From 57196874381f29706bc897ff06b311f5d9f49a55 Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Fri, 6 Dec 2024 09:34:29 -0800 Subject: [PATCH 01/68] Fix crash in lowering use of a global variable (#4631) Actually presenting two options in this one review - if you look at the specific commits in this PR, the first commit represents my first attempt - and if you look at the overall PR change for the second attempt. But I'm totally open to completely different approaches/ideas - these were just my rough guesses. --- toolchain/lower/function_context.h | 1 + toolchain/lower/handle.cpp | 9 +++- toolchain/lower/testdata/global/use.carbon | 55 ++++++++++++++++++++++ 3 files changed, 64 insertions(+), 1 deletion(-) create mode 100644 toolchain/lower/testdata/global/use.carbon diff --git a/toolchain/lower/function_context.h b/toolchain/lower/function_context.h index 3be64fba61a15..8a52b7743612b 100644 --- a/toolchain/lower/function_context.h +++ b/toolchain/lower/function_context.h @@ -57,6 +57,7 @@ class FunctionContext { if (auto result = file_context_->global_variables().Lookup(inst_id)) { return result.value(); } + return file_context_->GetGlobal(inst_id); } diff --git a/toolchain/lower/handle.cpp b/toolchain/lower/handle.cpp index 75fe1ecb0d59c..af764e95a915d 100644 --- a/toolchain/lower/handle.cpp +++ b/toolchain/lower/handle.cpp @@ -174,7 +174,14 @@ auto HandleInst(FunctionContext& context, SemIR::InstId inst_id, return; } - context.SetLocal(inst_id, context.GetValue(inst.value_id)); + auto inner_inst_id = inst.value_id; + + if (auto bind_name = + context.sem_ir().insts().TryGetAs(inner_inst_id)) { + inner_inst_id = bind_name->value_id; + } + + context.SetLocal(inst_id, context.GetValue(inner_inst_id)); } auto HandleInst(FunctionContext& /*context*/, SemIR::InstId /*inst_id*/, diff --git a/toolchain/lower/testdata/global/use.carbon b/toolchain/lower/testdata/global/use.carbon new file mode 100644 index 0000000000000..c372364f3373b --- /dev/null +++ b/toolchain/lower/testdata/global/use.carbon @@ -0,0 +1,55 @@ +// Part of the Carbon Language project, under the Apache License v2.0 with LLVM +// Exceptions. See /LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// AUTOUPDATE +// TIP: To test this file alone, run: +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/lower/testdata/global/use.carbon +// TIP: To dump output, run: +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/lower/testdata/global/use.carbon +var a: i32 = 5; + +var b: i32 = a; + +fn F() -> i32 { + return a; +} + +// CHECK:STDOUT: ; ModuleID = 'use.carbon' +// CHECK:STDOUT: source_filename = "use.carbon" +// CHECK:STDOUT: +// CHECK:STDOUT: @a = internal global i32 +// CHECK:STDOUT: @b = internal global i32 +// CHECK:STDOUT: @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @_C__global_init.Main, ptr null }] +// CHECK:STDOUT: +// CHECK:STDOUT: define i32 @_CF.Main() !dbg !4 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %.loc15 = load i32, ptr @a, align 4, !dbg !7 +// CHECK:STDOUT: ret i32 %.loc15, !dbg !8 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: define void @_C__global_init.Main() !dbg !9 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: store i32 5, ptr @a, align 4, !dbg !10 +// CHECK:STDOUT: %.loc12 = load i32, ptr @a, align 4, !dbg !11 +// CHECK:STDOUT: store i32 %.loc12, ptr @b, align 4, !dbg !12 +// CHECK:STDOUT: ret void, !dbg !13 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} +// CHECK:STDOUT: !llvm.dbg.cu = !{!2} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !3 = !DIFile(filename: "use.carbon", directory: "") +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !3, line: 14, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) +// CHECK:STDOUT: !6 = !{} +// CHECK:STDOUT: !7 = !DILocation(line: 15, column: 10, scope: !4) +// CHECK:STDOUT: !8 = !DILocation(line: 15, column: 3, scope: !4) +// CHECK:STDOUT: !9 = distinct !DISubprogram(name: "__global_init", linkageName: "_C__global_init.Main", scope: null, file: !3, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !10 = !DILocation(line: 10, column: 1, scope: !9) +// CHECK:STDOUT: !11 = !DILocation(line: 12, column: 14, scope: !9) +// CHECK:STDOUT: !12 = !DILocation(line: 12, column: 1, scope: !9) +// CHECK:STDOUT: !13 = !DILocation(line: 0, scope: !9) From a2c939a2a28cc8cd1c2af88395e21c91983e7d3e Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Fri, 6 Dec 2024 10:51:36 -0800 Subject: [PATCH 02/68] Add an instruction for vptr initialization (#4633) This fixes a crash in lowering, at least (though only initializes the vptr to null for now) - certainly open to naming feedback on the instruction, or the exact semantics (we could have a global vptr instruction that's referenced from the existing instructions for reading globals, for instance). I guess we'll want one type parameter for the vptr_init instruction, which is the type that this is a vptr for? (can do that here or in a follow-on patch) --- toolchain/check/convert.cpp | 14 ++++++- toolchain/check/eval.cpp | 1 + .../testdata/class/virtual_modifiers.carbon | 41 +++++++++++-------- toolchain/lower/handle.cpp | 9 ++++ toolchain/lower/testdata/class/virtual.carbon | 12 +++--- toolchain/sem_ir/file.cpp | 3 ++ toolchain/sem_ir/inst_kind.def | 1 + toolchain/sem_ir/stringify_type.cpp | 4 ++ toolchain/sem_ir/typed_insts.h | 7 ++++ 9 files changed, 69 insertions(+), 23 deletions(-) diff --git a/toolchain/check/convert.cpp b/toolchain/check/convert.cpp index c12ede807a10f..4ee4feac54681 100644 --- a/toolchain/check/convert.cpp +++ b/toolchain/check/convert.cpp @@ -461,8 +461,18 @@ static auto ConvertStructToStructOrClass(Context& context, dest_elem_fields.size()}); for (auto [i, dest_field] : llvm::enumerate(dest_elem_fields)) { if (dest_field.name_id == SemIR::NameId::Vptr) { - // TODO: Initialize the vptr to point to a vtable. - new_block.Set(i, SemIR::ErrorInst::SingletonInstId); + // CARBON_CHECK(ToClass, "Only classes should have vptrs."); + auto dest_id = context.AddInst( + value_loc_id, {.type_id = dest_field.type_id, + .base_id = target.init_id, + .index = SemIR::ElementIndex(i)}); + auto vtable_ptr_id = context.AddInst( + value_loc_id, {.type_id = dest_field.type_id}); + auto init_id = context.AddInst( + value_loc_id, {.type_id = dest_field.type_id, + .src_id = vtable_ptr_id, + .dest_id = dest_id}); + new_block.Set(i, init_id); continue; } diff --git a/toolchain/check/eval.cpp b/toolchain/check/eval.cpp index b1090d8602770..62be16f00ba08 100644 --- a/toolchain/check/eval.cpp +++ b/toolchain/check/eval.cpp @@ -1579,6 +1579,7 @@ static auto TryEvalInstInContext(EvalContext& eval_context, case SemIR::Temporary::Kind: case SemIR::TemporaryStorage::Kind: case SemIR::ValueAsRef::Kind: + case SemIR::VtablePtr::Kind: break; case CARBON_KIND(SemIR::SymbolicBindingPattern bind): { diff --git a/toolchain/check/testdata/class/virtual_modifiers.carbon b/toolchain/check/testdata/class/virtual_modifiers.carbon index 760b247e12293..a14381718ffab 100644 --- a/toolchain/check/testdata/class/virtual_modifiers.carbon +++ b/toolchain/check/testdata/class/virtual_modifiers.carbon @@ -297,8 +297,11 @@ class Derived { // CHECK:STDOUT: %v.var: ref %Base = var v // CHECK:STDOUT: %v: ref %Base = bind_name v, %v.var // CHECK:STDOUT: %.loc7_28.1: %empty_struct_type = struct_literal () -// CHECK:STDOUT: %.loc7_28.2: init %Base = class_init (), %v.var [template = ] -// CHECK:STDOUT: %.loc7_29: init %Base = converted %.loc7_28.1, %.loc7_28.2 [template = ] +// CHECK:STDOUT: %.loc7_28.2: ref %ptr.1 = class_element_access %v.var, element0 +// CHECK:STDOUT: %.loc7_28.3: ref %ptr.1 = vtable_ptr +// CHECK:STDOUT: %.loc7_28.4: init %ptr.1 = initialize_from %.loc7_28.3 to %.loc7_28.2 +// CHECK:STDOUT: %.loc7_28.5: init %Base = class_init (%.loc7_28.4), %v.var +// CHECK:STDOUT: %.loc7_29: init %Base = converted %.loc7_28.1, %.loc7_28.5 // CHECK:STDOUT: assign %v.var, %.loc7_29 // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -593,14 +596,17 @@ class Derived { // CHECK:STDOUT: %i.ref.loc14_25: ref %i32 = name_ref i, %i // CHECK:STDOUT: %i.ref.loc14_34: ref %i32 = name_ref i, %i // CHECK:STDOUT: %.loc14_35.1: %struct_type.m2.m1.1 = struct_literal (%i.ref.loc14_25, %i.ref.loc14_34) +// CHECK:STDOUT: %.loc14_35.2: ref %ptr.1 = class_element_access %b1.var, element0 +// CHECK:STDOUT: %.loc14_35.3: ref %ptr.1 = vtable_ptr +// CHECK:STDOUT: %.loc14_35.4: init %ptr.1 = initialize_from %.loc14_35.3 to %.loc14_35.2 // CHECK:STDOUT: %.loc14_34: %i32 = bind_value %i.ref.loc14_34 -// CHECK:STDOUT: %.loc14_35.2: ref %i32 = class_element_access %b1.var, element2 -// CHECK:STDOUT: %.loc14_35.3: init %i32 = initialize_from %.loc14_34 to %.loc14_35.2 +// CHECK:STDOUT: %.loc14_35.5: ref %i32 = class_element_access %b1.var, element2 +// CHECK:STDOUT: %.loc14_35.6: init %i32 = initialize_from %.loc14_34 to %.loc14_35.5 // CHECK:STDOUT: %.loc14_25: %i32 = bind_value %i.ref.loc14_25 -// CHECK:STDOUT: %.loc14_35.4: ref %i32 = class_element_access %b1.var, element1 -// CHECK:STDOUT: %.loc14_35.5: init %i32 = initialize_from %.loc14_25 to %.loc14_35.4 -// CHECK:STDOUT: %.loc14_35.6: init %Base = class_init (, %.loc14_35.3, %.loc14_35.5), %b1.var -// CHECK:STDOUT: %.loc14_36: init %Base = converted %.loc14_35.1, %.loc14_35.6 +// CHECK:STDOUT: %.loc14_35.7: ref %i32 = class_element_access %b1.var, element1 +// CHECK:STDOUT: %.loc14_35.8: init %i32 = initialize_from %.loc14_25 to %.loc14_35.7 +// CHECK:STDOUT: %.loc14_35.9: init %Base = class_init (%.loc14_35.4, %.loc14_35.6, %.loc14_35.8), %b1.var +// CHECK:STDOUT: %.loc14_36: init %Base = converted %.loc14_35.1, %.loc14_35.9 // CHECK:STDOUT: assign %b1.var, %.loc14_36 // CHECK:STDOUT: %Base.ref.loc15: type = name_ref Base, file.%Base.decl [template = constants.%Base] // CHECK:STDOUT: %b2.var: ref %Base = var b2 @@ -608,22 +614,25 @@ class Derived { // CHECK:STDOUT: %int_3.loc15: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] // CHECK:STDOUT: %int_5: Core.IntLiteral = int_value 5 [template = constants.%int_5.1] // CHECK:STDOUT: %.loc15_35.1: %struct_type.m2.m1.2 = struct_literal (%int_3.loc15, %int_5) +// CHECK:STDOUT: %.loc15_35.2: ref %ptr.1 = class_element_access %b2.var, element0 +// CHECK:STDOUT: %.loc15_35.3: ref %ptr.1 = vtable_ptr +// CHECK:STDOUT: %.loc15_35.4: init %ptr.1 = initialize_from %.loc15_35.3 to %.loc15_35.2 // CHECK:STDOUT: %impl.elem0.loc15_35.1: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] // CHECK:STDOUT: %Convert.bound.loc15_35.1: = bound_method %int_5, %impl.elem0.loc15_35.1 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc15_35.1: = specific_function %Convert.bound.loc15_35.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc15_35.1: init %i32 = call %Convert.specific_fn.loc15_35.1(%int_5) [template = constants.%int_5.2] -// CHECK:STDOUT: %.loc15_35.2: init %i32 = converted %int_5, %int.convert_checked.loc15_35.1 [template = constants.%int_5.2] -// CHECK:STDOUT: %.loc15_35.3: ref %i32 = class_element_access %b2.var, element2 -// CHECK:STDOUT: %.loc15_35.4: init %i32 = initialize_from %.loc15_35.2 to %.loc15_35.3 [template = constants.%int_5.2] +// CHECK:STDOUT: %.loc15_35.5: init %i32 = converted %int_5, %int.convert_checked.loc15_35.1 [template = constants.%int_5.2] +// CHECK:STDOUT: %.loc15_35.6: ref %i32 = class_element_access %b2.var, element2 +// CHECK:STDOUT: %.loc15_35.7: init %i32 = initialize_from %.loc15_35.5 to %.loc15_35.6 [template = constants.%int_5.2] // CHECK:STDOUT: %impl.elem0.loc15_35.2: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] // CHECK:STDOUT: %Convert.bound.loc15_35.2: = bound_method %int_3.loc15, %impl.elem0.loc15_35.2 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc15_35.2: = specific_function %Convert.bound.loc15_35.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc15_35.2: init %i32 = call %Convert.specific_fn.loc15_35.2(%int_3.loc15) [template = constants.%int_3.2] -// CHECK:STDOUT: %.loc15_35.5: init %i32 = converted %int_3.loc15, %int.convert_checked.loc15_35.2 [template = constants.%int_3.2] -// CHECK:STDOUT: %.loc15_35.6: ref %i32 = class_element_access %b2.var, element1 -// CHECK:STDOUT: %.loc15_35.7: init %i32 = initialize_from %.loc15_35.5 to %.loc15_35.6 [template = constants.%int_3.2] -// CHECK:STDOUT: %.loc15_35.8: init %Base = class_init (, %.loc15_35.4, %.loc15_35.7), %b2.var [template = ] -// CHECK:STDOUT: %.loc15_36: init %Base = converted %.loc15_35.1, %.loc15_35.8 [template = ] +// CHECK:STDOUT: %.loc15_35.8: init %i32 = converted %int_3.loc15, %int.convert_checked.loc15_35.2 [template = constants.%int_3.2] +// CHECK:STDOUT: %.loc15_35.9: ref %i32 = class_element_access %b2.var, element1 +// CHECK:STDOUT: %.loc15_35.10: init %i32 = initialize_from %.loc15_35.8 to %.loc15_35.9 [template = constants.%int_3.2] +// CHECK:STDOUT: %.loc15_35.11: init %Base = class_init (%.loc15_35.4, %.loc15_35.7, %.loc15_35.10), %b2.var +// CHECK:STDOUT: %.loc15_36: init %Base = converted %.loc15_35.1, %.loc15_35.11 // CHECK:STDOUT: assign %b2.var, %.loc15_36 // CHECK:STDOUT: %b1.ref: ref %Base = name_ref b1, %b1 // CHECK:STDOUT: %m2.ref: %Base.elem = name_ref m2, @Base.%.loc6_9 [template = @Base.%.loc6_9] diff --git a/toolchain/lower/handle.cpp b/toolchain/lower/handle.cpp index af764e95a915d..01d0431ea0507 100644 --- a/toolchain/lower/handle.cpp +++ b/toolchain/lower/handle.cpp @@ -253,4 +253,13 @@ auto HandleInst(FunctionContext& context, SemIR::InstId inst_id, /*ArraySize=*/nullptr)); } +auto HandleInst(FunctionContext& context, SemIR::InstId inst_id, + SemIR::VtablePtr /*inst*/) -> void { + // TODO: Initialize the virtual pointer to actually point to a virtual + // function table. + context.SetLocal(inst_id, + llvm::ConstantPointerNull::get( + llvm::PointerType::get(context.llvm_context(), 0))); +} + } // namespace Carbon::Lower diff --git a/toolchain/lower/testdata/class/virtual.carbon b/toolchain/lower/testdata/class/virtual.carbon index 68a8dfa6cab9d..a7b57135dd863 100644 --- a/toolchain/lower/testdata/class/virtual.carbon +++ b/toolchain/lower/testdata/class/virtual.carbon @@ -119,9 +119,11 @@ fn Fn() { // CHECK:STDOUT: %i.var = alloca i32, align 4, !dbg !7 // CHECK:STDOUT: store i32 3, ptr %i.var, align 4, !dbg !8 // CHECK:STDOUT: %v.var = alloca { ptr, i32 }, align 8, !dbg !9 -// CHECK:STDOUT: %.loc12_23 = load i32, ptr %i.var, align 4, !dbg !10 -// CHECK:STDOUT: %.loc12_24.2.m = getelementptr inbounds nuw { ptr, i32 }, ptr %v.var, i32 0, i32 1, !dbg !11 -// CHECK:STDOUT: store i32 %.loc12_23, ptr %.loc12_24.2.m, align 4, !dbg !11 +// CHECK:STDOUT: %.loc12_24.2.vptr = getelementptr inbounds nuw { ptr, i32 }, ptr %v.var, i32 0, i32 0, !dbg !10 +// CHECK:STDOUT: store ptr null, ptr %.loc12_24.2.vptr, align 8, !dbg !10 +// CHECK:STDOUT: %.loc12_23 = load i32, ptr %i.var, align 4, !dbg !11 +// CHECK:STDOUT: %.loc12_24.5.m = getelementptr inbounds nuw { ptr, i32 }, ptr %v.var, i32 0, i32 1, !dbg !10 +// CHECK:STDOUT: store i32 %.loc12_23, ptr %.loc12_24.5.m, align 4, !dbg !10 // CHECK:STDOUT: %.loc15_4.m = getelementptr inbounds nuw { ptr, i32 }, ptr %v.var, i32 0, i32 1, !dbg !12 // CHECK:STDOUT: store i32 5, ptr %.loc15_4.m, align 4, !dbg !12 // CHECK:STDOUT: ret void, !dbg !13 @@ -140,7 +142,7 @@ fn Fn() { // CHECK:STDOUT: !7 = !DILocation(line: 10, column: 7, scope: !4) // CHECK:STDOUT: !8 = !DILocation(line: 10, column: 3, scope: !4) // CHECK:STDOUT: !9 = !DILocation(line: 12, column: 7, scope: !4) -// CHECK:STDOUT: !10 = !DILocation(line: 12, column: 23, scope: !4) -// CHECK:STDOUT: !11 = !DILocation(line: 12, column: 17, scope: !4) +// CHECK:STDOUT: !10 = !DILocation(line: 12, column: 17, scope: !4) +// CHECK:STDOUT: !11 = !DILocation(line: 12, column: 23, scope: !4) // CHECK:STDOUT: !12 = !DILocation(line: 15, column: 3, scope: !4) // CHECK:STDOUT: !13 = !DILocation(line: 9, column: 1, scope: !4) diff --git a/toolchain/sem_ir/file.cpp b/toolchain/sem_ir/file.cpp index 948f247a9d2e2..297c00b8c95b6 100644 --- a/toolchain/sem_ir/file.cpp +++ b/toolchain/sem_ir/file.cpp @@ -311,6 +311,9 @@ auto GetExprCategory(const File& file, InstId inst_id) -> ExprCategory { continue; } + case VtablePtr::Kind: + return ExprCategory::EphemeralRef; + case CARBON_KIND(ClassElementAccess inst): { inst_id = inst.base_id; // A value of class type is a pointer to an object representation. diff --git a/toolchain/sem_ir/inst_kind.def b/toolchain/sem_ir/inst_kind.def index a17b50e443f50..4e5603a20aa0b 100644 --- a/toolchain/sem_ir/inst_kind.def +++ b/toolchain/sem_ir/inst_kind.def @@ -118,6 +118,7 @@ CARBON_SEM_IR_INST_KIND(ValueParam) CARBON_SEM_IR_INST_KIND(ValueParamPattern) CARBON_SEM_IR_INST_KIND(VarStorage) CARBON_SEM_IR_INST_KIND(VtableType) +CARBON_SEM_IR_INST_KIND(VtablePtr) CARBON_SEM_IR_INST_KIND(WhereExpr) CARBON_SEM_IR_INST_KIND(WitnessType) diff --git a/toolchain/sem_ir/stringify_type.cpp b/toolchain/sem_ir/stringify_type.cpp index 29cfefe69e9fe..3993a18aef45a 100644 --- a/toolchain/sem_ir/stringify_type.cpp +++ b/toolchain/sem_ir/stringify_type.cpp @@ -424,6 +424,10 @@ auto StringifyTypeExpr(const SemIR::File& sem_ir, InstId outer_inst_id) step_stack.PushTypeId(inst.class_type_id); break; } + case VtablePtr::Kind: { + out << ""; + break; + } case AdaptDecl::Kind: case AddrOf::Kind: case AddrPattern::Kind: diff --git a/toolchain/sem_ir/typed_insts.h b/toolchain/sem_ir/typed_insts.h index fd5e433930834..50a83b2d5a517 100644 --- a/toolchain/sem_ir/typed_insts.h +++ b/toolchain/sem_ir/typed_insts.h @@ -1463,6 +1463,13 @@ struct VtableType { TypeId type_id; }; +// Initializer for virtual function table pointers in object initialization. +struct VtablePtr { + static constexpr auto Kind = + InstKind::VtablePtr.Define({.ir_name = "vtable_ptr"}); + TypeId type_id; +}; + // An `expr where requirements` expression. struct WhereExpr { static constexpr auto Kind = InstKind::WhereExpr.Define( From e7a86b03c6b8bcd4d34d7bc139265366f31cd84f Mon Sep 17 00:00:00 2001 From: Jon Ross-Perkins Date: Fri, 6 Dec 2024 13:17:24 -0800 Subject: [PATCH 03/68] Remove offsets from InstId formatting, trying to name more (#4645) The offsets were originally added to deal with churn from builtins in the raw semir. In textual semir, we mostly see instruction IDs for imports, and builtins have also settled down more. On imports, where possible, use the `EntityNameId` for an import instead of printing an instruction. Next, show the source location if we have a node. Only show the instruction if there's no location. This also exposes `Parse::Tree` and `TokenizedBuffer`, so that we can pass a `SemIR::File` without the component parts. In particular this allows us to get the `TokenizedBuffer` for import IRs without substantial structural modifications. We may want to make these optional for serialized `SemIR` later, but the nodes/tokens contain source location, which we'd need for debug information -- so it's not clear how much we can really make them optional without substantial information loss. Reduce arguments to just `File` in a few spots, as a result of the accompanying `TokenizedBuffer` and `Parse::Tree`. Also updates style to pass around `const File*` where the reference is maintained, instead of `const File&`. I was considering keeping a direct reference to the tree and tokens on `Context`, but initially my thought was it wouldn't make much difference. I can re-add those if desired, just as direct caching of the `File` fields. --- toolchain/check/check.cpp | 30 +- toolchain/check/check.h | 2 - toolchain/check/context.cpp | 23 +- toolchain/check/context.h | 19 +- .../alias/no_prelude/export_name.carbon | 32 +- .../testdata/alias/no_prelude/import.carbon | 26 +- .../alias/no_prelude/import_access.carbon | 10 +- .../alias/no_prelude/import_order.carbon | 16 +- toolchain/check/testdata/as/overloaded.carbon | 2 +- .../testdata/basics/builtin_insts.carbon | 8 +- .../multifile_raw_and_textual_ir.carbon | 128 ++-- .../basics/no_prelude/multifile_raw_ir.carbon | 126 ++-- .../no_prelude/raw_and_textual_ir.carbon | 212 +++--- .../testdata/basics/no_prelude/raw_ir.carbon | 262 ++++---- .../testdata/basics/no_prelude/verbose.carbon | 2 +- .../testdata/builtins/bool/make_type.carbon | 2 +- .../testdata/builtins/float/make_type.carbon | 4 +- .../builtins/int/convert_checked.carbon | 630 +++++++++--------- .../builtins/int/make_type_signed.carbon | 26 +- .../builtins/int/make_type_unsigned.carbon | 16 +- .../builtins/int_literal/make_type.carbon | 2 +- .../check/testdata/builtins/print.carbon | 2 +- .../class/adapter/extend_adapt.carbon | 2 +- .../class/cross_package_import.carbon | 20 +- .../testdata/class/fail_import_misuses.carbon | 8 +- .../check/testdata/class/generic/adapt.carbon | 40 +- .../class/generic/base_is_generic.carbon | 48 +- .../testdata/class/generic/import.carbon | 44 +- toolchain/check/testdata/class/import.carbon | 36 +- .../check/testdata/class/import_base.carbon | 24 +- .../testdata/class/import_indirect.carbon | 68 +- .../testdata/class/import_member_cycle.carbon | 8 +- .../testdata/class/import_struct_cyle.carbon | 10 +- .../class/no_prelude/export_name.carbon | 12 +- .../testdata/class/no_prelude/extern.carbon | 18 +- .../class/no_prelude/implicit_import.carbon | 14 +- .../class/no_prelude/import_access.carbon | 14 +- .../no_prelude/indirect_import_member.carbon | 74 +- .../no_definition_in_impl_file.carbon | 4 +- .../class/no_prelude/syntactic_merge.carbon | 14 +- .../testdata/class/virtual_modifiers.carbon | 16 +- toolchain/check/testdata/const/import.carbon | 6 +- .../check/testdata/deduce/int_float.carbon | 8 +- .../no_prelude/call_from_operator.carbon | 46 +- .../function/builtin/no_prelude/import.carbon | 6 +- .../function/declaration/import.carbon | 60 +- .../declaration/no_prelude/export_name.carbon | 4 +- .../declaration/no_prelude/extern.carbon | 2 +- .../no_prelude/extern_library.carbon | 2 +- .../fail_import_incomplete_return.carbon | 18 +- .../no_definition_in_impl_file.carbon | 4 +- .../function/definition/import.carbon | 18 +- .../function/definition/import_access.carbon | 6 +- .../no_prelude/extern_library.carbon | 2 +- .../no_prelude/implicit_import.carbon | 4 +- .../no_prelude/syntactic_merge.carbon | 14 +- .../generic/no_prelude/import_specific.carbon | 4 +- .../function/generic/resolve_used.carbon | 4 +- .../if_expr/fail_not_in_function.carbon | 6 +- .../testdata/impl/fail_redefinition.carbon | 2 +- .../impl/lookup/no_prelude/import.carbon | 260 ++++---- .../lookup/no_prelude/specific_args.carbon | 104 +-- .../testdata/impl/lookup/transitive.carbon | 34 +- .../impl/no_prelude/fail_alias.carbon | 2 +- .../no_prelude/generic_redeclaration.carbon | 2 +- .../impl/no_prelude/import_extend_impl.carbon | 22 +- .../impl/no_prelude/import_generic.carbon | 40 +- .../impl/no_prelude/import_self.carbon | 8 +- .../impl/no_prelude/import_use_generic.carbon | 20 +- .../impl/no_prelude/interface_args.carbon | 132 ++-- .../no_definition_in_impl_file.carbon | 26 +- .../interface/no_prelude/export_name.carbon | 8 +- .../fail_assoc_const_not_binding.carbon | 2 +- .../fail_assoc_const_template.carbon | 2 +- .../fail_definition_imported.carbon | 2 +- .../no_prelude/generic_import.carbon | 10 +- .../interface/no_prelude/import.carbon | 30 +- .../interface/no_prelude/import_access.carbon | 8 +- .../no_prelude/import_interface_decl.carbon | 6 +- .../no_prelude/syntactic_merge.carbon | 20 +- .../testdata/let/fail_generic_import.carbon | 2 +- .../check/testdata/let/generic_import.carbon | 2 +- .../testdata/let/no_prelude/import.carbon | 4 +- .../let/no_prelude/import_access.carbon | 2 +- .../testdata/namespace/add_to_import.carbon | 2 +- .../fail_conflict_after_merge.carbon | 2 +- ...l_conflict_imported_namespace_first.carbon | 2 +- ..._conflict_imported_namespace_nested.carbon | 2 +- ..._conflict_imported_namespace_second.carbon | 2 +- ...conflict_in_imports_namespace_first.carbon | 2 +- ...onflict_in_imports_namespace_second.carbon | 2 +- .../check/testdata/namespace/imported.carbon | 8 +- .../namespace/imported_indirect.carbon | 14 +- .../check/testdata/namespace/merging.carbon | 8 +- .../merging_with_indirections.carbon | 18 +- .../fail_and_or_not_in_function.carbon | 4 +- .../testdata/operators/overloaded/add.carbon | 4 +- .../operators/overloaded/bit_and.carbon | 4 +- .../overloaded/bit_complement.carbon | 2 +- .../operators/overloaded/bit_or.carbon | 4 +- .../operators/overloaded/bit_xor.carbon | 4 +- .../testdata/operators/overloaded/dec.carbon | 2 +- .../testdata/operators/overloaded/div.carbon | 4 +- .../testdata/operators/overloaded/eq.carbon | 4 +- .../overloaded/fail_assign_non_ref.carbon | 4 +- .../overloaded/fail_no_impl_for_arg.carbon | 4 +- .../operators/overloaded/implicit_as.carbon | 2 +- .../testdata/operators/overloaded/inc.carbon | 2 +- .../operators/overloaded/index.carbon | 6 +- .../operators/overloaded/left_shift.carbon | 4 +- .../testdata/operators/overloaded/mod.carbon | 4 +- .../testdata/operators/overloaded/mul.carbon | 4 +- .../operators/overloaded/negate.carbon | 2 +- .../operators/overloaded/ordered.carbon | 2 +- .../operators/overloaded/right_shift.carbon | 4 +- .../testdata/operators/overloaded/sub.carbon | 4 +- .../fail_conflict_no_namespaces.carbon | 2 +- .../packages/fail_import_type_error.carbon | 8 +- .../packages/implicit_imports_prelude.carbon | 2 +- .../testdata/packages/loaded_global.carbon | 4 +- .../no_prelude/cross_package_export.carbon | 96 +-- .../no_prelude/cross_package_import.carbon | 12 +- .../packages/no_prelude/export_import.carbon | 100 +-- .../packages/no_prelude/export_mixed.carbon | 76 +-- .../packages/no_prelude/export_name.carbon | 172 ++--- .../no_prelude/fail_export_name_member.carbon | 8 +- .../no_prelude/fail_export_name_params.carbon | 4 +- .../implicit_imports_entities.carbon | 52 +- .../packages/unused_lazy_import.carbon | 2 +- .../check/testdata/pointer/import.carbon | 4 +- .../no_prelude/import_convert_function.carbon | 96 +-- toolchain/check/testdata/struct/import.carbon | 40 +- toolchain/check/testdata/tuple/import.carbon | 40 +- .../var/no_prelude/export_name.carbon | 4 +- .../testdata/var/no_prelude/import.carbon | 2 +- .../var/no_prelude/import_access.carbon | 2 +- .../testdata/where_expr/constraints.carbon | 12 +- .../testdata/where_expr/equal_rewrite.carbon | 24 +- toolchain/driver/compile_subcommand.cpp | 11 +- toolchain/parse/tree.h | 2 + toolchain/sem_ir/file.cpp | 5 +- toolchain/sem_ir/file.h | 6 +- toolchain/sem_ir/formatter.cpp | 191 +++--- toolchain/sem_ir/formatter.h | 5 +- toolchain/sem_ir/ids.cpp | 13 +- toolchain/sem_ir/inst_namer.cpp | 176 ++--- toolchain/sem_ir/inst_namer.h | 15 +- toolchain/sem_ir/yaml_test.cpp | 4 +- 148 files changed, 2171 insertions(+), 2173 deletions(-) diff --git a/toolchain/check/check.cpp b/toolchain/check/check.cpp index cb16794798f73..73a4cc9bec9cc 100644 --- a/toolchain/check/check.cpp +++ b/toolchain/check/check.cpp @@ -63,6 +63,11 @@ struct UnitInfo { err_tracker(*unit.consumer), emitter(*unit.node_converter, err_tracker) {} + auto parse_tree() -> const Parse::Tree& { return unit->sem_ir->parse_tree(); } + auto source() -> const SourceBuffer& { + return parse_tree().tokens().source(); + } + SemIR::CheckIRId check_ir_id; Unit* unit; @@ -485,11 +490,10 @@ static auto CheckParseTree(UnitInfo& unit_info, int total_ir_count, // We can safely mark this as checked at the start. unit_info.is_checked = true; - SemIR::File& sem_ir = *unit_info.unit->sem_ir; + SemIR::File* sem_ir = unit_info.unit->sem_ir; Context::DiagnosticEmitter emitter(*unit_info.unit->sem_ir_converter, unit_info.err_tracker); - Context context(*unit_info.unit->tokens, emitter, *unit_info.unit->parse_tree, - unit_info.unit->get_parse_tree_and_subtrees, sem_ir, + Context context(&emitter, unit_info.unit->get_parse_tree_and_subtrees, sem_ir, vlog_stream); PrettyStackTraceFunction context_dumper( [&](llvm::raw_ostream& output) { context.PrintForStackDump(output); }); @@ -515,11 +519,11 @@ static auto CheckParseTree(UnitInfo& unit_info, int total_ir_count, context.VerifyOnFinish(); - sem_ir.set_has_errors(unit_info.err_tracker.seen_error()); + sem_ir->set_has_errors(unit_info.err_tracker.seen_error()); #ifndef NDEBUG - if (auto verify = sem_ir.Verify(); !verify.ok()) { - CARBON_FATAL("{0}Built invalid semantics IR: {1}\n", sem_ir, + if (auto verify = sem_ir->Verify(); !verify.ok()) { + CARBON_FATAL("{0}Built invalid semantics IR: {1}\n", *sem_ir, verify.error()); } #endif @@ -566,7 +570,7 @@ static auto TrackImport(Map& api_map, Map* explicit_import_map, UnitInfo& unit_info, Parse::Tree::PackagingNames import) -> void { - const auto& packaging = unit_info.unit->parse_tree->packaging_decl(); + const auto& packaging = unit_info.parse_tree().packaging_decl(); IdentifierId file_package_id = packaging ? packaging->names.package_id : IdentifierId::Invalid; @@ -712,7 +716,7 @@ static auto BuildApiMapAndDiagnosePackaging( llvm::MutableArrayRef unit_infos) -> Map { Map api_map; for (auto& unit_info : unit_infos) { - const auto& packaging = unit_info.unit->parse_tree->packaging_decl(); + const auto& packaging = unit_info.parse_tree().packaging_decl(); // An import key formed from the `package` or `library` declaration. Or, for // Main//default, a placeholder key. auto import_key = packaging ? GetImportKey(unit_info, IdentifierId::Invalid, @@ -749,7 +753,7 @@ static auto BuildApiMapAndDiagnosePackaging( auto insert_result = api_map.Insert(import_key, &unit_info); if (!insert_result.is_inserted()) { llvm::StringRef prev_filename = - insert_result.value()->unit->tokens->source().filename(); + insert_result.value()->source().filename(); if (packaging) { CARBON_DIAGNOSTIC(DuplicateLibraryApi, Error, "library's API previously provided by `{0}`", @@ -770,8 +774,8 @@ static auto BuildApiMapAndDiagnosePackaging( // Validate file extensions. Note imports rely the packaging declaration, // not the extension. If the input is not a regular file, for example // because it is stdin, no filename checking is performed. - if (unit_info.unit->tokens->source().is_regular_file()) { - auto filename = unit_info.unit->tokens->source().filename(); + if (unit_info.source().is_regular_file()) { + auto filename = unit_info.source().filename(); static constexpr llvm::StringLiteral ApiExt = ".carbon"; static constexpr llvm::StringLiteral ImplExt = ".impl.carbon"; bool is_api_with_impl_ext = !is_impl && filename.ends_with(ImplExt); @@ -814,7 +818,7 @@ auto CheckParseTrees(llvm::MutableArrayRef units, bool prelude_import, llvm::SmallVector ready_to_check; ready_to_check.reserve(units.size()); for (auto& unit_info : unit_infos) { - const auto& packaging = unit_info.unit->parse_tree->packaging_decl(); + const auto& packaging = unit_info.parse_tree().packaging_decl(); if (packaging && packaging->is_impl) { // An `impl` has an implicit import of its `api`. auto implicit_names = packaging->names; @@ -838,7 +842,7 @@ auto CheckParseTrees(llvm::MutableArrayRef units, bool prelude_import, .library_id = prelude_id}); } - for (const auto& import : unit_info.unit->parse_tree->imports()) { + for (const auto& import : unit_info.parse_tree().imports()) { TrackImport(api_map, &explicit_import_map, unit_info, import); } diff --git a/toolchain/check/check.h b/toolchain/check/check.h index 51784f9b4b772..fdce0495f913a 100644 --- a/toolchain/check/check.h +++ b/toolchain/check/check.h @@ -23,8 +23,6 @@ struct Unit { SharedValueStores* value_stores; // The `timings` may be null if nothing is to be recorded. Timings* timings; - const Lex::TokenizedBuffer* tokens; - const Parse::Tree* parse_tree; // Returns a lazily constructed TreeAndSubtrees. llvm::function_ref diff --git a/toolchain/check/context.cpp b/toolchain/check/context.cpp index e19c826d8c251..af4767ff6ffb6 100644 --- a/toolchain/check/context.cpp +++ b/toolchain/check/context.cpp @@ -38,22 +38,19 @@ namespace Carbon::Check { -Context::Context(const Lex::TokenizedBuffer& tokens, DiagnosticEmitter& emitter, - const Parse::Tree& parse_tree, +Context::Context(DiagnosticEmitter* emitter, llvm::function_ref get_parse_tree_and_subtrees, - SemIR::File& sem_ir, llvm::raw_ostream* vlog_stream) - : tokens_(&tokens), - emitter_(&emitter), - parse_tree_(&parse_tree), + SemIR::File* sem_ir, llvm::raw_ostream* vlog_stream) + : emitter_(emitter), get_parse_tree_and_subtrees_(get_parse_tree_and_subtrees), - sem_ir_(&sem_ir), + sem_ir_(sem_ir), vlog_stream_(vlog_stream), - node_stack_(parse_tree, vlog_stream), - inst_block_stack_("inst_block_stack_", sem_ir, vlog_stream), - pattern_block_stack_("pattern_block_stack_", sem_ir, vlog_stream), - param_and_arg_refs_stack_(sem_ir, vlog_stream, node_stack_), - args_type_info_stack_("args_type_info_stack_", sem_ir, vlog_stream), + node_stack_(sem_ir->parse_tree(), vlog_stream), + inst_block_stack_("inst_block_stack_", *sem_ir, vlog_stream), + pattern_block_stack_("pattern_block_stack_", *sem_ir, vlog_stream), + param_and_arg_refs_stack_(*sem_ir, vlog_stream, node_stack_), + args_type_info_stack_("args_type_info_stack_", *sem_ir, vlog_stream), decl_name_stack_(this), scope_stack_(sem_ir_->identifiers()), global_init_(this) { @@ -1415,7 +1412,7 @@ auto Context::PrintForStackDump(llvm::raw_ostream& output) const -> void { } auto Context::DumpFormattedFile() const -> void { - SemIR::Formatter formatter(*tokens_, *parse_tree_, *sem_ir_); + SemIR::Formatter formatter(sem_ir_); formatter.Print(llvm::errs()); } diff --git a/toolchain/check/context.h b/toolchain/check/context.h index f1f74d2389fe4..b685a2a7c131b 100644 --- a/toolchain/check/context.h +++ b/toolchain/check/context.h @@ -69,11 +69,10 @@ class Context { llvm::function_refContext::DiagnosticBuilder>; // Stores references for work. - explicit Context(const Lex::TokenizedBuffer& tokens, - DiagnosticEmitter& emitter, const Parse::Tree& parse_tree, + explicit Context(DiagnosticEmitter* emitter, llvm::function_ref get_parse_tree_and_subtrees, - SemIR::File& sem_ir, llvm::raw_ostream* vlog_stream); + SemIR::File* sem_ir, llvm::raw_ostream* vlog_stream); // Marks an implementation TODO. Always returns false. auto TODO(SemIRLoc loc, std::string label) -> bool; @@ -456,18 +455,18 @@ class Context { return tokens().GetKind(parse_tree().node_token(node_id)); } - auto tokens() -> const Lex::TokenizedBuffer& { return *tokens_; } - auto emitter() -> DiagnosticEmitter& { return *emitter_; } - auto parse_tree() -> const Parse::Tree& { return *parse_tree_; } - auto parse_tree_and_subtrees() -> const Parse::TreeAndSubtrees& { return get_parse_tree_and_subtrees_(); } auto sem_ir() -> SemIR::File& { return *sem_ir_; } + auto parse_tree() -> const Parse::Tree& { return sem_ir_->parse_tree(); } + + auto tokens() -> const Lex::TokenizedBuffer& { return parse_tree().tokens(); } + auto node_stack() -> NodeStack& { return node_stack_; } auto inst_block_stack() -> InstBlockStack& { return inst_block_stack_; } @@ -607,15 +606,9 @@ class Context { // any applicable instruction lists. auto FinishInst(SemIR::InstId inst_id, SemIR::Inst inst) -> void; - // Tokens for getting data on literals. - const Lex::TokenizedBuffer* tokens_; - // Handles diagnostics. DiagnosticEmitter* emitter_; - // The file's parse tree. - const Parse::Tree* parse_tree_; - // Returns a lazily constructed TreeAndSubtrees. llvm::function_ref get_parse_tree_and_subtrees_; diff --git a/toolchain/check/testdata/alias/no_prelude/export_name.carbon b/toolchain/check/testdata/alias/no_prelude/export_name.carbon index 034e6acb884a4..1aa43c0dd8a6d 100644 --- a/toolchain/check/testdata/alias/no_prelude/export_name.carbon +++ b/toolchain/check/testdata/alias/no_prelude/export_name.carbon @@ -103,10 +103,10 @@ var d: D* = &c; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1 = import_ref Main//base, inst+1, unloaded -// CHECK:STDOUT: %import_ref.2: type = import_ref Main//base, inst+7, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.3: = import_ref Main//base, inst+4, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.4 = import_ref Main//base, inst+2, unloaded +// CHECK:STDOUT: %import_ref.1 = import_ref Main//base, C, unloaded +// CHECK:STDOUT: %import_ref.2: type = import_ref Main//base, D, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.3: = import_ref Main//base, loc4_10, loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.4 = import_ref Main//base, inst14 [no loc], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -133,10 +133,10 @@ var d: D* = &c; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Main//base, inst+1, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2 = import_ref Main//base, inst+7, unloaded -// CHECK:STDOUT: %import_ref.3: = import_ref Main//base, inst+4, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.4 = import_ref Main//base, inst+2, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Main//base, C, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2 = import_ref Main//base, D, unloaded +// CHECK:STDOUT: %import_ref.3: = import_ref Main//base, loc4_10, loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.4 = import_ref Main//base, inst14 [no loc], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -164,9 +164,9 @@ var d: D* = &c; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Main//export, inst+10, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2: = import_ref Main//export, inst+8, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.3 = import_ref Main//export, inst+9, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Main//export, D, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2: = import_ref Main//export, inst20 [indirect], loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.3 = import_ref Main//export, inst21 [indirect], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -202,7 +202,7 @@ var d: D* = &c; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref = import_ref Main//export, inst+10, unloaded +// CHECK:STDOUT: %import_ref = import_ref Main//export, D, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -234,10 +234,10 @@ var d: D* = &c; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Main//export, inst+10, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2: type = import_ref Main//export_orig, inst+10, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.3: = import_ref Main//export_orig, inst+8, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.4 = import_ref Main//export_orig, inst+9, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Main//export, D, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2: type = import_ref Main//export_orig, C, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.3: = import_ref Main//export_orig, inst20 [indirect], loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.4 = import_ref Main//export_orig, inst21 [indirect], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/alias/no_prelude/import.carbon b/toolchain/check/testdata/alias/no_prelude/import.carbon index 6841bb8562284..d0cba099d79c4 100644 --- a/toolchain/check/testdata/alias/no_prelude/import.carbon +++ b/toolchain/check/testdata/alias/no_prelude/import.carbon @@ -108,11 +108,11 @@ var c: () = a_alias_alias; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1 = import_ref Main//class1, inst+1, unloaded -// CHECK:STDOUT: %import_ref.2: type = import_ref Main//class1, inst+7, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.3 = import_ref Main//class1, inst+12, unloaded -// CHECK:STDOUT: %import_ref.4: = import_ref Main//class1, inst+4, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.5 = import_ref Main//class1, inst+2, unloaded +// CHECK:STDOUT: %import_ref.1 = import_ref Main//class1, C, unloaded +// CHECK:STDOUT: %import_ref.2: type = import_ref Main//class1, c_alias, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.3 = import_ref Main//class1, a, unloaded +// CHECK:STDOUT: %import_ref.4: = import_ref Main//class1, loc4_10, loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.5 = import_ref Main//class1, inst14 [no loc], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -148,10 +148,10 @@ var c: () = a_alias_alias; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Main//class2, inst+12, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2 = import_ref Main//class2, inst+17, unloaded -// CHECK:STDOUT: %import_ref.3: = import_ref Main//class2, inst+9, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.4 = import_ref Main//class2, inst+10, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Main//class2, c_alias_alias, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2 = import_ref Main//class2, b, unloaded +// CHECK:STDOUT: %import_ref.3: = import_ref Main//class2, inst21 [indirect], loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.4 = import_ref Main//class2, inst22 [indirect], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -210,8 +210,8 @@ var c: () = a_alias_alias; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1 = import_ref Main//var1, inst+5, unloaded -// CHECK:STDOUT: %import_ref.2: ref %empty_tuple.type = import_ref Main//var1, inst+12, loaded +// CHECK:STDOUT: %import_ref.1 = import_ref Main//var1, a, unloaded +// CHECK:STDOUT: %import_ref.2: ref %empty_tuple.type = import_ref Main//var1, a_alias, loaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -247,8 +247,8 @@ var c: () = a_alias_alias; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: ref %empty_tuple.type = import_ref Main//var2, inst+6, loaded [template = ] -// CHECK:STDOUT: %import_ref.2 = import_ref Main//var2, inst+10, unloaded +// CHECK:STDOUT: %import_ref.1: ref %empty_tuple.type = import_ref Main//var2, a_alias_alias, loaded [template = ] +// CHECK:STDOUT: %import_ref.2 = import_ref Main//var2, b, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/alias/no_prelude/import_access.carbon b/toolchain/check/testdata/alias/no_prelude/import_access.carbon index 4654be49a05de..efe172fffc240 100644 --- a/toolchain/check/testdata/alias/no_prelude/import_access.carbon +++ b/toolchain/check/testdata/alias/no_prelude/import_access.carbon @@ -88,10 +88,10 @@ var inst: Test.A = {}; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1 = import_ref Test//def, inst+1, unloaded -// CHECK:STDOUT: %import_ref.2: type = import_ref Test//def, inst+7, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.3: = import_ref Test//def, inst+4, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.4 = import_ref Test//def, inst+2, unloaded +// CHECK:STDOUT: %import_ref.1 = import_ref Test//def, C, unloaded +// CHECK:STDOUT: %import_ref.2: type = import_ref Test//def, A, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.3: = import_ref Test//def, loc4_10, loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.4 = import_ref Test//def, inst14 [no loc], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -129,7 +129,7 @@ var inst: Test.A = {}; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref = import_ref Test//def, inst+1, unloaded +// CHECK:STDOUT: %import_ref = import_ref Test//def, C, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/alias/no_prelude/import_order.carbon b/toolchain/check/testdata/alias/no_prelude/import_order.carbon index ea195f859b7c5..7eb7f93a8e258 100644 --- a/toolchain/check/testdata/alias/no_prelude/import_order.carbon +++ b/toolchain/check/testdata/alias/no_prelude/import_order.carbon @@ -84,14 +84,14 @@ var a_val: a = {.v = b_val.v}; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1 = import_ref Main//a, inst+1, unloaded -// CHECK:STDOUT: %import_ref.2: type = import_ref Main//a, inst+12, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.3: type = import_ref Main//a, inst+14, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.4: type = import_ref Main//a, inst+16, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.5: type = import_ref Main//a, inst+18, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.6: = import_ref Main//a, inst+9, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.7 = import_ref Main//a, inst+2, unloaded -// CHECK:STDOUT: %import_ref.8: %C.elem = import_ref Main//a, inst+7, loaded [template = %.1] +// CHECK:STDOUT: %import_ref.1 = import_ref Main//a, C, unloaded +// CHECK:STDOUT: %import_ref.2: type = import_ref Main//a, a, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.3: type = import_ref Main//a, b, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.4: type = import_ref Main//a, c, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.5: type = import_ref Main//a, d, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.6: = import_ref Main//a, loc4_22, loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.7 = import_ref Main//a, inst14 [no loc], unloaded +// CHECK:STDOUT: %import_ref.8: %C.elem = import_ref Main//a, loc4_16, loaded [template = %.1] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/as/overloaded.carbon b/toolchain/check/testdata/as/overloaded.carbon index 2520accd4c8fb..d5b01468e613e 100644 --- a/toolchain/check/testdata/as/overloaded.carbon +++ b/toolchain/check/testdata/as/overloaded.carbon @@ -62,7 +62,7 @@ let n: i32 = ((4 as i32) as X) as i32; // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.2: %As.type.1 = import_ref Core//prelude/operators/as, inst+13, loaded [template = constants.%As.generic] +// CHECK:STDOUT: %import_ref.2: %As.type.1 = import_ref Core//prelude/operators/as, As, loaded [template = constants.%As.generic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/basics/builtin_insts.carbon b/toolchain/check/testdata/basics/builtin_insts.carbon index b5f06aabf75e7..f2a2271b1fe00 100644 --- a/toolchain/check/testdata/basics/builtin_insts.carbon +++ b/toolchain/check/testdata/basics/builtin_insts.carbon @@ -17,7 +17,7 @@ // CHECK:STDOUT: ir0: {decl_id: inst, is_export: false} // CHECK:STDOUT: import_ir_insts: {} // CHECK:STDOUT: name_scopes: -// CHECK:STDOUT: name_scope0: {inst: inst+0, parent_scope: name_scope, has_error: false, extended_scopes: [], names: {}} +// CHECK:STDOUT: name_scope0: {inst: inst12, parent_scope: name_scope, has_error: false, extended_scopes: [], names: {}} // CHECK:STDOUT: entity_names: {} // CHECK:STDOUT: functions: {} // CHECK:STDOUT: classes: {} @@ -44,7 +44,7 @@ // CHECK:STDOUT: 'inst(StringType)': {kind: StringType, type: type(TypeType)} // CHECK:STDOUT: 'inst(VtableType)': {kind: VtableType, type: type(TypeType)} // CHECK:STDOUT: 'inst(WitnessType)': {kind: WitnessType, type: type(TypeType)} -// CHECK:STDOUT: 'inst+0': {kind: Namespace, arg0: name_scope0, arg1: inst, type: type(inst(NamespaceType))} +// CHECK:STDOUT: inst12: {kind: Namespace, arg0: name_scope0, arg1: inst, type: type(inst(NamespaceType))} // CHECK:STDOUT: constant_values: // CHECK:STDOUT: 'inst(TypeType)': template_constant(inst(TypeType)) // CHECK:STDOUT: 'inst(AutoType)': template_constant(inst(AutoType)) @@ -58,7 +58,7 @@ // CHECK:STDOUT: 'inst(StringType)': template_constant(inst(StringType)) // CHECK:STDOUT: 'inst(VtableType)': template_constant(inst(VtableType)) // CHECK:STDOUT: 'inst(WitnessType)': template_constant(inst(WitnessType)) -// CHECK:STDOUT: 'inst+0': template_constant(inst+0) +// CHECK:STDOUT: inst12: template_constant(inst12) // CHECK:STDOUT: symbolic_constants: {} // CHECK:STDOUT: inst_blocks: // CHECK:STDOUT: inst_block_empty: {} @@ -66,5 +66,5 @@ // CHECK:STDOUT: import_refs: {} // CHECK:STDOUT: global_init: {} // CHECK:STDOUT: inst_block4: -// CHECK:STDOUT: 0: inst+0 +// CHECK:STDOUT: 0: inst12 // CHECK:STDOUT: ... diff --git a/toolchain/check/testdata/basics/no_prelude/multifile_raw_and_textual_ir.carbon b/toolchain/check/testdata/basics/no_prelude/multifile_raw_and_textual_ir.carbon index d372821a634aa..85ad0be50c147 100644 --- a/toolchain/check/testdata/basics/no_prelude/multifile_raw_and_textual_ir.carbon +++ b/toolchain/check/testdata/basics/no_prelude/multifile_raw_and_textual_ir.carbon @@ -33,7 +33,7 @@ fn B() { // CHECK:STDOUT: ir0: {decl_id: inst, is_export: false} // CHECK:STDOUT: import_ir_insts: {} // CHECK:STDOUT: name_scopes: -// CHECK:STDOUT: name_scope0: {inst: inst+0, parent_scope: name_scope, has_error: false, extended_scopes: [], names: {name0: inst+1}} +// CHECK:STDOUT: name_scope0: {inst: inst12, parent_scope: name_scope, has_error: false, extended_scopes: [], names: {name0: inst13}} // CHECK:STDOUT: entity_names: {} // CHECK:STDOUT: functions: // CHECK:STDOUT: function0: {name: name0, parent_scope: name_scope0, body: [inst_block4]} @@ -46,35 +46,35 @@ fn B() { // CHECK:STDOUT: 'type(TypeType)': {kind: copy, type: type(TypeType)} // CHECK:STDOUT: 'type(Error)': {kind: copy, type: type(Error)} // CHECK:STDOUT: 'type(inst(NamespaceType))': {kind: copy, type: type(inst(NamespaceType))} -// CHECK:STDOUT: 'type(inst+2)': {kind: none, type: type(inst+3)} -// CHECK:STDOUT: 'type(inst+3)': {kind: none, type: type(inst+3)} +// CHECK:STDOUT: 'type(inst14)': {kind: none, type: type(inst15)} +// CHECK:STDOUT: 'type(inst15)': {kind: none, type: type(inst15)} // CHECK:STDOUT: type_blocks: // CHECK:STDOUT: type_block0: {} // CHECK:STDOUT: insts: -// CHECK:STDOUT: 'inst+0': {kind: Namespace, arg0: name_scope0, arg1: inst, type: type(inst(NamespaceType))} -// CHECK:STDOUT: 'inst+1': {kind: FunctionDecl, arg0: function0, arg1: inst_block_empty, type: type(inst+2)} -// CHECK:STDOUT: 'inst+2': {kind: FunctionType, arg0: function0, arg1: specific, type: type(TypeType)} -// CHECK:STDOUT: 'inst+3': {kind: TupleType, arg0: type_block0, type: type(TypeType)} -// CHECK:STDOUT: 'inst+4': {kind: StructValue, arg0: inst_block_empty, type: type(inst+2)} -// CHECK:STDOUT: 'inst+5': {kind: Return} +// CHECK:STDOUT: inst12: {kind: Namespace, arg0: name_scope0, arg1: inst, type: type(inst(NamespaceType))} +// CHECK:STDOUT: inst13: {kind: FunctionDecl, arg0: function0, arg1: inst_block_empty, type: type(inst14)} +// CHECK:STDOUT: inst14: {kind: FunctionType, arg0: function0, arg1: specific, type: type(TypeType)} +// CHECK:STDOUT: inst15: {kind: TupleType, arg0: type_block0, type: type(TypeType)} +// CHECK:STDOUT: inst16: {kind: StructValue, arg0: inst_block_empty, type: type(inst14)} +// CHECK:STDOUT: inst17: {kind: Return} // CHECK:STDOUT: constant_values: -// CHECK:STDOUT: 'inst+0': template_constant(inst+0) -// CHECK:STDOUT: 'inst+1': template_constant(inst+4) -// CHECK:STDOUT: 'inst+2': template_constant(inst+2) -// CHECK:STDOUT: 'inst+3': template_constant(inst+3) -// CHECK:STDOUT: 'inst+4': template_constant(inst+4) +// CHECK:STDOUT: inst12: template_constant(inst12) +// CHECK:STDOUT: inst13: template_constant(inst16) +// CHECK:STDOUT: inst14: template_constant(inst14) +// CHECK:STDOUT: inst15: template_constant(inst15) +// CHECK:STDOUT: inst16: template_constant(inst16) // CHECK:STDOUT: symbolic_constants: {} // CHECK:STDOUT: inst_blocks: // CHECK:STDOUT: inst_block_empty: {} // CHECK:STDOUT: exports: -// CHECK:STDOUT: 0: inst+1 +// CHECK:STDOUT: 0: inst13 // CHECK:STDOUT: import_refs: {} // CHECK:STDOUT: global_init: {} // CHECK:STDOUT: inst_block4: -// CHECK:STDOUT: 0: inst+5 +// CHECK:STDOUT: 0: inst17 // CHECK:STDOUT: inst_block5: -// CHECK:STDOUT: 0: inst+0 -// CHECK:STDOUT: 1: inst+1 +// CHECK:STDOUT: 0: inst12 +// CHECK:STDOUT: 1: inst13 // CHECK:STDOUT: ... // CHECK:STDOUT: // CHECK:STDOUT: --- a.carbon @@ -101,13 +101,13 @@ fn B() { // CHECK:STDOUT: sem_ir: // CHECK:STDOUT: import_irs: // CHECK:STDOUT: ir0: {decl_id: inst, is_export: false} -// CHECK:STDOUT: ir1: {decl_id: inst+1, is_export: false} +// CHECK:STDOUT: ir1: {decl_id: inst13, is_export: false} // CHECK:STDOUT: import_ir_insts: -// CHECK:STDOUT: import_ir_inst0: {ir_id: ir1, inst_id: inst+1} -// CHECK:STDOUT: import_ir_inst1: {ir_id: ir1, inst_id: inst+1} +// CHECK:STDOUT: import_ir_inst0: {ir_id: ir1, inst_id: inst13} +// CHECK:STDOUT: import_ir_inst1: {ir_id: ir1, inst_id: inst13} // CHECK:STDOUT: name_scopes: -// CHECK:STDOUT: name_scope0: {inst: inst+0, parent_scope: name_scope, has_error: false, extended_scopes: [], names: {name1: inst+2, name0: inst+3}} -// CHECK:STDOUT: name_scope1: {inst: inst+2, parent_scope: name_scope0, has_error: false, extended_scopes: [], names: {name1: inst+8}} +// CHECK:STDOUT: name_scope0: {inst: inst12, parent_scope: name_scope, has_error: false, extended_scopes: [], names: {name1: inst14, name0: inst15}} +// CHECK:STDOUT: name_scope1: {inst: inst14, parent_scope: name_scope0, has_error: false, extended_scopes: [], names: {name1: inst20}} // CHECK:STDOUT: entity_names: // CHECK:STDOUT: entity_name0: {name: name1, parent_scope: name_scope1, index: comp_time_bind} // CHECK:STDOUT: functions: @@ -122,58 +122,58 @@ fn B() { // CHECK:STDOUT: 'type(TypeType)': {kind: copy, type: type(TypeType)} // CHECK:STDOUT: 'type(Error)': {kind: copy, type: type(Error)} // CHECK:STDOUT: 'type(inst(NamespaceType))': {kind: copy, type: type(inst(NamespaceType))} -// CHECK:STDOUT: 'type(inst+4)': {kind: none, type: type(inst+5)} -// CHECK:STDOUT: 'type(inst+5)': {kind: none, type: type(inst+5)} -// CHECK:STDOUT: 'type(inst+10)': {kind: none, type: type(inst+5)} +// CHECK:STDOUT: 'type(inst16)': {kind: none, type: type(inst17)} +// CHECK:STDOUT: 'type(inst17)': {kind: none, type: type(inst17)} +// CHECK:STDOUT: 'type(inst22)': {kind: none, type: type(inst17)} // CHECK:STDOUT: type_blocks: // CHECK:STDOUT: type_block0: {} // CHECK:STDOUT: insts: -// CHECK:STDOUT: 'inst+0': {kind: Namespace, arg0: name_scope0, arg1: inst, type: type(inst(NamespaceType))} -// CHECK:STDOUT: 'inst+1': {kind: ImportDecl, arg0: name1} -// CHECK:STDOUT: 'inst+2': {kind: Namespace, arg0: name_scope1, arg1: inst+1, type: type(inst(NamespaceType))} -// CHECK:STDOUT: 'inst+3': {kind: FunctionDecl, arg0: function0, arg1: inst_block_empty, type: type(inst+4)} -// CHECK:STDOUT: 'inst+4': {kind: FunctionType, arg0: function0, arg1: specific, type: type(TypeType)} -// CHECK:STDOUT: 'inst+5': {kind: TupleType, arg0: type_block0, type: type(TypeType)} -// CHECK:STDOUT: 'inst+6': {kind: StructValue, arg0: inst_block_empty, type: type(inst+4)} -// CHECK:STDOUT: 'inst+7': {kind: NameRef, arg0: name1, arg1: inst+2, type: type(inst(NamespaceType))} -// CHECK:STDOUT: 'inst+8': {kind: ImportRefLoaded, arg0: import_ir_inst0, arg1: entity_name0, type: type(inst+10)} -// CHECK:STDOUT: 'inst+9': {kind: FunctionDecl, arg0: function1, arg1: inst_block_empty, type: type(inst+10)} -// CHECK:STDOUT: 'inst+10': {kind: FunctionType, arg0: function1, arg1: specific, type: type(TypeType)} -// CHECK:STDOUT: 'inst+11': {kind: StructValue, arg0: inst_block_empty, type: type(inst+10)} -// CHECK:STDOUT: 'inst+12': {kind: NameRef, arg0: name1, arg1: inst+8, type: type(inst+10)} -// CHECK:STDOUT: 'inst+13': {kind: Call, arg0: inst+12, arg1: inst_block_empty, type: type(inst+5)} -// CHECK:STDOUT: 'inst+14': {kind: Return} +// CHECK:STDOUT: inst12: {kind: Namespace, arg0: name_scope0, arg1: inst, type: type(inst(NamespaceType))} +// CHECK:STDOUT: inst13: {kind: ImportDecl, arg0: name1} +// CHECK:STDOUT: inst14: {kind: Namespace, arg0: name_scope1, arg1: inst13, type: type(inst(NamespaceType))} +// CHECK:STDOUT: inst15: {kind: FunctionDecl, arg0: function0, arg1: inst_block_empty, type: type(inst16)} +// CHECK:STDOUT: inst16: {kind: FunctionType, arg0: function0, arg1: specific, type: type(TypeType)} +// CHECK:STDOUT: inst17: {kind: TupleType, arg0: type_block0, type: type(TypeType)} +// CHECK:STDOUT: inst18: {kind: StructValue, arg0: inst_block_empty, type: type(inst16)} +// CHECK:STDOUT: inst19: {kind: NameRef, arg0: name1, arg1: inst14, type: type(inst(NamespaceType))} +// CHECK:STDOUT: inst20: {kind: ImportRefLoaded, arg0: import_ir_inst0, arg1: entity_name0, type: type(inst22)} +// CHECK:STDOUT: inst21: {kind: FunctionDecl, arg0: function1, arg1: inst_block_empty, type: type(inst22)} +// CHECK:STDOUT: inst22: {kind: FunctionType, arg0: function1, arg1: specific, type: type(TypeType)} +// CHECK:STDOUT: inst23: {kind: StructValue, arg0: inst_block_empty, type: type(inst22)} +// CHECK:STDOUT: inst24: {kind: NameRef, arg0: name1, arg1: inst20, type: type(inst22)} +// CHECK:STDOUT: inst25: {kind: Call, arg0: inst24, arg1: inst_block_empty, type: type(inst17)} +// CHECK:STDOUT: inst26: {kind: Return} // CHECK:STDOUT: constant_values: -// CHECK:STDOUT: 'inst+0': template_constant(inst+0) -// CHECK:STDOUT: 'inst+2': template_constant(inst+2) -// CHECK:STDOUT: 'inst+3': template_constant(inst+6) -// CHECK:STDOUT: 'inst+4': template_constant(inst+4) -// CHECK:STDOUT: 'inst+5': template_constant(inst+5) -// CHECK:STDOUT: 'inst+6': template_constant(inst+6) -// CHECK:STDOUT: 'inst+7': template_constant(inst+2) -// CHECK:STDOUT: 'inst+8': template_constant(inst+11) -// CHECK:STDOUT: 'inst+9': template_constant(inst+11) -// CHECK:STDOUT: 'inst+10': template_constant(inst+10) -// CHECK:STDOUT: 'inst+11': template_constant(inst+11) -// CHECK:STDOUT: 'inst+12': template_constant(inst+11) +// CHECK:STDOUT: inst12: template_constant(inst12) +// CHECK:STDOUT: inst14: template_constant(inst14) +// CHECK:STDOUT: inst15: template_constant(inst18) +// CHECK:STDOUT: inst16: template_constant(inst16) +// CHECK:STDOUT: inst17: template_constant(inst17) +// CHECK:STDOUT: inst18: template_constant(inst18) +// CHECK:STDOUT: inst19: template_constant(inst14) +// CHECK:STDOUT: inst20: template_constant(inst23) +// CHECK:STDOUT: inst21: template_constant(inst23) +// CHECK:STDOUT: inst22: template_constant(inst22) +// CHECK:STDOUT: inst23: template_constant(inst23) +// CHECK:STDOUT: inst24: template_constant(inst23) // CHECK:STDOUT: symbolic_constants: {} // CHECK:STDOUT: inst_blocks: // CHECK:STDOUT: inst_block_empty: {} // CHECK:STDOUT: exports: -// CHECK:STDOUT: 0: inst+3 +// CHECK:STDOUT: 0: inst15 // CHECK:STDOUT: import_refs: -// CHECK:STDOUT: 0: inst+2 -// CHECK:STDOUT: 1: inst+8 +// CHECK:STDOUT: 0: inst14 +// CHECK:STDOUT: 1: inst20 // CHECK:STDOUT: global_init: {} // CHECK:STDOUT: inst_block4: -// CHECK:STDOUT: 0: inst+7 -// CHECK:STDOUT: 1: inst+12 -// CHECK:STDOUT: 2: inst+13 -// CHECK:STDOUT: 3: inst+14 +// CHECK:STDOUT: 0: inst19 +// CHECK:STDOUT: 1: inst24 +// CHECK:STDOUT: 2: inst25 +// CHECK:STDOUT: 3: inst26 // CHECK:STDOUT: inst_block5: -// CHECK:STDOUT: 0: inst+0 -// CHECK:STDOUT: 1: inst+1 -// CHECK:STDOUT: 2: inst+3 +// CHECK:STDOUT: 0: inst12 +// CHECK:STDOUT: 1: inst13 +// CHECK:STDOUT: 2: inst15 // CHECK:STDOUT: ... // CHECK:STDOUT: // CHECK:STDOUT: --- b.carbon @@ -191,7 +191,7 @@ fn B() { // CHECK:STDOUT: .A = %import_ref // CHECK:STDOUT: import A//default // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref: %A.type = import_ref A//default, inst+1, loaded [template = constants.%A] +// CHECK:STDOUT: %import_ref: %A.type = import_ref A//default, A, loaded [template = constants.%A] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/basics/no_prelude/multifile_raw_ir.carbon b/toolchain/check/testdata/basics/no_prelude/multifile_raw_ir.carbon index 324e51ad53594..42a95227cc8af 100644 --- a/toolchain/check/testdata/basics/no_prelude/multifile_raw_ir.carbon +++ b/toolchain/check/testdata/basics/no_prelude/multifile_raw_ir.carbon @@ -33,7 +33,7 @@ fn B() { // CHECK:STDOUT: ir0: {decl_id: inst, is_export: false} // CHECK:STDOUT: import_ir_insts: {} // CHECK:STDOUT: name_scopes: -// CHECK:STDOUT: name_scope0: {inst: inst+0, parent_scope: name_scope, has_error: false, extended_scopes: [], names: {name0: inst+1}} +// CHECK:STDOUT: name_scope0: {inst: inst12, parent_scope: name_scope, has_error: false, extended_scopes: [], names: {name0: inst13}} // CHECK:STDOUT: entity_names: {} // CHECK:STDOUT: functions: // CHECK:STDOUT: function0: {name: name0, parent_scope: name_scope0, body: [inst_block4]} @@ -46,48 +46,48 @@ fn B() { // CHECK:STDOUT: 'type(TypeType)': {kind: copy, type: type(TypeType)} // CHECK:STDOUT: 'type(Error)': {kind: copy, type: type(Error)} // CHECK:STDOUT: 'type(inst(NamespaceType))': {kind: copy, type: type(inst(NamespaceType))} -// CHECK:STDOUT: 'type(inst+2)': {kind: none, type: type(inst+3)} -// CHECK:STDOUT: 'type(inst+3)': {kind: none, type: type(inst+3)} +// CHECK:STDOUT: 'type(inst14)': {kind: none, type: type(inst15)} +// CHECK:STDOUT: 'type(inst15)': {kind: none, type: type(inst15)} // CHECK:STDOUT: type_blocks: // CHECK:STDOUT: type_block0: {} // CHECK:STDOUT: insts: -// CHECK:STDOUT: 'inst+0': {kind: Namespace, arg0: name_scope0, arg1: inst, type: type(inst(NamespaceType))} -// CHECK:STDOUT: 'inst+1': {kind: FunctionDecl, arg0: function0, arg1: inst_block_empty, type: type(inst+2)} -// CHECK:STDOUT: 'inst+2': {kind: FunctionType, arg0: function0, arg1: specific, type: type(TypeType)} -// CHECK:STDOUT: 'inst+3': {kind: TupleType, arg0: type_block0, type: type(TypeType)} -// CHECK:STDOUT: 'inst+4': {kind: StructValue, arg0: inst_block_empty, type: type(inst+2)} -// CHECK:STDOUT: 'inst+5': {kind: Return} +// CHECK:STDOUT: inst12: {kind: Namespace, arg0: name_scope0, arg1: inst, type: type(inst(NamespaceType))} +// CHECK:STDOUT: inst13: {kind: FunctionDecl, arg0: function0, arg1: inst_block_empty, type: type(inst14)} +// CHECK:STDOUT: inst14: {kind: FunctionType, arg0: function0, arg1: specific, type: type(TypeType)} +// CHECK:STDOUT: inst15: {kind: TupleType, arg0: type_block0, type: type(TypeType)} +// CHECK:STDOUT: inst16: {kind: StructValue, arg0: inst_block_empty, type: type(inst14)} +// CHECK:STDOUT: inst17: {kind: Return} // CHECK:STDOUT: constant_values: -// CHECK:STDOUT: 'inst+0': template_constant(inst+0) -// CHECK:STDOUT: 'inst+1': template_constant(inst+4) -// CHECK:STDOUT: 'inst+2': template_constant(inst+2) -// CHECK:STDOUT: 'inst+3': template_constant(inst+3) -// CHECK:STDOUT: 'inst+4': template_constant(inst+4) +// CHECK:STDOUT: inst12: template_constant(inst12) +// CHECK:STDOUT: inst13: template_constant(inst16) +// CHECK:STDOUT: inst14: template_constant(inst14) +// CHECK:STDOUT: inst15: template_constant(inst15) +// CHECK:STDOUT: inst16: template_constant(inst16) // CHECK:STDOUT: symbolic_constants: {} // CHECK:STDOUT: inst_blocks: // CHECK:STDOUT: inst_block_empty: {} // CHECK:STDOUT: exports: -// CHECK:STDOUT: 0: inst+1 +// CHECK:STDOUT: 0: inst13 // CHECK:STDOUT: import_refs: {} // CHECK:STDOUT: global_init: {} // CHECK:STDOUT: inst_block4: -// CHECK:STDOUT: 0: inst+5 +// CHECK:STDOUT: 0: inst17 // CHECK:STDOUT: inst_block5: -// CHECK:STDOUT: 0: inst+0 -// CHECK:STDOUT: 1: inst+1 +// CHECK:STDOUT: 0: inst12 +// CHECK:STDOUT: 1: inst13 // CHECK:STDOUT: ... // CHECK:STDOUT: --- // CHECK:STDOUT: filename: b.carbon // CHECK:STDOUT: sem_ir: // CHECK:STDOUT: import_irs: // CHECK:STDOUT: ir0: {decl_id: inst, is_export: false} -// CHECK:STDOUT: ir1: {decl_id: inst+1, is_export: false} +// CHECK:STDOUT: ir1: {decl_id: inst13, is_export: false} // CHECK:STDOUT: import_ir_insts: -// CHECK:STDOUT: import_ir_inst0: {ir_id: ir1, inst_id: inst+1} -// CHECK:STDOUT: import_ir_inst1: {ir_id: ir1, inst_id: inst+1} +// CHECK:STDOUT: import_ir_inst0: {ir_id: ir1, inst_id: inst13} +// CHECK:STDOUT: import_ir_inst1: {ir_id: ir1, inst_id: inst13} // CHECK:STDOUT: name_scopes: -// CHECK:STDOUT: name_scope0: {inst: inst+0, parent_scope: name_scope, has_error: false, extended_scopes: [], names: {name1: inst+2, name0: inst+3}} -// CHECK:STDOUT: name_scope1: {inst: inst+2, parent_scope: name_scope0, has_error: false, extended_scopes: [], names: {name1: inst+8}} +// CHECK:STDOUT: name_scope0: {inst: inst12, parent_scope: name_scope, has_error: false, extended_scopes: [], names: {name1: inst14, name0: inst15}} +// CHECK:STDOUT: name_scope1: {inst: inst14, parent_scope: name_scope0, has_error: false, extended_scopes: [], names: {name1: inst20}} // CHECK:STDOUT: entity_names: // CHECK:STDOUT: entity_name0: {name: name1, parent_scope: name_scope1, index: comp_time_bind} // CHECK:STDOUT: functions: @@ -102,56 +102,56 @@ fn B() { // CHECK:STDOUT: 'type(TypeType)': {kind: copy, type: type(TypeType)} // CHECK:STDOUT: 'type(Error)': {kind: copy, type: type(Error)} // CHECK:STDOUT: 'type(inst(NamespaceType))': {kind: copy, type: type(inst(NamespaceType))} -// CHECK:STDOUT: 'type(inst+4)': {kind: none, type: type(inst+5)} -// CHECK:STDOUT: 'type(inst+5)': {kind: none, type: type(inst+5)} -// CHECK:STDOUT: 'type(inst+10)': {kind: none, type: type(inst+5)} +// CHECK:STDOUT: 'type(inst16)': {kind: none, type: type(inst17)} +// CHECK:STDOUT: 'type(inst17)': {kind: none, type: type(inst17)} +// CHECK:STDOUT: 'type(inst22)': {kind: none, type: type(inst17)} // CHECK:STDOUT: type_blocks: // CHECK:STDOUT: type_block0: {} // CHECK:STDOUT: insts: -// CHECK:STDOUT: 'inst+0': {kind: Namespace, arg0: name_scope0, arg1: inst, type: type(inst(NamespaceType))} -// CHECK:STDOUT: 'inst+1': {kind: ImportDecl, arg0: name1} -// CHECK:STDOUT: 'inst+2': {kind: Namespace, arg0: name_scope1, arg1: inst+1, type: type(inst(NamespaceType))} -// CHECK:STDOUT: 'inst+3': {kind: FunctionDecl, arg0: function0, arg1: inst_block_empty, type: type(inst+4)} -// CHECK:STDOUT: 'inst+4': {kind: FunctionType, arg0: function0, arg1: specific, type: type(TypeType)} -// CHECK:STDOUT: 'inst+5': {kind: TupleType, arg0: type_block0, type: type(TypeType)} -// CHECK:STDOUT: 'inst+6': {kind: StructValue, arg0: inst_block_empty, type: type(inst+4)} -// CHECK:STDOUT: 'inst+7': {kind: NameRef, arg0: name1, arg1: inst+2, type: type(inst(NamespaceType))} -// CHECK:STDOUT: 'inst+8': {kind: ImportRefLoaded, arg0: import_ir_inst0, arg1: entity_name0, type: type(inst+10)} -// CHECK:STDOUT: 'inst+9': {kind: FunctionDecl, arg0: function1, arg1: inst_block_empty, type: type(inst+10)} -// CHECK:STDOUT: 'inst+10': {kind: FunctionType, arg0: function1, arg1: specific, type: type(TypeType)} -// CHECK:STDOUT: 'inst+11': {kind: StructValue, arg0: inst_block_empty, type: type(inst+10)} -// CHECK:STDOUT: 'inst+12': {kind: NameRef, arg0: name1, arg1: inst+8, type: type(inst+10)} -// CHECK:STDOUT: 'inst+13': {kind: Call, arg0: inst+12, arg1: inst_block_empty, type: type(inst+5)} -// CHECK:STDOUT: 'inst+14': {kind: Return} +// CHECK:STDOUT: inst12: {kind: Namespace, arg0: name_scope0, arg1: inst, type: type(inst(NamespaceType))} +// CHECK:STDOUT: inst13: {kind: ImportDecl, arg0: name1} +// CHECK:STDOUT: inst14: {kind: Namespace, arg0: name_scope1, arg1: inst13, type: type(inst(NamespaceType))} +// CHECK:STDOUT: inst15: {kind: FunctionDecl, arg0: function0, arg1: inst_block_empty, type: type(inst16)} +// CHECK:STDOUT: inst16: {kind: FunctionType, arg0: function0, arg1: specific, type: type(TypeType)} +// CHECK:STDOUT: inst17: {kind: TupleType, arg0: type_block0, type: type(TypeType)} +// CHECK:STDOUT: inst18: {kind: StructValue, arg0: inst_block_empty, type: type(inst16)} +// CHECK:STDOUT: inst19: {kind: NameRef, arg0: name1, arg1: inst14, type: type(inst(NamespaceType))} +// CHECK:STDOUT: inst20: {kind: ImportRefLoaded, arg0: import_ir_inst0, arg1: entity_name0, type: type(inst22)} +// CHECK:STDOUT: inst21: {kind: FunctionDecl, arg0: function1, arg1: inst_block_empty, type: type(inst22)} +// CHECK:STDOUT: inst22: {kind: FunctionType, arg0: function1, arg1: specific, type: type(TypeType)} +// CHECK:STDOUT: inst23: {kind: StructValue, arg0: inst_block_empty, type: type(inst22)} +// CHECK:STDOUT: inst24: {kind: NameRef, arg0: name1, arg1: inst20, type: type(inst22)} +// CHECK:STDOUT: inst25: {kind: Call, arg0: inst24, arg1: inst_block_empty, type: type(inst17)} +// CHECK:STDOUT: inst26: {kind: Return} // CHECK:STDOUT: constant_values: -// CHECK:STDOUT: 'inst+0': template_constant(inst+0) -// CHECK:STDOUT: 'inst+2': template_constant(inst+2) -// CHECK:STDOUT: 'inst+3': template_constant(inst+6) -// CHECK:STDOUT: 'inst+4': template_constant(inst+4) -// CHECK:STDOUT: 'inst+5': template_constant(inst+5) -// CHECK:STDOUT: 'inst+6': template_constant(inst+6) -// CHECK:STDOUT: 'inst+7': template_constant(inst+2) -// CHECK:STDOUT: 'inst+8': template_constant(inst+11) -// CHECK:STDOUT: 'inst+9': template_constant(inst+11) -// CHECK:STDOUT: 'inst+10': template_constant(inst+10) -// CHECK:STDOUT: 'inst+11': template_constant(inst+11) -// CHECK:STDOUT: 'inst+12': template_constant(inst+11) +// CHECK:STDOUT: inst12: template_constant(inst12) +// CHECK:STDOUT: inst14: template_constant(inst14) +// CHECK:STDOUT: inst15: template_constant(inst18) +// CHECK:STDOUT: inst16: template_constant(inst16) +// CHECK:STDOUT: inst17: template_constant(inst17) +// CHECK:STDOUT: inst18: template_constant(inst18) +// CHECK:STDOUT: inst19: template_constant(inst14) +// CHECK:STDOUT: inst20: template_constant(inst23) +// CHECK:STDOUT: inst21: template_constant(inst23) +// CHECK:STDOUT: inst22: template_constant(inst22) +// CHECK:STDOUT: inst23: template_constant(inst23) +// CHECK:STDOUT: inst24: template_constant(inst23) // CHECK:STDOUT: symbolic_constants: {} // CHECK:STDOUT: inst_blocks: // CHECK:STDOUT: inst_block_empty: {} // CHECK:STDOUT: exports: -// CHECK:STDOUT: 0: inst+3 +// CHECK:STDOUT: 0: inst15 // CHECK:STDOUT: import_refs: -// CHECK:STDOUT: 0: inst+2 -// CHECK:STDOUT: 1: inst+8 +// CHECK:STDOUT: 0: inst14 +// CHECK:STDOUT: 1: inst20 // CHECK:STDOUT: global_init: {} // CHECK:STDOUT: inst_block4: -// CHECK:STDOUT: 0: inst+7 -// CHECK:STDOUT: 1: inst+12 -// CHECK:STDOUT: 2: inst+13 -// CHECK:STDOUT: 3: inst+14 +// CHECK:STDOUT: 0: inst19 +// CHECK:STDOUT: 1: inst24 +// CHECK:STDOUT: 2: inst25 +// CHECK:STDOUT: 3: inst26 // CHECK:STDOUT: inst_block5: -// CHECK:STDOUT: 0: inst+0 -// CHECK:STDOUT: 1: inst+1 -// CHECK:STDOUT: 2: inst+3 +// CHECK:STDOUT: 0: inst12 +// CHECK:STDOUT: 1: inst13 +// CHECK:STDOUT: 2: inst15 // CHECK:STDOUT: ... diff --git a/toolchain/check/testdata/basics/no_prelude/raw_and_textual_ir.carbon b/toolchain/check/testdata/basics/no_prelude/raw_and_textual_ir.carbon index 0a96f7f2c4a1c..34f376f44b3a7 100644 --- a/toolchain/check/testdata/basics/no_prelude/raw_and_textual_ir.carbon +++ b/toolchain/check/testdata/basics/no_prelude/raw_and_textual_ir.carbon @@ -23,11 +23,11 @@ fn Foo(n: ()) -> ((), ()) { // CHECK:STDOUT: ir0: {decl_id: inst, is_export: false} // CHECK:STDOUT: import_ir_insts: {} // CHECK:STDOUT: name_scopes: -// CHECK:STDOUT: name_scope0: {inst: inst+0, parent_scope: name_scope, has_error: false, extended_scopes: [], names: {name0: inst+19}} +// CHECK:STDOUT: name_scope0: {inst: inst12, parent_scope: name_scope, has_error: false, extended_scopes: [], names: {name0: inst31}} // CHECK:STDOUT: entity_names: // CHECK:STDOUT: entity_name0: {name: name1, parent_scope: name_scope, index: comp_time_bind} // CHECK:STDOUT: functions: -// CHECK:STDOUT: function0: {name: name0, parent_scope: name_scope0, return_slot_pattern: inst+15, body: [inst_block9]} +// CHECK:STDOUT: function0: {name: name0, parent_scope: name_scope0, return_slot_pattern: inst27, body: [inst_block9]} // CHECK:STDOUT: classes: {} // CHECK:STDOUT: generics: {} // CHECK:STDOUT: specifics: {} @@ -37,132 +37,132 @@ fn Foo(n: ()) -> ((), ()) { // CHECK:STDOUT: 'type(TypeType)': {kind: copy, type: type(TypeType)} // CHECK:STDOUT: 'type(Error)': {kind: copy, type: type(Error)} // CHECK:STDOUT: 'type(inst(NamespaceType))': {kind: copy, type: type(inst(NamespaceType))} -// CHECK:STDOUT: 'type(inst+20)': {kind: none, type: type(inst+1)} -// CHECK:STDOUT: 'type(inst+1)': {kind: none, type: type(inst+1)} -// CHECK:STDOUT: 'type(inst+9)': {kind: pointer, type: type(inst+22)} -// CHECK:STDOUT: 'type(inst+22)': {kind: copy, type: type(inst+22)} +// CHECK:STDOUT: 'type(inst32)': {kind: none, type: type(inst13)} +// CHECK:STDOUT: 'type(inst13)': {kind: none, type: type(inst13)} +// CHECK:STDOUT: 'type(inst21)': {kind: pointer, type: type(inst34)} +// CHECK:STDOUT: 'type(inst34)': {kind: copy, type: type(inst34)} // CHECK:STDOUT: type_blocks: // CHECK:STDOUT: type_block0: {} // CHECK:STDOUT: type_block1: -// CHECK:STDOUT: 0: type(inst+1) -// CHECK:STDOUT: 1: type(inst+1) +// CHECK:STDOUT: 0: type(inst13) +// CHECK:STDOUT: 1: type(inst13) // CHECK:STDOUT: insts: -// CHECK:STDOUT: 'inst+0': {kind: Namespace, arg0: name_scope0, arg1: inst, type: type(inst(NamespaceType))} -// CHECK:STDOUT: 'inst+1': {kind: TupleType, arg0: type_block0, type: type(TypeType)} -// CHECK:STDOUT: 'inst+2': {kind: TupleLiteral, arg0: inst_block_empty, type: type(inst+1)} -// CHECK:STDOUT: 'inst+3': {kind: Converted, arg0: inst+2, arg1: inst+1, type: type(TypeType)} -// CHECK:STDOUT: 'inst+4': {kind: BindName, arg0: entity_name0, arg1: inst+16, type: type(inst+1)} -// CHECK:STDOUT: 'inst+5': {kind: BindingPattern, arg0: entity_name0, type: type(inst+1)} -// CHECK:STDOUT: 'inst+6': {kind: ValueParamPattern, arg0: inst+5, arg1: runtime_param0, type: type(inst+1)} -// CHECK:STDOUT: 'inst+7': {kind: TupleLiteral, arg0: inst_block_empty, type: type(inst+1)} -// CHECK:STDOUT: 'inst+8': {kind: TupleLiteral, arg0: inst_block_empty, type: type(inst+1)} -// CHECK:STDOUT: 'inst+9': {kind: TupleType, arg0: type_block1, type: type(TypeType)} -// CHECK:STDOUT: 'inst+10': {kind: TupleLiteral, arg0: inst_block5, type: type(inst+9)} -// CHECK:STDOUT: 'inst+11': {kind: Converted, arg0: inst+7, arg1: inst+1, type: type(TypeType)} -// CHECK:STDOUT: 'inst+12': {kind: Converted, arg0: inst+8, arg1: inst+1, type: type(TypeType)} -// CHECK:STDOUT: 'inst+13': {kind: Converted, arg0: inst+10, arg1: inst+9, type: type(TypeType)} -// CHECK:STDOUT: 'inst+14': {kind: ReturnSlotPattern, arg0: inst+10, type: type(inst+9)} -// CHECK:STDOUT: 'inst+15': {kind: OutParamPattern, arg0: inst+14, arg1: runtime_param1, type: type(inst+9)} -// CHECK:STDOUT: 'inst+16': {kind: ValueParam, arg0: runtime_param0, arg1: name1, type: type(inst+1)} -// CHECK:STDOUT: 'inst+17': {kind: OutParam, arg0: runtime_param1, arg1: name(ReturnSlot), type: type(inst+9)} -// CHECK:STDOUT: 'inst+18': {kind: ReturnSlot, arg0: inst+10, arg1: inst+17, type: type(inst+9)} -// CHECK:STDOUT: 'inst+19': {kind: FunctionDecl, arg0: function0, arg1: inst_block8, type: type(inst+20)} -// CHECK:STDOUT: 'inst+20': {kind: FunctionType, arg0: function0, arg1: specific, type: type(TypeType)} -// CHECK:STDOUT: 'inst+21': {kind: StructValue, arg0: inst_block_empty, type: type(inst+20)} -// CHECK:STDOUT: 'inst+22': {kind: PointerType, arg0: type(inst+9), type: type(TypeType)} -// CHECK:STDOUT: 'inst+23': {kind: NameRef, arg0: name1, arg1: inst+4, type: type(inst+1)} -// CHECK:STDOUT: 'inst+24': {kind: TupleLiteral, arg0: inst_block_empty, type: type(inst+1)} -// CHECK:STDOUT: 'inst+25': {kind: TupleLiteral, arg0: inst_block10, type: type(inst+9)} -// CHECK:STDOUT: 'inst+26': {kind: TupleAccess, arg0: inst+18, arg1: element0, type: type(inst+1)} -// CHECK:STDOUT: 'inst+27': {kind: TupleInit, arg0: inst_block11, arg1: inst+26, type: type(inst+1)} -// CHECK:STDOUT: 'inst+28': {kind: TupleValue, arg0: inst_block_empty, type: type(inst+1)} -// CHECK:STDOUT: 'inst+29': {kind: Converted, arg0: inst+23, arg1: inst+27, type: type(inst+1)} -// CHECK:STDOUT: 'inst+30': {kind: TupleAccess, arg0: inst+18, arg1: element1, type: type(inst+1)} -// CHECK:STDOUT: 'inst+31': {kind: TupleInit, arg0: inst_block_empty, arg1: inst+30, type: type(inst+1)} -// CHECK:STDOUT: 'inst+32': {kind: Converted, arg0: inst+24, arg1: inst+31, type: type(inst+1)} -// CHECK:STDOUT: 'inst+33': {kind: TupleInit, arg0: inst_block12, arg1: inst+18, type: type(inst+9)} -// CHECK:STDOUT: 'inst+34': {kind: TupleValue, arg0: inst_block13, type: type(inst+9)} -// CHECK:STDOUT: 'inst+35': {kind: Converted, arg0: inst+25, arg1: inst+33, type: type(inst+9)} -// CHECK:STDOUT: 'inst+36': {kind: ReturnExpr, arg0: inst+35, arg1: inst+18} +// CHECK:STDOUT: inst12: {kind: Namespace, arg0: name_scope0, arg1: inst, type: type(inst(NamespaceType))} +// CHECK:STDOUT: inst13: {kind: TupleType, arg0: type_block0, type: type(TypeType)} +// CHECK:STDOUT: inst14: {kind: TupleLiteral, arg0: inst_block_empty, type: type(inst13)} +// CHECK:STDOUT: inst15: {kind: Converted, arg0: inst14, arg1: inst13, type: type(TypeType)} +// CHECK:STDOUT: inst16: {kind: BindName, arg0: entity_name0, arg1: inst28, type: type(inst13)} +// CHECK:STDOUT: inst17: {kind: BindingPattern, arg0: entity_name0, type: type(inst13)} +// CHECK:STDOUT: inst18: {kind: ValueParamPattern, arg0: inst17, arg1: runtime_param0, type: type(inst13)} +// CHECK:STDOUT: inst19: {kind: TupleLiteral, arg0: inst_block_empty, type: type(inst13)} +// CHECK:STDOUT: inst20: {kind: TupleLiteral, arg0: inst_block_empty, type: type(inst13)} +// CHECK:STDOUT: inst21: {kind: TupleType, arg0: type_block1, type: type(TypeType)} +// CHECK:STDOUT: inst22: {kind: TupleLiteral, arg0: inst_block5, type: type(inst21)} +// CHECK:STDOUT: inst23: {kind: Converted, arg0: inst19, arg1: inst13, type: type(TypeType)} +// CHECK:STDOUT: inst24: {kind: Converted, arg0: inst20, arg1: inst13, type: type(TypeType)} +// CHECK:STDOUT: inst25: {kind: Converted, arg0: inst22, arg1: inst21, type: type(TypeType)} +// CHECK:STDOUT: inst26: {kind: ReturnSlotPattern, arg0: inst22, type: type(inst21)} +// CHECK:STDOUT: inst27: {kind: OutParamPattern, arg0: inst26, arg1: runtime_param1, type: type(inst21)} +// CHECK:STDOUT: inst28: {kind: ValueParam, arg0: runtime_param0, arg1: name1, type: type(inst13)} +// CHECK:STDOUT: inst29: {kind: OutParam, arg0: runtime_param1, arg1: name(ReturnSlot), type: type(inst21)} +// CHECK:STDOUT: inst30: {kind: ReturnSlot, arg0: inst22, arg1: inst29, type: type(inst21)} +// CHECK:STDOUT: inst31: {kind: FunctionDecl, arg0: function0, arg1: inst_block8, type: type(inst32)} +// CHECK:STDOUT: inst32: {kind: FunctionType, arg0: function0, arg1: specific, type: type(TypeType)} +// CHECK:STDOUT: inst33: {kind: StructValue, arg0: inst_block_empty, type: type(inst32)} +// CHECK:STDOUT: inst34: {kind: PointerType, arg0: type(inst21), type: type(TypeType)} +// CHECK:STDOUT: inst35: {kind: NameRef, arg0: name1, arg1: inst16, type: type(inst13)} +// CHECK:STDOUT: inst36: {kind: TupleLiteral, arg0: inst_block_empty, type: type(inst13)} +// CHECK:STDOUT: inst37: {kind: TupleLiteral, arg0: inst_block10, type: type(inst21)} +// CHECK:STDOUT: inst38: {kind: TupleAccess, arg0: inst30, arg1: element0, type: type(inst13)} +// CHECK:STDOUT: inst39: {kind: TupleInit, arg0: inst_block11, arg1: inst38, type: type(inst13)} +// CHECK:STDOUT: inst40: {kind: TupleValue, arg0: inst_block_empty, type: type(inst13)} +// CHECK:STDOUT: inst41: {kind: Converted, arg0: inst35, arg1: inst39, type: type(inst13)} +// CHECK:STDOUT: inst42: {kind: TupleAccess, arg0: inst30, arg1: element1, type: type(inst13)} +// CHECK:STDOUT: inst43: {kind: TupleInit, arg0: inst_block_empty, arg1: inst42, type: type(inst13)} +// CHECK:STDOUT: inst44: {kind: Converted, arg0: inst36, arg1: inst43, type: type(inst13)} +// CHECK:STDOUT: inst45: {kind: TupleInit, arg0: inst_block12, arg1: inst30, type: type(inst21)} +// CHECK:STDOUT: inst46: {kind: TupleValue, arg0: inst_block13, type: type(inst21)} +// CHECK:STDOUT: inst47: {kind: Converted, arg0: inst37, arg1: inst45, type: type(inst21)} +// CHECK:STDOUT: inst48: {kind: ReturnExpr, arg0: inst47, arg1: inst30} // CHECK:STDOUT: constant_values: -// CHECK:STDOUT: 'inst+0': template_constant(inst+0) -// CHECK:STDOUT: 'inst+1': template_constant(inst+1) -// CHECK:STDOUT: 'inst+3': template_constant(inst+1) -// CHECK:STDOUT: 'inst+9': template_constant(inst+9) -// CHECK:STDOUT: 'inst+11': template_constant(inst+1) -// CHECK:STDOUT: 'inst+12': template_constant(inst+1) -// CHECK:STDOUT: 'inst+13': template_constant(inst+9) -// CHECK:STDOUT: 'inst+19': template_constant(inst+21) -// CHECK:STDOUT: 'inst+20': template_constant(inst+20) -// CHECK:STDOUT: 'inst+21': template_constant(inst+21) -// CHECK:STDOUT: 'inst+22': template_constant(inst+22) -// CHECK:STDOUT: 'inst+27': template_constant(inst+28) -// CHECK:STDOUT: 'inst+28': template_constant(inst+28) -// CHECK:STDOUT: 'inst+29': template_constant(inst+28) -// CHECK:STDOUT: 'inst+31': template_constant(inst+28) -// CHECK:STDOUT: 'inst+32': template_constant(inst+28) -// CHECK:STDOUT: 'inst+33': template_constant(inst+34) -// CHECK:STDOUT: 'inst+34': template_constant(inst+34) -// CHECK:STDOUT: 'inst+35': template_constant(inst+34) +// CHECK:STDOUT: inst12: template_constant(inst12) +// CHECK:STDOUT: inst13: template_constant(inst13) +// CHECK:STDOUT: inst15: template_constant(inst13) +// CHECK:STDOUT: inst21: template_constant(inst21) +// CHECK:STDOUT: inst23: template_constant(inst13) +// CHECK:STDOUT: inst24: template_constant(inst13) +// CHECK:STDOUT: inst25: template_constant(inst21) +// CHECK:STDOUT: inst31: template_constant(inst33) +// CHECK:STDOUT: inst32: template_constant(inst32) +// CHECK:STDOUT: inst33: template_constant(inst33) +// CHECK:STDOUT: inst34: template_constant(inst34) +// CHECK:STDOUT: inst39: template_constant(inst40) +// CHECK:STDOUT: inst40: template_constant(inst40) +// CHECK:STDOUT: inst41: template_constant(inst40) +// CHECK:STDOUT: inst43: template_constant(inst40) +// CHECK:STDOUT: inst44: template_constant(inst40) +// CHECK:STDOUT: inst45: template_constant(inst46) +// CHECK:STDOUT: inst46: template_constant(inst46) +// CHECK:STDOUT: inst47: template_constant(inst46) // CHECK:STDOUT: symbolic_constants: {} // CHECK:STDOUT: inst_blocks: // CHECK:STDOUT: inst_block_empty: {} // CHECK:STDOUT: exports: -// CHECK:STDOUT: 0: inst+19 +// CHECK:STDOUT: 0: inst31 // CHECK:STDOUT: import_refs: {} // CHECK:STDOUT: global_init: {} // CHECK:STDOUT: inst_block4: -// CHECK:STDOUT: 0: inst+6 +// CHECK:STDOUT: 0: inst18 // CHECK:STDOUT: inst_block5: -// CHECK:STDOUT: 0: inst+7 -// CHECK:STDOUT: 1: inst+8 +// CHECK:STDOUT: 0: inst19 +// CHECK:STDOUT: 1: inst20 // CHECK:STDOUT: inst_block6: -// CHECK:STDOUT: 0: inst+16 -// CHECK:STDOUT: 1: inst+17 +// CHECK:STDOUT: 0: inst28 +// CHECK:STDOUT: 1: inst29 // CHECK:STDOUT: inst_block7: -// CHECK:STDOUT: 0: inst+5 -// CHECK:STDOUT: 1: inst+6 -// CHECK:STDOUT: 2: inst+14 -// CHECK:STDOUT: 3: inst+15 +// CHECK:STDOUT: 0: inst17 +// CHECK:STDOUT: 1: inst18 +// CHECK:STDOUT: 2: inst26 +// CHECK:STDOUT: 3: inst27 // CHECK:STDOUT: inst_block8: -// CHECK:STDOUT: 0: inst+2 -// CHECK:STDOUT: 1: inst+3 -// CHECK:STDOUT: 2: inst+7 -// CHECK:STDOUT: 3: inst+8 -// CHECK:STDOUT: 4: inst+10 -// CHECK:STDOUT: 5: inst+11 -// CHECK:STDOUT: 6: inst+12 -// CHECK:STDOUT: 7: inst+13 -// CHECK:STDOUT: 8: inst+16 -// CHECK:STDOUT: 9: inst+4 -// CHECK:STDOUT: 10: inst+17 -// CHECK:STDOUT: 11: inst+18 +// CHECK:STDOUT: 0: inst14 +// CHECK:STDOUT: 1: inst15 +// CHECK:STDOUT: 2: inst19 +// CHECK:STDOUT: 3: inst20 +// CHECK:STDOUT: 4: inst22 +// CHECK:STDOUT: 5: inst23 +// CHECK:STDOUT: 6: inst24 +// CHECK:STDOUT: 7: inst25 +// CHECK:STDOUT: 8: inst28 +// CHECK:STDOUT: 9: inst16 +// CHECK:STDOUT: 10: inst29 +// CHECK:STDOUT: 11: inst30 // CHECK:STDOUT: inst_block9: -// CHECK:STDOUT: 0: inst+23 -// CHECK:STDOUT: 1: inst+24 -// CHECK:STDOUT: 2: inst+25 -// CHECK:STDOUT: 3: inst+26 -// CHECK:STDOUT: 4: inst+27 -// CHECK:STDOUT: 5: inst+29 -// CHECK:STDOUT: 6: inst+30 -// CHECK:STDOUT: 7: inst+31 -// CHECK:STDOUT: 8: inst+32 -// CHECK:STDOUT: 9: inst+33 -// CHECK:STDOUT: 10: inst+35 -// CHECK:STDOUT: 11: inst+36 +// CHECK:STDOUT: 0: inst35 +// CHECK:STDOUT: 1: inst36 +// CHECK:STDOUT: 2: inst37 +// CHECK:STDOUT: 3: inst38 +// CHECK:STDOUT: 4: inst39 +// CHECK:STDOUT: 5: inst41 +// CHECK:STDOUT: 6: inst42 +// CHECK:STDOUT: 7: inst43 +// CHECK:STDOUT: 8: inst44 +// CHECK:STDOUT: 9: inst45 +// CHECK:STDOUT: 10: inst47 +// CHECK:STDOUT: 11: inst48 // CHECK:STDOUT: inst_block10: -// CHECK:STDOUT: 0: inst+23 -// CHECK:STDOUT: 1: inst+24 +// CHECK:STDOUT: 0: inst35 +// CHECK:STDOUT: 1: inst36 // CHECK:STDOUT: inst_block11: {} // CHECK:STDOUT: inst_block12: -// CHECK:STDOUT: 0: inst+29 -// CHECK:STDOUT: 1: inst+32 +// CHECK:STDOUT: 0: inst41 +// CHECK:STDOUT: 1: inst44 // CHECK:STDOUT: inst_block13: -// CHECK:STDOUT: 0: inst+28 -// CHECK:STDOUT: 1: inst+28 +// CHECK:STDOUT: 0: inst40 +// CHECK:STDOUT: 1: inst40 // CHECK:STDOUT: inst_block14: -// CHECK:STDOUT: 0: inst+0 -// CHECK:STDOUT: 1: inst+19 +// CHECK:STDOUT: 0: inst12 +// CHECK:STDOUT: 1: inst31 // CHECK:STDOUT: ... // CHECK:STDOUT: // CHECK:STDOUT: --- raw_and_textual_ir.carbon diff --git a/toolchain/check/testdata/basics/no_prelude/raw_ir.carbon b/toolchain/check/testdata/basics/no_prelude/raw_ir.carbon index dce3ffdb4f4ad..b9a88d94862b1 100644 --- a/toolchain/check/testdata/basics/no_prelude/raw_ir.carbon +++ b/toolchain/check/testdata/basics/no_prelude/raw_ir.carbon @@ -23,15 +23,15 @@ fn Foo[T:! type](n: T) -> (T, ()) { // CHECK:STDOUT: ir0: {decl_id: inst, is_export: false} // CHECK:STDOUT: import_ir_insts: {} // CHECK:STDOUT: name_scopes: -// CHECK:STDOUT: name_scope0: {inst: inst+0, parent_scope: name_scope, has_error: false, extended_scopes: [], names: {name0: inst+24}} +// CHECK:STDOUT: name_scope0: {inst: inst12, parent_scope: name_scope, has_error: false, extended_scopes: [], names: {name0: inst36}} // CHECK:STDOUT: entity_names: // CHECK:STDOUT: entity_name0: {name: name1, parent_scope: name_scope, index: comp_time_bind0} // CHECK:STDOUT: entity_name1: {name: name2, parent_scope: name_scope, index: comp_time_bind} // CHECK:STDOUT: functions: -// CHECK:STDOUT: function0: {name: name0, parent_scope: name_scope0, return_slot_pattern: inst+19, body: [inst_block14]} +// CHECK:STDOUT: function0: {name: name0, parent_scope: name_scope0, return_slot_pattern: inst31, body: [inst_block14]} // CHECK:STDOUT: classes: {} // CHECK:STDOUT: generics: -// CHECK:STDOUT: generic0: {decl: inst+24, bindings: inst_block10} +// CHECK:STDOUT: generic0: {decl: inst36, bindings: inst_block10} // CHECK:STDOUT: specifics: // CHECK:STDOUT: specific0: {generic: generic0, args: inst_block12} // CHECK:STDOUT: struct_type_fields: @@ -40,8 +40,8 @@ fn Foo[T:! type](n: T) -> (T, ()) { // CHECK:STDOUT: 'type(TypeType)': {kind: copy, type: type(TypeType)} // CHECK:STDOUT: 'type(Error)': {kind: copy, type: type(Error)} // CHECK:STDOUT: 'type(inst(NamespaceType))': {kind: copy, type: type(inst(NamespaceType))} -// CHECK:STDOUT: 'type(inst+28)': {kind: none, type: type(inst+11)} -// CHECK:STDOUT: 'type(inst+11)': {kind: none, type: type(inst+11)} +// CHECK:STDOUT: 'type(inst40)': {kind: none, type: type(inst23)} +// CHECK:STDOUT: 'type(inst23)': {kind: none, type: type(inst23)} // CHECK:STDOUT: 'type(symbolic_constant0)': {kind: copy, type: type(symbolic_constant0)} // CHECK:STDOUT: 'type(symbolic_constant2)': {kind: pointer, type: type(symbolic_constant6)} // CHECK:STDOUT: 'type(symbolic_constant6)': {kind: copy, type: type(symbolic_constant6)} @@ -51,156 +51,156 @@ fn Foo[T:! type](n: T) -> (T, ()) { // CHECK:STDOUT: type_block0: {} // CHECK:STDOUT: type_block1: // CHECK:STDOUT: 0: type(TypeType) -// CHECK:STDOUT: 1: type(inst+11) +// CHECK:STDOUT: 1: type(inst23) // CHECK:STDOUT: type_block2: // CHECK:STDOUT: 0: type(symbolic_constant0) -// CHECK:STDOUT: 1: type(inst+11) +// CHECK:STDOUT: 1: type(inst23) // CHECK:STDOUT: type_block3: // CHECK:STDOUT: 0: type(symbolic_constant3) -// CHECK:STDOUT: 1: type(inst+11) +// CHECK:STDOUT: 1: type(inst23) // CHECK:STDOUT: insts: -// CHECK:STDOUT: 'inst+0': {kind: Namespace, arg0: name_scope0, arg1: inst, type: type(inst(NamespaceType))} -// CHECK:STDOUT: 'inst+1': {kind: BindSymbolicName, arg0: entity_name0, arg1: inst+20, type: type(TypeType)} -// CHECK:STDOUT: 'inst+2': {kind: BindSymbolicName, arg0: entity_name0, arg1: inst, type: type(TypeType)} -// CHECK:STDOUT: 'inst+3': {kind: SymbolicBindingPattern, arg0: entity_name0, type: type(TypeType)} -// CHECK:STDOUT: 'inst+4': {kind: SymbolicBindingPattern, arg0: entity_name0, type: type(TypeType)} -// CHECK:STDOUT: 'inst+5': {kind: ValueParamPattern, arg0: inst+3, arg1: runtime_param, type: type(TypeType)} -// CHECK:STDOUT: 'inst+6': {kind: NameRef, arg0: name1, arg1: inst+1, type: type(TypeType)} -// CHECK:STDOUT: 'inst+7': {kind: BindName, arg0: entity_name1, arg1: inst+21, type: type(symbolic_constant3)} -// CHECK:STDOUT: 'inst+8': {kind: BindingPattern, arg0: entity_name1, type: type(symbolic_constant3)} -// CHECK:STDOUT: 'inst+9': {kind: ValueParamPattern, arg0: inst+8, arg1: runtime_param0, type: type(symbolic_constant3)} -// CHECK:STDOUT: 'inst+10': {kind: NameRef, arg0: name1, arg1: inst+1, type: type(TypeType)} -// CHECK:STDOUT: 'inst+11': {kind: TupleType, arg0: type_block0, type: type(TypeType)} -// CHECK:STDOUT: 'inst+12': {kind: TupleLiteral, arg0: inst_block_empty, type: type(inst+11)} -// CHECK:STDOUT: 'inst+13': {kind: TupleType, arg0: type_block1, type: type(TypeType)} -// CHECK:STDOUT: 'inst+14': {kind: TupleLiteral, arg0: inst_block6, type: type(inst+13)} -// CHECK:STDOUT: 'inst+15': {kind: Converted, arg0: inst+12, arg1: inst+11, type: type(TypeType)} -// CHECK:STDOUT: 'inst+16': {kind: TupleType, arg0: type_block2, type: type(TypeType)} -// CHECK:STDOUT: 'inst+17': {kind: Converted, arg0: inst+14, arg1: inst+16, type: type(TypeType)} -// CHECK:STDOUT: 'inst+18': {kind: ReturnSlotPattern, arg0: inst+14, type: type(symbolic_constant5)} -// CHECK:STDOUT: 'inst+19': {kind: OutParamPattern, arg0: inst+18, arg1: runtime_param1, type: type(symbolic_constant5)} -// CHECK:STDOUT: 'inst+20': {kind: ValueParam, arg0: runtime_param, arg1: name1, type: type(TypeType)} -// CHECK:STDOUT: 'inst+21': {kind: ValueParam, arg0: runtime_param0, arg1: name2, type: type(symbolic_constant3)} -// CHECK:STDOUT: 'inst+22': {kind: OutParam, arg0: runtime_param1, arg1: name(ReturnSlot), type: type(symbolic_constant5)} -// CHECK:STDOUT: 'inst+23': {kind: ReturnSlot, arg0: inst+14, arg1: inst+22, type: type(symbolic_constant5)} -// CHECK:STDOUT: 'inst+24': {kind: FunctionDecl, arg0: function0, arg1: inst_block9, type: type(inst+28)} -// CHECK:STDOUT: 'inst+25': {kind: BindSymbolicName, arg0: entity_name0, arg1: inst, type: type(TypeType)} -// CHECK:STDOUT: 'inst+26': {kind: SymbolicBindingPattern, arg0: entity_name0, type: type(TypeType)} -// CHECK:STDOUT: 'inst+27': {kind: TupleType, arg0: type_block3, type: type(TypeType)} -// CHECK:STDOUT: 'inst+28': {kind: FunctionType, arg0: function0, arg1: specific, type: type(TypeType)} -// CHECK:STDOUT: 'inst+29': {kind: StructValue, arg0: inst_block_empty, type: type(inst+28)} -// CHECK:STDOUT: 'inst+30': {kind: PointerType, arg0: type(symbolic_constant2), type: type(TypeType)} -// CHECK:STDOUT: 'inst+31': {kind: NameRef, arg0: name2, arg1: inst+7, type: type(symbolic_constant3)} -// CHECK:STDOUT: 'inst+32': {kind: TupleLiteral, arg0: inst_block_empty, type: type(inst+11)} -// CHECK:STDOUT: 'inst+33': {kind: TupleLiteral, arg0: inst_block15, type: type(symbolic_constant5)} -// CHECK:STDOUT: 'inst+34': {kind: TupleAccess, arg0: inst+23, arg1: element0, type: type(symbolic_constant3)} -// CHECK:STDOUT: 'inst+35': {kind: InitializeFrom, arg0: inst+31, arg1: inst+34, type: type(symbolic_constant3)} -// CHECK:STDOUT: 'inst+36': {kind: TupleAccess, arg0: inst+23, arg1: element1, type: type(inst+11)} -// CHECK:STDOUT: 'inst+37': {kind: TupleInit, arg0: inst_block_empty, arg1: inst+36, type: type(inst+11)} -// CHECK:STDOUT: 'inst+38': {kind: TupleValue, arg0: inst_block_empty, type: type(inst+11)} -// CHECK:STDOUT: 'inst+39': {kind: Converted, arg0: inst+32, arg1: inst+37, type: type(inst+11)} -// CHECK:STDOUT: 'inst+40': {kind: TupleInit, arg0: inst_block16, arg1: inst+23, type: type(symbolic_constant5)} -// CHECK:STDOUT: 'inst+41': {kind: Converted, arg0: inst+33, arg1: inst+40, type: type(symbolic_constant5)} -// CHECK:STDOUT: 'inst+42': {kind: ReturnExpr, arg0: inst+41, arg1: inst+23} +// CHECK:STDOUT: inst12: {kind: Namespace, arg0: name_scope0, arg1: inst, type: type(inst(NamespaceType))} +// CHECK:STDOUT: inst13: {kind: BindSymbolicName, arg0: entity_name0, arg1: inst32, type: type(TypeType)} +// CHECK:STDOUT: inst14: {kind: BindSymbolicName, arg0: entity_name0, arg1: inst, type: type(TypeType)} +// CHECK:STDOUT: inst15: {kind: SymbolicBindingPattern, arg0: entity_name0, type: type(TypeType)} +// CHECK:STDOUT: inst16: {kind: SymbolicBindingPattern, arg0: entity_name0, type: type(TypeType)} +// CHECK:STDOUT: inst17: {kind: ValueParamPattern, arg0: inst15, arg1: runtime_param, type: type(TypeType)} +// CHECK:STDOUT: inst18: {kind: NameRef, arg0: name1, arg1: inst13, type: type(TypeType)} +// CHECK:STDOUT: inst19: {kind: BindName, arg0: entity_name1, arg1: inst33, type: type(symbolic_constant3)} +// CHECK:STDOUT: inst20: {kind: BindingPattern, arg0: entity_name1, type: type(symbolic_constant3)} +// CHECK:STDOUT: inst21: {kind: ValueParamPattern, arg0: inst20, arg1: runtime_param0, type: type(symbolic_constant3)} +// CHECK:STDOUT: inst22: {kind: NameRef, arg0: name1, arg1: inst13, type: type(TypeType)} +// CHECK:STDOUT: inst23: {kind: TupleType, arg0: type_block0, type: type(TypeType)} +// CHECK:STDOUT: inst24: {kind: TupleLiteral, arg0: inst_block_empty, type: type(inst23)} +// CHECK:STDOUT: inst25: {kind: TupleType, arg0: type_block1, type: type(TypeType)} +// CHECK:STDOUT: inst26: {kind: TupleLiteral, arg0: inst_block6, type: type(inst25)} +// CHECK:STDOUT: inst27: {kind: Converted, arg0: inst24, arg1: inst23, type: type(TypeType)} +// CHECK:STDOUT: inst28: {kind: TupleType, arg0: type_block2, type: type(TypeType)} +// CHECK:STDOUT: inst29: {kind: Converted, arg0: inst26, arg1: inst28, type: type(TypeType)} +// CHECK:STDOUT: inst30: {kind: ReturnSlotPattern, arg0: inst26, type: type(symbolic_constant5)} +// CHECK:STDOUT: inst31: {kind: OutParamPattern, arg0: inst30, arg1: runtime_param1, type: type(symbolic_constant5)} +// CHECK:STDOUT: inst32: {kind: ValueParam, arg0: runtime_param, arg1: name1, type: type(TypeType)} +// CHECK:STDOUT: inst33: {kind: ValueParam, arg0: runtime_param0, arg1: name2, type: type(symbolic_constant3)} +// CHECK:STDOUT: inst34: {kind: OutParam, arg0: runtime_param1, arg1: name(ReturnSlot), type: type(symbolic_constant5)} +// CHECK:STDOUT: inst35: {kind: ReturnSlot, arg0: inst26, arg1: inst34, type: type(symbolic_constant5)} +// CHECK:STDOUT: inst36: {kind: FunctionDecl, arg0: function0, arg1: inst_block9, type: type(inst40)} +// CHECK:STDOUT: inst37: {kind: BindSymbolicName, arg0: entity_name0, arg1: inst, type: type(TypeType)} +// CHECK:STDOUT: inst38: {kind: SymbolicBindingPattern, arg0: entity_name0, type: type(TypeType)} +// CHECK:STDOUT: inst39: {kind: TupleType, arg0: type_block3, type: type(TypeType)} +// CHECK:STDOUT: inst40: {kind: FunctionType, arg0: function0, arg1: specific, type: type(TypeType)} +// CHECK:STDOUT: inst41: {kind: StructValue, arg0: inst_block_empty, type: type(inst40)} +// CHECK:STDOUT: inst42: {kind: PointerType, arg0: type(symbolic_constant2), type: type(TypeType)} +// CHECK:STDOUT: inst43: {kind: NameRef, arg0: name2, arg1: inst19, type: type(symbolic_constant3)} +// CHECK:STDOUT: inst44: {kind: TupleLiteral, arg0: inst_block_empty, type: type(inst23)} +// CHECK:STDOUT: inst45: {kind: TupleLiteral, arg0: inst_block15, type: type(symbolic_constant5)} +// CHECK:STDOUT: inst46: {kind: TupleAccess, arg0: inst35, arg1: element0, type: type(symbolic_constant3)} +// CHECK:STDOUT: inst47: {kind: InitializeFrom, arg0: inst43, arg1: inst46, type: type(symbolic_constant3)} +// CHECK:STDOUT: inst48: {kind: TupleAccess, arg0: inst35, arg1: element1, type: type(inst23)} +// CHECK:STDOUT: inst49: {kind: TupleInit, arg0: inst_block_empty, arg1: inst48, type: type(inst23)} +// CHECK:STDOUT: inst50: {kind: TupleValue, arg0: inst_block_empty, type: type(inst23)} +// CHECK:STDOUT: inst51: {kind: Converted, arg0: inst44, arg1: inst49, type: type(inst23)} +// CHECK:STDOUT: inst52: {kind: TupleInit, arg0: inst_block16, arg1: inst35, type: type(symbolic_constant5)} +// CHECK:STDOUT: inst53: {kind: Converted, arg0: inst45, arg1: inst52, type: type(symbolic_constant5)} +// CHECK:STDOUT: inst54: {kind: ReturnExpr, arg0: inst53, arg1: inst35} // CHECK:STDOUT: constant_values: -// CHECK:STDOUT: 'inst+0': template_constant(inst+0) -// CHECK:STDOUT: 'inst+1': symbolic_constant3 -// CHECK:STDOUT: 'inst+2': symbolic_constant0 -// CHECK:STDOUT: 'inst+3': symbolic_constant4 -// CHECK:STDOUT: 'inst+4': symbolic_constant1 -// CHECK:STDOUT: 'inst+5': symbolic_constant4 -// CHECK:STDOUT: 'inst+6': symbolic_constant3 -// CHECK:STDOUT: 'inst+10': symbolic_constant3 -// CHECK:STDOUT: 'inst+11': template_constant(inst+11) -// CHECK:STDOUT: 'inst+13': template_constant(inst+13) -// CHECK:STDOUT: 'inst+15': template_constant(inst+11) -// CHECK:STDOUT: 'inst+16': symbolic_constant2 -// CHECK:STDOUT: 'inst+17': symbolic_constant5 -// CHECK:STDOUT: 'inst+24': template_constant(inst+29) -// CHECK:STDOUT: 'inst+25': symbolic_constant3 -// CHECK:STDOUT: 'inst+26': symbolic_constant4 -// CHECK:STDOUT: 'inst+27': symbolic_constant5 -// CHECK:STDOUT: 'inst+28': template_constant(inst+28) -// CHECK:STDOUT: 'inst+29': template_constant(inst+29) -// CHECK:STDOUT: 'inst+30': symbolic_constant6 -// CHECK:STDOUT: 'inst+37': template_constant(inst+38) -// CHECK:STDOUT: 'inst+38': template_constant(inst+38) -// CHECK:STDOUT: 'inst+39': template_constant(inst+38) +// CHECK:STDOUT: inst12: template_constant(inst12) +// CHECK:STDOUT: inst13: symbolic_constant3 +// CHECK:STDOUT: inst14: symbolic_constant0 +// CHECK:STDOUT: inst15: symbolic_constant4 +// CHECK:STDOUT: inst16: symbolic_constant1 +// CHECK:STDOUT: inst17: symbolic_constant4 +// CHECK:STDOUT: inst18: symbolic_constant3 +// CHECK:STDOUT: inst22: symbolic_constant3 +// CHECK:STDOUT: inst23: template_constant(inst23) +// CHECK:STDOUT: inst25: template_constant(inst25) +// CHECK:STDOUT: inst27: template_constant(inst23) +// CHECK:STDOUT: inst28: symbolic_constant2 +// CHECK:STDOUT: inst29: symbolic_constant5 +// CHECK:STDOUT: inst36: template_constant(inst41) +// CHECK:STDOUT: inst37: symbolic_constant3 +// CHECK:STDOUT: inst38: symbolic_constant4 +// CHECK:STDOUT: inst39: symbolic_constant5 +// CHECK:STDOUT: inst40: template_constant(inst40) +// CHECK:STDOUT: inst41: template_constant(inst41) +// CHECK:STDOUT: inst42: symbolic_constant6 +// CHECK:STDOUT: inst49: template_constant(inst50) +// CHECK:STDOUT: inst50: template_constant(inst50) +// CHECK:STDOUT: inst51: template_constant(inst50) // CHECK:STDOUT: symbolic_constants: -// CHECK:STDOUT: symbolic_constant0: {inst: inst+2, generic: generic, index: generic_inst, .Self: false} -// CHECK:STDOUT: symbolic_constant1: {inst: inst+4, generic: generic, index: generic_inst, .Self: false} -// CHECK:STDOUT: symbolic_constant2: {inst: inst+16, generic: generic, index: generic_inst, .Self: false} -// CHECK:STDOUT: symbolic_constant3: {inst: inst+2, generic: generic0, index: generic_inst_in_decl0, .Self: false} -// CHECK:STDOUT: symbolic_constant4: {inst: inst+4, generic: generic0, index: generic_inst_in_decl1, .Self: false} -// CHECK:STDOUT: symbolic_constant5: {inst: inst+16, generic: generic0, index: generic_inst_in_decl2, .Self: false} -// CHECK:STDOUT: symbolic_constant6: {inst: inst+30, generic: generic, index: generic_inst, .Self: false} +// CHECK:STDOUT: symbolic_constant0: {inst: inst14, generic: generic, index: generic_inst, .Self: false} +// CHECK:STDOUT: symbolic_constant1: {inst: inst16, generic: generic, index: generic_inst, .Self: false} +// CHECK:STDOUT: symbolic_constant2: {inst: inst28, generic: generic, index: generic_inst, .Self: false} +// CHECK:STDOUT: symbolic_constant3: {inst: inst14, generic: generic0, index: generic_inst_in_decl0, .Self: false} +// CHECK:STDOUT: symbolic_constant4: {inst: inst16, generic: generic0, index: generic_inst_in_decl1, .Self: false} +// CHECK:STDOUT: symbolic_constant5: {inst: inst28, generic: generic0, index: generic_inst_in_decl2, .Self: false} +// CHECK:STDOUT: symbolic_constant6: {inst: inst42, generic: generic, index: generic_inst, .Self: false} // CHECK:STDOUT: inst_blocks: // CHECK:STDOUT: inst_block_empty: {} // CHECK:STDOUT: exports: -// CHECK:STDOUT: 0: inst+24 +// CHECK:STDOUT: 0: inst36 // CHECK:STDOUT: import_refs: {} // CHECK:STDOUT: global_init: {} // CHECK:STDOUT: inst_block4: -// CHECK:STDOUT: 0: inst+5 +// CHECK:STDOUT: 0: inst17 // CHECK:STDOUT: inst_block5: -// CHECK:STDOUT: 0: inst+9 +// CHECK:STDOUT: 0: inst21 // CHECK:STDOUT: inst_block6: -// CHECK:STDOUT: 0: inst+10 -// CHECK:STDOUT: 1: inst+12 +// CHECK:STDOUT: 0: inst22 +// CHECK:STDOUT: 1: inst24 // CHECK:STDOUT: inst_block7: -// CHECK:STDOUT: 0: inst+21 -// CHECK:STDOUT: 1: inst+22 +// CHECK:STDOUT: 0: inst33 +// CHECK:STDOUT: 1: inst34 // CHECK:STDOUT: inst_block8: -// CHECK:STDOUT: 0: inst+3 -// CHECK:STDOUT: 1: inst+5 -// CHECK:STDOUT: 2: inst+8 -// CHECK:STDOUT: 3: inst+9 -// CHECK:STDOUT: 4: inst+18 -// CHECK:STDOUT: 5: inst+19 +// CHECK:STDOUT: 0: inst15 +// CHECK:STDOUT: 1: inst17 +// CHECK:STDOUT: 2: inst20 +// CHECK:STDOUT: 3: inst21 +// CHECK:STDOUT: 4: inst30 +// CHECK:STDOUT: 5: inst31 // CHECK:STDOUT: inst_block9: -// CHECK:STDOUT: 0: inst+6 -// CHECK:STDOUT: 1: inst+10 -// CHECK:STDOUT: 2: inst+12 -// CHECK:STDOUT: 3: inst+14 -// CHECK:STDOUT: 4: inst+15 -// CHECK:STDOUT: 5: inst+17 -// CHECK:STDOUT: 6: inst+20 -// CHECK:STDOUT: 7: inst+1 -// CHECK:STDOUT: 8: inst+21 -// CHECK:STDOUT: 9: inst+7 -// CHECK:STDOUT: 10: inst+22 -// CHECK:STDOUT: 11: inst+23 +// CHECK:STDOUT: 0: inst18 +// CHECK:STDOUT: 1: inst22 +// CHECK:STDOUT: 2: inst24 +// CHECK:STDOUT: 3: inst26 +// CHECK:STDOUT: 4: inst27 +// CHECK:STDOUT: 5: inst29 +// CHECK:STDOUT: 6: inst32 +// CHECK:STDOUT: 7: inst13 +// CHECK:STDOUT: 8: inst33 +// CHECK:STDOUT: 9: inst19 +// CHECK:STDOUT: 10: inst34 +// CHECK:STDOUT: 11: inst35 // CHECK:STDOUT: inst_block10: -// CHECK:STDOUT: 0: inst+1 +// CHECK:STDOUT: 0: inst13 // CHECK:STDOUT: inst_block11: -// CHECK:STDOUT: 0: inst+25 -// CHECK:STDOUT: 1: inst+26 -// CHECK:STDOUT: 2: inst+27 +// CHECK:STDOUT: 0: inst37 +// CHECK:STDOUT: 1: inst38 +// CHECK:STDOUT: 2: inst39 // CHECK:STDOUT: inst_block12: -// CHECK:STDOUT: 0: inst+2 +// CHECK:STDOUT: 0: inst14 // CHECK:STDOUT: inst_block13: -// CHECK:STDOUT: 0: inst+2 -// CHECK:STDOUT: 1: inst+2 -// CHECK:STDOUT: 2: inst+16 +// CHECK:STDOUT: 0: inst14 +// CHECK:STDOUT: 1: inst14 +// CHECK:STDOUT: 2: inst28 // CHECK:STDOUT: inst_block14: -// CHECK:STDOUT: 0: inst+31 -// CHECK:STDOUT: 1: inst+32 -// CHECK:STDOUT: 2: inst+33 -// CHECK:STDOUT: 3: inst+34 -// CHECK:STDOUT: 4: inst+35 -// CHECK:STDOUT: 5: inst+36 -// CHECK:STDOUT: 6: inst+37 -// CHECK:STDOUT: 7: inst+39 -// CHECK:STDOUT: 8: inst+40 -// CHECK:STDOUT: 9: inst+41 -// CHECK:STDOUT: 10: inst+42 +// CHECK:STDOUT: 0: inst43 +// CHECK:STDOUT: 1: inst44 +// CHECK:STDOUT: 2: inst45 +// CHECK:STDOUT: 3: inst46 +// CHECK:STDOUT: 4: inst47 +// CHECK:STDOUT: 5: inst48 +// CHECK:STDOUT: 6: inst49 +// CHECK:STDOUT: 7: inst51 +// CHECK:STDOUT: 8: inst52 +// CHECK:STDOUT: 9: inst53 +// CHECK:STDOUT: 10: inst54 // CHECK:STDOUT: inst_block15: -// CHECK:STDOUT: 0: inst+31 -// CHECK:STDOUT: 1: inst+32 +// CHECK:STDOUT: 0: inst43 +// CHECK:STDOUT: 1: inst44 // CHECK:STDOUT: inst_block16: -// CHECK:STDOUT: 0: inst+35 -// CHECK:STDOUT: 1: inst+39 +// CHECK:STDOUT: 0: inst47 +// CHECK:STDOUT: 1: inst51 // CHECK:STDOUT: inst_block17: -// CHECK:STDOUT: 0: inst+0 -// CHECK:STDOUT: 1: inst+24 +// CHECK:STDOUT: 0: inst12 +// CHECK:STDOUT: 1: inst36 // CHECK:STDOUT: ... diff --git a/toolchain/check/testdata/basics/no_prelude/verbose.carbon b/toolchain/check/testdata/basics/no_prelude/verbose.carbon index ff9fe57008a7e..2da1a1e033f3f 100644 --- a/toolchain/check/testdata/basics/no_prelude/verbose.carbon +++ b/toolchain/check/testdata/basics/no_prelude/verbose.carbon @@ -13,7 +13,7 @@ // SET-CHECK-SUBSET // CHECK:STDERR: Node Push 0: FunctionIntroducer -> // CHECK:STDERR: AddPlaceholderInst: {kind: FunctionDecl, arg0: function, arg1: inst_block_empty} -// CHECK:STDERR: ReplaceInst: inst+{{[0-9]+}} -> {kind: FunctionDecl, arg0: function{{[0-9]+}}, arg1: inst_block_empty, type: type(inst+{{[0-9]+}})} +// CHECK:STDERR: ReplaceInst: inst{{[0-9]+}} -> {kind: FunctionDecl, arg0: function{{[0-9]+}}, arg1: inst_block_empty, type: type(inst{{[0-9]+}})} // CHECK:STDERR: inst_block_stack_ Push 1 // CHECK:STDERR: AddInst: {kind: Return} // CHECK:STDERR: inst_block_stack_ Pop 1: inst_block{{[0-9]+}} diff --git a/toolchain/check/testdata/builtins/bool/make_type.carbon b/toolchain/check/testdata/builtins/bool/make_type.carbon index e48291448b5d5..272bc28ae7ac5 100644 --- a/toolchain/check/testdata/builtins/bool/make_type.carbon +++ b/toolchain/check/testdata/builtins/bool/make_type.carbon @@ -62,7 +62,7 @@ var b: Bool() = false; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref: %Bool.type = import_ref Main//types, inst+7, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref: %Bool.type = import_ref Main//types, Bool, loaded [template = constants.%Bool] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... diff --git a/toolchain/check/testdata/builtins/float/make_type.carbon b/toolchain/check/testdata/builtins/float/make_type.carbon index 652023b9c9373..b94b72d37f769 100644 --- a/toolchain/check/testdata/builtins/float/make_type.carbon +++ b/toolchain/check/testdata/builtins/float/make_type.carbon @@ -111,7 +111,7 @@ var dyn: Float(dyn_size); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref Main//types, inst+26, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref Main//types, Float, loaded [template = constants.%Float] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: .Int = %import_ref.38 @@ -201,7 +201,7 @@ var dyn: Float(dyn_size); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref Main//types, inst+26, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref Main//types, Float, loaded [template = constants.%Float] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: .Int = %import_ref.38 diff --git a/toolchain/check/testdata/builtins/int/convert_checked.carbon b/toolchain/check/testdata/builtins/int/convert_checked.carbon index 09174ab698b0d..19dab04fe00f0 100644 --- a/toolchain/check/testdata/builtins/int/convert_checked.carbon +++ b/toolchain/check/testdata/builtins/int/convert_checked.carbon @@ -832,27 +832,27 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %NegateI32.type = import_ref Main//int_ops, inst+30, loaded [template = constants.%NegateI32] -// CHECK:STDOUT: %import_ref.2: %SubI32.type = import_ref Main//int_ops, inst+57, loaded [template = constants.%SubI32] -// CHECK:STDOUT: %import_ref.3 = import_ref Main//int_ops, inst+93, unloaded -// CHECK:STDOUT: %import_ref.4: %IntLiteral.type = import_ref Main//int_ops, inst+100, loaded [template = constants.%IntLiteral] -// CHECK:STDOUT: %import_ref.5: %Int32ToInt32.type = import_ref Main//int_ops, inst+119, loaded [template = constants.%Int32ToInt32] -// CHECK:STDOUT: %import_ref.6 = import_ref Main//int_ops, inst+138, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref Main//int_ops, inst+157, unloaded -// CHECK:STDOUT: %import_ref.8 = import_ref Main//int_ops, inst+176, unloaded -// CHECK:STDOUT: %import_ref.9: %IntLiteralToIntLiteral.type = import_ref Main//int_ops, inst+195, loaded [template = constants.%IntLiteralToIntLiteral] -// CHECK:STDOUT: %import_ref.10 = import_ref Main//int_ops, inst+216, unloaded -// CHECK:STDOUT: %import_ref.11 = import_ref Main//int_ops, inst+236, unloaded -// CHECK:STDOUT: %import_ref.12 = import_ref Main//int_ops, inst+255, unloaded -// CHECK:STDOUT: %import_ref.13 = import_ref Main//int_ops, inst+274, unloaded -// CHECK:STDOUT: %import_ref.14 = import_ref Main//int_ops, inst+293, unloaded -// CHECK:STDOUT: %import_ref.15 = import_ref Main//int_ops, inst+312, unloaded -// CHECK:STDOUT: %import_ref.16 = import_ref Main//int_ops, inst+333, unloaded -// CHECK:STDOUT: %import_ref.17 = import_ref Main//int_ops, inst+353, unloaded -// CHECK:STDOUT: %import_ref.18 = import_ref Main//int_ops, inst+372, unloaded -// CHECK:STDOUT: %import_ref.19 = import_ref Main//int_ops, inst+391, unloaded -// CHECK:STDOUT: %import_ref.20: %Int32ToIntLiteral.type = import_ref Main//int_ops, inst+410, loaded [template = constants.%Int32ToIntLiteral] -// CHECK:STDOUT: %import_ref.21 = import_ref Main//int_ops, inst+429, unloaded +// CHECK:STDOUT: %import_ref.1: %NegateI32.type = import_ref Main//int_ops, NegateI32, loaded [template = constants.%NegateI32] +// CHECK:STDOUT: %import_ref.2: %SubI32.type = import_ref Main//int_ops, SubI32, loaded [template = constants.%SubI32] +// CHECK:STDOUT: %import_ref.3 = import_ref Main//int_ops, AddU32, unloaded +// CHECK:STDOUT: %import_ref.4: %IntLiteral.type = import_ref Main//int_ops, IntLiteral, loaded [template = constants.%IntLiteral] +// CHECK:STDOUT: %import_ref.5: %Int32ToInt32.type = import_ref Main//int_ops, Int32ToInt32, loaded [template = constants.%Int32ToInt32] +// CHECK:STDOUT: %import_ref.6 = import_ref Main//int_ops, Int32ToUint32, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Main//int_ops, Uint32ToInt32, unloaded +// CHECK:STDOUT: %import_ref.8 = import_ref Main//int_ops, Uint32ToUint32, unloaded +// CHECK:STDOUT: %import_ref.9: %IntLiteralToIntLiteral.type = import_ref Main//int_ops, IntLiteralToIntLiteral, loaded [template = constants.%IntLiteralToIntLiteral] +// CHECK:STDOUT: %import_ref.10 = import_ref Main//int_ops, Int32ToInt16, unloaded +// CHECK:STDOUT: %import_ref.11 = import_ref Main//int_ops, Int32ToUint16, unloaded +// CHECK:STDOUT: %import_ref.12 = import_ref Main//int_ops, Uint32ToInt16, unloaded +// CHECK:STDOUT: %import_ref.13 = import_ref Main//int_ops, Uint32ToUint16, unloaded +// CHECK:STDOUT: %import_ref.14 = import_ref Main//int_ops, IntLiteralToInt16, unloaded +// CHECK:STDOUT: %import_ref.15 = import_ref Main//int_ops, IntLiteralToUint16, unloaded +// CHECK:STDOUT: %import_ref.16 = import_ref Main//int_ops, Int32ToInt64, unloaded +// CHECK:STDOUT: %import_ref.17 = import_ref Main//int_ops, Int32ToUint64, unloaded +// CHECK:STDOUT: %import_ref.18 = import_ref Main//int_ops, Uint32ToInt64, unloaded +// CHECK:STDOUT: %import_ref.19 = import_ref Main//int_ops, Uint32ToUint64, unloaded +// CHECK:STDOUT: %import_ref.20: %Int32ToIntLiteral.type = import_ref Main//int_ops, Int32ToIntLiteral, loaded [template = constants.%Int32ToIntLiteral] +// CHECK:STDOUT: %import_ref.21 = import_ref Main//int_ops, Uint32ToUintLiteral, unloaded // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.22 // CHECK:STDOUT: .ImplicitAs = %import_ref.23 @@ -1024,27 +1024,27 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1 = import_ref Main//int_ops, inst+30, unloaded -// CHECK:STDOUT: %import_ref.2 = import_ref Main//int_ops, inst+57, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref Main//int_ops, inst+93, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Main//int_ops, inst+100, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Main//int_ops, inst+119, unloaded -// CHECK:STDOUT: %import_ref.6: %Int32ToUint32.type = import_ref Main//int_ops, inst+138, loaded [template = constants.%Int32ToUint32] -// CHECK:STDOUT: %import_ref.7: %Uint32ToInt32.type = import_ref Main//int_ops, inst+157, loaded [template = constants.%Uint32ToInt32] -// CHECK:STDOUT: %import_ref.8 = import_ref Main//int_ops, inst+176, unloaded -// CHECK:STDOUT: %import_ref.9 = import_ref Main//int_ops, inst+195, unloaded -// CHECK:STDOUT: %import_ref.10 = import_ref Main//int_ops, inst+216, unloaded -// CHECK:STDOUT: %import_ref.11 = import_ref Main//int_ops, inst+236, unloaded -// CHECK:STDOUT: %import_ref.12 = import_ref Main//int_ops, inst+255, unloaded -// CHECK:STDOUT: %import_ref.13 = import_ref Main//int_ops, inst+274, unloaded -// CHECK:STDOUT: %import_ref.14 = import_ref Main//int_ops, inst+293, unloaded -// CHECK:STDOUT: %import_ref.15 = import_ref Main//int_ops, inst+312, unloaded -// CHECK:STDOUT: %import_ref.16 = import_ref Main//int_ops, inst+333, unloaded -// CHECK:STDOUT: %import_ref.17 = import_ref Main//int_ops, inst+353, unloaded -// CHECK:STDOUT: %import_ref.18 = import_ref Main//int_ops, inst+372, unloaded -// CHECK:STDOUT: %import_ref.19 = import_ref Main//int_ops, inst+391, unloaded -// CHECK:STDOUT: %import_ref.20 = import_ref Main//int_ops, inst+410, unloaded -// CHECK:STDOUT: %import_ref.21 = import_ref Main//int_ops, inst+429, unloaded +// CHECK:STDOUT: %import_ref.1 = import_ref Main//int_ops, NegateI32, unloaded +// CHECK:STDOUT: %import_ref.2 = import_ref Main//int_ops, SubI32, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref Main//int_ops, AddU32, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Main//int_ops, IntLiteral, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref Main//int_ops, Int32ToInt32, unloaded +// CHECK:STDOUT: %import_ref.6: %Int32ToUint32.type = import_ref Main//int_ops, Int32ToUint32, loaded [template = constants.%Int32ToUint32] +// CHECK:STDOUT: %import_ref.7: %Uint32ToInt32.type = import_ref Main//int_ops, Uint32ToInt32, loaded [template = constants.%Uint32ToInt32] +// CHECK:STDOUT: %import_ref.8 = import_ref Main//int_ops, Uint32ToUint32, unloaded +// CHECK:STDOUT: %import_ref.9 = import_ref Main//int_ops, IntLiteralToIntLiteral, unloaded +// CHECK:STDOUT: %import_ref.10 = import_ref Main//int_ops, Int32ToInt16, unloaded +// CHECK:STDOUT: %import_ref.11 = import_ref Main//int_ops, Int32ToUint16, unloaded +// CHECK:STDOUT: %import_ref.12 = import_ref Main//int_ops, Uint32ToInt16, unloaded +// CHECK:STDOUT: %import_ref.13 = import_ref Main//int_ops, Uint32ToUint16, unloaded +// CHECK:STDOUT: %import_ref.14 = import_ref Main//int_ops, IntLiteralToInt16, unloaded +// CHECK:STDOUT: %import_ref.15 = import_ref Main//int_ops, IntLiteralToUint16, unloaded +// CHECK:STDOUT: %import_ref.16 = import_ref Main//int_ops, Int32ToInt64, unloaded +// CHECK:STDOUT: %import_ref.17 = import_ref Main//int_ops, Int32ToUint64, unloaded +// CHECK:STDOUT: %import_ref.18 = import_ref Main//int_ops, Uint32ToInt64, unloaded +// CHECK:STDOUT: %import_ref.19 = import_ref Main//int_ops, Uint32ToUint64, unloaded +// CHECK:STDOUT: %import_ref.20 = import_ref Main//int_ops, Int32ToIntLiteral, unloaded +// CHECK:STDOUT: %import_ref.21 = import_ref Main//int_ops, Uint32ToUintLiteral, unloaded // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .UInt = %import_ref.22 // CHECK:STDOUT: .ImplicitAs = %import_ref.23 @@ -1194,27 +1194,27 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %NegateI32.type = import_ref Main//int_ops, inst+30, loaded [template = constants.%NegateI32] -// CHECK:STDOUT: %import_ref.2 = import_ref Main//int_ops, inst+57, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref Main//int_ops, inst+93, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Main//int_ops, inst+100, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Main//int_ops, inst+119, unloaded -// CHECK:STDOUT: %import_ref.6: %Int32ToUint32.type = import_ref Main//int_ops, inst+138, loaded [template = constants.%Int32ToUint32] -// CHECK:STDOUT: %import_ref.7 = import_ref Main//int_ops, inst+157, unloaded -// CHECK:STDOUT: %import_ref.8 = import_ref Main//int_ops, inst+176, unloaded -// CHECK:STDOUT: %import_ref.9 = import_ref Main//int_ops, inst+195, unloaded -// CHECK:STDOUT: %import_ref.10: %Int32ToInt16.type = import_ref Main//int_ops, inst+216, loaded [template = constants.%Int32ToInt16] -// CHECK:STDOUT: %import_ref.11: %Int32ToUint16.type = import_ref Main//int_ops, inst+236, loaded [template = constants.%Int32ToUint16] -// CHECK:STDOUT: %import_ref.12: %Uint32ToInt16.type = import_ref Main//int_ops, inst+255, loaded [template = constants.%Uint32ToInt16] -// CHECK:STDOUT: %import_ref.13: %Uint32ToUint16.type = import_ref Main//int_ops, inst+274, loaded [template = constants.%Uint32ToUint16] -// CHECK:STDOUT: %import_ref.14: %IntLiteralToInt16.type = import_ref Main//int_ops, inst+293, loaded [template = constants.%IntLiteralToInt16] -// CHECK:STDOUT: %import_ref.15: %IntLiteralToUint16.type = import_ref Main//int_ops, inst+312, loaded [template = constants.%IntLiteralToUint16] -// CHECK:STDOUT: %import_ref.16 = import_ref Main//int_ops, inst+333, unloaded -// CHECK:STDOUT: %import_ref.17 = import_ref Main//int_ops, inst+353, unloaded -// CHECK:STDOUT: %import_ref.18 = import_ref Main//int_ops, inst+372, unloaded -// CHECK:STDOUT: %import_ref.19 = import_ref Main//int_ops, inst+391, unloaded -// CHECK:STDOUT: %import_ref.20: %Int32ToIntLiteral.type = import_ref Main//int_ops, inst+410, loaded [template = constants.%Int32ToIntLiteral] -// CHECK:STDOUT: %import_ref.21 = import_ref Main//int_ops, inst+429, unloaded +// CHECK:STDOUT: %import_ref.1: %NegateI32.type = import_ref Main//int_ops, NegateI32, loaded [template = constants.%NegateI32] +// CHECK:STDOUT: %import_ref.2 = import_ref Main//int_ops, SubI32, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref Main//int_ops, AddU32, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Main//int_ops, IntLiteral, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref Main//int_ops, Int32ToInt32, unloaded +// CHECK:STDOUT: %import_ref.6: %Int32ToUint32.type = import_ref Main//int_ops, Int32ToUint32, loaded [template = constants.%Int32ToUint32] +// CHECK:STDOUT: %import_ref.7 = import_ref Main//int_ops, Uint32ToInt32, unloaded +// CHECK:STDOUT: %import_ref.8 = import_ref Main//int_ops, Uint32ToUint32, unloaded +// CHECK:STDOUT: %import_ref.9 = import_ref Main//int_ops, IntLiteralToIntLiteral, unloaded +// CHECK:STDOUT: %import_ref.10: %Int32ToInt16.type = import_ref Main//int_ops, Int32ToInt16, loaded [template = constants.%Int32ToInt16] +// CHECK:STDOUT: %import_ref.11: %Int32ToUint16.type = import_ref Main//int_ops, Int32ToUint16, loaded [template = constants.%Int32ToUint16] +// CHECK:STDOUT: %import_ref.12: %Uint32ToInt16.type = import_ref Main//int_ops, Uint32ToInt16, loaded [template = constants.%Uint32ToInt16] +// CHECK:STDOUT: %import_ref.13: %Uint32ToUint16.type = import_ref Main//int_ops, Uint32ToUint16, loaded [template = constants.%Uint32ToUint16] +// CHECK:STDOUT: %import_ref.14: %IntLiteralToInt16.type = import_ref Main//int_ops, IntLiteralToInt16, loaded [template = constants.%IntLiteralToInt16] +// CHECK:STDOUT: %import_ref.15: %IntLiteralToUint16.type = import_ref Main//int_ops, IntLiteralToUint16, loaded [template = constants.%IntLiteralToUint16] +// CHECK:STDOUT: %import_ref.16 = import_ref Main//int_ops, Int32ToInt64, unloaded +// CHECK:STDOUT: %import_ref.17 = import_ref Main//int_ops, Int32ToUint64, unloaded +// CHECK:STDOUT: %import_ref.18 = import_ref Main//int_ops, Uint32ToInt64, unloaded +// CHECK:STDOUT: %import_ref.19 = import_ref Main//int_ops, Uint32ToUint64, unloaded +// CHECK:STDOUT: %import_ref.20: %Int32ToIntLiteral.type = import_ref Main//int_ops, Int32ToIntLiteral, loaded [template = constants.%Int32ToIntLiteral] +// CHECK:STDOUT: %import_ref.21 = import_ref Main//int_ops, Uint32ToUintLiteral, unloaded // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .UInt = %import_ref.22 // CHECK:STDOUT: .ImplicitAs = %import_ref.23 @@ -1569,27 +1569,27 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1 = import_ref Main//int_ops, inst+30, unloaded -// CHECK:STDOUT: %import_ref.2 = import_ref Main//int_ops, inst+57, unloaded -// CHECK:STDOUT: %import_ref.3: %AddU32.type = import_ref Main//int_ops, inst+93, loaded [template = constants.%AddU32] -// CHECK:STDOUT: %import_ref.4 = import_ref Main//int_ops, inst+100, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Main//int_ops, inst+119, unloaded -// CHECK:STDOUT: %import_ref.6: %Int32ToUint32.type = import_ref Main//int_ops, inst+138, loaded [template = constants.%Int32ToUint32] -// CHECK:STDOUT: %import_ref.7 = import_ref Main//int_ops, inst+157, unloaded -// CHECK:STDOUT: %import_ref.8 = import_ref Main//int_ops, inst+176, unloaded -// CHECK:STDOUT: %import_ref.9 = import_ref Main//int_ops, inst+195, unloaded -// CHECK:STDOUT: %import_ref.10 = import_ref Main//int_ops, inst+216, unloaded -// CHECK:STDOUT: %import_ref.11 = import_ref Main//int_ops, inst+236, unloaded -// CHECK:STDOUT: %import_ref.12 = import_ref Main//int_ops, inst+255, unloaded -// CHECK:STDOUT: %import_ref.13 = import_ref Main//int_ops, inst+274, unloaded -// CHECK:STDOUT: %import_ref.14 = import_ref Main//int_ops, inst+293, unloaded -// CHECK:STDOUT: %import_ref.15 = import_ref Main//int_ops, inst+312, unloaded -// CHECK:STDOUT: %import_ref.16 = import_ref Main//int_ops, inst+333, unloaded -// CHECK:STDOUT: %import_ref.17 = import_ref Main//int_ops, inst+353, unloaded -// CHECK:STDOUT: %import_ref.18: %Uint32ToInt64.type = import_ref Main//int_ops, inst+372, loaded [template = constants.%Uint32ToInt64] -// CHECK:STDOUT: %import_ref.19: %Uint32ToUint64.type = import_ref Main//int_ops, inst+391, loaded [template = constants.%Uint32ToUint64] -// CHECK:STDOUT: %import_ref.20 = import_ref Main//int_ops, inst+410, unloaded -// CHECK:STDOUT: %import_ref.21 = import_ref Main//int_ops, inst+429, unloaded +// CHECK:STDOUT: %import_ref.1 = import_ref Main//int_ops, NegateI32, unloaded +// CHECK:STDOUT: %import_ref.2 = import_ref Main//int_ops, SubI32, unloaded +// CHECK:STDOUT: %import_ref.3: %AddU32.type = import_ref Main//int_ops, AddU32, loaded [template = constants.%AddU32] +// CHECK:STDOUT: %import_ref.4 = import_ref Main//int_ops, IntLiteral, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref Main//int_ops, Int32ToInt32, unloaded +// CHECK:STDOUT: %import_ref.6: %Int32ToUint32.type = import_ref Main//int_ops, Int32ToUint32, loaded [template = constants.%Int32ToUint32] +// CHECK:STDOUT: %import_ref.7 = import_ref Main//int_ops, Uint32ToInt32, unloaded +// CHECK:STDOUT: %import_ref.8 = import_ref Main//int_ops, Uint32ToUint32, unloaded +// CHECK:STDOUT: %import_ref.9 = import_ref Main//int_ops, IntLiteralToIntLiteral, unloaded +// CHECK:STDOUT: %import_ref.10 = import_ref Main//int_ops, Int32ToInt16, unloaded +// CHECK:STDOUT: %import_ref.11 = import_ref Main//int_ops, Int32ToUint16, unloaded +// CHECK:STDOUT: %import_ref.12 = import_ref Main//int_ops, Uint32ToInt16, unloaded +// CHECK:STDOUT: %import_ref.13 = import_ref Main//int_ops, Uint32ToUint16, unloaded +// CHECK:STDOUT: %import_ref.14 = import_ref Main//int_ops, IntLiteralToInt16, unloaded +// CHECK:STDOUT: %import_ref.15 = import_ref Main//int_ops, IntLiteralToUint16, unloaded +// CHECK:STDOUT: %import_ref.16 = import_ref Main//int_ops, Int32ToInt64, unloaded +// CHECK:STDOUT: %import_ref.17 = import_ref Main//int_ops, Int32ToUint64, unloaded +// CHECK:STDOUT: %import_ref.18: %Uint32ToInt64.type = import_ref Main//int_ops, Uint32ToInt64, loaded [template = constants.%Uint32ToInt64] +// CHECK:STDOUT: %import_ref.19: %Uint32ToUint64.type = import_ref Main//int_ops, Uint32ToUint64, loaded [template = constants.%Uint32ToUint64] +// CHECK:STDOUT: %import_ref.20 = import_ref Main//int_ops, Int32ToIntLiteral, unloaded +// CHECK:STDOUT: %import_ref.21 = import_ref Main//int_ops, Uint32ToUintLiteral, unloaded // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .UInt = %import_ref.22 // CHECK:STDOUT: .ImplicitAs = %import_ref.23 @@ -1830,27 +1830,27 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %NegateI32.type = import_ref Main//int_ops, inst+30, loaded [template = constants.%NegateI32] -// CHECK:STDOUT: %import_ref.2: %SubI32.type = import_ref Main//int_ops, inst+57, loaded [template = constants.%SubI32] -// CHECK:STDOUT: %import_ref.3 = import_ref Main//int_ops, inst+93, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Main//int_ops, inst+100, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Main//int_ops, inst+119, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Main//int_ops, inst+138, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref Main//int_ops, inst+157, unloaded -// CHECK:STDOUT: %import_ref.8 = import_ref Main//int_ops, inst+176, unloaded -// CHECK:STDOUT: %import_ref.9 = import_ref Main//int_ops, inst+195, unloaded -// CHECK:STDOUT: %import_ref.10 = import_ref Main//int_ops, inst+216, unloaded -// CHECK:STDOUT: %import_ref.11 = import_ref Main//int_ops, inst+236, unloaded -// CHECK:STDOUT: %import_ref.12 = import_ref Main//int_ops, inst+255, unloaded -// CHECK:STDOUT: %import_ref.13 = import_ref Main//int_ops, inst+274, unloaded -// CHECK:STDOUT: %import_ref.14 = import_ref Main//int_ops, inst+293, unloaded -// CHECK:STDOUT: %import_ref.15 = import_ref Main//int_ops, inst+312, unloaded -// CHECK:STDOUT: %import_ref.16: %Int32ToInt64.type = import_ref Main//int_ops, inst+333, loaded [template = constants.%Int32ToInt64] -// CHECK:STDOUT: %import_ref.17: %Int32ToUint64.type = import_ref Main//int_ops, inst+353, loaded [template = constants.%Int32ToUint64] -// CHECK:STDOUT: %import_ref.18 = import_ref Main//int_ops, inst+372, unloaded -// CHECK:STDOUT: %import_ref.19 = import_ref Main//int_ops, inst+391, unloaded -// CHECK:STDOUT: %import_ref.20 = import_ref Main//int_ops, inst+410, unloaded -// CHECK:STDOUT: %import_ref.21 = import_ref Main//int_ops, inst+429, unloaded +// CHECK:STDOUT: %import_ref.1: %NegateI32.type = import_ref Main//int_ops, NegateI32, loaded [template = constants.%NegateI32] +// CHECK:STDOUT: %import_ref.2: %SubI32.type = import_ref Main//int_ops, SubI32, loaded [template = constants.%SubI32] +// CHECK:STDOUT: %import_ref.3 = import_ref Main//int_ops, AddU32, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Main//int_ops, IntLiteral, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref Main//int_ops, Int32ToInt32, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Main//int_ops, Int32ToUint32, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Main//int_ops, Uint32ToInt32, unloaded +// CHECK:STDOUT: %import_ref.8 = import_ref Main//int_ops, Uint32ToUint32, unloaded +// CHECK:STDOUT: %import_ref.9 = import_ref Main//int_ops, IntLiteralToIntLiteral, unloaded +// CHECK:STDOUT: %import_ref.10 = import_ref Main//int_ops, Int32ToInt16, unloaded +// CHECK:STDOUT: %import_ref.11 = import_ref Main//int_ops, Int32ToUint16, unloaded +// CHECK:STDOUT: %import_ref.12 = import_ref Main//int_ops, Uint32ToInt16, unloaded +// CHECK:STDOUT: %import_ref.13 = import_ref Main//int_ops, Uint32ToUint16, unloaded +// CHECK:STDOUT: %import_ref.14 = import_ref Main//int_ops, IntLiteralToInt16, unloaded +// CHECK:STDOUT: %import_ref.15 = import_ref Main//int_ops, IntLiteralToUint16, unloaded +// CHECK:STDOUT: %import_ref.16: %Int32ToInt64.type = import_ref Main//int_ops, Int32ToInt64, loaded [template = constants.%Int32ToInt64] +// CHECK:STDOUT: %import_ref.17: %Int32ToUint64.type = import_ref Main//int_ops, Int32ToUint64, loaded [template = constants.%Int32ToUint64] +// CHECK:STDOUT: %import_ref.18 = import_ref Main//int_ops, Uint32ToInt64, unloaded +// CHECK:STDOUT: %import_ref.19 = import_ref Main//int_ops, Uint32ToUint64, unloaded +// CHECK:STDOUT: %import_ref.20 = import_ref Main//int_ops, Int32ToIntLiteral, unloaded +// CHECK:STDOUT: %import_ref.21 = import_ref Main//int_ops, Uint32ToUintLiteral, unloaded // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .UInt = %import_ref.22 // CHECK:STDOUT: .ImplicitAs = %import_ref.23 @@ -2018,27 +2018,27 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1 = import_ref Main//int_ops, inst+30, unloaded -// CHECK:STDOUT: %import_ref.2 = import_ref Main//int_ops, inst+57, unloaded -// CHECK:STDOUT: %import_ref.3: %AddU32.type = import_ref Main//int_ops, inst+93, loaded [template = constants.%AddU32] -// CHECK:STDOUT: %import_ref.4 = import_ref Main//int_ops, inst+100, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Main//int_ops, inst+119, unloaded -// CHECK:STDOUT: %import_ref.6: %Int32ToUint32.type = import_ref Main//int_ops, inst+138, loaded [template = constants.%Int32ToUint32] -// CHECK:STDOUT: %import_ref.7: %Uint32ToInt32.type = import_ref Main//int_ops, inst+157, loaded [template = constants.%Uint32ToInt32] -// CHECK:STDOUT: %import_ref.8 = import_ref Main//int_ops, inst+176, unloaded -// CHECK:STDOUT: %import_ref.9 = import_ref Main//int_ops, inst+195, unloaded -// CHECK:STDOUT: %import_ref.10 = import_ref Main//int_ops, inst+216, unloaded -// CHECK:STDOUT: %import_ref.11 = import_ref Main//int_ops, inst+236, unloaded -// CHECK:STDOUT: %import_ref.12 = import_ref Main//int_ops, inst+255, unloaded -// CHECK:STDOUT: %import_ref.13 = import_ref Main//int_ops, inst+274, unloaded -// CHECK:STDOUT: %import_ref.14 = import_ref Main//int_ops, inst+293, unloaded -// CHECK:STDOUT: %import_ref.15 = import_ref Main//int_ops, inst+312, unloaded -// CHECK:STDOUT: %import_ref.16 = import_ref Main//int_ops, inst+333, unloaded -// CHECK:STDOUT: %import_ref.17 = import_ref Main//int_ops, inst+353, unloaded -// CHECK:STDOUT: %import_ref.18 = import_ref Main//int_ops, inst+372, unloaded -// CHECK:STDOUT: %import_ref.19 = import_ref Main//int_ops, inst+391, unloaded -// CHECK:STDOUT: %import_ref.20 = import_ref Main//int_ops, inst+410, unloaded -// CHECK:STDOUT: %import_ref.21 = import_ref Main//int_ops, inst+429, unloaded +// CHECK:STDOUT: %import_ref.1 = import_ref Main//int_ops, NegateI32, unloaded +// CHECK:STDOUT: %import_ref.2 = import_ref Main//int_ops, SubI32, unloaded +// CHECK:STDOUT: %import_ref.3: %AddU32.type = import_ref Main//int_ops, AddU32, loaded [template = constants.%AddU32] +// CHECK:STDOUT: %import_ref.4 = import_ref Main//int_ops, IntLiteral, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref Main//int_ops, Int32ToInt32, unloaded +// CHECK:STDOUT: %import_ref.6: %Int32ToUint32.type = import_ref Main//int_ops, Int32ToUint32, loaded [template = constants.%Int32ToUint32] +// CHECK:STDOUT: %import_ref.7: %Uint32ToInt32.type = import_ref Main//int_ops, Uint32ToInt32, loaded [template = constants.%Uint32ToInt32] +// CHECK:STDOUT: %import_ref.8 = import_ref Main//int_ops, Uint32ToUint32, unloaded +// CHECK:STDOUT: %import_ref.9 = import_ref Main//int_ops, IntLiteralToIntLiteral, unloaded +// CHECK:STDOUT: %import_ref.10 = import_ref Main//int_ops, Int32ToInt16, unloaded +// CHECK:STDOUT: %import_ref.11 = import_ref Main//int_ops, Int32ToUint16, unloaded +// CHECK:STDOUT: %import_ref.12 = import_ref Main//int_ops, Uint32ToInt16, unloaded +// CHECK:STDOUT: %import_ref.13 = import_ref Main//int_ops, Uint32ToUint16, unloaded +// CHECK:STDOUT: %import_ref.14 = import_ref Main//int_ops, IntLiteralToInt16, unloaded +// CHECK:STDOUT: %import_ref.15 = import_ref Main//int_ops, IntLiteralToUint16, unloaded +// CHECK:STDOUT: %import_ref.16 = import_ref Main//int_ops, Int32ToInt64, unloaded +// CHECK:STDOUT: %import_ref.17 = import_ref Main//int_ops, Int32ToUint64, unloaded +// CHECK:STDOUT: %import_ref.18 = import_ref Main//int_ops, Uint32ToInt64, unloaded +// CHECK:STDOUT: %import_ref.19 = import_ref Main//int_ops, Uint32ToUint64, unloaded +// CHECK:STDOUT: %import_ref.20 = import_ref Main//int_ops, Int32ToIntLiteral, unloaded +// CHECK:STDOUT: %import_ref.21 = import_ref Main//int_ops, Uint32ToUintLiteral, unloaded // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.22 // CHECK:STDOUT: .ImplicitAs = %import_ref.23 @@ -2146,27 +2146,27 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1 = import_ref Main//int_ops, inst+30, unloaded -// CHECK:STDOUT: %import_ref.2 = import_ref Main//int_ops, inst+57, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref Main//int_ops, inst+93, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Main//int_ops, inst+100, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Main//int_ops, inst+119, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Main//int_ops, inst+138, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref Main//int_ops, inst+157, unloaded -// CHECK:STDOUT: %import_ref.8 = import_ref Main//int_ops, inst+176, unloaded -// CHECK:STDOUT: %import_ref.9 = import_ref Main//int_ops, inst+195, unloaded -// CHECK:STDOUT: %import_ref.10: %Int32ToInt16.type = import_ref Main//int_ops, inst+216, loaded [template = constants.%Int32ToInt16] -// CHECK:STDOUT: %import_ref.11 = import_ref Main//int_ops, inst+236, unloaded -// CHECK:STDOUT: %import_ref.12 = import_ref Main//int_ops, inst+255, unloaded -// CHECK:STDOUT: %import_ref.13 = import_ref Main//int_ops, inst+274, unloaded -// CHECK:STDOUT: %import_ref.14 = import_ref Main//int_ops, inst+293, unloaded -// CHECK:STDOUT: %import_ref.15 = import_ref Main//int_ops, inst+312, unloaded -// CHECK:STDOUT: %import_ref.16 = import_ref Main//int_ops, inst+333, unloaded -// CHECK:STDOUT: %import_ref.17 = import_ref Main//int_ops, inst+353, unloaded -// CHECK:STDOUT: %import_ref.18 = import_ref Main//int_ops, inst+372, unloaded -// CHECK:STDOUT: %import_ref.19 = import_ref Main//int_ops, inst+391, unloaded -// CHECK:STDOUT: %import_ref.20 = import_ref Main//int_ops, inst+410, unloaded -// CHECK:STDOUT: %import_ref.21 = import_ref Main//int_ops, inst+429, unloaded +// CHECK:STDOUT: %import_ref.1 = import_ref Main//int_ops, NegateI32, unloaded +// CHECK:STDOUT: %import_ref.2 = import_ref Main//int_ops, SubI32, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref Main//int_ops, AddU32, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Main//int_ops, IntLiteral, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref Main//int_ops, Int32ToInt32, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Main//int_ops, Int32ToUint32, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Main//int_ops, Uint32ToInt32, unloaded +// CHECK:STDOUT: %import_ref.8 = import_ref Main//int_ops, Uint32ToUint32, unloaded +// CHECK:STDOUT: %import_ref.9 = import_ref Main//int_ops, IntLiteralToIntLiteral, unloaded +// CHECK:STDOUT: %import_ref.10: %Int32ToInt16.type = import_ref Main//int_ops, Int32ToInt16, loaded [template = constants.%Int32ToInt16] +// CHECK:STDOUT: %import_ref.11 = import_ref Main//int_ops, Int32ToUint16, unloaded +// CHECK:STDOUT: %import_ref.12 = import_ref Main//int_ops, Uint32ToInt16, unloaded +// CHECK:STDOUT: %import_ref.13 = import_ref Main//int_ops, Uint32ToUint16, unloaded +// CHECK:STDOUT: %import_ref.14 = import_ref Main//int_ops, IntLiteralToInt16, unloaded +// CHECK:STDOUT: %import_ref.15 = import_ref Main//int_ops, IntLiteralToUint16, unloaded +// CHECK:STDOUT: %import_ref.16 = import_ref Main//int_ops, Int32ToInt64, unloaded +// CHECK:STDOUT: %import_ref.17 = import_ref Main//int_ops, Int32ToUint64, unloaded +// CHECK:STDOUT: %import_ref.18 = import_ref Main//int_ops, Uint32ToInt64, unloaded +// CHECK:STDOUT: %import_ref.19 = import_ref Main//int_ops, Uint32ToUint64, unloaded +// CHECK:STDOUT: %import_ref.20 = import_ref Main//int_ops, Int32ToIntLiteral, unloaded +// CHECK:STDOUT: %import_ref.21 = import_ref Main//int_ops, Uint32ToUintLiteral, unloaded // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.22 // CHECK:STDOUT: .ImplicitAs = %import_ref.23 @@ -2251,27 +2251,27 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1 = import_ref Main//int_ops, inst+30, unloaded -// CHECK:STDOUT: %import_ref.2 = import_ref Main//int_ops, inst+57, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref Main//int_ops, inst+93, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Main//int_ops, inst+100, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Main//int_ops, inst+119, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Main//int_ops, inst+138, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref Main//int_ops, inst+157, unloaded -// CHECK:STDOUT: %import_ref.8 = import_ref Main//int_ops, inst+176, unloaded -// CHECK:STDOUT: %import_ref.9 = import_ref Main//int_ops, inst+195, unloaded -// CHECK:STDOUT: %import_ref.10 = import_ref Main//int_ops, inst+216, unloaded -// CHECK:STDOUT: %import_ref.11: %Int32ToUint16.type = import_ref Main//int_ops, inst+236, loaded [template = constants.%Int32ToUint16] -// CHECK:STDOUT: %import_ref.12 = import_ref Main//int_ops, inst+255, unloaded -// CHECK:STDOUT: %import_ref.13 = import_ref Main//int_ops, inst+274, unloaded -// CHECK:STDOUT: %import_ref.14 = import_ref Main//int_ops, inst+293, unloaded -// CHECK:STDOUT: %import_ref.15 = import_ref Main//int_ops, inst+312, unloaded -// CHECK:STDOUT: %import_ref.16 = import_ref Main//int_ops, inst+333, unloaded -// CHECK:STDOUT: %import_ref.17 = import_ref Main//int_ops, inst+353, unloaded -// CHECK:STDOUT: %import_ref.18 = import_ref Main//int_ops, inst+372, unloaded -// CHECK:STDOUT: %import_ref.19 = import_ref Main//int_ops, inst+391, unloaded -// CHECK:STDOUT: %import_ref.20 = import_ref Main//int_ops, inst+410, unloaded -// CHECK:STDOUT: %import_ref.21 = import_ref Main//int_ops, inst+429, unloaded +// CHECK:STDOUT: %import_ref.1 = import_ref Main//int_ops, NegateI32, unloaded +// CHECK:STDOUT: %import_ref.2 = import_ref Main//int_ops, SubI32, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref Main//int_ops, AddU32, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Main//int_ops, IntLiteral, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref Main//int_ops, Int32ToInt32, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Main//int_ops, Int32ToUint32, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Main//int_ops, Uint32ToInt32, unloaded +// CHECK:STDOUT: %import_ref.8 = import_ref Main//int_ops, Uint32ToUint32, unloaded +// CHECK:STDOUT: %import_ref.9 = import_ref Main//int_ops, IntLiteralToIntLiteral, unloaded +// CHECK:STDOUT: %import_ref.10 = import_ref Main//int_ops, Int32ToInt16, unloaded +// CHECK:STDOUT: %import_ref.11: %Int32ToUint16.type = import_ref Main//int_ops, Int32ToUint16, loaded [template = constants.%Int32ToUint16] +// CHECK:STDOUT: %import_ref.12 = import_ref Main//int_ops, Uint32ToInt16, unloaded +// CHECK:STDOUT: %import_ref.13 = import_ref Main//int_ops, Uint32ToUint16, unloaded +// CHECK:STDOUT: %import_ref.14 = import_ref Main//int_ops, IntLiteralToInt16, unloaded +// CHECK:STDOUT: %import_ref.15 = import_ref Main//int_ops, IntLiteralToUint16, unloaded +// CHECK:STDOUT: %import_ref.16 = import_ref Main//int_ops, Int32ToInt64, unloaded +// CHECK:STDOUT: %import_ref.17 = import_ref Main//int_ops, Int32ToUint64, unloaded +// CHECK:STDOUT: %import_ref.18 = import_ref Main//int_ops, Uint32ToInt64, unloaded +// CHECK:STDOUT: %import_ref.19 = import_ref Main//int_ops, Uint32ToUint64, unloaded +// CHECK:STDOUT: %import_ref.20 = import_ref Main//int_ops, Int32ToIntLiteral, unloaded +// CHECK:STDOUT: %import_ref.21 = import_ref Main//int_ops, Uint32ToUintLiteral, unloaded // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .UInt = %import_ref.22 // CHECK:STDOUT: .ImplicitAs = %import_ref.23 @@ -2360,27 +2360,27 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1 = import_ref Main//int_ops, inst+30, unloaded -// CHECK:STDOUT: %import_ref.2 = import_ref Main//int_ops, inst+57, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref Main//int_ops, inst+93, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Main//int_ops, inst+100, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Main//int_ops, inst+119, unloaded -// CHECK:STDOUT: %import_ref.6: %Int32ToUint32.type = import_ref Main//int_ops, inst+138, loaded [template = constants.%Int32ToUint32] -// CHECK:STDOUT: %import_ref.7 = import_ref Main//int_ops, inst+157, unloaded -// CHECK:STDOUT: %import_ref.8 = import_ref Main//int_ops, inst+176, unloaded -// CHECK:STDOUT: %import_ref.9 = import_ref Main//int_ops, inst+195, unloaded -// CHECK:STDOUT: %import_ref.10 = import_ref Main//int_ops, inst+216, unloaded -// CHECK:STDOUT: %import_ref.11 = import_ref Main//int_ops, inst+236, unloaded -// CHECK:STDOUT: %import_ref.12: %Uint32ToInt16.type = import_ref Main//int_ops, inst+255, loaded [template = constants.%Uint32ToInt16] -// CHECK:STDOUT: %import_ref.13 = import_ref Main//int_ops, inst+274, unloaded -// CHECK:STDOUT: %import_ref.14 = import_ref Main//int_ops, inst+293, unloaded -// CHECK:STDOUT: %import_ref.15 = import_ref Main//int_ops, inst+312, unloaded -// CHECK:STDOUT: %import_ref.16 = import_ref Main//int_ops, inst+333, unloaded -// CHECK:STDOUT: %import_ref.17 = import_ref Main//int_ops, inst+353, unloaded -// CHECK:STDOUT: %import_ref.18 = import_ref Main//int_ops, inst+372, unloaded -// CHECK:STDOUT: %import_ref.19 = import_ref Main//int_ops, inst+391, unloaded -// CHECK:STDOUT: %import_ref.20 = import_ref Main//int_ops, inst+410, unloaded -// CHECK:STDOUT: %import_ref.21 = import_ref Main//int_ops, inst+429, unloaded +// CHECK:STDOUT: %import_ref.1 = import_ref Main//int_ops, NegateI32, unloaded +// CHECK:STDOUT: %import_ref.2 = import_ref Main//int_ops, SubI32, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref Main//int_ops, AddU32, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Main//int_ops, IntLiteral, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref Main//int_ops, Int32ToInt32, unloaded +// CHECK:STDOUT: %import_ref.6: %Int32ToUint32.type = import_ref Main//int_ops, Int32ToUint32, loaded [template = constants.%Int32ToUint32] +// CHECK:STDOUT: %import_ref.7 = import_ref Main//int_ops, Uint32ToInt32, unloaded +// CHECK:STDOUT: %import_ref.8 = import_ref Main//int_ops, Uint32ToUint32, unloaded +// CHECK:STDOUT: %import_ref.9 = import_ref Main//int_ops, IntLiteralToIntLiteral, unloaded +// CHECK:STDOUT: %import_ref.10 = import_ref Main//int_ops, Int32ToInt16, unloaded +// CHECK:STDOUT: %import_ref.11 = import_ref Main//int_ops, Int32ToUint16, unloaded +// CHECK:STDOUT: %import_ref.12: %Uint32ToInt16.type = import_ref Main//int_ops, Uint32ToInt16, loaded [template = constants.%Uint32ToInt16] +// CHECK:STDOUT: %import_ref.13 = import_ref Main//int_ops, Uint32ToUint16, unloaded +// CHECK:STDOUT: %import_ref.14 = import_ref Main//int_ops, IntLiteralToInt16, unloaded +// CHECK:STDOUT: %import_ref.15 = import_ref Main//int_ops, IntLiteralToUint16, unloaded +// CHECK:STDOUT: %import_ref.16 = import_ref Main//int_ops, Int32ToInt64, unloaded +// CHECK:STDOUT: %import_ref.17 = import_ref Main//int_ops, Int32ToUint64, unloaded +// CHECK:STDOUT: %import_ref.18 = import_ref Main//int_ops, Uint32ToInt64, unloaded +// CHECK:STDOUT: %import_ref.19 = import_ref Main//int_ops, Uint32ToUint64, unloaded +// CHECK:STDOUT: %import_ref.20 = import_ref Main//int_ops, Int32ToIntLiteral, unloaded +// CHECK:STDOUT: %import_ref.21 = import_ref Main//int_ops, Uint32ToUintLiteral, unloaded // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.22 // CHECK:STDOUT: .ImplicitAs = %import_ref.23 @@ -2475,27 +2475,27 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1 = import_ref Main//int_ops, inst+30, unloaded -// CHECK:STDOUT: %import_ref.2 = import_ref Main//int_ops, inst+57, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref Main//int_ops, inst+93, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Main//int_ops, inst+100, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Main//int_ops, inst+119, unloaded -// CHECK:STDOUT: %import_ref.6: %Int32ToUint32.type = import_ref Main//int_ops, inst+138, loaded [template = constants.%Int32ToUint32] -// CHECK:STDOUT: %import_ref.7 = import_ref Main//int_ops, inst+157, unloaded -// CHECK:STDOUT: %import_ref.8 = import_ref Main//int_ops, inst+176, unloaded -// CHECK:STDOUT: %import_ref.9 = import_ref Main//int_ops, inst+195, unloaded -// CHECK:STDOUT: %import_ref.10 = import_ref Main//int_ops, inst+216, unloaded -// CHECK:STDOUT: %import_ref.11 = import_ref Main//int_ops, inst+236, unloaded -// CHECK:STDOUT: %import_ref.12 = import_ref Main//int_ops, inst+255, unloaded -// CHECK:STDOUT: %import_ref.13: %Uint32ToUint16.type = import_ref Main//int_ops, inst+274, loaded [template = constants.%Uint32ToUint16] -// CHECK:STDOUT: %import_ref.14 = import_ref Main//int_ops, inst+293, unloaded -// CHECK:STDOUT: %import_ref.15 = import_ref Main//int_ops, inst+312, unloaded -// CHECK:STDOUT: %import_ref.16 = import_ref Main//int_ops, inst+333, unloaded -// CHECK:STDOUT: %import_ref.17 = import_ref Main//int_ops, inst+353, unloaded -// CHECK:STDOUT: %import_ref.18 = import_ref Main//int_ops, inst+372, unloaded -// CHECK:STDOUT: %import_ref.19 = import_ref Main//int_ops, inst+391, unloaded -// CHECK:STDOUT: %import_ref.20 = import_ref Main//int_ops, inst+410, unloaded -// CHECK:STDOUT: %import_ref.21 = import_ref Main//int_ops, inst+429, unloaded +// CHECK:STDOUT: %import_ref.1 = import_ref Main//int_ops, NegateI32, unloaded +// CHECK:STDOUT: %import_ref.2 = import_ref Main//int_ops, SubI32, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref Main//int_ops, AddU32, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Main//int_ops, IntLiteral, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref Main//int_ops, Int32ToInt32, unloaded +// CHECK:STDOUT: %import_ref.6: %Int32ToUint32.type = import_ref Main//int_ops, Int32ToUint32, loaded [template = constants.%Int32ToUint32] +// CHECK:STDOUT: %import_ref.7 = import_ref Main//int_ops, Uint32ToInt32, unloaded +// CHECK:STDOUT: %import_ref.8 = import_ref Main//int_ops, Uint32ToUint32, unloaded +// CHECK:STDOUT: %import_ref.9 = import_ref Main//int_ops, IntLiteralToIntLiteral, unloaded +// CHECK:STDOUT: %import_ref.10 = import_ref Main//int_ops, Int32ToInt16, unloaded +// CHECK:STDOUT: %import_ref.11 = import_ref Main//int_ops, Int32ToUint16, unloaded +// CHECK:STDOUT: %import_ref.12 = import_ref Main//int_ops, Uint32ToInt16, unloaded +// CHECK:STDOUT: %import_ref.13: %Uint32ToUint16.type = import_ref Main//int_ops, Uint32ToUint16, loaded [template = constants.%Uint32ToUint16] +// CHECK:STDOUT: %import_ref.14 = import_ref Main//int_ops, IntLiteralToInt16, unloaded +// CHECK:STDOUT: %import_ref.15 = import_ref Main//int_ops, IntLiteralToUint16, unloaded +// CHECK:STDOUT: %import_ref.16 = import_ref Main//int_ops, Int32ToInt64, unloaded +// CHECK:STDOUT: %import_ref.17 = import_ref Main//int_ops, Int32ToUint64, unloaded +// CHECK:STDOUT: %import_ref.18 = import_ref Main//int_ops, Uint32ToInt64, unloaded +// CHECK:STDOUT: %import_ref.19 = import_ref Main//int_ops, Uint32ToUint64, unloaded +// CHECK:STDOUT: %import_ref.20 = import_ref Main//int_ops, Int32ToIntLiteral, unloaded +// CHECK:STDOUT: %import_ref.21 = import_ref Main//int_ops, Uint32ToUintLiteral, unloaded // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .UInt = %import_ref.22 // CHECK:STDOUT: .ImplicitAs = %import_ref.23 @@ -2593,27 +2593,27 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1 = import_ref Main//int_ops, inst+30, unloaded -// CHECK:STDOUT: %import_ref.2: %SubI32.type = import_ref Main//int_ops, inst+57, loaded [template = constants.%SubI32] -// CHECK:STDOUT: %import_ref.3 = import_ref Main//int_ops, inst+93, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Main//int_ops, inst+100, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Main//int_ops, inst+119, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Main//int_ops, inst+138, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref Main//int_ops, inst+157, unloaded -// CHECK:STDOUT: %import_ref.8 = import_ref Main//int_ops, inst+176, unloaded -// CHECK:STDOUT: %import_ref.9 = import_ref Main//int_ops, inst+195, unloaded -// CHECK:STDOUT: %import_ref.10 = import_ref Main//int_ops, inst+216, unloaded -// CHECK:STDOUT: %import_ref.11: %Int32ToUint16.type = import_ref Main//int_ops, inst+236, loaded [template = constants.%Int32ToUint16] -// CHECK:STDOUT: %import_ref.12 = import_ref Main//int_ops, inst+255, unloaded -// CHECK:STDOUT: %import_ref.13 = import_ref Main//int_ops, inst+274, unloaded -// CHECK:STDOUT: %import_ref.14 = import_ref Main//int_ops, inst+293, unloaded -// CHECK:STDOUT: %import_ref.15 = import_ref Main//int_ops, inst+312, unloaded -// CHECK:STDOUT: %import_ref.16 = import_ref Main//int_ops, inst+333, unloaded -// CHECK:STDOUT: %import_ref.17 = import_ref Main//int_ops, inst+353, unloaded -// CHECK:STDOUT: %import_ref.18 = import_ref Main//int_ops, inst+372, unloaded -// CHECK:STDOUT: %import_ref.19 = import_ref Main//int_ops, inst+391, unloaded -// CHECK:STDOUT: %import_ref.20 = import_ref Main//int_ops, inst+410, unloaded -// CHECK:STDOUT: %import_ref.21 = import_ref Main//int_ops, inst+429, unloaded +// CHECK:STDOUT: %import_ref.1 = import_ref Main//int_ops, NegateI32, unloaded +// CHECK:STDOUT: %import_ref.2: %SubI32.type = import_ref Main//int_ops, SubI32, loaded [template = constants.%SubI32] +// CHECK:STDOUT: %import_ref.3 = import_ref Main//int_ops, AddU32, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Main//int_ops, IntLiteral, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref Main//int_ops, Int32ToInt32, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Main//int_ops, Int32ToUint32, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Main//int_ops, Uint32ToInt32, unloaded +// CHECK:STDOUT: %import_ref.8 = import_ref Main//int_ops, Uint32ToUint32, unloaded +// CHECK:STDOUT: %import_ref.9 = import_ref Main//int_ops, IntLiteralToIntLiteral, unloaded +// CHECK:STDOUT: %import_ref.10 = import_ref Main//int_ops, Int32ToInt16, unloaded +// CHECK:STDOUT: %import_ref.11: %Int32ToUint16.type = import_ref Main//int_ops, Int32ToUint16, loaded [template = constants.%Int32ToUint16] +// CHECK:STDOUT: %import_ref.12 = import_ref Main//int_ops, Uint32ToInt16, unloaded +// CHECK:STDOUT: %import_ref.13 = import_ref Main//int_ops, Uint32ToUint16, unloaded +// CHECK:STDOUT: %import_ref.14 = import_ref Main//int_ops, IntLiteralToInt16, unloaded +// CHECK:STDOUT: %import_ref.15 = import_ref Main//int_ops, IntLiteralToUint16, unloaded +// CHECK:STDOUT: %import_ref.16 = import_ref Main//int_ops, Int32ToInt64, unloaded +// CHECK:STDOUT: %import_ref.17 = import_ref Main//int_ops, Int32ToUint64, unloaded +// CHECK:STDOUT: %import_ref.18 = import_ref Main//int_ops, Uint32ToInt64, unloaded +// CHECK:STDOUT: %import_ref.19 = import_ref Main//int_ops, Uint32ToUint64, unloaded +// CHECK:STDOUT: %import_ref.20 = import_ref Main//int_ops, Int32ToIntLiteral, unloaded +// CHECK:STDOUT: %import_ref.21 = import_ref Main//int_ops, Uint32ToUintLiteral, unloaded // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .UInt = %import_ref.22 // CHECK:STDOUT: .ImplicitAs = %import_ref.23 @@ -2717,27 +2717,27 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1 = import_ref Main//int_ops, inst+30, unloaded -// CHECK:STDOUT: %import_ref.2: %SubI32.type = import_ref Main//int_ops, inst+57, loaded [template = constants.%SubI32] -// CHECK:STDOUT: %import_ref.3 = import_ref Main//int_ops, inst+93, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Main//int_ops, inst+100, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Main//int_ops, inst+119, unloaded -// CHECK:STDOUT: %import_ref.6: %Int32ToUint32.type = import_ref Main//int_ops, inst+138, loaded [template = constants.%Int32ToUint32] -// CHECK:STDOUT: %import_ref.7 = import_ref Main//int_ops, inst+157, unloaded -// CHECK:STDOUT: %import_ref.8 = import_ref Main//int_ops, inst+176, unloaded -// CHECK:STDOUT: %import_ref.9 = import_ref Main//int_ops, inst+195, unloaded -// CHECK:STDOUT: %import_ref.10 = import_ref Main//int_ops, inst+216, unloaded -// CHECK:STDOUT: %import_ref.11 = import_ref Main//int_ops, inst+236, unloaded -// CHECK:STDOUT: %import_ref.12 = import_ref Main//int_ops, inst+255, unloaded -// CHECK:STDOUT: %import_ref.13 = import_ref Main//int_ops, inst+274, unloaded -// CHECK:STDOUT: %import_ref.14 = import_ref Main//int_ops, inst+293, unloaded -// CHECK:STDOUT: %import_ref.15 = import_ref Main//int_ops, inst+312, unloaded -// CHECK:STDOUT: %import_ref.16 = import_ref Main//int_ops, inst+333, unloaded -// CHECK:STDOUT: %import_ref.17 = import_ref Main//int_ops, inst+353, unloaded -// CHECK:STDOUT: %import_ref.18 = import_ref Main//int_ops, inst+372, unloaded -// CHECK:STDOUT: %import_ref.19 = import_ref Main//int_ops, inst+391, unloaded -// CHECK:STDOUT: %import_ref.20 = import_ref Main//int_ops, inst+410, unloaded -// CHECK:STDOUT: %import_ref.21 = import_ref Main//int_ops, inst+429, unloaded +// CHECK:STDOUT: %import_ref.1 = import_ref Main//int_ops, NegateI32, unloaded +// CHECK:STDOUT: %import_ref.2: %SubI32.type = import_ref Main//int_ops, SubI32, loaded [template = constants.%SubI32] +// CHECK:STDOUT: %import_ref.3 = import_ref Main//int_ops, AddU32, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Main//int_ops, IntLiteral, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref Main//int_ops, Int32ToInt32, unloaded +// CHECK:STDOUT: %import_ref.6: %Int32ToUint32.type = import_ref Main//int_ops, Int32ToUint32, loaded [template = constants.%Int32ToUint32] +// CHECK:STDOUT: %import_ref.7 = import_ref Main//int_ops, Uint32ToInt32, unloaded +// CHECK:STDOUT: %import_ref.8 = import_ref Main//int_ops, Uint32ToUint32, unloaded +// CHECK:STDOUT: %import_ref.9 = import_ref Main//int_ops, IntLiteralToIntLiteral, unloaded +// CHECK:STDOUT: %import_ref.10 = import_ref Main//int_ops, Int32ToInt16, unloaded +// CHECK:STDOUT: %import_ref.11 = import_ref Main//int_ops, Int32ToUint16, unloaded +// CHECK:STDOUT: %import_ref.12 = import_ref Main//int_ops, Uint32ToInt16, unloaded +// CHECK:STDOUT: %import_ref.13 = import_ref Main//int_ops, Uint32ToUint16, unloaded +// CHECK:STDOUT: %import_ref.14 = import_ref Main//int_ops, IntLiteralToInt16, unloaded +// CHECK:STDOUT: %import_ref.15 = import_ref Main//int_ops, IntLiteralToUint16, unloaded +// CHECK:STDOUT: %import_ref.16 = import_ref Main//int_ops, Int32ToInt64, unloaded +// CHECK:STDOUT: %import_ref.17 = import_ref Main//int_ops, Int32ToUint64, unloaded +// CHECK:STDOUT: %import_ref.18 = import_ref Main//int_ops, Uint32ToInt64, unloaded +// CHECK:STDOUT: %import_ref.19 = import_ref Main//int_ops, Uint32ToUint64, unloaded +// CHECK:STDOUT: %import_ref.20 = import_ref Main//int_ops, Int32ToIntLiteral, unloaded +// CHECK:STDOUT: %import_ref.21 = import_ref Main//int_ops, Uint32ToUintLiteral, unloaded // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .UInt = %import_ref.22 // CHECK:STDOUT: .ImplicitAs = %import_ref.23 @@ -2842,27 +2842,27 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1 = import_ref Main//int_ops, inst+30, unloaded -// CHECK:STDOUT: %import_ref.2: %SubI32.type = import_ref Main//int_ops, inst+57, loaded [template = constants.%SubI32] -// CHECK:STDOUT: %import_ref.3 = import_ref Main//int_ops, inst+93, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Main//int_ops, inst+100, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Main//int_ops, inst+119, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Main//int_ops, inst+138, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref Main//int_ops, inst+157, unloaded -// CHECK:STDOUT: %import_ref.8 = import_ref Main//int_ops, inst+176, unloaded -// CHECK:STDOUT: %import_ref.9 = import_ref Main//int_ops, inst+195, unloaded -// CHECK:STDOUT: %import_ref.10 = import_ref Main//int_ops, inst+216, unloaded -// CHECK:STDOUT: %import_ref.11 = import_ref Main//int_ops, inst+236, unloaded -// CHECK:STDOUT: %import_ref.12 = import_ref Main//int_ops, inst+255, unloaded -// CHECK:STDOUT: %import_ref.13 = import_ref Main//int_ops, inst+274, unloaded -// CHECK:STDOUT: %import_ref.14 = import_ref Main//int_ops, inst+293, unloaded -// CHECK:STDOUT: %import_ref.15 = import_ref Main//int_ops, inst+312, unloaded -// CHECK:STDOUT: %import_ref.16 = import_ref Main//int_ops, inst+333, unloaded -// CHECK:STDOUT: %import_ref.17: %Int32ToUint64.type = import_ref Main//int_ops, inst+353, loaded [template = constants.%Int32ToUint64] -// CHECK:STDOUT: %import_ref.18 = import_ref Main//int_ops, inst+372, unloaded -// CHECK:STDOUT: %import_ref.19 = import_ref Main//int_ops, inst+391, unloaded -// CHECK:STDOUT: %import_ref.20 = import_ref Main//int_ops, inst+410, unloaded -// CHECK:STDOUT: %import_ref.21 = import_ref Main//int_ops, inst+429, unloaded +// CHECK:STDOUT: %import_ref.1 = import_ref Main//int_ops, NegateI32, unloaded +// CHECK:STDOUT: %import_ref.2: %SubI32.type = import_ref Main//int_ops, SubI32, loaded [template = constants.%SubI32] +// CHECK:STDOUT: %import_ref.3 = import_ref Main//int_ops, AddU32, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Main//int_ops, IntLiteral, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref Main//int_ops, Int32ToInt32, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Main//int_ops, Int32ToUint32, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Main//int_ops, Uint32ToInt32, unloaded +// CHECK:STDOUT: %import_ref.8 = import_ref Main//int_ops, Uint32ToUint32, unloaded +// CHECK:STDOUT: %import_ref.9 = import_ref Main//int_ops, IntLiteralToIntLiteral, unloaded +// CHECK:STDOUT: %import_ref.10 = import_ref Main//int_ops, Int32ToInt16, unloaded +// CHECK:STDOUT: %import_ref.11 = import_ref Main//int_ops, Int32ToUint16, unloaded +// CHECK:STDOUT: %import_ref.12 = import_ref Main//int_ops, Uint32ToInt16, unloaded +// CHECK:STDOUT: %import_ref.13 = import_ref Main//int_ops, Uint32ToUint16, unloaded +// CHECK:STDOUT: %import_ref.14 = import_ref Main//int_ops, IntLiteralToInt16, unloaded +// CHECK:STDOUT: %import_ref.15 = import_ref Main//int_ops, IntLiteralToUint16, unloaded +// CHECK:STDOUT: %import_ref.16 = import_ref Main//int_ops, Int32ToInt64, unloaded +// CHECK:STDOUT: %import_ref.17: %Int32ToUint64.type = import_ref Main//int_ops, Int32ToUint64, loaded [template = constants.%Int32ToUint64] +// CHECK:STDOUT: %import_ref.18 = import_ref Main//int_ops, Uint32ToInt64, unloaded +// CHECK:STDOUT: %import_ref.19 = import_ref Main//int_ops, Uint32ToUint64, unloaded +// CHECK:STDOUT: %import_ref.20 = import_ref Main//int_ops, Int32ToIntLiteral, unloaded +// CHECK:STDOUT: %import_ref.21 = import_ref Main//int_ops, Uint32ToUintLiteral, unloaded // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .UInt = %import_ref.22 // CHECK:STDOUT: .ImplicitAs = %import_ref.23 @@ -2963,27 +2963,27 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %NegateI32.type = import_ref Main//int_ops, inst+30, loaded [template = constants.%NegateI32] -// CHECK:STDOUT: %import_ref.2 = import_ref Main//int_ops, inst+57, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref Main//int_ops, inst+93, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Main//int_ops, inst+100, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Main//int_ops, inst+119, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Main//int_ops, inst+138, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref Main//int_ops, inst+157, unloaded -// CHECK:STDOUT: %import_ref.8 = import_ref Main//int_ops, inst+176, unloaded -// CHECK:STDOUT: %import_ref.9 = import_ref Main//int_ops, inst+195, unloaded -// CHECK:STDOUT: %import_ref.10: %Int32ToInt16.type = import_ref Main//int_ops, inst+216, loaded [template = constants.%Int32ToInt16] -// CHECK:STDOUT: %import_ref.11 = import_ref Main//int_ops, inst+236, unloaded -// CHECK:STDOUT: %import_ref.12 = import_ref Main//int_ops, inst+255, unloaded -// CHECK:STDOUT: %import_ref.13 = import_ref Main//int_ops, inst+274, unloaded -// CHECK:STDOUT: %import_ref.14 = import_ref Main//int_ops, inst+293, unloaded -// CHECK:STDOUT: %import_ref.15 = import_ref Main//int_ops, inst+312, unloaded -// CHECK:STDOUT: %import_ref.16 = import_ref Main//int_ops, inst+333, unloaded -// CHECK:STDOUT: %import_ref.17 = import_ref Main//int_ops, inst+353, unloaded -// CHECK:STDOUT: %import_ref.18 = import_ref Main//int_ops, inst+372, unloaded -// CHECK:STDOUT: %import_ref.19 = import_ref Main//int_ops, inst+391, unloaded -// CHECK:STDOUT: %import_ref.20 = import_ref Main//int_ops, inst+410, unloaded -// CHECK:STDOUT: %import_ref.21 = import_ref Main//int_ops, inst+429, unloaded +// CHECK:STDOUT: %import_ref.1: %NegateI32.type = import_ref Main//int_ops, NegateI32, loaded [template = constants.%NegateI32] +// CHECK:STDOUT: %import_ref.2 = import_ref Main//int_ops, SubI32, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref Main//int_ops, AddU32, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Main//int_ops, IntLiteral, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref Main//int_ops, Int32ToInt32, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Main//int_ops, Int32ToUint32, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Main//int_ops, Uint32ToInt32, unloaded +// CHECK:STDOUT: %import_ref.8 = import_ref Main//int_ops, Uint32ToUint32, unloaded +// CHECK:STDOUT: %import_ref.9 = import_ref Main//int_ops, IntLiteralToIntLiteral, unloaded +// CHECK:STDOUT: %import_ref.10: %Int32ToInt16.type = import_ref Main//int_ops, Int32ToInt16, loaded [template = constants.%Int32ToInt16] +// CHECK:STDOUT: %import_ref.11 = import_ref Main//int_ops, Int32ToUint16, unloaded +// CHECK:STDOUT: %import_ref.12 = import_ref Main//int_ops, Uint32ToInt16, unloaded +// CHECK:STDOUT: %import_ref.13 = import_ref Main//int_ops, Uint32ToUint16, unloaded +// CHECK:STDOUT: %import_ref.14 = import_ref Main//int_ops, IntLiteralToInt16, unloaded +// CHECK:STDOUT: %import_ref.15 = import_ref Main//int_ops, IntLiteralToUint16, unloaded +// CHECK:STDOUT: %import_ref.16 = import_ref Main//int_ops, Int32ToInt64, unloaded +// CHECK:STDOUT: %import_ref.17 = import_ref Main//int_ops, Int32ToUint64, unloaded +// CHECK:STDOUT: %import_ref.18 = import_ref Main//int_ops, Uint32ToInt64, unloaded +// CHECK:STDOUT: %import_ref.19 = import_ref Main//int_ops, Uint32ToUint64, unloaded +// CHECK:STDOUT: %import_ref.20 = import_ref Main//int_ops, Int32ToIntLiteral, unloaded +// CHECK:STDOUT: %import_ref.21 = import_ref Main//int_ops, Uint32ToUintLiteral, unloaded // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.22 // CHECK:STDOUT: .ImplicitAs = %import_ref.23 @@ -3079,27 +3079,27 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1 = import_ref Main//int_ops, inst+30, unloaded -// CHECK:STDOUT: %import_ref.2 = import_ref Main//int_ops, inst+57, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref Main//int_ops, inst+93, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Main//int_ops, inst+100, unloaded -// CHECK:STDOUT: %import_ref.5: %Int32ToInt32.type = import_ref Main//int_ops, inst+119, loaded [template = constants.%Int32ToInt32] -// CHECK:STDOUT: %import_ref.6 = import_ref Main//int_ops, inst+138, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref Main//int_ops, inst+157, unloaded -// CHECK:STDOUT: %import_ref.8 = import_ref Main//int_ops, inst+176, unloaded -// CHECK:STDOUT: %import_ref.9 = import_ref Main//int_ops, inst+195, unloaded -// CHECK:STDOUT: %import_ref.10: %Int32ToInt16.type = import_ref Main//int_ops, inst+216, loaded [template = constants.%Int32ToInt16] -// CHECK:STDOUT: %import_ref.11 = import_ref Main//int_ops, inst+236, unloaded -// CHECK:STDOUT: %import_ref.12 = import_ref Main//int_ops, inst+255, unloaded -// CHECK:STDOUT: %import_ref.13 = import_ref Main//int_ops, inst+274, unloaded -// CHECK:STDOUT: %import_ref.14 = import_ref Main//int_ops, inst+293, unloaded -// CHECK:STDOUT: %import_ref.15 = import_ref Main//int_ops, inst+312, unloaded -// CHECK:STDOUT: %import_ref.16: %Int32ToInt64.type = import_ref Main//int_ops, inst+333, loaded [template = constants.%Int32ToInt64] -// CHECK:STDOUT: %import_ref.17 = import_ref Main//int_ops, inst+353, unloaded -// CHECK:STDOUT: %import_ref.18 = import_ref Main//int_ops, inst+372, unloaded -// CHECK:STDOUT: %import_ref.19 = import_ref Main//int_ops, inst+391, unloaded -// CHECK:STDOUT: %import_ref.20 = import_ref Main//int_ops, inst+410, unloaded -// CHECK:STDOUT: %import_ref.21 = import_ref Main//int_ops, inst+429, unloaded +// CHECK:STDOUT: %import_ref.1 = import_ref Main//int_ops, NegateI32, unloaded +// CHECK:STDOUT: %import_ref.2 = import_ref Main//int_ops, SubI32, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref Main//int_ops, AddU32, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Main//int_ops, IntLiteral, unloaded +// CHECK:STDOUT: %import_ref.5: %Int32ToInt32.type = import_ref Main//int_ops, Int32ToInt32, loaded [template = constants.%Int32ToInt32] +// CHECK:STDOUT: %import_ref.6 = import_ref Main//int_ops, Int32ToUint32, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Main//int_ops, Uint32ToInt32, unloaded +// CHECK:STDOUT: %import_ref.8 = import_ref Main//int_ops, Uint32ToUint32, unloaded +// CHECK:STDOUT: %import_ref.9 = import_ref Main//int_ops, IntLiteralToIntLiteral, unloaded +// CHECK:STDOUT: %import_ref.10: %Int32ToInt16.type = import_ref Main//int_ops, Int32ToInt16, loaded [template = constants.%Int32ToInt16] +// CHECK:STDOUT: %import_ref.11 = import_ref Main//int_ops, Int32ToUint16, unloaded +// CHECK:STDOUT: %import_ref.12 = import_ref Main//int_ops, Uint32ToInt16, unloaded +// CHECK:STDOUT: %import_ref.13 = import_ref Main//int_ops, Uint32ToUint16, unloaded +// CHECK:STDOUT: %import_ref.14 = import_ref Main//int_ops, IntLiteralToInt16, unloaded +// CHECK:STDOUT: %import_ref.15 = import_ref Main//int_ops, IntLiteralToUint16, unloaded +// CHECK:STDOUT: %import_ref.16: %Int32ToInt64.type = import_ref Main//int_ops, Int32ToInt64, loaded [template = constants.%Int32ToInt64] +// CHECK:STDOUT: %import_ref.17 = import_ref Main//int_ops, Int32ToUint64, unloaded +// CHECK:STDOUT: %import_ref.18 = import_ref Main//int_ops, Uint32ToInt64, unloaded +// CHECK:STDOUT: %import_ref.19 = import_ref Main//int_ops, Uint32ToUint64, unloaded +// CHECK:STDOUT: %import_ref.20 = import_ref Main//int_ops, Int32ToIntLiteral, unloaded +// CHECK:STDOUT: %import_ref.21 = import_ref Main//int_ops, Uint32ToUintLiteral, unloaded // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.22 // CHECK:STDOUT: .ImplicitAs = %import_ref.23 diff --git a/toolchain/check/testdata/builtins/int/make_type_signed.carbon b/toolchain/check/testdata/builtins/int/make_type_signed.carbon index eadcbc9195080..5609130800a06 100644 --- a/toolchain/check/testdata/builtins/int/make_type_signed.carbon +++ b/toolchain/check/testdata/builtins/int/make_type_signed.carbon @@ -163,8 +163,8 @@ var m: Int(1000000000); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %IntLiteral.type = import_ref Main//types, inst+7, loaded [template = constants.%IntLiteral] -// CHECK:STDOUT: %import_ref.2: %Int.type = import_ref Main//types, inst+23, loaded [template = constants.%Int] +// CHECK:STDOUT: %import_ref.1: %IntLiteral.type = import_ref Main//types, IntLiteral, loaded [template = constants.%IntLiteral] +// CHECK:STDOUT: %import_ref.2: %Int.type = import_ref Main//types, Int, loaded [template = constants.%Int] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -321,11 +321,11 @@ var m: Int(1000000000); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1 = import_ref Main//types, inst+7, unloaded -// CHECK:STDOUT: %import_ref.2: %Int.type = import_ref Main//types, inst+23, loaded [template = constants.%Int] -// CHECK:STDOUT: %import_ref.3: %F.type = import_ref Main//use_types, inst+34, loaded [template = constants.%F] -// CHECK:STDOUT: %import_ref.4: %G.type = import_ref Main//use_types, inst+59, loaded [template = constants.%G] -// CHECK:STDOUT: %import_ref.5: %Symbolic.type = import_ref Main//use_types, inst+98, loaded [template = constants.%Symbolic] +// CHECK:STDOUT: %import_ref.1 = import_ref Main//types, IntLiteral, unloaded +// CHECK:STDOUT: %import_ref.2: %Int.type = import_ref Main//types, Int, loaded [template = constants.%Int] +// CHECK:STDOUT: %import_ref.3: %F.type = import_ref Main//use_types, F, loaded [template = constants.%F] +// CHECK:STDOUT: %import_ref.4: %G.type = import_ref Main//use_types, G, loaded [template = constants.%G] +// CHECK:STDOUT: %import_ref.5: %Symbolic.type = import_ref Main//use_types, Symbolic, loaded [template = constants.%Symbolic] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -482,8 +482,8 @@ var m: Int(1000000000); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1 = import_ref Main//types, inst+7, unloaded -// CHECK:STDOUT: %import_ref.2: %Int.type = import_ref Main//types, inst+23, loaded [template = constants.%Int] +// CHECK:STDOUT: %import_ref.1 = import_ref Main//types, IntLiteral, unloaded +// CHECK:STDOUT: %import_ref.2: %Int.type = import_ref Main//types, Int, loaded [template = constants.%Int] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -540,8 +540,8 @@ var m: Int(1000000000); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1 = import_ref Main//types, inst+7, unloaded -// CHECK:STDOUT: %import_ref.2: %Int.type.2 = import_ref Main//types, inst+23, loaded [template = constants.%Int.2] +// CHECK:STDOUT: %import_ref.1 = import_ref Main//types, IntLiteral, unloaded +// CHECK:STDOUT: %import_ref.2: %Int.type.2 = import_ref Main//types, Int, loaded [template = constants.%Int.2] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.3 // CHECK:STDOUT: .ImplicitAs = %import_ref.4 @@ -617,8 +617,8 @@ var m: Int(1000000000); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1 = import_ref Main//types, inst+7, unloaded -// CHECK:STDOUT: %import_ref.2: %Int.type = import_ref Main//types, inst+23, loaded [template = constants.%Int] +// CHECK:STDOUT: %import_ref.1 = import_ref Main//types, IntLiteral, unloaded +// CHECK:STDOUT: %import_ref.2: %Int.type = import_ref Main//types, Int, loaded [template = constants.%Int] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... diff --git a/toolchain/check/testdata/builtins/int/make_type_unsigned.carbon b/toolchain/check/testdata/builtins/int/make_type_unsigned.carbon index 554d9eda496f8..b1a9d7c491713 100644 --- a/toolchain/check/testdata/builtins/int/make_type_unsigned.carbon +++ b/toolchain/check/testdata/builtins/int/make_type_unsigned.carbon @@ -144,8 +144,8 @@ var m: UInt(1000000000); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %IntLiteral.type = import_ref Main//types, inst+7, loaded [template = constants.%IntLiteral] -// CHECK:STDOUT: %import_ref.2: %UInt.type = import_ref Main//types, inst+23, loaded [template = constants.%UInt] +// CHECK:STDOUT: %import_ref.1: %IntLiteral.type = import_ref Main//types, IntLiteral, loaded [template = constants.%IntLiteral] +// CHECK:STDOUT: %import_ref.2: %UInt.type = import_ref Main//types, UInt, loaded [template = constants.%UInt] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -281,8 +281,8 @@ var m: UInt(1000000000); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1 = import_ref Main//types, inst+7, unloaded -// CHECK:STDOUT: %import_ref.2: %UInt.type = import_ref Main//types, inst+23, loaded [template = constants.%UInt] +// CHECK:STDOUT: %import_ref.1 = import_ref Main//types, IntLiteral, unloaded +// CHECK:STDOUT: %import_ref.2: %UInt.type = import_ref Main//types, UInt, loaded [template = constants.%UInt] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -339,8 +339,8 @@ var m: UInt(1000000000); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1 = import_ref Main//types, inst+7, unloaded -// CHECK:STDOUT: %import_ref.2: %UInt.type = import_ref Main//types, inst+23, loaded [template = constants.%UInt] +// CHECK:STDOUT: %import_ref.1 = import_ref Main//types, IntLiteral, unloaded +// CHECK:STDOUT: %import_ref.2: %UInt.type = import_ref Main//types, UInt, loaded [template = constants.%UInt] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.3 // CHECK:STDOUT: .ImplicitAs = %import_ref.4 @@ -416,8 +416,8 @@ var m: UInt(1000000000); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1 = import_ref Main//types, inst+7, unloaded -// CHECK:STDOUT: %import_ref.2: %UInt.type = import_ref Main//types, inst+23, loaded [template = constants.%UInt] +// CHECK:STDOUT: %import_ref.1 = import_ref Main//types, IntLiteral, unloaded +// CHECK:STDOUT: %import_ref.2: %UInt.type = import_ref Main//types, UInt, loaded [template = constants.%UInt] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... diff --git a/toolchain/check/testdata/builtins/int_literal/make_type.carbon b/toolchain/check/testdata/builtins/int_literal/make_type.carbon index 865a169d29dfe..92dd742a889ae 100644 --- a/toolchain/check/testdata/builtins/int_literal/make_type.carbon +++ b/toolchain/check/testdata/builtins/int_literal/make_type.carbon @@ -61,7 +61,7 @@ var i: IntLiteral(); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref: %IntLiteral.type = import_ref Main//types, inst+7, loaded [template = constants.%IntLiteral] +// CHECK:STDOUT: %import_ref: %IntLiteral.type = import_ref Main//types, IntLiteral, loaded [template = constants.%IntLiteral] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... diff --git a/toolchain/check/testdata/builtins/print.carbon b/toolchain/check/testdata/builtins/print.carbon index 12fd068148ebf..1d7a4d4b27821 100644 --- a/toolchain/check/testdata/builtins/print.carbon +++ b/toolchain/check/testdata/builtins/print.carbon @@ -52,7 +52,7 @@ fn Main() { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.38: %Print.type.2 = import_ref Core//prelude, inst+54, loaded [template = constants.%Print.2] +// CHECK:STDOUT: %import_ref.38: %Print.type.2 = import_ref Core//prelude, Print, loaded [template = constants.%Print.2] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/class/adapter/extend_adapt.carbon b/toolchain/check/testdata/class/adapter/extend_adapt.carbon index d1d9c2dc38555..e0ab57eb8dd0b 100644 --- a/toolchain/check/testdata/class/adapter/extend_adapt.carbon +++ b/toolchain/check/testdata/class/adapter/extend_adapt.carbon @@ -611,7 +611,7 @@ fn F(a: IntAdapter) -> i32 { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: %IntLiteral.type = import_ref Core//prelude/types, inst+7, loaded [template = constants.%IntLiteral] +// CHECK:STDOUT: %import_ref.1: %IntLiteral.type = import_ref Core//prelude/types, IntLiteral, loaded [template = constants.%IntLiteral] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/class/cross_package_import.carbon b/toolchain/check/testdata/class/cross_package_import.carbon index 65cf8ec17a651..79eff108ca137 100644 --- a/toolchain/check/testdata/class/cross_package_import.carbon +++ b/toolchain/check/testdata/class/cross_package_import.carbon @@ -201,9 +201,9 @@ var c: Other.C = {}; // CHECK:STDOUT: .C = %import_ref.1 // CHECK:STDOUT: import Other//other_define // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref Other//other_define, inst+3, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2: = import_ref Other//other_define, inst+6, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.3 = import_ref Other//other_define, inst+4, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Other//other_define, C, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2: = import_ref Other//other_define, loc4_10, loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.3 = import_ref Other//other_define, inst16 [no loc], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -251,7 +251,7 @@ var c: Other.C = {}; // CHECK:STDOUT: .C = %import_ref // CHECK:STDOUT: import Other//other_extern // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref: type = import_ref Other//other_extern, inst+3, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref: type = import_ref Other//other_extern, C, loaded [template = constants.%C] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -296,9 +296,9 @@ var c: Other.C = {}; // CHECK:STDOUT: import Other//other_define // CHECK:STDOUT: import Other//other_extern // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref Other//other_define, inst+3, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2: = import_ref Other//other_define, inst+6, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.3 = import_ref Other//other_define, inst+4, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Other//other_define, C, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2: = import_ref Other//other_define, loc4_10, loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.3 = import_ref Other//other_define, inst16 [no loc], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -349,9 +349,9 @@ var c: Other.C = {}; // CHECK:STDOUT: import Other//other_define // CHECK:STDOUT: import Other//other_conflict // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref Other//other_define, inst+3, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2: = import_ref Other//other_define, inst+6, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.3 = import_ref Other//other_define, inst+4, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Other//other_define, C, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2: = import_ref Other//other_define, loc4_10, loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.3 = import_ref Other//other_define, inst16 [no loc], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/class/fail_import_misuses.carbon b/toolchain/check/testdata/class/fail_import_misuses.carbon index 6e8ea2da80044..2ec2f5fb8e6d9 100644 --- a/toolchain/check/testdata/class/fail_import_misuses.carbon +++ b/toolchain/check/testdata/class/fail_import_misuses.carbon @@ -91,14 +91,14 @@ var a: Incomplete; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Main//a, inst+3, loaded [template = constants.%Empty] -// CHECK:STDOUT: %import_ref.2: type = import_ref Main//a, inst+8, loaded [template = constants.%Incomplete] +// CHECK:STDOUT: %import_ref.1: type = import_ref Main//a, Empty, loaded [template = constants.%Empty] +// CHECK:STDOUT: %import_ref.2: type = import_ref Main//a, Incomplete, loaded [template = constants.%Incomplete] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.3: = import_ref Main//a, inst+6, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.4 = import_ref Main//a, inst+4, unloaded +// CHECK:STDOUT: %import_ref.3: = import_ref Main//a, loc5_1, loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.4 = import_ref Main//a, inst16 [no loc], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/class/generic/adapt.carbon b/toolchain/check/testdata/class/generic/adapt.carbon index 6fb769d1a9f0b..56fdfca510175 100644 --- a/toolchain/check/testdata/class/generic/adapt.carbon +++ b/toolchain/check/testdata/class/generic/adapt.carbon @@ -286,19 +286,19 @@ fn ImportedConvertLocal(a: Adapter(C)) -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %C.type = import_ref Main//adapt_specific_type, inst+9, loaded [template = constants.%C.generic] -// CHECK:STDOUT: %import_ref.2: type = import_ref Main//adapt_specific_type, inst+26, loaded [template = constants.%Adapter] -// CHECK:STDOUT: %import_ref.3 = import_ref Main//adapt_specific_type, inst+64, unloaded +// CHECK:STDOUT: %import_ref.1: %C.type = import_ref Main//adapt_specific_type, C, loaded [template = constants.%C.generic] +// CHECK:STDOUT: %import_ref.2: type = import_ref Main//adapt_specific_type, Adapter, loaded [template = constants.%Adapter] +// CHECK:STDOUT: %import_ref.3 = import_ref Main//adapt_specific_type, Access, unloaded // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.10 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.4: = import_ref Main//adapt_specific_type, inst+20, loaded [symbolic = @C.%complete_type (constants.%complete_type.1)] -// CHECK:STDOUT: %import_ref.5 = import_ref Main//adapt_specific_type, inst+15, unloaded -// CHECK:STDOUT: %import_ref.6: @C.%C.elem (%C.elem.1) = import_ref Main//adapt_specific_type, inst+18, loaded [template = %.1] -// CHECK:STDOUT: %import_ref.8: = import_ref Main//adapt_specific_type, inst+50, loaded [template = constants.%complete_type.2] -// CHECK:STDOUT: %import_ref.9 = import_ref Main//adapt_specific_type, inst+27, unloaded +// CHECK:STDOUT: %import_ref.4: = import_ref Main//adapt_specific_type, loc6_1, loaded [symbolic = @C.%complete_type (constants.%complete_type.1)] +// CHECK:STDOUT: %import_ref.5 = import_ref Main//adapt_specific_type, inst27 [no loc], unloaded +// CHECK:STDOUT: %import_ref.6: @C.%C.elem (%C.elem.1) = import_ref Main//adapt_specific_type, loc5_8, loaded [template = %.1] +// CHECK:STDOUT: %import_ref.8: = import_ref Main//adapt_specific_type, loc10_1, loaded [template = constants.%complete_type.2] +// CHECK:STDOUT: %import_ref.9 = import_ref Main//adapt_specific_type, inst39 [no loc], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -655,20 +655,20 @@ fn ImportedConvertLocal(a: Adapter(C)) -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1 = import_ref Main//extend_adapt_specific_type_library, inst+9, unloaded -// CHECK:STDOUT: %import_ref.2: type = import_ref Main//extend_adapt_specific_type_library, inst+26, loaded [template = constants.%Adapter] +// CHECK:STDOUT: %import_ref.1 = import_ref Main//extend_adapt_specific_type_library, C, unloaded +// CHECK:STDOUT: %import_ref.2: type = import_ref Main//extend_adapt_specific_type_library, Adapter, loaded [template = constants.%Adapter] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.10 // CHECK:STDOUT: .ImplicitAs = %import_ref.11 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.3: = import_ref Main//extend_adapt_specific_type_library, inst+20, loaded [symbolic = @C.%complete_type (constants.%complete_type.1)] -// CHECK:STDOUT: %import_ref.4 = import_ref Main//extend_adapt_specific_type_library, inst+15, unloaded -// CHECK:STDOUT: %import_ref.5: @C.%C.elem (%C.elem.1) = import_ref Main//extend_adapt_specific_type_library, inst+18, loaded [template = %.1] -// CHECK:STDOUT: %import_ref.7: = import_ref Main//extend_adapt_specific_type_library, inst+50, loaded [template = constants.%complete_type.2] -// CHECK:STDOUT: %import_ref.8 = import_ref Main//extend_adapt_specific_type_library, inst+27, unloaded -// CHECK:STDOUT: %import_ref.9: type = import_ref Main//extend_adapt_specific_type_library, inst+43, loaded [template = constants.%C.2] +// CHECK:STDOUT: %import_ref.3: = import_ref Main//extend_adapt_specific_type_library, loc9_1, loaded [symbolic = @C.%complete_type (constants.%complete_type.1)] +// CHECK:STDOUT: %import_ref.4 = import_ref Main//extend_adapt_specific_type_library, inst27 [no loc], unloaded +// CHECK:STDOUT: %import_ref.5: @C.%C.elem (%C.elem.1) = import_ref Main//extend_adapt_specific_type_library, loc8_8, loaded [template = %.1] +// CHECK:STDOUT: %import_ref.7: = import_ref Main//extend_adapt_specific_type_library, loc13_1, loaded [template = constants.%complete_type.2] +// CHECK:STDOUT: %import_ref.8 = import_ref Main//extend_adapt_specific_type_library, inst39 [no loc], unloaded +// CHECK:STDOUT: %import_ref.9: type = import_ref Main//extend_adapt_specific_type_library, loc12_21, loaded [template = constants.%C.2] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -887,15 +887,15 @@ fn ImportedConvertLocal(a: Adapter(C)) -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Adapter.type = import_ref Main//adapt_generic_type, inst+9, loaded [template = constants.%Adapter.generic] -// CHECK:STDOUT: %import_ref.2 = import_ref Main//adapt_generic_type, inst+50, unloaded +// CHECK:STDOUT: %import_ref.1: %Adapter.type = import_ref Main//adapt_generic_type, Adapter, loaded [template = constants.%Adapter.generic] +// CHECK:STDOUT: %import_ref.2 = import_ref Main//adapt_generic_type, Convert, unloaded // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.6 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.4: = import_ref Main//adapt_generic_type, inst+18, loaded [symbolic = @Adapter.%complete_type (constants.%complete_type.1)] -// CHECK:STDOUT: %import_ref.5 = import_ref Main//adapt_generic_type, inst+15, unloaded +// CHECK:STDOUT: %import_ref.4: = import_ref Main//adapt_generic_type, loc6_1, loaded [symbolic = @Adapter.%complete_type (constants.%complete_type.1)] +// CHECK:STDOUT: %import_ref.5 = import_ref Main//adapt_generic_type, inst27 [no loc], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/class/generic/base_is_generic.carbon b/toolchain/check/testdata/class/generic/base_is_generic.carbon index 99b20833b9b92..adb04b35b3894 100644 --- a/toolchain/check/testdata/class/generic/base_is_generic.carbon +++ b/toolchain/check/testdata/class/generic/base_is_generic.carbon @@ -272,25 +272,25 @@ fn H() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1 = import_ref Main//extend_generic_base, inst+9, unloaded -// CHECK:STDOUT: %import_ref.2 = import_ref Main//extend_generic_base, inst+26, unloaded -// CHECK:STDOUT: %import_ref.3: type = import_ref Main//extend_generic_base, inst+47, loaded [template = constants.%Derived] -// CHECK:STDOUT: %import_ref.4 = import_ref Main//extend_generic_base, inst+77, unloaded +// CHECK:STDOUT: %import_ref.1 = import_ref Main//extend_generic_base, Base, unloaded +// CHECK:STDOUT: %import_ref.2 = import_ref Main//extend_generic_base, Param, unloaded +// CHECK:STDOUT: %import_ref.3: type = import_ref Main//extend_generic_base, Derived, loaded [template = constants.%Derived] +// CHECK:STDOUT: %import_ref.4 = import_ref Main//extend_generic_base, DoubleFieldAccess, unloaded // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.16 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.5: = import_ref Main//extend_generic_base, inst+45, loaded [template = constants.%complete_type.1] -// CHECK:STDOUT: %import_ref.6 = import_ref Main//extend_generic_base, inst+27, unloaded -// CHECK:STDOUT: %import_ref.7: %Param.elem = import_ref Main//extend_generic_base, inst+43, loaded [template = %.1] -// CHECK:STDOUT: %import_ref.8: = import_ref Main//extend_generic_base, inst+20, loaded [symbolic = @Base.%complete_type (constants.%complete_type.2)] -// CHECK:STDOUT: %import_ref.9 = import_ref Main//extend_generic_base, inst+15, unloaded -// CHECK:STDOUT: %import_ref.10: @Base.%Base.elem (%Base.elem.1) = import_ref Main//extend_generic_base, inst+18, loaded [template = %.2] -// CHECK:STDOUT: %import_ref.12: = import_ref Main//extend_generic_base, inst+62, loaded [template = constants.%complete_type.3] -// CHECK:STDOUT: %import_ref.13 = import_ref Main//extend_generic_base, inst+48, unloaded -// CHECK:STDOUT: %import_ref.14 = import_ref Main//extend_generic_base, inst+60, unloaded -// CHECK:STDOUT: %import_ref.15: type = import_ref Main//extend_generic_base, inst+51, loaded [template = constants.%Base.2] +// CHECK:STDOUT: %import_ref.5: = import_ref Main//extend_generic_base, loc10_1, loaded [template = constants.%complete_type.1] +// CHECK:STDOUT: %import_ref.6 = import_ref Main//extend_generic_base, inst39 [no loc], unloaded +// CHECK:STDOUT: %import_ref.7: %Param.elem = import_ref Main//extend_generic_base, loc9_8, loaded [template = %.1] +// CHECK:STDOUT: %import_ref.8: = import_ref Main//extend_generic_base, loc6_1, loaded [symbolic = @Base.%complete_type (constants.%complete_type.2)] +// CHECK:STDOUT: %import_ref.9 = import_ref Main//extend_generic_base, inst27 [no loc], unloaded +// CHECK:STDOUT: %import_ref.10: @Base.%Base.elem (%Base.elem.1) = import_ref Main//extend_generic_base, loc5_8, loaded [template = %.2] +// CHECK:STDOUT: %import_ref.12: = import_ref Main//extend_generic_base, loc14_1, loaded [template = constants.%complete_type.3] +// CHECK:STDOUT: %import_ref.13 = import_ref Main//extend_generic_base, inst60 [no loc], unloaded +// CHECK:STDOUT: %import_ref.14 = import_ref Main//extend_generic_base, loc13_27, unloaded +// CHECK:STDOUT: %import_ref.15: type = import_ref Main//extend_generic_base, loc13_26, loaded [template = constants.%Base.2] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -779,21 +779,21 @@ fn H() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1 = import_ref Main//extend_generic_symbolic_base, inst+9, unloaded -// CHECK:STDOUT: %import_ref.2: %C.type = import_ref Main//extend_generic_symbolic_base, inst+47, loaded [template = constants.%C.generic] -// CHECK:STDOUT: %import_ref.3 = import_ref Main//extend_generic_symbolic_base, inst+70, unloaded +// CHECK:STDOUT: %import_ref.1 = import_ref Main//extend_generic_symbolic_base, X, unloaded +// CHECK:STDOUT: %import_ref.2: %C.type = import_ref Main//extend_generic_symbolic_base, C, loaded [template = constants.%C.generic] +// CHECK:STDOUT: %import_ref.3 = import_ref Main//extend_generic_symbolic_base, F, unloaded // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.4 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.5: = import_ref Main//extend_generic_symbolic_base, inst+26, loaded [template = constants.%complete_type.1] -// CHECK:STDOUT: %import_ref.6 = import_ref Main//extend_generic_symbolic_base, inst+15, unloaded -// CHECK:STDOUT: %import_ref.7: @X.%G.type (%G.type.1) = import_ref Main//extend_generic_symbolic_base, inst+21, loaded [symbolic = @X.%G (constants.%G.1)] -// CHECK:STDOUT: %import_ref.9: = import_ref Main//extend_generic_symbolic_base, inst+63, loaded [symbolic = @C.%complete_type (constants.%complete_type.2)] -// CHECK:STDOUT: %import_ref.10 = import_ref Main//extend_generic_symbolic_base, inst+52, unloaded -// CHECK:STDOUT: %import_ref.11 = import_ref Main//extend_generic_symbolic_base, inst+61, unloaded -// CHECK:STDOUT: %import_ref.12: type = import_ref Main//extend_generic_symbolic_base, inst+55, loaded [symbolic = @C.%X (constants.%X.2)] +// CHECK:STDOUT: %import_ref.5: = import_ref Main//extend_generic_symbolic_base, loc6_1, loaded [template = constants.%complete_type.1] +// CHECK:STDOUT: %import_ref.6 = import_ref Main//extend_generic_symbolic_base, inst27 [no loc], unloaded +// CHECK:STDOUT: %import_ref.7: @X.%G.type (%G.type.1) = import_ref Main//extend_generic_symbolic_base, loc5_15, loaded [symbolic = @X.%G (constants.%G.1)] +// CHECK:STDOUT: %import_ref.9: = import_ref Main//extend_generic_symbolic_base, loc10_1, loaded [symbolic = @C.%complete_type (constants.%complete_type.2)] +// CHECK:STDOUT: %import_ref.10 = import_ref Main//extend_generic_symbolic_base, inst64 [no loc], unloaded +// CHECK:STDOUT: %import_ref.11 = import_ref Main//extend_generic_symbolic_base, loc9_20, unloaded +// CHECK:STDOUT: %import_ref.12: type = import_ref Main//extend_generic_symbolic_base, loc9_19, loaded [symbolic = @C.%X (constants.%X.2)] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/class/generic/import.carbon b/toolchain/check/testdata/class/generic/import.carbon index 6ea8c618dba44..2e3138016b2b9 100644 --- a/toolchain/check/testdata/class/generic/import.carbon +++ b/toolchain/check/testdata/class/generic/import.carbon @@ -294,17 +294,17 @@ class Class(U:! type) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.2: %CompleteClass.type = import_ref Main//foo, inst+20, loaded [template = constants.%CompleteClass.generic] +// CHECK:STDOUT: %import_ref.2: %CompleteClass.type = import_ref Main//foo, CompleteClass, loaded [template = constants.%CompleteClass.generic] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.42 // CHECK:STDOUT: .ImplicitAs = %import_ref.43 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.38: = import_ref Main//foo, inst+54, loaded [template = constants.%complete_type.2] -// CHECK:STDOUT: %import_ref.39 = import_ref Main//foo, inst+25, unloaded -// CHECK:STDOUT: %import_ref.40 = import_ref Main//foo, inst+41, unloaded -// CHECK:STDOUT: %import_ref.41 = import_ref Main//foo, inst+50, unloaded +// CHECK:STDOUT: %import_ref.38: = import_ref Main//foo, loc9_1, loaded [template = constants.%complete_type.2] +// CHECK:STDOUT: %import_ref.39 = import_ref Main//foo, inst37 [no loc], unloaded +// CHECK:STDOUT: %import_ref.40 = import_ref Main//foo, loc7_8, unloaded +// CHECK:STDOUT: %import_ref.41 = import_ref Main//foo, loc8_17, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -472,18 +472,18 @@ class Class(U:! type) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1 = import_ref Main//foo, inst+9, unloaded -// CHECK:STDOUT: %import_ref.2: %CompleteClass.type = import_ref Main//foo, inst+20, loaded [template = constants.%CompleteClass.generic] -// CHECK:STDOUT: %import_ref.3: %F.type.3 = import_ref Main//foo, inst+362, loaded [template = constants.%F.3] +// CHECK:STDOUT: %import_ref.1 = import_ref Main//foo, Class, unloaded +// CHECK:STDOUT: %import_ref.2: %CompleteClass.type = import_ref Main//foo, CompleteClass, loaded [template = constants.%CompleteClass.generic] +// CHECK:STDOUT: %import_ref.3: %F.type.3 = import_ref Main//foo, F, loaded [template = constants.%F.3] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.4 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.5: = import_ref Main//foo, inst+54, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.6 = import_ref Main//foo, inst+25, unloaded -// CHECK:STDOUT: %import_ref.7: @CompleteClass.%CompleteClass.elem (%CompleteClass.elem.1) = import_ref Main//foo, inst+41, loaded [template = %.1] -// CHECK:STDOUT: %import_ref.8: @CompleteClass.%F.type (%F.type.1) = import_ref Main//foo, inst+50, loaded [symbolic = @CompleteClass.%F (constants.%F.1)] +// CHECK:STDOUT: %import_ref.5: = import_ref Main//foo, loc9_1, loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.6 = import_ref Main//foo, inst37 [no loc], unloaded +// CHECK:STDOUT: %import_ref.7: @CompleteClass.%CompleteClass.elem (%CompleteClass.elem.1) = import_ref Main//foo, loc7_8, loaded [template = %.1] +// CHECK:STDOUT: %import_ref.8: @CompleteClass.%F.type (%F.type.1) = import_ref Main//foo, loc8_17, loaded [symbolic = @CompleteClass.%F (constants.%F.1)] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -659,19 +659,19 @@ class Class(U:! type) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1 = import_ref Main//foo, inst+9, unloaded -// CHECK:STDOUT: %import_ref.2: %CompleteClass.type = import_ref Main//foo, inst+20, loaded [template = constants.%CompleteClass.generic] -// CHECK:STDOUT: %import_ref.3: %F.type.3 = import_ref Main//foo, inst+362, loaded [template = constants.%F.3] +// CHECK:STDOUT: %import_ref.1 = import_ref Main//foo, Class, unloaded +// CHECK:STDOUT: %import_ref.2: %CompleteClass.type = import_ref Main//foo, CompleteClass, loaded [template = constants.%CompleteClass.generic] +// CHECK:STDOUT: %import_ref.3: %F.type.3 = import_ref Main//foo, F, loaded [template = constants.%F.3] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.8 // CHECK:STDOUT: .ImplicitAs = %import_ref.9 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.4: = import_ref Main//foo, inst+54, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.5 = import_ref Main//foo, inst+25, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Main//foo, inst+41, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref Main//foo, inst+50, unloaded +// CHECK:STDOUT: %import_ref.4: = import_ref Main//foo, loc9_1, loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.5 = import_ref Main//foo, inst37 [no loc], unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Main//foo, loc7_8, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Main//foo, loc8_17, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -788,9 +788,9 @@ class Class(U:! type) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Class.type = import_ref Main//foo, inst+9, loaded [template = constants.%Class.generic] -// CHECK:STDOUT: %import_ref.2 = import_ref Main//foo, inst+20, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref Main//foo, inst+362, unloaded +// CHECK:STDOUT: %import_ref.1: %Class.type = import_ref Main//foo, Class, loaded [template = constants.%Class.generic] +// CHECK:STDOUT: %import_ref.2 = import_ref Main//foo, CompleteClass, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref Main//foo, F, unloaded // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... diff --git a/toolchain/check/testdata/class/import.carbon b/toolchain/check/testdata/class/import.carbon index df03b4ca965fe..2707ce3dc2a25 100644 --- a/toolchain/check/testdata/class/import.carbon +++ b/toolchain/check/testdata/class/import.carbon @@ -194,28 +194,28 @@ fn Run() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Main//a, inst+3, loaded [template = constants.%Empty] -// CHECK:STDOUT: %import_ref.2: type = import_ref Main//a, inst+8, loaded [template = constants.%Field] -// CHECK:STDOUT: %import_ref.3: type = import_ref Main//a, inst+30, loaded [template = constants.%ForwardDeclared.1] -// CHECK:STDOUT: %import_ref.4: type = import_ref Main//a, inst+53, loaded [template = constants.%Incomplete] +// CHECK:STDOUT: %import_ref.1: type = import_ref Main//a, Empty, loaded [template = constants.%Empty] +// CHECK:STDOUT: %import_ref.2: type = import_ref Main//a, Field, loaded [template = constants.%Field] +// CHECK:STDOUT: %import_ref.3: type = import_ref Main//a, ForwardDeclared, loaded [template = constants.%ForwardDeclared.1] +// CHECK:STDOUT: %import_ref.4: type = import_ref Main//a, Incomplete, loaded [template = constants.%Incomplete] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .ImplicitAs = %import_ref.10 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.5: = import_ref Main//a, inst+6, loaded [template = constants.%complete_type.1] -// CHECK:STDOUT: %import_ref.6 = import_ref Main//a, inst+4, unloaded -// CHECK:STDOUT: %import_ref.7: = import_ref Main//a, inst+28, loaded [template = constants.%complete_type.2] -// CHECK:STDOUT: %import_ref.8 = import_ref Main//a, inst+9, unloaded -// CHECK:STDOUT: %import_ref.9: %Field.elem = import_ref Main//a, inst+26, loaded [template = %.1] -// CHECK:STDOUT: %import_ref.46: = import_ref Main//a, inst+52, loaded [template = constants.%complete_type.1] -// CHECK:STDOUT: %import_ref.47 = import_ref Main//a, inst+31, unloaded -// CHECK:STDOUT: %import_ref.48: %F.type = import_ref Main//a, inst+38, loaded [template = constants.%F] -// CHECK:STDOUT: %import_ref.49: %G.type = import_ref Main//a, inst+49, loaded [template = constants.%G] -// CHECK:STDOUT: %import_ref.50: = import_ref Main//a, inst+52, loaded [template = constants.%complete_type.1] -// CHECK:STDOUT: %import_ref.51 = import_ref Main//a, inst+31, unloaded -// CHECK:STDOUT: %import_ref.52 = import_ref Main//a, inst+38, unloaded -// CHECK:STDOUT: %import_ref.53 = import_ref Main//a, inst+49, unloaded +// CHECK:STDOUT: %import_ref.5: = import_ref Main//a, loc5_1, loaded [template = constants.%complete_type.1] +// CHECK:STDOUT: %import_ref.6 = import_ref Main//a, inst16 [no loc], unloaded +// CHECK:STDOUT: %import_ref.7: = import_ref Main//a, loc9_1, loaded [template = constants.%complete_type.2] +// CHECK:STDOUT: %import_ref.8 = import_ref Main//a, inst21 [no loc], unloaded +// CHECK:STDOUT: %import_ref.9: %Field.elem = import_ref Main//a, loc8_8, loaded [template = %.1] +// CHECK:STDOUT: %import_ref.46: = import_ref Main//a, loc16_1, loaded [template = constants.%complete_type.1] +// CHECK:STDOUT: %import_ref.47 = import_ref Main//a, inst43 [no loc], unloaded +// CHECK:STDOUT: %import_ref.48: %F.type = import_ref Main//a, loc14_21, loaded [template = constants.%F] +// CHECK:STDOUT: %import_ref.49: %G.type = import_ref Main//a, loc15_27, loaded [template = constants.%G] +// CHECK:STDOUT: %import_ref.50: = import_ref Main//a, loc16_1, loaded [template = constants.%complete_type.1] +// CHECK:STDOUT: %import_ref.51 = import_ref Main//a, inst43 [no loc], unloaded +// CHECK:STDOUT: %import_ref.52 = import_ref Main//a, loc14_21, unloaded +// CHECK:STDOUT: %import_ref.53 = import_ref Main//a, loc15_27, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -330,5 +330,5 @@ fn Run() { // CHECK:STDOUT: // CHECK:STDOUT: fn @F[%self.param_patt: %ForwardDeclared.1]() [from "a.carbon"]; // CHECK:STDOUT: -// CHECK:STDOUT: fn @G[addr .inst+389: %ptr.3]() [from "a.carbon"]; +// CHECK:STDOUT: fn @G[addr .inst401: %ptr.3]() [from "a.carbon"]; // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/import_base.carbon b/toolchain/check/testdata/class/import_base.carbon index c1e1db501a7cb..c7984b69f5d30 100644 --- a/toolchain/check/testdata/class/import_base.carbon +++ b/toolchain/check/testdata/class/import_base.carbon @@ -170,23 +170,23 @@ fn Run() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1 = import_ref Main//a, inst+3, unloaded -// CHECK:STDOUT: %import_ref.2: type = import_ref Main//a, inst+46, loaded [template = constants.%Child] +// CHECK:STDOUT: %import_ref.1 = import_ref Main//a, Base, unloaded +// CHECK:STDOUT: %import_ref.2: type = import_ref Main//a, Child, loaded [template = constants.%Child] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .ImplicitAs = %import_ref.14 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.3: = import_ref Main//a, inst+44, loaded [template = constants.%complete_type.1] -// CHECK:STDOUT: %import_ref.4 = import_ref Main//a, inst+4, unloaded -// CHECK:STDOUT: %import_ref.5: %F.type = import_ref Main//a, inst+10, loaded [template = constants.%F] -// CHECK:STDOUT: %import_ref.6 = import_ref Main//a, inst+19, unloaded -// CHECK:STDOUT: %import_ref.7: %Base.elem = import_ref Main//a, inst+37, loaded [template = %.1] -// CHECK:STDOUT: %import_ref.8 = import_ref Main//a, inst+42, unloaded -// CHECK:STDOUT: %import_ref.10: = import_ref Main//a, inst+53, loaded [template = constants.%complete_type.2] -// CHECK:STDOUT: %import_ref.11 = import_ref Main//a, inst+47, unloaded -// CHECK:STDOUT: %import_ref.12 = import_ref Main//a, inst+51, unloaded -// CHECK:STDOUT: %import_ref.13: type = import_ref Main//a, inst+48, loaded [template = constants.%Base] +// CHECK:STDOUT: %import_ref.3: = import_ref Main//a, loc10_1, loaded [template = constants.%complete_type.1] +// CHECK:STDOUT: %import_ref.4 = import_ref Main//a, inst16 [no loc], unloaded +// CHECK:STDOUT: %import_ref.5: %F.type = import_ref Main//a, loc5_21, loaded [template = constants.%F] +// CHECK:STDOUT: %import_ref.6 = import_ref Main//a, loc6_26, unloaded +// CHECK:STDOUT: %import_ref.7: %Base.elem = import_ref Main//a, loc8_8, loaded [template = %.1] +// CHECK:STDOUT: %import_ref.8 = import_ref Main//a, loc9_13, unloaded +// CHECK:STDOUT: %import_ref.10: = import_ref Main//a, loc14_1, loaded [template = constants.%complete_type.2] +// CHECK:STDOUT: %import_ref.11 = import_ref Main//a, inst59 [no loc], unloaded +// CHECK:STDOUT: %import_ref.12 = import_ref Main//a, loc13_20, unloaded +// CHECK:STDOUT: %import_ref.13: type = import_ref Main//a, loc13_16, loaded [template = constants.%Base] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/class/import_indirect.carbon b/toolchain/check/testdata/class/import_indirect.carbon index 48129faf6d504..8d1b4c744db48 100644 --- a/toolchain/check/testdata/class/import_indirect.carbon +++ b/toolchain/check/testdata/class/import_indirect.carbon @@ -143,13 +143,13 @@ var ptr: E* = &val; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Main//a, inst+3, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.1: type = import_ref Main//a, C, loaded [template = constants.%C] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.2: = import_ref Main//a, inst+6, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.3 = import_ref Main//a, inst+4, unloaded +// CHECK:STDOUT: %import_ref.2: = import_ref Main//a, loc4_10, loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.3 = import_ref Main//a, inst16 [no loc], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -202,13 +202,13 @@ var ptr: E* = &val; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Main//a, inst+3, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.1: type = import_ref Main//a, C, loaded [template = constants.%C] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.2: = import_ref Main//a, inst+6, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.3 = import_ref Main//a, inst+4, unloaded +// CHECK:STDOUT: %import_ref.2: = import_ref Main//a, loc4_10, loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.3 = import_ref Main//a, inst16 [no loc], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -261,16 +261,16 @@ var ptr: E* = &val; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Main//a, inst+3, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2: type = import_ref Main//b, inst+12, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.3 = import_ref Main//b, inst+17, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Main//b, inst+27, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Main//a, C, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2: type = import_ref Main//b, D, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.3 = import_ref Main//b, b_val, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Main//b, b_ptr, unloaded // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.5: = import_ref Main//a, inst+6, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.6 = import_ref Main//a, inst+4, unloaded +// CHECK:STDOUT: %import_ref.5: = import_ref Main//a, loc4_10, loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.6 = import_ref Main//a, inst16 [no loc], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -323,16 +323,16 @@ var ptr: E* = &val; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Main//b, inst+12, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2 = import_ref Main//b, inst+17, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref Main//b, inst+27, unloaded -// CHECK:STDOUT: %import_ref.4: type = import_ref Main//a, inst+3, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.1: type = import_ref Main//b, D, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2 = import_ref Main//b, b_val, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref Main//b, b_ptr, unloaded +// CHECK:STDOUT: %import_ref.4: type = import_ref Main//a, C, loaded [template = constants.%C] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.5: = import_ref Main//a, inst+6, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.6 = import_ref Main//a, inst+4, unloaded +// CHECK:STDOUT: %import_ref.5: = import_ref Main//a, loc4_10, loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.6 = import_ref Main//a, inst16 [no loc], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -385,18 +385,18 @@ var ptr: E* = &val; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Main//b, inst+12, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2 = import_ref Main//b, inst+17, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref Main//b, inst+27, unloaded -// CHECK:STDOUT: %import_ref.4: type = import_ref Main//c, inst+12, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.5 = import_ref Main//c, inst+17, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Main//c, inst+27, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Main//b, D, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2 = import_ref Main//b, b_val, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref Main//b, b_ptr, unloaded +// CHECK:STDOUT: %import_ref.4: type = import_ref Main//c, E, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.5 = import_ref Main//c, c_val, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Main//c, c_ptr, unloaded // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.7: = import_ref Main//b, inst+9, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.8 = import_ref Main//b, inst+10, unloaded +// CHECK:STDOUT: %import_ref.7: = import_ref Main//b, inst21 [indirect], loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.8 = import_ref Main//b, inst22 [indirect], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -451,18 +451,18 @@ var ptr: E* = &val; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Main//c, inst+12, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2 = import_ref Main//c, inst+17, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref Main//c, inst+27, unloaded -// CHECK:STDOUT: %import_ref.4: type = import_ref Main//b, inst+12, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.5 = import_ref Main//b, inst+17, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Main//b, inst+27, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Main//c, E, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2 = import_ref Main//c, c_val, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref Main//c, c_ptr, unloaded +// CHECK:STDOUT: %import_ref.4: type = import_ref Main//b, D, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.5 = import_ref Main//b, b_val, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Main//b, b_ptr, unloaded // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.7: = import_ref Main//b, inst+9, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.8 = import_ref Main//b, inst+10, unloaded +// CHECK:STDOUT: %import_ref.7: = import_ref Main//b, inst21 [indirect], loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.8 = import_ref Main//b, inst22 [indirect], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/class/import_member_cycle.carbon b/toolchain/check/testdata/class/import_member_cycle.carbon index b595f9b542ddc..ddf0929ac804d 100644 --- a/toolchain/check/testdata/class/import_member_cycle.carbon +++ b/toolchain/check/testdata/class/import_member_cycle.carbon @@ -76,14 +76,14 @@ fn Run() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Main//a, inst+3, loaded [template = constants.%Cycle] +// CHECK:STDOUT: %import_ref.1: type = import_ref Main//a, Cycle, loaded [template = constants.%Cycle] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.2: = import_ref Main//a, inst+11, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.3 = import_ref Main//a, inst+4, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Main//a, inst+9, unloaded +// CHECK:STDOUT: %import_ref.2: = import_ref Main//a, loc6_1, loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.3 = import_ref Main//a, inst16 [no loc], unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Main//a, loc5_8, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/class/import_struct_cyle.carbon b/toolchain/check/testdata/class/import_struct_cyle.carbon index 452e1c0ee2e33..c4abd2475b5e5 100644 --- a/toolchain/check/testdata/class/import_struct_cyle.carbon +++ b/toolchain/check/testdata/class/import_struct_cyle.carbon @@ -92,15 +92,15 @@ fn Run() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1 = import_ref Main//a, inst+3, unloaded -// CHECK:STDOUT: %import_ref.2: ref %struct_type.b = import_ref Main//a, inst+11, loaded +// CHECK:STDOUT: %import_ref.1 = import_ref Main//a, Cycle, unloaded +// CHECK:STDOUT: %import_ref.2: ref %struct_type.b = import_ref Main//a, a, loaded // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.3: = import_ref Main//a, inst+19, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.4 = import_ref Main//a, inst+4, unloaded -// CHECK:STDOUT: %import_ref.5: %Cycle.elem = import_ref Main//a, inst+17, loaded [template = %.1] +// CHECK:STDOUT: %import_ref.3: = import_ref Main//a, loc11_1, loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.4 = import_ref Main//a, inst16 [no loc], unloaded +// CHECK:STDOUT: %import_ref.5: %Cycle.elem = import_ref Main//a, loc10_8, loaded [template = %.1] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/class/no_prelude/export_name.carbon b/toolchain/check/testdata/class/no_prelude/export_name.carbon index 01b3cd759707d..4996ab9a3a8ab 100644 --- a/toolchain/check/testdata/class/no_prelude/export_name.carbon +++ b/toolchain/check/testdata/class/no_prelude/export_name.carbon @@ -70,9 +70,9 @@ var c: C = {}; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Main//base, inst+1, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2: = import_ref Main//base, inst+4, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.3 = import_ref Main//base, inst+2, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Main//base, C, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2: = import_ref Main//base, loc4_10, loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.3 = import_ref Main//base, inst14 [no loc], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -99,9 +99,9 @@ var c: C = {}; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Main//export, inst+9, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2: = import_ref Main//export, inst+7, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.3 = import_ref Main//export, inst+8, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Main//export, C, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2: = import_ref Main//export, inst19 [indirect], loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.3 = import_ref Main//export, inst20 [indirect], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/class/no_prelude/extern.carbon b/toolchain/check/testdata/class/no_prelude/extern.carbon index 20c83909b08e3..59683a4e55265 100644 --- a/toolchain/check/testdata/class/no_prelude/extern.carbon +++ b/toolchain/check/testdata/class/no_prelude/extern.carbon @@ -495,7 +495,7 @@ extern class C; // CHECK:STDOUT: --- fail_import_extern_decl_then_decl.carbon // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1 = import_ref Main//extern_decl, inst+1, unloaded +// CHECK:STDOUT: %import_ref.1 = import_ref Main//extern_decl, C, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -508,7 +508,7 @@ extern class C; // CHECK:STDOUT: --- fail_import_decl_then_extern_decl.carbon // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1 = import_ref Main//decl, inst+1, unloaded +// CHECK:STDOUT: %import_ref.1 = import_ref Main//decl, C, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -521,7 +521,7 @@ extern class C; // CHECK:STDOUT: --- fail_import_extern_decl_then_def.carbon // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1 = import_ref Main//extern_decl, inst+1, unloaded +// CHECK:STDOUT: %import_ref.1 = import_ref Main//extern_decl, C, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -534,7 +534,7 @@ extern class C; // CHECK:STDOUT: --- fail_import_ownership_conflict.carbon // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1 = import_ref Main//extern_decl, inst+1, unloaded +// CHECK:STDOUT: %import_ref.1 = import_ref Main//extern_decl, C, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -547,7 +547,7 @@ extern class C; // CHECK:STDOUT: --- fail_todo_import_extern_decl_copy.carbon // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1 = import_ref Main//extern_decl, inst+1, unloaded +// CHECK:STDOUT: %import_ref.1 = import_ref Main//extern_decl, C, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -604,8 +604,8 @@ extern class C; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.2: = import_ref Main//def, inst+4, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.3 = import_ref Main//def, inst+2, unloaded +// CHECK:STDOUT: %import_ref.2: = import_ref Main//def, loc4_10, loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.3 = import_ref Main//def, inst14 [no loc], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -631,8 +631,8 @@ extern class C; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.2: = import_ref Main//def, inst+4, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.3 = import_ref Main//def, inst+2, unloaded +// CHECK:STDOUT: %import_ref.2: = import_ref Main//def, loc4_10, loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.3 = import_ref Main//def, inst14 [no loc], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/class/no_prelude/implicit_import.carbon b/toolchain/check/testdata/class/no_prelude/implicit_import.carbon index 1509fec44ef6c..d6c8b2013e8cb 100644 --- a/toolchain/check/testdata/class/no_prelude/implicit_import.carbon +++ b/toolchain/check/testdata/class/no_prelude/implicit_import.carbon @@ -155,8 +155,8 @@ class B {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.2: = import_ref Main//redecl_after_def, inst+4, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.3 = import_ref Main//redecl_after_def, inst+2, unloaded +// CHECK:STDOUT: %import_ref.2: = import_ref Main//redecl_after_def, loc4_10, loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.3 = import_ref Main//redecl_after_def, inst14 [no loc], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -207,9 +207,9 @@ class B {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Main//redef_after_def, inst+1, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2: = import_ref Main//redef_after_def, inst+4, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.3 = import_ref Main//redef_after_def, inst+2, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Main//redef_after_def, C, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2: = import_ref Main//redef_after_def, loc4_10, loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.3 = import_ref Main//redef_after_def, inst14 [no loc], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -263,8 +263,8 @@ class B {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1 = import_ref Main//def_alias, inst+1, unloaded -// CHECK:STDOUT: %import_ref.2: type = import_ref Main//def_alias, inst+4, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.1 = import_ref Main//def_alias, C, unloaded +// CHECK:STDOUT: %import_ref.2: type = import_ref Main//def_alias, B, loaded [template = constants.%C] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/class/no_prelude/import_access.carbon b/toolchain/check/testdata/class/no_prelude/import_access.carbon index 60c5d568d46da..e08c8fc6e1c0c 100644 --- a/toolchain/check/testdata/class/no_prelude/import_access.carbon +++ b/toolchain/check/testdata/class/no_prelude/import_access.carbon @@ -207,9 +207,9 @@ private class Redecl {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Test//def, inst+1, loaded [template = constants.%Def] -// CHECK:STDOUT: %import_ref.2: = import_ref Test//def, inst+4, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.3 = import_ref Test//def, inst+2, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Test//def, Def, loaded [template = constants.%Def] +// CHECK:STDOUT: %import_ref.2: = import_ref Test//def, loc4_20, loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.3 = import_ref Test//def, inst14 [no loc], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -303,9 +303,9 @@ private class Redecl {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Test//forward_with_def, inst+1, loaded [template = constants.%ForwardWithDef] -// CHECK:STDOUT: %import_ref.2: = import_ref Test//forward_with_def, inst+5, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.3 = import_ref Test//forward_with_def, inst+2, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Test//forward_with_def, ForwardWithDef, loaded [template = constants.%ForwardWithDef] +// CHECK:STDOUT: %import_ref.2: = import_ref Test//forward_with_def, loc6_23, loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.3 = import_ref Test//forward_with_def, inst14 [no loc], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -401,7 +401,7 @@ private class Redecl {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref: type = import_ref Test//forward, inst+1, loaded [template = constants.%Forward] +// CHECK:STDOUT: %import_ref: type = import_ref Test//forward, Forward, loaded [template = constants.%Forward] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/class/no_prelude/indirect_import_member.carbon b/toolchain/check/testdata/class/no_prelude/indirect_import_member.carbon index 218bda9046a89..1a0f4cdfd9945 100644 --- a/toolchain/check/testdata/class/no_prelude/indirect_import_member.carbon +++ b/toolchain/check/testdata/class/no_prelude/indirect_import_member.carbon @@ -135,7 +135,7 @@ var x: () = D.C.F(); // CHECK:STDOUT: --- b.carbon // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref = import_ref Main//a, inst+1, unloaded +// CHECK:STDOUT: %import_ref = import_ref Main//a, C, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -154,10 +154,10 @@ var x: () = D.C.F(); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Main//a, inst+1, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2: = import_ref Main//a, inst+8, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.3 = import_ref Main//a, inst+2, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Main//a, inst+3, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Main//a, C, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2: = import_ref Main//a, loc6_1, loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.3 = import_ref Main//a, inst14 [no loc], unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Main//a, loc5_10, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -178,7 +178,7 @@ var x: () = D.C.F(); // CHECK:STDOUT: --- d.carbon // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref = import_ref Main//c, inst+10, unloaded +// CHECK:STDOUT: %import_ref = import_ref Main//c, C, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -198,10 +198,10 @@ var x: () = D.C.F(); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Main//c, inst+10, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2: = import_ref Main//c, inst+7, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.3 = import_ref Main//c, inst+8, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Main//c, inst+9, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Main//c, C, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2: = import_ref Main//c, inst19 [indirect], loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.3 = import_ref Main//c, inst20 [indirect], unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Main//c, inst21 [indirect], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -235,7 +235,7 @@ var x: () = D.C.F(); // CHECK:STDOUT: --- f.carbon // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref = import_ref Main//e, inst+3, unloaded +// CHECK:STDOUT: %import_ref = import_ref Main//e, D, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -257,10 +257,10 @@ var x: () = D.C.F(); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Main//a, inst+1, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2: = import_ref Main//a, inst+8, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.3 = import_ref Main//a, inst+2, unloaded -// CHECK:STDOUT: %import_ref.4: %F.type = import_ref Main//a, inst+3, loaded [template = constants.%F] +// CHECK:STDOUT: %import_ref.1: type = import_ref Main//a, C, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2: = import_ref Main//a, loc6_1, loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.3 = import_ref Main//a, inst14 [no loc], unloaded +// CHECK:STDOUT: %import_ref.4: %F.type = import_ref Main//a, loc5_10, loaded [template = constants.%F] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -305,10 +305,10 @@ var x: () = D.C.F(); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Main//c, inst+10, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2: = import_ref Main//c, inst+7, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.3 = import_ref Main//c, inst+8, unloaded -// CHECK:STDOUT: %import_ref.4: %F.type = import_ref Main//c, inst+9, loaded [template = constants.%F] +// CHECK:STDOUT: %import_ref.1: type = import_ref Main//c, C, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2: = import_ref Main//c, inst19 [indirect], loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.3 = import_ref Main//c, inst20 [indirect], unloaded +// CHECK:STDOUT: %import_ref.4: %F.type = import_ref Main//c, inst21 [indirect], loaded [template = constants.%F] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -353,10 +353,10 @@ var x: () = D.C.F(); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Main//c, inst+10, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2: = import_ref Main//c, inst+7, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.3 = import_ref Main//c, inst+8, unloaded -// CHECK:STDOUT: %import_ref.4: %F.type = import_ref Main//c, inst+9, loaded [template = constants.%F] +// CHECK:STDOUT: %import_ref.1: type = import_ref Main//c, C, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2: = import_ref Main//c, inst19 [indirect], loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.3 = import_ref Main//c, inst20 [indirect], unloaded +// CHECK:STDOUT: %import_ref.4: %F.type = import_ref Main//c, inst21 [indirect], loaded [template = constants.%F] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -402,13 +402,13 @@ var x: () = D.C.F(); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Main//e, inst+3, loaded [template = constants.%D] -// CHECK:STDOUT: %import_ref.2: = import_ref Main//e, inst+15, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.3 = import_ref Main//e, inst+4, unloaded -// CHECK:STDOUT: %import_ref.4: type = import_ref Main//e, inst+14, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.5: = import_ref Main//e, inst+10, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.6 = import_ref Main//e, inst+11, unloaded -// CHECK:STDOUT: %import_ref.7: %F.type = import_ref Main//e, inst+12, loaded [template = constants.%F] +// CHECK:STDOUT: %import_ref.1: type = import_ref Main//e, D, loaded [template = constants.%D] +// CHECK:STDOUT: %import_ref.2: = import_ref Main//e, loc8_1, loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.3 = import_ref Main//e, inst16 [no loc], unloaded +// CHECK:STDOUT: %import_ref.4: type = import_ref Main//e, loc7_9, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.5: = import_ref Main//e, inst22 [indirect], loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.6 = import_ref Main//e, inst23 [indirect], unloaded +// CHECK:STDOUT: %import_ref.7: %F.type = import_ref Main//e, inst24 [indirect], loaded [template = constants.%F] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -462,13 +462,13 @@ var x: () = D.C.F(); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Main//e, inst+3, loaded [template = constants.%D] -// CHECK:STDOUT: %import_ref.2: = import_ref Main//e, inst+15, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.3 = import_ref Main//e, inst+4, unloaded -// CHECK:STDOUT: %import_ref.4: type = import_ref Main//e, inst+14, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.5: = import_ref Main//e, inst+10, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.6 = import_ref Main//e, inst+11, unloaded -// CHECK:STDOUT: %import_ref.7: %F.type = import_ref Main//e, inst+12, loaded [template = constants.%F] +// CHECK:STDOUT: %import_ref.1: type = import_ref Main//e, D, loaded [template = constants.%D] +// CHECK:STDOUT: %import_ref.2: = import_ref Main//e, loc8_1, loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.3 = import_ref Main//e, inst16 [no loc], unloaded +// CHECK:STDOUT: %import_ref.4: type = import_ref Main//e, loc7_9, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.5: = import_ref Main//e, inst22 [indirect], loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.6 = import_ref Main//e, inst23 [indirect], unloaded +// CHECK:STDOUT: %import_ref.7: %F.type = import_ref Main//e, inst24 [indirect], loaded [template = constants.%F] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/class/no_prelude/no_definition_in_impl_file.carbon b/toolchain/check/testdata/class/no_prelude/no_definition_in_impl_file.carbon index 1066e952d6003..d82e6d3eb64a8 100644 --- a/toolchain/check/testdata/class/no_prelude/no_definition_in_impl_file.carbon +++ b/toolchain/check/testdata/class/no_prelude/no_definition_in_impl_file.carbon @@ -124,7 +124,7 @@ class D; // CHECK:STDOUT: --- use_decl_in_api.impl.carbon // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref = import_ref Main//decl_in_api_definition_in_impl, inst+1, unloaded +// CHECK:STDOUT: %import_ref = import_ref Main//decl_in_api_definition_in_impl, A, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -153,7 +153,7 @@ class D; // CHECK:STDOUT: --- decl_only_in_api.impl.carbon // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref = import_ref Main//decl_only_in_api, inst+1, unloaded +// CHECK:STDOUT: %import_ref = import_ref Main//decl_only_in_api, B, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/class/no_prelude/syntactic_merge.carbon b/toolchain/check/testdata/class/no_prelude/syntactic_merge.carbon index 65a7d21ec5858..84aa7a56cc2cd 100644 --- a/toolchain/check/testdata/class/no_prelude/syntactic_merge.carbon +++ b/toolchain/check/testdata/class/no_prelude/syntactic_merge.carbon @@ -587,10 +587,10 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Main//two_file, inst+1, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2: type = import_ref Main//two_file, inst+7, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.5: = import_ref Main//two_file, inst+4, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.6 = import_ref Main//two_file, inst+2, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Main//two_file, C, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2: type = import_ref Main//two_file, D, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.5: = import_ref Main//two_file, loc4_10, loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.6 = import_ref Main//two_file, inst14 [no loc], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -976,9 +976,9 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Main//alias_two_file, inst+1, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.3: = import_ref Main//alias_two_file, inst+4, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.4 = import_ref Main//alias_two_file, inst+2, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Main//alias_two_file, C, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.3: = import_ref Main//alias_two_file, loc4_10, loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.4 = import_ref Main//alias_two_file, inst14 [no loc], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/class/virtual_modifiers.carbon b/toolchain/check/testdata/class/virtual_modifiers.carbon index a14381718ffab..09a12635346ac 100644 --- a/toolchain/check/testdata/class/virtual_modifiers.carbon +++ b/toolchain/check/testdata/class/virtual_modifiers.carbon @@ -204,10 +204,10 @@ class Derived { // CHECK:STDOUT: .Base = %import_ref.1 // CHECK:STDOUT: import Modifiers//default // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref Modifiers//default, inst+3, loaded [template = constants.%Base] -// CHECK:STDOUT: %import_ref.2: = import_ref Modifiers//default, inst+11, loaded [template = constants.%complete_type.1] -// CHECK:STDOUT: %import_ref.3 = import_ref Modifiers//default, inst+4, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Modifiers//default, inst+5, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Modifiers//default, Base, loaded [template = constants.%Base] +// CHECK:STDOUT: %import_ref.2: = import_ref Modifiers//default, loc6_1, loaded [template = constants.%complete_type.1] +// CHECK:STDOUT: %import_ref.3 = import_ref Modifiers//default, inst16 [no loc], unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Modifiers//default, loc5_17, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -266,10 +266,10 @@ class Derived { // CHECK:STDOUT: .Base = %import_ref.1 // CHECK:STDOUT: import Modifiers//default // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref Modifiers//default, inst+3, loaded [template = constants.%Base] -// CHECK:STDOUT: %import_ref.2: = import_ref Modifiers//default, inst+11, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.3 = import_ref Modifiers//default, inst+4, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Modifiers//default, inst+5, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Modifiers//default, Base, loaded [template = constants.%Base] +// CHECK:STDOUT: %import_ref.2: = import_ref Modifiers//default, loc6_1, loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.3 = import_ref Modifiers//default, inst16 [no loc], unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Modifiers//default, loc5_17, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/const/import.carbon b/toolchain/check/testdata/const/import.carbon index 8a9312f49965c..07a9930fc1cc6 100644 --- a/toolchain/check/testdata/const/import.carbon +++ b/toolchain/check/testdata/const/import.carbon @@ -109,9 +109,9 @@ var a_ptr: const i32* = a_ptr_ref; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1 = import_ref Implicit//default, inst+24, unloaded -// CHECK:STDOUT: %import_ref.2: ref %const = import_ref Implicit//default, inst+33, loaded -// CHECK:STDOUT: %import_ref.3: ref %ptr = import_ref Implicit//default, inst+45, loaded +// CHECK:STDOUT: %import_ref.1 = import_ref Implicit//default, F, unloaded +// CHECK:STDOUT: %import_ref.2: ref %const = import_ref Implicit//default, a_ref, loaded +// CHECK:STDOUT: %import_ref.3: ref %ptr = import_ref Implicit//default, a_ptr_ref, loaded // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.4 // CHECK:STDOUT: import Core//prelude diff --git a/toolchain/check/testdata/deduce/int_float.carbon b/toolchain/check/testdata/deduce/int_float.carbon index c70195a55fde5..68b8d10f7ab05 100644 --- a/toolchain/check/testdata/deduce/int_float.carbon +++ b/toolchain/check/testdata/deduce/int_float.carbon @@ -62,8 +62,8 @@ fn G(a: f64) -> Core.IntLiteral() { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: %IntLiteral.type = import_ref Core//prelude/types, inst+7, loaded [template = constants.%IntLiteral] -// CHECK:STDOUT: %import_ref.2: %Int.type = import_ref Core//prelude/types, inst+23, loaded [template = constants.%Int] +// CHECK:STDOUT: %import_ref.1: %IntLiteral.type = import_ref Core//prelude/types, IntLiteral, loaded [template = constants.%IntLiteral] +// CHECK:STDOUT: %import_ref.2: %Int.type = import_ref Core//prelude/types, Int, loaded [template = constants.%Int] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -188,8 +188,8 @@ fn G(a: f64) -> Core.IntLiteral() { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: %IntLiteral.type = import_ref Core//prelude/types, inst+7, loaded [template = constants.%IntLiteral] -// CHECK:STDOUT: %import_ref.2: %Float.type = import_ref Core//prelude/types, inst+53, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.1: %IntLiteral.type = import_ref Core//prelude/types, IntLiteral, loaded [template = constants.%IntLiteral] +// CHECK:STDOUT: %import_ref.2: %Float.type = import_ref Core//prelude/types, Float, loaded [template = constants.%Float] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/function/builtin/no_prelude/call_from_operator.carbon b/toolchain/check/testdata/function/builtin/no_prelude/call_from_operator.carbon index a9472500c4a8b..930f2a6bc9d00 100644 --- a/toolchain/check/testdata/function/builtin/no_prelude/call_from_operator.carbon +++ b/toolchain/check/testdata/function/builtin/no_prelude/call_from_operator.carbon @@ -659,29 +659,29 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: .ImplicitAs = %import_ref.31 // CHECK:STDOUT: import Core//default // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.3 = import_ref Core//default, inst+70, unloaded -// CHECK:STDOUT: %import_ref.4: @As.%Convert.assoc_type (%Convert.assoc_type.1) = import_ref Core//default, inst+94, loaded [symbolic = @As.%assoc0 (constants.%assoc0.3)] -// CHECK:STDOUT: %import_ref.5 = import_ref Core//default, inst+86, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Core//default, inst+86, unloaded -// CHECK:STDOUT: %import_ref.8 = import_ref Core//default, inst+26, unloaded -// CHECK:STDOUT: %import_ref.9: %Op.assoc_type = import_ref Core//default, inst+56, loaded [template = constants.%assoc0.7] -// CHECK:STDOUT: %import_ref.10 = import_ref Core//default, inst+50, unloaded -// CHECK:STDOUT: %import_ref.11: type = import_ref Core//default, inst+149, loaded [template = constants.%i32] -// CHECK:STDOUT: %import_ref.12: type = import_ref Core//default, inst+150, loaded [template = constants.%Add.type] -// CHECK:STDOUT: %import_ref.13: = import_ref Core//default, inst+171, loaded [template = constants.%interface.2] -// CHECK:STDOUT: %import_ref.14: type = import_ref Core//default, inst+176, loaded [template = Core.IntLiteral] -// CHECK:STDOUT: %import_ref.15: type = import_ref Core//default, inst+182, loaded [template = constants.%As.type.3] -// CHECK:STDOUT: %import_ref.16: = import_ref Core//default, inst+206, loaded [template = constants.%interface.1] -// CHECK:STDOUT: %import_ref.17 = import_ref Core//default, inst+112, unloaded -// CHECK:STDOUT: %import_ref.18: @ImplicitAs.%Convert.assoc_type (%Convert.assoc_type.3) = import_ref Core//default, inst+136, loaded [symbolic = @ImplicitAs.%assoc0 (constants.%assoc0.8)] -// CHECK:STDOUT: %import_ref.19 = import_ref Core//default, inst+128, unloaded -// CHECK:STDOUT: %import_ref.20: type = import_ref Core//default, inst+211, loaded [template = Core.IntLiteral] -// CHECK:STDOUT: %import_ref.21: type = import_ref Core//default, inst+217, loaded [template = constants.%ImplicitAs.type.3] -// CHECK:STDOUT: %import_ref.22: = import_ref Core//default, inst+241, loaded [template = constants.%interface.4] -// CHECK:STDOUT: %import_ref.23 = import_ref Core//default, inst+128, unloaded -// CHECK:STDOUT: %import_ref.25: type = import_ref Core//default, inst+246, loaded [template = constants.%i32] -// CHECK:STDOUT: %import_ref.26: type = import_ref Core//default, inst+252, loaded [template = constants.%ImplicitAs.type.4] -// CHECK:STDOUT: %import_ref.27: = import_ref Core//default, inst+276, loaded [template = constants.%interface.3] +// CHECK:STDOUT: %import_ref.3 = import_ref Core//default, inst82 [no loc], unloaded +// CHECK:STDOUT: %import_ref.4: @As.%Convert.assoc_type (%Convert.assoc_type.1) = import_ref Core//default, loc12_32, loaded [symbolic = @As.%assoc0 (constants.%assoc0.3)] +// CHECK:STDOUT: %import_ref.5 = import_ref Core//default, Convert, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Core//default, loc12_32, unloaded +// CHECK:STDOUT: %import_ref.8 = import_ref Core//default, inst38 [no loc], unloaded +// CHECK:STDOUT: %import_ref.9: %Op.assoc_type = import_ref Core//default, loc8_41, loaded [template = constants.%assoc0.7] +// CHECK:STDOUT: %import_ref.10 = import_ref Core//default, Op, unloaded +// CHECK:STDOUT: %import_ref.11: type = import_ref Core//default, loc19_6, loaded [template = constants.%i32] +// CHECK:STDOUT: %import_ref.12: type = import_ref Core//default, loc19_13, loaded [template = constants.%Add.type] +// CHECK:STDOUT: %import_ref.13: = import_ref Core//default, loc19_17, loaded [template = constants.%interface.2] +// CHECK:STDOUT: %import_ref.14: type = import_ref Core//default, loc23_17, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.15: type = import_ref Core//default, loc23_28, loaded [template = constants.%As.type.3] +// CHECK:STDOUT: %import_ref.16: = import_ref Core//default, loc23_30, loaded [template = constants.%interface.1] +// CHECK:STDOUT: %import_ref.17 = import_ref Core//default, inst124 [no loc], unloaded +// CHECK:STDOUT: %import_ref.18: @ImplicitAs.%Convert.assoc_type (%Convert.assoc_type.3) = import_ref Core//default, loc16_32, loaded [symbolic = @ImplicitAs.%assoc0 (constants.%assoc0.8)] +// CHECK:STDOUT: %import_ref.19 = import_ref Core//default, Convert, unloaded +// CHECK:STDOUT: %import_ref.20: type = import_ref Core//default, loc27_17, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.21: type = import_ref Core//default, loc27_36, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.22: = import_ref Core//default, loc27_38, loaded [template = constants.%interface.4] +// CHECK:STDOUT: %import_ref.23 = import_ref Core//default, loc16_32, unloaded +// CHECK:STDOUT: %import_ref.25: type = import_ref Core//default, loc31_6, loaded [template = constants.%i32] +// CHECK:STDOUT: %import_ref.26: type = import_ref Core//default, loc31_36, loaded [template = constants.%ImplicitAs.type.4] +// CHECK:STDOUT: %import_ref.27: = import_ref Core//default, loc31_38, loaded [template = constants.%interface.3] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/function/builtin/no_prelude/import.carbon b/toolchain/check/testdata/function/builtin/no_prelude/import.carbon index c0648f113e71b..b074158331ddb 100644 --- a/toolchain/check/testdata/function/builtin/no_prelude/import.carbon +++ b/toolchain/check/testdata/function/builtin/no_prelude/import.carbon @@ -184,9 +184,9 @@ var arr: [i32; Core.AsIntLiteral(Core.TestAdd(Core.AsI32(1), Core.AsI32(2)))] = // CHECK:STDOUT: .AsI32 = %import_ref.4 // CHECK:STDOUT: import Core//core // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.2: %AsIntLiteral.type = import_ref Core//core, inst+61, loaded [template = constants.%AsIntLiteral] -// CHECK:STDOUT: %import_ref.3: %TestAdd.type = import_ref Core//core, inst+88, loaded [template = constants.%TestAdd] -// CHECK:STDOUT: %import_ref.4: %AsI32.type = import_ref Core//core, inst+42, loaded [template = constants.%AsI32] +// CHECK:STDOUT: %import_ref.2: %AsIntLiteral.type = import_ref Core//core, AsIntLiteral, loaded [template = constants.%AsIntLiteral] +// CHECK:STDOUT: %import_ref.3: %TestAdd.type = import_ref Core//core, TestAdd, loaded [template = constants.%TestAdd] +// CHECK:STDOUT: %import_ref.4: %AsI32.type = import_ref Core//core, AsI32, loaded [template = constants.%AsI32] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/function/declaration/import.carbon b/toolchain/check/testdata/function/declaration/import.carbon index b0aa9bf78b0c6..2f39bd04b4b72 100644 --- a/toolchain/check/testdata/function/declaration/import.carbon +++ b/toolchain/check/testdata/function/declaration/import.carbon @@ -486,15 +486,15 @@ import library "extern_api"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %A.type = import_ref Main//api, inst+3, loaded [template = constants.%A] -// CHECK:STDOUT: %import_ref.2: %B.type = import_ref Main//api, inst+33, loaded [template = constants.%B] -// CHECK:STDOUT: %import_ref.3: %C.type = import_ref Main//api, inst+58, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.4: %D.type = import_ref Main//api, inst+61, loaded [template = constants.%D] -// CHECK:STDOUT: %import_ref.5: = import_ref Main//api, inst+64, loaded +// CHECK:STDOUT: %import_ref.1: %A.type = import_ref Main//api, A, loaded [template = constants.%A] +// CHECK:STDOUT: %import_ref.2: %B.type = import_ref Main//api, B, loaded [template = constants.%B] +// CHECK:STDOUT: %import_ref.3: %C.type = import_ref Main//api, C, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.4: %D.type = import_ref Main//api, D, loaded [template = constants.%D] +// CHECK:STDOUT: %import_ref.5: = import_ref Main//api, NS, loaded // CHECK:STDOUT: %NS: = namespace %import_ref.5, [template] { // CHECK:STDOUT: .E = %import_ref.6 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.6: %E.type = import_ref Main//api, inst+65, loaded [template = constants.%E] +// CHECK:STDOUT: %import_ref.6: %E.type = import_ref Main//api, E, loaded [template = constants.%E] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.7 // CHECK:STDOUT: .ImplicitAs = %import_ref.8 @@ -628,7 +628,7 @@ import library "extern_api"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.5: = import_ref Main//api, inst+64, loaded +// CHECK:STDOUT: %import_ref.5: = import_ref Main//api, NS, loaded // CHECK:STDOUT: %NS: = namespace %import_ref.5, [template] { // CHECK:STDOUT: .E = file.%E.decl // CHECK:STDOUT: } @@ -799,7 +799,7 @@ import library "extern_api"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.5: = import_ref Main//extern_api, inst+64, loaded +// CHECK:STDOUT: %import_ref.5: = import_ref Main//extern_api, NS, loaded // CHECK:STDOUT: %NS: = namespace %import_ref.5, [template] { // CHECK:STDOUT: .E = file.%E.decl // CHECK:STDOUT: } @@ -969,15 +969,15 @@ import library "extern_api"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %A.type = import_ref Main//api, inst+3, loaded [template = constants.%A] -// CHECK:STDOUT: %import_ref.2: %B.type = import_ref Main//api, inst+33, loaded [template = constants.%B] -// CHECK:STDOUT: %import_ref.3: %C.type = import_ref Main//api, inst+58, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.4: %D.type = import_ref Main//api, inst+61, loaded [template = constants.%D] -// CHECK:STDOUT: %import_ref.5: = import_ref Main//api, inst+64, loaded +// CHECK:STDOUT: %import_ref.1: %A.type = import_ref Main//api, A, loaded [template = constants.%A] +// CHECK:STDOUT: %import_ref.2: %B.type = import_ref Main//api, B, loaded [template = constants.%B] +// CHECK:STDOUT: %import_ref.3: %C.type = import_ref Main//api, C, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.4: %D.type = import_ref Main//api, D, loaded [template = constants.%D] +// CHECK:STDOUT: %import_ref.5: = import_ref Main//api, NS, loaded // CHECK:STDOUT: %NS: = namespace %import_ref.5, [template] { // CHECK:STDOUT: .E = %import_ref.6 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.6: %E.type = import_ref Main//api, inst+65, loaded [template = constants.%E] +// CHECK:STDOUT: %import_ref.6: %E.type = import_ref Main//api, E, loaded [template = constants.%E] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.12 // CHECK:STDOUT: .ImplicitAs = %import_ref.13 @@ -1110,15 +1110,15 @@ import library "extern_api"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %A.type = import_ref Main//extern_api, inst+3, loaded [template = constants.%A] -// CHECK:STDOUT: %import_ref.2: %B.type = import_ref Main//extern_api, inst+33, loaded [template = constants.%B] -// CHECK:STDOUT: %import_ref.3: %C.type = import_ref Main//extern_api, inst+58, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.4: %D.type = import_ref Main//extern_api, inst+61, loaded [template = constants.%D] -// CHECK:STDOUT: %import_ref.5: = import_ref Main//extern_api, inst+64, loaded +// CHECK:STDOUT: %import_ref.1: %A.type = import_ref Main//extern_api, A, loaded [template = constants.%A] +// CHECK:STDOUT: %import_ref.2: %B.type = import_ref Main//extern_api, B, loaded [template = constants.%B] +// CHECK:STDOUT: %import_ref.3: %C.type = import_ref Main//extern_api, C, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.4: %D.type = import_ref Main//extern_api, D, loaded [template = constants.%D] +// CHECK:STDOUT: %import_ref.5: = import_ref Main//extern_api, NS, loaded // CHECK:STDOUT: %NS: = namespace %import_ref.5, [template] { // CHECK:STDOUT: .E = %import_ref.6 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.6: %E.type = import_ref Main//extern_api, inst+65, loaded [template = constants.%E] +// CHECK:STDOUT: %import_ref.6: %E.type = import_ref Main//extern_api, E, loaded [template = constants.%E] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.12 // CHECK:STDOUT: .ImplicitAs = %import_ref.13 @@ -1221,11 +1221,11 @@ import library "extern_api"; // CHECK:STDOUT: --- unloaded.carbon // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1 = import_ref Main//api, inst+3, unloaded -// CHECK:STDOUT: %import_ref.2 = import_ref Main//api, inst+33, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref Main//api, inst+58, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Main//api, inst+61, unloaded -// CHECK:STDOUT: %import_ref.5: = import_ref Main//api, inst+64, loaded +// CHECK:STDOUT: %import_ref.1 = import_ref Main//api, A, unloaded +// CHECK:STDOUT: %import_ref.2 = import_ref Main//api, B, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref Main//api, C, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Main//api, D, unloaded +// CHECK:STDOUT: %import_ref.5: = import_ref Main//api, NS, loaded // CHECK:STDOUT: %NS: = namespace %import_ref.5, [template] { // CHECK:STDOUT: .E = %import_ref.6 // CHECK:STDOUT: } @@ -1251,11 +1251,11 @@ import library "extern_api"; // CHECK:STDOUT: --- unloaded_extern.carbon // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1 = import_ref Main//extern_api, inst+3, unloaded -// CHECK:STDOUT: %import_ref.2 = import_ref Main//extern_api, inst+33, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref Main//extern_api, inst+58, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Main//extern_api, inst+61, unloaded -// CHECK:STDOUT: %import_ref.5: = import_ref Main//extern_api, inst+64, loaded +// CHECK:STDOUT: %import_ref.1 = import_ref Main//extern_api, A, unloaded +// CHECK:STDOUT: %import_ref.2 = import_ref Main//extern_api, B, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref Main//extern_api, C, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Main//extern_api, D, unloaded +// CHECK:STDOUT: %import_ref.5: = import_ref Main//extern_api, NS, loaded // CHECK:STDOUT: %NS: = namespace %import_ref.5, [template] { // CHECK:STDOUT: .E = %import_ref.6 // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/function/declaration/no_prelude/export_name.carbon b/toolchain/check/testdata/function/declaration/no_prelude/export_name.carbon index 06bb7ff13d783..80164df05ad5c 100644 --- a/toolchain/check/testdata/function/declaration/no_prelude/export_name.carbon +++ b/toolchain/check/testdata/function/declaration/no_prelude/export_name.carbon @@ -62,7 +62,7 @@ var f: () = F(); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref: %F.type = import_ref Main//base, inst+1, loaded [template = constants.%F] +// CHECK:STDOUT: %import_ref: %F.type = import_ref Main//base, F, loaded [template = constants.%F] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -84,7 +84,7 @@ var f: () = F(); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref: %F.type = import_ref Main//export, inst+7, loaded [template = constants.%F] +// CHECK:STDOUT: %import_ref: %F.type = import_ref Main//export, F, loaded [template = constants.%F] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/function/declaration/no_prelude/extern.carbon b/toolchain/check/testdata/function/declaration/no_prelude/extern.carbon index c154f1a2ad31b..cfe90921d5f4d 100644 --- a/toolchain/check/testdata/function/declaration/no_prelude/extern.carbon +++ b/toolchain/check/testdata/function/declaration/no_prelude/extern.carbon @@ -105,7 +105,7 @@ extern library "basic" fn F(); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref: %F.type = import_ref Main//basic, inst+1, loaded [template = constants.%F] +// CHECK:STDOUT: %import_ref: %F.type = import_ref Main//basic, F, loaded [template = constants.%F] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/function/declaration/no_prelude/extern_library.carbon b/toolchain/check/testdata/function/declaration/no_prelude/extern_library.carbon index f094d2a83fb8d..e6f40a066995c 100644 --- a/toolchain/check/testdata/function/declaration/no_prelude/extern_library.carbon +++ b/toolchain/check/testdata/function/declaration/no_prelude/extern_library.carbon @@ -266,7 +266,7 @@ extern library "extern_library_owner" fn F() {} // CHECK:STDOUT: --- fail_extern_library_collision.carbon // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1 = import_ref Main//extern_library, inst+1, unloaded +// CHECK:STDOUT: %import_ref.1 = import_ref Main//extern_library, F, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/function/declaration/no_prelude/fail_import_incomplete_return.carbon b/toolchain/check/testdata/function/declaration/no_prelude/fail_import_incomplete_return.carbon index b06b812ef06cb..99f0021778a34 100644 --- a/toolchain/check/testdata/function/declaration/no_prelude/fail_import_incomplete_return.carbon +++ b/toolchain/check/testdata/function/declaration/no_prelude/fail_import_incomplete_return.carbon @@ -197,15 +197,15 @@ fn CallFAndGIncomplete() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1 = import_ref Main//incomplete_return, inst+1, unloaded -// CHECK:STDOUT: %import_ref.2 = import_ref Main//incomplete_return, inst+3, unloaded -// CHECK:STDOUT: %import_ref.3: %ReturnCUnused.type = import_ref Main//incomplete_return, inst+10, loaded [template = constants.%ReturnCUnused] -// CHECK:STDOUT: %import_ref.4: %ReturnCUsed.type = import_ref Main//incomplete_return, inst+19, loaded [template = constants.%ReturnCUsed] -// CHECK:STDOUT: %import_ref.5: %ReturnDUnused.type = import_ref Main//incomplete_return, inst+27, loaded [template = constants.%ReturnDUnused] -// CHECK:STDOUT: %import_ref.6: %ReturnDUsed.type = import_ref Main//incomplete_return, inst+35, loaded [template = constants.%ReturnDUsed] -// CHECK:STDOUT: %import_ref.7 = import_ref Main//incomplete_return, inst+38, unloaded -// CHECK:STDOUT: %import_ref.8: = import_ref Main//incomplete_return, inst+48, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.9 = import_ref Main//incomplete_return, inst+4, unloaded +// CHECK:STDOUT: %import_ref.1 = import_ref Main//incomplete_return, C, unloaded +// CHECK:STDOUT: %import_ref.2 = import_ref Main//incomplete_return, D, unloaded +// CHECK:STDOUT: %import_ref.3: %ReturnCUnused.type = import_ref Main//incomplete_return, ReturnCUnused, loaded [template = constants.%ReturnCUnused] +// CHECK:STDOUT: %import_ref.4: %ReturnCUsed.type = import_ref Main//incomplete_return, ReturnCUsed, loaded [template = constants.%ReturnCUsed] +// CHECK:STDOUT: %import_ref.5: %ReturnDUnused.type = import_ref Main//incomplete_return, ReturnDUnused, loaded [template = constants.%ReturnDUnused] +// CHECK:STDOUT: %import_ref.6: %ReturnDUsed.type = import_ref Main//incomplete_return, ReturnDUsed, loaded [template = constants.%ReturnDUsed] +// CHECK:STDOUT: %import_ref.7 = import_ref Main//incomplete_return, Call, unloaded +// CHECK:STDOUT: %import_ref.8: = import_ref Main//incomplete_return, loc37_10, loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.9 = import_ref Main//incomplete_return, inst16 [no loc], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/function/declaration/no_prelude/no_definition_in_impl_file.carbon b/toolchain/check/testdata/function/declaration/no_prelude/no_definition_in_impl_file.carbon index 3564ac165a585..8cab2a30cf875 100644 --- a/toolchain/check/testdata/function/declaration/no_prelude/no_definition_in_impl_file.carbon +++ b/toolchain/check/testdata/function/declaration/no_prelude/no_definition_in_impl_file.carbon @@ -121,7 +121,7 @@ fn D(); // CHECK:STDOUT: --- use_decl_in_api.impl.carbon // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref = import_ref Main//decl_in_api_definition_in_impl, inst+1, unloaded +// CHECK:STDOUT: %import_ref = import_ref Main//decl_in_api_definition_in_impl, A, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -151,7 +151,7 @@ fn D(); // CHECK:STDOUT: --- decl_only_in_api.impl.carbon // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref = import_ref Main//decl_only_in_api, inst+1, unloaded +// CHECK:STDOUT: %import_ref = import_ref Main//decl_only_in_api, B, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/function/definition/import.carbon b/toolchain/check/testdata/function/definition/import.carbon index 135482e411d37..3476692458617 100644 --- a/toolchain/check/testdata/function/definition/import.carbon +++ b/toolchain/check/testdata/function/definition/import.carbon @@ -270,10 +270,10 @@ fn D() {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %A.type = import_ref Main//fns, inst+3, loaded [template = constants.%A] -// CHECK:STDOUT: %import_ref.2: %B.type = import_ref Main//fns, inst+34, loaded [template = constants.%B] -// CHECK:STDOUT: %import_ref.3: %C.type = import_ref Main//fns, inst+61, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.4 = import_ref Main//fns, inst+72, unloaded +// CHECK:STDOUT: %import_ref.1: %A.type = import_ref Main//fns, A, loaded [template = constants.%A] +// CHECK:STDOUT: %import_ref.2: %B.type = import_ref Main//fns, B, loaded [template = constants.%B] +// CHECK:STDOUT: %import_ref.3: %C.type = import_ref Main//fns, C, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.4 = import_ref Main//fns, D, unloaded // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.5 // CHECK:STDOUT: .ImplicitAs = %import_ref.6 @@ -365,8 +365,8 @@ fn D() {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.3 = import_ref Main//fns, inst+61, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Main//fns, inst+72, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref Main//fns, C, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Main//fns, D, unloaded // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.5 // CHECK:STDOUT: import Core//prelude @@ -446,9 +446,9 @@ fn D() {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1 = import_ref Main//fns, inst+3, unloaded -// CHECK:STDOUT: %import_ref.2 = import_ref Main//fns, inst+34, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref Main//fns, inst+61, unloaded +// CHECK:STDOUT: %import_ref.1 = import_ref Main//fns, A, unloaded +// CHECK:STDOUT: %import_ref.2 = import_ref Main//fns, B, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref Main//fns, C, unloaded // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... diff --git a/toolchain/check/testdata/function/definition/import_access.carbon b/toolchain/check/testdata/function/definition/import_access.carbon index 1a2c5537b073f..973cecf0d54b0 100644 --- a/toolchain/check/testdata/function/definition/import_access.carbon +++ b/toolchain/check/testdata/function/definition/import_access.carbon @@ -226,7 +226,7 @@ private fn Redecl() {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref: %Def.type = import_ref Test//def, inst+3, loaded [template = constants.%Def] +// CHECK:STDOUT: %import_ref: %Def.type = import_ref Test//def, Def, loaded [template = constants.%Def] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -338,7 +338,7 @@ private fn Redecl() {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref: %ForwardWithDef.type = import_ref Test//forward_with_def, inst+3, loaded [template = constants.%ForwardWithDef] +// CHECK:STDOUT: %import_ref: %ForwardWithDef.type = import_ref Test//forward_with_def, ForwardWithDef, loaded [template = constants.%ForwardWithDef] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -450,7 +450,7 @@ private fn Redecl() {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref: %Forward.type = import_ref Test//forward, inst+3, loaded [template = constants.%Forward] +// CHECK:STDOUT: %import_ref: %Forward.type = import_ref Test//forward, Forward, loaded [template = constants.%Forward] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... diff --git a/toolchain/check/testdata/function/definition/no_prelude/extern_library.carbon b/toolchain/check/testdata/function/definition/no_prelude/extern_library.carbon index 384d99b203fc2..80521c05fcfdf 100644 --- a/toolchain/check/testdata/function/definition/no_prelude/extern_library.carbon +++ b/toolchain/check/testdata/function/definition/no_prelude/extern_library.carbon @@ -273,7 +273,7 @@ extern fn F() {} // CHECK:STDOUT: --- indirect_two_file.carbon // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref = import_ref Main//indirect_two_file_extern, inst+1, unloaded +// CHECK:STDOUT: %import_ref = import_ref Main//indirect_two_file_extern, F, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/function/definition/no_prelude/implicit_import.carbon b/toolchain/check/testdata/function/definition/no_prelude/implicit_import.carbon index 32d20c04b2cfa..89b9fb3f55b21 100644 --- a/toolchain/check/testdata/function/definition/no_prelude/implicit_import.carbon +++ b/toolchain/check/testdata/function/definition/no_prelude/implicit_import.carbon @@ -352,8 +352,8 @@ fn B() {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1 = import_ref Main//def_alias, inst+1, unloaded -// CHECK:STDOUT: %import_ref.2: %A.type = import_ref Main//def_alias, inst+6, loaded [template = constants.%A] +// CHECK:STDOUT: %import_ref.1 = import_ref Main//def_alias, A, unloaded +// CHECK:STDOUT: %import_ref.2: %A.type = import_ref Main//def_alias, B, loaded [template = constants.%A] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/function/definition/no_prelude/syntactic_merge.carbon b/toolchain/check/testdata/function/definition/no_prelude/syntactic_merge.carbon index 6ed172e0b38bd..03f753995e811 100644 --- a/toolchain/check/testdata/function/definition/no_prelude/syntactic_merge.carbon +++ b/toolchain/check/testdata/function/definition/no_prelude/syntactic_merge.carbon @@ -452,10 +452,10 @@ fn Foo(a: const (const C)) {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Main//two_file, inst+1, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2: type = import_ref Main//two_file, inst+7, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.5: = import_ref Main//two_file, inst+4, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.6 = import_ref Main//two_file, inst+2, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Main//two_file, C, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2: type = import_ref Main//two_file, D, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.5: = import_ref Main//two_file, loc4_10, loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.6 = import_ref Main//two_file, inst14 [no loc], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -788,9 +788,9 @@ fn Foo(a: const (const C)) {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Main//alias_two_file, inst+1, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.3: = import_ref Main//alias_two_file, inst+4, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.4 = import_ref Main//alias_two_file, inst+2, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Main//alias_two_file, C, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.3: = import_ref Main//alias_two_file, loc4_10, loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.4 = import_ref Main//alias_two_file, inst14 [no loc], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/function/generic/no_prelude/import_specific.carbon b/toolchain/check/testdata/function/generic/no_prelude/import_specific.carbon index c978745b6f02e..573359709b463 100644 --- a/toolchain/check/testdata/function/generic/no_prelude/import_specific.carbon +++ b/toolchain/check/testdata/function/generic/no_prelude/import_specific.carbon @@ -135,8 +135,8 @@ fn H() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %F.type = import_ref Main//library, inst+7, loaded [template = constants.%F] -// CHECK:STDOUT: %import_ref.2: %G.type = import_ref Main//library, inst+18, loaded [template = constants.%G] +// CHECK:STDOUT: %import_ref.1: %F.type = import_ref Main//library, F, loaded [template = constants.%F] +// CHECK:STDOUT: %import_ref.2: %G.type = import_ref Main//library, G, loaded [template = constants.%G] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/function/generic/resolve_used.carbon b/toolchain/check/testdata/function/generic/resolve_used.carbon index 914b6833e0b22..b2e58751184ed 100644 --- a/toolchain/check/testdata/function/generic/resolve_used.carbon +++ b/toolchain/check/testdata/function/generic/resolve_used.carbon @@ -53,8 +53,8 @@ fn CallNegative() { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: %IntLiteral.type = import_ref Core//prelude/types, inst+7, loaded [template = constants.%IntLiteral] -// CHECK:STDOUT: %import_ref.2: %Int.type = import_ref Core//prelude/types, inst+23, loaded [template = constants.%Int] +// CHECK:STDOUT: %import_ref.1: %IntLiteral.type = import_ref Core//prelude/types, IntLiteral, loaded [template = constants.%IntLiteral] +// CHECK:STDOUT: %import_ref.2: %Int.type = import_ref Core//prelude/types, Int, loaded [template = constants.%Int] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/if_expr/fail_not_in_function.carbon b/toolchain/check/testdata/if_expr/fail_not_in_function.carbon index 267ab3c94e93e..78e02a33a3b4f 100644 --- a/toolchain/check/testdata/if_expr/fail_not_in_function.carbon +++ b/toolchain/check/testdata/if_expr/fail_not_in_function.carbon @@ -61,7 +61,7 @@ class C { // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = imports.%Core -// CHECK:STDOUT: .x = .inst+18.loc23_5 +// CHECK:STDOUT: .x = .inst30.loc23_5 // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core @@ -78,8 +78,8 @@ class C { // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C -// CHECK:STDOUT: .n = .inst+357.loc37_8 -// CHECK:STDOUT: complete_type_witness = .inst+359.loc38_1 +// CHECK:STDOUT: .n = .inst369.loc37_8 +// CHECK:STDOUT: complete_type_witness = .inst371.loc38_1 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { diff --git a/toolchain/check/testdata/impl/fail_redefinition.carbon b/toolchain/check/testdata/impl/fail_redefinition.carbon index 6218f49f34407..31465dd4c68d2 100644 --- a/toolchain/check/testdata/impl/fail_redefinition.carbon +++ b/toolchain/check/testdata/impl/fail_redefinition.carbon @@ -72,6 +72,6 @@ impl i32 as I {} // CHECK:STDOUT: // CHECK:STDOUT: impl @impl: %.loc13_6.2 as %I.ref.loc13 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = .inst+24.loc13_15 +// CHECK:STDOUT: witness = .inst36.loc13_15 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/lookup/no_prelude/import.carbon b/toolchain/check/testdata/impl/lookup/no_prelude/import.carbon index a305583a8684c..04484d724bceb 100644 --- a/toolchain/check/testdata/impl/lookup/no_prelude/import.carbon +++ b/toolchain/check/testdata/impl/lookup/no_prelude/import.carbon @@ -299,13 +299,13 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: .HasF = %import_ref.4 // CHECK:STDOUT: import PackageA//default // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref PackageA//default, inst+12, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2: = import_ref PackageA//default, inst+15, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.3 = import_ref PackageA//default, inst+13, unloaded -// CHECK:STDOUT: %import_ref.4: type = import_ref PackageA//default, inst+1, loaded [template = constants.%HasF.type] -// CHECK:STDOUT: %import_ref.5 = import_ref PackageA//default, inst+3, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref PackageA//default, inst+10, unloaded -// CHECK:STDOUT: %import_ref.7: %F.type.2 = import_ref PackageA//default, inst+5, loaded [template = constants.%F.2] +// CHECK:STDOUT: %import_ref.1: type = import_ref PackageA//default, C, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2: = import_ref PackageA//default, loc8_10, loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.3 = import_ref PackageA//default, inst25 [no loc], unloaded +// CHECK:STDOUT: %import_ref.4: type = import_ref PackageA//default, HasF, loaded [template = constants.%HasF.type] +// CHECK:STDOUT: %import_ref.5 = import_ref PackageA//default, inst15 [no loc], unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref PackageA//default, loc5_9, unloaded +// CHECK:STDOUT: %import_ref.7: %F.type.2 = import_ref PackageA//default, F, loaded [template = constants.%F.2] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -452,16 +452,16 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: .HasF = %import_ref.4 // CHECK:STDOUT: import PackageA//default // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref PackageA//default, inst+12, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2: = import_ref PackageA//default, inst+15, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.3 = import_ref PackageA//default, inst+13, unloaded -// CHECK:STDOUT: %import_ref.4: type = import_ref PackageA//default, inst+1, loaded [template = constants.%HasF.type] -// CHECK:STDOUT: %import_ref.5 = import_ref PackageA//default, inst+3, unloaded -// CHECK:STDOUT: %import_ref.6: %F.assoc_type = import_ref PackageA//default, inst+10, loaded [template = constants.%assoc0] -// CHECK:STDOUT: %import_ref.7 = import_ref PackageA//default, inst+5, unloaded -// CHECK:STDOUT: %import_ref.9: type = import_ref PackageA//default, inst+17, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.10: type = import_ref PackageA//default, inst+18, loaded [template = constants.%HasF.type] -// CHECK:STDOUT: %import_ref.11: = import_ref PackageA//default, inst+24, loaded [template = constants.%interface] +// CHECK:STDOUT: %import_ref.1: type = import_ref PackageA//default, C, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2: = import_ref PackageA//default, loc8_10, loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.3 = import_ref PackageA//default, inst25 [no loc], unloaded +// CHECK:STDOUT: %import_ref.4: type = import_ref PackageA//default, HasF, loaded [template = constants.%HasF.type] +// CHECK:STDOUT: %import_ref.5 = import_ref PackageA//default, inst15 [no loc], unloaded +// CHECK:STDOUT: %import_ref.6: %F.assoc_type = import_ref PackageA//default, loc5_9, loaded [template = constants.%assoc0] +// CHECK:STDOUT: %import_ref.7 = import_ref PackageA//default, F, unloaded +// CHECK:STDOUT: %import_ref.9: type = import_ref PackageA//default, loc11_6, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.10: type = import_ref PackageA//default, loc11_11, loaded [template = constants.%HasF.type] +// CHECK:STDOUT: %import_ref.11: = import_ref PackageA//default, loc11_16, loaded [template = constants.%interface] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -549,30 +549,30 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: .D = %import_ref.1 // CHECK:STDOUT: import PackageB//default // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref PackageB//default, inst+14, loaded [template = constants.%D] -// CHECK:STDOUT: %import_ref.2: = import_ref PackageB//default, inst+17, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.3 = import_ref PackageB//default, inst+15, unloaded -// CHECK:STDOUT: %import_ref.4: type = import_ref PackageA//default, inst+1, loaded [template = constants.%HasF.type] -// CHECK:STDOUT: %import_ref.5 = import_ref PackageA//default, inst+3, unloaded -// CHECK:STDOUT: %import_ref.6: %F.assoc_type = import_ref PackageA//default, inst+10, loaded [template = constants.%assoc0] -// CHECK:STDOUT: %import_ref.7 = import_ref PackageA//default, inst+5, unloaded -// CHECK:STDOUT: %import_ref.9: = import_ref PackageA//default, inst+15, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.10 = import_ref PackageA//default, inst+13, unloaded -// CHECK:STDOUT: %import_ref.11: type = import_ref PackageA//default, inst+17, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.12: type = import_ref PackageA//default, inst+18, loaded [template = constants.%HasF.type] -// CHECK:STDOUT: %import_ref.13 = import_ref PackageA//default, inst+24, unloaded -// CHECK:STDOUT: %import_ref.14 = import_ref PackageB//default, inst+5, unloaded -// CHECK:STDOUT: %import_ref.15 = import_ref PackageB//default, inst+12, unloaded -// CHECK:STDOUT: %import_ref.16 = import_ref PackageB//default, inst+7, unloaded -// CHECK:STDOUT: %import_ref.17: type = import_ref PackageB//default, inst+25, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.18: type = import_ref PackageB//default, inst+26, loaded [template = constants.%HasG.type] -// CHECK:STDOUT: %import_ref.19 = import_ref PackageB//default, inst+32, unloaded -// CHECK:STDOUT: %import_ref.20: type = import_ref PackageB//default, inst+35, loaded [template = constants.%D] -// CHECK:STDOUT: %import_ref.21: type = import_ref PackageB//default, inst+44, loaded [template = constants.%HasF.type] -// CHECK:STDOUT: %import_ref.22: = import_ref PackageB//default, inst+53, loaded [template = constants.%interface] -// CHECK:STDOUT: %import_ref.23: type = import_ref PackageB//default, inst+56, loaded [template = constants.%D] -// CHECK:STDOUT: %import_ref.24: type = import_ref PackageB//default, inst+57, loaded [template = constants.%HasG.type] -// CHECK:STDOUT: %import_ref.25 = import_ref PackageB//default, inst+63, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref PackageB//default, D, loaded [template = constants.%D] +// CHECK:STDOUT: %import_ref.2: = import_ref PackageB//default, loc10_10, loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.3 = import_ref PackageB//default, inst27 [no loc], unloaded +// CHECK:STDOUT: %import_ref.4: type = import_ref PackageA//default, HasF, loaded [template = constants.%HasF.type] +// CHECK:STDOUT: %import_ref.5 = import_ref PackageA//default, inst15 [no loc], unloaded +// CHECK:STDOUT: %import_ref.6: %F.assoc_type = import_ref PackageA//default, loc5_9, loaded [template = constants.%assoc0] +// CHECK:STDOUT: %import_ref.7 = import_ref PackageA//default, F, unloaded +// CHECK:STDOUT: %import_ref.9: = import_ref PackageA//default, loc8_10, loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.10 = import_ref PackageA//default, inst25 [no loc], unloaded +// CHECK:STDOUT: %import_ref.11: type = import_ref PackageA//default, loc11_6, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.12: type = import_ref PackageA//default, loc11_11, loaded [template = constants.%HasF.type] +// CHECK:STDOUT: %import_ref.13 = import_ref PackageA//default, loc11_16, unloaded +// CHECK:STDOUT: %import_ref.14 = import_ref PackageB//default, inst17 [no loc], unloaded +// CHECK:STDOUT: %import_ref.15 = import_ref PackageB//default, loc7_9, unloaded +// CHECK:STDOUT: %import_ref.16 = import_ref PackageB//default, G, unloaded +// CHECK:STDOUT: %import_ref.17: type = import_ref PackageB//default, loc13_14, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.18: type = import_ref PackageB//default, loc13_20, loaded [template = constants.%HasG.type] +// CHECK:STDOUT: %import_ref.19 = import_ref PackageB//default, loc13_25, unloaded +// CHECK:STDOUT: %import_ref.20: type = import_ref PackageB//default, loc18_6, loaded [template = constants.%D] +// CHECK:STDOUT: %import_ref.21: type = import_ref PackageB//default, loc18_19, loaded [template = constants.%HasF.type] +// CHECK:STDOUT: %import_ref.22: = import_ref PackageB//default, loc18_25, loaded [template = constants.%interface] +// CHECK:STDOUT: %import_ref.23: type = import_ref PackageB//default, loc23_6, loaded [template = constants.%D] +// CHECK:STDOUT: %import_ref.24: type = import_ref PackageB//default, loc23_11, loaded [template = constants.%HasG.type] +// CHECK:STDOUT: %import_ref.25 = import_ref PackageB//default, loc23_16, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -690,30 +690,30 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: .HasG = %import_ref.4 // CHECK:STDOUT: import PackageB//default // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref PackageA//default, inst+12, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2: = import_ref PackageA//default, inst+15, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.3 = import_ref PackageA//default, inst+13, unloaded -// CHECK:STDOUT: %import_ref.4: type = import_ref PackageB//default, inst+3, loaded [template = constants.%HasG.type] -// CHECK:STDOUT: %import_ref.5 = import_ref PackageB//default, inst+5, unloaded -// CHECK:STDOUT: %import_ref.6: %G.assoc_type = import_ref PackageB//default, inst+12, loaded [template = constants.%assoc0] -// CHECK:STDOUT: %import_ref.7 = import_ref PackageB//default, inst+7, unloaded -// CHECK:STDOUT: %import_ref.9 = import_ref PackageA//default, inst+3, unloaded -// CHECK:STDOUT: %import_ref.10 = import_ref PackageA//default, inst+10, unloaded -// CHECK:STDOUT: %import_ref.11 = import_ref PackageA//default, inst+5, unloaded -// CHECK:STDOUT: %import_ref.12: type = import_ref PackageA//default, inst+17, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.13: type = import_ref PackageA//default, inst+18, loaded [template = constants.%HasF.type] -// CHECK:STDOUT: %import_ref.14 = import_ref PackageA//default, inst+24, unloaded -// CHECK:STDOUT: %import_ref.15: type = import_ref PackageB//default, inst+25, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.16: type = import_ref PackageB//default, inst+26, loaded [template = constants.%HasG.type] -// CHECK:STDOUT: %import_ref.17: = import_ref PackageB//default, inst+32, loaded [template = constants.%interface] -// CHECK:STDOUT: %import_ref.18: = import_ref PackageB//default, inst+17, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.19 = import_ref PackageB//default, inst+15, unloaded -// CHECK:STDOUT: %import_ref.20: type = import_ref PackageB//default, inst+35, loaded [template = constants.%D] -// CHECK:STDOUT: %import_ref.21: type = import_ref PackageB//default, inst+44, loaded [template = constants.%HasF.type] -// CHECK:STDOUT: %import_ref.22 = import_ref PackageB//default, inst+53, unloaded -// CHECK:STDOUT: %import_ref.23: type = import_ref PackageB//default, inst+56, loaded [template = constants.%D] -// CHECK:STDOUT: %import_ref.24: type = import_ref PackageB//default, inst+57, loaded [template = constants.%HasG.type] -// CHECK:STDOUT: %import_ref.25 = import_ref PackageB//default, inst+63, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref PackageA//default, C, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2: = import_ref PackageA//default, loc8_10, loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.3 = import_ref PackageA//default, inst25 [no loc], unloaded +// CHECK:STDOUT: %import_ref.4: type = import_ref PackageB//default, HasG, loaded [template = constants.%HasG.type] +// CHECK:STDOUT: %import_ref.5 = import_ref PackageB//default, inst17 [no loc], unloaded +// CHECK:STDOUT: %import_ref.6: %G.assoc_type = import_ref PackageB//default, loc7_9, loaded [template = constants.%assoc0] +// CHECK:STDOUT: %import_ref.7 = import_ref PackageB//default, G, unloaded +// CHECK:STDOUT: %import_ref.9 = import_ref PackageA//default, inst15 [no loc], unloaded +// CHECK:STDOUT: %import_ref.10 = import_ref PackageA//default, loc5_9, unloaded +// CHECK:STDOUT: %import_ref.11 = import_ref PackageA//default, F, unloaded +// CHECK:STDOUT: %import_ref.12: type = import_ref PackageA//default, loc11_6, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.13: type = import_ref PackageA//default, loc11_11, loaded [template = constants.%HasF.type] +// CHECK:STDOUT: %import_ref.14 = import_ref PackageA//default, loc11_16, unloaded +// CHECK:STDOUT: %import_ref.15: type = import_ref PackageB//default, loc13_14, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.16: type = import_ref PackageB//default, loc13_20, loaded [template = constants.%HasG.type] +// CHECK:STDOUT: %import_ref.17: = import_ref PackageB//default, loc13_25, loaded [template = constants.%interface] +// CHECK:STDOUT: %import_ref.18: = import_ref PackageB//default, loc10_10, loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.19 = import_ref PackageB//default, inst27 [no loc], unloaded +// CHECK:STDOUT: %import_ref.20: type = import_ref PackageB//default, loc18_6, loaded [template = constants.%D] +// CHECK:STDOUT: %import_ref.21: type = import_ref PackageB//default, loc18_19, loaded [template = constants.%HasF.type] +// CHECK:STDOUT: %import_ref.22 = import_ref PackageB//default, loc18_25, unloaded +// CHECK:STDOUT: %import_ref.23: type = import_ref PackageB//default, loc23_6, loaded [template = constants.%D] +// CHECK:STDOUT: %import_ref.24: type = import_ref PackageB//default, loc23_11, loaded [template = constants.%HasG.type] +// CHECK:STDOUT: %import_ref.25 = import_ref PackageB//default, loc23_16, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -828,27 +828,27 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: .HasG = %import_ref.4 // CHECK:STDOUT: import PackageB//default // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref PackageB//default, inst+14, loaded [template = constants.%D] -// CHECK:STDOUT: %import_ref.2: = import_ref PackageB//default, inst+17, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.3 = import_ref PackageB//default, inst+15, unloaded -// CHECK:STDOUT: %import_ref.4: type = import_ref PackageB//default, inst+3, loaded [template = constants.%HasG.type] -// CHECK:STDOUT: %import_ref.5 = import_ref PackageB//default, inst+5, unloaded -// CHECK:STDOUT: %import_ref.6: %G.assoc_type = import_ref PackageB//default, inst+12, loaded [template = constants.%assoc0] -// CHECK:STDOUT: %import_ref.7 = import_ref PackageB//default, inst+7, unloaded -// CHECK:STDOUT: %import_ref.9: = import_ref PackageB//default, inst+23, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.10 = import_ref PackageB//default, inst+24, unloaded -// CHECK:STDOUT: %import_ref.11: type = import_ref PackageB//default, inst+25, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.12: type = import_ref PackageB//default, inst+26, loaded [template = constants.%HasG.type] -// CHECK:STDOUT: %import_ref.13 = import_ref PackageB//default, inst+32, unloaded -// CHECK:STDOUT: %import_ref.14 = import_ref PackageB//default, inst+41, unloaded -// CHECK:STDOUT: %import_ref.15 = import_ref PackageB//default, inst+42, unloaded -// CHECK:STDOUT: %import_ref.16 = import_ref PackageB//default, inst+43, unloaded -// CHECK:STDOUT: %import_ref.17: type = import_ref PackageB//default, inst+35, loaded [template = constants.%D] -// CHECK:STDOUT: %import_ref.18: type = import_ref PackageB//default, inst+44, loaded [template = constants.%HasF.type] -// CHECK:STDOUT: %import_ref.19 = import_ref PackageB//default, inst+53, unloaded -// CHECK:STDOUT: %import_ref.20: type = import_ref PackageB//default, inst+56, loaded [template = constants.%D] -// CHECK:STDOUT: %import_ref.21: type = import_ref PackageB//default, inst+57, loaded [template = constants.%HasG.type] -// CHECK:STDOUT: %import_ref.22: = import_ref PackageB//default, inst+63, loaded [template = constants.%interface] +// CHECK:STDOUT: %import_ref.1: type = import_ref PackageB//default, D, loaded [template = constants.%D] +// CHECK:STDOUT: %import_ref.2: = import_ref PackageB//default, loc10_10, loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.3 = import_ref PackageB//default, inst27 [no loc], unloaded +// CHECK:STDOUT: %import_ref.4: type = import_ref PackageB//default, HasG, loaded [template = constants.%HasG.type] +// CHECK:STDOUT: %import_ref.5 = import_ref PackageB//default, inst17 [no loc], unloaded +// CHECK:STDOUT: %import_ref.6: %G.assoc_type = import_ref PackageB//default, loc7_9, loaded [template = constants.%assoc0] +// CHECK:STDOUT: %import_ref.7 = import_ref PackageB//default, G, unloaded +// CHECK:STDOUT: %import_ref.9: = import_ref PackageB//default, inst35 [indirect], loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.10 = import_ref PackageB//default, inst36 [indirect], unloaded +// CHECK:STDOUT: %import_ref.11: type = import_ref PackageB//default, loc13_14, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.12: type = import_ref PackageB//default, loc13_20, loaded [template = constants.%HasG.type] +// CHECK:STDOUT: %import_ref.13 = import_ref PackageB//default, loc13_25, unloaded +// CHECK:STDOUT: %import_ref.14 = import_ref PackageB//default, inst53 [indirect], unloaded +// CHECK:STDOUT: %import_ref.15 = import_ref PackageB//default, inst54 [indirect], unloaded +// CHECK:STDOUT: %import_ref.16 = import_ref PackageB//default, F, unloaded +// CHECK:STDOUT: %import_ref.17: type = import_ref PackageB//default, loc18_6, loaded [template = constants.%D] +// CHECK:STDOUT: %import_ref.18: type = import_ref PackageB//default, loc18_19, loaded [template = constants.%HasF.type] +// CHECK:STDOUT: %import_ref.19 = import_ref PackageB//default, loc18_25, unloaded +// CHECK:STDOUT: %import_ref.20: type = import_ref PackageB//default, loc23_6, loaded [template = constants.%D] +// CHECK:STDOUT: %import_ref.21: type = import_ref PackageB//default, loc23_11, loaded [template = constants.%HasG.type] +// CHECK:STDOUT: %import_ref.22: = import_ref PackageB//default, loc23_16, loaded [template = constants.%interface] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -1012,13 +1012,13 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: .Z = %import_ref.1 // CHECK:STDOUT: import PackageAssociatedInterface//default // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref PackageAssociatedInterface//default, inst+1, loaded [template = constants.%Z.type] -// CHECK:STDOUT: %import_ref.2 = import_ref PackageAssociatedInterface//default, inst+3, unloaded -// CHECK:STDOUT: %import_ref.3: %H.assoc_type = import_ref PackageAssociatedInterface//default, inst+10, loaded [template = constants.%assoc0] -// CHECK:STDOUT: %import_ref.4 = import_ref PackageAssociatedInterface//default, inst+5, unloaded -// CHECK:STDOUT: %import_ref.6: type = import_ref PackageAssociatedInterface//default, inst+13, loaded [template = constants.%empty_tuple.type] -// CHECK:STDOUT: %import_ref.7: type = import_ref PackageAssociatedInterface//default, inst+14, loaded [template = constants.%Z.type] -// CHECK:STDOUT: %import_ref.8: = import_ref PackageAssociatedInterface//default, inst+20, loaded [template = constants.%interface] +// CHECK:STDOUT: %import_ref.1: type = import_ref PackageAssociatedInterface//default, Z, loaded [template = constants.%Z.type] +// CHECK:STDOUT: %import_ref.2 = import_ref PackageAssociatedInterface//default, inst15 [no loc], unloaded +// CHECK:STDOUT: %import_ref.3: %H.assoc_type = import_ref PackageAssociatedInterface//default, loc5_9, loaded [template = constants.%assoc0] +// CHECK:STDOUT: %import_ref.4 = import_ref PackageAssociatedInterface//default, H, unloaded +// CHECK:STDOUT: %import_ref.6: type = import_ref PackageAssociatedInterface//default, loc8_7, loaded [template = constants.%empty_tuple.type] +// CHECK:STDOUT: %import_ref.7: type = import_ref PackageAssociatedInterface//default, loc8_12, loaded [template = constants.%Z.type] +// CHECK:STDOUT: %import_ref.8: = import_ref PackageAssociatedInterface//default, loc8_14, loaded [template = constants.%interface] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -1188,13 +1188,13 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: .Y = %import_ref.4 // CHECK:STDOUT: import PackageHasParam//default // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: %AnyParam.type = import_ref PackageHasParam//default, inst+14, loaded [template = constants.%AnyParam.generic] -// CHECK:STDOUT: %import_ref.2: = import_ref PackageHasParam//default, inst+24, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.3 = import_ref PackageHasParam//default, inst+22, unloaded -// CHECK:STDOUT: %import_ref.4: type = import_ref PackageHasParam//default, inst+26, loaded [template = constants.%Y.type] -// CHECK:STDOUT: %import_ref.5 = import_ref PackageHasParam//default, inst+28, unloaded -// CHECK:STDOUT: %import_ref.6: %K.assoc_type = import_ref PackageHasParam//default, inst+34, loaded [template = constants.%assoc0] -// CHECK:STDOUT: %import_ref.7: %K.type.2 = import_ref PackageHasParam//default, inst+30, loaded [template = constants.%K.2] +// CHECK:STDOUT: %import_ref.1: %AnyParam.type = import_ref PackageHasParam//default, AnyParam, loaded [template = constants.%AnyParam.generic] +// CHECK:STDOUT: %import_ref.2: = import_ref PackageHasParam//default, loc4_34, loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.3 = import_ref PackageHasParam//default, inst34 [no loc], unloaded +// CHECK:STDOUT: %import_ref.4: type = import_ref PackageHasParam//default, Y, loaded [template = constants.%Y.type] +// CHECK:STDOUT: %import_ref.5 = import_ref PackageHasParam//default, inst40 [no loc], unloaded +// CHECK:STDOUT: %import_ref.6: %K.assoc_type = import_ref PackageHasParam//default, loc7_10, loaded [template = constants.%assoc0] +// CHECK:STDOUT: %import_ref.7: %K.type.2 = import_ref PackageHasParam//default, K, loaded [template = constants.%K.2] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -1374,18 +1374,18 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: .GenericInterface = %import_ref.4 // CHECK:STDOUT: import PackageGenericInterface//default // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: %AnyParam.type = import_ref PackageHasParam//default, inst+14, loaded [template = constants.%AnyParam.generic] -// CHECK:STDOUT: %import_ref.2: = import_ref PackageHasParam//default, inst+24, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.3 = import_ref PackageHasParam//default, inst+22, unloaded -// CHECK:STDOUT: %import_ref.4: %GenericInterface.type.1 = import_ref PackageGenericInterface//default, inst+9, loaded [template = constants.%GenericInterface.generic] -// CHECK:STDOUT: %import_ref.5 = import_ref PackageGenericInterface//default, inst+16, unloaded -// CHECK:STDOUT: %import_ref.6: type = import_ref PackageHasParam//default, inst+26, loaded [template = constants.%Y.type] -// CHECK:STDOUT: %import_ref.7 = import_ref PackageHasParam//default, inst+28, unloaded -// CHECK:STDOUT: %import_ref.8: %K.assoc_type = import_ref PackageHasParam//default, inst+34, loaded [template = constants.%assoc0] -// CHECK:STDOUT: %import_ref.9 = import_ref PackageHasParam//default, inst+30, unloaded -// CHECK:STDOUT: %import_ref.11: type = import_ref PackageGenericInterface//default, inst+45, loaded [template = constants.%AnyParam.2] -// CHECK:STDOUT: %import_ref.12: type = import_ref PackageGenericInterface//default, inst+55, loaded [template = constants.%Y.type] -// CHECK:STDOUT: %import_ref.13: = import_ref PackageGenericInterface//default, inst+64, loaded [template = constants.%interface] +// CHECK:STDOUT: %import_ref.1: %AnyParam.type = import_ref PackageHasParam//default, AnyParam, loaded [template = constants.%AnyParam.generic] +// CHECK:STDOUT: %import_ref.2: = import_ref PackageHasParam//default, loc4_34, loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.3 = import_ref PackageHasParam//default, inst34 [no loc], unloaded +// CHECK:STDOUT: %import_ref.4: %GenericInterface.type.1 = import_ref PackageGenericInterface//default, GenericInterface, loaded [template = constants.%GenericInterface.generic] +// CHECK:STDOUT: %import_ref.5 = import_ref PackageGenericInterface//default, inst28 [no loc], unloaded +// CHECK:STDOUT: %import_ref.6: type = import_ref PackageHasParam//default, Y, loaded [template = constants.%Y.type] +// CHECK:STDOUT: %import_ref.7 = import_ref PackageHasParam//default, inst40 [no loc], unloaded +// CHECK:STDOUT: %import_ref.8: %K.assoc_type = import_ref PackageHasParam//default, loc7_10, loaded [template = constants.%assoc0] +// CHECK:STDOUT: %import_ref.9 = import_ref PackageHasParam//default, K, unloaded +// CHECK:STDOUT: %import_ref.11: type = import_ref PackageGenericInterface//default, loc8_47, loaded [template = constants.%AnyParam.2] +// CHECK:STDOUT: %import_ref.12: type = import_ref PackageGenericInterface//default, loc8_67, loaded [template = constants.%Y.type] +// CHECK:STDOUT: %import_ref.13: = import_ref PackageGenericInterface//default, loc8_70, loaded [template = constants.%interface] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -1744,24 +1744,24 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: .I = %import_ref.4 // CHECK:STDOUT: import HasExtraInterfaces//default // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: %C.type = import_ref HasExtraInterfaces//default, inst+39, loaded [template = constants.%C.generic] -// CHECK:STDOUT: %import_ref.2: = import_ref HasExtraInterfaces//default, inst+47, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.3 = import_ref HasExtraInterfaces//default, inst+45, unloaded -// CHECK:STDOUT: %import_ref.4: type = import_ref HasExtraInterfaces//default, inst+49, loaded [template = constants.%I.type] -// CHECK:STDOUT: %import_ref.5 = import_ref HasExtraInterfaces//default, inst+51, unloaded -// CHECK:STDOUT: %import_ref.6: %F.assoc_type = import_ref HasExtraInterfaces//default, inst+57, loaded [template = constants.%assoc0] -// CHECK:STDOUT: %import_ref.7 = import_ref HasExtraInterfaces//default, inst+53, unloaded -// CHECK:STDOUT: %import_ref.9 = import_ref HasExtraInterfaces//default, inst+31, unloaded -// CHECK:STDOUT: %import_ref.10 = import_ref HasExtraInterfaces//default, inst+27, unloaded -// CHECK:STDOUT: %import_ref.11 = import_ref HasExtraInterfaces//default, inst+23, unloaded -// CHECK:STDOUT: %import_ref.12 = import_ref HasExtraInterfaces//default, inst+19, unloaded -// CHECK:STDOUT: %import_ref.13 = import_ref HasExtraInterfaces//default, inst+15, unloaded -// CHECK:STDOUT: %import_ref.14 = import_ref HasExtraInterfaces//default, inst+11, unloaded -// CHECK:STDOUT: %import_ref.15 = import_ref HasExtraInterfaces//default, inst+7, unloaded -// CHECK:STDOUT: %import_ref.16 = import_ref HasExtraInterfaces//default, inst+3, unloaded -// CHECK:STDOUT: %import_ref.17: type = import_ref HasExtraInterfaces//default, inst+72, loaded [template = constants.%C.3] -// CHECK:STDOUT: %import_ref.18: type = import_ref HasExtraInterfaces//default, inst+74, loaded [template = constants.%I.type] -// CHECK:STDOUT: %import_ref.19 = import_ref HasExtraInterfaces//default, inst+80, unloaded +// CHECK:STDOUT: %import_ref.1: %C.type = import_ref HasExtraInterfaces//default, C, loaded [template = constants.%C.generic] +// CHECK:STDOUT: %import_ref.2: = import_ref HasExtraInterfaces//default, loc13_20, loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.3 = import_ref HasExtraInterfaces//default, inst57 [no loc], unloaded +// CHECK:STDOUT: %import_ref.4: type = import_ref HasExtraInterfaces//default, I, loaded [template = constants.%I.type] +// CHECK:STDOUT: %import_ref.5 = import_ref HasExtraInterfaces//default, inst63 [no loc], unloaded +// CHECK:STDOUT: %import_ref.6: %F.assoc_type = import_ref HasExtraInterfaces//default, loc14_21, loaded [template = constants.%assoc0] +// CHECK:STDOUT: %import_ref.7 = import_ref HasExtraInterfaces//default, F, unloaded +// CHECK:STDOUT: %import_ref.9 = import_ref HasExtraInterfaces//default, inst43 [no loc], unloaded +// CHECK:STDOUT: %import_ref.10 = import_ref HasExtraInterfaces//default, inst39 [no loc], unloaded +// CHECK:STDOUT: %import_ref.11 = import_ref HasExtraInterfaces//default, inst35 [no loc], unloaded +// CHECK:STDOUT: %import_ref.12 = import_ref HasExtraInterfaces//default, inst31 [no loc], unloaded +// CHECK:STDOUT: %import_ref.13 = import_ref HasExtraInterfaces//default, inst27 [no loc], unloaded +// CHECK:STDOUT: %import_ref.14 = import_ref HasExtraInterfaces//default, inst23 [no loc], unloaded +// CHECK:STDOUT: %import_ref.15 = import_ref HasExtraInterfaces//default, inst19 [no loc], unloaded +// CHECK:STDOUT: %import_ref.16 = import_ref HasExtraInterfaces//default, inst15 [no loc], unloaded +// CHECK:STDOUT: %import_ref.17: type = import_ref HasExtraInterfaces//default, loc16_72, loaded [template = constants.%C.3] +// CHECK:STDOUT: %import_ref.18: type = import_ref HasExtraInterfaces//default, loc16_77, loaded [template = constants.%I.type] +// CHECK:STDOUT: %import_ref.19 = import_ref HasExtraInterfaces//default, loc16_79, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/impl/lookup/no_prelude/specific_args.carbon b/toolchain/check/testdata/impl/lookup/no_prelude/specific_args.carbon index 63e3ebedc42cf..fb8a1a4c5536f 100644 --- a/toolchain/check/testdata/impl/lookup/no_prelude/specific_args.carbon +++ b/toolchain/check/testdata/impl/lookup/no_prelude/specific_args.carbon @@ -193,15 +193,15 @@ fn H(c: C(InClassArgs)) { c.(I(X).F)(); } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %I.type.1 = import_ref Main//types, inst+7, loaded [template = constants.%I.generic] -// CHECK:STDOUT: %import_ref.2 = import_ref Main//types, inst+32, unloaded -// CHECK:STDOUT: %import_ref.3: type = import_ref Main//types, inst+41, loaded [template = constants.%X] -// CHECK:STDOUT: %import_ref.4: = import_ref Main//types, inst+43, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.5 = import_ref Main//types, inst+42, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Main//types, inst+14, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref Main//types, inst+20, unloaded -// CHECK:STDOUT: %import_ref.8: @I.%F.type (%F.type.1) = import_ref Main//types, inst+16, loaded [symbolic = @I.%F (constants.%F.1)] -// CHECK:STDOUT: %import_ref.9 = import_ref Main//types, inst+16, unloaded +// CHECK:STDOUT: %import_ref.1: %I.type.1 = import_ref Main//types, I, loaded [template = constants.%I.generic] +// CHECK:STDOUT: %import_ref.2 = import_ref Main//types, C, unloaded +// CHECK:STDOUT: %import_ref.3: type = import_ref Main//types, X, loaded [template = constants.%X] +// CHECK:STDOUT: %import_ref.4: = import_ref Main//types, loc7_10, loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.5 = import_ref Main//types, inst54 [no loc], unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Main//types, inst26 [no loc], unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Main//types, loc4_31, unloaded +// CHECK:STDOUT: %import_ref.8: @I.%F.type (%F.type.1) = import_ref Main//types, F, loaded [symbolic = @I.%F (constants.%F.1)] +// CHECK:STDOUT: %import_ref.9 = import_ref Main//types, loc4_31, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -333,21 +333,21 @@ fn H(c: C(InClassArgs)) { c.(I(X).F)(); } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %I.type.1 = import_ref Main//types, inst+7, loaded [template = constants.%I.generic] -// CHECK:STDOUT: %import_ref.2 = import_ref Main//types, inst+32, unloaded -// CHECK:STDOUT: %import_ref.3: type = import_ref Main//types, inst+41, loaded [template = constants.%X] -// CHECK:STDOUT: %import_ref.4: type = import_ref Main//impl_in_interface_args, inst+5, loaded [template = constants.%InInterfaceArgs] -// CHECK:STDOUT: %import_ref.5: = import_ref Main//types, inst+43, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.6 = import_ref Main//types, inst+42, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref Main//types, inst+14, unloaded -// CHECK:STDOUT: %import_ref.8: @I.%F.assoc_type (%F.assoc_type.1) = import_ref Main//types, inst+20, loaded [symbolic = @I.%assoc0 (constants.%assoc0.3)] -// CHECK:STDOUT: %import_ref.9 = import_ref Main//types, inst+16, unloaded -// CHECK:STDOUT: %import_ref.10 = import_ref Main//types, inst+16, unloaded -// CHECK:STDOUT: %import_ref.11: = import_ref Main//impl_in_interface_args, inst+8, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.12 = import_ref Main//impl_in_interface_args, inst+6, unloaded -// CHECK:STDOUT: %import_ref.14: type = import_ref Main//impl_in_interface_args, inst+14, loaded [template = constants.%X] -// CHECK:STDOUT: %import_ref.15: type = import_ref Main//impl_in_interface_args, inst+44, loaded [template = constants.%I.type.3] -// CHECK:STDOUT: %import_ref.16: = import_ref Main//impl_in_interface_args, inst+55, loaded [template = constants.%interface] +// CHECK:STDOUT: %import_ref.1: %I.type.1 = import_ref Main//types, I, loaded [template = constants.%I.generic] +// CHECK:STDOUT: %import_ref.2 = import_ref Main//types, C, unloaded +// CHECK:STDOUT: %import_ref.3: type = import_ref Main//types, X, loaded [template = constants.%X] +// CHECK:STDOUT: %import_ref.4: type = import_ref Main//impl_in_interface_args, InInterfaceArgs, loaded [template = constants.%InInterfaceArgs] +// CHECK:STDOUT: %import_ref.5: = import_ref Main//types, loc7_10, loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.6 = import_ref Main//types, inst54 [no loc], unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Main//types, inst26 [no loc], unloaded +// CHECK:STDOUT: %import_ref.8: @I.%F.assoc_type (%F.assoc_type.1) = import_ref Main//types, loc4_31, loaded [symbolic = @I.%assoc0 (constants.%assoc0.3)] +// CHECK:STDOUT: %import_ref.9 = import_ref Main//types, F, unloaded +// CHECK:STDOUT: %import_ref.10 = import_ref Main//types, loc4_31, unloaded +// CHECK:STDOUT: %import_ref.11: = import_ref Main//impl_in_interface_args, loc5_24, loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.12 = import_ref Main//impl_in_interface_args, inst18 [no loc], unloaded +// CHECK:STDOUT: %import_ref.14: type = import_ref Main//impl_in_interface_args, loc7_6, loaded [template = constants.%X] +// CHECK:STDOUT: %import_ref.15: type = import_ref Main//impl_in_interface_args, loc7_28, loaded [template = constants.%I.type.3] +// CHECK:STDOUT: %import_ref.16: = import_ref Main//impl_in_interface_args, loc7_30, loaded [template = constants.%interface] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -483,17 +483,17 @@ fn H(c: C(InClassArgs)) { c.(I(X).F)(); } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %I.type.1 = import_ref Main//types, inst+7, loaded [template = constants.%I.generic] -// CHECK:STDOUT: %import_ref.2: %C.type = import_ref Main//types, inst+32, loaded [template = constants.%C.generic] -// CHECK:STDOUT: %import_ref.3: type = import_ref Main//types, inst+41, loaded [template = constants.%X] -// CHECK:STDOUT: %import_ref.4: = import_ref Main//types, inst+39, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.5 = import_ref Main//types, inst+37, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Main//types, inst+14, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref Main//types, inst+20, unloaded -// CHECK:STDOUT: %import_ref.8: @I.%F.type (%F.type.1) = import_ref Main//types, inst+16, loaded [symbolic = @I.%F (constants.%F.1)] -// CHECK:STDOUT: %import_ref.9 = import_ref Main//types, inst+16, unloaded -// CHECK:STDOUT: %import_ref.10: = import_ref Main//types, inst+43, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.11 = import_ref Main//types, inst+42, unloaded +// CHECK:STDOUT: %import_ref.1: %I.type.1 = import_ref Main//types, I, loaded [template = constants.%I.generic] +// CHECK:STDOUT: %import_ref.2: %C.type = import_ref Main//types, C, loaded [template = constants.%C.generic] +// CHECK:STDOUT: %import_ref.3: type = import_ref Main//types, X, loaded [template = constants.%X] +// CHECK:STDOUT: %import_ref.4: = import_ref Main//types, loc5_20, loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.5 = import_ref Main//types, inst49 [no loc], unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Main//types, inst26 [no loc], unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Main//types, loc4_31, unloaded +// CHECK:STDOUT: %import_ref.8: @I.%F.type (%F.type.1) = import_ref Main//types, F, loaded [symbolic = @I.%F (constants.%F.1)] +// CHECK:STDOUT: %import_ref.9 = import_ref Main//types, loc4_31, unloaded +// CHECK:STDOUT: %import_ref.10: = import_ref Main//types, loc7_10, loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.11 = import_ref Main//types, inst54 [no loc], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -653,23 +653,23 @@ fn H(c: C(InClassArgs)) { c.(I(X).F)(); } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %I.type.1 = import_ref Main//types, inst+7, loaded [template = constants.%I.generic] -// CHECK:STDOUT: %import_ref.2: %C.type = import_ref Main//types, inst+32, loaded [template = constants.%C.generic] -// CHECK:STDOUT: %import_ref.3: type = import_ref Main//types, inst+41, loaded [template = constants.%X] -// CHECK:STDOUT: %import_ref.4: type = import_ref Main//impl_in_class_args, inst+5, loaded [template = constants.%InClassArgs] -// CHECK:STDOUT: %import_ref.5: = import_ref Main//types, inst+39, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.6 = import_ref Main//types, inst+37, unloaded -// CHECK:STDOUT: %import_ref.7: = import_ref Main//impl_in_class_args, inst+8, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.8 = import_ref Main//impl_in_class_args, inst+6, unloaded -// CHECK:STDOUT: %import_ref.9 = import_ref Main//types, inst+14, unloaded -// CHECK:STDOUT: %import_ref.10: @I.%F.assoc_type (%F.assoc_type.1) = import_ref Main//types, inst+20, loaded [symbolic = @I.%assoc0 (constants.%assoc0.3)] -// CHECK:STDOUT: %import_ref.11 = import_ref Main//types, inst+16, unloaded -// CHECK:STDOUT: %import_ref.12 = import_ref Main//types, inst+16, unloaded -// CHECK:STDOUT: %import_ref.13: = import_ref Main//types, inst+43, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.14 = import_ref Main//types, inst+42, unloaded -// CHECK:STDOUT: %import_ref.16: type = import_ref Main//impl_in_class_args, inst+25, loaded [template = constants.%C.2] -// CHECK:STDOUT: %import_ref.17: type = import_ref Main//impl_in_class_args, inst+57, loaded [template = constants.%I.type.3] -// CHECK:STDOUT: %import_ref.18: = import_ref Main//impl_in_class_args, inst+68, loaded [template = constants.%interface] +// CHECK:STDOUT: %import_ref.1: %I.type.1 = import_ref Main//types, I, loaded [template = constants.%I.generic] +// CHECK:STDOUT: %import_ref.2: %C.type = import_ref Main//types, C, loaded [template = constants.%C.generic] +// CHECK:STDOUT: %import_ref.3: type = import_ref Main//types, X, loaded [template = constants.%X] +// CHECK:STDOUT: %import_ref.4: type = import_ref Main//impl_in_class_args, InClassArgs, loaded [template = constants.%InClassArgs] +// CHECK:STDOUT: %import_ref.5: = import_ref Main//types, loc5_20, loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.6 = import_ref Main//types, inst49 [no loc], unloaded +// CHECK:STDOUT: %import_ref.7: = import_ref Main//impl_in_class_args, loc5_20, loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.8 = import_ref Main//impl_in_class_args, inst18 [no loc], unloaded +// CHECK:STDOUT: %import_ref.9 = import_ref Main//types, inst26 [no loc], unloaded +// CHECK:STDOUT: %import_ref.10: @I.%F.assoc_type (%F.assoc_type.1) = import_ref Main//types, loc4_31, loaded [symbolic = @I.%assoc0 (constants.%assoc0.3)] +// CHECK:STDOUT: %import_ref.11 = import_ref Main//types, F, unloaded +// CHECK:STDOUT: %import_ref.12 = import_ref Main//types, loc4_31, unloaded +// CHECK:STDOUT: %import_ref.13: = import_ref Main//types, loc7_10, loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.14 = import_ref Main//types, inst54 [no loc], unloaded +// CHECK:STDOUT: %import_ref.16: type = import_ref Main//impl_in_class_args, loc7_19, loaded [template = constants.%C.2] +// CHECK:STDOUT: %import_ref.17: type = import_ref Main//impl_in_class_args, loc7_27, loaded [template = constants.%I.type.3] +// CHECK:STDOUT: %import_ref.18: = import_ref Main//impl_in_class_args, loc7_29, loaded [template = constants.%interface] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/impl/lookup/transitive.carbon b/toolchain/check/testdata/impl/lookup/transitive.carbon index 1694fc3b2454a..4131827c5d13f 100644 --- a/toolchain/check/testdata/impl/lookup/transitive.carbon +++ b/toolchain/check/testdata/impl/lookup/transitive.carbon @@ -105,14 +105,14 @@ fn Call() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Main//i, inst+3, loaded [template = constants.%I.type] +// CHECK:STDOUT: %import_ref.1: type = import_ref Main//i, I, loaded [template = constants.%I.type] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.2 = import_ref Main//i, inst+5, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref Main//i, inst+12, unloaded -// CHECK:STDOUT: %import_ref.4: %F.type.2 = import_ref Main//i, inst+7, loaded [template = constants.%F.2] +// CHECK:STDOUT: %import_ref.2 = import_ref Main//i, inst17 [no loc], unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref Main//i, loc4_21, unloaded +// CHECK:STDOUT: %import_ref.4: %F.type.2 = import_ref Main//i, F, loaded [template = constants.%F.2] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -179,13 +179,13 @@ fn Call() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Main//c, inst+5, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.1: type = import_ref Main//c, C, loaded [template = constants.%C] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.2: = import_ref Main//c, inst+8, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.3 = import_ref Main//c, inst+6, unloaded +// CHECK:STDOUT: %import_ref.2: = import_ref Main//c, loc6_10, loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.3 = import_ref Main//c, inst18 [no loc], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -236,20 +236,20 @@ fn Call() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Get.type = import_ref Main//get, inst+16, loaded [template = constants.%Get] -// CHECK:STDOUT: %import_ref.2: type = import_ref Main//i, inst+3, loaded [template = constants.%I.type] +// CHECK:STDOUT: %import_ref.1: %Get.type = import_ref Main//get, Get, loaded [template = constants.%Get] +// CHECK:STDOUT: %import_ref.2: type = import_ref Main//i, I, loaded [template = constants.%I.type] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.3: = import_ref Main//get, inst+9, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.4 = import_ref Main//get, inst+10, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Main//i, inst+5, unloaded -// CHECK:STDOUT: %import_ref.6: %F.assoc_type = import_ref Main//i, inst+12, loaded [template = constants.%assoc0] -// CHECK:STDOUT: %import_ref.7 = import_ref Main//i, inst+7, unloaded -// CHECK:STDOUT: %import_ref.9: type = import_ref Main//c, inst+10, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.10: type = import_ref Main//c, inst+17, loaded [template = constants.%I.type] -// CHECK:STDOUT: %import_ref.11: = import_ref Main//c, inst+27, loaded [template = constants.%interface] +// CHECK:STDOUT: %import_ref.3: = import_ref Main//get, inst21 [indirect], loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.4 = import_ref Main//get, inst22 [indirect], unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref Main//i, inst17 [no loc], unloaded +// CHECK:STDOUT: %import_ref.6: %F.assoc_type = import_ref Main//i, loc4_21, loaded [template = constants.%assoc0] +// CHECK:STDOUT: %import_ref.7 = import_ref Main//i, F, unloaded +// CHECK:STDOUT: %import_ref.9: type = import_ref Main//c, loc7_6, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.10: type = import_ref Main//c, loc7_11, loaded [template = constants.%I.type] +// CHECK:STDOUT: %import_ref.11: = import_ref Main//c, loc7_13, loaded [template = constants.%interface] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/impl/no_prelude/fail_alias.carbon b/toolchain/check/testdata/impl/no_prelude/fail_alias.carbon index 56a66de9c59be..0d08142659ced 100644 --- a/toolchain/check/testdata/impl/no_prelude/fail_alias.carbon +++ b/toolchain/check/testdata/impl/no_prelude/fail_alias.carbon @@ -67,7 +67,7 @@ impl AC as AI {} // CHECK:STDOUT: // CHECK:STDOUT: impl @impl: %AC.ref.loc17 as %AI.ref.loc17 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = .inst+18.loc17_15 +// CHECK:STDOUT: witness = .inst30.loc17_15 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { diff --git a/toolchain/check/testdata/impl/no_prelude/generic_redeclaration.carbon b/toolchain/check/testdata/impl/no_prelude/generic_redeclaration.carbon index fab420685e3f0..5fc3fa3579b8f 100644 --- a/toolchain/check/testdata/impl/no_prelude/generic_redeclaration.carbon +++ b/toolchain/check/testdata/impl/no_prelude/generic_redeclaration.carbon @@ -452,7 +452,7 @@ impl (C, C).0 as I {} // CHECK:STDOUT: // CHECK:STDOUT: impl: %.loc7 as %J.ref.loc7 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = .inst+26.loc7_28 +// CHECK:STDOUT: witness = .inst38.loc7_28 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/no_prelude/import_extend_impl.carbon b/toolchain/check/testdata/impl/no_prelude/import_extend_impl.carbon index 98e33ecf15050..f7faa34949ad7 100644 --- a/toolchain/check/testdata/impl/no_prelude/import_extend_impl.carbon +++ b/toolchain/check/testdata/impl/no_prelude/import_extend_impl.carbon @@ -127,17 +127,17 @@ fn G(c: C) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1 = import_ref Main//extend_impl_library, inst+1, unloaded -// CHECK:STDOUT: %import_ref.2: type = import_ref Main//extend_impl_library, inst+12, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.3: = import_ref Main//extend_impl_library, inst+24, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.4 = import_ref Main//extend_impl_library, inst+13, unloaded -// CHECK:STDOUT: %import_ref.5: type = import_ref Main//extend_impl_library, inst+15, loaded [template = constants.%I.type] -// CHECK:STDOUT: %import_ref.6 = import_ref Main//extend_impl_library, inst+3, unloaded -// CHECK:STDOUT: %import_ref.7: %F.assoc_type = import_ref Main//extend_impl_library, inst+10, loaded [template = constants.%assoc0] -// CHECK:STDOUT: %import_ref.8 = import_ref Main//extend_impl_library, inst+5, unloaded -// CHECK:STDOUT: %import_ref.10: type = import_ref Main//extend_impl_library, inst+14, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.11: type = import_ref Main//extend_impl_library, inst+15, loaded [template = constants.%I.type] -// CHECK:STDOUT: %import_ref.12: = import_ref Main//extend_impl_library, inst+21, loaded [template = constants.%interface] +// CHECK:STDOUT: %import_ref.1 = import_ref Main//extend_impl_library, I, unloaded +// CHECK:STDOUT: %import_ref.2: type = import_ref Main//extend_impl_library, C, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.3: = import_ref Main//extend_impl_library, loc12_1, loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.4 = import_ref Main//extend_impl_library, inst25 [no loc], unloaded +// CHECK:STDOUT: %import_ref.5: type = import_ref Main//extend_impl_library, loc9_18, loaded [template = constants.%I.type] +// CHECK:STDOUT: %import_ref.6 = import_ref Main//extend_impl_library, inst15 [no loc], unloaded +// CHECK:STDOUT: %import_ref.7: %F.assoc_type = import_ref Main//extend_impl_library, loc5_9, loaded [template = constants.%assoc0] +// CHECK:STDOUT: %import_ref.8 = import_ref Main//extend_impl_library, F, unloaded +// CHECK:STDOUT: %import_ref.10: type = import_ref Main//extend_impl_library, loc9_15, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.11: type = import_ref Main//extend_impl_library, loc9_18, loaded [template = constants.%I.type] +// CHECK:STDOUT: %import_ref.12: = import_ref Main//extend_impl_library, loc9_20, loaded [template = constants.%interface] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/impl/no_prelude/import_generic.carbon b/toolchain/check/testdata/impl/no_prelude/import_generic.carbon index 96b0b29ed3bbb..6cf5d23d16925 100644 --- a/toolchain/check/testdata/impl/no_prelude/import_generic.carbon +++ b/toolchain/check/testdata/impl/no_prelude/import_generic.carbon @@ -201,16 +201,16 @@ impl forall [T:! type] C as I(T*) {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Main//import_generic, inst+1, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2: %I.type.1 = import_ref Main//import_generic, inst+12, loaded [template = constants.%I.generic] -// CHECK:STDOUT: %import_ref.3 = import_ref Main//import_generic, inst+19, unloaded -// CHECK:STDOUT: %import_ref.4: = import_ref Main//import_generic, inst+4, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.5 = import_ref Main//import_generic, inst+2, unloaded -// CHECK:STDOUT: %import_ref.6: type = import_ref Main//import_generic, inst+26, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.7: type = import_ref Main//import_generic, inst+29, loaded [symbolic = @impl.1.%I.type.1 (constants.%I.type.2)] -// CHECK:STDOUT: %import_ref.8: type = import_ref Main//import_generic, inst+38, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.9: type = import_ref Main//import_generic, inst+43, loaded [symbolic = @impl.2.%I.type (constants.%I.type.3)] -// CHECK:STDOUT: %import_ref.10 = import_ref Main//import_generic, inst+51, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Main//import_generic, C, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2: %I.type.1 = import_ref Main//import_generic, I, loaded [template = constants.%I.generic] +// CHECK:STDOUT: %import_ref.3 = import_ref Main//import_generic, inst31 [no loc], unloaded +// CHECK:STDOUT: %import_ref.4: = import_ref Main//import_generic, loc4_10, loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.5 = import_ref Main//import_generic, inst14 [no loc], unloaded +// CHECK:STDOUT: %import_ref.6: type = import_ref Main//import_generic, loc7_24, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.7: type = import_ref Main//import_generic, loc7_32, loaded [symbolic = @impl.1.%I.type.1 (constants.%I.type.2)] +// CHECK:STDOUT: %import_ref.8: type = import_ref Main//import_generic, loc8_24, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.9: type = import_ref Main//import_generic, loc8_33, loaded [symbolic = @impl.2.%I.type (constants.%I.type.3)] +// CHECK:STDOUT: %import_ref.10 = import_ref Main//import_generic, loc8_35, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -339,16 +339,16 @@ impl forall [T:! type] C as I(T*) {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Main//import_generic, inst+1, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2: %I.type.1 = import_ref Main//import_generic, inst+12, loaded [template = constants.%I.generic] -// CHECK:STDOUT: %import_ref.3 = import_ref Main//import_generic, inst+19, unloaded -// CHECK:STDOUT: %import_ref.4: = import_ref Main//import_generic, inst+4, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.5 = import_ref Main//import_generic, inst+2, unloaded -// CHECK:STDOUT: %import_ref.6: type = import_ref Main//import_generic, inst+26, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.7: type = import_ref Main//import_generic, inst+29, loaded [symbolic = @impl.1.%I.type (constants.%I.type.2)] -// CHECK:STDOUT: %import_ref.8: type = import_ref Main//import_generic, inst+38, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.9: type = import_ref Main//import_generic, inst+43, loaded [symbolic = @impl.2.%I.type.1 (constants.%I.type.3)] -// CHECK:STDOUT: %import_ref.10 = import_ref Main//import_generic, inst+51, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Main//import_generic, C, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2: %I.type.1 = import_ref Main//import_generic, I, loaded [template = constants.%I.generic] +// CHECK:STDOUT: %import_ref.3 = import_ref Main//import_generic, inst31 [no loc], unloaded +// CHECK:STDOUT: %import_ref.4: = import_ref Main//import_generic, loc4_10, loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.5 = import_ref Main//import_generic, inst14 [no loc], unloaded +// CHECK:STDOUT: %import_ref.6: type = import_ref Main//import_generic, loc7_24, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.7: type = import_ref Main//import_generic, loc7_32, loaded [symbolic = @impl.1.%I.type (constants.%I.type.2)] +// CHECK:STDOUT: %import_ref.8: type = import_ref Main//import_generic, loc8_24, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.9: type = import_ref Main//import_generic, loc8_33, loaded [symbolic = @impl.2.%I.type.1 (constants.%I.type.3)] +// CHECK:STDOUT: %import_ref.10 = import_ref Main//import_generic, loc8_35, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/impl/no_prelude/import_self.carbon b/toolchain/check/testdata/impl/no_prelude/import_self.carbon index d49400162aab1..cc725a2593ed0 100644 --- a/toolchain/check/testdata/impl/no_prelude/import_self.carbon +++ b/toolchain/check/testdata/impl/no_prelude/import_self.carbon @@ -116,10 +116,10 @@ fn F(x: (), y: ()) -> () { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Main//a, inst+1, loaded [template = constants.%Add.type] -// CHECK:STDOUT: %import_ref.2 = import_ref Main//a, inst+3, unloaded -// CHECK:STDOUT: %import_ref.3: %Op.assoc_type = import_ref Main//a, inst+34, loaded [template = constants.%assoc0] -// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref Main//a, inst+27, loaded [template = constants.%Op.2] +// CHECK:STDOUT: %import_ref.1: type = import_ref Main//a, Add, loaded [template = constants.%Add.type] +// CHECK:STDOUT: %import_ref.2 = import_ref Main//a, inst15 [no loc], unloaded +// CHECK:STDOUT: %import_ref.3: %Op.assoc_type = import_ref Main//a, loc5_41, loaded [template = constants.%assoc0] +// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref Main//a, Op, loaded [template = constants.%Op.2] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/impl/no_prelude/import_use_generic.carbon b/toolchain/check/testdata/impl/no_prelude/import_use_generic.carbon index b35915cb199c6..7381afa0c7830 100644 --- a/toolchain/check/testdata/impl/no_prelude/import_use_generic.carbon +++ b/toolchain/check/testdata/impl/no_prelude/import_use_generic.carbon @@ -210,16 +210,16 @@ fn F() -> c.(I.F)() {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %C.type = import_ref Main//import_generic, inst+7, loaded [template = constants.%C.generic] -// CHECK:STDOUT: %import_ref.2: type = import_ref Main//import_generic, inst+17, loaded [template = constants.%I.type] -// CHECK:STDOUT: %import_ref.3: = import_ref Main//import_generic, inst+15, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.4 = import_ref Main//import_generic, inst+13, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Main//import_generic, inst+19, unloaded -// CHECK:STDOUT: %import_ref.6: %F.assoc_type = import_ref Main//import_generic, inst+25, loaded [template = constants.%assoc0] -// CHECK:STDOUT: %import_ref.7 = import_ref Main//import_generic, inst+21, unloaded -// CHECK:STDOUT: %import_ref.9: type = import_ref Main//import_generic, inst+32, loaded [symbolic = @impl.%C (constants.%C.1)] -// CHECK:STDOUT: %import_ref.10: type = import_ref Main//import_generic, inst+33, loaded [template = constants.%I.type] -// CHECK:STDOUT: %import_ref.11: = import_ref Main//import_generic, inst+43, loaded [symbolic = @impl.%interface (constants.%interface.1)] +// CHECK:STDOUT: %import_ref.1: %C.type = import_ref Main//import_generic, C, loaded [template = constants.%C.generic] +// CHECK:STDOUT: %import_ref.2: type = import_ref Main//import_generic, I, loaded [template = constants.%I.type] +// CHECK:STDOUT: %import_ref.3: = import_ref Main//import_generic, loc4_20, loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.4 = import_ref Main//import_generic, inst25 [no loc], unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref Main//import_generic, inst31 [no loc], unloaded +// CHECK:STDOUT: %import_ref.6: %F.assoc_type = import_ref Main//import_generic, loc7_9, loaded [template = constants.%assoc0] +// CHECK:STDOUT: %import_ref.7 = import_ref Main//import_generic, F, unloaded +// CHECK:STDOUT: %import_ref.9: type = import_ref Main//import_generic, loc10_27, loaded [symbolic = @impl.%C (constants.%C.1)] +// CHECK:STDOUT: %import_ref.10: type = import_ref Main//import_generic, loc10_32, loaded [template = constants.%I.type] +// CHECK:STDOUT: %import_ref.11: = import_ref Main//import_generic, loc10_34, loaded [symbolic = @impl.%interface (constants.%interface.1)] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/impl/no_prelude/interface_args.carbon b/toolchain/check/testdata/impl/no_prelude/interface_args.carbon index 28d76917c9b29..a0b7bc3f2de92 100644 --- a/toolchain/check/testdata/impl/no_prelude/interface_args.carbon +++ b/toolchain/check/testdata/impl/no_prelude/interface_args.carbon @@ -283,23 +283,23 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Action.type.1 = import_ref Main//action, inst+7, loaded [template = constants.%Action.generic] -// CHECK:STDOUT: %import_ref.2: type = import_ref Main//action, inst+28, loaded [template = constants.%A] -// CHECK:STDOUT: %import_ref.3: type = import_ref Main//action, inst+33, loaded [template = constants.%B] -// CHECK:STDOUT: %import_ref.4 = import_ref Main//action, inst+36, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Main//action, inst+61, unloaded -// CHECK:STDOUT: %import_ref.6: = import_ref Main//action, inst+35, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.7 = import_ref Main//action, inst+34, unloaded -// CHECK:STDOUT: %import_ref.8 = import_ref Main//action, inst+14, unloaded -// CHECK:STDOUT: %import_ref.9: @Action.%Op.assoc_type (%Op.assoc_type.1) = import_ref Main//action, inst+20, loaded [symbolic = @Action.%assoc0 (constants.%assoc0.3)] -// CHECK:STDOUT: %import_ref.10 = import_ref Main//action, inst+16, unloaded -// CHECK:STDOUT: %import_ref.11: = import_ref Main//action, inst+31, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.12 = import_ref Main//action, inst+29, unloaded -// CHECK:STDOUT: %import_ref.13: type = import_ref Main//action, inst+39, loaded [template = constants.%A] -// CHECK:STDOUT: %import_ref.14: type = import_ref Main//action, inst+42, loaded [template = constants.%Action.type.3] -// CHECK:STDOUT: %import_ref.15: = import_ref Main//action, inst+53, loaded [template = constants.%interface] -// CHECK:STDOUT: %import_ref.16 = import_ref Main//action, inst+45, unloaded -// CHECK:STDOUT: %import_ref.17 = import_ref Main//action, inst+16, unloaded +// CHECK:STDOUT: %import_ref.1: %Action.type.1 = import_ref Main//action, Action, loaded [template = constants.%Action.generic] +// CHECK:STDOUT: %import_ref.2: type = import_ref Main//action, A, loaded [template = constants.%A] +// CHECK:STDOUT: %import_ref.3: type = import_ref Main//action, B, loaded [template = constants.%B] +// CHECK:STDOUT: %import_ref.4 = import_ref Main//action, C, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref Main//action, F, unloaded +// CHECK:STDOUT: %import_ref.6: = import_ref Main//action, loc9_10, loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.7 = import_ref Main//action, inst46 [no loc], unloaded +// CHECK:STDOUT: %import_ref.8 = import_ref Main//action, inst26 [no loc], unloaded +// CHECK:STDOUT: %import_ref.9: @Action.%Op.assoc_type (%Op.assoc_type.1) = import_ref Main//action, loc5_10, loaded [symbolic = @Action.%assoc0 (constants.%assoc0.3)] +// CHECK:STDOUT: %import_ref.10 = import_ref Main//action, Op, unloaded +// CHECK:STDOUT: %import_ref.11: = import_ref Main//action, loc8_10, loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.12 = import_ref Main//action, inst41 [no loc], unloaded +// CHECK:STDOUT: %import_ref.13: type = import_ref Main//action, loc12_6, loaded [template = constants.%A] +// CHECK:STDOUT: %import_ref.14: type = import_ref Main//action, loc12_19, loaded [template = constants.%Action.type.3] +// CHECK:STDOUT: %import_ref.15: = import_ref Main//action, loc12_21, loaded [template = constants.%interface] +// CHECK:STDOUT: %import_ref.16 = import_ref Main//action, loc13_11, unloaded +// CHECK:STDOUT: %import_ref.17 = import_ref Main//action, loc5_10, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -440,25 +440,25 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Action.type.1 = import_ref Main//action, inst+7, loaded [template = constants.%Action.generic] -// CHECK:STDOUT: %import_ref.2: type = import_ref Main//action, inst+28, loaded [template = constants.%A] -// CHECK:STDOUT: %import_ref.3 = import_ref Main//action, inst+33, unloaded -// CHECK:STDOUT: %import_ref.4: type = import_ref Main//action, inst+36, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.5 = import_ref Main//action, inst+61, unloaded -// CHECK:STDOUT: %import_ref.6: = import_ref Main//action, inst+35, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.7 = import_ref Main//action, inst+34, unloaded -// CHECK:STDOUT: %import_ref.8 = import_ref Main//action, inst+14, unloaded -// CHECK:STDOUT: %import_ref.9: @Action.%Op.assoc_type (%Op.assoc_type.1) = import_ref Main//action, inst+20, loaded [symbolic = @Action.%assoc0 (constants.%assoc0.4)] -// CHECK:STDOUT: %import_ref.10 = import_ref Main//action, inst+16, unloaded -// CHECK:STDOUT: %import_ref.11: = import_ref Main//action, inst+31, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.12 = import_ref Main//action, inst+29, unloaded -// CHECK:STDOUT: %import_ref.13: type = import_ref Main//action, inst+39, loaded [template = constants.%A] -// CHECK:STDOUT: %import_ref.14: type = import_ref Main//action, inst+42, loaded [template = constants.%Action.type.3] -// CHECK:STDOUT: %import_ref.15 = import_ref Main//action, inst+53, unloaded -// CHECK:STDOUT: %import_ref.16 = import_ref Main//action, inst+45, unloaded -// CHECK:STDOUT: %import_ref.17 = import_ref Main//action, inst+16, unloaded -// CHECK:STDOUT: %import_ref.19: = import_ref Main//action, inst+38, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.20 = import_ref Main//action, inst+37, unloaded +// CHECK:STDOUT: %import_ref.1: %Action.type.1 = import_ref Main//action, Action, loaded [template = constants.%Action.generic] +// CHECK:STDOUT: %import_ref.2: type = import_ref Main//action, A, loaded [template = constants.%A] +// CHECK:STDOUT: %import_ref.3 = import_ref Main//action, B, unloaded +// CHECK:STDOUT: %import_ref.4: type = import_ref Main//action, C, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.5 = import_ref Main//action, F, unloaded +// CHECK:STDOUT: %import_ref.6: = import_ref Main//action, loc9_10, loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.7 = import_ref Main//action, inst46 [no loc], unloaded +// CHECK:STDOUT: %import_ref.8 = import_ref Main//action, inst26 [no loc], unloaded +// CHECK:STDOUT: %import_ref.9: @Action.%Op.assoc_type (%Op.assoc_type.1) = import_ref Main//action, loc5_10, loaded [symbolic = @Action.%assoc0 (constants.%assoc0.4)] +// CHECK:STDOUT: %import_ref.10 = import_ref Main//action, Op, unloaded +// CHECK:STDOUT: %import_ref.11: = import_ref Main//action, loc8_10, loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.12 = import_ref Main//action, inst41 [no loc], unloaded +// CHECK:STDOUT: %import_ref.13: type = import_ref Main//action, loc12_6, loaded [template = constants.%A] +// CHECK:STDOUT: %import_ref.14: type = import_ref Main//action, loc12_19, loaded [template = constants.%Action.type.3] +// CHECK:STDOUT: %import_ref.15 = import_ref Main//action, loc12_21, unloaded +// CHECK:STDOUT: %import_ref.16 = import_ref Main//action, loc13_11, unloaded +// CHECK:STDOUT: %import_ref.17 = import_ref Main//action, loc5_10, unloaded +// CHECK:STDOUT: %import_ref.19: = import_ref Main//action, loc10_10, loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.20 = import_ref Main//action, inst49 [no loc], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -764,21 +764,21 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Factory.type.1 = import_ref Main//factory, inst+7, loaded [template = constants.%Factory.generic] -// CHECK:STDOUT: %import_ref.2: type = import_ref Main//factory, inst+34, loaded [template = constants.%A] -// CHECK:STDOUT: %import_ref.3: type = import_ref Main//factory, inst+39, loaded [template = constants.%B] -// CHECK:STDOUT: %import_ref.4: = import_ref Main//factory, inst+41, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.5 = import_ref Main//factory, inst+40, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Main//factory, inst+14, unloaded -// CHECK:STDOUT: %import_ref.7: @Factory.%Make.assoc_type (%Make.assoc_type.1) = import_ref Main//factory, inst+26, loaded [symbolic = @Factory.%assoc0 (constants.%assoc0.3)] -// CHECK:STDOUT: %import_ref.8 = import_ref Main//factory, inst+21, unloaded -// CHECK:STDOUT: %import_ref.9: = import_ref Main//factory, inst+37, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.10 = import_ref Main//factory, inst+35, unloaded -// CHECK:STDOUT: %import_ref.11: type = import_ref Main//factory, inst+42, loaded [template = constants.%A] -// CHECK:STDOUT: %import_ref.12: type = import_ref Main//factory, inst+45, loaded [template = constants.%Factory.type.3] -// CHECK:STDOUT: %import_ref.13: = import_ref Main//factory, inst+61, loaded [template = constants.%interface] -// CHECK:STDOUT: %import_ref.14 = import_ref Main//factory, inst+53, unloaded -// CHECK:STDOUT: %import_ref.15 = import_ref Main//factory, inst+21, unloaded +// CHECK:STDOUT: %import_ref.1: %Factory.type.1 = import_ref Main//factory, Factory, loaded [template = constants.%Factory.generic] +// CHECK:STDOUT: %import_ref.2: type = import_ref Main//factory, A, loaded [template = constants.%A] +// CHECK:STDOUT: %import_ref.3: type = import_ref Main//factory, B, loaded [template = constants.%B] +// CHECK:STDOUT: %import_ref.4: = import_ref Main//factory, loc9_10, loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.5 = import_ref Main//factory, inst52 [no loc], unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Main//factory, inst26 [no loc], unloaded +// CHECK:STDOUT: %import_ref.7: @Factory.%Make.assoc_type (%Make.assoc_type.1) = import_ref Main//factory, loc5_17, loaded [symbolic = @Factory.%assoc0 (constants.%assoc0.3)] +// CHECK:STDOUT: %import_ref.8 = import_ref Main//factory, Make, unloaded +// CHECK:STDOUT: %import_ref.9: = import_ref Main//factory, loc8_10, loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.10 = import_ref Main//factory, inst47 [no loc], unloaded +// CHECK:STDOUT: %import_ref.11: type = import_ref Main//factory, loc11_6, loaded [template = constants.%A] +// CHECK:STDOUT: %import_ref.12: type = import_ref Main//factory, loc11_20, loaded [template = constants.%Factory.type.3] +// CHECK:STDOUT: %import_ref.13: = import_ref Main//factory, loc11_22, loaded [template = constants.%interface] +// CHECK:STDOUT: %import_ref.14 = import_ref Main//factory, loc12_17, unloaded +// CHECK:STDOUT: %import_ref.15 = import_ref Main//factory, loc5_17, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -926,21 +926,21 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Factory.type.1 = import_ref Main//factory, inst+7, loaded [template = constants.%Factory.generic] -// CHECK:STDOUT: %import_ref.2: type = import_ref Main//factory, inst+34, loaded [template = constants.%A] -// CHECK:STDOUT: %import_ref.3 = import_ref Main//factory, inst+39, unloaded -// CHECK:STDOUT: %import_ref.4: = import_ref Main//factory, inst+41, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.5 = import_ref Main//factory, inst+40, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Main//factory, inst+14, unloaded -// CHECK:STDOUT: %import_ref.7: @Factory.%Make.assoc_type (%Make.assoc_type.1) = import_ref Main//factory, inst+26, loaded [symbolic = @Factory.%assoc0 (constants.%assoc0.4)] -// CHECK:STDOUT: %import_ref.8 = import_ref Main//factory, inst+21, unloaded -// CHECK:STDOUT: %import_ref.9: = import_ref Main//factory, inst+37, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.10 = import_ref Main//factory, inst+35, unloaded -// CHECK:STDOUT: %import_ref.11: type = import_ref Main//factory, inst+42, loaded [template = constants.%A] -// CHECK:STDOUT: %import_ref.12: type = import_ref Main//factory, inst+45, loaded [template = constants.%Factory.type.3] -// CHECK:STDOUT: %import_ref.13 = import_ref Main//factory, inst+61, unloaded -// CHECK:STDOUT: %import_ref.14 = import_ref Main//factory, inst+53, unloaded -// CHECK:STDOUT: %import_ref.15 = import_ref Main//factory, inst+21, unloaded +// CHECK:STDOUT: %import_ref.1: %Factory.type.1 = import_ref Main//factory, Factory, loaded [template = constants.%Factory.generic] +// CHECK:STDOUT: %import_ref.2: type = import_ref Main//factory, A, loaded [template = constants.%A] +// CHECK:STDOUT: %import_ref.3 = import_ref Main//factory, B, unloaded +// CHECK:STDOUT: %import_ref.4: = import_ref Main//factory, loc9_10, loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.5 = import_ref Main//factory, inst52 [no loc], unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Main//factory, inst26 [no loc], unloaded +// CHECK:STDOUT: %import_ref.7: @Factory.%Make.assoc_type (%Make.assoc_type.1) = import_ref Main//factory, loc5_17, loaded [symbolic = @Factory.%assoc0 (constants.%assoc0.4)] +// CHECK:STDOUT: %import_ref.8 = import_ref Main//factory, Make, unloaded +// CHECK:STDOUT: %import_ref.9: = import_ref Main//factory, loc8_10, loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.10 = import_ref Main//factory, inst47 [no loc], unloaded +// CHECK:STDOUT: %import_ref.11: type = import_ref Main//factory, loc11_6, loaded [template = constants.%A] +// CHECK:STDOUT: %import_ref.12: type = import_ref Main//factory, loc11_20, loaded [template = constants.%Factory.type.3] +// CHECK:STDOUT: %import_ref.13 = import_ref Main//factory, loc11_22, unloaded +// CHECK:STDOUT: %import_ref.14 = import_ref Main//factory, loc12_17, unloaded +// CHECK:STDOUT: %import_ref.15 = import_ref Main//factory, loc5_17, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/impl/no_prelude/no_definition_in_impl_file.carbon b/toolchain/check/testdata/impl/no_prelude/no_definition_in_impl_file.carbon index a4f9d4891bb65..c5a0859cbfba3 100644 --- a/toolchain/check/testdata/impl/no_prelude/no_definition_in_impl_file.carbon +++ b/toolchain/check/testdata/impl/no_prelude/no_definition_in_impl_file.carbon @@ -118,10 +118,10 @@ impl () as D; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Main//decl_in_api_definition_in_impl, inst+1, loaded [template = constants.%A.type] -// CHECK:STDOUT: %import_ref.2 = import_ref Main//decl_in_api_definition_in_impl, inst+3, unloaded -// CHECK:STDOUT: %import_ref.3: type = import_ref Main//decl_in_api_definition_in_impl, inst+7, loaded [template = constants.%empty_tuple.type] -// CHECK:STDOUT: %import_ref.4: type = import_ref Main//decl_in_api_definition_in_impl, inst+8, loaded [template = constants.%A.type] +// CHECK:STDOUT: %import_ref.1: type = import_ref Main//decl_in_api_definition_in_impl, A, loaded [template = constants.%A.type] +// CHECK:STDOUT: %import_ref.2 = import_ref Main//decl_in_api_definition_in_impl, inst15 [no loc], unloaded +// CHECK:STDOUT: %import_ref.3: type = import_ref Main//decl_in_api_definition_in_impl, loc6_7, loaded [template = constants.%empty_tuple.type] +// CHECK:STDOUT: %import_ref.4: type = import_ref Main//decl_in_api_definition_in_impl, loc6_12, loaded [template = constants.%A.type] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -164,7 +164,7 @@ impl () as D; // CHECK:STDOUT: --- use_decl_in_api.impl.carbon // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref = import_ref Main//decl_in_api_definition_in_impl, inst+1, unloaded +// CHECK:STDOUT: %import_ref = import_ref Main//decl_in_api_definition_in_impl, A, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -213,10 +213,10 @@ impl () as D; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1 = import_ref Main//decl_only_in_api, inst+1, unloaded -// CHECK:STDOUT: %import_ref.2 = import_ref Main//decl_only_in_api, inst+3, unloaded -// CHECK:STDOUT: %import_ref.3: type = import_ref Main//decl_only_in_api, inst+7, loaded [template = constants.%empty_tuple.type] -// CHECK:STDOUT: %import_ref.4: type = import_ref Main//decl_only_in_api, inst+8, loaded [template = constants.%B.type] +// CHECK:STDOUT: %import_ref.1 = import_ref Main//decl_only_in_api, B, unloaded +// CHECK:STDOUT: %import_ref.2 = import_ref Main//decl_only_in_api, inst15 [no loc], unloaded +// CHECK:STDOUT: %import_ref.3: type = import_ref Main//decl_only_in_api, loc6_7, loaded [template = constants.%empty_tuple.type] +// CHECK:STDOUT: %import_ref.4: type = import_ref Main//decl_only_in_api, loc6_12, loaded [template = constants.%B.type] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -273,10 +273,10 @@ impl () as D; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Main//decl_in_api_decl_in_impl, inst+1, loaded [template = constants.%C.type] -// CHECK:STDOUT: %import_ref.2 = import_ref Main//decl_in_api_decl_in_impl, inst+3, unloaded -// CHECK:STDOUT: %import_ref.3: type = import_ref Main//decl_in_api_decl_in_impl, inst+7, loaded [template = constants.%empty_tuple.type] -// CHECK:STDOUT: %import_ref.4: type = import_ref Main//decl_in_api_decl_in_impl, inst+8, loaded [template = constants.%C.type] +// CHECK:STDOUT: %import_ref.1: type = import_ref Main//decl_in_api_decl_in_impl, C, loaded [template = constants.%C.type] +// CHECK:STDOUT: %import_ref.2 = import_ref Main//decl_in_api_decl_in_impl, inst15 [no loc], unloaded +// CHECK:STDOUT: %import_ref.3: type = import_ref Main//decl_in_api_decl_in_impl, loc6_7, loaded [template = constants.%empty_tuple.type] +// CHECK:STDOUT: %import_ref.4: type = import_ref Main//decl_in_api_decl_in_impl, loc6_12, loaded [template = constants.%C.type] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/interface/no_prelude/export_name.carbon b/toolchain/check/testdata/interface/no_prelude/export_name.carbon index 4e8686a1a78d1..37d2fd6ddcadf 100644 --- a/toolchain/check/testdata/interface/no_prelude/export_name.carbon +++ b/toolchain/check/testdata/interface/no_prelude/export_name.carbon @@ -67,8 +67,8 @@ fn UseEmpty(i: I) {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Main//base, inst+1, loaded [template = constants.%I.type] -// CHECK:STDOUT: %import_ref.2 = import_ref Main//base, inst+3, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Main//base, I, loaded [template = constants.%I.type] +// CHECK:STDOUT: %import_ref.2 = import_ref Main//base, inst15 [no loc], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -94,8 +94,8 @@ fn UseEmpty(i: I) {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Main//export, inst+7, loaded [template = constants.%I.type] -// CHECK:STDOUT: %import_ref.2 = import_ref Main//export, inst+6, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Main//export, I, loaded [template = constants.%I.type] +// CHECK:STDOUT: %import_ref.2 = import_ref Main//export, inst18 [indirect], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/interface/no_prelude/fail_assoc_const_not_binding.carbon b/toolchain/check/testdata/interface/no_prelude/fail_assoc_const_not_binding.carbon index 8225295d2af4e..1667a902d5021 100644 --- a/toolchain/check/testdata/interface/no_prelude/fail_assoc_const_not_binding.carbon +++ b/toolchain/check/testdata/interface/no_prelude/fail_assoc_const_not_binding.carbon @@ -24,7 +24,7 @@ interface I { // CHECK:STDOUT: // CHECK:STDOUT: interface @I { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = .inst+3 +// CHECK:STDOUT: .Self = .inst15 // CHECK:STDOUT: witness = invalid // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interface/no_prelude/fail_assoc_const_template.carbon b/toolchain/check/testdata/interface/no_prelude/fail_assoc_const_template.carbon index 6c53d318c6bc5..1cd44210feb9d 100644 --- a/toolchain/check/testdata/interface/no_prelude/fail_assoc_const_template.carbon +++ b/toolchain/check/testdata/interface/no_prelude/fail_assoc_const_template.carbon @@ -24,7 +24,7 @@ interface I { // CHECK:STDOUT: // CHECK:STDOUT: interface @I { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = .inst+3 +// CHECK:STDOUT: .Self = .inst15 // CHECK:STDOUT: witness = invalid // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interface/no_prelude/fail_definition_imported.carbon b/toolchain/check/testdata/interface/no_prelude/fail_definition_imported.carbon index d6125d785617d..9bb021a516f1f 100644 --- a/toolchain/check/testdata/interface/no_prelude/fail_definition_imported.carbon +++ b/toolchain/check/testdata/interface/no_prelude/fail_definition_imported.carbon @@ -52,7 +52,7 @@ interface I {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref: type = import_ref Main//a, inst+1, loaded [template = constants.%I.type] +// CHECK:STDOUT: %import_ref: type = import_ref Main//a, I, loaded [template = constants.%I.type] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/interface/no_prelude/generic_import.carbon b/toolchain/check/testdata/interface/no_prelude/generic_import.carbon index a8bd80179ce48..3cc00a6da9e8a 100644 --- a/toolchain/check/testdata/interface/no_prelude/generic_import.carbon +++ b/toolchain/check/testdata/interface/no_prelude/generic_import.carbon @@ -124,11 +124,11 @@ impl C as AddWith(C) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %AddWith.type.1 = import_ref Main//a, inst+7, loaded [template = constants.%AddWith.generic] -// CHECK:STDOUT: %import_ref.2 = import_ref Main//a, inst+14, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref Main//a, inst+20, unloaded -// CHECK:STDOUT: %import_ref.4: @AddWith.%F.type (%F.type.1) = import_ref Main//a, inst+16, loaded [symbolic = @AddWith.%F (constants.%F.1)] -// CHECK:STDOUT: %import_ref.5 = import_ref Main//a, inst+16, unloaded +// CHECK:STDOUT: %import_ref.1: %AddWith.type.1 = import_ref Main//a, AddWith, loaded [template = constants.%AddWith.generic] +// CHECK:STDOUT: %import_ref.2 = import_ref Main//a, inst26 [no loc], unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref Main//a, loc5_9, unloaded +// CHECK:STDOUT: %import_ref.4: @AddWith.%F.type (%F.type.1) = import_ref Main//a, F, loaded [symbolic = @AddWith.%F (constants.%F.1)] +// CHECK:STDOUT: %import_ref.5 = import_ref Main//a, loc5_9, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/interface/no_prelude/import.carbon b/toolchain/check/testdata/interface/no_prelude/import.carbon index 69dd6f58b6fb9..81e7cd28392e4 100644 --- a/toolchain/check/testdata/interface/no_prelude/import.carbon +++ b/toolchain/check/testdata/interface/no_prelude/import.carbon @@ -167,21 +167,21 @@ var f: ForwardDeclared* = &f_ref.f; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Main//a, inst+1, loaded [template = constants.%Empty.type] -// CHECK:STDOUT: %import_ref.2: type = import_ref Main//a, inst+5, loaded [template = constants.%Basic.type] -// CHECK:STDOUT: %import_ref.3: type = import_ref Main//a, inst+20, loaded [template = constants.%ForwardDeclared.type] -// CHECK:STDOUT: %import_ref.4: ref %struct_type.f.1 = import_ref Main//a, inst+39, loaded -// CHECK:STDOUT: %import_ref.5 = import_ref Main//a, inst+3, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Main//a, inst+7, unloaded -// CHECK:STDOUT: %import_ref.7: %assoc_type.1 = import_ref Main//a, inst+11, loaded [template = constants.%assoc0.1] -// CHECK:STDOUT: %import_ref.8: %F.assoc_type.1 = import_ref Main//a, inst+18, loaded [template = constants.%assoc1.1] -// CHECK:STDOUT: %import_ref.9 = import_ref Main//a, inst+9, unloaded -// CHECK:STDOUT: %import_ref.10 = import_ref Main//a, inst+13, unloaded -// CHECK:STDOUT: %import_ref.11 = import_ref Main//a, inst+22, unloaded -// CHECK:STDOUT: %import_ref.12: %assoc_type.2 = import_ref Main//a, inst+26, loaded [template = constants.%assoc0.2] -// CHECK:STDOUT: %import_ref.13: %F.assoc_type.2 = import_ref Main//a, inst+32, loaded [template = constants.%assoc1.2] -// CHECK:STDOUT: %import_ref.14 = import_ref Main//a, inst+24, unloaded -// CHECK:STDOUT: %import_ref.15 = import_ref Main//a, inst+28, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Main//a, Empty, loaded [template = constants.%Empty.type] +// CHECK:STDOUT: %import_ref.2: type = import_ref Main//a, Basic, loaded [template = constants.%Basic.type] +// CHECK:STDOUT: %import_ref.3: type = import_ref Main//a, ForwardDeclared, loaded [template = constants.%ForwardDeclared.type] +// CHECK:STDOUT: %import_ref.4: ref %struct_type.f.1 = import_ref Main//a, f_ref, loaded +// CHECK:STDOUT: %import_ref.5 = import_ref Main//a, inst15 [no loc], unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Main//a, inst19 [no loc], unloaded +// CHECK:STDOUT: %import_ref.7: %assoc_type.1 = import_ref Main//a, loc8_15, loaded [template = constants.%assoc0.1] +// CHECK:STDOUT: %import_ref.8: %F.assoc_type.1 = import_ref Main//a, loc9_9, loaded [template = constants.%assoc1.1] +// CHECK:STDOUT: %import_ref.9 = import_ref Main//a, T, unloaded +// CHECK:STDOUT: %import_ref.10 = import_ref Main//a, F, unloaded +// CHECK:STDOUT: %import_ref.11 = import_ref Main//a, inst34 [no loc], unloaded +// CHECK:STDOUT: %import_ref.12: %assoc_type.2 = import_ref Main//a, loc16_15, loaded [template = constants.%assoc0.2] +// CHECK:STDOUT: %import_ref.13: %F.assoc_type.2 = import_ref Main//a, loc17_9, loaded [template = constants.%assoc1.2] +// CHECK:STDOUT: %import_ref.14 = import_ref Main//a, T, unloaded +// CHECK:STDOUT: %import_ref.15 = import_ref Main//a, F, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/interface/no_prelude/import_access.carbon b/toolchain/check/testdata/interface/no_prelude/import_access.carbon index 380ca946b9062..45b32127ed2cd 100644 --- a/toolchain/check/testdata/interface/no_prelude/import_access.carbon +++ b/toolchain/check/testdata/interface/no_prelude/import_access.carbon @@ -200,8 +200,8 @@ private interface Redecl {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Test//def, inst+1, loaded [template = constants.%Def.type] -// CHECK:STDOUT: %import_ref.2 = import_ref Test//def, inst+3, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Test//def, Def, loaded [template = constants.%Def.type] +// CHECK:STDOUT: %import_ref.2 = import_ref Test//def, inst15 [no loc], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -303,8 +303,8 @@ private interface Redecl {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Test//forward_with_def, inst+1, loaded [template = constants.%ForwardWithDef.type] -// CHECK:STDOUT: %import_ref.2 = import_ref Test//forward_with_def, inst+4, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Test//forward_with_def, ForwardWithDef, loaded [template = constants.%ForwardWithDef.type] +// CHECK:STDOUT: %import_ref.2 = import_ref Test//forward_with_def, inst16 [no loc], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/interface/no_prelude/import_interface_decl.carbon b/toolchain/check/testdata/interface/no_prelude/import_interface_decl.carbon index 11da3f1090b9f..e8e5697089c14 100644 --- a/toolchain/check/testdata/interface/no_prelude/import_interface_decl.carbon +++ b/toolchain/check/testdata/interface/no_prelude/import_interface_decl.carbon @@ -48,9 +48,9 @@ impl library "[[@TEST_NAME]]"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1 = import_ref Main//a, inst+1, unloaded -// CHECK:STDOUT: %import_ref.2: type = import_ref Main//a, inst+5, loaded [template = constants.%empty_tuple.type] -// CHECK:STDOUT: %import_ref.3: type = import_ref Main//a, inst+6, loaded [template = constants.%A.type] +// CHECK:STDOUT: %import_ref.1 = import_ref Main//a, A, unloaded +// CHECK:STDOUT: %import_ref.2: type = import_ref Main//a, loc3_7, loaded [template = constants.%empty_tuple.type] +// CHECK:STDOUT: %import_ref.3: type = import_ref Main//a, loc3_12, loaded [template = constants.%A.type] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/interface/no_prelude/syntactic_merge.carbon b/toolchain/check/testdata/interface/no_prelude/syntactic_merge.carbon index ffe95393a6e85..1720f5ea25200 100644 --- a/toolchain/check/testdata/interface/no_prelude/syntactic_merge.carbon +++ b/toolchain/check/testdata/interface/no_prelude/syntactic_merge.carbon @@ -639,12 +639,12 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Main//two_file, inst+1, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2: type = import_ref Main//two_file, inst+7, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.3: %Foo.type = import_ref Main//two_file, inst+15, loaded [template = constants.%Foo.generic] -// CHECK:STDOUT: %import_ref.4: %Bar.type = import_ref Main//two_file, inst+26, loaded [template = constants.%Bar.generic] -// CHECK:STDOUT: %import_ref.5: = import_ref Main//two_file, inst+4, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.6 = import_ref Main//two_file, inst+2, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Main//two_file, C, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2: type = import_ref Main//two_file, D, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.3: %Foo.type = import_ref Main//two_file, Foo, loaded [template = constants.%Foo.generic] +// CHECK:STDOUT: %import_ref.4: %Bar.type = import_ref Main//two_file, Bar, loaded [template = constants.%Bar.generic] +// CHECK:STDOUT: %import_ref.5: = import_ref Main//two_file, loc4_10, loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.6 = import_ref Main//two_file, inst14 [no loc], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -1095,10 +1095,10 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Main//alias_two_file, inst+1, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2: %Foo.type = import_ref Main//alias_two_file, inst+13, loaded [template = constants.%Foo.generic] -// CHECK:STDOUT: %import_ref.3: = import_ref Main//alias_two_file, inst+4, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.4 = import_ref Main//alias_two_file, inst+2, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Main//alias_two_file, C, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2: %Foo.type = import_ref Main//alias_two_file, Foo, loaded [template = constants.%Foo.generic] +// CHECK:STDOUT: %import_ref.3: = import_ref Main//alias_two_file, loc4_10, loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.4 = import_ref Main//alias_two_file, inst14 [no loc], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/let/fail_generic_import.carbon b/toolchain/check/testdata/let/fail_generic_import.carbon index 1411f7ed6a18d..48966f1972ad3 100644 --- a/toolchain/check/testdata/let/fail_generic_import.carbon +++ b/toolchain/check/testdata/let/fail_generic_import.carbon @@ -70,7 +70,7 @@ let a: T = 0; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref: type = import_ref Implicit//default, inst+3, loaded +// CHECK:STDOUT: %import_ref: type = import_ref Implicit//default, T, loaded // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... diff --git a/toolchain/check/testdata/let/generic_import.carbon b/toolchain/check/testdata/let/generic_import.carbon index b389b5e221c0c..838c6909ffd89 100644 --- a/toolchain/check/testdata/let/generic_import.carbon +++ b/toolchain/check/testdata/let/generic_import.carbon @@ -70,7 +70,7 @@ var b: T = *a; // CHECK:STDOUT: --- fail_implicit.impl.carbon // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref: type = import_ref Implicit//default, inst+3, loaded +// CHECK:STDOUT: %import_ref: type = import_ref Implicit//default, T, loaded // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... diff --git a/toolchain/check/testdata/let/no_prelude/import.carbon b/toolchain/check/testdata/let/no_prelude/import.carbon index 56fdc5a4f3068..49df73b454f28 100644 --- a/toolchain/check/testdata/let/no_prelude/import.carbon +++ b/toolchain/check/testdata/let/no_prelude/import.carbon @@ -63,7 +63,7 @@ let b: () = Other.a; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref: %empty_tuple.type = import_ref Implicit//default, inst+4, loaded +// CHECK:STDOUT: %import_ref: %empty_tuple.type = import_ref Implicit//default, a, loaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -119,7 +119,7 @@ let b: () = Other.a; // CHECK:STDOUT: .a = %import_ref // CHECK:STDOUT: import Other//default // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref: %empty_tuple.type = import_ref Other//default, inst+4, loaded +// CHECK:STDOUT: %import_ref: %empty_tuple.type = import_ref Other//default, a, loaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/let/no_prelude/import_access.carbon b/toolchain/check/testdata/let/no_prelude/import_access.carbon index 9d7e9bb94a8af..c4b130539c577 100644 --- a/toolchain/check/testdata/let/no_prelude/import_access.carbon +++ b/toolchain/check/testdata/let/no_prelude/import_access.carbon @@ -82,7 +82,7 @@ let v2: () = Test.v; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref: %empty_tuple.type = import_ref Test//def, inst+4, loaded +// CHECK:STDOUT: %import_ref: %empty_tuple.type = import_ref Test//def, v, loaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/namespace/add_to_import.carbon b/toolchain/check/testdata/namespace/add_to_import.carbon index 51856f93046af..cf9853baa893b 100644 --- a/toolchain/check/testdata/namespace/add_to_import.carbon +++ b/toolchain/check/testdata/namespace/add_to_import.carbon @@ -60,7 +60,7 @@ var a: i32 = NS.A(); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: = import_ref Implicit//default, inst+3, loaded +// CHECK:STDOUT: %import_ref.1: = import_ref Implicit//default, NS, loaded // CHECK:STDOUT: %NS: = namespace %import_ref.1, [template] { // CHECK:STDOUT: .A = file.%A.decl // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/namespace/fail_conflict_after_merge.carbon b/toolchain/check/testdata/namespace/fail_conflict_after_merge.carbon index e7fa6f72d2df7..e5d9693c74247 100644 --- a/toolchain/check/testdata/namespace/fail_conflict_after_merge.carbon +++ b/toolchain/check/testdata/namespace/fail_conflict_after_merge.carbon @@ -75,7 +75,7 @@ fn NS(); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref: = import_ref Example//namespace, inst+3, loaded +// CHECK:STDOUT: %import_ref: = import_ref Example//namespace, NS, loaded // CHECK:STDOUT: %NS: = namespace %import_ref, [template] {} // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude diff --git a/toolchain/check/testdata/namespace/fail_conflict_imported_namespace_first.carbon b/toolchain/check/testdata/namespace/fail_conflict_imported_namespace_first.carbon index f7011a5e62738..9e5df72064b0e 100644 --- a/toolchain/check/testdata/namespace/fail_conflict_imported_namespace_first.carbon +++ b/toolchain/check/testdata/namespace/fail_conflict_imported_namespace_first.carbon @@ -59,7 +59,7 @@ fn NS.Foo(); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref: = import_ref Example//namespace, inst+3, loaded +// CHECK:STDOUT: %import_ref: = import_ref Example//namespace, NS, loaded // CHECK:STDOUT: %NS: = namespace %import_ref, [template] { // CHECK:STDOUT: .Foo = file.%Foo.decl // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/namespace/fail_conflict_imported_namespace_nested.carbon b/toolchain/check/testdata/namespace/fail_conflict_imported_namespace_nested.carbon index efb2c492d70a5..e3dca5294bd7b 100644 --- a/toolchain/check/testdata/namespace/fail_conflict_imported_namespace_nested.carbon +++ b/toolchain/check/testdata/namespace/fail_conflict_imported_namespace_nested.carbon @@ -67,7 +67,7 @@ fn Other.Nested.F(); // CHECK:STDOUT: .Nested = %Nested // CHECK:STDOUT: import Other//default // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref: = import_ref Other//default, inst+3, loaded +// CHECK:STDOUT: %import_ref: = import_ref Other//default, Nested, loaded // CHECK:STDOUT: %Nested: = namespace %import_ref, [template] { // CHECK:STDOUT: .F = file.%F.decl // CHECK:STDOUT: import Other//default diff --git a/toolchain/check/testdata/namespace/fail_conflict_imported_namespace_second.carbon b/toolchain/check/testdata/namespace/fail_conflict_imported_namespace_second.carbon index 78142ba3bab0c..d5197d93a95c8 100644 --- a/toolchain/check/testdata/namespace/fail_conflict_imported_namespace_second.carbon +++ b/toolchain/check/testdata/namespace/fail_conflict_imported_namespace_second.carbon @@ -74,7 +74,7 @@ fn NS.Foo(); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref: %NS.type = import_ref Example//fn, inst+3, loaded [template = constants.%NS] +// CHECK:STDOUT: %import_ref: %NS.type = import_ref Example//fn, NS, loaded [template = constants.%NS] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... diff --git a/toolchain/check/testdata/namespace/fail_conflict_in_imports_namespace_first.carbon b/toolchain/check/testdata/namespace/fail_conflict_in_imports_namespace_first.carbon index 4b281701683e2..48b4b6fab8923 100644 --- a/toolchain/check/testdata/namespace/fail_conflict_in_imports_namespace_first.carbon +++ b/toolchain/check/testdata/namespace/fail_conflict_in_imports_namespace_first.carbon @@ -105,7 +105,7 @@ fn NS.Bar() {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: = import_ref Example//namespace, inst+3, loaded +// CHECK:STDOUT: %import_ref.1: = import_ref Example//namespace, NS, loaded // CHECK:STDOUT: %NS: = namespace %import_ref.1, [template] { // CHECK:STDOUT: .Foo = %import_ref.2 // CHECK:STDOUT: .Bar = file.%Bar.decl diff --git a/toolchain/check/testdata/namespace/fail_conflict_in_imports_namespace_second.carbon b/toolchain/check/testdata/namespace/fail_conflict_in_imports_namespace_second.carbon index 16e552fea08ff..68d103eea18e1 100644 --- a/toolchain/check/testdata/namespace/fail_conflict_in_imports_namespace_second.carbon +++ b/toolchain/check/testdata/namespace/fail_conflict_in_imports_namespace_second.carbon @@ -105,7 +105,7 @@ fn NS.Bar() {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.2: = import_ref Example//namespace, inst+3, loaded +// CHECK:STDOUT: %import_ref.2: = import_ref Example//namespace, NS, loaded // CHECK:STDOUT: %NS: = namespace %import_ref.2, [template] { // CHECK:STDOUT: .Foo = %import_ref.3 // CHECK:STDOUT: .Bar = file.%Bar.decl diff --git a/toolchain/check/testdata/namespace/imported.carbon b/toolchain/check/testdata/namespace/imported.carbon index f641c5421eaad..47240ab4f1eaa 100644 --- a/toolchain/check/testdata/namespace/imported.carbon +++ b/toolchain/check/testdata/namespace/imported.carbon @@ -76,17 +76,17 @@ var package_b: () = package.NS.ChildNS.B(); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: = import_ref Implicit//default, inst+3, loaded +// CHECK:STDOUT: %import_ref.1: = import_ref Implicit//default, NS, loaded // CHECK:STDOUT: %NS: = namespace %import_ref.1, [template] { // CHECK:STDOUT: .A = %import_ref.2 // CHECK:STDOUT: .ChildNS = %ChildNS // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.2: %A.type = import_ref Implicit//default, inst+5, loaded [template = constants.%A] -// CHECK:STDOUT: %import_ref.3: = import_ref Implicit//default, inst+4, loaded +// CHECK:STDOUT: %import_ref.2: %A.type = import_ref Implicit//default, A, loaded [template = constants.%A] +// CHECK:STDOUT: %import_ref.3: = import_ref Implicit//default, ChildNS, loaded // CHECK:STDOUT: %ChildNS: = namespace %import_ref.3, [template] { // CHECK:STDOUT: .B = %import_ref.4 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.4: %B.type = import_ref Implicit//default, inst+9, loaded [template = constants.%B] +// CHECK:STDOUT: %import_ref.4: %B.type = import_ref Implicit//default, B, loaded [template = constants.%B] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... diff --git a/toolchain/check/testdata/namespace/imported_indirect.carbon b/toolchain/check/testdata/namespace/imported_indirect.carbon index b430ce7398487..55f62d06d9df8 100644 --- a/toolchain/check/testdata/namespace/imported_indirect.carbon +++ b/toolchain/check/testdata/namespace/imported_indirect.carbon @@ -63,7 +63,7 @@ var e: () = A.B.C.D(); // CHECK:STDOUT: --- b.carbon // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref: = import_ref Same//a, inst+3, loaded +// CHECK:STDOUT: %import_ref: = import_ref Same//a, A, loaded // CHECK:STDOUT: %A: = namespace %import_ref, [template] { // CHECK:STDOUT: .B = file.%B // CHECK:STDOUT: } @@ -86,7 +86,7 @@ var e: () = A.B.C.D(); // CHECK:STDOUT: --- c.carbon // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: = import_ref Same//b, inst+4, loaded +// CHECK:STDOUT: %import_ref.1: = import_ref Same//b, A, loaded // CHECK:STDOUT: %A: = namespace %import_ref.1, [template] { // CHECK:STDOUT: .B = %B // CHECK:STDOUT: } @@ -114,7 +114,7 @@ var e: () = A.B.C.D(); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: = import_ref Same//c, inst+4, loaded +// CHECK:STDOUT: %import_ref.1: = import_ref Same//c, A, loaded // CHECK:STDOUT: %A: = namespace %import_ref.1, [template] { // CHECK:STDOUT: .B = %B // CHECK:STDOUT: } @@ -148,19 +148,19 @@ var e: () = A.B.C.D(); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: = import_ref Same//d, inst+4, loaded +// CHECK:STDOUT: %import_ref.1: = import_ref Same//d, A, loaded // CHECK:STDOUT: %A: = namespace %import_ref.1, [template] { // CHECK:STDOUT: .B = %B // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.2: = import_ref Same//d, inst+6, loaded +// CHECK:STDOUT: %import_ref.2: = import_ref Same//d, B, loaded // CHECK:STDOUT: %B: = namespace %import_ref.2, [template] { // CHECK:STDOUT: .C = %C // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.3: = import_ref Same//d, inst+8, loaded +// CHECK:STDOUT: %import_ref.3: = import_ref Same//d, C, loaded // CHECK:STDOUT: %C: = namespace %import_ref.3, [template] { // CHECK:STDOUT: .D = %import_ref.4 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.4: %D.type = import_ref Same//d, inst+10, loaded [template = constants.%D] +// CHECK:STDOUT: %import_ref.4: %D.type = import_ref Same//d, D, loaded [template = constants.%D] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... diff --git a/toolchain/check/testdata/namespace/merging.carbon b/toolchain/check/testdata/namespace/merging.carbon index 71dd149977624..51495f244f9e8 100644 --- a/toolchain/check/testdata/namespace/merging.carbon +++ b/toolchain/check/testdata/namespace/merging.carbon @@ -138,16 +138,16 @@ fn Run() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: = import_ref Example//a, inst+3, loaded +// CHECK:STDOUT: %import_ref.1: = import_ref Example//a, NS, loaded // CHECK:STDOUT: %NS: = namespace %import_ref.1, [template] { // CHECK:STDOUT: .A = %import_ref.2 // CHECK:STDOUT: .B1 = %import_ref.3 // CHECK:STDOUT: .B2 = %import_ref.4 // CHECK:STDOUT: .C = file.%C.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.2: %A.type = import_ref Example//a, inst+4, loaded [template = constants.%A] -// CHECK:STDOUT: %import_ref.3: %B1.type = import_ref Example//b, inst+4, loaded [template = constants.%B1] -// CHECK:STDOUT: %import_ref.4: %B2.type = import_ref Example//b, inst+10, loaded [template = constants.%B2] +// CHECK:STDOUT: %import_ref.2: %A.type = import_ref Example//a, A, loaded [template = constants.%A] +// CHECK:STDOUT: %import_ref.3: %B1.type = import_ref Example//b, B1, loaded [template = constants.%B1] +// CHECK:STDOUT: %import_ref.4: %B2.type = import_ref Example//b, B2, loaded [template = constants.%B2] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... diff --git a/toolchain/check/testdata/namespace/merging_with_indirections.carbon b/toolchain/check/testdata/namespace/merging_with_indirections.carbon index fe46d95f24221..8ebf87f085328 100644 --- a/toolchain/check/testdata/namespace/merging_with_indirections.carbon +++ b/toolchain/check/testdata/namespace/merging_with_indirections.carbon @@ -89,18 +89,18 @@ fn Run() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: = import_ref Other//a, inst+3, loaded +// CHECK:STDOUT: %import_ref.1: = import_ref Other//a, NS1, loaded // CHECK:STDOUT: %NS1: = namespace %import_ref.1, [template] { // CHECK:STDOUT: .A = %import_ref.2 // CHECK:STDOUT: .B = file.%B.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.2: type = import_ref Other//a, inst+4, loaded [template = constants.%A] +// CHECK:STDOUT: %import_ref.2: type = import_ref Other//a, A, loaded [template = constants.%A] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.3: = import_ref Other//a, inst+7, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.4 = import_ref Other//a, inst+5, unloaded +// CHECK:STDOUT: %import_ref.3: = import_ref Other//a, loc5_14, loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.4 = import_ref Other//a, inst17 [no loc], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -172,16 +172,16 @@ fn Run() { // CHECK:STDOUT: import Other//b // CHECK:STDOUT: import Other//a // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: %F.type = import_ref Other//b, inst+23, loaded [template = constants.%F] -// CHECK:STDOUT: %import_ref.2: = import_ref Other//b, inst+16, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.3 = import_ref Other//b, inst+17, unloaded -// CHECK:STDOUT: %import_ref.4: = import_ref Other//b, inst+4, loaded +// CHECK:STDOUT: %import_ref.1: %F.type = import_ref Other//b, F, loaded [template = constants.%F] +// CHECK:STDOUT: %import_ref.2: = import_ref Other//b, inst28 [indirect], loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.3 = import_ref Other//b, inst29 [indirect], unloaded +// CHECK:STDOUT: %import_ref.4: = import_ref Other//b, NS1, loaded // CHECK:STDOUT: %NS1: = namespace %import_ref.4, [template] { // CHECK:STDOUT: .A = %import_ref.5 // CHECK:STDOUT: import Other//b // CHECK:STDOUT: import Other//a // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.5: type = import_ref Other//a, inst+4, loaded [template = constants.%A] +// CHECK:STDOUT: %import_ref.5: type = import_ref Other//a, A, loaded [template = constants.%A] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/operators/builtin/fail_and_or_not_in_function.carbon b/toolchain/check/testdata/operators/builtin/fail_and_or_not_in_function.carbon index 34c894edf679b..ae935e0852f8a 100644 --- a/toolchain/check/testdata/operators/builtin/fail_and_or_not_in_function.carbon +++ b/toolchain/check/testdata/operators/builtin/fail_and_or_not_in_function.carbon @@ -59,7 +59,7 @@ var or_: F(true or true); // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: %.loc42_17: bool = block_arg [template = constants.%true] -// CHECK:STDOUT: %F.call: init type = call .inst+73.loc42_10(%.loc42_17) +// CHECK:STDOUT: %F.call: init type = call .inst85.loc42_10(%.loc42_17) // CHECK:STDOUT: %.loc42_24.1: type = value_of_initializer %F.call // CHECK:STDOUT: %.loc42_24.2: type = converted %F.call, %.loc42_24.1 // CHECK:STDOUT: %or_.var: ref = var or_ @@ -68,7 +68,7 @@ var or_: F(true or true); // CHECK:STDOUT: // CHECK:STDOUT: fn @F(%b.param_patt: bool) -> type { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %b.ref: bool = name_ref b, .inst+13.loc12_6 +// CHECK:STDOUT: %b.ref: bool = name_ref b, .inst25.loc12_6 // CHECK:STDOUT: if %b.ref br !if.expr.then else br !if.expr.else // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then: diff --git a/toolchain/check/testdata/operators/overloaded/add.carbon b/toolchain/check/testdata/operators/overloaded/add.carbon index 2eb0dca7d9cfd..210a583a1bbf7 100644 --- a/toolchain/check/testdata/operators/overloaded/add.carbon +++ b/toolchain/check/testdata/operators/overloaded/add.carbon @@ -63,8 +63,8 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/arithmetic, inst+1, loaded [template = constants.%Add.type] -// CHECK:STDOUT: %import_ref.5: type = import_ref Core//prelude/operators/arithmetic, inst+36, loaded [template = constants.%AddAssign.type] +// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/arithmetic, Add, loaded [template = constants.%Add.type] +// CHECK:STDOUT: %import_ref.5: type = import_ref Core//prelude/operators/arithmetic, AddAssign, loaded [template = constants.%AddAssign.type] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/operators/overloaded/bit_and.carbon b/toolchain/check/testdata/operators/overloaded/bit_and.carbon index ea1816f99559e..658d89f5cc9d1 100644 --- a/toolchain/check/testdata/operators/overloaded/bit_and.carbon +++ b/toolchain/check/testdata/operators/overloaded/bit_and.carbon @@ -63,8 +63,8 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/bitwise, inst+29, loaded [template = constants.%BitAnd.type] -// CHECK:STDOUT: %import_ref.5: type = import_ref Core//prelude/operators/bitwise, inst+63, loaded [template = constants.%BitAndAssign.type] +// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/bitwise, BitAnd, loaded [template = constants.%BitAnd.type] +// CHECK:STDOUT: %import_ref.5: type = import_ref Core//prelude/operators/bitwise, BitAndAssign, loaded [template = constants.%BitAndAssign.type] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/operators/overloaded/bit_complement.carbon b/toolchain/check/testdata/operators/overloaded/bit_complement.carbon index 39cdcd4ff0538..ccd42c22a5f06 100644 --- a/toolchain/check/testdata/operators/overloaded/bit_complement.carbon +++ b/toolchain/check/testdata/operators/overloaded/bit_complement.carbon @@ -46,7 +46,7 @@ fn TestOp(a: C) -> C { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/bitwise, inst+1, loaded [template = constants.%BitComplement.type] +// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/bitwise, BitComplement, loaded [template = constants.%BitComplement.type] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/operators/overloaded/bit_or.carbon b/toolchain/check/testdata/operators/overloaded/bit_or.carbon index 782ed5161e4af..b965a282d036d 100644 --- a/toolchain/check/testdata/operators/overloaded/bit_or.carbon +++ b/toolchain/check/testdata/operators/overloaded/bit_or.carbon @@ -63,8 +63,8 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/bitwise, inst+94, loaded [template = constants.%BitOr.type] -// CHECK:STDOUT: %import_ref.5: type = import_ref Core//prelude/operators/bitwise, inst+128, loaded [template = constants.%BitOrAssign.type] +// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/bitwise, BitOr, loaded [template = constants.%BitOr.type] +// CHECK:STDOUT: %import_ref.5: type = import_ref Core//prelude/operators/bitwise, BitOrAssign, loaded [template = constants.%BitOrAssign.type] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/operators/overloaded/bit_xor.carbon b/toolchain/check/testdata/operators/overloaded/bit_xor.carbon index d0babebda3918..b27d98183aa51 100644 --- a/toolchain/check/testdata/operators/overloaded/bit_xor.carbon +++ b/toolchain/check/testdata/operators/overloaded/bit_xor.carbon @@ -63,8 +63,8 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/bitwise, inst+159, loaded [template = constants.%BitXor.type] -// CHECK:STDOUT: %import_ref.5: type = import_ref Core//prelude/operators/bitwise, inst+193, loaded [template = constants.%BitXorAssign.type] +// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/bitwise, BitXor, loaded [template = constants.%BitXor.type] +// CHECK:STDOUT: %import_ref.5: type = import_ref Core//prelude/operators/bitwise, BitXorAssign, loaded [template = constants.%BitXorAssign.type] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/operators/overloaded/dec.carbon b/toolchain/check/testdata/operators/overloaded/dec.carbon index 8e6e96c41460e..8d3048c5f1c10 100644 --- a/toolchain/check/testdata/operators/overloaded/dec.carbon +++ b/toolchain/check/testdata/operators/overloaded/dec.carbon @@ -47,7 +47,7 @@ fn TestOp() { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/arithmetic, inst+183, loaded [template = constants.%Dec.type] +// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/arithmetic, Dec, loaded [template = constants.%Dec.type] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/operators/overloaded/div.carbon b/toolchain/check/testdata/operators/overloaded/div.carbon index 16ea0d7043a8c..d55dc3c3387b3 100644 --- a/toolchain/check/testdata/operators/overloaded/div.carbon +++ b/toolchain/check/testdata/operators/overloaded/div.carbon @@ -63,8 +63,8 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/arithmetic, inst+272, loaded [template = constants.%Div.type] -// CHECK:STDOUT: %import_ref.5: type = import_ref Core//prelude/operators/arithmetic, inst+306, loaded [template = constants.%DivAssign.type] +// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/arithmetic, Div, loaded [template = constants.%Div.type] +// CHECK:STDOUT: %import_ref.5: type = import_ref Core//prelude/operators/arithmetic, DivAssign, loaded [template = constants.%DivAssign.type] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/operators/overloaded/eq.carbon b/toolchain/check/testdata/operators/overloaded/eq.carbon index c18ed8d278f1e..f6d4e6d1666bc 100644 --- a/toolchain/check/testdata/operators/overloaded/eq.carbon +++ b/toolchain/check/testdata/operators/overloaded/eq.carbon @@ -111,7 +111,7 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/comparison, inst+3, loaded [template = constants.%Eq.type] +// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/comparison, Eq, loaded [template = constants.%Eq.type] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -381,7 +381,7 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/comparison, inst+3, loaded [template = constants.%Eq.type] +// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/comparison, Eq, loaded [template = constants.%Eq.type] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/operators/overloaded/fail_assign_non_ref.carbon b/toolchain/check/testdata/operators/overloaded/fail_assign_non_ref.carbon index b84d2365b18e0..32cb5bd17ee36 100644 --- a/toolchain/check/testdata/operators/overloaded/fail_assign_non_ref.carbon +++ b/toolchain/check/testdata/operators/overloaded/fail_assign_non_ref.carbon @@ -71,8 +71,8 @@ fn TestAddAssignNonRef(a: C, b: C) { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/arithmetic, inst+67, loaded [template = constants.%Inc.type] -// CHECK:STDOUT: %import_ref.5: type = import_ref Core//prelude/operators/arithmetic, inst+36, loaded [template = constants.%AddAssign.type] +// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/arithmetic, Inc, loaded [template = constants.%Inc.type] +// CHECK:STDOUT: %import_ref.5: type = import_ref Core//prelude/operators/arithmetic, AddAssign, loaded [template = constants.%AddAssign.type] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/operators/overloaded/fail_no_impl_for_arg.carbon b/toolchain/check/testdata/operators/overloaded/fail_no_impl_for_arg.carbon index bb42581c27eb7..99f27df7ac3bd 100644 --- a/toolchain/check/testdata/operators/overloaded/fail_no_impl_for_arg.carbon +++ b/toolchain/check/testdata/operators/overloaded/fail_no_impl_for_arg.carbon @@ -82,8 +82,8 @@ fn TestAssign(b: D) { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/arithmetic, inst+1, loaded [template = constants.%Add.type] -// CHECK:STDOUT: %import_ref.5: type = import_ref Core//prelude/operators/arithmetic, inst+36, loaded [template = constants.%AddAssign.type] +// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/arithmetic, Add, loaded [template = constants.%Add.type] +// CHECK:STDOUT: %import_ref.5: type = import_ref Core//prelude/operators/arithmetic, AddAssign, loaded [template = constants.%AddAssign.type] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/operators/overloaded/implicit_as.carbon b/toolchain/check/testdata/operators/overloaded/implicit_as.carbon index 18a34748765f2..3bd2c0270af34 100644 --- a/toolchain/check/testdata/operators/overloaded/implicit_as.carbon +++ b/toolchain/check/testdata/operators/overloaded/implicit_as.carbon @@ -77,7 +77,7 @@ fn Test() { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+56, loaded [template = constants.%ImplicitAs.generic] +// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, ImplicitAs, loaded [template = constants.%ImplicitAs.generic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/operators/overloaded/inc.carbon b/toolchain/check/testdata/operators/overloaded/inc.carbon index 0f3ac8a7c2e28..ff7d9a6b5ef8f 100644 --- a/toolchain/check/testdata/operators/overloaded/inc.carbon +++ b/toolchain/check/testdata/operators/overloaded/inc.carbon @@ -47,7 +47,7 @@ fn TestOp() { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/arithmetic, inst+67, loaded [template = constants.%Inc.type] +// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/arithmetic, Inc, loaded [template = constants.%Inc.type] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/operators/overloaded/index.carbon b/toolchain/check/testdata/operators/overloaded/index.carbon index 8fb61481efef3..b58034c271289 100644 --- a/toolchain/check/testdata/operators/overloaded/index.carbon +++ b/toolchain/check/testdata/operators/overloaded/index.carbon @@ -102,7 +102,7 @@ let x: i32 = c[0]; // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: %IndexWith.type.1 = import_ref Core//prelude/operators/index, inst+13, loaded [template = constants.%IndexWith.generic] +// CHECK:STDOUT: %import_ref.1: %IndexWith.type.1 = import_ref Core//prelude/operators/index, IndexWith, loaded [template = constants.%IndexWith.generic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -262,7 +262,7 @@ let x: i32 = c[0]; // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.2: %IndexWith.type.1 = import_ref Core//prelude/operators/index, inst+13, loaded [template = constants.%IndexWith.generic] +// CHECK:STDOUT: %import_ref.2: %IndexWith.type.1 = import_ref Core//prelude/operators/index, IndexWith, loaded [template = constants.%IndexWith.generic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -415,7 +415,7 @@ let x: i32 = c[0]; // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: %IndexWith.type.1 = import_ref Core//prelude/operators/index, inst+13, loaded [template = constants.%IndexWith.generic] +// CHECK:STDOUT: %import_ref.1: %IndexWith.type.1 = import_ref Core//prelude/operators/index, IndexWith, loaded [template = constants.%IndexWith.generic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/operators/overloaded/left_shift.carbon b/toolchain/check/testdata/operators/overloaded/left_shift.carbon index 12608d666f857..044e03779f168 100644 --- a/toolchain/check/testdata/operators/overloaded/left_shift.carbon +++ b/toolchain/check/testdata/operators/overloaded/left_shift.carbon @@ -63,8 +63,8 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/bitwise, inst+224, loaded [template = constants.%LeftShift.type] -// CHECK:STDOUT: %import_ref.5: type = import_ref Core//prelude/operators/bitwise, inst+258, loaded [template = constants.%LeftShiftAssign.type] +// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/bitwise, LeftShift, loaded [template = constants.%LeftShift.type] +// CHECK:STDOUT: %import_ref.5: type = import_ref Core//prelude/operators/bitwise, LeftShiftAssign, loaded [template = constants.%LeftShiftAssign.type] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/operators/overloaded/mod.carbon b/toolchain/check/testdata/operators/overloaded/mod.carbon index 78f7403175f65..f73b6d63b7505 100644 --- a/toolchain/check/testdata/operators/overloaded/mod.carbon +++ b/toolchain/check/testdata/operators/overloaded/mod.carbon @@ -63,8 +63,8 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/arithmetic, inst+337, loaded [template = constants.%Mod.type] -// CHECK:STDOUT: %import_ref.5: type = import_ref Core//prelude/operators/arithmetic, inst+371, loaded [template = constants.%ModAssign.type] +// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/arithmetic, Mod, loaded [template = constants.%Mod.type] +// CHECK:STDOUT: %import_ref.5: type = import_ref Core//prelude/operators/arithmetic, ModAssign, loaded [template = constants.%ModAssign.type] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/operators/overloaded/mul.carbon b/toolchain/check/testdata/operators/overloaded/mul.carbon index 33f998c3883f0..f013f13526c62 100644 --- a/toolchain/check/testdata/operators/overloaded/mul.carbon +++ b/toolchain/check/testdata/operators/overloaded/mul.carbon @@ -63,8 +63,8 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/arithmetic, inst+207, loaded [template = constants.%Mul.type] -// CHECK:STDOUT: %import_ref.5: type = import_ref Core//prelude/operators/arithmetic, inst+241, loaded [template = constants.%MulAssign.type] +// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/arithmetic, Mul, loaded [template = constants.%Mul.type] +// CHECK:STDOUT: %import_ref.5: type = import_ref Core//prelude/operators/arithmetic, MulAssign, loaded [template = constants.%MulAssign.type] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/operators/overloaded/negate.carbon b/toolchain/check/testdata/operators/overloaded/negate.carbon index ef3b327efd4c4..8c0efa78ea09b 100644 --- a/toolchain/check/testdata/operators/overloaded/negate.carbon +++ b/toolchain/check/testdata/operators/overloaded/negate.carbon @@ -46,7 +46,7 @@ fn TestOp(a: C) -> C { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/arithmetic, inst+91, loaded [template = constants.%Negate.type] +// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/arithmetic, Negate, loaded [template = constants.%Negate.type] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/operators/overloaded/ordered.carbon b/toolchain/check/testdata/operators/overloaded/ordered.carbon index 120199b59117f..dbafbba67b5e9 100644 --- a/toolchain/check/testdata/operators/overloaded/ordered.carbon +++ b/toolchain/check/testdata/operators/overloaded/ordered.carbon @@ -113,7 +113,7 @@ fn TestGreaterEqual(a: D, b: D) -> bool { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/comparison, inst+72, loaded [template = constants.%Ordered.type] +// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/comparison, Ordered, loaded [template = constants.%Ordered.type] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/operators/overloaded/right_shift.carbon b/toolchain/check/testdata/operators/overloaded/right_shift.carbon index 442f0cf2841d8..5220ab523649c 100644 --- a/toolchain/check/testdata/operators/overloaded/right_shift.carbon +++ b/toolchain/check/testdata/operators/overloaded/right_shift.carbon @@ -63,8 +63,8 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/bitwise, inst+289, loaded [template = constants.%RightShift.type] -// CHECK:STDOUT: %import_ref.5: type = import_ref Core//prelude/operators/bitwise, inst+323, loaded [template = constants.%RightShiftAssign.type] +// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/bitwise, RightShift, loaded [template = constants.%RightShift.type] +// CHECK:STDOUT: %import_ref.5: type = import_ref Core//prelude/operators/bitwise, RightShiftAssign, loaded [template = constants.%RightShiftAssign.type] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/operators/overloaded/sub.carbon b/toolchain/check/testdata/operators/overloaded/sub.carbon index f23da2e424d04..9eb83cb4f16cf 100644 --- a/toolchain/check/testdata/operators/overloaded/sub.carbon +++ b/toolchain/check/testdata/operators/overloaded/sub.carbon @@ -63,8 +63,8 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/arithmetic, inst+118, loaded [template = constants.%Sub.type] -// CHECK:STDOUT: %import_ref.5: type = import_ref Core//prelude/operators/arithmetic, inst+152, loaded [template = constants.%SubAssign.type] +// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/arithmetic, Sub, loaded [template = constants.%Sub.type] +// CHECK:STDOUT: %import_ref.5: type = import_ref Core//prelude/operators/arithmetic, SubAssign, loaded [template = constants.%SubAssign.type] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/packages/fail_conflict_no_namespaces.carbon b/toolchain/check/testdata/packages/fail_conflict_no_namespaces.carbon index 6e1bf77fac7e2..b6f7faedfeb7b 100644 --- a/toolchain/check/testdata/packages/fail_conflict_no_namespaces.carbon +++ b/toolchain/check/testdata/packages/fail_conflict_no_namespaces.carbon @@ -94,7 +94,7 @@ import library "var"; // CHECK:STDOUT: --- fail_conflict.carbon // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1 = import_ref Example//fn, inst+3, unloaded +// CHECK:STDOUT: %import_ref.1 = import_ref Example//fn, Foo, unloaded // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... diff --git a/toolchain/check/testdata/packages/fail_import_type_error.carbon b/toolchain/check/testdata/packages/fail_import_type_error.carbon index 2c138e0c56bae..2e131050d8dfd 100644 --- a/toolchain/check/testdata/packages/fail_import_type_error.carbon +++ b/toolchain/check/testdata/packages/fail_import_type_error.carbon @@ -88,10 +88,10 @@ var d: i32 = d_ref; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: ref = import_ref Implicit//default, inst+5, loaded -// CHECK:STDOUT: %import_ref.2: ref = import_ref Implicit//default, inst+9, loaded -// CHECK:STDOUT: %import_ref.3: ref = import_ref Implicit//default, inst+13, loaded -// CHECK:STDOUT: %import_ref.4: ref = import_ref Implicit//default, inst+17, loaded +// CHECK:STDOUT: %import_ref.1: ref = import_ref Implicit//default, a_ref, loaded +// CHECK:STDOUT: %import_ref.2: ref = import_ref Implicit//default, b_ref, loaded +// CHECK:STDOUT: %import_ref.3: ref = import_ref Implicit//default, c_ref, loaded +// CHECK:STDOUT: %import_ref.4: ref = import_ref Implicit//default, d_ref, loaded // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.5 // CHECK:STDOUT: import Core//prelude diff --git a/toolchain/check/testdata/packages/implicit_imports_prelude.carbon b/toolchain/check/testdata/packages/implicit_imports_prelude.carbon index 32dc22d5b231d..2e68450e2d831 100644 --- a/toolchain/check/testdata/packages/implicit_imports_prelude.carbon +++ b/toolchain/check/testdata/packages/implicit_imports_prelude.carbon @@ -84,7 +84,7 @@ var b: i32 = a; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: ref %i32 = import_ref Main//lib, inst+19, loaded +// CHECK:STDOUT: %import_ref.1: ref %i32 = import_ref Main//lib, a, loaded // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.36 // CHECK:STDOUT: import Core//prelude diff --git a/toolchain/check/testdata/packages/loaded_global.carbon b/toolchain/check/testdata/packages/loaded_global.carbon index e423af610611a..8255163b023a5 100644 --- a/toolchain/check/testdata/packages/loaded_global.carbon +++ b/toolchain/check/testdata/packages/loaded_global.carbon @@ -72,7 +72,7 @@ var package_b: () = package.B(); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref: %A.type = import_ref Implicit//default, inst+3, loaded [template = constants.%A] +// CHECK:STDOUT: %import_ref: %A.type = import_ref Implicit//default, A, loaded [template = constants.%A] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -147,7 +147,7 @@ var package_b: () = package.B(); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref: %B.type = import_ref SamePackage//default, inst+3, loaded [template = constants.%B] +// CHECK:STDOUT: %import_ref: %B.type = import_ref SamePackage//default, B, loaded [template = constants.%B] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... diff --git a/toolchain/check/testdata/packages/no_prelude/cross_package_export.carbon b/toolchain/check/testdata/packages/no_prelude/cross_package_export.carbon index 1da372a1a2c4e..14ad3b0108fe3 100644 --- a/toolchain/check/testdata/packages/no_prelude/cross_package_export.carbon +++ b/toolchain/check/testdata/packages/no_prelude/cross_package_export.carbon @@ -242,7 +242,7 @@ alias C = Other.C; // CHECK:STDOUT: --- export_import.carbon // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref = import_ref Other//base, inst+1, unloaded +// CHECK:STDOUT: %import_ref = import_ref Other//base, C, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -255,7 +255,7 @@ alias C = Other.C; // CHECK:STDOUT: --- export_import_copy.carbon // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref = import_ref Other//base, inst+1, unloaded +// CHECK:STDOUT: %import_ref = import_ref Other//base, C, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -268,7 +268,7 @@ alias C = Other.C; // CHECK:STDOUT: --- export_import_indirect.carbon // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref = import_ref Other//base, inst+1, unloaded +// CHECK:STDOUT: %import_ref = import_ref Other//base, C, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -288,10 +288,10 @@ alias C = Other.C; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Other//base, inst+1, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2: = import_ref Other//base, inst+9, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.3 = import_ref Other//base, inst+2, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Other//base, inst+7, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Other//base, C, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2: = import_ref Other//base, loc6_1, loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.3 = import_ref Other//base, inst14 [no loc], unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Other//base, loc5_8, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -319,10 +319,10 @@ alias C = Other.C; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Other//base, inst+1, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2: = import_ref Other//base, inst+9, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.3 = import_ref Other//base, inst+2, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Other//base, inst+7, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Other//base, C, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2: = import_ref Other//base, loc6_1, loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.3 = import_ref Other//base, inst14 [no loc], unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Other//base, loc5_8, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -350,10 +350,10 @@ alias C = Other.C; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Other//export_name, inst+11, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2: = import_ref Other//export_name, inst+8, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.3 = import_ref Other//export_name, inst+9, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Other//export_name, inst+10, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Other//export_name, C, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2: = import_ref Other//export_name, inst20 [indirect], loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.3 = import_ref Other//export_name, inst21 [indirect], unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Other//export_name, inst22 [indirect], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -388,10 +388,10 @@ alias C = Other.C; // CHECK:STDOUT: import Other//export_import // CHECK:STDOUT: import Other//base // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref Other//base, inst+1, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2: = import_ref Other//base, inst+9, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.3 = import_ref Other//base, inst+2, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Other//base, inst+7, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Other//base, C, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2: = import_ref Other//base, loc6_1, loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.3 = import_ref Other//base, inst14 [no loc], unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Other//base, loc5_8, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -444,10 +444,10 @@ alias C = Other.C; // CHECK:STDOUT: import Other//export_import_copy // CHECK:STDOUT: import Other//base // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref Other//base, inst+1, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2: = import_ref Other//base, inst+9, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.3 = import_ref Other//base, inst+2, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Other//base, inst+7, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Other//base, C, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2: = import_ref Other//base, loc6_1, loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.3 = import_ref Other//base, inst14 [no loc], unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Other//base, loc5_8, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -500,10 +500,10 @@ alias C = Other.C; // CHECK:STDOUT: import Other//export_import // CHECK:STDOUT: import Other//base // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref Other//base, inst+1, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2: = import_ref Other//base, inst+9, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.3 = import_ref Other//base, inst+2, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Other//base, inst+7, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Other//base, C, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2: = import_ref Other//base, loc6_1, loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.3 = import_ref Other//base, inst14 [no loc], unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Other//base, loc5_8, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -554,10 +554,10 @@ alias C = Other.C; // CHECK:STDOUT: .C = %import_ref.1 // CHECK:STDOUT: import Other//export_name // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref Other//export_name, inst+11, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2: = import_ref Other//export_name, inst+8, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.3 = import_ref Other//export_name, inst+9, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Other//export_name, inst+10, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Other//export_name, C, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2: = import_ref Other//export_name, inst20 [indirect], loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.3 = import_ref Other//export_name, inst21 [indirect], unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Other//export_name, inst22 [indirect], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -609,10 +609,10 @@ alias C = Other.C; // CHECK:STDOUT: import Other//export_name // CHECK:STDOUT: import Other//export_name_copy // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref Other//export_name, inst+11, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2: = import_ref Other//export_name, inst+8, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.3 = import_ref Other//export_name, inst+9, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Other//export_name, inst+10, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Other//export_name, C, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2: = import_ref Other//export_name, inst20 [indirect], loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.3 = import_ref Other//export_name, inst21 [indirect], unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Other//export_name, inst22 [indirect], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -663,10 +663,10 @@ alias C = Other.C; // CHECK:STDOUT: .C = %import_ref.1 // CHECK:STDOUT: import Other//export_name_indirect // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref Other//export_name_indirect, inst+11, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2: = import_ref Other//export_name_indirect, inst+8, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.3 = import_ref Other//export_name_indirect, inst+9, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Other//export_name_indirect, inst+10, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Other//export_name_indirect, C, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2: = import_ref Other//export_name_indirect, inst20 [indirect], loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.3 = import_ref Other//export_name_indirect, inst21 [indirect], unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Other//export_name_indirect, inst22 [indirect], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -723,10 +723,10 @@ alias C = Other.C; // CHECK:STDOUT: import Other//export_name_indirect // CHECK:STDOUT: import Other//base // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref Other//export_name, inst+11, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2: = import_ref Other//export_name, inst+8, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.3 = import_ref Other//export_name, inst+9, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Other//export_name, inst+10, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Other//export_name, C, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2: = import_ref Other//export_name, inst20 [indirect], loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.3 = import_ref Other//export_name, inst21 [indirect], unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Other//export_name, inst22 [indirect], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -808,7 +808,7 @@ alias C = Other.C; // CHECK:STDOUT: import Other//conflict // CHECK:STDOUT: import Other//base // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: %C.type = import_ref Other//conflict, inst+1, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.1: %C.type = import_ref Other//conflict, C, loaded [template = constants.%C] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -839,10 +839,10 @@ alias C = Other.C; // CHECK:STDOUT: import Other//export_name // CHECK:STDOUT: import Other//conflict // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref Other//export_name, inst+11, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2: = import_ref Other//export_name, inst+8, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.3 = import_ref Other//export_name, inst+9, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Other//export_name, inst+10, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Other//export_name, C, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2: = import_ref Other//export_name, inst20 [indirect], loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.3 = import_ref Other//export_name, inst21 [indirect], unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Other//export_name, inst22 [indirect], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/packages/no_prelude/cross_package_import.carbon b/toolchain/check/testdata/packages/no_prelude/cross_package_import.carbon index 7a48673868463..87220bdd54c5d 100644 --- a/toolchain/check/testdata/packages/no_prelude/cross_package_import.carbon +++ b/toolchain/check/testdata/packages/no_prelude/cross_package_import.carbon @@ -299,7 +299,7 @@ fn UseF() { Other.F(); } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref: %F.type = import_ref Other//other_fn, inst+1, loaded [template = constants.%F] +// CHECK:STDOUT: %import_ref: %F.type = import_ref Other//other_fn, F, loaded [template = constants.%F] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -348,8 +348,8 @@ fn UseF() { Other.F(); } // CHECK:STDOUT: import Other//other_fn // CHECK:STDOUT: import Other//other_fn2 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: %F.type = import_ref Other//other_fn, inst+1, loaded [template = constants.%F] -// CHECK:STDOUT: %import_ref.2: %F2.type = import_ref Other//other_fn2, inst+1, loaded [template = constants.%F2] +// CHECK:STDOUT: %import_ref.1: %F.type = import_ref Other//other_fn, F, loaded [template = constants.%F] +// CHECK:STDOUT: %import_ref.2: %F2.type = import_ref Other//other_fn2, F2, loaded [template = constants.%F2] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -392,7 +392,7 @@ fn UseF() { Other.F(); } // CHECK:STDOUT: import Other//other_fn // CHECK:STDOUT: import Other//other_fn_extern // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: %F.type = import_ref Other//other_fn, inst+1, loaded [template = constants.%F] +// CHECK:STDOUT: %import_ref.1: %F.type = import_ref Other//other_fn, F, loaded [template = constants.%F] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -446,7 +446,7 @@ fn UseF() { Other.F(); } // CHECK:STDOUT: import Other//other_fn // CHECK:STDOUT: import Other//other_fn_conflict // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: %F.type = import_ref Other//other_fn, inst+1, loaded [template = constants.%F] +// CHECK:STDOUT: %import_ref.1: %F.type = import_ref Other//other_fn, F, loaded [template = constants.%F] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -476,7 +476,7 @@ fn UseF() { Other.F(); } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: = import_ref Main//main_other_ns, inst+1, loaded +// CHECK:STDOUT: %import_ref.1: = import_ref Main//main_other_ns, Other, loaded // CHECK:STDOUT: %Other: = namespace %import_ref.1, [template] { // CHECK:STDOUT: .F = file.%F.decl // CHECK:STDOUT: import Other//other_fn diff --git a/toolchain/check/testdata/packages/no_prelude/export_import.carbon b/toolchain/check/testdata/packages/no_prelude/export_import.carbon index c3ec9d710f943..b9bb77b4e5ea8 100644 --- a/toolchain/check/testdata/packages/no_prelude/export_import.carbon +++ b/toolchain/check/testdata/packages/no_prelude/export_import.carbon @@ -198,7 +198,7 @@ var indirect_c: C = {.x = ()}; // CHECK:STDOUT: --- export.carbon // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref = import_ref Main//base, inst+1, unloaded +// CHECK:STDOUT: %import_ref = import_ref Main//base, C, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -211,7 +211,7 @@ var indirect_c: C = {.x = ()}; // CHECK:STDOUT: --- export_copy.carbon // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref = import_ref Main//base, inst+1, unloaded +// CHECK:STDOUT: %import_ref = import_ref Main//base, C, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -224,7 +224,7 @@ var indirect_c: C = {.x = ()}; // CHECK:STDOUT: --- non_export.carbon // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref = import_ref Main//base, inst+1, unloaded +// CHECK:STDOUT: %import_ref = import_ref Main//base, C, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -237,7 +237,7 @@ var indirect_c: C = {.x = ()}; // CHECK:STDOUT: --- export_export.carbon // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref = import_ref Main//base, inst+1, unloaded +// CHECK:STDOUT: %import_ref = import_ref Main//base, C, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -250,7 +250,7 @@ var indirect_c: C = {.x = ()}; // CHECK:STDOUT: --- import_then_export.carbon // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref = import_ref Main//base, inst+1, unloaded +// CHECK:STDOUT: %import_ref = import_ref Main//base, C, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -278,10 +278,10 @@ var indirect_c: C = {.x = ()}; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Main//base, inst+1, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2: = import_ref Main//base, inst+9, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.3 = import_ref Main//base, inst+2, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Main//base, inst+7, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Main//base, C, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2: = import_ref Main//base, loc6_1, loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.3 = import_ref Main//base, inst14 [no loc], unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Main//base, loc5_8, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -327,10 +327,10 @@ var indirect_c: C = {.x = ()}; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Main//base, inst+1, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2: = import_ref Main//base, inst+9, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.3 = import_ref Main//base, inst+2, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Main//base, inst+7, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Main//base, C, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2: = import_ref Main//base, loc6_1, loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.3 = import_ref Main//base, inst14 [no loc], unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Main//base, loc5_8, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -377,10 +377,10 @@ var indirect_c: C = {.x = ()}; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Main//export_export, inst+2, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2: = import_ref Main//base, inst+9, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.3 = import_ref Main//base, inst+2, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Main//base, inst+7, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Main//export_export, C, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2: = import_ref Main//base, loc6_1, loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.3 = import_ref Main//base, inst14 [no loc], unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Main//base, loc5_8, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -427,10 +427,10 @@ var indirect_c: C = {.x = ()}; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Main//base, inst+1, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2: = import_ref Main//base, inst+9, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.3 = import_ref Main//base, inst+2, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Main//base, inst+7, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Main//base, C, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2: = import_ref Main//base, loc6_1, loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.3 = import_ref Main//base, inst14 [no loc], unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Main//base, loc5_8, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -476,10 +476,10 @@ var indirect_c: C = {.x = ()}; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Main//base, inst+1, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2: = import_ref Main//base, inst+9, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.3 = import_ref Main//base, inst+2, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Main//base, inst+7, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Main//base, C, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2: = import_ref Main//base, loc6_1, loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.3 = import_ref Main//base, inst14 [no loc], unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Main//base, loc5_8, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -525,10 +525,10 @@ var indirect_c: C = {.x = ()}; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Main//base, inst+1, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2: = import_ref Main//base, inst+9, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.3 = import_ref Main//base, inst+2, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Main//base, inst+7, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Main//base, C, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2: = import_ref Main//base, loc6_1, loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.3 = import_ref Main//base, inst14 [no loc], unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Main//base, loc5_8, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -574,10 +574,10 @@ var indirect_c: C = {.x = ()}; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Main//base, inst+1, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2: = import_ref Main//base, inst+9, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.3 = import_ref Main//base, inst+2, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Main//base, inst+7, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Main//base, C, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2: = import_ref Main//base, loc6_1, loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.3 = import_ref Main//base, inst14 [no loc], unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Main//base, loc5_8, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -623,10 +623,10 @@ var indirect_c: C = {.x = ()}; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Main//base, inst+1, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2: = import_ref Main//base, inst+9, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.3 = import_ref Main//base, inst+2, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Main//base, inst+7, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Main//base, C, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2: = import_ref Main//base, loc6_1, loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.3 = import_ref Main//base, inst14 [no loc], unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Main//base, loc5_8, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -672,10 +672,10 @@ var indirect_c: C = {.x = ()}; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Main//base, inst+1, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2: = import_ref Main//base, inst+9, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.3 = import_ref Main//base, inst+2, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Main//base, inst+7, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Main//base, C, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2: = import_ref Main//base, loc6_1, loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.3 = import_ref Main//base, inst14 [no loc], unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Main//base, loc5_8, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -732,10 +732,10 @@ var indirect_c: C = {.x = ()}; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Main//base, inst+1, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2: = import_ref Main//base, inst+9, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.3 = import_ref Main//base, inst+2, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Main//base, inst+7, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Main//base, C, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2: = import_ref Main//base, loc6_1, loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.3 = import_ref Main//base, inst14 [no loc], unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Main//base, loc5_8, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -781,11 +781,11 @@ var indirect_c: C = {.x = ()}; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1 = import_ref Main//use_non_export_then_base, inst+14, unloaded -// CHECK:STDOUT: %import_ref.2: type = import_ref Main//base, inst+1, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.3: = import_ref Main//base, inst+9, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.4 = import_ref Main//base, inst+2, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Main//base, inst+7, unloaded +// CHECK:STDOUT: %import_ref.1 = import_ref Main//use_non_export_then_base, c, unloaded +// CHECK:STDOUT: %import_ref.2: type = import_ref Main//base, C, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.3: = import_ref Main//base, loc6_1, loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.4 = import_ref Main//base, inst14 [no loc], unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref Main//base, loc5_8, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/packages/no_prelude/export_mixed.carbon b/toolchain/check/testdata/packages/no_prelude/export_mixed.carbon index f5c1270422397..1a4a0455904dd 100644 --- a/toolchain/check/testdata/packages/no_prelude/export_mixed.carbon +++ b/toolchain/check/testdata/packages/no_prelude/export_mixed.carbon @@ -163,8 +163,8 @@ var d: D = {.y = ()}; // CHECK:STDOUT: --- export_import.carbon // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1 = import_ref Main//base, inst+1, unloaded -// CHECK:STDOUT: %import_ref.2 = import_ref Main//base, inst+11, unloaded +// CHECK:STDOUT: %import_ref.1 = import_ref Main//base, C, unloaded +// CHECK:STDOUT: %import_ref.2 = import_ref Main//base, D, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -185,11 +185,11 @@ var d: D = {.y = ()}; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Main//base, inst+1, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2 = import_ref Main//base, inst+11, unloaded -// CHECK:STDOUT: %import_ref.3: = import_ref Main//base, inst+9, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.4 = import_ref Main//base, inst+2, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Main//base, inst+7, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Main//base, C, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2 = import_ref Main//base, D, unloaded +// CHECK:STDOUT: %import_ref.3: = import_ref Main//base, loc6_1, loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.4 = import_ref Main//base, inst14 [no loc], unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref Main//base, loc5_8, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -218,11 +218,11 @@ var d: D = {.y = ()}; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Main//base, inst+1, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2 = import_ref Main//base, inst+11, unloaded -// CHECK:STDOUT: %import_ref.3: = import_ref Main//base, inst+9, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.4 = import_ref Main//base, inst+2, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Main//base, inst+7, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Main//base, C, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2 = import_ref Main//base, D, unloaded +// CHECK:STDOUT: %import_ref.3: = import_ref Main//base, loc6_1, loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.4 = import_ref Main//base, inst14 [no loc], unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref Main//base, loc5_8, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -244,7 +244,7 @@ var d: D = {.y = ()}; // CHECK:STDOUT: --- export_name_then_import.carbon // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref = import_ref Main//export_name, inst+12, unloaded +// CHECK:STDOUT: %import_ref = import_ref Main//export_name, C, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -266,10 +266,10 @@ var d: D = {.y = ()}; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Main//export_import_then_name, inst+12, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2: = import_ref Main//export_import_then_name, inst+9, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.3 = import_ref Main//export_import_then_name, inst+10, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Main//export_import_then_name, inst+11, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Main//export_import_then_name, C, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2: = import_ref Main//export_import_then_name, inst21 [indirect], loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.3 = import_ref Main//export_import_then_name, inst22 [indirect], unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Main//export_import_then_name, inst23 [indirect], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -315,10 +315,10 @@ var d: D = {.y = ()}; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Main//export_name, inst+12, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2: = import_ref Main//export_name, inst+9, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.3 = import_ref Main//export_name, inst+10, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Main//export_name, inst+11, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Main//export_name, C, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2: = import_ref Main//export_name, inst21 [indirect], loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.3 = import_ref Main//export_name, inst22 [indirect], unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Main//export_name, inst23 [indirect], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -364,10 +364,10 @@ var d: D = {.y = ()}; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Main//export_import_then_name, inst+12, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2: = import_ref Main//export_import_then_name, inst+9, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.3 = import_ref Main//export_import_then_name, inst+10, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Main//export_import_then_name, inst+11, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Main//export_import_then_name, C, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2: = import_ref Main//export_import_then_name, inst21 [indirect], loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.3 = import_ref Main//export_import_then_name, inst22 [indirect], unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Main//export_import_then_name, inst23 [indirect], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -409,7 +409,7 @@ var d: D = {.y = ()}; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref = import_ref Main//export_import_then_name, inst+12, unloaded +// CHECK:STDOUT: %import_ref = import_ref Main//export_import_then_name, C, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -443,10 +443,10 @@ var d: D = {.y = ()}; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Main//export_import_then_name, inst+12, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2: = import_ref Main//export_import_then_name, inst+9, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.3 = import_ref Main//export_import_then_name, inst+10, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Main//export_import_then_name, inst+11, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Main//export_import_then_name, C, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2: = import_ref Main//export_import_then_name, inst21 [indirect], loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.3 = import_ref Main//export_import_then_name, inst22 [indirect], unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Main//export_import_then_name, inst23 [indirect], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -496,14 +496,14 @@ var d: D = {.y = ()}; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Main//export_import_then_name, inst+12, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2: type = import_ref Main//base, inst+11, loaded [template = constants.%D] -// CHECK:STDOUT: %import_ref.3: = import_ref Main//export_import_then_name, inst+9, loaded [template = constants.%complete_type.1] -// CHECK:STDOUT: %import_ref.4 = import_ref Main//export_import_then_name, inst+10, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Main//export_import_then_name, inst+11, unloaded -// CHECK:STDOUT: %import_ref.6: = import_ref Main//base, inst+18, loaded [template = constants.%complete_type.2] -// CHECK:STDOUT: %import_ref.7 = import_ref Main//base, inst+12, unloaded -// CHECK:STDOUT: %import_ref.8 = import_ref Main//base, inst+16, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Main//export_import_then_name, C, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2: type = import_ref Main//base, D, loaded [template = constants.%D] +// CHECK:STDOUT: %import_ref.3: = import_ref Main//export_import_then_name, inst21 [indirect], loaded [template = constants.%complete_type.1] +// CHECK:STDOUT: %import_ref.4 = import_ref Main//export_import_then_name, inst22 [indirect], unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref Main//export_import_then_name, inst23 [indirect], unloaded +// CHECK:STDOUT: %import_ref.6: = import_ref Main//base, loc10_1, loaded [template = constants.%complete_type.2] +// CHECK:STDOUT: %import_ref.7 = import_ref Main//base, inst24 [no loc], unloaded +// CHECK:STDOUT: %import_ref.8 = import_ref Main//base, loc9_8, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/packages/no_prelude/export_name.carbon b/toolchain/check/testdata/packages/no_prelude/export_name.carbon index 8dbfd2633080e..8294c49126f18 100644 --- a/toolchain/check/testdata/packages/no_prelude/export_name.carbon +++ b/toolchain/check/testdata/packages/no_prelude/export_name.carbon @@ -263,18 +263,18 @@ private export C; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Main//base, inst+1, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2: = import_ref Main//base, inst+11, loaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Main//base, C, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2: = import_ref Main//base, NS, loaded // CHECK:STDOUT: %NS: = namespace %import_ref.2, [template] { // CHECK:STDOUT: .NSC = file.%NSC // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.3: type = import_ref Main//base, inst+12, loaded [template = constants.%NSC] -// CHECK:STDOUT: %import_ref.4: = import_ref Main//base, inst+9, loaded [template = constants.%complete_type.1] -// CHECK:STDOUT: %import_ref.5 = import_ref Main//base, inst+2, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Main//base, inst+7, unloaded -// CHECK:STDOUT: %import_ref.7: = import_ref Main//base, inst+19, loaded [template = constants.%complete_type.2] -// CHECK:STDOUT: %import_ref.8 = import_ref Main//base, inst+13, unloaded -// CHECK:STDOUT: %import_ref.9 = import_ref Main//base, inst+17, unloaded +// CHECK:STDOUT: %import_ref.3: type = import_ref Main//base, NSC, loaded [template = constants.%NSC] +// CHECK:STDOUT: %import_ref.4: = import_ref Main//base, loc6_1, loaded [template = constants.%complete_type.1] +// CHECK:STDOUT: %import_ref.5 = import_ref Main//base, inst14 [no loc], unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Main//base, loc5_8, unloaded +// CHECK:STDOUT: %import_ref.7: = import_ref Main//base, loc11_1, loaded [template = constants.%complete_type.2] +// CHECK:STDOUT: %import_ref.8 = import_ref Main//base, inst25 [no loc], unloaded +// CHECK:STDOUT: %import_ref.9 = import_ref Main//base, loc10_8, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -304,8 +304,8 @@ private export C; // CHECK:STDOUT: --- not_reexporting.carbon // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1 = import_ref Main//export, inst+14, unloaded -// CHECK:STDOUT: %import_ref.2: = import_ref Main//export, inst+4, loaded +// CHECK:STDOUT: %import_ref.1 = import_ref Main//export, C, unloaded +// CHECK:STDOUT: %import_ref.2: = import_ref Main//export, NS, loaded // CHECK:STDOUT: %NS: = namespace %import_ref.2, [template] { // CHECK:STDOUT: .NSC = %import_ref.3 // CHECK:STDOUT: } @@ -332,18 +332,18 @@ private export C; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Main//export, inst+14, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2: = import_ref Main//export, inst+4, loaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Main//export, C, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2: = import_ref Main//export, NS, loaded // CHECK:STDOUT: %NS: = namespace %import_ref.2, [template] { // CHECK:STDOUT: .NSC = file.%NSC // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.3: type = import_ref Main//export, inst+22, loaded [template = constants.%NSC] -// CHECK:STDOUT: %import_ref.4: = import_ref Main//export, inst+11, loaded [template = constants.%complete_type.1] -// CHECK:STDOUT: %import_ref.5 = import_ref Main//export, inst+12, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Main//export, inst+13, unloaded -// CHECK:STDOUT: %import_ref.7: = import_ref Main//export, inst+19, loaded [template = constants.%complete_type.2] -// CHECK:STDOUT: %import_ref.8 = import_ref Main//export, inst+20, unloaded -// CHECK:STDOUT: %import_ref.9 = import_ref Main//export, inst+21, unloaded +// CHECK:STDOUT: %import_ref.3: type = import_ref Main//export, NSC, loaded [template = constants.%NSC] +// CHECK:STDOUT: %import_ref.4: = import_ref Main//export, inst23 [indirect], loaded [template = constants.%complete_type.1] +// CHECK:STDOUT: %import_ref.5 = import_ref Main//export, inst24 [indirect], unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Main//export, inst25 [indirect], unloaded +// CHECK:STDOUT: %import_ref.7: = import_ref Main//export, inst31 [indirect], loaded [template = constants.%complete_type.2] +// CHECK:STDOUT: %import_ref.8 = import_ref Main//export, inst32 [indirect], unloaded +// CHECK:STDOUT: %import_ref.9 = import_ref Main//export, inst33 [indirect], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -392,18 +392,18 @@ private export C; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Main//export, inst+14, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2: = import_ref Main//export, inst+4, loaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Main//export, C, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2: = import_ref Main//export, NS, loaded // CHECK:STDOUT: %NS: = namespace %import_ref.2, [template] { // CHECK:STDOUT: .NSC = %import_ref.3 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.3: type = import_ref Main//export, inst+22, loaded [template = constants.%NSC] -// CHECK:STDOUT: %import_ref.4: = import_ref Main//export, inst+11, loaded [template = constants.%complete_type.1] -// CHECK:STDOUT: %import_ref.5 = import_ref Main//export, inst+12, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Main//export, inst+13, unloaded -// CHECK:STDOUT: %import_ref.7: = import_ref Main//export, inst+19, loaded [template = constants.%complete_type.2] -// CHECK:STDOUT: %import_ref.8 = import_ref Main//export, inst+20, unloaded -// CHECK:STDOUT: %import_ref.9 = import_ref Main//export, inst+21, unloaded +// CHECK:STDOUT: %import_ref.3: type = import_ref Main//export, NSC, loaded [template = constants.%NSC] +// CHECK:STDOUT: %import_ref.4: = import_ref Main//export, inst23 [indirect], loaded [template = constants.%complete_type.1] +// CHECK:STDOUT: %import_ref.5 = import_ref Main//export, inst24 [indirect], unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Main//export, inst25 [indirect], unloaded +// CHECK:STDOUT: %import_ref.7: = import_ref Main//export, inst31 [indirect], loaded [template = constants.%complete_type.2] +// CHECK:STDOUT: %import_ref.8 = import_ref Main//export, inst32 [indirect], unloaded +// CHECK:STDOUT: %import_ref.9 = import_ref Main//export, inst33 [indirect], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -474,18 +474,18 @@ private export C; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Main//export_export, inst+14, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2: = import_ref Main//export_export, inst+4, loaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Main//export_export, C, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2: = import_ref Main//export_export, NS, loaded // CHECK:STDOUT: %NS: = namespace %import_ref.2, [template] { // CHECK:STDOUT: .NSC = %import_ref.3 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.3: type = import_ref Main//export_export, inst+22, loaded [template = constants.%NSC] -// CHECK:STDOUT: %import_ref.4: = import_ref Main//export_export, inst+11, loaded [template = constants.%complete_type.1] -// CHECK:STDOUT: %import_ref.5 = import_ref Main//export_export, inst+12, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Main//export_export, inst+13, unloaded -// CHECK:STDOUT: %import_ref.7: = import_ref Main//export_export, inst+19, loaded [template = constants.%complete_type.2] -// CHECK:STDOUT: %import_ref.8 = import_ref Main//export_export, inst+20, unloaded -// CHECK:STDOUT: %import_ref.9 = import_ref Main//export_export, inst+21, unloaded +// CHECK:STDOUT: %import_ref.3: type = import_ref Main//export_export, NSC, loaded [template = constants.%NSC] +// CHECK:STDOUT: %import_ref.4: = import_ref Main//export_export, inst23 [indirect], loaded [template = constants.%complete_type.1] +// CHECK:STDOUT: %import_ref.5 = import_ref Main//export_export, inst24 [indirect], unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Main//export_export, inst25 [indirect], unloaded +// CHECK:STDOUT: %import_ref.7: = import_ref Main//export_export, inst31 [indirect], loaded [template = constants.%complete_type.2] +// CHECK:STDOUT: %import_ref.8 = import_ref Main//export_export, inst32 [indirect], unloaded +// CHECK:STDOUT: %import_ref.9 = import_ref Main//export_export, inst33 [indirect], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -557,18 +557,18 @@ private export C; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Main//export_export, inst+14, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2: = import_ref Main//export_export, inst+4, loaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Main//export_export, C, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2: = import_ref Main//export_export, NS, loaded // CHECK:STDOUT: %NS: = namespace %import_ref.2, [template] { // CHECK:STDOUT: .NSC = %import_ref.3 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.3: type = import_ref Main//export_export, inst+22, loaded [template = constants.%NSC] -// CHECK:STDOUT: %import_ref.4: = import_ref Main//export_export, inst+11, loaded [template = constants.%complete_type.1] -// CHECK:STDOUT: %import_ref.5 = import_ref Main//export_export, inst+12, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Main//export_export, inst+13, unloaded -// CHECK:STDOUT: %import_ref.7: = import_ref Main//export_export, inst+19, loaded [template = constants.%complete_type.2] -// CHECK:STDOUT: %import_ref.8 = import_ref Main//export_export, inst+20, unloaded -// CHECK:STDOUT: %import_ref.9 = import_ref Main//export_export, inst+21, unloaded +// CHECK:STDOUT: %import_ref.3: type = import_ref Main//export_export, NSC, loaded [template = constants.%NSC] +// CHECK:STDOUT: %import_ref.4: = import_ref Main//export_export, inst23 [indirect], loaded [template = constants.%complete_type.1] +// CHECK:STDOUT: %import_ref.5 = import_ref Main//export_export, inst24 [indirect], unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Main//export_export, inst25 [indirect], unloaded +// CHECK:STDOUT: %import_ref.7: = import_ref Main//export_export, inst31 [indirect], loaded [template = constants.%complete_type.2] +// CHECK:STDOUT: %import_ref.8 = import_ref Main//export_export, inst32 [indirect], unloaded +// CHECK:STDOUT: %import_ref.9 = import_ref Main//export_export, inst33 [indirect], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -626,8 +626,8 @@ private export C; // CHECK:STDOUT: --- fail_export_ns.carbon // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1 = import_ref Main//base, inst+1, unloaded -// CHECK:STDOUT: %import_ref.2: = import_ref Main//base, inst+11, loaded +// CHECK:STDOUT: %import_ref.1 = import_ref Main//base, C, unloaded +// CHECK:STDOUT: %import_ref.2: = import_ref Main//base, NS, loaded // CHECK:STDOUT: %NS: = namespace %import_ref.2, [template] { // CHECK:STDOUT: .NSC = %import_ref.3 // CHECK:STDOUT: } @@ -674,14 +674,14 @@ private export C; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Main//base, inst+1, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2: = import_ref Main//base, inst+11, loaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Main//base, C, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2: = import_ref Main//base, NS, loaded // CHECK:STDOUT: %NS: = namespace %import_ref.2, [template] { // CHECK:STDOUT: .NSC = %import_ref.3 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.4: = import_ref Main//base, inst+9, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.5 = import_ref Main//base, inst+2, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Main//base, inst+7, unloaded +// CHECK:STDOUT: %import_ref.4: = import_ref Main//base, loc6_1, loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.5 = import_ref Main//base, inst14 [no loc], unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Main//base, loc5_8, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -715,18 +715,18 @@ private export C; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Main//base, inst+1, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2: = import_ref Main//base, inst+11, loaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Main//base, C, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2: = import_ref Main//base, NS, loaded // CHECK:STDOUT: %NS: = namespace %import_ref.2, [template] { // CHECK:STDOUT: .NSC = %import_ref.3 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.3: type = import_ref Main//base, inst+12, loaded [template = constants.%NSC] -// CHECK:STDOUT: %import_ref.4: = import_ref Main//base, inst+9, loaded [template = constants.%complete_type.1] -// CHECK:STDOUT: %import_ref.5 = import_ref Main//base, inst+2, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Main//base, inst+7, unloaded -// CHECK:STDOUT: %import_ref.7: = import_ref Main//base, inst+19, loaded [template = constants.%complete_type.2] -// CHECK:STDOUT: %import_ref.8 = import_ref Main//base, inst+13, unloaded -// CHECK:STDOUT: %import_ref.9 = import_ref Main//base, inst+17, unloaded +// CHECK:STDOUT: %import_ref.3: type = import_ref Main//base, NSC, loaded [template = constants.%NSC] +// CHECK:STDOUT: %import_ref.4: = import_ref Main//base, loc6_1, loaded [template = constants.%complete_type.1] +// CHECK:STDOUT: %import_ref.5 = import_ref Main//base, inst14 [no loc], unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Main//base, loc5_8, unloaded +// CHECK:STDOUT: %import_ref.7: = import_ref Main//base, loc11_1, loaded [template = constants.%complete_type.2] +// CHECK:STDOUT: %import_ref.8 = import_ref Main//base, inst25 [no loc], unloaded +// CHECK:STDOUT: %import_ref.9 = import_ref Main//base, loc10_8, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -797,18 +797,18 @@ private export C; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Main//export, inst+14, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2: = import_ref Main//export, inst+4, loaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Main//export, C, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2: = import_ref Main//export, NS, loaded // CHECK:STDOUT: %NS: = namespace %import_ref.2, [template] { // CHECK:STDOUT: .NSC = %import_ref.3 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.3: type = import_ref Main//export, inst+22, loaded [template = constants.%NSC] -// CHECK:STDOUT: %import_ref.4: = import_ref Main//export, inst+11, loaded [template = constants.%complete_type.1] -// CHECK:STDOUT: %import_ref.5 = import_ref Main//export, inst+12, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Main//export, inst+13, unloaded -// CHECK:STDOUT: %import_ref.7: = import_ref Main//export, inst+19, loaded [template = constants.%complete_type.2] -// CHECK:STDOUT: %import_ref.8 = import_ref Main//export, inst+20, unloaded -// CHECK:STDOUT: %import_ref.9 = import_ref Main//export, inst+21, unloaded +// CHECK:STDOUT: %import_ref.3: type = import_ref Main//export, NSC, loaded [template = constants.%NSC] +// CHECK:STDOUT: %import_ref.4: = import_ref Main//export, inst23 [indirect], loaded [template = constants.%complete_type.1] +// CHECK:STDOUT: %import_ref.5 = import_ref Main//export, inst24 [indirect], unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Main//export, inst25 [indirect], unloaded +// CHECK:STDOUT: %import_ref.7: = import_ref Main//export, inst31 [indirect], loaded [template = constants.%complete_type.2] +// CHECK:STDOUT: %import_ref.8 = import_ref Main//export, inst32 [indirect], unloaded +// CHECK:STDOUT: %import_ref.9 = import_ref Main//export, inst33 [indirect], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -888,14 +888,14 @@ private export C; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Main//base, inst+1, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2: = import_ref Main//base, inst+11, loaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Main//base, C, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2: = import_ref Main//base, NS, loaded // CHECK:STDOUT: %NS: = namespace %import_ref.2, [template] { // CHECK:STDOUT: .NSC = %import_ref.3 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.4: = import_ref Main//base, inst+9, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.5 = import_ref Main//base, inst+2, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Main//base, inst+7, unloaded +// CHECK:STDOUT: %import_ref.4: = import_ref Main//base, loc6_1, loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.5 = import_ref Main//base, inst14 [no loc], unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Main//base, loc5_8, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -926,10 +926,10 @@ private export C; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Main//repeat_export, inst+14, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2: = import_ref Main//repeat_export, inst+11, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.3 = import_ref Main//repeat_export, inst+12, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Main//repeat_export, inst+13, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Main//repeat_export, C, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2: = import_ref Main//repeat_export, inst23 [indirect], loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.3 = import_ref Main//repeat_export, inst24 [indirect], unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Main//repeat_export, inst25 [indirect], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -973,14 +973,14 @@ private export C; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Main//base, inst+1, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2: = import_ref Main//base, inst+11, loaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Main//base, C, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2: = import_ref Main//base, NS, loaded // CHECK:STDOUT: %NS: = namespace %import_ref.2, [template] { // CHECK:STDOUT: .NSC = %import_ref.3 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.4: = import_ref Main//base, inst+9, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.5 = import_ref Main//base, inst+2, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Main//base, inst+7, unloaded +// CHECK:STDOUT: %import_ref.4: = import_ref Main//base, loc6_1, loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.5 = import_ref Main//base, inst14 [no loc], unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Main//base, loc5_8, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/packages/no_prelude/fail_export_name_member.carbon b/toolchain/check/testdata/packages/no_prelude/fail_export_name_member.carbon index 80baf4f6974a1..c87722e435729 100644 --- a/toolchain/check/testdata/packages/no_prelude/fail_export_name_member.carbon +++ b/toolchain/check/testdata/packages/no_prelude/fail_export_name_member.carbon @@ -72,10 +72,10 @@ export C.n; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Foo//a, inst+1, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2: = import_ref Foo//a, inst+10, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.3 = import_ref Foo//a, inst+2, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Foo//a, inst+8, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Foo//a, C, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2: = import_ref Foo//a, loc6_1, loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.3 = import_ref Foo//a, inst14 [no loc], unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Foo//a, loc5_8, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/packages/no_prelude/fail_export_name_params.carbon b/toolchain/check/testdata/packages/no_prelude/fail_export_name_params.carbon index 8f24720e01f67..c43645f3097a6 100644 --- a/toolchain/check/testdata/packages/no_prelude/fail_export_name_params.carbon +++ b/toolchain/check/testdata/packages/no_prelude/fail_export_name_params.carbon @@ -96,8 +96,8 @@ export C2(T:! type); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %C1.type = import_ref Foo//a, inst+7, loaded [template = constants.%C1.generic] -// CHECK:STDOUT: %import_ref.2: %C2.type = import_ref Foo//a, inst+18, loaded [template = constants.%C2.generic] +// CHECK:STDOUT: %import_ref.1: %C1.type = import_ref Foo//a, C1, loaded [template = constants.%C1.generic] +// CHECK:STDOUT: %import_ref.2: %C2.type = import_ref Foo//a, C2, loaded [template = constants.%C2.generic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/packages/no_prelude/implicit_imports_entities.carbon b/toolchain/check/testdata/packages/no_prelude/implicit_imports_entities.carbon index bfe47f30471cb..208c57afc1237 100644 --- a/toolchain/check/testdata/packages/no_prelude/implicit_imports_entities.carbon +++ b/toolchain/check/testdata/packages/no_prelude/implicit_imports_entities.carbon @@ -308,7 +308,7 @@ import Other library "o1"; // CHECK:STDOUT: --- mix_current_package.carbon // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref = import_ref Main//c1, inst+1, unloaded +// CHECK:STDOUT: %import_ref = import_ref Main//c1, C1, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -330,12 +330,12 @@ import Other library "o1"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Main//mix_current_package, inst+2, loaded [template = constants.%C1] -// CHECK:STDOUT: %import_ref.2: type = import_ref Main//c2, inst+1, loaded [template = constants.%C2] -// CHECK:STDOUT: %import_ref.3: = import_ref Main//c1, inst+4, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.4 = import_ref Main//c1, inst+2, unloaded -// CHECK:STDOUT: %import_ref.5: = import_ref Main//c2, inst+4, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.6 = import_ref Main//c2, inst+2, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Main//mix_current_package, C1, loaded [template = constants.%C1] +// CHECK:STDOUT: %import_ref.2: type = import_ref Main//c2, C2, loaded [template = constants.%C2] +// CHECK:STDOUT: %import_ref.3: = import_ref Main//c1, loc4_11, loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.4 = import_ref Main//c1, inst14 [no loc], unloaded +// CHECK:STDOUT: %import_ref.5: = import_ref Main//c2, loc4_11, loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.6 = import_ref Main//c2, inst14 [no loc], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -383,7 +383,7 @@ import Other library "o1"; // CHECK:STDOUT: --- dup_c1.carbon // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref = import_ref Main//c1, inst+1, unloaded +// CHECK:STDOUT: %import_ref = import_ref Main//c1, C1, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -403,9 +403,9 @@ import Other library "o1"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Main//dup_c1, inst+2, loaded [template = constants.%C1] -// CHECK:STDOUT: %import_ref.2: = import_ref Main//c1, inst+4, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.3 = import_ref Main//c1, inst+2, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Main//dup_c1, C1, loaded [template = constants.%C1] +// CHECK:STDOUT: %import_ref.2: = import_ref Main//c1, loc4_11, loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.3 = import_ref Main//c1, inst14 [no loc], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -438,7 +438,7 @@ import Other library "o1"; // CHECK:STDOUT: --- use_ns.carbon // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: = import_ref Main//ns, inst+1, loaded +// CHECK:STDOUT: %import_ref.1: = import_ref Main//ns, NS, loaded // CHECK:STDOUT: %NS: = namespace %import_ref.1, [template] { // CHECK:STDOUT: .C = %import_ref.2 // CHECK:STDOUT: } @@ -461,13 +461,13 @@ import Other library "o1"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: = import_ref Main//use_ns, inst+3, loaded +// CHECK:STDOUT: %import_ref.1: = import_ref Main//use_ns, NS, loaded // CHECK:STDOUT: %NS: = namespace %import_ref.1, [template] { // CHECK:STDOUT: .C = %import_ref.2 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.2: type = import_ref Main//use_ns, inst+4, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.3: = import_ref Main//ns, inst+5, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.4 = import_ref Main//ns, inst+3, unloaded +// CHECK:STDOUT: %import_ref.2: type = import_ref Main//use_ns, C, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.3: = import_ref Main//ns, loc5_13, loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.4 = import_ref Main//ns, inst15 [no loc], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -531,12 +531,12 @@ import Other library "o1"; // CHECK:STDOUT: import Other//o2 // CHECK:STDOUT: import Other//o1 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref Other//o1, inst+1, loaded [template = constants.%O1] -// CHECK:STDOUT: %import_ref.2: = import_ref Other//o1, inst+4, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.3 = import_ref Other//o1, inst+2, unloaded -// CHECK:STDOUT: %import_ref.4: type = import_ref Other//o2, inst+1, loaded [template = constants.%O2] -// CHECK:STDOUT: %import_ref.5: = import_ref Other//o2, inst+4, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.6 = import_ref Other//o2, inst+2, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Other//o1, O1, loaded [template = constants.%O1] +// CHECK:STDOUT: %import_ref.2: = import_ref Other//o1, loc4_11, loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.3 = import_ref Other//o1, inst14 [no loc], unloaded +// CHECK:STDOUT: %import_ref.4: type = import_ref Other//o2, O2, loaded [template = constants.%O2] +// CHECK:STDOUT: %import_ref.5: = import_ref Other//o2, loc4_11, loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.6 = import_ref Other//o2, inst14 [no loc], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -612,9 +612,9 @@ import Other library "o1"; // CHECK:STDOUT: .O1 = %import_ref.1 // CHECK:STDOUT: import Other//o1 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref Other//o1, inst+1, loaded [template = constants.%O1] -// CHECK:STDOUT: %import_ref.2: = import_ref Other//o1, inst+4, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.3 = import_ref Other//o1, inst+2, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Other//o1, O1, loaded [template = constants.%O1] +// CHECK:STDOUT: %import_ref.2: = import_ref Other//o1, loc4_11, loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.3 = import_ref Other//o1, inst14 [no loc], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -681,7 +681,7 @@ import Other library "o1"; // CHECK:STDOUT: --- import_conflict_reverse.carbon // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref = import_ref Main//local_other, inst+1, unloaded +// CHECK:STDOUT: %import_ref = import_ref Main//local_other, Other, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/packages/unused_lazy_import.carbon b/toolchain/check/testdata/packages/unused_lazy_import.carbon index 69c0333416428..7d934b4c1e6c7 100644 --- a/toolchain/check/testdata/packages/unused_lazy_import.carbon +++ b/toolchain/check/testdata/packages/unused_lazy_import.carbon @@ -46,7 +46,7 @@ impl package Implicit; // CHECK:STDOUT: --- implicit.impl.carbon // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref = import_ref Implicit//default, inst+3, unloaded +// CHECK:STDOUT: %import_ref = import_ref Implicit//default, A, unloaded // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... diff --git a/toolchain/check/testdata/pointer/import.carbon b/toolchain/check/testdata/pointer/import.carbon index 284024ba39e27..b8b62dffa9a5d 100644 --- a/toolchain/check/testdata/pointer/import.carbon +++ b/toolchain/check/testdata/pointer/import.carbon @@ -96,8 +96,8 @@ var a: i32* = a_ref; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1 = import_ref Implicit//default, inst+19, unloaded -// CHECK:STDOUT: %import_ref.2: ref %ptr = import_ref Implicit//default, inst+317, loaded +// CHECK:STDOUT: %import_ref.1 = import_ref Implicit//default, a_orig, unloaded +// CHECK:STDOUT: %import_ref.2: ref %ptr = import_ref Implicit//default, a_ref, loaded // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.37 // CHECK:STDOUT: import Core//prelude diff --git a/toolchain/check/testdata/return/no_prelude/import_convert_function.carbon b/toolchain/check/testdata/return/no_prelude/import_convert_function.carbon index 8e86eac38ef1d..a58b729c28841 100644 --- a/toolchain/check/testdata/return/no_prelude/import_convert_function.carbon +++ b/toolchain/check/testdata/return/no_prelude/import_convert_function.carbon @@ -381,14 +381,14 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//default // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type.1 = import_ref Core//default, inst+30, loaded [template = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %import_ref.3 = import_ref Core//default, inst+36, unloaded -// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%Convert.assoc_type (%Convert.assoc_type.1) = import_ref Core//default, inst+60, loaded [symbolic = @ImplicitAs.%assoc0 (constants.%assoc0.3)] -// CHECK:STDOUT: %import_ref.5: @ImplicitAs.%Convert.type (%Convert.type.1) = import_ref Core//default, inst+52, loaded [symbolic = @ImplicitAs.%Convert (constants.%Convert.1)] -// CHECK:STDOUT: %import_ref.6 = import_ref Core//default, inst+52, unloaded -// CHECK:STDOUT: %import_ref.8: type = import_ref Core//default, inst+71, loaded [template = Core.IntLiteral] -// CHECK:STDOUT: %import_ref.9: type = import_ref Core//default, inst+79, loaded [template = constants.%ImplicitAs.type.3] -// CHECK:STDOUT: %import_ref.10: = import_ref Core//default, inst+103, loaded [template = constants.%interface.1] +// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type.1 = import_ref Core//default, ImplicitAs, loaded [template = constants.%ImplicitAs.generic] +// CHECK:STDOUT: %import_ref.3 = import_ref Core//default, inst48 [no loc], unloaded +// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%Convert.assoc_type (%Convert.assoc_type.1) = import_ref Core//default, loc9_32, loaded [symbolic = @ImplicitAs.%assoc0 (constants.%assoc0.3)] +// CHECK:STDOUT: %import_ref.5: @ImplicitAs.%Convert.type (%Convert.type.1) = import_ref Core//default, Convert, loaded [symbolic = @ImplicitAs.%Convert (constants.%Convert.1)] +// CHECK:STDOUT: %import_ref.6 = import_ref Core//default, loc9_32, unloaded +// CHECK:STDOUT: %import_ref.8: type = import_ref Core//default, loc12_17, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.9: type = import_ref Core//default, loc12_36, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.10: = import_ref Core//default, loc12_38, loaded [template = constants.%interface.1] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -1147,46 +1147,46 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: .ImplicitAs = %import_ref.10 // CHECK:STDOUT: import Core//default // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.2: type = import_ref P//library, inst+33, loaded [template = constants.%D] -// CHECK:STDOUT: %import_ref.3: = import_ref P//library, inst+47, loaded [template = constants.%complete_type.1] -// CHECK:STDOUT: %import_ref.4 = import_ref P//library, inst+34, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref P//library, inst+40, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref P//library, inst+45, unloaded -// CHECK:STDOUT: %import_ref.7: %C.type = import_ref P//library, inst+24, loaded [template = constants.%C.generic] -// CHECK:STDOUT: %import_ref.8: = import_ref P//library, inst+31, loaded [template = constants.%complete_type.2] -// CHECK:STDOUT: %import_ref.9 = import_ref P//library, inst+29, unloaded -// CHECK:STDOUT: %import_ref.11 = import_ref Core//default, inst+36, unloaded -// CHECK:STDOUT: %import_ref.12: @ImplicitAs.%Convert.assoc_type (%Convert.assoc_type.1) = import_ref Core//default, inst+60, loaded [symbolic = @ImplicitAs.%assoc0 (constants.%assoc0.3)] -// CHECK:STDOUT: %import_ref.13 = import_ref Core//default, inst+52, unloaded -// CHECK:STDOUT: %import_ref.14 = import_ref Core//default, inst+52, unloaded -// CHECK:STDOUT: %import_ref.16: type = import_ref Core//default, inst+71, loaded [template = Core.IntLiteral] -// CHECK:STDOUT: %import_ref.17: type = import_ref Core//default, inst+79, loaded [template = constants.%ImplicitAs.type.3] -// CHECK:STDOUT: %import_ref.18: = import_ref Core//default, inst+103, loaded [template = constants.%interface.1] -// CHECK:STDOUT: %import_ref.19: type = import_ref P//library, inst+143, loaded [template = constants.%C.2] -// CHECK:STDOUT: %import_ref.20: type = import_ref P//library, inst+148, loaded [template = constants.%ImplicitAs.type.4] -// CHECK:STDOUT: %import_ref.21: = import_ref P//library, inst+169, loaded [template = constants.%interface.2] -// CHECK:STDOUT: %import_ref.22: type = import_ref P//library, inst+186, loaded [template = constants.%C.3] -// CHECK:STDOUT: %import_ref.23: type = import_ref P//library, inst+191, loaded [template = constants.%ImplicitAs.type.4] -// CHECK:STDOUT: %import_ref.24: = import_ref P//library, inst+207, loaded [template = constants.%interface.3] -// CHECK:STDOUT: %import_ref.25: type = import_ref P//library, inst+223, loaded [template = constants.%C.4] -// CHECK:STDOUT: %import_ref.26: type = import_ref P//library, inst+228, loaded [template = constants.%ImplicitAs.type.4] -// CHECK:STDOUT: %import_ref.27: = import_ref P//library, inst+244, loaded [template = constants.%interface.4] -// CHECK:STDOUT: %import_ref.28: type = import_ref P//library, inst+260, loaded [template = constants.%C.5] -// CHECK:STDOUT: %import_ref.29: type = import_ref P//library, inst+265, loaded [template = constants.%ImplicitAs.type.4] -// CHECK:STDOUT: %import_ref.30: = import_ref P//library, inst+281, loaded [template = constants.%interface.5] -// CHECK:STDOUT: %import_ref.31: type = import_ref P//library, inst+297, loaded [template = constants.%C.6] -// CHECK:STDOUT: %import_ref.32: type = import_ref P//library, inst+302, loaded [template = constants.%ImplicitAs.type.4] -// CHECK:STDOUT: %import_ref.33: = import_ref P//library, inst+318, loaded [template = constants.%interface.6] -// CHECK:STDOUT: %import_ref.34: type = import_ref P//library, inst+334, loaded [template = constants.%C.7] -// CHECK:STDOUT: %import_ref.35: type = import_ref P//library, inst+339, loaded [template = constants.%ImplicitAs.type.4] -// CHECK:STDOUT: %import_ref.36: = import_ref P//library, inst+355, loaded [template = constants.%interface.7] -// CHECK:STDOUT: %import_ref.37: type = import_ref P//library, inst+371, loaded [template = constants.%C.8] -// CHECK:STDOUT: %import_ref.38: type = import_ref P//library, inst+376, loaded [template = constants.%ImplicitAs.type.4] -// CHECK:STDOUT: %import_ref.39: = import_ref P//library, inst+392, loaded [template = constants.%interface.8] -// CHECK:STDOUT: %import_ref.40: type = import_ref P//library, inst+408, loaded [template = constants.%C.9] -// CHECK:STDOUT: %import_ref.41: type = import_ref P//library, inst+413, loaded [template = constants.%ImplicitAs.type.4] -// CHECK:STDOUT: %import_ref.42: = import_ref P//library, inst+429, loaded [template = constants.%interface.9] -// CHECK:STDOUT: %import_ref.43: %Make.type = import_ref P//library, inst+54, loaded [template = constants.%Make] +// CHECK:STDOUT: %import_ref.2: type = import_ref P//library, D, loaded [template = constants.%D] +// CHECK:STDOUT: %import_ref.3: = import_ref P//library, loc7_35, loaded [template = constants.%complete_type.1] +// CHECK:STDOUT: %import_ref.4 = import_ref P//library, inst46 [no loc], unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref P//library, loc7_16, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref P//library, loc7_28, unloaded +// CHECK:STDOUT: %import_ref.7: %C.type = import_ref P//library, C, loaded [template = constants.%C.generic] +// CHECK:STDOUT: %import_ref.8: = import_ref P//library, loc6_19, loaded [template = constants.%complete_type.2] +// CHECK:STDOUT: %import_ref.9 = import_ref P//library, inst41 [no loc], unloaded +// CHECK:STDOUT: %import_ref.11 = import_ref Core//default, inst48 [no loc], unloaded +// CHECK:STDOUT: %import_ref.12: @ImplicitAs.%Convert.assoc_type (%Convert.assoc_type.1) = import_ref Core//default, loc9_32, loaded [symbolic = @ImplicitAs.%assoc0 (constants.%assoc0.3)] +// CHECK:STDOUT: %import_ref.13 = import_ref Core//default, Convert, unloaded +// CHECK:STDOUT: %import_ref.14 = import_ref Core//default, loc9_32, unloaded +// CHECK:STDOUT: %import_ref.16: type = import_ref Core//default, loc12_17, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.17: type = import_ref Core//default, loc12_36, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.18: = import_ref Core//default, loc12_38, loaded [template = constants.%interface.1] +// CHECK:STDOUT: %import_ref.19: type = import_ref P//library, loc10_9, loaded [template = constants.%C.2] +// CHECK:STDOUT: %import_ref.20: type = import_ref P//library, loc10_31, loaded [template = constants.%ImplicitAs.type.4] +// CHECK:STDOUT: %import_ref.21: = import_ref P//library, loc10_33, loaded [template = constants.%interface.2] +// CHECK:STDOUT: %import_ref.22: type = import_ref P//library, loc11_9, loaded [template = constants.%C.3] +// CHECK:STDOUT: %import_ref.23: type = import_ref P//library, loc11_31, loaded [template = constants.%ImplicitAs.type.4] +// CHECK:STDOUT: %import_ref.24: = import_ref P//library, loc11_33, loaded [template = constants.%interface.3] +// CHECK:STDOUT: %import_ref.25: type = import_ref P//library, loc12_9, loaded [template = constants.%C.4] +// CHECK:STDOUT: %import_ref.26: type = import_ref P//library, loc12_31, loaded [template = constants.%ImplicitAs.type.4] +// CHECK:STDOUT: %import_ref.27: = import_ref P//library, loc12_33, loaded [template = constants.%interface.4] +// CHECK:STDOUT: %import_ref.28: type = import_ref P//library, loc13_9, loaded [template = constants.%C.5] +// CHECK:STDOUT: %import_ref.29: type = import_ref P//library, loc13_31, loaded [template = constants.%ImplicitAs.type.4] +// CHECK:STDOUT: %import_ref.30: = import_ref P//library, loc13_33, loaded [template = constants.%interface.5] +// CHECK:STDOUT: %import_ref.31: type = import_ref P//library, loc14_9, loaded [template = constants.%C.6] +// CHECK:STDOUT: %import_ref.32: type = import_ref P//library, loc14_31, loaded [template = constants.%ImplicitAs.type.4] +// CHECK:STDOUT: %import_ref.33: = import_ref P//library, loc14_33, loaded [template = constants.%interface.6] +// CHECK:STDOUT: %import_ref.34: type = import_ref P//library, loc15_9, loaded [template = constants.%C.7] +// CHECK:STDOUT: %import_ref.35: type = import_ref P//library, loc15_31, loaded [template = constants.%ImplicitAs.type.4] +// CHECK:STDOUT: %import_ref.36: = import_ref P//library, loc15_33, loaded [template = constants.%interface.7] +// CHECK:STDOUT: %import_ref.37: type = import_ref P//library, loc16_9, loaded [template = constants.%C.8] +// CHECK:STDOUT: %import_ref.38: type = import_ref P//library, loc16_31, loaded [template = constants.%ImplicitAs.type.4] +// CHECK:STDOUT: %import_ref.39: = import_ref P//library, loc16_33, loaded [template = constants.%interface.8] +// CHECK:STDOUT: %import_ref.40: type = import_ref P//library, loc17_9, loaded [template = constants.%C.9] +// CHECK:STDOUT: %import_ref.41: type = import_ref P//library, loc17_31, loaded [template = constants.%ImplicitAs.type.4] +// CHECK:STDOUT: %import_ref.42: = import_ref P//library, loc17_33, loaded [template = constants.%interface.9] +// CHECK:STDOUT: %import_ref.43: %Make.type = import_ref P//library, Make, loaded [template = constants.%Make] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/struct/import.carbon b/toolchain/check/testdata/struct/import.carbon index ce8cb8d5b6987..ca557774bf9fd 100644 --- a/toolchain/check/testdata/struct/import.carbon +++ b/toolchain/check/testdata/struct/import.carbon @@ -43,10 +43,10 @@ var c_bad: C({.c = 1, .d = 2}) = F(); // --- fail_bad_value.impl.carbon impl package Implicit; -// CHECK:STDERR: fail_bad_value.impl.carbon:[[@LINE+6]]:1: error: cannot implicitly convert from `C()` to `C()` [ImplicitAsConversionFailure] +// CHECK:STDERR: fail_bad_value.impl.carbon:[[@LINE+6]]:1: error: cannot implicitly convert from `C()` to `C()` [ImplicitAsConversionFailure] // CHECK:STDERR: var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_bad_value.impl.carbon:[[@LINE+3]]:1: note: type `C()` does not implement interface `ImplicitAs(C())` [MissingImplInMemberAccessNote] +// CHECK:STDERR: fail_bad_value.impl.carbon:[[@LINE+3]]:1: note: type `C()` does not implement interface `ImplicitAs(C())` [MissingImplInMemberAccessNote] // CHECK:STDERR: var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ var c_bad: C({.a = 3, .b = 4}) = F(); @@ -305,18 +305,18 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: ref %struct_type.a = import_ref Implicit//default, inst+21, loaded -// CHECK:STDOUT: %import_ref.2: ref %struct_type.a.d.1 = import_ref Implicit//default, inst+342, loaded -// CHECK:STDOUT: %import_ref.3: %C.type = import_ref Implicit//default, inst+401, loaded [template = constants.%C.generic] -// CHECK:STDOUT: %import_ref.4: %F.type = import_ref Implicit//default, inst+445, loaded [template = constants.%F] +// CHECK:STDOUT: %import_ref.1: ref %struct_type.a = import_ref Implicit//default, a_ref, loaded +// CHECK:STDOUT: %import_ref.2: ref %struct_type.a.d.1 = import_ref Implicit//default, b_ref, loaded +// CHECK:STDOUT: %import_ref.3: %C.type = import_ref Implicit//default, C, loaded [template = constants.%C.generic] +// CHECK:STDOUT: %import_ref.4: %F.type = import_ref Implicit//default, F, loaded [template = constants.%F] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.39 // CHECK:STDOUT: .ImplicitAs = %import_ref.42 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.40: = import_ref Implicit//default, inst+408, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.41 = import_ref Implicit//default, inst+406, unloaded +// CHECK:STDOUT: %import_ref.40: = import_ref Implicit//default, loc8_34, loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.41 = import_ref Implicit//default, inst418 [no loc], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -470,16 +470,16 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1 = import_ref Implicit//default, inst+21, unloaded -// CHECK:STDOUT: %import_ref.2 = import_ref Implicit//default, inst+342, unloaded -// CHECK:STDOUT: %import_ref.3: %C.type = import_ref Implicit//default, inst+401, loaded [template = constants.%C.generic] -// CHECK:STDOUT: %import_ref.4: %F.type = import_ref Implicit//default, inst+445, loaded [template = constants.%F] +// CHECK:STDOUT: %import_ref.1 = import_ref Implicit//default, a_ref, unloaded +// CHECK:STDOUT: %import_ref.2 = import_ref Implicit//default, b_ref, unloaded +// CHECK:STDOUT: %import_ref.3: %C.type = import_ref Implicit//default, C, loaded [template = constants.%C.generic] +// CHECK:STDOUT: %import_ref.4: %F.type = import_ref Implicit//default, F, loaded [template = constants.%F] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.39: = import_ref Implicit//default, inst+408, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.40 = import_ref Implicit//default, inst+406, unloaded +// CHECK:STDOUT: %import_ref.39: = import_ref Implicit//default, loc8_34, loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.40 = import_ref Implicit//default, inst418 [no loc], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -574,17 +574,17 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1 = import_ref Implicit//default, inst+21, unloaded -// CHECK:STDOUT: %import_ref.2 = import_ref Implicit//default, inst+342, unloaded -// CHECK:STDOUT: %import_ref.3: %C.type = import_ref Implicit//default, inst+401, loaded [template = constants.%C.generic] -// CHECK:STDOUT: %import_ref.4: %F.type = import_ref Implicit//default, inst+445, loaded [template = constants.%F] +// CHECK:STDOUT: %import_ref.1 = import_ref Implicit//default, a_ref, unloaded +// CHECK:STDOUT: %import_ref.2 = import_ref Implicit//default, b_ref, unloaded +// CHECK:STDOUT: %import_ref.3: %C.type = import_ref Implicit//default, C, loaded [template = constants.%C.generic] +// CHECK:STDOUT: %import_ref.4: %F.type = import_ref Implicit//default, F, loaded [template = constants.%F] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .ImplicitAs = %import_ref.41 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.39: = import_ref Implicit//default, inst+408, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.40 = import_ref Implicit//default, inst+406, unloaded +// CHECK:STDOUT: %import_ref.39: = import_ref Implicit//default, loc8_34, loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.40 = import_ref Implicit//default, inst418 [no loc], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/tuple/import.carbon b/toolchain/check/testdata/tuple/import.carbon index d14cd2d38aec7..d9e569e9e9e0a 100644 --- a/toolchain/check/testdata/tuple/import.carbon +++ b/toolchain/check/testdata/tuple/import.carbon @@ -45,10 +45,10 @@ var c_bad: C((1, 2, 3)) = F(); impl package Implicit; -// CHECK:STDERR: fail_bad_value.impl.carbon:[[@LINE+6]]:1: error: cannot implicitly convert from `C()` to `C()` [ImplicitAsConversionFailure] +// CHECK:STDERR: fail_bad_value.impl.carbon:[[@LINE+6]]:1: error: cannot implicitly convert from `C()` to `C()` [ImplicitAsConversionFailure] // CHECK:STDERR: var c_bad: C((3, 4)) = F(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_bad_value.impl.carbon:[[@LINE+3]]:1: note: type `C()` does not implement interface `ImplicitAs(C())` [MissingImplInMemberAccessNote] +// CHECK:STDERR: fail_bad_value.impl.carbon:[[@LINE+3]]:1: note: type `C()` does not implement interface `ImplicitAs(C())` [MissingImplInMemberAccessNote] // CHECK:STDERR: var c_bad: C((3, 4)) = F(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~ var c_bad: C((3, 4)) = F(); @@ -336,18 +336,18 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: ref %tuple.type.2 = import_ref Implicit//default, inst+23, loaded -// CHECK:STDOUT: %import_ref.2: ref %tuple.type.8 = import_ref Implicit//default, inst+355, loaded -// CHECK:STDOUT: %import_ref.3: %C.type = import_ref Implicit//default, inst+438, loaded [template = constants.%C.generic] -// CHECK:STDOUT: %import_ref.4: %F.type = import_ref Implicit//default, inst+472, loaded [template = constants.%F] +// CHECK:STDOUT: %import_ref.1: ref %tuple.type.2 = import_ref Implicit//default, a_ref, loaded +// CHECK:STDOUT: %import_ref.2: ref %tuple.type.8 = import_ref Implicit//default, b_ref, loaded +// CHECK:STDOUT: %import_ref.3: %C.type = import_ref Implicit//default, C, loaded [template = constants.%C.generic] +// CHECK:STDOUT: %import_ref.4: %F.type = import_ref Implicit//default, F, loaded [template = constants.%F] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.39 // CHECK:STDOUT: .ImplicitAs = %import_ref.42 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.40: = import_ref Implicit//default, inst+445, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.41 = import_ref Implicit//default, inst+443, unloaded +// CHECK:STDOUT: %import_ref.40: = import_ref Implicit//default, loc7_26, loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.41 = import_ref Implicit//default, inst455 [no loc], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -519,16 +519,16 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1 = import_ref Implicit//default, inst+23, unloaded -// CHECK:STDOUT: %import_ref.2 = import_ref Implicit//default, inst+355, unloaded -// CHECK:STDOUT: %import_ref.3: %C.type = import_ref Implicit//default, inst+438, loaded [template = constants.%C.generic] -// CHECK:STDOUT: %import_ref.4: %F.type = import_ref Implicit//default, inst+472, loaded [template = constants.%F] +// CHECK:STDOUT: %import_ref.1 = import_ref Implicit//default, a_ref, unloaded +// CHECK:STDOUT: %import_ref.2 = import_ref Implicit//default, b_ref, unloaded +// CHECK:STDOUT: %import_ref.3: %C.type = import_ref Implicit//default, C, loaded [template = constants.%C.generic] +// CHECK:STDOUT: %import_ref.4: %F.type = import_ref Implicit//default, F, loaded [template = constants.%F] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.39: = import_ref Implicit//default, inst+445, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.40 = import_ref Implicit//default, inst+443, unloaded +// CHECK:STDOUT: %import_ref.39: = import_ref Implicit//default, loc7_26, loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.40 = import_ref Implicit//default, inst455 [no loc], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -624,17 +624,17 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1 = import_ref Implicit//default, inst+23, unloaded -// CHECK:STDOUT: %import_ref.2 = import_ref Implicit//default, inst+355, unloaded -// CHECK:STDOUT: %import_ref.3: %C.type = import_ref Implicit//default, inst+438, loaded [template = constants.%C.generic] -// CHECK:STDOUT: %import_ref.4: %F.type = import_ref Implicit//default, inst+472, loaded [template = constants.%F] +// CHECK:STDOUT: %import_ref.1 = import_ref Implicit//default, a_ref, unloaded +// CHECK:STDOUT: %import_ref.2 = import_ref Implicit//default, b_ref, unloaded +// CHECK:STDOUT: %import_ref.3: %C.type = import_ref Implicit//default, C, loaded [template = constants.%C.generic] +// CHECK:STDOUT: %import_ref.4: %F.type = import_ref Implicit//default, F, loaded [template = constants.%F] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .ImplicitAs = %import_ref.41 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.39: = import_ref Implicit//default, inst+445, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.40 = import_ref Implicit//default, inst+443, unloaded +// CHECK:STDOUT: %import_ref.39: = import_ref Implicit//default, loc7_26, loaded [template = constants.%complete_type] +// CHECK:STDOUT: %import_ref.40 = import_ref Implicit//default, inst455 [no loc], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/var/no_prelude/export_name.carbon b/toolchain/check/testdata/var/no_prelude/export_name.carbon index 714b13c9024b8..545a88848440d 100644 --- a/toolchain/check/testdata/var/no_prelude/export_name.carbon +++ b/toolchain/check/testdata/var/no_prelude/export_name.carbon @@ -66,7 +66,7 @@ var w: () = v; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref: ref %empty_tuple.type = import_ref Main//base, inst+5, loaded +// CHECK:STDOUT: %import_ref: ref %empty_tuple.type = import_ref Main//base, v, loaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -85,7 +85,7 @@ var w: () = v; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref: ref %empty_tuple.type = import_ref Main//export, inst+4, loaded [template = ] +// CHECK:STDOUT: %import_ref: ref %empty_tuple.type = import_ref Main//export, v, loaded [template = ] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/var/no_prelude/import.carbon b/toolchain/check/testdata/var/no_prelude/import.carbon index a4ea7a0052bff..cff135b7b45f7 100644 --- a/toolchain/check/testdata/var/no_prelude/import.carbon +++ b/toolchain/check/testdata/var/no_prelude/import.carbon @@ -54,7 +54,7 @@ var a: () = a_ref; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref: ref %empty_tuple.type = import_ref Implicit//default, inst+5, loaded +// CHECK:STDOUT: %import_ref: ref %empty_tuple.type = import_ref Implicit//default, a_ref, loaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/var/no_prelude/import_access.carbon b/toolchain/check/testdata/var/no_prelude/import_access.carbon index d18c8f20c3fb7..35eb8a1e25868 100644 --- a/toolchain/check/testdata/var/no_prelude/import_access.carbon +++ b/toolchain/check/testdata/var/no_prelude/import_access.carbon @@ -85,7 +85,7 @@ var v2: () = Test.v; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref: ref %empty_tuple.type = import_ref Test//def, inst+5, loaded +// CHECK:STDOUT: %import_ref: ref %empty_tuple.type = import_ref Test//def, v, loaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/where_expr/constraints.carbon b/toolchain/check/testdata/where_expr/constraints.carbon index 2e58038f6530c..a005cf801d235 100644 --- a/toolchain/check/testdata/where_expr/constraints.carbon +++ b/toolchain/check/testdata/where_expr/constraints.carbon @@ -575,17 +575,17 @@ fn NotEmptyStruct() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Main//state_constraints, inst+3, loaded [template = constants.%J.type] -// CHECK:STDOUT: %import_ref.2 = import_ref Main//state_constraints, inst+7, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref Main//state_constraints, inst+35, unloaded -// CHECK:STDOUT: %import_ref.4: %Impls.type = import_ref Main//state_constraints, inst+57, loaded [template = constants.%Impls] -// CHECK:STDOUT: %import_ref.5 = import_ref Main//state_constraints, inst+85, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Main//state_constraints, J, loaded [template = constants.%J.type] +// CHECK:STDOUT: %import_ref.2 = import_ref Main//state_constraints, I, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref Main//state_constraints, EqualEqual, unloaded +// CHECK:STDOUT: %import_ref.4: %Impls.type = import_ref Main//state_constraints, Impls, loaded [template = constants.%Impls] +// CHECK:STDOUT: %import_ref.5 = import_ref Main//state_constraints, And, unloaded // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .ImplicitAs = %import_ref.7 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.6 = import_ref Main//state_constraints, inst+5, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Main//state_constraints, inst17 [no loc], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/where_expr/equal_rewrite.carbon b/toolchain/check/testdata/where_expr/equal_rewrite.carbon index 861a2deedbe45..21d6e3d66dd1c 100644 --- a/toolchain/check/testdata/where_expr/equal_rewrite.carbon +++ b/toolchain/check/testdata/where_expr/equal_rewrite.carbon @@ -1084,10 +1084,10 @@ let K: (E where .F = .Self.G) = bool; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1 = import_ref Main//equal_constraint, inst+3, unloaded -// CHECK:STDOUT: %import_ref.2: %Equal.type = import_ref Main//equal_constraint, inst+33, loaded [template = constants.%Equal] -// CHECK:STDOUT: %import_ref.3 = import_ref Main//nested_rewrites, inst+3, unloaded -// CHECK:STDOUT: %import_ref.4: %NestedRewrite.type = import_ref Main//nested_rewrites, inst+55, loaded [template = constants.%NestedRewrite] +// CHECK:STDOUT: %import_ref.1 = import_ref Main//equal_constraint, N, unloaded +// CHECK:STDOUT: %import_ref.2: %Equal.type = import_ref Main//equal_constraint, Equal, loaded [template = constants.%Equal] +// CHECK:STDOUT: %import_ref.3 = import_ref Main//nested_rewrites, A, unloaded +// CHECK:STDOUT: %import_ref.4: %NestedRewrite.type = import_ref Main//nested_rewrites, NestedRewrite, loaded [template = constants.%NestedRewrite] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Bool = %import_ref.8 // CHECK:STDOUT: .ImplicitAs = %import_ref.9 @@ -1095,14 +1095,14 @@ let K: (E where .F = .Self.G) = bool; // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.5 = import_ref Main//equal_constraint, inst+5, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Main//equal_constraint, inst+9, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref Main//equal_constraint, inst+7, unloaded -// CHECK:STDOUT: %import_ref.45 = import_ref Main//nested_rewrites, inst+5, unloaded -// CHECK:STDOUT: %import_ref.46 = import_ref Main//nested_rewrites, inst+9, unloaded -// CHECK:STDOUT: %import_ref.47 = import_ref Main//nested_rewrites, inst+12, unloaded -// CHECK:STDOUT: %import_ref.48 = import_ref Main//nested_rewrites, inst+7, unloaded -// CHECK:STDOUT: %import_ref.49 = import_ref Main//nested_rewrites, inst+11, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref Main//equal_constraint, inst17 [no loc], unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Main//equal_constraint, loc5_15, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Main//equal_constraint, P, unloaded +// CHECK:STDOUT: %import_ref.45 = import_ref Main//nested_rewrites, inst17 [no loc], unloaded +// CHECK:STDOUT: %import_ref.46 = import_ref Main//nested_rewrites, loc5_15, unloaded +// CHECK:STDOUT: %import_ref.47 = import_ref Main//nested_rewrites, loc6_15, unloaded +// CHECK:STDOUT: %import_ref.48 = import_ref Main//nested_rewrites, B, unloaded +// CHECK:STDOUT: %import_ref.49 = import_ref Main//nested_rewrites, C, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/driver/compile_subcommand.cpp b/toolchain/driver/compile_subcommand.cpp index 155a5d0b2855f..3df5f5f182253 100644 --- a/toolchain/driver/compile_subcommand.cpp +++ b/toolchain/driver/compile_subcommand.cpp @@ -440,8 +440,8 @@ class CompilationUnit { CARBON_CHECK(node_converter_, "Must call PreCheck first"); CARBON_CHECK(!sem_ir_converter_, "Called GetCheckUnit twice"); - sem_ir_.emplace(check_ir_id, parse_tree_->packaging_decl(), value_stores_, - input_filename_); + sem_ir_.emplace(&*parse_tree_, check_ir_id, parse_tree_->packaging_decl(), + value_stores_, input_filename_); if (mem_usage_) { mem_usage_->Collect("sem_ir_", *sem_ir_); } @@ -450,8 +450,6 @@ class CompilationUnit { return {.consumer = consumer_, .value_stores = &value_stores_, .timings = timings_ ? &*timings_ : nullptr, - .tokens = &*tokens_, - .parse_tree = &*parse_tree_, .get_parse_tree_and_subtrees = *get_parse_tree_and_subtrees_, .sem_ir = &*sem_ir_, .node_converter = &*node_converter_, @@ -500,8 +498,7 @@ class CompilationUnit { } }; - SemIR::Formatter formatter(*tokens_, *parse_tree_, *sem_ir_, - should_format_entity); + SemIR::Formatter formatter(&*sem_ir_, should_format_entity); if (vlog_stream_) { CARBON_VLOG("*** SemIR::File ***\n"); formatter.Print(*vlog_stream_); @@ -524,7 +521,7 @@ class CompilationUnit { llvm_context_ = std::make_unique(); // TODO: Consider disabling instruction naming by default if we're not // producing textual LLVM IR. - SemIR::InstNamer inst_namer(*tokens_, *parse_tree_, *sem_ir_); + SemIR::InstNamer inst_namer(&*sem_ir_); module_ = Lower::LowerToLLVM(*llvm_context_, options_.include_debug_info, *sem_ir_converter_, input_filename_, *sem_ir_, &inst_namer, vlog_stream_); diff --git a/toolchain/parse/tree.h b/toolchain/parse/tree.h index 40082acb1b210..7cbdb25e3afa9 100644 --- a/toolchain/parse/tree.h +++ b/toolchain/parse/tree.h @@ -190,6 +190,8 @@ class Tree : public Printable { // CHECK so that it can be used within a debugger. auto Verify() const -> ErrorOr; + auto tokens() const -> const Lex::TokenizedBuffer& { return *tokens_; } + private: friend class Context; friend class TypedNodesTestPeer; diff --git a/toolchain/sem_ir/file.cpp b/toolchain/sem_ir/file.cpp index 297c00b8c95b6..fc36832250679 100644 --- a/toolchain/sem_ir/file.cpp +++ b/toolchain/sem_ir/file.cpp @@ -18,10 +18,11 @@ namespace Carbon::SemIR { -File::File(CheckIRId check_ir_id, +File::File(const Parse::Tree* parse_tree, CheckIRId check_ir_id, const std::optional& packaging_decl, SharedValueStores& value_stores, std::string filename) - : check_ir_id_(check_ir_id), + : parse_tree_(parse_tree), + check_ir_id_(check_ir_id), package_id_(packaging_decl ? packaging_decl->names.package_id : IdentifierId::Invalid), library_id_(packaging_decl ? LibraryNameId::ForStringLiteralValueId( diff --git a/toolchain/sem_ir/file.h b/toolchain/sem_ir/file.h index 528ff15e1eb93..c624a705e8e6a 100644 --- a/toolchain/sem_ir/file.h +++ b/toolchain/sem_ir/file.h @@ -39,7 +39,7 @@ namespace Carbon::SemIR { class File : public Printable { public: // Starts a new file for Check::CheckParseTree. - explicit File(CheckIRId check_ir_id, + explicit File(const Parse::Tree* parse_tree, CheckIRId check_ir_id, const std::optional& packaging_decl, SharedValueStores& value_stores, std::string filename); @@ -181,7 +181,11 @@ class File : public Printable { auto filename() const -> llvm::StringRef { return filename_; } + auto parse_tree() const -> const Parse::Tree& { return *parse_tree_; } + private: + const Parse::Tree* parse_tree_; + // True if parts of the IR may be invalid. bool has_errors_ = false; diff --git a/toolchain/sem_ir/formatter.cpp b/toolchain/sem_ir/formatter.cpp index bbf53905b8016..49f1fd5d052f0 100644 --- a/toolchain/sem_ir/formatter.cpp +++ b/toolchain/sem_ir/formatter.cpp @@ -25,7 +25,7 @@ namespace Carbon::SemIR { // Formatter for printing textual Semantics IR. class FormatterImpl { public: - explicit FormatterImpl(const File& sem_ir, InstNamer* inst_namer, + explicit FormatterImpl(const File* sem_ir, InstNamer* inst_namer, Formatter::ShouldFormatEntityFn should_format_entity, int indent) : sem_ir_(sem_ir), @@ -35,7 +35,7 @@ class FormatterImpl { // Create the first chunk and assign it to all instructions that don't have // a chunk of their own. auto first_chunk = AddChunkNoFlush(true); - tentative_inst_chunks_.resize(sem_ir.insts().size(), first_chunk); + tentative_inst_chunks_.resize(sem_ir_->insts().size(), first_chunk); } // Prints the SemIR. @@ -44,12 +44,12 @@ class FormatterImpl { // including file-scoped instructions. The file scope may contain entity // declarations which are defined later, such as classes. auto Format() -> void { - out_ << "--- " << sem_ir_.filename() << "\n\n"; + out_ << "--- " << sem_ir_->filename() << "\n\n"; FormatScopeIfUsed(InstNamer::ScopeId::Constants, - sem_ir_.constants().array_ref()); + sem_ir_->constants().array_ref()); FormatScopeIfUsed(InstNamer::ScopeId::ImportRefs, - sem_ir_.inst_blocks().Get(InstBlockId::ImportRefs)); + sem_ir_->inst_blocks().Get(InstBlockId::ImportRefs)); out_ << inst_namer_->GetScopeName(InstNamer::ScopeId::File) << " "; OpenBrace(); @@ -57,7 +57,7 @@ class FormatterImpl { // TODO: Handle the case where there are multiple top-level instruction // blocks. For example, there may be branching in the initializer of a // global or a type expression. - if (auto block_id = sem_ir_.top_inst_block_id(); block_id.is_valid()) { + if (auto block_id = sem_ir_->top_inst_block_id(); block_id.is_valid()) { llvm::SaveAndRestore file_scope(scope_, InstNamer::ScopeId::File); FormatCodeBlock(block_id); } @@ -65,23 +65,23 @@ class FormatterImpl { CloseBrace(); out_ << '\n'; - for (int i : llvm::seq(sem_ir_.interfaces().size())) { + for (int i : llvm::seq(sem_ir_->interfaces().size())) { FormatInterface(InterfaceId(i)); } - for (int i : llvm::seq(sem_ir_.impls().size())) { + for (int i : llvm::seq(sem_ir_->impls().size())) { FormatImpl(ImplId(i)); } - for (int i : llvm::seq(sem_ir_.classes().size())) { + for (int i : llvm::seq(sem_ir_->classes().size())) { FormatClass(ClassId(i)); } - for (int i : llvm::seq(sem_ir_.functions().size())) { + for (int i : llvm::seq(sem_ir_->functions().size())) { FormatFunction(FunctionId(i)); } - for (int i : llvm::seq(sem_ir_.specifics().size())) { + for (int i : llvm::seq(sem_ir_->specifics().size())) { FormatSpecific(SpecificId(i)); } @@ -258,7 +258,7 @@ class FormatterImpl { // Formats a full class. auto FormatClass(ClassId id) -> void { - const Class& class_info = sem_ir_.classes().Get(id); + const Class& class_info = sem_ir_->classes().Get(id); if (!ShouldFormatEntity(class_info)) { return; } @@ -289,7 +289,7 @@ class FormatterImpl { // Formats a full interface. auto FormatInterface(InterfaceId id) -> void { - const Interface& interface_info = sem_ir_.interfaces().Get(id); + const Interface& interface_info = sem_ir_->interfaces().Get(id); if (!ShouldFormatEntity(interface_info)) { return; } @@ -325,7 +325,7 @@ class FormatterImpl { // Formats a full impl. auto FormatImpl(ImplId id) -> void { - const Impl& impl_info = sem_ir_.impls().Get(id); + const Impl& impl_info = sem_ir_->impls().Get(id); if (!ShouldFormatEntity(impl_info)) { return; } @@ -368,7 +368,7 @@ class FormatterImpl { // Formats a full function. auto FormatFunction(FunctionId id) -> void { - const Function& fn = sem_ir_.functions().Get(id); + const Function& fn = sem_ir_->functions().Get(id); if (!ShouldFormatEntity(fn)) { return; } @@ -400,13 +400,13 @@ class FormatterImpl { if (fn.return_slot_pattern_id.is_valid()) { out_ << " -> "; - auto return_info = ReturnTypeInfo::ForFunction(sem_ir_, fn); + auto return_info = ReturnTypeInfo::ForFunction(*sem_ir_, fn); if (!fn.body_block_ids.empty() && return_info.is_valid() && return_info.has_return_slot()) { FormatName(fn.return_slot_pattern_id); out_ << ": "; } - FormatType(sem_ir_.insts().Get(fn.return_slot_pattern_id).type_id()); + FormatType(sem_ir_->insts().Get(fn.return_slot_pattern_id).type_id()); } if (fn.builtin_function_kind != BuiltinFunctionKind::None) { @@ -450,8 +450,8 @@ class FormatterImpl { out_ << "!" << region_name << ":\n"; } for (auto [generic_inst_id, specific_inst_id] : llvm::zip_longest( - sem_ir_.inst_blocks().GetOrEmpty(generic.GetEvalBlock(region)), - sem_ir_.inst_blocks().GetOrEmpty( + sem_ir_->inst_blocks().GetOrEmpty(generic.GetEvalBlock(region)), + sem_ir_->inst_blocks().GetOrEmpty( specific.GetValueBlock(region)))) { Indent(); if (generic_inst_id) { @@ -471,8 +471,8 @@ class FormatterImpl { // Formats a full specific. auto FormatSpecific(SpecificId id) -> void { - const auto& specific = sem_ir_.specifics().Get(id); - const auto& generic = sem_ir_.generics().Get(specific.generic_id); + const auto& specific = sem_ir_->specifics().Get(id); + const auto& generic = sem_ir_->generics().Get(specific.generic_id); if (!should_format_entity_(generic.decl_id)) { // Omit specifics if we also omitted the generic. return; @@ -500,7 +500,7 @@ class FormatterImpl { // Handles generic-specific setup for FormatEntityStart. auto FormatGenericStart(llvm::StringRef entity_kind, GenericId generic_id) -> void { - const auto& generic = sem_ir_.generics().Get(generic_id); + const auto& generic = sem_ir_->generics().Get(generic_id); out_ << "\n"; Indent(); out_ << "generic " << entity_kind << " "; @@ -529,11 +529,12 @@ class FormatterImpl { // If this entity was imported from a different IR, annotate the name of // that IR in the output before the `{` or `;`. if (entity.first_owning_decl_id.is_valid()) { - auto loc_id = sem_ir_.insts().GetLocId(entity.first_owning_decl_id); + auto loc_id = sem_ir_->insts().GetLocId(entity.first_owning_decl_id); if (loc_id.is_import_ir_inst_id()) { auto import_ir_id = - sem_ir_.import_ir_insts().Get(loc_id.import_ir_inst_id()).ir_id; - const auto* import_file = sem_ir_.import_irs().Get(import_ir_id).sem_ir; + sem_ir_->import_ir_insts().Get(loc_id.import_ir_inst_id()).ir_id; + const auto* import_file = + sem_ir_->import_irs().Get(import_ir_id).sem_ir; pending_imported_from_ = import_file->filename(); } } @@ -575,19 +576,19 @@ class FormatterImpl { out_ << (is_implicit ? "[" : "("); llvm::ListSeparator sep; - for (InstId param_id : sem_ir_.inst_blocks().Get(param_patterns_id)) { + for (InstId param_id : sem_ir_->inst_blocks().Get(param_patterns_id)) { out_ << sep; if (!param_id.is_valid()) { out_ << "invalid"; continue; } - if (auto addr = sem_ir_.insts().TryGetAs(param_id)) { + if (auto addr = sem_ir_->insts().TryGetAs(param_id)) { out_ << "addr "; param_id = addr->inner_id; } FormatName(param_id); out_ << ": "; - FormatType(sem_ir_.insts().Get(param_id).type_id()); + FormatType(sem_ir_->insts().Get(param_id).type_id()); } out_ << (is_implicit ? "]" : ")"); @@ -595,7 +596,7 @@ class FormatterImpl { // Prints instructions for a code block. auto FormatCodeBlock(InstBlockId block_id) -> void { - for (const InstId inst_id : sem_ir_.inst_blocks().GetOrEmpty(block_id)) { + for (const InstId inst_id : sem_ir_->inst_blocks().GetOrEmpty(block_id)) { FormatInst(inst_id); } } @@ -611,7 +612,7 @@ class FormatterImpl { // Prints the contents of a name scope, with an optional label. auto FormatNameScope(NameScopeId id, llvm::StringRef label = "") -> void { - const auto& scope = sem_ir_.name_scopes().Get(id); + const auto& scope = sem_ir_->name_scopes().Get(id); if (scope.names.empty() && scope.extended_scopes.empty() && scope.import_ir_scopes.empty() && !scope.has_error) { @@ -684,7 +685,7 @@ class FormatterImpl { return; } - FormatInst(inst_id, sem_ir_.insts().Get(inst_id)); + FormatInst(inst_id, sem_ir_->insts().Get(inst_id)); } auto FormatInst(InstId inst_id, Inst inst) -> void { @@ -703,9 +704,9 @@ class FormatterImpl { Indent(); FormatInstLHS(inst_id, inst); out_ << InstT::Kind.ir_name(); - pending_constant_value_ = sem_ir_.constant_values().Get(inst_id); + pending_constant_value_ = sem_ir_->constant_values().Get(inst_id); pending_constant_value_is_self_ = - sem_ir_.constant_values().GetInstIdIfValid(pending_constant_value_) == + sem_ir_->constant_values().GetInstIdIfValid(pending_constant_value_) == inst_id; FormatInstRHS(inst); FormatPendingConstantValue(AddSpace::Before); @@ -774,7 +775,7 @@ class FormatterImpl { case InstValueKind::Typed: FormatName(inst_id); out_ << ": "; - switch (GetExprCategory(sem_ir_, inst_id)) { + switch (GetExprCategory(*sem_ir_, inst_id)) { case ExprCategory::NotExpr: case ExprCategory::Error: case ExprCategory::Value: @@ -898,9 +899,9 @@ class FormatterImpl { return; } - llvm::ArrayRef args = sem_ir_.inst_blocks().Get(inst.args_id); + llvm::ArrayRef args = sem_ir_->inst_blocks().Get(inst.args_id); - auto return_info = ReturnTypeInfo::ForType(sem_ir_, inst.type_id); + auto return_info = ReturnTypeInfo::ForType(*sem_ir_, inst.type_id); bool has_return_slot = return_info.has_return_slot(); InstId return_slot_arg_id = InstId::Invalid; if (has_return_slot) { @@ -975,7 +976,7 @@ class FormatterImpl { llvm::SaveAndRestore class_scope( scope_, inst_namer_->GetScopeFor(inst.function_id)); FormatTrailingBlock( - sem_ir_.functions().Get(inst.function_id).pattern_block_id); + sem_ir_->functions().Get(inst.function_id).pattern_block_id); FormatTrailingBlock(inst.decl_block_id); } @@ -983,7 +984,7 @@ class FormatterImpl { FormatArgs(inst.class_id); llvm::SaveAndRestore class_scope(scope_, inst_namer_->GetScopeFor(inst.class_id)); - FormatTrailingBlock(sem_ir_.classes().Get(inst.class_id).pattern_block_id); + FormatTrailingBlock(sem_ir_->classes().Get(inst.class_id).pattern_block_id); FormatTrailingBlock(inst.decl_block_id); } @@ -991,7 +992,7 @@ class FormatterImpl { FormatArgs(inst.impl_id); llvm::SaveAndRestore class_scope(scope_, inst_namer_->GetScopeFor(inst.impl_id)); - FormatTrailingBlock(sem_ir_.impls().Get(inst.impl_id).pattern_block_id); + FormatTrailingBlock(sem_ir_->impls().Get(inst.impl_id).pattern_block_id); FormatTrailingBlock(inst.decl_block_id); } @@ -1000,31 +1001,63 @@ class FormatterImpl { llvm::SaveAndRestore class_scope( scope_, inst_namer_->GetScopeFor(inst.interface_id)); FormatTrailingBlock( - sem_ir_.interfaces().Get(inst.interface_id).pattern_block_id); + sem_ir_->interfaces().Get(inst.interface_id).pattern_block_id); FormatTrailingBlock(inst.decl_block_id); } auto FormatInstRHS(IntValue inst) -> void { out_ << " "; - sem_ir_.ints() + sem_ir_->ints() .Get(inst.int_id) - .print(out_, sem_ir_.types().IsSignedInt(inst.type_id)); + .print(out_, sem_ir_->types().IsSignedInt(inst.type_id)); } auto FormatInstRHS(FloatLiteral inst) -> void { llvm::SmallVector buffer; - sem_ir_.floats().Get(inst.float_id).toString(buffer); + sem_ir_->floats().Get(inst.float_id).toString(buffer); out_ << " " << buffer; } - auto FormatInstRHS(ImportRefUnloaded inst) -> void { - FormatArgs(inst.import_ir_inst_id); - out_ << ", unloaded"; + auto FormatImportRefRHS(ImportIRInstId import_ir_inst_id, + EntityNameId entity_name_id, + llvm::StringLiteral loaded_label) -> void { + out_ << " "; + auto import_ir_inst = sem_ir_->import_ir_insts().Get(import_ir_inst_id); + FormatArg(import_ir_inst.ir_id); + out_ << ", "; + if (entity_name_id.is_valid()) { + // Prefer to show the entity name when possible. + FormatArg(entity_name_id); + } else { + // Show a name based on the location when possible, or the numeric + // instruction as a last resort. + const auto& import_ir = sem_ir_->import_irs().Get(import_ir_inst.ir_id); + auto loc_id = import_ir.sem_ir->insts().GetLocId(import_ir_inst.inst_id); + if (!loc_id.is_valid()) { + out_ << import_ir_inst.inst_id << " [no loc]"; + } else if (loc_id.is_import_ir_inst_id()) { + // TODO: Probably don't want to format each indirection, but maybe reuse + // GetCanonicalImportIRInst? + out_ << import_ir_inst.inst_id << " [indirect]"; + } else if (loc_id.is_node_id()) { + // Formats a NodeId from the import. + const auto& tree = import_ir.sem_ir->parse_tree(); + auto token = tree.node_token(loc_id.node_id()); + out_ << "loc" << tree.tokens().GetLineNumber(token) << "_" + << tree.tokens().GetColumnNumber(token); + } else { + CARBON_FATAL("Unexpected LocId: {0}", loc_id); + } + } + out_ << ", " << loaded_label; } auto FormatInstRHS(ImportRefLoaded inst) -> void { - FormatArgs(inst.import_ir_inst_id); - out_ << ", loaded"; + FormatImportRefRHS(inst.import_ir_inst_id, inst.entity_name_id, "loaded"); + } + + auto FormatInstRHS(ImportRefUnloaded inst) -> void { + FormatImportRefRHS(inst.import_ir_inst_id, inst.entity_name_id, "unloaded"); } auto FormatInstRHS(SpliceBlock inst) -> void { @@ -1040,7 +1073,7 @@ class FormatterImpl { auto FormatInstRHS(StructType inst) -> void { out_ << " {"; llvm::ListSeparator sep; - for (auto field : sem_ir_.struct_type_fields().Get(inst.fields_id)) { + for (auto field : sem_ir_->struct_type_fields().Get(inst.fields_id)) { out_ << sep << "."; FormatName(field.name_id); out_ << ": "; @@ -1069,7 +1102,7 @@ class FormatterImpl { auto FormatArg(BoolValue v) -> void { out_ << v; } auto FormatArg(EntityNameId id) -> void { - const auto& info = sem_ir_.entity_names().Get(id); + const auto& info = sem_ir_->entity_names().Get(id); FormatName(info.name_id); if (info.bind_index.is_valid()) { out_ << ", " << info.bind_index.index; @@ -1077,7 +1110,7 @@ class FormatterImpl { } auto FormatArg(FacetTypeId id) -> void { - const auto& info = sem_ir_.facet_types().Get(id); + const auto& info = sem_ir_->facet_types().Get(id); // Nothing output to indicate that this is a facet type since this is only // used as the argument to a `facet_type` instruction. out_ << "<"; @@ -1125,30 +1158,9 @@ class FormatterImpl { } } - auto FormatArg(ImportIRInstId id) -> void { - // Don't format the inst_id because it refers to a different IR. - // TODO: Consider a better way to format the InstID from other IRs. - auto import_ir_inst = sem_ir_.import_ir_insts().Get(id); - FormatArg(import_ir_inst.ir_id); - out_ << ", " << import_ir_inst.inst_id; - } - auto FormatArg(IntId id) -> void { // We don't know the signedness to use here. Default to unsigned. - sem_ir_.ints().Get(id).print(out_, /*isSigned=*/false); - } - - auto FormatArg(LocId id) -> void { - if (id.is_import_ir_inst_id()) { - out_ << "{"; - FormatArg(id.import_ir_inst_id()); - out_ << "}"; - } else { - // TODO: For a NodeId, this prints the index of the node. Do we want it to - // print a line number or something in order to make it less dependent on - // parse? - out_ << id; - } + sem_ir_->ints().Get(id).print(out_, /*isSigned=*/false); } auto FormatArg(ElementIndex index) -> void { out_ << index; } @@ -1169,7 +1181,7 @@ class FormatterImpl { out_ << '('; llvm::ListSeparator sep; - for (auto inst_id : sem_ir_.inst_blocks().Get(id)) { + for (auto inst_id : sem_ir_->inst_blocks().Get(id)) { out_ << sep; FormatArg(inst_id); } @@ -1178,14 +1190,14 @@ class FormatterImpl { auto FormatArg(RealId id) -> void { // TODO: Format with a `.` when the exponent is near zero. - const auto& real = sem_ir_.reals().Get(id); + const auto& real = sem_ir_->reals().Get(id); real.mantissa.print(out_, /*isSigned=*/false); out_ << (real.is_decimal ? 'e' : 'p') << real.exponent; } auto FormatArg(StringLiteralValueId id) -> void { out_ << '"'; - out_.write_escaped(sem_ir_.string_literal_values().Get(id), + out_.write_escaped(sem_ir_->string_literal_values().Get(id), /*UseHexEscapes=*/true); out_ << '"'; } @@ -1195,7 +1207,7 @@ class FormatterImpl { auto FormatArg(TypeBlockId id) -> void { out_ << '('; llvm::ListSeparator sep; - for (auto type_id : sem_ir_.type_blocks().Get(id)) { + for (auto type_id : sem_ir_->type_blocks().Get(id)) { out_ << sep; FormatArg(type_id); } @@ -1216,7 +1228,7 @@ class FormatterImpl { } auto FormatName(NameId id) -> void { - out_ << sem_ir_.names().GetFormatted(id); + out_ << sem_ir_->names().GetFormatted(id); } auto FormatName(InstId id) -> void { @@ -1231,7 +1243,7 @@ class FormatterImpl { } auto FormatName(SpecificId id) -> void { - const auto& specific = sem_ir_.specifics().Get(id); + const auto& specific = sem_ir_->specifics().Get(id); FormatName(specific.generic_id); FormatArg(specific.args_id); } @@ -1250,21 +1262,21 @@ class FormatterImpl { // generic first, and the canonical constant second. if (id.is_symbolic()) { const auto& symbolic_constant = - sem_ir_.constant_values().GetSymbolicConstant(id); + sem_ir_->constant_values().GetSymbolicConstant(id); if (symbolic_constant.generic_id.is_valid()) { const auto& generic = - sem_ir_.generics().Get(symbolic_constant.generic_id); - FormatName(sem_ir_.inst_blocks().Get(generic.GetEvalBlock( + sem_ir_->generics().Get(symbolic_constant.generic_id); + FormatName(sem_ir_->inst_blocks().Get(generic.GetEvalBlock( symbolic_constant.index .region()))[symbolic_constant.index.index()]); out_ << " ("; - FormatName(sem_ir_.constant_values().GetInstId(id)); + FormatName(sem_ir_->constant_values().GetInstId(id)); out_ << ")"; return; } } - FormatName(sem_ir_.constant_values().GetInstId(id)); + FormatName(sem_ir_->constant_values().GetInstId(id)); } auto FormatType(TypeId id) -> void { @@ -1274,7 +1286,7 @@ class FormatterImpl { // Types are formatted in the `constants` scope because they only refer to // constants. llvm::SaveAndRestore file_scope(scope_, InstNamer::ScopeId::Constants); - FormatConstant(sem_ir_.types().GetConstantId(id)); + FormatConstant(sem_ir_->types().GetConstantId(id)); } } @@ -1282,7 +1294,7 @@ class FormatterImpl { auto GetImportIRLabel(ImportIRId id) -> std::string { CARBON_CHECK(id.is_valid(), "GetImportIRLabel should only be called where we a valid ID."); - const auto& import_ir = *sem_ir_.import_irs().Get(id).sem_ir; + const auto& import_ir = *sem_ir_->import_irs().Get(id).sem_ir; CARBON_CHECK(import_ir.library_id().is_valid()); llvm::StringRef package_name = @@ -1297,7 +1309,7 @@ class FormatterImpl { return llvm::formatv("{0}//{1}", package_name, library_name); } - const File& sem_ir_; + const File* sem_ir_; InstNamer* const inst_namer_; Formatter::ShouldFormatEntityFn should_format_entity_; @@ -1347,12 +1359,11 @@ class FormatterImpl { llvm::SmallVector tentative_inst_chunks_; }; -Formatter::Formatter(const Lex::TokenizedBuffer& tokenized_buffer, - const Parse::Tree& parse_tree, const File& sem_ir, +Formatter::Formatter(const File* sem_ir, ShouldFormatEntityFn should_format_entity) : sem_ir_(sem_ir), should_format_entity_(should_format_entity), - inst_namer_(tokenized_buffer, parse_tree, sem_ir) {} + inst_namer_(sem_ir) {} Formatter::~Formatter() = default; diff --git a/toolchain/sem_ir/formatter.h b/toolchain/sem_ir/formatter.h index d0e635cca28b7..765e758ef716e 100644 --- a/toolchain/sem_ir/formatter.h +++ b/toolchain/sem_ir/formatter.h @@ -22,8 +22,7 @@ class Formatter { llvm::function_refbool>; explicit Formatter( - const Lex::TokenizedBuffer& tokenized_buffer, - const Parse::Tree& parse_tree, const File& sem_ir, + const File* sem_ir, ShouldFormatEntityFn should_format_entity = [](InstId) { return true; }); ~Formatter(); @@ -31,7 +30,7 @@ class Formatter { auto Print(llvm::raw_ostream& out) -> void; private: - const File& sem_ir_; + const File* sem_ir_; ShouldFormatEntityFn should_format_entity_; // Caches naming between Print calls. InstNamer inst_namer_; diff --git a/toolchain/sem_ir/ids.cpp b/toolchain/sem_ir/ids.cpp index f4966ab391012..b32b403a2a8a7 100644 --- a/toolchain/sem_ir/ids.cpp +++ b/toolchain/sem_ir/ids.cpp @@ -10,17 +10,10 @@ namespace Carbon::SemIR { auto InstId::Print(llvm::raw_ostream& out) const -> void { - if (!is_valid()) { - IdBase::Print(out); - return; - } - out << Label; - if (index < static_cast(SingletonInstKinds.size())) { - out << "(" << SingletonInstKinds[index] << ")"; + if (IsSingletonInstId(*this)) { + out << Label << "(" << SingletonInstKinds[index] << ")"; } else { - // Use the `+` as a small reminder that this is a delta, rather than an - // absolute index. - out << "+" << index - SingletonInstKinds.size(); + IdBase::Print(out); } } diff --git a/toolchain/sem_ir/inst_namer.cpp b/toolchain/sem_ir/inst_namer.cpp index 57118efb9b477..83501f0eebeb8 100644 --- a/toolchain/sem_ir/inst_namer.cpp +++ b/toolchain/sem_ir/inst_namer.cpp @@ -17,35 +17,31 @@ namespace Carbon::SemIR { -InstNamer::InstNamer(const Lex::TokenizedBuffer& tokenized_buffer, - const Parse::Tree& parse_tree, const File& sem_ir) - : tokenized_buffer_(tokenized_buffer), - parse_tree_(parse_tree), - sem_ir_(sem_ir) { - insts_.resize(sem_ir.insts().size(), {ScopeId::None, Namespace::Name()}); - labels_.resize(sem_ir.inst_blocks().size()); +InstNamer::InstNamer(const File* sem_ir) : sem_ir_(sem_ir) { + insts_.resize(sem_ir->insts().size(), {ScopeId::None, Namespace::Name()}); + labels_.resize(sem_ir->inst_blocks().size()); scopes_.resize(static_cast(GetScopeFor(NumberOfScopesTag()))); - generic_scopes_.resize(sem_ir.generics().size(), ScopeId::None); + generic_scopes_.resize(sem_ir->generics().size(), ScopeId::None); // Build the constants scope. - CollectNamesInBlock(ScopeId::Constants, sem_ir.constants().array_ref()); + CollectNamesInBlock(ScopeId::Constants, sem_ir->constants().array_ref()); // Build the ImportRef scope. - CollectNamesInBlock(ScopeId::ImportRefs, - sem_ir.inst_blocks().Get(SemIR::InstBlockId::ImportRefs)); + CollectNamesInBlock(ScopeId::ImportRefs, sem_ir->inst_blocks().Get( + SemIR::InstBlockId::ImportRefs)); // Build the file scope. - CollectNamesInBlock(ScopeId::File, sem_ir.top_inst_block_id()); + CollectNamesInBlock(ScopeId::File, sem_ir->top_inst_block_id()); // Build each function scope. - for (auto [i, fn] : llvm::enumerate(sem_ir.functions().array_ref())) { + for (auto [i, fn] : llvm::enumerate(sem_ir->functions().array_ref())) { FunctionId fn_id(i); auto fn_scope = GetScopeFor(fn_id); // TODO: Provide a location for the function for use as a // disambiguator. auto fn_loc = Parse::NodeId::Invalid; GetScopeInfo(fn_scope).name = globals_.AllocateName( - *this, fn_loc, sem_ir.names().GetIRBaseName(fn.name_id).str()); + *this, fn_loc, sem_ir->names().GetIRBaseName(fn.name_id).str()); CollectNamesInBlock(fn_scope, fn.implicit_param_patterns_id); CollectNamesInBlock(fn_scope, fn.param_patterns_id); if (!fn.body_block_ids.empty()) { @@ -61,14 +57,14 @@ InstNamer::InstNamer(const Lex::TokenizedBuffer& tokenized_buffer, } // Build each class scope. - for (auto [i, class_info] : llvm::enumerate(sem_ir.classes().array_ref())) { + for (auto [i, class_info] : llvm::enumerate(sem_ir->classes().array_ref())) { ClassId class_id(i); auto class_scope = GetScopeFor(class_id); // TODO: Provide a location for the class for use as a disambiguator. auto class_loc = Parse::NodeId::Invalid; GetScopeInfo(class_scope).name = globals_.AllocateName( *this, class_loc, - sem_ir.names().GetIRBaseName(class_info.name_id).str()); + sem_ir->names().GetIRBaseName(class_info.name_id).str()); AddBlockLabel(class_scope, class_info.body_block_id, "class", class_loc); CollectNamesInBlock(class_scope, class_info.body_block_id); CollectNamesInGeneric(class_scope, class_info.generic_id); @@ -76,14 +72,14 @@ InstNamer::InstNamer(const Lex::TokenizedBuffer& tokenized_buffer, // Build each interface scope. for (auto [i, interface_info] : - llvm::enumerate(sem_ir.interfaces().array_ref())) { + llvm::enumerate(sem_ir->interfaces().array_ref())) { InterfaceId interface_id(i); auto interface_scope = GetScopeFor(interface_id); // TODO: Provide a location for the interface for use as a disambiguator. auto interface_loc = Parse::NodeId::Invalid; GetScopeInfo(interface_scope).name = globals_.AllocateName( *this, interface_loc, - sem_ir.names().GetIRBaseName(interface_info.name_id).str()); + sem_ir->names().GetIRBaseName(interface_info.name_id).str()); AddBlockLabel(interface_scope, interface_info.body_block_id, "interface", interface_loc); CollectNamesInBlock(interface_scope, interface_info.body_block_id); @@ -91,7 +87,7 @@ InstNamer::InstNamer(const Lex::TokenizedBuffer& tokenized_buffer, } // Build each impl scope. - for (auto [i, impl_info] : llvm::enumerate(sem_ir.impls().array_ref())) { + for (auto [i, impl_info] : llvm::enumerate(sem_ir->impls().array_ref())) { ImplId impl_id(i); auto impl_scope = GetScopeFor(impl_id); // TODO: Provide a location for the impl for use as a disambiguator. @@ -140,7 +136,7 @@ auto InstNamer::GetNameFor(ScopeId scope_id, InstId inst_id) const // Check for a builtin. if (SemIR::IsSingletonInstId(inst_id)) { - return sem_ir_.insts().Get(inst_id).kind().ir_name().str(); + return sem_ir_->insts().Get(inst_id).kind().ir_name().str(); } if (inst_id == SemIR::Namespace::PackageInstId) { @@ -153,12 +149,13 @@ auto InstNamer::GetNameFor(ScopeId scope_id, InstId inst_id) const std::string str; llvm::raw_string_ostream str_stream(str); str_stream << "." << inst_id; - auto loc_id = sem_ir_.insts().GetLocId(inst_id); + auto loc_id = sem_ir_->insts().GetLocId(inst_id); // TODO: Consider handling inst_id cases. if (loc_id.is_node_id()) { - auto token = parse_tree_.node_token(loc_id.node_id()); - str_stream << ".loc" << tokenized_buffer_.GetLineNumber(token) << "_" - << tokenized_buffer_.GetColumnNumber(token); + const auto& tree = sem_ir_->parse_tree(); + auto token = tree.node_token(loc_id.node_id()); + str_stream << ".loc" << tree.tokens().GetLineNumber(token) << "_" + << tree.tokens().GetColumnNumber(token); } return str; } @@ -246,13 +243,14 @@ auto InstNamer::Namespace::AllocateName(const InstNamer& inst_namer, // Append location information to try to disambiguate. // TODO: Consider handling inst_id cases. if (loc_id.is_node_id()) { - auto token = inst_namer.parse_tree_.node_token(loc_id.node_id()); + const auto& tree = inst_namer.sem_ir_->parse_tree(); + auto token = tree.node_token(loc_id.node_id()); llvm::raw_string_ostream(name) - << ".loc" << inst_namer.tokenized_buffer_.GetLineNumber(token); + << ".loc" << tree.tokens().GetLineNumber(token); add_name(); llvm::raw_string_ostream(name) - << "_" << inst_namer.tokenized_buffer_.GetColumnNumber(token); + << "_" << tree.tokens().GetColumnNumber(token); add_name(); } @@ -275,9 +273,9 @@ auto InstNamer::AddBlockLabel(ScopeId scope_id, InstBlockId block_id, } if (!loc_id.is_valid()) { - if (const auto& block = sem_ir_.inst_blocks().Get(block_id); + if (const auto& block = sem_ir_->inst_blocks().Get(block_id); !block.empty()) { - loc_id = sem_ir_.insts().GetLocId(block.front()); + loc_id = sem_ir_->insts().GetLocId(block.front()); } } @@ -291,7 +289,7 @@ auto InstNamer::AddBlockLabel(ScopeId scope_id, InstBlockId block_id, auto InstNamer::AddBlockLabel(ScopeId scope_id, SemIR::LocId loc_id, AnyBranch branch) -> void { llvm::StringRef name; - switch (parse_tree_.node_kind(loc_id.node_id())) { + switch (sem_ir_->parse_tree().node_kind(loc_id.node_id())) { case Parse::NodeKind::IfExprIf: switch (branch.kind) { case BranchIf::Kind: @@ -359,7 +357,7 @@ auto InstNamer::AddBlockLabel(ScopeId scope_id, SemIR::LocId loc_id, auto InstNamer::CollectNamesInBlock(ScopeId scope_id, InstBlockId block_id) -> void { if (block_id.is_valid()) { - CollectNamesInBlock(scope_id, sem_ir_.inst_blocks().Get(block_id)); + CollectNamesInBlock(scope_id, sem_ir_->inst_blocks().Get(block_id)); } } @@ -373,13 +371,13 @@ auto InstNamer::CollectNamesInBlock(ScopeId scope_id, continue; } - auto untyped_inst = sem_ir_.insts().Get(inst_id); + auto untyped_inst = sem_ir_->insts().Get(inst_id); auto add_inst_name = [&](std::string name) { ScopeId old_scope_id = insts_[inst_id.index].first; if (old_scope_id == ScopeId::None) { insts_[inst_id.index] = { scope_id, scope.insts.AllocateName( - *this, sem_ir_.insts().GetLocId(inst_id), name)}; + *this, sem_ir_->insts().GetLocId(inst_id), name)}; } else { CARBON_CHECK(old_scope_id == scope_id, "Attempting to name inst in multiple scopes"); @@ -387,32 +385,32 @@ auto InstNamer::CollectNamesInBlock(ScopeId scope_id, }; auto add_inst_name_id = [&](NameId name_id, llvm::StringRef suffix = "") { add_inst_name( - (sem_ir_.names().GetIRBaseName(name_id).str() + suffix).str()); + (sem_ir_->names().GetIRBaseName(name_id).str() + suffix).str()); }; auto add_int_or_float_type_name = [&](char type_literal_prefix, SemIR::InstId bit_width_id) { std::string name; llvm::raw_string_ostream out(name); out << type_literal_prefix; - if (auto bit_width = sem_ir_.insts().TryGetAs(bit_width_id)) { - out << sem_ir_.ints().Get(bit_width->int_id); + if (auto bit_width = sem_ir_->insts().TryGetAs(bit_width_id)) { + out << sem_ir_->ints().Get(bit_width->int_id); } else { out << "N"; } add_inst_name(std::move(name)); }; auto facet_access_name_id = [&](InstId facet_value_inst_id) -> NameId { - if (auto name = sem_ir_.insts().TryGetAs(facet_value_inst_id)) { + if (auto name = sem_ir_->insts().TryGetAs(facet_value_inst_id)) { return name->name_id; - } else if (auto symbolic = sem_ir_.insts().TryGetAs( + } else if (auto symbolic = sem_ir_->insts().TryGetAs( facet_value_inst_id)) { - return sem_ir_.entity_names().Get(symbolic->entity_name_id).name_id; + return sem_ir_->entity_names().Get(symbolic->entity_name_id).name_id; } return NameId::Invalid; }; if (auto branch = untyped_inst.TryAs()) { - AddBlockLabel(scope_id, sem_ir_.insts().GetLocId(inst_id), *branch); + AddBlockLabel(scope_id, sem_ir_->insts().GetLocId(inst_id), *branch); } CARBON_KIND_SWITCH(untyped_inst) { @@ -440,8 +438,8 @@ auto InstNamer::CollectNamesInBlock(ScopeId scope_id, // TODO: Try to get the name of the interface associated with // `inst.interface_type_id`. if (auto fn_ty = - sem_ir_.types().TryGetAs(inst.entity_type_id)) { - add_inst_name_id(sem_ir_.functions().Get(fn_ty->function_id).name_id, + sem_ir_->types().TryGetAs(inst.entity_type_id)) { + add_inst_name_id(sem_ir_->functions().Get(fn_ty->function_id).name_id, ".assoc_type"); } else { // TODO: Handle other cases. @@ -455,14 +453,14 @@ auto InstNamer::CollectNamesInBlock(ScopeId scope_id, case ExportDecl::Kind: { auto inst = untyped_inst.As(); add_inst_name_id( - sem_ir_.entity_names().Get(inst.entity_name_id).name_id); + sem_ir_->entity_names().Get(inst.entity_name_id).name_id); continue; } case BindingPattern::Kind: case SymbolicBindingPattern::Kind: { auto inst = untyped_inst.As(); add_inst_name_id( - sem_ir_.entity_names().Get(inst.entity_name_id).name_id, ".patt"); + sem_ir_->entity_names().Get(inst.entity_name_id).name_id, ".patt"); continue; } case CARBON_KIND(BoolLiteral inst): { @@ -474,9 +472,9 @@ auto InstNamer::CollectNamesInBlock(ScopeId scope_id, continue; } case CARBON_KIND(BoundMethod inst): { - auto type_id = sem_ir_.insts().Get(inst.function_id).type_id(); - if (auto fn_ty = sem_ir_.types().TryGetAs(type_id)) { - add_inst_name_id(sem_ir_.functions().Get(fn_ty->function_id).name_id, + auto type_id = sem_ir_->insts().Get(inst.function_id).type_id(); + if (auto fn_ty = sem_ir_->types().TryGetAs(type_id)) { + add_inst_name_id(sem_ir_->functions().Get(fn_ty->function_id).name_id, ".bound"); } else { add_inst_name("bound_method"); @@ -485,12 +483,12 @@ auto InstNamer::CollectNamesInBlock(ScopeId scope_id, } case CARBON_KIND(Call inst): { auto callee_function = - SemIR::GetCalleeFunction(sem_ir_, inst.callee_id); + SemIR::GetCalleeFunction(*sem_ir_, inst.callee_id); if (!callee_function.function_id.is_valid()) { break; } const auto& function = - sem_ir_.functions().Get(callee_function.function_id); + sem_ir_->functions().Get(callee_function.function_id); // Name the call's result based on the callee. if (function.builtin_function_kind != SemIR::BuiltinFunctionKind::None) { @@ -504,7 +502,7 @@ auto InstNamer::CollectNamesInBlock(ScopeId scope_id, continue; } case CARBON_KIND(ClassDecl inst): { - const auto& class_info = sem_ir_.classes().Get(inst.class_id); + const auto& class_info = sem_ir_->classes().Get(inst.class_id); add_inst_name_id(class_info.name_id, ".decl"); auto class_scope_id = GetScopeFor(inst.class_id); CollectNamesInBlock(class_scope_id, class_info.pattern_block_id); @@ -512,7 +510,7 @@ auto InstNamer::CollectNamesInBlock(ScopeId scope_id, continue; } case CARBON_KIND(ClassType inst): { - add_inst_name_id(sem_ir_.classes().Get(inst.class_id).name_id); + add_inst_name_id(sem_ir_->classes().Get(inst.class_id).name_id); continue; } case CompleteTypeWitness::Kind: { @@ -545,12 +543,12 @@ auto InstNamer::CollectNamesInBlock(ScopeId scope_id, } case CARBON_KIND(FacetType inst): { const auto& facet_type_info = - sem_ir_.facet_types().Get(inst.facet_type_id); + sem_ir_->facet_types().Get(inst.facet_type_id); bool has_where = facet_type_info.other_requirements || !facet_type_info.rewrite_constraints.empty(); if (auto interface = facet_type_info.TryAsSingleInterface()) { const auto& interface_info = - sem_ir_.interfaces().Get(interface->interface_id); + sem_ir_->interfaces().Get(interface->interface_id); add_inst_name_id(interface_info.name_id, has_where ? "_where.type" : ".type"); } else if (facet_type_info.impls_constraints.empty()) { @@ -562,12 +560,12 @@ auto InstNamer::CollectNamesInBlock(ScopeId scope_id, } case CARBON_KIND(FacetValue inst): { if (auto facet_type = - sem_ir_.types().TryGetAs(inst.type_id)) { + sem_ir_->types().TryGetAs(inst.type_id)) { const auto& facet_type_info = - sem_ir_.facet_types().Get(facet_type->facet_type_id); + sem_ir_->facet_types().Get(facet_type->facet_type_id); if (auto interface = facet_type_info.TryAsSingleInterface()) { const auto& interface_info = - sem_ir_.interfaces().Get(interface->interface_id); + sem_ir_->interfaces().Get(interface->interface_id); add_inst_name_id(interface_info.name_id, ".facet"); continue; } @@ -584,7 +582,7 @@ auto InstNamer::CollectNamesInBlock(ScopeId scope_id, continue; } case CARBON_KIND(FunctionDecl inst): { - const auto& function_info = sem_ir_.functions().Get(inst.function_id); + const auto& function_info = sem_ir_->functions().Get(inst.function_id); add_inst_name_id(function_info.name_id, ".decl"); auto function_scope_id = GetScopeFor(inst.function_id); CollectNamesInBlock(function_scope_id, function_info.pattern_block_id); @@ -592,23 +590,24 @@ auto InstNamer::CollectNamesInBlock(ScopeId scope_id, continue; } case CARBON_KIND(FunctionType inst): { - add_inst_name_id(sem_ir_.functions().Get(inst.function_id).name_id, + add_inst_name_id(sem_ir_->functions().Get(inst.function_id).name_id, ".type"); continue; } case CARBON_KIND(GenericClassType inst): { - add_inst_name_id(sem_ir_.classes().Get(inst.class_id).name_id, ".type"); + add_inst_name_id(sem_ir_->classes().Get(inst.class_id).name_id, + ".type"); continue; } case CARBON_KIND(GenericInterfaceType inst): { - add_inst_name_id(sem_ir_.interfaces().Get(inst.interface_id).name_id, + add_inst_name_id(sem_ir_->interfaces().Get(inst.interface_id).name_id, ".type"); continue; } case CARBON_KIND(ImplDecl inst): { auto impl_scope_id = GetScopeFor(inst.impl_id); - CollectNamesInBlock(impl_scope_id, - sem_ir_.impls().Get(inst.impl_id).pattern_block_id); + CollectNamesInBlock( + impl_scope_id, sem_ir_->impls().Get(inst.impl_id).pattern_block_id); CollectNamesInBlock(impl_scope_id, inst.decl_block_id); break; } @@ -626,9 +625,9 @@ auto InstNamer::CollectNamesInBlock(ScopeId scope_id, // When building import refs, we frequently add instructions without // a block. Constants that refer to them need to be separately // named. - auto const_id = sem_ir_.constant_values().Get(inst_id); + auto const_id = sem_ir_->constant_values().Get(inst_id); if (const_id.is_valid() && const_id.is_template()) { - auto const_inst_id = sem_ir_.constant_values().GetInstId(const_id); + auto const_inst_id = sem_ir_->constant_values().GetInstId(const_id); if (!insts_[const_inst_id.index].second) { CollectNamesInBlock(ScopeId::ImportRefs, const_inst_id); } @@ -637,7 +636,7 @@ auto InstNamer::CollectNamesInBlock(ScopeId scope_id, } case CARBON_KIND(InterfaceDecl inst): { const auto& interface_info = - sem_ir_.interfaces().Get(inst.interface_id); + sem_ir_->interfaces().Get(inst.interface_id); add_inst_name_id(interface_info.name_id, ".decl"); auto interface_scope_id = GetScopeFor(inst.interface_id); CollectNamesInBlock(interface_scope_id, @@ -665,7 +664,7 @@ auto InstNamer::CollectNamesInBlock(ScopeId scope_id, case CARBON_KIND(IntValue inst): { std::string name; llvm::raw_string_ostream out(name); - out << "int_" << sem_ir_.ints().Get(inst.int_id); + out << "int_" << sem_ir_->ints().Get(inst.int_id); add_inst_name(std::move(name)); continue; } @@ -675,7 +674,8 @@ auto InstNamer::CollectNamesInBlock(ScopeId scope_id, } // The namespace is specified here due to the name conflict. case CARBON_KIND(SemIR::Namespace inst): { - add_inst_name_id(sem_ir_.name_scopes().Get(inst.name_scope_id).name_id); + add_inst_name_id( + sem_ir_->name_scopes().Get(inst.name_scope_id).name_id); continue; } case OutParam::Kind: @@ -686,7 +686,7 @@ auto InstNamer::CollectNamesInBlock(ScopeId scope_id, case OutParamPattern::Kind: case ValueParamPattern::Kind: { add_inst_name_id( - SemIR::Function::GetNameFromPatternId(sem_ir_, inst_id), + SemIR::Function::GetNameFromPatternId(*sem_ir_, inst_id), ".param_patt"); continue; } @@ -700,12 +700,12 @@ auto InstNamer::CollectNamesInBlock(ScopeId scope_id, } case CARBON_KIND(SpecificFunction inst): { InstId callee_id = inst.callee_id; - if (auto method = sem_ir_.insts().TryGetAs(callee_id)) { + if (auto method = sem_ir_->insts().TryGetAs(callee_id)) { callee_id = method->function_id; } - auto type_id = sem_ir_.insts().Get(callee_id).type_id(); - if (auto fn_ty = sem_ir_.types().TryGetAs(type_id)) { - add_inst_name_id(sem_ir_.functions().Get(fn_ty->function_id).name_id, + auto type_id = sem_ir_->insts().Get(callee_id).type_id(); + if (auto fn_ty = sem_ir_->types().TryGetAs(type_id)) { + add_inst_name_id(sem_ir_->functions().Get(fn_ty->function_id).name_id, ".specific_fn"); } else { add_inst_name("specific_fn"); @@ -725,27 +725,29 @@ auto InstNamer::CollectNamesInBlock(ScopeId scope_id, continue; } case CARBON_KIND(StructValue inst): { - if (auto fn_ty = sem_ir_.types().TryGetAs(inst.type_id)) { - add_inst_name_id(sem_ir_.functions().Get(fn_ty->function_id).name_id); + if (auto fn_ty = + sem_ir_->types().TryGetAs(inst.type_id)) { + add_inst_name_id( + sem_ir_->functions().Get(fn_ty->function_id).name_id); } else if (auto class_ty = - sem_ir_.types().TryGetAs(inst.type_id)) { - add_inst_name_id(sem_ir_.classes().Get(class_ty->class_id).name_id, + sem_ir_->types().TryGetAs(inst.type_id)) { + add_inst_name_id(sem_ir_->classes().Get(class_ty->class_id).name_id, ".val"); } else if (auto generic_class_ty = - sem_ir_.types().TryGetAs( + sem_ir_->types().TryGetAs( inst.type_id)) { add_inst_name_id( - sem_ir_.classes().Get(generic_class_ty->class_id).name_id, + sem_ir_->classes().Get(generic_class_ty->class_id).name_id, ".generic"); } else if (auto generic_interface_ty = - sem_ir_.types().TryGetAs( + sem_ir_->types().TryGetAs( inst.type_id)) { - add_inst_name_id(sem_ir_.interfaces() + add_inst_name_id(sem_ir_->interfaces() .Get(generic_interface_ty->interface_id) .name_id, ".generic"); } else { - if (sem_ir_.inst_blocks().Get(inst.elements_id).empty()) { + if (sem_ir_->inst_blocks().Get(inst.elements_id).empty()) { add_inst_name("empty_struct"); } else { add_inst_name("struct"); @@ -754,7 +756,7 @@ auto InstNamer::CollectNamesInBlock(ScopeId scope_id, continue; } case CARBON_KIND(StructType inst): { - const auto& fields = sem_ir_.struct_type_fields().Get(inst.fields_id); + const auto& fields = sem_ir_->struct_type_fields().Get(inst.fields_id); if (fields.empty()) { add_inst_name("empty_struct_type"); continue; @@ -762,7 +764,7 @@ auto InstNamer::CollectNamesInBlock(ScopeId scope_id, std::string name = "struct_type"; for (auto field : fields) { name += "."; - name += sem_ir_.names().GetIRBaseName(field.name_id).str(); + name += sem_ir_->names().GetIRBaseName(field.name_id).str(); } add_inst_name(std::move(name)); continue; @@ -783,7 +785,7 @@ auto InstNamer::CollectNamesInBlock(ScopeId scope_id, continue; } case CARBON_KIND(TupleValue inst): { - if (sem_ir_.types().Is(inst.type_id)) { + if (sem_ir_->types().Is(inst.type_id)) { add_inst_name("array"); } else if (inst.elements_id == InstBlockId::Empty) { add_inst_name("empty_tuple"); @@ -794,8 +796,8 @@ auto InstNamer::CollectNamesInBlock(ScopeId scope_id, } case CARBON_KIND(UnboundElementType inst): { if (auto class_ty = - sem_ir_.types().TryGetAs(inst.class_type_id)) { - add_inst_name_id(sem_ir_.classes().Get(class_ty->class_id).name_id, + sem_ir_->types().TryGetAs(inst.class_type_id)) { + add_inst_name_id(sem_ir_->classes().Get(class_ty->class_id).name_id, ".elem"); } else { add_inst_name("elem_type"); @@ -824,7 +826,7 @@ auto InstNamer::CollectNamesInGeneric(ScopeId scope_id, GenericId generic_id) return; } generic_scopes_[generic_id.index] = scope_id; - const auto& generic = sem_ir_.generics().Get(generic_id); + const auto& generic = sem_ir_->generics().Get(generic_id); CollectNamesInBlock(scope_id, generic.decl_block_id); CollectNamesInBlock(scope_id, generic.definition_block_id); } diff --git a/toolchain/sem_ir/inst_namer.h b/toolchain/sem_ir/inst_namer.h index 1a4ee50bec428..67fbd41be244a 100644 --- a/toolchain/sem_ir/inst_namer.h +++ b/toolchain/sem_ir/inst_namer.h @@ -31,8 +31,7 @@ class InstNamer { // Construct the instruction namer, and assign names to all instructions in // the provided file. - InstNamer(const Lex::TokenizedBuffer& tokenized_buffer, - const Parse::Tree& parse_tree, const File& sem_ir); + explicit InstNamer(const File* sem_ir); // Returns the scope ID corresponding to an ID of a function, class, or // interface. @@ -41,13 +40,13 @@ class InstNamer { auto index = static_cast(ScopeId::FirstFunction); if constexpr (!std::same_as) { - index += sem_ir_.functions().size(); + index += sem_ir_->functions().size(); if constexpr (!std::same_as) { - index += sem_ir_.classes().size(); + index += sem_ir_->classes().size(); if constexpr (!std::same_as) { - index += sem_ir_.interfaces().size(); + index += sem_ir_->interfaces().size(); if constexpr (!std::same_as) { - index += sem_ir_.impls().size(); + index += sem_ir_->impls().size(); static_assert(std::same_as, "Unknown ID kind for scope"); } @@ -165,9 +164,7 @@ class InstNamer { auto CollectNamesInGeneric(ScopeId scope_id, GenericId generic_id) -> void; - const Lex::TokenizedBuffer& tokenized_buffer_; - const Parse::Tree& parse_tree_; - const File& sem_ir_; + const File* sem_ir_; // The namespace for entity names. Names within this namespace are prefixed // with `@` in formatted SemIR. diff --git a/toolchain/sem_ir/yaml_test.cpp b/toolchain/sem_ir/yaml_test.cpp index 9d85198037776..1bbafae77b481 100644 --- a/toolchain/sem_ir/yaml_test.cpp +++ b/toolchain/sem_ir/yaml_test.cpp @@ -48,12 +48,12 @@ TEST(SemIRTest, YAML) { // Matches the ID of an instruction. Instruction counts may change as various // support changes, so this code is only doing loose structural checks. auto type_block_id = Yaml::Scalar(MatchesRegex(R"(type_block\d+)")); - auto inst_id = Yaml::Scalar(MatchesRegex(R"(inst\+\d+)")); + auto inst_id = Yaml::Scalar(MatchesRegex(R"(inst\d+)")); auto constant_id = Yaml::Scalar(MatchesRegex(R"(template_constant\(inst(\w+|\+\d+)\))")); auto inst_builtin = Yaml::Scalar(MatchesRegex(R"(inst\(\w+\))")); auto type_id = - Yaml::Scalar(MatchesRegex(R"(type\((\w+|inst\(\w+\)|inst\+\d+)\))")); + Yaml::Scalar(MatchesRegex(R"(type\((\w+|inst\(\w+\)|inst\d+)\))")); auto type_builtin = Pair(type_id, Yaml::Mapping(_)); auto file = Yaml::Mapping(ElementsAre( From daba2c72cfd40e8ca159f71c2c56cc407c2d82d2 Mon Sep 17 00:00:00 2001 From: Boaz Brickner Date: Fri, 6 Dec 2024 22:50:50 +0100 Subject: [PATCH 04/68] [NFC] Convert NameScope from struct to class (#4623) This is a preparation change for adding name poisoning support (https://github.com/carbon-language/carbon-lang/issues/4622), which is expected to require more elaborate logic around NameScope since a name can be not defined yet, defined, or poisoned. The API separates looking up a name from getting the full entry since we have cases where the entries are invalidated between the time we're looking for the name and when we access (and sometimes modify) the entry. This change has the following benefits: * `names` and `name_map` are internal to `NameScope` and are guaranteed to match. * `extended_scopes` and `import_ir_scopes` can not be manipulated (only new scopes can be added). * `inst_id`, `name_id` and `parent_scope_id` are constants. * `has_error` can only be mutated from false to true. --------- Co-authored-by: jonmeow --- toolchain/check/check.cpp | 4 +- toolchain/check/context.cpp | 12 +- toolchain/check/decl_name_stack.cpp | 10 +- toolchain/check/handle_class.cpp | 6 +- toolchain/check/handle_export.cpp | 4 +- toolchain/check/handle_impl.cpp | 31 +-- toolchain/check/handle_let_and_var.cpp | 2 +- toolchain/check/handle_namespace.cpp | 9 +- toolchain/check/import.cpp | 86 ++++---- toolchain/check/import_ref.cpp | 8 +- toolchain/check/merge.cpp | 5 +- toolchain/lower/mangler.cpp | 6 +- toolchain/sem_ir/BUILD | 12 ++ toolchain/sem_ir/formatter.cpp | 12 +- toolchain/sem_ir/ids.h | 2 +- toolchain/sem_ir/inst_namer.cpp | 2 +- toolchain/sem_ir/name_scope.cpp | 54 +++++ toolchain/sem_ir/name_scope.h | 138 ++++++++----- toolchain/sem_ir/name_scope_test.cpp | 261 +++++++++++++++++++++++++ 19 files changed, 525 insertions(+), 139 deletions(-) create mode 100644 toolchain/sem_ir/name_scope.cpp create mode 100644 toolchain/sem_ir/name_scope_test.cpp diff --git a/toolchain/check/check.cpp b/toolchain/check/check.cpp index 73a4cc9bec9cc..4331094ce873d 100644 --- a/toolchain/check/check.cpp +++ b/toolchain/check/check.cpp @@ -198,7 +198,7 @@ static auto ImportCurrentPackage(Context& context, UnitInfo& unit_info, unit_info.package_imports[import_map_lookup.value()]; if (self_import.has_load_error) { - context.name_scopes().Get(SemIR::NameScopeId::Package).has_error = true; + context.name_scopes().Get(SemIR::NameScopeId::Package).set_has_error(); } ImportLibrariesFromCurrentPackage( @@ -208,7 +208,7 @@ static auto ImportCurrentPackage(Context& context, UnitInfo& unit_info, context.scope_stack().Push( package_inst_id, SemIR::NameScopeId::Package, SemIR::SpecificId::Invalid, - context.name_scopes().Get(SemIR::NameScopeId::Package).has_error); + context.name_scopes().Get(SemIR::NameScopeId::Package).has_error()); } // Imports all other packages (excluding the current package). diff --git a/toolchain/check/context.cpp b/toolchain/check/context.cpp index af4767ff6ffb6..6a99ee4445f0d 100644 --- a/toolchain/check/context.cpp +++ b/toolchain/check/context.cpp @@ -359,16 +359,16 @@ auto Context::LookupNameInExactScope(SemIRLoc loc, SemIR::NameId name_id, SemIR::NameScopeId scope_id, const SemIR::NameScope& scope) -> std::pair { - if (auto lookup = scope.name_map.Lookup(name_id)) { - auto entry = scope.names[lookup.value()]; + if (auto entry_id = scope.Lookup(name_id)) { + auto entry = scope.GetEntry(*entry_id); LoadImportRef(*this, entry.inst_id); return {entry.inst_id, entry.access_kind}; } - if (!scope.import_ir_scopes.empty()) { + if (!scope.import_ir_scopes().empty()) { // TODO: Enforce other access modifiers for imports. return {ImportNameFromOtherPackage(*this, loc, scope_id, - scope.import_ir_scopes, name_id), + scope.import_ir_scopes(), name_id), SemIR::AccessKind::Public}; } return {SemIR::InstId::Invalid, SemIR::AccessKind::Public}; @@ -525,7 +525,7 @@ auto Context::LookupQualifiedName(SemIRLoc loc, SemIR::NameId name_id, continue; } const auto& name_scope = name_scopes().Get(scope_id); - has_error |= name_scope.has_error; + has_error |= name_scope.has_error(); auto [scope_result_id, access_kind] = LookupNameInExactScope(loc, name_id, scope_id, name_scope); @@ -546,7 +546,7 @@ auto Context::LookupQualifiedName(SemIRLoc loc, SemIR::NameId name_id, if (!scope_result_id.is_valid() || is_access_prohibited) { // If nothing is found in this scope or if we encountered an invalid // access, look in its extended scopes. - const auto& extended = name_scope.extended_scopes; + const auto& extended = name_scope.extended_scopes(); scopes.reserve(scopes.size() + extended.size()); for (auto extended_id : llvm::reverse(extended)) { // Substitute into the constant describing the extended scope to diff --git a/toolchain/check/decl_name_stack.cpp b/toolchain/check/decl_name_stack.cpp index 25abc2e08589b..c8b795e6243c8 100644 --- a/toolchain/check/decl_name_stack.cpp +++ b/toolchain/check/decl_name_stack.cpp @@ -135,7 +135,7 @@ auto DeclNameStack::AddName(NameContext name_context, SemIR::InstId target_id, auto& name_scope = context_->name_scopes().Get(name_context.parent_scope_id); if (name_context.has_qualifiers) { - auto inst = context_->insts().Get(name_scope.inst_id); + auto inst = context_->insts().Get(name_scope.inst_id()); if (!inst.Is()) { // TODO: Point at the declaration for the scoped entity. CARBON_DIAGNOSTIC( @@ -231,7 +231,7 @@ auto DeclNameStack::ApplyNameQualifier(const NameComponent& name) -> void { if (scope_id.is_valid()) { PushNameQualifierScope(*context_, name_context.resolved_inst_id, scope_id, specific_id, - context_->name_scopes().Get(scope_id).has_error); + context_->name_scopes().Get(scope_id).has_error()); name_context.parent_scope_id = scope_id; } else { name_context.state = NameContext::State::Error; @@ -416,12 +416,12 @@ auto DeclNameStack::ResolveAsScope(const NameContext& name_context, SemIR::InstBlockId::Invalid))) { return InvalidResult; } - if (scope.is_closed_import) { + if (scope.is_closed_import()) { DiagnoseQualifiedDeclInImportedPackage(*context_, name_context.loc_id, - scope.inst_id); + scope.inst_id()); // Only error once per package. Recover by allowing this package name to // be used as a name qualifier. - scope.is_closed_import = false; + scope.set_is_closed_import(false); } return {scope_id, SemIR::SpecificId::Invalid}; } diff --git a/toolchain/check/handle_class.cpp b/toolchain/check/handle_class.cpp index b7c6018eab096..e751b99b280f2 100644 --- a/toolchain/check/handle_class.cpp +++ b/toolchain/check/handle_class.cpp @@ -410,7 +410,7 @@ auto HandleParseNode(Context& context, Parse::AdaptDeclId node_id) -> bool { // Extend the class scope with the adapted type's scope if requested. if (introducer.modifier_set.HasAnyOf(KeywordModifierSet::Extend)) { auto& class_scope = context.name_scopes().Get(class_info.scope_id); - class_scope.extended_scopes.push_back(adapted_inst_id); + class_scope.AddExtendedScope(adapted_inst_id); } return true; } @@ -555,9 +555,9 @@ auto HandleParseNode(Context& context, Parse::BaseDeclId node_id) -> bool { if (introducer.modifier_set.HasAnyOf(KeywordModifierSet::Extend)) { auto& class_scope = context.name_scopes().Get(class_info.scope_id); if (base_info.scope_id.is_valid()) { - class_scope.extended_scopes.push_back(base_info.inst_id); + class_scope.AddExtendedScope(base_info.inst_id); } else { - class_scope.has_error = true; + class_scope.set_has_error(); } } return true; diff --git a/toolchain/check/handle_export.cpp b/toolchain/check/handle_export.cpp index 0203e94df33dd..ed532f3e1923b 100644 --- a/toolchain/check/handle_export.cpp +++ b/toolchain/check/handle_export.cpp @@ -81,8 +81,8 @@ auto HandleParseNode(Context& context, Parse::ExportDeclId node_id) -> bool { // diagnostic and so that cross-package imports can find it easily. auto entity_name = context.entity_names().Get(import_ref->entity_name_id); auto& parent_scope = context.name_scopes().Get(entity_name.parent_scope_id); - auto lookup = parent_scope.name_map.Lookup(entity_name.name_id); - auto& scope_inst_id = parent_scope.names[lookup.value()].inst_id; + auto& scope_inst_id = + parent_scope.GetEntry(*parent_scope.Lookup(entity_name.name_id)).inst_id; CARBON_CHECK(scope_inst_id == inst_id); scope_inst_id = export_id; diff --git a/toolchain/check/handle_impl.cpp b/toolchain/check/handle_impl.cpp index 6de37a2e90e90..0d55083d7af94 100644 --- a/toolchain/check/handle_impl.cpp +++ b/toolchain/check/handle_impl.cpp @@ -76,10 +76,10 @@ static auto TryAsClassScope(Context& context, SemIR::NameScopeId scope_id) return std::nullopt; } auto& scope = context.name_scopes().Get(scope_id); - if (!scope.inst_id.is_valid()) { + if (!scope.inst_id().is_valid()) { return std::nullopt; } - return context.insts().TryGetAs(scope.inst_id); + return context.insts().TryGetAs(scope.inst_id()); } static auto GetDefaultSelfType(Context& context) -> SemIR::TypeId { @@ -145,7 +145,7 @@ static auto ExtendImpl(Context& context, Parse::NodeId extend_node, CARBON_DIAGNOSTIC(ExtendImplForall, Error, "cannot `extend` a parameterized `impl`"); context.emitter().Emit(extend_node, ExtendImplForall); - parent_scope.has_error = true; + parent_scope.set_has_error(); return; } @@ -158,7 +158,7 @@ static auto ExtendImpl(Context& context, Parse::NodeId extend_node, // If the explicit self type is not the default, just bail out. if (self_type_id != GetDefaultSelfType(context)) { diag.Emit(); - parent_scope.has_error = true; + parent_scope.set_has_error(); return; } @@ -176,18 +176,21 @@ static auto ExtendImpl(Context& context, Parse::NodeId extend_node, if (!context.types().Is(constraint_id)) { context.TODO(node_id, "extending non-facet-type constraint"); - parent_scope.has_error = true; + parent_scope.set_has_error(); return; } - parent_scope.has_error |= !context.TryToDefineType(constraint_id, [&] { - CARBON_DIAGNOSTIC(ExtendUndefinedInterface, Error, - "`extend impl` requires a definition for facet type {0}", - InstIdAsType); - return context.emitter().Build(node_id, ExtendUndefinedInterface, - constraint_inst_id); - }); - - parent_scope.extended_scopes.push_back(constraint_inst_id); + if (!context.TryToDefineType(constraint_id, [&] { + CARBON_DIAGNOSTIC( + ExtendUndefinedInterface, Error, + "`extend impl` requires a definition for facet type {0}", + InstIdAsType); + return context.emitter().Build(node_id, ExtendUndefinedInterface, + constraint_inst_id); + })) { + parent_scope.set_has_error(); + }; + + parent_scope.AddExtendedScope(constraint_inst_id); } // Pops the parameters of an `impl`, forming a `NameComponent` with no diff --git a/toolchain/check/handle_let_and_var.cpp b/toolchain/check/handle_let_and_var.cpp index 2779855fbd5c7..5967111812c6e 100644 --- a/toolchain/check/handle_let_and_var.cpp +++ b/toolchain/check/handle_let_and_var.cpp @@ -75,7 +75,7 @@ static auto BuildAssociatedConstantDecl(Context& context, "single `:!` binding"); context.emitter().Emit(pattern.loc_id, ExpectedSymbolicBindingInAssociatedConstant); - context.name_scopes().Get(interface_info.scope_id).has_error = true; + context.name_scopes().Get(interface_info.scope_id).set_has_error(); return; } diff --git a/toolchain/check/handle_namespace.cpp b/toolchain/check/handle_namespace.cpp index cbc1eec8969e9..f4b6e4b22b4f4 100644 --- a/toolchain/check/handle_namespace.cpp +++ b/toolchain/check/handle_namespace.cpp @@ -50,14 +50,17 @@ auto HandleParseNode(Context& context, Parse::NamespaceId node_id) -> bool { // Point at the other namespace. namespace_inst.name_scope_id = existing->name_scope_id; - if (context.name_scopes().Get(existing->name_scope_id).is_closed_import) { + if (context.name_scopes() + .Get(existing->name_scope_id) + .is_closed_import()) { // The existing name is a package name, so this is a name conflict. context.DiagnoseDuplicateName(namespace_id, existing_inst_id); // Treat this as a local namespace name from now on to avoid further // diagnostics. - context.name_scopes().Get(existing->name_scope_id).is_closed_import = - false; + context.name_scopes() + .Get(existing->name_scope_id) + .set_is_closed_import(false); } else if (existing->import_id.is_valid() && !context.insts().GetLocId(existing_inst_id).is_valid()) { // When the name conflict is an imported namespace, fill the location ID diff --git a/toolchain/check/import.cpp b/toolchain/check/import.cpp index 4d1788dd59640..debb25096df6b 100644 --- a/toolchain/check/import.cpp +++ b/toolchain/check/import.cpp @@ -26,6 +26,11 @@ static auto GetImportNameForEntity(const T& entity) -> std::pair { return {entity.name_id, entity.parent_scope_id}; } +template <> +auto GetImportNameForEntity(const SemIR::NameScope& entity) + -> std::pair { + return {entity.name_id(), entity.parent_scope_id()}; +} // Returns name information for the entity, corresponding to IDs in the import // IR rather than the current IR. @@ -99,10 +104,12 @@ static auto AddNamespace(Context& context, SemIR::TypeId namespace_type_id, llvm::function_ref make_import_id) -> NamespaceResult { auto* parent_scope = &context.name_scopes().Get(parent_scope_id); - auto insert_result = - parent_scope->name_map.Insert(name_id, parent_scope->names.size()); - if (!insert_result.is_inserted()) { - auto prev_inst_id = parent_scope->names[insert_result.value()].inst_id; + auto [inserted, entry_id] = parent_scope->LookupOrAdd( + name_id, + // This InstId is temporary and would be overridden if used. + SemIR::InstId::Invalid, SemIR::AccessKind::Public); + if (!inserted) { + auto prev_inst_id = parent_scope->GetEntry(entry_id).inst_id; if (auto namespace_inst = context.insts().TryGetAs(prev_inst_id)) { if (diagnose_duplicate_namespace) { @@ -140,17 +147,12 @@ static auto AddNamespace(Context& context, SemIR::TypeId namespace_type_id, // Diagnose if there's a name conflict, but still produce the namespace to // supersede the name conflict in order to avoid repeat diagnostics. - if (!insert_result.is_inserted()) { - auto& entry = parent_scope->names[insert_result.value()]; + auto& entry = parent_scope->GetEntry(entry_id); + if (!inserted) { context.DiagnoseDuplicateName(namespace_id, entry.inst_id); - entry.inst_id = namespace_id; entry.access_kind = SemIR::AccessKind::Public; - } else { - parent_scope->names.push_back({.name_id = name_id, - .inst_id = namespace_id, - .access_kind = SemIR::AccessKind::Public}); } - + entry.inst_id = namespace_id; return {namespace_inst.name_scope_id, namespace_id, false}; } @@ -237,20 +239,20 @@ static auto CopyAncestorNameScopesFromImportIR( // The namespace hasn't been copied yet, so add it to our list. const auto& scope = import_sem_ir.name_scopes().Get(import_parent_scope_id); auto scope_inst = - import_sem_ir.insts().GetAs(scope.inst_id); + import_sem_ir.insts().GetAs(scope.inst_id()); new_namespaces.push_back(scope_inst.name_scope_id); - import_parent_scope_id = scope.parent_scope_id; + import_parent_scope_id = scope.parent_scope_id(); } // Add ancestor namespace names, starting with the outermost. for (auto import_scope_id : llvm::reverse(new_namespaces)) { auto import_scope = import_sem_ir.name_scopes().Get(import_scope_id); auto name_id = - CopyNameFromImportIR(context, import_sem_ir, import_scope.name_id); + CopyNameFromImportIR(context, import_sem_ir, import_scope.name_id()); scope_cursor = CopySingleNameScopeFromImportIR( context, namespace_type_id, &copied_namespaces, ir_id, - import_scope.inst_id, import_scope_id, scope_cursor, name_id) + import_scope.inst_id(), import_scope_id, scope_cursor, name_id) .name_scope_id; } @@ -265,25 +267,22 @@ static auto AddImportRefOrMerge(Context& context, SemIR::ImportIRId ir_id, SemIR::NameId name_id) -> void { // Leave a placeholder that the inst comes from the other IR. auto& parent_scope = context.name_scopes().Get(parent_scope_id); - auto insert = parent_scope.name_map.Insert(name_id, [&] { + auto [inserted, entry_id] = parent_scope.LookupOrAdd( + name_id, + // This InstId is temporary and would be overridden if used. + SemIR::InstId::Invalid, SemIR::AccessKind::Public); + auto& entry = parent_scope.GetEntry(entry_id); + if (inserted) { auto entity_name_id = context.entity_names().Add( {.name_id = name_id, .parent_scope_id = parent_scope_id, .bind_index = SemIR::CompileTimeBindIndex::Invalid}); - int index = parent_scope.names.size(); - parent_scope.names.push_back( - {.name_id = name_id, - .inst_id = - AddImportRef(context, {.ir_id = ir_id, .inst_id = import_inst_id}, - entity_name_id), - .access_kind = SemIR::AccessKind::Public}); - return index; - }); - if (insert.is_inserted()) { + entry.inst_id = AddImportRef( + context, {.ir_id = ir_id, .inst_id = import_inst_id}, entity_name_id); return; } - auto inst_id = parent_scope.names[insert.value()].inst_id; + auto inst_id = entry.inst_id; auto prev_ir_inst = GetCanonicalImportIRInst(context, inst_id); VerifySameCanonicalImportIRInst(context, inst_id, prev_ir_inst, ir_id, &import_sem_ir, import_inst_id); @@ -333,7 +332,7 @@ static auto ImportScopeFromApiFile(Context& context, const auto& api_scope = api_sem_ir.name_scopes().Get(api_scope_id); auto& impl_scope = context.name_scopes().Get(impl_scope_id); - for (const auto& api_entry : api_scope.names) { + for (const auto& api_entry : api_scope.entries()) { auto impl_name_id = CopyNameFromImportIR(context, api_sem_ir, api_entry.name_id); if (auto ns = @@ -342,7 +341,7 @@ static auto ImportScopeFromApiFile(Context& context, // ImportLibrariesFromOtherPackage. if (api_scope_id == SemIR::NameScopeId::Package) { const auto& ns_scope = api_sem_ir.name_scopes().Get(ns->name_scope_id); - if (!ns_scope.import_ir_scopes.empty()) { + if (!ns_scope.import_ir_scopes().empty()) { continue; } } @@ -427,8 +426,8 @@ auto ImportLibrariesFromCurrentPackage( // file, it transitively affects the current file too. if (import_ir.sem_ir->name_scopes() .Get(SemIR::NameScopeId::Package) - .has_error) { - context.name_scopes().Get(SemIR::NameScopeId::Package).has_error = true; + .has_error()) { + context.name_scopes().Get(SemIR::NameScopeId::Package).set_has_error(); } } } @@ -450,15 +449,16 @@ auto ImportLibrariesFromOtherPackage(Context& context, auto namespace_const_id = context.constant_values().Get(result.inst_id); auto& scope = context.name_scopes().Get(result.name_scope_id); - scope.is_closed_import = !result.is_duplicate_of_namespace_in_current_package; + scope.set_is_closed_import( + !result.is_duplicate_of_namespace_in_current_package); for (auto import_ir : import_irs) { auto ir_id = AddImportIR(context, import_ir); - scope.import_ir_scopes.push_back({ir_id, SemIR::NameScopeId::Package}); + scope.AddImportIRScope({ir_id, SemIR::NameScopeId::Package}); context.import_ir_constant_values()[ir_id.index].Set( SemIR::Namespace::PackageInstId, namespace_const_id); } if (has_load_error) { - scope.has_error = has_load_error; + scope.set_has_error(); } } @@ -483,13 +483,15 @@ static auto LookupNameInImport(const SemIR::File& import_ir, // Look up the name in the import scope. const auto& import_scope = import_ir.name_scopes().Get(import_scope_id); - auto lookup = import_scope.name_map.Lookup(import_name_id); - if (!lookup) { + auto import_scope_entry_id = import_scope.Lookup(import_name_id); + if (!import_scope_entry_id) { // Name doesn't exist in the import scope. return nullptr; } - const auto& import_scope_entry = import_scope.names[lookup.value()]; + const auto& import_scope_entry = + import_scope.GetEntry(*import_scope_entry_id); + if (import_scope_entry.access_kind != SemIR::AccessKind::Public) { // Ignore cross-package non-public names. return nullptr; @@ -512,8 +514,9 @@ static auto AddNamespaceFromOtherPackage(Context& context, context, namespace_type_id, /*copied_namespaces=*/nullptr, import_ir_id, import_inst_id, import_ns.name_scope_id, parent_scope_id, name_id); auto& scope = context.name_scopes().Get(result.name_scope_id); - scope.is_closed_import = !result.is_duplicate_of_namespace_in_current_package; - scope.import_ir_scopes.push_back({import_ir_id, import_ns.name_scope_id}); + scope.set_is_closed_import( + !result.is_duplicate_of_namespace_in_current_package); + scope.AddImportIRScope({import_ir_id, import_ns.name_scope_id}); return result.inst_id; } @@ -584,8 +587,7 @@ auto ImportNameFromOtherPackage( if (auto import_ns = import_inst.TryAs()) { if (auto ns = context.insts().TryGetAs(result_id)) { auto& name_scope = context.name_scopes().Get(ns->name_scope_id); - name_scope.import_ir_scopes.push_back( - {import_ir_id, import_ns->name_scope_id}); + name_scope.AddImportIRScope({import_ir_id, import_ns->name_scope_id}); continue; } } diff --git a/toolchain/check/import_ref.cpp b/toolchain/check/import_ref.cpp index ae0ec1cb769c4..bbf8b12a6e3bc 100644 --- a/toolchain/check/import_ref.cpp +++ b/toolchain/check/import_ref.cpp @@ -1204,14 +1204,14 @@ static auto GetIncompleteLocalEntityBase( static auto AddNameScopeImportRefs(ImportContext& context, const SemIR::NameScope& import_scope, SemIR::NameScope& new_scope) -> void { - for (auto entry : import_scope.names) { + for (auto entry : import_scope.entries()) { auto ref_id = AddImportRef(context, entry.inst_id); new_scope.AddRequired({.name_id = GetLocalNameId(context, entry.name_id), .inst_id = ref_id, .access_kind = entry.access_kind}); } - for (auto scope_inst_id : import_scope.extended_scopes) { - new_scope.extended_scopes.push_back(AddImportRef(context, scope_inst_id)); + for (auto scope_inst_id : import_scope.extended_scopes()) { + new_scope.AddExtendedScope(AddImportRef(context, scope_inst_id)); } } @@ -2020,7 +2020,7 @@ static auto AddInterfaceDefinition(ImportContext& context, context.local_context().inst_block_stack().Pop(); new_interface.self_param_id = self_param_id; - CARBON_CHECK(import_scope.extended_scopes.empty(), + CARBON_CHECK(import_scope.extended_scopes().empty(), "Interfaces don't currently have extended scopes to support."); } diff --git a/toolchain/check/merge.cpp b/toolchain/check/merge.cpp index 1d2a38307f46a..b19eb0cc87ddd 100644 --- a/toolchain/check/merge.cpp +++ b/toolchain/check/merge.cpp @@ -169,8 +169,9 @@ auto ReplacePrevInstForMerge(Context& context, SemIR::NameScopeId scope_id, SemIR::NameId name_id, SemIR::InstId new_inst_id) -> void { auto& scope = context.name_scopes().Get(scope_id); - if (auto lookup = scope.name_map.Lookup(name_id)) { - scope.names[lookup.value()].inst_id = new_inst_id; + auto entry_id = scope.Lookup(name_id); + if (entry_id) { + scope.GetEntry(*entry_id).inst_id = new_inst_id; } } diff --git a/toolchain/lower/mangler.cpp b/toolchain/lower/mangler.cpp index fb910e1355336..16ceb05d72574 100644 --- a/toolchain/lower/mangler.cpp +++ b/toolchain/lower/mangler.cpp @@ -39,7 +39,7 @@ auto Mangler::MangleInverseQualifiedNameScope(llvm::raw_ostream& os, continue; } const auto& name_scope = sem_ir().name_scopes().Get(name_scope_id); - CARBON_KIND_SWITCH(sem_ir().insts().Get(name_scope.inst_id)) { + CARBON_KIND_SWITCH(sem_ir().insts().Get(name_scope.inst_id())) { case CARBON_KIND(SemIR::ImplDecl impl_decl): { const auto& impl = sem_ir().impls().Get(impl_decl.impl_id); @@ -110,7 +110,7 @@ auto Mangler::MangleInverseQualifiedNameScope(llvm::raw_ostream& os, break; } case SemIR::Namespace::Kind: { - os << names().GetAsStringIfIdentifier(name_scope.name_id); + os << names().GetAsStringIfIdentifier(name_scope.name_id()); break; } default: @@ -119,7 +119,7 @@ auto Mangler::MangleInverseQualifiedNameScope(llvm::raw_ostream& os, } if (!name_scope.is_imported_package()) { names_to_render.push_back( - {.name_scope_id = name_scope.parent_scope_id, .prefix = '.'}); + {.name_scope_id = name_scope.parent_scope_id(), .prefix = '.'}); } } } diff --git a/toolchain/sem_ir/BUILD b/toolchain/sem_ir/BUILD index 99ef32bc095c0..0d102074dcd89 100644 --- a/toolchain/sem_ir/BUILD +++ b/toolchain/sem_ir/BUILD @@ -75,6 +75,7 @@ cc_library( "generic.cpp", "impl.cpp", "name.cpp", + "name_scope.cpp", "type.cpp", "type_info.cpp", ], @@ -181,6 +182,17 @@ cc_library( ], ) +cc_test( + name = "name_scope_test", + size = "small", + srcs = ["name_scope_test.cpp"], + deps = [ + ":file", + "//testing/base:gtest_main", + "@googletest//:gtest", + ], +) + cc_test( name = "typed_insts_test", size = "small", diff --git a/toolchain/sem_ir/formatter.cpp b/toolchain/sem_ir/formatter.cpp index 49f1fd5d052f0..ff70a25b3e9d3 100644 --- a/toolchain/sem_ir/formatter.cpp +++ b/toolchain/sem_ir/formatter.cpp @@ -614,8 +614,8 @@ class FormatterImpl { auto FormatNameScope(NameScopeId id, llvm::StringRef label = "") -> void { const auto& scope = sem_ir_->name_scopes().Get(id); - if (scope.names.empty() && scope.extended_scopes.empty() && - scope.import_ir_scopes.empty() && !scope.has_error) { + if (scope.entries().empty() && scope.extended_scopes().empty() && + scope.import_ir_scopes().empty() && !scope.has_error()) { // Name scope is empty. return; } @@ -625,7 +625,7 @@ class FormatterImpl { out_ << label; } - for (auto [name_id, inst_id, access_kind] : scope.names) { + for (auto [name_id, inst_id, access_kind] : scope.entries()) { Indent(); out_ << "."; FormatName(name_id); @@ -644,7 +644,7 @@ class FormatterImpl { out_ << "\n"; } - for (auto extended_scope_id : scope.extended_scopes) { + for (auto extended_scope_id : scope.extended_scopes()) { Indent(); out_ << "extend "; FormatName(extended_scope_id); @@ -656,7 +656,7 @@ class FormatterImpl { // add or remove an unused prelude file, but is intended to still show the // existence of indirect imports. bool has_prelude_components = false; - for (auto [import_ir_id, unused] : scope.import_ir_scopes) { + for (auto [import_ir_id, unused] : scope.import_ir_scopes()) { auto label = GetImportIRLabel(import_ir_id); if (label.starts_with("Core//prelude/")) { if (has_prelude_components) { @@ -671,7 +671,7 @@ class FormatterImpl { out_ << "import " << label << "\n"; } - if (scope.has_error) { + if (scope.has_error()) { Indent(); out_ << "has_error\n"; } diff --git a/toolchain/sem_ir/ids.h b/toolchain/sem_ir/ids.h index e643298bca381..4fb961c5e2cf5 100644 --- a/toolchain/sem_ir/ids.h +++ b/toolchain/sem_ir/ids.h @@ -17,6 +17,7 @@ namespace Carbon::SemIR { // Forward declare indexed types, for integration with ValueStore. class File; class Inst; +class NameScope; struct EntityName; struct Class; struct FacetTypeInfo; @@ -27,7 +28,6 @@ struct ImportIR; struct ImportIRInst; struct Impl; struct Interface; -struct NameScope; struct StructTypeField; struct TypeInfo; diff --git a/toolchain/sem_ir/inst_namer.cpp b/toolchain/sem_ir/inst_namer.cpp index 83501f0eebeb8..c2c1fdcb23af0 100644 --- a/toolchain/sem_ir/inst_namer.cpp +++ b/toolchain/sem_ir/inst_namer.cpp @@ -675,7 +675,7 @@ auto InstNamer::CollectNamesInBlock(ScopeId scope_id, // The namespace is specified here due to the name conflict. case CARBON_KIND(SemIR::Namespace inst): { add_inst_name_id( - sem_ir_->name_scopes().Get(inst.name_scope_id).name_id); + sem_ir_->name_scopes().Get(inst.name_scope_id).name_id()); continue; } case OutParam::Kind: diff --git a/toolchain/sem_ir/name_scope.cpp b/toolchain/sem_ir/name_scope.cpp new file mode 100644 index 0000000000000..d87e9d2e96626 --- /dev/null +++ b/toolchain/sem_ir/name_scope.cpp @@ -0,0 +1,54 @@ +// Part of the Carbon Language project, under the Apache License v2.0 with LLVM +// Exceptions. See /LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +#include "toolchain/sem_ir/name_scope.h" + +namespace Carbon::SemIR { + +auto NameScope::Print(llvm::raw_ostream& out) const -> void { + out << "{inst: " << inst_id_ << ", parent_scope: " << parent_scope_id_ + << ", has_error: " << (has_error_ ? "true" : "false"); + + out << ", extended_scopes: ["; + llvm::ListSeparator scope_sep; + for (auto id : extended_scopes_) { + out << scope_sep << id; + } + out << "]"; + + out << ", names: {"; + llvm::ListSeparator sep; + for (auto entry : names_) { + out << sep << entry.name_id << ": " << entry.inst_id; + } + out << "}"; + + out << "}"; +} + +auto NameScope::AddRequired(Entry name_entry) -> void { + auto add_name = [&] { + EntryId index(names_.size()); + names_.push_back(name_entry); + return index; + }; + auto result = name_map_.Insert(name_entry.name_id, add_name); + CARBON_CHECK(result.is_inserted(), "Failed to add required name: {0}", + name_entry.name_id); +} + +auto NameScope::LookupOrAdd(SemIR::NameId name_id, InstId inst_id, + AccessKind access_kind) + -> std::pair { + auto insert_result = name_map_.Insert(name_id, EntryId(names_.size())); + if (!insert_result.is_inserted()) { + return {false, EntryId(insert_result.value())}; + } + + names_.push_back( + {.name_id = name_id, .inst_id = inst_id, .access_kind = access_kind}); + return {true, EntryId(names_.size() - 1)}; +} + +} // namespace Carbon::SemIR diff --git a/toolchain/sem_ir/name_scope.h b/toolchain/sem_ir/name_scope.h index fe985ab7c996a..e7b38278220bb 100644 --- a/toolchain/sem_ir/name_scope.h +++ b/toolchain/sem_ir/name_scope.h @@ -18,52 +18,104 @@ enum class AccessKind : int8_t { Private, }; -struct NameScope : Printable { +class NameScope : public Printable { + public: struct Entry { NameId name_id; InstId inst_id; AccessKind access_kind; }; - auto Print(llvm::raw_ostream& out) const -> void { - out << "{inst: " << inst_id << ", parent_scope: " << parent_scope_id - << ", has_error: " << (has_error ? "true" : "false"); + struct EntryId : public IdBase { + static constexpr llvm::StringLiteral Label = "name_scope_entry"; + using IdBase::IdBase; + }; - out << ", extended_scopes: ["; - llvm::ListSeparator scope_sep; - for (auto id : extended_scopes) { - out << scope_sep << id; - } - out << "]"; + explicit NameScope(InstId inst_id, NameId name_id, + NameScopeId parent_scope_id) + : inst_id_(inst_id), + name_id_(name_id), + parent_scope_id_(parent_scope_id) {} - out << ", names: {"; - llvm::ListSeparator sep; - for (auto entry : names) { - out << sep << entry.name_id << ": " << entry.inst_id; + auto Print(llvm::raw_ostream& out) const -> void; + + auto entries() const -> llvm::ArrayRef { return names_; } + + // Get a specific Name entry based on an EntryId that return from a lookup. + // The Entry could become invalidated if the scope object is invalidated or if + // a name is added. + auto GetEntry(EntryId entry_id) const -> const Entry& { + return names_[entry_id.index]; + } + auto GetEntry(EntryId entry_id) -> Entry& { return names_[entry_id.index]; } + + // Searches for the given name and returns an EntryId if found or nullopt if + // not. + auto Lookup(NameId name_id) const -> std::optional { + auto lookup = name_map_.Lookup(name_id); + if (!lookup) { + return std::nullopt; } - out << "}"; + return lookup.value(); + } + + // Adds a new name known to not exist. + auto AddRequired(Entry name_entry) -> void; + + // If the given name already exists, return true and an EntryId. + // If not, adds the name using inst_id and access_kind and returns false and + // an EntryId. + auto LookupOrAdd(SemIR::NameId name_id, InstId inst_id, + AccessKind access_kind) -> std::pair; - out << "}"; + auto extended_scopes() const -> llvm::ArrayRef { + return extended_scopes_; } - // Adds a name to the scope that must not already exist. - auto AddRequired(Entry name_entry) -> void { - auto add_name = [&] { - int index = names.size(); - names.push_back(name_entry); - return index; - }; - auto result = name_map.Insert(name_entry.name_id, add_name); - CARBON_CHECK(result.is_inserted(), "Failed to add required name: {0}", - name_entry.name_id); + auto AddExtendedScope(SemIR::InstId extended_scope) -> void { + extended_scopes_.push_back(extended_scope); + } + + auto inst_id() const -> InstId { return inst_id_; } + + auto name_id() const -> NameId { return name_id_; } + + auto parent_scope_id() const -> NameScopeId { return parent_scope_id_; } + + auto has_error() const -> bool { return has_error_; } + + // Mark that we have diagnosed an error in a construct that would have added + // names to this scope. + auto set_has_error() -> void { has_error_ = true; } + + auto is_closed_import() const -> bool { return is_closed_import_; } + + auto set_is_closed_import(bool is_closed_import) -> void { + is_closed_import_ = is_closed_import; } // Returns true if this name scope describes an imported package. auto is_imported_package() const -> bool { - return is_closed_import && parent_scope_id == NameScopeId::Package; + return is_closed_import() && parent_scope_id() == NameScopeId::Package; + } + + auto import_ir_scopes() const + -> llvm::ArrayRef> { + return import_ir_scopes_; + } + + auto AddImportIRScope( + const std::pair& import_ir_scope) + -> void { + return import_ir_scopes_.push_back(import_ir_scope); } - // Names in the scope. We store both an insertion-ordered vector for iterating + private: + // Names in the scope. + // Entries could become invalidated if the scope object is invalidated or if a + // name is added. + // + // We store both an insertion-ordered vector for iterating // and a map from `NameId` to the index of that vector for name lookup. // // Optimization notes: this is somewhat memory inefficient. If this ends up @@ -72,8 +124,8 @@ struct NameScope : Printable { // vector so that these can pack densely. If this ends up both cold and memory // intensive, we can also switch the lookup to a set of indices into the // vector rather than a map from `NameId` to index. - llvm::SmallVector names; - Map name_map; + llvm::SmallVector names_; + Map name_map_; // Instructions returning values that are extended by this scope. // @@ -81,31 +133,31 @@ struct NameScope : Printable { // than a single extended scope. // TODO: Revisit this once we have more kinds of extended scope and data. // TODO: Consider using something like `TinyPtrVector` for this. - llvm::SmallVector extended_scopes; + llvm::SmallVector extended_scopes_; // The instruction which owns the scope. - InstId inst_id; + InstId inst_id_; // When the scope is a namespace, the name. Otherwise, invalid. - NameId name_id; + NameId name_id_; // The parent scope. - NameScopeId parent_scope_id; + NameScopeId parent_scope_id_; // Whether we have diagnosed an error in a construct that would have added // names to this scope. For example, this can happen if an `import` failed or - // an `extend` declaration was ill-formed. If true, the `names` map is assumed - // to be missing names as a result of the error, and no further errors are - // produced for lookup failures in this scope. - bool has_error = false; + // an `extend` declaration was ill-formed. If true, names are assumed to be + // missing as a result of the error, and no further errors are produced for + // lookup failures in this scope. + bool has_error_ = false; // True if this is a closed namespace created by importing a package. - bool is_closed_import = false; + bool is_closed_import_ = false; // Imported IR scopes that compose this namespace. This will be empty for // scopes that correspond to the current package. llvm::SmallVector, 0> - import_ir_scopes; + import_ir_scopes_; }; // Provides a ValueStore wrapper for an API specific to name scopes. @@ -116,9 +168,7 @@ class NameScopeStore { // Adds a name scope, returning an ID to reference it. auto Add(InstId inst_id, NameId name_id, NameScopeId parent_scope_id) -> NameScopeId { - return values_.Add({.inst_id = inst_id, - .name_id = name_id, - .parent_scope_id = parent_scope_id}); + return values_.Add(NameScope(inst_id, name_id, parent_scope_id)); } // Adds a name that is required to exist in a name scope, such as `Self`. @@ -145,7 +195,7 @@ class NameScopeStore { if (!scope_id.is_valid()) { return {InstId::Invalid, std::nullopt}; } - auto inst_id = Get(scope_id).inst_id; + auto inst_id = Get(scope_id).inst_id(); if (!inst_id.is_valid()) { return {InstId::Invalid, std::nullopt}; } diff --git a/toolchain/sem_ir/name_scope_test.cpp b/toolchain/sem_ir/name_scope_test.cpp new file mode 100644 index 0000000000000..c34aa1d8f010e --- /dev/null +++ b/toolchain/sem_ir/name_scope_test.cpp @@ -0,0 +1,261 @@ +// Part of the Carbon Language project, under the Apache License v2.0 with LLVM +// Exceptions. See /LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +#include "toolchain/sem_ir/name_scope.h" + +#include +#include + +namespace Carbon::SemIR { +namespace { + +using ::testing::ElementsAre; +using ::testing::Field; +using ::testing::Pair; + +MATCHER_P(NameScopeEntryEquals, entry, "") { + return ExplainMatchResult( + AllOf(Field("name_id", &NameScope::Entry::name_id, entry.name_id), + Field("inst_id", &NameScope::Entry::inst_id, entry.inst_id), + Field("access_kind", &NameScope::Entry::access_kind, + entry.access_kind)), + arg, result_listener); +} + +TEST(NameScope, Empty) { + int id = 0; + + InstId scope_inst_id(++id); + NameId scope_name_id(++id); + NameScopeId parent_scope_id(++id); + NameScope name_scope(scope_inst_id, scope_name_id, parent_scope_id); + + EXPECT_THAT(name_scope.entries(), ElementsAre()); + EXPECT_THAT(name_scope.extended_scopes(), ElementsAre()); + EXPECT_EQ(name_scope.inst_id(), scope_inst_id); + EXPECT_EQ(name_scope.name_id(), scope_name_id); + EXPECT_EQ(name_scope.parent_scope_id(), parent_scope_id); + EXPECT_FALSE(name_scope.has_error()); + EXPECT_FALSE(name_scope.is_closed_import()); + EXPECT_FALSE(name_scope.is_imported_package()); + EXPECT_THAT(name_scope.import_ir_scopes(), ElementsAre()); +} + +TEST(NameScope, Lookup) { + int id = 0; + + InstId scope_inst_id(++id); + NameId scope_name_id(++id); + NameScopeId parent_scope_id(++id); + NameScope name_scope(scope_inst_id, scope_name_id, parent_scope_id); + + NameScope::Entry entry1 = {.name_id = NameId(++id), + .inst_id = InstId(++id), + .access_kind = AccessKind::Public}; + name_scope.AddRequired(entry1); + + NameScope::Entry entry2 = {.name_id = NameId(++id), + .inst_id = InstId(++id), + .access_kind = AccessKind::Protected}; + name_scope.AddRequired(entry2); + + NameScope::Entry entry3 = {.name_id = NameId(++id), + .inst_id = InstId(++id), + .access_kind = AccessKind::Private}; + name_scope.AddRequired(entry3); + + auto lookup = name_scope.Lookup(entry1.name_id); + ASSERT_NE(lookup, std::nullopt); + EXPECT_THAT(static_cast(name_scope).GetEntry(*lookup), + NameScopeEntryEquals(entry1)); + EXPECT_THAT(static_cast(name_scope).GetEntry(*lookup), + NameScopeEntryEquals(entry1)); + + lookup = name_scope.Lookup(entry2.name_id); + ASSERT_NE(lookup, std::nullopt); + EXPECT_THAT(name_scope.GetEntry(*lookup), NameScopeEntryEquals(entry2)); + + lookup = name_scope.Lookup(entry3.name_id); + ASSERT_NE(lookup, std::nullopt); + EXPECT_THAT(name_scope.GetEntry(*lookup), NameScopeEntryEquals(entry3)); + + NameId unknown_name_id(++id); + lookup = name_scope.Lookup(unknown_name_id); + EXPECT_EQ(lookup, std::nullopt); +} + +TEST(NameScope, LookupOrAdd) { + int id = 0; + + InstId scope_inst_id(++id); + NameId scope_name_id(++id); + NameScopeId parent_scope_id(++id); + NameScope name_scope(scope_inst_id, scope_name_id, parent_scope_id); + + NameScope::Entry entry1 = {.name_id = NameId(++id), + .inst_id = InstId(++id), + .access_kind = AccessKind::Public}; + { + auto [added, entry_id] = name_scope.LookupOrAdd( + entry1.name_id, entry1.inst_id, entry1.access_kind); + EXPECT_TRUE(added); + EXPECT_THAT(name_scope.GetEntry(entry_id), NameScopeEntryEquals(entry1)); + } + + NameScope::Entry entry2 = {.name_id = NameId(++id), + .inst_id = InstId(++id), + .access_kind = AccessKind::Protected}; + { + auto [added, entry_id] = name_scope.LookupOrAdd( + entry2.name_id, entry2.inst_id, entry2.access_kind); + EXPECT_TRUE(added); + EXPECT_THAT(name_scope.GetEntry(entry_id), NameScopeEntryEquals(entry2)); + } + + NameScope::Entry entry3 = {.name_id = NameId(++id), + .inst_id = InstId(++id), + .access_kind = AccessKind::Private}; + { + auto [added, entry_id] = name_scope.LookupOrAdd( + entry3.name_id, entry3.inst_id, entry3.access_kind); + EXPECT_TRUE(added); + EXPECT_THAT(name_scope.GetEntry(entry_id), NameScopeEntryEquals(entry3)); + } + + { + auto [added, entry_id] = name_scope.LookupOrAdd( + entry1.name_id, entry1.inst_id, entry1.access_kind); + EXPECT_FALSE(added); + EXPECT_THAT(name_scope.GetEntry(entry_id), NameScopeEntryEquals(entry1)); + } + + { + auto [added, entry_id] = name_scope.LookupOrAdd( + entry2.name_id, entry2.inst_id, entry2.access_kind); + EXPECT_FALSE(added); + EXPECT_THAT(name_scope.GetEntry(entry_id), NameScopeEntryEquals(entry2)); + } + + { + auto [added, entry_id] = name_scope.LookupOrAdd( + entry3.name_id, entry3.inst_id, entry3.access_kind); + EXPECT_FALSE(added); + EXPECT_THAT(name_scope.GetEntry(entry_id), NameScopeEntryEquals(entry3)); + } +} + +TEST(NameScope, ExtendedScopes) { + int id = 0; + + InstId scope_inst_id(++id); + NameId scope_name_id(++id); + NameScopeId parent_scope_id = NameScopeId::Package; + NameScope name_scope(scope_inst_id, scope_name_id, parent_scope_id); + + EXPECT_THAT(name_scope.extended_scopes(), ElementsAre()); + + InstId extended_scope1(++id); + name_scope.AddExtendedScope(extended_scope1); + EXPECT_THAT(name_scope.extended_scopes(), ElementsAre(extended_scope1)); + + InstId extended_scope2(++id); + name_scope.AddExtendedScope(extended_scope2); + EXPECT_THAT(name_scope.extended_scopes(), + ElementsAre(extended_scope1, extended_scope2)); +} + +TEST(NameScope, HasError) { + int id = 0; + + InstId scope_inst_id(++id); + NameId scope_name_id(++id); + NameScopeId parent_scope_id(++id); + NameScope name_scope(scope_inst_id, scope_name_id, parent_scope_id); + + EXPECT_FALSE(name_scope.has_error()); + + name_scope.set_has_error(); + EXPECT_TRUE(name_scope.has_error()); + + name_scope.set_has_error(); + EXPECT_TRUE(name_scope.has_error()); +} + +TEST(NameScope, IsClosedImport) { + int id = 0; + + InstId scope_inst_id(++id); + NameId scope_name_id(++id); + NameScopeId parent_scope_id(++id); + NameScope name_scope(scope_inst_id, scope_name_id, parent_scope_id); + + EXPECT_FALSE(name_scope.is_closed_import()); + + name_scope.set_is_closed_import(true); + EXPECT_TRUE(name_scope.is_closed_import()); + + name_scope.set_is_closed_import(false); + EXPECT_FALSE(name_scope.is_closed_import()); +} + +TEST(NameScope, IsImportedPackageParentNonPackageScope) { + int id = 0; + + InstId scope_inst_id(++id); + NameId scope_name_id(++id); + NameScopeId parent_scope_id(++id); + NameScope name_scope(scope_inst_id, scope_name_id, parent_scope_id); + + EXPECT_FALSE(name_scope.is_imported_package()); + + name_scope.set_is_closed_import(true); + EXPECT_FALSE(name_scope.is_imported_package()); + + name_scope.set_is_closed_import(false); + EXPECT_FALSE(name_scope.is_imported_package()); +} + +TEST(NameScope, IsImportedPackageParentPackageScope) { + int id = 0; + + InstId scope_inst_id(++id); + NameId scope_name_id(++id); + NameScopeId parent_scope_id = NameScopeId::Package; + NameScope name_scope(scope_inst_id, scope_name_id, parent_scope_id); + + EXPECT_FALSE(name_scope.is_imported_package()); + + name_scope.set_is_closed_import(true); + EXPECT_TRUE(name_scope.is_imported_package()); + + name_scope.set_is_closed_import(false); + EXPECT_FALSE(name_scope.is_imported_package()); +} + +TEST(NameScope, ImportIRScopes) { + int id = 0; + + InstId scope_inst_id(++id); + NameId scope_name_id(++id); + NameScopeId parent_scope_id = NameScopeId::Package; + NameScope name_scope(scope_inst_id, scope_name_id, parent_scope_id); + + EXPECT_THAT(name_scope.import_ir_scopes(), ElementsAre()); + + ImportIRId import_ir_id1(++id); + NameScopeId import_name_scope_id1(++id); + name_scope.AddImportIRScope({import_ir_id1, import_name_scope_id1}); + EXPECT_THAT(name_scope.import_ir_scopes(), + ElementsAre(Pair(import_ir_id1, import_name_scope_id1))); + + ImportIRId import_ir_id2(++id); + NameScopeId import_name_scope_id2(++id); + name_scope.AddImportIRScope({import_ir_id2, import_name_scope_id2}); + EXPECT_THAT(name_scope.import_ir_scopes(), + ElementsAre(Pair(import_ir_id1, import_name_scope_id1), + Pair(import_ir_id2, import_name_scope_id2))); +} + +} // namespace +} // namespace Carbon::SemIR From bd0f620583a49318d143c42d613cc686d44619d4 Mon Sep 17 00:00:00 2001 From: josh11b <15258583+josh11b@users.noreply.github.com> Date: Fri, 6 Dec 2024 15:22:21 -0800 Subject: [PATCH 05/68] Add more tests of indexing a tuple with a non-literal (#4650) Co-authored-by: Josh L --- .../tuple/access/index_not_literal.carbon | 175 +++++++++++++----- 1 file changed, 126 insertions(+), 49 deletions(-) diff --git a/toolchain/check/testdata/tuple/access/index_not_literal.carbon b/toolchain/check/testdata/tuple/access/index_not_literal.carbon index bd1ca97edb2d6..b3ae52b3e521f 100644 --- a/toolchain/check/testdata/tuple/access/index_not_literal.carbon +++ b/toolchain/check/testdata/tuple/access/index_not_literal.carbon @@ -8,41 +8,65 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/tuple/access/index_not_literal.carbon -var a: (i32, i32) = (12, 34); +var a: (bool, i32) = (true, 34); var b: i32 = a.({.index = 1}.index); +var c: bool = a.(0 as i32); +var d: i32 = a.({.index = 1 as i32}.index); // CHECK:STDOUT: --- index_not_literal.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { +// CHECK:STDOUT: %Bool.type: type = fn_type @Bool [template] +// CHECK:STDOUT: %Bool: %Bool.type = struct_value () [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] // CHECK:STDOUT: %Int.type: type = fn_type @Int [template] // CHECK:STDOUT: %Int: %Int.type = struct_value () [template] // CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (type, type) [template] -// CHECK:STDOUT: %tuple.type.2: type = tuple_type (%i32, %i32) [template] -// CHECK:STDOUT: %int_12.1: Core.IntLiteral = int_value 12 [template] +// CHECK:STDOUT: %tuple.type.2: type = tuple_type (bool, %i32) [template] +// CHECK:STDOUT: %true: bool = bool_literal true [template] // CHECK:STDOUT: %int_34.1: Core.IntLiteral = int_value 34 [template] -// CHECK:STDOUT: %tuple.type.3: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [template] +// CHECK:STDOUT: %tuple.type.3: type = tuple_type (bool, Core.IntLiteral) [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] // CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] // CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_12.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_34.1, %Convert.14 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_12.2: %i32 = int_value 12 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_34.1, %Convert.14 [template] -// CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_34.2: %i32 = int_value 34 [template] -// CHECK:STDOUT: %tuple: %tuple.type.2 = tuple_value (%int_12.2, %int_34.2) [template] -// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %struct_type.index: type = struct_type {.index: Core.IntLiteral} [template] -// CHECK:STDOUT: %struct: %struct_type.index = struct_value (%int_1) [template] +// CHECK:STDOUT: %tuple: %tuple.type.2 = tuple_value (%true, %int_34.2) [template] +// CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %struct_type.index.1: type = struct_type {.index: Core.IntLiteral} [template] +// CHECK:STDOUT: %struct.1: %struct_type.index.1 = struct_value (%int_1.1) [template] +// CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.6, @As(%i32) [template] +// CHECK:STDOUT: %Convert.type.16: type = fn_type @Convert.7, @impl.5(%int_32) [template] +// CHECK:STDOUT: %Convert.16: %Convert.type.16 = struct_value () [template] +// CHECK:STDOUT: %interface.10: = interface_witness (%Convert.16) [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_0.1, %Convert.16 [template] +// CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.7(%int_32) [template] +// CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] +// CHECK:STDOUT: %Convert.type.17: type = fn_type @Convert.4, @impl.3(%int_32) [template] +// CHECK:STDOUT: %Convert.17: %Convert.type.17 = struct_value () [template] +// CHECK:STDOUT: %interface.11: = interface_witness (%Convert.17) [template] +// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_0.2, %Convert.17 [template] +// CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.4(%int_32) [template] +// CHECK:STDOUT: %Convert.bound.4: = bound_method %int_1.1, %Convert.16 [template] +// CHECK:STDOUT: %Convert.specific_fn.4: = specific_function %Convert.bound.4, @Convert.7(%int_32) [template] +// CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] +// CHECK:STDOUT: %struct_type.index.2: type = struct_type {.index: %i32} [template] +// CHECK:STDOUT: %struct.2: %struct_type.index.2 = struct_value (%int_1.2) [template] +// CHECK:STDOUT: %Convert.bound.5: = bound_method %int_1.2, %Convert.17 [template] +// CHECK:STDOUT: %Convert.specific_fn.5: = specific_function %Convert.bound.5, @Convert.4(%int_32) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .Bool = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.3 +// CHECK:STDOUT: .As = %import_ref.39 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -53,18 +77,19 @@ var b: i32 = a.({.index = 1}.index); // CHECK:STDOUT: .Core = imports.%Core // CHECK:STDOUT: .a = %a // CHECK:STDOUT: .b = %b +// CHECK:STDOUT: .c = %c +// CHECK:STDOUT: .d = %d // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int_32.loc11_9: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11_9: init type = call constants.%Int(%int_32.loc11_9) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc11_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11_14: init type = call constants.%Int(%int_32.loc11_14) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_17.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc11_9, %int.make_type_signed.loc11_14) -// CHECK:STDOUT: %.loc11_17.2: type = value_of_initializer %int.make_type_signed.loc11_9 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_17.3: type = converted %int.make_type_signed.loc11_9, %.loc11_17.2 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_17.4: type = value_of_initializer %int.make_type_signed.loc11_14 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_17.5: type = converted %int.make_type_signed.loc11_14, %.loc11_17.4 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_17.6: type = converted %.loc11_17.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] +// CHECK:STDOUT: %bool.make_type.loc11: init type = call constants.%Bool() [template = bool] +// CHECK:STDOUT: %int_32.loc11: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %int.make_type_signed.loc11: init type = call constants.%Int(%int_32.loc11) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_18.1: %tuple.type.1 = tuple_literal (%bool.make_type.loc11, %int.make_type_signed.loc11) +// CHECK:STDOUT: %.loc11_18.2: type = value_of_initializer %bool.make_type.loc11 [template = bool] +// CHECK:STDOUT: %.loc11_18.3: type = converted %bool.make_type.loc11, %.loc11_18.2 [template = bool] +// CHECK:STDOUT: %.loc11_18.4: type = value_of_initializer %int.make_type_signed.loc11 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_18.5: type = converted %int.make_type_signed.loc11, %.loc11_18.4 [template = constants.%i32] +// CHECK:STDOUT: %.loc11_18.6: type = converted %.loc11_18.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %a.var: ref %tuple.type.2 = var a // CHECK:STDOUT: %a: ref %tuple.type.2 = bind_name a, %a.var // CHECK:STDOUT: %int_32.loc12: Core.IntLiteral = int_value 32 [template = constants.%int_32] @@ -73,39 +98,91 @@ var b: i32 = a.({.index = 1}.index); // CHECK:STDOUT: %.loc12_8.2: type = converted %int.make_type_signed.loc12, %.loc12_8.1 [template = constants.%i32] // CHECK:STDOUT: %b.var: ref %i32 = var b // CHECK:STDOUT: %b: ref %i32 = bind_name b, %b.var +// CHECK:STDOUT: %bool.make_type.loc13: init type = call constants.%Bool() [template = bool] +// CHECK:STDOUT: %.loc13_8.1: type = value_of_initializer %bool.make_type.loc13 [template = bool] +// CHECK:STDOUT: %.loc13_8.2: type = converted %bool.make_type.loc13, %.loc13_8.1 [template = bool] +// CHECK:STDOUT: %c.var: ref bool = var c +// CHECK:STDOUT: %c: ref bool = bind_name c, %c.var +// CHECK:STDOUT: %int_32.loc14: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %int.make_type_signed.loc14: init type = call constants.%Int(%int_32.loc14) [template = constants.%i32] +// CHECK:STDOUT: %.loc14_8.1: type = value_of_initializer %int.make_type_signed.loc14 [template = constants.%i32] +// CHECK:STDOUT: %.loc14_8.2: type = converted %int.make_type_signed.loc14, %.loc14_8.1 [template = constants.%i32] +// CHECK:STDOUT: %d.var: ref %i32 = var d +// CHECK:STDOUT: %d: ref %i32 = bind_name d, %d.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int_12: Core.IntLiteral = int_value 12 [template = constants.%int_12.1] +// CHECK:STDOUT: %true: bool = bool_literal true [template = constants.%true] // CHECK:STDOUT: %int_34: Core.IntLiteral = int_value 34 [template = constants.%int_34.1] -// CHECK:STDOUT: %.loc11_28.1: %tuple.type.3 = tuple_literal (%int_12, %int_34) -// CHECK:STDOUT: %impl.elem0.loc11_28.1: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] -// CHECK:STDOUT: %Convert.bound.loc11_28.1: = bound_method %int_12, %impl.elem0.loc11_28.1 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc11_28.1: = specific_function %Convert.bound.loc11_28.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc11_28.1: init %i32 = call %Convert.specific_fn.loc11_28.1(%int_12) [template = constants.%int_12.2] -// CHECK:STDOUT: %.loc11_28.2: init %i32 = converted %int_12, %int.convert_checked.loc11_28.1 [template = constants.%int_12.2] -// CHECK:STDOUT: %tuple.elem0: ref %i32 = tuple_access file.%a.var, element0 -// CHECK:STDOUT: %.loc11_28.3: init %i32 = initialize_from %.loc11_28.2 to %tuple.elem0 [template = constants.%int_12.2] -// CHECK:STDOUT: %impl.elem0.loc11_28.2: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] -// CHECK:STDOUT: %Convert.bound.loc11_28.2: = bound_method %int_34, %impl.elem0.loc11_28.2 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc11_28.2: = specific_function %Convert.bound.loc11_28.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] -// CHECK:STDOUT: %int.convert_checked.loc11_28.2: init %i32 = call %Convert.specific_fn.loc11_28.2(%int_34) [template = constants.%int_34.2] -// CHECK:STDOUT: %.loc11_28.4: init %i32 = converted %int_34, %int.convert_checked.loc11_28.2 [template = constants.%int_34.2] +// CHECK:STDOUT: %.loc11_31.1: %tuple.type.3 = tuple_literal (%true, %int_34) +// CHECK:STDOUT: %tuple.elem0.loc11: ref bool = tuple_access file.%a.var, element0 +// CHECK:STDOUT: %.loc11_31.2: init bool = initialize_from %true to %tuple.elem0.loc11 [template = constants.%true] +// CHECK:STDOUT: %impl.elem0.loc11: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %Convert.bound.loc11: = bound_method %int_34, %impl.elem0.loc11 [template = constants.%Convert.bound.1] +// CHECK:STDOUT: %Convert.specific_fn.loc11: = specific_function %Convert.bound.loc11, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] +// CHECK:STDOUT: %int.convert_checked.loc11: init %i32 = call %Convert.specific_fn.loc11(%int_34) [template = constants.%int_34.2] +// CHECK:STDOUT: %.loc11_31.3: init %i32 = converted %int_34, %int.convert_checked.loc11 [template = constants.%int_34.2] // CHECK:STDOUT: %tuple.elem1.loc11: ref %i32 = tuple_access file.%a.var, element1 -// CHECK:STDOUT: %.loc11_28.5: init %i32 = initialize_from %.loc11_28.4 to %tuple.elem1.loc11 [template = constants.%int_34.2] -// CHECK:STDOUT: %.loc11_28.6: init %tuple.type.2 = tuple_init (%.loc11_28.3, %.loc11_28.5) to file.%a.var [template = constants.%tuple] -// CHECK:STDOUT: %.loc11_29: init %tuple.type.2 = converted %.loc11_28.1, %.loc11_28.6 [template = constants.%tuple] -// CHECK:STDOUT: assign file.%a.var, %.loc11_29 -// CHECK:STDOUT: %a.ref: ref %tuple.type.2 = name_ref a, file.%a -// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1] -// CHECK:STDOUT: %.loc12_28.1: %struct_type.index = struct_literal (%int_1) -// CHECK:STDOUT: %struct: %struct_type.index = struct_value (%int_1) [template = constants.%struct] -// CHECK:STDOUT: %.loc12_28.2: %struct_type.index = converted %.loc12_28.1, %struct [template = constants.%struct] -// CHECK:STDOUT: %.loc12_29: Core.IntLiteral = struct_access %.loc12_28.2, element0 [template = constants.%int_1] -// CHECK:STDOUT: %tuple.elem1.loc12: ref %i32 = tuple_access %a.ref, element1 +// CHECK:STDOUT: %.loc11_31.4: init %i32 = initialize_from %.loc11_31.3 to %tuple.elem1.loc11 [template = constants.%int_34.2] +// CHECK:STDOUT: %.loc11_31.5: init %tuple.type.2 = tuple_init (%.loc11_31.2, %.loc11_31.4) to file.%a.var [template = constants.%tuple] +// CHECK:STDOUT: %.loc11_32: init %tuple.type.2 = converted %.loc11_31.1, %.loc11_31.5 [template = constants.%tuple] +// CHECK:STDOUT: assign file.%a.var, %.loc11_32 +// CHECK:STDOUT: %a.ref.loc12: ref %tuple.type.2 = name_ref a, file.%a +// CHECK:STDOUT: %int_1.loc12: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] +// CHECK:STDOUT: %.loc12_28.1: %struct_type.index.1 = struct_literal (%int_1.loc12) +// CHECK:STDOUT: %struct.loc12: %struct_type.index.1 = struct_value (%int_1.loc12) [template = constants.%struct.1] +// CHECK:STDOUT: %.loc12_28.2: %struct_type.index.1 = converted %.loc12_28.1, %struct.loc12 [template = constants.%struct.1] +// CHECK:STDOUT: %.loc12_29: Core.IntLiteral = struct_access %.loc12_28.2, element0 [template = constants.%int_1.1] +// CHECK:STDOUT: %tuple.elem1.loc12: ref %i32 = tuple_access %a.ref.loc12, element1 // CHECK:STDOUT: %.loc12_15: %i32 = bind_value %tuple.elem1.loc12 // CHECK:STDOUT: assign file.%b.var, %.loc12_15 +// CHECK:STDOUT: %a.ref.loc13: ref %tuple.type.2 = name_ref a, file.%a +// CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] +// CHECK:STDOUT: %int_32.loc13: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %int.make_type_signed.loc13: init type = call constants.%Int(%int_32.loc13) [template = constants.%i32] +// CHECK:STDOUT: %.loc13_23.1: type = value_of_initializer %int.make_type_signed.loc13 [template = constants.%i32] +// CHECK:STDOUT: %.loc13_23.2: type = converted %int.make_type_signed.loc13, %.loc13_23.1 [template = constants.%i32] +// CHECK:STDOUT: %impl.elem0.loc13_20.1: %Convert.type.15 = interface_witness_access constants.%interface.10, element0 [template = constants.%Convert.16] +// CHECK:STDOUT: %Convert.bound.loc13_20.1: = bound_method %int_0, %impl.elem0.loc13_20.1 [template = constants.%Convert.bound.2] +// CHECK:STDOUT: %Convert.specific_fn.loc13_20.1: = specific_function %Convert.bound.loc13_20.1, @Convert.7(constants.%int_32) [template = constants.%Convert.specific_fn.2] +// CHECK:STDOUT: %int.convert_checked.loc13_20.1: init %i32 = call %Convert.specific_fn.loc13_20.1(%int_0) [template = constants.%int_0.2] +// CHECK:STDOUT: %.loc13_20.1: %i32 = value_of_initializer %int.convert_checked.loc13_20.1 [template = constants.%int_0.2] +// CHECK:STDOUT: %.loc13_20.2: %i32 = converted %int_0, %.loc13_20.1 [template = constants.%int_0.2] +// CHECK:STDOUT: %impl.elem0.loc13_20.2: %Convert.type.6 = interface_witness_access constants.%interface.11, element0 [template = constants.%Convert.17] +// CHECK:STDOUT: %Convert.bound.loc13_20.2: = bound_method %.loc13_20.2, %impl.elem0.loc13_20.2 [template = constants.%Convert.bound.3] +// CHECK:STDOUT: %Convert.specific_fn.loc13_20.2: = specific_function %Convert.bound.loc13_20.2, @Convert.4(constants.%int_32) [template = constants.%Convert.specific_fn.3] +// CHECK:STDOUT: %int.convert_checked.loc13_20.2: init Core.IntLiteral = call %Convert.specific_fn.loc13_20.2(%.loc13_20.2) [template = constants.%int_0.1] +// CHECK:STDOUT: %.loc13_20.3: Core.IntLiteral = value_of_initializer %int.convert_checked.loc13_20.2 [template = constants.%int_0.1] +// CHECK:STDOUT: %.loc13_20.4: Core.IntLiteral = converted %.loc13_20.2, %.loc13_20.3 [template = constants.%int_0.1] +// CHECK:STDOUT: %tuple.elem0.loc13: ref bool = tuple_access %a.ref.loc13, element0 +// CHECK:STDOUT: %.loc13_16: bool = bind_value %tuple.elem0.loc13 +// CHECK:STDOUT: assign file.%c.var, %.loc13_16 +// CHECK:STDOUT: %a.ref.loc14: ref %tuple.type.2 = name_ref a, file.%a +// CHECK:STDOUT: %int_1.loc14: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] +// CHECK:STDOUT: %int_32.loc14: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %int.make_type_signed.loc14: init type = call constants.%Int(%int_32.loc14) [template = constants.%i32] +// CHECK:STDOUT: %.loc14_32.1: type = value_of_initializer %int.make_type_signed.loc14 [template = constants.%i32] +// CHECK:STDOUT: %.loc14_32.2: type = converted %int.make_type_signed.loc14, %.loc14_32.1 [template = constants.%i32] +// CHECK:STDOUT: %impl.elem0.loc14_29: %Convert.type.15 = interface_witness_access constants.%interface.10, element0 [template = constants.%Convert.16] +// CHECK:STDOUT: %Convert.bound.loc14_29: = bound_method %int_1.loc14, %impl.elem0.loc14_29 [template = constants.%Convert.bound.4] +// CHECK:STDOUT: %Convert.specific_fn.loc14_29: = specific_function %Convert.bound.loc14_29, @Convert.7(constants.%int_32) [template = constants.%Convert.specific_fn.4] +// CHECK:STDOUT: %int.convert_checked.loc14_29: init %i32 = call %Convert.specific_fn.loc14_29(%int_1.loc14) [template = constants.%int_1.2] +// CHECK:STDOUT: %.loc14_29.1: %i32 = value_of_initializer %int.convert_checked.loc14_29 [template = constants.%int_1.2] +// CHECK:STDOUT: %.loc14_29.2: %i32 = converted %int_1.loc14, %.loc14_29.1 [template = constants.%int_1.2] +// CHECK:STDOUT: %.loc14_35.1: %struct_type.index.2 = struct_literal (%.loc14_29.2) +// CHECK:STDOUT: %struct.loc14: %struct_type.index.2 = struct_value (%.loc14_29.2) [template = constants.%struct.2] +// CHECK:STDOUT: %.loc14_35.2: %struct_type.index.2 = converted %.loc14_35.1, %struct.loc14 [template = constants.%struct.2] +// CHECK:STDOUT: %.loc14_36.1: %i32 = struct_access %.loc14_35.2, element0 [template = constants.%int_1.2] +// CHECK:STDOUT: %impl.elem0.loc14_36: %Convert.type.6 = interface_witness_access constants.%interface.11, element0 [template = constants.%Convert.17] +// CHECK:STDOUT: %Convert.bound.loc14_36: = bound_method %.loc14_36.1, %impl.elem0.loc14_36 [template = constants.%Convert.bound.5] +// CHECK:STDOUT: %Convert.specific_fn.loc14_36: = specific_function %Convert.bound.loc14_36, @Convert.4(constants.%int_32) [template = constants.%Convert.specific_fn.5] +// CHECK:STDOUT: %int.convert_checked.loc14_36: init Core.IntLiteral = call %Convert.specific_fn.loc14_36(%.loc14_36.1) [template = constants.%int_1.1] +// CHECK:STDOUT: %.loc14_36.2: Core.IntLiteral = value_of_initializer %int.convert_checked.loc14_36 [template = constants.%int_1.1] +// CHECK:STDOUT: %.loc14_36.3: Core.IntLiteral = converted %.loc14_36.1, %.loc14_36.2 [template = constants.%int_1.1] +// CHECK:STDOUT: %tuple.elem1.loc14: ref %i32 = tuple_access %a.ref.loc14, element1 +// CHECK:STDOUT: %.loc14_15: %i32 = bind_value %tuple.elem1.loc14 +// CHECK:STDOUT: assign file.%d.var, %.loc14_15 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: From 4e3b8c9775d76451d54aa59dca85499b03f1e3ae Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Mon, 9 Dec 2024 16:13:40 -0500 Subject: [PATCH 06/68] Disable modernize-use-trailing-return-type on MATCHER_P (#4656) clang-tidy gives a false positive on the use of the MATCHER_P macro. --- toolchain/sem_ir/name_scope_test.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/toolchain/sem_ir/name_scope_test.cpp b/toolchain/sem_ir/name_scope_test.cpp index c34aa1d8f010e..fa6068d80b27b 100644 --- a/toolchain/sem_ir/name_scope_test.cpp +++ b/toolchain/sem_ir/name_scope_test.cpp @@ -14,6 +14,7 @@ using ::testing::ElementsAre; using ::testing::Field; using ::testing::Pair; +// NOLINTNEXTLINE(modernize-use-trailing-return-type): From the macro. MATCHER_P(NameScopeEntryEquals, entry, "") { return ExplainMatchResult( AllOf(Field("name_id", &NameScope::Entry::name_id, entry.name_id), From e75ef345911a65349b7b35a86f65b2d2abb3b36c Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Mon, 9 Dec 2024 15:48:46 -0800 Subject: [PATCH 07/68] Improve diagnostics for missing qualified names. (#4638) Mention the scope in which the name wasn't found. --------- Co-authored-by: Geoff Romer --- toolchain/check/context.cpp | 55 +- toolchain/check/context.h | 9 + .../no_prelude/fail_local_in_namespace.carbon | 2 +- .../alias/no_prelude/import_access.carbon | 2 +- .../check/testdata/class/adapter/adapt.carbon | 2 +- .../class/adapter/extend_adapt.carbon | 4 +- .../class/adapter/fail_adapt_bad_decl.carbon | 2 +- .../testdata/class/fail_base_bad_type.carbon | 2 +- .../testdata/class/fail_unknown_member.carbon | 2 +- .../class/generic/member_lookup.carbon | 701 ++++++++++++++++++ .../class/no_prelude/import_access.carbon | 6 +- .../function/definition/import_access.carbon | 6 +- .../testdata/interface/member_lookup.carbon | 449 +++++++++++ .../fail_lookup_in_type_type.carbon | 2 +- .../no_prelude/fail_lookup_undefined.carbon | 2 +- .../interface/no_prelude/import_access.carbon | 4 +- .../let/no_prelude/import_access.carbon | 2 +- .../package_expr/fail_not_found.carbon | 2 +- .../no_prelude/cross_package_import.carbon | 2 +- .../var/no_prelude/import_access.carbon | 2 +- .../testdata/where_expr/designator.carbon | 2 +- toolchain/diagnostics/diagnostic_kind.def | 2 + toolchain/sem_ir/stringify_type.cpp | 6 +- 23 files changed, 1243 insertions(+), 25 deletions(-) create mode 100644 toolchain/check/testdata/class/generic/member_lookup.carbon create mode 100644 toolchain/check/testdata/interface/member_lookup.carbon diff --git a/toolchain/check/context.cpp b/toolchain/check/context.cpp index 6a99ee4445f0d..0f22b08c0da9e 100644 --- a/toolchain/check/context.cpp +++ b/toolchain/check/context.cpp @@ -222,6 +222,54 @@ auto Context::DiagnoseNameNotFound(SemIRLoc loc, SemIR::NameId name_id) emitter_->Emit(loc, NameNotFound, name_id); } +// Given an instruction associated with a scope and a `SpecificId` for that +// scope, returns an instruction that describes the specific scope. +static auto GetInstForSpecificScope(Context& context, SemIR::InstId inst_id, + SemIR::SpecificId specific_id) + -> SemIR::InstId { + if (!specific_id.is_valid()) { + return inst_id; + } + auto inst = context.insts().Get(inst_id); + CARBON_KIND_SWITCH(inst) { + case CARBON_KIND(SemIR::ClassDecl class_decl): { + return context.types().GetInstId( + context.GetClassType(class_decl.class_id, specific_id)); + } + case CARBON_KIND(SemIR::InterfaceDecl interface_decl): { + return context.types().GetInstId( + context.GetInterfaceType(interface_decl.interface_id, specific_id)); + } + default: { + // Don't know how to form a specific for this generic scope. + // TODO: Handle more cases. + return SemIR::InstId::Invalid; + } + } +} + +auto Context::DiagnoseMemberNameNotFound( + SemIRLoc loc, SemIR::NameId name_id, + llvm::ArrayRef lookup_scopes) -> void { + if (lookup_scopes.size() == 1 && + lookup_scopes.front().name_scope_id.is_valid()) { + const auto& scope = name_scopes().Get(lookup_scopes.front().name_scope_id); + if (auto specific_inst_id = GetInstForSpecificScope( + *this, scope.inst_id(), lookup_scopes.front().specific_id); + specific_inst_id.is_valid()) { + CARBON_DIAGNOSTIC(MemberNameNotFoundInScope, Error, + "member name `{0}` not found in {1}", SemIR::NameId, + InstIdAsType); + emitter_->Emit(loc, MemberNameNotFoundInScope, name_id, specific_inst_id); + return; + } + } + + CARBON_DIAGNOSTIC(MemberNameNotFound, Error, "member name `{0}` not found", + SemIR::NameId); + emitter_->Emit(loc, MemberNameNotFound, name_id); +} + auto Context::NoteAbstractClass(SemIR::ClassId class_id, DiagnosticBuilder& builder) -> void { const auto& class_info = classes().Get(class_id); @@ -590,7 +638,7 @@ auto Context::LookupQualifiedName(SemIRLoc loc, SemIR::NameId name_id, if (required && !result.inst_id.is_valid()) { if (!has_error) { if (prohibited_accesses.empty()) { - DiagnoseNameNotFound(loc, name_id); + DiagnoseMemberNameNotFound(loc, name_id, lookup_scopes); } else { // TODO: We should report multiple prohibited accesses in case we don't // find a valid lookup. Reporting the last one should suffice for now. @@ -1361,6 +1409,11 @@ auto Context::GetSingletonType(SemIR::InstId singleton_id) -> SemIR::TypeId { return type_id; } +auto Context::GetClassType(SemIR::ClassId class_id, + SemIR::SpecificId specific_id) -> SemIR::TypeId { + return GetCompleteTypeImpl(*this, class_id, specific_id); +} + auto Context::GetFunctionType(SemIR::FunctionId fn_id, SemIR::SpecificId specific_id) -> SemIR::TypeId { return GetCompleteTypeImpl(*this, fn_id, specific_id); diff --git a/toolchain/check/context.h b/toolchain/check/context.h index b685a2a7c131b..436586c6def17 100644 --- a/toolchain/check/context.h +++ b/toolchain/check/context.h @@ -248,6 +248,11 @@ class Context { // Prints a diagnostic for a missing name. auto DiagnoseNameNotFound(SemIRLoc loc, SemIR::NameId name_id) -> void; + // Prints a diagnostic for a missing qualified name. + auto DiagnoseMemberNameNotFound(SemIRLoc loc, SemIR::NameId name_id, + llvm::ArrayRef lookup_scopes) + -> void; + // Adds a note to a diagnostic explaining that a class is incomplete. auto NoteIncompleteClass(SemIR::ClassId class_id, DiagnosticBuilder& builder) -> void; @@ -386,6 +391,10 @@ class Context { // `singleton_id` is already validated to be a singleton. auto GetSingletonType(SemIR::InstId singleton_id) -> SemIR::TypeId; + // Gets a class type. + auto GetClassType(SemIR::ClassId class_id, SemIR::SpecificId specific_id) + -> SemIR::TypeId; + // Gets a function type. The returned type will be complete. auto GetFunctionType(SemIR::FunctionId fn_id, SemIR::SpecificId specific_id) -> SemIR::TypeId; diff --git a/toolchain/check/testdata/alias/no_prelude/fail_local_in_namespace.carbon b/toolchain/check/testdata/alias/no_prelude/fail_local_in_namespace.carbon index 62fb86951c3bd..e3efd77671b37 100644 --- a/toolchain/check/testdata/alias/no_prelude/fail_local_in_namespace.carbon +++ b/toolchain/check/testdata/alias/no_prelude/fail_local_in_namespace.carbon @@ -20,7 +20,7 @@ fn F() -> {} { // CHECK:STDERR: ^~ // CHECK:STDERR: alias NS.a = {}; - // CHECK:STDERR: fail_local_in_namespace.carbon:[[@LINE+3]]:10: error: name `a` not found [NameNotFound] + // CHECK:STDERR: fail_local_in_namespace.carbon:[[@LINE+3]]:10: error: member name `a` not found in `NS` [MemberNameNotFoundInScope] // CHECK:STDERR: return NS.a; // CHECK:STDERR: ^~~~ return NS.a; diff --git a/toolchain/check/testdata/alias/no_prelude/import_access.carbon b/toolchain/check/testdata/alias/no_prelude/import_access.carbon index efe172fffc240..affd369ff6ac9 100644 --- a/toolchain/check/testdata/alias/no_prelude/import_access.carbon +++ b/toolchain/check/testdata/alias/no_prelude/import_access.carbon @@ -47,7 +47,7 @@ package Other library "[[@TEST_NAME]]"; import Test library "def"; -// CHECK:STDERR: fail_other_def.carbon:[[@LINE+3]]:11: error: name `A` not found [NameNotFound] +// CHECK:STDERR: fail_other_def.carbon:[[@LINE+3]]:11: error: member name `A` not found in `Test` [MemberNameNotFoundInScope] // CHECK:STDERR: var inst: Test.A = {}; // CHECK:STDERR: ^~~~~~ var inst: Test.A = {}; diff --git a/toolchain/check/testdata/class/adapter/adapt.carbon b/toolchain/check/testdata/class/adapter/adapt.carbon index 214d7aa2fc89b..6a2e359b1e517 100644 --- a/toolchain/check/testdata/class/adapter/adapt.carbon +++ b/toolchain/check/testdata/class/adapter/adapt.carbon @@ -39,7 +39,7 @@ class AdaptNotExtend { fn F(a: AdaptNotExtend) { // `Adapted` is not extended, so lookup for `F` finds nothing. - // CHECK:STDERR: fail_not_extend.carbon:[[@LINE+3]]:3: error: name `F` not found [NameNotFound] + // CHECK:STDERR: fail_not_extend.carbon:[[@LINE+3]]:3: error: member name `F` not found in `AdaptNotExtend` [MemberNameNotFoundInScope] // CHECK:STDERR: a.F(); // CHECK:STDERR: ^~~ a.F(); diff --git a/toolchain/check/testdata/class/adapter/extend_adapt.carbon b/toolchain/check/testdata/class/adapter/extend_adapt.carbon index e0ab57eb8dd0b..b85fcf75739a3 100644 --- a/toolchain/check/testdata/class/adapter/extend_adapt.carbon +++ b/toolchain/check/testdata/class/adapter/extend_adapt.carbon @@ -95,7 +95,7 @@ class StructAdapter { fn F(a: StructAdapter) -> i32 { // TODO: This should be allowed. - // CHECK:STDERR: fail_todo_adapt_struct.carbon:[[@LINE+4]]:10: error: name `b` not found [NameNotFound] + // CHECK:STDERR: fail_todo_adapt_struct.carbon:[[@LINE+4]]:10: error: member name `b` not found in `StructAdapter` [MemberNameNotFoundInScope] // CHECK:STDERR: return a.b; // CHECK:STDERR: ^~~ // CHECK:STDERR: @@ -131,7 +131,7 @@ class IntAdapter { fn F(a: IntAdapter) -> i32 { // Builtin types have no member names. - // CHECK:STDERR: fail_adapt_builtin.carbon:[[@LINE+3]]:10: error: name `foo` not found [NameNotFound] + // CHECK:STDERR: fail_adapt_builtin.carbon:[[@LINE+3]]:10: error: member name `foo` not found in `IntAdapter` [MemberNameNotFoundInScope] // CHECK:STDERR: return a.foo; // CHECK:STDERR: ^~~~~ return a.foo; diff --git a/toolchain/check/testdata/class/adapter/fail_adapt_bad_decl.carbon b/toolchain/check/testdata/class/adapter/fail_adapt_bad_decl.carbon index 9fe41fa011e8c..0476c356edac9 100644 --- a/toolchain/check/testdata/class/adapter/fail_adapt_bad_decl.carbon +++ b/toolchain/check/testdata/class/adapter/fail_adapt_bad_decl.carbon @@ -23,7 +23,7 @@ class Bad { adapt 100; } -// CHECK:STDERR: fail_not_type.carbon:[[@LINE+4]]:18: error: name `F` not found [NameNotFound] +// CHECK:STDERR: fail_not_type.carbon:[[@LINE+4]]:18: error: member name `F` not found in `Bad` [MemberNameNotFoundInScope] // CHECK:STDERR: fn Use(b: Bad) { b.F(); } // CHECK:STDERR: ^~~ // CHECK:STDERR: diff --git a/toolchain/check/testdata/class/fail_base_bad_type.carbon b/toolchain/check/testdata/class/fail_base_bad_type.carbon index ffd83ab440d34..e4c2546563c52 100644 --- a/toolchain/check/testdata/class/fail_base_bad_type.carbon +++ b/toolchain/check/testdata/class/fail_base_bad_type.carbon @@ -174,7 +174,7 @@ fn AccessMemberWithInvalidBaseFinal_WithMember(p: DeriveFromFinal*) -> i32 { } fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { - // CHECK:STDERR: fail_derive_from_final.carbon:[[@LINE+3]]:10: error: name `b` not found [NameNotFound] + // CHECK:STDERR: fail_derive_from_final.carbon:[[@LINE+3]]:10: error: member name `b` not found in `DeriveFromFinal` [MemberNameNotFoundInScope] // CHECK:STDERR: return (*p).b; // CHECK:STDERR: ^~~~~~ return (*p).b; diff --git a/toolchain/check/testdata/class/fail_unknown_member.carbon b/toolchain/check/testdata/class/fail_unknown_member.carbon index b1f8594312093..af1131b3d35b4 100644 --- a/toolchain/check/testdata/class/fail_unknown_member.carbon +++ b/toolchain/check/testdata/class/fail_unknown_member.carbon @@ -14,7 +14,7 @@ class Class { fn G(c: Class) -> i32 { // TODO: Mention the scope in which we looked for the name. - // CHECK:STDERR: fail_unknown_member.carbon:[[@LINE+3]]:10: error: name `something` not found [NameNotFound] + // CHECK:STDERR: fail_unknown_member.carbon:[[@LINE+3]]:10: error: member name `something` not found in `Class` [MemberNameNotFoundInScope] // CHECK:STDERR: return c.something; // CHECK:STDERR: ^~~~~~~~~~~ return c.something; diff --git a/toolchain/check/testdata/class/generic/member_lookup.carbon b/toolchain/check/testdata/class/generic/member_lookup.carbon new file mode 100644 index 0000000000000..ef262019aea9b --- /dev/null +++ b/toolchain/check/testdata/class/generic/member_lookup.carbon @@ -0,0 +1,701 @@ +// Part of the Carbon Language project, under the Apache License v2.0 with LLVM +// Exceptions. See /LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// AUTOUPDATE +// TIP: To test this file alone, run: +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/class/generic/member_lookup.carbon +// TIP: To dump output, run: +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/class/generic/member_lookup.carbon + +// --- member_access.carbon + +library "[[@TEST_NAME]]"; + +base class Base(T:! type) { + var b: T; +} + +class Derived(T:! type) { + extend base: Base(T); + var d: T; +} + +fn AccessDerived[T:! type](x: Derived(T)) -> T { + return x.d; +} + +fn AccessBase[T:! type](x: Derived(T)) -> T { + return x.b; +} + +fn AccessConcrete(x: Derived(i32)) -> i32 { + return x.b; +} + +// --- fail_no_member.carbon + +library "[[@TEST_NAME]]"; + +base class Base(T:! type) { + var b: T; +} + +class Derived(T:! type) { + extend base: Base(T); + var d: T; +} + +fn AccessMissingBase[T:! type](x: Base(T)) -> T { + // CHECK:STDERR: fail_no_member.carbon:[[@LINE+4]]:10: error: member name `nonesuch` not found in `Base(T)` [MemberNameNotFoundInScope] + // CHECK:STDERR: return x.nonesuch; + // CHECK:STDERR: ^~~~~~~~~~ + // CHECK:STDERR: + return x.nonesuch; +} + +fn AccessMissingDerived[T:! type](x: Derived(T)) -> T { + // CHECK:STDERR: fail_no_member.carbon:[[@LINE+4]]:10: error: member name `nonesuch` not found in `Derived(T)` [MemberNameNotFoundInScope] + // CHECK:STDERR: return x.nonesuch; + // CHECK:STDERR: ^~~~~~~~~~ + // CHECK:STDERR: + return x.nonesuch; +} + +fn AccessMissingConcrete(x: Derived(i32)) -> i32 { + // CHECK:STDERR: fail_no_member.carbon:[[@LINE+3]]:10: error: member name `nonesuch` not found in `Derived(i32)` [MemberNameNotFoundInScope] + // CHECK:STDERR: return x.nonesuch; + // CHECK:STDERR: ^~~~~~~~~~ + return x.nonesuch; +} + +// CHECK:STDOUT: --- member_access.carbon +// CHECK:STDOUT: +// CHECK:STDOUT: constants { +// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] +// CHECK:STDOUT: %Base.type: type = generic_class_type @Base [template] +// CHECK:STDOUT: %Base.generic: %Base.type = struct_value () [template] +// CHECK:STDOUT: %Base.1: type = class_type @Base, @Base(%T) [symbolic] +// CHECK:STDOUT: %Base.elem.1: type = unbound_element_type %Base.1, %T [symbolic] +// CHECK:STDOUT: %struct_type.b.1: type = struct_type {.b: %T} [symbolic] +// CHECK:STDOUT: %complete_type.1: = complete_type_witness %struct_type.b.1 [symbolic] +// CHECK:STDOUT: %Derived.type: type = generic_class_type @Derived [template] +// CHECK:STDOUT: %Derived.generic: %Derived.type = struct_value () [template] +// CHECK:STDOUT: %Derived.1: type = class_type @Derived, @Derived(%T) [symbolic] +// CHECK:STDOUT: %Derived.elem.1: type = unbound_element_type %Derived.1, %Base.1 [symbolic] +// CHECK:STDOUT: %Derived.elem.2: type = unbound_element_type %Derived.1, %T [symbolic] +// CHECK:STDOUT: %struct_type.base.d.1: type = struct_type {.base: %Base.1, .d: %T} [symbolic] +// CHECK:STDOUT: %complete_type.2: = complete_type_witness %struct_type.base.d.1 [symbolic] +// CHECK:STDOUT: %AccessDerived.type: type = fn_type @AccessDerived [template] +// CHECK:STDOUT: %AccessDerived: %AccessDerived.type = struct_value () [template] +// CHECK:STDOUT: %AccessBase.type: type = fn_type @AccessBase [template] +// CHECK:STDOUT: %AccessBase: %AccessBase.type = struct_value () [template] +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %Derived.2: type = class_type @Derived, @Derived(%i32) [template] +// CHECK:STDOUT: %AccessConcrete.type: type = fn_type @AccessConcrete [template] +// CHECK:STDOUT: %AccessConcrete: %AccessConcrete.type = struct_value () [template] +// CHECK:STDOUT: %Base.2: type = class_type @Base, @Base(%i32) [template] +// CHECK:STDOUT: %Derived.elem.3: type = unbound_element_type %Derived.2, %Base.2 [template] +// CHECK:STDOUT: %Derived.elem.4: type = unbound_element_type %Derived.2, %i32 [template] +// CHECK:STDOUT: %struct_type.base.d.3: type = struct_type {.base: %Base.2, .d: %i32} [template] +// CHECK:STDOUT: %complete_type.3: = complete_type_witness %struct_type.base.d.3 [template] +// CHECK:STDOUT: %Base.elem.2: type = unbound_element_type %Base.2, %i32 [template] +// CHECK:STDOUT: %struct_type.b.2: type = struct_type {.b: %i32} [template] +// CHECK:STDOUT: %complete_type.4: = complete_type_witness %struct_type.b.2 [template] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: import Core//prelude +// CHECK:STDOUT: import Core//prelude/... +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Base = %Base.decl +// CHECK:STDOUT: .Derived = %Derived.decl +// CHECK:STDOUT: .AccessDerived = %AccessDerived.decl +// CHECK:STDOUT: .AccessBase = %AccessBase.decl +// CHECK:STDOUT: .AccessConcrete = %AccessConcrete.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %Base.decl: %Base.type = class_decl @Base [template = constants.%Base.generic] { +// CHECK:STDOUT: %T.patt.loc4_17.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_17.2 (constants.%T.patt)] +// CHECK:STDOUT: %T.param_patt: type = value_param_pattern %T.patt.loc4_17.1, runtime_param [symbolic = %T.patt.loc4_17.2 (constants.%T.patt)] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %T.param: type = value_param runtime_param +// CHECK:STDOUT: %T.loc4_17.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc4_17.2 (constants.%T)] +// CHECK:STDOUT: } +// CHECK:STDOUT: %Derived.decl: %Derived.type = class_decl @Derived [template = constants.%Derived.generic] { +// CHECK:STDOUT: %T.patt.loc8_15.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_15.2 (constants.%T.patt)] +// CHECK:STDOUT: %T.param_patt: type = value_param_pattern %T.patt.loc8_15.1, runtime_param [symbolic = %T.patt.loc8_15.2 (constants.%T.patt)] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %T.param: type = value_param runtime_param +// CHECK:STDOUT: %T.loc8_15.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc8_15.2 (constants.%T)] +// CHECK:STDOUT: } +// CHECK:STDOUT: %AccessDerived.decl: %AccessDerived.type = fn_decl @AccessDerived [template = constants.%AccessDerived] { +// CHECK:STDOUT: %T.patt.loc13_18.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc13_18.2 (constants.%T.patt)] +// CHECK:STDOUT: %T.param_patt: type = value_param_pattern %T.patt.loc13_18.1, runtime_param [symbolic = %T.patt.loc13_18.2 (constants.%T.patt)] +// CHECK:STDOUT: %x.patt: @AccessDerived.%Derived.loc13_40.2 (%Derived.1) = binding_pattern x +// CHECK:STDOUT: %x.param_patt: @AccessDerived.%Derived.loc13_40.2 (%Derived.1) = value_param_pattern %x.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: @AccessDerived.%T.loc13_18.2 (%T) = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: @AccessDerived.%T.loc13_18.2 (%T) = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %Derived.ref: %Derived.type = name_ref Derived, file.%Derived.decl [template = constants.%Derived.generic] +// CHECK:STDOUT: %T.ref.loc13_39: type = name_ref T, %T.loc13_18.1 [symbolic = %T.loc13_18.2 (constants.%T)] +// CHECK:STDOUT: %Derived.loc13_40.1: type = class_type @Derived, @Derived(constants.%T) [symbolic = %Derived.loc13_40.2 (constants.%Derived.1)] +// CHECK:STDOUT: %T.ref.loc13_46: type = name_ref T, %T.loc13_18.1 [symbolic = %T.loc13_18.2 (constants.%T)] +// CHECK:STDOUT: %T.param: type = value_param runtime_param +// CHECK:STDOUT: %T.loc13_18.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc13_18.2 (constants.%T)] +// CHECK:STDOUT: %x.param: @AccessDerived.%Derived.loc13_40.2 (%Derived.1) = value_param runtime_param0 +// CHECK:STDOUT: %x: @AccessDerived.%Derived.loc13_40.2 (%Derived.1) = bind_name x, %x.param +// CHECK:STDOUT: %return.param: ref @AccessDerived.%T.loc13_18.2 (%T) = out_param runtime_param1 +// CHECK:STDOUT: %return: ref @AccessDerived.%T.loc13_18.2 (%T) = return_slot %return.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %AccessBase.decl: %AccessBase.type = fn_decl @AccessBase [template = constants.%AccessBase] { +// CHECK:STDOUT: %T.patt.loc17_15.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc17_15.2 (constants.%T.patt)] +// CHECK:STDOUT: %T.param_patt: type = value_param_pattern %T.patt.loc17_15.1, runtime_param [symbolic = %T.patt.loc17_15.2 (constants.%T.patt)] +// CHECK:STDOUT: %x.patt: @AccessBase.%Derived.loc17_37.2 (%Derived.1) = binding_pattern x +// CHECK:STDOUT: %x.param_patt: @AccessBase.%Derived.loc17_37.2 (%Derived.1) = value_param_pattern %x.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: @AccessBase.%T.loc17_15.2 (%T) = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: @AccessBase.%T.loc17_15.2 (%T) = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %Derived.ref: %Derived.type = name_ref Derived, file.%Derived.decl [template = constants.%Derived.generic] +// CHECK:STDOUT: %T.ref.loc17_36: type = name_ref T, %T.loc17_15.1 [symbolic = %T.loc17_15.2 (constants.%T)] +// CHECK:STDOUT: %Derived.loc17_37.1: type = class_type @Derived, @Derived(constants.%T) [symbolic = %Derived.loc17_37.2 (constants.%Derived.1)] +// CHECK:STDOUT: %T.ref.loc17_43: type = name_ref T, %T.loc17_15.1 [symbolic = %T.loc17_15.2 (constants.%T)] +// CHECK:STDOUT: %T.param: type = value_param runtime_param +// CHECK:STDOUT: %T.loc17_15.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc17_15.2 (constants.%T)] +// CHECK:STDOUT: %x.param: @AccessBase.%Derived.loc17_37.2 (%Derived.1) = value_param runtime_param0 +// CHECK:STDOUT: %x: @AccessBase.%Derived.loc17_37.2 (%Derived.1) = bind_name x, %x.param +// CHECK:STDOUT: %return.param: ref @AccessBase.%T.loc17_15.2 (%T) = out_param runtime_param1 +// CHECK:STDOUT: %return: ref @AccessBase.%T.loc17_15.2 (%T) = return_slot %return.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %AccessConcrete.decl: %AccessConcrete.type = fn_decl @AccessConcrete [template = constants.%AccessConcrete] { +// CHECK:STDOUT: %x.patt: %Derived.2 = binding_pattern x +// CHECK:STDOUT: %x.param_patt: %Derived.2 = value_param_pattern %x.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %Derived.ref: %Derived.type = name_ref Derived, file.%Derived.decl [template = constants.%Derived.generic] +// CHECK:STDOUT: %int_32.loc21_30: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %int.make_type_signed.loc21_30: init type = call constants.%Int(%int_32.loc21_30) [template = constants.%i32] +// CHECK:STDOUT: %.loc21_33.1: type = value_of_initializer %int.make_type_signed.loc21_30 [template = constants.%i32] +// CHECK:STDOUT: %.loc21_33.2: type = converted %int.make_type_signed.loc21_30, %.loc21_33.1 [template = constants.%i32] +// CHECK:STDOUT: %Derived: type = class_type @Derived, @Derived(constants.%i32) [template = constants.%Derived.2] +// CHECK:STDOUT: %int_32.loc21_39: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %int.make_type_signed.loc21_39: init type = call constants.%Int(%int_32.loc21_39) [template = constants.%i32] +// CHECK:STDOUT: %.loc21_39.1: type = value_of_initializer %int.make_type_signed.loc21_39 [template = constants.%i32] +// CHECK:STDOUT: %.loc21_39.2: type = converted %int.make_type_signed.loc21_39, %.loc21_39.1 [template = constants.%i32] +// CHECK:STDOUT: %x.param: %Derived.2 = value_param runtime_param0 +// CHECK:STDOUT: %x: %Derived.2 = bind_name x, %x.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic class @Base(%T.loc4_17.1: type) { +// CHECK:STDOUT: %T.loc4_17.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_17.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc4_17.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_17.2 (constants.%T.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Base: type = class_type @Base, @Base(%T.loc4_17.2) [symbolic = %Base (constants.%Base.1)] +// CHECK:STDOUT: %Base.elem: type = unbound_element_type @Base.%Base (%Base.1), @Base.%T.loc4_17.2 (%T) [symbolic = %Base.elem (constants.%Base.elem.1)] +// CHECK:STDOUT: %struct_type.b: type = struct_type {.b: @Base.%T.loc4_17.2 (%T)} [symbolic = %struct_type.b (constants.%struct_type.b.1)] +// CHECK:STDOUT: %complete_type.loc6_1.2: = complete_type_witness @Base.%struct_type.b (%struct_type.b.1) [symbolic = %complete_type.loc6_1.2 (constants.%complete_type.1)] +// CHECK:STDOUT: +// CHECK:STDOUT: class { +// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc4_17.1 [symbolic = %T.loc4_17.2 (constants.%T)] +// CHECK:STDOUT: %.loc5: @Base.%Base.elem (%Base.elem.1) = field_decl b, element0 [template] +// CHECK:STDOUT: %complete_type.loc6_1.1: = complete_type_witness %struct_type.b.1 [symbolic = %complete_type.loc6_1.2 (constants.%complete_type.1)] +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = constants.%Base.1 +// CHECK:STDOUT: .b = %.loc5 +// CHECK:STDOUT: complete_type_witness = %complete_type.loc6_1.1 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic class @Derived(%T.loc8_15.1: type) { +// CHECK:STDOUT: %T.loc8_15.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc8_15.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc8_15.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_15.2 (constants.%T.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Base.loc9_22.2: type = class_type @Base, @Base(%T.loc8_15.2) [symbolic = %Base.loc9_22.2 (constants.%Base.1)] +// CHECK:STDOUT: %Derived: type = class_type @Derived, @Derived(%T.loc8_15.2) [symbolic = %Derived (constants.%Derived.1)] +// CHECK:STDOUT: %Derived.elem.loc9: type = unbound_element_type @Derived.%Derived (%Derived.1), @Derived.%Base.loc9_22.2 (%Base.1) [symbolic = %Derived.elem.loc9 (constants.%Derived.elem.1)] +// CHECK:STDOUT: %Derived.elem.loc10: type = unbound_element_type @Derived.%Derived (%Derived.1), @Derived.%T.loc8_15.2 (%T) [symbolic = %Derived.elem.loc10 (constants.%Derived.elem.2)] +// CHECK:STDOUT: %struct_type.base.d: type = struct_type {.base: @Derived.%Base.loc9_22.2 (%Base.1), .d: @Derived.%T.loc8_15.2 (%T)} [symbolic = %struct_type.base.d (constants.%struct_type.base.d.1)] +// CHECK:STDOUT: %complete_type.loc11_1.2: = complete_type_witness @Derived.%struct_type.base.d (%struct_type.base.d.1) [symbolic = %complete_type.loc11_1.2 (constants.%complete_type.2)] +// CHECK:STDOUT: +// CHECK:STDOUT: class { +// CHECK:STDOUT: %Base.ref: %Base.type = name_ref Base, file.%Base.decl [template = constants.%Base.generic] +// CHECK:STDOUT: %T.ref.loc9: type = name_ref T, %T.loc8_15.1 [symbolic = %T.loc8_15.2 (constants.%T)] +// CHECK:STDOUT: %Base.loc9_22.1: type = class_type @Base, @Base(constants.%T) [symbolic = %Base.loc9_22.2 (constants.%Base.1)] +// CHECK:STDOUT: %.loc9: @Derived.%Derived.elem.loc9 (%Derived.elem.1) = base_decl %Base.loc9_22.1, element0 [template] +// CHECK:STDOUT: %T.ref.loc10: type = name_ref T, %T.loc8_15.1 [symbolic = %T.loc8_15.2 (constants.%T)] +// CHECK:STDOUT: %.loc10: @Derived.%Derived.elem.loc10 (%Derived.elem.2) = field_decl d, element1 [template] +// CHECK:STDOUT: %complete_type.loc11_1.1: = complete_type_witness %struct_type.base.d.1 [symbolic = %complete_type.loc11_1.2 (constants.%complete_type.2)] +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = constants.%Derived.1 +// CHECK:STDOUT: .base = %.loc9 +// CHECK:STDOUT: .d = %.loc10 +// CHECK:STDOUT: extend %Base.loc9_22.1 +// CHECK:STDOUT: complete_type_witness = %complete_type.loc11_1.1 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @AccessDerived(%T.loc13_18.1: type) { +// CHECK:STDOUT: %T.loc13_18.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc13_18.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc13_18.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc13_18.2 (constants.%T.patt)] +// CHECK:STDOUT: %Derived.loc13_40.2: type = class_type @Derived, @Derived(%T.loc13_18.2) [symbolic = %Derived.loc13_40.2 (constants.%Derived.1)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Derived.elem: type = unbound_element_type @AccessDerived.%Derived.loc13_40.2 (%Derived.1), @AccessDerived.%T.loc13_18.2 (%T) [symbolic = %Derived.elem (constants.%Derived.elem.2)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%T.param_patt: type](%x.param_patt: @AccessDerived.%Derived.loc13_40.2 (%Derived.1)) -> @AccessDerived.%T.loc13_18.2 (%T) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %x.ref: @AccessDerived.%Derived.loc13_40.2 (%Derived.1) = name_ref x, %x +// CHECK:STDOUT: %d.ref: @AccessDerived.%Derived.elem (%Derived.elem.2) = name_ref d, @Derived.%.loc10 [template = @Derived.%.loc10] +// CHECK:STDOUT: %.loc14_11.1: ref @AccessDerived.%T.loc13_18.2 (%T) = class_element_access %x.ref, element1 +// CHECK:STDOUT: %.loc14_11.2: @AccessDerived.%T.loc13_18.2 (%T) = bind_value %.loc14_11.1 +// CHECK:STDOUT: return %.loc14_11.2 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @AccessBase(%T.loc17_15.1: type) { +// CHECK:STDOUT: %T.loc17_15.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc17_15.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc17_15.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc17_15.2 (constants.%T.patt)] +// CHECK:STDOUT: %Derived.loc17_37.2: type = class_type @Derived, @Derived(%T.loc17_15.2) [symbolic = %Derived.loc17_37.2 (constants.%Derived.1)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Base: type = class_type @Base, @Base(%T.loc17_15.2) [symbolic = %Base (constants.%Base.1)] +// CHECK:STDOUT: %Base.elem: type = unbound_element_type @AccessBase.%Base (%Base.1), @AccessBase.%T.loc17_15.2 (%T) [symbolic = %Base.elem (constants.%Base.elem.1)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%T.param_patt: type](%x.param_patt: @AccessBase.%Derived.loc17_37.2 (%Derived.1)) -> @AccessBase.%T.loc17_15.2 (%T) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %x.ref: @AccessBase.%Derived.loc17_37.2 (%Derived.1) = name_ref x, %x +// CHECK:STDOUT: %b.ref: @AccessBase.%Base.elem (%Base.elem.1) = name_ref b, @Base.%.loc5 [template = @Base.%.loc5] +// CHECK:STDOUT: %.loc18_11.1: ref @AccessBase.%Base (%Base.1) = class_element_access %x.ref, element0 +// CHECK:STDOUT: %.loc18_11.2: ref @AccessBase.%Base (%Base.1) = converted %x.ref, %.loc18_11.1 +// CHECK:STDOUT: %.loc18_11.3: ref @AccessBase.%T.loc17_15.2 (%T) = class_element_access %.loc18_11.2, element0 +// CHECK:STDOUT: %.loc18_11.4: @AccessBase.%T.loc17_15.2 (%T) = bind_value %.loc18_11.3 +// CHECK:STDOUT: return %.loc18_11.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @AccessConcrete(%x.param_patt: %Derived.2) -> %i32 { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %x.ref: %Derived.2 = name_ref x, %x +// CHECK:STDOUT: %b.ref: %Base.elem.2 = name_ref b, @Base.%.loc5 [template = @Base.%.loc5] +// CHECK:STDOUT: %.loc22_11.1: ref %Base.2 = class_element_access %x.ref, element0 +// CHECK:STDOUT: %.loc22_11.2: ref %Base.2 = converted %x.ref, %.loc22_11.1 +// CHECK:STDOUT: %.loc22_11.3: ref %i32 = class_element_access %.loc22_11.2, element0 +// CHECK:STDOUT: %.loc22_11.4: %i32 = bind_value %.loc22_11.3 +// CHECK:STDOUT: return %.loc22_11.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Base(constants.%T) { +// CHECK:STDOUT: %T.loc4_17.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc4_17.2 => constants.%T +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Base => constants.%Base.1 +// CHECK:STDOUT: %Base.elem => constants.%Base.elem.1 +// CHECK:STDOUT: %struct_type.b => constants.%struct_type.b.1 +// CHECK:STDOUT: %complete_type.loc6_1.2 => constants.%complete_type.1 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Base(%T.loc4_17.2) { +// CHECK:STDOUT: %T.loc4_17.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc4_17.2 => constants.%T +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Derived(constants.%T) { +// CHECK:STDOUT: %T.loc8_15.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc8_15.2 => constants.%T +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Base.loc9_22.2 => constants.%Base.1 +// CHECK:STDOUT: %Derived => constants.%Derived.1 +// CHECK:STDOUT: %Derived.elem.loc9 => constants.%Derived.elem.1 +// CHECK:STDOUT: %Derived.elem.loc10 => constants.%Derived.elem.2 +// CHECK:STDOUT: %struct_type.base.d => constants.%struct_type.base.d.1 +// CHECK:STDOUT: %complete_type.loc11_1.2 => constants.%complete_type.2 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Base(@Derived.%T.loc8_15.2) { +// CHECK:STDOUT: %T.loc4_17.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc4_17.2 => constants.%T +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Derived(%T.loc8_15.2) { +// CHECK:STDOUT: %T.loc8_15.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc8_15.2 => constants.%T +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Derived(@AccessDerived.%T.loc13_18.2) { +// CHECK:STDOUT: %T.loc8_15.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc8_15.2 => constants.%T +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @AccessDerived(constants.%T) { +// CHECK:STDOUT: %T.loc13_18.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc13_18.2 => constants.%T +// CHECK:STDOUT: %Derived.loc13_40.2 => constants.%Derived.1 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Derived(@AccessBase.%T.loc17_15.2) { +// CHECK:STDOUT: %T.loc8_15.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc8_15.2 => constants.%T +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @AccessBase(constants.%T) { +// CHECK:STDOUT: %T.loc17_15.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc17_15.2 => constants.%T +// CHECK:STDOUT: %Derived.loc17_37.2 => constants.%Derived.1 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Base(@AccessBase.%T.loc17_15.2) { +// CHECK:STDOUT: %T.loc4_17.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc4_17.2 => constants.%T +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Derived(constants.%i32) { +// CHECK:STDOUT: %T.loc8_15.2 => constants.%i32 +// CHECK:STDOUT: %T.patt.loc8_15.2 => constants.%i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Base.loc9_22.2 => constants.%Base.2 +// CHECK:STDOUT: %Derived => constants.%Derived.2 +// CHECK:STDOUT: %Derived.elem.loc9 => constants.%Derived.elem.3 +// CHECK:STDOUT: %Derived.elem.loc10 => constants.%Derived.elem.4 +// CHECK:STDOUT: %struct_type.base.d => constants.%struct_type.base.d.3 +// CHECK:STDOUT: %complete_type.loc11_1.2 => constants.%complete_type.3 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Base(constants.%i32) { +// CHECK:STDOUT: %T.loc4_17.2 => constants.%i32 +// CHECK:STDOUT: %T.patt.loc4_17.2 => constants.%i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Base => constants.%Base.2 +// CHECK:STDOUT: %Base.elem => constants.%Base.elem.2 +// CHECK:STDOUT: %struct_type.b => constants.%struct_type.b.2 +// CHECK:STDOUT: %complete_type.loc6_1.2 => constants.%complete_type.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: --- fail_no_member.carbon +// CHECK:STDOUT: +// CHECK:STDOUT: constants { +// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] +// CHECK:STDOUT: %Base.type: type = generic_class_type @Base [template] +// CHECK:STDOUT: %Base.generic: %Base.type = struct_value () [template] +// CHECK:STDOUT: %Base.1: type = class_type @Base, @Base(%T) [symbolic] +// CHECK:STDOUT: %Base.elem.1: type = unbound_element_type %Base.1, %T [symbolic] +// CHECK:STDOUT: %struct_type.b.1: type = struct_type {.b: %T} [symbolic] +// CHECK:STDOUT: %complete_type.1: = complete_type_witness %struct_type.b.1 [symbolic] +// CHECK:STDOUT: %Derived.type: type = generic_class_type @Derived [template] +// CHECK:STDOUT: %Derived.generic: %Derived.type = struct_value () [template] +// CHECK:STDOUT: %Derived.1: type = class_type @Derived, @Derived(%T) [symbolic] +// CHECK:STDOUT: %Derived.elem.1: type = unbound_element_type %Derived.1, %Base.1 [symbolic] +// CHECK:STDOUT: %Derived.elem.2: type = unbound_element_type %Derived.1, %T [symbolic] +// CHECK:STDOUT: %struct_type.base.d.1: type = struct_type {.base: %Base.1, .d: %T} [symbolic] +// CHECK:STDOUT: %complete_type.2: = complete_type_witness %struct_type.base.d.1 [symbolic] +// CHECK:STDOUT: %AccessMissingBase.type: type = fn_type @AccessMissingBase [template] +// CHECK:STDOUT: %AccessMissingBase: %AccessMissingBase.type = struct_value () [template] +// CHECK:STDOUT: %AccessMissingDerived.type: type = fn_type @AccessMissingDerived [template] +// CHECK:STDOUT: %AccessMissingDerived: %AccessMissingDerived.type = struct_value () [template] +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %Derived.2: type = class_type @Derived, @Derived(%i32) [template] +// CHECK:STDOUT: %AccessMissingConcrete.type: type = fn_type @AccessMissingConcrete [template] +// CHECK:STDOUT: %AccessMissingConcrete: %AccessMissingConcrete.type = struct_value () [template] +// CHECK:STDOUT: %Base.2: type = class_type @Base, @Base(%i32) [template] +// CHECK:STDOUT: %Derived.elem.3: type = unbound_element_type %Derived.2, %Base.2 [template] +// CHECK:STDOUT: %Derived.elem.4: type = unbound_element_type %Derived.2, %i32 [template] +// CHECK:STDOUT: %struct_type.base.d.3: type = struct_type {.base: %Base.2, .d: %i32} [template] +// CHECK:STDOUT: %complete_type.3: = complete_type_witness %struct_type.base.d.3 [template] +// CHECK:STDOUT: %Base.elem.2: type = unbound_element_type %Base.2, %i32 [template] +// CHECK:STDOUT: %struct_type.b.2: type = struct_type {.b: %i32} [template] +// CHECK:STDOUT: %complete_type.4: = complete_type_witness %struct_type.b.2 [template] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: import Core//prelude +// CHECK:STDOUT: import Core//prelude/... +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Base = %Base.decl +// CHECK:STDOUT: .Derived = %Derived.decl +// CHECK:STDOUT: .AccessMissingBase = %AccessMissingBase.decl +// CHECK:STDOUT: .AccessMissingDerived = %AccessMissingDerived.decl +// CHECK:STDOUT: .AccessMissingConcrete = %AccessMissingConcrete.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %Base.decl: %Base.type = class_decl @Base [template = constants.%Base.generic] { +// CHECK:STDOUT: %T.patt.loc4_17.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_17.2 (constants.%T.patt)] +// CHECK:STDOUT: %T.param_patt: type = value_param_pattern %T.patt.loc4_17.1, runtime_param [symbolic = %T.patt.loc4_17.2 (constants.%T.patt)] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %T.param: type = value_param runtime_param +// CHECK:STDOUT: %T.loc4_17.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc4_17.2 (constants.%T)] +// CHECK:STDOUT: } +// CHECK:STDOUT: %Derived.decl: %Derived.type = class_decl @Derived [template = constants.%Derived.generic] { +// CHECK:STDOUT: %T.patt.loc8_15.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_15.2 (constants.%T.patt)] +// CHECK:STDOUT: %T.param_patt: type = value_param_pattern %T.patt.loc8_15.1, runtime_param [symbolic = %T.patt.loc8_15.2 (constants.%T.patt)] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %T.param: type = value_param runtime_param +// CHECK:STDOUT: %T.loc8_15.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc8_15.2 (constants.%T)] +// CHECK:STDOUT: } +// CHECK:STDOUT: %AccessMissingBase.decl: %AccessMissingBase.type = fn_decl @AccessMissingBase [template = constants.%AccessMissingBase] { +// CHECK:STDOUT: %T.patt.loc13_22.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc13_22.2 (constants.%T.patt)] +// CHECK:STDOUT: %T.param_patt: type = value_param_pattern %T.patt.loc13_22.1, runtime_param [symbolic = %T.patt.loc13_22.2 (constants.%T.patt)] +// CHECK:STDOUT: %x.patt: @AccessMissingBase.%Base.loc13_41.2 (%Base.1) = binding_pattern x +// CHECK:STDOUT: %x.param_patt: @AccessMissingBase.%Base.loc13_41.2 (%Base.1) = value_param_pattern %x.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: @AccessMissingBase.%T.loc13_22.2 (%T) = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: @AccessMissingBase.%T.loc13_22.2 (%T) = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %Base.ref: %Base.type = name_ref Base, file.%Base.decl [template = constants.%Base.generic] +// CHECK:STDOUT: %T.ref.loc13_40: type = name_ref T, %T.loc13_22.1 [symbolic = %T.loc13_22.2 (constants.%T)] +// CHECK:STDOUT: %Base.loc13_41.1: type = class_type @Base, @Base(constants.%T) [symbolic = %Base.loc13_41.2 (constants.%Base.1)] +// CHECK:STDOUT: %T.ref.loc13_47: type = name_ref T, %T.loc13_22.1 [symbolic = %T.loc13_22.2 (constants.%T)] +// CHECK:STDOUT: %T.param: type = value_param runtime_param +// CHECK:STDOUT: %T.loc13_22.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc13_22.2 (constants.%T)] +// CHECK:STDOUT: %x.param: @AccessMissingBase.%Base.loc13_41.2 (%Base.1) = value_param runtime_param0 +// CHECK:STDOUT: %x: @AccessMissingBase.%Base.loc13_41.2 (%Base.1) = bind_name x, %x.param +// CHECK:STDOUT: %return.param: ref @AccessMissingBase.%T.loc13_22.2 (%T) = out_param runtime_param1 +// CHECK:STDOUT: %return: ref @AccessMissingBase.%T.loc13_22.2 (%T) = return_slot %return.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %AccessMissingDerived.decl: %AccessMissingDerived.type = fn_decl @AccessMissingDerived [template = constants.%AccessMissingDerived] { +// CHECK:STDOUT: %T.patt.loc21_25.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc21_25.2 (constants.%T.patt)] +// CHECK:STDOUT: %T.param_patt: type = value_param_pattern %T.patt.loc21_25.1, runtime_param [symbolic = %T.patt.loc21_25.2 (constants.%T.patt)] +// CHECK:STDOUT: %x.patt: @AccessMissingDerived.%Derived.loc21_47.2 (%Derived.1) = binding_pattern x +// CHECK:STDOUT: %x.param_patt: @AccessMissingDerived.%Derived.loc21_47.2 (%Derived.1) = value_param_pattern %x.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: @AccessMissingDerived.%T.loc21_25.2 (%T) = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: @AccessMissingDerived.%T.loc21_25.2 (%T) = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %Derived.ref: %Derived.type = name_ref Derived, file.%Derived.decl [template = constants.%Derived.generic] +// CHECK:STDOUT: %T.ref.loc21_46: type = name_ref T, %T.loc21_25.1 [symbolic = %T.loc21_25.2 (constants.%T)] +// CHECK:STDOUT: %Derived.loc21_47.1: type = class_type @Derived, @Derived(constants.%T) [symbolic = %Derived.loc21_47.2 (constants.%Derived.1)] +// CHECK:STDOUT: %T.ref.loc21_53: type = name_ref T, %T.loc21_25.1 [symbolic = %T.loc21_25.2 (constants.%T)] +// CHECK:STDOUT: %T.param: type = value_param runtime_param +// CHECK:STDOUT: %T.loc21_25.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc21_25.2 (constants.%T)] +// CHECK:STDOUT: %x.param: @AccessMissingDerived.%Derived.loc21_47.2 (%Derived.1) = value_param runtime_param0 +// CHECK:STDOUT: %x: @AccessMissingDerived.%Derived.loc21_47.2 (%Derived.1) = bind_name x, %x.param +// CHECK:STDOUT: %return.param: ref @AccessMissingDerived.%T.loc21_25.2 (%T) = out_param runtime_param1 +// CHECK:STDOUT: %return: ref @AccessMissingDerived.%T.loc21_25.2 (%T) = return_slot %return.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %AccessMissingConcrete.decl: %AccessMissingConcrete.type = fn_decl @AccessMissingConcrete [template = constants.%AccessMissingConcrete] { +// CHECK:STDOUT: %x.patt: %Derived.2 = binding_pattern x +// CHECK:STDOUT: %x.param_patt: %Derived.2 = value_param_pattern %x.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %Derived.ref: %Derived.type = name_ref Derived, file.%Derived.decl [template = constants.%Derived.generic] +// CHECK:STDOUT: %int_32.loc29_37: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %int.make_type_signed.loc29_37: init type = call constants.%Int(%int_32.loc29_37) [template = constants.%i32] +// CHECK:STDOUT: %.loc29_40.1: type = value_of_initializer %int.make_type_signed.loc29_37 [template = constants.%i32] +// CHECK:STDOUT: %.loc29_40.2: type = converted %int.make_type_signed.loc29_37, %.loc29_40.1 [template = constants.%i32] +// CHECK:STDOUT: %Derived: type = class_type @Derived, @Derived(constants.%i32) [template = constants.%Derived.2] +// CHECK:STDOUT: %int_32.loc29_46: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %int.make_type_signed.loc29_46: init type = call constants.%Int(%int_32.loc29_46) [template = constants.%i32] +// CHECK:STDOUT: %.loc29_46.1: type = value_of_initializer %int.make_type_signed.loc29_46 [template = constants.%i32] +// CHECK:STDOUT: %.loc29_46.2: type = converted %int.make_type_signed.loc29_46, %.loc29_46.1 [template = constants.%i32] +// CHECK:STDOUT: %x.param: %Derived.2 = value_param runtime_param0 +// CHECK:STDOUT: %x: %Derived.2 = bind_name x, %x.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic class @Base(%T.loc4_17.1: type) { +// CHECK:STDOUT: %T.loc4_17.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_17.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc4_17.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_17.2 (constants.%T.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Base: type = class_type @Base, @Base(%T.loc4_17.2) [symbolic = %Base (constants.%Base.1)] +// CHECK:STDOUT: %Base.elem: type = unbound_element_type @Base.%Base (%Base.1), @Base.%T.loc4_17.2 (%T) [symbolic = %Base.elem (constants.%Base.elem.1)] +// CHECK:STDOUT: %struct_type.b: type = struct_type {.b: @Base.%T.loc4_17.2 (%T)} [symbolic = %struct_type.b (constants.%struct_type.b.1)] +// CHECK:STDOUT: %complete_type.loc6_1.2: = complete_type_witness @Base.%struct_type.b (%struct_type.b.1) [symbolic = %complete_type.loc6_1.2 (constants.%complete_type.1)] +// CHECK:STDOUT: +// CHECK:STDOUT: class { +// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc4_17.1 [symbolic = %T.loc4_17.2 (constants.%T)] +// CHECK:STDOUT: %.loc5: @Base.%Base.elem (%Base.elem.1) = field_decl b, element0 [template] +// CHECK:STDOUT: %complete_type.loc6_1.1: = complete_type_witness %struct_type.b.1 [symbolic = %complete_type.loc6_1.2 (constants.%complete_type.1)] +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = constants.%Base.1 +// CHECK:STDOUT: .b = %.loc5 +// CHECK:STDOUT: complete_type_witness = %complete_type.loc6_1.1 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic class @Derived(%T.loc8_15.1: type) { +// CHECK:STDOUT: %T.loc8_15.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc8_15.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc8_15.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_15.2 (constants.%T.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Base.loc9_22.2: type = class_type @Base, @Base(%T.loc8_15.2) [symbolic = %Base.loc9_22.2 (constants.%Base.1)] +// CHECK:STDOUT: %Derived: type = class_type @Derived, @Derived(%T.loc8_15.2) [symbolic = %Derived (constants.%Derived.1)] +// CHECK:STDOUT: %Derived.elem.loc9: type = unbound_element_type @Derived.%Derived (%Derived.1), @Derived.%Base.loc9_22.2 (%Base.1) [symbolic = %Derived.elem.loc9 (constants.%Derived.elem.1)] +// CHECK:STDOUT: %Derived.elem.loc10: type = unbound_element_type @Derived.%Derived (%Derived.1), @Derived.%T.loc8_15.2 (%T) [symbolic = %Derived.elem.loc10 (constants.%Derived.elem.2)] +// CHECK:STDOUT: %struct_type.base.d: type = struct_type {.base: @Derived.%Base.loc9_22.2 (%Base.1), .d: @Derived.%T.loc8_15.2 (%T)} [symbolic = %struct_type.base.d (constants.%struct_type.base.d.1)] +// CHECK:STDOUT: %complete_type.loc11_1.2: = complete_type_witness @Derived.%struct_type.base.d (%struct_type.base.d.1) [symbolic = %complete_type.loc11_1.2 (constants.%complete_type.2)] +// CHECK:STDOUT: +// CHECK:STDOUT: class { +// CHECK:STDOUT: %Base.ref: %Base.type = name_ref Base, file.%Base.decl [template = constants.%Base.generic] +// CHECK:STDOUT: %T.ref.loc9: type = name_ref T, %T.loc8_15.1 [symbolic = %T.loc8_15.2 (constants.%T)] +// CHECK:STDOUT: %Base.loc9_22.1: type = class_type @Base, @Base(constants.%T) [symbolic = %Base.loc9_22.2 (constants.%Base.1)] +// CHECK:STDOUT: %.loc9: @Derived.%Derived.elem.loc9 (%Derived.elem.1) = base_decl %Base.loc9_22.1, element0 [template] +// CHECK:STDOUT: %T.ref.loc10: type = name_ref T, %T.loc8_15.1 [symbolic = %T.loc8_15.2 (constants.%T)] +// CHECK:STDOUT: %.loc10: @Derived.%Derived.elem.loc10 (%Derived.elem.2) = field_decl d, element1 [template] +// CHECK:STDOUT: %complete_type.loc11_1.1: = complete_type_witness %struct_type.base.d.1 [symbolic = %complete_type.loc11_1.2 (constants.%complete_type.2)] +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = constants.%Derived.1 +// CHECK:STDOUT: .base = %.loc9 +// CHECK:STDOUT: .d = %.loc10 +// CHECK:STDOUT: extend %Base.loc9_22.1 +// CHECK:STDOUT: complete_type_witness = %complete_type.loc11_1.1 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @AccessMissingBase(%T.loc13_22.1: type) { +// CHECK:STDOUT: %T.loc13_22.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc13_22.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc13_22.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc13_22.2 (constants.%T.patt)] +// CHECK:STDOUT: %Base.loc13_41.2: type = class_type @Base, @Base(%T.loc13_22.2) [symbolic = %Base.loc13_41.2 (constants.%Base.1)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%T.param_patt: type](%x.param_patt: @AccessMissingBase.%Base.loc13_41.2 (%Base.1)) -> @AccessMissingBase.%T.loc13_22.2 (%T) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %x.ref: @AccessMissingBase.%Base.loc13_41.2 (%Base.1) = name_ref x, %x +// CHECK:STDOUT: %nonesuch.ref: = name_ref nonesuch, [template = ] +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @AccessMissingDerived(%T.loc21_25.1: type) { +// CHECK:STDOUT: %T.loc21_25.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc21_25.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc21_25.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc21_25.2 (constants.%T.patt)] +// CHECK:STDOUT: %Derived.loc21_47.2: type = class_type @Derived, @Derived(%T.loc21_25.2) [symbolic = %Derived.loc21_47.2 (constants.%Derived.1)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%T.param_patt: type](%x.param_patt: @AccessMissingDerived.%Derived.loc21_47.2 (%Derived.1)) -> @AccessMissingDerived.%T.loc21_25.2 (%T) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %x.ref: @AccessMissingDerived.%Derived.loc21_47.2 (%Derived.1) = name_ref x, %x +// CHECK:STDOUT: %nonesuch.ref: = name_ref nonesuch, [template = ] +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @AccessMissingConcrete(%x.param_patt: %Derived.2) -> %i32 { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %x.ref: %Derived.2 = name_ref x, %x +// CHECK:STDOUT: %nonesuch.ref: = name_ref nonesuch, [template = ] +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Base(constants.%T) { +// CHECK:STDOUT: %T.loc4_17.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc4_17.2 => constants.%T +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Base => constants.%Base.1 +// CHECK:STDOUT: %Base.elem => constants.%Base.elem.1 +// CHECK:STDOUT: %struct_type.b => constants.%struct_type.b.1 +// CHECK:STDOUT: %complete_type.loc6_1.2 => constants.%complete_type.1 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Base(%T.loc4_17.2) { +// CHECK:STDOUT: %T.loc4_17.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc4_17.2 => constants.%T +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Derived(constants.%T) { +// CHECK:STDOUT: %T.loc8_15.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc8_15.2 => constants.%T +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Base.loc9_22.2 => constants.%Base.1 +// CHECK:STDOUT: %Derived => constants.%Derived.1 +// CHECK:STDOUT: %Derived.elem.loc9 => constants.%Derived.elem.1 +// CHECK:STDOUT: %Derived.elem.loc10 => constants.%Derived.elem.2 +// CHECK:STDOUT: %struct_type.base.d => constants.%struct_type.base.d.1 +// CHECK:STDOUT: %complete_type.loc11_1.2 => constants.%complete_type.2 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Base(@Derived.%T.loc8_15.2) { +// CHECK:STDOUT: %T.loc4_17.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc4_17.2 => constants.%T +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Derived(%T.loc8_15.2) { +// CHECK:STDOUT: %T.loc8_15.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc8_15.2 => constants.%T +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Base(@AccessMissingBase.%T.loc13_22.2) { +// CHECK:STDOUT: %T.loc4_17.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc4_17.2 => constants.%T +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @AccessMissingBase(constants.%T) { +// CHECK:STDOUT: %T.loc13_22.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc13_22.2 => constants.%T +// CHECK:STDOUT: %Base.loc13_41.2 => constants.%Base.1 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Derived(@AccessMissingDerived.%T.loc21_25.2) { +// CHECK:STDOUT: %T.loc8_15.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc8_15.2 => constants.%T +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @AccessMissingDerived(constants.%T) { +// CHECK:STDOUT: %T.loc21_25.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc21_25.2 => constants.%T +// CHECK:STDOUT: %Derived.loc21_47.2 => constants.%Derived.1 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Derived(constants.%i32) { +// CHECK:STDOUT: %T.loc8_15.2 => constants.%i32 +// CHECK:STDOUT: %T.patt.loc8_15.2 => constants.%i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Base.loc9_22.2 => constants.%Base.2 +// CHECK:STDOUT: %Derived => constants.%Derived.2 +// CHECK:STDOUT: %Derived.elem.loc9 => constants.%Derived.elem.3 +// CHECK:STDOUT: %Derived.elem.loc10 => constants.%Derived.elem.4 +// CHECK:STDOUT: %struct_type.base.d => constants.%struct_type.base.d.3 +// CHECK:STDOUT: %complete_type.loc11_1.2 => constants.%complete_type.3 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Base(constants.%i32) { +// CHECK:STDOUT: %T.loc4_17.2 => constants.%i32 +// CHECK:STDOUT: %T.patt.loc4_17.2 => constants.%i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Base => constants.%Base.2 +// CHECK:STDOUT: %Base.elem => constants.%Base.elem.2 +// CHECK:STDOUT: %struct_type.b => constants.%struct_type.b.2 +// CHECK:STDOUT: %complete_type.loc6_1.2 => constants.%complete_type.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/no_prelude/import_access.carbon b/toolchain/check/testdata/class/no_prelude/import_access.carbon index e08c8fc6e1c0c..28bd83637d176 100644 --- a/toolchain/check/testdata/class/no_prelude/import_access.carbon +++ b/toolchain/check/testdata/class/no_prelude/import_access.carbon @@ -60,7 +60,7 @@ package Other library "[[@TEST_NAME]]"; import Test library "def"; -// CHECK:STDERR: fail_other_def.carbon:[[@LINE+4]]:8: error: name `Def` not found [NameNotFound] +// CHECK:STDERR: fail_other_def.carbon:[[@LINE+4]]:8: error: member name `Def` not found in `Test` [MemberNameNotFoundInScope] // CHECK:STDERR: var c: Test.Def = {}; // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: @@ -90,7 +90,7 @@ package Other library "[[@TEST_NAME]]"; import Test library "forward_with_def"; -// CHECK:STDERR: fail_other_forward_with_def.carbon:[[@LINE+4]]:8: error: name `ForwardWithDef` not found [NameNotFound] +// CHECK:STDERR: fail_other_forward_with_def.carbon:[[@LINE+4]]:8: error: member name `ForwardWithDef` not found in `Test` [MemberNameNotFoundInScope] // CHECK:STDERR: var c: Test.ForwardWithDef = {}; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -122,7 +122,7 @@ package Other library "[[@TEST_NAME]]"; import Test library "forward"; -// CHECK:STDERR: fail_other_forward.carbon:[[@LINE+3]]:9: error: name `Forward` not found [NameNotFound] +// CHECK:STDERR: fail_other_forward.carbon:[[@LINE+3]]:9: error: member name `Forward` not found in `Test` [MemberNameNotFoundInScope] // CHECK:STDERR: fn F(c: Test.Forward*) {} // CHECK:STDERR: ^~~~~~~~~~~~ fn F(c: Test.Forward*) {} diff --git a/toolchain/check/testdata/function/definition/import_access.carbon b/toolchain/check/testdata/function/definition/import_access.carbon index 973cecf0d54b0..b6785c12a6f8c 100644 --- a/toolchain/check/testdata/function/definition/import_access.carbon +++ b/toolchain/check/testdata/function/definition/import_access.carbon @@ -60,7 +60,7 @@ package Other library "[[@TEST_NAME]]"; import Test library "def"; -// CHECK:STDERR: fail_other_def.carbon:[[@LINE+4]]:13: error: name `Def` not found [NameNotFound] +// CHECK:STDERR: fail_other_def.carbon:[[@LINE+4]]:13: error: member name `Def` not found in `Test` [MemberNameNotFoundInScope] // CHECK:STDERR: var f: () = Test.Def(); // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: @@ -90,7 +90,7 @@ package Other library "[[@TEST_NAME]]"; import Test library "forward_with_def"; -// CHECK:STDERR: fail_other_forward_with_def.carbon:[[@LINE+4]]:13: error: name `ForwardWithDef` not found [NameNotFound] +// CHECK:STDERR: fail_other_forward_with_def.carbon:[[@LINE+4]]:13: error: member name `ForwardWithDef` not found in `Test` [MemberNameNotFoundInScope] // CHECK:STDERR: var f: () = Test.ForwardWithDef(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -122,7 +122,7 @@ package Other library "[[@TEST_NAME]]"; import Test library "forward"; -// CHECK:STDERR: fail_other_forward.carbon:[[@LINE+3]]:13: error: name `Forward` not found [NameNotFound] +// CHECK:STDERR: fail_other_forward.carbon:[[@LINE+3]]:13: error: member name `Forward` not found in `Test` [MemberNameNotFoundInScope] // CHECK:STDERR: var f: () = Test.Forward(); // CHECK:STDERR: ^~~~~~~~~~~~ var f: () = Test.Forward(); diff --git a/toolchain/check/testdata/interface/member_lookup.carbon b/toolchain/check/testdata/interface/member_lookup.carbon new file mode 100644 index 0000000000000..07e49e82ed634 --- /dev/null +++ b/toolchain/check/testdata/interface/member_lookup.carbon @@ -0,0 +1,449 @@ +// Part of the Carbon Language project, under the Apache License v2.0 with LLVM +// Exceptions. See /LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// AUTOUPDATE +// TIP: To test this file alone, run: +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interface/member_lookup.carbon +// TIP: To dump output, run: +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/member_lookup.carbon + +// --- member_access.carbon + +library "[[@TEST_NAME]]"; + +interface Interface(T:! type) { + let X:! T; +} + +fn AccessGeneric[T:! type](I:! Interface(T)) -> T { + return I.X; +} + +fn AccessConcrete(I:! Interface(i32)) -> i32 { + return I.X; +} + +// --- fail_no_member.carbon + +library "[[@TEST_NAME]]"; + +interface Interface(T:! type) { + let X:! T; +} + +fn AccessMissingGeneric[T:! type](I:! Interface(T)) -> T { + // CHECK:STDERR: fail_no_member.carbon:[[@LINE+4]]:10: error: member name `nonesuch` not found in `Interface(T)` [MemberNameNotFoundInScope] + // CHECK:STDERR: return I.nonesuch; + // CHECK:STDERR: ^~~~~~~~~~ + // CHECK:STDERR: + return I.nonesuch; +} + +fn AccessMissingConcrete(I:! Interface(i32)) -> i32 { + // CHECK:STDERR: fail_no_member.carbon:[[@LINE+3]]:10: error: member name `nonesuch` not found in `Interface(i32)` [MemberNameNotFoundInScope] + // CHECK:STDERR: return I.nonesuch; + // CHECK:STDERR: ^~~~~~~~~~ + return I.nonesuch; +} + +// CHECK:STDOUT: --- member_access.carbon +// CHECK:STDOUT: +// CHECK:STDOUT: constants { +// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] +// CHECK:STDOUT: %Interface.type.1: type = generic_interface_type @Interface [template] +// CHECK:STDOUT: %Interface.generic: %Interface.type.1 = struct_value () [template] +// CHECK:STDOUT: %Interface.type.2: type = facet_type <@Interface, @Interface(%T)> [symbolic] +// CHECK:STDOUT: %Self: %Interface.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %assoc_type.1: type = assoc_entity_type %Interface.type.2, %T [symbolic] +// CHECK:STDOUT: %assoc0.1: %assoc_type.1 = assoc_entity element0, @Interface.%X [symbolic] +// CHECK:STDOUT: %I.1: %Interface.type.2 = bind_symbolic_name I, 1 [symbolic] +// CHECK:STDOUT: %I.patt.1: %Interface.type.2 = symbolic_binding_pattern I, 1 [symbolic] +// CHECK:STDOUT: %AccessGeneric.type: type = fn_type @AccessGeneric [template] +// CHECK:STDOUT: %AccessGeneric: %AccessGeneric.type = struct_value () [template] +// CHECK:STDOUT: %I.as_wit.1: = facet_access_witness %I.1 [symbolic] +// CHECK:STDOUT: %impl.elem0.1: %T = interface_witness_access %I.as_wit.1, element0 [symbolic] +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %Interface.type.3: type = facet_type <@Interface, @Interface(%i32)> [template] +// CHECK:STDOUT: %I.2: %Interface.type.3 = bind_symbolic_name I, 0 [symbolic] +// CHECK:STDOUT: %I.patt.2: %Interface.type.3 = symbolic_binding_pattern I, 0 [symbolic] +// CHECK:STDOUT: %AccessConcrete.type: type = fn_type @AccessConcrete [template] +// CHECK:STDOUT: %AccessConcrete: %AccessConcrete.type = struct_value () [template] +// CHECK:STDOUT: %assoc_type.2: type = assoc_entity_type %Interface.type.3, %i32 [template] +// CHECK:STDOUT: %assoc0.2: %assoc_type.2 = assoc_entity element0, @Interface.%X [template] +// CHECK:STDOUT: %I.as_wit.2: = facet_access_witness %I.2 [symbolic] +// CHECK:STDOUT: %impl.elem0.2: %i32 = interface_witness_access %I.as_wit.2, element0 [symbolic] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: import Core//prelude +// CHECK:STDOUT: import Core//prelude/... +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Interface = %Interface.decl +// CHECK:STDOUT: .AccessGeneric = %AccessGeneric.decl +// CHECK:STDOUT: .AccessConcrete = %AccessConcrete.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %Interface.decl: %Interface.type.1 = interface_decl @Interface [template = constants.%Interface.generic] { +// CHECK:STDOUT: %T.patt.loc4_21.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_21.2 (constants.%T.patt)] +// CHECK:STDOUT: %T.param_patt: type = value_param_pattern %T.patt.loc4_21.1, runtime_param [symbolic = %T.patt.loc4_21.2 (constants.%T.patt)] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %T.param: type = value_param runtime_param +// CHECK:STDOUT: %T.loc4_21.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc4_21.2 (constants.%T)] +// CHECK:STDOUT: } +// CHECK:STDOUT: %AccessGeneric.decl: %AccessGeneric.type = fn_decl @AccessGeneric [template = constants.%AccessGeneric] { +// CHECK:STDOUT: %T.patt.loc8_18.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_18.2 (constants.%T.patt)] +// CHECK:STDOUT: %T.param_patt: type = value_param_pattern %T.patt.loc8_18.1, runtime_param [symbolic = %T.patt.loc8_18.2 (constants.%T.patt)] +// CHECK:STDOUT: %I.patt.loc8_28.1: @AccessGeneric.%Interface.type.loc8_43.2 (%Interface.type.2) = symbolic_binding_pattern I, 1 [symbolic = %I.patt.loc8_28.2 (constants.%I.patt.1)] +// CHECK:STDOUT: %I.param_patt: @AccessGeneric.%Interface.type.loc8_43.2 (%Interface.type.2) = value_param_pattern %I.patt.loc8_28.1, runtime_param [symbolic = %I.patt.loc8_28.2 (constants.%I.patt.1)] +// CHECK:STDOUT: %return.patt: @AccessGeneric.%T.loc8_18.2 (%T) = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: @AccessGeneric.%T.loc8_18.2 (%T) = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %Interface.ref: %Interface.type.1 = name_ref Interface, file.%Interface.decl [template = constants.%Interface.generic] +// CHECK:STDOUT: %T.ref.loc8_42: type = name_ref T, %T.loc8_18.1 [symbolic = %T.loc8_18.2 (constants.%T)] +// CHECK:STDOUT: %Interface.type.loc8_43.1: type = facet_type <@Interface, @Interface(constants.%T)> [symbolic = %Interface.type.loc8_43.2 (constants.%Interface.type.2)] +// CHECK:STDOUT: %T.ref.loc8_49: type = name_ref T, %T.loc8_18.1 [symbolic = %T.loc8_18.2 (constants.%T)] +// CHECK:STDOUT: %T.param: type = value_param runtime_param +// CHECK:STDOUT: %T.loc8_18.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc8_18.2 (constants.%T)] +// CHECK:STDOUT: %I.param: @AccessGeneric.%Interface.type.loc8_43.2 (%Interface.type.2) = value_param runtime_param +// CHECK:STDOUT: %I.loc8_28.1: @AccessGeneric.%Interface.type.loc8_43.2 (%Interface.type.2) = bind_symbolic_name I, 1, %I.param [symbolic = %I.loc8_28.2 (constants.%I.1)] +// CHECK:STDOUT: %return.param: ref @AccessGeneric.%T.loc8_18.2 (%T) = out_param runtime_param0 +// CHECK:STDOUT: %return: ref @AccessGeneric.%T.loc8_18.2 (%T) = return_slot %return.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %AccessConcrete.decl: %AccessConcrete.type = fn_decl @AccessConcrete [template = constants.%AccessConcrete] { +// CHECK:STDOUT: %I.patt.loc12_19.1: %Interface.type.3 = symbolic_binding_pattern I, 0 [symbolic = %I.patt.loc12_19.2 (constants.%I.patt.2)] +// CHECK:STDOUT: %I.param_patt: %Interface.type.3 = value_param_pattern %I.patt.loc12_19.1, runtime_param [symbolic = %I.patt.loc12_19.2 (constants.%I.patt.2)] +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %Interface.ref: %Interface.type.1 = name_ref Interface, file.%Interface.decl [template = constants.%Interface.generic] +// CHECK:STDOUT: %int_32.loc12_33: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %int.make_type_signed.loc12_33: init type = call constants.%Int(%int_32.loc12_33) [template = constants.%i32] +// CHECK:STDOUT: %.loc12_36.1: type = value_of_initializer %int.make_type_signed.loc12_33 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_36.2: type = converted %int.make_type_signed.loc12_33, %.loc12_36.1 [template = constants.%i32] +// CHECK:STDOUT: %Interface.type: type = facet_type <@Interface, @Interface(constants.%i32)> [template = constants.%Interface.type.3] +// CHECK:STDOUT: %int_32.loc12_42: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %int.make_type_signed.loc12_42: init type = call constants.%Int(%int_32.loc12_42) [template = constants.%i32] +// CHECK:STDOUT: %.loc12_42.1: type = value_of_initializer %int.make_type_signed.loc12_42 [template = constants.%i32] +// CHECK:STDOUT: %.loc12_42.2: type = converted %int.make_type_signed.loc12_42, %.loc12_42.1 [template = constants.%i32] +// CHECK:STDOUT: %I.param: %Interface.type.3 = value_param runtime_param +// CHECK:STDOUT: %I.loc12_19.1: %Interface.type.3 = bind_symbolic_name I, 0, %I.param [symbolic = %I.loc12_19.2 (constants.%I.2)] +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic interface @Interface(%T.loc4_21.1: type) { +// CHECK:STDOUT: %T.loc4_21.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_21.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc4_21.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_21.2 (constants.%T.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Interface.type: type = facet_type <@Interface, @Interface(%T.loc4_21.2)> [symbolic = %Interface.type (constants.%Interface.type.2)] +// CHECK:STDOUT: %Self.2: %Interface.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self)] +// CHECK:STDOUT: %assoc_type: type = assoc_entity_type @Interface.%Interface.type (%Interface.type.2), @Interface.%T.loc4_21.2 (%T) [symbolic = %assoc_type (constants.%assoc_type.1)] +// CHECK:STDOUT: %assoc0.loc5_12.2: @Interface.%assoc_type (%assoc_type.1) = assoc_entity element0, %X [symbolic = %assoc0.loc5_12.2 (constants.%assoc0.1)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: %Self.1: @Interface.%Interface.type (%Interface.type.2) = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self)] +// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc4_21.1 [symbolic = %T.loc4_21.2 (constants.%T)] +// CHECK:STDOUT: %X: @Interface.%T.loc4_21.2 (%T) = assoc_const_decl X [template] +// CHECK:STDOUT: %assoc0.loc5_12.1: @Interface.%assoc_type (%assoc_type.1) = assoc_entity element0, %X [symbolic = %assoc0.loc5_12.2 (constants.%assoc0.1)] +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = %Self.1 +// CHECK:STDOUT: .X = %assoc0.loc5_12.1 +// CHECK:STDOUT: witness = (%X) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @AccessGeneric(%T.loc8_18.1: type, %I.loc8_28.1: @AccessGeneric.%Interface.type.loc8_43.2 (%Interface.type.2)) { +// CHECK:STDOUT: %T.loc8_18.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc8_18.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc8_18.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_18.2 (constants.%T.patt)] +// CHECK:STDOUT: %Interface.type.loc8_43.2: type = facet_type <@Interface, @Interface(%T.loc8_18.2)> [symbolic = %Interface.type.loc8_43.2 (constants.%Interface.type.2)] +// CHECK:STDOUT: %I.loc8_28.2: %Interface.type.2 = bind_symbolic_name I, 1 [symbolic = %I.loc8_28.2 (constants.%I.1)] +// CHECK:STDOUT: %I.patt.loc8_28.2: %Interface.type.2 = symbolic_binding_pattern I, 1 [symbolic = %I.patt.loc8_28.2 (constants.%I.patt.1)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %assoc_type: type = assoc_entity_type @AccessGeneric.%Interface.type.loc8_43.2 (%Interface.type.2), @AccessGeneric.%T.loc8_18.2 (%T) [symbolic = %assoc_type (constants.%assoc_type.1)] +// CHECK:STDOUT: %assoc0: @AccessGeneric.%assoc_type (%assoc_type.1) = assoc_entity element0, @Interface.%X [symbolic = %assoc0 (constants.%assoc0.1)] +// CHECK:STDOUT: %I.as_wit.loc9_11.2: = facet_access_witness %I.loc8_28.2 [symbolic = %I.as_wit.loc9_11.2 (constants.%I.as_wit.1)] +// CHECK:STDOUT: %impl.elem0.loc9_11.2: @AccessGeneric.%T.loc8_18.2 (%T) = interface_witness_access %I.as_wit.loc9_11.2, element0 [symbolic = %impl.elem0.loc9_11.2 (constants.%impl.elem0.1)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%T.param_patt: type](%I.param_patt: @AccessGeneric.%Interface.type.loc8_43.2 (%Interface.type.2)) -> @AccessGeneric.%T.loc8_18.2 (%T) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %I.ref: @AccessGeneric.%Interface.type.loc8_43.2 (%Interface.type.2) = name_ref I, %I.loc8_28.1 [symbolic = %I.loc8_28.2 (constants.%I.1)] +// CHECK:STDOUT: %.loc9: @AccessGeneric.%assoc_type (%assoc_type.1) = specific_constant @Interface.%assoc0.loc5_12.1, @Interface(constants.%T) [symbolic = %assoc0 (constants.%assoc0.1)] +// CHECK:STDOUT: %X.ref: @AccessGeneric.%assoc_type (%assoc_type.1) = name_ref X, %.loc9 [symbolic = %assoc0 (constants.%assoc0.1)] +// CHECK:STDOUT: %I.as_wit.loc9_11.1: = facet_access_witness %I.ref [symbolic = %I.as_wit.loc9_11.2 (constants.%I.as_wit.1)] +// CHECK:STDOUT: %impl.elem0.loc9_11.1: @AccessGeneric.%T.loc8_18.2 (%T) = interface_witness_access %I.as_wit.loc9_11.1, element0 [symbolic = %impl.elem0.loc9_11.2 (constants.%impl.elem0.1)] +// CHECK:STDOUT: return %impl.elem0.loc9_11.1 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @AccessConcrete(%I.loc12_19.1: %Interface.type.3) { +// CHECK:STDOUT: %I.loc12_19.2: %Interface.type.3 = bind_symbolic_name I, 0 [symbolic = %I.loc12_19.2 (constants.%I.2)] +// CHECK:STDOUT: %I.patt.loc12_19.2: %Interface.type.3 = symbolic_binding_pattern I, 0 [symbolic = %I.patt.loc12_19.2 (constants.%I.patt.2)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %I.as_wit.loc13_11.2: = facet_access_witness %I.loc12_19.2 [symbolic = %I.as_wit.loc13_11.2 (constants.%I.as_wit.2)] +// CHECK:STDOUT: %impl.elem0.loc13_11.2: %i32 = interface_witness_access %I.as_wit.loc13_11.2, element0 [symbolic = %impl.elem0.loc13_11.2 (constants.%impl.elem0.2)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn(%I.param_patt: %Interface.type.3) -> %i32 { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %I.ref: %Interface.type.3 = name_ref I, %I.loc12_19.1 [symbolic = %I.loc12_19.2 (constants.%I.2)] +// CHECK:STDOUT: %.loc13: %assoc_type.2 = specific_constant @Interface.%assoc0.loc5_12.1, @Interface(constants.%i32) [template = constants.%assoc0.2] +// CHECK:STDOUT: %X.ref: %assoc_type.2 = name_ref X, %.loc13 [template = constants.%assoc0.2] +// CHECK:STDOUT: %I.as_wit.loc13_11.1: = facet_access_witness %I.ref [symbolic = %I.as_wit.loc13_11.2 (constants.%I.as_wit.2)] +// CHECK:STDOUT: %impl.elem0.loc13_11.1: %i32 = interface_witness_access %I.as_wit.loc13_11.1, element0 [symbolic = %impl.elem0.loc13_11.2 (constants.%impl.elem0.2)] +// CHECK:STDOUT: return %impl.elem0.loc13_11.1 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Interface(constants.%T) { +// CHECK:STDOUT: %T.loc4_21.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc4_21.2 => constants.%T +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Interface.type => constants.%Interface.type.2 +// CHECK:STDOUT: %Self.2 => constants.%Self +// CHECK:STDOUT: %assoc_type => constants.%assoc_type.1 +// CHECK:STDOUT: %assoc0.loc5_12.2 => constants.%assoc0.1 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Interface(%T.loc4_21.2) { +// CHECK:STDOUT: %T.loc4_21.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc4_21.2 => constants.%T +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Interface(@AccessGeneric.%T.loc8_18.2) { +// CHECK:STDOUT: %T.loc4_21.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc4_21.2 => constants.%T +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @AccessGeneric(constants.%T, constants.%I.1) { +// CHECK:STDOUT: %T.loc8_18.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc8_18.2 => constants.%T +// CHECK:STDOUT: %Interface.type.loc8_43.2 => constants.%Interface.type.2 +// CHECK:STDOUT: %I.loc8_28.2 => constants.%I.1 +// CHECK:STDOUT: %I.patt.loc8_28.2 => constants.%I.1 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Interface(constants.%i32) { +// CHECK:STDOUT: %T.loc4_21.2 => constants.%i32 +// CHECK:STDOUT: %T.patt.loc4_21.2 => constants.%i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Interface.type => constants.%Interface.type.3 +// CHECK:STDOUT: %Self.2 => constants.%Self +// CHECK:STDOUT: %assoc_type => constants.%assoc_type.2 +// CHECK:STDOUT: %assoc0.loc5_12.2 => constants.%assoc0.2 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @AccessConcrete(constants.%I.2) { +// CHECK:STDOUT: %I.loc12_19.2 => constants.%I.2 +// CHECK:STDOUT: %I.patt.loc12_19.2 => constants.%I.2 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: --- fail_no_member.carbon +// CHECK:STDOUT: +// CHECK:STDOUT: constants { +// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] +// CHECK:STDOUT: %Interface.type.1: type = generic_interface_type @Interface [template] +// CHECK:STDOUT: %Interface.generic: %Interface.type.1 = struct_value () [template] +// CHECK:STDOUT: %Interface.type.2: type = facet_type <@Interface, @Interface(%T)> [symbolic] +// CHECK:STDOUT: %Self: %Interface.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %assoc_type.1: type = assoc_entity_type %Interface.type.2, %T [symbolic] +// CHECK:STDOUT: %assoc0.1: %assoc_type.1 = assoc_entity element0, @Interface.%X [symbolic] +// CHECK:STDOUT: %I.1: %Interface.type.2 = bind_symbolic_name I, 1 [symbolic] +// CHECK:STDOUT: %I.patt.1: %Interface.type.2 = symbolic_binding_pattern I, 1 [symbolic] +// CHECK:STDOUT: %AccessMissingGeneric.type: type = fn_type @AccessMissingGeneric [template] +// CHECK:STDOUT: %AccessMissingGeneric: %AccessMissingGeneric.type = struct_value () [template] +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %Interface.type.3: type = facet_type <@Interface, @Interface(%i32)> [template] +// CHECK:STDOUT: %I.2: %Interface.type.3 = bind_symbolic_name I, 0 [symbolic] +// CHECK:STDOUT: %I.patt.2: %Interface.type.3 = symbolic_binding_pattern I, 0 [symbolic] +// CHECK:STDOUT: %AccessMissingConcrete.type: type = fn_type @AccessMissingConcrete [template] +// CHECK:STDOUT: %AccessMissingConcrete: %AccessMissingConcrete.type = struct_value () [template] +// CHECK:STDOUT: %assoc_type.2: type = assoc_entity_type %Interface.type.3, %i32 [template] +// CHECK:STDOUT: %assoc0.2: %assoc_type.2 = assoc_entity element0, @Interface.%X [template] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: import Core//prelude +// CHECK:STDOUT: import Core//prelude/... +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Interface = %Interface.decl +// CHECK:STDOUT: .AccessMissingGeneric = %AccessMissingGeneric.decl +// CHECK:STDOUT: .AccessMissingConcrete = %AccessMissingConcrete.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %Interface.decl: %Interface.type.1 = interface_decl @Interface [template = constants.%Interface.generic] { +// CHECK:STDOUT: %T.patt.loc4_21.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_21.2 (constants.%T.patt)] +// CHECK:STDOUT: %T.param_patt: type = value_param_pattern %T.patt.loc4_21.1, runtime_param [symbolic = %T.patt.loc4_21.2 (constants.%T.patt)] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %T.param: type = value_param runtime_param +// CHECK:STDOUT: %T.loc4_21.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc4_21.2 (constants.%T)] +// CHECK:STDOUT: } +// CHECK:STDOUT: %AccessMissingGeneric.decl: %AccessMissingGeneric.type = fn_decl @AccessMissingGeneric [template = constants.%AccessMissingGeneric] { +// CHECK:STDOUT: %T.patt.loc8_25.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_25.2 (constants.%T.patt)] +// CHECK:STDOUT: %T.param_patt: type = value_param_pattern %T.patt.loc8_25.1, runtime_param [symbolic = %T.patt.loc8_25.2 (constants.%T.patt)] +// CHECK:STDOUT: %I.patt.loc8_35.1: @AccessMissingGeneric.%Interface.type.loc8_50.2 (%Interface.type.2) = symbolic_binding_pattern I, 1 [symbolic = %I.patt.loc8_35.2 (constants.%I.patt.1)] +// CHECK:STDOUT: %I.param_patt: @AccessMissingGeneric.%Interface.type.loc8_50.2 (%Interface.type.2) = value_param_pattern %I.patt.loc8_35.1, runtime_param [symbolic = %I.patt.loc8_35.2 (constants.%I.patt.1)] +// CHECK:STDOUT: %return.patt: @AccessMissingGeneric.%T.loc8_25.2 (%T) = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: @AccessMissingGeneric.%T.loc8_25.2 (%T) = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %Interface.ref: %Interface.type.1 = name_ref Interface, file.%Interface.decl [template = constants.%Interface.generic] +// CHECK:STDOUT: %T.ref.loc8_49: type = name_ref T, %T.loc8_25.1 [symbolic = %T.loc8_25.2 (constants.%T)] +// CHECK:STDOUT: %Interface.type.loc8_50.1: type = facet_type <@Interface, @Interface(constants.%T)> [symbolic = %Interface.type.loc8_50.2 (constants.%Interface.type.2)] +// CHECK:STDOUT: %T.ref.loc8_56: type = name_ref T, %T.loc8_25.1 [symbolic = %T.loc8_25.2 (constants.%T)] +// CHECK:STDOUT: %T.param: type = value_param runtime_param +// CHECK:STDOUT: %T.loc8_25.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc8_25.2 (constants.%T)] +// CHECK:STDOUT: %I.param: @AccessMissingGeneric.%Interface.type.loc8_50.2 (%Interface.type.2) = value_param runtime_param +// CHECK:STDOUT: %I.loc8_35.1: @AccessMissingGeneric.%Interface.type.loc8_50.2 (%Interface.type.2) = bind_symbolic_name I, 1, %I.param [symbolic = %I.loc8_35.2 (constants.%I.1)] +// CHECK:STDOUT: %return.param: ref @AccessMissingGeneric.%T.loc8_25.2 (%T) = out_param runtime_param0 +// CHECK:STDOUT: %return: ref @AccessMissingGeneric.%T.loc8_25.2 (%T) = return_slot %return.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %AccessMissingConcrete.decl: %AccessMissingConcrete.type = fn_decl @AccessMissingConcrete [template = constants.%AccessMissingConcrete] { +// CHECK:STDOUT: %I.patt.loc16_26.1: %Interface.type.3 = symbolic_binding_pattern I, 0 [symbolic = %I.patt.loc16_26.2 (constants.%I.patt.2)] +// CHECK:STDOUT: %I.param_patt: %Interface.type.3 = value_param_pattern %I.patt.loc16_26.1, runtime_param [symbolic = %I.patt.loc16_26.2 (constants.%I.patt.2)] +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %Interface.ref: %Interface.type.1 = name_ref Interface, file.%Interface.decl [template = constants.%Interface.generic] +// CHECK:STDOUT: %int_32.loc16_40: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %int.make_type_signed.loc16_40: init type = call constants.%Int(%int_32.loc16_40) [template = constants.%i32] +// CHECK:STDOUT: %.loc16_43.1: type = value_of_initializer %int.make_type_signed.loc16_40 [template = constants.%i32] +// CHECK:STDOUT: %.loc16_43.2: type = converted %int.make_type_signed.loc16_40, %.loc16_43.1 [template = constants.%i32] +// CHECK:STDOUT: %Interface.type: type = facet_type <@Interface, @Interface(constants.%i32)> [template = constants.%Interface.type.3] +// CHECK:STDOUT: %int_32.loc16_49: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %int.make_type_signed.loc16_49: init type = call constants.%Int(%int_32.loc16_49) [template = constants.%i32] +// CHECK:STDOUT: %.loc16_49.1: type = value_of_initializer %int.make_type_signed.loc16_49 [template = constants.%i32] +// CHECK:STDOUT: %.loc16_49.2: type = converted %int.make_type_signed.loc16_49, %.loc16_49.1 [template = constants.%i32] +// CHECK:STDOUT: %I.param: %Interface.type.3 = value_param runtime_param +// CHECK:STDOUT: %I.loc16_26.1: %Interface.type.3 = bind_symbolic_name I, 0, %I.param [symbolic = %I.loc16_26.2 (constants.%I.2)] +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic interface @Interface(%T.loc4_21.1: type) { +// CHECK:STDOUT: %T.loc4_21.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_21.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc4_21.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_21.2 (constants.%T.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Interface.type: type = facet_type <@Interface, @Interface(%T.loc4_21.2)> [symbolic = %Interface.type (constants.%Interface.type.2)] +// CHECK:STDOUT: %Self.2: %Interface.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self)] +// CHECK:STDOUT: %assoc_type: type = assoc_entity_type @Interface.%Interface.type (%Interface.type.2), @Interface.%T.loc4_21.2 (%T) [symbolic = %assoc_type (constants.%assoc_type.1)] +// CHECK:STDOUT: %assoc0.loc5_12.2: @Interface.%assoc_type (%assoc_type.1) = assoc_entity element0, %X [symbolic = %assoc0.loc5_12.2 (constants.%assoc0.1)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: %Self.1: @Interface.%Interface.type (%Interface.type.2) = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self)] +// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc4_21.1 [symbolic = %T.loc4_21.2 (constants.%T)] +// CHECK:STDOUT: %X: @Interface.%T.loc4_21.2 (%T) = assoc_const_decl X [template] +// CHECK:STDOUT: %assoc0.loc5_12.1: @Interface.%assoc_type (%assoc_type.1) = assoc_entity element0, %X [symbolic = %assoc0.loc5_12.2 (constants.%assoc0.1)] +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = %Self.1 +// CHECK:STDOUT: .X = %assoc0.loc5_12.1 +// CHECK:STDOUT: witness = (%X) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @AccessMissingGeneric(%T.loc8_25.1: type, %I.loc8_35.1: @AccessMissingGeneric.%Interface.type.loc8_50.2 (%Interface.type.2)) { +// CHECK:STDOUT: %T.loc8_25.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc8_25.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc8_25.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_25.2 (constants.%T.patt)] +// CHECK:STDOUT: %Interface.type.loc8_50.2: type = facet_type <@Interface, @Interface(%T.loc8_25.2)> [symbolic = %Interface.type.loc8_50.2 (constants.%Interface.type.2)] +// CHECK:STDOUT: %I.loc8_35.2: %Interface.type.2 = bind_symbolic_name I, 1 [symbolic = %I.loc8_35.2 (constants.%I.1)] +// CHECK:STDOUT: %I.patt.loc8_35.2: %Interface.type.2 = symbolic_binding_pattern I, 1 [symbolic = %I.patt.loc8_35.2 (constants.%I.patt.1)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%T.param_patt: type](%I.param_patt: @AccessMissingGeneric.%Interface.type.loc8_50.2 (%Interface.type.2)) -> @AccessMissingGeneric.%T.loc8_25.2 (%T) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %I.ref: @AccessMissingGeneric.%Interface.type.loc8_50.2 (%Interface.type.2) = name_ref I, %I.loc8_35.1 [symbolic = %I.loc8_35.2 (constants.%I.1)] +// CHECK:STDOUT: %nonesuch.ref: = name_ref nonesuch, [template = ] +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @AccessMissingConcrete(%I.loc16_26.1: %Interface.type.3) { +// CHECK:STDOUT: %I.loc16_26.2: %Interface.type.3 = bind_symbolic_name I, 0 [symbolic = %I.loc16_26.2 (constants.%I.2)] +// CHECK:STDOUT: %I.patt.loc16_26.2: %Interface.type.3 = symbolic_binding_pattern I, 0 [symbolic = %I.patt.loc16_26.2 (constants.%I.patt.2)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn(%I.param_patt: %Interface.type.3) -> %i32 { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %I.ref: %Interface.type.3 = name_ref I, %I.loc16_26.1 [symbolic = %I.loc16_26.2 (constants.%I.2)] +// CHECK:STDOUT: %nonesuch.ref: = name_ref nonesuch, [template = ] +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Interface(constants.%T) { +// CHECK:STDOUT: %T.loc4_21.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc4_21.2 => constants.%T +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Interface.type => constants.%Interface.type.2 +// CHECK:STDOUT: %Self.2 => constants.%Self +// CHECK:STDOUT: %assoc_type => constants.%assoc_type.1 +// CHECK:STDOUT: %assoc0.loc5_12.2 => constants.%assoc0.1 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Interface(%T.loc4_21.2) { +// CHECK:STDOUT: %T.loc4_21.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc4_21.2 => constants.%T +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Interface(@AccessMissingGeneric.%T.loc8_25.2) { +// CHECK:STDOUT: %T.loc4_21.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc4_21.2 => constants.%T +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @AccessMissingGeneric(constants.%T, constants.%I.1) { +// CHECK:STDOUT: %T.loc8_25.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc8_25.2 => constants.%T +// CHECK:STDOUT: %Interface.type.loc8_50.2 => constants.%Interface.type.2 +// CHECK:STDOUT: %I.loc8_35.2 => constants.%I.1 +// CHECK:STDOUT: %I.patt.loc8_35.2 => constants.%I.1 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Interface(constants.%i32) { +// CHECK:STDOUT: %T.loc4_21.2 => constants.%i32 +// CHECK:STDOUT: %T.patt.loc4_21.2 => constants.%i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Interface.type => constants.%Interface.type.3 +// CHECK:STDOUT: %Self.2 => constants.%Self +// CHECK:STDOUT: %assoc_type => constants.%assoc_type.2 +// CHECK:STDOUT: %assoc0.loc5_12.2 => constants.%assoc0.2 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @AccessMissingConcrete(constants.%I.2) { +// CHECK:STDOUT: %I.loc16_26.2 => constants.%I.2 +// CHECK:STDOUT: %I.patt.loc16_26.2 => constants.%I.2 +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/interface/no_prelude/fail_lookup_in_type_type.carbon b/toolchain/check/testdata/interface/no_prelude/fail_lookup_in_type_type.carbon index 21c80d2c6171e..7f7176d274c03 100644 --- a/toolchain/check/testdata/interface/no_prelude/fail_lookup_in_type_type.carbon +++ b/toolchain/check/testdata/interface/no_prelude/fail_lookup_in_type_type.carbon @@ -22,7 +22,7 @@ let T: type.not_found = {}; library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_lookup_type_where.carbon:[[@LINE+3]]:8: error: name `missing` not found [NameNotFound] +// CHECK:STDERR: fail_lookup_type_where.carbon:[[@LINE+3]]:8: error: member name `missing` not found [MemberNameNotFound] // CHECK:STDERR: let U: (type where .Self impls type).missing = {}; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ let U: (type where .Self impls type).missing = {}; diff --git a/toolchain/check/testdata/interface/no_prelude/fail_lookup_undefined.carbon b/toolchain/check/testdata/interface/no_prelude/fail_lookup_undefined.carbon index 91604916835e3..1a34b7cf4f266 100644 --- a/toolchain/check/testdata/interface/no_prelude/fail_lookup_undefined.carbon +++ b/toolchain/check/testdata/interface/no_prelude/fail_lookup_undefined.carbon @@ -38,7 +38,7 @@ interface BeingDefined { // CHECK:STDERR: interface BeingDefined { // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: - // CHECK:STDERR: fail_lookup_undefined.carbon:[[@LINE+4]]:13: error: name `T` not found [NameNotFound] + // CHECK:STDERR: fail_lookup_undefined.carbon:[[@LINE+4]]:13: error: member name `T` not found in `BeingDefined` [MemberNameNotFoundInScope] // CHECK:STDERR: fn H() -> BeingDefined.T; // CHECK:STDERR: ^~~~~~~~~~~~~~ // CHECK:STDERR: diff --git a/toolchain/check/testdata/interface/no_prelude/import_access.carbon b/toolchain/check/testdata/interface/no_prelude/import_access.carbon index 45b32127ed2cd..c10de96c50423 100644 --- a/toolchain/check/testdata/interface/no_prelude/import_access.carbon +++ b/toolchain/check/testdata/interface/no_prelude/import_access.carbon @@ -61,7 +61,7 @@ package Other library "[[@TEST_NAME]]"; import Test library "def"; -// CHECK:STDERR: fail_other_def.carbon:[[@LINE+4]]:9: error: name `Def` not found [NameNotFound] +// CHECK:STDERR: fail_other_def.carbon:[[@LINE+4]]:9: error: member name `Def` not found in `Test` [MemberNameNotFoundInScope] // CHECK:STDERR: fn F(i: Test.Def) {} // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: @@ -91,7 +91,7 @@ package Other library "[[@TEST_NAME]]"; import Test library "forward_with_def"; -// CHECK:STDERR: fail_other_forward_with_def.carbon:[[@LINE+4]]:9: error: name `ForwardWithDef` not found [NameNotFound] +// CHECK:STDERR: fail_other_forward_with_def.carbon:[[@LINE+4]]:9: error: member name `ForwardWithDef` not found in `Test` [MemberNameNotFoundInScope] // CHECK:STDERR: fn F(i: Test.ForwardWithDef) {} // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: diff --git a/toolchain/check/testdata/let/no_prelude/import_access.carbon b/toolchain/check/testdata/let/no_prelude/import_access.carbon index c4b130539c577..4d995ba88353d 100644 --- a/toolchain/check/testdata/let/no_prelude/import_access.carbon +++ b/toolchain/check/testdata/let/no_prelude/import_access.carbon @@ -46,7 +46,7 @@ package Other library "[[@TEST_NAME]]"; import Test library "def"; -// CHECK:STDERR: fail_other_def.carbon:[[@LINE+3]]:14: error: name `v` not found [NameNotFound] +// CHECK:STDERR: fail_other_def.carbon:[[@LINE+3]]:14: error: member name `v` not found in `Test` [MemberNameNotFoundInScope] // CHECK:STDERR: let v2: () = Test.v; // CHECK:STDERR: ^~~~~~ let v2: () = Test.v; diff --git a/toolchain/check/testdata/package_expr/fail_not_found.carbon b/toolchain/check/testdata/package_expr/fail_not_found.carbon index 11c435b9aa4d9..b2cf119489408 100644 --- a/toolchain/check/testdata/package_expr/fail_not_found.carbon +++ b/toolchain/check/testdata/package_expr/fail_not_found.carbon @@ -9,7 +9,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/package_expr/fail_not_found.carbon fn Main() { - // CHECK:STDERR: fail_not_found.carbon:[[@LINE+3]]:16: error: name `x` not found [NameNotFound] + // CHECK:STDERR: fail_not_found.carbon:[[@LINE+3]]:16: error: member name `x` not found in `package` [MemberNameNotFoundInScope] // CHECK:STDERR: var y: i32 = package.x; // CHECK:STDERR: ^~~~~~~~~ var y: i32 = package.x; diff --git a/toolchain/check/testdata/packages/no_prelude/cross_package_import.carbon b/toolchain/check/testdata/packages/no_prelude/cross_package_import.carbon index 87220bdd54c5d..e86958d20aad0 100644 --- a/toolchain/check/testdata/packages/no_prelude/cross_package_import.carbon +++ b/toolchain/check/testdata/packages/no_prelude/cross_package_import.carbon @@ -201,7 +201,7 @@ library "[[@TEST_NAME]]"; import Other library "other_fn_use"; -// CHECK:STDERR: fail_use_other_fn_use.carbon:[[@LINE+3]]:13: error: name `F` not found [NameNotFound] +// CHECK:STDERR: fail_use_other_fn_use.carbon:[[@LINE+3]]:13: error: member name `F` not found in `Other` [MemberNameNotFoundInScope] // CHECK:STDERR: fn UseF() { Other.F(); } // CHECK:STDERR: ^~~~~~~ fn UseF() { Other.F(); } diff --git a/toolchain/check/testdata/var/no_prelude/import_access.carbon b/toolchain/check/testdata/var/no_prelude/import_access.carbon index 35eb8a1e25868..f392ab220d7a0 100644 --- a/toolchain/check/testdata/var/no_prelude/import_access.carbon +++ b/toolchain/check/testdata/var/no_prelude/import_access.carbon @@ -46,7 +46,7 @@ package Other library "[[@TEST_NAME]]"; import Test library "def"; -// CHECK:STDERR: fail_other_def.carbon:[[@LINE+3]]:14: error: name `v` not found [NameNotFound] +// CHECK:STDERR: fail_other_def.carbon:[[@LINE+3]]:14: error: member name `v` not found in `Test` [MemberNameNotFoundInScope] // CHECK:STDERR: var v2: () = Test.v; // CHECK:STDERR: ^~~~~~ var v2: () = Test.v; diff --git a/toolchain/check/testdata/where_expr/designator.carbon b/toolchain/check/testdata/where_expr/designator.carbon index 8747ea0d167da..6ca1952b0fc21 100644 --- a/toolchain/check/testdata/where_expr/designator.carbon +++ b/toolchain/check/testdata/where_expr/designator.carbon @@ -30,7 +30,7 @@ interface J { let Member:! type; } -// CHECK:STDERR: fail_wrong_member.carbon:[[@LINE+4]]:31: error: name `Mismatch` not found [NameNotFound] +// CHECK:STDERR: fail_wrong_member.carbon:[[@LINE+4]]:31: error: member name `Mismatch` not found in `J` [MemberNameNotFoundInScope] // CHECK:STDERR: fn PeriodMismatch(W:! J where .Mismatch = {}); // CHECK:STDERR: ^~~~~~~~~ // CHECK:STDERR: diff --git a/toolchain/diagnostics/diagnostic_kind.def b/toolchain/diagnostics/diagnostic_kind.def index 97cd57425936b..d9f0bb0cb0302 100644 --- a/toolchain/diagnostics/diagnostic_kind.def +++ b/toolchain/diagnostics/diagnostic_kind.def @@ -280,6 +280,8 @@ CARBON_DIAGNOSTIC_KIND(FromExtendHere) CARBON_DIAGNOSTIC_KIND(InNameLookup) CARBON_DIAGNOSTIC_KIND(NameAmbiguousDueToExtend) CARBON_DIAGNOSTIC_KIND(NameNotFound) +CARBON_DIAGNOSTIC_KIND(MemberNameNotFound) +CARBON_DIAGNOSTIC_KIND(MemberNameNotFoundInScope) CARBON_DIAGNOSTIC_KIND(NoPeriodSelfForDesignator) CARBON_DIAGNOSTIC_KIND(AbstractTypeInAdaptDecl) diff --git a/toolchain/sem_ir/stringify_type.cpp b/toolchain/sem_ir/stringify_type.cpp index 3993a18aef45a..3f74c1971dcc5 100644 --- a/toolchain/sem_ir/stringify_type.cpp +++ b/toolchain/sem_ir/stringify_type.cpp @@ -372,6 +372,11 @@ auto StringifyTypeExpr(const SemIR::File& sem_ir, InstId outer_inst_id) out << sem_ir.names().GetFormatted(inst.name_id); break; } + case CARBON_KIND(Namespace inst): { + out << sem_ir.names().GetFormatted( + sem_ir.name_scopes().Get(inst.name_scope_id).name_id()); + break; + } case CARBON_KIND(PointerType inst): { step_stack.PushString("*"); step_stack.PushTypeId(inst.pointee_id); @@ -463,7 +468,6 @@ auto StringifyTypeExpr(const SemIR::File& sem_ir, InstId outer_inst_id) case InitializeFrom::Kind: case InterfaceDecl::Kind: case InterfaceWitness::Kind: - case Namespace::Kind: case OutParam::Kind: case OutParamPattern::Kind: case RequirementEquivalent::Kind: From eabe9f117aafd3bfb6633188760d34f907dfb78a Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Mon, 9 Dec 2024 19:00:28 -0800 Subject: [PATCH 08/68] Track complete types required by a generic. (#4652) When a generic requires a symbolic type to be complete, add a new `require_complete_type` instruction to the generic eval block. During monomorphization of such an instruction, require that type to be complete. --- toolchain/check/call.cpp | 2 +- toolchain/check/context.cpp | 44 ++- toolchain/check/context.h | 26 +- toolchain/check/convert.cpp | 2 +- toolchain/check/eval.cpp | 41 ++ toolchain/check/function.cpp | 8 +- toolchain/check/function.h | 2 +- toolchain/check/generic.cpp | 1 - toolchain/check/handle_binding_pattern.cpp | 4 +- toolchain/check/handle_class.cpp | 4 +- toolchain/check/handle_function.cpp | 14 +- toolchain/check/handle_impl.cpp | 2 +- toolchain/check/impl.cpp | 16 +- toolchain/check/import_ref.cpp | 23 ++ toolchain/check/member_access.cpp | 16 +- .../check/testdata/array/generic_empty.carbon | 2 + .../testdata/as/adapter_conversion.carbon | 16 +- toolchain/check/testdata/as/overloaded.carbon | 4 +- .../testdata/basics/no_prelude/raw_ir.carbon | 84 ++-- .../check/testdata/builtins/int/eq.carbon | 6 +- .../testdata/builtins/int/greater.carbon | 6 +- .../testdata/builtins/int/greater_eq.carbon | 6 +- .../check/testdata/builtins/int/less.carbon | 6 +- .../testdata/builtins/int/less_eq.carbon | 6 +- .../builtins/int/make_type_signed.carbon | 6 + .../builtins/int/make_type_unsigned.carbon | 2 + .../check/testdata/builtins/int/neq.carbon | 6 +- .../testdata/class/access_modifers.carbon | 16 +- .../testdata/class/adapter/init_adapt.carbon | 12 +- .../check/testdata/class/base_method.carbon | 4 +- toolchain/check/testdata/class/basic.carbon | 4 +- .../check/testdata/class/fail_abstract.carbon | 2 +- .../class/fail_field_modifiers.carbon | 4 +- .../testdata/class/fail_generic_method.carbon | 2 + .../testdata/class/fail_incomplete.carbon | 2 +- .../check/testdata/class/fail_init.carbon | 4 +- .../class/fail_init_as_inplace.carbon | 4 +- .../check/testdata/class/fail_scope.carbon | 4 +- .../check/testdata/class/field_access.carbon | 4 +- .../class/field_access_in_value.carbon | 4 +- .../check/testdata/class/generic/adapt.carbon | 49 ++- .../class/generic/base_is_generic.carbon | 39 +- .../check/testdata/class/generic/basic.carbon | 11 + .../check/testdata/class/generic/call.carbon | 12 +- .../check/testdata/class/generic/field.carbon | 21 +- .../testdata/class/generic/import.carbon | 6 +- .../check/testdata/class/generic/init.carbon | 19 +- .../class/generic/member_access.carbon | 32 +- .../class/generic/member_inline.carbon | 7 + .../class/generic/member_lookup.carbon | 60 ++- .../class/generic/member_out_of_line.carbon | 11 + .../class/generic/method_deduce.carbon | 30 +- .../check/testdata/class/generic/self.carbon | 6 + .../testdata/class/generic/stringify.carbon | 4 +- .../testdata/class/generic_method.carbon | 6 + toolchain/check/testdata/class/import.carbon | 2 +- .../testdata/class/inheritance_access.carbon | 18 +- toolchain/check/testdata/class/init_as.carbon | 4 +- toolchain/check/testdata/class/method.carbon | 4 +- toolchain/check/testdata/class/reorder.carbon | 4 +- toolchain/check/testdata/class/scope.carbon | 4 +- .../class/syntactic_merge_literal.carbon | 12 +- .../testdata/class/virtual_modifiers.carbon | 4 +- toolchain/check/testdata/deduce/array.carbon | 36 +- .../check/testdata/deduce/generic_type.carbon | 51 ++- .../check/testdata/deduce/int_float.carbon | 4 + toolchain/check/testdata/deduce/tuple.carbon | 22 +- .../testdata/deduce/type_operator.carbon | 45 ++- toolchain/check/testdata/eval/symbolic.carbon | 6 + .../call/prefer_unqualified_lookup.carbon | 6 +- .../fail_import_incomplete_return.carbon | 8 +- .../testdata/function/generic/deduce.carbon | 51 ++- .../function/generic/no_prelude/call.carbon | 16 + .../fail_type_param_mismatch.carbon | 4 + .../no_prelude/indirect_generic_type.carbon | 4 + .../generic/no_prelude/type_param.carbon | 4 + .../no_prelude/type_param_scope.carbon | 2 + .../function/generic/redeclare.carbon | 9 + .../function/generic/resolve_used.carbon | 3 + .../function/generic/return_slot.carbon | 8 + .../function/generic/undefined.carbon | 8 + .../testdata/generic/complete_type.carbon | 359 ++++++++++++++++++ .../if_expr/fail_not_in_function.carbon | 4 +- .../testdata/impl/extend_impl_generic.carbon | 18 + .../impl/fail_extend_impl_forall.carbon | 5 + .../check/testdata/impl/lookup/generic.carbon | 12 + .../impl/lookup/no_prelude/impl_forall.carbon | 30 +- .../impl/no_prelude/import_generic.carbon | 6 + ..._todo_define_default_fn_out_of_line.carbon | 4 + .../testdata/interface/member_lookup.carbon | 15 + .../no_prelude/as_type_of_type.carbon | 2 + .../no_prelude/assoc_const_in_generic.carbon | 8 + .../no_prelude/fail_todo_facet_lookup.carbon | 2 + .../fail_todo_generic_default_fn.carbon | 2 + .../operators/overloaded/implicit_as.carbon | 10 +- .../fail_return_with_returned_var.carbon | 4 +- .../check/testdata/return/returned_var.carbon | 4 +- toolchain/check/testdata/struct/import.carbon | 22 +- toolchain/check/testdata/tuple/import.carbon | 22 +- .../testdata/where_expr/dot_self_index.carbon | 9 + toolchain/diagnostics/diagnostic_kind.def | 1 + toolchain/sem_ir/file.cpp | 1 + toolchain/sem_ir/formatter.cpp | 4 + toolchain/sem_ir/inst_kind.def | 1 + toolchain/sem_ir/inst_namer.cpp | 8 +- toolchain/sem_ir/stringify_type.cpp | 1 + toolchain/sem_ir/typed_insts.h | 19 + 107 files changed, 1356 insertions(+), 290 deletions(-) create mode 100644 toolchain/check/testdata/generic/complete_type.carbon diff --git a/toolchain/check/call.cpp b/toolchain/check/call.cpp index 27010a6a69de2..b1d0652841521 100644 --- a/toolchain/check/call.cpp +++ b/toolchain/check/call.cpp @@ -179,7 +179,7 @@ auto PerformCall(Context& context, SemIR::LocId loc_id, SemIR::InstId callee_id, builder.Note(function.return_slot_pattern_id, IncompleteReturnTypeHere); }); - return CheckFunctionReturnType(context, callee_id, function, + return CheckFunctionReturnType(context, loc_id, function, *callee_specific_id); }(); switch (return_info.init_repr.kind) { diff --git a/toolchain/check/context.cpp b/toolchain/check/context.cpp index 0f22b08c0da9e..f7f9c9791bcc5 100644 --- a/toolchain/check/context.cpp +++ b/toolchain/check/context.cpp @@ -498,7 +498,7 @@ struct ProhibitedAccessInfo { }; auto Context::AppendLookupScopesForConstant( - SemIRLoc loc, SemIR::ConstantId base_const_id, + SemIR::LocId loc_id, SemIR::ConstantId base_const_id, llvm::SmallVector* scopes) -> bool { auto base_id = constant_values().GetInstId(base_const_id); auto base = insts().Get(base_id); @@ -509,11 +509,12 @@ auto Context::AppendLookupScopesForConstant( return true; } if (auto base_as_class = base.TryAs()) { - TryToDefineType(GetTypeIdForTypeConstant(base_const_id), [&] { + TryToDefineType(GetTypeIdForTypeConstant(base_const_id), loc_id, [&] { CARBON_DIAGNOSTIC(QualifiedExprInIncompleteClassScope, Error, "member access into incomplete class {0}", InstIdAsType); - return emitter().Build(loc, QualifiedExprInIncompleteClassScope, base_id); + return emitter().Build(loc_id, QualifiedExprInIncompleteClassScope, + base_id); }); auto& class_info = classes().Get(base_as_class->class_id); scopes->push_back(LookupScope{.name_scope_id = class_info.scope_id, @@ -521,11 +522,11 @@ auto Context::AppendLookupScopesForConstant( return true; } if (auto base_as_facet_type = base.TryAs()) { - TryToDefineType(GetTypeIdForTypeConstant(base_const_id), [&] { + TryToDefineType(GetTypeIdForTypeConstant(base_const_id), loc_id, [&] { CARBON_DIAGNOSTIC(QualifiedExprInUndefinedInterfaceScope, Error, "member access into undefined interface {0}", InstIdAsType); - return emitter().Build(loc, QualifiedExprInUndefinedInterfaceScope, + return emitter().Build(loc_id, QualifiedExprInUndefinedInterfaceScope, base_id); }); const auto& facet_type_info = @@ -550,7 +551,7 @@ auto Context::AppendLookupScopesForConstant( return false; } -auto Context::LookupQualifiedName(SemIRLoc loc, SemIR::NameId name_id, +auto Context::LookupQualifiedName(SemIR::LocId loc_id, SemIR::NameId name_id, llvm::ArrayRef lookup_scopes, bool required, std::optional access_info) @@ -576,7 +577,7 @@ auto Context::LookupQualifiedName(SemIRLoc loc, SemIR::NameId name_id, has_error |= name_scope.has_error(); auto [scope_result_id, access_kind] = - LookupNameInExactScope(loc, name_id, scope_id, name_scope); + LookupNameInExactScope(loc_id, name_id, scope_id, name_scope); auto is_access_prohibited = IsAccessProhibited(access_info, access_kind, is_parent_access); @@ -610,7 +611,7 @@ auto Context::LookupQualifiedName(SemIRLoc loc, SemIR::NameId name_id, "declared as an extended scope here"); builder.Note(extended_id, FromExtendHere); }); - if (!AppendLookupScopesForConstant(loc, const_id, &scopes)) { + if (!AppendLookupScopesForConstant(loc_id, const_id, &scopes)) { // TODO: Handle case where we have a symbolic type and instead should // look in its type. } @@ -625,7 +626,7 @@ auto Context::LookupQualifiedName(SemIRLoc loc, SemIR::NameId name_id, NameAmbiguousDueToExtend, Error, "ambiguous use of name `{0}` found in multiple extended scopes", SemIR::NameId); - emitter_->Emit(loc, NameAmbiguousDueToExtend, name_id); + emitter_->Emit(loc_id, NameAmbiguousDueToExtend, name_id); // TODO: Add notes pointing to the scopes. return {.specific_id = SemIR::SpecificId::Invalid, .inst_id = SemIR::ErrorInst::SingletonInstId}; @@ -638,7 +639,7 @@ auto Context::LookupQualifiedName(SemIRLoc loc, SemIR::NameId name_id, if (required && !result.inst_id.is_valid()) { if (!has_error) { if (prohibited_accesses.empty()) { - DiagnoseMemberNameNotFound(loc, name_id, lookup_scopes); + DiagnoseMemberNameNotFound(loc_id, name_id, lookup_scopes); } else { // TODO: We should report multiple prohibited accesses in case we don't // find a valid lookup. Reporting the last one should suffice for now. @@ -647,9 +648,9 @@ auto Context::LookupQualifiedName(SemIRLoc loc, SemIR::NameId name_id, // Note, `access_info` is guaranteed to have a value here, since // `prohibited_accesses` is non-empty. - DiagnoseInvalidQualifiedNameAccess(*this, loc, scope_result_id, name_id, - access_kind, is_parent_access, - *access_info); + DiagnoseInvalidQualifiedNameAccess(*this, loc_id, scope_result_id, + name_id, access_kind, + is_parent_access, *access_info); } } @@ -1278,13 +1279,24 @@ class TypeCompleter { }; } // namespace -auto Context::TryToCompleteType(SemIR::TypeId type_id, +auto Context::TryToCompleteType(SemIR::TypeId type_id, SemIR::LocId loc_id, BuildDiagnosticFn diagnoser, BuildDiagnosticFn abstract_diagnoser) -> bool { if (!TypeCompleter(*this, diagnoser).Complete(type_id)) { return false; } + // For a symbolic type, create an instruction to require the corresponding + // specific type to be complete. + if (diagnoser && type_id.AsConstantId().is_symbolic()) { + // TODO: Deduplicate these. + AddInstInNoBlock(SemIR::LocIdAndInst( + loc_id, + SemIR::RequireCompleteType{ + .type_id = GetSingletonType(SemIR::WitnessType::SingletonInstId), + .complete_type_id = type_id})); + } + if (!abstract_diagnoser) { return true; } @@ -1308,9 +1320,9 @@ auto Context::TryToCompleteType(SemIR::TypeId type_id, return true; } -auto Context::TryToDefineType(SemIR::TypeId type_id, +auto Context::TryToDefineType(SemIR::TypeId type_id, SemIR::LocId loc_id, BuildDiagnosticFn diagnoser) -> bool { - if (!TryToCompleteType(type_id, diagnoser)) { + if (!TryToCompleteType(type_id, loc_id, diagnoser)) { return false; } diff --git a/toolchain/check/context.h b/toolchain/check/context.h index 436586c6def17..42c76b1f15af7 100644 --- a/toolchain/check/context.h +++ b/toolchain/check/context.h @@ -225,14 +225,14 @@ class Context { // Appends the lookup scopes corresponding to `base_const_id` to `*scopes`. // Returns `false` if not a scope. On invalid scopes, prints a diagnostic, but // still updates `*scopes` and returns `true`. - auto AppendLookupScopesForConstant(SemIRLoc loc, + auto AppendLookupScopesForConstant(SemIR::LocId loc_id, SemIR::ConstantId base_const_id, llvm::SmallVector* scopes) -> bool; // Performs a qualified name lookup in a specified scopes and in scopes that // they extend, returning the referenced instruction. - auto LookupQualifiedName(SemIRLoc loc, SemIR::NameId name_id, + auto LookupQualifiedName(SemIR::LocId loc_id, SemIR::NameId name_id, llvm::ArrayRef lookup_scopes, bool required = true, std::optional access_info = std::nullopt) @@ -344,10 +344,21 @@ class Context { // If the type is not complete, `diagnoser` is invoked to diagnose the issue, // if a `diagnoser` is provided. The builder it returns will be annotated to // describe the reason why the type is not complete. - auto TryToCompleteType(SemIR::TypeId type_id, - BuildDiagnosticFn diagnoser = nullptr, + // + // If `diagnoser` is provided, it is assumed to be an error for the type to be + // incomplete, and `diagnoser` should build an error diagnostic. If `type_id` + // is dependent, the completeness of the type will be enforced during + // monomorphization, and `loc_id` is used as the location for a diagnostic + // produced at that time. + // + // Returns `true` if the type is symbolic. + auto TryToCompleteType(SemIR::TypeId type_id, SemIR::LocId loc_id, + BuildDiagnosticFn diagnoser, BuildDiagnosticFn abstract_diagnoser = nullptr) -> bool; + auto TryToCompleteType(SemIR::TypeId type_id) -> bool { + return TryToCompleteType(type_id, SemIR::LocId::Invalid, nullptr); + } // Attempts to complete and define the type `type_id`. Returns `true` if the // type is defined, or `false` if no definition is available. A defined type @@ -355,16 +366,17 @@ class Context { // // This is the same as `TryToCompleteType` except for interfaces, which are // complete before they are fully defined. - auto TryToDefineType(SemIR::TypeId type_id, + auto TryToDefineType(SemIR::TypeId type_id, SemIR::LocId loc_id, BuildDiagnosticFn diagnoser = nullptr) -> bool; // Returns the type `type_id` as a complete type, or produces an incomplete // type error and returns an error type. This is a convenience wrapper around // TryToCompleteType. `diagnoser` must not be null. - auto AsCompleteType(SemIR::TypeId type_id, BuildDiagnosticFn diagnoser, + auto AsCompleteType(SemIR::TypeId type_id, SemIR::LocId loc_id, + BuildDiagnosticFn diagnoser, BuildDiagnosticFn abstract_diagnoser = nullptr) -> SemIR::TypeId { - return TryToCompleteType(type_id, diagnoser, abstract_diagnoser) + return TryToCompleteType(type_id, loc_id, diagnoser, abstract_diagnoser) ? type_id : SemIR::ErrorInst::SingletonTypeId; } diff --git a/toolchain/check/convert.cpp b/toolchain/check/convert.cpp index 4ee4feac54681..2658ca16bb5be 100644 --- a/toolchain/check/convert.cpp +++ b/toolchain/check/convert.cpp @@ -968,7 +968,7 @@ auto Convert(Context& context, SemIR::LocId loc_id, SemIR::InstId expr_id, // We can only perform initialization for complete types. if (!context.TryToCompleteType( - target.type_id, + target.type_id, loc_id, [&] { CARBON_CHECK(!target.is_initializer(), "Initialization of incomplete types is expected to be " diff --git a/toolchain/check/eval.cpp b/toolchain/check/eval.cpp index 62be16f00ba08..e195dca3d27b1 100644 --- a/toolchain/check/eval.cpp +++ b/toolchain/check/eval.cpp @@ -1768,6 +1768,47 @@ static auto TryEvalInstInContext(EvalContext& eval_context, return MakeConstantResult(eval_context.context(), typed_inst, phase); } + case CARBON_KIND(SemIR::RequireCompleteType require_complete): { + auto phase = Phase::Template; + auto witness_type_id = eval_context.context().GetSingletonType( + SemIR::WitnessType::SingletonInstId); + auto complete_type_id = GetConstantValue( + eval_context, require_complete.complete_type_id, &phase); + + // If the type is a template constant, require it to be complete now. + if (phase == Phase::Template) { + // No location is needed here because we know the type is not a symbolic + // constant. + complete_type_id = eval_context.context().AsCompleteType( + complete_type_id, SemIR::LocId::Invalid, [&] { + CARBON_DIAGNOSTIC(IncompleteTypeInMonomorphization, Error, + "{0} evaluates to incomplete type {1}", + SemIR::TypeId, SemIR::TypeId); + return eval_context.emitter().Build( + inst_id, IncompleteTypeInMonomorphization, + require_complete.complete_type_id, complete_type_id); + }); + if (complete_type_id == SemIR::ErrorInst::SingletonTypeId) { + return SemIR::ErrorInst::SingletonConstantId; + } + return MakeConstantResult( + eval_context.context(), + SemIR::CompleteTypeWitness{ + .type_id = witness_type_id, + .object_repr_id = + eval_context.types().GetObjectRepr(complete_type_id)}, + phase); + } + + // If it's not a template constant, require it to be complete once it + // becomes one. + return MakeConstantResult( + eval_context.context(), + SemIR::RequireCompleteType{.type_id = witness_type_id, + .complete_type_id = complete_type_id}, + phase); + } + // These cases are either not expressions or not constant. case SemIR::AddrPattern::Kind: case SemIR::Assign::Kind: diff --git a/toolchain/check/function.cpp b/toolchain/check/function.cpp index d14973408cf48..50ef2d6cc0136 100644 --- a/toolchain/check/function.cpp +++ b/toolchain/check/function.cpp @@ -65,7 +65,7 @@ auto CheckFunctionTypeMatches(Context& context, return true; } -auto CheckFunctionReturnType(Context& context, SemIRLoc loc, +auto CheckFunctionReturnType(Context& context, SemIR::LocId loc_id, SemIR::Function& function, SemIR::SpecificId specific_id) -> SemIR::ReturnTypeInfo { @@ -78,19 +78,19 @@ auto CheckFunctionReturnType(Context& context, SemIRLoc loc, auto diagnose_incomplete_return_type = [&] { CARBON_DIAGNOSTIC(IncompleteTypeInFunctionReturnType, Error, "function returns incomplete type {0}", SemIR::TypeId); - return context.emitter().Build(loc, IncompleteTypeInFunctionReturnType, + return context.emitter().Build(loc_id, IncompleteTypeInFunctionReturnType, return_info.type_id); }; auto diagnose_abstract_return_type = [&] { CARBON_DIAGNOSTIC(AbstractTypeInFunctionReturnType, Error, "function returns abstract type {0}", SemIR::TypeId); - return context.emitter().Build(loc, AbstractTypeInFunctionReturnType, + return context.emitter().Build(loc_id, AbstractTypeInFunctionReturnType, return_info.type_id); }; // TODO: Consider suppressing the diagnostic if we've already diagnosed a // definition or call to this function. - if (context.TryToCompleteType(return_info.type_id, + if (context.TryToCompleteType(return_info.type_id, loc_id, diagnose_incomplete_return_type, diagnose_abstract_return_type)) { return_info = SemIR::ReturnTypeInfo::ForFunction(context.sem_ir(), diff --git a/toolchain/check/function.h b/toolchain/check/function.h index a98199de9efad..3320bc5ffb612 100644 --- a/toolchain/check/function.h +++ b/toolchain/check/function.h @@ -39,7 +39,7 @@ auto CheckFunctionTypeMatches( // error if not. This computes the return slot usage for the function if // necessary, and returns information about how the function returns its return // value. -auto CheckFunctionReturnType(Context& context, SemIRLoc loc, +auto CheckFunctionReturnType(Context& context, SemIR::LocId loc_id, SemIR::Function& function, SemIR::SpecificId specific_id) -> SemIR::ReturnTypeInfo; diff --git a/toolchain/check/generic.cpp b/toolchain/check/generic.cpp index 3855fb25abc13..7f2c297385174 100644 --- a/toolchain/check/generic.cpp +++ b/toolchain/check/generic.cpp @@ -246,7 +246,6 @@ static auto MakeGenericEvalBlock(Context& context, SemIR::GenericId generic_id, // TODO: Eventually, completeness requirements should be modeled as // constraints on the generic rather than properties of the type. For now, // require the transformed type to be complete if the original was. - // TODO: We'll also need to do this when evaluating the eval block. if (context.types().IsComplete(inst.type_id())) { context.TryToCompleteType(type_id); } diff --git a/toolchain/check/handle_binding_pattern.cpp b/toolchain/check/handle_binding_pattern.cpp index 706cfcdd0a6d2..93ac910a31530 100644 --- a/toolchain/check/handle_binding_pattern.cpp +++ b/toolchain/check/handle_binding_pattern.cpp @@ -104,7 +104,7 @@ static auto HandleAnyBindingPattern(Context& context, Parse::NodeId node_id, // A `var` declaration at class scope introduces a field. auto parent_class_decl = context.GetCurrentScopeAs(); cast_type_id = context.AsCompleteType( - cast_type_id, + cast_type_id, type_node, [&] { CARBON_DIAGNOSTIC(IncompleteTypeInVarDecl, Error, "{0:field|variable} has incomplete type {1}", @@ -245,7 +245,7 @@ static auto HandleAnyBindingPattern(Context& context, Parse::NodeId node_id, } case Parse::NodeKind::LetIntroducer: { - cast_type_id = context.AsCompleteType(cast_type_id, [&] { + cast_type_id = context.AsCompleteType(cast_type_id, type_node, [&] { CARBON_DIAGNOSTIC(IncompleteTypeInLetDecl, Error, "`let` binding has incomplete type {0}", InstIdAsType); diff --git a/toolchain/check/handle_class.cpp b/toolchain/check/handle_class.cpp index e751b99b280f2..b60ba5b577f18 100644 --- a/toolchain/check/handle_class.cpp +++ b/toolchain/check/handle_class.cpp @@ -385,7 +385,7 @@ auto HandleParseNode(Context& context, Parse::AdaptDeclId node_id) -> bool { auto [adapted_inst_id, adapted_type_id] = ExprAsType(context, node_id, adapted_type_expr_id); adapted_type_id = context.AsCompleteType( - adapted_type_id, + adapted_type_id, node_id, [&] { CARBON_DIAGNOSTIC(IncompleteTypeInAdaptDecl, Error, "adapted type {0} is an incomplete type", @@ -457,7 +457,7 @@ static auto CheckBaseType(Context& context, Parse::NodeId node_id, SemIR::InstId base_expr_id) -> BaseInfo { auto [base_type_inst_id, base_type_id] = ExprAsType(context, node_id, base_expr_id); - base_type_id = context.AsCompleteType(base_type_id, [&] { + base_type_id = context.AsCompleteType(base_type_id, node_id, [&] { CARBON_DIAGNOSTIC(IncompleteTypeInBaseDecl, Error, "base {0} is an incomplete type", InstIdAsType); return context.emitter().Build(node_id, IncompleteTypeInBaseDecl, diff --git a/toolchain/check/handle_function.cpp b/toolchain/check/handle_function.cpp index 960f4a86865ab..9740be7dee3a4 100644 --- a/toolchain/check/handle_function.cpp +++ b/toolchain/check/handle_function.cpp @@ -331,16 +331,17 @@ auto HandleParseNode(Context& context, Parse::FunctionDeclId node_id) -> bool { static auto CheckFunctionDefinitionSignature(Context& context, SemIR::Function& function) -> void { - // Check the return type is complete. - CheckFunctionReturnType(context, function.return_slot_pattern_id, function, - SemIR::SpecificId::Invalid); - auto params_to_complete = context.inst_blocks().GetOrEmpty(function.call_params_id); + + // Check the return type is complete. if (function.return_slot_pattern_id.is_valid()) { - // Exclude the return slot because it's diagnosed above. + CheckFunctionReturnType( + context, context.insts().GetLocId(function.return_slot_pattern_id), + function, SemIR::SpecificId::Invalid); params_to_complete = params_to_complete.drop_back(); } + // Check the parameter types are complete. for (auto param_ref_id : params_to_complete) { if (param_ref_id == SemIR::ErrorInst::SingletonInstId) { @@ -349,7 +350,8 @@ static auto CheckFunctionDefinitionSignature(Context& context, // The parameter types need to be complete. context.TryToCompleteType( - context.insts().GetAs(param_ref_id).type_id, [&] { + context.insts().GetAs(param_ref_id).type_id, + context.insts().GetLocId(param_ref_id), [&] { CARBON_DIAGNOSTIC( IncompleteTypeInFunctionParam, Error, "parameter has incomplete type {0} in function definition", diff --git a/toolchain/check/handle_impl.cpp b/toolchain/check/handle_impl.cpp index 0d55083d7af94..861d15f76b07b 100644 --- a/toolchain/check/handle_impl.cpp +++ b/toolchain/check/handle_impl.cpp @@ -179,7 +179,7 @@ static auto ExtendImpl(Context& context, Parse::NodeId extend_node, parent_scope.set_has_error(); return; } - if (!context.TryToDefineType(constraint_id, [&] { + if (!context.TryToDefineType(constraint_id, node_id, [&] { CARBON_DIAGNOSTIC( ExtendUndefinedInterface, Error, "`extend impl` requires a definition for facet type {0}", diff --git a/toolchain/check/impl.cpp b/toolchain/check/impl.cpp index b4139765d4ead..2af9831853891 100644 --- a/toolchain/check/impl.cpp +++ b/toolchain/check/impl.cpp @@ -143,13 +143,15 @@ static auto BuildInterfaceWitness( // TODO: This is going to try and define all the interfaces for this facet // type, and so once we support impl of a facet type with more than one // interface, it might give the wrong name in the diagnostic. - if (!context.TryToDefineType(facet_type_id, [&] { - CARBON_DIAGNOSTIC(ImplOfUndefinedInterface, Error, - "implementation of undefined interface {0}", - SemIR::NameId); - return context.emitter().Build( - impl.definition_id, ImplOfUndefinedInterface, interface.name_id); - })) { + if (!context.TryToDefineType( + facet_type_id, context.insts().GetLocId(impl.definition_id), [&] { + CARBON_DIAGNOSTIC(ImplOfUndefinedInterface, Error, + "implementation of undefined interface {0}", + SemIR::NameId); + return context.emitter().Build(impl.definition_id, + ImplOfUndefinedInterface, + interface.name_id); + })) { return SemIR::ErrorInst::SingletonInstId; } diff --git a/toolchain/check/import_ref.cpp b/toolchain/check/import_ref.cpp index bbf8b12a6e3bc..c585ed8193595 100644 --- a/toolchain/check/import_ref.cpp +++ b/toolchain/check/import_ref.cpp @@ -2295,6 +2295,26 @@ static auto TryResolveTypedInst(ImportRefResolver& resolver, .pointee_id = pointee_type_id}); } +static auto TryResolveTypedInst(ImportRefResolver& resolver, + SemIR::RequireCompleteType inst) + -> ResolveResult { + CARBON_CHECK(resolver.import_types().GetInstId(inst.type_id) == + SemIR::WitnessType::SingletonInstId); + + auto complete_type_const_id = + GetLocalConstantId(resolver, inst.complete_type_id); + if (resolver.HasNewWork()) { + return ResolveResult::Retry(); + } + + auto complete_type_id = + resolver.local_context().GetTypeIdForTypeConstant(complete_type_const_id); + return ResolveAs( + resolver, {.type_id = resolver.local_context().GetSingletonType( + SemIR::WitnessType::SingletonInstId), + .complete_type_id = complete_type_id}); +} + static auto TryResolveTypedInst(ImportRefResolver& resolver, SemIR::SpecificFunction inst) -> ResolveResult { auto type_const_id = GetLocalConstantId(resolver, inst.type_id); @@ -2522,6 +2542,9 @@ static auto TryResolveInstCanonical(ImportRefResolver& resolver, case CARBON_KIND(SemIR::PointerType inst): { return TryResolveTypedInst(resolver, inst); } + case CARBON_KIND(SemIR::RequireCompleteType inst): { + return TryResolveTypedInst(resolver, inst); + } case CARBON_KIND(SemIR::SpecificFunction inst): { return TryResolveTypedInst(resolver, inst); } diff --git a/toolchain/check/member_access.cpp b/toolchain/check/member_access.cpp index 5ab658b946164..2128b9b802004 100644 --- a/toolchain/check/member_access.cpp +++ b/toolchain/check/member_access.cpp @@ -425,13 +425,15 @@ auto PerformMemberAccess(Context& context, SemIR::LocId loc_id, // If the base isn't a scope, it must have a complete type. auto base_type_id = context.insts().Get(base_id).type_id(); - if (!context.TryToCompleteType(base_type_id, [&] { - CARBON_DIAGNOSTIC(IncompleteTypeInMemberAccess, Error, - "member access into object of incomplete type {0}", - TypeOfInstId); - return context.emitter().Build(base_id, IncompleteTypeInMemberAccess, - base_id); - })) { + if (!context.TryToCompleteType( + base_type_id, context.insts().GetLocId(base_id), [&] { + CARBON_DIAGNOSTIC( + IncompleteTypeInMemberAccess, Error, + "member access into object of incomplete type {0}", + TypeOfInstId); + return context.emitter().Build( + base_id, IncompleteTypeInMemberAccess, base_id); + })) { return SemIR::ErrorInst::SingletonInstId; } diff --git a/toolchain/check/testdata/array/generic_empty.carbon b/toolchain/check/testdata/array/generic_empty.carbon index a2843f9ba2341..b5cb4b349da11 100644 --- a/toolchain/check/testdata/array/generic_empty.carbon +++ b/toolchain/check/testdata/array/generic_empty.carbon @@ -23,6 +23,7 @@ fn G(T:! type) { // CHECK:STDOUT: %G: %G.type = struct_value () [template] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %array_type: type = array_type %int_0, %T [symbolic] +// CHECK:STDOUT: %require_complete: = require_complete_type %array_type [symbolic] // CHECK:STDOUT: %array: %array_type = tuple_value () [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -54,6 +55,7 @@ fn G(T:! type) { // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %array_type.loc13_17.2: type = array_type constants.%int_0, @G.%T.loc11_6.2 (%T) [symbolic = %array_type.loc13_17.2 (constants.%array_type)] +// CHECK:STDOUT: %require_complete: = require_complete_type @G.%array_type.loc13_17.2 (%array_type) [symbolic = %require_complete (constants.%require_complete)] // CHECK:STDOUT: %array: @G.%array_type.loc13_17.2 (%array_type) = tuple_value () [symbolic = %array (constants.%array)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%T.param_patt: type) { diff --git a/toolchain/check/testdata/as/adapter_conversion.carbon b/toolchain/check/testdata/as/adapter_conversion.carbon index 0273e44c1a813..2cd4c50777839 100644 --- a/toolchain/check/testdata/as/adapter_conversion.carbon +++ b/toolchain/check/testdata/as/adapter_conversion.carbon @@ -117,7 +117,7 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: %Make.type: type = fn_type @Make [template] // CHECK:STDOUT: %Make: %Make.type = struct_value () [template] // CHECK:STDOUT: %struct_type.x.y.1: type = struct_type {.x: %i32, .y: %i32} [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.x.y.1 [template] +// CHECK:STDOUT: %complete_type.1: = complete_type_witness %struct_type.x.y.1 [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %struct_type.x.y.2: type = struct_type {.x: Core.IntLiteral, .y: Core.IntLiteral} [template] @@ -190,7 +190,7 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: %return.param: ref %A = out_param runtime_param0 // CHECK:STDOUT: %return: ref %A = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.x.y.1 [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.x.y.1 [template = constants.%complete_type.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%A @@ -203,7 +203,7 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: class @B { // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%A] // CHECK:STDOUT: adapt_decl %A.ref [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.x.y.1 [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.x.y.1 [template = constants.%complete_type.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%B @@ -289,7 +289,7 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: %Int.type: type = fn_type @Int [template] // CHECK:STDOUT: %Int: %Int.type = struct_value () [template] // CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %i32 [template] +// CHECK:STDOUT: %complete_type.1: = complete_type_witness %i32 [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @As(%i32) [template] // CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.7, @impl.5(%int_32) [template] @@ -331,7 +331,7 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: %.loc5_12.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] // CHECK:STDOUT: %.loc5_12.2: type = converted %int.make_type_signed, %.loc5_12.1 [template = constants.%i32] // CHECK:STDOUT: adapt_decl %.loc5_12.2 [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %i32 [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %i32 [template = constants.%complete_type.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%A @@ -464,7 +464,7 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] // CHECK:STDOUT: %A.elem: type = unbound_element_type %A, %i32 [template] // CHECK:STDOUT: %struct_type.x.y.1: type = struct_type {.x: %i32, .y: %i32} [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.x.y.1 [template] +// CHECK:STDOUT: %complete_type.1: = complete_type_witness %struct_type.x.y.1 [template] // CHECK:STDOUT: %B: type = class_type @B [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] @@ -519,7 +519,7 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: %.loc6_10.1: type = value_of_initializer %int.make_type_signed.loc6 [template = constants.%i32] // CHECK:STDOUT: %.loc6_10.2: type = converted %int.make_type_signed.loc6, %.loc6_10.1 [template = constants.%i32] // CHECK:STDOUT: %.loc6_8: %A.elem = field_decl y, element1 [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.x.y.1 [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.x.y.1 [template = constants.%complete_type.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%A @@ -531,7 +531,7 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: class @B { // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%A] // CHECK:STDOUT: adapt_decl %A.ref [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.x.y.1 [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.x.y.1 [template = constants.%complete_type.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%B diff --git a/toolchain/check/testdata/as/overloaded.carbon b/toolchain/check/testdata/as/overloaded.carbon index d5b01468e613e..a831731d918c5 100644 --- a/toolchain/check/testdata/as/overloaded.carbon +++ b/toolchain/check/testdata/as/overloaded.carbon @@ -32,7 +32,7 @@ let n: i32 = ((4 as i32) as X) as i32; // CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] // CHECK:STDOUT: %X.elem: type = unbound_element_type %X, %i32 [template] // CHECK:STDOUT: %struct_type.n: type = struct_type {.n: %i32} [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.n [template] +// CHECK:STDOUT: %complete_type.1: = complete_type_witness %struct_type.n [template] // CHECK:STDOUT: %As.type.1: type = generic_interface_type @As [template] // CHECK:STDOUT: %As.generic: %As.type.1 = struct_value () [template] // CHECK:STDOUT: %As.type.3: type = facet_type <@As, @As(%X)> [template] @@ -153,7 +153,7 @@ let n: i32 = ((4 as i32) as X) as i32; // CHECK:STDOUT: %.loc12_10.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] // CHECK:STDOUT: %.loc12_10.2: type = converted %int.make_type_signed, %.loc12_10.1 [template = constants.%i32] // CHECK:STDOUT: %.loc12_8: %X.elem = field_decl n, element0 [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.n [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.n [template = constants.%complete_type.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%X diff --git a/toolchain/check/testdata/basics/no_prelude/raw_ir.carbon b/toolchain/check/testdata/basics/no_prelude/raw_ir.carbon index b9a88d94862b1..6eead5ca98af2 100644 --- a/toolchain/check/testdata/basics/no_prelude/raw_ir.carbon +++ b/toolchain/check/testdata/basics/no_prelude/raw_ir.carbon @@ -45,6 +45,7 @@ fn Foo[T:! type](n: T) -> (T, ()) { // CHECK:STDOUT: 'type(symbolic_constant0)': {kind: copy, type: type(symbolic_constant0)} // CHECK:STDOUT: 'type(symbolic_constant2)': {kind: pointer, type: type(symbolic_constant6)} // CHECK:STDOUT: 'type(symbolic_constant6)': {kind: copy, type: type(symbolic_constant6)} +// CHECK:STDOUT: 'type(inst(WitnessType))': {kind: copy, type: type(inst(WitnessType))} // CHECK:STDOUT: 'type(symbolic_constant3)': {kind: copy, type: type(symbolic_constant3)} // CHECK:STDOUT: 'type(symbolic_constant5)': {kind: pointer, type: type(symbolic_constant6)} // CHECK:STDOUT: type_blocks: @@ -90,18 +91,26 @@ fn Foo[T:! type](n: T) -> (T, ()) { // CHECK:STDOUT: inst40: {kind: FunctionType, arg0: function0, arg1: specific, type: type(TypeType)} // CHECK:STDOUT: inst41: {kind: StructValue, arg0: inst_block_empty, type: type(inst40)} // CHECK:STDOUT: inst42: {kind: PointerType, arg0: type(symbolic_constant2), type: type(TypeType)} -// CHECK:STDOUT: inst43: {kind: NameRef, arg0: name2, arg1: inst19, type: type(symbolic_constant3)} -// CHECK:STDOUT: inst44: {kind: TupleLiteral, arg0: inst_block_empty, type: type(inst23)} -// CHECK:STDOUT: inst45: {kind: TupleLiteral, arg0: inst_block15, type: type(symbolic_constant5)} -// CHECK:STDOUT: inst46: {kind: TupleAccess, arg0: inst35, arg1: element0, type: type(symbolic_constant3)} -// CHECK:STDOUT: inst47: {kind: InitializeFrom, arg0: inst43, arg1: inst46, type: type(symbolic_constant3)} -// CHECK:STDOUT: inst48: {kind: TupleAccess, arg0: inst35, arg1: element1, type: type(inst23)} -// CHECK:STDOUT: inst49: {kind: TupleInit, arg0: inst_block_empty, arg1: inst48, type: type(inst23)} -// CHECK:STDOUT: inst50: {kind: TupleValue, arg0: inst_block_empty, type: type(inst23)} -// CHECK:STDOUT: inst51: {kind: Converted, arg0: inst44, arg1: inst49, type: type(inst23)} -// CHECK:STDOUT: inst52: {kind: TupleInit, arg0: inst_block16, arg1: inst35, type: type(symbolic_constant5)} -// CHECK:STDOUT: inst53: {kind: Converted, arg0: inst45, arg1: inst52, type: type(symbolic_constant5)} -// CHECK:STDOUT: inst54: {kind: ReturnExpr, arg0: inst53, arg1: inst35} +// CHECK:STDOUT: inst43: {kind: RequireCompleteType, arg0: type(symbolic_constant2), type: type(inst(WitnessType))} +// CHECK:STDOUT: inst44: {kind: RequireCompleteType, arg0: type(symbolic_constant2), type: type(inst(WitnessType))} +// CHECK:STDOUT: inst45: {kind: RequireCompleteType, arg0: type(symbolic_constant3), type: type(inst(WitnessType))} +// CHECK:STDOUT: inst46: {kind: RequireCompleteType, arg0: type(symbolic_constant0), type: type(inst(WitnessType))} +// CHECK:STDOUT: inst47: {kind: NameRef, arg0: name2, arg1: inst19, type: type(symbolic_constant3)} +// CHECK:STDOUT: inst48: {kind: TupleLiteral, arg0: inst_block_empty, type: type(inst23)} +// CHECK:STDOUT: inst49: {kind: TupleLiteral, arg0: inst_block15, type: type(symbolic_constant5)} +// CHECK:STDOUT: inst50: {kind: RequireCompleteType, arg0: type(symbolic_constant5), type: type(inst(WitnessType))} +// CHECK:STDOUT: inst51: {kind: TupleAccess, arg0: inst35, arg1: element0, type: type(symbolic_constant3)} +// CHECK:STDOUT: inst52: {kind: RequireCompleteType, arg0: type(symbolic_constant0), type: type(inst(WitnessType))} +// CHECK:STDOUT: inst53: {kind: InitializeFrom, arg0: inst47, arg1: inst51, type: type(symbolic_constant3)} +// CHECK:STDOUT: inst54: {kind: TupleAccess, arg0: inst35, arg1: element1, type: type(inst23)} +// CHECK:STDOUT: inst55: {kind: TupleInit, arg0: inst_block_empty, arg1: inst54, type: type(inst23)} +// CHECK:STDOUT: inst56: {kind: TupleValue, arg0: inst_block_empty, type: type(inst23)} +// CHECK:STDOUT: inst57: {kind: Converted, arg0: inst48, arg1: inst55, type: type(inst23)} +// CHECK:STDOUT: inst58: {kind: TupleInit, arg0: inst_block16, arg1: inst35, type: type(symbolic_constant5)} +// CHECK:STDOUT: inst59: {kind: Converted, arg0: inst49, arg1: inst58, type: type(symbolic_constant5)} +// CHECK:STDOUT: inst60: {kind: ReturnExpr, arg0: inst59, arg1: inst35} +// CHECK:STDOUT: inst61: {kind: RequireCompleteType, arg0: type(symbolic_constant5), type: type(inst(WitnessType))} +// CHECK:STDOUT: inst62: {kind: RequireCompleteType, arg0: type(symbolic_constant3), type: type(inst(WitnessType))} // CHECK:STDOUT: constant_values: // CHECK:STDOUT: inst12: template_constant(inst12) // CHECK:STDOUT: inst13: symbolic_constant3 @@ -123,9 +132,17 @@ fn Foo[T:! type](n: T) -> (T, ()) { // CHECK:STDOUT: inst40: template_constant(inst40) // CHECK:STDOUT: inst41: template_constant(inst41) // CHECK:STDOUT: inst42: symbolic_constant6 -// CHECK:STDOUT: inst49: template_constant(inst50) -// CHECK:STDOUT: inst50: template_constant(inst50) -// CHECK:STDOUT: inst51: template_constant(inst50) +// CHECK:STDOUT: inst43: symbolic_constant9 +// CHECK:STDOUT: inst44: symbolic_constant7 +// CHECK:STDOUT: inst45: symbolic_constant10 +// CHECK:STDOUT: inst46: symbolic_constant8 +// CHECK:STDOUT: inst50: symbolic_constant9 +// CHECK:STDOUT: inst52: symbolic_constant10 +// CHECK:STDOUT: inst55: template_constant(inst56) +// CHECK:STDOUT: inst56: template_constant(inst56) +// CHECK:STDOUT: inst57: template_constant(inst56) +// CHECK:STDOUT: inst61: symbolic_constant9 +// CHECK:STDOUT: inst62: symbolic_constant10 // CHECK:STDOUT: symbolic_constants: // CHECK:STDOUT: symbolic_constant0: {inst: inst14, generic: generic, index: generic_inst, .Self: false} // CHECK:STDOUT: symbolic_constant1: {inst: inst16, generic: generic, index: generic_inst, .Self: false} @@ -134,6 +151,10 @@ fn Foo[T:! type](n: T) -> (T, ()) { // CHECK:STDOUT: symbolic_constant4: {inst: inst16, generic: generic0, index: generic_inst_in_decl1, .Self: false} // CHECK:STDOUT: symbolic_constant5: {inst: inst28, generic: generic0, index: generic_inst_in_decl2, .Self: false} // CHECK:STDOUT: symbolic_constant6: {inst: inst42, generic: generic, index: generic_inst, .Self: false} +// CHECK:STDOUT: symbolic_constant7: {inst: inst44, generic: generic, index: generic_inst, .Self: false} +// CHECK:STDOUT: symbolic_constant8: {inst: inst46, generic: generic, index: generic_inst, .Self: false} +// CHECK:STDOUT: symbolic_constant9: {inst: inst44, generic: generic0, index: generic_inst_in_def0, .Self: false} +// CHECK:STDOUT: symbolic_constant10: {inst: inst46, generic: generic0, index: generic_inst_in_def1, .Self: false} // CHECK:STDOUT: inst_blocks: // CHECK:STDOUT: inst_block_empty: {} // CHECK:STDOUT: exports: @@ -183,24 +204,27 @@ fn Foo[T:! type](n: T) -> (T, ()) { // CHECK:STDOUT: 1: inst14 // CHECK:STDOUT: 2: inst28 // CHECK:STDOUT: inst_block14: -// CHECK:STDOUT: 0: inst43 -// CHECK:STDOUT: 1: inst44 -// CHECK:STDOUT: 2: inst45 -// CHECK:STDOUT: 3: inst46 -// CHECK:STDOUT: 4: inst47 -// CHECK:STDOUT: 5: inst48 -// CHECK:STDOUT: 6: inst49 -// CHECK:STDOUT: 7: inst51 -// CHECK:STDOUT: 8: inst52 -// CHECK:STDOUT: 9: inst53 -// CHECK:STDOUT: 10: inst54 +// CHECK:STDOUT: 0: inst47 +// CHECK:STDOUT: 1: inst48 +// CHECK:STDOUT: 2: inst49 +// CHECK:STDOUT: 3: inst51 +// CHECK:STDOUT: 4: inst53 +// CHECK:STDOUT: 5: inst54 +// CHECK:STDOUT: 6: inst55 +// CHECK:STDOUT: 7: inst57 +// CHECK:STDOUT: 8: inst58 +// CHECK:STDOUT: 9: inst59 +// CHECK:STDOUT: 10: inst60 // CHECK:STDOUT: inst_block15: -// CHECK:STDOUT: 0: inst43 -// CHECK:STDOUT: 1: inst44 -// CHECK:STDOUT: inst_block16: // CHECK:STDOUT: 0: inst47 -// CHECK:STDOUT: 1: inst51 +// CHECK:STDOUT: 1: inst48 +// CHECK:STDOUT: inst_block16: +// CHECK:STDOUT: 0: inst53 +// CHECK:STDOUT: 1: inst57 // CHECK:STDOUT: inst_block17: +// CHECK:STDOUT: 0: inst61 +// CHECK:STDOUT: 1: inst62 +// CHECK:STDOUT: inst_block18: // CHECK:STDOUT: 0: inst12 // CHECK:STDOUT: 1: inst36 // CHECK:STDOUT: ... diff --git a/toolchain/check/testdata/builtins/int/eq.carbon b/toolchain/check/testdata/builtins/int/eq.carbon index e6439e699f97b..1859c8b8718fd 100644 --- a/toolchain/check/testdata/builtins/int/eq.carbon +++ b/toolchain/check/testdata/builtins/int/eq.carbon @@ -46,7 +46,7 @@ fn WrongResult(a: i32, b: i32) -> i32 = "int.eq"; // CHECK:STDOUT: %Eq: %Eq.type = struct_value () [template] // CHECK:STDOUT: %True: type = class_type @True [template] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %complete_type.1: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %False: type = class_type @False [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] @@ -158,7 +158,7 @@ fn WrongResult(a: i32, b: i32) -> i32 = "int.eq"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @True { -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%True @@ -166,7 +166,7 @@ fn WrongResult(a: i32, b: i32) -> i32 = "int.eq"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @False { -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%False diff --git a/toolchain/check/testdata/builtins/int/greater.carbon b/toolchain/check/testdata/builtins/int/greater.carbon index efdf91f164f12..1424735e65d22 100644 --- a/toolchain/check/testdata/builtins/int/greater.carbon +++ b/toolchain/check/testdata/builtins/int/greater.carbon @@ -43,7 +43,7 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %Negate: %Negate.type = struct_value () [template] // CHECK:STDOUT: %True: type = class_type @True [template] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %complete_type.1: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %False: type = class_type @False [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] @@ -180,7 +180,7 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @True { -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%True @@ -188,7 +188,7 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @False { -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%False diff --git a/toolchain/check/testdata/builtins/int/greater_eq.carbon b/toolchain/check/testdata/builtins/int/greater_eq.carbon index ae9b5ff0d4a78..834e7811de0a6 100644 --- a/toolchain/check/testdata/builtins/int/greater_eq.carbon +++ b/toolchain/check/testdata/builtins/int/greater_eq.carbon @@ -43,7 +43,7 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %Negate: %Negate.type = struct_value () [template] // CHECK:STDOUT: %True: type = class_type @True [template] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %complete_type.1: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %False: type = class_type @False [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] @@ -180,7 +180,7 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @True { -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%True @@ -188,7 +188,7 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @False { -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%False diff --git a/toolchain/check/testdata/builtins/int/less.carbon b/toolchain/check/testdata/builtins/int/less.carbon index c4c683dc10509..d5abc7671e309 100644 --- a/toolchain/check/testdata/builtins/int/less.carbon +++ b/toolchain/check/testdata/builtins/int/less.carbon @@ -43,7 +43,7 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %Negate: %Negate.type = struct_value () [template] // CHECK:STDOUT: %True: type = class_type @True [template] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %complete_type.1: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %False: type = class_type @False [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] @@ -180,7 +180,7 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @True { -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%True @@ -188,7 +188,7 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @False { -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%False diff --git a/toolchain/check/testdata/builtins/int/less_eq.carbon b/toolchain/check/testdata/builtins/int/less_eq.carbon index 70c317b5007c3..87f787350caf4 100644 --- a/toolchain/check/testdata/builtins/int/less_eq.carbon +++ b/toolchain/check/testdata/builtins/int/less_eq.carbon @@ -43,7 +43,7 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %Negate: %Negate.type = struct_value () [template] // CHECK:STDOUT: %True: type = class_type @True [template] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %complete_type.1: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %False: type = class_type @False [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] @@ -180,7 +180,7 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @True { -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%True @@ -188,7 +188,7 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @False { -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%False diff --git a/toolchain/check/testdata/builtins/int/make_type_signed.carbon b/toolchain/check/testdata/builtins/int/make_type_signed.carbon index 5609130800a06..cd8315d1700e7 100644 --- a/toolchain/check/testdata/builtins/int/make_type_signed.carbon +++ b/toolchain/check/testdata/builtins/int/make_type_signed.carbon @@ -160,6 +160,7 @@ var m: Int(1000000000); // CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic] // CHECK:STDOUT: %Symbolic.type: type = fn_type @Symbolic [template] // CHECK:STDOUT: %Symbolic: %Symbolic.type = struct_value () [template] +// CHECK:STDOUT: %require_complete: = require_complete_type %iN [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -277,6 +278,7 @@ var m: Int(1000000000); // CHECK:STDOUT: %iN: type = int_type signed, %N.loc14_13.2 [symbolic = %iN (constants.%iN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete: = require_complete_type @Symbolic.%iN (%iN) [symbolic = %require_complete (constants.%require_complete)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%N.param_patt: Core.IntLiteral, %x.param_patt: @Symbolic.%iN (%iN)) -> @Symbolic.%iN (%iN) { // CHECK:STDOUT: !entry: @@ -317,7 +319,9 @@ var m: Int(1000000000); // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] // CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic] // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic] +// CHECK:STDOUT: %require_complete: = require_complete_type %iN [symbolic] // CHECK:STDOUT: %Symbolic.specific_fn: = specific_function %Symbolic, @Symbolic(%int_24) [template] +// CHECK:STDOUT: %complete_type: = complete_type_witness %i24 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -455,6 +459,7 @@ var m: Int(1000000000); // CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete: = require_complete_type @Symbolic.%iN (%iN) [symbolic = %require_complete (constants.%require_complete)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%N.param_patt: Core.IntLiteral, %x.param_patt: @Symbolic.%iN (%iN)) -> @Symbolic.%iN (%iN); // CHECK:STDOUT: } @@ -471,6 +476,7 @@ var m: Int(1000000000); // CHECK:STDOUT: %iN => constants.%i24 // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete => constants.%complete_type // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_zero_size.carbon diff --git a/toolchain/check/testdata/builtins/int/make_type_unsigned.carbon b/toolchain/check/testdata/builtins/int/make_type_unsigned.carbon index b1a9d7c491713..71f18dc5f50e4 100644 --- a/toolchain/check/testdata/builtins/int/make_type_unsigned.carbon +++ b/toolchain/check/testdata/builtins/int/make_type_unsigned.carbon @@ -141,6 +141,7 @@ var m: UInt(1000000000); // CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic] // CHECK:STDOUT: %Symbolic.type: type = fn_type @Symbolic [template] // CHECK:STDOUT: %Symbolic: %Symbolic.type = struct_value () [template] +// CHECK:STDOUT: %require_complete: = require_complete_type %uN [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -258,6 +259,7 @@ var m: UInt(1000000000); // CHECK:STDOUT: %uN: type = int_type unsigned, %N.loc14_13.2 [symbolic = %uN (constants.%uN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete: = require_complete_type @Symbolic.%uN (%uN) [symbolic = %require_complete (constants.%require_complete)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%N.param_patt: Core.IntLiteral, %x.param_patt: @Symbolic.%uN (%uN)) -> @Symbolic.%uN (%uN) { // CHECK:STDOUT: !entry: diff --git a/toolchain/check/testdata/builtins/int/neq.carbon b/toolchain/check/testdata/builtins/int/neq.carbon index 6118640a869a6..61fde3f19eb2a 100644 --- a/toolchain/check/testdata/builtins/int/neq.carbon +++ b/toolchain/check/testdata/builtins/int/neq.carbon @@ -37,7 +37,7 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %Neq: %Neq.type = struct_value () [template] // CHECK:STDOUT: %True: type = class_type @True [template] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %complete_type.1: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %False: type = class_type @False [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] @@ -149,7 +149,7 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @True { -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%True @@ -157,7 +157,7 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @False { -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%False diff --git a/toolchain/check/testdata/class/access_modifers.carbon b/toolchain/check/testdata/class/access_modifers.carbon index 67efd1011a2ed..f4e0fbf4cd241 100644 --- a/toolchain/check/testdata/class/access_modifers.carbon +++ b/toolchain/check/testdata/class/access_modifers.carbon @@ -167,7 +167,7 @@ class A { // CHECK:STDOUT: %Make.type: type = fn_type @Make [template] // CHECK:STDOUT: %Make: %Make.type = struct_value () [template] // CHECK:STDOUT: %struct_type.radius.1: type = struct_type {.radius: %i32} [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.radius.1 [template] +// CHECK:STDOUT: %complete_type.3: = complete_type_witness %struct_type.radius.1 [template] // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %Convert.bound.2: = bound_method %int_0.1, %Convert.14 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] @@ -235,7 +235,7 @@ class A { // CHECK:STDOUT: %return.param: ref %Circle = out_param runtime_param0 // CHECK:STDOUT: %return: ref %Circle = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.radius.1 [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.radius.1 [template = constants.%complete_type.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Circle @@ -378,7 +378,7 @@ class A { // CHECK:STDOUT: %Compute.type: type = fn_type @Compute [template] // CHECK:STDOUT: %Compute: %Compute.type = struct_value () [template] // CHECK:STDOUT: %struct_type.radius: type = struct_type {.radius: %i32} [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.radius [template] +// CHECK:STDOUT: %complete_type.1: = complete_type_witness %struct_type.radius [template] // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] @@ -456,7 +456,7 @@ class A { // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.radius [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.radius [template = constants.%complete_type.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Circle @@ -515,7 +515,7 @@ class A { // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_5.2: %i32 = int_value 5 [template] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %complete_type.3: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -554,7 +554,7 @@ class A { // CHECK:STDOUT: %.loc5_17.1: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_5.2] // CHECK:STDOUT: %.loc5_17.2: %i32 = converted %int_5, %.loc5_17.1 [template = constants.%int_5.2] // CHECK:STDOUT: %x: %i32 = bind_name x, %.loc5_17.2 -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%A @@ -587,7 +587,7 @@ class A { // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_5.2: %i32 = int_value 5 [template] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %complete_type.3: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -643,7 +643,7 @@ class A { // CHECK:STDOUT: %.loc6_25.1: %i32 = value_of_initializer %int.convert_checked.loc6 [template = constants.%int_5.2] // CHECK:STDOUT: %.loc6_25.2: %i32 = converted %int_5.loc6, %.loc6_25.1 [template = constants.%int_5.2] // CHECK:STDOUT: %y: %i32 = bind_name y, %.loc6_25.2 -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%A diff --git a/toolchain/check/testdata/class/adapter/init_adapt.carbon b/toolchain/check/testdata/class/adapter/init_adapt.carbon index 9d0e1a9cb89c2..3f29fae62ba26 100644 --- a/toolchain/check/testdata/class/adapter/init_adapt.carbon +++ b/toolchain/check/testdata/class/adapter/init_adapt.carbon @@ -101,7 +101,7 @@ var e: C = MakeAdaptC(); // CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] // CHECK:STDOUT: %C.elem: type = unbound_element_type %C, %i32 [template] // CHECK:STDOUT: %struct_type.a.b.1: type = struct_type {.a: %i32, .b: %i32} [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a.b.1 [template] +// CHECK:STDOUT: %complete_type.1: = complete_type_witness %struct_type.a.b.1 [template] // CHECK:STDOUT: %AdaptC: type = class_type @AdaptC [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] @@ -186,7 +186,7 @@ var e: C = MakeAdaptC(); // CHECK:STDOUT: %.loc6_10.1: type = value_of_initializer %int.make_type_signed.loc6 [template = constants.%i32] // CHECK:STDOUT: %.loc6_10.2: type = converted %int.make_type_signed.loc6, %.loc6_10.1 [template = constants.%i32] // CHECK:STDOUT: %.loc6_8: %C.elem = field_decl b, element1 [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a.b.1 [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a.b.1 [template = constants.%complete_type.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C @@ -198,7 +198,7 @@ var e: C = MakeAdaptC(); // CHECK:STDOUT: class @AdaptC { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: adapt_decl %C.ref [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a.b.1 [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a.b.1 [template = constants.%complete_type.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%AdaptC @@ -271,7 +271,7 @@ var e: C = MakeAdaptC(); // CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] // CHECK:STDOUT: %C.elem: type = unbound_element_type %C, %i32 [template] // CHECK:STDOUT: %struct_type.a.b.1: type = struct_type {.a: %i32, .b: %i32} [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a.b.1 [template] +// CHECK:STDOUT: %complete_type.1: = complete_type_witness %struct_type.a.b.1 [template] // CHECK:STDOUT: %AdaptC: type = class_type @AdaptC [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] @@ -356,7 +356,7 @@ var e: C = MakeAdaptC(); // CHECK:STDOUT: %.loc6_10.1: type = value_of_initializer %int.make_type_signed.loc6 [template = constants.%i32] // CHECK:STDOUT: %.loc6_10.2: type = converted %int.make_type_signed.loc6, %.loc6_10.1 [template = constants.%i32] // CHECK:STDOUT: %.loc6_8: %C.elem = field_decl b, element1 [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a.b.1 [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a.b.1 [template = constants.%complete_type.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C @@ -368,7 +368,7 @@ var e: C = MakeAdaptC(); // CHECK:STDOUT: class @AdaptC { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: adapt_decl %C.ref [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a.b.1 [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a.b.1 [template = constants.%complete_type.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%AdaptC diff --git a/toolchain/check/testdata/class/base_method.carbon b/toolchain/check/testdata/class/base_method.carbon index f72f7dedc6a41..b2907d2d4fade 100644 --- a/toolchain/check/testdata/class/base_method.carbon +++ b/toolchain/check/testdata/class/base_method.carbon @@ -52,7 +52,7 @@ fn Call(p: Derived*) { // CHECK:STDOUT: %Derived: type = class_type @Derived [template] // CHECK:STDOUT: %Derived.elem: type = unbound_element_type %Derived, %Base [template] // CHECK:STDOUT: %struct_type.base.1: type = struct_type {.base: %Base} [template] -// CHECK:STDOUT: %complete_type.2: = complete_type_witness %struct_type.base.1 [template] +// CHECK:STDOUT: %complete_type.4: = complete_type_witness %struct_type.base.1 [template] // CHECK:STDOUT: %ptr.3: type = ptr_type %Derived [template] // CHECK:STDOUT: %Call.type: type = fn_type @Call [template] // CHECK:STDOUT: %Call: %Call.type = struct_value () [template] @@ -126,7 +126,7 @@ fn Call(p: Derived*) { // CHECK:STDOUT: class @Derived { // CHECK:STDOUT: %Base.ref: type = name_ref Base, file.%Base.decl [template = constants.%Base] // CHECK:STDOUT: %.loc22: %Derived.elem = base_decl %Base.ref, element0 [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.base.1 [template = constants.%complete_type.2] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.base.1 [template = constants.%complete_type.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Derived diff --git a/toolchain/check/testdata/class/basic.carbon b/toolchain/check/testdata/class/basic.carbon index 10c2ac6cd4ac4..0eee260bce2bb 100644 --- a/toolchain/check/testdata/class/basic.carbon +++ b/toolchain/check/testdata/class/basic.carbon @@ -40,7 +40,7 @@ fn Run() -> i32 { // CHECK:STDOUT: %G: %G.type = struct_value () [template] // CHECK:STDOUT: %Class.elem: type = unbound_element_type %Class, %i32 [template] // CHECK:STDOUT: %struct_type.k: type = struct_type {.k: %i32} [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.k [template] +// CHECK:STDOUT: %complete_type.1: = complete_type_witness %struct_type.k [template] // CHECK:STDOUT: %Run.type: type = fn_type @Run [template] // CHECK:STDOUT: %Run: %Run.type = struct_value () [template] // CHECK:STDOUT: %int_4.1: Core.IntLiteral = int_value 4 [template] @@ -150,7 +150,7 @@ fn Run() -> i32 { // CHECK:STDOUT: %.loc18_10.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] // CHECK:STDOUT: %.loc18_10.2: type = converted %int.make_type_signed, %.loc18_10.1 [template = constants.%i32] // CHECK:STDOUT: %.loc18_8: %Class.elem = field_decl k, element0 [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.k [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.k [template = constants.%complete_type.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class diff --git a/toolchain/check/testdata/class/fail_abstract.carbon b/toolchain/check/testdata/class/fail_abstract.carbon index a977a81a36cfc..410dcef16b33c 100644 --- a/toolchain/check/testdata/class/fail_abstract.carbon +++ b/toolchain/check/testdata/class/fail_abstract.carbon @@ -178,7 +178,7 @@ fn ReturnAbstract() -> Abstract; fn CallReturnAbstract() { // CHECK:STDERR: fail_call_abstract_return.carbon:[[@LINE+9]]:3: error: function returns abstract type `Abstract` [AbstractTypeInFunctionReturnType] // CHECK:STDERR: ReturnAbstract(); - // CHECK:STDERR: ^~~~~~~~~~~~~~ + // CHECK:STDERR: ^~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_call_abstract_return.carbon:[[@LINE-9]]:1: note: class was declared abstract here [ClassAbstractHere] // CHECK:STDERR: abstract class Abstract { // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/toolchain/check/testdata/class/fail_field_modifiers.carbon b/toolchain/check/testdata/class/fail_field_modifiers.carbon index 9008ecd88dc09..9277231dc92a9 100644 --- a/toolchain/check/testdata/class/fail_field_modifiers.carbon +++ b/toolchain/check/testdata/class/fail_field_modifiers.carbon @@ -56,7 +56,7 @@ class Class { // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] // CHECK:STDOUT: %struct_type.j.k: type = struct_type {.j: %i32, .k: %i32} [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.j.k [template] +// CHECK:STDOUT: %complete_type.3: = complete_type_witness %struct_type.j.k [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -112,7 +112,7 @@ class Class { // CHECK:STDOUT: %.loc34_23.1: %i32 = value_of_initializer %int.convert_checked.loc34 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc34_23.2: %i32 = converted %int_1, %.loc34_23.1 [template = constants.%int_1.2] // CHECK:STDOUT: %m: %i32 = bind_name m, %.loc34_23.2 -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.j.k [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.j.k [template = constants.%complete_type.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class diff --git a/toolchain/check/testdata/class/fail_generic_method.carbon b/toolchain/check/testdata/class/fail_generic_method.carbon index 8b85b0ac647c9..699ee973995c6 100644 --- a/toolchain/check/testdata/class/fail_generic_method.carbon +++ b/toolchain/check/testdata/class/fail_generic_method.carbon @@ -39,6 +39,7 @@ fn Class(N:! i32).F[self: Self](n: T) {} // CHECK:STDOUT: %Class.type: type = generic_class_type @Class [template] // CHECK:STDOUT: %Class.generic: %Class.type = struct_value () [template] // CHECK:STDOUT: %Class: type = class_type @Class, @Class(%T) [symbolic] +// CHECK:STDOUT: %require_complete: = require_complete_type %T [symbolic] // CHECK:STDOUT: %Class.elem: type = unbound_element_type %Class, %T [symbolic] // CHECK:STDOUT: %F.type: type = fn_type @F, @Class(%T) [symbolic] // CHECK:STDOUT: %F: %F.type = struct_value () [symbolic] @@ -101,6 +102,7 @@ fn Class(N:! i32).F[self: Self](n: T) {} // CHECK:STDOUT: %T.patt.loc11_13.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc11_13.2 (constants.%T.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete: = require_complete_type @Class.%T.loc11_13.2 (%T) [symbolic = %require_complete (constants.%require_complete)] // CHECK:STDOUT: %Class: type = class_type @Class, @Class(%T.loc11_13.2) [symbolic = %Class (constants.%Class)] // CHECK:STDOUT: %Class.elem: type = unbound_element_type @Class.%Class (%Class), @Class.%T.loc11_13.2 (%T) [symbolic = %Class.elem (constants.%Class.elem)] // CHECK:STDOUT: %F.type: type = fn_type @F, @Class(%T.loc11_13.2) [symbolic = %F.type (constants.%F.type)] diff --git a/toolchain/check/testdata/class/fail_incomplete.carbon b/toolchain/check/testdata/class/fail_incomplete.carbon index 9dac1fc844dbd..b21382bba518c 100644 --- a/toolchain/check/testdata/class/fail_incomplete.carbon +++ b/toolchain/check/testdata/class/fail_incomplete.carbon @@ -129,7 +129,7 @@ fn CallTakeIncomplete(p: Class*) { fn CallReturnIncomplete() { // CHECK:STDERR: fail_forward_decl.carbon:[[@LINE+10]]:3: error: function returns incomplete type `Class` [IncompleteTypeInFunctionReturnType] // CHECK:STDERR: ReturnIncomplete(); - // CHECK:STDERR: ^~~~~~~~~~~~~~~~ + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_forward_decl.carbon:[[@LINE-118]]:1: note: class was forward declared here [ClassForwardDeclaredHere] // CHECK:STDERR: class Class; // CHECK:STDERR: ^~~~~~~~~~~~ diff --git a/toolchain/check/testdata/class/fail_init.carbon b/toolchain/check/testdata/class/fail_init.carbon index f03a06948cded..461a2839c8733 100644 --- a/toolchain/check/testdata/class/fail_init.carbon +++ b/toolchain/check/testdata/class/fail_init.carbon @@ -40,7 +40,7 @@ fn F() { // CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] // CHECK:STDOUT: %Class.elem: type = unbound_element_type %Class, %i32 [template] // CHECK:STDOUT: %struct_type.a.b: type = struct_type {.a: %i32, .b: %i32} [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a.b [template] +// CHECK:STDOUT: %complete_type.1: = complete_type_witness %struct_type.a.b [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] @@ -89,7 +89,7 @@ fn F() { // CHECK:STDOUT: %.loc13_10.1: type = value_of_initializer %int.make_type_signed.loc13 [template = constants.%i32] // CHECK:STDOUT: %.loc13_10.2: type = converted %int.make_type_signed.loc13, %.loc13_10.1 [template = constants.%i32] // CHECK:STDOUT: %.loc13_8: %Class.elem = field_decl b, element1 [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a.b [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a.b [template = constants.%complete_type.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class diff --git a/toolchain/check/testdata/class/fail_init_as_inplace.carbon b/toolchain/check/testdata/class/fail_init_as_inplace.carbon index 8d4fcb5cdcf13..85d03a93dba8d 100644 --- a/toolchain/check/testdata/class/fail_init_as_inplace.carbon +++ b/toolchain/check/testdata/class/fail_init_as_inplace.carbon @@ -37,7 +37,7 @@ fn F() { // CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] // CHECK:STDOUT: %Class.elem: type = unbound_element_type %Class, %i32 [template] // CHECK:STDOUT: %struct_type.a.b.1: type = struct_type {.a: %i32, .b: %i32} [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a.b.1 [template] +// CHECK:STDOUT: %complete_type.1: = complete_type_witness %struct_type.a.b.1 [template] // CHECK:STDOUT: %ptr.1: type = ptr_type %Class [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] @@ -100,7 +100,7 @@ fn F() { // CHECK:STDOUT: %.loc13_10.1: type = value_of_initializer %int.make_type_signed.loc13 [template = constants.%i32] // CHECK:STDOUT: %.loc13_10.2: type = converted %int.make_type_signed.loc13, %.loc13_10.1 [template = constants.%i32] // CHECK:STDOUT: %.loc13_8: %Class.elem = field_decl b, element1 [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a.b.1 [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a.b.1 [template = constants.%complete_type.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class diff --git a/toolchain/check/testdata/class/fail_scope.carbon b/toolchain/check/testdata/class/fail_scope.carbon index 8f7dcfd9accbe..dae0ca2e4bd4a 100644 --- a/toolchain/check/testdata/class/fail_scope.carbon +++ b/toolchain/check/testdata/class/fail_scope.carbon @@ -32,7 +32,7 @@ fn G() -> i32 { // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %complete_type.1: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] @@ -87,7 +87,7 @@ fn G() -> i32 { // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class diff --git a/toolchain/check/testdata/class/field_access.carbon b/toolchain/check/testdata/class/field_access.carbon index 18fad2c4a69d1..9d43cd28cd1ae 100644 --- a/toolchain/check/testdata/class/field_access.carbon +++ b/toolchain/check/testdata/class/field_access.carbon @@ -31,7 +31,7 @@ fn Run() { // CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] // CHECK:STDOUT: %Class.elem: type = unbound_element_type %Class, %i32 [template] // CHECK:STDOUT: %struct_type.j.k: type = struct_type {.j: %i32, .k: %i32} [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.j.k [template] +// CHECK:STDOUT: %complete_type.1: = complete_type_witness %struct_type.j.k [template] // CHECK:STDOUT: %Run.type: type = fn_type @Run [template] // CHECK:STDOUT: %Run: %Run.type = struct_value () [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] @@ -79,7 +79,7 @@ fn Run() { // CHECK:STDOUT: %.loc13_10.1: type = value_of_initializer %int.make_type_signed.loc13 [template = constants.%i32] // CHECK:STDOUT: %.loc13_10.2: type = converted %int.make_type_signed.loc13, %.loc13_10.1 [template = constants.%i32] // CHECK:STDOUT: %.loc13_8: %Class.elem = field_decl k, element1 [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.j.k [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.j.k [template = constants.%complete_type.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class diff --git a/toolchain/check/testdata/class/field_access_in_value.carbon b/toolchain/check/testdata/class/field_access_in_value.carbon index 7f03770b2aa01..9361826dc84bf 100644 --- a/toolchain/check/testdata/class/field_access_in_value.carbon +++ b/toolchain/check/testdata/class/field_access_in_value.carbon @@ -32,7 +32,7 @@ fn Test() { // CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] // CHECK:STDOUT: %Class.elem: type = unbound_element_type %Class, %i32 [template] // CHECK:STDOUT: %struct_type.j.k: type = struct_type {.j: %i32, .k: %i32} [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.j.k [template] +// CHECK:STDOUT: %complete_type.1: = complete_type_witness %struct_type.j.k [template] // CHECK:STDOUT: %Test.type: type = fn_type @Test [template] // CHECK:STDOUT: %Test: %Test.type = struct_value () [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] @@ -80,7 +80,7 @@ fn Test() { // CHECK:STDOUT: %.loc13_10.1: type = value_of_initializer %int.make_type_signed.loc13 [template = constants.%i32] // CHECK:STDOUT: %.loc13_10.2: type = converted %int.make_type_signed.loc13, %.loc13_10.1 [template = constants.%i32] // CHECK:STDOUT: %.loc13_8: %Class.elem = field_decl k, element1 [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.j.k [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.j.k [template = constants.%complete_type.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class diff --git a/toolchain/check/testdata/class/generic/adapt.carbon b/toolchain/check/testdata/class/generic/adapt.carbon index 56fdfca510175..222c8b49d7871 100644 --- a/toolchain/check/testdata/class/generic/adapt.carbon +++ b/toolchain/check/testdata/class/generic/adapt.carbon @@ -128,6 +128,7 @@ fn ImportedConvertLocal(a: Adapter(C)) -> i32 { // CHECK:STDOUT: %C.type: type = generic_class_type @C [template] // CHECK:STDOUT: %C.generic: %C.type = struct_value () [template] // CHECK:STDOUT: %C.1: type = class_type @C, @C(%T) [symbolic] +// CHECK:STDOUT: %require_complete: = require_complete_type %T [symbolic] // CHECK:STDOUT: %C.elem.1: type = unbound_element_type %C.1, %T [symbolic] // CHECK:STDOUT: %struct_type.x.1: type = struct_type {.x: %T} [symbolic] // CHECK:STDOUT: %complete_type.1: = complete_type_witness %struct_type.x.1 [symbolic] @@ -137,9 +138,10 @@ fn ImportedConvertLocal(a: Adapter(C)) -> i32 { // CHECK:STDOUT: %Int: %Int.type = struct_value () [template] // CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] // CHECK:STDOUT: %C.2: type = class_type @C, @C(%i32) [template] +// CHECK:STDOUT: %complete_type.2: = complete_type_witness %i32 [template] // CHECK:STDOUT: %C.elem.2: type = unbound_element_type %C.2, %i32 [template] // CHECK:STDOUT: %struct_type.x.2: type = struct_type {.x: %i32} [template] -// CHECK:STDOUT: %complete_type.2: = complete_type_witness %struct_type.x.2 [template] +// CHECK:STDOUT: %complete_type.3: = complete_type_witness %struct_type.x.2 [template] // CHECK:STDOUT: %Access.type: type = fn_type @Access [template] // CHECK:STDOUT: %Access: %Access.type = struct_value () [template] // CHECK:STDOUT: } @@ -191,6 +193,7 @@ fn ImportedConvertLocal(a: Adapter(C)) -> i32 { // CHECK:STDOUT: %T.patt.loc4_9.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_9.2 (constants.%T.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete: = require_complete_type @C.%T.loc4_9.2 (%T) [symbolic = %require_complete (constants.%require_complete)] // CHECK:STDOUT: %C: type = class_type @C, @C(%T.loc4_9.2) [symbolic = %C (constants.%C.1)] // CHECK:STDOUT: %C.elem: type = unbound_element_type @C.%C (%C.1), @C.%T.loc4_9.2 (%T) [symbolic = %C.elem (constants.%C.elem.1)] // CHECK:STDOUT: %struct_type.x: type = struct_type {.x: @C.%T.loc4_9.2 (%T)} [symbolic = %struct_type.x (constants.%struct_type.x.1)] @@ -216,7 +219,7 @@ fn ImportedConvertLocal(a: Adapter(C)) -> i32 { // CHECK:STDOUT: %.loc9_14.2: type = converted %int.make_type_signed, %.loc9_14.1 [template = constants.%i32] // CHECK:STDOUT: %C: type = class_type @C, @C(constants.%i32) [template = constants.%C.2] // CHECK:STDOUT: adapt_decl %C [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.x.2 [template = constants.%complete_type.2] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.x.2 [template = constants.%complete_type.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Adapter @@ -255,10 +258,11 @@ fn ImportedConvertLocal(a: Adapter(C)) -> i32 { // CHECK:STDOUT: %T.patt.loc4_9.2 => constants.%i32 // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete => constants.%complete_type.2 // CHECK:STDOUT: %C => constants.%C.2 // CHECK:STDOUT: %C.elem => constants.%C.elem.2 // CHECK:STDOUT: %struct_type.x => constants.%struct_type.x.2 -// CHECK:STDOUT: %complete_type.loc6_1.2 => constants.%complete_type.2 +// CHECK:STDOUT: %complete_type.loc6_1.2 => constants.%complete_type.3 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- import_adapt_specific_type.carbon @@ -277,7 +281,9 @@ fn ImportedConvertLocal(a: Adapter(C)) -> i32 { // CHECK:STDOUT: %C.2: type = class_type @C, @C(%i32) [template] // CHECK:STDOUT: %struct_type.x.2: type = struct_type {.x: %i32} [template] // CHECK:STDOUT: %complete_type.2: = complete_type_witness %struct_type.x.2 [template] +// CHECK:STDOUT: %require_complete: = require_complete_type %T [symbolic] // CHECK:STDOUT: %C.elem.1: type = unbound_element_type %C.1, %T [symbolic] +// CHECK:STDOUT: %complete_type.3: = complete_type_witness %i32 [template] // CHECK:STDOUT: %C.elem.2: type = unbound_element_type %C.2, %i32 [template] // CHECK:STDOUT: %Int.type: type = fn_type @Int [template] // CHECK:STDOUT: %Int: %Int.type = struct_value () [template] @@ -298,7 +304,7 @@ fn ImportedConvertLocal(a: Adapter(C)) -> i32 { // CHECK:STDOUT: %import_ref.5 = import_ref Main//adapt_specific_type, inst27 [no loc], unloaded // CHECK:STDOUT: %import_ref.6: @C.%C.elem (%C.elem.1) = import_ref Main//adapt_specific_type, loc5_8, loaded [template = %.1] // CHECK:STDOUT: %import_ref.8: = import_ref Main//adapt_specific_type, loc10_1, loaded [template = constants.%complete_type.2] -// CHECK:STDOUT: %import_ref.9 = import_ref Main//adapt_specific_type, inst39 [no loc], unloaded +// CHECK:STDOUT: %import_ref.9 = import_ref Main//adapt_specific_type, inst42 [no loc], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -340,6 +346,7 @@ fn ImportedConvertLocal(a: Adapter(C)) -> i32 { // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt (constants.%T.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete: = require_complete_type @C.%T (%T) [symbolic = %require_complete (constants.%require_complete)] // CHECK:STDOUT: %C: type = class_type @C, @C(%T) [symbolic = %C (constants.%C.1)] // CHECK:STDOUT: %C.elem: type = unbound_element_type @C.%C (%C.1), @C.%T (%T) [symbolic = %C.elem (constants.%C.elem.1)] // CHECK:STDOUT: %struct_type.x: type = struct_type {.x: @C.%T (%T)} [symbolic = %struct_type.x (constants.%struct_type.x.1)] @@ -380,6 +387,7 @@ fn ImportedConvertLocal(a: Adapter(C)) -> i32 { // CHECK:STDOUT: %T.patt => constants.%i32 // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete => constants.%complete_type.3 // CHECK:STDOUT: %C => constants.%C.2 // CHECK:STDOUT: %C.elem => constants.%C.elem.2 // CHECK:STDOUT: %struct_type.x => constants.%struct_type.x.2 @@ -399,6 +407,7 @@ fn ImportedConvertLocal(a: Adapter(C)) -> i32 { // CHECK:STDOUT: %C.type: type = generic_class_type @C [template] // CHECK:STDOUT: %C.generic: %C.type = struct_value () [template] // CHECK:STDOUT: %C.1: type = class_type @C, @C(%T) [symbolic] +// CHECK:STDOUT: %require_complete.1: = require_complete_type %T [symbolic] // CHECK:STDOUT: %C.elem.1: type = unbound_element_type %C.1, %T [symbolic] // CHECK:STDOUT: %struct_type.x.1: type = struct_type {.x: %T} [symbolic] // CHECK:STDOUT: %complete_type.1: = complete_type_witness %struct_type.x.1 [symbolic] @@ -408,9 +417,10 @@ fn ImportedConvertLocal(a: Adapter(C)) -> i32 { // CHECK:STDOUT: %Int: %Int.type = struct_value () [template] // CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] // CHECK:STDOUT: %C.2: type = class_type @C, @C(%i32) [template] +// CHECK:STDOUT: %complete_type.2: = complete_type_witness %i32 [template] // CHECK:STDOUT: %C.elem.2: type = unbound_element_type %C.2, %i32 [template] // CHECK:STDOUT: %struct_type.x.2: type = struct_type {.x: %i32} [template] -// CHECK:STDOUT: %complete_type.2: = complete_type_witness %struct_type.x.2 [template] +// CHECK:STDOUT: %complete_type.3: = complete_type_witness %struct_type.x.2 [template] // CHECK:STDOUT: %Access.type: type = fn_type @Access [template] // CHECK:STDOUT: %Access: %Access.type = struct_value () [template] // CHECK:STDOUT: } @@ -463,6 +473,7 @@ fn ImportedConvertLocal(a: Adapter(C)) -> i32 { // CHECK:STDOUT: %T.patt.loc4_9.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_9.2 (constants.%T.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete: = require_complete_type @C.%T.loc4_9.2 (%T) [symbolic = %require_complete (constants.%require_complete.1)] // CHECK:STDOUT: %C: type = class_type @C, @C(%T.loc4_9.2) [symbolic = %C (constants.%C.1)] // CHECK:STDOUT: %C.elem: type = unbound_element_type @C.%C (%C.1), @C.%T.loc4_9.2 (%T) [symbolic = %C.elem (constants.%C.elem.1)] // CHECK:STDOUT: %struct_type.x: type = struct_type {.x: @C.%T.loc4_9.2 (%T)} [symbolic = %struct_type.x (constants.%struct_type.x.1)] @@ -488,7 +499,7 @@ fn ImportedConvertLocal(a: Adapter(C)) -> i32 { // CHECK:STDOUT: %.loc9_21.2: type = converted %int.make_type_signed, %.loc9_21.1 [template = constants.%i32] // CHECK:STDOUT: %C: type = class_type @C, @C(constants.%i32) [template = constants.%C.2] // CHECK:STDOUT: adapt_decl %C [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.x.2 [template = constants.%complete_type.2] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.x.2 [template = constants.%complete_type.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Adapter @@ -520,10 +531,11 @@ fn ImportedConvertLocal(a: Adapter(C)) -> i32 { // CHECK:STDOUT: %T.patt.loc4_9.2 => constants.%i32 // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete => constants.%complete_type.2 // CHECK:STDOUT: %C => constants.%C.2 // CHECK:STDOUT: %C.elem => constants.%C.elem.2 // CHECK:STDOUT: %struct_type.x => constants.%struct_type.x.2 -// CHECK:STDOUT: %complete_type.loc6_1.2 => constants.%complete_type.2 +// CHECK:STDOUT: %complete_type.loc6_1.2 => constants.%complete_type.3 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- extend_adapt_specific_type_library.carbon @@ -534,6 +546,7 @@ fn ImportedConvertLocal(a: Adapter(C)) -> i32 { // CHECK:STDOUT: %C.type: type = generic_class_type @C [template] // CHECK:STDOUT: %C.generic: %C.type = struct_value () [template] // CHECK:STDOUT: %C.1: type = class_type @C, @C(%T) [symbolic] +// CHECK:STDOUT: %require_complete: = require_complete_type %T [symbolic] // CHECK:STDOUT: %C.elem.1: type = unbound_element_type %C.1, %T [symbolic] // CHECK:STDOUT: %struct_type.x.1: type = struct_type {.x: %T} [symbolic] // CHECK:STDOUT: %complete_type.1: = complete_type_witness %struct_type.x.1 [symbolic] @@ -543,9 +556,10 @@ fn ImportedConvertLocal(a: Adapter(C)) -> i32 { // CHECK:STDOUT: %Int: %Int.type = struct_value () [template] // CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] // CHECK:STDOUT: %C.2: type = class_type @C, @C(%i32) [template] +// CHECK:STDOUT: %complete_type.2: = complete_type_witness %i32 [template] // CHECK:STDOUT: %C.elem.2: type = unbound_element_type %C.2, %i32 [template] // CHECK:STDOUT: %struct_type.x.2: type = struct_type {.x: %i32} [template] -// CHECK:STDOUT: %complete_type.2: = complete_type_witness %struct_type.x.2 [template] +// CHECK:STDOUT: %complete_type.3: = complete_type_witness %struct_type.x.2 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -578,6 +592,7 @@ fn ImportedConvertLocal(a: Adapter(C)) -> i32 { // CHECK:STDOUT: %T.patt.loc7_9.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc7_9.2 (constants.%T.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete: = require_complete_type @C.%T.loc7_9.2 (%T) [symbolic = %require_complete (constants.%require_complete)] // CHECK:STDOUT: %C: type = class_type @C, @C(%T.loc7_9.2) [symbolic = %C (constants.%C.1)] // CHECK:STDOUT: %C.elem: type = unbound_element_type @C.%C (%C.1), @C.%T.loc7_9.2 (%T) [symbolic = %C.elem (constants.%C.elem.1)] // CHECK:STDOUT: %struct_type.x: type = struct_type {.x: @C.%T.loc7_9.2 (%T)} [symbolic = %struct_type.x (constants.%struct_type.x.1)] @@ -603,7 +618,7 @@ fn ImportedConvertLocal(a: Adapter(C)) -> i32 { // CHECK:STDOUT: %.loc12_21.2: type = converted %int.make_type_signed, %.loc12_21.1 [template = constants.%i32] // CHECK:STDOUT: %C: type = class_type @C, @C(constants.%i32) [template = constants.%C.2] // CHECK:STDOUT: adapt_decl %C [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.x.2 [template = constants.%complete_type.2] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.x.2 [template = constants.%complete_type.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Adapter @@ -626,10 +641,11 @@ fn ImportedConvertLocal(a: Adapter(C)) -> i32 { // CHECK:STDOUT: %T.patt.loc7_9.2 => constants.%i32 // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete => constants.%complete_type.2 // CHECK:STDOUT: %C => constants.%C.2 // CHECK:STDOUT: %C.elem => constants.%C.elem.2 // CHECK:STDOUT: %struct_type.x => constants.%struct_type.x.2 -// CHECK:STDOUT: %complete_type.loc9_1.2 => constants.%complete_type.2 +// CHECK:STDOUT: %complete_type.loc9_1.2 => constants.%complete_type.3 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_todo_import_extend_adapt_specific_type.carbon @@ -646,7 +662,9 @@ fn ImportedConvertLocal(a: Adapter(C)) -> i32 { // CHECK:STDOUT: %C.2: type = class_type @C, @C(%i32) [template] // CHECK:STDOUT: %struct_type.x.2: type = struct_type {.x: %i32} [template] // CHECK:STDOUT: %complete_type.2: = complete_type_witness %struct_type.x.2 [template] +// CHECK:STDOUT: %require_complete.1: = require_complete_type %T [symbolic] // CHECK:STDOUT: %C.elem.1: type = unbound_element_type %C.1, %T [symbolic] +// CHECK:STDOUT: %complete_type.3: = complete_type_witness %i32 [template] // CHECK:STDOUT: %C.elem.2: type = unbound_element_type %C.2, %i32 [template] // CHECK:STDOUT: %Int.type: type = fn_type @Int [template] // CHECK:STDOUT: %Int: %Int.type = struct_value () [template] @@ -667,7 +685,7 @@ fn ImportedConvertLocal(a: Adapter(C)) -> i32 { // CHECK:STDOUT: %import_ref.4 = import_ref Main//extend_adapt_specific_type_library, inst27 [no loc], unloaded // CHECK:STDOUT: %import_ref.5: @C.%C.elem (%C.elem.1) = import_ref Main//extend_adapt_specific_type_library, loc8_8, loaded [template = %.1] // CHECK:STDOUT: %import_ref.7: = import_ref Main//extend_adapt_specific_type_library, loc13_1, loaded [template = constants.%complete_type.2] -// CHECK:STDOUT: %import_ref.8 = import_ref Main//extend_adapt_specific_type_library, inst39 [no loc], unloaded +// CHECK:STDOUT: %import_ref.8 = import_ref Main//extend_adapt_specific_type_library, inst42 [no loc], unloaded // CHECK:STDOUT: %import_ref.9: type = import_ref Main//extend_adapt_specific_type_library, loc12_21, loaded [template = constants.%C.2] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -710,6 +728,7 @@ fn ImportedConvertLocal(a: Adapter(C)) -> i32 { // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt (constants.%T.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete: = require_complete_type @C.%T (%T) [symbolic = %require_complete (constants.%require_complete.1)] // CHECK:STDOUT: %C: type = class_type @C, @C(%T) [symbolic = %C (constants.%C.1)] // CHECK:STDOUT: %C.elem: type = unbound_element_type @C.%C (%C.1), @C.%T (%T) [symbolic = %C.elem (constants.%C.elem.1)] // CHECK:STDOUT: %struct_type.x: type = struct_type {.x: @C.%T (%T)} [symbolic = %struct_type.x (constants.%struct_type.x.1)] @@ -742,6 +761,7 @@ fn ImportedConvertLocal(a: Adapter(C)) -> i32 { // CHECK:STDOUT: %T.patt => constants.%i32 // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete => constants.%complete_type.3 // CHECK:STDOUT: %C => constants.%C.2 // CHECK:STDOUT: %C.elem => constants.%C.elem.2 // CHECK:STDOUT: %struct_type.x => constants.%struct_type.x.2 @@ -761,6 +781,7 @@ fn ImportedConvertLocal(a: Adapter(C)) -> i32 { // CHECK:STDOUT: %Adapter.type: type = generic_class_type @Adapter [template] // CHECK:STDOUT: %Adapter.generic: %Adapter.type = struct_value () [template] // CHECK:STDOUT: %Adapter.1: type = class_type @Adapter, @Adapter(%T) [symbolic] +// CHECK:STDOUT: %require_complete: = require_complete_type %T [symbolic] // CHECK:STDOUT: %complete_type.1: = complete_type_witness %T [symbolic] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] // CHECK:STDOUT: %Int.type: type = fn_type @Int [template] @@ -822,6 +843,7 @@ fn ImportedConvertLocal(a: Adapter(C)) -> i32 { // CHECK:STDOUT: %T.patt.loc4_15.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_15.2 (constants.%T.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete: = require_complete_type @Adapter.%T.loc4_15.2 (%T) [symbolic = %require_complete (constants.%require_complete)] // CHECK:STDOUT: %complete_type.loc6_1.2: = complete_type_witness @Adapter.%T.loc4_15.2 (%T) [symbolic = %complete_type.loc6_1.2 (constants.%complete_type.1)] // CHECK:STDOUT: // CHECK:STDOUT: class { @@ -857,6 +879,7 @@ fn ImportedConvertLocal(a: Adapter(C)) -> i32 { // CHECK:STDOUT: %T.patt.loc4_15.2 => constants.%i32 // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete => constants.%complete_type.2 // CHECK:STDOUT: %complete_type.loc6_1.2 => constants.%complete_type.2 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -868,6 +891,7 @@ fn ImportedConvertLocal(a: Adapter(C)) -> i32 { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] // CHECK:STDOUT: %complete_type.1: = complete_type_witness %T [symbolic] // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] +// CHECK:STDOUT: %require_complete: = require_complete_type %T [symbolic] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] // CHECK:STDOUT: %Int.type: type = fn_type @Int [template] // CHECK:STDOUT: %Int: %Int.type = struct_value () [template] @@ -956,6 +980,7 @@ fn ImportedConvertLocal(a: Adapter(C)) -> i32 { // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt (constants.%T.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete: = require_complete_type @Adapter.%T (%T) [symbolic = %require_complete (constants.%require_complete)] // CHECK:STDOUT: %complete_type: = complete_type_witness @Adapter.%T (%T) [symbolic = %complete_type (constants.%complete_type.1)] // CHECK:STDOUT: // CHECK:STDOUT: class { @@ -1013,6 +1038,7 @@ fn ImportedConvertLocal(a: Adapter(C)) -> i32 { // CHECK:STDOUT: %T.patt => constants.%i32 // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete => constants.%complete_type.2 // CHECK:STDOUT: %complete_type => constants.%complete_type.2 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1021,6 +1047,7 @@ fn ImportedConvertLocal(a: Adapter(C)) -> i32 { // CHECK:STDOUT: %T.patt => constants.%C // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete => constants.%complete_type.3 // CHECK:STDOUT: %complete_type => constants.%complete_type.4 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/generic/base_is_generic.carbon b/toolchain/check/testdata/class/generic/base_is_generic.carbon index adb04b35b3894..4f9da912f1a1f 100644 --- a/toolchain/check/testdata/class/generic/base_is_generic.carbon +++ b/toolchain/check/testdata/class/generic/base_is_generic.carbon @@ -92,6 +92,7 @@ fn H() { // CHECK:STDOUT: %Base.type: type = generic_class_type @Base [template] // CHECK:STDOUT: %Base.generic: %Base.type = struct_value () [template] // CHECK:STDOUT: %Base.1: type = class_type @Base, @Base(%T) [symbolic] +// CHECK:STDOUT: %require_complete: = require_complete_type %T [symbolic] // CHECK:STDOUT: %Base.elem.1: type = unbound_element_type %Base.1, %T [symbolic] // CHECK:STDOUT: %struct_type.x.1: type = struct_type {.x: %T} [symbolic] // CHECK:STDOUT: %complete_type.1: = complete_type_witness %struct_type.x.1 [symbolic] @@ -164,6 +165,7 @@ fn H() { // CHECK:STDOUT: %T.patt.loc4_17.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_17.2 (constants.%T.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete: = require_complete_type @Base.%T.loc4_17.2 (%T) [symbolic = %require_complete (constants.%require_complete)] // CHECK:STDOUT: %Base: type = class_type @Base, @Base(%T.loc4_17.2) [symbolic = %Base (constants.%Base.1)] // CHECK:STDOUT: %Base.elem: type = unbound_element_type @Base.%Base (%Base.1), @Base.%T.loc4_17.2 (%T) [symbolic = %Base.elem (constants.%Base.elem.1)] // CHECK:STDOUT: %struct_type.x: type = struct_type {.x: @Base.%T.loc4_17.2 (%T)} [symbolic = %struct_type.x (constants.%struct_type.x.1)] @@ -237,6 +239,7 @@ fn H() { // CHECK:STDOUT: %T.patt.loc4_17.2 => constants.%Param // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete => constants.%complete_type.2 // CHECK:STDOUT: %Base => constants.%Base.2 // CHECK:STDOUT: %Base.elem => constants.%Base.elem.2 // CHECK:STDOUT: %struct_type.x => constants.%struct_type.x.2 @@ -260,6 +263,7 @@ fn H() { // CHECK:STDOUT: %Base.2: type = class_type @Base, @Base(%Param) [template] // CHECK:STDOUT: %struct_type.base.1: type = struct_type {.base: %Base.2} [template] // CHECK:STDOUT: %complete_type.3: = complete_type_witness %struct_type.base.1 [template] +// CHECK:STDOUT: %require_complete: = require_complete_type %T [symbolic] // CHECK:STDOUT: %Base.elem.1: type = unbound_element_type %Base.1, %T [symbolic] // CHECK:STDOUT: %Base.elem.2: type = unbound_element_type %Base.2, %Param [template] // CHECK:STDOUT: %struct_type.x.2: type = struct_type {.x: %Param} [template] @@ -282,13 +286,13 @@ fn H() { // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.5: = import_ref Main//extend_generic_base, loc10_1, loaded [template = constants.%complete_type.1] -// CHECK:STDOUT: %import_ref.6 = import_ref Main//extend_generic_base, inst39 [no loc], unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Main//extend_generic_base, inst42 [no loc], unloaded // CHECK:STDOUT: %import_ref.7: %Param.elem = import_ref Main//extend_generic_base, loc9_8, loaded [template = %.1] // CHECK:STDOUT: %import_ref.8: = import_ref Main//extend_generic_base, loc6_1, loaded [symbolic = @Base.%complete_type (constants.%complete_type.2)] // CHECK:STDOUT: %import_ref.9 = import_ref Main//extend_generic_base, inst27 [no loc], unloaded // CHECK:STDOUT: %import_ref.10: @Base.%Base.elem (%Base.elem.1) = import_ref Main//extend_generic_base, loc5_8, loaded [template = %.2] // CHECK:STDOUT: %import_ref.12: = import_ref Main//extend_generic_base, loc14_1, loaded [template = constants.%complete_type.3] -// CHECK:STDOUT: %import_ref.13 = import_ref Main//extend_generic_base, inst60 [no loc], unloaded +// CHECK:STDOUT: %import_ref.13 = import_ref Main//extend_generic_base, inst63 [no loc], unloaded // CHECK:STDOUT: %import_ref.14 = import_ref Main//extend_generic_base, loc13_27, unloaded // CHECK:STDOUT: %import_ref.15: type = import_ref Main//extend_generic_base, loc13_26, loaded [template = constants.%Base.2] // CHECK:STDOUT: } @@ -342,6 +346,7 @@ fn H() { // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt (constants.%T.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete: = require_complete_type @Base.%T (%T) [symbolic = %require_complete (constants.%require_complete)] // CHECK:STDOUT: %Base: type = class_type @Base, @Base(%T) [symbolic = %Base (constants.%Base.1)] // CHECK:STDOUT: %Base.elem: type = unbound_element_type @Base.%Base (%Base.1), @Base.%T (%T) [symbolic = %Base.elem (constants.%Base.elem.1)] // CHECK:STDOUT: %struct_type.x: type = struct_type {.x: @Base.%T (%T)} [symbolic = %struct_type.x (constants.%struct_type.x.1)] @@ -378,6 +383,7 @@ fn H() { // CHECK:STDOUT: %T.patt => constants.%Param // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete => constants.%complete_type.1 // CHECK:STDOUT: %Base => constants.%Base.2 // CHECK:STDOUT: %Base.elem => constants.%Base.elem.2 // CHECK:STDOUT: %struct_type.x => constants.%struct_type.x.2 @@ -397,6 +403,7 @@ fn H() { // CHECK:STDOUT: %C.type: type = generic_class_type @C [template] // CHECK:STDOUT: %C.generic: %C.type = struct_value () [template] // CHECK:STDOUT: %C.1: type = class_type @C, @C(%T) [symbolic] +// CHECK:STDOUT: %require_complete: = require_complete_type %T [symbolic] // CHECK:STDOUT: %X: type = class_type @X [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] @@ -438,6 +445,7 @@ fn H() { // CHECK:STDOUT: %T.patt.loc4_9.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_9.2 (constants.%T.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete: = require_complete_type @C.%T.loc4_9.2 (%T) [symbolic = %require_complete (constants.%require_complete)] // CHECK:STDOUT: // CHECK:STDOUT: class { // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc4_9.1 [symbolic = %T.loc4_9.2 (constants.%T)] @@ -486,6 +494,7 @@ fn H() { // CHECK:STDOUT: %T.patt.loc4_9.2 => constants.%X // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete => constants.%complete_type // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- extend_generic_symbolic_base.carbon @@ -500,6 +509,7 @@ fn H() { // CHECK:STDOUT: %G.1: %G.type.1 = struct_value () [symbolic] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] // CHECK:STDOUT: %complete_type.1: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %require_complete.1: = require_complete_type %U [symbolic] // CHECK:STDOUT: %G.specific_fn.1: = specific_function %G.1, @G(%U) [symbolic] // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] @@ -509,6 +519,7 @@ fn H() { // CHECK:STDOUT: %X.2: type = class_type @X, @X(%T) [symbolic] // CHECK:STDOUT: %G.type.2: type = fn_type @G, @X(%T) [symbolic] // CHECK:STDOUT: %G.2: %G.type.2 = struct_value () [symbolic] +// CHECK:STDOUT: %require_complete.2: = require_complete_type %X.2 [symbolic] // CHECK:STDOUT: %C.elem.1: type = unbound_element_type %C.1, %X.2 [symbolic] // CHECK:STDOUT: %struct_type.base.1: type = struct_type {.base: %X.2} [symbolic] // CHECK:STDOUT: %complete_type.2: = complete_type_witness %struct_type.base.1 [symbolic] @@ -520,12 +531,13 @@ fn H() { // CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] // CHECK:STDOUT: %C.2: type = class_type @C, @C(%i32) [template] // CHECK:STDOUT: %X.3: type = class_type @X, @X(%i32) [template] +// CHECK:STDOUT: %G.type.3: type = fn_type @G, @X(%i32) [template] +// CHECK:STDOUT: %G.3: %G.type.3 = struct_value () [template] // CHECK:STDOUT: %C.elem.2: type = unbound_element_type %C.2, %X.3 [template] // CHECK:STDOUT: %struct_type.base.2: type = struct_type {.base: %X.3} [template] // CHECK:STDOUT: %complete_type.3: = complete_type_witness %struct_type.base.2 [template] -// CHECK:STDOUT: %G.type.3: type = fn_type @G, @X(%i32) [template] -// CHECK:STDOUT: %G.3: %G.type.3 = struct_value () [template] // CHECK:STDOUT: %G.specific_fn.2: = specific_function %G.3, @G(%i32) [template] +// CHECK:STDOUT: %complete_type.4: = complete_type_witness %i32 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -593,6 +605,7 @@ fn H() { // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %X.loc9_19.2: type = class_type @X, @X(%T.loc8_9.2) [symbolic = %X.loc9_19.2 (constants.%X.2)] +// CHECK:STDOUT: %require_complete: = require_complete_type @C.%X.loc9_19.2 (%X.2) [symbolic = %require_complete (constants.%require_complete.2)] // CHECK:STDOUT: %C: type = class_type @C, @C(%T.loc8_9.2) [symbolic = %C (constants.%C.1)] // CHECK:STDOUT: %C.elem: type = unbound_element_type @C.%C (%C.1), @C.%X.loc9_19.2 (%X.2) [symbolic = %C.elem (constants.%C.elem.1)] // CHECK:STDOUT: %struct_type.base: type = struct_type {.base: @C.%X.loc9_19.2 (%X.2)} [symbolic = %struct_type.base (constants.%struct_type.base.1)] @@ -617,6 +630,7 @@ fn H() { // CHECK:STDOUT: %U: type = bind_symbolic_name U, 0 [symbolic = %U (constants.%U)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete: = require_complete_type @G.%U (%U) [symbolic = %require_complete (constants.%require_complete.1)] // CHECK:STDOUT: %G.type: type = fn_type @G, @X(%U) [symbolic = %G.type (constants.%G.type.1)] // CHECK:STDOUT: %G: @G.%G.type (%G.type.1) = struct_value () [symbolic = %G (constants.%G.1)] // CHECK:STDOUT: %G.specific_fn.loc5_24.2: = specific_function %G, @G(%U) [symbolic = %G.specific_fn.loc5_24.2 (constants.%G.specific_fn.1)] @@ -668,6 +682,7 @@ fn H() { // CHECK:STDOUT: %U => constants.%U // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete => constants.%require_complete.1 // CHECK:STDOUT: %G.type => constants.%G.type.1 // CHECK:STDOUT: %G => constants.%G.1 // CHECK:STDOUT: %G.specific_fn.loc5_24.2 => constants.%G.specific_fn.1 @@ -717,6 +732,7 @@ fn H() { // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %X.loc9_19.2 => constants.%X.3 +// CHECK:STDOUT: %require_complete => constants.%complete_type.1 // CHECK:STDOUT: %C => constants.%C.2 // CHECK:STDOUT: %C.elem => constants.%C.elem.2 // CHECK:STDOUT: %struct_type.base => constants.%struct_type.base.2 @@ -736,6 +752,7 @@ fn H() { // CHECK:STDOUT: %U => constants.%i32 // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete => constants.%complete_type.4 // CHECK:STDOUT: %G.type => constants.%G.type.3 // CHECK:STDOUT: %G => constants.%G.3 // CHECK:STDOUT: %G.specific_fn.loc5_24.2 => constants.%G.specific_fn.2 @@ -765,17 +782,20 @@ fn H() { // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %G.type.1: type = fn_type @G, @X(%U) [symbolic] // CHECK:STDOUT: %G.1: %G.type.1 = struct_value () [symbolic] +// CHECK:STDOUT: %require_complete.1: = require_complete_type %X.2 [symbolic] +// CHECK:STDOUT: %require_complete.2: = require_complete_type %U [symbolic] // CHECK:STDOUT: %G.specific_fn.1: = specific_function %G.1, @G(%U) [symbolic] // CHECK:STDOUT: %G.type.2: type = fn_type @G, @X(%T) [symbolic] // CHECK:STDOUT: %G.2: %G.type.2 = struct_value () [symbolic] // CHECK:STDOUT: %C.2: type = class_type @C, @C(%i32) [template] // CHECK:STDOUT: %X.3: type = class_type @X, @X(%i32) [template] +// CHECK:STDOUT: %G.type.3: type = fn_type @G, @X(%i32) [template] +// CHECK:STDOUT: %G.3: %G.type.3 = struct_value () [template] // CHECK:STDOUT: %C.elem.2: type = unbound_element_type %C.2, %X.3 [template] // CHECK:STDOUT: %struct_type.base.2: type = struct_type {.base: %X.3} [template] // CHECK:STDOUT: %complete_type.3: = complete_type_witness %struct_type.base.2 [template] -// CHECK:STDOUT: %G.type.3: type = fn_type @G, @X(%i32) [template] -// CHECK:STDOUT: %G.3: %G.type.3 = struct_value () [template] // CHECK:STDOUT: %G.specific_fn.2: = specific_function %G.3, @G(%i32) [template] +// CHECK:STDOUT: %complete_type.4: = complete_type_witness %i32 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -791,7 +811,7 @@ fn H() { // CHECK:STDOUT: %import_ref.6 = import_ref Main//extend_generic_symbolic_base, inst27 [no loc], unloaded // CHECK:STDOUT: %import_ref.7: @X.%G.type (%G.type.1) = import_ref Main//extend_generic_symbolic_base, loc5_15, loaded [symbolic = @X.%G (constants.%G.1)] // CHECK:STDOUT: %import_ref.9: = import_ref Main//extend_generic_symbolic_base, loc10_1, loaded [symbolic = @C.%complete_type (constants.%complete_type.2)] -// CHECK:STDOUT: %import_ref.10 = import_ref Main//extend_generic_symbolic_base, inst64 [no loc], unloaded +// CHECK:STDOUT: %import_ref.10 = import_ref Main//extend_generic_symbolic_base, inst68 [no loc], unloaded // CHECK:STDOUT: %import_ref.11 = import_ref Main//extend_generic_symbolic_base, loc9_20, unloaded // CHECK:STDOUT: %import_ref.12: type = import_ref Main//extend_generic_symbolic_base, loc9_19, loaded [symbolic = @C.%X (constants.%X.2)] // CHECK:STDOUT: } @@ -815,6 +835,7 @@ fn H() { // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %X: type = class_type @X, @X(%T) [symbolic = %X (constants.%X.2)] +// CHECK:STDOUT: %require_complete: = require_complete_type @C.%X (%X.2) [symbolic = %require_complete (constants.%require_complete.1)] // CHECK:STDOUT: %C: type = class_type @C, @C(%T) [symbolic = %C (constants.%C.1)] // CHECK:STDOUT: %C.elem: type = unbound_element_type @C.%C (%C.1), @C.%X (%X.2) [symbolic = %C.elem (constants.%C.elem.1)] // CHECK:STDOUT: %struct_type.base: type = struct_type {.base: @C.%X (%X.2)} [symbolic = %struct_type.base (constants.%struct_type.base.1)] @@ -871,6 +892,7 @@ fn H() { // CHECK:STDOUT: %U: type = bind_symbolic_name U, 0 [symbolic = %U (constants.%U)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete: = require_complete_type @G.%U (%U) [symbolic = %require_complete (constants.%require_complete.2)] // CHECK:STDOUT: %G.type: type = fn_type @G, @X(%U) [symbolic = %G.type (constants.%G.type.1)] // CHECK:STDOUT: %G: @G.%G.type (%G.type.1) = struct_value () [symbolic = %G (constants.%G.1)] // CHECK:STDOUT: %G.specific_fn: = specific_function %G, @G(%U) [symbolic = %G.specific_fn (constants.%G.specific_fn.1)] @@ -920,6 +942,7 @@ fn H() { // CHECK:STDOUT: %U => constants.%U // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete => constants.%require_complete.2 // CHECK:STDOUT: %G.type => constants.%G.type.1 // CHECK:STDOUT: %G => constants.%G.1 // CHECK:STDOUT: %G.specific_fn => constants.%G.specific_fn.1 @@ -940,6 +963,7 @@ fn H() { // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %X => constants.%X.3 +// CHECK:STDOUT: %require_complete => constants.%complete_type.1 // CHECK:STDOUT: %C => constants.%C.2 // CHECK:STDOUT: %C.elem => constants.%C.elem.2 // CHECK:STDOUT: %struct_type.base => constants.%struct_type.base.2 @@ -959,6 +983,7 @@ fn H() { // CHECK:STDOUT: %U => constants.%i32 // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete => constants.%complete_type.4 // CHECK:STDOUT: %G.type => constants.%G.type.3 // CHECK:STDOUT: %G => constants.%G.3 // CHECK:STDOUT: %G.specific_fn => constants.%G.specific_fn.2 diff --git a/toolchain/check/testdata/class/generic/basic.carbon b/toolchain/check/testdata/class/generic/basic.carbon index 33a104223ab37..c93191c8781e9 100644 --- a/toolchain/check/testdata/class/generic/basic.carbon +++ b/toolchain/check/testdata/class/generic/basic.carbon @@ -37,9 +37,13 @@ class Declaration(T:! type); // CHECK:STDOUT: %GetAddr: %GetAddr.type = struct_value () [symbolic] // CHECK:STDOUT: %GetValue.type: type = fn_type @GetValue, @Class(%T) [symbolic] // CHECK:STDOUT: %GetValue: %GetValue.type = struct_value () [symbolic] +// CHECK:STDOUT: %require_complete.1: = require_complete_type %T [symbolic] // CHECK:STDOUT: %Class.elem: type = unbound_element_type %Class, %T [symbolic] // CHECK:STDOUT: %struct_type.k: type = struct_type {.k: %T} [symbolic] // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.k [symbolic] +// CHECK:STDOUT: %require_complete.2: = require_complete_type %ptr.2 [symbolic] +// CHECK:STDOUT: %require_complete.3: = require_complete_type %ptr.1 [symbolic] +// CHECK:STDOUT: %require_complete.4: = require_complete_type %Class [symbolic] // CHECK:STDOUT: %Declaration.type: type = generic_class_type @Declaration [template] // CHECK:STDOUT: %Declaration.generic: %Declaration.type = struct_value () [template] // CHECK:STDOUT: } @@ -83,6 +87,7 @@ class Declaration(T:! type); // CHECK:STDOUT: %GetAddr: @Class.%GetAddr.type (%GetAddr.type) = struct_value () [symbolic = %GetAddr (constants.%GetAddr)] // CHECK:STDOUT: %GetValue.type: type = fn_type @GetValue, @Class(%T.loc11_13.2) [symbolic = %GetValue.type (constants.%GetValue.type)] // CHECK:STDOUT: %GetValue: @Class.%GetValue.type (%GetValue.type) = struct_value () [symbolic = %GetValue (constants.%GetValue)] +// CHECK:STDOUT: %require_complete: = require_complete_type @Class.%T.loc11_13.2 (%T) [symbolic = %require_complete (constants.%require_complete.1)] // CHECK:STDOUT: %Class: type = class_type @Class, @Class(%T.loc11_13.2) [symbolic = %Class (constants.%Class)] // CHECK:STDOUT: %Class.elem: type = unbound_element_type @Class.%Class (%Class), @Class.%T.loc11_13.2 (%T) [symbolic = %Class.elem (constants.%Class.elem)] // CHECK:STDOUT: %struct_type.k: type = struct_type {.k: @Class.%T.loc11_13.2 (%T)} [symbolic = %struct_type.k (constants.%struct_type.k)] @@ -147,6 +152,9 @@ class Declaration(T:! type); // CHECK:STDOUT: %ptr.loc12_38.1: type = ptr_type @GetAddr.%T (%T) [symbolic = %ptr.loc12_38.1 (constants.%ptr.2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete.loc12_34: = require_complete_type @GetAddr.%ptr.loc12_38.1 (%ptr.2) [symbolic = %require_complete.loc12_34 (constants.%require_complete.2)] +// CHECK:STDOUT: %require_complete.loc12_23: = require_complete_type @GetAddr.%ptr.loc12_29.1 (%ptr.1) [symbolic = %require_complete.loc12_23 (constants.%require_complete.3)] +// CHECK:STDOUT: %require_complete.loc13: = require_complete_type @GetAddr.%Class (%Class) [symbolic = %require_complete.loc13 (constants.%require_complete.4)] // CHECK:STDOUT: %Class.elem: type = unbound_element_type @GetAddr.%Class (%Class), @GetAddr.%T (%T) [symbolic = %Class.elem (constants.%Class.elem)] // CHECK:STDOUT: // CHECK:STDOUT: fn[addr %self.param_patt: @GetAddr.%ptr.loc12_29.1 (%ptr.1)]() -> @GetAddr.%ptr.loc12_38.1 (%ptr.2) { @@ -165,7 +173,9 @@ class Declaration(T:! type); // CHECK:STDOUT: %Class: type = class_type @Class, @Class(%T) [symbolic = %Class (constants.%Class)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete.loc17: = require_complete_type @GetValue.%Class (%Class) [symbolic = %require_complete.loc17 (constants.%require_complete.4)] // CHECK:STDOUT: %Class.elem: type = unbound_element_type @GetValue.%Class (%Class), @GetValue.%T (%T) [symbolic = %Class.elem (constants.%Class.elem)] +// CHECK:STDOUT: %require_complete.loc18: = require_complete_type @GetValue.%T (%T) [symbolic = %require_complete.loc18 (constants.%require_complete.1)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @GetValue.%Class (%Class)]() -> @GetValue.%T (%T) { // CHECK:STDOUT: !entry: @@ -186,6 +196,7 @@ class Declaration(T:! type); // CHECK:STDOUT: %GetAddr => constants.%GetAddr // CHECK:STDOUT: %GetValue.type => constants.%GetValue.type // CHECK:STDOUT: %GetValue => constants.%GetValue +// CHECK:STDOUT: %require_complete => constants.%require_complete.1 // CHECK:STDOUT: %Class => constants.%Class // CHECK:STDOUT: %Class.elem => constants.%Class.elem // CHECK:STDOUT: %struct_type.k => constants.%struct_type.k diff --git a/toolchain/check/testdata/class/generic/call.carbon b/toolchain/check/testdata/class/generic/call.carbon index 23fe4f248d97a..af27c369f0486 100644 --- a/toolchain/check/testdata/class/generic/call.carbon +++ b/toolchain/check/testdata/class/generic/call.carbon @@ -101,7 +101,7 @@ class Outer(T:! type) { // CHECK:STDOUT: %Class.generic: %Class.type = struct_value () [template] // CHECK:STDOUT: %Class.1: type = class_type @Class, @Class(%T, %N.1) [symbolic] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %complete_type.1: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %ptr.1: type = ptr_type %i32 [template] // CHECK:STDOUT: %int_5.1: Core.IntLiteral = int_value 5 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] @@ -191,7 +191,7 @@ class Outer(T:! type) { // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: class { -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class.1 @@ -506,9 +506,11 @@ class Outer(T:! type) { // CHECK:STDOUT: %D.1: %D.type.1 = struct_value () [symbolic] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %require_complete.1: = require_complete_type %Outer.1 [symbolic] // CHECK:STDOUT: %Outer.val.1: %Outer.1 = struct_value () [symbolic] // CHECK:STDOUT: %Inner.type.2: type = generic_class_type @Inner, @Outer(%U) [symbolic] // CHECK:STDOUT: %Inner.generic.2: %Inner.type.2 = struct_value () [symbolic] +// CHECK:STDOUT: %require_complete.2: = require_complete_type %Outer.2 [symbolic] // CHECK:STDOUT: %Outer.val.2: %Outer.2 = struct_value () [symbolic] // CHECK:STDOUT: %A.type.2: type = fn_type @A, @Inner(%T, %T) [symbolic] // CHECK:STDOUT: %A.2: %A.type.2 = struct_value () [symbolic] @@ -518,7 +520,9 @@ class Outer(T:! type) { // CHECK:STDOUT: %C.2: %C.type.2 = struct_value () [symbolic] // CHECK:STDOUT: %D.type.2: type = fn_type @D, @Inner(%T, %T) [symbolic] // CHECK:STDOUT: %D.2: %D.type.2 = struct_value () [symbolic] +// CHECK:STDOUT: %require_complete.3: = require_complete_type %Inner.2 [symbolic] // CHECK:STDOUT: %Inner.val.1: %Inner.2 = struct_value () [symbolic] +// CHECK:STDOUT: %require_complete.4: = require_complete_type %Inner.1 [symbolic] // CHECK:STDOUT: %Inner.val.2: %Inner.1 = struct_value () [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -644,6 +648,7 @@ class Outer(T:! type) { // CHECK:STDOUT: %Outer.loc4_22.1: type = class_type @Outer, @Outer(%T) [symbolic = %Outer.loc4_22.1 (constants.%Outer.1)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete: = require_complete_type @A.%Outer.loc4_22.1 (%Outer.1) [symbolic = %require_complete (constants.%require_complete.1)] // CHECK:STDOUT: %Outer.val: @A.%Outer.loc4_22.1 (%Outer.1) = struct_value () [symbolic = %Outer.val (constants.%Outer.val.1)] // CHECK:STDOUT: // CHECK:STDOUT: fn() -> %return.param_patt: @A.%Outer.loc4_22.1 (%Outer.1) { @@ -660,6 +665,7 @@ class Outer(T:! type) { // CHECK:STDOUT: %Outer.loc7_22.1: type = class_type @Outer, @Outer(%U) [symbolic = %Outer.loc7_22.1 (constants.%Outer.2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete: = require_complete_type @B.%Outer.loc7_22.1 (%Outer.2) [symbolic = %require_complete (constants.%require_complete.2)] // CHECK:STDOUT: %Outer.val: @B.%Outer.loc7_22.1 (%Outer.2) = struct_value () [symbolic = %Outer.val (constants.%Outer.val.2)] // CHECK:STDOUT: // CHECK:STDOUT: fn() -> %return.param_patt: @B.%Outer.loc7_22.1 (%Outer.2) { @@ -678,6 +684,7 @@ class Outer(T:! type) { // CHECK:STDOUT: %Inner.loc10_22.1: type = class_type @Inner, @Inner(%T, %T) [symbolic = %Inner.loc10_22.1 (constants.%Inner.2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete: = require_complete_type @C.%Inner.loc10_22.1 (%Inner.2) [symbolic = %require_complete (constants.%require_complete.3)] // CHECK:STDOUT: %Inner.val: @C.%Inner.loc10_22.1 (%Inner.2) = struct_value () [symbolic = %Inner.val (constants.%Inner.val.1)] // CHECK:STDOUT: // CHECK:STDOUT: fn() -> %return.param_patt: @C.%Inner.loc10_22.1 (%Inner.2) { @@ -697,6 +704,7 @@ class Outer(T:! type) { // CHECK:STDOUT: %Inner.loc13_22.1: type = class_type @Inner, @Inner(%T, %U) [symbolic = %Inner.loc13_22.1 (constants.%Inner.1)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete: = require_complete_type @D.%Inner.loc13_22.1 (%Inner.1) [symbolic = %require_complete (constants.%require_complete.4)] // CHECK:STDOUT: %Inner.val: @D.%Inner.loc13_22.1 (%Inner.1) = struct_value () [symbolic = %Inner.val (constants.%Inner.val.2)] // CHECK:STDOUT: // CHECK:STDOUT: fn() -> %return.param_patt: @D.%Inner.loc13_22.1 (%Inner.1) { diff --git a/toolchain/check/testdata/class/generic/field.carbon b/toolchain/check/testdata/class/generic/field.carbon index 3b861317ddf2b..1ebf70f19f5b9 100644 --- a/toolchain/check/testdata/class/generic/field.carbon +++ b/toolchain/check/testdata/class/generic/field.carbon @@ -32,6 +32,7 @@ fn H(U:! type, c: Class(U)) -> U { // CHECK:STDOUT: %Class.type: type = generic_class_type @Class [template] // CHECK:STDOUT: %Class.generic: %Class.type = struct_value () [template] // CHECK:STDOUT: %Class.1: type = class_type @Class, @Class(%T) [symbolic] +// CHECK:STDOUT: %require_complete.1: = require_complete_type %T [symbolic] // CHECK:STDOUT: %Class.elem.1: type = unbound_element_type %Class.1, %T [symbolic] // CHECK:STDOUT: %struct_type.x.1: type = struct_type {.x: %T} [symbolic] // CHECK:STDOUT: %complete_type.1: = complete_type_witness %struct_type.x.1 [symbolic] @@ -42,19 +43,23 @@ fn H(U:! type, c: Class(U)) -> U { // CHECK:STDOUT: %Class.2: type = class_type @Class, @Class(%i32) [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] +// CHECK:STDOUT: %complete_type.2: = complete_type_witness %i32 [template] // CHECK:STDOUT: %Class.elem.2: type = unbound_element_type %Class.2, %i32 [template] // CHECK:STDOUT: %struct_type.x.2: type = struct_type {.x: %i32} [template] -// CHECK:STDOUT: %complete_type.2: = complete_type_witness %struct_type.x.2 [template] +// CHECK:STDOUT: %complete_type.3: = complete_type_witness %struct_type.x.2 [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] +// CHECK:STDOUT: %require_complete.2: = require_complete_type %Class.1 [symbolic] // CHECK:STDOUT: %U: type = bind_symbolic_name U, 0 [symbolic] // CHECK:STDOUT: %U.patt: type = symbolic_binding_pattern U, 0 [symbolic] // CHECK:STDOUT: %Class.3: type = class_type @Class, @Class(%U) [symbolic] // CHECK:STDOUT: %H.type: type = fn_type @H [template] // CHECK:STDOUT: %H: %H.type = struct_value () [template] +// CHECK:STDOUT: %require_complete.3: = require_complete_type %U [symbolic] // CHECK:STDOUT: %Class.elem.3: type = unbound_element_type %Class.3, %U [symbolic] // CHECK:STDOUT: %struct_type.x.3: type = struct_type {.x: %U} [symbolic] -// CHECK:STDOUT: %complete_type.3: = complete_type_witness %struct_type.x.3 [symbolic] +// CHECK:STDOUT: %complete_type.4: = complete_type_witness %struct_type.x.3 [symbolic] +// CHECK:STDOUT: %require_complete.4: = require_complete_type %Class.3 [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -147,6 +152,7 @@ fn H(U:! type, c: Class(U)) -> U { // CHECK:STDOUT: %T.patt.loc11_13.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc11_13.2 (constants.%T.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete: = require_complete_type @Class.%T.loc11_13.2 (%T) [symbolic = %require_complete (constants.%require_complete.1)] // CHECK:STDOUT: %Class: type = class_type @Class, @Class(%T.loc11_13.2) [symbolic = %Class (constants.%Class.1)] // CHECK:STDOUT: %Class.elem: type = unbound_element_type @Class.%Class (%Class.1), @Class.%T.loc11_13.2 (%T) [symbolic = %Class.elem (constants.%Class.elem.1)] // CHECK:STDOUT: %struct_type.x: type = struct_type {.x: @Class.%T.loc11_13.2 (%T)} [symbolic = %struct_type.x (constants.%struct_type.x.1)] @@ -179,7 +185,9 @@ fn H(U:! type, c: Class(U)) -> U { // CHECK:STDOUT: %Class.loc19_26.2: type = class_type @Class, @Class(%T.loc19_6.2) [symbolic = %Class.loc19_26.2 (constants.%Class.1)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete.loc19: = require_complete_type @G.%Class.loc19_26.2 (%Class.1) [symbolic = %require_complete.loc19 (constants.%require_complete.2)] // CHECK:STDOUT: %Class.elem: type = unbound_element_type @G.%Class.loc19_26.2 (%Class.1), @G.%T.loc19_6.2 (%T) [symbolic = %Class.elem (constants.%Class.elem.1)] +// CHECK:STDOUT: %require_complete.loc20: = require_complete_type @G.%T.loc19_6.2 (%T) [symbolic = %require_complete.loc20 (constants.%require_complete.1)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%T.param_patt: type, %c.param_patt: @G.%Class.loc19_26.2 (%Class.1)) -> @G.%T.loc19_6.2 (%T) { // CHECK:STDOUT: !entry: @@ -197,6 +205,8 @@ fn H(U:! type, c: Class(U)) -> U { // CHECK:STDOUT: %Class.loc23_26.2: type = class_type @Class, @Class(%U.loc23_6.2) [symbolic = %Class.loc23_26.2 (constants.%Class.3)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete.loc23_29: = require_complete_type @H.%U.loc23_6.2 (%U) [symbolic = %require_complete.loc23_29 (constants.%require_complete.3)] +// CHECK:STDOUT: %require_complete.loc23_17: = require_complete_type @H.%Class.loc23_26.2 (%Class.3) [symbolic = %require_complete.loc23_17 (constants.%require_complete.4)] // CHECK:STDOUT: %Class.elem: type = unbound_element_type @H.%Class.loc23_26.2 (%Class.3), @H.%U.loc23_6.2 (%U) [symbolic = %Class.elem (constants.%Class.elem.3)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%U.param_patt: type, %c.param_patt: @H.%Class.loc23_26.2 (%Class.3)) -> @H.%U.loc23_6.2 (%U) { @@ -214,6 +224,7 @@ fn H(U:! type, c: Class(U)) -> U { // CHECK:STDOUT: %T.patt.loc11_13.2 => constants.%T // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete => constants.%require_complete.1 // CHECK:STDOUT: %Class => constants.%Class.1 // CHECK:STDOUT: %Class.elem => constants.%Class.elem.1 // CHECK:STDOUT: %struct_type.x => constants.%struct_type.x.1 @@ -230,10 +241,11 @@ fn H(U:! type, c: Class(U)) -> U { // CHECK:STDOUT: %T.patt.loc11_13.2 => constants.%i32 // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete => constants.%complete_type.2 // CHECK:STDOUT: %Class => constants.%Class.2 // CHECK:STDOUT: %Class.elem => constants.%Class.elem.2 // CHECK:STDOUT: %struct_type.x => constants.%struct_type.x.2 -// CHECK:STDOUT: %complete_type.loc13_1.2 => constants.%complete_type.2 +// CHECK:STDOUT: %complete_type.loc13_1.2 => constants.%complete_type.3 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(@G.%T.loc19_6.2) { @@ -252,10 +264,11 @@ fn H(U:! type, c: Class(U)) -> U { // CHECK:STDOUT: %T.patt.loc11_13.2 => constants.%U // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete => constants.%require_complete.3 // CHECK:STDOUT: %Class => constants.%Class.3 // CHECK:STDOUT: %Class.elem => constants.%Class.elem.3 // CHECK:STDOUT: %struct_type.x => constants.%struct_type.x.3 -// CHECK:STDOUT: %complete_type.loc13_1.2 => constants.%complete_type.3 +// CHECK:STDOUT: %complete_type.loc13_1.2 => constants.%complete_type.4 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(@H.%U.loc23_6.2) { diff --git a/toolchain/check/testdata/class/generic/import.carbon b/toolchain/check/testdata/class/generic/import.carbon index 2e3138016b2b9..9424168a6c5ac 100644 --- a/toolchain/check/testdata/class/generic/import.carbon +++ b/toolchain/check/testdata/class/generic/import.carbon @@ -102,7 +102,7 @@ class Class(U:! type) { // CHECK:STDOUT: %F.type.1: type = fn_type @F.1, @CompleteClass(%T) [symbolic] // CHECK:STDOUT: %F.1: %F.type.1 = struct_value () [symbolic] // CHECK:STDOUT: %struct_type.n: type = struct_type {.n: %i32} [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.n [template] +// CHECK:STDOUT: %complete_type.1: = complete_type_witness %struct_type.n [template] // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] @@ -196,7 +196,7 @@ class Class(U:! type) { // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.n [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.n [template = constants.%complete_type.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%CompleteClass.1 @@ -260,6 +260,7 @@ class Class(U:! type) { // CHECK:STDOUT: %Class.type: type = generic_class_type @Class [template] // CHECK:STDOUT: %Class.generic: %Class.type = struct_value () [template] // CHECK:STDOUT: %Class: type = class_type @Class, @Class(%T) [symbolic] +// CHECK:STDOUT: %require_complete.7: = require_complete_type %T [symbolic] // CHECK:STDOUT: %Class.elem: type = unbound_element_type %Class, %T [symbolic] // CHECK:STDOUT: %struct_type.x: type = struct_type {.x: %T} [symbolic] // CHECK:STDOUT: %complete_type.1: = complete_type_witness %struct_type.x [symbolic] @@ -344,6 +345,7 @@ class Class(U:! type) { // CHECK:STDOUT: %T.patt.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.1 (constants.%T.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete: = require_complete_type @Class.%T.1 (%T) [symbolic = %require_complete (constants.%require_complete.7)] // CHECK:STDOUT: %Class: type = class_type @Class, @Class(%T.1) [symbolic = %Class (constants.%Class)] // CHECK:STDOUT: %Class.elem: type = unbound_element_type @Class.%Class (%Class), @Class.%T.1 (%T) [symbolic = %Class.elem (constants.%Class.elem)] // CHECK:STDOUT: %struct_type.x: type = struct_type {.x: @Class.%T.1 (%T)} [symbolic = %struct_type.x (constants.%struct_type.x)] diff --git a/toolchain/check/testdata/class/generic/init.carbon b/toolchain/check/testdata/class/generic/init.carbon index 41fa787d3027b..bdfea5f7833f2 100644 --- a/toolchain/check/testdata/class/generic/init.carbon +++ b/toolchain/check/testdata/class/generic/init.carbon @@ -50,11 +50,13 @@ fn InitFromAdaptedSpecific(x: i32) -> i32 { // CHECK:STDOUT: %Class.type: type = generic_class_type @Class [template] // CHECK:STDOUT: %Class.generic: %Class.type = struct_value () [template] // CHECK:STDOUT: %Class.1: type = class_type @Class, @Class(%T) [symbolic] +// CHECK:STDOUT: %require_complete.1: = require_complete_type %T [symbolic] // CHECK:STDOUT: %Class.elem.1: type = unbound_element_type %Class.1, %T [symbolic] // CHECK:STDOUT: %struct_type.k.1: type = struct_type {.k: %T} [symbolic] // CHECK:STDOUT: %complete_type.1: = complete_type_witness %struct_type.k.1 [symbolic] // CHECK:STDOUT: %InitFromStructGeneric.type: type = fn_type @InitFromStructGeneric [template] // CHECK:STDOUT: %InitFromStructGeneric: %InitFromStructGeneric.type = struct_value () [template] +// CHECK:STDOUT: %require_complete.2: = require_complete_type %Class.1 [symbolic] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] // CHECK:STDOUT: %Int.type: type = fn_type @Int [template] // CHECK:STDOUT: %Int: %Int.type = struct_value () [template] @@ -62,9 +64,10 @@ fn InitFromAdaptedSpecific(x: i32) -> i32 { // CHECK:STDOUT: %InitFromStructSpecific.type: type = fn_type @InitFromStructSpecific [template] // CHECK:STDOUT: %InitFromStructSpecific: %InitFromStructSpecific.type = struct_value () [template] // CHECK:STDOUT: %Class.2: type = class_type @Class, @Class(%i32) [template] +// CHECK:STDOUT: %complete_type.2: = complete_type_witness %i32 [template] // CHECK:STDOUT: %Class.elem.2: type = unbound_element_type %Class.2, %i32 [template] // CHECK:STDOUT: %struct_type.k.2: type = struct_type {.k: %i32} [template] -// CHECK:STDOUT: %complete_type.2: = complete_type_witness %struct_type.k.2 [template] +// CHECK:STDOUT: %complete_type.3: = complete_type_witness %struct_type.k.2 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -133,6 +136,7 @@ fn InitFromAdaptedSpecific(x: i32) -> i32 { // CHECK:STDOUT: %T.patt.loc4_13.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_13.2 (constants.%T.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete: = require_complete_type @Class.%T.loc4_13.2 (%T) [symbolic = %require_complete (constants.%require_complete.1)] // CHECK:STDOUT: %Class: type = class_type @Class, @Class(%T.loc4_13.2) [symbolic = %Class (constants.%Class.1)] // CHECK:STDOUT: %Class.elem: type = unbound_element_type @Class.%Class (%Class.1), @Class.%T.loc4_13.2 (%T) [symbolic = %Class.elem (constants.%Class.elem.1)] // CHECK:STDOUT: %struct_type.k: type = struct_type {.k: @Class.%T.loc4_13.2 (%T)} [symbolic = %struct_type.k (constants.%struct_type.k.1)] @@ -155,7 +159,9 @@ fn InitFromAdaptedSpecific(x: i32) -> i32 { // CHECK:STDOUT: %T.patt.loc8_26.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_26.2 (constants.%T.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete.loc8: = require_complete_type @InitFromStructGeneric.%T.loc8_26.2 (%T) [symbolic = %require_complete.loc8 (constants.%require_complete.1)] // CHECK:STDOUT: %Class.loc9_17.2: type = class_type @Class, @Class(%T.loc8_26.2) [symbolic = %Class.loc9_17.2 (constants.%Class.1)] +// CHECK:STDOUT: %require_complete.loc9: = require_complete_type @InitFromStructGeneric.%Class.loc9_17.2 (%Class.1) [symbolic = %require_complete.loc9 (constants.%require_complete.2)] // CHECK:STDOUT: %struct_type.k: type = struct_type {.k: @InitFromStructGeneric.%T.loc8_26.2 (%T)} [symbolic = %struct_type.k (constants.%struct_type.k.1)] // CHECK:STDOUT: %Class.elem: type = unbound_element_type @InitFromStructGeneric.%Class.loc9_17.2 (%Class.1), @InitFromStructGeneric.%T.loc8_26.2 (%T) [symbolic = %Class.elem (constants.%Class.elem.1)] // CHECK:STDOUT: @@ -210,6 +216,7 @@ fn InitFromAdaptedSpecific(x: i32) -> i32 { // CHECK:STDOUT: %T.patt.loc4_13.2 => constants.%T // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete => constants.%require_complete.1 // CHECK:STDOUT: %Class => constants.%Class.1 // CHECK:STDOUT: %Class.elem => constants.%Class.elem.1 // CHECK:STDOUT: %struct_type.k => constants.%struct_type.k.1 @@ -236,10 +243,11 @@ fn InitFromAdaptedSpecific(x: i32) -> i32 { // CHECK:STDOUT: %T.patt.loc4_13.2 => constants.%i32 // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete => constants.%complete_type.2 // CHECK:STDOUT: %Class => constants.%Class.2 // CHECK:STDOUT: %Class.elem => constants.%Class.elem.2 // CHECK:STDOUT: %struct_type.k => constants.%struct_type.k.2 -// CHECK:STDOUT: %complete_type.loc6_1.2 => constants.%complete_type.2 +// CHECK:STDOUT: %complete_type.loc6_1.2 => constants.%complete_type.3 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- adapt.carbon @@ -250,9 +258,11 @@ fn InitFromAdaptedSpecific(x: i32) -> i32 { // CHECK:STDOUT: %Adapt.type: type = generic_class_type @Adapt [template] // CHECK:STDOUT: %Adapt.generic: %Adapt.type = struct_value () [template] // CHECK:STDOUT: %Adapt.1: type = class_type @Adapt, @Adapt(%T) [symbolic] +// CHECK:STDOUT: %require_complete.1: = require_complete_type %T [symbolic] // CHECK:STDOUT: %complete_type.1: = complete_type_witness %T [symbolic] // CHECK:STDOUT: %InitFromAdaptedGeneric.type: type = fn_type @InitFromAdaptedGeneric [template] // CHECK:STDOUT: %InitFromAdaptedGeneric: %InitFromAdaptedGeneric.type = struct_value () [template] +// CHECK:STDOUT: %require_complete.2: = require_complete_type %Adapt.1 [symbolic] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] // CHECK:STDOUT: %Int.type: type = fn_type @Int [template] // CHECK:STDOUT: %Int: %Int.type = struct_value () [template] @@ -329,6 +339,7 @@ fn InitFromAdaptedSpecific(x: i32) -> i32 { // CHECK:STDOUT: %T.patt.loc4_13.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_13.2 (constants.%T.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete: = require_complete_type @Adapt.%T.loc4_13.2 (%T) [symbolic = %require_complete (constants.%require_complete.1)] // CHECK:STDOUT: %complete_type.loc6_1.2: = complete_type_witness @Adapt.%T.loc4_13.2 (%T) [symbolic = %complete_type.loc6_1.2 (constants.%complete_type.1)] // CHECK:STDOUT: // CHECK:STDOUT: class { @@ -347,7 +358,9 @@ fn InitFromAdaptedSpecific(x: i32) -> i32 { // CHECK:STDOUT: %T.patt.loc8_27.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_27.2 (constants.%T.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete.loc8: = require_complete_type @InitFromAdaptedGeneric.%T.loc8_27.2 (%T) [symbolic = %require_complete.loc8 (constants.%require_complete.1)] // CHECK:STDOUT: %Adapt.loc9_23.2: type = class_type @Adapt, @Adapt(%T.loc8_27.2) [symbolic = %Adapt.loc9_23.2 (constants.%Adapt.1)] +// CHECK:STDOUT: %require_complete.loc9: = require_complete_type @InitFromAdaptedGeneric.%Adapt.loc9_23.2 (%Adapt.1) [symbolic = %require_complete.loc9 (constants.%require_complete.2)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%T.param_patt: type, %x.param_patt: @InitFromAdaptedGeneric.%T.loc8_27.2 (%T)) -> @InitFromAdaptedGeneric.%T.loc8_27.2 (%T) { // CHECK:STDOUT: !entry: @@ -389,6 +402,7 @@ fn InitFromAdaptedSpecific(x: i32) -> i32 { // CHECK:STDOUT: %T.patt.loc4_13.2 => constants.%T // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete => constants.%require_complete.1 // CHECK:STDOUT: %complete_type.loc6_1.2 => constants.%complete_type.1 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -407,6 +421,7 @@ fn InitFromAdaptedSpecific(x: i32) -> i32 { // CHECK:STDOUT: %T.patt.loc4_13.2 => constants.%i32 // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete => constants.%complete_type.2 // CHECK:STDOUT: %complete_type.loc6_1.2 => constants.%complete_type.2 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/generic/member_access.carbon b/toolchain/check/testdata/class/generic/member_access.carbon index 9df6e29ccaa78..c02c4e65b6e25 100644 --- a/toolchain/check/testdata/class/generic/member_access.carbon +++ b/toolchain/check/testdata/class/generic/member_access.carbon @@ -56,6 +56,7 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: %Class.type: type = generic_class_type @Class [template] // CHECK:STDOUT: %Class.generic: %Class.type = struct_value () [template] // CHECK:STDOUT: %Class.1: type = class_type @Class, @Class(%T) [symbolic] +// CHECK:STDOUT: %require_complete.1: = require_complete_type %T [symbolic] // CHECK:STDOUT: %Class.elem.1: type = unbound_element_type %Class.1, %T [symbolic] // CHECK:STDOUT: %Get.type.1: type = fn_type @Get, @Class(%T) [symbolic] // CHECK:STDOUT: %Get.1: %Get.type.1 = struct_value () [symbolic] @@ -65,6 +66,9 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: %GetAddr.1: %GetAddr.type.1 = struct_value () [symbolic] // CHECK:STDOUT: %struct_type.x.1: type = struct_type {.x: %T} [symbolic] // CHECK:STDOUT: %complete_type.1: = complete_type_witness %struct_type.x.1 [symbolic] +// CHECK:STDOUT: %require_complete.2: = require_complete_type %Class.1 [symbolic] +// CHECK:STDOUT: %require_complete.3: = require_complete_type %ptr.2 [symbolic] +// CHECK:STDOUT: %require_complete.4: = require_complete_type %ptr.1 [symbolic] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] // CHECK:STDOUT: %Int.type: type = fn_type @Int [template] // CHECK:STDOUT: %Int: %Int.type = struct_value () [template] @@ -72,19 +76,22 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: %Class.2: type = class_type @Class, @Class(%i32) [template] // CHECK:STDOUT: %DirectFieldAccess.type: type = fn_type @DirectFieldAccess [template] // CHECK:STDOUT: %DirectFieldAccess: %DirectFieldAccess.type = struct_value () [template] +// CHECK:STDOUT: %complete_type.2: = complete_type_witness %i32 [template] // CHECK:STDOUT: %Class.elem.2: type = unbound_element_type %Class.2, %i32 [template] // CHECK:STDOUT: %Get.type.2: type = fn_type @Get, @Class(%i32) [template] // CHECK:STDOUT: %Get.2: %Get.type.2 = struct_value () [template] // CHECK:STDOUT: %GetAddr.type.2: type = fn_type @GetAddr, @Class(%i32) [template] // CHECK:STDOUT: %GetAddr.2: %GetAddr.type.2 = struct_value () [template] // CHECK:STDOUT: %struct_type.x.2: type = struct_type {.x: %i32} [template] -// CHECK:STDOUT: %complete_type.2: = complete_type_witness %struct_type.x.2 [template] +// CHECK:STDOUT: %complete_type.3: = complete_type_witness %struct_type.x.2 [template] // CHECK:STDOUT: %MethodCall.type: type = fn_type @MethodCall [template] // CHECK:STDOUT: %MethodCall: %MethodCall.type = struct_value () [template] // CHECK:STDOUT: %ptr.5: type = ptr_type %Class.2 [template] // CHECK:STDOUT: %AddrMethodCall.type: type = fn_type @AddrMethodCall [template] // CHECK:STDOUT: %AddrMethodCall: %AddrMethodCall.type = struct_value () [template] // CHECK:STDOUT: %ptr.6: type = ptr_type %i32 [template] +// CHECK:STDOUT: %complete_type.4: = complete_type_witness %ptr.6 [template] +// CHECK:STDOUT: %complete_type.5: = complete_type_witness %ptr.5 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -182,6 +189,7 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: %T.patt.loc2_13.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc2_13.2 (constants.%T.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete: = require_complete_type @Class.%T.loc2_13.2 (%T) [symbolic = %require_complete (constants.%require_complete.1)] // CHECK:STDOUT: %Class: type = class_type @Class, @Class(%T.loc2_13.2) [symbolic = %Class (constants.%Class.1)] // CHECK:STDOUT: %Class.elem: type = unbound_element_type @Class.%Class (%Class.1), @Class.%T.loc2_13.2 (%T) [symbolic = %Class.elem (constants.%Class.elem.1)] // CHECK:STDOUT: %Get.type: type = fn_type @Get, @Class(%T.loc2_13.2) [symbolic = %Get.type (constants.%Get.type.1)] @@ -241,7 +249,9 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: %Class: type = class_type @Class, @Class(%T) [symbolic = %Class (constants.%Class.1)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete.loc5_14: = require_complete_type @Get.%Class (%Class.1) [symbolic = %require_complete.loc5_14 (constants.%require_complete.2)] // CHECK:STDOUT: %Class.elem: type = unbound_element_type @Get.%Class (%Class.1), @Get.%T (%T) [symbolic = %Class.elem (constants.%Class.elem.1)] +// CHECK:STDOUT: %require_complete.loc5_42: = require_complete_type @Get.%T (%T) [symbolic = %require_complete.loc5_42 (constants.%require_complete.1)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Get.%Class (%Class.1)]() -> @Get.%T (%T) { // CHECK:STDOUT: !entry: @@ -260,6 +270,9 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: %ptr.loc7_38.1: type = ptr_type @GetAddr.%T (%T) [symbolic = %ptr.loc7_38.1 (constants.%ptr.2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete.loc7_34: = require_complete_type @GetAddr.%ptr.loc7_38.1 (%ptr.2) [symbolic = %require_complete.loc7_34 (constants.%require_complete.3)] +// CHECK:STDOUT: %require_complete.loc7_23: = require_complete_type @GetAddr.%ptr.loc7_29.1 (%ptr.1) [symbolic = %require_complete.loc7_23 (constants.%require_complete.4)] +// CHECK:STDOUT: %require_complete.loc7_54: = require_complete_type @GetAddr.%Class (%Class.1) [symbolic = %require_complete.loc7_54 (constants.%require_complete.2)] // CHECK:STDOUT: %Class.elem: type = unbound_element_type @GetAddr.%Class (%Class.1), @GetAddr.%T (%T) [symbolic = %Class.elem (constants.%Class.elem.1)] // CHECK:STDOUT: // CHECK:STDOUT: fn[addr %self.param_patt: @GetAddr.%ptr.loc7_29.1 (%ptr.1)]() -> @GetAddr.%ptr.loc7_38.1 (%ptr.2) { @@ -317,6 +330,7 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: %T.patt.loc2_13.2 => constants.%T // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete => constants.%require_complete.1 // CHECK:STDOUT: %Class => constants.%Class.1 // CHECK:STDOUT: %Class.elem => constants.%Class.elem.1 // CHECK:STDOUT: %Get.type => constants.%Get.type.1 @@ -359,6 +373,7 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: %T.patt.loc2_13.2 => constants.%i32 // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete => constants.%complete_type.2 // CHECK:STDOUT: %Class => constants.%Class.2 // CHECK:STDOUT: %Class.elem => constants.%Class.elem.2 // CHECK:STDOUT: %Get.type => constants.%Get.type.2 @@ -366,7 +381,7 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: %GetAddr.type => constants.%GetAddr.type.2 // CHECK:STDOUT: %GetAddr => constants.%GetAddr.2 // CHECK:STDOUT: %struct_type.x => constants.%struct_type.x.2 -// CHECK:STDOUT: %complete_type.loc8_1.2 => constants.%complete_type.2 +// CHECK:STDOUT: %complete_type.loc8_1.2 => constants.%complete_type.3 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Get(constants.%i32) { @@ -374,7 +389,9 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: %Class => constants.%Class.2 // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete.loc5_14 => constants.%complete_type.3 // CHECK:STDOUT: %Class.elem => constants.%Class.elem.2 +// CHECK:STDOUT: %require_complete.loc5_42 => constants.%complete_type.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @GetAddr(constants.%i32) { @@ -384,6 +401,9 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: %ptr.loc7_38.1 => constants.%ptr.6 // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete.loc7_34 => constants.%complete_type.4 +// CHECK:STDOUT: %require_complete.loc7_23 => constants.%complete_type.5 +// CHECK:STDOUT: %require_complete.loc7_54 => constants.%complete_type.3 // CHECK:STDOUT: %Class.elem => constants.%Class.elem.2 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -399,10 +419,13 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: %Make: %Make.type = struct_value () [symbolic] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %require_complete.1: = require_complete_type %Class [symbolic] // CHECK:STDOUT: %Class.val: %Class = struct_value () [symbolic] // CHECK:STDOUT: %StaticMemberFunctionCall.type: type = fn_type @StaticMemberFunctionCall [template] // CHECK:STDOUT: %StaticMemberFunctionCall: %StaticMemberFunctionCall.type = struct_value () [template] // CHECK:STDOUT: %Make.specific_fn: = specific_function %Make, @Make(%T) [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.3: type = facet_type <@ImplicitAs, @ImplicitAs(%Class)> [symbolic] +// CHECK:STDOUT: %require_complete.2: = require_complete_type %ImplicitAs.type.3 [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -476,6 +499,7 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: %Class.loc5_23.1: type = class_type @Class, @Class(%T) [symbolic = %Class.loc5_23.1 (constants.%Class)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete: = require_complete_type @Make.%Class.loc5_23.1 (%Class) [symbolic = %require_complete (constants.%require_complete.1)] // CHECK:STDOUT: %Class.val: @Make.%Class.loc5_23.1 (%Class) = struct_value () [symbolic = %Class.val (constants.%Class.val)] // CHECK:STDOUT: // CHECK:STDOUT: fn() -> %return.param_patt: @Make.%Class.loc5_23.1 (%Class) { @@ -493,9 +517,12 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: %Class.loc8_49.2: type = class_type @Class, @Class(%T.loc8_29.2) [symbolic = %Class.loc8_49.2 (constants.%Class)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete.loc15_18: = require_complete_type @StaticMemberFunctionCall.%Class.loc8_49.2 (%Class) [symbolic = %require_complete.loc15_18 (constants.%require_complete.1)] // CHECK:STDOUT: %Make.type: type = fn_type @Make, @Class(%T.loc8_29.2) [symbolic = %Make.type (constants.%Make.type)] // CHECK:STDOUT: %Make: @StaticMemberFunctionCall.%Make.type (%Make.type) = struct_value () [symbolic = %Make (constants.%Make)] // CHECK:STDOUT: %Make.specific_fn.loc15_18.2: = specific_function %Make, @Make(%T.loc8_29.2) [symbolic = %Make.specific_fn.loc15_18.2 (constants.%Make.specific_fn)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Class.loc8_49.2)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.3)] +// CHECK:STDOUT: %require_complete.loc15_25: = require_complete_type @StaticMemberFunctionCall.%ImplicitAs.type (%ImplicitAs.type.3) [symbolic = %require_complete.loc15_25 (constants.%require_complete.2)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%T.param_patt: type) -> %return.param_patt: @StaticMemberFunctionCall.%Class.loc8_49.2 (%Class) { // CHECK:STDOUT: !entry: @@ -531,6 +558,7 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: %Class.loc5_23.1 => constants.%Class // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete => constants.%require_complete.1 // CHECK:STDOUT: %Class.val => constants.%Class.val // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/generic/member_inline.carbon b/toolchain/check/testdata/class/generic/member_inline.carbon index 6cc17eac9b334..53b910784fe49 100644 --- a/toolchain/check/testdata/class/generic/member_inline.carbon +++ b/toolchain/check/testdata/class/generic/member_inline.carbon @@ -50,9 +50,11 @@ class C(T:! type) { // CHECK:STDOUT: %F: %F.type = struct_value () [symbolic] // CHECK:STDOUT: %G.type: type = fn_type @G, @Class(%T) [symbolic] // CHECK:STDOUT: %G: %G.type = struct_value () [symbolic] +// CHECK:STDOUT: %require_complete.1: = require_complete_type %T [symbolic] // CHECK:STDOUT: %Class.elem: type = unbound_element_type %Class, %T [symbolic] // CHECK:STDOUT: %struct_type.n: type = struct_type {.n: %T} [symbolic] // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.n [symbolic] +// CHECK:STDOUT: %require_complete.2: = require_complete_type %Class [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -86,6 +88,7 @@ class C(T:! type) { // CHECK:STDOUT: %F: @Class.%F.type (%F.type) = struct_value () [symbolic = %F (constants.%F)] // CHECK:STDOUT: %G.type: type = fn_type @G, @Class(%T.loc4_13.2) [symbolic = %G.type (constants.%G.type)] // CHECK:STDOUT: %G: @Class.%G.type (%G.type) = struct_value () [symbolic = %G (constants.%G)] +// CHECK:STDOUT: %require_complete: = require_complete_type @Class.%T.loc4_13.2 (%T) [symbolic = %require_complete (constants.%require_complete.1)] // CHECK:STDOUT: %Class: type = class_type @Class, @Class(%T.loc4_13.2) [symbolic = %Class (constants.%Class)] // CHECK:STDOUT: %Class.elem: type = unbound_element_type @Class.%Class (%Class), @Class.%T.loc4_13.2 (%T) [symbolic = %Class.elem (constants.%Class.elem)] // CHECK:STDOUT: %struct_type.n: type = struct_type {.n: @Class.%T.loc4_13.2 (%T)} [symbolic = %struct_type.n (constants.%struct_type.n)] @@ -136,6 +139,7 @@ class C(T:! type) { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete: = require_complete_type @F.%T (%T) [symbolic = %require_complete (constants.%require_complete.1)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%n.param_patt: @F.%T (%T)) -> @F.%T (%T) { // CHECK:STDOUT: !entry: @@ -149,7 +153,9 @@ class C(T:! type) { // CHECK:STDOUT: %Class: type = class_type @Class, @Class(%T) [symbolic = %Class (constants.%Class)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete.loc9: = require_complete_type @G.%Class (%Class) [symbolic = %require_complete.loc9 (constants.%require_complete.2)] // CHECK:STDOUT: %Class.elem: type = unbound_element_type @G.%Class (%Class), @G.%T (%T) [symbolic = %Class.elem (constants.%Class.elem)] +// CHECK:STDOUT: %require_complete.loc10: = require_complete_type @G.%T (%T) [symbolic = %require_complete.loc10 (constants.%require_complete.1)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @G.%Class (%Class)]() -> @G.%T (%T) { // CHECK:STDOUT: !entry: @@ -170,6 +176,7 @@ class C(T:! type) { // CHECK:STDOUT: %F => constants.%F // CHECK:STDOUT: %G.type => constants.%G.type // CHECK:STDOUT: %G => constants.%G +// CHECK:STDOUT: %require_complete => constants.%require_complete.1 // CHECK:STDOUT: %Class => constants.%Class // CHECK:STDOUT: %Class.elem => constants.%Class.elem // CHECK:STDOUT: %struct_type.n => constants.%struct_type.n diff --git a/toolchain/check/testdata/class/generic/member_lookup.carbon b/toolchain/check/testdata/class/generic/member_lookup.carbon index ef262019aea9b..aef2efd7d1403 100644 --- a/toolchain/check/testdata/class/generic/member_lookup.carbon +++ b/toolchain/check/testdata/class/generic/member_lookup.carbon @@ -77,18 +77,21 @@ fn AccessMissingConcrete(x: Derived(i32)) -> i32 { // CHECK:STDOUT: %Base.type: type = generic_class_type @Base [template] // CHECK:STDOUT: %Base.generic: %Base.type = struct_value () [template] // CHECK:STDOUT: %Base.1: type = class_type @Base, @Base(%T) [symbolic] +// CHECK:STDOUT: %require_complete.1: = require_complete_type %T [symbolic] // CHECK:STDOUT: %Base.elem.1: type = unbound_element_type %Base.1, %T [symbolic] // CHECK:STDOUT: %struct_type.b.1: type = struct_type {.b: %T} [symbolic] // CHECK:STDOUT: %complete_type.1: = complete_type_witness %struct_type.b.1 [symbolic] // CHECK:STDOUT: %Derived.type: type = generic_class_type @Derived [template] // CHECK:STDOUT: %Derived.generic: %Derived.type = struct_value () [template] // CHECK:STDOUT: %Derived.1: type = class_type @Derived, @Derived(%T) [symbolic] +// CHECK:STDOUT: %require_complete.2: = require_complete_type %Base.1 [symbolic] // CHECK:STDOUT: %Derived.elem.1: type = unbound_element_type %Derived.1, %Base.1 [symbolic] // CHECK:STDOUT: %Derived.elem.2: type = unbound_element_type %Derived.1, %T [symbolic] // CHECK:STDOUT: %struct_type.base.d.1: type = struct_type {.base: %Base.1, .d: %T} [symbolic] // CHECK:STDOUT: %complete_type.2: = complete_type_witness %struct_type.base.d.1 [symbolic] // CHECK:STDOUT: %AccessDerived.type: type = fn_type @AccessDerived [template] // CHECK:STDOUT: %AccessDerived: %AccessDerived.type = struct_value () [template] +// CHECK:STDOUT: %require_complete.3: = require_complete_type %Derived.1 [symbolic] // CHECK:STDOUT: %AccessBase.type: type = fn_type @AccessBase [template] // CHECK:STDOUT: %AccessBase: %AccessBase.type = struct_value () [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] @@ -99,13 +102,14 @@ fn AccessMissingConcrete(x: Derived(i32)) -> i32 { // CHECK:STDOUT: %AccessConcrete.type: type = fn_type @AccessConcrete [template] // CHECK:STDOUT: %AccessConcrete: %AccessConcrete.type = struct_value () [template] // CHECK:STDOUT: %Base.2: type = class_type @Base, @Base(%i32) [template] -// CHECK:STDOUT: %Derived.elem.3: type = unbound_element_type %Derived.2, %Base.2 [template] -// CHECK:STDOUT: %Derived.elem.4: type = unbound_element_type %Derived.2, %i32 [template] -// CHECK:STDOUT: %struct_type.base.d.3: type = struct_type {.base: %Base.2, .d: %i32} [template] -// CHECK:STDOUT: %complete_type.3: = complete_type_witness %struct_type.base.d.3 [template] +// CHECK:STDOUT: %complete_type.3: = complete_type_witness %i32 [template] // CHECK:STDOUT: %Base.elem.2: type = unbound_element_type %Base.2, %i32 [template] // CHECK:STDOUT: %struct_type.b.2: type = struct_type {.b: %i32} [template] // CHECK:STDOUT: %complete_type.4: = complete_type_witness %struct_type.b.2 [template] +// CHECK:STDOUT: %Derived.elem.3: type = unbound_element_type %Derived.2, %Base.2 [template] +// CHECK:STDOUT: %Derived.elem.4: type = unbound_element_type %Derived.2, %i32 [template] +// CHECK:STDOUT: %struct_type.base.d.3: type = struct_type {.base: %Base.2, .d: %i32} [template] +// CHECK:STDOUT: %complete_type.5: = complete_type_witness %struct_type.base.d.3 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -206,6 +210,7 @@ fn AccessMissingConcrete(x: Derived(i32)) -> i32 { // CHECK:STDOUT: %T.patt.loc4_17.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_17.2 (constants.%T.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete: = require_complete_type @Base.%T.loc4_17.2 (%T) [symbolic = %require_complete (constants.%require_complete.1)] // CHECK:STDOUT: %Base: type = class_type @Base, @Base(%T.loc4_17.2) [symbolic = %Base (constants.%Base.1)] // CHECK:STDOUT: %Base.elem: type = unbound_element_type @Base.%Base (%Base.1), @Base.%T.loc4_17.2 (%T) [symbolic = %Base.elem (constants.%Base.elem.1)] // CHECK:STDOUT: %struct_type.b: type = struct_type {.b: @Base.%T.loc4_17.2 (%T)} [symbolic = %struct_type.b (constants.%struct_type.b.1)] @@ -229,8 +234,10 @@ fn AccessMissingConcrete(x: Derived(i32)) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Base.loc9_22.2: type = class_type @Base, @Base(%T.loc8_15.2) [symbolic = %Base.loc9_22.2 (constants.%Base.1)] +// CHECK:STDOUT: %require_complete.loc9: = require_complete_type @Derived.%Base.loc9_22.2 (%Base.1) [symbolic = %require_complete.loc9 (constants.%require_complete.2)] // CHECK:STDOUT: %Derived: type = class_type @Derived, @Derived(%T.loc8_15.2) [symbolic = %Derived (constants.%Derived.1)] // CHECK:STDOUT: %Derived.elem.loc9: type = unbound_element_type @Derived.%Derived (%Derived.1), @Derived.%Base.loc9_22.2 (%Base.1) [symbolic = %Derived.elem.loc9 (constants.%Derived.elem.1)] +// CHECK:STDOUT: %require_complete.loc10: = require_complete_type @Derived.%T.loc8_15.2 (%T) [symbolic = %require_complete.loc10 (constants.%require_complete.1)] // CHECK:STDOUT: %Derived.elem.loc10: type = unbound_element_type @Derived.%Derived (%Derived.1), @Derived.%T.loc8_15.2 (%T) [symbolic = %Derived.elem.loc10 (constants.%Derived.elem.2)] // CHECK:STDOUT: %struct_type.base.d: type = struct_type {.base: @Derived.%Base.loc9_22.2 (%Base.1), .d: @Derived.%T.loc8_15.2 (%T)} [symbolic = %struct_type.base.d (constants.%struct_type.base.d.1)] // CHECK:STDOUT: %complete_type.loc11_1.2: = complete_type_witness @Derived.%struct_type.base.d (%struct_type.base.d.1) [symbolic = %complete_type.loc11_1.2 (constants.%complete_type.2)] @@ -259,7 +266,9 @@ fn AccessMissingConcrete(x: Derived(i32)) -> i32 { // CHECK:STDOUT: %Derived.loc13_40.2: type = class_type @Derived, @Derived(%T.loc13_18.2) [symbolic = %Derived.loc13_40.2 (constants.%Derived.1)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete.loc13: = require_complete_type @AccessDerived.%Derived.loc13_40.2 (%Derived.1) [symbolic = %require_complete.loc13 (constants.%require_complete.3)] // CHECK:STDOUT: %Derived.elem: type = unbound_element_type @AccessDerived.%Derived.loc13_40.2 (%Derived.1), @AccessDerived.%T.loc13_18.2 (%T) [symbolic = %Derived.elem (constants.%Derived.elem.2)] +// CHECK:STDOUT: %require_complete.loc14: = require_complete_type @AccessDerived.%T.loc13_18.2 (%T) [symbolic = %require_complete.loc14 (constants.%require_complete.1)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%T.param_patt: type](%x.param_patt: @AccessDerived.%Derived.loc13_40.2 (%Derived.1)) -> @AccessDerived.%T.loc13_18.2 (%T) { // CHECK:STDOUT: !entry: @@ -277,8 +286,11 @@ fn AccessMissingConcrete(x: Derived(i32)) -> i32 { // CHECK:STDOUT: %Derived.loc17_37.2: type = class_type @Derived, @Derived(%T.loc17_15.2) [symbolic = %Derived.loc17_37.2 (constants.%Derived.1)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete.loc17: = require_complete_type @AccessBase.%Derived.loc17_37.2 (%Derived.1) [symbolic = %require_complete.loc17 (constants.%require_complete.3)] // CHECK:STDOUT: %Base: type = class_type @Base, @Base(%T.loc17_15.2) [symbolic = %Base (constants.%Base.1)] +// CHECK:STDOUT: %require_complete.loc18_11: = require_complete_type @AccessBase.%Base (%Base.1) [symbolic = %require_complete.loc18_11 (constants.%require_complete.2)] // CHECK:STDOUT: %Base.elem: type = unbound_element_type @AccessBase.%Base (%Base.1), @AccessBase.%T.loc17_15.2 (%T) [symbolic = %Base.elem (constants.%Base.elem.1)] +// CHECK:STDOUT: %require_complete.loc18_13: = require_complete_type @AccessBase.%T.loc17_15.2 (%T) [symbolic = %require_complete.loc18_13 (constants.%require_complete.1)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%T.param_patt: type](%x.param_patt: @AccessBase.%Derived.loc17_37.2 (%Derived.1)) -> @AccessBase.%T.loc17_15.2 (%T) { // CHECK:STDOUT: !entry: @@ -308,6 +320,7 @@ fn AccessMissingConcrete(x: Derived(i32)) -> i32 { // CHECK:STDOUT: %T.patt.loc4_17.2 => constants.%T // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete => constants.%require_complete.1 // CHECK:STDOUT: %Base => constants.%Base.1 // CHECK:STDOUT: %Base.elem => constants.%Base.elem.1 // CHECK:STDOUT: %struct_type.b => constants.%struct_type.b.1 @@ -325,8 +338,10 @@ fn AccessMissingConcrete(x: Derived(i32)) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Base.loc9_22.2 => constants.%Base.1 +// CHECK:STDOUT: %require_complete.loc9 => constants.%require_complete.2 // CHECK:STDOUT: %Derived => constants.%Derived.1 // CHECK:STDOUT: %Derived.elem.loc9 => constants.%Derived.elem.1 +// CHECK:STDOUT: %require_complete.loc10 => constants.%require_complete.1 // CHECK:STDOUT: %Derived.elem.loc10 => constants.%Derived.elem.2 // CHECK:STDOUT: %struct_type.base.d => constants.%struct_type.base.d.1 // CHECK:STDOUT: %complete_type.loc11_1.2 => constants.%complete_type.2 @@ -375,11 +390,13 @@ fn AccessMissingConcrete(x: Derived(i32)) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Base.loc9_22.2 => constants.%Base.2 +// CHECK:STDOUT: %require_complete.loc9 => constants.%complete_type.4 // CHECK:STDOUT: %Derived => constants.%Derived.2 // CHECK:STDOUT: %Derived.elem.loc9 => constants.%Derived.elem.3 +// CHECK:STDOUT: %require_complete.loc10 => constants.%complete_type.3 // CHECK:STDOUT: %Derived.elem.loc10 => constants.%Derived.elem.4 // CHECK:STDOUT: %struct_type.base.d => constants.%struct_type.base.d.3 -// CHECK:STDOUT: %complete_type.loc11_1.2 => constants.%complete_type.3 +// CHECK:STDOUT: %complete_type.loc11_1.2 => constants.%complete_type.5 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Base(constants.%i32) { @@ -387,6 +404,7 @@ fn AccessMissingConcrete(x: Derived(i32)) -> i32 { // CHECK:STDOUT: %T.patt.loc4_17.2 => constants.%i32 // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete => constants.%complete_type.3 // CHECK:STDOUT: %Base => constants.%Base.2 // CHECK:STDOUT: %Base.elem => constants.%Base.elem.2 // CHECK:STDOUT: %struct_type.b => constants.%struct_type.b.2 @@ -401,12 +419,14 @@ fn AccessMissingConcrete(x: Derived(i32)) -> i32 { // CHECK:STDOUT: %Base.type: type = generic_class_type @Base [template] // CHECK:STDOUT: %Base.generic: %Base.type = struct_value () [template] // CHECK:STDOUT: %Base.1: type = class_type @Base, @Base(%T) [symbolic] +// CHECK:STDOUT: %require_complete.1: = require_complete_type %T [symbolic] // CHECK:STDOUT: %Base.elem.1: type = unbound_element_type %Base.1, %T [symbolic] // CHECK:STDOUT: %struct_type.b.1: type = struct_type {.b: %T} [symbolic] // CHECK:STDOUT: %complete_type.1: = complete_type_witness %struct_type.b.1 [symbolic] // CHECK:STDOUT: %Derived.type: type = generic_class_type @Derived [template] // CHECK:STDOUT: %Derived.generic: %Derived.type = struct_value () [template] // CHECK:STDOUT: %Derived.1: type = class_type @Derived, @Derived(%T) [symbolic] +// CHECK:STDOUT: %require_complete.2: = require_complete_type %Base.1 [symbolic] // CHECK:STDOUT: %Derived.elem.1: type = unbound_element_type %Derived.1, %Base.1 [symbolic] // CHECK:STDOUT: %Derived.elem.2: type = unbound_element_type %Derived.1, %T [symbolic] // CHECK:STDOUT: %struct_type.base.d.1: type = struct_type {.base: %Base.1, .d: %T} [symbolic] @@ -415,6 +435,7 @@ fn AccessMissingConcrete(x: Derived(i32)) -> i32 { // CHECK:STDOUT: %AccessMissingBase: %AccessMissingBase.type = struct_value () [template] // CHECK:STDOUT: %AccessMissingDerived.type: type = fn_type @AccessMissingDerived [template] // CHECK:STDOUT: %AccessMissingDerived: %AccessMissingDerived.type = struct_value () [template] +// CHECK:STDOUT: %require_complete.3: = require_complete_type %Derived.1 [symbolic] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] // CHECK:STDOUT: %Int.type: type = fn_type @Int [template] // CHECK:STDOUT: %Int: %Int.type = struct_value () [template] @@ -423,13 +444,14 @@ fn AccessMissingConcrete(x: Derived(i32)) -> i32 { // CHECK:STDOUT: %AccessMissingConcrete.type: type = fn_type @AccessMissingConcrete [template] // CHECK:STDOUT: %AccessMissingConcrete: %AccessMissingConcrete.type = struct_value () [template] // CHECK:STDOUT: %Base.2: type = class_type @Base, @Base(%i32) [template] -// CHECK:STDOUT: %Derived.elem.3: type = unbound_element_type %Derived.2, %Base.2 [template] -// CHECK:STDOUT: %Derived.elem.4: type = unbound_element_type %Derived.2, %i32 [template] -// CHECK:STDOUT: %struct_type.base.d.3: type = struct_type {.base: %Base.2, .d: %i32} [template] -// CHECK:STDOUT: %complete_type.3: = complete_type_witness %struct_type.base.d.3 [template] +// CHECK:STDOUT: %complete_type.3: = complete_type_witness %i32 [template] // CHECK:STDOUT: %Base.elem.2: type = unbound_element_type %Base.2, %i32 [template] // CHECK:STDOUT: %struct_type.b.2: type = struct_type {.b: %i32} [template] // CHECK:STDOUT: %complete_type.4: = complete_type_witness %struct_type.b.2 [template] +// CHECK:STDOUT: %Derived.elem.3: type = unbound_element_type %Derived.2, %Base.2 [template] +// CHECK:STDOUT: %Derived.elem.4: type = unbound_element_type %Derived.2, %i32 [template] +// CHECK:STDOUT: %struct_type.base.d.3: type = struct_type {.base: %Base.2, .d: %i32} [template] +// CHECK:STDOUT: %complete_type.5: = complete_type_witness %struct_type.base.d.3 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -530,6 +552,7 @@ fn AccessMissingConcrete(x: Derived(i32)) -> i32 { // CHECK:STDOUT: %T.patt.loc4_17.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_17.2 (constants.%T.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete: = require_complete_type @Base.%T.loc4_17.2 (%T) [symbolic = %require_complete (constants.%require_complete.1)] // CHECK:STDOUT: %Base: type = class_type @Base, @Base(%T.loc4_17.2) [symbolic = %Base (constants.%Base.1)] // CHECK:STDOUT: %Base.elem: type = unbound_element_type @Base.%Base (%Base.1), @Base.%T.loc4_17.2 (%T) [symbolic = %Base.elem (constants.%Base.elem.1)] // CHECK:STDOUT: %struct_type.b: type = struct_type {.b: @Base.%T.loc4_17.2 (%T)} [symbolic = %struct_type.b (constants.%struct_type.b.1)] @@ -553,8 +576,10 @@ fn AccessMissingConcrete(x: Derived(i32)) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Base.loc9_22.2: type = class_type @Base, @Base(%T.loc8_15.2) [symbolic = %Base.loc9_22.2 (constants.%Base.1)] +// CHECK:STDOUT: %require_complete.loc9: = require_complete_type @Derived.%Base.loc9_22.2 (%Base.1) [symbolic = %require_complete.loc9 (constants.%require_complete.2)] // CHECK:STDOUT: %Derived: type = class_type @Derived, @Derived(%T.loc8_15.2) [symbolic = %Derived (constants.%Derived.1)] // CHECK:STDOUT: %Derived.elem.loc9: type = unbound_element_type @Derived.%Derived (%Derived.1), @Derived.%Base.loc9_22.2 (%Base.1) [symbolic = %Derived.elem.loc9 (constants.%Derived.elem.1)] +// CHECK:STDOUT: %require_complete.loc10: = require_complete_type @Derived.%T.loc8_15.2 (%T) [symbolic = %require_complete.loc10 (constants.%require_complete.1)] // CHECK:STDOUT: %Derived.elem.loc10: type = unbound_element_type @Derived.%Derived (%Derived.1), @Derived.%T.loc8_15.2 (%T) [symbolic = %Derived.elem.loc10 (constants.%Derived.elem.2)] // CHECK:STDOUT: %struct_type.base.d: type = struct_type {.base: @Derived.%Base.loc9_22.2 (%Base.1), .d: @Derived.%T.loc8_15.2 (%T)} [symbolic = %struct_type.base.d (constants.%struct_type.base.d.1)] // CHECK:STDOUT: %complete_type.loc11_1.2: = complete_type_witness @Derived.%struct_type.base.d (%struct_type.base.d.1) [symbolic = %complete_type.loc11_1.2 (constants.%complete_type.2)] @@ -583,6 +608,7 @@ fn AccessMissingConcrete(x: Derived(i32)) -> i32 { // CHECK:STDOUT: %Base.loc13_41.2: type = class_type @Base, @Base(%T.loc13_22.2) [symbolic = %Base.loc13_41.2 (constants.%Base.1)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete: = require_complete_type @AccessMissingBase.%Base.loc13_41.2 (%Base.1) [symbolic = %require_complete (constants.%require_complete.2)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%T.param_patt: type](%x.param_patt: @AccessMissingBase.%Base.loc13_41.2 (%Base.1)) -> @AccessMissingBase.%T.loc13_22.2 (%T) { // CHECK:STDOUT: !entry: @@ -598,6 +624,9 @@ fn AccessMissingConcrete(x: Derived(i32)) -> i32 { // CHECK:STDOUT: %Derived.loc21_47.2: type = class_type @Derived, @Derived(%T.loc21_25.2) [symbolic = %Derived.loc21_47.2 (constants.%Derived.1)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete.loc21: = require_complete_type @AccessMissingDerived.%Derived.loc21_47.2 (%Derived.1) [symbolic = %require_complete.loc21 (constants.%require_complete.3)] +// CHECK:STDOUT: %Base: type = class_type @Base, @Base(%T.loc21_25.2) [symbolic = %Base (constants.%Base.1)] +// CHECK:STDOUT: %require_complete.loc26: = require_complete_type @AccessMissingDerived.%Base (%Base.1) [symbolic = %require_complete.loc26 (constants.%require_complete.2)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%T.param_patt: type](%x.param_patt: @AccessMissingDerived.%Derived.loc21_47.2 (%Derived.1)) -> @AccessMissingDerived.%T.loc21_25.2 (%T) { // CHECK:STDOUT: !entry: @@ -619,6 +648,7 @@ fn AccessMissingConcrete(x: Derived(i32)) -> i32 { // CHECK:STDOUT: %T.patt.loc4_17.2 => constants.%T // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete => constants.%require_complete.1 // CHECK:STDOUT: %Base => constants.%Base.1 // CHECK:STDOUT: %Base.elem => constants.%Base.elem.1 // CHECK:STDOUT: %struct_type.b => constants.%struct_type.b.1 @@ -636,8 +666,10 @@ fn AccessMissingConcrete(x: Derived(i32)) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Base.loc9_22.2 => constants.%Base.1 +// CHECK:STDOUT: %require_complete.loc9 => constants.%require_complete.2 // CHECK:STDOUT: %Derived => constants.%Derived.1 // CHECK:STDOUT: %Derived.elem.loc9 => constants.%Derived.elem.1 +// CHECK:STDOUT: %require_complete.loc10 => constants.%require_complete.1 // CHECK:STDOUT: %Derived.elem.loc10 => constants.%Derived.elem.2 // CHECK:STDOUT: %struct_type.base.d => constants.%struct_type.base.d.1 // CHECK:STDOUT: %complete_type.loc11_1.2 => constants.%complete_type.2 @@ -675,17 +707,24 @@ fn AccessMissingConcrete(x: Derived(i32)) -> i32 { // CHECK:STDOUT: %Derived.loc21_47.2 => constants.%Derived.1 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @Base(@AccessMissingDerived.%T.loc21_25.2) { +// CHECK:STDOUT: %T.loc4_17.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc4_17.2 => constants.%T +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: specific @Derived(constants.%i32) { // CHECK:STDOUT: %T.loc8_15.2 => constants.%i32 // CHECK:STDOUT: %T.patt.loc8_15.2 => constants.%i32 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Base.loc9_22.2 => constants.%Base.2 +// CHECK:STDOUT: %require_complete.loc9 => constants.%complete_type.4 // CHECK:STDOUT: %Derived => constants.%Derived.2 // CHECK:STDOUT: %Derived.elem.loc9 => constants.%Derived.elem.3 +// CHECK:STDOUT: %require_complete.loc10 => constants.%complete_type.3 // CHECK:STDOUT: %Derived.elem.loc10 => constants.%Derived.elem.4 // CHECK:STDOUT: %struct_type.base.d => constants.%struct_type.base.d.3 -// CHECK:STDOUT: %complete_type.loc11_1.2 => constants.%complete_type.3 +// CHECK:STDOUT: %complete_type.loc11_1.2 => constants.%complete_type.5 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Base(constants.%i32) { @@ -693,6 +732,7 @@ fn AccessMissingConcrete(x: Derived(i32)) -> i32 { // CHECK:STDOUT: %T.patt.loc4_17.2 => constants.%i32 // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete => constants.%complete_type.3 // CHECK:STDOUT: %Base => constants.%Base.2 // CHECK:STDOUT: %Base.elem => constants.%Base.elem.2 // CHECK:STDOUT: %struct_type.b => constants.%struct_type.b.2 diff --git a/toolchain/check/testdata/class/generic/member_out_of_line.carbon b/toolchain/check/testdata/class/generic/member_out_of_line.carbon index b0c1fd4862d57..f85a1169457a6 100644 --- a/toolchain/check/testdata/class/generic/member_out_of_line.carbon +++ b/toolchain/check/testdata/class/generic/member_out_of_line.carbon @@ -117,9 +117,11 @@ fn Generic(T:! ()).WrongType() {} // CHECK:STDOUT: %F: %F.type = struct_value () [symbolic] // CHECK:STDOUT: %G.type: type = fn_type @G, @Class(%T) [symbolic] // CHECK:STDOUT: %G: %G.type = struct_value () [symbolic] +// CHECK:STDOUT: %require_complete.1: = require_complete_type %T [symbolic] // CHECK:STDOUT: %Class.elem: type = unbound_element_type %Class, %T [symbolic] // CHECK:STDOUT: %struct_type.n: type = struct_type {.n: %T} [symbolic] // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.n [symbolic] +// CHECK:STDOUT: %require_complete.2: = require_complete_type %Class [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -184,6 +186,7 @@ fn Generic(T:! ()).WrongType() {} // CHECK:STDOUT: %F: @Class.%F.type (%F.type) = struct_value () [symbolic = %F (constants.%F)] // CHECK:STDOUT: %G.type: type = fn_type @G, @Class(%T.loc4_13.2) [symbolic = %G.type (constants.%G.type)] // CHECK:STDOUT: %G: @Class.%G.type (%G.type) = struct_value () [symbolic = %G (constants.%G)] +// CHECK:STDOUT: %require_complete: = require_complete_type @Class.%T.loc4_13.2 (%T) [symbolic = %require_complete (constants.%require_complete.1)] // CHECK:STDOUT: %Class: type = class_type @Class, @Class(%T.loc4_13.2) [symbolic = %Class (constants.%Class)] // CHECK:STDOUT: %Class.elem: type = unbound_element_type @Class.%Class (%Class), @Class.%T.loc4_13.2 (%T) [symbolic = %Class.elem (constants.%Class.elem)] // CHECK:STDOUT: %struct_type.n: type = struct_type {.n: @Class.%T.loc4_13.2 (%T)} [symbolic = %struct_type.n (constants.%struct_type.n)] @@ -234,6 +237,7 @@ fn Generic(T:! ()).WrongType() {} // CHECK:STDOUT: %T.loc5: type = bind_symbolic_name T, 0 [symbolic = %T.loc5 (constants.%T)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete: = require_complete_type @F.%T.loc5 (%T) [symbolic = %require_complete (constants.%require_complete.1)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%n.param_patt: %T) -> %T { // CHECK:STDOUT: !entry: @@ -247,7 +251,9 @@ fn Generic(T:! ()).WrongType() {} // CHECK:STDOUT: %Class: type = class_type @Class, @Class(%T.loc6) [symbolic = %Class (constants.%Class)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete.loc14: = require_complete_type @G.%Class (%Class) [symbolic = %require_complete.loc14 (constants.%require_complete.2)] // CHECK:STDOUT: %Class.elem: type = unbound_element_type @G.%Class (%Class), @G.%T.loc6 (%T) [symbolic = %Class.elem (constants.%Class.elem)] +// CHECK:STDOUT: %require_complete.loc15: = require_complete_type @G.%T.loc6 (%T) [symbolic = %require_complete.loc15 (constants.%require_complete.1)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: %Class]() -> %T { // CHECK:STDOUT: !entry: @@ -268,6 +274,7 @@ fn Generic(T:! ()).WrongType() {} // CHECK:STDOUT: %F => constants.%F // CHECK:STDOUT: %G.type => constants.%G.type // CHECK:STDOUT: %G => constants.%G +// CHECK:STDOUT: %require_complete => constants.%require_complete.1 // CHECK:STDOUT: %Class => constants.%Class // CHECK:STDOUT: %Class.elem => constants.%Class.elem // CHECK:STDOUT: %struct_type.n => constants.%struct_type.n @@ -310,6 +317,8 @@ fn Generic(T:! ()).WrongType() {} // CHECK:STDOUT: %F: %F.type = struct_value () [symbolic] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %require_complete.1: = require_complete_type %B [symbolic] +// CHECK:STDOUT: %require_complete.2: = require_complete_type %T [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -418,6 +427,8 @@ fn Generic(T:! ()).WrongType() {} // CHECK:STDOUT: %B: type = class_type @B, @B(%T.loc6, %N.loc6) [symbolic = %B (constants.%B)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete.loc10_31: = require_complete_type @F.%B (%B) [symbolic = %require_complete.loc10_31 (constants.%require_complete.1)] +// CHECK:STDOUT: %require_complete.loc10_40: = require_complete_type @F.%T.loc6 (%T) [symbolic = %require_complete.loc10_40 (constants.%require_complete.2)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: %B](%a.param_patt: %T) { // CHECK:STDOUT: !entry: diff --git a/toolchain/check/testdata/class/generic/method_deduce.carbon b/toolchain/check/testdata/class/generic/method_deduce.carbon index 3eb855cd8f703..d87b35d058f8f 100644 --- a/toolchain/check/testdata/class/generic/method_deduce.carbon +++ b/toolchain/check/testdata/class/generic/method_deduce.carbon @@ -29,7 +29,7 @@ fn CallGenericMethodWithNonDeducedParam(c: Class(A)) -> (A, B) { // CHECK:STDOUT: constants { // CHECK:STDOUT: %A: type = class_type @A [template] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %complete_type.1: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %B: type = class_type @B [template] // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] @@ -44,7 +44,10 @@ fn CallGenericMethodWithNonDeducedParam(c: Class(A)) -> (A, B) { // CHECK:STDOUT: %Get.1: %Get.type.1 = struct_value () [symbolic] // CHECK:STDOUT: %GetNoDeduce.type.1: type = fn_type @GetNoDeduce, @Class(%T) [symbolic] // CHECK:STDOUT: %GetNoDeduce.1: %GetNoDeduce.type.1 = struct_value () [symbolic] +// CHECK:STDOUT: %require_complete.1: = require_complete_type %tuple.type.2 [symbolic] // CHECK:STDOUT: %Get.specific_fn.1: = specific_function %Get.1, @Get(%T, %U) [symbolic] +// CHECK:STDOUT: %require_complete.2: = require_complete_type %T [symbolic] +// CHECK:STDOUT: %require_complete.3: = require_complete_type %U [symbolic] // CHECK:STDOUT: %GetNoDeduce.specific_fn.1: = specific_function %GetNoDeduce.1, @GetNoDeduce(%T, %U) [symbolic] // CHECK:STDOUT: %Class.2: type = class_type @Class, @Class(%A) [template] // CHECK:STDOUT: %tuple.type.3: type = tuple_type (%A, %B) [template] @@ -59,6 +62,7 @@ fn CallGenericMethodWithNonDeducedParam(c: Class(A)) -> (A, B) { // CHECK:STDOUT: %CallGenericMethodWithNonDeducedParam: %CallGenericMethodWithNonDeducedParam.type = struct_value () [template] // CHECK:STDOUT: %GetNoDeduce.specific_fn.2: = specific_function %GetNoDeduce.2, @GetNoDeduce(%A, %B) [template] // CHECK:STDOUT: %A.val: %A = struct_value () [template] +// CHECK:STDOUT: %complete_type.2: = complete_type_witness %tuple.type.3 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -126,7 +130,7 @@ fn CallGenericMethodWithNonDeducedParam(c: Class(A)) -> (A, B) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @A { -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%A @@ -134,7 +138,7 @@ fn CallGenericMethodWithNonDeducedParam(c: Class(A)) -> (A, B) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @B { -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%B @@ -187,7 +191,7 @@ fn CallGenericMethodWithNonDeducedParam(c: Class(A)) -> (A, B) { // CHECK:STDOUT: %return.param: ref @GetNoDeduce.%tuple.type (%tuple.type.2) = out_param runtime_param1 // CHECK:STDOUT: %return: ref @GetNoDeduce.%tuple.type (%tuple.type.2) = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class.1 @@ -204,9 +208,12 @@ fn CallGenericMethodWithNonDeducedParam(c: Class(A)) -> (A, B) { // CHECK:STDOUT: %tuple.type: type = tuple_type (@Get.%T (%T), @Get.%U.loc15_10.1 (%U)) [symbolic = %tuple.type (constants.%tuple.type.2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete.loc15_20: = require_complete_type @Get.%tuple.type (%tuple.type.2) [symbolic = %require_complete.loc15_20 (constants.%require_complete.1)] // CHECK:STDOUT: %Get.type: type = fn_type @Get, @Class(%T) [symbolic = %Get.type (constants.%Get.type.1)] // CHECK:STDOUT: %Get: @Get.%Get.type (%Get.type.1) = struct_value () [symbolic = %Get (constants.%Get.1)] // CHECK:STDOUT: %Get.specific_fn.loc15_39.2: = specific_function %Get, @Get(%T, %U.loc15_10.1) [symbolic = %Get.specific_fn.loc15_39.2 (constants.%Get.specific_fn.1)] +// CHECK:STDOUT: %require_complete.loc15_44.1: = require_complete_type @Get.%T (%T) [symbolic = %require_complete.loc15_44.1 (constants.%require_complete.2)] +// CHECK:STDOUT: %require_complete.loc15_44.2: = require_complete_type @Get.%U.loc15_10.1 (%U) [symbolic = %require_complete.loc15_44.2 (constants.%require_complete.3)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%U.param_patt: type) -> %return.param_patt: @Get.%tuple.type (%tuple.type.2) { // CHECK:STDOUT: !entry: @@ -238,9 +245,12 @@ fn CallGenericMethodWithNonDeducedParam(c: Class(A)) -> (A, B) { // CHECK:STDOUT: %tuple.type: type = tuple_type (@GetNoDeduce.%T (%T), @GetNoDeduce.%U.loc16_24.1 (%U)) [symbolic = %tuple.type (constants.%tuple.type.2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete.loc16_19: = require_complete_type @GetNoDeduce.%T (%T) [symbolic = %require_complete.loc16_19 (constants.%require_complete.2)] // CHECK:STDOUT: %GetNoDeduce.type: type = fn_type @GetNoDeduce, @Class(%T) [symbolic = %GetNoDeduce.type (constants.%GetNoDeduce.type.1)] // CHECK:STDOUT: %GetNoDeduce: @GetNoDeduce.%GetNoDeduce.type (%GetNoDeduce.type.1) = struct_value () [symbolic = %GetNoDeduce (constants.%GetNoDeduce.1)] // CHECK:STDOUT: %GetNoDeduce.specific_fn.loc16_53.2: = specific_function %GetNoDeduce, @GetNoDeduce(%T, %U.loc16_24.1) [symbolic = %GetNoDeduce.specific_fn.loc16_53.2 (constants.%GetNoDeduce.specific_fn.1)] +// CHECK:STDOUT: %require_complete.loc16_70: = require_complete_type @GetNoDeduce.%tuple.type (%tuple.type.2) [symbolic = %require_complete.loc16_70 (constants.%require_complete.1)] +// CHECK:STDOUT: %require_complete.loc16_69: = require_complete_type @GetNoDeduce.%U.loc16_24.1 (%U) [symbolic = %require_complete.loc16_69 (constants.%require_complete.3)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%x.param_patt: @GetNoDeduce.%T (%T), %U.param_patt: type) -> %return.param_patt: @GetNoDeduce.%tuple.type (%tuple.type.2) { // CHECK:STDOUT: !entry: @@ -314,9 +324,12 @@ fn CallGenericMethodWithNonDeducedParam(c: Class(A)) -> (A, B) { // CHECK:STDOUT: %tuple.type => constants.%tuple.type.2 // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete.loc15_20 => constants.%require_complete.1 // CHECK:STDOUT: %Get.type => constants.%Get.type.1 // CHECK:STDOUT: %Get => constants.%Get.1 // CHECK:STDOUT: %Get.specific_fn.loc15_39.2 => constants.%Get.specific_fn.1 +// CHECK:STDOUT: %require_complete.loc15_44.1 => constants.%require_complete.2 +// CHECK:STDOUT: %require_complete.loc15_44.2 => constants.%require_complete.3 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @GetNoDeduce(constants.%T, constants.%U) { @@ -326,9 +339,12 @@ fn CallGenericMethodWithNonDeducedParam(c: Class(A)) -> (A, B) { // CHECK:STDOUT: %tuple.type => constants.%tuple.type.2 // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete.loc16_19 => constants.%require_complete.2 // CHECK:STDOUT: %GetNoDeduce.type => constants.%GetNoDeduce.type.1 // CHECK:STDOUT: %GetNoDeduce => constants.%GetNoDeduce.1 // CHECK:STDOUT: %GetNoDeduce.specific_fn.loc16_53.2 => constants.%GetNoDeduce.specific_fn.1 +// CHECK:STDOUT: %require_complete.loc16_70 => constants.%require_complete.1 +// CHECK:STDOUT: %require_complete.loc16_69 => constants.%require_complete.3 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(%T.loc14_13.2) { @@ -378,9 +394,12 @@ fn CallGenericMethodWithNonDeducedParam(c: Class(A)) -> (A, B) { // CHECK:STDOUT: %tuple.type => constants.%tuple.type.3 // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete.loc15_20 => constants.%complete_type.2 // CHECK:STDOUT: %Get.type => constants.%Get.type.2 // CHECK:STDOUT: %Get => constants.%Get.2 // CHECK:STDOUT: %Get.specific_fn.loc15_39.2 => constants.%Get.specific_fn.2 +// CHECK:STDOUT: %require_complete.loc15_44.1 => constants.%complete_type.1 +// CHECK:STDOUT: %require_complete.loc15_44.2 => constants.%complete_type.1 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @GetNoDeduce(constants.%A, constants.%B) { @@ -390,8 +409,11 @@ fn CallGenericMethodWithNonDeducedParam(c: Class(A)) -> (A, B) { // CHECK:STDOUT: %tuple.type => constants.%tuple.type.3 // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete.loc16_19 => constants.%complete_type.1 // CHECK:STDOUT: %GetNoDeduce.type => constants.%GetNoDeduce.type.2 // CHECK:STDOUT: %GetNoDeduce => constants.%GetNoDeduce.2 // CHECK:STDOUT: %GetNoDeduce.specific_fn.loc16_53.2 => constants.%GetNoDeduce.specific_fn.2 +// CHECK:STDOUT: %require_complete.loc16_70 => constants.%complete_type.2 +// CHECK:STDOUT: %require_complete.loc16_69 => constants.%complete_type.1 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/generic/self.carbon b/toolchain/check/testdata/class/generic/self.carbon index 17f246435ea62..b6e2f746f75e5 100644 --- a/toolchain/check/testdata/class/generic/self.carbon +++ b/toolchain/check/testdata/class/generic/self.carbon @@ -35,6 +35,7 @@ class Class(T:! type) { // CHECK:STDOUT: %F: %F.type = struct_value () [symbolic] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %require_complete: = require_complete_type %Class [symbolic] // CHECK:STDOUT: %Class.val: %Class = struct_value () [symbolic] // CHECK:STDOUT: %MakeSelf.specific_fn: = specific_function %MakeSelf, @MakeSelf(%T) [symbolic] // CHECK:STDOUT: %MakeClass.specific_fn: = specific_function %MakeClass, @MakeClass(%T) [symbolic] @@ -111,6 +112,7 @@ class Class(T:! type) { // CHECK:STDOUT: %Class: type = class_type @Class, @Class(%T) [symbolic = %Class (constants.%Class)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete: = require_complete_type @MakeSelf.%Class (%Class) [symbolic = %require_complete (constants.%require_complete)] // CHECK:STDOUT: %Class.val: @MakeSelf.%Class (%Class) = struct_value () [symbolic = %Class.val (constants.%Class.val)] // CHECK:STDOUT: // CHECK:STDOUT: fn() -> %return.param_patt: @MakeSelf.%Class (%Class) { @@ -127,6 +129,7 @@ class Class(T:! type) { // CHECK:STDOUT: %Class.loc15_28.1: type = class_type @Class, @Class(%T) [symbolic = %Class.loc15_28.1 (constants.%Class)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete: = require_complete_type @MakeClass.%Class.loc15_28.1 (%Class) [symbolic = %require_complete (constants.%require_complete)] // CHECK:STDOUT: %Class.val: @MakeClass.%Class.loc15_28.1 (%Class) = struct_value () [symbolic = %Class.val (constants.%Class.val)] // CHECK:STDOUT: // CHECK:STDOUT: fn() -> %return.param_patt: @MakeClass.%Class.loc15_28.1 (%Class) { @@ -142,6 +145,7 @@ class Class(T:! type) { // CHECK:STDOUT: !definition: // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)] // CHECK:STDOUT: %Class.loc17_19.2: type = class_type @Class, @Class(%T) [symbolic = %Class.loc17_19.2 (constants.%Class)] +// CHECK:STDOUT: %require_complete: = require_complete_type @F.%Class.loc17_19.2 (%Class) [symbolic = %require_complete (constants.%require_complete)] // CHECK:STDOUT: %MakeSelf.type: type = fn_type @MakeSelf, @Class(%T) [symbolic = %MakeSelf.type (constants.%MakeSelf.type)] // CHECK:STDOUT: %MakeSelf: @F.%MakeSelf.type (%MakeSelf.type) = struct_value () [symbolic = %MakeSelf (constants.%MakeSelf)] // CHECK:STDOUT: %MakeSelf.specific_fn.loc17_23.2: = specific_function %MakeSelf, @MakeSelf(%T) [symbolic = %MakeSelf.specific_fn.loc17_23.2 (constants.%MakeSelf.specific_fn)] @@ -199,6 +203,7 @@ class Class(T:! type) { // CHECK:STDOUT: %Class => constants.%Class // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete => constants.%require_complete // CHECK:STDOUT: %Class.val => constants.%Class.val // CHECK:STDOUT: } // CHECK:STDOUT: @@ -212,6 +217,7 @@ class Class(T:! type) { // CHECK:STDOUT: %Class.loc15_28.1 => constants.%Class // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete => constants.%require_complete // CHECK:STDOUT: %Class.val => constants.%Class.val // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/generic/stringify.carbon b/toolchain/check/testdata/class/generic/stringify.carbon index 305f11bf08e25..64720dd14b1cd 100644 --- a/toolchain/check/testdata/class/generic/stringify.carbon +++ b/toolchain/check/testdata/class/generic/stringify.carbon @@ -293,7 +293,7 @@ var v: C(123) = (); // CHECK:STDOUT: %C.generic: %C.type = struct_value () [template] // CHECK:STDOUT: %C.1: type = class_type @C, @C(%N.1) [symbolic] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %complete_type.1: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %int_123.1: Core.IntLiteral = int_value 123 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] @@ -352,7 +352,7 @@ var v: C(123) = (); // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: class { -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C.1 diff --git a/toolchain/check/testdata/class/generic_method.carbon b/toolchain/check/testdata/class/generic_method.carbon index b008b066f3dbc..a35b6529fe358 100644 --- a/toolchain/check/testdata/class/generic_method.carbon +++ b/toolchain/check/testdata/class/generic_method.carbon @@ -23,11 +23,13 @@ fn Class(T:! type).F[self: Self](n: T) {} // CHECK:STDOUT: %Class.type: type = generic_class_type @Class [template] // CHECK:STDOUT: %Class.generic: %Class.type = struct_value () [template] // CHECK:STDOUT: %Class: type = class_type @Class, @Class(%T) [symbolic] +// CHECK:STDOUT: %require_complete.1: = require_complete_type %T [symbolic] // CHECK:STDOUT: %Class.elem: type = unbound_element_type %Class, %T [symbolic] // CHECK:STDOUT: %F.type: type = fn_type @F, @Class(%T) [symbolic] // CHECK:STDOUT: %F: %F.type = struct_value () [symbolic] // CHECK:STDOUT: %struct_type.a: type = struct_type {.a: %T} [symbolic] // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a [symbolic] +// CHECK:STDOUT: %require_complete.2: = require_complete_type %Class [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -73,6 +75,7 @@ fn Class(T:! type).F[self: Self](n: T) {} // CHECK:STDOUT: %T.patt.loc11_13.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc11_13.2 (constants.%T.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete: = require_complete_type @Class.%T.loc11_13.2 (%T) [symbolic = %require_complete (constants.%require_complete.1)] // CHECK:STDOUT: %Class: type = class_type @Class, @Class(%T.loc11_13.2) [symbolic = %Class (constants.%Class)] // CHECK:STDOUT: %Class.elem: type = unbound_element_type @Class.%Class (%Class), @Class.%T.loc11_13.2 (%T) [symbolic = %Class.elem (constants.%Class.elem)] // CHECK:STDOUT: %F.type: type = fn_type @F, @Class(%T.loc11_13.2) [symbolic = %F.type (constants.%F.type)] @@ -112,6 +115,8 @@ fn Class(T:! type).F[self: Self](n: T) {} // CHECK:STDOUT: %Class: type = class_type @Class, @Class(%T.loc13) [symbolic = %Class (constants.%Class)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete.loc16_26: = require_complete_type @F.%Class (%Class) [symbolic = %require_complete.loc16_26 (constants.%require_complete.2)] +// CHECK:STDOUT: %require_complete.loc16_35: = require_complete_type @F.%T.loc13 (%T) [symbolic = %require_complete.loc16_35 (constants.%require_complete.1)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: %Class](%n.param_patt: %T) { // CHECK:STDOUT: !entry: @@ -124,6 +129,7 @@ fn Class(T:! type).F[self: Self](n: T) {} // CHECK:STDOUT: %T.patt.loc11_13.2 => constants.%T // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete => constants.%require_complete.1 // CHECK:STDOUT: %Class => constants.%Class // CHECK:STDOUT: %Class.elem => constants.%Class.elem // CHECK:STDOUT: %F.type => constants.%F.type diff --git a/toolchain/check/testdata/class/import.carbon b/toolchain/check/testdata/class/import.carbon index 2707ce3dc2a25..2dc900296825a 100644 --- a/toolchain/check/testdata/class/import.carbon +++ b/toolchain/check/testdata/class/import.carbon @@ -330,5 +330,5 @@ fn Run() { // CHECK:STDOUT: // CHECK:STDOUT: fn @F[%self.param_patt: %ForwardDeclared.1]() [from "a.carbon"]; // CHECK:STDOUT: -// CHECK:STDOUT: fn @G[addr .inst401: %ptr.3]() [from "a.carbon"]; +// CHECK:STDOUT: fn @G[addr .inst419: %ptr.3]() [from "a.carbon"]; // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/inheritance_access.carbon b/toolchain/check/testdata/class/inheritance_access.carbon index 0846118860459..8e5b9fcaa438b 100644 --- a/toolchain/check/testdata/class/inheritance_access.carbon +++ b/toolchain/check/testdata/class/inheritance_access.carbon @@ -490,7 +490,7 @@ class B { // CHECK:STDOUT: %SomeProtectedFunction.type: type = fn_type @SomeProtectedFunction [template] // CHECK:STDOUT: %SomeProtectedFunction: %SomeProtectedFunction.type = struct_value () [template] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] -// CHECK:STDOUT: %complete_type.1: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %complete_type.3: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %B: type = class_type @B [template] // CHECK:STDOUT: %B.elem: type = unbound_element_type %B, %A [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] @@ -498,7 +498,7 @@ class B { // CHECK:STDOUT: %H.type: type = fn_type @H [template] // CHECK:STDOUT: %H: %H.type = struct_value () [template] // CHECK:STDOUT: %struct_type.base: type = struct_type {.base: %A} [template] -// CHECK:STDOUT: %complete_type.2: = complete_type_witness %struct_type.base [template] +// CHECK:STDOUT: %complete_type.4: = complete_type_witness %struct_type.base [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -545,7 +545,7 @@ class B { // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%A @@ -579,7 +579,7 @@ class B { // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.base [template = constants.%complete_type.2] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.base [template = constants.%complete_type.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%B @@ -974,7 +974,7 @@ class B { // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_5.2: %i32 = int_value 5 [template] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] -// CHECK:STDOUT: %complete_type.1: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %complete_type.3: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %Internal: type = class_type @Internal [template] // CHECK:STDOUT: %B: type = class_type @B [template] // CHECK:STDOUT: %B.elem: type = unbound_element_type %B, %Internal [template] @@ -983,7 +983,7 @@ class B { // CHECK:STDOUT: %SomeFunc.type: type = fn_type @SomeFunc [template] // CHECK:STDOUT: %SomeFunc: %SomeFunc.type = struct_value () [template] // CHECK:STDOUT: %struct_type.internal.1: type = struct_type {.internal: %Internal} [template] -// CHECK:STDOUT: %complete_type.2: = complete_type_witness %struct_type.internal.1 [template] +// CHECK:STDOUT: %complete_type.4: = complete_type_witness %struct_type.internal.1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -1033,7 +1033,7 @@ class B { // CHECK:STDOUT: %.loc6_45.1: %i32 = value_of_initializer %int.convert_checked.loc6 [template = constants.%int_5.2] // CHECK:STDOUT: %.loc6_45.2: %i32 = converted %int_5.loc6, %.loc6_45.1 [template = constants.%int_5.2] // CHECK:STDOUT: %SOME_PRIVATE_CONSTANT: %i32 = bind_name SOME_PRIVATE_CONSTANT, %.loc6_45.2 -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%A @@ -1055,7 +1055,7 @@ class B { // CHECK:STDOUT: %.loc10_43.1: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_5.2] // CHECK:STDOUT: %.loc10_43.2: %i32 = converted %int_5, %.loc10_43.1 [template = constants.%int_5.2] // CHECK:STDOUT: %INTERNAL_CONSTANT: %i32 = bind_name INTERNAL_CONSTANT, %.loc10_43.2 -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Internal @@ -1093,7 +1093,7 @@ class B { // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.internal.1 [template = constants.%complete_type.2] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.internal.1 [template = constants.%complete_type.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%B diff --git a/toolchain/check/testdata/class/init_as.carbon b/toolchain/check/testdata/class/init_as.carbon index 5852c378d6319..ff35a2ba27e7d 100644 --- a/toolchain/check/testdata/class/init_as.carbon +++ b/toolchain/check/testdata/class/init_as.carbon @@ -27,7 +27,7 @@ fn F() -> i32 { // CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] // CHECK:STDOUT: %Class.elem: type = unbound_element_type %Class, %i32 [template] // CHECK:STDOUT: %struct_type.a.b.1: type = struct_type {.a: %i32, .b: %i32} [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a.b.1 [template] +// CHECK:STDOUT: %complete_type.1: = complete_type_witness %struct_type.a.b.1 [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] @@ -87,7 +87,7 @@ fn F() -> i32 { // CHECK:STDOUT: %.loc13_10.1: type = value_of_initializer %int.make_type_signed.loc13 [template = constants.%i32] // CHECK:STDOUT: %.loc13_10.2: type = converted %int.make_type_signed.loc13, %.loc13_10.1 [template = constants.%i32] // CHECK:STDOUT: %.loc13_8: %Class.elem = field_decl b, element1 [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a.b.1 [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a.b.1 [template = constants.%complete_type.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class diff --git a/toolchain/check/testdata/class/method.carbon b/toolchain/check/testdata/class/method.carbon index 77ecdbc83bc57..44cac1cd71851 100644 --- a/toolchain/check/testdata/class/method.carbon +++ b/toolchain/check/testdata/class/method.carbon @@ -73,7 +73,7 @@ fn CallGOnInitializingExpr() -> i32 { // CHECK:STDOUT: %G: %G.type = struct_value () [template] // CHECK:STDOUT: %Class.elem: type = unbound_element_type %Class, %i32 [template] // CHECK:STDOUT: %struct_type.k.1: type = struct_type {.k: %i32} [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.k.1 [template] +// CHECK:STDOUT: %complete_type.1: = complete_type_witness %struct_type.k.1 [template] // CHECK:STDOUT: %Call.type: type = fn_type @Call [template] // CHECK:STDOUT: %Call: %Call.type = struct_value () [template] // CHECK:STDOUT: %CallAlias.type: type = fn_type @CallAlias [template] @@ -307,7 +307,7 @@ fn CallGOnInitializingExpr() -> i32 { // CHECK:STDOUT: %.loc17_10.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] // CHECK:STDOUT: %.loc17_10.2: type = converted %int.make_type_signed, %.loc17_10.1 [template = constants.%i32] // CHECK:STDOUT: %.loc17_8: %Class.elem = field_decl k, element0 [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.k.1 [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.k.1 [template = constants.%complete_type.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class diff --git a/toolchain/check/testdata/class/reorder.carbon b/toolchain/check/testdata/class/reorder.carbon index 3beded487809a..63c4e2b18a2dd 100644 --- a/toolchain/check/testdata/class/reorder.carbon +++ b/toolchain/check/testdata/class/reorder.carbon @@ -31,7 +31,7 @@ class Class { // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %complete_type.1: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] @@ -83,7 +83,7 @@ class Class { // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class diff --git a/toolchain/check/testdata/class/scope.carbon b/toolchain/check/testdata/class/scope.carbon index 2bd018d57a6ae..16f7fe3fceea8 100644 --- a/toolchain/check/testdata/class/scope.carbon +++ b/toolchain/check/testdata/class/scope.carbon @@ -40,7 +40,7 @@ fn Run() { // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %complete_type.1: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] @@ -114,7 +114,7 @@ fn Run() { // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class diff --git a/toolchain/check/testdata/class/syntactic_merge_literal.carbon b/toolchain/check/testdata/class/syntactic_merge_literal.carbon index 8c6c62f434e12..af6ad9aa7285e 100644 --- a/toolchain/check/testdata/class/syntactic_merge_literal.carbon +++ b/toolchain/check/testdata/class/syntactic_merge_literal.carbon @@ -41,7 +41,7 @@ class D(b:! C(1_000)) {} // CHECK:STDOUT: %C.generic: %C.type = struct_value () [template] // CHECK:STDOUT: %C.1: type = class_type @C, @C(%a) [symbolic] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %complete_type.1: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %int_1000.1: Core.IntLiteral = int_value 1000 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] @@ -126,7 +126,7 @@ class D(b:! C(1_000)) {} // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: class { -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C.1 @@ -141,7 +141,7 @@ class D(b:! C(1_000)) {} // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: class { -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%D @@ -177,7 +177,7 @@ class D(b:! C(1_000)) {} // CHECK:STDOUT: %C.generic: %C.type = struct_value () [template] // CHECK:STDOUT: %C.1: type = class_type @C, @C(%a) [symbolic] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %complete_type.1: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %int_1000.1: Core.IntLiteral = int_value 1000 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] @@ -264,7 +264,7 @@ class D(b:! C(1_000)) {} // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: class { -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C.1 @@ -286,7 +286,7 @@ class D(b:! C(1_000)) {} // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: class { -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%.1 diff --git a/toolchain/check/testdata/class/virtual_modifiers.carbon b/toolchain/check/testdata/class/virtual_modifiers.carbon index 09a12635346ac..e68d6da249484 100644 --- a/toolchain/check/testdata/class/virtual_modifiers.carbon +++ b/toolchain/check/testdata/class/virtual_modifiers.carbon @@ -508,7 +508,7 @@ class Derived { // CHECK:STDOUT: %F.1: %F.type.1 = struct_value () [template] // CHECK:STDOUT: %ptr.1: type = ptr_type [template] // CHECK:STDOUT: %struct_type.vptr.m1.m2: type = struct_type {.: %ptr.1, .m1: %i32, .m2: %i32} [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.vptr.m1.m2 [template] +// CHECK:STDOUT: %complete_type.1: = complete_type_witness %struct_type.vptr.m1.m2 [template] // CHECK:STDOUT: %F.type.2: type = fn_type @F.2 [template] // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [template] // CHECK:STDOUT: %int_3.1: Core.IntLiteral = int_value 3 [template] @@ -563,7 +563,7 @@ class Derived { // CHECK:STDOUT: %.loc6_11.2: type = converted %int.make_type_signed.loc6, %.loc6_11.1 [template = constants.%i32] // CHECK:STDOUT: %.loc6_9: %Base.elem = field_decl m2, element2 [template] // CHECK:STDOUT: %F.decl: %F.type.1 = fn_decl @F.1 [template = constants.%F.1] {} {} -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.vptr.m1.m2 [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.vptr.m1.m2 [template = constants.%complete_type.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Base diff --git a/toolchain/check/testdata/deduce/array.carbon b/toolchain/check/testdata/deduce/array.carbon index dad4826a7518c..63ae9cf40346d 100644 --- a/toolchain/check/testdata/deduce/array.carbon +++ b/toolchain/check/testdata/deduce/array.carbon @@ -102,13 +102,15 @@ fn G() -> C { // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %complete_type.1: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template] // CHECK:STDOUT: %array_type.1: type = array_type %int_3, %T [symbolic] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] +// CHECK:STDOUT: %require_complete.1: = require_complete_type %T [symbolic] +// CHECK:STDOUT: %require_complete.2: = require_complete_type %array_type.1 [symbolic] // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] // CHECK:STDOUT: %Int.type: type = fn_type @Int [template] @@ -130,6 +132,7 @@ fn G() -> C { // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %array: %array_type.2 = tuple_value (%C.val, %C.val, %C.val) [template] // CHECK:STDOUT: %F.specific_fn: = specific_function %F, @F(%C) [template] +// CHECK:STDOUT: %complete_type.4: = complete_type_witness %array_type.2 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -180,7 +183,7 @@ fn G() -> C { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C @@ -193,6 +196,8 @@ fn G() -> C { // CHECK:STDOUT: %array_type.loc6_24.2: type = array_type constants.%int_3, @F.%T.loc6_6.2 (%T) [symbolic = %array_type.loc6_24.2 (constants.%array_type.1)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete.loc6_27: = require_complete_type @F.%T.loc6_6.2 (%T) [symbolic = %require_complete.loc6_27 (constants.%require_complete.1)] +// CHECK:STDOUT: %require_complete.loc6_17: = require_complete_type @F.%array_type.loc6_24.2 (%array_type.1) [symbolic = %require_complete.loc6_17 (constants.%require_complete.2)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%T.param_patt: type](%a.param_patt: @F.%array_type.loc6_24.2 (%array_type.1)) -> @F.%T.loc6_6.2 (%T) { // CHECK:STDOUT: !entry: @@ -262,6 +267,8 @@ fn G() -> C { // CHECK:STDOUT: %array_type.loc6_24.2 => constants.%array_type.2 // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete.loc6_27 => constants.%complete_type.1 +// CHECK:STDOUT: %require_complete.loc6_17 => constants.%complete_type.4 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_todo_bound_only.carbon @@ -269,7 +276,7 @@ fn G() -> C { // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %complete_type.1: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] // CHECK:STDOUT: %Int.type: type = fn_type @Int [template] // CHECK:STDOUT: %Int: %Int.type = struct_value () [template] @@ -358,7 +365,7 @@ fn G() -> C { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C @@ -425,7 +432,7 @@ fn G() -> C { // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %complete_type.1: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] @@ -517,7 +524,7 @@ fn G() -> C { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C @@ -582,13 +589,15 @@ fn G() -> C { // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %complete_type.1: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %array_type.1: type = array_type %int_2, %T [symbolic] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] +// CHECK:STDOUT: %require_complete.1: = require_complete_type %T [symbolic] +// CHECK:STDOUT: %require_complete.2: = require_complete_type %array_type.1 [symbolic] // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] // CHECK:STDOUT: %Int.type: type = fn_type @Int [template] @@ -611,6 +620,7 @@ fn G() -> C { // CHECK:STDOUT: %array: %array_type.2 = tuple_value (%C.val, %C.val, %C.val) [template] // CHECK:STDOUT: %array_type.3: type = array_type %int_2, %C [template] // CHECK:STDOUT: %F.specific_fn: = specific_function %F, @F(%C) [template] +// CHECK:STDOUT: %complete_type.4: = complete_type_witness %array_type.3 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -661,7 +671,7 @@ fn G() -> C { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C @@ -674,6 +684,8 @@ fn G() -> C { // CHECK:STDOUT: %array_type.loc6_24.2: type = array_type constants.%int_2, @F.%T.loc6_6.2 (%T) [symbolic = %array_type.loc6_24.2 (constants.%array_type.1)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete.loc6_27: = require_complete_type @F.%T.loc6_6.2 (%T) [symbolic = %require_complete.loc6_27 (constants.%require_complete.1)] +// CHECK:STDOUT: %require_complete.loc6_17: = require_complete_type @F.%array_type.loc6_24.2 (%array_type.1) [symbolic = %require_complete.loc6_17 (constants.%require_complete.2)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%T.param_patt: type](%a.param_patt: @F.%array_type.loc6_24.2 (%array_type.1)) -> @F.%T.loc6_6.2 (%T) { // CHECK:STDOUT: !entry: @@ -743,6 +755,8 @@ fn G() -> C { // CHECK:STDOUT: %array_type.loc6_24.2 => constants.%array_type.3 // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete.loc6_27 => constants.%complete_type.1 +// CHECK:STDOUT: %require_complete.loc6_17 => constants.%complete_type.4 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_type_mismatch.carbon @@ -750,7 +764,7 @@ fn G() -> C { // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %complete_type.1: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %D: type = class_type @D [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] // CHECK:STDOUT: %Int.type: type = fn_type @Int [template] @@ -842,7 +856,7 @@ fn G() -> C { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C @@ -850,7 +864,7 @@ fn G() -> C { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @D { -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%D diff --git a/toolchain/check/testdata/deduce/generic_type.carbon b/toolchain/check/testdata/deduce/generic_type.carbon index 3350f352bc52b..bca8f464f5c13 100644 --- a/toolchain/check/testdata/deduce/generic_type.carbon +++ b/toolchain/check/testdata/deduce/generic_type.carbon @@ -78,6 +78,8 @@ fn G() -> i32 { // CHECK:STDOUT: %D: type = class_type @D [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] +// CHECK:STDOUT: %require_complete.1: = require_complete_type %T [symbolic] +// CHECK:STDOUT: %require_complete.2: = require_complete_type %C.1 [symbolic] // CHECK:STDOUT: %F.specific_fn.1: = specific_function %F, @F(%T) [symbolic] // CHECK:STDOUT: %C.2: type = class_type @C, @C(%D) [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] @@ -174,6 +176,8 @@ fn G() -> i32 { // CHECK:STDOUT: %C.loc7_22.2: type = class_type @C, @C(%T.loc7_6.2) [symbolic = %C.loc7_22.2 (constants.%C.1)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete.loc7_25: = require_complete_type @F.%T.loc7_6.2 (%T) [symbolic = %require_complete.loc7_25 (constants.%require_complete.1)] +// CHECK:STDOUT: %require_complete.loc7_17: = require_complete_type @F.%C.loc7_22.2 (%C.1) [symbolic = %require_complete.loc7_17 (constants.%require_complete.2)] // CHECK:STDOUT: %F.specific_fn.loc7_39.2: = specific_function constants.%F, @F(%T.loc7_6.2) [symbolic = %F.specific_fn.loc7_39.2 (constants.%F.specific_fn.1)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%T.param_patt: type](%p.param_patt: @F.%C.loc7_22.2 (%C.1)) -> @F.%T.loc7_6.2 (%T) { @@ -216,6 +220,8 @@ fn G() -> i32 { // CHECK:STDOUT: %C.loc7_22.2 => constants.%C.1 // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete.loc7_25 => constants.%require_complete.1 +// CHECK:STDOUT: %require_complete.loc7_17 => constants.%require_complete.2 // CHECK:STDOUT: %F.specific_fn.loc7_39.2 => constants.%F.specific_fn.1 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -238,6 +244,8 @@ fn G() -> i32 { // CHECK:STDOUT: %C.loc7_22.2 => constants.%C.2 // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete.loc7_25 => constants.%complete_type +// CHECK:STDOUT: %require_complete.loc7_17 => constants.%complete_type // CHECK:STDOUT: %F.specific_fn.loc7_39.2 => constants.%F.specific_fn.2 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -254,6 +262,7 @@ fn G() -> i32 { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] +// CHECK:STDOUT: %require_complete: = require_complete_type %I.1 [symbolic] // CHECK:STDOUT: %F.specific_fn.1: = specific_function %F, @F(%T) [symbolic] // CHECK:STDOUT: %I.2: type = class_type @I, @I(%C) [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] @@ -350,6 +359,7 @@ fn G() -> i32 { // CHECK:STDOUT: %I.loc7_22.2: type = class_type @I, @I(%T.loc7_6.2) [symbolic = %I.loc7_22.2 (constants.%I.1)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete: = require_complete_type @F.%I.loc7_22.2 (%I.1) [symbolic = %require_complete (constants.%require_complete)] // CHECK:STDOUT: %F.specific_fn.loc7_39.2: = specific_function constants.%F, @F(%T.loc7_6.2) [symbolic = %F.specific_fn.loc7_39.2 (constants.%F.specific_fn.1)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%T.param_patt: type](%p.param_patt: @F.%I.loc7_22.2 (%I.1)) -> %return.param_patt: %C { @@ -391,6 +401,7 @@ fn G() -> i32 { // CHECK:STDOUT: %I.loc7_22.2 => constants.%I.1 // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete => constants.%require_complete // CHECK:STDOUT: %F.specific_fn.loc7_39.2 => constants.%F.specific_fn.1 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -413,6 +424,7 @@ fn G() -> i32 { // CHECK:STDOUT: %I.loc7_22.2 => constants.%I.2 // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete => constants.%complete_type // CHECK:STDOUT: %F.specific_fn.loc7_39.2 => constants.%F.specific_fn.2 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -430,14 +442,19 @@ fn G() -> i32 { // CHECK:STDOUT: %Inner.generic.1: %Inner.type.1 = struct_value () [symbolic] // CHECK:STDOUT: %Inner.1: type = class_type @Inner, @Inner(%T, %U) [symbolic] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %complete_type.1: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %D: type = class_type @D [template] +// CHECK:STDOUT: %require_complete.1: = require_complete_type %Outer.1 [symbolic] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (type, type) [template] // CHECK:STDOUT: %tuple.type.2: type = tuple_type (%T, %U) [symbolic] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] +// CHECK:STDOUT: %require_complete.2: = require_complete_type %tuple.type.2 [symbolic] +// CHECK:STDOUT: %require_complete.3: = require_complete_type %Inner.1 [symbolic] // CHECK:STDOUT: %F.specific_fn.1: = specific_function %F, @F(%T, %U) [symbolic] +// CHECK:STDOUT: %require_complete.4: = require_complete_type %T [symbolic] +// CHECK:STDOUT: %require_complete.5: = require_complete_type %U [symbolic] // CHECK:STDOUT: %Outer.2: type = class_type @Outer, @Outer(%C) [template] // CHECK:STDOUT: %Inner.type.2: type = generic_class_type @Inner, @Outer(%C) [template] // CHECK:STDOUT: %Inner.generic.2: %Inner.type.2 = struct_value () [template] @@ -446,6 +463,7 @@ fn G() -> i32 { // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] // CHECK:STDOUT: %F.specific_fn.2: = specific_function %F, @F(%C, %D) [template] +// CHECK:STDOUT: %complete_type.2: = complete_type_witness %tuple.type.3 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -544,7 +562,7 @@ fn G() -> i32 { // CHECK:STDOUT: %U.param: type = value_param runtime_param // CHECK:STDOUT: %U.loc5_15.1: type = bind_symbolic_name U, 1, %U.param [symbolic = %U.loc5_15.2 (constants.%U)] // CHECK:STDOUT: } -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Outer.1 @@ -560,7 +578,7 @@ fn G() -> i32 { // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: class { -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Inner.1 @@ -569,7 +587,7 @@ fn G() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C @@ -577,7 +595,7 @@ fn G() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @D { -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%D @@ -590,13 +608,18 @@ fn G() -> i32 { // CHECK:STDOUT: %U.loc13_16.2: type = bind_symbolic_name U, 1 [symbolic = %U.loc13_16.2 (constants.%U)] // CHECK:STDOUT: %U.patt.loc13_16.2: type = symbolic_binding_pattern U, 1 [symbolic = %U.patt.loc13_16.2 (constants.%U.patt)] // CHECK:STDOUT: %Outer.loc13_36.2: type = class_type @Outer, @Outer(%T.loc13_6.2) [symbolic = %Outer.loc13_36.2 (constants.%Outer.1)] +// CHECK:STDOUT: %require_complete.loc13_37: = require_complete_type @F.%Outer.loc13_36.2 (%Outer.1) [symbolic = %require_complete.loc13_37 (constants.%require_complete.1)] // CHECK:STDOUT: %Inner.type: type = generic_class_type @Inner, @Outer(%T.loc13_6.2) [symbolic = %Inner.type (constants.%Inner.type.1)] // CHECK:STDOUT: %Inner.generic: @F.%Inner.type (%Inner.type.1) = struct_value () [symbolic = %Inner.generic (constants.%Inner.generic.1)] // CHECK:STDOUT: %Inner.loc13_45.2: type = class_type @Inner, @Inner(%T.loc13_6.2, %U.loc13_16.2) [symbolic = %Inner.loc13_45.2 (constants.%Inner.1)] // CHECK:STDOUT: %tuple.type: type = tuple_type (@F.%T.loc13_6.2 (%T), @F.%U.loc13_16.2 (%U)) [symbolic = %tuple.type (constants.%tuple.type.2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete.loc13_48: = require_complete_type @F.%tuple.type (%tuple.type.2) [symbolic = %require_complete.loc13_48 (constants.%require_complete.2)] +// CHECK:STDOUT: %require_complete.loc13_27: = require_complete_type @F.%Inner.loc13_45.2 (%Inner.1) [symbolic = %require_complete.loc13_27 (constants.%require_complete.3)] // CHECK:STDOUT: %F.specific_fn.loc13_67.2: = specific_function constants.%F, @F(%T.loc13_6.2, %U.loc13_16.2) [symbolic = %F.specific_fn.loc13_67.2 (constants.%F.specific_fn.1)] +// CHECK:STDOUT: %require_complete.loc13_70.1: = require_complete_type @F.%T.loc13_6.2 (%T) [symbolic = %require_complete.loc13_70.1 (constants.%require_complete.4)] +// CHECK:STDOUT: %require_complete.loc13_70.2: = require_complete_type @F.%U.loc13_16.2 (%U) [symbolic = %require_complete.loc13_70.2 (constants.%require_complete.5)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%T.param_patt: type, %U.param_patt: type](%p.param_patt: @F.%Inner.loc13_45.2 (%Inner.1)) -> %return.param_patt: @F.%tuple.type (%tuple.type.2) { // CHECK:STDOUT: !entry: @@ -667,13 +690,18 @@ fn G() -> i32 { // CHECK:STDOUT: %U.loc13_16.2 => constants.%U // CHECK:STDOUT: %U.patt.loc13_16.2 => constants.%U // CHECK:STDOUT: %Outer.loc13_36.2 => constants.%Outer.1 +// CHECK:STDOUT: %require_complete.loc13_37 => constants.%require_complete.1 // CHECK:STDOUT: %Inner.type => constants.%Inner.type.1 // CHECK:STDOUT: %Inner.generic => constants.%Inner.generic.1 // CHECK:STDOUT: %Inner.loc13_45.2 => constants.%Inner.1 // CHECK:STDOUT: %tuple.type => constants.%tuple.type.2 // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete.loc13_48 => constants.%require_complete.2 +// CHECK:STDOUT: %require_complete.loc13_27 => constants.%require_complete.3 // CHECK:STDOUT: %F.specific_fn.loc13_67.2 => constants.%F.specific_fn.1 +// CHECK:STDOUT: %require_complete.loc13_70.1 => constants.%require_complete.4 +// CHECK:STDOUT: %require_complete.loc13_70.2 => constants.%require_complete.5 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F(%T.loc13_6.2, %U.loc13_16.2) { @@ -682,6 +710,7 @@ fn G() -> i32 { // CHECK:STDOUT: %U.loc13_16.2 => constants.%U // CHECK:STDOUT: %U.patt.loc13_16.2 => constants.%U // CHECK:STDOUT: %Outer.loc13_36.2 => constants.%Outer.1 +// CHECK:STDOUT: %require_complete.loc13_37 => constants.%require_complete.1 // CHECK:STDOUT: %Inner.type => constants.%Inner.type.1 // CHECK:STDOUT: %Inner.generic => constants.%Inner.generic.1 // CHECK:STDOUT: %Inner.loc13_45.2 => constants.%Inner.1 @@ -710,13 +739,18 @@ fn G() -> i32 { // CHECK:STDOUT: %U.loc13_16.2 => constants.%D // CHECK:STDOUT: %U.patt.loc13_16.2 => constants.%D // CHECK:STDOUT: %Outer.loc13_36.2 => constants.%Outer.2 +// CHECK:STDOUT: %require_complete.loc13_37 => constants.%complete_type.1 // CHECK:STDOUT: %Inner.type => constants.%Inner.type.2 // CHECK:STDOUT: %Inner.generic => constants.%Inner.generic.2 // CHECK:STDOUT: %Inner.loc13_45.2 => constants.%Inner.2 // CHECK:STDOUT: %tuple.type => constants.%tuple.type.3 // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete.loc13_48 => constants.%complete_type.2 +// CHECK:STDOUT: %require_complete.loc13_27 => constants.%complete_type.1 // CHECK:STDOUT: %F.specific_fn.loc13_67.2 => constants.%F.specific_fn.2 +// CHECK:STDOUT: %require_complete.loc13_70.1 => constants.%complete_type.1 +// CHECK:STDOUT: %require_complete.loc13_70.2 => constants.%complete_type.1 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- nontype.carbon @@ -732,9 +766,10 @@ fn G() -> i32 { // CHECK:STDOUT: %WithNontype.generic: %WithNontype.type = struct_value () [template] // CHECK:STDOUT: %WithNontype.1: type = class_type @WithNontype, @WithNontype(%N.1) [symbolic] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %complete_type.1: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] +// CHECK:STDOUT: %require_complete.1: = require_complete_type %WithNontype.1 [symbolic] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] @@ -824,7 +859,7 @@ fn G() -> i32 { // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: class { -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%WithNontype.1 @@ -838,6 +873,7 @@ fn G() -> i32 { // CHECK:STDOUT: %WithNontype.loc6_31.2: type = class_type @WithNontype, @WithNontype(%N.loc6_6.2) [symbolic = %WithNontype.loc6_31.2 (constants.%WithNontype.1)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete: = require_complete_type @F.%WithNontype.loc6_31.2 (%WithNontype.1) [symbolic = %require_complete (constants.%require_complete.1)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%N.param_patt: %i32](%x.param_patt: @F.%WithNontype.loc6_31.2 (%WithNontype.1)) -> %i32 { // CHECK:STDOUT: !entry: @@ -902,5 +938,6 @@ fn G() -> i32 { // CHECK:STDOUT: %WithNontype.loc6_31.2 => constants.%WithNontype.2 // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete => constants.%complete_type.1 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/deduce/int_float.carbon b/toolchain/check/testdata/deduce/int_float.carbon index 68b8d10f7ab05..90b616c100b49 100644 --- a/toolchain/check/testdata/deduce/int_float.carbon +++ b/toolchain/check/testdata/deduce/int_float.carbon @@ -48,11 +48,13 @@ fn G(a: f64) -> Core.IntLiteral() { // CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] +// CHECK:STDOUT: %require_complete: = require_complete_type %iN [symbolic] // CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [template] // CHECK:STDOUT: %i64: type = int_type signed, %int_64 [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] // CHECK:STDOUT: %F.specific_fn: = specific_function %F, @F(%int_64) [template] +// CHECK:STDOUT: %complete_type: = complete_type_witness %i64 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -132,6 +134,7 @@ fn G(a: f64) -> Core.IntLiteral() { // CHECK:STDOUT: %iN: type = int_type signed, %N.loc4_6.2 [symbolic = %iN (constants.%iN)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete: = require_complete_type @F.%iN (%iN) [symbolic = %require_complete (constants.%require_complete)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%N.param_patt: Core.IntLiteral](%n.param_patt: @F.%iN (%iN)) -> Core.IntLiteral { // CHECK:STDOUT: !entry: @@ -163,6 +166,7 @@ fn G(a: f64) -> Core.IntLiteral() { // CHECK:STDOUT: %iN => constants.%i64 // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete => constants.%complete_type // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_todo_float.carbon diff --git a/toolchain/check/testdata/deduce/tuple.carbon b/toolchain/check/testdata/deduce/tuple.carbon index 0235b8a9faa41..1b6a7ba588e1b 100644 --- a/toolchain/check/testdata/deduce/tuple.carbon +++ b/toolchain/check/testdata/deduce/tuple.carbon @@ -57,7 +57,7 @@ fn G(pair: (C, D)) -> D { // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %complete_type.1: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %D: type = class_type @D [template] // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] @@ -67,11 +67,14 @@ fn G(pair: (C, D)) -> D { // CHECK:STDOUT: %tuple.type.2: type = tuple_type (%T, %U) [symbolic] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] +// CHECK:STDOUT: %require_complete.1: = require_complete_type %U [symbolic] +// CHECK:STDOUT: %require_complete.2: = require_complete_type %tuple.type.2 [symbolic] // CHECK:STDOUT: %F.specific_fn.1: = specific_function %F, @F(%T, %U) [symbolic] // CHECK:STDOUT: %tuple.type.3: type = tuple_type (%C, %D) [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] // CHECK:STDOUT: %F.specific_fn.2: = specific_function %F, @F(%C, %D) [template] +// CHECK:STDOUT: %complete_type.2: = complete_type_witness %tuple.type.3 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -135,7 +138,7 @@ fn G(pair: (C, D)) -> D { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C @@ -143,7 +146,7 @@ fn G(pair: (C, D)) -> D { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @D { -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%D @@ -158,6 +161,8 @@ fn G(pair: (C, D)) -> D { // CHECK:STDOUT: %tuple.type: type = tuple_type (@F.%T.loc7_6.2 (%T), @F.%U.loc7_16.2 (%U)) [symbolic = %tuple.type (constants.%tuple.type.2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete.loc7_40: = require_complete_type @F.%U.loc7_16.2 (%U) [symbolic = %require_complete.loc7_40 (constants.%require_complete.1)] +// CHECK:STDOUT: %require_complete.loc7_30: = require_complete_type @F.%tuple.type (%tuple.type.2) [symbolic = %require_complete.loc7_30 (constants.%require_complete.2)] // CHECK:STDOUT: %F.specific_fn.loc7_54.2: = specific_function constants.%F, @F(%T.loc7_6.2, %U.loc7_16.2) [symbolic = %F.specific_fn.loc7_54.2 (constants.%F.specific_fn.1)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%T.param_patt: type, %U.param_patt: type](%pair.param_patt: @F.%tuple.type (%tuple.type.2)) -> @F.%U.loc7_16.2 (%U) { @@ -190,6 +195,8 @@ fn G(pair: (C, D)) -> D { // CHECK:STDOUT: %tuple.type => constants.%tuple.type.2 // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete.loc7_40 => constants.%require_complete.1 +// CHECK:STDOUT: %require_complete.loc7_30 => constants.%require_complete.2 // CHECK:STDOUT: %F.specific_fn.loc7_54.2 => constants.%F.specific_fn.1 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -209,6 +216,8 @@ fn G(pair: (C, D)) -> D { // CHECK:STDOUT: %tuple.type => constants.%tuple.type.3 // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete.loc7_40 => constants.%complete_type.1 +// CHECK:STDOUT: %require_complete.loc7_30 => constants.%complete_type.2 // CHECK:STDOUT: %F.specific_fn.loc7_54.2 => constants.%F.specific_fn.2 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -227,7 +236,7 @@ fn G(pair: (C, D)) -> D { // CHECK:STDOUT: %HasPair.generic: %HasPair.type = struct_value () [template] // CHECK:STDOUT: %HasPair.1: type = class_type @HasPair, @HasPair(%Pair) [symbolic] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %complete_type.1: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %A: %i32 = bind_symbolic_name A, 0 [symbolic] // CHECK:STDOUT: %A.patt: %i32 = symbolic_binding_pattern A, 0 [symbolic] // CHECK:STDOUT: %B: %i32 = bind_symbolic_name B, 1 [symbolic] @@ -236,6 +245,7 @@ fn G(pair: (C, D)) -> D { // CHECK:STDOUT: %HasPair.2: type = class_type @HasPair, @HasPair(%tuple.1) [symbolic] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] +// CHECK:STDOUT: %require_complete.1: = require_complete_type %HasPair.2 [symbolic] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %tuple.type.3: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [template] @@ -371,7 +381,7 @@ fn G(pair: (C, D)) -> D { // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: class { -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%HasPair.1 @@ -388,6 +398,7 @@ fn G(pair: (C, D)) -> D { // CHECK:STDOUT: %HasPair.loc6_41.2: type = class_type @HasPair, @HasPair(%tuple.loc6_40.2) [symbolic = %HasPair.loc6_41.2 (constants.%HasPair.2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete: = require_complete_type @F.%HasPair.loc6_41.2 (%HasPair.2) [symbolic = %require_complete (constants.%require_complete.1)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%A.param_patt: %i32, %B.param_patt: %i32](%h.param_patt: @F.%HasPair.loc6_41.2 (%HasPair.2)) -> %i32 { // CHECK:STDOUT: !entry: @@ -449,6 +460,7 @@ fn G(pair: (C, D)) -> D { // CHECK:STDOUT: %HasPair.loc6_41.2 => constants.%HasPair.3 // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete => constants.%complete_type.1 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_inconsistent.carbon diff --git a/toolchain/check/testdata/deduce/type_operator.carbon b/toolchain/check/testdata/deduce/type_operator.carbon index c67b4c8929787..d7cccd9beef08 100644 --- a/toolchain/check/testdata/deduce/type_operator.carbon +++ b/toolchain/check/testdata/deduce/type_operator.carbon @@ -67,17 +67,20 @@ fn G(p: C*) -> const C { // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %complete_type.1: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %ptr.1: type = ptr_type %T [symbolic] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] +// CHECK:STDOUT: %require_complete.1: = require_complete_type %T [symbolic] +// CHECK:STDOUT: %require_complete.2: = require_complete_type %ptr.1 [symbolic] // CHECK:STDOUT: %F.specific_fn.1: = specific_function %F, @F(%T) [symbolic] // CHECK:STDOUT: %ptr.2: type = ptr_type %C [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] // CHECK:STDOUT: %F.specific_fn.2: = specific_function %F, @F(%C) [template] +// CHECK:STDOUT: %complete_type.2: = complete_type_witness %ptr.2 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -131,7 +134,7 @@ fn G(p: C*) -> const C { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C @@ -144,6 +147,8 @@ fn G(p: C*) -> const C { // CHECK:STDOUT: %ptr.loc6_20.2: type = ptr_type @F.%T.loc6_6.2 (%T) [symbolic = %ptr.loc6_20.2 (constants.%ptr.1)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete.loc6_23: = require_complete_type @F.%T.loc6_6.2 (%T) [symbolic = %require_complete.loc6_23 (constants.%require_complete.1)] +// CHECK:STDOUT: %require_complete.loc6_17: = require_complete_type @F.%ptr.loc6_20.2 (%ptr.1) [symbolic = %require_complete.loc6_17 (constants.%require_complete.2)] // CHECK:STDOUT: %F.specific_fn.loc6_37.2: = specific_function constants.%F, @F(%T.loc6_6.2) [symbolic = %F.specific_fn.loc6_37.2 (constants.%F.specific_fn.1)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%T.param_patt: type](%p.param_patt: @F.%ptr.loc6_20.2 (%ptr.1)) -> @F.%T.loc6_6.2 (%T) { @@ -174,6 +179,8 @@ fn G(p: C*) -> const C { // CHECK:STDOUT: %ptr.loc6_20.2 => constants.%ptr.1 // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete.loc6_23 => constants.%require_complete.1 +// CHECK:STDOUT: %require_complete.loc6_17 => constants.%require_complete.2 // CHECK:STDOUT: %F.specific_fn.loc6_37.2 => constants.%F.specific_fn.1 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -189,6 +196,8 @@ fn G(p: C*) -> const C { // CHECK:STDOUT: %ptr.loc6_20.2 => constants.%ptr.2 // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete.loc6_23 => constants.%complete_type.1 +// CHECK:STDOUT: %require_complete.loc6_17 => constants.%complete_type.2 // CHECK:STDOUT: %F.specific_fn.loc6_37.2 => constants.%F.specific_fn.2 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -197,19 +206,22 @@ fn G(p: C*) -> const C { // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %complete_type.1: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %const.1: type = const_type %T [symbolic] // CHECK:STDOUT: %ptr.1: type = ptr_type %const.1 [symbolic] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] +// CHECK:STDOUT: %require_complete.1: = require_complete_type %T [symbolic] +// CHECK:STDOUT: %require_complete.2: = require_complete_type %ptr.1 [symbolic] // CHECK:STDOUT: %F.specific_fn.1: = specific_function %F, @F(%T) [symbolic] // CHECK:STDOUT: %const.2: type = const_type %C [template] // CHECK:STDOUT: %ptr.2: type = ptr_type %const.2 [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] // CHECK:STDOUT: %F.specific_fn.2: = specific_function %F, @F(%C) [template] +// CHECK:STDOUT: %complete_type.2: = complete_type_witness %ptr.2 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -265,7 +277,7 @@ fn G(p: C*) -> const C { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C @@ -279,6 +291,8 @@ fn G(p: C*) -> const C { // CHECK:STDOUT: %ptr.loc6_26.2: type = ptr_type @F.%const.loc6_19.2 (%const.1) [symbolic = %ptr.loc6_26.2 (constants.%ptr.1)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete.loc6_29: = require_complete_type @F.%T.loc6_6.2 (%T) [symbolic = %require_complete.loc6_29 (constants.%require_complete.1)] +// CHECK:STDOUT: %require_complete.loc6_17: = require_complete_type @F.%ptr.loc6_26.2 (%ptr.1) [symbolic = %require_complete.loc6_17 (constants.%require_complete.2)] // CHECK:STDOUT: %F.specific_fn.loc6_43.2: = specific_function constants.%F, @F(%T.loc6_6.2) [symbolic = %F.specific_fn.loc6_43.2 (constants.%F.specific_fn.1)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%T.param_patt: type](%p.param_patt: @F.%ptr.loc6_26.2 (%ptr.1)) -> @F.%T.loc6_6.2 (%T) { @@ -310,6 +324,8 @@ fn G(p: C*) -> const C { // CHECK:STDOUT: %ptr.loc6_26.2 => constants.%ptr.1 // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete.loc6_29 => constants.%require_complete.1 +// CHECK:STDOUT: %require_complete.loc6_17 => constants.%require_complete.2 // CHECK:STDOUT: %F.specific_fn.loc6_43.2 => constants.%F.specific_fn.1 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -327,6 +343,8 @@ fn G(p: C*) -> const C { // CHECK:STDOUT: %ptr.loc6_26.2 => constants.%ptr.2 // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete.loc6_29 => constants.%complete_type.1 +// CHECK:STDOUT: %require_complete.loc6_17 => constants.%complete_type.2 // CHECK:STDOUT: %F.specific_fn.loc6_43.2 => constants.%F.specific_fn.2 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -335,18 +353,21 @@ fn G(p: C*) -> const C { // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %complete_type.1: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %ptr.1: type = ptr_type %T [symbolic] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] +// CHECK:STDOUT: %require_complete.1: = require_complete_type %T [symbolic] +// CHECK:STDOUT: %require_complete.2: = require_complete_type %ptr.1 [symbolic] // CHECK:STDOUT: %F.specific_fn.1: = specific_function %F, @F(%T) [symbolic] // CHECK:STDOUT: %const: type = const_type %C [template] // CHECK:STDOUT: %ptr.2: type = ptr_type %const [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] // CHECK:STDOUT: %F.specific_fn.2: = specific_function %F, @F(%const) [template] +// CHECK:STDOUT: %complete_type.2: = complete_type_witness %ptr.2 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -402,7 +423,7 @@ fn G(p: C*) -> const C { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C @@ -415,6 +436,8 @@ fn G(p: C*) -> const C { // CHECK:STDOUT: %ptr.loc6_20.2: type = ptr_type @F.%T.loc6_6.2 (%T) [symbolic = %ptr.loc6_20.2 (constants.%ptr.1)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete.loc6_23: = require_complete_type @F.%T.loc6_6.2 (%T) [symbolic = %require_complete.loc6_23 (constants.%require_complete.1)] +// CHECK:STDOUT: %require_complete.loc6_17: = require_complete_type @F.%ptr.loc6_20.2 (%ptr.1) [symbolic = %require_complete.loc6_17 (constants.%require_complete.2)] // CHECK:STDOUT: %F.specific_fn.loc6_37.2: = specific_function constants.%F, @F(%T.loc6_6.2) [symbolic = %F.specific_fn.loc6_37.2 (constants.%F.specific_fn.1)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%T.param_patt: type](%p.param_patt: @F.%ptr.loc6_20.2 (%ptr.1)) -> @F.%T.loc6_6.2 (%T) { @@ -445,6 +468,8 @@ fn G(p: C*) -> const C { // CHECK:STDOUT: %ptr.loc6_20.2 => constants.%ptr.1 // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete.loc6_23 => constants.%require_complete.1 +// CHECK:STDOUT: %require_complete.loc6_17 => constants.%require_complete.2 // CHECK:STDOUT: %F.specific_fn.loc6_37.2 => constants.%F.specific_fn.1 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -460,6 +485,8 @@ fn G(p: C*) -> const C { // CHECK:STDOUT: %ptr.loc6_20.2 => constants.%ptr.2 // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete.loc6_23 => constants.%complete_type.1 +// CHECK:STDOUT: %require_complete.loc6_17 => constants.%complete_type.2 // CHECK:STDOUT: %F.specific_fn.loc6_37.2 => constants.%F.specific_fn.2 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -475,6 +502,8 @@ fn G(p: C*) -> const C { // CHECK:STDOUT: %ptr.1: type = ptr_type %const.1 [symbolic] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] +// CHECK:STDOUT: %require_complete.1: = require_complete_type %T [symbolic] +// CHECK:STDOUT: %require_complete.2: = require_complete_type %ptr.1 [symbolic] // CHECK:STDOUT: %F.specific_fn: = specific_function %F, @F(%T) [symbolic] // CHECK:STDOUT: %ptr.2: type = ptr_type %C [template] // CHECK:STDOUT: %const.2: type = const_type %C [template] @@ -549,6 +578,8 @@ fn G(p: C*) -> const C { // CHECK:STDOUT: %ptr.loc6_26.2: type = ptr_type @F.%const.loc6_19.2 (%const.1) [symbolic = %ptr.loc6_26.2 (constants.%ptr.1)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete.loc6_29: = require_complete_type @F.%T.loc6_6.2 (%T) [symbolic = %require_complete.loc6_29 (constants.%require_complete.1)] +// CHECK:STDOUT: %require_complete.loc6_17: = require_complete_type @F.%ptr.loc6_26.2 (%ptr.1) [symbolic = %require_complete.loc6_17 (constants.%require_complete.2)] // CHECK:STDOUT: %F.specific_fn.loc6_43.2: = specific_function constants.%F, @F(%T.loc6_6.2) [symbolic = %F.specific_fn.loc6_43.2 (constants.%F.specific_fn)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%T.param_patt: type](%p.param_patt: @F.%ptr.loc6_26.2 (%ptr.1)) -> @F.%T.loc6_6.2 (%T) { @@ -577,6 +608,8 @@ fn G(p: C*) -> const C { // CHECK:STDOUT: %ptr.loc6_26.2 => constants.%ptr.1 // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete.loc6_29 => constants.%require_complete.1 +// CHECK:STDOUT: %require_complete.loc6_17 => constants.%require_complete.2 // CHECK:STDOUT: %F.specific_fn.loc6_43.2 => constants.%F.specific_fn // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/eval/symbolic.carbon b/toolchain/check/testdata/eval/symbolic.carbon index 516d5b6f0bc6d..6d79a08c24fae 100644 --- a/toolchain/check/testdata/eval/symbolic.carbon +++ b/toolchain/check/testdata/eval/symbolic.carbon @@ -26,9 +26,12 @@ fn F(T:! type) { // CHECK:STDOUT: %const: type = const_type %T [symbolic] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (type, type) [template] // CHECK:STDOUT: %tuple.type.2: type = tuple_type (%ptr.1, %const) [symbolic] +// CHECK:STDOUT: %require_complete.1: = require_complete_type %tuple.type.2 [symbolic] // CHECK:STDOUT: %struct_type.a: type = struct_type {.a: %T} [symbolic] +// CHECK:STDOUT: %require_complete.2: = require_complete_type %struct_type.a [symbolic] // CHECK:STDOUT: %int_5: Core.IntLiteral = int_value 5 [template] // CHECK:STDOUT: %array_type: type = array_type %int_5, %T [symbolic] +// CHECK:STDOUT: %require_complete.3: = require_complete_type %array_type [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -61,8 +64,11 @@ fn F(T:! type) { // CHECK:STDOUT: %ptr.loc13_12.2: type = ptr_type @F.%T.loc12_6.2 (%T) [symbolic = %ptr.loc13_12.2 (constants.%ptr.1)] // CHECK:STDOUT: %const.loc13_15.2: type = const_type @F.%T.loc12_6.2 (%T) [symbolic = %const.loc13_15.2 (constants.%const)] // CHECK:STDOUT: %tuple.type: type = tuple_type (@F.%ptr.loc13_12.2 (%ptr.1), @F.%const.loc13_15.2 (%const)) [symbolic = %tuple.type (constants.%tuple.type.2)] +// CHECK:STDOUT: %require_complete.loc13: = require_complete_type @F.%tuple.type (%tuple.type.2) [symbolic = %require_complete.loc13 (constants.%require_complete.1)] // CHECK:STDOUT: %struct_type.a.loc14_16.2: type = struct_type {.a: @F.%T.loc12_6.2 (%T)} [symbolic = %struct_type.a.loc14_16.2 (constants.%struct_type.a)] +// CHECK:STDOUT: %require_complete.loc14: = require_complete_type @F.%struct_type.a.loc14_16.2 (%struct_type.a) [symbolic = %require_complete.loc14 (constants.%require_complete.2)] // CHECK:STDOUT: %array_type.loc15_15.2: type = array_type constants.%int_5, @F.%T.loc12_6.2 (%T) [symbolic = %array_type.loc15_15.2 (constants.%array_type)] +// CHECK:STDOUT: %require_complete.loc15: = require_complete_type @F.%array_type.loc15_15.2 (%array_type) [symbolic = %require_complete.loc15 (constants.%require_complete.3)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%T.param_patt: type) { // CHECK:STDOUT: !entry: diff --git a/toolchain/check/testdata/function/call/prefer_unqualified_lookup.carbon b/toolchain/check/testdata/function/call/prefer_unqualified_lookup.carbon index c5be597472506..c686caf50b0c8 100644 --- a/toolchain/check/testdata/function/call/prefer_unqualified_lookup.carbon +++ b/toolchain/check/testdata/function/call/prefer_unqualified_lookup.carbon @@ -42,7 +42,7 @@ fn Class(F:! type).Inner.G() -> i32 { return F(); } // CHECK:STDOUT: %G.type: type = fn_type @G, @Inner(%F.1) [symbolic] // CHECK:STDOUT: %G: %G.type = struct_value () [symbolic] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %complete_type.1: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] @@ -99,7 +99,7 @@ fn Class(F:! type).Inner.G() -> i32 { return F(); } // CHECK:STDOUT: // CHECK:STDOUT: class { // CHECK:STDOUT: %Inner.decl: type = class_decl @Inner [template = constants.%Inner.1] {} {} -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class @@ -139,7 +139,7 @@ fn Class(F:! type).Inner.G() -> i32 { return F(); } // CHECK:STDOUT: %return.param.loc9: ref %i32 = out_param runtime_param0 // CHECK:STDOUT: %return.loc9: ref %i32 = return_slot %return.param.loc9 // CHECK:STDOUT: } -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Inner.2 diff --git a/toolchain/check/testdata/function/declaration/no_prelude/fail_import_incomplete_return.carbon b/toolchain/check/testdata/function/declaration/no_prelude/fail_import_incomplete_return.carbon index 99f0021778a34..26a536920ffc2 100644 --- a/toolchain/check/testdata/function/declaration/no_prelude/fail_import_incomplete_return.carbon +++ b/toolchain/check/testdata/function/declaration/no_prelude/fail_import_incomplete_return.carbon @@ -23,7 +23,7 @@ fn ReturnDUsed() -> D; fn Call() { // CHECK:STDERR: fail_incomplete_return.carbon:[[@LINE+10]]:3: error: function returns incomplete type `C` [IncompleteTypeInFunctionReturnType] // CHECK:STDERR: ReturnCUsed(); - // CHECK:STDERR: ^~~~~~~~~~~ + // CHECK:STDERR: ^~~~~~~~~~~~~ // CHECK:STDERR: fail_incomplete_return.carbon:[[@LINE-12]]:1: note: class was forward declared here [ClassForwardDeclaredHere] // CHECK:STDERR: class C; // CHECK:STDERR: ^~~~~~~~ @@ -34,7 +34,7 @@ fn Call() { ReturnCUsed(); // CHECK:STDERR: fail_incomplete_return.carbon:[[@LINE+10]]:3: error: function returns incomplete type `D` [IncompleteTypeInFunctionReturnType] // CHECK:STDERR: ReturnDUsed(); - // CHECK:STDERR: ^~~~~~~~~~~ + // CHECK:STDERR: ^~~~~~~~~~~~~ // CHECK:STDERR: fail_incomplete_return.carbon:[[@LINE-22]]:1: note: class was forward declared here [ClassForwardDeclaredHere] // CHECK:STDERR: class D; // CHECK:STDERR: ^~~~~~~~ @@ -56,7 +56,7 @@ import library "incomplete_return"; fn CallFAndGIncomplete() { // CHECK:STDERR: fail_use_imported.carbon:[[@LINE+12]]:3: error: function returns incomplete type `C` [IncompleteTypeInFunctionReturnType] // CHECK:STDERR: ReturnCUnused(); - // CHECK:STDERR: ^~~~~~~~~~~~~ + // CHECK:STDERR: ^~~~~~~~~~~~~~~ // CHECK:STDERR: fail_use_imported.carbon:[[@LINE-6]]:1: in import [InImport] // CHECK:STDERR: fail_incomplete_return.carbon:4:1: note: class was forward declared here [ClassForwardDeclaredHere] // CHECK:STDERR: class C; @@ -69,7 +69,7 @@ fn CallFAndGIncomplete() { ReturnCUnused(); // CHECK:STDERR: fail_use_imported.carbon:[[@LINE+11]]:3: error: function returns incomplete type `C` [IncompleteTypeInFunctionReturnType] // CHECK:STDERR: ReturnCUsed(); - // CHECK:STDERR: ^~~~~~~~~~~ + // CHECK:STDERR: ^~~~~~~~~~~~~ // CHECK:STDERR: fail_use_imported.carbon:[[@LINE-19]]:1: in import [InImport] // CHECK:STDERR: fail_incomplete_return.carbon:4:1: note: class was forward declared here [ClassForwardDeclaredHere] // CHECK:STDERR: class C; diff --git a/toolchain/check/testdata/function/generic/deduce.carbon b/toolchain/check/testdata/function/generic/deduce.carbon index 20800f5e991d5..a93133a675c43 100644 --- a/toolchain/check/testdata/function/generic/deduce.carbon +++ b/toolchain/check/testdata/function/generic/deduce.carbon @@ -198,6 +198,7 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: %ptr.1: type = ptr_type %T [symbolic] // CHECK:STDOUT: %ExplicitGenericParam.type: type = fn_type @ExplicitGenericParam [template] // CHECK:STDOUT: %ExplicitGenericParam: %ExplicitGenericParam.type = struct_value () [template] +// CHECK:STDOUT: %require_complete.1: = require_complete_type %ptr.1 [symbolic] // CHECK:STDOUT: %ExplicitGenericParam.specific_fn.1: = specific_function %ExplicitGenericParam, @ExplicitGenericParam(%T) [symbolic] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] // CHECK:STDOUT: %Int.type: type = fn_type @Int [template] @@ -211,7 +212,9 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: %ptr.3: type = ptr_type %struct_type.a [symbolic] // CHECK:STDOUT: %CallExplicitGenericParamWithGenericArg.type: type = fn_type @CallExplicitGenericParamWithGenericArg [template] // CHECK:STDOUT: %CallExplicitGenericParamWithGenericArg: %CallExplicitGenericParamWithGenericArg.type = struct_value () [template] +// CHECK:STDOUT: %require_complete.2: = require_complete_type %ptr.3 [symbolic] // CHECK:STDOUT: %ExplicitGenericParam.specific_fn.3: = specific_function %ExplicitGenericParam, @ExplicitGenericParam(%struct_type.a) [symbolic] +// CHECK:STDOUT: %complete_type: = complete_type_witness %ptr.2 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -277,6 +280,7 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: %ptr.loc4_39.2: type = ptr_type @ExplicitGenericParam.%T.loc4_25.2 (%T) [symbolic = %ptr.loc4_39.2 (constants.%ptr.1)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete: = require_complete_type @ExplicitGenericParam.%ptr.loc4_39.2 (%ptr.1) [symbolic = %require_complete (constants.%require_complete.1)] // CHECK:STDOUT: %ExplicitGenericParam.specific_fn.loc4_50.2: = specific_function constants.%ExplicitGenericParam, @ExplicitGenericParam(%T.loc4_25.2) [symbolic = %ExplicitGenericParam.specific_fn.loc4_50.2 (constants.%ExplicitGenericParam.specific_fn.1)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%T.param_patt: type) -> @ExplicitGenericParam.%ptr.loc4_39.2 (%ptr.1) { @@ -312,6 +316,7 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: %ptr.loc10_63.2: type = ptr_type @CallExplicitGenericParamWithGenericArg.%struct_type.a.loc10_62.2 (%struct_type.a) [symbolic = %ptr.loc10_63.2 (constants.%ptr.3)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete: = require_complete_type @CallExplicitGenericParamWithGenericArg.%ptr.loc10_63.2 (%ptr.3) [symbolic = %require_complete (constants.%require_complete.2)] // CHECK:STDOUT: %ExplicitGenericParam.specific_fn.loc11_10.2: = specific_function constants.%ExplicitGenericParam, @ExplicitGenericParam(%struct_type.a.loc10_62.2) [symbolic = %ExplicitGenericParam.specific_fn.loc11_10.2 (constants.%ExplicitGenericParam.specific_fn.3)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%T.param_patt: type) -> @CallExplicitGenericParamWithGenericArg.%ptr.loc10_63.2 (%ptr.3) { @@ -333,6 +338,7 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: %ptr.loc4_39.2 => constants.%ptr.1 // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete => constants.%require_complete.1 // CHECK:STDOUT: %ExplicitGenericParam.specific_fn.loc4_50.2 => constants.%ExplicitGenericParam.specific_fn.1 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -348,6 +354,7 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: %ptr.loc4_39.2 => constants.%ptr.2 // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete => constants.%complete_type // CHECK:STDOUT: %ExplicitGenericParam.specific_fn.loc4_50.2 => constants.%ExplicitGenericParam.specific_fn.2 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -364,6 +371,7 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: %ptr.loc4_39.2 => constants.%ptr.3 // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete => constants.%require_complete.2 // CHECK:STDOUT: %ExplicitGenericParam.specific_fn.loc4_50.2 => constants.%ExplicitGenericParam.specific_fn.3 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -381,6 +389,7 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: %ptr: type = ptr_type %T [symbolic] // CHECK:STDOUT: %ExplicitGenericParam.type: type = fn_type @ExplicitGenericParam [template] // CHECK:STDOUT: %ExplicitGenericParam: %ExplicitGenericParam.type = struct_value () [template] +// CHECK:STDOUT: %require_complete: = require_complete_type %ptr [symbolic] // CHECK:STDOUT: %ExplicitGenericParam.specific_fn: = specific_function %ExplicitGenericParam, @ExplicitGenericParam(%T) [symbolic] // CHECK:STDOUT: %CallExplicitGenericParamConst.type: type = fn_type @CallExplicitGenericParamConst [template] // CHECK:STDOUT: %CallExplicitGenericParamConst: %CallExplicitGenericParamConst.type = struct_value () [template] @@ -438,6 +447,7 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: %ptr.loc4_39.2: type = ptr_type @ExplicitGenericParam.%T.loc4_25.2 (%T) [symbolic = %ptr.loc4_39.2 (constants.%ptr)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete: = require_complete_type @ExplicitGenericParam.%ptr.loc4_39.2 (%ptr) [symbolic = %require_complete (constants.%require_complete)] // CHECK:STDOUT: %ExplicitGenericParam.specific_fn.loc4_50.2: = specific_function constants.%ExplicitGenericParam, @ExplicitGenericParam(%T.loc4_25.2) [symbolic = %ExplicitGenericParam.specific_fn.loc4_50.2 (constants.%ExplicitGenericParam.specific_fn)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%T.param_patt: type) -> @ExplicitGenericParam.%ptr.loc4_39.2 (%ptr) { @@ -459,6 +469,7 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ExplicitGenericParam.specific_fn.loc7_3.2: = specific_function constants.%ExplicitGenericParam, @ExplicitGenericParam(%T.loc6_34.2) [symbolic = %ExplicitGenericParam.specific_fn.loc7_3.2 (constants.%ExplicitGenericParam.specific_fn)] // CHECK:STDOUT: %ptr: type = ptr_type @CallExplicitGenericParamConst.%T.loc6_34.2 (%T) [symbolic = %ptr (constants.%ptr)] +// CHECK:STDOUT: %require_complete: = require_complete_type @CallExplicitGenericParamConst.%ptr (%ptr) [symbolic = %require_complete (constants.%require_complete)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%T.param_patt: type) { // CHECK:STDOUT: !entry: @@ -483,6 +494,7 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: %ptr.loc4_39.2 => constants.%ptr // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete => constants.%require_complete // CHECK:STDOUT: %ExplicitGenericParam.specific_fn.loc4_50.2 => constants.%ExplicitGenericParam.specific_fn // CHECK:STDOUT: } // CHECK:STDOUT: @@ -508,18 +520,21 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: constants { // CHECK:STDOUT: %A: type = class_type @A [template] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %complete_type.1: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %ptr.1: type = ptr_type %T [symbolic] // CHECK:STDOUT: %ExplicitAndAlsoDeduced.type: type = fn_type @ExplicitAndAlsoDeduced [template] // CHECK:STDOUT: %ExplicitAndAlsoDeduced: %ExplicitAndAlsoDeduced.type = struct_value () [template] +// CHECK:STDOUT: %require_complete.1: = require_complete_type %ptr.1 [symbolic] +// CHECK:STDOUT: %require_complete.2: = require_complete_type %T [symbolic] // CHECK:STDOUT: %ExplicitAndAlsoDeduced.specific_fn.1: = specific_function %ExplicitAndAlsoDeduced, @ExplicitAndAlsoDeduced(%T) [symbolic] // CHECK:STDOUT: %ptr.2: type = ptr_type %A [template] // CHECK:STDOUT: %CallExplicitAndAlsoDeduced.type: type = fn_type @CallExplicitAndAlsoDeduced [template] // CHECK:STDOUT: %CallExplicitAndAlsoDeduced: %CallExplicitAndAlsoDeduced.type = struct_value () [template] // CHECK:STDOUT: %ExplicitAndAlsoDeduced.specific_fn.2: = specific_function %ExplicitAndAlsoDeduced, @ExplicitAndAlsoDeduced(%A) [template] // CHECK:STDOUT: %A.val: %A = struct_value () [template] +// CHECK:STDOUT: %complete_type.2: = complete_type_witness %ptr.2 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -568,7 +583,7 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @A { -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%A @@ -581,6 +596,8 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: %ptr.loc6_47.2: type = ptr_type @ExplicitAndAlsoDeduced.%T.loc6_27.2 (%T) [symbolic = %ptr.loc6_47.2 (constants.%ptr.1)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete.loc6_43: = require_complete_type @ExplicitAndAlsoDeduced.%ptr.loc6_47.2 (%ptr.1) [symbolic = %require_complete.loc6_43 (constants.%require_complete.1)] +// CHECK:STDOUT: %require_complete.loc6_38: = require_complete_type @ExplicitAndAlsoDeduced.%T.loc6_27.2 (%T) [symbolic = %require_complete.loc6_38 (constants.%require_complete.2)] // CHECK:STDOUT: %ExplicitAndAlsoDeduced.specific_fn.loc7_10.2: = specific_function constants.%ExplicitAndAlsoDeduced, @ExplicitAndAlsoDeduced(%T.loc6_27.2) [symbolic = %ExplicitAndAlsoDeduced.specific_fn.loc7_10.2 (constants.%ExplicitAndAlsoDeduced.specific_fn.1)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%T.param_patt: type, %x.param_patt: @ExplicitAndAlsoDeduced.%T.loc6_27.2 (%T)) -> @ExplicitAndAlsoDeduced.%ptr.loc6_47.2 (%ptr.1) { @@ -619,6 +636,8 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: %ptr.loc6_47.2 => constants.%ptr.1 // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete.loc6_43 => constants.%require_complete.1 +// CHECK:STDOUT: %require_complete.loc6_38 => constants.%require_complete.2 // CHECK:STDOUT: %ExplicitAndAlsoDeduced.specific_fn.loc7_10.2 => constants.%ExplicitAndAlsoDeduced.specific_fn.1 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -634,6 +653,8 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: %ptr.loc6_47.2 => constants.%ptr.2 // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete.loc6_43 => constants.%complete_type.2 +// CHECK:STDOUT: %require_complete.loc6_38 => constants.%complete_type.1 // CHECK:STDOUT: %ExplicitAndAlsoDeduced.specific_fn.loc7_10.2 => constants.%ExplicitAndAlsoDeduced.specific_fn.2 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -645,6 +666,8 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: %ptr.1: type = ptr_type %T [symbolic] // CHECK:STDOUT: %ImplicitGenericParam.type: type = fn_type @ImplicitGenericParam [template] // CHECK:STDOUT: %ImplicitGenericParam: %ImplicitGenericParam.type = struct_value () [template] +// CHECK:STDOUT: %require_complete.1: = require_complete_type %ptr.1 [symbolic] +// CHECK:STDOUT: %require_complete.2: = require_complete_type %T [symbolic] // CHECK:STDOUT: %ImplicitGenericParam.specific_fn.1: = specific_function %ImplicitGenericParam, @ImplicitGenericParam(%T) [symbolic] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] // CHECK:STDOUT: %Int.type: type = fn_type @Int [template] @@ -654,6 +677,8 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: %CallImplicitGenericParam.type: type = fn_type @CallImplicitGenericParam [template] // CHECK:STDOUT: %CallImplicitGenericParam: %CallImplicitGenericParam.type = struct_value () [template] // CHECK:STDOUT: %ImplicitGenericParam.specific_fn.2: = specific_function %ImplicitGenericParam, @ImplicitGenericParam(%i32) [template] +// CHECK:STDOUT: %complete_type.1: = complete_type_witness %ptr.2 [template] +// CHECK:STDOUT: %complete_type.2: = complete_type_witness %i32 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -717,6 +742,8 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: %ptr.loc4_45.2: type = ptr_type @ImplicitGenericParam.%T.loc4_25.2 (%T) [symbolic = %ptr.loc4_45.2 (constants.%ptr.1)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete.loc4_41: = require_complete_type @ImplicitGenericParam.%ptr.loc4_45.2 (%ptr.1) [symbolic = %require_complete.loc4_41 (constants.%require_complete.1)] +// CHECK:STDOUT: %require_complete.loc4_36: = require_complete_type @ImplicitGenericParam.%T.loc4_25.2 (%T) [symbolic = %require_complete.loc4_36 (constants.%require_complete.2)] // CHECK:STDOUT: %ImplicitGenericParam.specific_fn.loc4_56.2: = specific_function constants.%ImplicitGenericParam, @ImplicitGenericParam(%T.loc4_25.2) [symbolic = %ImplicitGenericParam.specific_fn.loc4_56.2 (constants.%ImplicitGenericParam.specific_fn.1)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%T.param_patt: type](%x.param_patt: @ImplicitGenericParam.%T.loc4_25.2 (%T)) -> @ImplicitGenericParam.%ptr.loc4_45.2 (%ptr.1) { @@ -748,6 +775,8 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: %ptr.loc4_45.2 => constants.%ptr.1 // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete.loc4_41 => constants.%require_complete.1 +// CHECK:STDOUT: %require_complete.loc4_36 => constants.%require_complete.2 // CHECK:STDOUT: %ImplicitGenericParam.specific_fn.loc4_56.2 => constants.%ImplicitGenericParam.specific_fn.1 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -763,6 +792,8 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: %ptr.loc4_45.2 => constants.%ptr.2 // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete.loc4_41 => constants.%complete_type.1 +// CHECK:STDOUT: %require_complete.loc4_36 => constants.%complete_type.2 // CHECK:STDOUT: %ImplicitGenericParam.specific_fn.loc4_56.2 => constants.%ImplicitGenericParam.specific_fn.2 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -780,6 +811,7 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: %tuple.type.2: type = tuple_type (%T, %i32) [symbolic] // CHECK:STDOUT: %TupleParam.type: type = fn_type @TupleParam [template] // CHECK:STDOUT: %TupleParam: %TupleParam.type = struct_value () [template] +// CHECK:STDOUT: %require_complete.1: = require_complete_type %tuple.type.2 [symbolic] // CHECK:STDOUT: %CallTupleParam.type: type = fn_type @CallTupleParam [template] // CHECK:STDOUT: %CallTupleParam: %CallTupleParam.type = struct_value () [template] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template] @@ -795,6 +827,7 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] // CHECK:STDOUT: %tuple: %tuple.type.4 = tuple_value (%int_1, %int_2.2) [template] +// CHECK:STDOUT: %complete_type.3: = complete_type_witness %tuple.type.4 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -840,6 +873,7 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: %tuple.type: type = tuple_type (@TupleParam.%T.loc4_15.2 (%T), %i32) [symbolic = %tuple.type (constants.%tuple.type.2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete: = require_complete_type @TupleParam.%tuple.type (%tuple.type.2) [symbolic = %require_complete (constants.%require_complete.1)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%T.param_patt: type](%x.param_patt: @TupleParam.%tuple.type (%tuple.type.2)) { // CHECK:STDOUT: !entry: @@ -878,6 +912,7 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: %tuple.type => constants.%tuple.type.4 // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete => constants.%complete_type.3 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- deduce_nested_struct.carbon @@ -893,6 +928,7 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: %struct_type.a.b.1: type = struct_type {.a: %T, .b: %i32} [symbolic] // CHECK:STDOUT: %StructParam.type: type = fn_type @StructParam [template] // CHECK:STDOUT: %StructParam: %StructParam.type = struct_value () [template] +// CHECK:STDOUT: %require_complete.1: = require_complete_type %struct_type.a.b.1 [symbolic] // CHECK:STDOUT: %CallStructParam.type: type = fn_type @CallStructParam [template] // CHECK:STDOUT: %CallStructParam: %CallStructParam.type = struct_value () [template] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template] @@ -908,6 +944,7 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] // CHECK:STDOUT: %struct: %struct_type.a.b.3 = struct_value (%int_1, %int_2.2) [template] +// CHECK:STDOUT: %complete_type.3: = complete_type_witness %struct_type.a.b.3 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -952,6 +989,7 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: %struct_type.a.b.loc4_44.2: type = struct_type {.a: @StructParam.%T.loc4_16.2 (%T), .b: %i32} [symbolic = %struct_type.a.b.loc4_44.2 (constants.%struct_type.a.b.1)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete: = require_complete_type @StructParam.%struct_type.a.b.loc4_44.2 (%struct_type.a.b.1) [symbolic = %require_complete (constants.%require_complete.1)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%T.param_patt: type](%x.param_patt: @StructParam.%struct_type.a.b.loc4_44.2 (%struct_type.a.b.1)) { // CHECK:STDOUT: !entry: @@ -990,6 +1028,7 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: %struct_type.a.b.loc4_44.2 => constants.%struct_type.a.b.3 // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete => constants.%complete_type.3 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_deduce_bigger_struct.carbon @@ -1004,6 +1043,7 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: %struct_type.c.d.e: type = struct_type {.c: %T, .d: %i32, .e: %i32} [symbolic] // CHECK:STDOUT: %BigStructParam.type: type = fn_type @BigStructParam [template] // CHECK:STDOUT: %BigStructParam: %BigStructParam.type = struct_value () [template] +// CHECK:STDOUT: %require_complete: = require_complete_type %struct_type.c.d.e [symbolic] // CHECK:STDOUT: %CallBigStructParam.type: type = fn_type @CallBigStructParam [template] // CHECK:STDOUT: %CallBigStructParam: %CallBigStructParam.type = struct_value () [template] // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template] @@ -1056,6 +1096,7 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: %struct_type.c.d.e.loc4_56.2: type = struct_type {.c: @BigStructParam.%T.loc4_19.2 (%T), .d: %i32, .e: %i32} [symbolic = %struct_type.c.d.e.loc4_56.2 (constants.%struct_type.c.d.e)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete: = require_complete_type @BigStructParam.%struct_type.c.d.e.loc4_56.2 (%struct_type.c.d.e) [symbolic = %require_complete (constants.%require_complete)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%T.param_patt: type](%x.param_patt: @BigStructParam.%struct_type.c.d.e.loc4_56.2 (%struct_type.c.d.e)) { // CHECK:STDOUT: !entry: @@ -1090,6 +1131,7 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: %struct_type.f.g: type = struct_type {.f: %T, .g: %i32} [symbolic] // CHECK:STDOUT: %SmallStructParam.type: type = fn_type @SmallStructParam [template] // CHECK:STDOUT: %SmallStructParam: %SmallStructParam.type = struct_value () [template] +// CHECK:STDOUT: %require_complete: = require_complete_type %struct_type.f.g [symbolic] // CHECK:STDOUT: %CallSmallStructParam.type: type = fn_type @CallSmallStructParam [template] // CHECK:STDOUT: %CallSmallStructParam: %CallSmallStructParam.type = struct_value () [template] // CHECK:STDOUT: %int_5: Core.IntLiteral = int_value 5 [template] @@ -1139,6 +1181,7 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: %struct_type.f.g.loc4_49.2: type = struct_type {.f: @SmallStructParam.%T.loc4_21.2 (%T), .g: %i32} [symbolic = %struct_type.f.g.loc4_49.2 (constants.%struct_type.f.g)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete: = require_complete_type @SmallStructParam.%struct_type.f.g.loc4_49.2 (%struct_type.f.g) [symbolic = %require_complete (constants.%require_complete)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%T.param_patt: type](%x.param_patt: @SmallStructParam.%struct_type.f.g.loc4_49.2 (%struct_type.f.g)) { // CHECK:STDOUT: !entry: @@ -1174,6 +1217,7 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: %struct_type.i.different: type = struct_type {.i: %T, .different: %i32} [symbolic] // CHECK:STDOUT: %WrongNameStructParam.type: type = fn_type @WrongNameStructParam [template] // CHECK:STDOUT: %WrongNameStructParam: %WrongNameStructParam.type = struct_value () [template] +// CHECK:STDOUT: %require_complete: = require_complete_type %struct_type.i.different [symbolic] // CHECK:STDOUT: %CallWrongNameStructParam.type: type = fn_type @CallWrongNameStructParam [template] // CHECK:STDOUT: %CallWrongNameStructParam: %CallWrongNameStructParam.type = struct_value () [template] // CHECK:STDOUT: %int_8: Core.IntLiteral = int_value 8 [template] @@ -1222,6 +1266,7 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: %struct_type.i.different.loc4_61.2: type = struct_type {.i: @WrongNameStructParam.%T.loc4_25.2 (%T), .different: %i32} [symbolic = %struct_type.i.different.loc4_61.2 (constants.%struct_type.i.different)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete: = require_complete_type @WrongNameStructParam.%struct_type.i.different.loc4_61.2 (%struct_type.i.different) [symbolic = %require_complete (constants.%require_complete)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%T.param_patt: type](%x.param_patt: @WrongNameStructParam.%struct_type.i.different.loc4_61.2 (%struct_type.i.different)) { // CHECK:STDOUT: !entry: @@ -1256,6 +1301,7 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: %struct_type.first.second: type = struct_type {.first: %T, .second: %i32} [symbolic] // CHECK:STDOUT: %WrongOrderStructParam.type: type = fn_type @WrongOrderStructParam [template] // CHECK:STDOUT: %WrongOrderStructParam: %WrongOrderStructParam.type = struct_value () [template] +// CHECK:STDOUT: %require_complete: = require_complete_type %struct_type.first.second [symbolic] // CHECK:STDOUT: %CallWrongOrderStructParam.type: type = fn_type @CallWrongOrderStructParam [template] // CHECK:STDOUT: %CallWrongOrderStructParam: %CallWrongOrderStructParam.type = struct_value () [template] // CHECK:STDOUT: %int_11: Core.IntLiteral = int_value 11 [template] @@ -1304,6 +1350,7 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: %struct_type.first.second.loc4_63.2: type = struct_type {.first: @WrongOrderStructParam.%T.loc4_26.2 (%T), .second: %i32} [symbolic = %struct_type.first.second.loc4_63.2 (constants.%struct_type.first.second)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete: = require_complete_type @WrongOrderStructParam.%struct_type.first.second.loc4_63.2 (%struct_type.first.second) [symbolic = %require_complete (constants.%require_complete)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%T.param_patt: type](%x.param_patt: @WrongOrderStructParam.%struct_type.first.second.loc4_63.2 (%struct_type.first.second)) { // CHECK:STDOUT: !entry: diff --git a/toolchain/check/testdata/function/generic/no_prelude/call.carbon b/toolchain/check/testdata/function/generic/no_prelude/call.carbon index 2fe6b5f7a0304..c758b59a9445a 100644 --- a/toolchain/check/testdata/function/generic/no_prelude/call.carbon +++ b/toolchain/check/testdata/function/generic/no_prelude/call.carbon @@ -59,12 +59,14 @@ fn CallSpecific(x: C) -> C { // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %Function.type: type = fn_type @Function [template] // CHECK:STDOUT: %Function: %Function.type = struct_value () [template] +// CHECK:STDOUT: %require_complete.1: = require_complete_type %T [symbolic] // CHECK:STDOUT: %CallGeneric.type: type = fn_type @CallGeneric [template] // CHECK:STDOUT: %CallGeneric: %CallGeneric.type = struct_value () [template] // CHECK:STDOUT: %Function.specific_fn.1: = specific_function %Function, @Function(%T) [symbolic] // CHECK:STDOUT: %ptr.1: type = ptr_type %T [symbolic] // CHECK:STDOUT: %CallGenericPtr.type: type = fn_type @CallGenericPtr [template] // CHECK:STDOUT: %CallGenericPtr: %CallGenericPtr.type = struct_value () [template] +// CHECK:STDOUT: %require_complete.2: = require_complete_type %ptr.1 [symbolic] // CHECK:STDOUT: %Function.specific_fn.2: = specific_function %Function, @Function(%ptr.1) [symbolic] // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] @@ -164,6 +166,7 @@ fn CallSpecific(x: C) -> C { // CHECK:STDOUT: %T.patt.loc4_13.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_13.2 (constants.%T.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete: = require_complete_type @Function.%T.loc4_13.2 (%T) [symbolic = %require_complete (constants.%require_complete.1)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%T.param_patt: type, %x.param_patt: @Function.%T.loc4_13.2 (%T)) -> @Function.%T.loc4_13.2 (%T) { // CHECK:STDOUT: !entry: @@ -177,6 +180,7 @@ fn CallSpecific(x: C) -> C { // CHECK:STDOUT: %T.patt.loc8_16.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_16.2 (constants.%T.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete: = require_complete_type @CallGeneric.%T.loc8_16.2 (%T) [symbolic = %require_complete (constants.%require_complete.1)] // CHECK:STDOUT: %Function.specific_fn.loc9_10.2: = specific_function constants.%Function, @Function(%T.loc8_16.2) [symbolic = %Function.specific_fn.loc9_10.2 (constants.%Function.specific_fn.1)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%T.param_patt: type, %x.param_patt: @CallGeneric.%T.loc8_16.2 (%T)) -> @CallGeneric.%T.loc8_16.2 (%T) { @@ -198,6 +202,7 @@ fn CallSpecific(x: C) -> C { // CHECK:STDOUT: %ptr.loc12_33.2: type = ptr_type @CallGenericPtr.%T.loc12_19.2 (%T) [symbolic = %ptr.loc12_33.2 (constants.%ptr.1)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete: = require_complete_type @CallGenericPtr.%ptr.loc12_33.2 (%ptr.1) [symbolic = %require_complete (constants.%require_complete.2)] // CHECK:STDOUT: %Function.specific_fn.loc13_10.2: = specific_function constants.%Function, @Function(%ptr.loc12_33.2) [symbolic = %Function.specific_fn.loc13_10.2 (constants.%Function.specific_fn.2)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%T.param_patt: type, %x.param_patt: @CallGenericPtr.%ptr.loc12_33.2 (%ptr.1)) -> @CallGenericPtr.%ptr.loc12_33.2 (%ptr.1) { @@ -230,6 +235,7 @@ fn CallSpecific(x: C) -> C { // CHECK:STDOUT: %T.patt.loc4_13.2 => constants.%T // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete => constants.%require_complete.1 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @CallGeneric(constants.%T) { @@ -253,6 +259,7 @@ fn CallSpecific(x: C) -> C { // CHECK:STDOUT: %T.patt.loc4_13.2 => constants.%ptr.1 // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete => constants.%require_complete.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Function(@CallGenericPtr.%ptr.loc12_33.2) { @@ -265,6 +272,7 @@ fn CallSpecific(x: C) -> C { // CHECK:STDOUT: %T.patt.loc4_13.2 => constants.%C // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete => constants.%complete_type // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- deduced.carbon @@ -274,12 +282,14 @@ fn CallSpecific(x: C) -> C { // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %Function.type: type = fn_type @Function [template] // CHECK:STDOUT: %Function: %Function.type = struct_value () [template] +// CHECK:STDOUT: %require_complete.1: = require_complete_type %T [symbolic] // CHECK:STDOUT: %CallGeneric.type: type = fn_type @CallGeneric [template] // CHECK:STDOUT: %CallGeneric: %CallGeneric.type = struct_value () [template] // CHECK:STDOUT: %Function.specific_fn.1: = specific_function %Function, @Function(%T) [symbolic] // CHECK:STDOUT: %ptr.1: type = ptr_type %T [symbolic] // CHECK:STDOUT: %CallGenericPtr.type: type = fn_type @CallGenericPtr [template] // CHECK:STDOUT: %CallGenericPtr: %CallGenericPtr.type = struct_value () [template] +// CHECK:STDOUT: %require_complete.2: = require_complete_type %ptr.1 [symbolic] // CHECK:STDOUT: %Function.specific_fn.2: = specific_function %Function, @Function(%ptr.1) [symbolic] // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] @@ -379,6 +389,7 @@ fn CallSpecific(x: C) -> C { // CHECK:STDOUT: %T.patt.loc4_13.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_13.2 (constants.%T.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete: = require_complete_type @Function.%T.loc4_13.2 (%T) [symbolic = %require_complete (constants.%require_complete.1)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%T.param_patt: type](%x.param_patt: @Function.%T.loc4_13.2 (%T)) -> @Function.%T.loc4_13.2 (%T) { // CHECK:STDOUT: !entry: @@ -392,6 +403,7 @@ fn CallSpecific(x: C) -> C { // CHECK:STDOUT: %T.patt.loc8_16.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_16.2 (constants.%T.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete: = require_complete_type @CallGeneric.%T.loc8_16.2 (%T) [symbolic = %require_complete (constants.%require_complete.1)] // CHECK:STDOUT: %Function.specific_fn.loc9_10.2: = specific_function constants.%Function, @Function(%T.loc8_16.2) [symbolic = %Function.specific_fn.loc9_10.2 (constants.%Function.specific_fn.1)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%T.param_patt: type, %x.param_patt: @CallGeneric.%T.loc8_16.2 (%T)) -> @CallGeneric.%T.loc8_16.2 (%T) { @@ -412,6 +424,7 @@ fn CallSpecific(x: C) -> C { // CHECK:STDOUT: %ptr.loc12_33.2: type = ptr_type @CallGenericPtr.%T.loc12_19.2 (%T) [symbolic = %ptr.loc12_33.2 (constants.%ptr.1)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete: = require_complete_type @CallGenericPtr.%ptr.loc12_33.2 (%ptr.1) [symbolic = %require_complete (constants.%require_complete.2)] // CHECK:STDOUT: %Function.specific_fn.loc13_10.2: = specific_function constants.%Function, @Function(%ptr.loc12_33.2) [symbolic = %Function.specific_fn.loc13_10.2 (constants.%Function.specific_fn.2)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%T.param_patt: type, %x.param_patt: @CallGenericPtr.%ptr.loc12_33.2 (%ptr.1)) -> @CallGenericPtr.%ptr.loc12_33.2 (%ptr.1) { @@ -441,6 +454,7 @@ fn CallSpecific(x: C) -> C { // CHECK:STDOUT: %T.patt.loc4_13.2 => constants.%T // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete => constants.%require_complete.1 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @CallGeneric(constants.%T) { @@ -464,6 +478,7 @@ fn CallSpecific(x: C) -> C { // CHECK:STDOUT: %T.patt.loc4_13.2 => constants.%ptr.1 // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete => constants.%require_complete.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Function(@CallGenericPtr.%ptr.loc12_33.2) { @@ -476,5 +491,6 @@ fn CallSpecific(x: C) -> C { // CHECK:STDOUT: %T.patt.loc4_13.2 => constants.%C // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete => constants.%complete_type // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/generic/no_prelude/fail_type_param_mismatch.carbon b/toolchain/check/testdata/function/generic/no_prelude/fail_type_param_mismatch.carbon index 0f15fed2c8ea3..129e728e8d720 100644 --- a/toolchain/check/testdata/function/generic/no_prelude/fail_type_param_mismatch.carbon +++ b/toolchain/check/testdata/function/generic/no_prelude/fail_type_param_mismatch.carbon @@ -26,6 +26,8 @@ fn F(T:! type, U:! type) { // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %ptr: type = ptr_type %T [symbolic] +// CHECK:STDOUT: %require_complete.1: = require_complete_type %ptr [symbolic] +// CHECK:STDOUT: %require_complete.2: = require_complete_type %U [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -53,6 +55,8 @@ fn F(T:! type, U:! type) { // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ptr.loc12_11.2: type = ptr_type @F.%T.loc11_6.2 (%T) [symbolic = %ptr.loc12_11.2 (constants.%ptr)] +// CHECK:STDOUT: %require_complete.loc12: = require_complete_type @F.%ptr.loc12_11.2 (%ptr) [symbolic = %require_complete.loc12 (constants.%require_complete.1)] +// CHECK:STDOUT: %require_complete.loc16: = require_complete_type @F.%U.loc11_16.2 (%U) [symbolic = %require_complete.loc16 (constants.%require_complete.2)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%T.param_patt: type, %U.param_patt: type) { // CHECK:STDOUT: !entry: diff --git a/toolchain/check/testdata/function/generic/no_prelude/indirect_generic_type.carbon b/toolchain/check/testdata/function/generic/no_prelude/indirect_generic_type.carbon index 323a5cc6f6940..481c6f2ac1b94 100644 --- a/toolchain/check/testdata/function/generic/no_prelude/indirect_generic_type.carbon +++ b/toolchain/check/testdata/function/generic/no_prelude/indirect_generic_type.carbon @@ -21,6 +21,8 @@ fn F(T:! type, p: T**) -> T* { // CHECK:STDOUT: %ptr.2: type = ptr_type %ptr.1 [symbolic] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] +// CHECK:STDOUT: %require_complete.1: = require_complete_type %ptr.1 [symbolic] +// CHECK:STDOUT: %require_complete.2: = require_complete_type %ptr.2 [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -56,6 +58,8 @@ fn F(T:! type, p: T**) -> T* { // CHECK:STDOUT: %ptr.loc11_21.2: type = ptr_type @F.%ptr.loc11_20.2 (%ptr.1) [symbolic = %ptr.loc11_21.2 (constants.%ptr.2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete.loc11_24: = require_complete_type @F.%ptr.loc11_20.2 (%ptr.1) [symbolic = %require_complete.loc11_24 (constants.%require_complete.1)] +// CHECK:STDOUT: %require_complete.loc11_17: = require_complete_type @F.%ptr.loc11_21.2 (%ptr.2) [symbolic = %require_complete.loc11_17 (constants.%require_complete.2)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%T.param_patt: type, %p.param_patt: @F.%ptr.loc11_21.2 (%ptr.2)) -> @F.%ptr.loc11_20.2 (%ptr.1) { // CHECK:STDOUT: !entry: diff --git a/toolchain/check/testdata/function/generic/no_prelude/type_param.carbon b/toolchain/check/testdata/function/generic/no_prelude/type_param.carbon index 44ed8f97931ba..3e7ec0ecb1a89 100644 --- a/toolchain/check/testdata/function/generic/no_prelude/type_param.carbon +++ b/toolchain/check/testdata/function/generic/no_prelude/type_param.carbon @@ -21,6 +21,8 @@ fn F(T:! type) { // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %ptr: type = ptr_type %T [symbolic] +// CHECK:STDOUT: %require_complete.1: = require_complete_type %ptr [symbolic] +// CHECK:STDOUT: %require_complete.2: = require_complete_type %T [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -42,6 +44,8 @@ fn F(T:! type) { // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ptr.loc12_11.2: type = ptr_type @F.%T.loc11_6.2 (%T) [symbolic = %ptr.loc12_11.2 (constants.%ptr)] +// CHECK:STDOUT: %require_complete.loc12: = require_complete_type @F.%ptr.loc12_11.2 (%ptr) [symbolic = %require_complete.loc12 (constants.%require_complete.1)] +// CHECK:STDOUT: %require_complete.loc13: = require_complete_type @F.%T.loc11_6.2 (%T) [symbolic = %require_complete.loc13 (constants.%require_complete.2)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%T.param_patt: type) { // CHECK:STDOUT: !entry: diff --git a/toolchain/check/testdata/function/generic/no_prelude/type_param_scope.carbon b/toolchain/check/testdata/function/generic/no_prelude/type_param_scope.carbon index 4629d97a0122d..3c7dadd197e3a 100644 --- a/toolchain/check/testdata/function/generic/no_prelude/type_param_scope.carbon +++ b/toolchain/check/testdata/function/generic/no_prelude/type_param_scope.carbon @@ -20,6 +20,7 @@ fn F(T:! type, n: T) -> T { // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] +// CHECK:STDOUT: %require_complete: = require_complete_type %T [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -50,6 +51,7 @@ fn F(T:! type, n: T) -> T { // CHECK:STDOUT: %T.patt.loc11_6.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc11_6.2 (constants.%T.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete: = require_complete_type @F.%T.loc11_6.2 (%T) [symbolic = %require_complete (constants.%require_complete)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%T.param_patt: type, %n.param_patt: @F.%T.loc11_6.2 (%T)) -> @F.%T.loc11_6.2 (%T) { // CHECK:STDOUT: !entry: diff --git a/toolchain/check/testdata/function/generic/redeclare.carbon b/toolchain/check/testdata/function/generic/redeclare.carbon index fc99ab8c419a5..d235370022fb9 100644 --- a/toolchain/check/testdata/function/generic/redeclare.carbon +++ b/toolchain/check/testdata/function/generic/redeclare.carbon @@ -97,6 +97,7 @@ fn F(U:! type, T:! type) -> U* { // CHECK:STDOUT: %ptr: type = ptr_type %T [symbolic] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] +// CHECK:STDOUT: %require_complete: = require_complete_type %ptr [symbolic] // CHECK:STDOUT: %F.specific_fn: = specific_function %F, @F(%T) [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -147,6 +148,7 @@ fn F(U:! type, T:! type) -> U* { // CHECK:STDOUT: %ptr.loc4_20.2: type = ptr_type @F.%T.loc4_6.2 (%T) [symbolic = %ptr.loc4_20.2 (constants.%ptr)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete: = require_complete_type @F.%ptr.loc4_20.2 (%ptr) [symbolic = %require_complete (constants.%require_complete)] // CHECK:STDOUT: %F.specific_fn.loc7_10.2: = specific_function constants.%F, @F(%T.loc4_6.2) [symbolic = %F.specific_fn.loc7_10.2 (constants.%F.specific_fn)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%T.param_patt: type) -> %ptr { @@ -167,6 +169,7 @@ fn F(U:! type, T:! type) -> U* { // CHECK:STDOUT: %ptr.loc4_20.2 => constants.%ptr // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete => constants.%require_complete // CHECK:STDOUT: %F.specific_fn.loc7_10.2 => constants.%F.specific_fn // CHECK:STDOUT: } // CHECK:STDOUT: @@ -189,6 +192,7 @@ fn F(U:! type, T:! type) -> U* { // CHECK:STDOUT: %ptr.2: type = ptr_type %U [symbolic] // CHECK:STDOUT: %.type: type = fn_type @.1 [template] // CHECK:STDOUT: %.1: %.type = struct_value () [template] +// CHECK:STDOUT: %require_complete: = require_complete_type %ptr.2 [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -258,6 +262,7 @@ fn F(U:! type, T:! type) -> U* { // CHECK:STDOUT: %ptr.loc13_30.2: type = ptr_type @.1.%U.loc13_16.2 (%U) [symbolic = %ptr.loc13_30.2 (constants.%ptr.2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete: = require_complete_type @.1.%ptr.loc13_30.2 (%ptr.2) [symbolic = %require_complete (constants.%require_complete)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%T.param_patt: type, %U.param_patt: type) -> @.1.%ptr.loc13_30.2 (%ptr.2) { // CHECK:STDOUT: !entry: @@ -300,6 +305,7 @@ fn F(U:! type, T:! type) -> U* { // CHECK:STDOUT: %ptr.2: type = ptr_type %T.2 [symbolic] // CHECK:STDOUT: %.type: type = fn_type @.1 [template] // CHECK:STDOUT: %.1: %.type = struct_value () [template] +// CHECK:STDOUT: %require_complete: = require_complete_type %ptr.2 [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -369,6 +375,7 @@ fn F(U:! type, T:! type) -> U* { // CHECK:STDOUT: %ptr.loc13_30.2: type = ptr_type @.1.%T.loc13_16.2 (%T.2) [symbolic = %ptr.loc13_30.2 (constants.%ptr.2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete: = require_complete_type @.1.%ptr.loc13_30.2 (%ptr.2) [symbolic = %require_complete (constants.%require_complete)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%U.param_patt: type, %T.param_patt: type) -> @.1.%ptr.loc13_30.2 (%ptr.2) { // CHECK:STDOUT: !entry: @@ -411,6 +418,7 @@ fn F(U:! type, T:! type) -> U* { // CHECK:STDOUT: %ptr.2: type = ptr_type %U.2 [symbolic] // CHECK:STDOUT: %.type: type = fn_type @.1 [template] // CHECK:STDOUT: %.1: %.type = struct_value () [template] +// CHECK:STDOUT: %require_complete: = require_complete_type %ptr.2 [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -480,6 +488,7 @@ fn F(U:! type, T:! type) -> U* { // CHECK:STDOUT: %ptr.loc13_30.2: type = ptr_type @.1.%U.loc13_6.2 (%U.2) [symbolic = %ptr.loc13_30.2 (constants.%ptr.2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete: = require_complete_type @.1.%ptr.loc13_30.2 (%ptr.2) [symbolic = %require_complete (constants.%require_complete)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%U.param_patt: type, %T.param_patt: type) -> @.1.%ptr.loc13_30.2 (%ptr.2) { // CHECK:STDOUT: !entry: diff --git a/toolchain/check/testdata/function/generic/resolve_used.carbon b/toolchain/check/testdata/function/generic/resolve_used.carbon index b2e58751184ed..51b5a86e01e5e 100644 --- a/toolchain/check/testdata/function/generic/resolve_used.carbon +++ b/toolchain/check/testdata/function/generic/resolve_used.carbon @@ -40,6 +40,7 @@ fn CallNegative() { // CHECK:STDOUT: %Int.type: type = fn_type @Int [template] // CHECK:STDOUT: %Int: %Int.type = struct_value () [template] // CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic] +// CHECK:STDOUT: %require_complete: = require_complete_type %iN [symbolic] // CHECK:STDOUT: %CallNegative.type: type = fn_type @CallNegative [template] // CHECK:STDOUT: %CallNegative: %CallNegative.type = struct_value () [template] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template] @@ -85,6 +86,7 @@ fn CallNegative() { // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %iN: type = int_type signed, %N.loc4_19.2 [symbolic = %iN (constants.%iN)] +// CHECK:STDOUT: %require_complete: = require_complete_type @ErrorIfNIsZero.%iN (%iN) [symbolic = %require_complete (constants.%require_complete)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%N.param_patt: Core.IntLiteral) { // CHECK:STDOUT: !entry: @@ -120,5 +122,6 @@ fn CallNegative() { // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %iN => +// CHECK:STDOUT: %require_complete => // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/generic/return_slot.carbon b/toolchain/check/testdata/function/generic/return_slot.carbon index 2f6091be41077..ec26c1c08568c 100644 --- a/toolchain/check/testdata/function/generic/return_slot.carbon +++ b/toolchain/check/testdata/function/generic/return_slot.carbon @@ -33,6 +33,7 @@ fn G() { // CHECK:STDOUT: %Make.1: %Make.type.1 = struct_value () [symbolic] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] // CHECK:STDOUT: %complete_type.1: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %require_complete: = require_complete_type %T [symbolic] // CHECK:STDOUT: %Make.specific_fn.1: = specific_function %Make.1, @Make(%T) [symbolic] // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] @@ -58,6 +59,8 @@ fn G() { // CHECK:STDOUT: %Make.type.4: type = fn_type @Make, @Wrap(%C) [template] // CHECK:STDOUT: %Make.4: %Make.type.4 = struct_value () [template] // CHECK:STDOUT: %Make.specific_fn.4: = specific_function %Make.4, @Make(%C) [template] +// CHECK:STDOUT: %complete_type.3: = complete_type_witness %i32 [template] +// CHECK:STDOUT: %complete_type.4: = complete_type_witness %empty_tuple.type [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -133,6 +136,7 @@ fn G() { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete: = require_complete_type @Make.%T (%T) [symbolic = %require_complete (constants.%require_complete)] // CHECK:STDOUT: %Make.type: type = fn_type @Make, @Wrap(%T) [symbolic = %Make.type (constants.%Make.type.1)] // CHECK:STDOUT: %Make: @Make.%Make.type (%Make.type.1) = struct_value () [symbolic = %Make (constants.%Make.1)] // CHECK:STDOUT: %Make.specific_fn.loc12_27.2: = specific_function %Make, @Make(%T) [symbolic = %Make.specific_fn.loc12_27.2 (constants.%Make.specific_fn.1)] @@ -209,6 +213,7 @@ fn G() { // CHECK:STDOUT: %T => constants.%T // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete => constants.%require_complete // CHECK:STDOUT: %Make.type => constants.%Make.type.1 // CHECK:STDOUT: %Make => constants.%Make.1 // CHECK:STDOUT: %Make.specific_fn.loc12_27.2 => constants.%Make.specific_fn.1 @@ -241,6 +246,7 @@ fn G() { // CHECK:STDOUT: %T => constants.%i32 // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete => constants.%complete_type.3 // CHECK:STDOUT: %Make.type => constants.%Make.type.2 // CHECK:STDOUT: %Make => constants.%Make.2 // CHECK:STDOUT: %Make.specific_fn.loc12_27.2 => constants.%Make.specific_fn.2 @@ -259,6 +265,7 @@ fn G() { // CHECK:STDOUT: %T => constants.%empty_tuple.type // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete => constants.%complete_type.4 // CHECK:STDOUT: %Make.type => constants.%Make.type.3 // CHECK:STDOUT: %Make => constants.%Make.3 // CHECK:STDOUT: %Make.specific_fn.loc12_27.2 => constants.%Make.specific_fn.3 @@ -277,6 +284,7 @@ fn G() { // CHECK:STDOUT: %T => constants.%C // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete => constants.%complete_type.2 // CHECK:STDOUT: %Make.type => constants.%Make.type.4 // CHECK:STDOUT: %Make => constants.%Make.4 // CHECK:STDOUT: %Make.specific_fn.loc12_27.2 => constants.%Make.specific_fn.4 diff --git a/toolchain/check/testdata/function/generic/undefined.carbon b/toolchain/check/testdata/function/generic/undefined.carbon index 5d70a16d3fdbf..304a8bf829dc6 100644 --- a/toolchain/check/testdata/function/generic/undefined.carbon +++ b/toolchain/check/testdata/function/generic/undefined.carbon @@ -57,6 +57,7 @@ fn CallUndefined() -> i32 { // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %Defined.type: type = fn_type @Defined [template] // CHECK:STDOUT: %Defined: %Defined.type = struct_value () [template] +// CHECK:STDOUT: %require_complete.1: = require_complete_type %T [symbolic] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] // CHECK:STDOUT: %Int.type: type = fn_type @Int [template] // CHECK:STDOUT: %Int: %Int.type = struct_value () [template] @@ -72,6 +73,7 @@ fn CallUndefined() -> i32 { // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.7(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] // CHECK:STDOUT: %Defined.specific_fn: = specific_function %Defined, @Defined(%i32) [template] +// CHECK:STDOUT: %complete_type.2: = complete_type_witness %i32 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -125,6 +127,7 @@ fn CallUndefined() -> i32 { // CHECK:STDOUT: %T.patt.loc4_12.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_12.2 (constants.%T.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete: = require_complete_type @Defined.%T.loc4_12.2 (%T) [symbolic = %require_complete (constants.%require_complete.1)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%T.param_patt: type](%x.param_patt: @Defined.%T.loc4_12.2 (%T)) -> @Defined.%T.loc4_12.2 (%T) { // CHECK:STDOUT: !entry: @@ -164,6 +167,7 @@ fn CallUndefined() -> i32 { // CHECK:STDOUT: %T.patt.loc4_12.2 => constants.%i32 // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete => constants.%complete_type.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- call_defined_late.carbon @@ -188,6 +192,8 @@ fn CallUndefined() -> i32 { // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.7(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] // CHECK:STDOUT: %Defined.specific_fn: = specific_function %Defined, @Defined(%i32) [template] +// CHECK:STDOUT: %require_complete.7: = require_complete_type %T [symbolic] +// CHECK:STDOUT: %complete_type.2: = complete_type_witness %i32 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -258,6 +264,7 @@ fn CallUndefined() -> i32 { // CHECK:STDOUT: %T.patt.loc4: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4 (constants.%T.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete: = require_complete_type @Defined.%T.loc4_12.2 (%T) [symbolic = %require_complete (constants.%require_complete.7)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%T.param_patt: type](%x.param_patt: %T) -> %T { // CHECK:STDOUT: !entry: @@ -297,6 +304,7 @@ fn CallUndefined() -> i32 { // CHECK:STDOUT: %T.patt.loc4 => constants.%i32 // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete => constants.%complete_type.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_call_undefined.carbon diff --git a/toolchain/check/testdata/generic/complete_type.carbon b/toolchain/check/testdata/generic/complete_type.carbon new file mode 100644 index 0000000000000..15cc795cfc947 --- /dev/null +++ b/toolchain/check/testdata/generic/complete_type.carbon @@ -0,0 +1,359 @@ +// Part of the Carbon Language project, under the Apache License v2.0 with LLVM +// Exceptions. See /LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// AUTOUPDATE +// TIP: To test this file alone, run: +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/generic/complete_type.carbon +// TIP: To dump output, run: +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/generic/complete_type.carbon + +// --- fail_incomplete_in_class.carbon + +library "[[@TEST_NAME]]"; + +class B; + +class A(T:! type) { + // CHECK:STDERR: fail_incomplete_in_class.carbon:[[@LINE+7]]:10: error: `T` evaluates to incomplete type `B` [IncompleteTypeInMonomorphization] + // CHECK:STDERR: var v: T; + // CHECK:STDERR: ^ + // CHECK:STDERR: fail_incomplete_in_class.carbon:[[@LINE-6]]:1: note: class was forward declared here [ClassForwardDeclaredHere] + // CHECK:STDERR: class B; + // CHECK:STDERR: ^~~~~~~~ + // CHECK:STDERR: + var v: T; +} + +// CHECK:STDERR: fail_incomplete_in_class.carbon:[[@LINE+7]]:6: error: parameter has incomplete type `A(B)` in function definition [IncompleteTypeInFunctionParam] +// CHECK:STDERR: fn F(x: A(B)) {} +// CHECK:STDERR: ^~~~~~~ +// CHECK:STDERR: fail_incomplete_in_class.carbon:[[@LINE-16]]:1: note: class was forward declared here [ClassForwardDeclaredHere] +// CHECK:STDERR: class B; +// CHECK:STDERR: ^~~~~~~~ +// CHECK:STDERR: +fn F(x: A(B)) {} + +class B {} + +// --- incomplete_in_function.carbon + +library "[[@TEST_NAME]]"; + +class B; + +fn F(T:! type) { + var v: T; +} + +// F(B) isn't resolved until the end of the file. +fn G() { F(B); } + +class B {} + +// --- fail_incomplete_in_function_at_eof.carbon + +library "[[@TEST_NAME]]"; + +class B; + +fn F(T:! type) { + // CHECK:STDERR: fail_incomplete_in_function_at_eof.carbon:[[@LINE+6]]:10: error: `T` evaluates to incomplete type `B` [IncompleteTypeInMonomorphization] + // CHECK:STDERR: var v: T; + // CHECK:STDERR: ^ + // CHECK:STDERR: fail_incomplete_in_function_at_eof.carbon:[[@LINE-6]]:1: note: class was forward declared here [ClassForwardDeclaredHere] + // CHECK:STDERR: class B; + // CHECK:STDERR: ^~~~~~~~ + var v: T; +} + +fn G() { F(B); } + +// CHECK:STDOUT: --- fail_incomplete_in_class.carbon +// CHECK:STDOUT: +// CHECK:STDOUT: constants { +// CHECK:STDOUT: %B: type = class_type @B [template] +// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] +// CHECK:STDOUT: %A.type: type = generic_class_type @A [template] +// CHECK:STDOUT: %A.generic: %A.type = struct_value () [template] +// CHECK:STDOUT: %A.1: type = class_type @A, @A(%T) [symbolic] +// CHECK:STDOUT: %require_complete: = require_complete_type %T [symbolic] +// CHECK:STDOUT: %A.elem.1: type = unbound_element_type %A.1, %T [symbolic] +// CHECK:STDOUT: %struct_type.v.1: type = struct_type {.v: %T} [symbolic] +// CHECK:STDOUT: %complete_type.1: = complete_type_witness %struct_type.v.1 [symbolic] +// CHECK:STDOUT: %A.2: type = class_type @A, @A(%B) [template] +// CHECK:STDOUT: %F.type: type = fn_type @F [template] +// CHECK:STDOUT: %F: %F.type = struct_value () [template] +// CHECK:STDOUT: %A.elem.2: type = unbound_element_type %A.2, %B [template] +// CHECK:STDOUT: %struct_type.v.2: type = struct_type {.v: %B} [template] +// CHECK:STDOUT: %complete_type.2: = complete_type_witness %struct_type.v.2 [template] +// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] +// CHECK:STDOUT: %complete_type.3: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: import Core//prelude +// CHECK:STDOUT: import Core//prelude/... +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .B = %B.decl.loc4 +// CHECK:STDOUT: .A = %A.decl +// CHECK:STDOUT: .F = %F.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %B.decl.loc4: type = class_decl @B [template = constants.%B] {} {} +// CHECK:STDOUT: %A.decl: %A.type = class_decl @A [template = constants.%A.generic] { +// CHECK:STDOUT: %T.patt.loc6_9.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc6_9.2 (constants.%T.patt)] +// CHECK:STDOUT: %T.param_patt: type = value_param_pattern %T.patt.loc6_9.1, runtime_param [symbolic = %T.patt.loc6_9.2 (constants.%T.patt)] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %T.param: type = value_param runtime_param +// CHECK:STDOUT: %T.loc6_9.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc6_9.2 (constants.%T)] +// CHECK:STDOUT: } +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { +// CHECK:STDOUT: %x.patt: %A.2 = binding_pattern x +// CHECK:STDOUT: %x.param_patt: %A.2 = value_param_pattern %x.patt, runtime_param0 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %A.ref: %A.type = name_ref A, file.%A.decl [template = constants.%A.generic] +// CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl.loc4 [template = constants.%B] +// CHECK:STDOUT: %A: type = class_type @A, @A(constants.%B) [template = constants.%A.2] +// CHECK:STDOUT: %x.param: %A.2 = value_param runtime_param0 +// CHECK:STDOUT: %x: %A.2 = bind_name x, %x.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %B.decl.loc26: type = class_decl @B [template = constants.%B] {} {} +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: class @B { +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.3] +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = constants.%B +// CHECK:STDOUT: complete_type_witness = %complete_type +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic class @A(%T.loc6_9.1: type) { +// CHECK:STDOUT: %T.loc6_9.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc6_9.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc6_9.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc6_9.2 (constants.%T.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete: = require_complete_type @A.%T.loc6_9.2 (%T) [symbolic = %require_complete (constants.%require_complete)] +// CHECK:STDOUT: %A: type = class_type @A, @A(%T.loc6_9.2) [symbolic = %A (constants.%A.1)] +// CHECK:STDOUT: %A.elem: type = unbound_element_type @A.%A (%A.1), @A.%T.loc6_9.2 (%T) [symbolic = %A.elem (constants.%A.elem.1)] +// CHECK:STDOUT: %struct_type.v: type = struct_type {.v: @A.%T.loc6_9.2 (%T)} [symbolic = %struct_type.v (constants.%struct_type.v.1)] +// CHECK:STDOUT: %complete_type.loc15_1.2: = complete_type_witness @A.%struct_type.v (%struct_type.v.1) [symbolic = %complete_type.loc15_1.2 (constants.%complete_type.1)] +// CHECK:STDOUT: +// CHECK:STDOUT: class { +// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc6_9.1 [symbolic = %T.loc6_9.2 (constants.%T)] +// CHECK:STDOUT: %.loc14: @A.%A.elem (%A.elem.1) = field_decl v, element0 [template] +// CHECK:STDOUT: %complete_type.loc15_1.1: = complete_type_witness %struct_type.v.1 [symbolic = %complete_type.loc15_1.2 (constants.%complete_type.1)] +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = constants.%A.1 +// CHECK:STDOUT: .v = %.loc14 +// CHECK:STDOUT: complete_type_witness = %complete_type.loc15_1.1 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @F(%x.param_patt: %A.2) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @A(constants.%T) { +// CHECK:STDOUT: %T.loc6_9.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc6_9.2 => constants.%T +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @A(%T.loc6_9.2) { +// CHECK:STDOUT: %T.loc6_9.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc6_9.2 => constants.%T +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @A(constants.%B) { +// CHECK:STDOUT: %T.loc6_9.2 => constants.%B +// CHECK:STDOUT: %T.patt.loc6_9.2 => constants.%B +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete => +// CHECK:STDOUT: %A => constants.%A.2 +// CHECK:STDOUT: %A.elem => constants.%A.elem.2 +// CHECK:STDOUT: %struct_type.v => constants.%struct_type.v.2 +// CHECK:STDOUT: %complete_type.loc15_1.2 => constants.%complete_type.2 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: --- incomplete_in_function.carbon +// CHECK:STDOUT: +// CHECK:STDOUT: constants { +// CHECK:STDOUT: %B: type = class_type @B [template] +// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] +// CHECK:STDOUT: %F.type: type = fn_type @F [template] +// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template] +// CHECK:STDOUT: %F: %F.type = struct_value () [template] +// CHECK:STDOUT: %require_complete: = require_complete_type %T [symbolic] +// CHECK:STDOUT: %G.type: type = fn_type @G [template] +// CHECK:STDOUT: %G: %G.type = struct_value () [template] +// CHECK:STDOUT: %F.specific_fn: = specific_function %F, @F(%B) [template] +// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: import Core//prelude +// CHECK:STDOUT: import Core//prelude/... +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .B = %B.decl.loc4 +// CHECK:STDOUT: .F = %F.decl +// CHECK:STDOUT: .G = %G.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %B.decl.loc4: type = class_decl @B [template = constants.%B] {} {} +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { +// CHECK:STDOUT: %T.patt.loc6_6.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc6_6.2 (constants.%T.patt)] +// CHECK:STDOUT: %T.param_patt: type = value_param_pattern %T.patt.loc6_6.1, runtime_param [symbolic = %T.patt.loc6_6.2 (constants.%T.patt)] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %T.param: type = value_param runtime_param +// CHECK:STDOUT: %T.loc6_6.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc6_6.2 (constants.%T)] +// CHECK:STDOUT: } +// CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] {} {} +// CHECK:STDOUT: %B.decl.loc13: type = class_decl @B [template = constants.%B] {} {} +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: class @B { +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = constants.%B +// CHECK:STDOUT: complete_type_witness = %complete_type +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @F(%T.loc6_6.1: type) { +// CHECK:STDOUT: %T.loc6_6.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc6_6.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc6_6.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc6_6.2 (constants.%T.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete: = require_complete_type @F.%T.loc6_6.2 (%T) [symbolic = %require_complete (constants.%require_complete)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn(%T.param_patt: type) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc6_6.1 [symbolic = %T.loc6_6.2 (constants.%T)] +// CHECK:STDOUT: %v.var: ref @F.%T.loc6_6.2 (%T) = var v +// CHECK:STDOUT: %v: ref @F.%T.loc6_6.2 (%T) = bind_name v, %v.var +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @G() { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [template = constants.%F] +// CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl.loc4 [template = constants.%B] +// CHECK:STDOUT: %F.specific_fn: = specific_function %F.ref, @F(constants.%B) [template = constants.%F.specific_fn] +// CHECK:STDOUT: %F.call: init %empty_tuple.type = call %F.specific_fn() +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @F(constants.%T) { +// CHECK:STDOUT: %T.loc6_6.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc6_6.2 => constants.%T +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @F(constants.%B) { +// CHECK:STDOUT: %T.loc6_6.2 => constants.%B +// CHECK:STDOUT: %T.patt.loc6_6.2 => constants.%B +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete => constants.%complete_type +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: --- fail_incomplete_in_function_at_eof.carbon +// CHECK:STDOUT: +// CHECK:STDOUT: constants { +// CHECK:STDOUT: %B: type = class_type @B [template] +// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] +// CHECK:STDOUT: %F.type: type = fn_type @F [template] +// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template] +// CHECK:STDOUT: %F: %F.type = struct_value () [template] +// CHECK:STDOUT: %require_complete: = require_complete_type %T [symbolic] +// CHECK:STDOUT: %G.type: type = fn_type @G [template] +// CHECK:STDOUT: %G: %G.type = struct_value () [template] +// CHECK:STDOUT: %F.specific_fn: = specific_function %F, @F(%B) [template] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: import Core//prelude +// CHECK:STDOUT: import Core//prelude/... +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .B = %B.decl +// CHECK:STDOUT: .F = %F.decl +// CHECK:STDOUT: .G = %G.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %B.decl: type = class_decl @B [template = constants.%B] {} {} +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { +// CHECK:STDOUT: %T.patt.loc6_6.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc6_6.2 (constants.%T.patt)] +// CHECK:STDOUT: %T.param_patt: type = value_param_pattern %T.patt.loc6_6.1, runtime_param [symbolic = %T.patt.loc6_6.2 (constants.%T.patt)] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %T.param: type = value_param runtime_param +// CHECK:STDOUT: %T.loc6_6.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc6_6.2 (constants.%T)] +// CHECK:STDOUT: } +// CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] {} {} +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: class @B; +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @F(%T.loc6_6.1: type) { +// CHECK:STDOUT: %T.loc6_6.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc6_6.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc6_6.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc6_6.2 (constants.%T.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete: = require_complete_type @F.%T.loc6_6.2 (%T) [symbolic = %require_complete (constants.%require_complete)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn(%T.param_patt: type) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc6_6.1 [symbolic = %T.loc6_6.2 (constants.%T)] +// CHECK:STDOUT: %v.var: ref @F.%T.loc6_6.2 (%T) = var v +// CHECK:STDOUT: %v: ref @F.%T.loc6_6.2 (%T) = bind_name v, %v.var +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @G() { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [template = constants.%F] +// CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [template = constants.%B] +// CHECK:STDOUT: %F.specific_fn: = specific_function %F.ref, @F(constants.%B) [template = constants.%F.specific_fn] +// CHECK:STDOUT: %F.call: init %empty_tuple.type = call %F.specific_fn() +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @F(constants.%T) { +// CHECK:STDOUT: %T.loc6_6.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc6_6.2 => constants.%T +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @F(constants.%B) { +// CHECK:STDOUT: %T.loc6_6.2 => constants.%B +// CHECK:STDOUT: %T.patt.loc6_6.2 => constants.%B +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete => +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/if_expr/fail_not_in_function.carbon b/toolchain/check/testdata/if_expr/fail_not_in_function.carbon index 78e02a33a3b4f..f9286638026d1 100644 --- a/toolchain/check/testdata/if_expr/fail_not_in_function.carbon +++ b/toolchain/check/testdata/if_expr/fail_not_in_function.carbon @@ -78,8 +78,8 @@ class C { // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C -// CHECK:STDOUT: .n = .inst369.loc37_8 -// CHECK:STDOUT: complete_type_witness = .inst371.loc38_1 +// CHECK:STDOUT: .n = .inst387.loc37_8 +// CHECK:STDOUT: complete_type_witness = .inst389.loc38_1 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { diff --git a/toolchain/check/testdata/impl/extend_impl_generic.carbon b/toolchain/check/testdata/impl/extend_impl_generic.carbon index adf77c8c2f202..121ab9fe35c0d 100644 --- a/toolchain/check/testdata/impl/extend_impl_generic.carbon +++ b/toolchain/check/testdata/impl/extend_impl_generic.carbon @@ -317,6 +317,7 @@ class X(U:! type) { // CHECK:STDOUT: %X.generic: %X.type = struct_value () [template] // CHECK:STDOUT: %X: type = class_type @X, @X(%U) [symbolic] // CHECK:STDOUT: %I.type.3: type = facet_type <@I, @I(%U)> [symbolic] +// CHECK:STDOUT: %require_complete.1: = require_complete_type %I.type.3 [symbolic] // CHECK:STDOUT: %F.type.2: type = fn_type @F.1, @I(%U) [symbolic] // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [symbolic] // CHECK:STDOUT: %F.assoc_type.2: type = assoc_entity_type %I.type.3, %F.type.2 [symbolic] @@ -327,6 +328,8 @@ class X(U:! type) { // CHECK:STDOUT: %interface: = interface_witness (%F.3) [symbolic] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %require_complete.2: = require_complete_type %X [symbolic] +// CHECK:STDOUT: %require_complete.3: = require_complete_type %U [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -406,6 +409,7 @@ class X(U:! type) { // CHECK:STDOUT: !definition: // CHECK:STDOUT: %F.type: type = fn_type @F.2, @impl(%U) [symbolic = %F.type (constants.%F.type.3)] // CHECK:STDOUT: %F: @impl.%F.type (%F.type.3) = struct_value () [symbolic = %F (constants.%F.3)] +// CHECK:STDOUT: %require_complete: = require_complete_type @impl.%I.type.loc9_21.2 (%I.type.3) [symbolic = %require_complete (constants.%require_complete.1)] // CHECK:STDOUT: %interface.loc9_23.2: = interface_witness (%F) [symbolic = %interface.loc9_23.2 (constants.%interface)] // CHECK:STDOUT: // CHECK:STDOUT: impl: %Self.ref as %I.type.loc9_21.1 { @@ -437,6 +441,7 @@ class X(U:! type) { // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %I.type: type = facet_type <@I, @I(%U.loc8_9.2)> [symbolic = %I.type (constants.%I.type.3)] +// CHECK:STDOUT: %require_complete: = require_complete_type @X.%I.type (%I.type.3) [symbolic = %require_complete (constants.%require_complete.1)] // CHECK:STDOUT: // CHECK:STDOUT: class { // CHECK:STDOUT: impl_decl @impl [template] {} { @@ -467,8 +472,12 @@ class X(U:! type) { // CHECK:STDOUT: generic fn @F.2(@X.%U.loc8_9.1: type) { // CHECK:STDOUT: %U: type = bind_symbolic_name U, 0 [symbolic = %U (constants.%U)] // CHECK:STDOUT: %X: type = class_type @X, @X(%U) [symbolic = %X (constants.%X)] +// CHECK:STDOUT: %I.type: type = facet_type <@I, @I(%U)> [symbolic = %I.type (constants.%I.type.3)] +// CHECK:STDOUT: %require_complete.loc10_25: = require_complete_type @F.2.%I.type (%I.type.3) [symbolic = %require_complete.loc10_25 (constants.%require_complete.1)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete.loc10_14: = require_complete_type @F.2.%X (%X) [symbolic = %require_complete.loc10_14 (constants.%require_complete.2)] +// CHECK:STDOUT: %require_complete.loc10_23: = require_complete_type @F.2.%U (%U) [symbolic = %require_complete.loc10_23 (constants.%require_complete.3)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @F.2.%X (%X)](%t.param_patt: @F.2.%U (%U)) { // CHECK:STDOUT: !entry: @@ -504,6 +513,7 @@ class X(U:! type) { // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %I.type => constants.%I.type.3 +// CHECK:STDOUT: %require_complete => constants.%require_complete.1 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @I(constants.%U) { @@ -537,6 +547,7 @@ class X(U:! type) { // CHECK:STDOUT: !definition: // CHECK:STDOUT: %F.type => constants.%F.type.3 // CHECK:STDOUT: %F => constants.%F.3 +// CHECK:STDOUT: %require_complete => constants.%require_complete.1 // CHECK:STDOUT: %interface.loc9_23.2 => constants.%interface // CHECK:STDOUT: } // CHECK:STDOUT: @@ -545,9 +556,16 @@ class X(U:! type) { // CHECK:STDOUT: %U.patt.loc8_9.2 => constants.%U // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @I(@F.2.%U) { +// CHECK:STDOUT: %T.loc4_13.2 => constants.%U +// CHECK:STDOUT: %T.patt.loc4_13.2 => constants.%U +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: specific @F.2(constants.%U) { // CHECK:STDOUT: %U => constants.%U // CHECK:STDOUT: %X => constants.%X +// CHECK:STDOUT: %I.type => constants.%I.type.3 +// CHECK:STDOUT: %require_complete.loc10_25 => constants.%require_complete.1 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F.1(constants.%U, constants.%I.facet) { diff --git a/toolchain/check/testdata/impl/fail_extend_impl_forall.carbon b/toolchain/check/testdata/impl/fail_extend_impl_forall.carbon index ef38d9997ca73..6b8b2a052db49 100644 --- a/toolchain/check/testdata/impl/fail_extend_impl_forall.carbon +++ b/toolchain/check/testdata/impl/fail_extend_impl_forall.carbon @@ -37,10 +37,12 @@ class C { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %F.type.2: type = fn_type @F.2, @impl(%T) [symbolic] // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [symbolic] +// CHECK:STDOUT: %require_complete.1: = require_complete_type %GenericInterface.type.2 [symbolic] // CHECK:STDOUT: %GenericInterface.facet: %GenericInterface.type.2 = facet_value %C, %C [symbolic] // CHECK:STDOUT: %interface: = interface_witness (%F.2) [symbolic] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %require_complete.2: = require_complete_type %T [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -106,6 +108,7 @@ class C { // CHECK:STDOUT: !definition: // CHECK:STDOUT: %F.type: type = fn_type @F.2, @impl(%T.loc19_23.2) [symbolic = %F.type (constants.%F.type.2)] // CHECK:STDOUT: %F: @impl.%F.type (%F.type.2) = struct_value () [symbolic = %F (constants.%F.2)] +// CHECK:STDOUT: %require_complete: = require_complete_type @impl.%GenericInterface.type.loc19_54.2 (%GenericInterface.type.2) [symbolic = %require_complete (constants.%require_complete.1)] // CHECK:STDOUT: %interface.loc19_56.2: = interface_witness (%F) [symbolic = %interface.loc19_56.2 (constants.%interface)] // CHECK:STDOUT: // CHECK:STDOUT: impl: %Self.ref as %GenericInterface.type.loc19_54.1 { @@ -156,6 +159,7 @@ class C { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete: = require_complete_type @F.2.%T (%T) [symbolic = %require_complete (constants.%require_complete.2)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%x.param_patt: @F.2.%T (%T)) { // CHECK:STDOUT: !entry: @@ -198,6 +202,7 @@ class C { // CHECK:STDOUT: !definition: // CHECK:STDOUT: %F.type => constants.%F.type.2 // CHECK:STDOUT: %F => constants.%F.2 +// CHECK:STDOUT: %require_complete => constants.%require_complete.1 // CHECK:STDOUT: %interface.loc19_56.2 => constants.%interface // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/lookup/generic.carbon b/toolchain/check/testdata/impl/lookup/generic.carbon index e16e3cfa1d9d9..4707564039712 100644 --- a/toolchain/check/testdata/impl/lookup/generic.carbon +++ b/toolchain/check/testdata/impl/lookup/generic.carbon @@ -287,6 +287,7 @@ fn G(x: A) { // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [symbolic] // CHECK:STDOUT: %HasF.facet: %HasF.type = facet_value %T, %T [symbolic] // CHECK:STDOUT: %interface.1: = interface_witness (%F.2) [symbolic] +// CHECK:STDOUT: %require_complete: = require_complete_type %T [symbolic] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] @@ -294,6 +295,7 @@ fn G(x: A) { // CHECK:STDOUT: %F.3: %F.type.3 = struct_value () [template] // CHECK:STDOUT: %interface.2: = interface_witness (%F.3) [template] // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [template] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -406,6 +408,7 @@ fn G(x: A) { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete: = require_complete_type @F.2.%T (%T) [symbolic = %require_complete (constants.%require_complete)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @F.2.%T (%T)]() -> @F.2.%T (%T) { // CHECK:STDOUT: !entry: @@ -473,6 +476,7 @@ fn G(x: A) { // CHECK:STDOUT: %T => constants.%empty_struct_type // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete => constants.%complete_type // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- deduced_type_argument.carbon @@ -695,6 +699,7 @@ fn G(x: A) { // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] // CHECK:STDOUT: %F.type.2: type = fn_type @F.2, @impl(%T) [symbolic] // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [symbolic] +// CHECK:STDOUT: %require_complete: = require_complete_type %HasF.type.2 [symbolic] // CHECK:STDOUT: %HasF.facet: %HasF.type.2 = facet_value %empty_struct_type, %empty_struct_type [symbolic] // CHECK:STDOUT: %interface.1: = interface_witness (%F.2) [symbolic] // CHECK:STDOUT: %G.type: type = fn_type @G [template] @@ -706,6 +711,7 @@ fn G(x: A) { // CHECK:STDOUT: %assoc0.2: %F.assoc_type.2 = assoc_entity element0, @HasF.%F.decl [template] // CHECK:STDOUT: %F.type.4: type = fn_type @F.2, @impl(%empty_struct_type) [template] // CHECK:STDOUT: %F.4: %F.type.4 = struct_value () [template] +// CHECK:STDOUT: %complete_type: = complete_type_witness %HasF.type.3 [template] // CHECK:STDOUT: %interface.2: = interface_witness (%F.4) [template] // CHECK:STDOUT: %F.specific_fn: = specific_function %F.4, @F.2(%empty_struct_type) [template] // CHECK:STDOUT: } @@ -786,6 +792,7 @@ fn G(x: A) { // CHECK:STDOUT: !definition: // CHECK:STDOUT: %F.type: type = fn_type @F.2, @impl(%T.loc8_14.2) [symbolic = %F.type (constants.%F.type.2)] // CHECK:STDOUT: %F: @impl.%F.type (%F.type.2) = struct_value () [symbolic = %F (constants.%F.2)] +// CHECK:STDOUT: %require_complete: = require_complete_type @impl.%HasF.type.loc8_36.2 (%HasF.type.2) [symbolic = %require_complete (constants.%require_complete)] // CHECK:STDOUT: %interface.loc8_38.2: = interface_witness (%F) [symbolic = %interface.loc8_38.2 (constants.%interface.1)] // CHECK:STDOUT: // CHECK:STDOUT: impl: %.loc8_25.2 as %HasF.type.loc8_36.1 { @@ -860,6 +867,7 @@ fn G(x: A) { // CHECK:STDOUT: !definition: // CHECK:STDOUT: %F.type => constants.%F.type.2 // CHECK:STDOUT: %F => constants.%F.2 +// CHECK:STDOUT: %require_complete => constants.%require_complete // CHECK:STDOUT: %interface.loc8_38.2 => constants.%interface.1 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -894,6 +902,7 @@ fn G(x: A) { // CHECK:STDOUT: !definition: // CHECK:STDOUT: %F.type => constants.%F.type.4 // CHECK:STDOUT: %F => constants.%F.4 +// CHECK:STDOUT: %require_complete => constants.%complete_type // CHECK:STDOUT: %interface.loc8_38.2 => constants.%interface.2 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1056,6 +1065,7 @@ fn G(x: A) { // CHECK:STDOUT: %assoc0.1: %F.assoc_type.1 = assoc_entity element0, @HasF.%F.decl [symbolic] // CHECK:STDOUT: %F.type.2: type = fn_type @F.2, @impl(%T) [symbolic] // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [symbolic] +// CHECK:STDOUT: %require_complete: = require_complete_type %HasF.type.2 [symbolic] // CHECK:STDOUT: %HasF.facet: %HasF.type.2 = facet_value %T, %T [symbolic] // CHECK:STDOUT: %interface: = interface_witness (%F.2) [symbolic] // CHECK:STDOUT: %A: type = class_type @A [template] @@ -1149,6 +1159,7 @@ fn G(x: A) { // CHECK:STDOUT: !definition: // CHECK:STDOUT: %F.type: type = fn_type @F.2, @impl(%T.loc8_14.2) [symbolic = %F.type (constants.%F.type.2)] // CHECK:STDOUT: %F: @impl.%F.type (%F.type.2) = struct_value () [symbolic = %F (constants.%F.2)] +// CHECK:STDOUT: %require_complete: = require_complete_type @impl.%HasF.type.loc8_35.2 (%HasF.type.2) [symbolic = %require_complete (constants.%require_complete)] // CHECK:STDOUT: %interface.loc8_37.2: = interface_witness (%F) [symbolic = %interface.loc8_37.2 (constants.%interface)] // CHECK:STDOUT: // CHECK:STDOUT: impl: %T.ref.loc8_24 as %HasF.type.loc8_35.1 { @@ -1235,6 +1246,7 @@ fn G(x: A) { // CHECK:STDOUT: !definition: // CHECK:STDOUT: %F.type => constants.%F.type.2 // CHECK:STDOUT: %F => constants.%F.2 +// CHECK:STDOUT: %require_complete => constants.%require_complete // CHECK:STDOUT: %interface.loc8_37.2 => constants.%interface // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/lookup/no_prelude/impl_forall.carbon b/toolchain/check/testdata/impl/lookup/no_prelude/impl_forall.carbon index d2c5aaca94fe5..72351de2c7dc9 100644 --- a/toolchain/check/testdata/impl/lookup/no_prelude/impl_forall.carbon +++ b/toolchain/check/testdata/impl/lookup/no_prelude/impl_forall.carbon @@ -40,6 +40,7 @@ fn TestSpecific(a: A({})) -> {} { // CHECK:STDOUT: %A.type: type = generic_class_type @A [template] // CHECK:STDOUT: %A.generic: %A.type = struct_value () [template] // CHECK:STDOUT: %A.1: type = class_type @A, @A(%T) [symbolic] +// CHECK:STDOUT: %require_complete.1: = require_complete_type %T [symbolic] // CHECK:STDOUT: %A.elem.1: type = unbound_element_type %A.1, %T [symbolic] // CHECK:STDOUT: %struct_type.n.1: type = struct_type {.n: %T} [symbolic] // CHECK:STDOUT: %complete_type.1: = complete_type_witness %struct_type.n.1 [symbolic] @@ -60,24 +61,30 @@ fn TestSpecific(a: A({})) -> {} { // CHECK:STDOUT: %I.type.3: type = facet_type <@I, @I(%V)> [symbolic] // CHECK:STDOUT: %F.type.2: type = fn_type @F.2, @impl(%V) [symbolic] // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [symbolic] +// CHECK:STDOUT: %require_complete.2: = require_complete_type %I.type.3 [symbolic] // CHECK:STDOUT: %F.type.3: type = fn_type @F.1, @I(%V) [symbolic] // CHECK:STDOUT: %F.3: %F.type.3 = struct_value () [symbolic] // CHECK:STDOUT: %F.assoc_type.2: type = assoc_entity_type %I.type.3, %F.type.3 [symbolic] // CHECK:STDOUT: %assoc0.2: %F.assoc_type.2 = assoc_entity element0, @I.%F.decl [symbolic] // CHECK:STDOUT: %I.facet: %I.type.2 = facet_value %A.2, %A.2 [symbolic] // CHECK:STDOUT: %interface.1: = interface_witness (%F.2) [symbolic] +// CHECK:STDOUT: %require_complete.3: = require_complete_type %V [symbolic] // CHECK:STDOUT: %A.elem.2: type = unbound_element_type %A.2, %V [symbolic] // CHECK:STDOUT: %struct_type.n.2: type = struct_type {.n: %V} [symbolic] // CHECK:STDOUT: %complete_type.2: = complete_type_witness %struct_type.n.2 [symbolic] +// CHECK:STDOUT: %require_complete.4: = require_complete_type %A.2 [symbolic] // CHECK:STDOUT: %W: type = bind_symbolic_name W, 0 [symbolic] // CHECK:STDOUT: %W.patt: type = symbolic_binding_pattern W, 0 [symbolic] // CHECK:STDOUT: %A.3: type = class_type @A, @A(%W) [symbolic] // CHECK:STDOUT: %TestGeneric.type: type = fn_type @TestGeneric [template] // CHECK:STDOUT: %TestGeneric: %TestGeneric.type = struct_value () [template] +// CHECK:STDOUT: %require_complete.5: = require_complete_type %W [symbolic] // CHECK:STDOUT: %A.elem.3: type = unbound_element_type %A.3, %W [symbolic] // CHECK:STDOUT: %struct_type.n.3: type = struct_type {.n: %W} [symbolic] // CHECK:STDOUT: %complete_type.3: = complete_type_witness %struct_type.n.3 [symbolic] +// CHECK:STDOUT: %require_complete.6: = require_complete_type %A.3 [symbolic] // CHECK:STDOUT: %I.type.4: type = facet_type <@I, @I(%W)> [symbolic] +// CHECK:STDOUT: %require_complete.7: = require_complete_type %I.type.4 [symbolic] // CHECK:STDOUT: %F.type.4: type = fn_type @F.1, @I(%W) [symbolic] // CHECK:STDOUT: %F.4: %F.type.4 = struct_value () [symbolic] // CHECK:STDOUT: %F.assoc_type.3: type = assoc_entity_type %I.type.4, %F.type.4 [symbolic] @@ -89,9 +96,10 @@ fn TestSpecific(a: A({})) -> {} { // CHECK:STDOUT: %A.4: type = class_type @A, @A(%empty_struct_type) [template] // CHECK:STDOUT: %TestSpecific.type: type = fn_type @TestSpecific [template] // CHECK:STDOUT: %TestSpecific: %TestSpecific.type = struct_value () [template] +// CHECK:STDOUT: %complete_type.4: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %A.elem.4: type = unbound_element_type %A.4, %empty_struct_type [template] // CHECK:STDOUT: %struct_type.n.4: type = struct_type {.n: %empty_struct_type} [template] -// CHECK:STDOUT: %complete_type.4: = complete_type_witness %struct_type.n.4 [template] +// CHECK:STDOUT: %complete_type.5: = complete_type_witness %struct_type.n.4 [template] // CHECK:STDOUT: %I.type.5: type = facet_type <@I, @I(%empty_struct_type)> [template] // CHECK:STDOUT: %F.type.6: type = fn_type @F.1, @I(%empty_struct_type) [template] // CHECK:STDOUT: %F.6: %F.type.6 = struct_value () [template] @@ -99,6 +107,7 @@ fn TestSpecific(a: A({})) -> {} { // CHECK:STDOUT: %assoc0.4: %F.assoc_type.4 = assoc_entity element0, @I.%F.decl [template] // CHECK:STDOUT: %F.type.7: type = fn_type @F.2, @impl(%empty_struct_type) [template] // CHECK:STDOUT: %F.7: %F.type.7 = struct_value () [template] +// CHECK:STDOUT: %complete_type.6: = complete_type_witness %I.type.5 [template] // CHECK:STDOUT: %interface.3: = interface_witness (%F.7) [template] // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [template] // CHECK:STDOUT: } @@ -223,6 +232,7 @@ fn TestSpecific(a: A({})) -> {} { // CHECK:STDOUT: !definition: // CHECK:STDOUT: %F.type: type = fn_type @F.2, @impl(%V.loc10_14.2) [symbolic = %F.type (constants.%F.type.2)] // CHECK:STDOUT: %F: @impl.%F.type (%F.type.2) = struct_value () [symbolic = %F (constants.%F.2)] +// CHECK:STDOUT: %require_complete: = require_complete_type @impl.%I.type.loc10_35.2 (%I.type.3) [symbolic = %require_complete (constants.%require_complete.2)] // CHECK:STDOUT: %interface.loc10_37.2: = interface_witness (%F) [symbolic = %interface.loc10_37.2 (constants.%interface.1)] // CHECK:STDOUT: // CHECK:STDOUT: impl: %A.loc10_27.1 as %I.type.loc10_35.1 { @@ -252,6 +262,7 @@ fn TestSpecific(a: A({})) -> {} { // CHECK:STDOUT: %T.patt.loc2_9.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc2_9.2 (constants.%T.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete: = require_complete_type @A.%T.loc2_9.2 (%T) [symbolic = %require_complete (constants.%require_complete.1)] // CHECK:STDOUT: %A: type = class_type @A, @A(%T.loc2_9.2) [symbolic = %A (constants.%A.1)] // CHECK:STDOUT: %A.elem: type = unbound_element_type @A.%A (%A.1), @A.%T.loc2_9.2 (%T) [symbolic = %A.elem (constants.%A.elem.1)] // CHECK:STDOUT: %struct_type.n: type = struct_type {.n: @A.%T.loc2_9.2 (%T)} [symbolic = %struct_type.n (constants.%struct_type.n.1)] @@ -283,6 +294,8 @@ fn TestSpecific(a: A({})) -> {} { // CHECK:STDOUT: %A: type = class_type @A, @A(%V) [symbolic = %A (constants.%A.2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete.loc11_22: = require_complete_type @F.2.%V (%V) [symbolic = %require_complete.loc11_22 (constants.%require_complete.3)] +// CHECK:STDOUT: %require_complete.loc11_12: = require_complete_type @F.2.%A (%A.2) [symbolic = %require_complete.loc11_12 (constants.%require_complete.4)] // CHECK:STDOUT: %A.elem: type = unbound_element_type @F.2.%A (%A.2), @F.2.%V (%V) [symbolic = %A.elem (constants.%A.elem.2)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @F.2.%A (%A.2)]() -> @F.2.%V (%V) { @@ -301,7 +314,10 @@ fn TestSpecific(a: A({})) -> {} { // CHECK:STDOUT: %A.loc16_32.2: type = class_type @A, @A(%W.loc16_16.2) [symbolic = %A.loc16_32.2 (constants.%A.3)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete.loc16_35: = require_complete_type @TestGeneric.%W.loc16_16.2 (%W) [symbolic = %require_complete.loc16_35 (constants.%require_complete.5)] +// CHECK:STDOUT: %require_complete.loc16_27: = require_complete_type @TestGeneric.%A.loc16_32.2 (%A.3) [symbolic = %require_complete.loc16_27 (constants.%require_complete.6)] // CHECK:STDOUT: %I.type.loc17_16.2: type = facet_type <@I, @I(%W.loc16_16.2)> [symbolic = %I.type.loc17_16.2 (constants.%I.type.4)] +// CHECK:STDOUT: %require_complete.loc17: = require_complete_type @TestGeneric.%I.type.loc17_16.2 (%I.type.4) [symbolic = %require_complete.loc17 (constants.%require_complete.7)] // CHECK:STDOUT: %F.type.loc17_17: type = fn_type @F.1, @I(%W.loc16_16.2) [symbolic = %F.type.loc17_17 (constants.%F.type.4)] // CHECK:STDOUT: %F.assoc_type: type = assoc_entity_type @TestGeneric.%I.type.loc17_16.2 (%I.type.4), @TestGeneric.%F.type.loc17_17 (%F.type.4) [symbolic = %F.assoc_type (constants.%F.assoc_type.3)] // CHECK:STDOUT: %assoc0: @TestGeneric.%F.assoc_type (%F.assoc_type.3) = assoc_entity element0, @I.%F.decl [symbolic = %assoc0 (constants.%assoc0.3)] @@ -383,6 +399,7 @@ fn TestSpecific(a: A({})) -> {} { // CHECK:STDOUT: %T.patt.loc2_9.2 => constants.%V // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete => constants.%require_complete.3 // CHECK:STDOUT: %A => constants.%A.2 // CHECK:STDOUT: %A.elem => constants.%A.elem.2 // CHECK:STDOUT: %struct_type.n => constants.%struct_type.n.2 @@ -421,6 +438,7 @@ fn TestSpecific(a: A({})) -> {} { // CHECK:STDOUT: !definition: // CHECK:STDOUT: %F.type => constants.%F.type.2 // CHECK:STDOUT: %F => constants.%F.2 +// CHECK:STDOUT: %require_complete => constants.%require_complete.2 // CHECK:STDOUT: %interface.loc10_37.2 => constants.%interface.1 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -453,6 +471,7 @@ fn TestSpecific(a: A({})) -> {} { // CHECK:STDOUT: %T.patt.loc2_9.2 => constants.%W // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete => constants.%require_complete.5 // CHECK:STDOUT: %A => constants.%A.3 // CHECK:STDOUT: %A.elem => constants.%A.elem.3 // CHECK:STDOUT: %struct_type.n => constants.%struct_type.n.3 @@ -492,6 +511,7 @@ fn TestSpecific(a: A({})) -> {} { // CHECK:STDOUT: !definition: // CHECK:STDOUT: %F.type => constants.%F.type.5 // CHECK:STDOUT: %F => constants.%F.5 +// CHECK:STDOUT: %require_complete => constants.%require_complete.7 // CHECK:STDOUT: %interface.loc10_37.2 => constants.%interface.2 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -500,6 +520,8 @@ fn TestSpecific(a: A({})) -> {} { // CHECK:STDOUT: %A => constants.%A.3 // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete.loc11_22 => constants.%require_complete.5 +// CHECK:STDOUT: %require_complete.loc11_12 => constants.%require_complete.6 // CHECK:STDOUT: %A.elem => constants.%A.elem.3 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -520,10 +542,11 @@ fn TestSpecific(a: A({})) -> {} { // CHECK:STDOUT: %T.patt.loc2_9.2 => constants.%empty_struct_type // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete => constants.%complete_type.4 // CHECK:STDOUT: %A => constants.%A.4 // CHECK:STDOUT: %A.elem => constants.%A.elem.4 // CHECK:STDOUT: %struct_type.n => constants.%struct_type.n.4 -// CHECK:STDOUT: %complete_type.loc4_1.2 => constants.%complete_type.4 +// CHECK:STDOUT: %complete_type.loc4_1.2 => constants.%complete_type.5 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @I(constants.%empty_struct_type) { @@ -548,6 +571,7 @@ fn TestSpecific(a: A({})) -> {} { // CHECK:STDOUT: !definition: // CHECK:STDOUT: %F.type => constants.%F.type.7 // CHECK:STDOUT: %F => constants.%F.7 +// CHECK:STDOUT: %require_complete => constants.%complete_type.6 // CHECK:STDOUT: %interface.loc10_37.2 => constants.%interface.3 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -556,6 +580,8 @@ fn TestSpecific(a: A({})) -> {} { // CHECK:STDOUT: %A => constants.%A.4 // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete.loc11_22 => constants.%complete_type.4 +// CHECK:STDOUT: %require_complete.loc11_12 => constants.%complete_type.5 // CHECK:STDOUT: %A.elem => constants.%A.elem.4 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/no_prelude/import_generic.carbon b/toolchain/check/testdata/impl/no_prelude/import_generic.carbon index 6cf5d23d16925..4e8566a2dd1e8 100644 --- a/toolchain/check/testdata/impl/no_prelude/import_generic.carbon +++ b/toolchain/check/testdata/impl/no_prelude/import_generic.carbon @@ -51,6 +51,7 @@ impl forall [T:! type] C as I(T*) {} // CHECK:STDOUT: %Self: %I.type.2 = bind_symbolic_name Self, 1 [symbolic] // CHECK:STDOUT: %ptr: type = ptr_type %T [symbolic] // CHECK:STDOUT: %I.type.3: type = facet_type <@I, @I(%ptr)> [symbolic] +// CHECK:STDOUT: %require_complete: = require_complete_type %I.type.3 [symbolic] // CHECK:STDOUT: %interface: = interface_witness () [template] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -124,6 +125,7 @@ impl forall [T:! type] C as I(T*) {} // CHECK:STDOUT: %I.type.loc8_33.2: type = facet_type <@I, @I(%ptr.loc8_32.2)> [symbolic = %I.type.loc8_33.2 (constants.%I.type.3)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete: = require_complete_type @impl.2.%I.type.loc8_33.2 (%I.type.3) [symbolic = %require_complete (constants.%require_complete)] // CHECK:STDOUT: // CHECK:STDOUT: impl: %C.ref as %I.type.loc8_33.1 { // CHECK:STDOUT: %interface: = interface_witness () [template = constants.%interface] @@ -197,6 +199,8 @@ impl forall [T:! type] C as I(T*) {} // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %ptr: type = ptr_type %T [symbolic] // CHECK:STDOUT: %I.type.3: type = facet_type <@I, @I(%ptr)> [symbolic] +// CHECK:STDOUT: %require_complete.1: = require_complete_type %I.type.3 [symbolic] +// CHECK:STDOUT: %require_complete.2: = require_complete_type %I.type.2 [symbolic] // CHECK:STDOUT: %interface: = interface_witness () [template] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -251,6 +255,7 @@ impl forall [T:! type] C as I(T*) {} // CHECK:STDOUT: %I.type.1: type = facet_type <@I, @I(%T.1)> [symbolic = %I.type.1 (constants.%I.type.2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete: = require_complete_type @impl.1.%I.type.1 (%I.type.2) [symbolic = %require_complete (constants.%require_complete.2)] // CHECK:STDOUT: // CHECK:STDOUT: impl: imports.%import_ref.6 as imports.%import_ref.7 { // CHECK:STDOUT: %interface: = interface_witness () [template = constants.%interface] @@ -267,6 +272,7 @@ impl forall [T:! type] C as I(T*) {} // CHECK:STDOUT: %I.type: type = facet_type <@I, @I(%ptr)> [symbolic = %I.type (constants.%I.type.3)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete: = require_complete_type @impl.2.%I.type (%I.type.3) [symbolic = %require_complete (constants.%require_complete.1)] // CHECK:STDOUT: // CHECK:STDOUT: impl: imports.%import_ref.8 as imports.%import_ref.9 { // CHECK:STDOUT: !members: diff --git a/toolchain/check/testdata/interface/fail_todo_define_default_fn_out_of_line.carbon b/toolchain/check/testdata/interface/fail_todo_define_default_fn_out_of_line.carbon index 64115b4513eac..ce4ac90f3eabc 100644 --- a/toolchain/check/testdata/interface/fail_todo_define_default_fn_out_of_line.carbon +++ b/toolchain/check/testdata/interface/fail_todo_define_default_fn_out_of_line.carbon @@ -217,6 +217,8 @@ fn Interface.C.F[self: Self](U:! type, u: U) -> U { return u; } // CHECK:STDOUT: %F: %F.type = struct_value () [symbolic] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %require_complete.1: = require_complete_type %U [symbolic] +// CHECK:STDOUT: %require_complete.2: = require_complete_type %C.2 [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -314,6 +316,8 @@ fn Interface.C.F[self: Self](U:! type, u: U) -> U { return u; } // CHECK:STDOUT: %U.patt.loc14: type = symbolic_binding_pattern U, 1 [symbolic = %U.patt.loc14 (constants.%U.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete.loc20_46: = require_complete_type @F.%U.loc14_22.1 (%U) [symbolic = %require_complete.loc20_46 (constants.%require_complete.1)] +// CHECK:STDOUT: %require_complete.loc20_22: = require_complete_type @F.%C (%C.2) [symbolic = %require_complete.loc20_22 (constants.%require_complete.2)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: %C.2](%U.param_patt: type, %u.param_patt: %U) -> %U { // CHECK:STDOUT: !entry: diff --git a/toolchain/check/testdata/interface/member_lookup.carbon b/toolchain/check/testdata/interface/member_lookup.carbon index 07e49e82ed634..582c0db0f692a 100644 --- a/toolchain/check/testdata/interface/member_lookup.carbon +++ b/toolchain/check/testdata/interface/member_lookup.carbon @@ -56,12 +56,14 @@ fn AccessMissingConcrete(I:! Interface(i32)) -> i32 { // CHECK:STDOUT: %Interface.generic: %Interface.type.1 = struct_value () [template] // CHECK:STDOUT: %Interface.type.2: type = facet_type <@Interface, @Interface(%T)> [symbolic] // CHECK:STDOUT: %Self: %Interface.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %require_complete.1: = require_complete_type %T [symbolic] // CHECK:STDOUT: %assoc_type.1: type = assoc_entity_type %Interface.type.2, %T [symbolic] // CHECK:STDOUT: %assoc0.1: %assoc_type.1 = assoc_entity element0, @Interface.%X [symbolic] // CHECK:STDOUT: %I.1: %Interface.type.2 = bind_symbolic_name I, 1 [symbolic] // CHECK:STDOUT: %I.patt.1: %Interface.type.2 = symbolic_binding_pattern I, 1 [symbolic] // CHECK:STDOUT: %AccessGeneric.type: type = fn_type @AccessGeneric [template] // CHECK:STDOUT: %AccessGeneric: %AccessGeneric.type = struct_value () [template] +// CHECK:STDOUT: %require_complete.2: = require_complete_type %Interface.type.2 [symbolic] // CHECK:STDOUT: %I.as_wit.1: = facet_access_witness %I.1 [symbolic] // CHECK:STDOUT: %impl.elem0.1: %T = interface_witness_access %I.as_wit.1, element0 [symbolic] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] @@ -73,6 +75,7 @@ fn AccessMissingConcrete(I:! Interface(i32)) -> i32 { // CHECK:STDOUT: %I.patt.2: %Interface.type.3 = symbolic_binding_pattern I, 0 [symbolic] // CHECK:STDOUT: %AccessConcrete.type: type = fn_type @AccessConcrete [template] // CHECK:STDOUT: %AccessConcrete: %AccessConcrete.type = struct_value () [template] +// CHECK:STDOUT: %complete_type: = complete_type_witness %i32 [template] // CHECK:STDOUT: %assoc_type.2: type = assoc_entity_type %Interface.type.3, %i32 [template] // CHECK:STDOUT: %assoc0.2: %assoc_type.2 = assoc_entity element0, @Interface.%X [template] // CHECK:STDOUT: %I.as_wit.2: = facet_access_witness %I.2 [symbolic] @@ -151,6 +154,7 @@ fn AccessMissingConcrete(I:! Interface(i32)) -> i32 { // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Interface.type: type = facet_type <@Interface, @Interface(%T.loc4_21.2)> [symbolic = %Interface.type (constants.%Interface.type.2)] // CHECK:STDOUT: %Self.2: %Interface.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self)] +// CHECK:STDOUT: %require_complete: = require_complete_type @Interface.%T.loc4_21.2 (%T) [symbolic = %require_complete (constants.%require_complete.1)] // CHECK:STDOUT: %assoc_type: type = assoc_entity_type @Interface.%Interface.type (%Interface.type.2), @Interface.%T.loc4_21.2 (%T) [symbolic = %assoc_type (constants.%assoc_type.1)] // CHECK:STDOUT: %assoc0.loc5_12.2: @Interface.%assoc_type (%assoc_type.1) = assoc_entity element0, %X [symbolic = %assoc0.loc5_12.2 (constants.%assoc0.1)] // CHECK:STDOUT: @@ -175,10 +179,12 @@ fn AccessMissingConcrete(I:! Interface(i32)) -> i32 { // CHECK:STDOUT: %I.patt.loc8_28.2: %Interface.type.2 = symbolic_binding_pattern I, 1 [symbolic = %I.patt.loc8_28.2 (constants.%I.patt.1)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete.loc9_10: = require_complete_type @AccessGeneric.%Interface.type.loc8_43.2 (%Interface.type.2) [symbolic = %require_complete.loc9_10 (constants.%require_complete.2)] // CHECK:STDOUT: %assoc_type: type = assoc_entity_type @AccessGeneric.%Interface.type.loc8_43.2 (%Interface.type.2), @AccessGeneric.%T.loc8_18.2 (%T) [symbolic = %assoc_type (constants.%assoc_type.1)] // CHECK:STDOUT: %assoc0: @AccessGeneric.%assoc_type (%assoc_type.1) = assoc_entity element0, @Interface.%X [symbolic = %assoc0 (constants.%assoc0.1)] // CHECK:STDOUT: %I.as_wit.loc9_11.2: = facet_access_witness %I.loc8_28.2 [symbolic = %I.as_wit.loc9_11.2 (constants.%I.as_wit.1)] // CHECK:STDOUT: %impl.elem0.loc9_11.2: @AccessGeneric.%T.loc8_18.2 (%T) = interface_witness_access %I.as_wit.loc9_11.2, element0 [symbolic = %impl.elem0.loc9_11.2 (constants.%impl.elem0.1)] +// CHECK:STDOUT: %require_complete.loc9_13: = require_complete_type @AccessGeneric.%T.loc8_18.2 (%T) [symbolic = %require_complete.loc9_13 (constants.%require_complete.1)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%T.param_patt: type](%I.param_patt: @AccessGeneric.%Interface.type.loc8_43.2 (%Interface.type.2)) -> @AccessGeneric.%T.loc8_18.2 (%T) { // CHECK:STDOUT: !entry: @@ -217,6 +223,7 @@ fn AccessMissingConcrete(I:! Interface(i32)) -> i32 { // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Interface.type => constants.%Interface.type.2 // CHECK:STDOUT: %Self.2 => constants.%Self +// CHECK:STDOUT: %require_complete => constants.%require_complete.1 // CHECK:STDOUT: %assoc_type => constants.%assoc_type.1 // CHECK:STDOUT: %assoc0.loc5_12.2 => constants.%assoc0.1 // CHECK:STDOUT: } @@ -246,6 +253,7 @@ fn AccessMissingConcrete(I:! Interface(i32)) -> i32 { // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Interface.type => constants.%Interface.type.3 // CHECK:STDOUT: %Self.2 => constants.%Self +// CHECK:STDOUT: %require_complete => constants.%complete_type // CHECK:STDOUT: %assoc_type => constants.%assoc_type.2 // CHECK:STDOUT: %assoc0.loc5_12.2 => constants.%assoc0.2 // CHECK:STDOUT: } @@ -264,12 +272,14 @@ fn AccessMissingConcrete(I:! Interface(i32)) -> i32 { // CHECK:STDOUT: %Interface.generic: %Interface.type.1 = struct_value () [template] // CHECK:STDOUT: %Interface.type.2: type = facet_type <@Interface, @Interface(%T)> [symbolic] // CHECK:STDOUT: %Self: %Interface.type.2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %require_complete.1: = require_complete_type %T [symbolic] // CHECK:STDOUT: %assoc_type.1: type = assoc_entity_type %Interface.type.2, %T [symbolic] // CHECK:STDOUT: %assoc0.1: %assoc_type.1 = assoc_entity element0, @Interface.%X [symbolic] // CHECK:STDOUT: %I.1: %Interface.type.2 = bind_symbolic_name I, 1 [symbolic] // CHECK:STDOUT: %I.patt.1: %Interface.type.2 = symbolic_binding_pattern I, 1 [symbolic] // CHECK:STDOUT: %AccessMissingGeneric.type: type = fn_type @AccessMissingGeneric [template] // CHECK:STDOUT: %AccessMissingGeneric: %AccessMissingGeneric.type = struct_value () [template] +// CHECK:STDOUT: %require_complete.2: = require_complete_type %Interface.type.2 [symbolic] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] // CHECK:STDOUT: %Int.type: type = fn_type @Int [template] // CHECK:STDOUT: %Int: %Int.type = struct_value () [template] @@ -279,6 +289,7 @@ fn AccessMissingConcrete(I:! Interface(i32)) -> i32 { // CHECK:STDOUT: %I.patt.2: %Interface.type.3 = symbolic_binding_pattern I, 0 [symbolic] // CHECK:STDOUT: %AccessMissingConcrete.type: type = fn_type @AccessMissingConcrete [template] // CHECK:STDOUT: %AccessMissingConcrete: %AccessMissingConcrete.type = struct_value () [template] +// CHECK:STDOUT: %complete_type: = complete_type_witness %i32 [template] // CHECK:STDOUT: %assoc_type.2: type = assoc_entity_type %Interface.type.3, %i32 [template] // CHECK:STDOUT: %assoc0.2: %assoc_type.2 = assoc_entity element0, @Interface.%X [template] // CHECK:STDOUT: } @@ -355,6 +366,7 @@ fn AccessMissingConcrete(I:! Interface(i32)) -> i32 { // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Interface.type: type = facet_type <@Interface, @Interface(%T.loc4_21.2)> [symbolic = %Interface.type (constants.%Interface.type.2)] // CHECK:STDOUT: %Self.2: %Interface.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self)] +// CHECK:STDOUT: %require_complete: = require_complete_type @Interface.%T.loc4_21.2 (%T) [symbolic = %require_complete (constants.%require_complete.1)] // CHECK:STDOUT: %assoc_type: type = assoc_entity_type @Interface.%Interface.type (%Interface.type.2), @Interface.%T.loc4_21.2 (%T) [symbolic = %assoc_type (constants.%assoc_type.1)] // CHECK:STDOUT: %assoc0.loc5_12.2: @Interface.%assoc_type (%assoc_type.1) = assoc_entity element0, %X [symbolic = %assoc0.loc5_12.2 (constants.%assoc0.1)] // CHECK:STDOUT: @@ -379,6 +391,7 @@ fn AccessMissingConcrete(I:! Interface(i32)) -> i32 { // CHECK:STDOUT: %I.patt.loc8_35.2: %Interface.type.2 = symbolic_binding_pattern I, 1 [symbolic = %I.patt.loc8_35.2 (constants.%I.patt.1)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete: = require_complete_type @AccessMissingGeneric.%Interface.type.loc8_50.2 (%Interface.type.2) [symbolic = %require_complete (constants.%require_complete.2)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%T.param_patt: type](%I.param_patt: @AccessMissingGeneric.%Interface.type.loc8_50.2 (%Interface.type.2)) -> @AccessMissingGeneric.%T.loc8_25.2 (%T) { // CHECK:STDOUT: !entry: @@ -409,6 +422,7 @@ fn AccessMissingConcrete(I:! Interface(i32)) -> i32 { // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Interface.type => constants.%Interface.type.2 // CHECK:STDOUT: %Self.2 => constants.%Self +// CHECK:STDOUT: %require_complete => constants.%require_complete.1 // CHECK:STDOUT: %assoc_type => constants.%assoc_type.1 // CHECK:STDOUT: %assoc0.loc5_12.2 => constants.%assoc0.1 // CHECK:STDOUT: } @@ -438,6 +452,7 @@ fn AccessMissingConcrete(I:! Interface(i32)) -> i32 { // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Interface.type => constants.%Interface.type.3 // CHECK:STDOUT: %Self.2 => constants.%Self +// CHECK:STDOUT: %require_complete => constants.%complete_type // CHECK:STDOUT: %assoc_type => constants.%assoc_type.2 // CHECK:STDOUT: %assoc0.loc5_12.2 => constants.%assoc0.2 // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/interface/no_prelude/as_type_of_type.carbon b/toolchain/check/testdata/interface/no_prelude/as_type_of_type.carbon index d9927135820ba..f51912518a12f 100644 --- a/toolchain/check/testdata/interface/no_prelude/as_type_of_type.carbon +++ b/toolchain/check/testdata/interface/no_prelude/as_type_of_type.carbon @@ -24,6 +24,7 @@ fn F(T:! Empty) { // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %T.as_type: type = facet_access_type %T [symbolic] +// CHECK:STDOUT: %require_complete: = require_complete_type %T.as_type [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -56,6 +57,7 @@ fn F(T:! Empty) { // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %T.as_type.loc14_10.2: type = facet_access_type %T.loc13_6.2 [symbolic = %T.as_type.loc14_10.2 (constants.%T.as_type)] +// CHECK:STDOUT: %require_complete: = require_complete_type @F.%T.as_type.loc14_10.2 (%T.as_type) [symbolic = %require_complete (constants.%require_complete)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%T.param_patt: %Empty.type) { // CHECK:STDOUT: !entry: diff --git a/toolchain/check/testdata/interface/no_prelude/assoc_const_in_generic.carbon b/toolchain/check/testdata/interface/no_prelude/assoc_const_in_generic.carbon index 0417c1947b75f..6af8c9486a543 100644 --- a/toolchain/check/testdata/interface/no_prelude/assoc_const_in_generic.carbon +++ b/toolchain/check/testdata/interface/no_prelude/assoc_const_in_generic.carbon @@ -41,14 +41,18 @@ fn H() { // CHECK:STDOUT: %assoc0.1: %F.assoc_type.1 = assoc_entity element0, @I.%F.decl [symbolic] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] +// CHECK:STDOUT: %require_complete.1: = require_complete_type %I.type.2 [symbolic] +// CHECK:STDOUT: %require_complete.2: = require_complete_type %F.assoc_type.1 [symbolic] // CHECK:STDOUT: %H.type: type = fn_type @H [template] // CHECK:STDOUT: %H: %H.type = struct_value () [template] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] // CHECK:STDOUT: %G.specific_fn: = specific_function %G, @G(%empty_struct_type) [template] // CHECK:STDOUT: %I.type.3: type = facet_type <@I, @I(%empty_struct_type)> [template] +// CHECK:STDOUT: %complete_type.1: = complete_type_witness %I.type.3 [template] // CHECK:STDOUT: %F.type.2: type = fn_type @F, @I(%empty_struct_type) [template] // CHECK:STDOUT: %F.assoc_type.2: type = assoc_entity_type %I.type.3, %F.type.2 [template] // CHECK:STDOUT: %assoc0.2: %F.assoc_type.2 = assoc_entity element0, @I.%F.decl [template] +// CHECK:STDOUT: %complete_type.2: = complete_type_witness %F.assoc_type.2 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -122,9 +126,11 @@ fn H() { // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %I.type.loc19_6.2: type = facet_type <@I, @I(%T.loc15_6.2)> [symbolic = %I.type.loc19_6.2 (constants.%I.type.2)] +// CHECK:STDOUT: %require_complete.loc19_7.1: = require_complete_type @G.%I.type.loc19_6.2 (%I.type.2) [symbolic = %require_complete.loc19_7.1 (constants.%require_complete.1)] // CHECK:STDOUT: %F.type: type = fn_type @F, @I(%T.loc15_6.2) [symbolic = %F.type (constants.%F.type.1)] // CHECK:STDOUT: %F.assoc_type: type = assoc_entity_type @G.%I.type.loc19_6.2 (%I.type.2), @G.%F.type (%F.type.1) [symbolic = %F.assoc_type (constants.%F.assoc_type.1)] // CHECK:STDOUT: %assoc0: @G.%F.assoc_type (%F.assoc_type.1) = assoc_entity element0, @I.%F.decl [symbolic = %assoc0 (constants.%assoc0.1)] +// CHECK:STDOUT: %require_complete.loc19_7.2: = require_complete_type @G.%F.assoc_type (%F.assoc_type.1) [symbolic = %require_complete.loc19_7.2 (constants.%require_complete.2)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%T.param_patt: type) { // CHECK:STDOUT: !entry: @@ -186,9 +192,11 @@ fn H() { // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %I.type.loc19_6.2 => constants.%I.type.3 +// CHECK:STDOUT: %require_complete.loc19_7.1 => constants.%complete_type.1 // CHECK:STDOUT: %F.type => constants.%F.type.2 // CHECK:STDOUT: %F.assoc_type => constants.%F.assoc_type.2 // CHECK:STDOUT: %assoc0 => constants.%assoc0.2 +// CHECK:STDOUT: %require_complete.loc19_7.2 => constants.%complete_type.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @I(constants.%empty_struct_type) { diff --git a/toolchain/check/testdata/interface/no_prelude/fail_todo_facet_lookup.carbon b/toolchain/check/testdata/interface/no_prelude/fail_todo_facet_lookup.carbon index ac5cb09c51fb0..baca7f01f4071 100644 --- a/toolchain/check/testdata/interface/no_prelude/fail_todo_facet_lookup.carbon +++ b/toolchain/check/testdata/interface/no_prelude/fail_todo_facet_lookup.carbon @@ -43,6 +43,7 @@ fn CallFacet(T:! Interface, x: T) { // CHECK:STDOUT: %T.as_type: type = facet_access_type %T [symbolic] // CHECK:STDOUT: %CallFacet.type: type = fn_type @CallFacet [template] // CHECK:STDOUT: %CallFacet: %CallFacet.type = struct_value () [template] +// CHECK:STDOUT: %require_complete: = require_complete_type %T.as_type [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -117,6 +118,7 @@ fn CallFacet(T:! Interface, x: T) { // CHECK:STDOUT: %T.as_type.loc21_32.2: type = facet_access_type %T.loc21_14.2 [symbolic = %T.as_type.loc21_32.2 (constants.%T.as_type)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete: = require_complete_type @CallFacet.%T.as_type.loc21_32.2 (%T.as_type) [symbolic = %require_complete (constants.%require_complete)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%T.param_patt: %Interface.type, %x.param_patt: @CallFacet.%T.as_type.loc21_32.2 (%T.as_type)) { // CHECK:STDOUT: !entry: diff --git a/toolchain/check/testdata/interface/no_prelude/fail_todo_generic_default_fn.carbon b/toolchain/check/testdata/interface/no_prelude/fail_todo_generic_default_fn.carbon index f6caac35fb740..a3db7e48aec56 100644 --- a/toolchain/check/testdata/interface/no_prelude/fail_todo_generic_default_fn.carbon +++ b/toolchain/check/testdata/interface/no_prelude/fail_todo_generic_default_fn.carbon @@ -37,6 +37,7 @@ fn I(T:! type).F[self: Self]() -> Self { return self; } // CHECK:STDOUT: %assoc0: %F.assoc_type = assoc_entity element0, @I.%F.decl [symbolic] // CHECK:STDOUT: %.type: type = fn_type @.1, @I(%T) [symbolic] // CHECK:STDOUT: %.1: %.type = struct_value () [symbolic] +// CHECK:STDOUT: %require_complete: = require_complete_type %Self.as_type [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -132,6 +133,7 @@ fn I(T:! type).F[self: Self]() -> Self { return self; } // CHECK:STDOUT: %Self.as_type.loc22_24.2: type = facet_access_type %Self [symbolic = %Self.as_type.loc22_24.2 (constants.%Self.as_type)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete: = require_complete_type @.1.%Self.as_type.loc22_24.2 (%Self.as_type) [symbolic = %require_complete (constants.%require_complete)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @.1.%Self.as_type.loc22_24.2 (%Self.as_type)]() -> @.1.%Self.as_type.loc22_24.2 (%Self.as_type) { // CHECK:STDOUT: !entry: diff --git a/toolchain/check/testdata/operators/overloaded/implicit_as.carbon b/toolchain/check/testdata/operators/overloaded/implicit_as.carbon index 3bd2c0270af34..d1e1428fd6703 100644 --- a/toolchain/check/testdata/operators/overloaded/implicit_as.carbon +++ b/toolchain/check/testdata/operators/overloaded/implicit_as.carbon @@ -42,7 +42,7 @@ fn Test() { // CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] // CHECK:STDOUT: %X.elem: type = unbound_element_type %X, %i32 [template] // CHECK:STDOUT: %struct_type.n: type = struct_type {.n: %i32} [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.n [template] +// CHECK:STDOUT: %complete_type.1: = complete_type_witness %struct_type.n [template] // CHECK:STDOUT: %ImplicitAs.type.1: type = generic_interface_type @ImplicitAs [template] // CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.1 = struct_value () [template] // CHECK:STDOUT: %ImplicitAs.type.3: type = facet_type <@ImplicitAs, @ImplicitAs(%X)> [template] @@ -63,11 +63,13 @@ fn Test() { // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %Source.type: type = fn_type @Source [template] // CHECK:STDOUT: %Source: %Source.type = struct_value () [template] +// CHECK:STDOUT: %require_complete.1: = require_complete_type %T [symbolic] // CHECK:STDOUT: %Source.specific_fn.1: = specific_function %Source, @Source(%T) [symbolic] // CHECK:STDOUT: %Test.type: type = fn_type @Test [template] // CHECK:STDOUT: %Test: %Test.type = struct_value () [template] // CHECK:STDOUT: %Source.specific_fn.2: = specific_function %Source, @Source(%X) [template] // CHECK:STDOUT: %Source.specific_fn.3: = specific_function %Source, @Source(%i32) [template] +// CHECK:STDOUT: %complete_type.2: = complete_type_witness %i32 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -199,7 +201,7 @@ fn Test() { // CHECK:STDOUT: %.loc12_10.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] // CHECK:STDOUT: %.loc12_10.2: type = converted %int.make_type_signed, %.loc12_10.1 [template = constants.%i32] // CHECK:STDOUT: %.loc12_8: %X.elem = field_decl n, element0 [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.n [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.n [template = constants.%complete_type.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%X @@ -236,6 +238,7 @@ fn Test() { // CHECK:STDOUT: %T.patt.loc27_11.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc27_11.2 (constants.%T.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete: = require_complete_type @Source.%T.loc27_11.2 (%T) [symbolic = %require_complete (constants.%require_complete.1)] // CHECK:STDOUT: %Source.specific_fn.loc27_35.2: = specific_function constants.%Source, @Source(%T.loc27_11.2) [symbolic = %Source.specific_fn.loc27_35.2 (constants.%Source.specific_fn.1)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%T.param_patt: type) -> @Source.%T.loc27_11.2 (%T) { @@ -292,6 +295,7 @@ fn Test() { // CHECK:STDOUT: %T.patt.loc27_11.2 => constants.%T // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete => constants.%require_complete.1 // CHECK:STDOUT: %Source.specific_fn.loc27_35.2 => constants.%Source.specific_fn.1 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -305,6 +309,7 @@ fn Test() { // CHECK:STDOUT: %T.patt.loc27_11.2 => constants.%X // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete => constants.%complete_type.1 // CHECK:STDOUT: %Source.specific_fn.loc27_35.2 => constants.%Source.specific_fn.2 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -313,6 +318,7 @@ fn Test() { // CHECK:STDOUT: %T.patt.loc27_11.2 => constants.%i32 // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete => constants.%complete_type.2 // CHECK:STDOUT: %Source.specific_fn.loc27_35.2 => constants.%Source.specific_fn.3 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/return/fail_return_with_returned_var.carbon b/toolchain/check/testdata/return/fail_return_with_returned_var.carbon index c549d4f69f7f3..8ebaa8fb53ecb 100644 --- a/toolchain/check/testdata/return/fail_return_with_returned_var.carbon +++ b/toolchain/check/testdata/return/fail_return_with_returned_var.carbon @@ -53,7 +53,7 @@ fn G() -> C { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %C.elem: type = unbound_element_type %C, %i32 [template] // CHECK:STDOUT: %struct_type.a.b.1: type = struct_type {.a: %i32, .b: %i32} [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a.b.1 [template] +// CHECK:STDOUT: %complete_type.3: = complete_type_witness %struct_type.a.b.1 [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] // CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] @@ -117,7 +117,7 @@ fn G() -> C { // CHECK:STDOUT: %.loc23_30.1: type = value_of_initializer %int.make_type_signed.loc23_30 [template = constants.%i32] // CHECK:STDOUT: %.loc23_30.2: type = converted %int.make_type_signed.loc23_30, %.loc23_30.1 [template = constants.%i32] // CHECK:STDOUT: %.loc23_28: %C.elem = field_decl b, element1 [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a.b.1 [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a.b.1 [template = constants.%complete_type.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C diff --git a/toolchain/check/testdata/return/returned_var.carbon b/toolchain/check/testdata/return/returned_var.carbon index 727ccb95b3291..f59d3fe2a4ef0 100644 --- a/toolchain/check/testdata/return/returned_var.carbon +++ b/toolchain/check/testdata/return/returned_var.carbon @@ -33,7 +33,7 @@ fn G() -> i32 { // CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] // CHECK:STDOUT: %C.elem: type = unbound_element_type %C, %i32 [template] // CHECK:STDOUT: %struct_type.a.b.1: type = struct_type {.a: %i32, .b: %i32} [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a.b.1 [template] +// CHECK:STDOUT: %complete_type.1: = complete_type_witness %struct_type.a.b.1 [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] @@ -108,7 +108,7 @@ fn G() -> i32 { // CHECK:STDOUT: %.loc13_10.1: type = value_of_initializer %int.make_type_signed.loc13 [template = constants.%i32] // CHECK:STDOUT: %.loc13_10.2: type = converted %int.make_type_signed.loc13, %.loc13_10.1 [template = constants.%i32] // CHECK:STDOUT: %.loc13_8: %C.elem = field_decl b, element1 [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a.b.1 [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a.b.1 [template = constants.%complete_type.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C diff --git a/toolchain/check/testdata/struct/import.carbon b/toolchain/check/testdata/struct/import.carbon index ca557774bf9fd..9c422c8f0f6d6 100644 --- a/toolchain/check/testdata/struct/import.carbon +++ b/toolchain/check/testdata/struct/import.carbon @@ -43,10 +43,10 @@ var c_bad: C({.c = 1, .d = 2}) = F(); // --- fail_bad_value.impl.carbon impl package Implicit; -// CHECK:STDERR: fail_bad_value.impl.carbon:[[@LINE+6]]:1: error: cannot implicitly convert from `C()` to `C()` [ImplicitAsConversionFailure] +// CHECK:STDERR: fail_bad_value.impl.carbon:[[@LINE+6]]:1: error: cannot implicitly convert from `C()` to `C()` [ImplicitAsConversionFailure] // CHECK:STDERR: var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_bad_value.impl.carbon:[[@LINE+3]]:1: note: type `C()` does not implement interface `ImplicitAs(C())` [MissingImplInMemberAccessNote] +// CHECK:STDERR: fail_bad_value.impl.carbon:[[@LINE+3]]:1: note: type `C()` does not implement interface `ImplicitAs(C())` [MissingImplInMemberAccessNote] // CHECK:STDERR: var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ var c_bad: C({.a = 3, .b = 4}) = F(); @@ -86,7 +86,7 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %C.generic: %C.type = struct_value () [template] // CHECK:STDOUT: %C.1: type = class_type @C, @C(%S) [symbolic] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %complete_type.3: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %struct_type.a.b.2: type = struct_type {.a: Core.IntLiteral, .b: Core.IntLiteral} [template] @@ -196,7 +196,7 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: class { -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C.1 @@ -281,7 +281,7 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %C.type: type = generic_class_type @C [template] // CHECK:STDOUT: %C.generic: %C.type = struct_value () [template] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %complete_type.1: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %struct_type.a.b.1: type = struct_type {.a: %i32, .b: %i32} [template] // CHECK:STDOUT: %S: %struct_type.a.b.1 = bind_symbolic_name S, 0 [symbolic] // CHECK:STDOUT: %S.patt: %struct_type.a.b.1 = symbolic_binding_pattern S, 0 [symbolic] @@ -315,8 +315,8 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.40: = import_ref Implicit//default, loc8_34, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.41 = import_ref Implicit//default, inst418 [no loc], unloaded +// CHECK:STDOUT: %import_ref.40: = import_ref Implicit//default, loc8_34, loaded [template = constants.%complete_type.1] +// CHECK:STDOUT: %import_ref.41 = import_ref Implicit//default, inst436 [no loc], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -479,7 +479,7 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.39: = import_ref Implicit//default, loc8_34, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.40 = import_ref Implicit//default, inst418 [no loc], unloaded +// CHECK:STDOUT: %import_ref.40 = import_ref Implicit//default, inst436 [no loc], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -544,7 +544,7 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %C.type: type = generic_class_type @C [template] // CHECK:STDOUT: %C.generic: %C.type = struct_value () [template] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %complete_type.1: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] // CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] // CHECK:STDOUT: %struct_type.a.b.1: type = struct_type {.a: %i32, .b: %i32} [template] @@ -583,8 +583,8 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.39: = import_ref Implicit//default, loc8_34, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.40 = import_ref Implicit//default, inst418 [no loc], unloaded +// CHECK:STDOUT: %import_ref.39: = import_ref Implicit//default, loc8_34, loaded [template = constants.%complete_type.1] +// CHECK:STDOUT: %import_ref.40 = import_ref Implicit//default, inst436 [no loc], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/tuple/import.carbon b/toolchain/check/testdata/tuple/import.carbon index d9e569e9e9e0a..2ea5c9c50ac38 100644 --- a/toolchain/check/testdata/tuple/import.carbon +++ b/toolchain/check/testdata/tuple/import.carbon @@ -45,10 +45,10 @@ var c_bad: C((1, 2, 3)) = F(); impl package Implicit; -// CHECK:STDERR: fail_bad_value.impl.carbon:[[@LINE+6]]:1: error: cannot implicitly convert from `C()` to `C()` [ImplicitAsConversionFailure] +// CHECK:STDERR: fail_bad_value.impl.carbon:[[@LINE+6]]:1: error: cannot implicitly convert from `C()` to `C()` [ImplicitAsConversionFailure] // CHECK:STDERR: var c_bad: C((3, 4)) = F(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_bad_value.impl.carbon:[[@LINE+3]]:1: note: type `C()` does not implement interface `ImplicitAs(C())` [MissingImplInMemberAccessNote] +// CHECK:STDERR: fail_bad_value.impl.carbon:[[@LINE+3]]:1: note: type `C()` does not implement interface `ImplicitAs(C())` [MissingImplInMemberAccessNote] // CHECK:STDERR: var c_bad: C((3, 4)) = F(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~ var c_bad: C((3, 4)) = F(); @@ -102,7 +102,7 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %C.generic: %C.type = struct_value () [template] // CHECK:STDOUT: %C.1: type = class_type @C, @C(%X) [symbolic] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %complete_type.3: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %tuple.5: %tuple.type.8 = tuple_value (%int_1.2, %int_2.2) [template] // CHECK:STDOUT: %C.2: type = class_type @C, @C(%tuple.5) [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] @@ -213,7 +213,7 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: class { -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C.1 @@ -313,7 +313,7 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %C.type: type = generic_class_type @C [template] // CHECK:STDOUT: %C.generic: %C.type = struct_value () [template] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %complete_type.1: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %X: %tuple.type.7 = bind_symbolic_name X, 0 [symbolic] // CHECK:STDOUT: %X.patt: %tuple.type.7 = symbolic_binding_pattern X, 0 [symbolic] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] @@ -346,8 +346,8 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.40: = import_ref Implicit//default, loc7_26, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.41 = import_ref Implicit//default, inst455 [no loc], unloaded +// CHECK:STDOUT: %import_ref.40: = import_ref Implicit//default, loc7_26, loaded [template = constants.%complete_type.1] +// CHECK:STDOUT: %import_ref.41 = import_ref Implicit//default, inst473 [no loc], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -528,7 +528,7 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.39: = import_ref Implicit//default, loc7_26, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.40 = import_ref Implicit//default, inst455 [no loc], unloaded +// CHECK:STDOUT: %import_ref.40 = import_ref Implicit//default, inst473 [no loc], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -594,7 +594,7 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %C.type: type = generic_class_type @C [template] // CHECK:STDOUT: %C.generic: %C.type = struct_value () [template] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %complete_type.1: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] // CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (%i32, %i32) [template] @@ -633,8 +633,8 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.39: = import_ref Implicit//default, loc7_26, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.40 = import_ref Implicit//default, inst455 [no loc], unloaded +// CHECK:STDOUT: %import_ref.39: = import_ref Implicit//default, loc7_26, loaded [template = constants.%complete_type.1] +// CHECK:STDOUT: %import_ref.40 = import_ref Implicit//default, inst473 [no loc], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/where_expr/dot_self_index.carbon b/toolchain/check/testdata/where_expr/dot_self_index.carbon index a15d8d1d54310..def337b0be967 100644 --- a/toolchain/check/testdata/where_expr/dot_self_index.carbon +++ b/toolchain/check/testdata/where_expr/dot_self_index.carbon @@ -37,6 +37,7 @@ fn G(U: Empty(i32) where .A = i32*) { // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %Empty.type.3: type = facet_type <@Empty, @Empty(%T)> [symbolic] // CHECK:STDOUT: %.Self.1: %Empty.type.3 = bind_symbolic_name .Self [symbolic] +// CHECK:STDOUT: %require_complete.1: = require_complete_type %Empty.type.3 [symbolic] // CHECK:STDOUT: %assoc_type.2: type = assoc_entity_type %Empty.type.3, type [symbolic] // CHECK:STDOUT: %assoc0.2: %assoc_type.2 = assoc_entity element0, @Empty.%A [symbolic] // CHECK:STDOUT: %.Self.as_wit.1: = facet_access_witness %.Self.1 [symbolic] @@ -47,6 +48,7 @@ fn G(U: Empty(i32) where .A = i32*) { // CHECK:STDOUT: %V.patt: type = symbolic_binding_pattern V, 1 [symbolic] // CHECK:STDOUT: %H.type: type = fn_type @H [template] // CHECK:STDOUT: %H: %H.type = struct_value () [template] +// CHECK:STDOUT: %require_complete.2: = require_complete_type %Empty_where.type.1 [symbolic] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] // CHECK:STDOUT: %Int.type: type = fn_type @Int [template] // CHECK:STDOUT: %Int: %Int.type = struct_value () [template] @@ -63,7 +65,9 @@ fn G(U: Empty(i32) where .A = i32*) { // CHECK:STDOUT: %G: %G.type = struct_value () [template] // CHECK:STDOUT: %Bool.type: type = fn_type @Bool [template] // CHECK:STDOUT: %Bool: %Bool.type = struct_value () [template] +// CHECK:STDOUT: %complete_type.1: = complete_type_witness %Empty.type.4 [template] // CHECK:STDOUT: %H.specific_fn: = specific_function %H, @H(%i32, bool) [template] +// CHECK:STDOUT: %complete_type.2: = complete_type_witness %Empty_where.type.2 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -175,6 +179,7 @@ fn G(U: Empty(i32) where .A = i32*) { // CHECK:STDOUT: %T.patt.loc18_6.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc18_6.2 (constants.%T.patt)] // CHECK:STDOUT: %Empty.type.loc18_26.2: type = facet_type <@Empty, @Empty(%T.loc18_6.2)> [symbolic = %Empty.type.loc18_26.2 (constants.%Empty.type.3)] // CHECK:STDOUT: %.Self.2: @H.%Empty.type.loc18_26.2 (%Empty.type.3) = bind_symbolic_name .Self [symbolic = %.Self.2 (constants.%.Self.1)] +// CHECK:STDOUT: %require_complete.loc18_34: = require_complete_type @H.%Empty.type.loc18_26.2 (%Empty.type.3) [symbolic = %require_complete.loc18_34 (constants.%require_complete.1)] // CHECK:STDOUT: %assoc_type: type = assoc_entity_type @H.%Empty.type.loc18_26.2 (%Empty.type.3), type [symbolic = %assoc_type (constants.%assoc_type.2)] // CHECK:STDOUT: %assoc0: @H.%assoc_type (%assoc_type.2) = assoc_entity element0, @Empty.%A [symbolic = %assoc0 (constants.%assoc0.2)] // CHECK:STDOUT: %.Self.as_wit.loc18_34.2: = facet_access_witness %.Self.2 [symbolic = %.Self.as_wit.loc18_34.2 (constants.%.Self.as_wit.1)] @@ -185,6 +190,7 @@ fn G(U: Empty(i32) where .A = i32*) { // CHECK:STDOUT: %V.patt.loc18_43.2: type = symbolic_binding_pattern V, 1 [symbolic = %V.patt.loc18_43.2 (constants.%V.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete.loc18_17: = require_complete_type @H.%Empty_where.type (%Empty_where.type.1) [symbolic = %require_complete.loc18_17 (constants.%require_complete.2)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%T.param_patt: type, %U.param_patt: @H.%Empty_where.type (%Empty_where.type.1), %V.param_patt: type) { // CHECK:STDOUT: !entry: @@ -239,6 +245,7 @@ fn G(U: Empty(i32) where .A = i32*) { // CHECK:STDOUT: %T.patt.loc18_6.2 => constants.%T // CHECK:STDOUT: %Empty.type.loc18_26.2 => constants.%Empty.type.3 // CHECK:STDOUT: %.Self.2 => constants.%.Self.1 +// CHECK:STDOUT: %require_complete.loc18_34 => constants.%require_complete.1 // CHECK:STDOUT: %assoc_type => constants.%assoc_type.2 // CHECK:STDOUT: %assoc0 => constants.%assoc0.2 // CHECK:STDOUT: %.Self.as_wit.loc18_34.2 => constants.%.Self.as_wit.1 @@ -265,6 +272,7 @@ fn G(U: Empty(i32) where .A = i32*) { // CHECK:STDOUT: %T.patt.loc18_6.2 => constants.%i32 // CHECK:STDOUT: %Empty.type.loc18_26.2 => constants.%Empty.type.4 // CHECK:STDOUT: %.Self.2 => constants.%.Self.2 +// CHECK:STDOUT: %require_complete.loc18_34 => constants.%complete_type.1 // CHECK:STDOUT: %assoc_type => constants.%assoc_type.3 // CHECK:STDOUT: %assoc0 => constants.%assoc0.3 // CHECK:STDOUT: %.Self.as_wit.loc18_34.2 => constants.%.Self.as_wit.2 @@ -275,5 +283,6 @@ fn G(U: Empty(i32) where .A = i32*) { // CHECK:STDOUT: %V.patt.loc18_43.2 => bool // CHECK:STDOUT: // CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete.loc18_17 => constants.%complete_type.2 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/diagnostics/diagnostic_kind.def b/toolchain/diagnostics/diagnostic_kind.def index d9f0bb0cb0302..738d43113d839 100644 --- a/toolchain/diagnostics/diagnostic_kind.def +++ b/toolchain/diagnostics/diagnostic_kind.def @@ -323,6 +323,7 @@ CARBON_DIAGNOSTIC_KIND(IncompleteTypeInBaseDecl) CARBON_DIAGNOSTIC_KIND(IncompleteTypeInConversion) CARBON_DIAGNOSTIC_KIND(IncompleteTypeInFunctionParam) CARBON_DIAGNOSTIC_KIND(IncompleteTypeInFunctionReturnType) +CARBON_DIAGNOSTIC_KIND(IncompleteTypeInMonomorphization) CARBON_DIAGNOSTIC_KIND(IncompleteTypeInLetDecl) CARBON_DIAGNOSTIC_KIND(IncompleteTypeInMemberAccess) CARBON_DIAGNOSTIC_KIND(IncompleteTypeInValueConversion) diff --git a/toolchain/sem_ir/file.cpp b/toolchain/sem_ir/file.cpp index fc36832250679..336938417e828 100644 --- a/toolchain/sem_ir/file.cpp +++ b/toolchain/sem_ir/file.cpp @@ -273,6 +273,7 @@ auto GetExprCategory(const File& file, InstId inst_id) -> ExprCategory { case LegacyFloatType::Kind: case NamespaceType::Kind: case PointerType::Kind: + case RequireCompleteType::Kind: case SpecificFunction::Kind: case SpecificFunctionType::Kind: case StringLiteral::Kind: diff --git a/toolchain/sem_ir/formatter.cpp b/toolchain/sem_ir/formatter.cpp index ff70a25b3e9d3..79cd833ea3183 100644 --- a/toolchain/sem_ir/formatter.cpp +++ b/toolchain/sem_ir/formatter.cpp @@ -902,6 +902,10 @@ class FormatterImpl { llvm::ArrayRef args = sem_ir_->inst_blocks().Get(inst.args_id); auto return_info = ReturnTypeInfo::ForType(*sem_ir_, inst.type_id); + if (!return_info.is_valid()) { + out_ << "()"; + return; + } bool has_return_slot = return_info.has_return_slot(); InstId return_slot_arg_id = InstId::Invalid; if (has_return_slot) { diff --git a/toolchain/sem_ir/inst_kind.def b/toolchain/sem_ir/inst_kind.def index 4e5603a20aa0b..49d75d91916b2 100644 --- a/toolchain/sem_ir/inst_kind.def +++ b/toolchain/sem_ir/inst_kind.def @@ -83,6 +83,7 @@ CARBON_SEM_IR_INST_KIND(NamespaceType) CARBON_SEM_IR_INST_KIND(OutParam) CARBON_SEM_IR_INST_KIND(OutParamPattern) CARBON_SEM_IR_INST_KIND(PointerType) +CARBON_SEM_IR_INST_KIND(RequireCompleteType) CARBON_SEM_IR_INST_KIND(RequirementEquivalent) CARBON_SEM_IR_INST_KIND(RequirementImpls) CARBON_SEM_IR_INST_KIND(RequirementRewrite) diff --git a/toolchain/sem_ir/inst_namer.cpp b/toolchain/sem_ir/inst_namer.cpp index c2c1fdcb23af0..454da12adfb93 100644 --- a/toolchain/sem_ir/inst_namer.cpp +++ b/toolchain/sem_ir/inst_namer.cpp @@ -694,7 +694,11 @@ auto InstNamer::CollectNamesInBlock(ScopeId scope_id, add_inst_name("ptr"); continue; } - case InstKind::ReturnSlotPattern: { + case RequireCompleteType::Kind: { + add_inst_name("require_complete"); + continue; + } + case ReturnSlotPattern::Kind: { add_inst_name_id(NameId::ReturnSlot, ".patt"); continue; } @@ -712,7 +716,7 @@ auto InstNamer::CollectNamesInBlock(ScopeId scope_id, } continue; } - case InstKind::ReturnSlot: { + case ReturnSlot::Kind: { add_inst_name_id(NameId::ReturnSlot); break; } diff --git a/toolchain/sem_ir/stringify_type.cpp b/toolchain/sem_ir/stringify_type.cpp index 3f74c1971dcc5..9429bc3767659 100644 --- a/toolchain/sem_ir/stringify_type.cpp +++ b/toolchain/sem_ir/stringify_type.cpp @@ -470,6 +470,7 @@ auto StringifyTypeExpr(const SemIR::File& sem_ir, InstId outer_inst_id) case InterfaceWitness::Kind: case OutParam::Kind: case OutParamPattern::Kind: + case RequireCompleteType::Kind: case RequirementEquivalent::Kind: case RequirementImpls::Kind: case RequirementRewrite::Kind: diff --git a/toolchain/sem_ir/typed_insts.h b/toolchain/sem_ir/typed_insts.h index 50a83b2d5a517..b2cdaca8f21a6 100644 --- a/toolchain/sem_ir/typed_insts.h +++ b/toolchain/sem_ir/typed_insts.h @@ -1059,6 +1059,25 @@ struct PointerType { TypeId pointee_id; }; +// Requires a type to be complete. This is only created for generic types and +// produces a witness that the type is complete. +// +// TODO: Eventually this should be replaced by a witness for an interface that +// models type completeness, and should track other information such as the +// value representation. +struct RequireCompleteType { + static constexpr auto Kind = + InstKind::RequireCompleteType.Define( + {.ir_name = "require_complete_type", + .is_type = InstIsType::Never, + .constant_kind = InstConstantKind::SymbolicOnly, + .is_lowered = false}); + // Always the builtin witness type. + TypeId type_id; + // The type that is required to be complete. + TypeId complete_type_id; +}; + struct Return { static constexpr auto Kind = InstKind::Return.Define Date: Tue, 10 Dec 2024 12:23:24 -0800 Subject: [PATCH 09/68] Rename mutable accessor in `InstBlock` store. (#4659) Mutating a block is a strange and rare operation and shouldn't have an innocuous name like `Get`. --- toolchain/sem_ir/block_value_store.h | 6 ++++-- toolchain/sem_ir/copy_on_write_block.h | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/toolchain/sem_ir/block_value_store.h b/toolchain/sem_ir/block_value_store.h index f5f812d611bfb..d27e2fd54c5c3 100644 --- a/toolchain/sem_ir/block_value_store.h +++ b/toolchain/sem_ir/block_value_store.h @@ -50,8 +50,10 @@ class BlockValueStore : public Yaml::Printable> { return values_.Get(id); } - // Returns the requested block. - auto Get(IdT id) -> llvm::MutableArrayRef { + // Returns a mutable view of the requested block. This operation should be + // avoided where possible; we generally want blocks to be immutable once + // created. + auto GetMutable(IdT id) -> llvm::MutableArrayRef { return values_.Get(id); } diff --git a/toolchain/sem_ir/copy_on_write_block.h b/toolchain/sem_ir/copy_on_write_block.h index 7fc279c3745d3..1ec9a11b7eda0 100644 --- a/toolchain/sem_ir/copy_on_write_block.h +++ b/toolchain/sem_ir/copy_on_write_block.h @@ -58,7 +58,7 @@ class CopyOnWriteBlock { if (id_ == source_id_) { id_ = (file_.*ValueStore)().Add((file_.*ValueStore)().Get(source_id_)); } - (file_.*ValueStore)().Get(id_)[i] = value; + (file_.*ValueStore)().GetMutable(id_)[i] = value; } private: From fe8b42148f481e34facfc7ad04e1713a109c092c Mon Sep 17 00:00:00 2001 From: Boaz Brickner Date: Tue, 10 Dec 2024 21:55:58 +0100 Subject: [PATCH 10/68] =?UTF-8?q?Mark=20some=20//common,=20//toolchain/dri?= =?UTF-8?q?ver,=20//=E2=80=8Etoolchain/install=20tests=20as=20small=20per?= =?UTF-8?q?=20'Test=20execution=20time'=20warning=20(#4646)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit These tests only take between 0.1s and 1.4s. --- common/BUILD | 5 +++++ toolchain/driver/BUILD | 1 + toolchain/install/BUILD | 1 + 3 files changed, 7 insertions(+) diff --git a/common/BUILD b/common/BUILD index 118d20d21454f..0a4474e77e521 100644 --- a/common/BUILD +++ b/common/BUILD @@ -181,6 +181,7 @@ cc_library( cc_test( name = "hashing_test", + size = "small", srcs = ["hashing_test.cpp"], deps = [ ":hashing", @@ -217,6 +218,7 @@ cc_library( cc_test( name = "hashtable_key_context_test", + size = "small", srcs = ["hashtable_key_context_test.cpp"], deps = [ ":hashtable_key_context", @@ -281,6 +283,7 @@ cc_library( cc_test( name = "map_test", + size = "small", srcs = ["map_test.cpp"], deps = [ ":map", @@ -368,6 +371,7 @@ cc_binary( sh_test( name = "raw_hashtable_metadata_group_benchmark_test", + size = "small", srcs = ["raw_hashtable_metadata_group_benchmark"], args = [ "--benchmark_min_time=1x", @@ -420,6 +424,7 @@ cc_library( cc_test( name = "set_test", + size = "small", srcs = ["set_test.cpp"], deps = [ ":raw_hashtable_test_helpers", diff --git a/toolchain/driver/BUILD b/toolchain/driver/BUILD index d015d2fc33fe7..4842aaaf047a8 100644 --- a/toolchain/driver/BUILD +++ b/toolchain/driver/BUILD @@ -74,6 +74,7 @@ cc_binary( sh_test( name = "compile_benchmark_test", + size = "small", srcs = [":compile_benchmark"], args = [ "--benchmark_min_time=1x", diff --git a/toolchain/install/BUILD b/toolchain/install/BUILD index 9ddf3b41a6913..9cb16c9fd92d4 100644 --- a/toolchain/install/BUILD +++ b/toolchain/install/BUILD @@ -82,6 +82,7 @@ cc_library( cc_test( name = "busybox_info_test", + size = "small", srcs = ["busybox_info_test.cpp"], deps = [ ":busybox_info", From 92201ceb10ec26884fd27c23a2e91ca8c3693fec Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Tue, 10 Dec 2024 12:56:37 -0800 Subject: [PATCH 11/68] Rename various `TryToCompleteType` functions to better describe what they do. (#4658) As requested in review of #4652. --- toolchain/check/context.cpp | 36 +++++++---- toolchain/check/context.h | 70 +++++++++++++--------- toolchain/check/convert.cpp | 4 +- toolchain/check/function.cpp | 6 +- toolchain/check/handle_binding_pattern.cpp | 2 +- toolchain/check/handle_class.cpp | 2 +- toolchain/check/handle_function.cpp | 2 +- toolchain/check/handle_impl.cpp | 2 +- toolchain/check/impl.cpp | 2 +- toolchain/check/member_access.cpp | 2 +- 10 files changed, 78 insertions(+), 50 deletions(-) diff --git a/toolchain/check/context.cpp b/toolchain/check/context.cpp index f7f9c9791bcc5..d4f7dd01a53b0 100644 --- a/toolchain/check/context.cpp +++ b/toolchain/check/context.cpp @@ -509,7 +509,7 @@ auto Context::AppendLookupScopesForConstant( return true; } if (auto base_as_class = base.TryAs()) { - TryToDefineType(GetTypeIdForTypeConstant(base_const_id), loc_id, [&] { + RequireDefinedType(GetTypeIdForTypeConstant(base_const_id), loc_id, [&] { CARBON_DIAGNOSTIC(QualifiedExprInIncompleteClassScope, Error, "member access into incomplete class {0}", InstIdAsType); @@ -522,7 +522,7 @@ auto Context::AppendLookupScopesForConstant( return true; } if (auto base_as_facet_type = base.TryAs()) { - TryToDefineType(GetTypeIdForTypeConstant(base_const_id), loc_id, [&] { + RequireDefinedType(GetTypeIdForTypeConstant(base_const_id), loc_id, [&] { CARBON_DIAGNOSTIC(QualifiedExprInUndefinedInterfaceScope, Error, "member access into undefined interface {0}", InstIdAsType); @@ -1279,16 +1279,21 @@ class TypeCompleter { }; } // namespace -auto Context::TryToCompleteType(SemIR::TypeId type_id, SemIR::LocId loc_id, - BuildDiagnosticFn diagnoser, - BuildDiagnosticFn abstract_diagnoser) -> bool { +auto Context::TryToCompleteType(SemIR::TypeId type_id) -> bool { + return TypeCompleter(*this, nullptr).Complete(type_id); +} + +auto Context::RequireCompleteType(SemIR::TypeId type_id, SemIR::LocId loc_id, + BuildDiagnosticFn diagnoser) -> bool { + CARBON_CHECK(diagnoser); + if (!TypeCompleter(*this, diagnoser).Complete(type_id)) { return false; } // For a symbolic type, create an instruction to require the corresponding // specific type to be complete. - if (diagnoser && type_id.AsConstantId().is_symbolic()) { + if (type_id.AsConstantId().is_symbolic()) { // TODO: Deduplicate these. AddInstInNoBlock(SemIR::LocIdAndInst( loc_id, @@ -1297,8 +1302,17 @@ auto Context::TryToCompleteType(SemIR::TypeId type_id, SemIR::LocId loc_id, .complete_type_id = type_id})); } - if (!abstract_diagnoser) { - return true; + return true; +} + +auto Context::RequireConcreteType(SemIR::TypeId type_id, SemIR::LocId loc_id, + BuildDiagnosticFn diagnoser, + BuildDiagnosticFn abstract_diagnoser) + -> bool { + CARBON_CHECK(abstract_diagnoser); + + if (!RequireCompleteType(type_id, loc_id, diagnoser)) { + return false; } if (auto class_type = types().TryGetAs(type_id)) { @@ -1320,9 +1334,9 @@ auto Context::TryToCompleteType(SemIR::TypeId type_id, SemIR::LocId loc_id, return true; } -auto Context::TryToDefineType(SemIR::TypeId type_id, SemIR::LocId loc_id, - BuildDiagnosticFn diagnoser) -> bool { - if (!TryToCompleteType(type_id, loc_id, diagnoser)) { +auto Context::RequireDefinedType(SemIR::TypeId type_id, SemIR::LocId loc_id, + BuildDiagnosticFn diagnoser) -> bool { + if (!RequireCompleteType(type_id, loc_id, diagnoser)) { return false; } diff --git a/toolchain/check/context.h b/toolchain/check/context.h index 42c76b1f15af7..cd1a02e2a0274 100644 --- a/toolchain/check/context.h +++ b/toolchain/check/context.h @@ -339,44 +339,58 @@ class Context { // Attempts to complete the type `type_id`. Returns `true` if the type is // complete, or `false` if it could not be completed. A complete type has - // known object and value representations. + // known object and value representations. Returns `true` if the type is + // symbolic. + // + // Avoid calling this where possible, as it can lead to coherence issues. + auto TryToCompleteType(SemIR::TypeId type_id) -> bool; + + // Like `TryToCompleteType`, but for cases where it is an error for the type + // to be incomplete. // // If the type is not complete, `diagnoser` is invoked to diagnose the issue, // if a `diagnoser` is provided. The builder it returns will be annotated to // describe the reason why the type is not complete. // - // If `diagnoser` is provided, it is assumed to be an error for the type to be - // incomplete, and `diagnoser` should build an error diagnostic. If `type_id` - // is dependent, the completeness of the type will be enforced during - // monomorphization, and `loc_id` is used as the location for a diagnostic - // produced at that time. - // - // Returns `true` if the type is symbolic. - auto TryToCompleteType(SemIR::TypeId type_id, SemIR::LocId loc_id, - BuildDiagnosticFn diagnoser, - BuildDiagnosticFn abstract_diagnoser = nullptr) - -> bool; - auto TryToCompleteType(SemIR::TypeId type_id) -> bool { - return TryToCompleteType(type_id, SemIR::LocId::Invalid, nullptr); - } - - // Attempts to complete and define the type `type_id`. Returns `true` if the - // type is defined, or `false` if no definition is available. A defined type - // has known members. + // `diagnoser` should build an error diagnostic. If `type_id` is dependent, + // the completeness of the type will be enforced during monomorphization, and + // `loc_id` is used as the location for a diagnostic produced at that time. + auto RequireCompleteType(SemIR::TypeId type_id, SemIR::LocId loc_id, + BuildDiagnosticFn diagnoser) -> bool; + + // Like `RequireCompleteType`, but also require the type to not be an abstract + // class type. If it is, `abstract_diagnoser` is used to diagnose the problem, + // and this function returns false. + auto RequireConcreteType(SemIR::TypeId type_id, SemIR::LocId loc_id, + BuildDiagnosticFn diagnoser, + BuildDiagnosticFn abstract_diagnoser) -> bool; + + // Like `RequireCompleteType`, but also require the type to be defined. A + // defined type has known members. If the type is not defined, `diagnoser` is + // used to diagnose the problem, and this function returns false. // - // This is the same as `TryToCompleteType` except for interfaces, which are + // This is the same as `RequireCompleteType` except for facet types, which are // complete before they are fully defined. - auto TryToDefineType(SemIR::TypeId type_id, SemIR::LocId loc_id, - BuildDiagnosticFn diagnoser = nullptr) -> bool; + auto RequireDefinedType(SemIR::TypeId type_id, SemIR::LocId loc_id, + BuildDiagnosticFn diagnoser) -> bool; - // Returns the type `type_id` as a complete type, or produces an incomplete - // type error and returns an error type. This is a convenience wrapper around - // TryToCompleteType. `diagnoser` must not be null. + // Returns the type `type_id` if it is a complete type, or produces an + // incomplete type error and returns an error type. This is a convenience + // wrapper around `RequireCompleteType`. auto AsCompleteType(SemIR::TypeId type_id, SemIR::LocId loc_id, + BuildDiagnosticFn diagnoser) -> SemIR::TypeId { + return RequireCompleteType(type_id, loc_id, diagnoser) + ? type_id + : SemIR::ErrorInst::SingletonTypeId; + } + + // Returns the type `type_id` if it is a concrete type, or produces an + // incomplete or abstract type error and returns an error type. This is a + // convenience wrapper around `RequireConcreteType`. + auto AsConcreteType(SemIR::TypeId type_id, SemIR::LocId loc_id, BuildDiagnosticFn diagnoser, - BuildDiagnosticFn abstract_diagnoser = nullptr) - -> SemIR::TypeId { - return TryToCompleteType(type_id, loc_id, diagnoser, abstract_diagnoser) + BuildDiagnosticFn abstract_diagnoser) -> SemIR::TypeId { + return RequireConcreteType(type_id, loc_id, diagnoser, abstract_diagnoser) ? type_id : SemIR::ErrorInst::SingletonTypeId; } diff --git a/toolchain/check/convert.cpp b/toolchain/check/convert.cpp index 2658ca16bb5be..7f4141a6a0749 100644 --- a/toolchain/check/convert.cpp +++ b/toolchain/check/convert.cpp @@ -966,8 +966,8 @@ auto Convert(Context& context, SemIR::LocId loc_id, SemIR::InstId expr_id, return SemIR::ErrorInst::SingletonInstId; } - // We can only perform initialization for complete types. - if (!context.TryToCompleteType( + // We can only perform initialization for complete, non-abstract types. + if (!context.RequireConcreteType( target.type_id, loc_id, [&] { CARBON_CHECK(!target.is_initializer(), diff --git a/toolchain/check/function.cpp b/toolchain/check/function.cpp index 50ef2d6cc0136..221d70143f607 100644 --- a/toolchain/check/function.cpp +++ b/toolchain/check/function.cpp @@ -90,9 +90,9 @@ auto CheckFunctionReturnType(Context& context, SemIR::LocId loc_id, // TODO: Consider suppressing the diagnostic if we've already diagnosed a // definition or call to this function. - if (context.TryToCompleteType(return_info.type_id, loc_id, - diagnose_incomplete_return_type, - diagnose_abstract_return_type)) { + if (context.RequireConcreteType(return_info.type_id, loc_id, + diagnose_incomplete_return_type, + diagnose_abstract_return_type)) { return_info = SemIR::ReturnTypeInfo::ForFunction(context.sem_ir(), function, specific_id); } diff --git a/toolchain/check/handle_binding_pattern.cpp b/toolchain/check/handle_binding_pattern.cpp index 93ac910a31530..dba8505115c35 100644 --- a/toolchain/check/handle_binding_pattern.cpp +++ b/toolchain/check/handle_binding_pattern.cpp @@ -103,7 +103,7 @@ static auto HandleAnyBindingPattern(Context& context, Parse::NodeId node_id, // A `var` declaration at class scope introduces a field. auto parent_class_decl = context.GetCurrentScopeAs(); - cast_type_id = context.AsCompleteType( + cast_type_id = context.AsConcreteType( cast_type_id, type_node, [&] { CARBON_DIAGNOSTIC(IncompleteTypeInVarDecl, Error, diff --git a/toolchain/check/handle_class.cpp b/toolchain/check/handle_class.cpp index b60ba5b577f18..c613374896969 100644 --- a/toolchain/check/handle_class.cpp +++ b/toolchain/check/handle_class.cpp @@ -384,7 +384,7 @@ auto HandleParseNode(Context& context, Parse::AdaptDeclId node_id) -> bool { auto [adapted_inst_id, adapted_type_id] = ExprAsType(context, node_id, adapted_type_expr_id); - adapted_type_id = context.AsCompleteType( + adapted_type_id = context.AsConcreteType( adapted_type_id, node_id, [&] { CARBON_DIAGNOSTIC(IncompleteTypeInAdaptDecl, Error, diff --git a/toolchain/check/handle_function.cpp b/toolchain/check/handle_function.cpp index 9740be7dee3a4..18677edf52713 100644 --- a/toolchain/check/handle_function.cpp +++ b/toolchain/check/handle_function.cpp @@ -349,7 +349,7 @@ static auto CheckFunctionDefinitionSignature(Context& context, } // The parameter types need to be complete. - context.TryToCompleteType( + context.RequireCompleteType( context.insts().GetAs(param_ref_id).type_id, context.insts().GetLocId(param_ref_id), [&] { CARBON_DIAGNOSTIC( diff --git a/toolchain/check/handle_impl.cpp b/toolchain/check/handle_impl.cpp index 861d15f76b07b..6e9fd86789116 100644 --- a/toolchain/check/handle_impl.cpp +++ b/toolchain/check/handle_impl.cpp @@ -179,7 +179,7 @@ static auto ExtendImpl(Context& context, Parse::NodeId extend_node, parent_scope.set_has_error(); return; } - if (!context.TryToDefineType(constraint_id, node_id, [&] { + if (!context.RequireDefinedType(constraint_id, node_id, [&] { CARBON_DIAGNOSTIC( ExtendUndefinedInterface, Error, "`extend impl` requires a definition for facet type {0}", diff --git a/toolchain/check/impl.cpp b/toolchain/check/impl.cpp index 2af9831853891..75a8a504e3eac 100644 --- a/toolchain/check/impl.cpp +++ b/toolchain/check/impl.cpp @@ -143,7 +143,7 @@ static auto BuildInterfaceWitness( // TODO: This is going to try and define all the interfaces for this facet // type, and so once we support impl of a facet type with more than one // interface, it might give the wrong name in the diagnostic. - if (!context.TryToDefineType( + if (!context.RequireDefinedType( facet_type_id, context.insts().GetLocId(impl.definition_id), [&] { CARBON_DIAGNOSTIC(ImplOfUndefinedInterface, Error, "implementation of undefined interface {0}", diff --git a/toolchain/check/member_access.cpp b/toolchain/check/member_access.cpp index 2128b9b802004..3686b515b3abb 100644 --- a/toolchain/check/member_access.cpp +++ b/toolchain/check/member_access.cpp @@ -425,7 +425,7 @@ auto PerformMemberAccess(Context& context, SemIR::LocId loc_id, // If the base isn't a scope, it must have a complete type. auto base_type_id = context.insts().Get(base_id).type_id(); - if (!context.TryToCompleteType( + if (!context.RequireCompleteType( base_type_id, context.insts().GetLocId(base_id), [&] { CARBON_DIAGNOSTIC( IncompleteTypeInMemberAccess, Error, From 87b3671330c36099e839a368cef16423f89ba52e Mon Sep 17 00:00:00 2001 From: Jon Ross-Perkins Date: Tue, 10 Dec 2024 13:00:51 -0800 Subject: [PATCH 12/68] Refactor single-unit checking out of check.cpp (#4649) This is primarily moving code around, to try to create a logical split of the code in check.cpp, makingthe API boundaries clearer. There's one small, deliberate logic change around false returns from `HandleParseNode`, where before there was a `CARBON_CHECK` instantiated by the `#define` (per `NodeKind`), and now it's outside the `#define` (done mainly because the message didn't keep up with the `Handle##Name` -> `HandleParseNode` rename). --- toolchain/check/BUILD | 2 + toolchain/check/check.cpp | 543 ++------------------------------- toolchain/check/check.h | 2 - toolchain/check/check_unit.cpp | 430 ++++++++++++++++++++++++++ toolchain/check/check_unit.h | 153 ++++++++++ toolchain/check/context.cpp | 8 +- toolchain/check/context.h | 10 +- 7 files changed, 612 insertions(+), 536 deletions(-) create mode 100644 toolchain/check/check_unit.cpp create mode 100644 toolchain/check/check_unit.h diff --git a/toolchain/check/BUILD b/toolchain/check/BUILD index d6a7b15da04de..e1cb268405438 100644 --- a/toolchain/check/BUILD +++ b/toolchain/check/BUILD @@ -96,6 +96,8 @@ cc_library( name = "check", srcs = [ "check.cpp", + "check_unit.cpp", + "check_unit.h", "deferred_definition_worklist.cpp", "deferred_definition_worklist.h", "handle.h", diff --git a/toolchain/check/check.cpp b/toolchain/check/check.cpp index 4331094ce873d..2113deed47916 100644 --- a/toolchain/check/check.cpp +++ b/toolchain/check/check.cpp @@ -6,536 +6,28 @@ #include "common/check.h" #include "common/map.h" -#include "toolchain/base/kind_switch.h" -#include "toolchain/base/pretty_stack_trace_function.h" +#include "toolchain/check/check_unit.h" #include "toolchain/check/context.h" #include "toolchain/check/diagnostic_helpers.h" -#include "toolchain/check/generic.h" -#include "toolchain/check/handle.h" -#include "toolchain/check/import.h" -#include "toolchain/check/import_ref.h" -#include "toolchain/check/node_id_traversal.h" #include "toolchain/check/sem_ir_diagnostic_converter.h" #include "toolchain/diagnostics/diagnostic.h" #include "toolchain/diagnostics/format_providers.h" #include "toolchain/lex/token_kind.h" #include "toolchain/parse/node_ids.h" #include "toolchain/parse/tree.h" -#include "toolchain/parse/tree_node_diagnostic_converter.h" #include "toolchain/sem_ir/file.h" -#include "toolchain/sem_ir/ids.h" #include "toolchain/sem_ir/typed_insts.h" namespace Carbon::Check { -namespace { -struct UnitInfo { - // A given import within the file, with its destination. - struct Import { - Parse::Tree::PackagingNames names; - UnitInfo* unit_info; - }; - // A file's imports corresponding to a single package, for the map. - struct PackageImports { - // Use the constructor so that the SmallVector is only constructed - // as-needed. - explicit PackageImports(IdentifierId package_id, - Parse::ImportDeclId node_id) - : package_id(package_id), node_id(node_id) {} - - // The identifier of the imported package. - IdentifierId package_id; - // The first `import` declaration in the file, which declared the package's - // identifier (even if the import failed). Used for associating diagnostics - // not specific to a single import. - Parse::ImportDeclId node_id; - // The associated `import` instruction. Only valid once a file is checked. - SemIR::InstId import_decl_id = SemIR::InstId::Invalid; - // Whether there's an import that failed to load. - bool has_load_error = false; - // The list of valid imports. - llvm::SmallVector imports; - }; - - explicit UnitInfo(SemIR::CheckIRId check_ir_id, Unit& unit) - : check_ir_id(check_ir_id), - unit(&unit), - err_tracker(*unit.consumer), - emitter(*unit.node_converter, err_tracker) {} - - auto parse_tree() -> const Parse::Tree& { return unit->sem_ir->parse_tree(); } - auto source() -> const SourceBuffer& { - return parse_tree().tokens().source(); - } - - SemIR::CheckIRId check_ir_id; - Unit* unit; - - // Emitter information. - ErrorTrackingDiagnosticConsumer err_tracker; - DiagnosticEmitter emitter; - - // List of the outgoing imports. If a package includes unavailable library - // imports, it has an entry with has_load_error set. Invalid imports (for - // example, `import Main;`) aren't added because they won't add identifiers to - // name lookup. - llvm::SmallVector package_imports; - - // A map of the package names to the outgoing imports above. - Map package_imports_map; - - // The remaining number of imports which must be checked before this unit can - // be processed. - int32_t imports_remaining = 0; - - // A list of incoming imports. This will be empty for `impl` files, because - // imports only touch `api` files. - llvm::SmallVector incoming_imports; - - // The corresponding `api` unit if this is an `impl` file. The entry should - // also be in the corresponding `PackageImports`. - UnitInfo* api_for_impl = nullptr; - - // Whether the unit has been checked. - bool is_checked = false; -}; -} // namespace - -// Collects direct imports, for CollectTransitiveImports. -static auto CollectDirectImports(llvm::SmallVector& results, - llvm::MutableArrayRef ir_to_result_index, - SemIR::InstId import_decl_id, - const UnitInfo::PackageImports& imports, - bool is_local) -> void { - for (const auto& import : imports.imports) { - const auto& direct_ir = *import.unit_info->unit->sem_ir; - auto& index = ir_to_result_index[direct_ir.check_ir_id().index]; - if (index != -1) { - // This should only happen when doing API imports for an implementation - // file. Don't change the entry; is_export doesn't matter. - continue; - } - index = results.size(); - results.push_back({.decl_id = import_decl_id, - // Only tag exports in API files, ignoring the value in - // implementation files. - .is_export = is_local && import.names.is_export, - .sem_ir = &direct_ir}); - } -} - -// Collects transitive imports, handling deduplication. These will be unified -// between local_imports and api_imports. -static auto CollectTransitiveImports( - SemIR::InstId import_decl_id, const UnitInfo::PackageImports* local_imports, - const UnitInfo::PackageImports* api_imports, int total_ir_count) - -> llvm::SmallVector { - llvm::SmallVector results; - - // Track whether an IR was imported in full, including `export import`. This - // distinguishes from IRs that are indirectly added without all names being - // exported to this IR. - llvm::SmallVector ir_to_result_index(total_ir_count, -1); - - // First add direct imports. This means that if an entity is imported both - // directly and indirectly, the import path will reflect the direct import. - if (local_imports) { - CollectDirectImports(results, ir_to_result_index, import_decl_id, - *local_imports, - /*is_local=*/true); - } - if (api_imports) { - CollectDirectImports(results, ir_to_result_index, import_decl_id, - *api_imports, - /*is_local=*/false); - } - - // Loop through direct imports for any indirect exports. The underlying vector - // is appended during iteration, so take the size first. - const int direct_imports = results.size(); - for (int direct_index : llvm::seq(direct_imports)) { - bool is_export = results[direct_index].is_export; - - for (const auto& indirect_ir : - results[direct_index].sem_ir->import_irs().array_ref()) { - if (!indirect_ir.is_export) { - continue; - } - - auto& indirect_index = - ir_to_result_index[indirect_ir.sem_ir->check_ir_id().index]; - if (indirect_index == -1) { - indirect_index = results.size(); - // TODO: In the case of a recursive `export import`, this only points at - // the outermost import. May want something that better reflects the - // recursion. - results.push_back({.decl_id = results[direct_index].decl_id, - .is_export = is_export, - .sem_ir = indirect_ir.sem_ir}); - } else if (is_export) { - results[indirect_index].is_export = true; - } - } - } - - return results; -} - -// Imports the current package. -static auto ImportCurrentPackage(Context& context, UnitInfo& unit_info, - int total_ir_count, - SemIR::InstId package_inst_id, - SemIR::TypeId namespace_type_id) -> void { - // Add imports from the current package. - auto import_map_lookup = - unit_info.package_imports_map.Lookup(IdentifierId::Invalid); - if (!import_map_lookup) { - // Push the scope; there are no names to add. - context.scope_stack().Push(package_inst_id, SemIR::NameScopeId::Package); - return; - } - UnitInfo::PackageImports& self_import = - unit_info.package_imports[import_map_lookup.value()]; - - if (self_import.has_load_error) { - context.name_scopes().Get(SemIR::NameScopeId::Package).set_has_error(); - } - - ImportLibrariesFromCurrentPackage( - context, namespace_type_id, - CollectTransitiveImports(self_import.import_decl_id, &self_import, - /*api_imports=*/nullptr, total_ir_count)); - - context.scope_stack().Push( - package_inst_id, SemIR::NameScopeId::Package, SemIR::SpecificId::Invalid, - context.name_scopes().Get(SemIR::NameScopeId::Package).has_error()); -} - -// Imports all other packages (excluding the current package). -static auto ImportOtherPackages(Context& context, UnitInfo& unit_info, - int total_ir_count, - SemIR::TypeId namespace_type_id) -> void { - // api_imports_list is initially the size of the current file's imports, - // including for API files, for simplicity in iteration. It's only really used - // when processing an implementation file, in order to combine the API file - // imports. - // - // For packages imported by the API file, the IdentifierId is the package name - // and the index is into the API's import list. Otherwise, the initial - // {Invalid, -1} state remains. - llvm::SmallVector> api_imports_list; - api_imports_list.resize(unit_info.package_imports.size(), - {IdentifierId::Invalid, -1}); - - // When there's an API file, add the mapping to api_imports_list. - if (unit_info.api_for_impl) { - const auto& api_identifiers = - unit_info.api_for_impl->unit->value_stores->identifiers(); - auto& impl_identifiers = unit_info.unit->value_stores->identifiers(); - - for (auto [api_imports_index, api_imports] : - llvm::enumerate(unit_info.api_for_impl->package_imports)) { - // Skip the current package. - if (!api_imports.package_id.is_valid()) { - continue; - } - // Translate the package ID from the API file to the implementation file. - auto impl_package_id = - impl_identifiers.Add(api_identifiers.Get(api_imports.package_id)); - if (auto lookup = unit_info.package_imports_map.Lookup(impl_package_id)) { - // On a hit, replace the entry to unify the API and implementation - // imports. - api_imports_list[lookup.value()] = {impl_package_id, api_imports_index}; - } else { - // On a miss, add the package as API-only. - api_imports_list.push_back({impl_package_id, api_imports_index}); - } - } - } - - for (auto [i, api_imports_entry] : llvm::enumerate(api_imports_list)) { - // These variables are updated after figuring out which imports are present. - auto import_decl_id = SemIR::InstId::Invalid; - IdentifierId package_id = IdentifierId::Invalid; - bool has_load_error = false; - - // Identify the local package imports if present. - UnitInfo::PackageImports* local_imports = nullptr; - if (i < unit_info.package_imports.size()) { - local_imports = &unit_info.package_imports[i]; - if (!local_imports->package_id.is_valid()) { - // Skip the current package. - continue; - } - import_decl_id = local_imports->import_decl_id; - - package_id = local_imports->package_id; - has_load_error |= local_imports->has_load_error; - } - - // Identify the API package imports if present. - UnitInfo::PackageImports* api_imports = nullptr; - if (api_imports_entry.second != -1) { - api_imports = - &unit_info.api_for_impl->package_imports[api_imports_entry.second]; - - if (local_imports) { - CARBON_CHECK(package_id == api_imports_entry.first); - } else { - auto import_ir_inst_id = context.import_ir_insts().Add( - {.ir_id = SemIR::ImportIRId::ApiForImpl, - .inst_id = api_imports->import_decl_id}); - import_decl_id = - context.AddInst(context.MakeImportedLocAndInst( - import_ir_inst_id, {.package_id = SemIR::NameId::ForIdentifier( - api_imports_entry.first)})); - package_id = api_imports_entry.first; - } - has_load_error |= api_imports->has_load_error; - } - - // Do the actual import. - ImportLibrariesFromOtherPackage( - context, namespace_type_id, import_decl_id, package_id, - CollectTransitiveImports(import_decl_id, local_imports, api_imports, - total_ir_count), - has_load_error); - } -} - -// Add imports to the root block. -static auto InitPackageScopeAndImports(Context& context, UnitInfo& unit_info, - int total_ir_count) -> void { - // First create the constant values map for all imported IRs. We'll populate - // these with mappings for namespaces as we go. - size_t num_irs = 0; - for (auto& package_imports : unit_info.package_imports) { - num_irs += package_imports.imports.size(); - } - if (!unit_info.api_for_impl) { - // Leave an empty slot for ImportIRId::ApiForImpl. - ++num_irs; - } - - context.import_irs().Reserve(num_irs); - context.import_ir_constant_values().reserve(num_irs); - - context.SetTotalIRCount(total_ir_count); - - // Importing makes many namespaces, so only canonicalize the type once. - auto namespace_type_id = - context.GetSingletonType(SemIR::NamespaceType::SingletonInstId); - - // Define the package scope, with an instruction for `package` expressions to - // reference. - auto package_scope_id = context.name_scopes().Add( - SemIR::Namespace::PackageInstId, SemIR::NameId::PackageNamespace, - SemIR::NameScopeId::Invalid); - CARBON_CHECK(package_scope_id == SemIR::NameScopeId::Package); - - auto package_inst_id = context.AddInst( - Parse::NodeId::Invalid, {.type_id = namespace_type_id, - .name_scope_id = SemIR::NameScopeId::Package, - .import_id = SemIR::InstId::Invalid}); - CARBON_CHECK(package_inst_id == SemIR::Namespace::PackageInstId); - - // If there is an implicit `api` import, set it first so that it uses the - // ImportIRId::ApiForImpl when processed for imports. - if (unit_info.api_for_impl) { - const auto& names = context.parse_tree().packaging_decl()->names; - auto import_decl_id = context.AddInst( - names.node_id, - {.package_id = SemIR::NameId::ForIdentifier(names.package_id)}); - SetApiImportIR(context, {.decl_id = import_decl_id, - .is_export = false, - .sem_ir = unit_info.api_for_impl->unit->sem_ir}); - } else { - SetApiImportIR(context, - {.decl_id = SemIR::InstId::Invalid, .sem_ir = nullptr}); - } - - // Add import instructions for everything directly imported. Implicit imports - // are handled separately. - for (auto& package_imports : unit_info.package_imports) { - CARBON_CHECK(!package_imports.import_decl_id.is_valid()); - package_imports.import_decl_id = context.AddInst( - package_imports.node_id, {.package_id = SemIR::NameId::ForIdentifier( - package_imports.package_id)}); - } - - // Process the imports. - if (unit_info.api_for_impl) { - ImportApiFile(context, namespace_type_id, - *unit_info.api_for_impl->unit->sem_ir); - } - ImportCurrentPackage(context, unit_info, total_ir_count, package_inst_id, - namespace_type_id); - CARBON_CHECK(context.scope_stack().PeekIndex() == ScopeIndex::Package); - ImportOtherPackages(context, unit_info, total_ir_count, namespace_type_id); -} - -// Checks that each required definition is available. If the definition can be -// generated by resolving a specific, does so, otherwise emits a diagnostic for -// each declaration in context.definitions_required() that doesn't have a -// definition. -static auto CheckRequiredDefinitions(Context& context, - Context::DiagnosticEmitter& emitter) - -> void { - CARBON_DIAGNOSTIC(MissingDefinitionInImpl, Error, - "no definition found for declaration in impl file"); - // Note that more required definitions can be added during this loop. - for (size_t i = 0; i != context.definitions_required().size(); ++i) { - SemIR::InstId decl_inst_id = context.definitions_required()[i]; - SemIR::Inst decl_inst = context.insts().Get(decl_inst_id); - CARBON_KIND_SWITCH(context.insts().Get(decl_inst_id)) { - case CARBON_KIND(SemIR::ClassDecl class_decl): { - if (!context.classes().Get(class_decl.class_id).is_defined()) { - emitter.Emit(decl_inst_id, MissingDefinitionInImpl); - } - break; - } - case CARBON_KIND(SemIR::FunctionDecl function_decl): { - if (context.functions().Get(function_decl.function_id).definition_id == - SemIR::InstId::Invalid) { - emitter.Emit(decl_inst_id, MissingDefinitionInImpl); - } - break; - } - case CARBON_KIND(SemIR::ImplDecl impl_decl): { - if (!context.impls().Get(impl_decl.impl_id).is_defined()) { - emitter.Emit(decl_inst_id, MissingDefinitionInImpl); - } - break; - } - case SemIR::InterfaceDecl::Kind: { - // TODO: Handle `interface` as well, once we can test it without - // triggering - // https://github.com/carbon-language/carbon-lang/issues/4071. - CARBON_FATAL("TODO: Support interfaces in DiagnoseMissingDefinitions"); - } - case CARBON_KIND(SemIR::SpecificFunction specific_function): { - if (!ResolveSpecificDefinition(context, - specific_function.specific_id)) { - CARBON_DIAGNOSTIC(MissingGenericFunctionDefinition, Error, - "use of undefined generic function"); - CARBON_DIAGNOSTIC(MissingGenericFunctionDefinitionHere, Note, - "generic function declared here"); - auto generic_decl_id = - context.generics() - .Get(context.specifics() - .Get(specific_function.specific_id) - .generic_id) - .decl_id; - emitter.Build(decl_inst_id, MissingGenericFunctionDefinition) - .Note(generic_decl_id, MissingGenericFunctionDefinitionHere) - .Emit(); - } - break; - } - default: { - CARBON_FATAL("Unexpected inst in definitions_required: {0}", decl_inst); - } - } - } -} - -// Loops over all nodes in the tree. On some errors, this may return early, -// for example if an unrecoverable state is encountered. -// NOLINTNEXTLINE(readability-function-size) -static auto ProcessNodeIds(Context& context, llvm::raw_ostream* vlog_stream, - ErrorTrackingDiagnosticConsumer& err_tracker, - Parse::NodeLocConverter& converter) -> bool { - NodeIdTraversal traversal(context, vlog_stream); - - Parse::NodeId node_id = Parse::NodeId::Invalid; - - // On crash, report which token we were handling. - PrettyStackTraceFunction node_dumper([&](llvm::raw_ostream& output) { - auto loc = converter.ConvertLoc( - node_id, [](DiagnosticLoc, const DiagnosticBase<>&) {}); - loc.FormatLocation(output); - output << ": checking " << context.parse_tree().node_kind(node_id) << "\n"; - // Crash output has a tab indent; try to indent slightly past that. - loc.FormatSnippet(output, /*indent=*/10); - }); - - while (auto maybe_node_id = traversal.Next()) { - node_id = *maybe_node_id; - auto parse_kind = context.parse_tree().node_kind(node_id); - - switch (parse_kind) { -#define CARBON_PARSE_NODE_KIND(Name) \ - case Parse::NodeKind::Name: { \ - if (!HandleParseNode(context, Parse::Name##Id(node_id))) { \ - CARBON_CHECK(err_tracker.seen_error(), \ - "Handle" #Name \ - " returned false without printing a diagnostic"); \ - return false; \ - } \ - break; \ - } -#include "toolchain/parse/node_kind.def" - } - - traversal.Handle(parse_kind); - } - return true; -} - -// Produces and checks the IR for the provided Parse::Tree. -static auto CheckParseTree(UnitInfo& unit_info, int total_ir_count, - llvm::raw_ostream* vlog_stream) -> void { - Timings::ScopedTiming timing(unit_info.unit->timings, "check"); - - // We can safely mark this as checked at the start. - unit_info.is_checked = true; - - SemIR::File* sem_ir = unit_info.unit->sem_ir; - Context::DiagnosticEmitter emitter(*unit_info.unit->sem_ir_converter, - unit_info.err_tracker); - Context context(&emitter, unit_info.unit->get_parse_tree_and_subtrees, sem_ir, - vlog_stream); - PrettyStackTraceFunction context_dumper( - [&](llvm::raw_ostream& output) { context.PrintForStackDump(output); }); - - // Add a block for the file. - context.inst_block_stack().Push(); - - InitPackageScopeAndImports(context, unit_info, total_ir_count); - - // Eagerly import the impls declared in the api file to prepare to redeclare - // them. - ImportImplsFromApiFile(context); - - if (!ProcessNodeIds(context, vlog_stream, unit_info.err_tracker, - *unit_info.unit->node_converter)) { - context.sem_ir().set_has_errors(true); - return; - } - - CheckRequiredDefinitions(context, emitter); - - context.Finalize(); - - context.VerifyOnFinish(); - - sem_ir->set_has_errors(unit_info.err_tracker.seen_error()); - -#ifndef NDEBUG - if (auto verify = sem_ir->Verify(); !verify.ok()) { - CARBON_FATAL("{0}Built invalid semantics IR: {1}\n", *sem_ir, - verify.error()); - } -#endif -} - // The package and library names, used as map keys. using ImportKey = std::pair; // Returns a key form of the package object. file_package_id is only used for // imports, not the main package declaration; as a consequence, it will be // invalid for the main package declaration. -static auto GetImportKey(UnitInfo& unit_info, IdentifierId file_package_id, +static auto GetImportKey(UnitAndImports& unit_info, + IdentifierId file_package_id, Parse::Tree::PackagingNames names) -> ImportKey { auto* stores = unit_info.unit->value_stores; llvm::StringRef package_name = @@ -566,10 +58,10 @@ static auto RenderImportKey(ImportKey import_key) -> std::string { // // The ID comparisons between the import and unit are okay because they both // come from the same file. -static auto TrackImport(Map& api_map, +static auto TrackImport(Map& api_map, Map* explicit_import_map, - UnitInfo& unit_info, Parse::Tree::PackagingNames import) - -> void { + UnitAndImports& unit_info, + Parse::Tree::PackagingNames import) -> void { const auto& packaging = unit_info.parse_tree().packaging_decl(); IdentifierId file_package_id = @@ -670,17 +162,17 @@ static auto TrackImport(Map& api_map, auto create_imports = [&]() -> int32_t { int32_t index = unit_info.package_imports.size(); unit_info.package_imports.push_back( - UnitInfo::PackageImports(import.package_id, import.node_id)); + PackageImports(import.package_id, import.node_id)); return index; }; auto insert_result = unit_info.package_imports_map.Insert(import.package_id, create_imports); - UnitInfo::PackageImports& package_imports = + PackageImports& package_imports = unit_info.package_imports[insert_result.value()]; if (auto api_lookup = api_map.Lookup(import_key)) { // Add references between the file and imported api. - UnitInfo* api = api_lookup.value(); + UnitAndImports* api = api_lookup.value(); package_imports.imports.push_back({import, api}); ++unit_info.imports_remaining; api->incoming_imports.push_back(&unit_info); @@ -713,8 +205,9 @@ static auto TrackImport(Map& api_map, // related to the packaging because the strings are loaded as part of getting // the ImportKey (which we then do for `impl` files too). static auto BuildApiMapAndDiagnosePackaging( - llvm::MutableArrayRef unit_infos) -> Map { - Map api_map; + llvm::MutableArrayRef unit_infos) + -> Map { + Map api_map; for (auto& unit_info : unit_infos) { const auto& packaging = unit_info.parse_tree().packaging_decl(); // An import key formed from the `package` or `library` declaration. Or, for @@ -803,19 +296,19 @@ static auto BuildApiMapAndDiagnosePackaging( auto CheckParseTrees(llvm::MutableArrayRef units, bool prelude_import, llvm::raw_ostream* vlog_stream) -> void { - // UnitInfo is big due to its SmallVectors, so we default to 0 on the + // UnitAndImports is big due to its SmallVectors, so we default to 0 on the // stack. - llvm::SmallVector unit_infos; + llvm::SmallVector unit_infos; unit_infos.reserve(units.size()); for (auto [i, unit] : llvm::enumerate(units)) { unit_infos.emplace_back(SemIR::CheckIRId(i), unit); } - Map api_map = + Map api_map = BuildApiMapAndDiagnosePackaging(unit_infos); // Mark down imports for all files. - llvm::SmallVector ready_to_check; + llvm::SmallVector ready_to_check; ready_to_check.reserve(units.size()); for (auto& unit_info : unit_infos) { const auto& packaging = unit_info.parse_tree().packaging_decl(); @@ -857,7 +350,7 @@ auto CheckParseTrees(llvm::MutableArrayRef units, bool prelude_import, for (int check_index = 0; check_index < static_cast(ready_to_check.size()); ++check_index) { auto* unit_info = ready_to_check[check_index]; - CheckParseTree(*unit_info, units.size(), vlog_stream); + CheckUnit(unit_info, units.size(), vlog_stream).Run(); for (auto* incoming_import : unit_info->incoming_imports) { --incoming_import->imports_remaining; if (incoming_import->imports_remaining == 0) { @@ -904,7 +397,7 @@ auto CheckParseTrees(llvm::MutableArrayRef units, bool prelude_import, // incomplete imports. for (auto& unit_info : unit_infos) { if (unit_info.imports_remaining > 0) { - CheckParseTree(unit_info, units.size(), vlog_stream); + CheckUnit(&unit_info, units.size(), vlog_stream).Run(); } } } diff --git a/toolchain/check/check.h b/toolchain/check/check.h index fdce0495f913a..5820d8030e745 100644 --- a/toolchain/check/check.h +++ b/toolchain/check/check.h @@ -10,8 +10,6 @@ #include "toolchain/base/timings.h" #include "toolchain/check/sem_ir_diagnostic_converter.h" #include "toolchain/diagnostics/diagnostic_emitter.h" -#include "toolchain/lex/tokenized_buffer.h" -#include "toolchain/parse/tree.h" #include "toolchain/parse/tree_and_subtrees.h" #include "toolchain/sem_ir/file.h" diff --git a/toolchain/check/check_unit.cpp b/toolchain/check/check_unit.cpp new file mode 100644 index 0000000000000..3d3e8d4bd8d64 --- /dev/null +++ b/toolchain/check/check_unit.cpp @@ -0,0 +1,430 @@ +// Part of the Carbon Language project, under the Apache License v2.0 with LLVM +// Exceptions. See /LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +#include "toolchain/check/check_unit.h" + +#include "toolchain/base/kind_switch.h" +#include "toolchain/base/pretty_stack_trace_function.h" +#include "toolchain/check/generic.h" +#include "toolchain/check/handle.h" +#include "toolchain/check/import.h" +#include "toolchain/check/import_ref.h" +#include "toolchain/check/node_id_traversal.h" + +namespace Carbon::Check { + +// Returns the number of imported IRs, to assist in Context construction. +static auto GetImportedIRCount(UnitAndImports* unit_and_imports) -> int { + int count = 0; + for (auto& package_imports : unit_and_imports->package_imports) { + count += package_imports.imports.size(); + } + if (!unit_and_imports->api_for_impl) { + // Leave an empty slot for ImportIRId::ApiForImpl. + ++count; + } + return count; +} + +CheckUnit::CheckUnit(UnitAndImports* unit_and_imports, int total_ir_count, + llvm::raw_ostream* vlog_stream) + : unit_and_imports_(unit_and_imports), + total_ir_count_(total_ir_count), + vlog_stream_(vlog_stream), + emitter_(*unit_and_imports_->unit->sem_ir_converter, + unit_and_imports_->err_tracker), + context_(&emitter_, unit_and_imports_->unit->get_parse_tree_and_subtrees, + unit_and_imports_->unit->sem_ir, + GetImportedIRCount(unit_and_imports), total_ir_count, + vlog_stream) {} + +auto CheckUnit::Run() -> void { + Timings::ScopedTiming timing(unit_and_imports_->unit->timings, "check"); + + // We can safely mark this as checked at the start. + unit_and_imports_->is_checked = true; + + PrettyStackTraceFunction context_dumper( + [&](llvm::raw_ostream& output) { context_.PrintForStackDump(output); }); + + // Add a block for the file. + context_.inst_block_stack().Push(); + + InitPackageScopeAndImports(); + + // Eagerly import the impls declared in the api file to prepare to redeclare + // them. + ImportImplsFromApiFile(context_); + + if (!ProcessNodeIds()) { + context_.sem_ir().set_has_errors(true); + return; + } + + CheckRequiredDefinitions(); + + context_.Finalize(); + + context_.VerifyOnFinish(); + + context_.sem_ir().set_has_errors(unit_and_imports_->err_tracker.seen_error()); + +#ifndef NDEBUG + if (auto verify = context_.sem_ir().Verify(); !verify.ok()) { + CARBON_FATAL("{0}Built invalid semantics IR: {1}\n", context_.sem_ir(), + verify.error()); + } +#endif +} + +auto CheckUnit::InitPackageScopeAndImports() -> void { + // Importing makes many namespaces, so only canonicalize the type once. + auto namespace_type_id = + context_.GetSingletonType(SemIR::NamespaceType::SingletonInstId); + + // Define the package scope, with an instruction for `package` expressions to + // reference. + auto package_scope_id = context_.name_scopes().Add( + SemIR::Namespace::PackageInstId, SemIR::NameId::PackageNamespace, + SemIR::NameScopeId::Invalid); + CARBON_CHECK(package_scope_id == SemIR::NameScopeId::Package); + + auto package_inst_id = context_.AddInst( + Parse::NodeId::Invalid, {.type_id = namespace_type_id, + .name_scope_id = SemIR::NameScopeId::Package, + .import_id = SemIR::InstId::Invalid}); + CARBON_CHECK(package_inst_id == SemIR::Namespace::PackageInstId); + + // If there is an implicit `api` import, set it first so that it uses the + // ImportIRId::ApiForImpl when processed for imports. + if (unit_and_imports_->api_for_impl) { + const auto& names = context_.parse_tree().packaging_decl()->names; + auto import_decl_id = context_.AddInst( + names.node_id, + {.package_id = SemIR::NameId::ForIdentifier(names.package_id)}); + SetApiImportIR(context_, + {.decl_id = import_decl_id, + .is_export = false, + .sem_ir = unit_and_imports_->api_for_impl->unit->sem_ir}); + } else { + SetApiImportIR(context_, + {.decl_id = SemIR::InstId::Invalid, .sem_ir = nullptr}); + } + + // Add import instructions for everything directly imported. Implicit imports + // are handled separately. + for (auto& package_imports : unit_and_imports_->package_imports) { + CARBON_CHECK(!package_imports.import_decl_id.is_valid()); + package_imports.import_decl_id = context_.AddInst( + package_imports.node_id, {.package_id = SemIR::NameId::ForIdentifier( + package_imports.package_id)}); + } + + // Process the imports. + if (unit_and_imports_->api_for_impl) { + ImportApiFile(context_, namespace_type_id, + *unit_and_imports_->api_for_impl->unit->sem_ir); + } + ImportCurrentPackage(package_inst_id, namespace_type_id); + CARBON_CHECK(context_.scope_stack().PeekIndex() == ScopeIndex::Package); + ImportOtherPackages(namespace_type_id); +} + +auto CheckUnit::CollectDirectImports( + llvm::SmallVector& results, + llvm::MutableArrayRef ir_to_result_index, SemIR::InstId import_decl_id, + const PackageImports& imports, bool is_local) -> void { + for (const auto& import : imports.imports) { + const auto& direct_ir = *import.unit_info->unit->sem_ir; + auto& index = ir_to_result_index[direct_ir.check_ir_id().index]; + if (index != -1) { + // This should only happen when doing API imports for an implementation + // file. Don't change the entry; is_export doesn't matter. + continue; + } + index = results.size(); + results.push_back({.decl_id = import_decl_id, + // Only tag exports in API files, ignoring the value in + // implementation files. + .is_export = is_local && import.names.is_export, + .sem_ir = &direct_ir}); + } +} + +auto CheckUnit::CollectTransitiveImports(SemIR::InstId import_decl_id, + const PackageImports* local_imports, + const PackageImports* api_imports) + -> llvm::SmallVector { + llvm::SmallVector results; + + // Track whether an IR was imported in full, including `export import`. This + // distinguishes from IRs that are indirectly added without all names being + // exported to this IR. + llvm::SmallVector ir_to_result_index(total_ir_count_, -1); + + // First add direct imports. This means that if an entity is imported both + // directly and indirectly, the import path will reflect the direct import. + if (local_imports) { + CollectDirectImports(results, ir_to_result_index, import_decl_id, + *local_imports, + /*is_local=*/true); + } + if (api_imports) { + CollectDirectImports(results, ir_to_result_index, import_decl_id, + *api_imports, + /*is_local=*/false); + } + + // Loop through direct imports for any indirect exports. The underlying vector + // is appended during iteration, so take the size first. + const int direct_imports = results.size(); + for (int direct_index : llvm::seq(direct_imports)) { + bool is_export = results[direct_index].is_export; + + for (const auto& indirect_ir : + results[direct_index].sem_ir->import_irs().array_ref()) { + if (!indirect_ir.is_export) { + continue; + } + + auto& indirect_index = + ir_to_result_index[indirect_ir.sem_ir->check_ir_id().index]; + if (indirect_index == -1) { + indirect_index = results.size(); + // TODO: In the case of a recursive `export import`, this only points at + // the outermost import. May want something that better reflects the + // recursion. + results.push_back({.decl_id = results[direct_index].decl_id, + .is_export = is_export, + .sem_ir = indirect_ir.sem_ir}); + } else if (is_export) { + results[indirect_index].is_export = true; + } + } + } + + return results; +} + +auto CheckUnit::ImportCurrentPackage(SemIR::InstId package_inst_id, + SemIR::TypeId namespace_type_id) -> void { + // Add imports from the current package. + auto import_map_lookup = + unit_and_imports_->package_imports_map.Lookup(IdentifierId::Invalid); + if (!import_map_lookup) { + // Push the scope; there are no names to add. + context_.scope_stack().Push(package_inst_id, SemIR::NameScopeId::Package); + return; + } + PackageImports& self_import = + unit_and_imports_->package_imports[import_map_lookup.value()]; + + if (self_import.has_load_error) { + context_.name_scopes().Get(SemIR::NameScopeId::Package).set_has_error(); + } + + ImportLibrariesFromCurrentPackage( + context_, namespace_type_id, + CollectTransitiveImports(self_import.import_decl_id, &self_import, + /*api_imports=*/nullptr)); + + context_.scope_stack().Push( + package_inst_id, SemIR::NameScopeId::Package, SemIR::SpecificId::Invalid, + context_.name_scopes().Get(SemIR::NameScopeId::Package).has_error()); +} + +auto CheckUnit::ImportOtherPackages(SemIR::TypeId namespace_type_id) -> void { + // api_imports_list is initially the size of the current file's imports, + // including for API files, for simplicity in iteration. It's only really used + // when processing an implementation file, in order to combine the API file + // imports. + // + // For packages imported by the API file, the IdentifierId is the package name + // and the index is into the API's import list. Otherwise, the initial + // {Invalid, -1} state remains. + llvm::SmallVector> api_imports_list; + api_imports_list.resize(unit_and_imports_->package_imports.size(), + {IdentifierId::Invalid, -1}); + + // When there's an API file, add the mapping to api_imports_list. + if (unit_and_imports_->api_for_impl) { + const auto& api_identifiers = + unit_and_imports_->api_for_impl->unit->value_stores->identifiers(); + auto& impl_identifiers = + unit_and_imports_->unit->value_stores->identifiers(); + + for (auto [api_imports_index, api_imports] : + llvm::enumerate(unit_and_imports_->api_for_impl->package_imports)) { + // Skip the current package. + if (!api_imports.package_id.is_valid()) { + continue; + } + // Translate the package ID from the API file to the implementation file. + auto impl_package_id = + impl_identifiers.Add(api_identifiers.Get(api_imports.package_id)); + if (auto lookup = + unit_and_imports_->package_imports_map.Lookup(impl_package_id)) { + // On a hit, replace the entry to unify the API and implementation + // imports. + api_imports_list[lookup.value()] = {impl_package_id, api_imports_index}; + } else { + // On a miss, add the package as API-only. + api_imports_list.push_back({impl_package_id, api_imports_index}); + } + } + } + + for (auto [i, api_imports_entry] : llvm::enumerate(api_imports_list)) { + // These variables are updated after figuring out which imports are present. + auto import_decl_id = SemIR::InstId::Invalid; + IdentifierId package_id = IdentifierId::Invalid; + bool has_load_error = false; + + // Identify the local package imports if present. + PackageImports* local_imports = nullptr; + if (i < unit_and_imports_->package_imports.size()) { + local_imports = &unit_and_imports_->package_imports[i]; + if (!local_imports->package_id.is_valid()) { + // Skip the current package. + continue; + } + import_decl_id = local_imports->import_decl_id; + + package_id = local_imports->package_id; + has_load_error |= local_imports->has_load_error; + } + + // Identify the API package imports if present. + PackageImports* api_imports = nullptr; + if (api_imports_entry.second != -1) { + api_imports = &unit_and_imports_->api_for_impl + ->package_imports[api_imports_entry.second]; + + if (local_imports) { + CARBON_CHECK(package_id == api_imports_entry.first); + } else { + auto import_ir_inst_id = context_.import_ir_insts().Add( + {.ir_id = SemIR::ImportIRId::ApiForImpl, + .inst_id = api_imports->import_decl_id}); + import_decl_id = + context_.AddInst(context_.MakeImportedLocAndInst( + import_ir_inst_id, {.package_id = SemIR::NameId::ForIdentifier( + api_imports_entry.first)})); + package_id = api_imports_entry.first; + } + has_load_error |= api_imports->has_load_error; + } + + // Do the actual import. + ImportLibrariesFromOtherPackage( + context_, namespace_type_id, import_decl_id, package_id, + CollectTransitiveImports(import_decl_id, local_imports, api_imports), + has_load_error); + } +} + +// Loops over all nodes in the tree. On some errors, this may return early, +// for example if an unrecoverable state is encountered. +// NOLINTNEXTLINE(readability-function-size) +auto CheckUnit::ProcessNodeIds() -> bool { + NodeIdTraversal traversal(context_, vlog_stream_); + + Parse::NodeId node_id = Parse::NodeId::Invalid; + + // On crash, report which token we were handling. + PrettyStackTraceFunction node_dumper([&](llvm::raw_ostream& output) { + auto loc = unit_and_imports_->unit->node_converter->ConvertLoc( + node_id, [](DiagnosticLoc, const DiagnosticBase<>&) {}); + loc.FormatLocation(output); + output << ": checking " << context_.parse_tree().node_kind(node_id) << "\n"; + // Crash output has a tab indent; try to indent slightly past that. + loc.FormatSnippet(output, /*indent=*/10); + }); + + while (auto maybe_node_id = traversal.Next()) { + node_id = *maybe_node_id; + auto parse_kind = context_.parse_tree().node_kind(node_id); + + bool result; + switch (parse_kind) { +#define CARBON_PARSE_NODE_KIND(Name) \ + case Parse::NodeKind::Name: { \ + result = HandleParseNode(context_, Parse::Name##Id(node_id)); \ + break; \ + } +#include "toolchain/parse/node_kind.def" + } + + if (!result) { + CARBON_CHECK( + unit_and_imports_->err_tracker.seen_error(), + "HandleParseNode for `{0}` returned false without diagnosing.", + parse_kind); + return false; + } + traversal.Handle(parse_kind); + } + return true; +} + +auto CheckUnit::CheckRequiredDefinitions() -> void { + CARBON_DIAGNOSTIC(MissingDefinitionInImpl, Error, + "no definition found for declaration in impl file"); + // Note that more required definitions can be added during this loop. + for (size_t i = 0; i != context_.definitions_required().size(); ++i) { + SemIR::InstId decl_inst_id = context_.definitions_required()[i]; + SemIR::Inst decl_inst = context_.insts().Get(decl_inst_id); + CARBON_KIND_SWITCH(context_.insts().Get(decl_inst_id)) { + case CARBON_KIND(SemIR::ClassDecl class_decl): { + if (!context_.classes().Get(class_decl.class_id).is_defined()) { + emitter_.Emit(decl_inst_id, MissingDefinitionInImpl); + } + break; + } + case CARBON_KIND(SemIR::FunctionDecl function_decl): { + if (context_.functions().Get(function_decl.function_id).definition_id == + SemIR::InstId::Invalid) { + emitter_.Emit(decl_inst_id, MissingDefinitionInImpl); + } + break; + } + case CARBON_KIND(SemIR::ImplDecl impl_decl): { + if (!context_.impls().Get(impl_decl.impl_id).is_defined()) { + emitter_.Emit(decl_inst_id, MissingDefinitionInImpl); + } + break; + } + case SemIR::InterfaceDecl::Kind: { + // TODO: Handle `interface` as well, once we can test it without + // triggering + // https://github.com/carbon-language/carbon-lang/issues/4071. + CARBON_FATAL("TODO: Support interfaces in DiagnoseMissingDefinitions"); + } + case CARBON_KIND(SemIR::SpecificFunction specific_function): { + if (!ResolveSpecificDefinition(context_, + specific_function.specific_id)) { + CARBON_DIAGNOSTIC(MissingGenericFunctionDefinition, Error, + "use of undefined generic function"); + CARBON_DIAGNOSTIC(MissingGenericFunctionDefinitionHere, Note, + "generic function declared here"); + auto generic_decl_id = + context_.generics() + .Get(context_.specifics() + .Get(specific_function.specific_id) + .generic_id) + .decl_id; + emitter_.Build(decl_inst_id, MissingGenericFunctionDefinition) + .Note(generic_decl_id, MissingGenericFunctionDefinitionHere) + .Emit(); + } + break; + } + default: { + CARBON_FATAL("Unexpected inst in definitions_required: {0}", decl_inst); + } + } + } +} + +} // namespace Carbon::Check diff --git a/toolchain/check/check_unit.h b/toolchain/check/check_unit.h new file mode 100644 index 0000000000000..2aba6799aa048 --- /dev/null +++ b/toolchain/check/check_unit.h @@ -0,0 +1,153 @@ +// Part of the Carbon Language project, under the Apache License v2.0 with LLVM +// Exceptions. See /LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +#ifndef CARBON_TOOLCHAIN_CHECK_CHECK_UNIT_H_ +#define CARBON_TOOLCHAIN_CHECK_CHECK_UNIT_H_ + +#include "common/map.h" +#include "llvm/ADT/SmallVector.h" +#include "toolchain/check/check.h" +#include "toolchain/check/context.h" +#include "toolchain/parse/tree_node_diagnostic_converter.h" +#include "toolchain/sem_ir/ids.h" + +namespace Carbon::Check { + +struct UnitAndImports; + +// A file's imports corresponding to a single package, for +// `UnitAndImports::package_imports`. +struct PackageImports { + // A given import within the file, with its destination. + struct Import { + Parse::Tree::PackagingNames names; + UnitAndImports* unit_info; + }; + + // Use the constructor so that the SmallVector is only constructed + // as-needed. + explicit PackageImports(IdentifierId package_id, Parse::ImportDeclId node_id) + : package_id(package_id), node_id(node_id) {} + + // The identifier of the imported package. + IdentifierId package_id; + // The first `import` declaration in the file, which declared the package's + // identifier (even if the import failed). Used for associating diagnostics + // not specific to a single import. + Parse::ImportDeclId node_id; + // The associated `import` instruction. Only valid once a file is checked. + SemIR::InstId import_decl_id = SemIR::InstId::Invalid; + // Whether there's an import that failed to load. + bool has_load_error = false; + // The list of valid imports. + llvm::SmallVector imports; +}; + +// Contains information accumulated while checking a `Unit` (primarily import +// information), in addition to the `Unit` itself. +struct UnitAndImports { + explicit UnitAndImports(SemIR::CheckIRId check_ir_id, Unit& unit) + : check_ir_id(check_ir_id), + unit(&unit), + err_tracker(*unit.consumer), + emitter(*unit.node_converter, err_tracker) {} + + auto parse_tree() -> const Parse::Tree& { return unit->sem_ir->parse_tree(); } + auto source() -> const SourceBuffer& { + return parse_tree().tokens().source(); + } + + SemIR::CheckIRId check_ir_id; + Unit* unit; + + // Emitter information. + ErrorTrackingDiagnosticConsumer err_tracker; + DiagnosticEmitter emitter; + + // List of the outgoing imports. If a package includes unavailable library + // imports, it has an entry with has_load_error set. Invalid imports (for + // example, `import Main;`) aren't added because they won't add identifiers to + // name lookup. + llvm::SmallVector package_imports; + + // A map of the package names to the outgoing imports above. + Map package_imports_map; + + // The remaining number of imports which must be checked before this unit can + // be processed. + int32_t imports_remaining = 0; + + // A list of incoming imports. This will be empty for `impl` files, because + // imports only touch `api` files. + llvm::SmallVector incoming_imports; + + // The corresponding `api` unit if this is an `impl` file. The entry should + // also be in the corresponding `PackageImports`. + UnitAndImports* api_for_impl = nullptr; + + // Whether the unit has been checked. + bool is_checked = false; +}; + +// Handles checking of a single unit. Requires that all dependencies have been +// checked. +// +// This mainly splits out the single-unit logic from the higher level cross-unit +// logic in check.cpp. +class CheckUnit { + public: + explicit CheckUnit(UnitAndImports* unit_and_imports, int total_ir_count, + llvm::raw_ostream* vlog_stream); + + // Produces and checks the IR for the provided unit. + auto Run() -> void; + + private: + // Add imports to the root block. + auto InitPackageScopeAndImports() -> void; + + // Collects direct imports, for CollectTransitiveImports. + auto CollectDirectImports(llvm::SmallVector& results, + llvm::MutableArrayRef ir_to_result_index, + SemIR::InstId import_decl_id, + const PackageImports& imports, bool is_local) + -> void; + + // Collects transitive imports, handling deduplication. These will be unified + // between local_imports and api_imports. + auto CollectTransitiveImports(SemIR::InstId import_decl_id, + const PackageImports* local_imports, + const PackageImports* api_imports) + -> llvm::SmallVector; + + // Imports the current package. + auto ImportCurrentPackage(SemIR::InstId package_inst_id, + SemIR::TypeId namespace_type_id) -> void; + + // Imports all other packages (excluding the current package). + auto ImportOtherPackages(SemIR::TypeId namespace_type_id) -> void; + + // Checks that each required definition is available. If the definition can be + // generated by resolving a specific, does so, otherwise emits a diagnostic + // for each declaration in context.definitions_required() that doesn't have a + // definition. + auto CheckRequiredDefinitions() -> void; + + // Loops over all nodes in the tree. On some errors, this may return early, + // for example if an unrecoverable state is encountered. + // NOLINTNEXTLINE(readability-function-size) + auto ProcessNodeIds() -> bool; + + UnitAndImports* unit_and_imports_; + // The number of IRs being checked in total. + int total_ir_count_; + llvm::raw_ostream* vlog_stream_; + + Context::DiagnosticEmitter emitter_; + Context context_; +}; + +} // namespace Carbon::Check + +#endif // CARBON_TOOLCHAIN_CHECK_CHECK_UNIT_H_ diff --git a/toolchain/check/context.cpp b/toolchain/check/context.cpp index d4f7dd01a53b0..5bb666cd0e401 100644 --- a/toolchain/check/context.cpp +++ b/toolchain/check/context.cpp @@ -41,7 +41,8 @@ namespace Carbon::Check { Context::Context(DiagnosticEmitter* emitter, llvm::function_ref get_parse_tree_and_subtrees, - SemIR::File* sem_ir, llvm::raw_ostream* vlog_stream) + SemIR::File* sem_ir, int imported_ir_count, int total_ir_count, + llvm::raw_ostream* vlog_stream) : emitter_(emitter), get_parse_tree_and_subtrees_(get_parse_tree_and_subtrees), sem_ir_(sem_ir), @@ -54,6 +55,11 @@ Context::Context(DiagnosticEmitter* emitter, decl_name_stack_(this), scope_stack_(sem_ir_->identifiers()), global_init_(this) { + // Prepare fields which relate to the number of IRs available for import. + import_irs().Reserve(imported_ir_count); + import_ir_constant_values_.reserve(imported_ir_count); + check_ir_map_.resize(total_ir_count, SemIR::ImportIRId::Invalid); + // Map the builtin `` and `type` type constants to their corresponding // special `TypeId` values. type_ids_for_type_constants_.Insert( diff --git a/toolchain/check/context.h b/toolchain/check/context.h index cd1a02e2a0274..2b3f4afdb7ff4 100644 --- a/toolchain/check/context.h +++ b/toolchain/check/context.h @@ -72,7 +72,8 @@ class Context { explicit Context(DiagnosticEmitter* emitter, llvm::function_ref get_parse_tree_and_subtrees, - SemIR::File* sem_ir, llvm::raw_ostream* vlog_stream); + SemIR::File* sem_ir, int imported_ir_count, + int total_ir_count, llvm::raw_ostream* vlog_stream); // Marks an implementation TODO. Always returns false. auto TODO(SemIRLoc loc, std::string label) -> bool; @@ -461,13 +462,6 @@ class Context { auto Finalize() -> void; - // Sets the total number of IRs which exist. This is used to prepare a map - // from IR to imported IR. - auto SetTotalIRCount(int num_irs) -> void { - CARBON_CHECK(check_ir_map_.empty(), "SetTotalIRCount is only called once"); - check_ir_map_.resize(num_irs, SemIR::ImportIRId::Invalid); - } - // Returns the imported IR ID for an IR, or invalid if not imported. auto GetImportIRId(const SemIR::File& sem_ir) -> SemIR::ImportIRId& { return check_ir_map_[sem_ir.check_ir_id().index]; From e98995c936e8e1233d0882f85e980f5cbee305ab Mon Sep 17 00:00:00 2001 From: Jon Ross-Perkins Date: Tue, 10 Dec 2024 14:03:48 -0800 Subject: [PATCH 13/68] Update the vscode extension for publishing. (#4660) A few initial fixes just so that publishing works. https://marketplace.visualstudio.com/items?itemName=carbon-lang.carbon-vscode --- utils/vscode/images/icon.png | 1 + utils/vscode/package.json | 8 +++++--- website/prebuild.py | 3 +++ 3 files changed, 9 insertions(+), 3 deletions(-) create mode 120000 utils/vscode/images/icon.png diff --git a/utils/vscode/images/icon.png b/utils/vscode/images/icon.png new file mode 120000 index 0000000000000..88e81e887cc92 --- /dev/null +++ b/utils/vscode/images/icon.png @@ -0,0 +1 @@ +../../../website/favicon.png \ No newline at end of file diff --git a/utils/vscode/package.json b/utils/vscode/package.json index 84219b07d56ff..a56569c43007d 100644 --- a/utils/vscode/package.json +++ b/utils/vscode/package.json @@ -1,8 +1,9 @@ { - "name": "carbon-lang", - "displayName": "carbon-lang", - "description": "Carbon Language support", + "name": "carbon-vscode", + "displayName": "Carbon Language", "version": "0.0.2", + "publisher": "carbon-lang", + "description": "Carbon language support for Visual Studio Code.", "repository": { "url": "https://github.com/carbon-language/carbon-lang" }, @@ -12,6 +13,7 @@ "categories": [ "Programming Languages" ], + "icon": "images/icon.png", "activationEvents": [], "main": "./src/extension.js", "contributes": { diff --git a/website/prebuild.py b/website/prebuild.py index a7d7457863e19..17bdf86afc31c 100755 --- a/website/prebuild.py +++ b/website/prebuild.py @@ -148,6 +148,9 @@ def main() -> None: # bazel-execroot interferes with jekyll because it's a broken symlink. Path("bazel-execroot").unlink() + # This is a symlink to website/favicon.png, which is moved below. + # TODO: Consider moving the icon to a location which won't break. + Path("utils/vscode/images/icon.png").unlink() # The external symlink is created by scripts/create_compdb.py, and can # interfere with local execution. From 14724a5c9a61bbba350cfd86c6c79c9c90871263 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Tue, 10 Dec 2024 14:39:21 -0800 Subject: [PATCH 14/68] Switch from recommending a local workspace extension to recommending our published extension. (#4661) --- .vscode/extensions.json | 1 + .vscode/extensions/carbon-lang | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) delete mode 120000 .vscode/extensions/carbon-lang diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 3963f0963261d..020727541fdd7 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -2,6 +2,7 @@ "recommendations": [ "bazelbuild.vscode-bazel", "bierner.github-markdown-preview", + "carbon-lang.carbon-vscode", "esbenp.prettier-vscode", "llvm-vs-code-extensions.vscode-clangd", "ms-python.black-formatter", diff --git a/.vscode/extensions/carbon-lang b/.vscode/extensions/carbon-lang deleted file mode 120000 index caed5f9f91d98..0000000000000 --- a/.vscode/extensions/carbon-lang +++ /dev/null @@ -1 +0,0 @@ -../../utils/vscode/ \ No newline at end of file From 8e8d5705716c734879602696afa4c40226edb6d6 Mon Sep 17 00:00:00 2001 From: Geoff Romer Date: Tue, 10 Dec 2024 17:58:40 -0800 Subject: [PATCH 15/68] Proposal: Variadics (#2240) Proposes a set of core features for declaring and implementing generic variadic functions. A "pack expansion" is a syntactic unit beginning with `...`, which is a kind of compile-time loop over sequences called "packs". Packs are initialized and referred to using "pack bindings", which are marked with the `each` keyword at the point of declaration and the point of use. The syntax and behavior of a pack expansion depends on its context, and in some cases by a keyword following the `...`: - In a tuple literal expression (such as a function call argument list), `...` iteratively evaluates its operand expression, and treats the values as successive elements of the tuple. - `...and` and `...or` iteratively evaluate a boolean expression, combining the values using `and` and `or`, and ending the loop early if the underlying operator short-circuits. - In a statement context, `...` iteratively executes a statement. - In a tuple literal pattern (such as a function parameter list), `...` iteratively matches the elements of the scrutinee tuple. In conjunction with pack bindings, this enables functions to take an arbitrary number of arguments. --------- Co-authored-by: josh11b Co-authored-by: Richard Smith Co-authored-by: josh11b <15258583+josh11b@users.noreply.github.com> Co-authored-by: Chandler Carruth Co-authored-by: Carbon Infra Bot --- docs/design/variadics.md | 950 +++++++++++++++ docs/project/principles/library_apis_only.md | 16 +- proposals/p2240.md | 1136 ++++++++++++++++++ 3 files changed, 2092 insertions(+), 10 deletions(-) create mode 100644 docs/design/variadics.md create mode 100644 proposals/p2240.md diff --git a/docs/design/variadics.md b/docs/design/variadics.md new file mode 100644 index 0000000000000..0f9454ec92005 --- /dev/null +++ b/docs/design/variadics.md @@ -0,0 +1,950 @@ +# Variadics + + + + + +## Table of contents + +- [Basics](#basics) + - [Overview](#overview) + - [Packs and each-names](#packs-and-each-names) + - [Pack expansions](#pack-expansions) + - [Pack expansion expressions and statements](#pack-expansion-expressions-and-statements) + - [Pack expansion patterns](#pack-expansion-patterns) + - [Additional examples](#additional-examples) +- [Execution Semantics](#execution-semantics) + - [Expressions and statements](#expressions-and-statements) + - [Pattern matching](#pattern-matching) +- [Typechecking](#typechecking) + - [Tuples, packs, segments, and shapes](#tuples-packs-segments-and-shapes) + - [Iterative typechecking of pack expansions](#iterative-typechecking-of-pack-expansions) + - [Typechecking patterns](#typechecking-patterns) + - [Typechecking pattern matches](#typechecking-pattern-matches) +- [Appendix: Type system formalism](#appendix-type-system-formalism) + - [Explicit deduced arities](#explicit-deduced-arities) + - [Typing and shaping rules](#typing-and-shaping-rules) + - [Reduction rules](#reduction-rules) + - [Equivalence, equality, and convertibility](#equivalence-equality-and-convertibility) + - [Pattern match typechecking algorithm](#pattern-match-typechecking-algorithm) + - [Canonicalization algorithm](#canonicalization-algorithm) +- [Alternatives considered](#alternatives-considered) +- [References](#references) + + + +## Basics + +### Overview + +A "pack expansion" is a syntactic unit beginning with `...`, which is a kind of +compile-time loop over sequences called "packs". Packs are initialized and +referred to using "each-names", which are marked with the `each` keyword at the +point of declaration and the point of use. + +The syntax and behavior of a pack expansion depends on its context, and in some +cases on a keyword following the `...`: + +- In a tuple literal expression (such as a function call argument list), `...` + iteratively evaluates its operand expression, and treats the values as + successive elements of the tuple. +- `...and` and `...or` iteratively evaluate a boolean expression, combining + the values using `and` and `or`. Normal short-circuiting behavior for the + resulting `and` and `or` operators applies at runtime. +- In a statement context, `...` iteratively executes a statement. +- In a tuple literal pattern (such as a function parameter list), `...` + iteratively matches the elements of the scrutinee tuple. In conjunction with + pack bindings, this enables functions to take an arbitrary number of + arguments. + +This example illustrates many of the key concepts: + +```carbon +// Takes an arbitrary number of vectors with arbitrary element types, and +// returns a vector of tuples where the i'th element of the vector is +// a tuple of the i'th elements of the input vectors. +fn Zip[... each ElementType:! type] + (... each vector: Vector(each ElementType)) + -> Vector((... each ElementType)) { + ... var each iter: auto = each vector.Begin(); + var result: Vector((... each ElementType)); + while (...and each iter != each vector.End()) { + result.push_back((... each iter)); + ... each iter++; + } + return result; +} +``` + +### Packs and each-names + +A _pack_ is a sequence of a fixed number of values called "elements", which may +be of different types. Packs are very similar to tuple values in many ways, but +they are not first-class values -- in particular, no run-time expression +evaluates to a pack. The _arity_ of a pack is a compile-time value representing +the number of values in the sequence. + +An _each-name_ consists of the keyword `each` followed by the name of a pack, +and can only occur inside a pack expansion. On the Nth iteration of the pack +expansion, an each-name refers to the Nth element of the named pack. As a +result, a binding pattern with an each-name, such as `each ElementType:! type`, +acts as a declaration of all the elements of the named pack, and thereby +implicitly acts as a declaration of the pack itself. + +Note that `each` is part of the name syntax, not an expression operator, so it +binds more tightly than any expression syntax. For example, the loop condition +`...and each iter != each vector.End()` in the implementation of `Zip` is +equivalent to `...and (each iter) != (each vector).End()`. + +### Pack expansions + +A _pack expansion_ is an instance of one of the following syntactic forms: + +- A statement of the form "`...` _statement_". +- A tuple expression element of the form "`...` _expression_", with the same + precedence as `,`. +- A tuple pattern element of the form "`...` _pattern_", with the same + precedence as `,`. +- An implicit parameter list element of the form "`...` _pattern_", with the + same precedence as `,`. +- An expression of the form "`...` `and` _expression_" or "`...` `or` + _expression_", with the same precedence as `and` and `or`. + +The statement, expression, or pattern following the `...` (and the `and`/`or`, +if present) is called the _body_ of the expansion. + +The `...` token can also occur in a tuple expression element of the form "`...` +`expand` _expression_", with the same precedence as `,`. However, that syntax is +not considered a pack expansion, and has its own semantics: _expression_ must +have a tuple type, and "`...` `expand` _expression_" evaluates _expression_ and +treats its elements as elements of the enclosing tuple literal. This is +especially useful for using non-literal tuple values as function call arguments: + +```carbon +fn F(x: i32, y: String); +fn MakeArgs() -> (i32, String); + +F(...expand MakeArgs()); +``` + +`...and`, `...or`, and `...expand` can be trivially distinguished with one token +of lookahead, and the other meanings of `...` can be distinguished from each +other by the context they appear in. As a corollary, if the nearest enclosing +delimiters around a `...` are parentheses, they will be interpreted as forming a +tuple rather than as grouping. Thus, expressions like `(... each ElementType)` +in the above example are tuple literals, even though they don't contain commas. + +By convention, `...` is always followed by whitespace, except that `...and`, +`...or`, and `...expand` are written with no whitespace between the two tokens. +This serves to emphasize that the keyword is not part of the expansion body, but +rather a modifier on the syntax and semantics of `...`. + +All each-names in a given expansion must refer to packs with the same arity, +which we will also refer to as the arity of the expansion. If an expansion +contains no each-names, it must be a pattern, or an expression in the type +position of a binding pattern, and its arity is deduced from the scrutinee. + +A pack expansion or `...expand` expression cannot contain another pack expansion +or `...expand` expression. + +An each-name cannot be used in the same pack expansion that declares it. In most +if not all cases, an each-name that violates this rule can be changed to an +ordinary name, because each-names are only necessary when you need to transfer a +pack from one pack expansion to another. + +#### Pack expansion expressions and statements + +A pack expansion expression or statement can be thought of as a kind of loop +that executes at compile time (specifically, monomorphization time), where the +expansion body is implicitly parameterized by an integer value called the _pack +index_, which ranges from 0 to one less than the arity of the expansion. The +pack index is implicitly used as an index into the packs referred to by +each-names. This is easiest to see with statement pack expansions. For example, +if `a`, `x`, and `y` are packs with arity 3, then +`... each a += each x * each y;` is roughly equivalent to + +```carbon +a[:0:] += x[:0:] * y[:0:]; +a[:1:] += x[:1:] * y[:1:]; +a[:2:] += x[:2:] * y[:2:]; +``` + +Here we are using `[:N:]` as a hypothetical pack indexing operator for purposes +of illustration; packs cannot actually be indexed in Carbon code. + +> **Future work:** We're open to eventually adding indexing of variadics, but +> that remains future work and will need its own proposal. + +`...and` and `...or` behave like chains of the corresponding boolean operator, +so `...and F(each x, each y)` behaves like +`true and F(x[:0:], y[:0:]) and F(x[:1:], y[:1:]) and F(x[:2:], y[:2:])`. They +can also be interpreted as looping constructs, although the rewrite is less +straightforward because Carbon doesn't have a way to write a loop in an +expression context. An expression like `...and F(each x, each y)` can be thought +of as evaluating to the value of `result` after executing the following code +fragment: + +``` +var result: bool = true; +for (let i:! i32 in (0, 1, 2)) { + result = result && F(x[:i:], y[:i:]); + if (result == false) { break; } +} +``` + +`...` in a tuple literal behaves like a series of comma-separated tuple +elements, so `(... F(each x, each y))` is equivalent to +`(F(x[:0:], y[:0:]), F(x[:1:], y[:1:]), F(x[:2:], y[:2:]))`. This can't be +expressed as a loop in Carbon code, but it is still fundamentally iterative. + +#### Pack expansion patterns + +A pack expansion pattern "`...` _subpattern_" appears as part of a tuple pattern +(or an implicit parameter list), and matches a sequence of tuple elements if +each element matches _subpattern_. For example, in the signature of `Zip` shown +earlier, the parameter list consists of a single pack expansion pattern +`... each vector: Vector(each ElementType)`, and so the entire argument list +will be matched against the binding pattern +`each vector: Vector(each ElementType)`. + +Since _subpattern_ will be matched against multiple scrutinees (or none) in a +single pattern-matching operation, a binding pattern within a pack expansion +pattern must declare an each-name (such as `each vector` in the `Zip` example), +and the Nth iteration of the pack expansion will initialize the Nth element of +the named pack from the Nth scrutinee. The binding pattern's type expression may +contain an each-name (such as `each ElementType` in the `Zip` example), but if +so, it must be a deduced parameter of the enclosing pattern. + +> **Future work:** That restriction can probably be relaxed, but we currently +> don't have motivating use cases to constrain the design. + +### Additional examples + +```carbon +// Computes the sum of its arguments, which are i64s +fn SumInts(... each param: i64) -> i64 { + var sum: i64 = 0; + ... sum += each param; + return sum; +} +``` + +```carbon +// Concatenates its arguments, which are all convertible to String +fn StrCat[... each T:! ConvertibleToString](... each param: each T) -> String { + var len: i64 = 0; + ... len += each param.Length(); + var result: String = ""; + result.Reserve(len); + ... result.Append(each param.ToString()); + return result; +} +``` + +```carbon +// Returns the minimum of its arguments, which must all have the same type T. +fn Min[T:! Comparable & Value](first: T, ... each next: T) -> T { + var result: T = first; + ... if (each next < result) { + result = each next; + } + return result; +} +``` + +```carbon +// Invokes f, with the tuple `args` as its arguments. +fn Apply[... each T:! type, F:! CallableWith(... each T)] + (f: F, args: (... each T)) -> auto { + return f(...expand args); +} +``` + +```carbon +// Toy example of mixing variadic and non-variadic parameters. +// Takes an i64, any number of f64s, and then another i64. +fn MiddleVariadic(first: i64, ... each middle: f64, last: i64); +``` + +```carbon +// Toy example of using the result of variadic type deduction. +fn TupleConcat[... each T1: type, ... each T2: type]( + t1: (... each T1), t2: (... each T2)) -> (... each T1, ... each T2) { + return (...expand t1, ...expand t2); +} +``` + +## Execution Semantics + +### Expressions and statements + +In all of the following, N is the arity of the pack expansion being discussed, +and `$I` is a notional variable representing the pack index. These semantics are +implemented at monomorphization time, so the value of N is a known integer +constant. Although the value of `$I` can vary during execution, it is +nevertheless treated as a constant. + +A statement of the form "`...` _statement_" is evaluated by executing +_statement_ N times, with `$I` ranging from 0 to N - 1. + +An expression of the form "`...and` _expression_" is evaluated as follows: a +notional `bool` variable `$R` is initialized to `true`, and then "`$R = $R and` +_expression_" is executed up to N times, with `$I` ranging from 0 to N - 1. If +at any point `$R` becomes false, this iteration is terminated early. The final +value of `$R` is the value of the expression. + +An expression of the form "`...or` _expression_" is evaluated the same way, but +with `or` in place of `and`, and `true` and `false` transposed. + +A tuple expression element of the form "`...` _expression_" evaluates to a +sequence of N values, where the k'th value is the value of _operand_ where `$I` +is equal to k - 1. + +An each-name evaluates to the `$I`th value of the pack it refers to (indexed +from zero). + +### Pattern matching + +The semantics of pack expansion patterns are chosen to follow the general +principle that pattern matching is the inverse of expression evaluation, so for +example if the pattern `(... each x: auto)` matches some scrutinee value `s`, +the expression `(... each x)` should be equal to `s`. These semantics are +implemented at monomorphization time, so all types are known constants, and all +all arities are known. + +A tuple pattern can contain no more than one subpattern of the form "`...` +_operand_". When such a subpattern is present, the N elements of the pattern +before the `...` expansion are matched with the first N elements of the +scrutinee, and the M elements of the pattern after the `...` expansion are +matched with the last M elements of the scrutinee. If the scrutinee does not +have at least N + M elements, the pattern does not match. + +The remaining elements of the scrutinee are iteratively matched against +_operand_, in order. In each iteration, `$I` is equal to the index of the +scrutinee element being matched, minus N. + +On the Nth iteration, a binding pattern binds the Nth element of the named pack +to the Nth scrutinee value. + +## Typechecking + +### Tuples, packs, segments, and shapes + +In order to discuss the underlying type system for variadics, we will need to +introduce some pseudo-syntax to represent values and expressions that occur in +the type system, but cannot be expressed directly in user code. We will use +non-ASCII glyphs such as `«»‖⟬⟭` for that pseudo-syntax, to distinguish it from +valid Carbon syntax. + +In the context of variadics, we will say that a tuple literal consists of a +comma-separated sequence of _segments_, and reserve the term "elements" for the +components of a tuple literal after pack expansion. For example, the expression +`(... each foo)` may evaluate to a tuple value with any number of elements, but +the expression itself has exactly one segment. + +Each segment has a type, which expresses (potentially symbolically) both the +types of the elements of the segment and the arity of the segment. The type of a +tuple literal is a tuple literal of the types of its segments. For example, +suppose we are trying to find the type of `z` in this code: + +```carbon +fn F[... each T:! type]((... each x: Optional(each T)), (... each y: i32)) { + let z: auto = (0 as f32, ... each x, ... each y); +} +``` + +We proceed by finding the type of each segment. The type of `0 as f32` is `f32`, +by the usual non-variadic typing rules. The type of `... each x` is +`... Optional(each T)`, because `Optional(each T)` is the declared type of +`each x`, and the type of a pack expansion is a pack expansion of the type of +its body. + +The type of `... each y` is more complicated. Conceptually, it consists of some +number of repetitions of `i32`. We don't know exactly how many repetitions, +because it's implicitly specified by the caller: it's the arity of the second +argument tuple. Effectively, that arity acts as a hidden deduced parameter of +`F`. + +So to represent this type, we need two new pseudo-syntaxes: + +- `‖each X‖` refers to the deduced arity of the pack expansion that contains + the declaration of `each X`. +- `«E; N»` evaluates to `N` repetitions of `E`. This is called a _arity + coercion_, because it coerces the expression `E` to have arity `N`. `E` must + not contain any pack expansions, each-names, or pack literals (see below). + +Combining the two, the type of `... each y` is `... «i32; ‖each y‖»`. Thus, the +type of `z` is `(f32, ... Optional(each T), ... «i32; ‖each y‖»)`. + +Now, consider a modified version of that example: + +```carbon +fn F[... each T:! type]((... each x: Optional(each T)), (... each y: i32)) { + let (... each z: auto) = (0 as f32, ... each x, ... each y); +} +``` + +`each z` is a pack, but it has the same elements as the tuple `z` in our earlier +example, so we represent its type in the same way, as a sequence of segments: +`⟬f32, Optional(each T), «i32; ‖each y‖»⟭`. The `⟬⟭` delimiters make this a +_pack literal_ rather than a tuple literal. Notice one subtle difference: the +segments of a pack literal do not contain `...`. In effect, every segment of a +pack literal acts as a separate loop body. As with the tuple literal syntax, the +pack literal pseudo-syntax can also be used in patterns. + +The _shape_ of a pack literal is a tuple of the arities of its segments, so the +shape of `⟬f32, Optional(each T), «i32; ‖each y‖»⟭` is +`(1, ‖each T‖, ‖each y‖)`. Other expressions and patterns also have shapes. In +particular, the shape of an arity coercion `«E; A»` is `(A,)`, the shape of +`each X` is `(‖each X‖,)`, and the shape of an expression that does not contain +pack literals, shape coercions, or each-names is `(1,)`. The arity of an +expression is the sum of the elements of its shape. See the +[appendix](#typing-and-shaping-rules) for the full rules for determining the +shape of an expression. + +If a pack literal is part of some enclosing expression that doesn't contain +`...`, it can be _expanded_, which moves the outer expression inside the pack +literal. For example, `... Optional(⟬each X, Y⟭)` is equivalent to +`... ⟬Optional(each X), Optional(Y)⟭`. Similarly, an arity coercion can be +expanded so long as the parent node is not `...`, a pattern, or a pack literal. +See the [appendix](#reduction-rules) for the full rules governing this +operation. _Fully expanding_ an expression or pattern that does not contain a +pack expansion means repeatedly expanding any pack literals and arity coercions +within it, until they cannot be expanded any further. + +The _scalar components_ of a fully-expanded expression `E` are a set, defined as +follows: + +- If `E` is a pack literal, its scalar components are the union of the scalar + components of the segments. +- If `E` is an arity coercion `«F; S»`, the only scalar component of `E` is + `F`. +- Otherwise, the only scalar component of `E` is `E`. + +The scalar components of any other expression that does not contain `...` are +the scalar components of its fully expanded form. + +By construction, a segment of a pack literal never has more than one scalar +component. Also by construction, a scalar component cannot contain a pack +literal, pack expansion, or arity coercion, but it can contain each-names, so we +can operate on it using the ordinary rules of non-variadic expressions so long +as we treat the names as opaque. + +### Iterative typechecking of pack expansions + +Since the execution semantics of an expansion are defined in terms of a notional +rewritten form where we simultaneously iterate over each-names, in principle we +can typecheck the expansion by typechecking the rewritten form. However, the +rewritten form usually would not typecheck as ordinary Carbon code, because the +each-names can have different types on different iterations. Furthermore, the +difference in types can propagate through expressions: if `each x` and `each y` +can have different types on different iterations, then so can `each x * each y`. +In effect, we have to typecheck the loop body separately for each iteration. + +However, at typechecking time we usually don't even know how many iterations +there will be, much less what type an each-name will have on any particular +iteration, because the types of the each-names are packs, which are sequences of +segments, not sequences of elements. To solve that problem, we require that the +types of all each-names in a pack expansion must have the same shape. This +enables us to typecheck the pack expansion by simultaneously iterating over +segments instead of input elements. + +As a result, the type of an expression or pattern within a pack expansion is a +sequence of segments, or in other words a _pack_, representing the types it +takes on over the course of the iteration. Note, however, that even though such +an expression has a pack type, it does not evaluate to a pack value. Rather, it +evaluates to a sequence of non-pack values over the course of the pack expansion +loop, and its pack type summarizes the types of that sequence. + +Within a given iteration, typechecking follows the usual rules of non-variadic +typechecking, except that when we need the type of an each-name, we use the +scalar component of the current segment of its type. As noted above, we can +operate on a scalar component using the ordinary rules of non-variadic +typechecking. + +Once the body of a pack expansion has been typechecked, typechecking the +expansion itself is relatively straightforward: + +- A statement pack expansion requires no further typechecking, because + statements don't have types. +- An `...and` or `...or` expression has type `bool`, and every segment of the + operand's type pack must have a type that's convertible to `bool`. +- For a `...` tuple element expression or pattern, the segments of the + operand's type pack become segments of the type of the enclosing tuple. + +> **TODO:** Discuss typechecking `...expand`. + +### Typechecking patterns + +A _full pattern_ consists of an optional deduced parameter list, a pattern, and +an optional return type expression. + +A pack expansion pattern has _fixed arity_ if it contains at least one usage of +an each-name that is not a parameter of the enclosing full pattern. Otherwise it +has _deduced arity_. A tuple pattern can have at most one segment with deduced +arity. For example: + +```carbon +class C(... each T:! type) { + fn F[... each U:! type](... each t: each T, ... each u: each U); +} +``` + +In the signature of `F`, `... each t: each T` has fixed arity, since the arity +is determined by the arguments passed to `C`, before the call to `F`. On the +other hand, `... each u: each U` has deduced arity, because the arity of +`each U` is determined by the arguments passed to `F`. + +After typechecking a full pattern, we attempt to merge as many tuple segments as +possible, in order to simplify the subsequent pattern matching. For example, +consider the following function declaration: + +```carbon +fn Min[T:! type](first: T, ... each next: T) -> T; +``` + +During typechecking, we rewrite that function signature so that it only has one +parameter: + +```carbon +fn Min[T:! type](... each args: «T; ‖each next‖+1») -> T; +``` + +(We represent the arity as `‖each next‖+1` to capture the fact that `each args` +must match at least one element.) + +When the pattern is heterogeneous, the merging process may be more complex. For +example: + +```carbon +fn ZipAtLeastOne[First:! type, ... each Next:! type] + (first: Vector(First), ... each next: Vector(each Next)) + -> Vector((First, ... each Next)); +``` + +During typechecking, we transform that function signature to the following form: + +```carbon +fn ZipAtLeastOne[... ⟬First, each Next⟭:! «type; ‖each next‖+1»] + (... each __args: Vector(⟬First, each Next⟭)) + -> Vector((... ⟬First, each Next⟭)); +``` + +We can then rewrite that by replacing the pack of names `⟬First, each Next⟭` +with an invented name `each __Args`, so that the function has only one +parameter: + +```carbon +fn ZipAtLeastOne[... each __Args:! «type; ‖each next‖+1»] + (... each __args: Vector(each __Args)) + -> Vector((... each __Args)); +``` + +We can replace a name pack with an invented each-name only if all of the +following conditions hold: + +- The name pack doesn't use any name more than once. For example, we can't + apply this rewrite to `⟬X, each Y, X⟭`. +- The name pack contains exactly one each-name. For example, we can't apply + this rewrite to `⟬X, Y⟭`. +- The replacement removes all usages of the constituent names, including their + declarations. For example, we can't apply this rewrite to `⟬X, each Y⟭` in + this code, because the resulting signature would have return type `X` but no + declaration of `X`: + ```carbon + fn F[... ⟬X, each Y⟭:! «type; ‖each next‖+1»] + (... each __args: each ⟬X, each Y⟭) -> X; + ``` +- The pack expansions being rewritten do not contain any pack literals other + than the name pack being replaced. For example, we can't apply this rewrite + to `⟬X, each Y⟭` in this code, because the pack expansion in the deduced + parameter list also contains the pack literal `⟬I, each type⟭`: + ```carbon + fn F[... ⟬X, each Y⟭:! ⟬I, each type⟭](... each __args: each ⟬X, each Y⟭); + ``` + Notice that as a corollary of this rule, all the names in the name pack must + have the same type. + +See the [appendix](#pattern-match-typechecking-algorithm) for a more formal +discussion of the rewriting process. + +### Typechecking pattern matches + +To typecheck a pattern match between a tuple pattern and a tuple scrutinee, we +try to split and merge the segments of the scrutinee type so that it has the +same number of segments as the pattern type, and corresponding segments have the +same arity. For example, consider this call to `ZipAtLeastOne` (as defined in +the previous section): + +```carbon +fn F[... each T:! type](... each t: Vector(each T), u: Vector(i32)) { + ZipAtLeastOne(... each t, u); +} +``` + +The pattern type is `(... Vector(⟬First, each Next⟭))`, so we need to rewrite +the scrutinee type `(... Vector(each T), Vector(i32))` to have a single tuple +segment with an arity that matches `‖each Next‖+1`. We can do that by merging +the scrutinee segments to obtain `(... ⟬Vector(each T), Vector(i32)⟭)`. This has +a single segment with arity `‖each T‖+1`, which can match `‖each Next‖+1` +because the deduced arity `‖each Next‖` behaves as a deduced parameter of the +pattern, so they match by deducing `‖each Next‖ == ‖each T‖`. + +When merging segments of the scrutinee, we don't attempt to form name packs and +replace them with invented names, but we also don't need to: we don't require a +merged scrutinee segments to have a single scalar component. + +The search for this rewrite processes each pattern segment to the left of the +segment with deduced arity, in order from left to right. For each pattern +segment, it greedily merges unmatched scrutinee segments from left to right +until their cumulative shape is greater than or equal to the shape of the +pattern segment, and then splits off a scrutinee segment on the right if +necessary to make the shapes exactly match. Pattern segments to the right of the +segment with deduced arity are processed the same way, but with left and right +reversed, so that segments are always processed from the outside in. + +See the [appendix](#appendix-type-system-formalism) for the rewrite rules that +govern merging and splitting. + +Once we have the pattern and scrutinee segments in one-to-one correspondence, we +check each scalar component of the scrutinee type against the scalar component +of the corresponding pattern type segment (by construction, the pattern type +segment has only one scalar component). Since we are checking scalar components +against scalar components, this proceeds according to the usual rules of +non-variadic typechecking. + +> **TODO:** Extend this approach to fall back to a complementary approach, where +> the pattern and scrutinee trade roles: we maximally merge the scrutinee tuple, +> while requiring each segment to have a single scalar component, and then +> merge/split the pattern tuple to match it, without requiring pattern tuple +> segments to have a single scalar component. This isn't quite symmetric with +> the current approach, because when processing the scrutinee we can't merge +> deduced parameters (scrutinees don't have any), but we can invent new `let` +> bindings. + +## Appendix: Type system formalism + +A _pack literal_ is a comma-separated sequence of segments, enclosed in `⟬⟭` +delimiters. A pack literal can appear in an expression, pattern, or name +context, and every segment must be valid in the context where the pack literal +appears (for example, the segments of a pack literal in a name context must all +be names). Pack literals cannot be nested, and cannot appear outside a pack +expansion. + +### Explicit deduced arities + +In this formalism, deduced arities are explicit rather than implicit, so Carbon +code must be desugared into this formalism as follows: + +For each pack expansion pattern, we introduce a binding pattern `__N:! Arity` as +a deduced parameter of the enclosing full pattern, where `__N` is a name chosen +to avoid collisions. Then, for each binding pattern of the form `each X: T` +within that expansion, if `T` does not contain an each-name, the binding pattern +is rewritten as `each X: «T; __N»`. If this does not introduce any usages of +`__N`, we remove its declaration. + +`Arity` is a compiler-internal type which represents non-negative integers. The +only operation it supports is `+`, with non-negative integer literals and other +`Arity`s. `Arity` is used only during type checking, so `+` has no run-time +semantics, and its only symbolic semantics are that it is commutative and +associative. + +### Typing and shaping rules + +The shape of an AST node within a pack expansion is determined as follows: + +- The shape of an arity coercion is the value of the expression after the `;`. +- The shape of a pack literal is the concatenation of the arities of its + segments. +- The shape of an each-name expression is the shape of the binding pattern + that declared the name. +- If a binding pattern's name and type components have the same number of + segments, and each name segment is an each-name if and only if the + corresponding type segment's shape is not 1, then the shape of the binding + pattern is the shape of the type expression. Otherwise, the binding pattern + is ill-shaped. +- For any other AST node: + - If all the node's children have shape 1, its shape is 1. + - If there is some shape `S` such that all of the node's children have + shape either 1 or `S`, its shape is `S`. + - Otherwise, the node is ill-shaped. + +> **TODO:** The "well-shaped" rules as stated are slightly too restrictive. For +> example, `⟬each X, Y⟭: «Z; N+1»` is well-shaped, and `(⟬each X, Y⟭, «Z; N+1»)` +> is well-shaped if the shape of `each X` is `N`. + +The type of an expression or pattern can be computed as follows: + +- The type of `each x: auto` is `each __X`, a newly-invented deduced parameter + of the enclosing full pattern, which behaves as if it was declared as + `... each __X:! type`. +- The type of an each-name expression is the type expression of the binding + pattern that declared it. +- The type of an arity coercion `«E; S»` is `«T; S»`, where `T` is the type of + `E`. +- The type of a pack literal is a pack literal consisting of the concatenated + types of its segments. This concatenation flattens any nested pack literals + (for example `⟬A, ⟬B, C⟭⟭` becomes `⟬A, B, C⟭`) +- The type of a pack expansion expression or pattern is `...B`, where `B` is + the type of its body. +- The type of a tuple literal is a tuple literal consisting of the types of + its segments. +- If an expression or pattern `E` contains a pack literal or arity coercion + that is not inside a pack expansion, the type of `E` is the type of the + fully expanded form of `E`. + +> **TODO:** address `...expand`, `...and` and `...or`. + +### Reduction rules + +Unless otherwise specified, all expressions in these rules must be free of side +effects. Note that every reduction rule is also an equivalence: the utterance +before the reduction is equivalent to the utterance after, so these rules can +sometimes be run in reverse (particularly during deduction). + +Utterances that are reduced by these rules must be well-shaped (and the reduced +form will likewise be well-shaped), but need not be well-typed. This enables us +to apply these reductions while determining whether an utterance is well-typed, +as in the case of typing an expression or pattern that contains a pack literal +or arity coercion, above. + +_Singular pack removal:_ if `E` is a pack segment, `⟬E⟭` reduces to `E`. + +_Singular expansion removal:_ `...E` reduces to `E`, if the shape of `E` is +`(1,)`. + +_Pack expansion splitting:_ If `E` is a segment and `S` is a sequence of +segments, `...⟬E, S⟭` reduces to `...E, ...⟬S⟭`. + +_Pack expanding:_ If `F` is a function, `X` is an utterance that does not +contain pack literals, each-names, or arity coercions, and `⟬P1, P2⟭` and +`⟬Q1, Q2⟭` both have the shape `(S1, S2)`, then +`F(⟬P1, P2⟭, X, ⟬Q1, Q2⟭, «Y; S1+S2»)` reduces to +`⟬F(P1, X, Q1, «Y; S1»), F(P2, X, Q2, «Y; S2»)⟭`. This rule generalizes in +several dimensions: + +- `F` can have any number of arity coercion and other non-pack-literal + arguments, and any positive number of pack literal arguments, and they can + be in any order. +- The pack literal arguments can have any number of segments (but the + well-shapedness requirement means they must have the same number of + segments). +- `F()` can be any expression syntax other than `...`, not just a function + call. For example, this rule implies that `⟬X1, X2⟭ * ⟬Y1, Y2⟭` reduces to + `⟬X1 * Y1, X2 * Y2⟭`, where the `*` operator plays the role of `F`. +- `F()` can also a be a pattern syntax. For example, this rule implies that + `(⟬x1: X1, x2: X2⟭, ⟬y1: Y1, y2: Y2⟭)` reduces to + `⟬(x1: X1, y1: Y1), (x2: X2, y2: Y2)⟭`, where the tuple pattern syntax + `( , )` plays the role of `F`. +- When binding pattern syntax takes the role of `F`, the name part of the + binding pattern must be a name pack. For example, `⟬x1, x2⟭: ⟬X1, X2⟭` + reduces to `⟬x1: X1, x2: X2⟭`, but `each x: ⟬X1, X2⟭` cannot be reduced by + this rule. + +_Coercion expanding:_ If `F` is a function, `S` is a shape, and `Y` is an +expression that does not contain pack literals or arity coercions, +`F(«X; S», Y, «Z; S»)` reduces to `«F(X, Y, Z); S»`. As with pack expanding, +this rule generalizes: + +- `F` can have any number of non-arity-coercion arguments, and any positive + number of arity coercion arguments, and they can be in any order. +- `F()` can be any expression syntax other than `...` or pack literal + formation, not just a function call. Unlike pack expanding, coercion + expanding does not apply if `F` is a pattern syntax. + +_Coercion removal:_ `«E; 1»` reduces to `E`. + +_Tuple indexing:_ Let `I` be an integer template constant, let `X` be a tuple +segment, and let `Ys` be a sequence of tuple segments. + +- If the arity `A` of `X` is less than `I+1`, then `(X, Ys).(I)` reduces to + `(Ys).(I-A)`. +- Otherwise: + - If `X` is not a pack expansion, then `(X, Ys).(I)` reduces to `X`. + - If `X` is of the form `...⟬«E; S»⟭`, then `(X, Ys).(I)` reduces to `E`. + +### Equivalence, equality, and convertibility + +_Pack renaming:_ Let `Ns` be a sequence of names, let `⟬Ns⟭: «T; N»` be a name +binding pattern (which may be a symbolic or template binding as well as a +runtime binding), and let `__A` be an identifier that does not collide with any +name that's visible where `⟬Ns⟭` is visible. We can rewrite all occurrences of +`⟬Ns⟭` to `each __A` in the scope of the binding pattern (including the pattern +itself) if all of the following conditions hold: + +- `Ns` contains at least one each-name. +- No name in `Ns` is used in the scope outside of `Ns`. +- No name occurs more than once in `Ns`. +- No other pack literals occur in the same pack expansion as an occurrence of + `⟬Ns⟭`. + +_Expansion convertibility:_ `...T` is convertible to `...U` if the arity of `U` +equals the arity of `T`, and the scalar components of `T` are each convertible +to all scalar components of `U`. + +_Shape equality:_ Let `(S1s)`, `(S2s)`, `(S3s)`, and `(S4s)` be shapes. +`(S1s, S2s)` equals `(S3s, S4s)` if `(S1s)` equals `(S3s)` and `(S2s)` equals +`(S4s)`. + +### Pattern match typechecking algorithm + +A full pattern is in _normal form_ if it contains no pack literals, and every +arity coercion is fully expanded. For example, +`[__N:! Arity](... each x: Vector(«i32; __N»))` is not in normal form, but +`[__N:! Arity](... each x: «Vector(i32); __N»)` is. Note that all user-written +full patterns are in normal form. Note also that by construction, this means +that the type of the body of every pack expansion has a single scalar component. +The _canonical form_ of a full pattern is the unique normal form (if any) that +is "maximally merged", meaning that every tuple pattern and tuple literal has +the smallest number of segments. For example, the canonical form of +`[__N:! Arity](... each x: «i32; __N», y: i32)` is +`[__N:! Arity](... each __args: «i32; __N+1»)`. + +> **TODO:** Specify algorithm for converting a full pattern to canonical form, +> or establishing that there is no such form. See next section for a start. + +If a function with type `F` is called with argument type `A`, we typecheck the +call by converting `F` to canonical form, and then checking whether `A` is +convertible to the parameter type by applying the deduction rules in the +previous sections. If that succeeds, we apply the resulting binding map to the +function return type to obtain the type of the call expression. + +> **TODO:** Specify the algorithm more precisely. In particular, discuss how to +> rewrite `A` as needed to make the shapes line up, but don't rewrite `F` after +> canonicalization. + +Typechecking for pattern match operations other than function calls is defined +in terms of typechecking a function call: We check a scrutinee type `S` against +a pattern `P` by checking `__F(S,)` against a hypothetical function signature +`fn __F(P,)->();`. + +> **Future work:** Extend this approach to support merging the argument list as +> well as the parameter list. + +#### Canonicalization algorithm + +The canonical form can be found by starting with a normal form, and +incrementally merging an adjacent singular parameter type into the variadic +parameter type. + +For example, consider the following function: + +```carbon +fn F[First:! type, Second:! type, ... each Next:! type] + (first: Vector(First), second: Vector(Second), + ... each next: Vector(each Next)) -> (First, Second, ... each Next); +``` + +First, we desugar the implicit arity: + +```carbon +fn F[__N:! Arity, First:! type, Second:! type, ... each Next:! «type; __N»] + (first: Vector(First), second: Vector(Second), + ... each next: Vector(each Next)) -> (First, Second, ... each Next); +``` + +Then we attempt to merge `Second` with `each Next` as follows (note that for +brevity, some of the steps presented here actually contain multiple independent +reductions): + +```carbon +// Singular pack removal (in reverse) +fn F[__N:! Arity, First:! type, Second:! type, ... ⟬each Next:! «type; __N»⟭] + (first: Vector(First), second: Vector(Second), + ... each next: Vector(⟬each Next⟭)) -> (First, Second, ... ⟬each Next⟭); +// Pack expanding +fn F[__N:! Arity, First:! type, Second:! type, ... ⟬each Next:! «type; __N»⟭] + (first: Vector(First), second: Vector(Second), + ... each next: ⟬Vector(each Next)⟭) -> (First, Second, ... ⟬each Next⟭); +// Pack expanding +fn F[__N:! Arity, First:! type, Second:! type, ... ⟬each Next:! «type; __N»⟭] + (first: Vector(First), second: Vector(Second), + ... ⟬each next: Vector(each Next)⟭) -> (First, Second, ... ⟬each Next⟭); +// Pack expansion splitting (in reverse) +fn F[__N:! Arity, First:! type, ... ⟬Second:! type, each Next:! «type; __N»⟭] + (first: Vector(First), ... ⟬second: Vector(Second), + each next: Vector(each Next)⟭) + -> (First, ... ⟬Second, each Next⟭); +// Pack expanding (in reverse) +fn F[__N:! Arity, First:! type, ... ⟬Second, each Next⟭:! «type; __N+1»] + (first: Vector(First), ... ⟬second, each next⟭: ⟬Vector(Second), Vector(each Next)⟭) + -> (First, ... ⟬Second, each Next⟭); +// Pack expanding (in reverse) +fn F[__N:! Arity, First:! type, ... ⟬Second, each Next⟭:! «type; __N+1»] + (first: Vector(First), ... ⟬second, each next⟭: Vector(⟬Second, each Next⟭)) + -> (First, ... ⟬Second, each Next⟭); +// Pack renaming +fn F[__N:! Arity, First:! type, ... each __A:! «type; __N+1»] + (first: Vector(First), ... each __a: Vector(each __A)) + -> (First, ... each __A); +``` + +This brings us back to a normal form, while reducing the number of tuple +segments. We can now repeat that process to merge the remaining parameter type: + +```carbon +fn F[__N:! Arity, First:! type, ... ⟬each __A:! «type; __N+1»⟭] + (first: Vector(First), ... each __a: Vector(⟬each __A⟭)) + -> (First, ... ⟬each __A⟭); +// Pack expanding +fn F[__N:! Arity, First:! type, ... ⟬each __A:! «type; __N+1»⟭] + (first: Vector(First), ... each __a: ⟬Vector(each __A)⟭) + -> (First, ... ⟬each __A⟭); +// Pack expanding +fn F[__N:! Arity, First:! type, ... ⟬each __A:! «type; __N+1»⟭] + (first: Vector(First), ... ⟬each __a: Vector(each __A)⟭) + -> (First, ... ⟬each __A⟭); +// Pack expansion splitting (in reverse) +fn F[__N:! Arity, ... ⟬First:! type, each __A:! «type; __N+1»⟭] + (... ⟬first: Vector(First), each __a: Vector(each __A)⟭) + -> (... ⟬First, each __A⟭); +// Pack expanding (in reverse) +fn F[__N:! Arity, ... ⟬First, each __A⟭:! «type; __N+2»⟭] + (... ⟬first, each __a⟭: ⟬Vector(First), Vector(each __A)⟭) + -> (... ⟬First, each __A⟭); +// Pack expanding (in reverse) +fn F[__N:! Arity, ... ⟬First, each __A⟭:! «type; __N+2»⟭] + (... ⟬first, each __a⟭: Vector(⟬First, each __A⟭)) + -> (... ⟬First, each __A⟭); +// Pack renaming +fn F[__N:! Arity, ... __B:! «type; __N+2»⟭] + (... __b: Vector(__B)) + -> (... __B); +``` + +Here again, this is a normal form, and there is demonstrably no way to perform +any further merging, so this must be the canonical form. + +> **TODO:** define the algorithm in more general terms, and discuss ways that +> merging can fail. + +## Alternatives considered + +- [Member packs](/proposals/p2240.md#member-packs) +- [Single semantic model for pack expansions](/proposals/p2240.md#single-semantic-model-for-pack-expansions) +- [Generalize `expand`](/proposals/p2240.md#generalize-expand) +- [Omit `expand`](/proposals/p2240.md#omit-expand) +- [Support expanding arrays](/proposals/p2240.md#support-expanding-arrays) +- [Omit each-names](/proposals/p2240.md#omit-each-names) + - [Disallow pack-type bindings](/proposals/p2240.md#disallow-pack-type-bindings) +- [Fold expressions](/proposals/p2240.md#fold-expressions) +- [Allow multiple pack expansions in a tuple pattern](/proposals/p2240.md#allow-multiple-pack-expansions-in-a-tuple-pattern) +- [Allow nested pack expansions](/proposals/p2240.md#allow-nested-pack-expansions) +- [Use postfix instead of prefix `...`](/proposals/p2240.md#use-postfix-instead-of-prefix-) +- [Avoid context-sensitity in pack expansions](/proposals/p2240.md#avoid-context-sensitity-in-pack-expansions) + - [Fold-like syntax](/proposals/p2240.md#fold-like-syntax) + - [Variadic blocks](/proposals/p2240.md#variadic-blocks) + - [Keyword syntax](/proposals/p2240.md#keyword-syntax) +- [Require parentheses around `each`](/proposals/p2240.md#require-parentheses-around-each) +- [Fused expansion tokens](/proposals/p2240.md#fused-expansion-tokens) +- [No parameter merging](/proposals/p2240.md#no-parameter-merging) +- [Exhaustive function call typechecking](/proposals/p2240.md#exhaustive-function-call-typechecking) + +## References + +- Proposal + [#2240: Variadics](https://github.com/carbon-language/carbon-lang/pull/2240) diff --git a/docs/project/principles/library_apis_only.md b/docs/project/principles/library_apis_only.md index 7b0a73074b5b4..b73233375f44f 100644 --- a/docs/project/principles/library_apis_only.md +++ b/docs/project/principles/library_apis_only.md @@ -88,16 +88,12 @@ is more restricted, and this principle will not apply to them. Most importantly, function types might not be first-class types, in which case they need not be library types. -The logic for translating a literal expression to a value of the appropriate -type is arguably part of that type's public API, but will not be part of that -type's class definition. - -Tuple types will probably not fully conform to this principle, because doing so -would be circular: there is no way to name a tuple type that doesn't rely on -tuple syntax, and no way to define a class body for a tuple type that doesn't -contain tuple patterns. However, we will strive to ensure that it is possible to -define a parameterized class type within Carbon that supports all the same -operations as built-in tuple types. +Some types (such as tuples, structs, and certain integer types) will have +built-in literal syntaxes for creating values of those types. Furthermore, in +some cases (such as tuples and structs) the type's literal syntax will also be +usable as a pattern syntax. The logic for performing those operations is +arguably part of those types' public API, but will not be part of those types' +class definitions. ## Alternatives considered diff --git a/proposals/p2240.md b/proposals/p2240.md new file mode 100644 index 0000000000000..dfecfcd771fef --- /dev/null +++ b/proposals/p2240.md @@ -0,0 +1,1136 @@ +# Variadics + + + +[Pull request](https://github.com/carbon-language/carbon-lang/pull/2240) + + + +## Table of contents + +- [Abstract](#abstract) +- [Problem](#problem) +- [Background](#background) +- [Proposal](#proposal) + - [Examples](#examples) + - [Comparisons](#comparisons) +- [Rationale](#rationale) +- [Alternatives considered](#alternatives-considered) + - [Member packs](#member-packs) + - [Single semantic model for pack expansions](#single-semantic-model-for-pack-expansions) + - [Generalize `expand`](#generalize-expand) + - [Omit `expand`](#omit-expand) + - [Support expanding arrays](#support-expanding-arrays) + - [Omit each-names](#omit-each-names) + - [Disallow pack-type bindings](#disallow-pack-type-bindings) + - [Fold expressions](#fold-expressions) + - [Allow multiple pack expansions in a tuple pattern](#allow-multiple-pack-expansions-in-a-tuple-pattern) + - [Allow nested pack expansions](#allow-nested-pack-expansions) + - [Use postfix instead of prefix `...`](#use-postfix-instead-of-prefix-) + - [Avoid context-sensitity in pack expansions](#avoid-context-sensitity-in-pack-expansions) + - [Fold-like syntax](#fold-like-syntax) + - [Variadic blocks](#variadic-blocks) + - [Keyword syntax](#keyword-syntax) + - [Require parentheses around `each`](#require-parentheses-around-each) + - [Fused expansion tokens](#fused-expansion-tokens) + - [No parameter merging](#no-parameter-merging) + - [Exhaustive function call typechecking](#exhaustive-function-call-typechecking) + + + +## Abstract + +Proposes a set of core features for declaring and implementing generic variadic +functions. + +A "pack expansion" is a syntactic unit beginning with `...`, which is a kind of +compile-time loop over sequences called "packs". Packs are initialized and +referred to using "each-names", which are marked with the `each` keyword at the +point of declaration and the point of use. + +The syntax and behavior of a pack expansion depends on its context, and in some +cases by a keyword following the `...`: + +- In a tuple literal expression (such as a function call argument list), `...` + iteratively evaluates its operand expression, and treats the values as + successive elements of the tuple. +- `...and` and `...or` iteratively evaluate a boolean expression, combining + the values using `and` and `or`, and ending the loop early if the underlying + operator short-circuits. +- In a statement context, `...` iteratively executes a statement. +- In a tuple literal pattern (such as a function parameter list), `...` + iteratively matches the elements of the scrutinee tuple. In conjunction with + pack bindings, this enables functions to take an arbitrary number of + arguments. + +## Problem + +Carbon needs a way to define functions and parameterized types that are +_variadic_, meaning they can take a variable number of arguments. + +## Background + +C has long supported variadic functions through the "varargs" mechanism, but +that's heavily disfavored in C++ because it isn't type-safe. Instead, C++ +provides a separate feature for defining variadic _templates_, which can be +functions, classes, or even variables. However, variadic templates currently +suffer from several shortcomings. Most notably: + +- They must be templates, which means they cannot be definition-checked, and + suffer from a variety of other costs such as needing to be defined in header + files, and code bloat due to template instantiation. +- It is inordinately difficult to define a variadic function whose parameters + have a fixed type, and the signature of such a function does not clearly + communicate that fixed type to readers. +- The design encourages using recursion rather than iteration to process the + elements of a variadic parameter list. This results in more template + instantiations, and typically has at least quadratic overhead in the size of + the pack (at compile time, and sometimes at run time). In recent versions of + C++ it is also possible to iterate over packs procedurally, using a + [fold expressions](https://en.cppreference.com/w/cpp/language/fold) over the + comma operator, but that technique is awkward to use and not widely known. + +There have been a number of C++ standard proposals to address some of these +issues, and improve variadic templates in other ways, such as +[P1219R2: Homogeneous variadic function parameters](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1219r2.html), +[P1306R1: Expansion Statements](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1306r1.pdf), +[P1858R2: Generalized Pack Declaration and Usage](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1858r2.html), +and +[P2277R0: Packs Outside of Templates](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2277r0.html). +However, C++ has chosen not to pursue definition-checking even for non-variadic +functions, so definition-checked variadics seem out of reach. The most recent +proposal to support fixed-type parameter packs was +[rejected](https://github.com/cplusplus/papers/issues/297). A proposal to +support iterating over parameter packs was inactive for several years, but has +very recently been [revived](https://github.com/cplusplus/papers/issues/156). + +Swift supports +[variadic parameters](https://docs.swift.org/swift-book/documentation/the-swift-programming-language/functions/#Variadic-Parameters) +so long as all elements have the same type, and has recently approved +[SE-0393: Value and Type Parameter Packs](https://github.com/apple/swift-evolution/blob/main/proposals/0393-parameter-packs.md), +which adds support for definition-checked, heterogeneous variadic parameters +(with a disjoint syntax). +[SE-0404: Pack Iteration](https://github.com/simanerush/swift-evolution/blob/se-0404-pack-iteration/proposals/0404-pack-iteration.md), +which extends that to support iterating through a variadic parameter list, has +been positively received, but hasn't yet been approved. + +There have been several attempts to add such a feature to Rust, but that work is +[currently inactive](https://github.com/rust-lang/rfcs/issues/376#issuecomment-830034029). + +## Proposal + +See `/docs/design/variadics.md` in this pull request. + +### Examples + +```carbon +// Computes the sum of its arguments, which are i64s +fn SumInts(... each param: i64) -> i64 { + var sum: i64 = 0; + ... sum += each param; + return sum; +} +``` + +```carbon +// Concatenates its arguments, which are all convertible to String +fn StrCat[... each T:! ConvertibleToString](... each param: each T) -> String { + var len: i64 = 0; + ... len += each param.Length(); + var result: String = ""; + result.Reserve(len); + ... result.Append(each param.ToString()); + return result; +} +``` + +```carbon +// Returns the minimum of its arguments, which must all have the same type T. +fn Min[T:! Comparable & Value](var result: T, ... each next: T) -> T { + ... if (each next < result) { + result = each next; + } + return result; +} +``` + +```carbon +// Invokes f, with the tuple `args` as its arguments. +fn Apply[... each T:! type, F:! CallableWith(... each T)] + (f: F, args: (... each T)) -> auto { + return f(...expand args); +} +``` + +```carbon +// Takes an arbitrary number of vectors with arbitrary element types, and +// returns a vector of tuples where the i'th element of the vector is +// a tuple of the i'th elements of the input vectors. +fn Zip[... each ElementType:! type] + (... each vector: Vector(each ElementType)) + -> Vector((... each ElementType)) { + ... var each iter: auto = each vector.Begin(); + var result: Vector((... each ElementType)); + while (...and each iter != each vector.End()) { + result.push_back((... each iter)); + ... each iter++; + } + return result; +} +``` + +```carbon +// Toy example of mixing variadic and non-variadic parameters. +// Takes an i64, any number of f64s, and then another i64. +fn MiddleVariadic(first: i64, ... each middle: f64, last: i64); +``` + +```carbon +// Toy example of using the result of variadic type deduction. +fn TupleConcat[... each T1: type, ... each T2: type]( + t1: (... each T1), t2: (... each T2)) -> (... each T1, ... each T2) { + return (...expand t1, ...expand t2); +} +``` + +### Comparisons + +The following table compares selected examples of Carbon variadics against +equivalent code written in C++20 (with and without the extensions discussed +[earlier](#background)) and Swift. + + + + + + + + + + + + + + + + + + + + + + + + + + + +
CarbonC++20C++20 with extensionsSwift with extensions
+ +```carbon +// Computes the sum of its arguments, which are i64s +fn SumInts(... each param: i64) -> i64 { + var sum: i64 = 0; + ... sum += each param; + return sum; +} +``` + + + +```cpp +template + requires (std::convertible_to && ...) +int64_t SumInts(const Params&... params) { + return (static_cast(params) + ... + 0); +} +``` + + + +With P1219R2: + +```C++ +int64_t SumInts(int64... params) { + return (static_cast(params) + ... + 0); +} +``` + + + +(No extensions) + +```swift +func SumInts(_ params: Int64...) { + var sum: Int64 = 0 + for param in params { + sum += param + } + return sum +} +``` + +
+ +```carbon +fn Min[T:! Comparable & Value](first: T, ... each next: T) -> T { + var result: T = first; + ... if (each next < result) { + result = each next; + } + return result; +} +``` + + + +```cpp +template + requires std::totally_ordered && std::copyable && + (std::same_as && ...) +T Min(T first, Params... rest) { + if constexpr (sizeof...(rest) == 0) { + // Base case. + return first; + } else { + T min_rest = Min(rest...); + if (min_rest < first) { + return min_rest; + } else { + return first; + } + } +} +``` + + + +With P1219R2 and P1306R2 + +```cpp +template + requires std::totally_ordered && std::copyable +T Min(const T& first, const T&... rest) { + T result = first; + template for (const T& t: rest) { + if (t < result) { + result = t; + } + } + return result; +} +``` + + + +(No extensions) + +```swift +func Min(_ first: T, _ rest: T...) -> T { + var result: T = first; + for t in rest { + if (t < result) { + result = t + } + } + return result +} +``` + +
+ +```carbon +fn StrCat[... each T:! ConvertibleToString](... each param: each T) -> String { + var len: i64 = 0; + ... len += each param.Length(); + var result: String = ""; + result.Reserve(len); + ... result.Append(each param.ToString()); + return result; +} +``` + + + +```cpp +template +std::string StrCat(const Ts&... params) { + std::string result; + result.reserve((params.Length() + ... + 0)); + (result.append(params.ToString()), ...); + return result; +} +``` + + + +With P1306R2 + +```cpp +template +std::string StrCat(const Ts&... params) { + std::string result; + result.reserve((params.Length() + ... + 0)); + template for (auto param: params) { + result.append(param.ToString()); + } + return result; +} +``` + + + +With SE-0393 and SE-404 + +```swift +func StrCat(_ param: repeat each T) -> String { + var len: Int64 = 0; + for param in repeat each param { + len += param.Length() + } + var result: String = "" + result.reserveCapacity(len) + for param in repeat each param { + result.append(param.ToString()) + } + return result +} +``` + +
+ +## Rationale + +Carbon needs variadics to effectively support +[interoperation with and migration from C++](/docs/project/goals.md#interoperability-with-and-migration-from-existing-c-code), +where variadic templates are fairly common. Variadics also make code +[easier to read, understand, and write](/docs/project/goals.md#code-that-is-easy-to-read-understand-and-write), +because some APIs (such as `printf`) can't be naturally expressed in terms of a +fixed number of parameters. + +Furthermore, Carbon needs to support _generic_ variadics for the same reasons it +needs to support generic non-variadic functions: for example, +definition-checking makes APIs +[easier to read, understand, and write](/docs/project/goals.md#code-that-is-easy-to-read-understand-and-write), +and [easier to evolve](/docs/project/goals.md#software-and-language-evolution). +Furthermore, the language as a whole is easier to understand and write code in +if separate features like variadics and generics compose in natural ways, rather +than being mutually exclusive. + +Variadics are also important for supporting +[performance-critical software](/docs/project/goals.md#performance-critical-software), +because variadic APIs can be more efficient than their non-variadic +counterparts. For example, `StrCat` is fundamentally more efficient than +something like a chain of `operator+` calls on `std::string`, because it does +not need to materialize a series of partial results, and it can pre-allocate a +buffer large enough for the final result. + +Variadics are also needed to support the principle that +[all APIs are library APIs](/docs/project/principles/library_apis_only.md), +because the library representations of types such as tuples and callables will +need to be variadic. This proposal may appear to deviate from that principle in +some ways, but that appearance is misleading: + +- The design of pack expansion expressions treats the tuple literal syntax as + built-in, but this isn't a problem because literal syntaxes are explicitly + excluded from the principle. +- The design of pack expansion patterns treats tuple types as built-in. This + is arguably consistent with the principle, if we regard a tuple pattern as a + kind of tuple literal (note that they have identical syntax). This proposal + also revises the text of the principle to make that more explicit. +- Pack types themselves are built-in types, with no library API. However, the + principle only applies to first-class types, and pack types are decidedly + not first-class: they cannot be function return types, they cannot even be + named, and an expression cannot evaluate to a value with a pack type unless + it's within a pack expansion _and_ it has compile-time expression phase (and + even that narrow exception only exists to make the formalism more + convenient). + +## Alternatives considered + +### Member packs + +We could potentially support declaring each-names as class members. However, +this raises some novel design issues. In particular, pack bindings currently +rely exclusively on type deduction for information like the arity of the pack, +but for class members, there usually isn't an initializer available to drive +type deduction. + +In addition, it's usually if not always possible to work around the lack of +member packs by using members with tuple or array types instead. Consequently, +this feature is deferred to future work. + +### Single semantic model for pack expansions + +There's a subtle discrepancy in how this proposal models expression pack +expansions: at run time, all pack expansions are modeled as procedural loops +that successively evaluate the expansion body for each element of the input +pack, and within each iteration, expressions have scalar values. However, in the +type system, expressions within a pack expansion are notionally evaluated once, +producing a pack value. In effect, this treats pack expansions like SIMD code, +with expressions operating on "vectors" of data in parallel, rather than +iteratively executing the code on a series of scalar values. + +This discrepancy leads to an impedance mismatch where the two models meet. In +particular, it leads to the result that expressions within a pack expansion have +pack types, but do not evaluate to pack values. This contravenes one of the +basic expectations of a type system, that the type of an expression equals (or +is at least a supertype of) the type of its value. + +It's tempting to resolve the inconsistency by applying the parallel model at run +time as well as in the type system. However, that isn't feasible, because the +parallel model has the same limitation for variadics as it does for SIMD: it +can't model branching control flow. For example, consider +`(... if (expand cond) then F(expand param) else G(expand param))`: if +`expand param` truly evaluated to a pack value, then evaluating this expression +would require N calls to _both_ `F` and `G`, rather than N calls to _either_ `F` +or `G`. Even for expressions that don't contain control flow, the same problem +applies when they occur within a statement pack expansion that does. We can't +even statically detect these problems, because a branch could be hidden inside a +function call. And this isn't just a performance problem -- if `F` or `G` have +side effects, it can also be a correctness problem. + +An earlier version of this proposal tried to address this problem in a more +limited way by saying that expressions within a pack expansion don't have types +at all, but instead have "type packs". This shift in terminology nominally +avoids the problem of having expressions that don't evaluate to a value of the +expression's type, but it doesn't seem to be very clarifying in practice, and it +doesn't address the substance of the problem. + +### Generalize `expand` + +The syntax "`...expand` _expression_" behaves like syntactic sugar for +`... each x`, where `x` is an invented pack binding in the same scope, defined +as if by "`let (... each x: auto) =` _expression_". We could generalize that by +saying that `expand` is a prefix operator with the same precedence as `*` that +can be used anywhere in a pack expansion, where "`expand` _expression_" is +syntactic sugar for `each x` (with `x` defined as before, in the scope +containing the pack expansion). This would make `expand` more useful, and also +resolve the anomaly where `...expand` is the only syntax that begins with `...` +but is not a pack expansion. It is also a precondition for several of the +alternatives discussed below. + +However, those semantics could be very surprising in practice. For example: + +```carbon +...if (Condition()) { + var x: auto = expand F(y); +} +``` + +In this code, `F(y)` is evaluated before the pack expansion is entered, which +means that it is evaluated unconditionally, and it cannot refer to names +declared inside the `if` block. + +We can avoid the name-resolution issue by disallowing `expand` in statement pack +expansions, but the sequencing of evaluation could still be surprising, +particularly with `if` expressions. + +### Omit `expand` + +As noted above, `...expand` is fundamentally syntactic sugar, so we could omit +it altogether. This would somewhat simplify the design, and avoid the anomaly of +having one syntax that starts with `...` but isn't a pack expansion. However, +that would make it substantially less ergonomic to do things like expand a tuple +into an argument list, which we expect to be relatively common. + +### Support expanding arrays + +Statically-sized arrays are very close to being a special case of tuple types: +the only difference between an array type `[i32; 2]` (using Rust syntax) and a +tuple type `(i32, i32)` is that the array type can be indexed with a run-time +subscript. Consequently, it would be fairly natural to allow `expand` to operate +on arrays as well as tuples, and even to allow arrays of types to be treated as +tuple types (in the same way that tuples of types can be treated as tuple +types). + +This functionality is omitted from the current proposal because we have no +motivating use cases, but it could be added as an extension. Note that there are +important motivating use cases under some of the alternatives considered below. + +### Omit each-names + +Rather than having packs be distinguished by their names, we could instead +distinguish them by their types. For example, under the current proposal, the +signature of `Zip` is: + +```carbon +fn Zip[... each ElementType:! type] + (... each vector: Vector(each ElementType)) + -> Vector((... each ElementType)); +``` + +With this alternative, it could instead be written: + +```carbon +fn Zip[ElementTypes:! [type;]] + (... vectors: Vector(expand ElementTypes)) + -> Vector((... expand ElementTypes)); +``` + +This employs several features not in the primary proposal: + +- In cases where the declared type of the each-name does not vary across + iterations (like `ElementType`), we can re-express it as an array binding if + [`expand` supports arrays](#support-expanding-arrays), and if + [`expand` is a stand-alone operator](#generalize-expand). Note that we only + need this in type position of a binding pattern, where we could more easily + restrict `expand` to avoid the problems discussed earlier. +- In cases where the declared type of the binding does vary, that fact alone + implies that the binding refers to a pack, so we can effectively infer the + presence of `each` from the type, rather than make the user spell it out + explicitly. + +This slight change in syntax belies a much larger shift in the underlying +semantics: since these are ordinary bindings, a given call to `Zip` must bind +each of them to a single value that represents the whole sequence of arguments +(which is why their names are now plural). In the case of `ElementTypes`, that +follows straightforwardly from its type: it represents the argument types as an +array of `type`s. The situation with `vectors` is more subtle: we have to +interpret `Vector(expand ElementTypes)` as the type of the whole sequence of +argument values, rather than as a generic description of the type of a single +argument. In other words, we have to interpret it as a pack type, and that means +`vectors` notionally binds to a run-time pack value. + +Consequently, when `vectors` is used in the function body, it doesn't need an +`each` prefix: we've chosen to express variadicity in terms of types, and it +already has a pack type, so it can be directly used as an expansion site. + +This approach has a few advantages: + +- We don't have to introduce the potentially-confusing concept of a binding + that binds to multiple values simultaneously. +- It avoids the anomaly where we have pack types in the type system, but no + actual values of those types. +- Removing the `each` keyword makes it more natural to spell `expand` as a + symbolic token (earlier versions of this proposal used `[:]`), which is more + concise and doesn't need surrounding whitespace. +- For fully homogeneous variadics (such as `SumInts` and `Min`) it's actually + possible to write the function body as an ordinary loop with no variadics, + by expressing the signature in terms of a non-pack binding with an array + type. + +However, it also has some major disadvantages: + +- The implicit expansion of pack-type bindings hurts readability. For example, + it's easy to overlook the fact that the loop condition + `while (...and expand iters != vectors.End())` in `Zip` has two expansion + sites, not just one. This problem is especially acute in cases where a + non-local name has a pack type. +- We have to forbid template-dependent names from having pack types (see + [leads issue #1162](https://github.com/carbon-language/carbon-lang/issues/1162)), + because the possibility that an expression might be an expansion site in + some instantiations but not others would cause serious readability and + implementability issues. +- A given _use_ of such a binding really represents a single value at a time, + in the same way that the iteration variable of a for-each loop does, so + giving the binding a plural name and a pack type creates confusion in that + context rather than alleviating it. + +It's also worth noting that we may eventually want to introduce operations that +treat the sequence of bound values as a unit, such as to determine the length of +the sequence (like `sizeof...` in C++), or even to index into it. This approach +might seem more amenable to that, because it conceptually treats the sequence of +values as a value in itself, which could have its own operations. However, this +approach leaves no "room" in the syntax to spell those operations, because any +mention of a pack-type binding implicitly refers to one of its elements. + +Conversely, the status quo proposal seems to leave a clear syntactic opening for +those operations: you can refer to the sequence as a whole by omitting `each`, +so `each vector.Size()` refers to the size of the current iteration's `vector`, +whereas `vector.Size()` could refer to the size of the sequence of bound values. +However, this could easily turn out to be a "wrong default": omitting `each` +seems easy to do by accident, and easy to misread during code review. + +There are other solutions to this problem that work equally well with the status +quo or this alternative. In particular, it's already possible to express these +operations outside of a pack expansion by converting to a tuple, as in +`(... each vector).Size()` (status quo) or `(... vectors).Size()` (this +alternative). That may be sufficient to address those use cases, especially if +we relax the restrictions on nesting pack expansions. Failing that, +variadic-only spellings for these operations (like `sizeof...` in C++) would +also work with both approaches. So this issue does not seem like an important +differentiator between the two approaches. + +#### Disallow pack-type bindings + +As a variant of the above approach, it's possible to omit both each-names and +pack-type bindings, and instead rely on variadic tuple-type bindings. For +example, the signature of `Zip` could instead be: + +```carbon +fn Zip[ElementTypes:! [type;]] + (... expand vectors: (... Vector(expand ElementTypes))) + -> Vector((... expand ElementTypes)); +``` + +This signature doesn't change the callsite semantics, but within the function +body `vectors` will be a tuple rather than a pack. This avoids or mitigates all +of the major disadvantages of pack-type bindings, but it comes at a substantial +cost: the function signature is substantially more complex and opaque. That +seems likely to be a bad tradeoff -- the disadvantages of pack-type bindings +mostly concern the function body, but readability of variadic function +signatures seems much more important than readability of variadic function +bodies, because the signatures will be read far more often, and by programmers +who have less familiarity with variadics. + +This approach requires us to relax the ban on nested pack expansions. This does +create some risk of confusion about which pack expansion a given `expand` +belongs to, but probably much less than if we allowed unrestricted nesting. + +The leads chose not to pursue this approach in +[leads issue #1162](https://github.com/carbon-language/carbon-lang/issues/1162). + +### Fold expressions + +We could generalize the `...and` and `...or` syntax to support a wider variety +of binary operators, and to permit specifying an initial value for the chain of +binary operators, as with C++'s +[fold expressions](https://en.cppreference.com/w/cpp/language/fold). This would +be more consistent with C++, and would give users more control over +associativity and over the behavior of the arity-zero case. + +However, fold expressions are arguably too general in some respects: folding +over a non-commutative operator like `-` is more likely to be confusing than to +be useful. Similarly, there are few if any plausible use cases for customizing +the arity-zero behavior of `and` or `or`. Conversely, fold expressions are +arguably not general enough in other respects, because they only support folding +over a fixed set of operators, not over functions or compound expressions. + +Furthermore, in order to support folds over operator tokens that can be either +binary or prefix-unary (such as `*`), we would need to choose a different syntax +for tuple element lists. Otherwise, `...*each foo` would be ambiguous between +`*foo[:0:], *foo[:1:],` etc. and `foo[:0:] * foo[:1:] *` etc. + +Note that even if Carbon supported more general C++-like fold expressions, we +would still probably have to give `and` and `or` special-case treatment, because +they are short-circuiting. + +As a point of comparison, C++ fold expressions give special-case treatment to +the same two operators, along with `,`: they are the only ones where the initial +value can be omitted (such as `... && args` rather than `true && ... && args`) +even if the pack may be empty. Furthermore, folding over `&&` appears to have +been the original motivation for adding fold expressions to C++; it's not clear +if there are important motivating use cases for the other operators. + +Given that we are only supporting a minimal set of operators, allowing `...` to +occur in ordinary binary syntax has few advantages and several drawbacks: + +- It might conflict with a future general fold facility. +- It would invite users to try other operators, and would probably give less + clear errors if they do. +- It would substantially complicate parsing and the AST. +- It would force users to make a meaningless choice between `x or ...` and + `... or x`, and likewise for `and`. + +See also the discussion [below](#fold-like-syntax) of using `...,` and `...;` in +place of the tuple and statement forms of `...`. This is inspired by fold +expressions, but distinct from them, because `,` and `;` are not truly binary +operators, and it's targeting a different problem. + +### Allow multiple pack expansions in a tuple pattern + +As currently proposed, we allow multiple `...` expressions within a tuple +literal expression, but only allow one `...` pattern within a tuple pattern. It +is superficially tempting to relax this restriction, but fundamentally +infeasible. + +Allowing multiple `...` patterns would create a potential for ambiguity about +where their scrutinees begin and end. For example, given a signature like +`fn F(... each xs: i32, ... each ys: i32)`, there is no way to tell where `xs` +ends and `ys` begins in the argument list; every choice is equally valid. That +ambiguity can be avoided if the types are different, but that would make type +_non_-equality a load-bearing part of the pattern. That's a very unusual thing +to need to reason about in the type system, so it's liable to be a source of +surprise and confusion for programmers, and in particular it looks difficult if +not impossible to usefully express with generic types, which would greatly limit +the usefulness of such a feature. + +Function authors can straightforwardly work around this restriction by adding +delimiters. For example, the current design disallows +`fn F(... each xs: i32, ... each ys: i32)`, but it allows +`fn F((... each xs: i32), (... each ys: i32))`, which is not only easier to +support, but makes the callsite safer and more readable, since the boundary +between the `xs` and `ys` arguments is explicitly marked. By contrast, if we +disallowed multiple `...` expressions in a function argument list, function +callers who ran into that restriction would often find it difficult or +impossible to work around. Note, however, that this workaround presupposes that +function signatures can have bindings below top-level, which is +[currently undecided](https://github.com/carbon-language/carbon-lang/issues/1229). + +To take a more abstract view of this situation: when we reuse expression syntax +as pattern syntax, we are effectively inverting expression evaluation, by asking +the language to find the operands that would cause an expression to evaluate to +a given value. That's only possible if the operations involved are invertible, +meaning that they do not lose information. When a tuple literal contains +multiple `...` expressions, evaluating it effectively discards structural +information about for example where `xs` ends and `ys` begins. The operation of +forming a tuple from multiple packs is not invertible, and consequently we +cannot use it as a pattern operation. Our rule effectively says that if the +function needs that structural information, it must ask the caller to provide +it, rather than asking the compiler to infer it. + +### Allow nested pack expansions + +Earlier versions of this design allowed pack expansions to contain other pack +expansions. This is in some ways a natural generalization, but it added +nontrivial complexity to the design. In particular, when an each-name is +lexically within two or more pack expansions, we need a rule for determining +which pack expansion iterates over it, in a way that is unsurprising and +supports the intended use cases. However, we have few if any motivating use +cases for it, which made it difficult to evaluate that aspect of the design. +Consequently, this proposal does not support nested pack expansions, although it +tries to avoid ruling them out as a future extension. + +### Use postfix instead of prefix `...` + +`...` is a postfix operator in C++, which aligns with the natural-language use +of "…", so it would be more consistent with both if `...`, `...and`, and `...or` +were postfix operators spelled `...`, `and...`, and `or...`, and likewise if +statement pack expansions were marked by a `...` at the end rather than the +beginning. + +However, prefix syntaxes are usually easier to parse (particularly for humans), +because they ensure that by the time you start parsing an utterance, you already +know the context in which it is used. This is clearest in the case of +statements: the reader might have to read an arbitrary amount of code in the +block before realizing that the code they've been reading will be executed +variadically, so that seems out of the question. The cases of `and`, `or`, and +`,` are less clear-cut, but we have chosen to make them all prefix operators for +consistency with statements. + +### Avoid context-sensitity in pack expansions + +This proposal "overloads" the `...` token with multiple different meanings +(including different precedences), and the meaning depends in part on the +surrounding context, despite Carbon's principle of +[avoiding context-sensitivity](/docs/project/principles/low_context_sensitivity.md). +We could instead represent the different meanings using separate syntaxes. + +There are several variants of this approach, but they all have substantial +drawbacks (see the following subsections). Furthermore, the problems associated +with context-sensitivity appear to be fairly mild in this case: the difference +between a tuple literal context and a statement context is usually quite local, +and is usually so fundamental that confusion seems unlikely. + +#### Fold-like syntax + +We could use a modifier after `...` to select the expansion's meaning (as we +already do with `and` and `or`). In particular, we could write `...,` to +iteratively form elements of a tuple, and write `...;` to iteratively execute a +statement. This avoids context-sensitivity (apart from `...,` having a dual role +in expressions and patterns, like many other syntaxes), and has an underlying +unity: `...,`, `...;` `...and`, and `...or` represent "folds" over the `,`, `;`, +`and`, and `or` tokens, respectively. As a side benefit, this would preserve the +property that a tuple literal always contains a `,` character (unlike the +current proposal). + +However, this approach has major readability problems. Using `...;` as a prefix +operator is completely at odds with the fact that `;` marks the end of a +statement, not the beginning. Furthermore, it would probably be surprising to +use `...;` in contexts where `;` is not needed, because the end of the statement +is marked with `}`. + +The problems with `...,` are less severe, but still substantial. In this syntax +`,` does not behave like a separator, but our eyes are trained to read it as +one, and that habit is difficult to unlearn. For example, most readers have +found that they can't help automatically reading `(..., each x)` as having two +sub-expressions, `...` and `each x`. This effect is particularly disruptive when +skimming a larger body of code, such as: + +```carbon +fn TupleConcat[..., each T1: type, ..., each T2: type]( + t1: (..., each T1), t2: (..., each T2)) -> (..., each T1, ..., each T2) { + return (..., expand t1, ..., expand t2); +} +``` + +#### Variadic blocks + +We could replace the statement form of `...` with a variadic block syntax such +as `...{ }`. However, this doesn't give us an alternative for the tuple form of +`...`, and yet heightens the problems with it: `...{` could read as as applying +the `...` operator to a struct literal. + +Furthermore, it gives us no way to variadically declare a variable that's +visible outside the expansion (such as `each iter` in the `Zip` example). This +can be worked around by declaring those variables as tuples, but this adds +unnecessary complexity to the code. + +#### Keyword syntax + +We could drop `...` altogether, and use a separate keyword for each kind of pack +expansion. For example, we could use `repeat` for variadic lists of tuple +elements, `do_repeat` for variadic statements, and `all_of` and `any_of` in +place of `...and` and `...or`. This leads to code like: + +```carbon +// Takes an arbitrary number of vectors with arbitrary element types, and +// returns a vector of tuples where the i'th element of the vector is +// a tuple of the i'th elements of the input vectors. +fn Zip[repeat each ElementType:! type] + (repeat each vector: Vector(each ElementType)) + -> Vector((repeat each ElementType)) { + do_repeat var each iter: auto = each vector.Begin(); + var result: Vector((repeat each ElementType)); + while (all_of each iter != each vector.End()) { + result.push_back((repeat each iter)); + repeat each iter++; + } + return result; +} +``` + +This approach is heavily influenced by +[Swift variadics](https://github.com/swiftlang/swift-evolution/blob/main/proposals/0393-parameter-packs.md), +but not quite the same. It has some major advantages: the keywords are more +consistent with `each` (and `expand` to some extent), substantially less +visually noisy than `...`, and they may also be more self-explanatory. However, +it does have some substantial drawbacks. + +Most notably, there is no longer any syntactic commonality between the different +tokens that mark the root of an expansion. That makes it harder to visually +identify expansions, and could also make variadics harder to learn, because the +spelling does not act as a mnemonic cue. And while it's already not ideal that +under the primary proposal a tuple literal is identified by the presence of +either `,` or `...`, it seems even worse if one of those two tokens is instead a +keyword. + +Relatedly, the keywords have less clear precedence relationships, because +`all_of` and `any_of` can't as easily "borrow" their precedence from their +non-variadic counterparts. For example, consider this line from `Zip`: + +```carbon +while (...and each iter != each vector.End()) { +``` + +Under this alternative, that becomes: + +```carbon +while (all_of each iter != each vector.End()) { +``` + +I find the precedence relationships in the initial `all_of expand iters !=` more +opaque than in `...and expand iters !=`, to the extent that we might need to +require additional parentheses: + +```carbon + while (all_of (expand iters != each vectors.End())) { +``` + +That avoids outright ambiguity, but obliging readers to maintain a mental stack +of parentheses in order to parse the expression creates its own readability +problems. + +It's appealing that the `repeat` keyword combines with `each` to produce code +that's almost readable as English, but it creates a temptation to read `expand` +the same way, which will usually be misleading. For example, `repeat expand foo` +sounds like it is repeatedly expanding `foo`, but in fact it expands it only +once. It's possible that a different spelling of `expand` could avoid that +problem, but I haven't been able to find one that does so while also avoiding +the potential for confusion with `each`. This is somewhat mitigated by the fact +that `expand` expressions are likely to be rare. + +It's somewhat awkward, and potentially even confusing, to use an imperative word +like `repeat` in a pattern context. By design, the pattern language is +descriptive rather than imperative: it describes the values that match rather +than giving instructions for how to match them. As a result, in a pattern like +`(repeat each param: i64)`, it's not clear what action is being repeated. + +Finally, it bears mentioning that the keywords occupy lexical space that could +otherwise be used for identifiers. Notably, `all_of`, `any_of`, and `repeat` are +all names of functions in the C++ standard library. This is not a fundamental +problem, because we expect Carbon to have some way of "quoting" a keyword for +use as an identifier (such as Rust's +[raw identifiers](https://doc.rust-lang.org/rust-by-example/compatibility/raw_identifiers.html)), +but it is likely to be a source of friction. + +### Require parentheses around `each` + +We could give `each` a lower precedence, so that expressions such as +`each vector.End()` would need to be written as `(each vector).End()`. This +could make the code clearer for readers, especially if they are new to Carbon +variadics. However, this would make the code visually busier, and might give the +misleading impression that `each` can be applied to anything other than an +identifier. I propose that we wait and see whether the unparenthesized syntax +has readability problems in practice, before attempting to solve those problems. + +We have discussed a more general solution to this kind of problem, where a +prefix operator could be embedded in a `->` token, in order to apply the prefix +operator to the left-hand operand without needing parentheses. However, this +approach is much more appealing when the prefix operator is a symbolic token: +`x-?>y` may be a plausible alternative to `(?x).y`, but `x-each>y` seems much +harder to visually parse. Furthermore, this approach is hard to reconcile with +treating `each` as fundamentally part of the name, rather than an operator +applied to the name. + +### Fused expansion tokens + +Instead of treating `...and` and `...or` as two tokens with whitespace +discouraged between them, we could treat them as single tokens. This might more +accurately reflect the fact that they are semantically different operations than +`...`, and reduce the potential for readability problems in code that doesn't +follow our recommended whitespace conventions. However, that could lead to a +worse user experience if users accidentally insert a space after the `...`. + +### No parameter merging + +Under the current proposal, the compiler attempts to merge function parameters +in order to support use cases like this one, where merging the parameters of +`Min` enables us to pair each argument with a single logical parameter that will +match it: + +```carbon +fn Min[T:! type](first: T, ... each next: T) -> T; + +fn F(... each arg: i32) { + Min(... each arg, 0 as i32); +} +``` + +However, this approach makes typechecking hard to understand (and predict), +because the complex conditions governing merging mean that subtle differences in +the code can cause dramatic differences in the semantics. For example: + +```carbon +fn F[A:! I, ... each B:! I](a: A, ... each b: each B); +fn G[A:! I, ... each B:! I](a: A, ... each b: each B) -> A; +``` + +These two function signatures are identical other than their return types, but +they actually have different requirements on their arguments: `G` requires the +first argument to be singular, whereas `F` only requires _some_ argument to be +singular. It seems likely to be hard to teach programmers that the function's +return type sometimes affects whether a given argument list is valid. Relatedly, +it's hard to see how a diagnostic could concisely explain why a given call to +`G` is invalid, in a way that doesn't seem to also apply to `F`. + +We could solve that problem by omitting parameter merging, and interpreting all +of the above signatures as requiring that the first argument must be singular, +because the first parameter is singular. Thus, there would be a clear and +predictable connection between the parameter list and the requirements on the +argument list. + +In order to support use cases like `Min` where the author doesn't intend to +impose such a requirement, we would need to provide some syntax for declaring +`Min` so that it has a single parameter, but can't be called with no arguments. +More generally, this syntax would probably need to support setting an arbitrary +minimum number of arguments, not just 1. For example, an earlier version of this +proposal used `each(>=N)` to require that a parameter match at least N +arguments, so `Min` could be written like this: + +```carbon +fn Min[T:! type](... each(>=1) param: T) -> T; +``` + +However, this alternative has several drawbacks: + +- We haven't been able to find a satisfactory arity-constraint syntax. In + addition to its aesthetic problems, `each(>=1) param` disrupts the mental + model where `each` is part of the name, and it's conceptually awkward + because the constraint actually applies to the pack expansion as a whole, + not to the each-name in particular. However, it's even harder to find an + arity-constraint syntax that could attach to `...` without creating + ambiguity. Furthermore, any arity-constraint syntax would be an additional + syntax that users need to learn, and an additional choice they need to make + when writing a function signature. +- Ideally, generic code should typecheck if every possible monomorphization of + it would typecheck. This alternative does not live up to that principle -- + see, for example, the above example of `Min`. The current design does not + fully achieve that aspiration either, but it's far more difficult to find + plausible examples where it fails. +- The first/rest style will probably be more natural to programmers coming + from C++, and if they define APIs in that style, there isn't any plausible + way for them to find out that they're imposing an unwanted constraint on + callers, until someone actually tries to make a call with the wrong shape. + +### Exhaustive function call typechecking + +The current proposal uses merging and splitting to try to align the argument and +parameter lists so that each argument has exactly one parameter than can match +it. We also plan to extend this design to also try the opposite approach, +aligning them so that each parameter has exactly one argument that it can match. +However, it isn't always possible to align arguments and parameters in that way. +For example: + +```carbon +fn F[... each T:! type](x: i32, ... each y: each T); + +fn G(... each z: i32) { + F(... each z, 0 as i16); +} +``` + +Every possible monomorphization of this code would typecheck, but we can't merge +the parameters because they have different types, and we can't merge the +arguments for the same reason. We also can't split the variadic parameter or the +variadic argument, because either of them could be empty. + +The fundamental problem is that, although every possible monomorphization +typechecks, some monomorphizations are structurally different from others. For +example, if `each z` is empty, the monomorphized code converts `0 as i16` to +`i32`, but otherwise `0 as i16` is passed into `F` unmodified. + +We could support such use cases by determining which parameters can potentially +match which arguments, and then typechecking each pair. For example, we could +typecheck the above code by cases: + +- If `each z` is empty, `x: i32` matches `0 as i16` (which typechecks because + `i16` is convertible to `i32`), and `each y: each T` matches nothing. +- If `each z` is not empty, `x: i32` matches its first element (which + typechecks because `i32` is convertible to `i32`), and `each y: each T` + matches the remaining elements of `each z`, followed by `0 as i16` (which + typechecks by binding `each T` to `⟬«i32; ‖each z‖-1», i16⟭`). + +More generally, this approach works by identifying all of the structurally +different ways that arguments could match parameters, typechecking them all in +parallel, and then combining the results with logical "and". + +However, the number of such cases (and hence the cost of typechecking) grows +quadratically, because the number of cases grows with the number of parameters, +and the case analysis has to be repeated for each variadic argument. +[Fast development cycles](/docs/project/goals.md#fast-and-scalable-development) +are a priority for Carbon, so if at all possible we want to avoid situations +where compilation costs grow faster than linearly with the amount of code. + +Furthermore, typechecking a function call doesn't merely need to output a +boolean decision about whether the code typechecks. In order to typecheck the +code that uses the call, and support subsequent phases of compilation, it needs +to also output the type of the call expression, and that can depend on the +values of deduced parameters of the function. + +These more complex outputs make it much harder to combine the results of +typechecking the separate cases. To do this in a general way, we would need to +incorporate some form of case branching directly into the type system. For +example: + +```carbon +fn P[T:! I, ... each U:! J](t: T, ... each u: each U) -> T; + +fn Q[X:! I&J, ... each Y:! I&J](x: X, ... each y: each Y) -> auto { + return P(... each y, x); +} + +fn R[A:! I&J ... each B:! I&J](a: A, ... each b: each B) { + Q(... each b, a); +} +``` + +The typechecker would need to represent the type of `P(... each x, y)` as +something like `(... each Y, X).0`. That subscript `.0` acts as a disguised form +of case branching, because now any subsequent code that depends on +`P(... each y, x)` needs to be typechecked separately for the cases where +`... each Y` is and is not empty. In this case, that even leaks back into the +caller `R` through `Q`'s return type, which compounds the complexity: the type +of `Q(... each b, a)` would need to be something like +`((... each B, A).(1..‖each B‖), (... each B, A).0).0` (where `.(M..N)` is a +hypothetical tuple slice notation). + +All of this may be feasible, but the cost in type system complexity and +performance would be daunting, and the benefits are at best unclear, because we +have not yet found plausible motivating use cases that benefit from this kind of +typechecking. From 47285b62072a842893828f16ae36bcc765195ea9 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Wed, 11 Dec 2024 08:33:53 -0800 Subject: [PATCH 16/68] Include a fully-qualified name when stringifying types. (#4657) For example, format the `ImplicitAs` interface as `Core.ImplicitAs` rather than simply `ImplicitAs`. When importing an entity in a namespace, also import a declaration of the enclosing namespace if necessary so that we can determine its name. --- toolchain/check/import_ref.cpp | 46 +++-- .../testdata/array/fail_bound_overflow.carbon | 2 +- .../testdata/array/fail_invalid_type.carbon | 2 +- .../testdata/array/fail_type_mismatch.carbon | 4 +- .../testdata/as/adapter_conversion.carbon | 2 +- .../testdata/as/fail_no_conversion.carbon | 2 +- .../check/testdata/as/fail_not_type.carbon | 2 +- .../basics/fail_non_type_as_type.carbon | 2 +- .../class/adapter/extend_adapt.carbon | 4 +- .../class/adapter/fail_adapt_bad_decl.carbon | 4 +- .../testdata/class/adapter/init_adapt.carbon | 8 +- .../class/cross_package_import.carbon | 2 +- .../testdata/class/fail_base_bad_type.carbon | 10 +- .../class/fail_compound_type_mismatch.carbon | 2 +- .../class/fail_derived_to_base.carbon | 4 +- .../check/testdata/class/fail_self.carbon | 2 +- .../check/testdata/class/generic/adapt.carbon | 4 +- .../check/testdata/class/generic/call.carbon | 2 +- .../testdata/class/generic/import.carbon | 2 +- .../class/generic/member_access.carbon | 2 +- .../testdata/class/generic/stringify.carbon | 6 +- toolchain/check/testdata/class/self.carbon | 2 +- .../check/testdata/const/fail_collapse.carbon | 2 +- toolchain/check/testdata/deduce/array.carbon | 2 +- .../function/call/fail_param_type.carbon | 2 +- .../call/fail_return_type_mismatch.carbon | 2 +- .../impl/fail_impl_bad_interface.carbon | 2 +- .../impl/lookup/no_prelude/import.carbon | 2 +- .../index/fail_array_non_int_indexing.carbon | 2 +- .../index/fail_negative_indexing.carbon | 2 +- .../fail_assoc_const_bad_default.carbon | 2 +- .../testdata/let/compile_time_bindings.carbon | 2 +- .../check/testdata/let/fail_generic.carbon | 4 +- .../namespace/imported_indirect.carbon | 174 +++++++++++++++++- .../builtin/fail_type_mismatch.carbon | 2 +- .../fail_type_mismatch_assignment.carbon | 2 +- .../builtin/fail_type_mismatch_once.carbon | 4 +- .../builtin/fail_unimplemented_op.carbon | 2 +- .../testdata/operators/overloaded/eq.carbon | 8 +- .../operators/overloaded/fail_no_impl.carbon | 8 +- .../overloaded/fail_no_impl_for_arg.carbon | 4 +- .../operators/overloaded/index.carbon | 2 +- .../operators/overloaded/ordered.carbon | 8 +- .../pointer/fail_type_mismatch.carbon | 2 +- .../testdata/return/fail_type_mismatch.carbon | 2 +- .../testdata/struct/fail_type_assign.carbon | 2 +- .../testdata/struct/fail_value_as_type.carbon | 2 +- toolchain/check/testdata/struct/import.carbon | 4 +- .../access/fail_negative_indexing.carbon | 2 +- .../tuple/access/fail_non_int_indexing.carbon | 2 +- .../tuple/fail_element_type_mismatch.carbon | 2 +- .../testdata/tuple/fail_type_assign.carbon | 2 +- .../testdata/tuple/fail_value_as_type.carbon | 2 +- toolchain/check/testdata/tuple/import.carbon | 4 +- .../var/fail_storage_is_literal.carbon | 2 +- .../testdata/where_expr/constraints.carbon | 8 +- .../testdata/where_expr/equal_rewrite.carbon | 18 +- .../testdata/while/fail_bad_condition.carbon | 2 +- toolchain/sem_ir/stringify_type.cpp | 43 +++-- 59 files changed, 332 insertions(+), 121 deletions(-) diff --git a/toolchain/check/import_ref.cpp b/toolchain/check/import_ref.cpp index c585ed8193595..b01b91d9b4493 100644 --- a/toolchain/check/import_ref.cpp +++ b/toolchain/check/import_ref.cpp @@ -1082,18 +1082,7 @@ static auto GetLocalNameScopeId(ImportRefResolver& resolver, } // Get the constant value for the scope. - auto const_id = SemIR::ConstantId::Invalid; - CARBON_KIND_SWITCH(*inst) { - case SemIR::Namespace::Kind: - // If the namespace has already been imported, we can use its constant. - // However, if it hasn't, we use Invalid instead of adding it to the - // work stack. That's expected to be okay when resolving references. - const_id = resolver.local_constant_values_for_import_insts().Get(inst_id); - break; - - default: - const_id = GetLocalConstantId(resolver, inst_id); - } + auto const_id = GetLocalConstantId(resolver, inst_id); if (!const_id.is_valid()) { return SemIR::NameScopeId::Invalid; } @@ -2280,6 +2269,36 @@ static auto TryResolveTypedInst(ImportRefResolver& resolver, .bit_width_id = bit_width_id}); } +static auto TryResolveTypedInst(ImportRefResolver& resolver, + SemIR::Namespace inst, + SemIR::InstId import_inst_id) -> ResolveResult { + const auto& name_scope = + resolver.import_name_scopes().Get(inst.name_scope_id); + auto parent_scope_id = + GetLocalNameScopeId(resolver, name_scope.parent_scope_id()); + + if (resolver.HasNewWork()) { + return ResolveResult::Retry(); + } + + auto namespace_type_id = resolver.local_context().GetSingletonType( + SemIR::NamespaceType::SingletonInstId); + auto namespace_decl = + SemIR::Namespace{.type_id = namespace_type_id, + .name_scope_id = SemIR::NameScopeId::Invalid, + .import_id = SemIR::AbsoluteInstId::Invalid}; + auto inst_id = resolver.local_context().AddPlaceholderInstInNoBlock( + resolver.local_context().MakeImportedLocAndInst( + AddImportIRInst(resolver, import_inst_id), namespace_decl)); + + auto name_id = GetLocalNameId(resolver, name_scope.name_id()); + namespace_decl.name_scope_id = + resolver.local_name_scopes().Add(inst_id, name_id, parent_scope_id); + resolver.local_context().ReplaceInstBeforeConstantUse(inst_id, + namespace_decl); + return {.const_id = resolver.local_constant_values().Get(inst_id)}; +} + static auto TryResolveTypedInst(ImportRefResolver& resolver, SemIR::PointerType inst) -> ResolveResult { CARBON_CHECK(inst.type_id == SemIR::TypeType::SingletonTypeId); @@ -2539,6 +2558,9 @@ static auto TryResolveInstCanonical(ImportRefResolver& resolver, case CARBON_KIND(SemIR::IntType inst): { return TryResolveTypedInst(resolver, inst); } + case CARBON_KIND(SemIR::Namespace inst): { + return TryResolveTypedInst(resolver, inst, inst_id); + } case CARBON_KIND(SemIR::PointerType inst): { return TryResolveTypedInst(resolver, inst); } diff --git a/toolchain/check/testdata/array/fail_bound_overflow.carbon b/toolchain/check/testdata/array/fail_bound_overflow.carbon index c52f0c50ba635..d2ee2ebd969aa 100644 --- a/toolchain/check/testdata/array/fail_bound_overflow.carbon +++ b/toolchain/check/testdata/array/fail_bound_overflow.carbon @@ -17,7 +17,7 @@ var a: [i32; 39999999999999999993]; // CHECK:STDERR: fail_bound_overflow.carbon:[[@LINE+6]]:9: error: cannot implicitly convert from `Core.IntLiteral` to `type` [ImplicitAsConversionFailure] // CHECK:STDERR: var b: [1; 39999999999999999993]; // CHECK:STDERR: ^ -// CHECK:STDERR: fail_bound_overflow.carbon:[[@LINE+3]]:9: note: type `Core.IntLiteral` does not implement interface `ImplicitAs(type)` [MissingImplInMemberAccessNote] +// CHECK:STDERR: fail_bound_overflow.carbon:[[@LINE+3]]:9: note: type `Core.IntLiteral` does not implement interface `Core.ImplicitAs(type)` [MissingImplInMemberAccessNote] // CHECK:STDERR: var b: [1; 39999999999999999993]; // CHECK:STDERR: ^ var b: [1; 39999999999999999993]; diff --git a/toolchain/check/testdata/array/fail_invalid_type.carbon b/toolchain/check/testdata/array/fail_invalid_type.carbon index 0da5e35b5dda6..ebd146e51f09e 100644 --- a/toolchain/check/testdata/array/fail_invalid_type.carbon +++ b/toolchain/check/testdata/array/fail_invalid_type.carbon @@ -11,7 +11,7 @@ // CHECK:STDERR: fail_invalid_type.carbon:[[@LINE+6]]:9: error: cannot implicitly convert from `Core.IntLiteral` to `type` [ImplicitAsConversionFailure] // CHECK:STDERR: var a: [1; 1]; // CHECK:STDERR: ^ -// CHECK:STDERR: fail_invalid_type.carbon:[[@LINE+3]]:9: note: type `Core.IntLiteral` does not implement interface `ImplicitAs(type)` [MissingImplInMemberAccessNote] +// CHECK:STDERR: fail_invalid_type.carbon:[[@LINE+3]]:9: note: type `Core.IntLiteral` does not implement interface `Core.ImplicitAs(type)` [MissingImplInMemberAccessNote] // CHECK:STDERR: var a: [1; 1]; // CHECK:STDERR: ^ var a: [1; 1]; diff --git a/toolchain/check/testdata/array/fail_type_mismatch.carbon b/toolchain/check/testdata/array/fail_type_mismatch.carbon index fd3aefda10a89..15afe0df36d70 100644 --- a/toolchain/check/testdata/array/fail_type_mismatch.carbon +++ b/toolchain/check/testdata/array/fail_type_mismatch.carbon @@ -11,7 +11,7 @@ // CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+7]]:19: error: cannot implicitly convert from `String` to `i32` [ImplicitAsConversionFailure] // CHECK:STDERR: var a: [i32; 3] = (1, "Hello", "World"); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+4]]:19: note: type `String` does not implement interface `ImplicitAs(i32)` [MissingImplInMemberAccessNote] +// CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+4]]:19: note: type `String` does not implement interface `Core.ImplicitAs(i32)` [MissingImplInMemberAccessNote] // CHECK:STDERR: var a: [i32; 3] = (1, "Hello", "World"); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -21,7 +21,7 @@ var t1: (i32, String, String); // CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+7]]:19: error: cannot implicitly convert from `String` to `i32` [ImplicitAsConversionFailure] // CHECK:STDERR: var b: [i32; 3] = t1; // CHECK:STDERR: ^~ -// CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+4]]:19: note: type `String` does not implement interface `ImplicitAs(i32)` [MissingImplInMemberAccessNote] +// CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+4]]:19: note: type `String` does not implement interface `Core.ImplicitAs(i32)` [MissingImplInMemberAccessNote] // CHECK:STDERR: var b: [i32; 3] = t1; // CHECK:STDERR: ^~ // CHECK:STDERR: diff --git a/toolchain/check/testdata/as/adapter_conversion.carbon b/toolchain/check/testdata/as/adapter_conversion.carbon index 2cd4c50777839..f12a256395ea0 100644 --- a/toolchain/check/testdata/as/adapter_conversion.carbon +++ b/toolchain/check/testdata/as/adapter_conversion.carbon @@ -100,7 +100,7 @@ class B { // CHECK:STDERR: fail_adapt_init_from_struct.carbon:[[@LINE+6]]:12: error: cannot convert from `{.x: Core.IntLiteral}` to `B` with `as` [ExplicitAsConversionFailure] // CHECK:STDERR: var b: B = {.x = 1} as B; // CHECK:STDERR: ^~~~~~~~~~~~~ -// CHECK:STDERR: fail_adapt_init_from_struct.carbon:[[@LINE+3]]:12: note: type `{.x: Core.IntLiteral}` does not implement interface `As(B)` [MissingImplInMemberAccessNote] +// CHECK:STDERR: fail_adapt_init_from_struct.carbon:[[@LINE+3]]:12: note: type `{.x: Core.IntLiteral}` does not implement interface `Core.As(B)` [MissingImplInMemberAccessNote] // CHECK:STDERR: var b: B = {.x = 1} as B; // CHECK:STDERR: ^~~~~~~~~~~~~ var b: B = {.x = 1} as B; diff --git a/toolchain/check/testdata/as/fail_no_conversion.carbon b/toolchain/check/testdata/as/fail_no_conversion.carbon index 4892372605c2e..5bfd2ebcdabaf 100644 --- a/toolchain/check/testdata/as/fail_no_conversion.carbon +++ b/toolchain/check/testdata/as/fail_no_conversion.carbon @@ -11,7 +11,7 @@ // CHECK:STDERR: fail_no_conversion.carbon:[[@LINE+6]]:21: error: cannot convert from `Core.IntLiteral` to `(i32, i32)` with `as` [ExplicitAsConversionFailure] // CHECK:STDERR: let n: (i32, i32) = 1 as (i32, i32); // CHECK:STDERR: ^~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_no_conversion.carbon:[[@LINE+3]]:21: note: type `Core.IntLiteral` does not implement interface `As((i32, i32))` [MissingImplInMemberAccessNote] +// CHECK:STDERR: fail_no_conversion.carbon:[[@LINE+3]]:21: note: type `Core.IntLiteral` does not implement interface `Core.As((i32, i32))` [MissingImplInMemberAccessNote] // CHECK:STDERR: let n: (i32, i32) = 1 as (i32, i32); // CHECK:STDERR: ^~~~~~~~~~~~~~~ let n: (i32, i32) = 1 as (i32, i32); diff --git a/toolchain/check/testdata/as/fail_not_type.carbon b/toolchain/check/testdata/as/fail_not_type.carbon index 7d8c42261c6c5..bc2c00c5ee85c 100644 --- a/toolchain/check/testdata/as/fail_not_type.carbon +++ b/toolchain/check/testdata/as/fail_not_type.carbon @@ -11,7 +11,7 @@ // CHECK:STDERR: fail_not_type.carbon:[[@LINE+6]]:19: error: cannot implicitly convert from `Core.IntLiteral` to `type` [ImplicitAsConversionFailure] // CHECK:STDERR: let n: i32 = 1 as 2; // CHECK:STDERR: ^ -// CHECK:STDERR: fail_not_type.carbon:[[@LINE+3]]:19: note: type `Core.IntLiteral` does not implement interface `ImplicitAs(type)` [MissingImplInMemberAccessNote] +// CHECK:STDERR: fail_not_type.carbon:[[@LINE+3]]:19: note: type `Core.IntLiteral` does not implement interface `Core.ImplicitAs(type)` [MissingImplInMemberAccessNote] // CHECK:STDERR: let n: i32 = 1 as 2; // CHECK:STDERR: ^ let n: i32 = 1 as 2; diff --git a/toolchain/check/testdata/basics/fail_non_type_as_type.carbon b/toolchain/check/testdata/basics/fail_non_type_as_type.carbon index 8b69c739b9dfc..6e2db17f5a8c8 100644 --- a/toolchain/check/testdata/basics/fail_non_type_as_type.carbon +++ b/toolchain/check/testdata/basics/fail_non_type_as_type.carbon @@ -11,7 +11,7 @@ // CHECK:STDERR: fail_non_type_as_type.carbon:[[@LINE+6]]:1: error: cannot implicitly convert from `Core.IntLiteral` to `type` [ImplicitAsConversionFailure] // CHECK:STDERR: var x: type = 42; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_non_type_as_type.carbon:[[@LINE+3]]:1: note: type `Core.IntLiteral` does not implement interface `ImplicitAs(type)` [MissingImplInMemberAccessNote] +// CHECK:STDERR: fail_non_type_as_type.carbon:[[@LINE+3]]:1: note: type `Core.IntLiteral` does not implement interface `Core.ImplicitAs(type)` [MissingImplInMemberAccessNote] // CHECK:STDERR: var x: type = 42; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ var x: type = 42; diff --git a/toolchain/check/testdata/class/adapter/extend_adapt.carbon b/toolchain/check/testdata/class/adapter/extend_adapt.carbon index b85fcf75739a3..3959adb39ad26 100644 --- a/toolchain/check/testdata/class/adapter/extend_adapt.carbon +++ b/toolchain/check/testdata/class/adapter/extend_adapt.carbon @@ -51,7 +51,7 @@ fn F(a: SomeClassAdapter) { // CHECK:STDERR: fail_todo_method_access.carbon:[[@LINE+10]]:3: error: cannot implicitly convert from `SomeClassAdapter` to `SomeClass` [ImplicitAsConversionFailure] // CHECK:STDERR: a.F(); // CHECK:STDERR: ^ - // CHECK:STDERR: fail_todo_method_access.carbon:[[@LINE+7]]:3: note: type `SomeClassAdapter` does not implement interface `ImplicitAs(SomeClass)` [MissingImplInMemberAccessNote] + // CHECK:STDERR: fail_todo_method_access.carbon:[[@LINE+7]]:3: note: type `SomeClassAdapter` does not implement interface `Core.ImplicitAs(SomeClass)` [MissingImplInMemberAccessNote] // CHECK:STDERR: a.F(); // CHECK:STDERR: ^ // CHECK:STDERR: fail_todo_method_access.carbon:[[@LINE-14]]:8: note: initializing function parameter [InCallToFunctionParam] @@ -78,7 +78,7 @@ fn F(a: SomeClassAdapter) -> i32 { // CHECK:STDERR: fail_todo_field_access.carbon:[[@LINE+7]]:10: error: cannot implicitly convert from `SomeClassAdapter` to `SomeClass` [ImplicitAsConversionFailure] // CHECK:STDERR: return a.b; // CHECK:STDERR: ^~~ - // CHECK:STDERR: fail_todo_field_access.carbon:[[@LINE+4]]:10: note: type `SomeClassAdapter` does not implement interface `ImplicitAs(SomeClass)` [MissingImplInMemberAccessNote] + // CHECK:STDERR: fail_todo_field_access.carbon:[[@LINE+4]]:10: note: type `SomeClassAdapter` does not implement interface `Core.ImplicitAs(SomeClass)` [MissingImplInMemberAccessNote] // CHECK:STDERR: return a.b; // CHECK:STDERR: ^~~ // CHECK:STDERR: diff --git a/toolchain/check/testdata/class/adapter/fail_adapt_bad_decl.carbon b/toolchain/check/testdata/class/adapter/fail_adapt_bad_decl.carbon index 0476c356edac9..f0fa494924792 100644 --- a/toolchain/check/testdata/class/adapter/fail_adapt_bad_decl.carbon +++ b/toolchain/check/testdata/class/adapter/fail_adapt_bad_decl.carbon @@ -16,7 +16,7 @@ class Bad { // CHECK:STDERR: fail_not_type.carbon:[[@LINE+7]]:3: error: cannot implicitly convert from `Core.IntLiteral` to `type` [ImplicitAsConversionFailure] // CHECK:STDERR: adapt 100; // CHECK:STDERR: ^~~~~~~~~~ - // CHECK:STDERR: fail_not_type.carbon:[[@LINE+4]]:3: note: type `Core.IntLiteral` does not implement interface `ImplicitAs(type)` [MissingImplInMemberAccessNote] + // CHECK:STDERR: fail_not_type.carbon:[[@LINE+4]]:3: note: type `Core.IntLiteral` does not implement interface `Core.ImplicitAs(type)` [MissingImplInMemberAccessNote] // CHECK:STDERR: adapt 100; // CHECK:STDERR: ^~~~~~~~~~ // CHECK:STDERR: @@ -37,7 +37,7 @@ class Bad { // CHECK:STDERR: fail_extend_not_type.carbon:[[@LINE+7]]:3: error: cannot implicitly convert from `Core.IntLiteral` to `type` [ImplicitAsConversionFailure] // CHECK:STDERR: extend adapt 100; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_extend_not_type.carbon:[[@LINE+4]]:3: note: type `Core.IntLiteral` does not implement interface `ImplicitAs(type)` [MissingImplInMemberAccessNote] + // CHECK:STDERR: fail_extend_not_type.carbon:[[@LINE+4]]:3: note: type `Core.IntLiteral` does not implement interface `Core.ImplicitAs(type)` [MissingImplInMemberAccessNote] // CHECK:STDERR: extend adapt 100; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ // CHECK:STDERR: diff --git a/toolchain/check/testdata/class/adapter/init_adapt.carbon b/toolchain/check/testdata/class/adapter/init_adapt.carbon index 3f29fae62ba26..7ab5d6abecf3a 100644 --- a/toolchain/check/testdata/class/adapter/init_adapt.carbon +++ b/toolchain/check/testdata/class/adapter/init_adapt.carbon @@ -55,7 +55,7 @@ let a: C = {.a = 1, .b = 2}; // CHECK:STDERR: fail_not_implicit.carbon:[[@LINE+7]]:1: error: cannot implicitly convert from `C` to `AdaptC` [ImplicitAsConversionFailure] // CHECK:STDERR: let b: AdaptC = a; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_not_implicit.carbon:[[@LINE+4]]:1: note: type `C` does not implement interface `ImplicitAs(AdaptC)` [MissingImplInMemberAccessNote] +// CHECK:STDERR: fail_not_implicit.carbon:[[@LINE+4]]:1: note: type `C` does not implement interface `Core.ImplicitAs(AdaptC)` [MissingImplInMemberAccessNote] // CHECK:STDERR: let b: AdaptC = a; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -64,7 +64,7 @@ let b: AdaptC = a; // CHECK:STDERR: fail_not_implicit.carbon:[[@LINE+7]]:1: error: cannot implicitly convert from `AdaptC` to `C` [ImplicitAsConversionFailure] // CHECK:STDERR: let c: C = b; // CHECK:STDERR: ^~~~~~~~~~~~~ -// CHECK:STDERR: fail_not_implicit.carbon:[[@LINE+4]]:1: note: type `AdaptC` does not implement interface `ImplicitAs(C)` [MissingImplInMemberAccessNote] +// CHECK:STDERR: fail_not_implicit.carbon:[[@LINE+4]]:1: note: type `AdaptC` does not implement interface `Core.ImplicitAs(C)` [MissingImplInMemberAccessNote] // CHECK:STDERR: let c: C = b; // CHECK:STDERR: ^~~~~~~~~~~~~ // CHECK:STDERR: @@ -77,7 +77,7 @@ fn MakeAdaptC() -> AdaptC; // CHECK:STDERR: fail_not_implicit.carbon:[[@LINE+7]]:1: error: cannot implicitly convert from `C` to `AdaptC` [ImplicitAsConversionFailure] // CHECK:STDERR: var d: AdaptC = MakeC(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_not_implicit.carbon:[[@LINE+4]]:1: note: type `C` does not implement interface `ImplicitAs(AdaptC)` [MissingImplInMemberAccessNote] +// CHECK:STDERR: fail_not_implicit.carbon:[[@LINE+4]]:1: note: type `C` does not implement interface `Core.ImplicitAs(AdaptC)` [MissingImplInMemberAccessNote] // CHECK:STDERR: var d: AdaptC = MakeC(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -86,7 +86,7 @@ var d: AdaptC = MakeC(); // CHECK:STDERR: fail_not_implicit.carbon:[[@LINE+6]]:1: error: cannot implicitly convert from `AdaptC` to `C` [ImplicitAsConversionFailure] // CHECK:STDERR: var e: C = MakeAdaptC(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_not_implicit.carbon:[[@LINE+3]]:1: note: type `AdaptC` does not implement interface `ImplicitAs(C)` [MissingImplInMemberAccessNote] +// CHECK:STDERR: fail_not_implicit.carbon:[[@LINE+3]]:1: note: type `AdaptC` does not implement interface `Core.ImplicitAs(C)` [MissingImplInMemberAccessNote] // CHECK:STDERR: var e: C = MakeAdaptC(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~ var e: C = MakeAdaptC(); diff --git a/toolchain/check/testdata/class/cross_package_import.carbon b/toolchain/check/testdata/class/cross_package_import.carbon index 79eff108ca137..d2fbf9b2d7345 100644 --- a/toolchain/check/testdata/class/cross_package_import.carbon +++ b/toolchain/check/testdata/class/cross_package_import.carbon @@ -48,7 +48,7 @@ library "[[@TEST_NAME]]"; import Other library "other_extern"; -// CHECK:STDERR: fail_extern.carbon:[[@LINE+8]]:8: error: variable has incomplete type `C` [IncompleteTypeInVarDecl] +// CHECK:STDERR: fail_extern.carbon:[[@LINE+8]]:8: error: variable has incomplete type `Other.C` [IncompleteTypeInVarDecl] // CHECK:STDERR: var c: Other.C = {}; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: fail_extern.carbon:[[@LINE-5]]:1: in import [InImport] diff --git a/toolchain/check/testdata/class/fail_base_bad_type.carbon b/toolchain/check/testdata/class/fail_base_bad_type.carbon index e4c2546563c52..fe003970a5f36 100644 --- a/toolchain/check/testdata/class/fail_base_bad_type.carbon +++ b/toolchain/check/testdata/class/fail_base_bad_type.carbon @@ -31,7 +31,7 @@ class DeriveFromNonType { // CHECK:STDERR: fail_derive_from_non_type.carbon:[[@LINE+7]]:16: error: cannot implicitly convert from `Core.IntLiteral` to `type` [ImplicitAsConversionFailure] // CHECK:STDERR: extend base: 32; // CHECK:STDERR: ^~ - // CHECK:STDERR: fail_derive_from_non_type.carbon:[[@LINE+4]]:16: note: type `Core.IntLiteral` does not implement interface `ImplicitAs(type)` [MissingImplInMemberAccessNote] + // CHECK:STDERR: fail_derive_from_non_type.carbon:[[@LINE+4]]:16: note: type `Core.IntLiteral` does not implement interface `Core.ImplicitAs(type)` [MissingImplInMemberAccessNote] // CHECK:STDERR: extend base: 32; // CHECK:STDERR: ^~ // CHECK:STDERR: @@ -57,7 +57,7 @@ class DeriveFromi32 { // CHECK:STDERR: fail_derive_from_i32.carbon:[[@LINE+7]]:53: error: cannot implicitly convert from `DeriveFromi32*` to `i32*` [ImplicitAsConversionFailure] // CHECK:STDERR: fn ConvertToBadBasei32(p: DeriveFromi32*) -> i32* { return p; } // CHECK:STDERR: ^~~~~~~~~ -// CHECK:STDERR: fail_derive_from_i32.carbon:[[@LINE+4]]:53: note: type `DeriveFromi32*` does not implement interface `ImplicitAs(i32*)` [MissingImplInMemberAccessNote] +// CHECK:STDERR: fail_derive_from_i32.carbon:[[@LINE+4]]:53: note: type `DeriveFromi32*` does not implement interface `Core.ImplicitAs(i32*)` [MissingImplInMemberAccessNote] // CHECK:STDERR: fn ConvertToBadBasei32(p: DeriveFromi32*) -> i32* { return p; } // CHECK:STDERR: ^~~~~~~~~ // CHECK:STDERR: @@ -82,7 +82,7 @@ class DeriveFromTuple { // CHECK:STDERR: fail_derive_from_tuple.carbon:[[@LINE+7]]:61: error: cannot implicitly convert from `DeriveFromTuple*` to `(Base,)*` [ImplicitAsConversionFailure] // CHECK:STDERR: fn ConvertToBadBaseTuple(p: DeriveFromTuple*) -> (Base,)* { return p; } // CHECK:STDERR: ^~~~~~~~~ -// CHECK:STDERR: fail_derive_from_tuple.carbon:[[@LINE+4]]:61: note: type `DeriveFromTuple*` does not implement interface `ImplicitAs((Base,)*)` [MissingImplInMemberAccessNote] +// CHECK:STDERR: fail_derive_from_tuple.carbon:[[@LINE+4]]:61: note: type `DeriveFromTuple*` does not implement interface `Core.ImplicitAs((Base,)*)` [MissingImplInMemberAccessNote] // CHECK:STDERR: fn ConvertToBadBaseTuple(p: DeriveFromTuple*) -> (Base,)* { return p; } // CHECK:STDERR: ^~~~~~~~~ // CHECK:STDERR: @@ -107,7 +107,7 @@ class DeriveFromStruct { // CHECK:STDERR: fail_derive_from_struct.carbon:[[@LINE+7]]:74: error: cannot implicitly convert from `DeriveFromStruct*` to `{.a: i32, .b: i32}*` [ImplicitAsConversionFailure] // CHECK:STDERR: fn ConvertToBadBaseStruct(p: DeriveFromStruct*) -> {.a: i32, .b: i32}* { return p; } // CHECK:STDERR: ^~~~~~~~~ -// CHECK:STDERR: fail_derive_from_struct.carbon:[[@LINE+4]]:74: note: type `DeriveFromStruct*` does not implement interface `ImplicitAs({.a: i32, .b: i32}*)` [MissingImplInMemberAccessNote] +// CHECK:STDERR: fail_derive_from_struct.carbon:[[@LINE+4]]:74: note: type `DeriveFromStruct*` does not implement interface `Core.ImplicitAs({.a: i32, .b: i32}*)` [MissingImplInMemberAccessNote] // CHECK:STDERR: fn ConvertToBadBaseStruct(p: DeriveFromStruct*) -> {.a: i32, .b: i32}* { return p; } // CHECK:STDERR: ^~~~~~~~~ // CHECK:STDERR: @@ -140,7 +140,7 @@ class DeriveFromIncomplete { // CHECK:STDERR: fail_derive_from_incomplete.carbon:[[@LINE+7]]:74: error: cannot implicitly convert from `DeriveFromIncomplete*` to `Incomplete*` [ImplicitAsConversionFailure] // CHECK:STDERR: fn ConvertToBadBaseIncomplete(p: DeriveFromIncomplete*) -> Incomplete* { return p; } // CHECK:STDERR: ^~~~~~~~~ -// CHECK:STDERR: fail_derive_from_incomplete.carbon:[[@LINE+4]]:74: note: type `DeriveFromIncomplete*` does not implement interface `ImplicitAs(Incomplete*)` [MissingImplInMemberAccessNote] +// CHECK:STDERR: fail_derive_from_incomplete.carbon:[[@LINE+4]]:74: note: type `DeriveFromIncomplete*` does not implement interface `Core.ImplicitAs(Incomplete*)` [MissingImplInMemberAccessNote] // CHECK:STDERR: fn ConvertToBadBaseIncomplete(p: DeriveFromIncomplete*) -> Incomplete* { return p; } // CHECK:STDERR: ^~~~~~~~~ // CHECK:STDERR: diff --git a/toolchain/check/testdata/class/fail_compound_type_mismatch.carbon b/toolchain/check/testdata/class/fail_compound_type_mismatch.carbon index 923dc78f4c202..80224c35fc376 100644 --- a/toolchain/check/testdata/class/fail_compound_type_mismatch.carbon +++ b/toolchain/check/testdata/class/fail_compound_type_mismatch.carbon @@ -20,7 +20,7 @@ fn AccessBInA(a: A) -> i32 { // CHECK:STDERR: fail_compound_type_mismatch.carbon:[[@LINE+6]]:10: error: cannot implicitly convert from `A` to `B` [ImplicitAsConversionFailure] // CHECK:STDERR: return a.(B.b); // CHECK:STDERR: ^~~~~~~ - // CHECK:STDERR: fail_compound_type_mismatch.carbon:[[@LINE+3]]:10: note: type `A` does not implement interface `ImplicitAs(B)` [MissingImplInMemberAccessNote] + // CHECK:STDERR: fail_compound_type_mismatch.carbon:[[@LINE+3]]:10: note: type `A` does not implement interface `Core.ImplicitAs(B)` [MissingImplInMemberAccessNote] // CHECK:STDERR: return a.(B.b); // CHECK:STDERR: ^~~~~~~ return a.(B.b); diff --git a/toolchain/check/testdata/class/fail_derived_to_base.carbon b/toolchain/check/testdata/class/fail_derived_to_base.carbon index 26c99b83a5ffc..2d9ef7c6f38b4 100644 --- a/toolchain/check/testdata/class/fail_derived_to_base.carbon +++ b/toolchain/check/testdata/class/fail_derived_to_base.carbon @@ -24,7 +24,7 @@ class B2 { // CHECK:STDERR: fail_derived_to_base.carbon:[[@LINE+7]]:38: error: cannot implicitly convert from `B2*` to `A1*` [ImplicitAsConversionFailure] // CHECK:STDERR: fn ConvertUnrelated(p: B2*) -> A1* { return p; } // CHECK:STDERR: ^~~~~~~~~ -// CHECK:STDERR: fail_derived_to_base.carbon:[[@LINE+4]]:38: note: type `B2*` does not implement interface `ImplicitAs(A1*)` [MissingImplInMemberAccessNote] +// CHECK:STDERR: fail_derived_to_base.carbon:[[@LINE+4]]:38: note: type `B2*` does not implement interface `Core.ImplicitAs(A1*)` [MissingImplInMemberAccessNote] // CHECK:STDERR: fn ConvertUnrelated(p: B2*) -> A1* { return p; } // CHECK:STDERR: ^~~~~~~~~ // CHECK:STDERR: @@ -35,7 +35,7 @@ class Incomplete; // CHECK:STDERR: fail_derived_to_base.carbon:[[@LINE+6]]:47: error: cannot implicitly convert from `Incomplete*` to `A2*` [ImplicitAsConversionFailure] // CHECK:STDERR: fn ConvertIncomplete(p: Incomplete*) -> A2* { return p; } // CHECK:STDERR: ^~~~~~~~~ -// CHECK:STDERR: fail_derived_to_base.carbon:[[@LINE+3]]:47: note: type `Incomplete*` does not implement interface `ImplicitAs(A2*)` [MissingImplInMemberAccessNote] +// CHECK:STDERR: fail_derived_to_base.carbon:[[@LINE+3]]:47: note: type `Incomplete*` does not implement interface `Core.ImplicitAs(A2*)` [MissingImplInMemberAccessNote] // CHECK:STDERR: fn ConvertIncomplete(p: Incomplete*) -> A2* { return p; } // CHECK:STDERR: ^~~~~~~~~ fn ConvertIncomplete(p: Incomplete*) -> A2* { return p; } diff --git a/toolchain/check/testdata/class/fail_self.carbon b/toolchain/check/testdata/class/fail_self.carbon index 7db7065faf566..f811759befd35 100644 --- a/toolchain/check/testdata/class/fail_self.carbon +++ b/toolchain/check/testdata/class/fail_self.carbon @@ -46,7 +46,7 @@ fn CallWrongSelf(ws: WrongSelf) { // CHECK:STDERR: fail_self.carbon:[[@LINE+9]]:3: error: cannot implicitly convert from `WrongSelf` to `Class` [ImplicitAsConversionFailure] // CHECK:STDERR: ws.F(); // CHECK:STDERR: ^~ - // CHECK:STDERR: fail_self.carbon:[[@LINE+6]]:3: note: type `WrongSelf` does not implement interface `ImplicitAs(Class)` [MissingImplInMemberAccessNote] + // CHECK:STDERR: fail_self.carbon:[[@LINE+6]]:3: note: type `WrongSelf` does not implement interface `Core.ImplicitAs(Class)` [MissingImplInMemberAccessNote] // CHECK:STDERR: ws.F(); // CHECK:STDERR: ^~ // CHECK:STDERR: fail_self.carbon:[[@LINE-10]]:8: note: initializing function parameter [InCallToFunctionParam] diff --git a/toolchain/check/testdata/class/generic/adapt.carbon b/toolchain/check/testdata/class/generic/adapt.carbon index 222c8b49d7871..031f2b22e1f70 100644 --- a/toolchain/check/testdata/class/generic/adapt.carbon +++ b/toolchain/check/testdata/class/generic/adapt.carbon @@ -51,7 +51,7 @@ fn Access(a: Adapter) -> i32 { // CHECK:STDERR: fail_todo_extend_adapt_specific_type.carbon:[[@LINE+7]]:10: error: cannot implicitly convert from `Adapter` to `C(i32)` [ImplicitAsConversionFailure] // CHECK:STDERR: return a.x; // CHECK:STDERR: ^~~ - // CHECK:STDERR: fail_todo_extend_adapt_specific_type.carbon:[[@LINE+4]]:10: note: type `Adapter` does not implement interface `ImplicitAs(C(i32))` [MissingImplInMemberAccessNote] + // CHECK:STDERR: fail_todo_extend_adapt_specific_type.carbon:[[@LINE+4]]:10: note: type `Adapter` does not implement interface `Core.ImplicitAs(C(i32))` [MissingImplInMemberAccessNote] // CHECK:STDERR: return a.x; // CHECK:STDERR: ^~~ // CHECK:STDERR: @@ -84,7 +84,7 @@ fn ImportedAccess(a: Adapter) -> i32 { // CHECK:STDERR: fail_todo_import_extend_adapt_specific_type.carbon:[[@LINE+6]]:10: error: cannot implicitly convert from `Adapter` to `C(i32)` [ImplicitAsConversionFailure] // CHECK:STDERR: return a.x; // CHECK:STDERR: ^~~ - // CHECK:STDERR: fail_todo_import_extend_adapt_specific_type.carbon:[[@LINE+3]]:10: note: type `Adapter` does not implement interface `ImplicitAs(C(i32))` [MissingImplInMemberAccessNote] + // CHECK:STDERR: fail_todo_import_extend_adapt_specific_type.carbon:[[@LINE+3]]:10: note: type `Adapter` does not implement interface `Core.ImplicitAs(C(i32))` [MissingImplInMemberAccessNote] // CHECK:STDERR: return a.x; // CHECK:STDERR: ^~~ return a.x; diff --git a/toolchain/check/testdata/class/generic/call.carbon b/toolchain/check/testdata/class/generic/call.carbon index af27c369f0486..1f3613066ef56 100644 --- a/toolchain/check/testdata/class/generic/call.carbon +++ b/toolchain/check/testdata/class/generic/call.carbon @@ -58,7 +58,7 @@ class Class(T:! type, N:! i32) {} // CHECK:STDERR: fail_no_conversion.carbon:[[@LINE+9]]:8: error: cannot implicitly convert from `Core.IntLiteral` to `type` [ImplicitAsConversionFailure] // CHECK:STDERR: var a: Class(5, i32*); // CHECK:STDERR: ^~~~~~~~~~~~~~ -// CHECK:STDERR: fail_no_conversion.carbon:[[@LINE+6]]:8: note: type `Core.IntLiteral` does not implement interface `ImplicitAs(type)` [MissingImplInMemberAccessNote] +// CHECK:STDERR: fail_no_conversion.carbon:[[@LINE+6]]:8: note: type `Core.IntLiteral` does not implement interface `Core.ImplicitAs(type)` [MissingImplInMemberAccessNote] // CHECK:STDERR: var a: Class(5, i32*); // CHECK:STDERR: ^~~~~~~~~~~~~~ // CHECK:STDERR: fail_no_conversion.carbon:[[@LINE-8]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] diff --git a/toolchain/check/testdata/class/generic/import.carbon b/toolchain/check/testdata/class/generic/import.carbon index 9424168a6c5ac..27d0e3273086b 100644 --- a/toolchain/check/testdata/class/generic/import.carbon +++ b/toolchain/check/testdata/class/generic/import.carbon @@ -58,7 +58,7 @@ fn Use() { // CHECK:STDERR: fail_generic_arg_mismatch.carbon:[[@LINE+7]]:3: error: cannot implicitly convert from `CompleteClass(i32)` to `CompleteClass(i32*)` [ImplicitAsConversionFailure] // CHECK:STDERR: var v: CompleteClass(i32*) = F(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_generic_arg_mismatch.carbon:[[@LINE+4]]:3: note: type `CompleteClass(i32)` does not implement interface `ImplicitAs(CompleteClass(i32*))` [MissingImplInMemberAccessNote] + // CHECK:STDERR: fail_generic_arg_mismatch.carbon:[[@LINE+4]]:3: note: type `CompleteClass(i32)` does not implement interface `Core.ImplicitAs(CompleteClass(i32*))` [MissingImplInMemberAccessNote] // CHECK:STDERR: var v: CompleteClass(i32*) = F(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: diff --git a/toolchain/check/testdata/class/generic/member_access.carbon b/toolchain/check/testdata/class/generic/member_access.carbon index c02c4e65b6e25..34d75357ab9a8 100644 --- a/toolchain/check/testdata/class/generic/member_access.carbon +++ b/toolchain/check/testdata/class/generic/member_access.carbon @@ -42,7 +42,7 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDERR: fail_todo_static_member_fn_call.carbon:[[@LINE+6]]:3: error: cannot implicitly convert from `Class(T)` to `Class(T)` [ImplicitAsConversionFailure] // CHECK:STDERR: return Class(T).Make(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_todo_static_member_fn_call.carbon:[[@LINE+3]]:3: note: type `Class(T)` does not implement interface `ImplicitAs(Class(T))` [MissingImplInMemberAccessNote] + // CHECK:STDERR: fail_todo_static_member_fn_call.carbon:[[@LINE+3]]:3: note: type `Class(T)` does not implement interface `Core.ImplicitAs(Class(T))` [MissingImplInMemberAccessNote] // CHECK:STDERR: return Class(T).Make(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~ return Class(T).Make(); diff --git a/toolchain/check/testdata/class/generic/stringify.carbon b/toolchain/check/testdata/class/generic/stringify.carbon index 64720dd14b1cd..382f305d4ee72 100644 --- a/toolchain/check/testdata/class/generic/stringify.carbon +++ b/toolchain/check/testdata/class/generic/stringify.carbon @@ -19,7 +19,7 @@ var v: NoParams; // CHECK:STDERR: fail_empty_params.carbon:[[@LINE+7]]:1: error: cannot implicitly convert from `NoParams` to `EmptyParams()` [ImplicitAsConversionFailure] // CHECK:STDERR: var w: EmptyParams() = v; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_empty_params.carbon:[[@LINE+4]]:1: note: type `NoParams` does not implement interface `ImplicitAs(EmptyParams())` [MissingImplInMemberAccessNote] +// CHECK:STDERR: fail_empty_params.carbon:[[@LINE+4]]:1: note: type `NoParams` does not implement interface `Core.ImplicitAs(EmptyParams())` [MissingImplInMemberAccessNote] // CHECK:STDERR: var w: EmptyParams() = v; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -40,7 +40,7 @@ var v: Outer({}*); // CHECK:STDERR: fail_nested.carbon:[[@LINE+7]]:1: error: cannot implicitly convert from `Outer({}*)` to `Inner({.a: i32}*)` [ImplicitAsConversionFailure] // CHECK:STDERR: var w: Outer({}*).Inner({.a: i32}*) = v; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_nested.carbon:[[@LINE+4]]:1: note: type `Outer({}*)` does not implement interface `ImplicitAs(Inner({.a: i32}*))` [MissingImplInMemberAccessNote] +// CHECK:STDERR: fail_nested.carbon:[[@LINE+4]]:1: note: type `Outer({}*)` does not implement interface `Core.ImplicitAs(Inner({.a: i32}*))` [MissingImplInMemberAccessNote] // CHECK:STDERR: var w: Outer({}*).Inner({.a: i32}*) = v; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -55,7 +55,7 @@ class C(N:! i32) {} // CHECK:STDERR: fail_int_value.carbon:[[@LINE+6]]:1: error: cannot implicitly convert from `()` to `C(123)` [ImplicitAsConversionFailure] // CHECK:STDERR: var v: C(123) = (); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_int_value.carbon:[[@LINE+3]]:1: note: type `()` does not implement interface `ImplicitAs(C(123))` [MissingImplInMemberAccessNote] +// CHECK:STDERR: fail_int_value.carbon:[[@LINE+3]]:1: note: type `()` does not implement interface `Core.ImplicitAs(C(123))` [MissingImplInMemberAccessNote] // CHECK:STDERR: var v: C(123) = (); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~ var v: C(123) = (); diff --git a/toolchain/check/testdata/class/self.carbon b/toolchain/check/testdata/class/self.carbon index 07e1effb44501..4ba9a050fa960 100644 --- a/toolchain/check/testdata/class/self.carbon +++ b/toolchain/check/testdata/class/self.carbon @@ -35,7 +35,7 @@ class Class { // CHECK:STDERR: fail_return_self_value.carbon:[[@LINE+6]]:25: error: cannot implicitly convert from `Class` to `type` [ImplicitAsConversionFailure] // CHECK:STDERR: fn F[self: Self]() -> self; // CHECK:STDERR: ^~~~ - // CHECK:STDERR: fail_return_self_value.carbon:[[@LINE+3]]:25: note: type `Class` does not implement interface `ImplicitAs(type)` [MissingImplInMemberAccessNote] + // CHECK:STDERR: fail_return_self_value.carbon:[[@LINE+3]]:25: note: type `Class` does not implement interface `Core.ImplicitAs(type)` [MissingImplInMemberAccessNote] // CHECK:STDERR: fn F[self: Self]() -> self; // CHECK:STDERR: ^~~~ fn F[self: Self]() -> self; diff --git a/toolchain/check/testdata/const/fail_collapse.carbon b/toolchain/check/testdata/const/fail_collapse.carbon index d7b1e1776a5d5..9cffd7c0824de 100644 --- a/toolchain/check/testdata/const/fail_collapse.carbon +++ b/toolchain/check/testdata/const/fail_collapse.carbon @@ -16,7 +16,7 @@ fn G(p: const (const i32)**) -> i32** { // CHECK:STDERR: fail_collapse.carbon:[[@LINE+6]]:3: error: cannot implicitly convert from `const i32**` to `i32**` [ImplicitAsConversionFailure] // CHECK:STDERR: return p; // CHECK:STDERR: ^~~~~~~~~ - // CHECK:STDERR: fail_collapse.carbon:[[@LINE+3]]:3: note: type `const i32**` does not implement interface `ImplicitAs(i32**)` [MissingImplInMemberAccessNote] + // CHECK:STDERR: fail_collapse.carbon:[[@LINE+3]]:3: note: type `const i32**` does not implement interface `Core.ImplicitAs(i32**)` [MissingImplInMemberAccessNote] // CHECK:STDERR: return p; // CHECK:STDERR: ^~~~~~~~~ return p; diff --git a/toolchain/check/testdata/deduce/array.carbon b/toolchain/check/testdata/deduce/array.carbon index 63ae9cf40346d..598049b5ebcdc 100644 --- a/toolchain/check/testdata/deduce/array.carbon +++ b/toolchain/check/testdata/deduce/array.carbon @@ -69,7 +69,7 @@ fn G() -> C { // CHECK:STDERR: fail_bound_mismatch.carbon:[[@LINE+10]]:12: error: cannot implicitly convert from `[C; 3]` to `[C; 2]` [ImplicitAsConversionFailure] // CHECK:STDERR: return F(a); // CHECK:STDERR: ^ - // CHECK:STDERR: fail_bound_mismatch.carbon:[[@LINE+7]]:12: note: type `[C; 3]` does not implement interface `ImplicitAs([C; 2])` [MissingImplInMemberAccessNote] + // CHECK:STDERR: fail_bound_mismatch.carbon:[[@LINE+7]]:12: note: type `[C; 3]` does not implement interface `Core.ImplicitAs([C; 2])` [MissingImplInMemberAccessNote] // CHECK:STDERR: return F(a); // CHECK:STDERR: ^ // CHECK:STDERR: fail_bound_mismatch.carbon:[[@LINE-11]]:16: note: initializing function parameter [InCallToFunctionParam] diff --git a/toolchain/check/testdata/function/call/fail_param_type.carbon b/toolchain/check/testdata/function/call/fail_param_type.carbon index 8ff54f984fd4f..d8c62c916c500 100644 --- a/toolchain/check/testdata/function/call/fail_param_type.carbon +++ b/toolchain/check/testdata/function/call/fail_param_type.carbon @@ -14,7 +14,7 @@ fn F() { // CHECK:STDERR: fail_param_type.carbon:[[@LINE+9]]:5: error: cannot implicitly convert from `f64` to `i32` [ImplicitAsConversionFailure] // CHECK:STDERR: G(1.0); // CHECK:STDERR: ^~~ - // CHECK:STDERR: fail_param_type.carbon:[[@LINE+6]]:5: note: type `f64` does not implement interface `ImplicitAs(i32)` [MissingImplInMemberAccessNote] + // CHECK:STDERR: fail_param_type.carbon:[[@LINE+6]]:5: note: type `f64` does not implement interface `Core.ImplicitAs(i32)` [MissingImplInMemberAccessNote] // CHECK:STDERR: G(1.0); // CHECK:STDERR: ^~~ // CHECK:STDERR: fail_param_type.carbon:[[@LINE-9]]:6: note: initializing function parameter [InCallToFunctionParam] diff --git a/toolchain/check/testdata/function/call/fail_return_type_mismatch.carbon b/toolchain/check/testdata/function/call/fail_return_type_mismatch.carbon index a1ec025bcbdf3..57f653b1e173c 100644 --- a/toolchain/check/testdata/function/call/fail_return_type_mismatch.carbon +++ b/toolchain/check/testdata/function/call/fail_return_type_mismatch.carbon @@ -14,7 +14,7 @@ fn Run() { // CHECK:STDERR: fail_return_type_mismatch.carbon:[[@LINE+6]]:3: error: cannot implicitly convert from `f64` to `i32` [ImplicitAsConversionFailure] // CHECK:STDERR: var x: i32 = Foo(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_return_type_mismatch.carbon:[[@LINE+3]]:3: note: type `f64` does not implement interface `ImplicitAs(i32)` [MissingImplInMemberAccessNote] + // CHECK:STDERR: fail_return_type_mismatch.carbon:[[@LINE+3]]:3: note: type `f64` does not implement interface `Core.ImplicitAs(i32)` [MissingImplInMemberAccessNote] // CHECK:STDERR: var x: i32 = Foo(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~ var x: i32 = Foo(); diff --git a/toolchain/check/testdata/impl/fail_impl_bad_interface.carbon b/toolchain/check/testdata/impl/fail_impl_bad_interface.carbon index 4a165b8a0d60e..da50bddc369bd 100644 --- a/toolchain/check/testdata/impl/fail_impl_bad_interface.carbon +++ b/toolchain/check/testdata/impl/fail_impl_bad_interface.carbon @@ -15,7 +15,7 @@ library "[[@TEST_NAME]]"; // CHECK:STDERR: fail_impl_as_false.carbon:[[@LINE+7]]:13: error: cannot implicitly convert from `bool` to `type` [ImplicitAsConversionFailure] // CHECK:STDERR: impl i32 as false {} // CHECK:STDERR: ^~~~~ -// CHECK:STDERR: fail_impl_as_false.carbon:[[@LINE+4]]:13: note: type `bool` does not implement interface `ImplicitAs(type)` [MissingImplInMemberAccessNote] +// CHECK:STDERR: fail_impl_as_false.carbon:[[@LINE+4]]:13: note: type `bool` does not implement interface `Core.ImplicitAs(type)` [MissingImplInMemberAccessNote] // CHECK:STDERR: impl i32 as false {} // CHECK:STDERR: ^~~~~ // CHECK:STDERR: diff --git a/toolchain/check/testdata/impl/lookup/no_prelude/import.carbon b/toolchain/check/testdata/impl/lookup/no_prelude/import.carbon index 04484d724bceb..2a5267c67d6be 100644 --- a/toolchain/check/testdata/impl/lookup/no_prelude/import.carbon +++ b/toolchain/check/testdata/impl/lookup/no_prelude/import.carbon @@ -183,7 +183,7 @@ import HasExtraInterfaces; fn Test(c: HasExtraInterfaces.C(type)) { // This triggers the import of a bunch more interfaces, which reallocates the // interface ValueStore. Ensure that doesn't result in a use-after-free crash. - // CHECK:STDERR: fail_use_has_extra_interfaces.carbon:[[@LINE+3]]:3: error: cannot access member of interface `I` in type `C(type)` that does not implement that interface [MissingImplInMemberAccess] + // CHECK:STDERR: fail_use_has_extra_interfaces.carbon:[[@LINE+3]]:3: error: cannot access member of interface `HasExtraInterfaces.I` in type `HasExtraInterfaces.C(type)` that does not implement that interface [MissingImplInMemberAccess] // CHECK:STDERR: c.(HasExtraInterfaces.I.F)(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~ c.(HasExtraInterfaces.I.F)(); diff --git a/toolchain/check/testdata/index/fail_array_non_int_indexing.carbon b/toolchain/check/testdata/index/fail_array_non_int_indexing.carbon index 74829b071f384..b38d5cb614917 100644 --- a/toolchain/check/testdata/index/fail_array_non_int_indexing.carbon +++ b/toolchain/check/testdata/index/fail_array_non_int_indexing.carbon @@ -12,7 +12,7 @@ var a: [i32; 1] = (12,); // CHECK:STDERR: fail_array_non_int_indexing.carbon:[[@LINE+6]]:16: error: cannot implicitly convert from `f64` to `i32` [ImplicitAsConversionFailure] // CHECK:STDERR: var b: i32 = a[2.6]; // CHECK:STDERR: ^~~ -// CHECK:STDERR: fail_array_non_int_indexing.carbon:[[@LINE+3]]:16: note: type `f64` does not implement interface `ImplicitAs(i32)` [MissingImplInMemberAccessNote] +// CHECK:STDERR: fail_array_non_int_indexing.carbon:[[@LINE+3]]:16: note: type `f64` does not implement interface `Core.ImplicitAs(i32)` [MissingImplInMemberAccessNote] // CHECK:STDERR: var b: i32 = a[2.6]; // CHECK:STDERR: ^~~ var b: i32 = a[2.6]; diff --git a/toolchain/check/testdata/index/fail_negative_indexing.carbon b/toolchain/check/testdata/index/fail_negative_indexing.carbon index 6b64234e0b7e8..c62619df16cd0 100644 --- a/toolchain/check/testdata/index/fail_negative_indexing.carbon +++ b/toolchain/check/testdata/index/fail_negative_indexing.carbon @@ -9,7 +9,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/index/fail_negative_indexing.carbon var c: [i32; 2] = (42, 42); -// CHECK:STDERR: fail_negative_indexing.carbon:[[@LINE+3]]:16: error: cannot access member of interface `Negate` in type `Core.IntLiteral` that does not implement that interface [MissingImplInMemberAccess] +// CHECK:STDERR: fail_negative_indexing.carbon:[[@LINE+3]]:16: error: cannot access member of interface `Core.Negate` in type `Core.IntLiteral` that does not implement that interface [MissingImplInMemberAccess] // CHECK:STDERR: var d: i32 = c[-10]; // CHECK:STDERR: ^~~ var d: i32 = c[-10]; diff --git a/toolchain/check/testdata/interface/fail_assoc_const_bad_default.carbon b/toolchain/check/testdata/interface/fail_assoc_const_bad_default.carbon index 7c80f963419f4..6ceef63cff67a 100644 --- a/toolchain/check/testdata/interface/fail_assoc_const_bad_default.carbon +++ b/toolchain/check/testdata/interface/fail_assoc_const_bad_default.carbon @@ -12,7 +12,7 @@ interface I { // CHECK:STDERR: fail_assoc_const_bad_default.carbon:[[@LINE+6]]:3: error: cannot implicitly convert from `Core.IntLiteral` to `type` [ImplicitAsConversionFailure] // CHECK:STDERR: let T:! type = 42; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_assoc_const_bad_default.carbon:[[@LINE+3]]:3: note: type `Core.IntLiteral` does not implement interface `ImplicitAs(type)` [MissingImplInMemberAccessNote] + // CHECK:STDERR: fail_assoc_const_bad_default.carbon:[[@LINE+3]]:3: note: type `Core.IntLiteral` does not implement interface `Core.ImplicitAs(type)` [MissingImplInMemberAccessNote] // CHECK:STDERR: let T:! type = 42; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~ let T:! type = 42; diff --git a/toolchain/check/testdata/let/compile_time_bindings.carbon b/toolchain/check/testdata/let/compile_time_bindings.carbon index 70f9880b45cc6..65c530e99cc3a 100644 --- a/toolchain/check/testdata/let/compile_time_bindings.carbon +++ b/toolchain/check/testdata/let/compile_time_bindings.carbon @@ -110,7 +110,7 @@ interface I { // CHECK:STDERR: fail_return_in_interface.carbon:[[@LINE+7]]:13: error: cannot implicitly convert from `` to `type` [ImplicitAsConversionFailure] // CHECK:STDERR: fn F() -> T; // CHECK:STDERR: ^ - // CHECK:STDERR: fail_return_in_interface.carbon:[[@LINE+4]]:13: note: type `` does not implement interface `ImplicitAs(type)` [MissingImplInMemberAccessNote] + // CHECK:STDERR: fail_return_in_interface.carbon:[[@LINE+4]]:13: note: type `` does not implement interface `Core.ImplicitAs(type)` [MissingImplInMemberAccessNote] // CHECK:STDERR: fn F() -> T; // CHECK:STDERR: ^ // CHECK:STDERR: diff --git a/toolchain/check/testdata/let/fail_generic.carbon b/toolchain/check/testdata/let/fail_generic.carbon index 824702625ea0d..15f6673b9f638 100644 --- a/toolchain/check/testdata/let/fail_generic.carbon +++ b/toolchain/check/testdata/let/fail_generic.carbon @@ -14,7 +14,7 @@ fn F(a: i32) -> i32 { // CHECK:STDERR: fail_generic.carbon:[[@LINE+7]]:3: error: cannot implicitly convert from `Core.IntLiteral` to `T` [ImplicitAsConversionFailure] // CHECK:STDERR: let x: T = 5; // CHECK:STDERR: ^~~~~~~~~~~~~ - // CHECK:STDERR: fail_generic.carbon:[[@LINE+4]]:3: note: type `Core.IntLiteral` does not implement interface `ImplicitAs(T)` [MissingImplInMemberAccessNote] + // CHECK:STDERR: fail_generic.carbon:[[@LINE+4]]:3: note: type `Core.IntLiteral` does not implement interface `Core.ImplicitAs(T)` [MissingImplInMemberAccessNote] // CHECK:STDERR: let x: T = 5; // CHECK:STDERR: ^~~~~~~~~~~~~ // CHECK:STDERR: @@ -22,7 +22,7 @@ fn F(a: i32) -> i32 { // CHECK:STDERR: fail_generic.carbon:[[@LINE+6]]:3: error: cannot implicitly convert from `T` to `i32` [ImplicitAsConversionFailure] // CHECK:STDERR: return x; // CHECK:STDERR: ^~~~~~~~~ - // CHECK:STDERR: fail_generic.carbon:[[@LINE+3]]:3: note: type `T` does not implement interface `ImplicitAs(i32)` [MissingImplInMemberAccessNote] + // CHECK:STDERR: fail_generic.carbon:[[@LINE+3]]:3: note: type `T` does not implement interface `Core.ImplicitAs(i32)` [MissingImplInMemberAccessNote] // CHECK:STDERR: return x; // CHECK:STDERR: ^~~~~~~~~ return x; diff --git a/toolchain/check/testdata/namespace/imported_indirect.carbon b/toolchain/check/testdata/namespace/imported_indirect.carbon index 55f62d06d9df8..c059c78479039 100644 --- a/toolchain/check/testdata/namespace/imported_indirect.carbon +++ b/toolchain/check/testdata/namespace/imported_indirect.carbon @@ -14,6 +14,8 @@ package Same library "[[@TEST_NAME]]"; namespace A; +class A.C; + // --- b.carbon package Same library "[[@TEST_NAME]]"; @@ -21,6 +23,8 @@ import library "a"; namespace A.B; +fn F() -> A.C; + // --- c.carbon package Same library "[[@TEST_NAME]]"; @@ -42,8 +46,53 @@ import library "d"; var e: () = A.B.C.D(); +// --- fail_named_indirectly_same_package.carbon + +package Same library "[[@TEST_NAME]]"; + +import library "b"; + +// CHECK:STDERR: fail_named_indirectly_same_package.carbon:[[@LINE+13]]:10: error: function returns incomplete type `A.C` [IncompleteTypeInFunctionReturnType] +// CHECK:STDERR: fn G() { F(); } +// CHECK:STDERR: ^~~ +// CHECK:STDERR: fail_named_indirectly_same_package.carbon:[[@LINE-5]]:1: in import [InImport] +// CHECK:STDERR: b.carbon:3:1: in import [InImport] +// CHECK:STDERR: a.carbon:6:1: note: class was forward declared here [ClassForwardDeclaredHere] +// CHECK:STDERR: class A.C; +// CHECK:STDERR: ^~~~~~~~~~ +// CHECK:STDERR: fail_named_indirectly_same_package.carbon:[[@LINE-10]]:1: in import [InImport] +// CHECK:STDERR: b.carbon:7:8: note: return type declared here [IncompleteReturnTypeHere] +// CHECK:STDERR: fn F() -> A.C; +// CHECK:STDERR: ^~~~~~ +// CHECK:STDERR: +fn G() { F(); } + +// --- fail_named_indirectly_different_package.carbon + +package Other library "[[@TEST_NAME]]"; + +import Same library "b"; + +// CHECK:STDERR: fail_named_indirectly_different_package.carbon:[[@LINE+12]]:10: error: function returns incomplete type `Same.A.C` [IncompleteTypeInFunctionReturnType] +// CHECK:STDERR: fn G() { Same.F(); } +// CHECK:STDERR: ^~~~~~~~ +// CHECK:STDERR: fail_named_indirectly_different_package.carbon:[[@LINE-5]]:1: in import [InImport] +// CHECK:STDERR: b.carbon:3:1: in import [InImport] +// CHECK:STDERR: a.carbon:6:1: note: class was forward declared here [ClassForwardDeclaredHere] +// CHECK:STDERR: class A.C; +// CHECK:STDERR: ^~~~~~~~~~ +// CHECK:STDERR: fail_named_indirectly_different_package.carbon:[[@LINE-10]]:1: in import [InImport] +// CHECK:STDERR: b.carbon:7:8: note: return type declared here [IncompleteReturnTypeHere] +// CHECK:STDERR: fn F() -> A.C; +// CHECK:STDERR: ^~~~~~ +fn G() { Same.F(); } + // CHECK:STDOUT: --- a.carbon // CHECK:STDOUT: +// CHECK:STDOUT: constants { +// CHECK:STDOUT: %C: type = class_type @C [template] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude @@ -57,16 +106,29 @@ var e: () = A.B.C.D(); // CHECK:STDOUT: .A = %A // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %A: = namespace [template] {} +// CHECK:STDOUT: %A: = namespace [template] { +// CHECK:STDOUT: .C = %C.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: class @C; +// CHECK:STDOUT: // CHECK:STDOUT: --- b.carbon // CHECK:STDOUT: +// CHECK:STDOUT: constants { +// CHECK:STDOUT: %C: type = class_type @C [template] +// CHECK:STDOUT: %F.type: type = fn_type @F [template] +// CHECK:STDOUT: %F: %F.type = struct_value () [template] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref: = import_ref Same//a, A, loaded -// CHECK:STDOUT: %A: = namespace %import_ref, [template] { +// CHECK:STDOUT: %import_ref.1: = import_ref Same//a, A, loaded +// CHECK:STDOUT: %A: = namespace %import_ref.1, [template] { +// CHECK:STDOUT: .C = %import_ref.2 // CHECK:STDOUT: .B = file.%B // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.2: type = import_ref Same//a, C, loaded [template = constants.%C] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -77,12 +139,26 @@ var e: () = A.B.C.D(); // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .A = imports.%A // CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %B: = namespace [template] {} +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { +// CHECK:STDOUT: %return.patt: %C = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %C = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %A.ref: = name_ref A, imports.%A [template = imports.%A] +// CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.2 [template = constants.%C] +// CHECK:STDOUT: %return.param: ref %C = out_param runtime_param0 +// CHECK:STDOUT: %return: ref %C = return_slot %return.param +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: class @C [from "a.carbon"]; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @F() -> %C; +// CHECK:STDOUT: // CHECK:STDOUT: --- c.carbon // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -90,6 +166,7 @@ var e: () = A.B.C.D(); // CHECK:STDOUT: %A: = namespace %import_ref.1, [template] { // CHECK:STDOUT: .B = %B // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.3 = import_ref Same//b, F, unloaded // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... @@ -99,6 +176,7 @@ var e: () = A.B.C.D(); // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .A = imports.%A +// CHECK:STDOUT: .F = imports.%import_ref.3 // CHECK:STDOUT: .Core = imports.%Core // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core @@ -194,3 +272,93 @@ var e: () = A.B.C.D(); // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: --- fail_named_indirectly_same_package.carbon +// CHECK:STDOUT: +// CHECK:STDOUT: constants { +// CHECK:STDOUT: %G.type: type = fn_type @G [template] +// CHECK:STDOUT: %G: %G.type = struct_value () [template] +// CHECK:STDOUT: %F.type: type = fn_type @F [template] +// CHECK:STDOUT: %F: %F.type = struct_value () [template] +// CHECK:STDOUT: %C: type = class_type @C [template] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: = import_ref Same//b, A, loaded +// CHECK:STDOUT: %A: = namespace %import_ref.1, [template] { +// CHECK:STDOUT: .B = %B +// CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.3: %F.type = import_ref Same//b, F, loaded [template = constants.%F] +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: import Core//prelude +// CHECK:STDOUT: import Core//prelude/... +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .A = imports.%A +// CHECK:STDOUT: .F = imports.%import_ref.3 +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .G = %G.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] {} {} +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: class @C [from "b.carbon"]; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @G() { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %F.ref: %F.type = name_ref F, imports.%import_ref.3 [template = constants.%F] +// CHECK:STDOUT: %F.call: init = call %F.ref() +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @F() -> %C [from "b.carbon"]; +// CHECK:STDOUT: +// CHECK:STDOUT: --- fail_named_indirectly_different_package.carbon +// CHECK:STDOUT: +// CHECK:STDOUT: constants { +// CHECK:STDOUT: %G.type: type = fn_type @G [template] +// CHECK:STDOUT: %G: %G.type = struct_value () [template] +// CHECK:STDOUT: %F.type: type = fn_type @F [template] +// CHECK:STDOUT: %F: %F.type = struct_value () [template] +// CHECK:STDOUT: %C: type = class_type @C [template] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: import Core//prelude +// CHECK:STDOUT: import Core//prelude/... +// CHECK:STDOUT: } +// CHECK:STDOUT: %Same: = namespace file.%Same.import, [template] { +// CHECK:STDOUT: .F = %import_ref +// CHECK:STDOUT: import Same//b +// CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %F.type = import_ref Same//b, F, loaded [template = constants.%F] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Same = imports.%Same +// CHECK:STDOUT: .G = %G.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %Same.import = import Same +// CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] {} {} +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: class @C [from "b.carbon"]; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @G() { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Same.ref: = name_ref Same, imports.%Same [template = imports.%Same] +// CHECK:STDOUT: %F.ref: %F.type = name_ref F, imports.%import_ref [template = constants.%F] +// CHECK:STDOUT: %F.call: init = call %F.ref() +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @F() -> %C [from "b.carbon"]; +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/operators/builtin/fail_type_mismatch.carbon b/toolchain/check/testdata/operators/builtin/fail_type_mismatch.carbon index 792ab5be51c0e..164949a70fa39 100644 --- a/toolchain/check/testdata/operators/builtin/fail_type_mismatch.carbon +++ b/toolchain/check/testdata/operators/builtin/fail_type_mismatch.carbon @@ -12,7 +12,7 @@ fn Main() { // CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+6]]:17: error: cannot implicitly convert from `Core.IntLiteral` to `bool` [ImplicitAsConversionFailure] // CHECK:STDERR: var x: bool = not 12; // CHECK:STDERR: ^~~~~~ - // CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+3]]:17: note: type `Core.IntLiteral` does not implement interface `ImplicitAs(bool)` [MissingImplInMemberAccessNote] + // CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+3]]:17: note: type `Core.IntLiteral` does not implement interface `Core.ImplicitAs(bool)` [MissingImplInMemberAccessNote] // CHECK:STDERR: var x: bool = not 12; // CHECK:STDERR: ^~~~~~ var x: bool = not 12; diff --git a/toolchain/check/testdata/operators/builtin/fail_type_mismatch_assignment.carbon b/toolchain/check/testdata/operators/builtin/fail_type_mismatch_assignment.carbon index b9159fa3ff905..84ff5fcc8835f 100644 --- a/toolchain/check/testdata/operators/builtin/fail_type_mismatch_assignment.carbon +++ b/toolchain/check/testdata/operators/builtin/fail_type_mismatch_assignment.carbon @@ -13,7 +13,7 @@ fn Main() { // CHECK:STDERR: fail_type_mismatch_assignment.carbon:[[@LINE+6]]:3: error: cannot implicitly convert from `f64` to `i32` [ImplicitAsConversionFailure] // CHECK:STDERR: a = 5.6; // CHECK:STDERR: ^~~~~~~ - // CHECK:STDERR: fail_type_mismatch_assignment.carbon:[[@LINE+3]]:3: note: type `f64` does not implement interface `ImplicitAs(i32)` [MissingImplInMemberAccessNote] + // CHECK:STDERR: fail_type_mismatch_assignment.carbon:[[@LINE+3]]:3: note: type `f64` does not implement interface `Core.ImplicitAs(i32)` [MissingImplInMemberAccessNote] // CHECK:STDERR: a = 5.6; // CHECK:STDERR: ^~~~~~~ a = 5.6; diff --git a/toolchain/check/testdata/operators/builtin/fail_type_mismatch_once.carbon b/toolchain/check/testdata/operators/builtin/fail_type_mismatch_once.carbon index fb16090423dcb..cffdd1230ffa9 100644 --- a/toolchain/check/testdata/operators/builtin/fail_type_mismatch_once.carbon +++ b/toolchain/check/testdata/operators/builtin/fail_type_mismatch_once.carbon @@ -11,11 +11,11 @@ fn Main() -> i32 { // The following line has two mismatches, but after the first, it shouldn't // keep erroring. - // CHECK:STDERR: fail_type_mismatch_once.carbon:[[@LINE+7]]:10: error: cannot access member of interface `Add` in type `Core.IntLiteral` that does not implement that interface [MissingImplInMemberAccess] + // CHECK:STDERR: fail_type_mismatch_once.carbon:[[@LINE+7]]:10: error: cannot access member of interface `Core.Add` in type `Core.IntLiteral` that does not implement that interface [MissingImplInMemberAccess] // CHECK:STDERR: return 12 + 3.4 + 12; // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: - // CHECK:STDERR: fail_type_mismatch_once.carbon:[[@LINE+3]]:10: error: cannot access member of interface `Add` in type `` that does not implement that interface [MissingImplInMemberAccess] + // CHECK:STDERR: fail_type_mismatch_once.carbon:[[@LINE+3]]:10: error: cannot access member of interface `Core.Add` in type `` that does not implement that interface [MissingImplInMemberAccess] // CHECK:STDERR: return 12 + 3.4 + 12; // CHECK:STDERR: ^~~~~~~~~~~~~ return 12 + 3.4 + 12; diff --git a/toolchain/check/testdata/operators/builtin/fail_unimplemented_op.carbon b/toolchain/check/testdata/operators/builtin/fail_unimplemented_op.carbon index 3af3394a67679..365bb892370ab 100644 --- a/toolchain/check/testdata/operators/builtin/fail_unimplemented_op.carbon +++ b/toolchain/check/testdata/operators/builtin/fail_unimplemented_op.carbon @@ -9,7 +9,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/operators/builtin/fail_unimplemented_op.carbon fn Main() -> i32 { - // CHECK:STDERR: fail_unimplemented_op.carbon:[[@LINE+3]]:10: error: cannot access member of interface `Add` in type `Core.IntLiteral` that does not implement that interface [MissingImplInMemberAccess] + // CHECK:STDERR: fail_unimplemented_op.carbon:[[@LINE+3]]:10: error: cannot access member of interface `Core.Add` in type `Core.IntLiteral` that does not implement that interface [MissingImplInMemberAccess] // CHECK:STDERR: return 12 + 34; // CHECK:STDERR: ^~~~~~~ return 12 + 34; diff --git a/toolchain/check/testdata/operators/overloaded/eq.carbon b/toolchain/check/testdata/operators/overloaded/eq.carbon index f6d4e6d1666bc..14cfe5079c7a7 100644 --- a/toolchain/check/testdata/operators/overloaded/eq.carbon +++ b/toolchain/check/testdata/operators/overloaded/eq.carbon @@ -34,7 +34,7 @@ package FailNoImpl; class D {}; fn TestEqual(a: D, b: D) -> bool { - // CHECK:STDERR: fail_no_impl.carbon:[[@LINE+4]]:10: error: cannot access member of interface `Eq` in type `D` that does not implement that interface [MissingImplInMemberAccess] + // CHECK:STDERR: fail_no_impl.carbon:[[@LINE+4]]:10: error: cannot access member of interface `Core.Eq` in type `D` that does not implement that interface [MissingImplInMemberAccess] // CHECK:STDERR: return a == b; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: @@ -42,7 +42,7 @@ fn TestEqual(a: D, b: D) -> bool { } fn TestNotEqual(a: D, b: D) -> bool { - // CHECK:STDERR: fail_no_impl.carbon:[[@LINE+4]]:10: error: cannot access member of interface `Eq` in type `D` that does not implement that interface [MissingImplInMemberAccess] + // CHECK:STDERR: fail_no_impl.carbon:[[@LINE+4]]:10: error: cannot access member of interface `Core.Eq` in type `D` that does not implement that interface [MissingImplInMemberAccess] // CHECK:STDERR: return a != b; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: @@ -65,7 +65,7 @@ fn TestRhsBad(a: C, b: D) -> bool { // CHECK:STDERR: fail_no_impl_for_args.carbon:[[@LINE+10]]:15: error: cannot implicitly convert from `D` to `C` [ImplicitAsConversionFailure] // CHECK:STDERR: return a == b; // CHECK:STDERR: ^ - // CHECK:STDERR: fail_no_impl_for_args.carbon:[[@LINE+7]]:15: note: type `D` does not implement interface `ImplicitAs(C)` [MissingImplInMemberAccessNote] + // CHECK:STDERR: fail_no_impl_for_args.carbon:[[@LINE+7]]:15: note: type `D` does not implement interface `Core.ImplicitAs(C)` [MissingImplInMemberAccessNote] // CHECK:STDERR: return a == b; // CHECK:STDERR: ^ // CHECK:STDERR: fail_no_impl_for_args.carbon:[[@LINE-11]]:21: note: initializing function parameter [InCallToFunctionParam] @@ -76,7 +76,7 @@ fn TestRhsBad(a: C, b: D) -> bool { } fn TestLhsBad(a: D, b: C) -> bool { - // CHECK:STDERR: fail_no_impl_for_args.carbon:[[@LINE+3]]:10: error: cannot access member of interface `Eq` in type `D` that does not implement that interface [MissingImplInMemberAccess] + // CHECK:STDERR: fail_no_impl_for_args.carbon:[[@LINE+3]]:10: error: cannot access member of interface `Core.Eq` in type `D` that does not implement that interface [MissingImplInMemberAccess] // CHECK:STDERR: return a != b; // CHECK:STDERR: ^~~~~~ return a != b; diff --git a/toolchain/check/testdata/operators/overloaded/fail_no_impl.carbon b/toolchain/check/testdata/operators/overloaded/fail_no_impl.carbon index 8046e1bf4bf62..f76473272923c 100644 --- a/toolchain/check/testdata/operators/overloaded/fail_no_impl.carbon +++ b/toolchain/check/testdata/operators/overloaded/fail_no_impl.carbon @@ -13,7 +13,7 @@ package User; class C {}; fn TestUnary(a: C) -> C { - // CHECK:STDERR: fail_no_impl.carbon:[[@LINE+4]]:10: error: cannot access member of interface `Negate` in type `C` that does not implement that interface [MissingImplInMemberAccess] + // CHECK:STDERR: fail_no_impl.carbon:[[@LINE+4]]:10: error: cannot access member of interface `Core.Negate` in type `C` that does not implement that interface [MissingImplInMemberAccess] // CHECK:STDERR: return -a; // CHECK:STDERR: ^~ // CHECK:STDERR: @@ -21,7 +21,7 @@ fn TestUnary(a: C) -> C { } fn TestBinary(a: C, b: C) -> C { - // CHECK:STDERR: fail_no_impl.carbon:[[@LINE+4]]:10: error: cannot access member of interface `Add` in type `C` that does not implement that interface [MissingImplInMemberAccess] + // CHECK:STDERR: fail_no_impl.carbon:[[@LINE+4]]:10: error: cannot access member of interface `Core.Add` in type `C` that does not implement that interface [MissingImplInMemberAccess] // CHECK:STDERR: return a + b; // CHECK:STDERR: ^~~~~ // CHECK:STDERR: @@ -30,12 +30,12 @@ fn TestBinary(a: C, b: C) -> C { fn TestRef(b: C) { var a: C = {}; - // CHECK:STDERR: fail_no_impl.carbon:[[@LINE+4]]:3: error: cannot access member of interface `AddAssign` in type `C` that does not implement that interface [MissingImplInMemberAccess] + // CHECK:STDERR: fail_no_impl.carbon:[[@LINE+4]]:3: error: cannot access member of interface `Core.AddAssign` in type `C` that does not implement that interface [MissingImplInMemberAccess] // CHECK:STDERR: a += b; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: a += b; - // CHECK:STDERR: fail_no_impl.carbon:[[@LINE+3]]:3: error: cannot access member of interface `Inc` in type `C` that does not implement that interface [MissingImplInMemberAccess] + // CHECK:STDERR: fail_no_impl.carbon:[[@LINE+3]]:3: error: cannot access member of interface `Core.Inc` in type `C` that does not implement that interface [MissingImplInMemberAccess] // CHECK:STDERR: ++a; // CHECK:STDERR: ^~~ ++a; diff --git a/toolchain/check/testdata/operators/overloaded/fail_no_impl_for_arg.carbon b/toolchain/check/testdata/operators/overloaded/fail_no_impl_for_arg.carbon index 99f27df7ac3bd..6ea10283ce257 100644 --- a/toolchain/check/testdata/operators/overloaded/fail_no_impl_for_arg.carbon +++ b/toolchain/check/testdata/operators/overloaded/fail_no_impl_for_arg.carbon @@ -24,7 +24,7 @@ fn Test(a: C, b: D) -> C { // CHECK:STDERR: fail_no_impl_for_arg.carbon:[[@LINE+10]]:14: error: cannot implicitly convert from `D` to `C` [ImplicitAsConversionFailure] // CHECK:STDERR: return a + b; // CHECK:STDERR: ^ - // CHECK:STDERR: fail_no_impl_for_arg.carbon:[[@LINE+7]]:14: note: type `D` does not implement interface `ImplicitAs(C)` [MissingImplInMemberAccessNote] + // CHECK:STDERR: fail_no_impl_for_arg.carbon:[[@LINE+7]]:14: note: type `D` does not implement interface `Core.ImplicitAs(C)` [MissingImplInMemberAccessNote] // CHECK:STDERR: return a + b; // CHECK:STDERR: ^ // CHECK:STDERR: fail_no_impl_for_arg.carbon:[[@LINE-13]]:18: note: initializing function parameter [InCallToFunctionParam] @@ -39,7 +39,7 @@ fn TestAssign(b: D) { // CHECK:STDERR: fail_no_impl_for_arg.carbon:[[@LINE+9]]:8: error: cannot implicitly convert from `D` to `C` [ImplicitAsConversionFailure] // CHECK:STDERR: a += b; // CHECK:STDERR: ^ - // CHECK:STDERR: fail_no_impl_for_arg.carbon:[[@LINE+6]]:8: note: type `D` does not implement interface `ImplicitAs(C)` [MissingImplInMemberAccessNote] + // CHECK:STDERR: fail_no_impl_for_arg.carbon:[[@LINE+6]]:8: note: type `D` does not implement interface `Core.ImplicitAs(C)` [MissingImplInMemberAccessNote] // CHECK:STDERR: a += b; // CHECK:STDERR: ^ // CHECK:STDERR: fail_no_impl_for_arg.carbon:[[@LINE-25]]:24: note: initializing function parameter [InCallToFunctionParam] diff --git a/toolchain/check/testdata/operators/overloaded/index.carbon b/toolchain/check/testdata/operators/overloaded/index.carbon index b58034c271289..1bf1bcfde2c0c 100644 --- a/toolchain/check/testdata/operators/overloaded/index.carbon +++ b/toolchain/check/testdata/operators/overloaded/index.carbon @@ -57,7 +57,7 @@ let c: C = {}; // CHECK:STDERR: fail_invalid_subscript_type.carbon:[[@LINE+7]]:22: error: cannot implicitly convert from `Core.IntLiteral` to `SubscriptType` [ImplicitAsConversionFailure] // CHECK:STDERR: let x: ElementType = c[0]; // CHECK:STDERR: ^~~~ -// CHECK:STDERR: fail_invalid_subscript_type.carbon:[[@LINE+4]]:22: note: type `Core.IntLiteral` does not implement interface `ImplicitAs(SubscriptType)` [MissingImplInMemberAccessNote] +// CHECK:STDERR: fail_invalid_subscript_type.carbon:[[@LINE+4]]:22: note: type `Core.IntLiteral` does not implement interface `Core.ImplicitAs(SubscriptType)` [MissingImplInMemberAccessNote] // CHECK:STDERR: let x: ElementType = c[0]; // CHECK:STDERR: ^~~~ // CHECK:STDERR: diff --git a/toolchain/check/testdata/operators/overloaded/ordered.carbon b/toolchain/check/testdata/operators/overloaded/ordered.carbon index dbafbba67b5e9..b65479c0edc70 100644 --- a/toolchain/check/testdata/operators/overloaded/ordered.carbon +++ b/toolchain/check/testdata/operators/overloaded/ordered.carbon @@ -44,7 +44,7 @@ package FailNoImpl; class D {}; fn TestLess(a: D, b: D) -> bool { - // CHECK:STDERR: fail_no_impl.carbon:[[@LINE+4]]:10: error: cannot access member of interface `Ordered` in type `D` that does not implement that interface [MissingImplInMemberAccess] + // CHECK:STDERR: fail_no_impl.carbon:[[@LINE+4]]:10: error: cannot access member of interface `Core.Ordered` in type `D` that does not implement that interface [MissingImplInMemberAccess] // CHECK:STDERR: return a < b; // CHECK:STDERR: ^~~~~ // CHECK:STDERR: @@ -52,7 +52,7 @@ fn TestLess(a: D, b: D) -> bool { } fn TestLessEqual(a: D, b: D) -> bool { - // CHECK:STDERR: fail_no_impl.carbon:[[@LINE+4]]:10: error: cannot access member of interface `Ordered` in type `D` that does not implement that interface [MissingImplInMemberAccess] + // CHECK:STDERR: fail_no_impl.carbon:[[@LINE+4]]:10: error: cannot access member of interface `Core.Ordered` in type `D` that does not implement that interface [MissingImplInMemberAccess] // CHECK:STDERR: return a <= b; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: @@ -60,7 +60,7 @@ fn TestLessEqual(a: D, b: D) -> bool { } fn TestGreater(a: D, b: D) -> bool { - // CHECK:STDERR: fail_no_impl.carbon:[[@LINE+4]]:10: error: cannot access member of interface `Ordered` in type `D` that does not implement that interface [MissingImplInMemberAccess] + // CHECK:STDERR: fail_no_impl.carbon:[[@LINE+4]]:10: error: cannot access member of interface `Core.Ordered` in type `D` that does not implement that interface [MissingImplInMemberAccess] // CHECK:STDERR: return a > b; // CHECK:STDERR: ^~~~~ // CHECK:STDERR: @@ -68,7 +68,7 @@ fn TestGreater(a: D, b: D) -> bool { } fn TestGreaterEqual(a: D, b: D) -> bool { - // CHECK:STDERR: fail_no_impl.carbon:[[@LINE+3]]:10: error: cannot access member of interface `Ordered` in type `D` that does not implement that interface [MissingImplInMemberAccess] + // CHECK:STDERR: fail_no_impl.carbon:[[@LINE+3]]:10: error: cannot access member of interface `Core.Ordered` in type `D` that does not implement that interface [MissingImplInMemberAccess] // CHECK:STDERR: return a >= b; // CHECK:STDERR: ^~~~~~ return a >= b; diff --git a/toolchain/check/testdata/pointer/fail_type_mismatch.carbon b/toolchain/check/testdata/pointer/fail_type_mismatch.carbon index df39aa7761031..54e9aa51a3ca3 100644 --- a/toolchain/check/testdata/pointer/fail_type_mismatch.carbon +++ b/toolchain/check/testdata/pointer/fail_type_mismatch.carbon @@ -12,7 +12,7 @@ fn ConstMismatch(p: const {}*) -> const ({}*) { // CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+6]]:3: error: cannot implicitly convert from `const {}*` to `const ({}*)` [ImplicitAsConversionFailure] // CHECK:STDERR: return p; // CHECK:STDERR: ^~~~~~~~~ - // CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+3]]:3: note: type `const {}*` does not implement interface `ImplicitAs(const ({}*))` [MissingImplInMemberAccessNote] + // CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+3]]:3: note: type `const {}*` does not implement interface `Core.ImplicitAs(const ({}*))` [MissingImplInMemberAccessNote] // CHECK:STDERR: return p; // CHECK:STDERR: ^~~~~~~~~ return p; diff --git a/toolchain/check/testdata/return/fail_type_mismatch.carbon b/toolchain/check/testdata/return/fail_type_mismatch.carbon index 177171072ceee..912ed3a02c73c 100644 --- a/toolchain/check/testdata/return/fail_type_mismatch.carbon +++ b/toolchain/check/testdata/return/fail_type_mismatch.carbon @@ -12,7 +12,7 @@ fn Main() -> i32 { // CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+6]]:3: error: cannot implicitly convert from `f64` to `i32` [ImplicitAsConversionFailure] // CHECK:STDERR: return 1.0; // CHECK:STDERR: ^~~~~~~~~~~ - // CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+3]]:3: note: type `f64` does not implement interface `ImplicitAs(i32)` [MissingImplInMemberAccessNote] + // CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+3]]:3: note: type `f64` does not implement interface `Core.ImplicitAs(i32)` [MissingImplInMemberAccessNote] // CHECK:STDERR: return 1.0; // CHECK:STDERR: ^~~~~~~~~~~ return 1.0; diff --git a/toolchain/check/testdata/struct/fail_type_assign.carbon b/toolchain/check/testdata/struct/fail_type_assign.carbon index 20fb8f7d5cdcb..104603681e2dc 100644 --- a/toolchain/check/testdata/struct/fail_type_assign.carbon +++ b/toolchain/check/testdata/struct/fail_type_assign.carbon @@ -11,7 +11,7 @@ // CHECK:STDERR: fail_type_assign.carbon:[[@LINE+6]]:1: error: cannot implicitly convert from `type` to `{.a: i32}` [ImplicitAsConversionFailure] // CHECK:STDERR: var x: {.a: i32} = {.a: i32}; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_type_assign.carbon:[[@LINE+3]]:1: note: type `type` does not implement interface `ImplicitAs({.a: i32})` [MissingImplInMemberAccessNote] +// CHECK:STDERR: fail_type_assign.carbon:[[@LINE+3]]:1: note: type `type` does not implement interface `Core.ImplicitAs({.a: i32})` [MissingImplInMemberAccessNote] // CHECK:STDERR: var x: {.a: i32} = {.a: i32}; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ var x: {.a: i32} = {.a: i32}; diff --git a/toolchain/check/testdata/struct/fail_value_as_type.carbon b/toolchain/check/testdata/struct/fail_value_as_type.carbon index 0283a5756e64e..0a5725a17446d 100644 --- a/toolchain/check/testdata/struct/fail_value_as_type.carbon +++ b/toolchain/check/testdata/struct/fail_value_as_type.carbon @@ -11,7 +11,7 @@ // CHECK:STDERR: fail_value_as_type.carbon:[[@LINE+6]]:8: error: cannot implicitly convert from `{.a: Core.IntLiteral}` to `type` [ImplicitAsConversionFailure] // CHECK:STDERR: var x: {.a = 1}; // CHECK:STDERR: ^~~~~~~~ -// CHECK:STDERR: fail_value_as_type.carbon:[[@LINE+3]]:8: note: type `{.a: Core.IntLiteral}` does not implement interface `ImplicitAs(type)` [MissingImplInMemberAccessNote] +// CHECK:STDERR: fail_value_as_type.carbon:[[@LINE+3]]:8: note: type `{.a: Core.IntLiteral}` does not implement interface `Core.ImplicitAs(type)` [MissingImplInMemberAccessNote] // CHECK:STDERR: var x: {.a = 1}; // CHECK:STDERR: ^~~~~~~~ var x: {.a = 1}; diff --git a/toolchain/check/testdata/struct/import.carbon b/toolchain/check/testdata/struct/import.carbon index 9c422c8f0f6d6..8a3eb2418143f 100644 --- a/toolchain/check/testdata/struct/import.carbon +++ b/toolchain/check/testdata/struct/import.carbon @@ -43,10 +43,10 @@ var c_bad: C({.c = 1, .d = 2}) = F(); // --- fail_bad_value.impl.carbon impl package Implicit; -// CHECK:STDERR: fail_bad_value.impl.carbon:[[@LINE+6]]:1: error: cannot implicitly convert from `C()` to `C()` [ImplicitAsConversionFailure] +// CHECK:STDERR: fail_bad_value.impl.carbon:[[@LINE+6]]:1: error: cannot implicitly convert from `C()` to `C()` [ImplicitAsConversionFailure] // CHECK:STDERR: var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_bad_value.impl.carbon:[[@LINE+3]]:1: note: type `C()` does not implement interface `ImplicitAs(C())` [MissingImplInMemberAccessNote] +// CHECK:STDERR: fail_bad_value.impl.carbon:[[@LINE+3]]:1: note: type `C()` does not implement interface `Core.ImplicitAs(C())` [MissingImplInMemberAccessNote] // CHECK:STDERR: var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ var c_bad: C({.a = 3, .b = 4}) = F(); diff --git a/toolchain/check/testdata/tuple/access/fail_negative_indexing.carbon b/toolchain/check/testdata/tuple/access/fail_negative_indexing.carbon index 962fdb512d250..634fc9e1f20f6 100644 --- a/toolchain/check/testdata/tuple/access/fail_negative_indexing.carbon +++ b/toolchain/check/testdata/tuple/access/fail_negative_indexing.carbon @@ -9,7 +9,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/tuple/access/fail_negative_indexing.carbon var a: (i32, i32) = (12, 6); -// CHECK:STDERR: fail_negative_indexing.carbon:[[@LINE+3]]:17: error: cannot access member of interface `Negate` in type `Core.IntLiteral` that does not implement that interface [MissingImplInMemberAccess] +// CHECK:STDERR: fail_negative_indexing.carbon:[[@LINE+3]]:17: error: cannot access member of interface `Core.Negate` in type `Core.IntLiteral` that does not implement that interface [MissingImplInMemberAccess] // CHECK:STDERR: var b: i32 = a.(-10); // CHECK:STDERR: ^~~ var b: i32 = a.(-10); diff --git a/toolchain/check/testdata/tuple/access/fail_non_int_indexing.carbon b/toolchain/check/testdata/tuple/access/fail_non_int_indexing.carbon index 0ef8d327f8459..2b41b07cc0569 100644 --- a/toolchain/check/testdata/tuple/access/fail_non_int_indexing.carbon +++ b/toolchain/check/testdata/tuple/access/fail_non_int_indexing.carbon @@ -12,7 +12,7 @@ var a: (i32, i32) = (12, 6); // CHECK:STDERR: fail_non_int_indexing.carbon:[[@LINE+6]]:17: error: cannot implicitly convert from `f64` to `Core.IntLiteral` [ImplicitAsConversionFailure] // CHECK:STDERR: var b: i32 = a.(2.6); // CHECK:STDERR: ^~~ -// CHECK:STDERR: fail_non_int_indexing.carbon:[[@LINE+3]]:17: note: type `f64` does not implement interface `ImplicitAs(Core.IntLiteral)` [MissingImplInMemberAccessNote] +// CHECK:STDERR: fail_non_int_indexing.carbon:[[@LINE+3]]:17: note: type `f64` does not implement interface `Core.ImplicitAs(Core.IntLiteral)` [MissingImplInMemberAccessNote] // CHECK:STDERR: var b: i32 = a.(2.6); // CHECK:STDERR: ^~~ var b: i32 = a.(2.6); diff --git a/toolchain/check/testdata/tuple/fail_element_type_mismatch.carbon b/toolchain/check/testdata/tuple/fail_element_type_mismatch.carbon index 1164116045b29..d211e442a27ed 100644 --- a/toolchain/check/testdata/tuple/fail_element_type_mismatch.carbon +++ b/toolchain/check/testdata/tuple/fail_element_type_mismatch.carbon @@ -11,7 +11,7 @@ // CHECK:STDERR: fail_element_type_mismatch.carbon:[[@LINE+6]]:21: error: cannot implicitly convert from `f64` to `i32` [ImplicitAsConversionFailure] // CHECK:STDERR: var x: (i32, i32) = (2, 65.89); // CHECK:STDERR: ^~~~~~~~~~ -// CHECK:STDERR: fail_element_type_mismatch.carbon:[[@LINE+3]]:21: note: type `f64` does not implement interface `ImplicitAs(i32)` [MissingImplInMemberAccessNote] +// CHECK:STDERR: fail_element_type_mismatch.carbon:[[@LINE+3]]:21: note: type `f64` does not implement interface `Core.ImplicitAs(i32)` [MissingImplInMemberAccessNote] // CHECK:STDERR: var x: (i32, i32) = (2, 65.89); // CHECK:STDERR: ^~~~~~~~~~ var x: (i32, i32) = (2, 65.89); diff --git a/toolchain/check/testdata/tuple/fail_type_assign.carbon b/toolchain/check/testdata/tuple/fail_type_assign.carbon index 82eee3054189c..34ba3ef294c86 100644 --- a/toolchain/check/testdata/tuple/fail_type_assign.carbon +++ b/toolchain/check/testdata/tuple/fail_type_assign.carbon @@ -11,7 +11,7 @@ // CHECK:STDERR: fail_type_assign.carbon:[[@LINE+6]]:18: error: cannot implicitly convert from `type` to `i32` [ImplicitAsConversionFailure] // CHECK:STDERR: var x: (i32, ) = (i32, ); // CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: fail_type_assign.carbon:[[@LINE+3]]:18: note: type `type` does not implement interface `ImplicitAs(i32)` [MissingImplInMemberAccessNote] +// CHECK:STDERR: fail_type_assign.carbon:[[@LINE+3]]:18: note: type `type` does not implement interface `Core.ImplicitAs(i32)` [MissingImplInMemberAccessNote] // CHECK:STDERR: var x: (i32, ) = (i32, ); // CHECK:STDERR: ^~~~~~~ var x: (i32, ) = (i32, ); diff --git a/toolchain/check/testdata/tuple/fail_value_as_type.carbon b/toolchain/check/testdata/tuple/fail_value_as_type.carbon index 5f6c878dd8cde..ad24527852d64 100644 --- a/toolchain/check/testdata/tuple/fail_value_as_type.carbon +++ b/toolchain/check/testdata/tuple/fail_value_as_type.carbon @@ -11,7 +11,7 @@ // CHECK:STDERR: fail_value_as_type.carbon:[[@LINE+6]]:8: error: cannot implicitly convert from `Core.IntLiteral` to `type` [ImplicitAsConversionFailure] // CHECK:STDERR: var x: (1, ); // CHECK:STDERR: ^~~~~ -// CHECK:STDERR: fail_value_as_type.carbon:[[@LINE+3]]:8: note: type `Core.IntLiteral` does not implement interface `ImplicitAs(type)` [MissingImplInMemberAccessNote] +// CHECK:STDERR: fail_value_as_type.carbon:[[@LINE+3]]:8: note: type `Core.IntLiteral` does not implement interface `Core.ImplicitAs(type)` [MissingImplInMemberAccessNote] // CHECK:STDERR: var x: (1, ); // CHECK:STDERR: ^~~~~ var x: (1, ); diff --git a/toolchain/check/testdata/tuple/import.carbon b/toolchain/check/testdata/tuple/import.carbon index 2ea5c9c50ac38..91ca8ab9db3db 100644 --- a/toolchain/check/testdata/tuple/import.carbon +++ b/toolchain/check/testdata/tuple/import.carbon @@ -45,10 +45,10 @@ var c_bad: C((1, 2, 3)) = F(); impl package Implicit; -// CHECK:STDERR: fail_bad_value.impl.carbon:[[@LINE+6]]:1: error: cannot implicitly convert from `C()` to `C()` [ImplicitAsConversionFailure] +// CHECK:STDERR: fail_bad_value.impl.carbon:[[@LINE+6]]:1: error: cannot implicitly convert from `C()` to `C()` [ImplicitAsConversionFailure] // CHECK:STDERR: var c_bad: C((3, 4)) = F(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_bad_value.impl.carbon:[[@LINE+3]]:1: note: type `C()` does not implement interface `ImplicitAs(C())` [MissingImplInMemberAccessNote] +// CHECK:STDERR: fail_bad_value.impl.carbon:[[@LINE+3]]:1: note: type `C()` does not implement interface `Core.ImplicitAs(C())` [MissingImplInMemberAccessNote] // CHECK:STDERR: var c_bad: C((3, 4)) = F(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~ var c_bad: C((3, 4)) = F(); diff --git a/toolchain/check/testdata/var/fail_storage_is_literal.carbon b/toolchain/check/testdata/var/fail_storage_is_literal.carbon index 3e55f28c4fced..f799ed7a0b969 100644 --- a/toolchain/check/testdata/var/fail_storage_is_literal.carbon +++ b/toolchain/check/testdata/var/fail_storage_is_literal.carbon @@ -12,7 +12,7 @@ fn Main() { // CHECK:STDERR: fail_storage_is_literal.carbon:[[@LINE+6]]:10: error: cannot implicitly convert from `Core.IntLiteral` to `type` [ImplicitAsConversionFailure] // CHECK:STDERR: var x: 1 = 1; // CHECK:STDERR: ^ - // CHECK:STDERR: fail_storage_is_literal.carbon:[[@LINE+3]]:10: note: type `Core.IntLiteral` does not implement interface `ImplicitAs(type)` [MissingImplInMemberAccessNote] + // CHECK:STDERR: fail_storage_is_literal.carbon:[[@LINE+3]]:10: note: type `Core.IntLiteral` does not implement interface `Core.ImplicitAs(type)` [MissingImplInMemberAccessNote] // CHECK:STDERR: var x: 1 = 1; // CHECK:STDERR: ^ var x: 1 = 1; diff --git a/toolchain/check/testdata/where_expr/constraints.carbon b/toolchain/check/testdata/where_expr/constraints.carbon index a005cf801d235..da847fe511118 100644 --- a/toolchain/check/testdata/where_expr/constraints.carbon +++ b/toolchain/check/testdata/where_expr/constraints.carbon @@ -45,7 +45,7 @@ library "[[@TEST_NAME]]"; // CHECK:STDERR: fail_left_of_impls_non_type.carbon:[[@LINE+7]]:32: error: cannot implicitly convert from `Core.IntLiteral` to `type` [ImplicitAsConversionFailure] // CHECK:STDERR: fn NonTypeImpls(U:! type where 7 impls type); // CHECK:STDERR: ^ -// CHECK:STDERR: fail_left_of_impls_non_type.carbon:[[@LINE+4]]:32: note: type `Core.IntLiteral` does not implement interface `ImplicitAs(type)` [MissingImplInMemberAccessNote] +// CHECK:STDERR: fail_left_of_impls_non_type.carbon:[[@LINE+4]]:32: note: type `Core.IntLiteral` does not implement interface `Core.ImplicitAs(type)` [MissingImplInMemberAccessNote] // CHECK:STDERR: fn NonTypeImpls(U:! type where 7 impls type); // CHECK:STDERR: ^ // CHECK:STDERR: @@ -58,7 +58,7 @@ library "[[@TEST_NAME]]"; // CHECK:STDERR: fail_right_of_impls_non_type.carbon:[[@LINE+7]]:44: error: cannot implicitly convert from `Core.IntLiteral` to `type` [ImplicitAsConversionFailure] // CHECK:STDERR: fn ImplsNonType(U:! type where .Self impls 7); // CHECK:STDERR: ^ -// CHECK:STDERR: fail_right_of_impls_non_type.carbon:[[@LINE+4]]:44: note: type `Core.IntLiteral` does not implement interface `ImplicitAs(type)` [MissingImplInMemberAccessNote] +// CHECK:STDERR: fail_right_of_impls_non_type.carbon:[[@LINE+4]]:44: note: type `Core.IntLiteral` does not implement interface `Core.ImplicitAs(type)` [MissingImplInMemberAccessNote] // CHECK:STDERR: fn ImplsNonType(U:! type where .Self impls 7); // CHECK:STDERR: ^ // CHECK:STDERR: @@ -89,7 +89,7 @@ fn DoesNotImplI() { // CHECK:STDERR: fail_todo_enforce_constraint.carbon:[[@LINE+11]]:3: error: cannot implicitly convert from `type` to `J where...` [ImplicitAsConversionFailure] // CHECK:STDERR: Impls(C); // CHECK:STDERR: ^~~~~~~~ - // CHECK:STDERR: fail_todo_enforce_constraint.carbon:[[@LINE+8]]:3: note: type `type` does not implement interface `ImplicitAs(J where...)` [MissingImplInMemberAccessNote] + // CHECK:STDERR: fail_todo_enforce_constraint.carbon:[[@LINE+8]]:3: note: type `type` does not implement interface `Core.ImplicitAs(J where...)` [MissingImplInMemberAccessNote] // CHECK:STDERR: Impls(C); // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: fail_todo_enforce_constraint.carbon:[[@LINE-14]]:1: in import [InImport] @@ -107,7 +107,7 @@ fn NotEmptyStruct() { // CHECK:STDERR: fail_todo_enforce_constraint.carbon:[[@LINE+9]]:3: error: cannot implicitly convert from `type` to `J where...` [ImplicitAsConversionFailure] // CHECK:STDERR: EmptyStruct(C); // CHECK:STDERR: ^~~~~~~~~~~~~~ - // CHECK:STDERR: fail_todo_enforce_constraint.carbon:[[@LINE+6]]:3: note: type `type` does not implement interface `ImplicitAs(J where...)` [MissingImplInMemberAccessNote] + // CHECK:STDERR: fail_todo_enforce_constraint.carbon:[[@LINE+6]]:3: note: type `type` does not implement interface `Core.ImplicitAs(J where...)` [MissingImplInMemberAccessNote] // CHECK:STDERR: EmptyStruct(C); // CHECK:STDERR: ^~~~~~~~~~~~~~ // CHECK:STDERR: fail_todo_enforce_constraint.carbon:[[@LINE-10]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] diff --git a/toolchain/check/testdata/where_expr/equal_rewrite.carbon b/toolchain/check/testdata/where_expr/equal_rewrite.carbon index 21d6e3d66dd1c..6725d2a6c34cc 100644 --- a/toolchain/check/testdata/where_expr/equal_rewrite.carbon +++ b/toolchain/check/testdata/where_expr/equal_rewrite.carbon @@ -76,7 +76,7 @@ fn WithBool(R:! O where .P = bool) { // CHECK:STDERR: fail_rewrites_mismatch_right.carbon:[[@LINE+10]]:3: error: cannot implicitly convert from `O where .(O.P) = bool` to `O where .(O.P) = i32` [ImplicitAsConversionFailure] // CHECK:STDERR: WithInteger(R); // CHECK:STDERR: ^~~~~~~~~~~~~~ - // CHECK:STDERR: fail_rewrites_mismatch_right.carbon:[[@LINE+7]]:3: note: type `O where .(O.P) = bool` does not implement interface `ImplicitAs(O where .(O.P) = i32)` [MissingImplInMemberAccessNote] + // CHECK:STDERR: fail_rewrites_mismatch_right.carbon:[[@LINE+7]]:3: note: type `O where .(O.P) = bool` does not implement interface `Core.ImplicitAs(O where .(O.P) = i32)` [MissingImplInMemberAccessNote] // CHECK:STDERR: WithInteger(R); // CHECK:STDERR: ^~~~~~~~~~~~~~ // CHECK:STDERR: fail_rewrites_mismatch_right.carbon:[[@LINE-9]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] @@ -101,7 +101,7 @@ fn WithU(W:! S where .U = ()) { // CHECK:STDERR: fail_rewrites_mismatch_left.carbon:[[@LINE+10]]:3: error: cannot implicitly convert from `S where .(S.U) = ()` to `S where .(S.T) = ()` [ImplicitAsConversionFailure] // CHECK:STDERR: WithT(W); // CHECK:STDERR: ^~~~~~~~ - // CHECK:STDERR: fail_rewrites_mismatch_left.carbon:[[@LINE+7]]:3: note: type `S where .(S.U) = ()` does not implement interface `ImplicitAs(S where .(S.T) = ())` [MissingImplInMemberAccessNote] + // CHECK:STDERR: fail_rewrites_mismatch_left.carbon:[[@LINE+7]]:3: note: type `S where .(S.U) = ()` does not implement interface `Core.ImplicitAs(S where .(S.T) = ())` [MissingImplInMemberAccessNote] // CHECK:STDERR: WithT(W); // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: fail_rewrites_mismatch_left.carbon:[[@LINE-9]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] @@ -122,7 +122,7 @@ fn Calls() { // CHECK:STDERR: fail_import_rewrites.carbon:[[@LINE+11]]:3: error: cannot implicitly convert from `type` to `N where .(N.P) = {}` [ImplicitAsConversionFailure] // CHECK:STDERR: Equal(bool); // CHECK:STDERR: ^~~~~~~~~~~ - // CHECK:STDERR: fail_import_rewrites.carbon:[[@LINE+8]]:3: note: type `type` does not implement interface `ImplicitAs(N where .(N.P) = {})` [MissingImplInMemberAccessNote] + // CHECK:STDERR: fail_import_rewrites.carbon:[[@LINE+8]]:3: note: type `type` does not implement interface `Core.ImplicitAs(N where .(N.P) = {})` [MissingImplInMemberAccessNote] // CHECK:STDERR: Equal(bool); // CHECK:STDERR: ^~~~~~~~~~~ // CHECK:STDERR: fail_import_rewrites.carbon:[[@LINE-10]]:1: in import [InImport] @@ -135,7 +135,7 @@ fn Calls() { // CHECK:STDERR: fail_import_rewrites.carbon:[[@LINE+11]]:3: error: cannot implicitly convert from `type` to `A where .(A.C) = () and .(A.B) = bool` [ImplicitAsConversionFailure] // CHECK:STDERR: NestedRewrite(i32); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_import_rewrites.carbon:[[@LINE+8]]:3: note: type `type` does not implement interface `ImplicitAs(A where .(A.C) = () and .(A.B) = bool)` [MissingImplInMemberAccessNote] + // CHECK:STDERR: fail_import_rewrites.carbon:[[@LINE+8]]:3: note: type `type` does not implement interface `Core.ImplicitAs(A where .(A.C) = () and .(A.B) = bool)` [MissingImplInMemberAccessNote] // CHECK:STDERR: NestedRewrite(i32); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_import_rewrites.carbon:[[@LINE-23]]:1: in import [InImport] @@ -158,7 +158,7 @@ interface I { // CHECK:STDERR: fail_check_rewrite_constraints.carbon:[[@LINE+7]]:46: error: cannot implicitly convert from `Core.IntLiteral` to `type` [ImplicitAsConversionFailure] // CHECK:STDERR: fn RewriteTypeMismatch(X:! I where .Member = 2); // CHECK:STDERR: ^ -// CHECK:STDERR: fail_check_rewrite_constraints.carbon:[[@LINE+4]]:46: note: type `Core.IntLiteral` does not implement interface `ImplicitAs(type)` [MissingImplInMemberAccessNote] +// CHECK:STDERR: fail_check_rewrite_constraints.carbon:[[@LINE+4]]:46: note: type `Core.IntLiteral` does not implement interface `Core.ImplicitAs(type)` [MissingImplInMemberAccessNote] // CHECK:STDERR: fn RewriteTypeMismatch(X:! I where .Member = 2); // CHECK:STDERR: ^ // CHECK:STDERR: @@ -175,7 +175,7 @@ impl D as A {} // CHECK:STDERR: fail_todo_let.carbon:[[@LINE+7]]:1: error: cannot implicitly convert from `type` to `type where...` [ImplicitAsConversionFailure] // CHECK:STDERR: let B: type where .Self impls A = D; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_todo_let.carbon:[[@LINE+4]]:1: note: type `type` does not implement interface `ImplicitAs(type where...)` [MissingImplInMemberAccessNote] +// CHECK:STDERR: fail_todo_let.carbon:[[@LINE+4]]:1: note: type `type` does not implement interface `Core.ImplicitAs(type where...)` [MissingImplInMemberAccessNote] // CHECK:STDERR: let B: type where .Self impls A = D; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -195,7 +195,7 @@ interface E { // CHECK:STDERR: fail_type_does_not_implement_where.carbon:[[@LINE+7]]:1: error: cannot implicitly convert from `type` to `E where .(E.G) = () and .(E.F) = bool` [ImplicitAsConversionFailure] // CHECK:STDERR: let H: (E where .F = bool and .G = ()) = f64; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_type_does_not_implement_where.carbon:[[@LINE+4]]:1: note: type `type` does not implement interface `ImplicitAs(E where .(E.G) = () and .(E.F) = bool)` [MissingImplInMemberAccessNote] +// CHECK:STDERR: fail_type_does_not_implement_where.carbon:[[@LINE+4]]:1: note: type `type` does not implement interface `Core.ImplicitAs(E where .(E.G) = () and .(E.F) = bool)` [MissingImplInMemberAccessNote] // CHECK:STDERR: let H: (E where .F = bool and .G = ()) = f64; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -204,7 +204,7 @@ let H: (E where .F = bool and .G = ()) = f64; // CHECK:STDERR: fail_type_does_not_implement_where.carbon:[[@LINE+7]]:1: error: cannot implicitly convert from `type` to `E where .(E.G) = i32 and .(E.F) = {}` [ImplicitAsConversionFailure] // CHECK:STDERR: let J: ((E where .F = {}) where .G = i32) = bool; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_type_does_not_implement_where.carbon:[[@LINE+4]]:1: note: type `type` does not implement interface `ImplicitAs(E where .(E.G) = i32 and .(E.F) = {})` [MissingImplInMemberAccessNote] +// CHECK:STDERR: fail_type_does_not_implement_where.carbon:[[@LINE+4]]:1: note: type `type` does not implement interface `Core.ImplicitAs(E where .(E.G) = i32 and .(E.F) = {})` [MissingImplInMemberAccessNote] // CHECK:STDERR: let J: ((E where .F = {}) where .G = i32) = bool; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -213,7 +213,7 @@ let J: ((E where .F = {}) where .G = i32) = bool; // CHECK:STDERR: fail_type_does_not_implement_where.carbon:[[@LINE+6]]:1: error: cannot implicitly convert from `type` to `E where .(E.F) = .(E.G)` [ImplicitAsConversionFailure] // CHECK:STDERR: let K: (E where .F = .Self.G) = bool; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_type_does_not_implement_where.carbon:[[@LINE+3]]:1: note: type `type` does not implement interface `ImplicitAs(E where .(E.F) = .(E.G))` [MissingImplInMemberAccessNote] +// CHECK:STDERR: fail_type_does_not_implement_where.carbon:[[@LINE+3]]:1: note: type `type` does not implement interface `Core.ImplicitAs(E where .(E.F) = .(E.G))` [MissingImplInMemberAccessNote] // CHECK:STDERR: let K: (E where .F = .Self.G) = bool; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ let K: (E where .F = .Self.G) = bool; diff --git a/toolchain/check/testdata/while/fail_bad_condition.carbon b/toolchain/check/testdata/while/fail_bad_condition.carbon index c02bcb402fd69..c8836c528c306 100644 --- a/toolchain/check/testdata/while/fail_bad_condition.carbon +++ b/toolchain/check/testdata/while/fail_bad_condition.carbon @@ -12,7 +12,7 @@ fn While() { // CHECK:STDERR: fail_bad_condition.carbon:[[@LINE+6]]:9: error: cannot implicitly convert from `String` to `bool` [ImplicitAsConversionFailure] // CHECK:STDERR: while ("Hello") {} // CHECK:STDERR: ^~~~~~~~~ - // CHECK:STDERR: fail_bad_condition.carbon:[[@LINE+3]]:9: note: type `String` does not implement interface `ImplicitAs(bool)` [MissingImplInMemberAccessNote] + // CHECK:STDERR: fail_bad_condition.carbon:[[@LINE+3]]:9: note: type `String` does not implement interface `Core.ImplicitAs(bool)` [MissingImplInMemberAccessNote] // CHECK:STDERR: while ("Hello") {} // CHECK:STDERR: ^~~~~~~~~ while ("Hello") {} diff --git a/toolchain/sem_ir/stringify_type.cpp b/toolchain/sem_ir/stringify_type.cpp index 9429bc3767659..7a83f22913fdc 100644 --- a/toolchain/sem_ir/stringify_type.cpp +++ b/toolchain/sem_ir/stringify_type.cpp @@ -6,6 +6,7 @@ #include "toolchain/base/kind_switch.h" #include "toolchain/sem_ir/entity_with_params_base.h" +#include "toolchain/sem_ir/ids.h" namespace Carbon::SemIR { @@ -65,6 +66,29 @@ class StepStack { auto PushNameId(NameId name_id) -> void { steps.push_back({.kind = Name, .name_id = name_id}); } + auto PushQualifiedName(NameScopeId name_scope_id, NameId name_id) -> void { + PushNameId(name_id); + while (name_scope_id.is_valid() && name_scope_id != NameScopeId::Package) { + const auto& name_scope = sem_ir->name_scopes().Get(name_scope_id); + // TODO: Decide how to print unnamed scopes. + if (name_scope.name_id().is_valid()) { + PushString("."); + // TODO: For a generic scope, pass a SpecificId to this function and + // include the relevant arguments. + PushNameId(name_scope.name_id()); + } + name_scope_id = name_scope.parent_scope_id(); + } + } + auto PushEntityName(const EntityWithParamsBase& entity, + SpecificId specific_id) -> void { + PushSpecificId(entity, specific_id); + PushQualifiedName(entity.parent_scope_id, entity.name_id); + } + auto PushEntityName(EntityNameId entity_name_id) -> void { + const auto& entity_name = sem_ir->entity_names().Get(entity_name_id); + PushQualifiedName(entity_name.parent_scope_id, entity_name.name_id); + } auto PushTypeId(TypeId type_id) -> void { PushInstId(sem_ir->types().GetInstId(type_id)); } @@ -174,14 +198,12 @@ auto StringifyTypeExpr(const SemIR::File& sem_ir, InstId outer_inst_id) case ExportDecl::Kind: { auto name_id = untyped_inst.As().entity_name_id; - out << sem_ir.names().GetFormatted( - sem_ir.entity_names().Get(name_id).name_id); + step_stack.PushEntityName(name_id); break; } case CARBON_KIND(ClassType inst): { const auto& class_info = sem_ir.classes().Get(inst.class_id); - out << sem_ir.names().GetFormatted(class_info.name_id); - step_stack.PushSpecificId(class_info, inst.specific_id); + step_stack.PushEntityName(class_info, inst.specific_id); break; } case CARBON_KIND(ConstType inst): { @@ -246,8 +268,7 @@ auto StringifyTypeExpr(const SemIR::File& sem_ir, InstId outer_inst_id) const auto& impls = facet_type_info.impls_constraints[index]; const auto& interface_info = sem_ir.interfaces().Get(impls.interface_id); - step_stack.PushSpecificId(interface_info, impls.specific_id); - step_stack.PushNameId(interface_info.name_id); + step_stack.PushEntityName(interface_info, impls.specific_id); if (index > 0) { step_stack.PushString(" & "); } @@ -293,8 +314,7 @@ auto StringifyTypeExpr(const SemIR::File& sem_ir, InstId outer_inst_id) } case CARBON_KIND(ImportRefUnloaded inst): { if (inst.entity_name_id.is_valid()) { - auto name_id = sem_ir.entity_names().Get(inst.entity_name_id).name_id; - out << sem_ir.names().GetFormatted(name_id); + step_stack.PushEntityName(inst.entity_name_id); } else { out << ""; } @@ -345,7 +365,7 @@ auto StringifyTypeExpr(const SemIR::File& sem_ir, InstId outer_inst_id) step_stack.PushInstId(entity_inst_id); } step_stack.PushString("."); - step_stack.PushNameId(interface.name_id); + step_stack.PushEntityName(interface, impls_constraint->specific_id); step_stack.PushString(".("); } else { step_stack.PushTypeId(witness_type_id); @@ -373,8 +393,9 @@ auto StringifyTypeExpr(const SemIR::File& sem_ir, InstId outer_inst_id) break; } case CARBON_KIND(Namespace inst): { - out << sem_ir.names().GetFormatted( - sem_ir.name_scopes().Get(inst.name_scope_id).name_id()); + const auto& name_scope = sem_ir.name_scopes().Get(inst.name_scope_id); + step_stack.PushQualifiedName(name_scope.parent_scope_id(), + name_scope.name_id()); break; } case CARBON_KIND(PointerType inst): { From 61c0a8b676e14b633348cd97828bb5340cbc5ec9 Mon Sep 17 00:00:00 2001 From: Jon Ross-Perkins Date: Wed, 11 Dec 2024 10:16:38 -0800 Subject: [PATCH 17/68] Make more use of llvm STLExtras (#4668) This is essentially the result of looking at `.begin()` uses. We also frequently do `std::shuffle`, but unfortunately STLExtras doesn't provide a wrapper for that. --- common/array_stack.h | 2 +- common/command_line.cpp | 7 ++--- common/hashing_test.cpp | 33 +++++++++------------- common/raw_hashtable_benchmark_helpers.cpp | 8 +++--- testing/base/source_gen.cpp | 6 ++-- testing/file_test/autoupdate.h | 4 +-- toolchain/check/deduce.cpp | 2 +- toolchain/check/impl_lookup.cpp | 12 ++++---- toolchain/check/scope_stack.cpp | 5 ++-- toolchain/lex/lex.cpp | 5 ++-- toolchain/lex/numeric_literal.cpp | 5 ++-- toolchain/lex/tokenized_buffer.cpp | 11 ++++---- toolchain/parse/extract.cpp | 2 +- toolchain/sem_ir/facet_type_info.cpp | 10 +++---- toolchain/testing/coverage_helper.h | 4 +-- 15 files changed, 52 insertions(+), 64 deletions(-) diff --git a/common/array_stack.h b/common/array_stack.h index 9021c8a4bdb53..8fdbbfe47259c 100644 --- a/common/array_stack.h +++ b/common/array_stack.h @@ -78,7 +78,7 @@ class ArrayStack { auto AppendToTop(llvm::ArrayRef values) -> void { CARBON_CHECK(!array_offsets_.empty(), "Must call PushArray before PushValues."); - values_.append(values.begin(), values.end()); + llvm::append_range(values_, values); } // Returns the current number of values in all arrays. diff --git a/common/command_line.cpp b/common/command_line.cpp index f17878ce716ce..95134bed0aa1d 100644 --- a/common/command_line.cpp +++ b/common/command_line.cpp @@ -1070,10 +1070,9 @@ auto Parser::FinalizeParsedOptions() -> ErrorOr { // Sort the missing arguments by name to provide a stable and deterministic // error message. We know there can't be duplicate names because these came // from a may keyed on the name, so this provides a total ordering. - std::sort(missing_options.begin(), missing_options.end(), - [](const Arg* lhs, const Arg* rhs) { - return lhs->info.name < rhs->info.name; - }); + llvm::sort(missing_options, [](const Arg* lhs, const Arg* rhs) { + return lhs->info.name < rhs->info.name; + }); std::string error_str = "required options not provided: "; llvm::raw_string_ostream error(error_str); diff --git a/common/hashing_test.cpp b/common/hashing_test.cpp index c332db8ccac31..df8231abd7433 100644 --- a/common/hashing_test.cpp +++ b/common/hashing_test.cpp @@ -592,9 +592,9 @@ auto FindBitRangeCollisions(llvm::ArrayRef> hashes) // Now we sort by the extracted bit sequence so we can efficiently scan for // colliding bit patterns. - std::sort( - bits_and_indices.begin(), bits_and_indices.end(), - [](const auto& lhs, const auto& rhs) { return lhs.bits < rhs.bits; }); + llvm::sort(bits_and_indices, [](const auto& lhs, const auto& rhs) { + return lhs.bits < rhs.bits; + }); // Scan the sorted bit sequences we've extracted looking for collisions. We // count the total collisions, but we also track the number of individual @@ -635,16 +635,15 @@ auto FindBitRangeCollisions(llvm::ArrayRef> hashes) } // Sort by collision count for each hash. - std::sort(bits_and_indices.begin(), bits_and_indices.end(), - [&](const auto& lhs, const auto& rhs) { - return collision_counts[collision_map[lhs.index]] < - collision_counts[collision_map[rhs.index]]; - }); + llvm::sort(bits_and_indices, [&](const auto& lhs, const auto& rhs) { + return collision_counts[collision_map[lhs.index]] < + collision_counts[collision_map[rhs.index]]; + }); // And compute the median and max. int median = collision_counts [collision_map[bits_and_indices[bits_and_indices.size() / 2].index]]; - int max = *std::max_element(collision_counts.begin(), collision_counts.end()); + int max = *llvm::max_element(collision_counts); CARBON_CHECK(max == collision_counts[collision_map[bits_and_indices.back().index]]); return {.total = total, .median = median, .max = max}; @@ -672,11 +671,9 @@ auto AllByteStringsHashedAndSorted() { hashes.push_back({HashValue(s, TestSeed), s}); } - std::sort(hashes.begin(), hashes.end(), - [](const HashedString& lhs, const HashedString& rhs) { - return static_cast(lhs.hash) < - static_cast(rhs.hash); - }); + llvm::sort(hashes, [](const HashedString& lhs, const HashedString& rhs) { + return static_cast(lhs.hash) < static_cast(rhs.hash); + }); CheckNoDuplicateValues(hashes); return hashes; @@ -832,11 +829,9 @@ struct SparseHashTest : ::testing::Test { } } - std::sort(hashes.begin(), hashes.end(), - [](const HashedString& lhs, const HashedString& rhs) { - return static_cast(lhs.hash) < - static_cast(rhs.hash); - }); + llvm::sort(hashes, [](const HashedString& lhs, const HashedString& rhs) { + return static_cast(lhs.hash) < static_cast(rhs.hash); + }); CheckNoDuplicateValues(hashes); return hashes; diff --git a/common/raw_hashtable_benchmark_helpers.cpp b/common/raw_hashtable_benchmark_helpers.cpp index 1199748b35fb5..5ba7cd13b6536 100644 --- a/common/raw_hashtable_benchmark_helpers.cpp +++ b/common/raw_hashtable_benchmark_helpers.cpp @@ -349,10 +349,10 @@ auto DumpHashStatistics(llvm::ArrayRef keys) -> void { grouped_key_indices[hash_index].push_back(i); } ssize_t max_group_index = - std::max_element(grouped_key_indices.begin(), grouped_key_indices.end(), - [](const auto& lhs, const auto& rhs) { - return lhs.size() < rhs.size(); - }) - + llvm::max_element(grouped_key_indices, + [](const auto& lhs, const auto& rhs) { + return lhs.size() < rhs.size(); + }) - grouped_key_indices.begin(); // If the max number of collisions on the index is less than or equal to the diff --git a/testing/base/source_gen.cpp b/testing/base/source_gen.cpp index 673225320d810..819dccc6e3c47 100644 --- a/testing/base/source_gen.cpp +++ b/testing/base/source_gen.cpp @@ -206,7 +206,7 @@ auto SourceGen::ClassGenState::BuildClassAndTypeNames( int num_declared_types = num_types * type_use_params.declared_types_weight / type_weight_sum; for ([[maybe_unused]] auto _ : llvm::seq(num_declared_types / num_classes)) { - type_names_.append(class_names_.begin(), class_names_.end()); + llvm::append_range(type_names_, class_names_); } // Now append the remainder number of class names. This is where the class // names being un-shuffled is essential. We're going to have one extra @@ -389,8 +389,8 @@ auto SourceGen::GetIdentifiers(int number, int min_length, int max_length, number, min_length, max_length, uniform, [this](int length, int length_count, llvm::SmallVectorImpl& dest) { - auto length_idents = GetSingleLengthIdentifiers(length, length_count); - dest.append(length_idents.begin(), length_idents.end()); + llvm::append_range(dest, + GetSingleLengthIdentifiers(length, length_count)); }); return idents; diff --git a/testing/file_test/autoupdate.h b/testing/file_test/autoupdate.h index f69f5ac9a5ad0..cc206e48739a5 100644 --- a/testing/file_test/autoupdate.h +++ b/testing/file_test/autoupdate.h @@ -58,8 +58,8 @@ class FileTestAutoupdater { // initialization. stdout_(BuildCheckLines(stdout, "STDOUT")), stderr_(BuildCheckLines(stderr, "STDERR")), - any_attached_stdout_lines_(std::any_of( - stdout_.lines.begin(), stdout_.lines.end(), + any_attached_stdout_lines_(llvm::any_of( + stdout_.lines, [&](const CheckLine& line) { return line.line_number() != -1; })), non_check_line_(non_check_lines_.begin()) { for (const auto& replacement : line_number_replacements_) { diff --git a/toolchain/check/deduce.cpp b/toolchain/check/deduce.cpp index ddb44d4816bf6..c4cfe8e8f016a 100644 --- a/toolchain/check/deduce.cpp +++ b/toolchain/check/deduce.cpp @@ -272,7 +272,7 @@ DeductionContext::DeductionContext(Context& context, SemIR::LocId loc_id, // to substitute them into the function declaration. auto args = context.inst_blocks().Get( context.specifics().Get(enclosing_specific_id).args_id); - std::copy(args.begin(), args.end(), result_arg_ids_.begin()); + llvm::copy(args, result_arg_ids_.begin()); // TODO: Subst is linear in the length of the substitutions list. Change // it so we can pass in an array mapping indexes to substitutions instead. diff --git a/toolchain/check/impl_lookup.cpp b/toolchain/check/impl_lookup.cpp index e0dc94187ccd3..53bc43686033f 100644 --- a/toolchain/check/impl_lookup.cpp +++ b/toolchain/check/impl_lookup.cpp @@ -38,8 +38,7 @@ static auto FindAssociatedImportIRs(Context& context, // Push the contents of an instruction block onto our worklist. auto push_block = [&](SemIR::InstBlockId block_id) { if (block_id.is_valid()) { - auto block = context.inst_blocks().Get(block_id); - worklist.append(block.begin(), block.end()); + llvm::append_range(worklist, context.inst_blocks().Get(block_id)); } }; @@ -102,11 +101,10 @@ static auto FindAssociatedImportIRs(Context& context, } // Deduplicate. - std::sort(result.begin(), result.end(), - [](SemIR::ImportIRId a, SemIR::ImportIRId b) { - return a.index < b.index; - }); - result.erase(std::unique(result.begin(), result.end()), result.end()); + llvm::sort(result, [](SemIR::ImportIRId a, SemIR::ImportIRId b) { + return a.index < b.index; + }); + result.erase(llvm::unique(result), result.end()); return result; } diff --git a/toolchain/check/scope_stack.cpp b/toolchain/check/scope_stack.cpp index cccdeeebfd698..019c30714c8cd 100644 --- a/toolchain/check/scope_stack.cpp +++ b/toolchain/check/scope_stack.cpp @@ -129,9 +129,8 @@ auto ScopeStack::LookupInLexicalScopes(SemIR::NameId name_id) // Find the first non-lexical scope that is within the scope of the lexical // lookup result. - auto* first_non_lexical_scope = std::lower_bound( - non_lexical_scope_stack_.begin(), non_lexical_scope_stack_.end(), - lexical_results.back().scope_index, + auto* first_non_lexical_scope = llvm::lower_bound( + non_lexical_scope_stack_, lexical_results.back().scope_index, [](const NonLexicalScope& scope, ScopeIndex index) { return scope.scope_index < index; }); diff --git a/toolchain/lex/lex.cpp b/toolchain/lex/lex.cpp index f11c2b8fce1b0..8cfbb3c2eea4e 100644 --- a/toolchain/lex/lex.cpp +++ b/toolchain/lex/lex.cpp @@ -1555,9 +1555,8 @@ auto Lexer::DiagnoseAndFixMismatchedBrackets() -> void { } // Find the innermost matching opening symbol. - auto opening_it = std::find_if( - open_groups_.rbegin(), open_groups_.rend(), - [&](TokenIndex opening_token) { + auto opening_it = llvm::find_if( + llvm::reverse(open_groups_), [&](TokenIndex opening_token) { return buffer_.GetTokenInfo(opening_token).kind().closing_symbol() == kind; }); diff --git a/toolchain/lex/numeric_literal.cpp b/toolchain/lex/numeric_literal.cpp index d75de7e8881aa..8a197bf8a1ae4 100644 --- a/toolchain/lex/numeric_literal.cpp +++ b/toolchain/lex/numeric_literal.cpp @@ -185,9 +185,8 @@ static auto ParseInt(llvm::StringRef digits, NumericLiteral::Radix radix, llvm::SmallString<32> cleaned; if (needs_cleaning) { cleaned.reserve(digits.size()); - std::remove_copy_if(digits.begin(), digits.end(), - std::back_inserter(cleaned), - [](char c) { return c == '_' || c == '.'; }); + llvm::copy_if(digits, std::back_inserter(cleaned), + [](char c) { return c != '_' && c != '.'; }); digits = cleaned; } diff --git a/toolchain/lex/tokenized_buffer.cpp b/toolchain/lex/tokenized_buffer.cpp index 6aec49a05cec7..e4a7652033438 100644 --- a/toolchain/lex/tokenized_buffer.cpp +++ b/toolchain/lex/tokenized_buffer.cpp @@ -317,10 +317,9 @@ auto TokenizedBuffer::PrintToken(llvm::raw_ostream& output_stream, auto TokenizedBuffer::FindLineIndex(int32_t byte_offset) const -> LineIndex { CARBON_DCHECK(!line_infos_.empty()); const auto* line_it = - std::partition_point(line_infos_.begin(), line_infos_.end(), - [byte_offset](LineInfo line_info) { - return line_info.start <= byte_offset; - }); + llvm::partition_point(line_infos_, [byte_offset](LineInfo line_info) { + return line_info.start <= byte_offset; + }); --line_it; // If this isn't the first line but it starts past the end of the source, then @@ -386,8 +385,8 @@ auto TokenizedBuffer::SourceBufferDiagnosticConverter::ConvertLoc( int32_t offset = loc - buffer_->source_->text().begin(); // Find the first line starting after the given location. - const auto* next_line_it = std::partition_point( - buffer_->line_infos_.begin(), buffer_->line_infos_.end(), + const auto* next_line_it = llvm::partition_point( + buffer_->line_infos_, [offset](const LineInfo& line) { return line.start <= offset; }); // Step back one line to find the line containing the given position. diff --git a/toolchain/parse/extract.cpp b/toolchain/parse/extract.cpp index 7106754d9fef7..ae4b87d0161dd 100644 --- a/toolchain/parse/extract.cpp +++ b/toolchain/parse/extract.cpp @@ -201,7 +201,7 @@ auto NodeExtractor::MatchesNodeIdOneOf( *trace_ << "\n"; } return false; - } else if (std::find(kinds.begin(), kinds.end(), node_kind) == kinds.end()) { + } else if (llvm::find(kinds, node_kind) == kinds.end()) { if (trace_) { *trace_ << "NodeIdOneOf error: wrong kind " << node_kind << ", expected "; trace_kinds(); diff --git a/toolchain/sem_ir/facet_type_info.cpp b/toolchain/sem_ir/facet_type_info.cpp index 667c3070a88b9..b132a75f8feba 100644 --- a/toolchain/sem_ir/facet_type_info.cpp +++ b/toolchain/sem_ir/facet_type_info.cpp @@ -7,14 +7,14 @@ namespace Carbon::SemIR { template -static auto SortAndDeduplicate(VecT* vec) -> void { - std::sort(vec->begin(), vec->end()); - vec->erase(std::unique(vec->begin(), vec->end()), vec->end()); +static auto SortAndDeduplicate(VecT& vec) -> void { + llvm::sort(vec); + vec.erase(llvm::unique(vec), vec.end()); } auto FacetTypeInfo::Canonicalize() -> void { - SortAndDeduplicate(&impls_constraints); - SortAndDeduplicate(&rewrite_constraints); + SortAndDeduplicate(impls_constraints); + SortAndDeduplicate(rewrite_constraints); } auto FacetTypeInfo::Print(llvm::raw_ostream& out) const -> void { diff --git a/toolchain/testing/coverage_helper.h b/toolchain/testing/coverage_helper.h index e91dc5792c999..135ddb72f7345 100644 --- a/toolchain/testing/coverage_helper.h +++ b/toolchain/testing/coverage_helper.h @@ -64,14 +64,14 @@ auto TestKindCoverage(const std::string& manifest_path, constexpr llvm::StringLiteral Bullet = "\n - "; - std::sort(missing_kinds.begin(), missing_kinds.end()); + llvm::sort(missing_kinds); EXPECT_TRUE(missing_kinds.empty()) << "Some kinds have no tests:" << Bullet << llvm::join(missing_kinds, Bullet); llvm::SmallVector unexpected_matches; covered_kinds.ForEach( [&](const std::string& match) { unexpected_matches.push_back(match); }); - std::sort(unexpected_matches.begin(), unexpected_matches.end()); + llvm::sort(unexpected_matches); EXPECT_TRUE(unexpected_matches.empty()) << "Matched things that aren't in the kind list:" << Bullet << llvm::join(unexpected_matches, Bullet); From 042ac394260c01aa1c1e401c1783519d5a8ce5cd Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Wed, 11 Dec 2024 10:53:58 -0800 Subject: [PATCH 18/68] Pacify CHECK failure on invalid code. (#4665) Found by fuzzer. --------- Co-authored-by: Jon Ross-Perkins --- toolchain/check/handle_impl.cpp | 9 ++- .../impl/no_prelude/error_recovery.carbon | 67 +++++++++++++++++++ 2 files changed, 74 insertions(+), 2 deletions(-) create mode 100644 toolchain/check/testdata/impl/no_prelude/error_recovery.carbon diff --git a/toolchain/check/handle_impl.cpp b/toolchain/check/handle_impl.cpp index 6e9fd86789116..33ebb26de0999 100644 --- a/toolchain/check/handle_impl.cpp +++ b/toolchain/check/handle_impl.cpp @@ -202,12 +202,17 @@ static auto PopImplIntroducerAndParamsAsNameComponent( context.node_stack().PopWithNodeIdIf(); if (implicit_param_patterns_id) { - // Emit the `forall` match. This shouldn't produce any `Call` params, + // Emit the `forall` match. This shouldn't produce any valid `Call` params, // because `impl`s are never actually called at runtime. auto call_params_id = CalleePatternMatch(context, *implicit_param_patterns_id, SemIR::InstBlockId::Invalid, SemIR::InstId::Invalid); - CARBON_CHECK(call_params_id == SemIR::InstBlockId::Empty); + CARBON_CHECK(call_params_id == SemIR::InstBlockId::Empty || + llvm::all_of(context.inst_blocks().Get(call_params_id), + [](SemIR::InstId inst_id) { + return inst_id == + SemIR::ErrorInst::SingletonInstId; + })); } Parse::NodeId first_param_node_id = diff --git a/toolchain/check/testdata/impl/no_prelude/error_recovery.carbon b/toolchain/check/testdata/impl/no_prelude/error_recovery.carbon new file mode 100644 index 0000000000000..a0dbffd769ddd --- /dev/null +++ b/toolchain/check/testdata/impl/no_prelude/error_recovery.carbon @@ -0,0 +1,67 @@ +// Part of the Carbon Language project, under the Apache License v2.0 with LLVM +// Exceptions. See /LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// AUTOUPDATE +// TIP: To test this file alone, run: +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/impl/no_prelude/error_recovery.carbon +// TIP: To dump output, run: +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/impl/no_prelude/error_recovery.carbon + +// --- fail_fuzz_crash.carbon + +class C {} +interface I {} + +// CHECK:STDERR: fail_fuzz_crash.carbon:[[@LINE+3]]:14: error: parameters of generic types must be constant [GenericParamMustBeConstant] +// CHECK:STDERR: impl forall [T: type] C as I { } +// CHECK:STDERR: ^~~~~~~ +impl forall [T: type] C as I { } + +// CHECK:STDOUT: --- fail_fuzz_crash.carbon +// CHECK:STDOUT: +// CHECK:STDOUT: constants { +// CHECK:STDOUT: %C: type = class_type @C [template] +// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %I.type: type = facet_type <@I> [template] +// CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic] +// CHECK:STDOUT: %interface: = interface_witness () [template] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .C = %C.decl +// CHECK:STDOUT: .I = %I.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} +// CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%I.type] {} {} +// CHECK:STDOUT: impl_decl @impl [template] {} { +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%I.type] +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: interface @I { +// CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self] +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = %Self +// CHECK:STDOUT: witness = () +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl: %C.ref as %I.ref { +// CHECK:STDOUT: %interface: = interface_witness () [template = constants.%interface] +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = %interface +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: class @C { +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = constants.%C +// CHECK:STDOUT: complete_type_witness = %complete_type +// CHECK:STDOUT: } +// CHECK:STDOUT: From 758b6c42ba0a610150fe96e95663eac552941c0e Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Wed, 11 Dec 2024 14:34:10 -0800 Subject: [PATCH 19/68] Produce a note indicating where the specific was used from if monomorphization fails. (#4662) Also fix a bug in `Context::GetClassType` that previously tried to complete the class type before returning it. That's not correct -- `GetCompleteTypeImpl` is only appropriate for cases where the type can trivially be completed and completing it can't fail -- and led to infinite recursion with this change because we would call `GetClassType` when producing a diagnostic if completing that class type failed. --- toolchain/check/check_unit.cpp | 5 +- toolchain/check/context.cpp | 63 ++++++----------- toolchain/check/decl_name_stack.cpp | 11 +-- toolchain/check/deduce.cpp | 2 +- toolchain/check/eval.cpp | 67 ++++++++++++++----- toolchain/check/eval.h | 3 +- toolchain/check/generic.cpp | 53 ++++++++++++--- toolchain/check/generic.h | 19 ++++-- toolchain/check/impl.cpp | 6 +- toolchain/check/impl_lookup.cpp | 2 +- toolchain/check/import_ref.cpp | 5 +- toolchain/check/subst.cpp | 4 +- .../function/generic/resolve_used.carbon | 3 + .../testdata/generic/complete_type.carbon | 26 ++++--- toolchain/diagnostics/diagnostic_kind.def | 1 + toolchain/sem_ir/stringify_type.cpp | 11 ++- 16 files changed, 179 insertions(+), 102 deletions(-) diff --git a/toolchain/check/check_unit.cpp b/toolchain/check/check_unit.cpp index 3d3e8d4bd8d64..54a5e5f9e8d76 100644 --- a/toolchain/check/check_unit.cpp +++ b/toolchain/check/check_unit.cpp @@ -402,7 +402,10 @@ auto CheckUnit::CheckRequiredDefinitions() -> void { CARBON_FATAL("TODO: Support interfaces in DiagnoseMissingDefinitions"); } case CARBON_KIND(SemIR::SpecificFunction specific_function): { - if (!ResolveSpecificDefinition(context_, + // TODO: Track a location for the use. In general we may want to track a + // list of enclosing locations if this was used from a generic. + SemIRLoc use_loc = decl_inst_id; + if (!ResolveSpecificDefinition(context_, use_loc, specific_function.specific_id)) { CARBON_DIAGNOSTIC(MissingGenericFunctionDefinition, Error, "use of undefined generic function"); diff --git a/toolchain/check/context.cpp b/toolchain/check/context.cpp index 5bb666cd0e401..adab63ebe771d 100644 --- a/toolchain/check/context.cpp +++ b/toolchain/check/context.cpp @@ -228,47 +228,21 @@ auto Context::DiagnoseNameNotFound(SemIRLoc loc, SemIR::NameId name_id) emitter_->Emit(loc, NameNotFound, name_id); } -// Given an instruction associated with a scope and a `SpecificId` for that -// scope, returns an instruction that describes the specific scope. -static auto GetInstForSpecificScope(Context& context, SemIR::InstId inst_id, - SemIR::SpecificId specific_id) - -> SemIR::InstId { - if (!specific_id.is_valid()) { - return inst_id; - } - auto inst = context.insts().Get(inst_id); - CARBON_KIND_SWITCH(inst) { - case CARBON_KIND(SemIR::ClassDecl class_decl): { - return context.types().GetInstId( - context.GetClassType(class_decl.class_id, specific_id)); - } - case CARBON_KIND(SemIR::InterfaceDecl interface_decl): { - return context.types().GetInstId( - context.GetInterfaceType(interface_decl.interface_id, specific_id)); - } - default: { - // Don't know how to form a specific for this generic scope. - // TODO: Handle more cases. - return SemIR::InstId::Invalid; - } - } -} - auto Context::DiagnoseMemberNameNotFound( SemIRLoc loc, SemIR::NameId name_id, llvm::ArrayRef lookup_scopes) -> void { if (lookup_scopes.size() == 1 && lookup_scopes.front().name_scope_id.is_valid()) { - const auto& scope = name_scopes().Get(lookup_scopes.front().name_scope_id); - if (auto specific_inst_id = GetInstForSpecificScope( - *this, scope.inst_id(), lookup_scopes.front().specific_id); - specific_inst_id.is_valid()) { - CARBON_DIAGNOSTIC(MemberNameNotFoundInScope, Error, - "member name `{0}` not found in {1}", SemIR::NameId, - InstIdAsType); - emitter_->Emit(loc, MemberNameNotFoundInScope, name_id, specific_inst_id); - return; - } + auto specific_id = lookup_scopes.front().specific_id; + auto scope_inst_id = + specific_id.is_valid() + ? GetInstForSpecific(*this, specific_id) + : name_scopes().Get(lookup_scopes.front().name_scope_id).inst_id(); + CARBON_DIAGNOSTIC(MemberNameNotFoundInScope, Error, + "member name `{0}` not found in {1}", SemIR::NameId, + InstIdAsType); + emitter_->Emit(loc, MemberNameNotFoundInScope, name_id, scope_inst_id); + return; } CARBON_DIAGNOSTIC(MemberNameNotFound, Error, "member name `{0}` not found", @@ -895,8 +869,9 @@ namespace { // complete. class TypeCompleter { public: - TypeCompleter(Context& context, Context::BuildDiagnosticFn diagnoser) - : context_(context), diagnoser_(diagnoser) {} + TypeCompleter(Context& context, SemIRLoc loc, + Context::BuildDiagnosticFn diagnoser) + : context_(context), loc_(loc), diagnoser_(diagnoser) {} // Attempts to complete the given type. Returns true if it is now complete, // false if it could not be completed. @@ -1009,7 +984,7 @@ class TypeCompleter { return false; } if (inst.specific_id.is_valid()) { - ResolveSpecificDefinition(context_, inst.specific_id); + ResolveSpecificDefinition(context_, loc_, inst.specific_id); } if (auto adapted_type_id = class_info.GetAdaptedType(context_.sem_ir(), inst.specific_id); @@ -1281,19 +1256,21 @@ class TypeCompleter { Context& context_; llvm::SmallVector work_list_; + SemIRLoc loc_; Context::BuildDiagnosticFn diagnoser_; }; } // namespace auto Context::TryToCompleteType(SemIR::TypeId type_id) -> bool { - return TypeCompleter(*this, nullptr).Complete(type_id); + // TODO: We need a location here in case we need to instantiate a class type. + return TypeCompleter(*this, SemIR::LocId::Invalid, nullptr).Complete(type_id); } auto Context::RequireCompleteType(SemIR::TypeId type_id, SemIR::LocId loc_id, BuildDiagnosticFn diagnoser) -> bool { CARBON_CHECK(diagnoser); - if (!TypeCompleter(*this, diagnoser).Complete(type_id)) { + if (!TypeCompleter(*this, loc_id, diagnoser).Complete(type_id)) { return false; } @@ -1358,7 +1335,7 @@ auto Context::RequireDefinedType(SemIR::TypeId type_id, SemIR::LocId loc_id, } if (interface.specific_id.is_valid()) { - ResolveSpecificDefinition(*this, interface.specific_id); + ResolveSpecificDefinition(*this, loc_id, interface.specific_id); } } // TODO: Finish facet type resolution. @@ -1443,7 +1420,7 @@ auto Context::GetSingletonType(SemIR::InstId singleton_id) -> SemIR::TypeId { auto Context::GetClassType(SemIR::ClassId class_id, SemIR::SpecificId specific_id) -> SemIR::TypeId { - return GetCompleteTypeImpl(*this, class_id, specific_id); + return GetTypeImpl(*this, class_id, specific_id); } auto Context::GetFunctionType(SemIR::FunctionId fn_id, diff --git a/toolchain/check/decl_name_stack.cpp b/toolchain/check/decl_name_stack.cpp index c8b795e6243c8..ae98f100ebfc0 100644 --- a/toolchain/check/decl_name_stack.cpp +++ b/toolchain/check/decl_name_stack.cpp @@ -115,7 +115,8 @@ auto DeclNameStack::Restore(SuspendedName sus) -> void { // Reattempt to resolve the definition of the specific. The generic might // have been defined after we suspended this scope. if (suspended_scope.entry.specific_id.is_valid()) { - ResolveSpecificDefinition(*context_, suspended_scope.entry.specific_id); + ResolveSpecificDefinition(*context_, sus.name_context.loc_id, + suspended_scope.entry.specific_id); } context_->scope_stack().Restore(std::move(suspended_scope)); @@ -192,7 +193,7 @@ auto DeclNameStack::LookupOrAddName(NameContext name_context, // `fn Class(T:! type).F(n: i32)` we will push the scope for `Class(T:! type)` // between the scope containing the declaration of `T` and the scope // containing the declaration of `n`. -static auto PushNameQualifierScope(Context& context, +static auto PushNameQualifierScope(Context& context, SemIRLoc loc, SemIR::InstId scope_inst_id, SemIR::NameScopeId scope_id, SemIR::SpecificId specific_id, @@ -203,7 +204,7 @@ static auto PushNameQualifierScope(Context& context, // When declaring a member of a generic, resolve the self specific. if (specific_id.is_valid()) { - ResolveSpecificDefinition(context, specific_id); + ResolveSpecificDefinition(context, loc, specific_id); } context.scope_stack().Push(scope_inst_id, scope_id, specific_id, has_error); @@ -229,8 +230,8 @@ auto DeclNameStack::ApplyNameQualifier(const NameComponent& name) -> void { // Resolve the qualifier as a scope and enter the new scope. auto [scope_id, specific_id] = ResolveAsScope(name_context, name); if (scope_id.is_valid()) { - PushNameQualifierScope(*context_, name_context.resolved_inst_id, scope_id, - specific_id, + PushNameQualifierScope(*context_, name_context.loc_id, + name_context.resolved_inst_id, scope_id, specific_id, context_->name_scopes().Get(scope_id).has_error()); name_context.parent_scope_id = scope_id; } else { diff --git a/toolchain/check/deduce.cpp b/toolchain/check/deduce.cpp index c4cfe8e8f016a..0ee531c9bcdc9 100644 --- a/toolchain/check/deduce.cpp +++ b/toolchain/check/deduce.cpp @@ -505,7 +505,7 @@ auto DeductionContext::MakeSpecific() -> SemIR::SpecificId { // TODO: Convert the deduced values to the types of the bindings. return Check::MakeSpecific( - context(), generic_id_, + context(), loc_id_, generic_id_, context().inst_blocks().AddCanonical(result_arg_ids_)); } diff --git a/toolchain/check/eval.cpp b/toolchain/check/eval.cpp index e195dca3d27b1..b70ac1d0dcd9b 100644 --- a/toolchain/check/eval.cpp +++ b/toolchain/check/eval.cpp @@ -31,13 +31,32 @@ struct SpecificEvalInfo { class EvalContext { public: explicit EvalContext( - Context& context, + Context& context, SemIRLoc fallback_loc, SemIR::SpecificId specific_id = SemIR::SpecificId::Invalid, std::optional specific_eval_info = std::nullopt) : context_(context), + fallback_loc_(fallback_loc), specific_id_(specific_id), specific_eval_info_(specific_eval_info) {} + // Gets the location to use for diagnostics if a better location is + // unavailable. + // TODO: This is also sometimes unavailable. + auto fallback_loc() const -> SemIRLoc { return fallback_loc_; } + + // Returns a location to use to point at an instruction in a diagnostic, given + // a list of instructions that might have an attached location. This is the + // location of the first instruction in the list that has a location if there + // is one, and otherwise the fallback location. + auto GetDiagnosticLoc(llvm::ArrayRef inst_ids) -> SemIRLoc { + for (auto inst_id : inst_ids) { + if (inst_id.is_valid() && context_.insts().GetLocId(inst_id).is_valid()) { + return inst_id; + } + } + return fallback_loc_; + } + // Gets the value of the specified compile-time binding in this context. // Returns `Invalid` if the value is not fixed in this context. auto GetCompileTimeBindValue(SemIR::CompileTimeBindIndex bind_index) @@ -161,6 +180,8 @@ class EvalContext { private: // The type-checking context in which we're performing evaluation. Context& context_; + // The location to use for diagnostics when a better location isn't available. + SemIRLoc fallback_loc_; // The specific that we are evaluating within. SemIR::SpecificId specific_id_; // If we are currently evaluating an eval block for `specific_id_`, @@ -419,7 +440,8 @@ static auto GetConstantValue(EvalContext& eval_context, if (args_id == specific.args_id) { return specific_id; } - return MakeSpecific(eval_context.context(), specific.generic_id, args_id); + return MakeSpecific(eval_context.context(), eval_context.fallback_loc(), + specific.generic_id, args_id); } // Like `GetConstantValue` but does a `FacetTypeId` -> `FacetTypeInfo` @@ -602,7 +624,7 @@ static auto PerformArrayIndex(EvalContext& eval_context, SemIR::ArrayIndex inst) "array index `{0}` is past the end of type {1}", TypedInt, SemIR::TypeId); eval_context.emitter().Emit( - inst.index_id, ArrayIndexOutOfBounds, + eval_context.GetDiagnosticLoc(inst.index_id), ArrayIndexOutOfBounds, {.type = index->type_id, .value = index_val}, aggregate_type_id); return SemIR::ErrorInst::SingletonConstantId; } @@ -1336,7 +1358,7 @@ static auto TryEvalInstInContext(EvalContext& eval_context, CARBON_DIAGNOSTIC(ArrayBoundNegative, Error, "array bound of {0} is negative", TypedInt); eval_context.emitter().Emit( - bound_id, ArrayBoundNegative, + eval_context.GetDiagnosticLoc(bound_id), ArrayBoundNegative, {.type = int_bound->type_id, .value = bound_val}); return false; } @@ -1344,7 +1366,7 @@ static auto TryEvalInstInContext(EvalContext& eval_context, CARBON_DIAGNOSTIC(ArrayBoundTooLarge, Error, "array bound of {0} is too large", TypedInt); eval_context.emitter().Emit( - bound_id, ArrayBoundTooLarge, + eval_context.GetDiagnosticLoc(bound_id), ArrayBoundTooLarge, {.type = int_bound->type_id, .value = bound_val}); return false; } @@ -1393,7 +1415,8 @@ static auto TryEvalInstInContext(EvalContext& eval_context, [&](SemIR::IntType result) { return ValidateIntType( eval_context.context(), - inst_id.is_valid() ? inst_id : int_type.bit_width_id, result); + eval_context.GetDiagnosticLoc({inst_id, int_type.bit_width_id}), + result); }, &SemIR::IntType::bit_width_id); } @@ -1405,7 +1428,9 @@ static auto TryEvalInstInContext(EvalContext& eval_context, eval_context, inst, [&](SemIR::FloatType result) { return ValidateFloatType(eval_context.context(), - float_type.bit_width_id, result); + eval_context.GetDiagnosticLoc( + {inst_id, float_type.bit_width_id}), + result); }, &SemIR::FloatType::bit_width_id); } @@ -1568,7 +1593,8 @@ static auto TryEvalInstInContext(EvalContext& eval_context, } case CARBON_KIND(SemIR::Call call): { - return MakeConstantForCall(eval_context, inst_id, call); + return MakeConstantForCall(eval_context, + eval_context.GetDiagnosticLoc(inst_id), call); } // TODO: These need special handling. @@ -1785,7 +1811,8 @@ static auto TryEvalInstInContext(EvalContext& eval_context, "{0} evaluates to incomplete type {1}", SemIR::TypeId, SemIR::TypeId); return eval_context.emitter().Build( - inst_id, IncompleteTypeInMonomorphization, + eval_context.GetDiagnosticLoc(inst_id), + IncompleteTypeInMonomorphization, require_complete.complete_type_id, complete_type_id); }); if (complete_type_id == SemIR::ErrorInst::SingletonTypeId) { @@ -1842,11 +1869,12 @@ static auto TryEvalInstInContext(EvalContext& eval_context, auto TryEvalInst(Context& context, SemIR::InstId inst_id, SemIR::Inst inst) -> SemIR::ConstantId { - EvalContext eval_context(context); + EvalContext eval_context(context, inst_id); return TryEvalInstInContext(eval_context, inst_id, inst); } -auto TryEvalBlockForSpecific(Context& context, SemIR::SpecificId specific_id, +auto TryEvalBlockForSpecific(Context& context, SemIRLoc loc, + SemIR::SpecificId specific_id, SemIR::GenericInstIndex::Region region) -> SemIR::InstBlockId { auto generic_id = context.specifics().Get(specific_id).generic_id; @@ -1856,20 +1884,27 @@ auto TryEvalBlockForSpecific(Context& context, SemIR::SpecificId specific_id, llvm::SmallVector result; result.resize(eval_block.size(), SemIR::InstId::Invalid); - EvalContext eval_context(context, specific_id, + EvalContext eval_context(context, loc, specific_id, SpecificEvalInfo{ .region = region, .values = result, }); + DiagnosticAnnotationScope annotate_diagnostics( + &context.emitter(), [&](auto& builder) { + CARBON_DIAGNOSTIC(ResolvingSpecificHere, Note, "in {0} used here", + InstIdAsType); + if (loc.is_inst_id && !loc.inst_id.is_valid()) { + return; + } + builder.Note(loc, ResolvingSpecificHere, + GetInstForSpecific(context, specific_id)); + }); + for (auto [i, inst_id] : llvm::enumerate(eval_block)) { auto const_id = TryEvalInstInContext(eval_context, inst_id, context.insts().Get(inst_id)); result[i] = context.constant_values().GetInstId(const_id); - - // TODO: If this becomes possible through monomorphization failure, produce - // a diagnostic and put `SemIR::ErrorInst::SingletonInstId` in the table - // entry. CARBON_CHECK(result[i].is_valid()); } diff --git a/toolchain/check/eval.h b/toolchain/check/eval.h index d56a41ba4ff7c..5c444969eddbe 100644 --- a/toolchain/check/eval.h +++ b/toolchain/check/eval.h @@ -20,7 +20,8 @@ auto TryEvalInst(Context& context, SemIR::InstId inst_id, SemIR::Inst inst) // Evaluates the eval block for a region of a specific. Produces a block // containing the evaluated constant values of the instructions in the eval // block. -auto TryEvalBlockForSpecific(Context& context, SemIR::SpecificId specific_id, +auto TryEvalBlockForSpecific(Context& context, SemIRLoc loc, + SemIR::SpecificId specific_id, SemIR::GenericInstIndex::Region region) -> SemIR::InstBlockId; diff --git a/toolchain/check/generic.cpp b/toolchain/check/generic.cpp index 7f2c297385174..ca37cc70d5cc8 100644 --- a/toolchain/check/generic.cpp +++ b/toolchain/check/generic.cpp @@ -5,11 +5,13 @@ #include "toolchain/check/generic.h" #include "common/map.h" +#include "toolchain/base/kind_switch.h" #include "toolchain/check/eval.h" #include "toolchain/check/generic_region_stack.h" #include "toolchain/check/subst.h" #include "toolchain/sem_ir/ids.h" #include "toolchain/sem_ir/inst.h" +#include "toolchain/sem_ir/typed_insts.h" namespace Carbon::Check { @@ -341,7 +343,7 @@ auto FinishGenericDecl(Context& context, SemIR::InstId decl_id) context.generic_region_stack().Pop(); context.generics().Get(generic_id).decl_block_id = decl_block_id; - auto self_specific_id = MakeSelfSpecific(context, generic_id); + auto self_specific_id = MakeSelfSpecific(context, decl_id, generic_id); context.generics().Get(generic_id).self_specific_id = self_specific_id; return generic_id; } @@ -371,15 +373,16 @@ auto FinishGenericDefinition(Context& context, SemIR::GenericId generic_id) context.generic_region_stack().Pop(); } -auto MakeSpecific(Context& context, SemIR::GenericId generic_id, +auto MakeSpecific(Context& context, SemIRLoc loc, SemIR::GenericId generic_id, SemIR::InstBlockId args_id) -> SemIR::SpecificId { auto specific_id = context.specifics().GetOrAdd(generic_id, args_id); // If this is the first time we've formed this specific, evaluate its decl // block to form information about the specific. if (!context.specifics().Get(specific_id).decl_block_id.is_valid()) { - auto decl_block_id = TryEvalBlockForSpecific( - context, specific_id, SemIR::GenericInstIndex::Region::Declaration); + auto decl_block_id = + TryEvalBlockForSpecific(context, loc, specific_id, + SemIR::GenericInstIndex::Region::Declaration); // Note that TryEvalBlockForSpecific may reallocate the list of specifics, // so re-lookup the specific here. context.specifics().Get(specific_id).decl_block_id = decl_block_id; @@ -388,8 +391,8 @@ auto MakeSpecific(Context& context, SemIR::GenericId generic_id, return specific_id; } -auto MakeSelfSpecific(Context& context, SemIR::GenericId generic_id) - -> SemIR::SpecificId { +auto MakeSelfSpecific(Context& context, SemIRLoc loc, + SemIR::GenericId generic_id) -> SemIR::SpecificId { if (!generic_id.is_valid()) { return SemIR::SpecificId::Invalid; } @@ -409,11 +412,11 @@ auto MakeSelfSpecific(Context& context, SemIR::GenericId generic_id) // TODO: This could be made more efficient. We don't need to perform // substitution here; we know we want identity mappings for all constants and // types. We could also consider not storing the mapping at all in this case. - return MakeSpecific(context, generic_id, args_id); + return MakeSpecific(context, loc, generic_id, args_id); } -auto ResolveSpecificDefinition(Context& context, SemIR::SpecificId specific_id) - -> bool { +auto ResolveSpecificDefinition(Context& context, SemIRLoc loc, + SemIR::SpecificId specific_id) -> bool { auto& specific = context.specifics().Get(specific_id); auto generic_id = specific.generic_id; CARBON_CHECK(generic_id.is_valid(), "Specific with no generic ID"); @@ -426,7 +429,7 @@ auto ResolveSpecificDefinition(Context& context, SemIR::SpecificId specific_id) return false; } auto definition_block_id = TryEvalBlockForSpecific( - context, specific_id, SemIR::GenericInstIndex::Region::Definition); + context, loc, specific_id, SemIR::GenericInstIndex::Region::Definition); // Note that TryEvalBlockForSpecific may reallocate the list of specifics, // so re-lookup the specific here. context.specifics().Get(specific_id).definition_block_id = @@ -435,4 +438,34 @@ auto ResolveSpecificDefinition(Context& context, SemIR::SpecificId specific_id) return true; } +auto GetInstForSpecific(Context& context, SemIR::SpecificId specific_id) + -> SemIR::InstId { + CARBON_CHECK(specific_id.is_valid()); + const auto& specific = context.specifics().Get(specific_id); + const auto& generic = context.generics().Get(specific.generic_id); + auto decl = context.insts().Get(generic.decl_id); + CARBON_KIND_SWITCH(decl) { + case CARBON_KIND(SemIR::ClassDecl class_decl): { + return context.types().GetInstId( + context.GetClassType(class_decl.class_id, specific_id)); + } + case CARBON_KIND(SemIR::InterfaceDecl interface_decl): { + return context.types().GetInstId( + context.GetInterfaceType(interface_decl.interface_id, specific_id)); + } + case SemIR::FunctionDecl::Kind: { + return context.constant_values().GetInstId( + TryEvalInst(context, SemIR::InstId::Invalid, + SemIR::SpecificFunction{ + .type_id = context.GetSingletonType( + SemIR::SpecificFunctionType::SingletonInstId), + .callee_id = generic.decl_id, + .specific_id = specific_id})); + } + default: { + CARBON_FATAL("Unknown kind for generic declaration {0}", decl); + } + } +} + } // namespace Carbon::Check diff --git a/toolchain/check/generic.h b/toolchain/check/generic.h index f9b45d00dbb4c..9813ae405c97d 100644 --- a/toolchain/check/generic.h +++ b/toolchain/check/generic.h @@ -49,29 +49,34 @@ auto RebuildGenericEvalBlock(Context& context, SemIR::GenericId generic_id, // declaration, but not the definition, of the generic. // // `args_id` should be a canonical instruction block referring to constants. -auto MakeSpecific(Context& context, SemIR::GenericId generic_id, +auto MakeSpecific(Context& context, SemIRLoc loc, SemIR::GenericId generic_id, SemIR::InstBlockId args_id) -> SemIR::SpecificId; // Builds a new specific if the given generic is valid. Otherwise returns an // invalid specific. -inline auto MakeSpecificIfGeneric(Context& context, SemIR::GenericId generic_id, +inline auto MakeSpecificIfGeneric(Context& context, SemIRLoc loc, + SemIR::GenericId generic_id, SemIR::InstBlockId args_id) -> SemIR::SpecificId { - return generic_id.is_valid() ? MakeSpecific(context, generic_id, args_id) + return generic_id.is_valid() ? MakeSpecific(context, loc, generic_id, args_id) : SemIR::SpecificId::Invalid; } // Builds the specific that describes how the generic should refer to itself. // For example, for a generic `G(T:! type)`, this is the specific `G(T)`. For an // invalid `generic_id`, returns an invalid specific ID. -auto MakeSelfSpecific(Context& context, SemIR::GenericId generic_id) - -> SemIR::SpecificId; +auto MakeSelfSpecific(Context& context, SemIRLoc loc, + SemIR::GenericId generic_id) -> SemIR::SpecificId; // Attempts to resolve the definition of the given specific, by evaluating the // eval block of the corresponding generic and storing a corresponding value // block in the specific. Returns false if a definition is not available. -auto ResolveSpecificDefinition(Context& context, SemIR::SpecificId specific_id) - -> bool; +auto ResolveSpecificDefinition(Context& context, SemIRLoc loc, + SemIR::SpecificId specific_id) -> bool; + +// Returns an instruction describing the entity named by the given specific. +auto GetInstForSpecific(Context& context, SemIR::SpecificId specific_id) + -> SemIR::InstId; } // namespace Carbon::Check diff --git a/toolchain/check/impl.cpp b/toolchain/check/impl.cpp index 75a8a504e3eac..7ca75fceb9577 100644 --- a/toolchain/check/impl.cpp +++ b/toolchain/check/impl.cpp @@ -33,7 +33,7 @@ static auto NoteAssociatedFunction(Context& context, // Gets the self specific of a generic declaration that is an interface member, // given a specific for an enclosing generic, plus a type to use as `Self`. static auto GetSelfSpecificForInterfaceMemberWithSelfType( - Context& context, SemIR::SpecificId enclosing_specific_id, + Context& context, SemIRLoc loc, SemIR::SpecificId enclosing_specific_id, SemIR::GenericId generic_id, SemIR::TypeId self_type_id) -> SemIR::SpecificId { const auto& generic = context.generics().Get(generic_id); @@ -84,7 +84,7 @@ static auto GetSelfSpecificForInterfaceMemberWithSelfType( } auto args_id = context.inst_blocks().AddCanonical(arg_ids); - return MakeSpecific(context, generic_id, args_id); + return MakeSpecific(context, loc, generic_id, args_id); } // Checks that `impl_function_id` is a valid implementation of the function @@ -115,7 +115,7 @@ static auto CheckAssociatedFunctionImplementation( // parameters. auto interface_function_specific_id = GetSelfSpecificForInterfaceMemberWithSelfType( - context, interface_function_type.specific_id, + context, impl_decl_id, interface_function_type.specific_id, context.functions() .Get(interface_function_type.function_id) .generic_id, diff --git a/toolchain/check/impl_lookup.cpp b/toolchain/check/impl_lookup.cpp index 53bc43686033f..197ea33ae3b15 100644 --- a/toolchain/check/impl_lookup.cpp +++ b/toolchain/check/impl_lookup.cpp @@ -160,7 +160,7 @@ auto LookupInterfaceWitness(Context& context, SemIR::LocId loc_id, if (specific_id.is_valid()) { // We need a definition of the specific `impl` so we can access its // witness. - ResolveSpecificDefinition(context, specific_id); + ResolveSpecificDefinition(context, loc_id, specific_id); } return context.constant_values().GetInstId( SemIR::GetConstantValueInSpecific(context.sem_ir(), specific_id, diff --git a/toolchain/check/import_ref.cpp b/toolchain/check/import_ref.cpp index b01b91d9b4493..33aa2d2728062 100644 --- a/toolchain/check/import_ref.cpp +++ b/toolchain/check/import_ref.cpp @@ -2714,8 +2714,9 @@ static auto FinishPendingGeneric(ImportRefResolver& resolver, SemIR::GenericInstIndex::Region::Declaration); resolver.local_generics().Get(pending.local_id).decl_block_id = decl_block_id; - auto self_specific_id = - MakeSelfSpecific(resolver.local_context(), pending.local_id); + auto local_decl_id = resolver.local_generics().Get(pending.local_id).decl_id; + auto self_specific_id = MakeSelfSpecific(resolver.local_context(), + local_decl_id, pending.local_id); resolver.local_generics().Get(pending.local_id).self_specific_id = self_specific_id; resolver.AddPendingSpecific({.import_id = import_generic.self_specific_id, diff --git a/toolchain/check/subst.cpp b/toolchain/check/subst.cpp index 61ca7d94b366d..5e96504885031 100644 --- a/toolchain/check/subst.cpp +++ b/toolchain/check/subst.cpp @@ -190,7 +190,9 @@ static auto PopOperand(Context& context, Worklist& worklist, SemIR::IdKind kind, auto args_id = PopOperand(context, worklist, SemIR::IdKind::For, specific.args_id.index); - return MakeSpecific(context, specific.generic_id, + // TODO: Provide a location here. + SemIRLoc loc = SemIR::InstId::Invalid; + return MakeSpecific(context, loc, specific.generic_id, SemIR::InstBlockId(args_id)) .index; } diff --git a/toolchain/check/testdata/function/generic/resolve_used.carbon b/toolchain/check/testdata/function/generic/resolve_used.carbon index 51b5a86e01e5e..b8ecc92ee0b71 100644 --- a/toolchain/check/testdata/function/generic/resolve_used.carbon +++ b/toolchain/check/testdata/function/generic/resolve_used.carbon @@ -24,6 +24,9 @@ fn ErrorIfNIsZero(N:! Core.IntLiteral()) { } fn CallNegative() { + // CHECK:STDERR: fail_todo_call_monomorphization_error.carbon:[[@LINE+3]]:3: note: in `ErrorIfNIsZero(0)` used here [ResolvingSpecificHere] + // CHECK:STDERR: ErrorIfNIsZero(0); + // CHECK:STDERR: ^~~~~~~~~~~~~~ ErrorIfNIsZero(0); } diff --git a/toolchain/check/testdata/generic/complete_type.carbon b/toolchain/check/testdata/generic/complete_type.carbon index 15cc795cfc947..b4b8da4eb211c 100644 --- a/toolchain/check/testdata/generic/complete_type.carbon +++ b/toolchain/check/testdata/generic/complete_type.carbon @@ -15,20 +15,23 @@ library "[[@TEST_NAME]]"; class B; class A(T:! type) { - // CHECK:STDERR: fail_incomplete_in_class.carbon:[[@LINE+7]]:10: error: `T` evaluates to incomplete type `B` [IncompleteTypeInMonomorphization] + // CHECK:STDERR: fail_incomplete_in_class.carbon:[[@LINE+6]]:10: error: `T` evaluates to incomplete type `B` [IncompleteTypeInMonomorphization] // CHECK:STDERR: var v: T; // CHECK:STDERR: ^ // CHECK:STDERR: fail_incomplete_in_class.carbon:[[@LINE-6]]:1: note: class was forward declared here [ClassForwardDeclaredHere] // CHECK:STDERR: class B; // CHECK:STDERR: ^~~~~~~~ - // CHECK:STDERR: var v: T; } +// CHECK:STDERR: fail_incomplete_in_class.carbon:[[@LINE+11]]:6: note: in `A(B)` used here [ResolvingSpecificHere] +// CHECK:STDERR: fn F(x: A(B)) {} +// CHECK:STDERR: ^~~~~~~ +// CHECK:STDERR: // CHECK:STDERR: fail_incomplete_in_class.carbon:[[@LINE+7]]:6: error: parameter has incomplete type `A(B)` in function definition [IncompleteTypeInFunctionParam] // CHECK:STDERR: fn F(x: A(B)) {} // CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: fail_incomplete_in_class.carbon:[[@LINE-16]]:1: note: class was forward declared here [ClassForwardDeclaredHere] +// CHECK:STDERR: fail_incomplete_in_class.carbon:[[@LINE-19]]:1: note: class was forward declared here [ClassForwardDeclaredHere] // CHECK:STDERR: class B; // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: @@ -67,6 +70,9 @@ fn F(T:! type) { var v: T; } +// CHECK:STDERR: fail_incomplete_in_function_at_eof.carbon:[[@LINE+3]]:10: note: in `F(B)` used here [ResolvingSpecificHere] +// CHECK:STDERR: fn G() { F(B); } +// CHECK:STDERR: ^ fn G() { F(B); } // CHECK:STDOUT: --- fail_incomplete_in_class.carbon @@ -125,7 +131,7 @@ fn G() { F(B); } // CHECK:STDOUT: %x.param: %A.2 = value_param runtime_param0 // CHECK:STDOUT: %x: %A.2 = bind_name x, %x.param // CHECK:STDOUT: } -// CHECK:STDOUT: %B.decl.loc26: type = class_decl @B [template = constants.%B] {} {} +// CHECK:STDOUT: %B.decl.loc29: type = class_decl @B [template = constants.%B] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @B { @@ -145,17 +151,17 @@ fn G() { F(B); } // CHECK:STDOUT: %A: type = class_type @A, @A(%T.loc6_9.2) [symbolic = %A (constants.%A.1)] // CHECK:STDOUT: %A.elem: type = unbound_element_type @A.%A (%A.1), @A.%T.loc6_9.2 (%T) [symbolic = %A.elem (constants.%A.elem.1)] // CHECK:STDOUT: %struct_type.v: type = struct_type {.v: @A.%T.loc6_9.2 (%T)} [symbolic = %struct_type.v (constants.%struct_type.v.1)] -// CHECK:STDOUT: %complete_type.loc15_1.2: = complete_type_witness @A.%struct_type.v (%struct_type.v.1) [symbolic = %complete_type.loc15_1.2 (constants.%complete_type.1)] +// CHECK:STDOUT: %complete_type.loc14_1.2: = complete_type_witness @A.%struct_type.v (%struct_type.v.1) [symbolic = %complete_type.loc14_1.2 (constants.%complete_type.1)] // CHECK:STDOUT: // CHECK:STDOUT: class { // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc6_9.1 [symbolic = %T.loc6_9.2 (constants.%T)] -// CHECK:STDOUT: %.loc14: @A.%A.elem (%A.elem.1) = field_decl v, element0 [template] -// CHECK:STDOUT: %complete_type.loc15_1.1: = complete_type_witness %struct_type.v.1 [symbolic = %complete_type.loc15_1.2 (constants.%complete_type.1)] +// CHECK:STDOUT: %.loc13: @A.%A.elem (%A.elem.1) = field_decl v, element0 [template] +// CHECK:STDOUT: %complete_type.loc14_1.1: = complete_type_witness %struct_type.v.1 [symbolic = %complete_type.loc14_1.2 (constants.%complete_type.1)] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%A.1 -// CHECK:STDOUT: .v = %.loc14 -// CHECK:STDOUT: complete_type_witness = %complete_type.loc15_1.1 +// CHECK:STDOUT: .v = %.loc13 +// CHECK:STDOUT: complete_type_witness = %complete_type.loc14_1.1 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -183,7 +189,7 @@ fn G() { F(B); } // CHECK:STDOUT: %A => constants.%A.2 // CHECK:STDOUT: %A.elem => constants.%A.elem.2 // CHECK:STDOUT: %struct_type.v => constants.%struct_type.v.2 -// CHECK:STDOUT: %complete_type.loc15_1.2 => constants.%complete_type.2 +// CHECK:STDOUT: %complete_type.loc14_1.2 => constants.%complete_type.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- incomplete_in_function.carbon diff --git a/toolchain/diagnostics/diagnostic_kind.def b/toolchain/diagnostics/diagnostic_kind.def index 738d43113d839..ceb0df8691386 100644 --- a/toolchain/diagnostics/diagnostic_kind.def +++ b/toolchain/diagnostics/diagnostic_kind.def @@ -141,6 +141,7 @@ CARBON_DIAGNOSTIC_KIND(SemanticsTodo) // Location context. CARBON_DIAGNOSTIC_KIND(InImport) +CARBON_DIAGNOSTIC_KIND(ResolvingSpecificHere) // Package/import checking diagnostics. CARBON_DIAGNOSTIC_KIND(IncorrectExtension) diff --git a/toolchain/sem_ir/stringify_type.cpp b/toolchain/sem_ir/stringify_type.cpp index 7a83f22913fdc..ca13382b65f91 100644 --- a/toolchain/sem_ir/stringify_type.cpp +++ b/toolchain/sem_ir/stringify_type.cpp @@ -403,6 +403,16 @@ auto StringifyTypeExpr(const SemIR::File& sem_ir, InstId outer_inst_id) step_stack.PushTypeId(inst.pointee_id); break; } + case CARBON_KIND(SpecificFunction inst): { + auto callee = SemIR::GetCalleeFunction(sem_ir, inst.callee_id); + if (callee.function_id.is_valid()) { + step_stack.PushEntityName(sem_ir.functions().Get(callee.function_id), + inst.specific_id); + } else { + step_stack.PushString(""); + } + break; + } case CARBON_KIND(StructType inst): { auto fields = sem_ir.struct_type_fields().Get(inst.fields_id); if (fields.empty()) { @@ -500,7 +510,6 @@ auto StringifyTypeExpr(const SemIR::File& sem_ir, InstId outer_inst_id) case ReturnSlot::Kind: case ReturnSlotPattern::Kind: case SpecificConstant::Kind: - case SpecificFunction::Kind: case SpliceBlock::Kind: case StringLiteral::Kind: case StructAccess::Kind: From 79ba184dabcda5003374df634a7481b639e00fdd Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Wed, 11 Dec 2024 16:44:07 -0800 Subject: [PATCH 20/68] Provide a location for monomorphization failures resulting from `TryToCompleteType`. (#4670) Almost all callers actually could never fail and nearly all of those already `CHECK`-failed on failure. Add a new overload for that case, and add a location parameter for the one remaining call. --- toolchain/check/context.cpp | 18 +- toolchain/check/context.h | 6 +- toolchain/check/convert.cpp | 15 +- toolchain/check/generic.cpp | 2 +- .../generic/complete_in_conversion.carbon | 216 ++++++++++++++++++ 5 files changed, 241 insertions(+), 16 deletions(-) create mode 100644 toolchain/check/testdata/class/generic/complete_in_conversion.carbon diff --git a/toolchain/check/context.cpp b/toolchain/check/context.cpp index adab63ebe771d..3b1c43c268f27 100644 --- a/toolchain/check/context.cpp +++ b/toolchain/check/context.cpp @@ -1261,9 +1261,15 @@ class TypeCompleter { }; } // namespace -auto Context::TryToCompleteType(SemIR::TypeId type_id) -> bool { - // TODO: We need a location here in case we need to instantiate a class type. - return TypeCompleter(*this, SemIR::LocId::Invalid, nullptr).Complete(type_id); +auto Context::TryToCompleteType(SemIR::TypeId type_id, SemIRLoc loc) -> bool { + return TypeCompleter(*this, loc, nullptr).Complete(type_id); +} + +auto Context::CompleteTypeOrCheckFail(SemIR::TypeId type_id) -> void { + bool complete = + TypeCompleter(*this, SemIR::LocId::Invalid, nullptr).Complete(type_id); + CARBON_CHECK(complete, "Expected {0} to be a complete type", + types().GetAsInst(type_id)); } auto Context::RequireCompleteType(SemIR::TypeId type_id, SemIR::LocId loc_id, @@ -1386,8 +1392,7 @@ template static auto GetCompleteTypeImpl(Context& context, EachArgT... each_arg) -> SemIR::TypeId { auto type_id = GetTypeImpl(context, each_arg...); - bool complete = context.TryToCompleteType(type_id); - CARBON_CHECK(complete, "Type completion should not fail"); + context.CompleteTypeOrCheckFail(type_id); return type_id; } @@ -1413,8 +1418,7 @@ auto Context::GetSingletonType(SemIR::InstId singleton_id) -> SemIR::TypeId { CARBON_CHECK(SemIR::IsSingletonInstId(singleton_id)); auto type_id = GetTypeIdForTypeInst(singleton_id); // To keep client code simpler, complete builtin types before returning them. - bool complete = TryToCompleteType(type_id); - CARBON_CHECK(complete, "Failed to complete builtin type"); + CompleteTypeOrCheckFail(type_id); return type_id; } diff --git a/toolchain/check/context.h b/toolchain/check/context.h index 2b3f4afdb7ff4..b602adbb53e86 100644 --- a/toolchain/check/context.h +++ b/toolchain/check/context.h @@ -344,7 +344,11 @@ class Context { // symbolic. // // Avoid calling this where possible, as it can lead to coherence issues. - auto TryToCompleteType(SemIR::TypeId type_id) -> bool; + // TODO: Remove the remaining call to this and delete this function. + auto TryToCompleteType(SemIR::TypeId type_id, SemIRLoc loc) -> bool; + + // Completes the type `type_id`. CHECK-fails if it can't be completed. + auto CompleteTypeOrCheckFail(SemIR::TypeId type_id) -> void; // Like `TryToCompleteType`, but for cases where it is an error for the type // to be incomplete. diff --git a/toolchain/check/convert.cpp b/toolchain/check/convert.cpp index 7f4141a6a0749..507548c3bccbc 100644 --- a/toolchain/check/convert.cpp +++ b/toolchain/check/convert.cpp @@ -596,13 +596,14 @@ using InheritancePath = // Computes the inheritance path from class `derived_id` to class `base_id`. // Returns nullopt if `derived_id` is not a class derived from `base_id`. -static auto ComputeInheritancePath(Context& context, SemIR::TypeId derived_id, +static auto ComputeInheritancePath(Context& context, SemIRLoc loc, + SemIR::TypeId derived_id, SemIR::TypeId base_id) -> std::optional { // We intend for NRVO to be applied to `result`. All `return` statements in // this function should `return result;`. std::optional result(std::in_place); - if (!context.TryToCompleteType(derived_id)) { + if (!context.TryToCompleteType(derived_id, loc)) { // TODO: Should we give an error here? If we don't, and there is an // inheritance path when the class is defined, we may have a coherence // problem. @@ -856,8 +857,8 @@ static auto PerformBuiltinConversion(Context& context, SemIR::LocId loc_id, } // An expression of type T converts to U if T is a class derived from U. - if (auto path = - ComputeInheritancePath(context, value_type_id, target.type_id); + if (auto path = ComputeInheritancePath(context, loc_id, value_type_id, + target.type_id); path && !path->empty()) { return ConvertDerivedToBase(context, loc_id, value_id, *path); } @@ -867,9 +868,9 @@ static auto PerformBuiltinConversion(Context& context, SemIR::LocId loc_id, if (auto target_pointer_type = target_type_inst.TryAs()) { if (auto src_pointer_type = sem_ir.types().TryGetAs(value_type_id)) { - if (auto path = - ComputeInheritancePath(context, src_pointer_type->pointee_id, - target_pointer_type->pointee_id); + if (auto path = ComputeInheritancePath(context, loc_id, + src_pointer_type->pointee_id, + target_pointer_type->pointee_id); path && !path->empty()) { return ConvertDerivedPointerToBasePointer( context, loc_id, *src_pointer_type, target.type_id, value_id, diff --git a/toolchain/check/generic.cpp b/toolchain/check/generic.cpp index ca37cc70d5cc8..e9abbba09dd2d 100644 --- a/toolchain/check/generic.cpp +++ b/toolchain/check/generic.cpp @@ -249,7 +249,7 @@ static auto MakeGenericEvalBlock(Context& context, SemIR::GenericId generic_id, // constraints on the generic rather than properties of the type. For now, // require the transformed type to be complete if the original was. if (context.types().IsComplete(inst.type_id())) { - context.TryToCompleteType(type_id); + context.CompleteTypeOrCheckFail(type_id); } inst.SetType(type_id); context.sem_ir().insts().Set(inst_id, inst); diff --git a/toolchain/check/testdata/class/generic/complete_in_conversion.carbon b/toolchain/check/testdata/class/generic/complete_in_conversion.carbon new file mode 100644 index 0000000000000..6ab05b239223f --- /dev/null +++ b/toolchain/check/testdata/class/generic/complete_in_conversion.carbon @@ -0,0 +1,216 @@ +// Part of the Carbon Language project, under the Apache License v2.0 with LLVM +// Exceptions. See /LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// AUTOUPDATE +// TIP: To test this file alone, run: +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/class/generic/complete_in_conversion.carbon +// TIP: To dump output, run: +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/class/generic/complete_in_conversion.carbon + +// --- fail_derived_to_base.carbon + +base class B {} + +class A(N:! i32) { + extend base: B; + + // CHECK:STDERR: fail_derived_to_base.carbon:[[@LINE+3]]:10: error: integer type width of 0 is not positive [IntWidthNotPositive] + // CHECK:STDERR: var n: Core.Int(N); + // CHECK:STDERR: ^~~~~~~~~~~ + var n: Core.Int(N); +} + +fn F(a: A(0)*) { + // CHECK:STDERR: fail_derived_to_base.carbon:[[@LINE+3]]:3: note: in `A(0)` used here [ResolvingSpecificHere] + // CHECK:STDERR: let b: B* = a; + // CHECK:STDERR: ^~~~~~~~~~~~~~ + let b: B* = a; +} + +// CHECK:STDOUT: --- fail_derived_to_base.carbon +// CHECK:STDOUT: +// CHECK:STDOUT: constants { +// CHECK:STDOUT: %B: type = class_type @B [template] +// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] +// CHECK:STDOUT: %complete_type.1: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %N.1: %i32 = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %N.patt.1: %i32 = symbolic_binding_pattern N, 0 [symbolic] +// CHECK:STDOUT: %A.type: type = generic_class_type @A [template] +// CHECK:STDOUT: %A.generic: %A.type = struct_value () [template] +// CHECK:STDOUT: %A.1: type = class_type @A, @A(%N.1) [symbolic] +// CHECK:STDOUT: %A.elem.1: type = unbound_element_type %A.1, %B [symbolic] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.type.13: type = fn_type @Convert.4, @impl.3(%int_32) [template] +// CHECK:STDOUT: %Convert.13: %Convert.type.13 = struct_value () [template] +// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.13) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %N.1, %Convert.13 [symbolic] +// CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.4(%int_32) [symbolic] +// CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %Convert.specific_fn.1(%N.1) [symbolic] +// CHECK:STDOUT: %iN.2: type = int_type signed, %int.convert_checked [symbolic] +// CHECK:STDOUT: %require_complete.7: = require_complete_type %iN.2 [symbolic] +// CHECK:STDOUT: %A.elem.2: type = unbound_element_type %A.1, %iN.2 [symbolic] +// CHECK:STDOUT: %struct_type.base.n: type = struct_type {.base: %B, .n: %iN.2} [symbolic] +// CHECK:STDOUT: %complete_type.3: = complete_type_witness %struct_type.base.n [symbolic] +// CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] +// CHECK:STDOUT: %interface.10: = interface_witness (%Convert.15) [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_0.1, %Convert.15 [template] +// CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] +// CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] +// CHECK:STDOUT: %A.2: type = class_type @A, @A(%int_0.2) [template] +// CHECK:STDOUT: %ptr.2: type = ptr_type %A.2 [template] +// CHECK:STDOUT: %F.type: type = fn_type @F [template] +// CHECK:STDOUT: %F: %F.type = struct_value () [template] +// CHECK:STDOUT: %ptr.3: type = ptr_type %B [template] +// CHECK:STDOUT: %A.elem.3: type = unbound_element_type %A.2, %B [template] +// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_0.2, %Convert.13 [template] +// CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.4(%int_32) [template] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int = %import_ref.1 +// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: import Core//prelude +// CHECK:STDOUT: import Core//prelude/... +// CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.1: %Int.type = import_ref Core//prelude/types, Int, loaded [template = constants.%Int] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .B = %B.decl +// CHECK:STDOUT: .A = %A.decl +// CHECK:STDOUT: .F = %F.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %B.decl: type = class_decl @B [template = constants.%B] {} {} +// CHECK:STDOUT: %A.decl: %A.type = class_decl @A [template = constants.%A.generic] { +// CHECK:STDOUT: %N.patt.loc4_9.1: %i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc4_9.2 (constants.%N.patt.1)] +// CHECK:STDOUT: %N.param_patt: %i32 = value_param_pattern %N.patt.loc4_9.1, runtime_param [symbolic = %N.patt.loc4_9.2 (constants.%N.patt.1)] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %int.make_type_signed.loc4: init type = call constants.%Int(%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc4_13.1: type = value_of_initializer %int.make_type_signed.loc4 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_13.2: type = converted %int.make_type_signed.loc4, %.loc4_13.1 [template = constants.%i32] +// CHECK:STDOUT: %N.param: %i32 = value_param runtime_param +// CHECK:STDOUT: %N.loc4_9.1: %i32 = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc4_9.2 (constants.%N.1)] +// CHECK:STDOUT: } +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { +// CHECK:STDOUT: %a.patt: %ptr.2 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %ptr.2 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %A.ref: %A.type = name_ref A, file.%A.decl [template = constants.%A.generic] +// CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] +// CHECK:STDOUT: %impl.elem0: %Convert.type.14 = interface_witness_access constants.%interface.10, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound.2] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.2] +// CHECK:STDOUT: %.loc13_12.1: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_0.2] +// CHECK:STDOUT: %.loc13_12.2: %i32 = converted %int_0, %.loc13_12.1 [template = constants.%int_0.2] +// CHECK:STDOUT: %A: type = class_type @A, @A(constants.%int_0.2) [template = constants.%A.2] +// CHECK:STDOUT: %ptr.loc13: type = ptr_type %A.2 [template = constants.%ptr.2] +// CHECK:STDOUT: %a.param: %ptr.2 = value_param runtime_param0 +// CHECK:STDOUT: %a: %ptr.2 = bind_name a, %a.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: class @B { +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = constants.%B +// CHECK:STDOUT: complete_type_witness = %complete_type +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic class @A(%N.loc4_9.1: %i32) { +// CHECK:STDOUT: %N.loc4_9.2: %i32 = bind_symbolic_name N, 0 [symbolic = %N.loc4_9.2 (constants.%N.1)] +// CHECK:STDOUT: %N.patt.loc4_9.2: %i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc4_9.2 (constants.%N.patt.1)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %A: type = class_type @A, @A(%N.loc4_9.2) [symbolic = %A (constants.%A.1)] +// CHECK:STDOUT: %A.elem.loc5: type = unbound_element_type @A.%A (%A.1), %B [symbolic = %A.elem.loc5 (constants.%A.elem.1)] +// CHECK:STDOUT: %Convert.bound.loc10_19.2: = bound_method %N.loc4_9.2, constants.%Convert.13 [symbolic = %Convert.bound.loc10_19.2 (constants.%Convert.bound.1)] +// CHECK:STDOUT: %Convert.specific_fn.loc10_19.2: = specific_function %Convert.bound.loc10_19.2, @Convert.4(constants.%int_32) [symbolic = %Convert.specific_fn.loc10_19.2 (constants.%Convert.specific_fn.1)] +// CHECK:STDOUT: %int.convert_checked.loc10_19.2: init Core.IntLiteral = call %Convert.specific_fn.loc10_19.2(%N.loc4_9.2) [symbolic = %int.convert_checked.loc10_19.2 (constants.%int.convert_checked)] +// CHECK:STDOUT: %iN: type = int_type signed, %int.convert_checked.loc10_19.2 [symbolic = %iN (constants.%iN.2)] +// CHECK:STDOUT: %require_complete: = require_complete_type @A.%iN (%iN.2) [symbolic = %require_complete (constants.%require_complete.7)] +// CHECK:STDOUT: %A.elem.loc10: type = unbound_element_type @A.%A (%A.1), @A.%iN (%iN.2) [symbolic = %A.elem.loc10 (constants.%A.elem.2)] +// CHECK:STDOUT: %struct_type.base.n: type = struct_type {.base: %B, .n: @A.%iN (%iN.2)} [symbolic = %struct_type.base.n (constants.%struct_type.base.n)] +// CHECK:STDOUT: %complete_type.loc11_1.2: = complete_type_witness @A.%struct_type.base.n (%struct_type.base.n) [symbolic = %complete_type.loc11_1.2 (constants.%complete_type.3)] +// CHECK:STDOUT: +// CHECK:STDOUT: class { +// CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [template = constants.%B] +// CHECK:STDOUT: %.loc5: @A.%A.elem.loc5 (%A.elem.1) = base_decl %B.ref, element0 [template] +// CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] +// CHECK:STDOUT: %Int.ref: %Int.type = name_ref Int, imports.%import_ref.1 [template = constants.%Int] +// CHECK:STDOUT: %N.ref: %i32 = name_ref N, %N.loc4_9.1 [symbolic = %N.loc4_9.2 (constants.%N.1)] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.13] +// CHECK:STDOUT: %Convert.bound.loc10_19.1: = bound_method %N.ref, %impl.elem0 [symbolic = %Convert.bound.loc10_19.2 (constants.%Convert.bound.1)] +// CHECK:STDOUT: %Convert.specific_fn.loc10_19.1: = specific_function %Convert.bound.loc10_19.1, @Convert.4(constants.%int_32) [symbolic = %Convert.specific_fn.loc10_19.2 (constants.%Convert.specific_fn.1)] +// CHECK:STDOUT: %int.convert_checked.loc10_19.1: init Core.IntLiteral = call %Convert.specific_fn.loc10_19.1(%N.ref) [symbolic = %int.convert_checked.loc10_19.2 (constants.%int.convert_checked)] +// CHECK:STDOUT: %.loc10_19.1: Core.IntLiteral = value_of_initializer %int.convert_checked.loc10_19.1 [symbolic = %int.convert_checked.loc10_19.2 (constants.%int.convert_checked)] +// CHECK:STDOUT: %.loc10_19.2: Core.IntLiteral = converted %N.ref, %.loc10_19.1 [symbolic = %int.convert_checked.loc10_19.2 (constants.%int.convert_checked)] +// CHECK:STDOUT: %int.make_type_signed.loc10: init type = call %Int.ref(%.loc10_19.2) [symbolic = %iN (constants.%iN.2)] +// CHECK:STDOUT: %.loc10_20.1: type = value_of_initializer %int.make_type_signed.loc10 [symbolic = %iN (constants.%iN.2)] +// CHECK:STDOUT: %.loc10_20.2: type = converted %int.make_type_signed.loc10, %.loc10_20.1 [symbolic = %iN (constants.%iN.2)] +// CHECK:STDOUT: %.loc10_8: @A.%A.elem.loc10 (%A.elem.2) = field_decl n, element1 [template] +// CHECK:STDOUT: %complete_type.loc11_1.1: = complete_type_witness %struct_type.base.n [symbolic = %complete_type.loc11_1.2 (constants.%complete_type.3)] +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = constants.%A.1 +// CHECK:STDOUT: .base = %.loc5 +// CHECK:STDOUT: .n = %.loc10_8 +// CHECK:STDOUT: extend %B.ref +// CHECK:STDOUT: complete_type_witness = %complete_type.loc11_1.1 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @F(%a.param_patt: %ptr.2) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [template = constants.%B] +// CHECK:STDOUT: %ptr.loc17: type = ptr_type %B [template = constants.%ptr.3] +// CHECK:STDOUT: %a.ref: %ptr.2 = name_ref a, %a +// CHECK:STDOUT: %.loc17_16.1: ref %A.2 = deref %a.ref +// CHECK:STDOUT: %.loc17_16.2: ref %B = class_element_access %.loc17_16.1, element0 +// CHECK:STDOUT: %addr: %ptr.3 = addr_of %.loc17_16.2 +// CHECK:STDOUT: %.loc17_16.3: %ptr.3 = converted %a.ref, %addr +// CHECK:STDOUT: %b: %ptr.3 = bind_name b, %.loc17_16.3 +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @A(constants.%N.1) { +// CHECK:STDOUT: %N.loc4_9.2 => constants.%N.1 +// CHECK:STDOUT: %N.patt.loc4_9.2 => constants.%N.1 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @A(%N.loc4_9.2) { +// CHECK:STDOUT: %N.loc4_9.2 => constants.%N.1 +// CHECK:STDOUT: %N.patt.loc4_9.2 => constants.%N.1 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @A(constants.%int_0.2) { +// CHECK:STDOUT: %N.loc4_9.2 => constants.%int_0.2 +// CHECK:STDOUT: %N.patt.loc4_9.2 => constants.%int_0.2 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %A => constants.%A.2 +// CHECK:STDOUT: %A.elem.loc5 => constants.%A.elem.3 +// CHECK:STDOUT: %Convert.bound.loc10_19.2 => constants.%Convert.bound.3 +// CHECK:STDOUT: %Convert.specific_fn.loc10_19.2 => constants.%Convert.specific_fn.3 +// CHECK:STDOUT: %int.convert_checked.loc10_19.2 => constants.%int_0.1 +// CHECK:STDOUT: %iN => +// CHECK:STDOUT: %require_complete => +// CHECK:STDOUT: %A.elem.loc10 => +// CHECK:STDOUT: %struct_type.base.n => +// CHECK:STDOUT: %complete_type.loc11_1.2 => +// CHECK:STDOUT: } +// CHECK:STDOUT: From 3ce0df67bb7a2e9503e9f06819c3f20708f914a5 Mon Sep 17 00:00:00 2001 From: Jon Ross-Perkins Date: Thu, 12 Dec 2024 12:51:02 -0800 Subject: [PATCH 21/68] Add `Dump` functions to Check, Parse, and Lex (#4669) - Provide `Check::Dump(context, arg)` and similar. - gdb and lldb should do contextual lookup, and `call Dump(*this, Lex::TokenIndex::Invalid)` has been tested with gdb. - Since this is only for debug, keeps the functions fully separated from code. - Uses alwayslink to ensure objects are correctly linked, even though there are no calls. - `-Wno-missing-prototypes` is needed when we don't have forward declarations. - Code is not linked in opt builds, using `#ifndef NDEBUG`. - This probably could be doing something in BUILD files with a `select()`, but the `#ifndef` seemed easier. This is based on #4620, but uses free functions instead of member functions. Co-authored-by: Dana Jansens --------- Co-authored-by: danakj --- common/ostream.h | 5 +- toolchain/check/BUILD | 20 ++++++++ toolchain/check/context.h | 9 +++- toolchain/check/dump.cpp | 78 ++++++++++++++++++++++++++++++ toolchain/docs/adding_features.md | 11 +++++ toolchain/lex/BUILD | 13 +++++ toolchain/lex/dump.cpp | 36 ++++++++++++++ toolchain/lex/dump.h | 34 +++++++++++++ toolchain/lex/tokenized_buffer.cpp | 8 +-- toolchain/lex/tokenized_buffer.h | 3 -- toolchain/parse/BUILD | 14 ++++++ toolchain/parse/context.cpp | 2 +- toolchain/parse/dump.cpp | 39 +++++++++++++++ toolchain/parse/dump.h | 35 ++++++++++++++ 14 files changed, 293 insertions(+), 14 deletions(-) create mode 100644 toolchain/check/dump.cpp create mode 100644 toolchain/lex/dump.cpp create mode 100644 toolchain/lex/dump.h create mode 100644 toolchain/parse/dump.cpp create mode 100644 toolchain/parse/dump.h diff --git a/common/ostream.h b/common/ostream.h index be984707af2d7..6ba004898875f 100644 --- a/common/ostream.h +++ b/common/ostream.h @@ -5,13 +5,14 @@ #ifndef CARBON_COMMON_OSTREAM_H_ #define CARBON_COMMON_OSTREAM_H_ +// Libraries should include this header instead of raw_ostream. + #include #include #include -#include "llvm/Support/raw_os_ostream.h" -// Libraries should include this header instead of raw_ostream. #include "llvm/Support/Compiler.h" +#include "llvm/Support/raw_os_ostream.h" #include "llvm/Support/raw_ostream.h" // IWYU pragma: export namespace Carbon { diff --git a/toolchain/check/BUILD b/toolchain/check/BUILD index e1cb268405438..213513bdbef18 100644 --- a/toolchain/check/BUILD +++ b/toolchain/check/BUILD @@ -92,6 +92,25 @@ cc_library( ], ) +cc_library( + name = "dump", + srcs = ["dump.cpp"], + # Contains Dump methods without a forward declaration. + copts = ["-Wno-missing-prototypes"], + deps = [ + ":context", + "//common:check", + "//common:ostream", + "//toolchain/lex:dump", + "//toolchain/lex:tokenized_buffer", + "//toolchain/parse:dump", + "//toolchain/parse:tree", + "//toolchain/sem_ir:file", + ], + # Always link dump methods. + alwayslink = 1, +) + cc_library( name = "check", srcs = [ @@ -111,6 +130,7 @@ cc_library( hdrs = ["check.h"], deps = [ ":context", + ":dump", ":impl", ":interface", ":pointer_dereference", diff --git a/toolchain/check/context.h b/toolchain/check/context.h index b602adbb53e86..500624f936a5d 100644 --- a/toolchain/check/context.h +++ b/toolchain/check/context.h @@ -495,10 +495,15 @@ class Context { } auto sem_ir() -> SemIR::File& { return *sem_ir_; } + auto sem_ir() const -> const SemIR::File& { return *sem_ir_; } - auto parse_tree() -> const Parse::Tree& { return sem_ir_->parse_tree(); } + auto parse_tree() const -> const Parse::Tree& { + return sem_ir_->parse_tree(); + } - auto tokens() -> const Lex::TokenizedBuffer& { return parse_tree().tokens(); } + auto tokens() const -> const Lex::TokenizedBuffer& { + return parse_tree().tokens(); + } auto node_stack() -> NodeStack& { return node_stack_; } diff --git a/toolchain/check/dump.cpp b/toolchain/check/dump.cpp new file mode 100644 index 0000000000000..d92306c78d518 --- /dev/null +++ b/toolchain/check/dump.cpp @@ -0,0 +1,78 @@ +// Part of the Carbon Language project, under the Apache License v2.0 with LLVM +// Exceptions. See /LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +// This library contains functions to assist dumping objects to stderr during +// interactive debugging. Functions named `Dump` are intended for direct use by +// developers, and should use overload resolution to determine which will be +// invoked. The debugger should do namespace resolution automatically. For +// example: +// +// - lldb: `expr Dump(context, id)` +// - gdb: `call Dump(context, id)` +// +// The `DumpNoNewline` functions are helpers that exclude a trailing newline. +// They're intended to be composed by `Dump` function implementations. + +#ifndef NDEBUG + +#include "toolchain/lex/dump.h" + +#include "common/check.h" +#include "common/ostream.h" +#include "toolchain/check/context.h" +#include "toolchain/lex/tokenized_buffer.h" +#include "toolchain/parse/dump.h" +#include "toolchain/parse/tree.h" +#include "toolchain/sem_ir/file.h" + +namespace Carbon::Check { + +static auto DumpNoNewline(const Context& context, SemIR::LocId loc_id) -> void { + if (!loc_id.is_valid()) { + llvm::errs() << "LocId(invalid)"; + return; + } + + if (loc_id.is_node_id()) { + auto token = context.parse_tree().node_token(loc_id.node_id()); + auto line = context.tokens().GetLineNumber(token); + auto col = context.tokens().GetColumnNumber(token); + const char* implicit = loc_id.is_implicit() ? " implicit" : ""; + llvm::errs() << "LocId("; + llvm::errs().write_escaped(context.sem_ir().filename()); + llvm::errs() << ":" << line << ":" << col << implicit << ")"; + } else { + CARBON_CHECK(loc_id.is_import_ir_inst_id()); + + auto import_ir_id = context.sem_ir() + .import_ir_insts() + .Get(loc_id.import_ir_inst_id()) + .ir_id; + const auto* import_file = + context.sem_ir().import_irs().Get(import_ir_id).sem_ir; + llvm::errs() << "LocId(import from \""; + llvm::errs().write_escaped(import_file->filename()); + llvm::errs() << "\")"; + } +} + +LLVM_DUMP_METHOD auto Dump(const Context& context, Lex::TokenIndex token) + -> void { + Parse::Dump(context.parse_tree(), token); +} + +LLVM_DUMP_METHOD auto Dump(const Context& context, Parse::NodeId node_id) + -> void { + Parse::Dump(context.parse_tree(), node_id); +} + +LLVM_DUMP_METHOD auto Dump(const Context& context, SemIR::LocId loc_id) + -> void { + DumpNoNewline(context, loc_id); + llvm::errs() << '\n'; +} + +} // namespace Carbon::Check + +#endif // NDEBUG diff --git a/toolchain/docs/adding_features.md b/toolchain/docs/adding_features.md index 2eb1800895434..cf23795105dfe 100644 --- a/toolchain/docs/adding_features.md +++ b/toolchain/docs/adding_features.md @@ -23,6 +23,7 @@ SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception - [Reviewing test deltas](#reviewing-test-deltas) - [Verbose output](#verbose-output) - [Stack traces](#stack-traces) + - [Dumping objects in interactive debuggers](#dumping-objects-in-interactive-debuggers) @@ -496,3 +497,13 @@ While the iterative processing pattern means function stack traces will have minimal context for how the current function is reached, we use LLVM's `PrettyStackTrace` to include details about the state stack. The state stack will be above the function stack in crash output. + +### Dumping objects in interactive debuggers + +We provide namespace-scoped `Dump` functions in several components, such as +[check/dump.cpp](/toolchain/check/dump.cpp). These `Dump` functions will print +contextual information about an object to stderr. The files contain details +regarding support. + +Objects which inherit from `Printable` also have `Dump` member functions, but +these will lack contextual information. diff --git a/toolchain/lex/BUILD b/toolchain/lex/BUILD index 08e2f0bb0d5f7..c68378ef81ccd 100644 --- a/toolchain/lex/BUILD +++ b/toolchain/lex/BUILD @@ -184,6 +184,7 @@ cc_library( hdrs = ["lex.h"], deps = [ ":character_set", + ":dump", ":helpers", ":numeric_literal", ":string_literal", @@ -198,6 +199,18 @@ cc_library( ], ) +cc_library( + name = "dump", + srcs = ["dump.cpp"], + hdrs = ["dump.h"], + deps = [ + ":tokenized_buffer", + "//common:ostream", + ], + # Always link dump methods. + alwayslink = 1, +) + cc_library( name = "token_index", hdrs = ["token_index.h"], diff --git a/toolchain/lex/dump.cpp b/toolchain/lex/dump.cpp new file mode 100644 index 0000000000000..d6e3532a6c9e6 --- /dev/null +++ b/toolchain/lex/dump.cpp @@ -0,0 +1,36 @@ +// Part of the Carbon Language project, under the Apache License v2.0 with LLVM +// Exceptions. See /LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +#ifndef NDEBUG + +#include "toolchain/lex/dump.h" + +#include "common/ostream.h" + +namespace Carbon::Lex { + +auto DumpNoNewline(const TokenizedBuffer& tokens, TokenIndex token) -> void { + if (!token.is_valid()) { + llvm::errs() << "TokenIndex(invalid)"; + return; + } + + auto kind = tokens.GetKind(token); + auto line = tokens.GetLineNumber(token); + auto col = tokens.GetColumnNumber(token); + + llvm::errs() << "TokenIndex(kind: " << kind << ", loc: "; + llvm::errs().write_escaped(tokens.source().filename()); + llvm::errs() << ":" << line << ":" << col << ")"; +} + +LLVM_DUMP_METHOD auto Dump(const TokenizedBuffer& tokens, TokenIndex token) + -> void { + DumpNoNewline(tokens, token); + llvm::errs() << '\n'; +} + +} // namespace Carbon::Lex + +#endif // NDEBUG diff --git a/toolchain/lex/dump.h b/toolchain/lex/dump.h new file mode 100644 index 0000000000000..f38f5598b2713 --- /dev/null +++ b/toolchain/lex/dump.h @@ -0,0 +1,34 @@ +// Part of the Carbon Language project, under the Apache License v2.0 with LLVM +// Exceptions. See /LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +// This library contains functions to assist dumping objects to stderr during +// interactive debugging. Functions named `Dump` are intended for direct use by +// developers, and should use overload resolution to determine which will be +// invoked. The debugger should do namespace resolution automatically. For +// example: +// +// - lldb: `expr Dump(tokens, id)` +// - gdb: `call Dump(tokens, id)` +// +// The `DumpNoNewline` functions are helpers that exclude a trailing newline. +// They're intended to be composed by `Dump` function implementations. + +#ifndef CARBON_TOOLCHAIN_LEX_DUMP_H_ +#define CARBON_TOOLCHAIN_LEX_DUMP_H_ + +#ifndef NDEBUG + +#include "toolchain/lex/tokenized_buffer.h" + +namespace Carbon::Lex { + +auto DumpNoNewline(const TokenizedBuffer& tokens, TokenIndex token) -> void; + +auto Dump(const TokenizedBuffer& tokens, TokenIndex token) -> void; + +} // namespace Carbon::Lex + +#endif // NDEBUG + +#endif // CARBON_TOOLCHAIN_LEX_DUMP_H_ diff --git a/toolchain/lex/tokenized_buffer.cpp b/toolchain/lex/tokenized_buffer.cpp index e4a7652033438..06597456cdeaf 100644 --- a/toolchain/lex/tokenized_buffer.cpp +++ b/toolchain/lex/tokenized_buffer.cpp @@ -25,7 +25,7 @@ auto TokenizedBuffer::GetLine(TokenIndex token) const -> LineIndex { } auto TokenizedBuffer::GetLineNumber(TokenIndex token) const -> int { - return GetLineNumber(GetLine(token)); + return GetLine(token).index + 1; } auto TokenizedBuffer::GetColumnNumber(TokenIndex token) const -> int { @@ -162,10 +162,6 @@ auto TokenizedBuffer::IsRecoveryToken(TokenIndex token) const -> bool { return recovery_tokens_[token.index]; } -auto TokenizedBuffer::GetLineNumber(LineIndex line) const -> int { - return line.index + 1; -} - auto TokenizedBuffer::GetNextLine(LineIndex line) const -> LineIndex { LineIndex next(line.index + 1); CARBON_DCHECK(static_cast(next.index) < line_infos_.size()); @@ -262,7 +258,7 @@ auto TokenizedBuffer::PrintToken(llvm::raw_ostream& output_stream, llvm::right_justify( llvm::formatv("'{0}'", token_info.kind().name()).str(), widths.kind + 2), - llvm::format_decimal(GetLineNumber(GetLine(token)), widths.line), + llvm::format_decimal(GetLineNumber(token), widths.line), llvm::format_decimal(GetColumnNumber(token), widths.column), llvm::format_decimal(GetIndentColumnNumber(line_index), widths.indent), token_text); diff --git a/toolchain/lex/tokenized_buffer.h b/toolchain/lex/tokenized_buffer.h index 1822a7c25823c..748e65f51e810 100644 --- a/toolchain/lex/tokenized_buffer.h +++ b/toolchain/lex/tokenized_buffer.h @@ -156,9 +156,6 @@ class TokenizedBuffer : public Printable { // For example, a closing paren inserted to match an unmatched paren. auto IsRecoveryToken(TokenIndex token) const -> bool; - // Returns the 1-based line number. - auto GetLineNumber(LineIndex line) const -> int; - // Returns the 1-based indentation column number. auto GetIndentColumnNumber(LineIndex line) const -> int; diff --git a/toolchain/parse/BUILD b/toolchain/parse/BUILD index 310ff296eeca1..24ee38f008373 100644 --- a/toolchain/parse/BUILD +++ b/toolchain/parse/BUILD @@ -88,6 +88,7 @@ cc_library( ], deps = [ ":context", + ":dump", ":node_kind", ":state", ":tree", @@ -102,6 +103,19 @@ cc_library( ], ) +cc_library( + name = "dump", + srcs = ["dump.cpp"], + hdrs = ["dump.h"], + deps = [ + ":tree", + "//common:ostream", + "//toolchain/lex:dump", + ], + # Always link dump methods. + alwayslink = 1, +) + cc_library( name = "state", srcs = ["state.cpp"], diff --git a/toolchain/parse/context.cpp b/toolchain/parse/context.cpp index dbcd5c6b14338..fd0b6384cb2a3 100644 --- a/toolchain/parse/context.cpp +++ b/toolchain/parse/context.cpp @@ -481,7 +481,7 @@ auto Context::PrintForStackDump(llvm::raw_ostream& output) const -> void { auto Context::PrintTokenForStackDump(llvm::raw_ostream& output, Lex::TokenIndex token) const -> void { - output << " @ " << tokens_->GetLineNumber(tokens_->GetLine(token)) << ":" + output << " @ " << tokens_->GetLineNumber(token) << ":" << tokens_->GetColumnNumber(token) << ": token " << token << " : " << tokens_->GetKind(token) << "\n"; } diff --git a/toolchain/parse/dump.cpp b/toolchain/parse/dump.cpp new file mode 100644 index 0000000000000..127990596e728 --- /dev/null +++ b/toolchain/parse/dump.cpp @@ -0,0 +1,39 @@ +// Part of the Carbon Language project, under the Apache License v2.0 with LLVM +// Exceptions. See /LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +#ifndef NDEBUG + +#include "toolchain/parse/dump.h" + +#include "common/ostream.h" +#include "toolchain/lex/dump.h" + +namespace Carbon::Parse { + +auto DumpNoNewline(const Tree& tree, NodeId node_id) -> void { + if (!node_id.is_valid()) { + llvm::errs() << "NodeId(invalid)"; + return; + } + + auto kind = tree.node_kind(node_id); + auto token = tree.node_token(node_id); + + llvm::errs() << "NodeId(kind: " << kind << ", token: "; + Lex::DumpNoNewline(tree.tokens(), token); + llvm::errs() << ")"; +} + +LLVM_DUMP_METHOD auto Dump(const Tree& tree, Lex::TokenIndex token) -> void { + Lex::Dump(tree.tokens(), token); +} + +LLVM_DUMP_METHOD auto Dump(const Tree& tree, NodeId node_id) -> void { + DumpNoNewline(tree, node_id); + llvm::errs() << '\n'; +} + +} // namespace Carbon::Parse + +#endif // NDEBUG diff --git a/toolchain/parse/dump.h b/toolchain/parse/dump.h new file mode 100644 index 0000000000000..4c3d90377c3b4 --- /dev/null +++ b/toolchain/parse/dump.h @@ -0,0 +1,35 @@ +// Part of the Carbon Language project, under the Apache License v2.0 with LLVM +// Exceptions. See /LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +// This library contains functions to assist dumping objects to stderr during +// interactive debugging. Functions named `Dump` are intended for direct use by +// developers, and should use overload resolution to determine which will be +// invoked. The debugger should do namespace resolution automatically. For +// example: +// +// - lldb: `expr Dump(tree, id)` +// - gdb: `call Dump(tree, id)` +// +// The `DumpNoNewline` functions are helpers that exclude a trailing newline. +// They're intended to be composed by `Dump` function implementations. + +#ifndef CARBON_TOOLCHAIN_PARSE_DUMP_H_ +#define CARBON_TOOLCHAIN_PARSE_DUMP_H_ + +#ifndef NDEBUG + +#include "toolchain/parse/tree.h" + +namespace Carbon::Parse { + +auto DumpNoNewline(const Tree& tree, NodeId node_id) -> void; + +auto Dump(const Tree& tree, Lex::TokenIndex token) -> void; +auto Dump(const Tree& tree, NodeId node_id) -> void; + +} // namespace Carbon::Parse + +#endif // NDEBUG + +#endif // CARBON_TOOLCHAIN_PARSE_DUMP_H_ From 9ea1534535dbc96592dd6bde8c217501bb1143a2 Mon Sep 17 00:00:00 2001 From: Boaz Brickner Date: Thu, 12 Dec 2024 23:19:24 +0100 Subject: [PATCH 22/68] Allow defining .h files in tests without trying to compile them as Carbon files (#4667) This would be used to test interop with C++. #4666 --- testing/file_test/file_test_base.cpp | 7 ++++-- .../cpp/no_prelude/test_support.carbon | 24 +++++++++++++++++++ 2 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 toolchain/check/testdata/interop/cpp/no_prelude/test_support.carbon diff --git a/testing/file_test/file_test_base.cpp b/testing/file_test/file_test_base.cpp index 5bdbab4eb4f70..fd250422261c4 100644 --- a/testing/file_test/file_test_base.cpp +++ b/testing/file_test/file_test_base.cpp @@ -378,8 +378,11 @@ auto FileTestBase::DoArgReplacements( } it = test_args.erase(it); for (const auto& file : test_files) { - it = test_args.insert(it, file.filename); - ++it; + const std::string& filename = file.filename; + if (!filename.ends_with(".h")) { + it = test_args.insert(it, filename); + ++it; + } } // Back up once because the for loop will advance. --it; diff --git a/toolchain/check/testdata/interop/cpp/no_prelude/test_support.carbon b/toolchain/check/testdata/interop/cpp/no_prelude/test_support.carbon new file mode 100644 index 0000000000000..8beed8f838bd7 --- /dev/null +++ b/toolchain/check/testdata/interop/cpp/no_prelude/test_support.carbon @@ -0,0 +1,24 @@ +// Part of the Carbon Language project, under the Apache License v2.0 with LLVM +// Exceptions. See /LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// AUTOUPDATE +// TIP: To test this file alone, run: +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interop/cpp/no_prelude/test_support.carbon +// TIP: To dump output, run: +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/no_prelude/test_support.carbon + +// --- cpp_file.h + +void foo(); + +// --- carbon_file.carbon + +library "[[@TEST_NAME]]"; + +// CHECK:STDOUT: --- carbon_file.carbon +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] {} +// CHECK:STDOUT: } +// CHECK:STDOUT: From 3e0fdd04eb80f9f2d37d3f61de275d57e4350b08 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Thu, 12 Dec 2024 14:23:00 -0800 Subject: [PATCH 23/68] Lower global variables as global definitions, not global declarations. (#4674) --- toolchain/lower/file_context.cpp | 11 +++++------ toolchain/lower/testdata/global/class_obj.carbon | 2 +- toolchain/lower/testdata/global/class_with_fun.carbon | 2 +- toolchain/lower/testdata/global/decl.carbon | 2 +- toolchain/lower/testdata/global/simple_init.carbon | 4 ++-- .../lower/testdata/global/simple_with_fun.carbon | 4 ++-- toolchain/lower/testdata/global/use.carbon | 4 ++-- 7 files changed, 14 insertions(+), 15 deletions(-) diff --git a/toolchain/lower/file_context.cpp b/toolchain/lower/file_context.cpp index 110a3e792094a..e2f5a32bbcf13 100644 --- a/toolchain/lower/file_context.cpp +++ b/toolchain/lower/file_context.cpp @@ -608,12 +608,11 @@ auto FileContext::BuildGlobalVariableDecl(SemIR::VarStorage var_storage) // TODO: Mangle name. auto mangled_name = *sem_ir().names().GetAsStringIfIdentifier(var_storage.name_id); - auto* type = - var_storage.type_id.is_valid() ? GetType(var_storage.type_id) : nullptr; - return new llvm::GlobalVariable(llvm_module(), type, - /*isConstant=*/false, - llvm::GlobalVariable::InternalLinkage, - /*Initializer=*/nullptr, mangled_name); + auto* type = GetType(var_storage.type_id); + return new llvm::GlobalVariable( + llvm_module(), type, + /*isConstant=*/false, llvm::GlobalVariable::InternalLinkage, + llvm::Constant::getNullValue(type), mangled_name); } auto FileContext::GetLocForDI(SemIR::InstId inst_id) -> LocForDI { diff --git a/toolchain/lower/testdata/global/class_obj.carbon b/toolchain/lower/testdata/global/class_obj.carbon index 564b1e5645a30..aac5deb70481e 100644 --- a/toolchain/lower/testdata/global/class_obj.carbon +++ b/toolchain/lower/testdata/global/class_obj.carbon @@ -14,7 +14,7 @@ var a: A = {}; // CHECK:STDOUT: ; ModuleID = 'class_obj.carbon' // CHECK:STDOUT: source_filename = "class_obj.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: @a = internal global {} +// CHECK:STDOUT: @a = internal global {} zeroinitializer // CHECK:STDOUT: @A.val.loc12_14 = internal constant {} zeroinitializer // CHECK:STDOUT: @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @_C__global_init.Main, ptr null }] // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/global/class_with_fun.carbon b/toolchain/lower/testdata/global/class_with_fun.carbon index 6262869d2b5c2..065f983ed6ef0 100644 --- a/toolchain/lower/testdata/global/class_with_fun.carbon +++ b/toolchain/lower/testdata/global/class_with_fun.carbon @@ -18,7 +18,7 @@ var a: A = {}; // CHECK:STDOUT: ; ModuleID = 'class_with_fun.carbon' // CHECK:STDOUT: source_filename = "class_with_fun.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: @a = internal global {} +// CHECK:STDOUT: @a = internal global {} zeroinitializer // CHECK:STDOUT: @A.val.loc13_12 = internal constant {} zeroinitializer // CHECK:STDOUT: @A.val.loc16_14 = internal constant {} zeroinitializer // CHECK:STDOUT: @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @_C__global_init.Main, ptr null }] diff --git a/toolchain/lower/testdata/global/decl.carbon b/toolchain/lower/testdata/global/decl.carbon index be0ac140c9857..c8bfc0b2a0f2d 100644 --- a/toolchain/lower/testdata/global/decl.carbon +++ b/toolchain/lower/testdata/global/decl.carbon @@ -12,7 +12,7 @@ var a: i32; // CHECK:STDOUT: ; ModuleID = 'decl.carbon' // CHECK:STDOUT: source_filename = "decl.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: @a = internal global i32 +// CHECK:STDOUT: @a = internal global i32 0 // CHECK:STDOUT: // CHECK:STDOUT: !llvm.module.flags = !{!0, !1} // CHECK:STDOUT: !llvm.dbg.cu = !{!2} diff --git a/toolchain/lower/testdata/global/simple_init.carbon b/toolchain/lower/testdata/global/simple_init.carbon index 6591ab48b3df3..67d9c68d31fe8 100644 --- a/toolchain/lower/testdata/global/simple_init.carbon +++ b/toolchain/lower/testdata/global/simple_init.carbon @@ -12,7 +12,7 @@ var a: i32 = 0; // CHECK:STDOUT: ; ModuleID = 'simple_init.carbon' // CHECK:STDOUT: source_filename = "simple_init.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: @a = internal global i32 +// CHECK:STDOUT: @a = internal global i32 0 // CHECK:STDOUT: @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @_C__global_init.Main, ptr null }] // CHECK:STDOUT: // CHECK:STDOUT: define void @_C__global_init.Main() !dbg !4 { @@ -22,7 +22,7 @@ var a: i32 = 0; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives -// CHECK:STDOUT: uselistorder i32 0, { 1, 0 } +// CHECK:STDOUT: uselistorder i32 0, { 1, 0, 2 } // CHECK:STDOUT: // CHECK:STDOUT: !llvm.module.flags = !{!0, !1} // CHECK:STDOUT: !llvm.dbg.cu = !{!2} diff --git a/toolchain/lower/testdata/global/simple_with_fun.carbon b/toolchain/lower/testdata/global/simple_with_fun.carbon index 761b9abb0261f..a2214c070c0c6 100644 --- a/toolchain/lower/testdata/global/simple_with_fun.carbon +++ b/toolchain/lower/testdata/global/simple_with_fun.carbon @@ -17,7 +17,7 @@ var a: i32 = test_a(); // CHECK:STDOUT: ; ModuleID = 'simple_with_fun.carbon' // CHECK:STDOUT: source_filename = "simple_with_fun.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: @a = internal global i32 +// CHECK:STDOUT: @a = internal global i32 0 // CHECK:STDOUT: @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @_C__global_init.Main, ptr null }] // CHECK:STDOUT: // CHECK:STDOUT: define i32 @_Ctest_a.Main() !dbg !4 { @@ -33,7 +33,7 @@ var a: i32 = test_a(); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives -// CHECK:STDOUT: uselistorder i32 0, { 1, 0 } +// CHECK:STDOUT: uselistorder i32 0, { 1, 0, 2 } // CHECK:STDOUT: // CHECK:STDOUT: !llvm.module.flags = !{!0, !1} // CHECK:STDOUT: !llvm.dbg.cu = !{!2} diff --git a/toolchain/lower/testdata/global/use.carbon b/toolchain/lower/testdata/global/use.carbon index c372364f3373b..58c2ebe5b6a4c 100644 --- a/toolchain/lower/testdata/global/use.carbon +++ b/toolchain/lower/testdata/global/use.carbon @@ -18,8 +18,8 @@ fn F() -> i32 { // CHECK:STDOUT: ; ModuleID = 'use.carbon' // CHECK:STDOUT: source_filename = "use.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: @a = internal global i32 -// CHECK:STDOUT: @b = internal global i32 +// CHECK:STDOUT: @a = internal global i32 0 +// CHECK:STDOUT: @b = internal global i32 0 // CHECK:STDOUT: @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @_C__global_init.Main, ptr null }] // CHECK:STDOUT: // CHECK:STDOUT: define i32 @_CF.Main() !dbg !4 { From 0d835699e39852a1e048c2403342358a334ffde2 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Thu, 12 Dec 2024 15:09:28 -0800 Subject: [PATCH 24/68] Import support for array types. (#4675) --- toolchain/check/import_ref.cpp | 21 +++ toolchain/check/testdata/array/import.carbon | 139 +++++++++++++++++++ 2 files changed, 160 insertions(+) create mode 100644 toolchain/check/testdata/array/import.carbon diff --git a/toolchain/check/import_ref.cpp b/toolchain/check/import_ref.cpp index 33aa2d2728062..6b317a0a7b6d5 100644 --- a/toolchain/check/import_ref.cpp +++ b/toolchain/check/import_ref.cpp @@ -1301,6 +1301,24 @@ static auto TryResolveTypedInst(ImportRefResolver& resolver, return ResolveResult::Done(resolver.local_constant_values().Get(inst_id)); } +static auto TryResolveTypedInst(ImportRefResolver& resolver, + SemIR::ArrayType inst) -> ResolveResult { + CARBON_CHECK(inst.type_id == SemIR::TypeType::SingletonTypeId); + auto element_type_const_id = + GetLocalConstantId(resolver, inst.element_type_id); + auto bound_id = GetLocalConstantInstId(resolver, inst.bound_id); + if (resolver.HasNewWork()) { + return ResolveResult::Retry(); + } + + auto element_type_id = + resolver.local_context().GetTypeIdForTypeConstant(element_type_const_id); + return ResolveAs( + resolver, {.type_id = SemIR::TypeType::SingletonTypeId, + .bound_id = bound_id, + .element_type_id = element_type_id}); +} + static auto TryResolveTypedInst(ImportRefResolver& resolver, SemIR::AssociatedEntity inst) -> ResolveResult { auto type_const_id = GetLocalConstantId(resolver, inst.type_id); @@ -2476,6 +2494,9 @@ static auto TryResolveInstCanonical(ImportRefResolver& resolver, case CARBON_KIND(SemIR::AdaptDecl inst): { return TryResolveTypedInst(resolver, inst, inst_id); } + case CARBON_KIND(SemIR::ArrayType inst): { + return TryResolveTypedInst(resolver, inst); + } case CARBON_KIND(SemIR::AssociatedEntity inst): { return TryResolveTypedInst(resolver, inst); } diff --git a/toolchain/check/testdata/array/import.carbon b/toolchain/check/testdata/array/import.carbon new file mode 100644 index 0000000000000..c2779e390fd69 --- /dev/null +++ b/toolchain/check/testdata/array/import.carbon @@ -0,0 +1,139 @@ +// Part of the Carbon Language project, under the Apache License v2.0 with LLVM +// Exceptions. See /LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// AUTOUPDATE +// TIP: To test this file alone, run: +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/array/import.carbon +// TIP: To dump output, run: +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/array/import.carbon + +// --- library.carbon + +library "[[@TEST_NAME]]"; + +fn F() -> [i32; 42]; + +// --- user.carbon + +import library "library"; + +fn G(n: i32) -> i32 { + return F()[n]; +} + +// CHECK:STDOUT: --- library.carbon +// CHECK:STDOUT: +// CHECK:STDOUT: constants { +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %int_42: Core.IntLiteral = int_value 42 [template] +// CHECK:STDOUT: %array_type: type = array_type %int_42, %i32 [template] +// CHECK:STDOUT: %F.type: type = fn_type @F [template] +// CHECK:STDOUT: %F: %F.type = struct_value () [template] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: import Core//prelude +// CHECK:STDOUT: import Core//prelude/... +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .F = %F.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { +// CHECK:STDOUT: %return.patt: %array_type = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %array_type = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] +// CHECK:STDOUT: %int_42: Core.IntLiteral = int_value 42 [template = constants.%int_42] +// CHECK:STDOUT: %.loc4_12.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc4_12.2: type = converted %int.make_type_signed, %.loc4_12.1 [template = constants.%i32] +// CHECK:STDOUT: %array_type: type = array_type %int_42, %i32 [template = constants.%array_type] +// CHECK:STDOUT: %return.param: ref %array_type = out_param runtime_param0 +// CHECK:STDOUT: %return: ref %array_type = return_slot %return.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @F() -> %array_type; +// CHECK:STDOUT: +// CHECK:STDOUT: --- user.carbon +// CHECK:STDOUT: +// CHECK:STDOUT: constants { +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %G.type: type = fn_type @G [template] +// CHECK:STDOUT: %G: %G.type = struct_value () [template] +// CHECK:STDOUT: %F.type: type = fn_type @F [template] +// CHECK:STDOUT: %F: %F.type = struct_value () [template] +// CHECK:STDOUT: %int_42: Core.IntLiteral = int_value 42 [template] +// CHECK:STDOUT: %array_type: type = array_type %int_42, %i32 [template] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: %F.type = import_ref Main//library, F, loaded [template = constants.%F] +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int = %import_ref.2 +// CHECK:STDOUT: import Core//prelude +// CHECK:STDOUT: import Core//prelude/... +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .F = imports.%import_ref.1 +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .G = %G.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { +// CHECK:STDOUT: %n.patt: %i32 = binding_pattern n +// CHECK:STDOUT: %n.param_patt: %i32 = value_param_pattern %n.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %int_32.loc4_9: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %int.make_type_signed.loc4_9: init type = call constants.%Int(%int_32.loc4_9) [template = constants.%i32] +// CHECK:STDOUT: %.loc4_9.1: type = value_of_initializer %int.make_type_signed.loc4_9 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_9.2: type = converted %int.make_type_signed.loc4_9, %.loc4_9.1 [template = constants.%i32] +// CHECK:STDOUT: %int_32.loc4_17: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %int.make_type_signed.loc4_17: init type = call constants.%Int(%int_32.loc4_17) [template = constants.%i32] +// CHECK:STDOUT: %.loc4_17.1: type = value_of_initializer %int.make_type_signed.loc4_17 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_17.2: type = converted %int.make_type_signed.loc4_17, %.loc4_17.1 [template = constants.%i32] +// CHECK:STDOUT: %n.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %n: %i32 = bind_name n, %n.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @G(%n.param_patt: %i32) -> %i32 { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %F.ref: %F.type = name_ref F, imports.%import_ref.1 [template = constants.%F] +// CHECK:STDOUT: %.loc5_12.1: ref %array_type = temporary_storage +// CHECK:STDOUT: %F.call: init %array_type = call %F.ref() to %.loc5_12.1 +// CHECK:STDOUT: %n.ref: %i32 = name_ref n, %n +// CHECK:STDOUT: %.loc5_12.2: ref %array_type = temporary %.loc5_12.1, %F.call +// CHECK:STDOUT: %int_32.loc5: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %int.make_type_signed.loc5: init type = call constants.%Int(%int_32.loc5) [template = constants.%i32] +// CHECK:STDOUT: %.loc5_15.1: type = value_of_initializer %int.make_type_signed.loc5 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_15.2: type = converted %int.make_type_signed.loc5, %.loc5_15.1 [template = constants.%i32] +// CHECK:STDOUT: %.loc5_15.3: ref %i32 = array_index %.loc5_12.2, %n.ref +// CHECK:STDOUT: %.loc5_15.4: %i32 = bind_value %.loc5_15.3 +// CHECK:STDOUT: return %.loc5_15.4 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @F() -> %array_type [from "library.carbon"]; +// CHECK:STDOUT: From e71fd07dc623386ae592fb117bbf27b12cf5fcf8 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Thu, 12 Dec 2024 15:23:44 -0800 Subject: [PATCH 25/68] Support stringifying tuple values. (#4664) --- toolchain/check/testdata/tuple/import.carbon | 4 ++-- toolchain/sem_ir/stringify_type.cpp | 22 +++++++++++++++++++- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/toolchain/check/testdata/tuple/import.carbon b/toolchain/check/testdata/tuple/import.carbon index 91ca8ab9db3db..3b9242177e5da 100644 --- a/toolchain/check/testdata/tuple/import.carbon +++ b/toolchain/check/testdata/tuple/import.carbon @@ -45,10 +45,10 @@ var c_bad: C((1, 2, 3)) = F(); impl package Implicit; -// CHECK:STDERR: fail_bad_value.impl.carbon:[[@LINE+6]]:1: error: cannot implicitly convert from `C()` to `C()` [ImplicitAsConversionFailure] +// CHECK:STDERR: fail_bad_value.impl.carbon:[[@LINE+6]]:1: error: cannot implicitly convert from `C((1, 2))` to `C((3, 4))` [ImplicitAsConversionFailure] // CHECK:STDERR: var c_bad: C((3, 4)) = F(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_bad_value.impl.carbon:[[@LINE+3]]:1: note: type `C()` does not implement interface `Core.ImplicitAs(C())` [MissingImplInMemberAccessNote] +// CHECK:STDERR: fail_bad_value.impl.carbon:[[@LINE+3]]:1: note: type `C((1, 2))` does not implement interface `Core.ImplicitAs(C((3, 4)))` [MissingImplInMemberAccessNote] // CHECK:STDERR: var c_bad: C((3, 4)) = F(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~ var c_bad: C((3, 4)) = F(); diff --git a/toolchain/sem_ir/stringify_type.cpp b/toolchain/sem_ir/stringify_type.cpp index ca13382b65f91..659ee92a968ea 100644 --- a/toolchain/sem_ir/stringify_type.cpp +++ b/toolchain/sem_ir/stringify_type.cpp @@ -454,6 +454,27 @@ auto StringifyTypeExpr(const SemIR::File& sem_ir, InstId outer_inst_id) } break; } + case CARBON_KIND(TupleValue inst): { + auto refs = sem_ir.inst_blocks().Get(inst.elements_id); + if (refs.empty()) { + out << "()"; + break; + } + out << "("; + step_stack.PushString(")"); + // A tuple of one element has a comma to disambiguate from an + // expression. + if (refs.size() == 1) { + step_stack.PushString(","); + } + for (auto i : llvm::reverse(llvm::seq(refs.size()))) { + step_stack.PushInstId(refs[i]); + if (i > 0) { + step_stack.PushString(", "); + } + } + break; + } case CARBON_KIND(UnboundElementType inst): { out << ""); @@ -522,7 +543,6 @@ auto StringifyTypeExpr(const SemIR::File& sem_ir, InstId outer_inst_id) case TupleAccess::Kind: case TupleInit::Kind: case TupleLiteral::Kind: - case TupleValue::Kind: case UnaryOperatorNot::Kind: case ValueAsRef::Kind: case ValueOfInitializer::Kind: From 55c257bc9316b26b53f6c6522341b726f63d4e43 Mon Sep 17 00:00:00 2001 From: Jon Ross-Perkins Date: Thu, 12 Dec 2024 16:05:33 -0800 Subject: [PATCH 26/68] Use a filename without a line number as a cue for autoupdate. (#4677) This is so that diagnostics which lack a location get split file clustering. --- testing/file_test/autoupdate.cpp | 9 +-- testing/file_test/autoupdate_testdata.sh | 3 +- testing/file_test/file_test_base.cpp | 2 +- testing/file_test/file_test_base_test.cpp | 12 ++++ .../file_test/testdata/no_line_number.carbon | 21 ++++++ .../class/syntactic_merge_literal.carbon | 68 +++++++++---------- .../packages/fail_duplicate_api.carbon | 4 +- .../testdata/packages/fail_extension.carbon | 8 +-- 8 files changed, 81 insertions(+), 46 deletions(-) create mode 100644 testing/file_test/testdata/no_line_number.carbon diff --git a/testing/file_test/autoupdate.cpp b/testing/file_test/autoupdate.cpp index 85424c74962cb..307753cc29090 100644 --- a/testing/file_test/autoupdate.cpp +++ b/testing/file_test/autoupdate.cpp @@ -15,10 +15,14 @@ namespace Carbon::Testing { -// Converts a matched line number to an int, trimming whitespace. +// Converts a matched line number to an int, trimming whitespace. Returns 0 if +// there is no line number, to assist early placement. static auto ParseLineNumber(absl::string_view matched_line_number) -> int { llvm::StringRef trimmed = matched_line_number; trimmed = trimmed.trim(); + if (trimmed.empty()) { + return 0; + } // NOLINTNEXTLINE(google-runtime-int): API requirement. long long val; CARBON_CHECK(!llvm::getAsSignedInteger(trimmed, 10, val), "{0}", @@ -41,7 +45,6 @@ auto FileTestAutoupdater::CheckLine::RemapLineNumbers( return; } - bool found_one = false; // Use a cursor for the line so that we can't keep matching the same // content, which may occur when we keep a literal line number. int line_offset = 0; @@ -60,10 +63,8 @@ auto FileTestAutoupdater::CheckLine::RemapLineNumbers( RE2::PartialMatch(line_cursor, *replacement_->re, &matched_line_number); } if (matched_line_number.empty()) { - CARBON_CHECK(found_one, "{0}", line_); return; } - found_one = true; // Update the cursor offset from the match. line_offset = matched_line_number.begin() - line_.c_str(); diff --git a/testing/file_test/autoupdate_testdata.sh b/testing/file_test/autoupdate_testdata.sh index c258c803dc633..e3bca94919afe 100755 --- a/testing/file_test/autoupdate_testdata.sh +++ b/testing/file_test/autoupdate_testdata.sh @@ -4,6 +4,7 @@ # Exceptions. See /LICENSE for license information. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -bazel run -c opt --experimental_convenience_symlinks=ignore \ +"$(dirname "$0")/../../scripts/run_bazel.py" \ + run -c opt --experimental_convenience_symlinks=ignore \ --ui_event_filters=-info,-stdout,-stderr,-finish \ //testing/file_test:file_test_base_test -- --autoupdate "$@" diff --git a/testing/file_test/file_test_base.cpp b/testing/file_test/file_test_base.cpp index fd250422261c4..c32ec573d899a 100644 --- a/testing/file_test/file_test_base.cpp +++ b/testing/file_test/file_test_base.cpp @@ -277,7 +277,7 @@ auto FileTestBase::GetLineNumberReplacements( -> llvm::SmallVector { return {{.has_file = true, .re = std::make_shared( - llvm::formatv(R"(({0}):(\d+))", llvm::join(filenames, "|"))), + llvm::formatv(R"(({0}):(\d+)?)", llvm::join(filenames, "|"))), .line_formatv = R"({0})"}}; } diff --git a/testing/file_test/file_test_base_test.cpp b/testing/file_test/file_test_base_test.cpp index 6caa1d6cf84a5..2660ddb6c534a 100644 --- a/testing/file_test/file_test_base_test.cpp +++ b/testing/file_test/file_test_base_test.cpp @@ -170,6 +170,17 @@ static auto TestFileOnlyREOneFile(TestParams& params) return {{.success = true}}; } +// Does printing and returns expected results for no_line_number.carbon. +static auto TestNoLineNumber(TestParams& params) + -> ErrorOr { + params.stdout << "a.carbon: msg1\n" + "msg2\n" + "b.carbon: msg3\n" + "msg4\n" + "a.carbon: msg5\n"; + return {{.success = true}}; +} + // Does printing and returns expected results for unattached_multi_file.carbon. static auto TestUnattachedMultiFile(TestParams& params) -> ErrorOr { @@ -242,6 +253,7 @@ auto FileTestBaseTest::Run( .Case("fail_example.carbon", &TestFailExample) .Case("file_only_re_one_file.carbon", &TestFileOnlyREOneFile) .Case("file_only_re_multi_file.carbon", &TestFileOnlyREMultiFile) + .Case("no_line_number.carbon", &TestNoLineNumber) .Case("unattached_multi_file.carbon", &TestUnattachedMultiFile) .Case("fail_multi_success_overall_fail.carbon", [&](TestParams&) { diff --git a/testing/file_test/testdata/no_line_number.carbon b/testing/file_test/testdata/no_line_number.carbon new file mode 100644 index 0000000000000..8f911f5b21178 --- /dev/null +++ b/testing/file_test/testdata/no_line_number.carbon @@ -0,0 +1,21 @@ +// Part of the Carbon Language project, under the Apache License v2.0 with LLVM +// Exceptions. See /LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +// AUTOUPDATE +// TIP: To test this file alone, run: +// TIP: bazel test //testing/file_test:file_test_base_test --test_arg=--file_tests=testing/file_test/testdata/no_line_number.carbon +// TIP: To dump output, run: +// TIP: bazel run //testing/file_test:file_test_base_test -- --dump_output --file_tests=testing/file_test/testdata/no_line_number.carbon +// CHECK:STDOUT: 3 args: `default_args`, `a.carbon`, `b.carbon` + +// --- a.carbon +// CHECK:STDOUT: a.carbon: msg1 +// CHECK:STDOUT: msg2 +aaa + +// --- b.carbon +// CHECK:STDOUT: b.carbon: msg3 +// CHECK:STDOUT: msg4 +// CHECK:STDOUT: a.carbon: msg5 +bbb diff --git a/toolchain/check/testdata/class/syntactic_merge_literal.carbon b/toolchain/check/testdata/class/syntactic_merge_literal.carbon index af6ad9aa7285e..0c7c4e0c67a3d 100644 --- a/toolchain/check/testdata/class/syntactic_merge_literal.carbon +++ b/toolchain/check/testdata/class/syntactic_merge_literal.carbon @@ -7,8 +7,6 @@ // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/class/syntactic_merge_literal.carbon // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/class/syntactic_merge_literal.carbon -// CHECK:STDERR: fail_int_mismatch.carbon: error: `Main//default` previously provided by `int_match.carbon` [DuplicateMainApi] -// CHECK:STDERR: // --- int_match.carbon @@ -17,6 +15,8 @@ class D(b:! C(1_000)); class D(b:! C(1_000)) {} // --- fail_int_mismatch.carbon +// CHECK:STDERR: fail_int_mismatch.carbon: error: `Main//default` previously provided by `int_match.carbon` [DuplicateMainApi] +// CHECK:STDERR: class C(a:! i32) {} class D(b:! C(1000)); @@ -213,19 +213,19 @@ class D(b:! C(1_000)) {} // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %C.decl: %C.type = class_decl @C [template = constants.%C.generic] { -// CHECK:STDOUT: %a.patt.loc2_9.1: %i32 = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc2_9.2 (constants.%a.patt)] -// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt.loc2_9.1, runtime_param [symbolic = %a.patt.loc2_9.2 (constants.%a.patt)] +// CHECK:STDOUT: %a.patt.loc4_9.1: %i32 = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc4_9.2 (constants.%a.patt)] +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt.loc4_9.1, runtime_param [symbolic = %a.patt.loc4_9.2 (constants.%a.patt)] // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc2_13.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc2_13.2: type = converted %int.make_type_signed, %.loc2_13.1 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_13.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc4_13.2: type = converted %int.make_type_signed, %.loc4_13.1 [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param -// CHECK:STDOUT: %a.loc2_9.1: %i32 = bind_symbolic_name a, 0, %a.param [symbolic = %a.loc2_9.2 (constants.%a)] +// CHECK:STDOUT: %a.loc4_9.1: %i32 = bind_symbolic_name a, 0, %a.param [symbolic = %a.loc4_9.2 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: %D.decl: %D.type = class_decl @D [template = constants.%D.generic] { -// CHECK:STDOUT: %b.patt.loc3_9.1: %C.2 = symbolic_binding_pattern b, 0 [symbolic = %b.patt.loc3_9.2 (constants.%b.patt)] -// CHECK:STDOUT: %b.param_patt: %C.2 = value_param_pattern %b.patt.loc3_9.1, runtime_param [symbolic = %b.patt.loc3_9.2 (constants.%b.patt)] +// CHECK:STDOUT: %b.patt.loc5_9.1: %C.2 = symbolic_binding_pattern b, 0 [symbolic = %b.patt.loc5_9.2 (constants.%b.patt)] +// CHECK:STDOUT: %b.param_patt: %C.2 = value_param_pattern %b.patt.loc5_9.1, runtime_param [symbolic = %b.patt.loc5_9.2 (constants.%b.patt)] // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [template = constants.%C.generic] // CHECK:STDOUT: %int_1000: Core.IntLiteral = int_value 1000 [template = constants.%int_1000.1] @@ -233,15 +233,15 @@ class D(b:! C(1_000)) {} // CHECK:STDOUT: %Convert.bound: = bound_method %int_1000, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_1000) [template = constants.%int_1000.2] -// CHECK:STDOUT: %.loc3_19.1: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_1000.2] -// CHECK:STDOUT: %.loc3_19.2: %i32 = converted %int_1000, %.loc3_19.1 [template = constants.%int_1000.2] +// CHECK:STDOUT: %.loc5_19.1: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_1000.2] +// CHECK:STDOUT: %.loc5_19.2: %i32 = converted %int_1000, %.loc5_19.1 [template = constants.%int_1000.2] // CHECK:STDOUT: %C: type = class_type @C, @C(constants.%int_1000.2) [template = constants.%C.2] // CHECK:STDOUT: %b.param: %C.2 = value_param runtime_param -// CHECK:STDOUT: %b.loc3_9.1: %C.2 = bind_symbolic_name b, 0, %b.param [symbolic = %b.loc3_9.2 (constants.%b)] +// CHECK:STDOUT: %b.loc5_9.1: %C.2 = bind_symbolic_name b, 0, %b.param [symbolic = %b.loc5_9.2 (constants.%b)] // CHECK:STDOUT: } // CHECK:STDOUT: %.decl: %.type = class_decl @.1 [template = constants.%.generic] { -// CHECK:STDOUT: %b.patt.loc10_9.1: %C.2 = symbolic_binding_pattern b, 0 [symbolic = %b.patt.loc10_9.2 (constants.%b.patt)] -// CHECK:STDOUT: %b.param_patt: %C.2 = value_param_pattern %b.patt.loc10_9.1, runtime_param [symbolic = %b.patt.loc10_9.2 (constants.%b.patt)] +// CHECK:STDOUT: %b.patt.loc12_9.1: %C.2 = symbolic_binding_pattern b, 0 [symbolic = %b.patt.loc12_9.2 (constants.%b.patt)] +// CHECK:STDOUT: %b.param_patt: %C.2 = value_param_pattern %b.patt.loc12_9.1, runtime_param [symbolic = %b.patt.loc12_9.2 (constants.%b.patt)] // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [template = constants.%C.generic] // CHECK:STDOUT: %int_1000: Core.IntLiteral = int_value 1000 [template = constants.%int_1000.1] @@ -249,17 +249,17 @@ class D(b:! C(1_000)) {} // CHECK:STDOUT: %Convert.bound: = bound_method %int_1000, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_1000) [template = constants.%int_1000.2] -// CHECK:STDOUT: %.loc10_20.1: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_1000.2] -// CHECK:STDOUT: %.loc10_20.2: %i32 = converted %int_1000, %.loc10_20.1 [template = constants.%int_1000.2] +// CHECK:STDOUT: %.loc12_20.1: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_1000.2] +// CHECK:STDOUT: %.loc12_20.2: %i32 = converted %int_1000, %.loc12_20.1 [template = constants.%int_1000.2] // CHECK:STDOUT: %C: type = class_type @C, @C(constants.%int_1000.2) [template = constants.%C.2] // CHECK:STDOUT: %b.param: %C.2 = value_param runtime_param -// CHECK:STDOUT: %b.loc10_9.1: %C.2 = bind_symbolic_name b, 0, %b.param [symbolic = %b.loc10_9.2 (constants.%b)] +// CHECK:STDOUT: %b.loc12_9.1: %C.2 = bind_symbolic_name b, 0, %b.param [symbolic = %b.loc12_9.2 (constants.%b)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @C(%a.loc2_9.1: %i32) { -// CHECK:STDOUT: %a.loc2_9.2: %i32 = bind_symbolic_name a, 0 [symbolic = %a.loc2_9.2 (constants.%a)] -// CHECK:STDOUT: %a.patt.loc2_9.2: %i32 = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc2_9.2 (constants.%a.patt)] +// CHECK:STDOUT: generic class @C(%a.loc4_9.1: %i32) { +// CHECK:STDOUT: %a.loc4_9.2: %i32 = bind_symbolic_name a, 0 [symbolic = %a.loc4_9.2 (constants.%a)] +// CHECK:STDOUT: %a.patt.loc4_9.2: %i32 = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc4_9.2 (constants.%a.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: @@ -272,16 +272,16 @@ class D(b:! C(1_000)) {} // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @D(%b.loc3_9.1: %C.2) { -// CHECK:STDOUT: %b.loc3_9.2: %C.2 = bind_symbolic_name b, 0 [symbolic = %b.loc3_9.2 (constants.%b)] -// CHECK:STDOUT: %b.patt.loc3_9.2: %C.2 = symbolic_binding_pattern b, 0 [symbolic = %b.patt.loc3_9.2 (constants.%b.patt)] +// CHECK:STDOUT: generic class @D(%b.loc5_9.1: %C.2) { +// CHECK:STDOUT: %b.loc5_9.2: %C.2 = bind_symbolic_name b, 0 [symbolic = %b.loc5_9.2 (constants.%b)] +// CHECK:STDOUT: %b.patt.loc5_9.2: %C.2 = symbolic_binding_pattern b, 0 [symbolic = %b.patt.loc5_9.2 (constants.%b.patt)] // CHECK:STDOUT: // CHECK:STDOUT: class; // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @.1(%b.loc10_9.1: %C.2) { -// CHECK:STDOUT: %b.loc10_9.2: %C.2 = bind_symbolic_name b, 0 [symbolic = %b.loc10_9.2 (constants.%b)] -// CHECK:STDOUT: %b.patt.loc10_9.2: %C.2 = symbolic_binding_pattern b, 0 [symbolic = %b.patt.loc10_9.2 (constants.%b.patt)] +// CHECK:STDOUT: generic class @.1(%b.loc12_9.1: %C.2) { +// CHECK:STDOUT: %b.loc12_9.2: %C.2 = bind_symbolic_name b, 0 [symbolic = %b.loc12_9.2 (constants.%b)] +// CHECK:STDOUT: %b.patt.loc12_9.2: %C.2 = symbolic_binding_pattern b, 0 [symbolic = %b.patt.loc12_9.2 (constants.%b.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: @@ -295,22 +295,22 @@ class D(b:! C(1_000)) {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @C(constants.%a) { -// CHECK:STDOUT: %a.loc2_9.2 => constants.%a -// CHECK:STDOUT: %a.patt.loc2_9.2 => constants.%a +// CHECK:STDOUT: %a.loc4_9.2 => constants.%a +// CHECK:STDOUT: %a.patt.loc4_9.2 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @C(constants.%int_1000.2) { -// CHECK:STDOUT: %a.loc2_9.2 => constants.%int_1000.2 -// CHECK:STDOUT: %a.patt.loc2_9.2 => constants.%int_1000.2 +// CHECK:STDOUT: %a.loc4_9.2 => constants.%int_1000.2 +// CHECK:STDOUT: %a.patt.loc4_9.2 => constants.%int_1000.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @D(constants.%b) { -// CHECK:STDOUT: %b.loc3_9.2 => constants.%b -// CHECK:STDOUT: %b.patt.loc3_9.2 => constants.%b +// CHECK:STDOUT: %b.loc5_9.2 => constants.%b +// CHECK:STDOUT: %b.patt.loc5_9.2 => constants.%b // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @.1(constants.%b) { -// CHECK:STDOUT: %b.loc10_9.2 => constants.%b -// CHECK:STDOUT: %b.patt.loc10_9.2 => constants.%b +// CHECK:STDOUT: %b.loc12_9.2 => constants.%b +// CHECK:STDOUT: %b.patt.loc12_9.2 => constants.%b // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/packages/fail_duplicate_api.carbon b/toolchain/check/testdata/packages/fail_duplicate_api.carbon index d41dd65674247..da19cec469508 100644 --- a/toolchain/check/testdata/packages/fail_duplicate_api.carbon +++ b/toolchain/check/testdata/packages/fail_duplicate_api.carbon @@ -7,12 +7,12 @@ // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/packages/fail_duplicate_api.carbon // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/packages/fail_duplicate_api.carbon -// CHECK:STDERR: fail_main2.carbon: error: `Main//default` previously provided by `main1.carbon` [DuplicateMainApi] -// CHECK:STDERR: // --- main1.carbon // --- fail_main2.carbon +// CHECK:STDERR: fail_main2.carbon: error: `Main//default` previously provided by `main1.carbon` [DuplicateMainApi] +// CHECK:STDERR: // --- main_lib1.carbon diff --git a/toolchain/check/testdata/packages/fail_extension.carbon b/toolchain/check/testdata/packages/fail_extension.carbon index 24aa0d805ef1f..400aa60085396 100644 --- a/toolchain/check/testdata/packages/fail_extension.carbon +++ b/toolchain/check/testdata/packages/fail_extension.carbon @@ -7,18 +7,18 @@ // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/packages/fail_extension.carbon // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/packages/fail_extension.carbon + +// --- fail_main.incorrect // CHECK:STDERR: fail_main.incorrect: error: file extension of `.carbon` required for api [IncorrectExtension] // CHECK:STDERR: + +// --- fail_main_redundant_with_swapped_ext.impl.carbon // CHECK:STDERR: fail_main_redundant_with_swapped_ext.impl.carbon: error: `Main//default` previously provided by `fail_main.incorrect` [DuplicateMainApi] // CHECK:STDERR: // CHECK:STDERR: fail_main_redundant_with_swapped_ext.impl.carbon: error: file extension of `.carbon` required for api [IncorrectExtension] // CHECK:STDERR: fail_main_redundant_with_swapped_ext.impl.carbon: note: file extension of `.impl.carbon` only allowed for `impl` [IncorrectExtensionImplNote] // CHECK:STDERR: -// --- fail_main.incorrect - -// --- fail_main_redundant_with_swapped_ext.impl.carbon - // --- fail_main_lib.incorrect // CHECK:STDERR: fail_main_lib.incorrect:[[@LINE+4]]:1: error: file extension of `.carbon` required for api [IncorrectExtension] From aee098b8e2d5a4225e6ce5c966c329f3bbc238c2 Mon Sep 17 00:00:00 2001 From: Jon Ross-Perkins Date: Thu, 12 Dec 2024 16:34:57 -0800 Subject: [PATCH 27/68] Clean up missing library in test (#4678) Noted in #4677 --- .../class/syntactic_merge_literal.carbon | 98 ++++++++++--------- 1 file changed, 50 insertions(+), 48 deletions(-) diff --git a/toolchain/check/testdata/class/syntactic_merge_literal.carbon b/toolchain/check/testdata/class/syntactic_merge_literal.carbon index 0c7c4e0c67a3d..9a119e08d0145 100644 --- a/toolchain/check/testdata/class/syntactic_merge_literal.carbon +++ b/toolchain/check/testdata/class/syntactic_merge_literal.carbon @@ -10,13 +10,15 @@ // --- int_match.carbon +library "[[@TEST_NAME]]"; + class C(a:! i32) {} class D(b:! C(1_000)); class D(b:! C(1_000)) {} // --- fail_int_mismatch.carbon -// CHECK:STDERR: fail_int_mismatch.carbon: error: `Main//default` previously provided by `int_match.carbon` [DuplicateMainApi] -// CHECK:STDERR: + +library "[[@TEST_NAME]]"; class C(a:! i32) {} class D(b:! C(1000)); @@ -71,57 +73,57 @@ class D(b:! C(1_000)) {} // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = imports.%Core // CHECK:STDOUT: .C = %C.decl -// CHECK:STDOUT: .D = %D.decl.loc3 +// CHECK:STDOUT: .D = %D.decl.loc5 // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %C.decl: %C.type = class_decl @C [template = constants.%C.generic] { -// CHECK:STDOUT: %a.patt.loc2_9.1: %i32 = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc2_9.2 (constants.%a.patt)] -// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt.loc2_9.1, runtime_param [symbolic = %a.patt.loc2_9.2 (constants.%a.patt)] +// CHECK:STDOUT: %a.patt.loc4_9.1: %i32 = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc4_9.2 (constants.%a.patt)] +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt.loc4_9.1, runtime_param [symbolic = %a.patt.loc4_9.2 (constants.%a.patt)] // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc2_13.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc2_13.2: type = converted %int.make_type_signed, %.loc2_13.1 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_13.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] +// CHECK:STDOUT: %.loc4_13.2: type = converted %int.make_type_signed, %.loc4_13.1 [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param -// CHECK:STDOUT: %a.loc2_9.1: %i32 = bind_symbolic_name a, 0, %a.param [symbolic = %a.loc2_9.2 (constants.%a)] +// CHECK:STDOUT: %a.loc4_9.1: %i32 = bind_symbolic_name a, 0, %a.param [symbolic = %a.loc4_9.2 (constants.%a)] // CHECK:STDOUT: } -// CHECK:STDOUT: %D.decl.loc3: %D.type = class_decl @D [template = constants.%D.generic] { -// CHECK:STDOUT: %b.patt.loc4: %C.2 = symbolic_binding_pattern b, 0 [symbolic = constants.%b.patt] -// CHECK:STDOUT: %b.param_patt: %C.2 = value_param_pattern %b.patt.loc4, runtime_param [symbolic = constants.%b.patt] +// CHECK:STDOUT: %D.decl.loc5: %D.type = class_decl @D [template = constants.%D.generic] { +// CHECK:STDOUT: %b.patt.loc6: %C.2 = symbolic_binding_pattern b, 0 [symbolic = constants.%b.patt] +// CHECK:STDOUT: %b.param_patt: %C.2 = value_param_pattern %b.patt.loc6, runtime_param [symbolic = constants.%b.patt] // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref.loc3: %C.type = name_ref C, file.%C.decl [template = constants.%C.generic] -// CHECK:STDOUT: %int_1000.loc3: Core.IntLiteral = int_value 1000 [template = constants.%int_1000.1] -// CHECK:STDOUT: %impl.elem0.loc3: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] -// CHECK:STDOUT: %Convert.bound.loc3: = bound_method %int_1000.loc3, %impl.elem0.loc3 [template = constants.%Convert.bound] -// CHECK:STDOUT: %Convert.specific_fn.loc3: = specific_function %Convert.bound.loc3, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked.loc3: init %i32 = call %Convert.specific_fn.loc3(%int_1000.loc3) [template = constants.%int_1000.2] -// CHECK:STDOUT: %.loc3_20.1: %i32 = value_of_initializer %int.convert_checked.loc3 [template = constants.%int_1000.2] -// CHECK:STDOUT: %.loc3_20.2: %i32 = converted %int_1000.loc3, %.loc3_20.1 [template = constants.%int_1000.2] -// CHECK:STDOUT: %C.loc3: type = class_type @C, @C(constants.%int_1000.2) [template = constants.%C.2] -// CHECK:STDOUT: %b.param.loc3: %C.2 = value_param runtime_param -// CHECK:STDOUT: %b.loc3_9.1: %C.2 = bind_symbolic_name b, 0, %b.param.loc3 [symbolic = %b.loc3_9.2 (constants.%b)] +// CHECK:STDOUT: %C.ref.loc5: %C.type = name_ref C, file.%C.decl [template = constants.%C.generic] +// CHECK:STDOUT: %int_1000.loc5: Core.IntLiteral = int_value 1000 [template = constants.%int_1000.1] +// CHECK:STDOUT: %impl.elem0.loc5: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %Convert.bound.loc5: = bound_method %int_1000.loc5, %impl.elem0.loc5 [template = constants.%Convert.bound] +// CHECK:STDOUT: %Convert.specific_fn.loc5: = specific_function %Convert.bound.loc5, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %int.convert_checked.loc5: init %i32 = call %Convert.specific_fn.loc5(%int_1000.loc5) [template = constants.%int_1000.2] +// CHECK:STDOUT: %.loc5_20.1: %i32 = value_of_initializer %int.convert_checked.loc5 [template = constants.%int_1000.2] +// CHECK:STDOUT: %.loc5_20.2: %i32 = converted %int_1000.loc5, %.loc5_20.1 [template = constants.%int_1000.2] +// CHECK:STDOUT: %C.loc5: type = class_type @C, @C(constants.%int_1000.2) [template = constants.%C.2] +// CHECK:STDOUT: %b.param.loc5: %C.2 = value_param runtime_param +// CHECK:STDOUT: %b.loc5_9.1: %C.2 = bind_symbolic_name b, 0, %b.param.loc5 [symbolic = %b.loc5_9.2 (constants.%b)] // CHECK:STDOUT: } -// CHECK:STDOUT: %D.decl.loc4: %D.type = class_decl @D [template = constants.%D.generic] { -// CHECK:STDOUT: %b.patt.loc4: %C.2 = symbolic_binding_pattern b, 0 [symbolic = constants.%b.patt] -// CHECK:STDOUT: %b.param_patt: %C.2 = value_param_pattern %b.patt.loc4, runtime_param [symbolic = constants.%b.patt] +// CHECK:STDOUT: %D.decl.loc6: %D.type = class_decl @D [template = constants.%D.generic] { +// CHECK:STDOUT: %b.patt.loc6: %C.2 = symbolic_binding_pattern b, 0 [symbolic = constants.%b.patt] +// CHECK:STDOUT: %b.param_patt: %C.2 = value_param_pattern %b.patt.loc6, runtime_param [symbolic = constants.%b.patt] // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref.loc4: %C.type = name_ref C, file.%C.decl [template = constants.%C.generic] -// CHECK:STDOUT: %int_1000.loc4: Core.IntLiteral = int_value 1000 [template = constants.%int_1000.1] -// CHECK:STDOUT: %impl.elem0.loc4: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] -// CHECK:STDOUT: %Convert.bound.loc4: = bound_method %int_1000.loc4, %impl.elem0.loc4 [template = constants.%Convert.bound] -// CHECK:STDOUT: %Convert.specific_fn.loc4: = specific_function %Convert.bound.loc4, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked.loc4: init %i32 = call %Convert.specific_fn.loc4(%int_1000.loc4) [template = constants.%int_1000.2] -// CHECK:STDOUT: %.loc4_20.1: %i32 = value_of_initializer %int.convert_checked.loc4 [template = constants.%int_1000.2] -// CHECK:STDOUT: %.loc4_20.2: %i32 = converted %int_1000.loc4, %.loc4_20.1 [template = constants.%int_1000.2] -// CHECK:STDOUT: %C.loc4: type = class_type @C, @C(constants.%int_1000.2) [template = constants.%C.2] -// CHECK:STDOUT: %b.param.loc4: %C.2 = value_param runtime_param -// CHECK:STDOUT: %b.loc4: %C.2 = bind_symbolic_name b, 0, %b.param.loc4 [symbolic = constants.%b] +// CHECK:STDOUT: %C.ref.loc6: %C.type = name_ref C, file.%C.decl [template = constants.%C.generic] +// CHECK:STDOUT: %int_1000.loc6: Core.IntLiteral = int_value 1000 [template = constants.%int_1000.1] +// CHECK:STDOUT: %impl.elem0.loc6: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %Convert.bound.loc6: = bound_method %int_1000.loc6, %impl.elem0.loc6 [template = constants.%Convert.bound] +// CHECK:STDOUT: %Convert.specific_fn.loc6: = specific_function %Convert.bound.loc6, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %int.convert_checked.loc6: init %i32 = call %Convert.specific_fn.loc6(%int_1000.loc6) [template = constants.%int_1000.2] +// CHECK:STDOUT: %.loc6_20.1: %i32 = value_of_initializer %int.convert_checked.loc6 [template = constants.%int_1000.2] +// CHECK:STDOUT: %.loc6_20.2: %i32 = converted %int_1000.loc6, %.loc6_20.1 [template = constants.%int_1000.2] +// CHECK:STDOUT: %C.loc6: type = class_type @C, @C(constants.%int_1000.2) [template = constants.%C.2] +// CHECK:STDOUT: %b.param.loc6: %C.2 = value_param runtime_param +// CHECK:STDOUT: %b.loc6: %C.2 = bind_symbolic_name b, 0, %b.param.loc6 [symbolic = constants.%b] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @C(%a.loc2_9.1: %i32) { -// CHECK:STDOUT: %a.loc2_9.2: %i32 = bind_symbolic_name a, 0 [symbolic = %a.loc2_9.2 (constants.%a)] -// CHECK:STDOUT: %a.patt.loc2_9.2: %i32 = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc2_9.2 (constants.%a.patt)] +// CHECK:STDOUT: generic class @C(%a.loc4_9.1: %i32) { +// CHECK:STDOUT: %a.loc4_9.2: %i32 = bind_symbolic_name a, 0 [symbolic = %a.loc4_9.2 (constants.%a)] +// CHECK:STDOUT: %a.patt.loc4_9.2: %i32 = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc4_9.2 (constants.%a.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: @@ -134,9 +136,9 @@ class D(b:! C(1_000)) {} // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @D(%b.loc3_9.1: %C.2) { -// CHECK:STDOUT: %b.loc3_9.2: %C.2 = bind_symbolic_name b, 0 [symbolic = %b.loc3_9.2 (constants.%b)] -// CHECK:STDOUT: %b.patt.loc3: %C.2 = symbolic_binding_pattern b, 0 [symbolic = %b.patt.loc3 (constants.%b.patt)] +// CHECK:STDOUT: generic class @D(%b.loc5_9.1: %C.2) { +// CHECK:STDOUT: %b.loc5_9.2: %C.2 = bind_symbolic_name b, 0 [symbolic = %b.loc5_9.2 (constants.%b)] +// CHECK:STDOUT: %b.patt.loc5: %C.2 = symbolic_binding_pattern b, 0 [symbolic = %b.patt.loc5 (constants.%b.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: @@ -150,18 +152,18 @@ class D(b:! C(1_000)) {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @C(constants.%a) { -// CHECK:STDOUT: %a.loc2_9.2 => constants.%a -// CHECK:STDOUT: %a.patt.loc2_9.2 => constants.%a +// CHECK:STDOUT: %a.loc4_9.2 => constants.%a +// CHECK:STDOUT: %a.patt.loc4_9.2 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @C(constants.%int_1000.2) { -// CHECK:STDOUT: %a.loc2_9.2 => constants.%int_1000.2 -// CHECK:STDOUT: %a.patt.loc2_9.2 => constants.%int_1000.2 +// CHECK:STDOUT: %a.loc4_9.2 => constants.%int_1000.2 +// CHECK:STDOUT: %a.patt.loc4_9.2 => constants.%int_1000.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @D(constants.%b) { -// CHECK:STDOUT: %b.loc3_9.2 => constants.%b -// CHECK:STDOUT: %b.patt.loc3 => constants.%b +// CHECK:STDOUT: %b.loc5_9.2 => constants.%b +// CHECK:STDOUT: %b.patt.loc5 => constants.%b // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_int_mismatch.carbon From c7ae2a7b183b156f9e8b949313cd9fb885e41d63 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Fri, 13 Dec 2024 09:48:05 -0500 Subject: [PATCH 28/68] Avoid printing enums as characters (#4676) Given code like the following: ``` auto kind = ConversionTarget::Kind{0}; CARBON_CHECK(!loc_id.is_valid(), "hello {0} world", kind); ``` Currently we would print 'hello ', as the check string would be treated as terminating at the '{0}', so it does not print the rest of the string or a newline. This is because ConversionTarget::Kind is an enum with underlying type `int8_t` which is a char, and llvm::formatv does not look if the type is an enum and treat is specially. So it prints it as a char rather than a number, which in this case is a nul terminator. With this change, the '{0}' value will be converted to a larger integer before being passed through to llvm::formatv so that char-sized enums will print as a number, and the result is that we will print 'hello 0 world\n' as the developer intended. --- common/check_internal.h | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/common/check_internal.h b/common/check_internal.h index 83cba46e127d0..97161297ed6f9 100644 --- a/common/check_internal.h +++ b/common/check_internal.h @@ -43,6 +43,28 @@ CheckCondition(bool condition) const char* condition_str, llvm::StringRef extra_message) -> void; +// Allow converting format values; the default behaviour is to just pass them +// through. +template +auto ConvertFormatValue(T&& t) -> T&& { + return std::forward(t); +} + +// Convert enums to larger integers so that byte-sized enums are not confused +// with being chars and printed as invalid (or nul-terminating) characters. +// Scoped enums are explicitly converted to integers so they can be printed +// without the user writing a cast. +template + requires(std::is_enum_v>) +auto ConvertFormatValue(T&& t) { + if constexpr (std::is_signed_v< + std::underlying_type_t>>) { + return static_cast(t); + } else { + return static_cast(t); + } +} + // Prints a check failure, including rendering any user-provided message using // a format string. // @@ -64,9 +86,10 @@ template (values)...).str()); + CheckFailImpl(Kind.c_str(), File.c_str(), Line, ConditionStr.c_str(), + llvm::formatv(FormatStr.c_str(), + ConvertFormatValue(std::forward(values))...) + .str()); } } From 18d99350a92577f5c7d07e0efaf2d6f1ffb39b6e Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Fri, 13 Dec 2024 10:46:27 -0500 Subject: [PATCH 29/68] Add a --remote switch to new_proposal.py (#4681) If the user's fork is not named 'origin' then the script will fail and needs to know the user's remote name. Fixes #1899 --- proposals/scripts/new_proposal.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/proposals/scripts/new_proposal.py b/proposals/scripts/new_proposal.py index 70c79f38d8730..b66eb749408c8 100755 --- a/proposals/scripts/new_proposal.py +++ b/proposals/scripts/new_proposal.py @@ -55,6 +55,13 @@ def _parse_args(args: Optional[List[str]] = None) -> argparse.Namespace: help="The name of the branch. Automatically generated from the title " "by default.", ) + parser.add_argument( + "--remote", + metavar="REMOTE", + default="origin", + help="The git remote name where the branch will be pushed. Defaults to " + "'origin'.", + ) parser.add_argument( "--proposals-dir", metavar="PROPOSALS_DIR", @@ -177,7 +184,7 @@ def main() -> None: _run( [git_bin, "switch", "--create", branch, parsed_args.branch_start_point] ) - _run([git_bin, "push", "-u", "origin", branch]) + _run([git_bin, "push", "-u", parsed_args.remote, branch]) # Copy template.md to a temp file. template_path = os.path.join(proposals_dir, "scripts/template.md") From 1d5d4617ca5699db6e6f5c37ea0db2a0ad04758a Mon Sep 17 00:00:00 2001 From: Jon Ross-Perkins Date: Fri, 13 Dec 2024 17:13:34 -0800 Subject: [PATCH 30/68] Fix mem usage tracking of semir (#4684) The call got misplaced during refactoring. --- toolchain/driver/compile_subcommand.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/toolchain/driver/compile_subcommand.cpp b/toolchain/driver/compile_subcommand.cpp index 3df5f5f182253..175a0c6313063 100644 --- a/toolchain/driver/compile_subcommand.cpp +++ b/toolchain/driver/compile_subcommand.cpp @@ -442,10 +442,6 @@ class CompilationUnit { sem_ir_.emplace(&*parse_tree_, check_ir_id, parse_tree_->packaging_decl(), value_stores_, input_filename_); - if (mem_usage_) { - mem_usage_->Collect("sem_ir_", *sem_ir_); - } - sem_ir_converter_.emplace(node_converters, &*sem_ir_); return {.consumer = consumer_, .value_stores = &value_stores_, @@ -465,6 +461,10 @@ class CompilationUnit { // to wait for code generation. consumer_->Flush(); + if (mem_usage_) { + mem_usage_->Collect("sem_ir_", *sem_ir_); + } + if (options_.dump_raw_sem_ir && IncludeInDumps()) { CARBON_VLOG("*** Raw SemIR::File ***\n{0}\n", *sem_ir_); sem_ir_->Print(driver_env_->output_stream, options_.builtin_sem_ir); From 7b45a28a824deb3c4012b80fdc72e364a055a5be Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Fri, 13 Dec 2024 20:47:32 -0800 Subject: [PATCH 31/68] Fix lowering of array indexing with an int literal. (#4686) Such indexing operations are created by array initialization. Since we switched integer literals to be of type IntLiteral we've been attempting to index arrays with the (empty) representation of an IntLiteral rather than with an actual integer value. --- toolchain/lower/handle.cpp | 18 +++- .../testdata/array/array_in_place.carbon | 4 +- .../testdata/array/assign_return_value.carbon | 4 +- toolchain/lower/testdata/array/base.carbon | 22 ++--- toolchain/lower/testdata/array/field.carbon | 85 +++++++++++++++++++ .../testdata/array/function_param.carbon | 6 +- .../testdata/basics/numeric_literals.carbon | 20 ++--- .../index/array_element_access.carbon | 8 +- 8 files changed, 134 insertions(+), 33 deletions(-) create mode 100644 toolchain/lower/testdata/array/field.carbon diff --git a/toolchain/lower/handle.cpp b/toolchain/lower/handle.cpp index 01d0431ea0507..a52ecae1af228 100644 --- a/toolchain/lower/handle.cpp +++ b/toolchain/lower/handle.cpp @@ -29,9 +29,25 @@ auto HandleInst(FunctionContext& context, SemIR::InstId inst_id, auto* array_value = context.GetValue(inst.array_id); auto* llvm_type = context.GetType(context.sem_ir().insts().Get(inst.array_id).type_id()); + + // The index in an `ArrayIndex` can be of any integer type, including + // IntLiteral. If it is an IntLiteral, its value representation is empty, so + // create a ConstantInt from its SemIR value directly. + llvm::Value* index; + if (context.sem_ir().types().GetInstId( + context.sem_ir().insts().Get(inst.index_id).type_id()) == + SemIR::IntLiteralType::SingletonInstId) { + auto value = context.sem_ir().insts().GetAs( + context.sem_ir().constant_values().GetConstantInstId(inst.index_id)); + index = llvm::ConstantInt::get(context.llvm_context(), + context.sem_ir().ints().Get(value.int_id)); + } else { + index = context.GetValue(inst.index_id); + } + llvm::Value* indexes[2] = { llvm::ConstantInt::get(llvm::Type::getInt32Ty(context.llvm_context()), 0), - context.GetValue(inst.index_id)}; + index}; context.SetLocal(inst_id, context.builder().CreateInBoundsGEP(llvm_type, array_value, indexes, "array.index")); diff --git a/toolchain/lower/testdata/array/array_in_place.carbon b/toolchain/lower/testdata/array/array_in_place.carbon index f3968281af8d0..dd443433fff17 100644 --- a/toolchain/lower/testdata/array/array_in_place.carbon +++ b/toolchain/lower/testdata/array/array_in_place.carbon @@ -22,9 +22,9 @@ fn G() { // CHECK:STDOUT: define void @_CG.Main() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %v.var = alloca [2 x { i32, i32, i32 }], align 8, !dbg !7 -// CHECK:STDOUT: %.loc14_42.1.array.index = getelementptr inbounds [2 x { i32, i32, i32 }], ptr %v.var, i32 0, {} zeroinitializer, !dbg !8 +// CHECK:STDOUT: %.loc14_42.1.array.index = getelementptr inbounds [2 x { i32, i32, i32 }], ptr %v.var, i32 0, i64 0, !dbg !8 // CHECK:STDOUT: call void @_CF.Main(ptr %.loc14_42.1.array.index), !dbg !9 -// CHECK:STDOUT: %.loc14_42.3.array.index = getelementptr inbounds [2 x { i32, i32, i32 }], ptr %v.var, i32 0, {} zeroinitializer, !dbg !8 +// CHECK:STDOUT: %.loc14_42.3.array.index = getelementptr inbounds [2 x { i32, i32, i32 }], ptr %v.var, i32 0, i64 1, !dbg !8 // CHECK:STDOUT: call void @_CF.Main(ptr %.loc14_42.3.array.index), !dbg !10 // CHECK:STDOUT: ret void, !dbg !11 // CHECK:STDOUT: } diff --git a/toolchain/lower/testdata/array/assign_return_value.carbon b/toolchain/lower/testdata/array/assign_return_value.carbon index 5cfb39c902dec..3413e29af391e 100644 --- a/toolchain/lower/testdata/array/assign_return_value.carbon +++ b/toolchain/lower/testdata/array/assign_return_value.carbon @@ -34,11 +34,11 @@ fn Run() { // CHECK:STDOUT: call void @_CF.Main(ptr %.loc14_23.1.temp), !dbg !11 // CHECK:STDOUT: %tuple.elem0.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %.loc14_23.1.temp, i32 0, i32 0, !dbg !11 // CHECK:STDOUT: %.loc14_23.3 = load i32, ptr %tuple.elem0.tuple.elem, align 4, !dbg !11 -// CHECK:STDOUT: %.loc14_23.4.array.index = getelementptr inbounds [2 x i32], ptr %t.var, i32 0, {} zeroinitializer, !dbg !11 +// CHECK:STDOUT: %.loc14_23.4.array.index = getelementptr inbounds [2 x i32], ptr %t.var, i32 0, i64 0, !dbg !11 // CHECK:STDOUT: store i32 %.loc14_23.3, ptr %.loc14_23.4.array.index, align 4, !dbg !11 // CHECK:STDOUT: %tuple.elem1.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %.loc14_23.1.temp, i32 0, i32 1, !dbg !11 // CHECK:STDOUT: %.loc14_23.6 = load i32, ptr %tuple.elem1.tuple.elem, align 4, !dbg !11 -// CHECK:STDOUT: %.loc14_23.7.array.index = getelementptr inbounds [2 x i32], ptr %t.var, i32 0, {} zeroinitializer, !dbg !11 +// CHECK:STDOUT: %.loc14_23.7.array.index = getelementptr inbounds [2 x i32], ptr %t.var, i32 0, i64 1, !dbg !11 // CHECK:STDOUT: store i32 %.loc14_23.6, ptr %.loc14_23.7.array.index, align 4, !dbg !11 // CHECK:STDOUT: ret void, !dbg !12 // CHECK:STDOUT: } diff --git a/toolchain/lower/testdata/array/base.carbon b/toolchain/lower/testdata/array/base.carbon index 753137e8090f3..6dc7a6d60c4f8 100644 --- a/toolchain/lower/testdata/array/base.carbon +++ b/toolchain/lower/testdata/array/base.carbon @@ -27,18 +27,18 @@ fn Run() { // CHECK:STDOUT: define void @main() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %a.var = alloca [1 x i32], align 4, !dbg !7 -// CHECK:STDOUT: %.loc12_24.3.array.index = getelementptr inbounds [1 x i32], ptr %a.var, i32 0, {} zeroinitializer, !dbg !8 +// CHECK:STDOUT: %.loc12_24.3.array.index = getelementptr inbounds [1 x i32], ptr %a.var, i32 0, i64 0, !dbg !8 // CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %a.var, ptr align 4 @array.1.loc12_25, i64 4, i1 false), !dbg !9 // CHECK:STDOUT: %b.var = alloca [2 x double], align 8, !dbg !10 -// CHECK:STDOUT: %.loc13_32.2.array.index = getelementptr inbounds [2 x double], ptr %b.var, i32 0, {} zeroinitializer, !dbg !11 -// CHECK:STDOUT: %.loc13_32.4.array.index = getelementptr inbounds [2 x double], ptr %b.var, i32 0, {} zeroinitializer, !dbg !11 +// CHECK:STDOUT: %.loc13_32.2.array.index = getelementptr inbounds [2 x double], ptr %b.var, i32 0, i64 0, !dbg !11 +// CHECK:STDOUT: %.loc13_32.4.array.index = getelementptr inbounds [2 x double], ptr %b.var, i32 0, i64 1, !dbg !11 // CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 8 %b.var, ptr align 8 @array.2.loc13_33, i64 16, i1 false), !dbg !12 // CHECK:STDOUT: %c.var = alloca [5 x {}], align 8, !dbg !13 -// CHECK:STDOUT: %.loc14_40.2.array.index = getelementptr inbounds [5 x {}], ptr %c.var, i32 0, {} zeroinitializer, !dbg !14 -// CHECK:STDOUT: %.loc14_40.4.array.index = getelementptr inbounds [5 x {}], ptr %c.var, i32 0, {} zeroinitializer, !dbg !14 -// CHECK:STDOUT: %.loc14_40.6.array.index = getelementptr inbounds [5 x {}], ptr %c.var, i32 0, {} zeroinitializer, !dbg !14 -// CHECK:STDOUT: %.loc14_40.8.array.index = getelementptr inbounds [5 x {}], ptr %c.var, i32 0, {} zeroinitializer, !dbg !14 -// CHECK:STDOUT: %.loc14_40.10.array.index = getelementptr inbounds [5 x {}], ptr %c.var, i32 0, {} zeroinitializer, !dbg !14 +// CHECK:STDOUT: %.loc14_40.2.array.index = getelementptr inbounds [5 x {}], ptr %c.var, i32 0, i64 0, !dbg !14 +// CHECK:STDOUT: %.loc14_40.4.array.index = getelementptr inbounds [5 x {}], ptr %c.var, i32 0, i64 1, !dbg !14 +// CHECK:STDOUT: %.loc14_40.6.array.index = getelementptr inbounds [5 x {}], ptr %c.var, i32 0, i64 2, !dbg !14 +// CHECK:STDOUT: %.loc14_40.8.array.index = getelementptr inbounds [5 x {}], ptr %c.var, i32 0, i64 3, !dbg !14 +// CHECK:STDOUT: %.loc14_40.10.array.index = getelementptr inbounds [5 x {}], ptr %c.var, i32 0, i64 4, !dbg !14 // CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %c.var, ptr align 1 @array.3.loc14_41, i64 0, i1 false), !dbg !15 // CHECK:STDOUT: %d.var = alloca { i32, i32, i32 }, align 8, !dbg !16 // CHECK:STDOUT: %tuple.elem0.loc15.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %d.var, i32 0, i32 0, !dbg !17 @@ -48,15 +48,15 @@ fn Run() { // CHECK:STDOUT: %e.var = alloca [3 x i32], align 4, !dbg !19 // CHECK:STDOUT: %tuple.elem0.loc16.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %d.var, i32 0, i32 0, !dbg !20 // CHECK:STDOUT: %.loc16_21.1 = load i32, ptr %tuple.elem0.loc16.tuple.elem, align 4, !dbg !20 -// CHECK:STDOUT: %.loc16_21.2.array.index = getelementptr inbounds [3 x i32], ptr %e.var, i32 0, {} zeroinitializer, !dbg !20 +// CHECK:STDOUT: %.loc16_21.2.array.index = getelementptr inbounds [3 x i32], ptr %e.var, i32 0, i64 0, !dbg !20 // CHECK:STDOUT: store i32 %.loc16_21.1, ptr %.loc16_21.2.array.index, align 4, !dbg !20 // CHECK:STDOUT: %tuple.elem1.loc16.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %d.var, i32 0, i32 1, !dbg !20 // CHECK:STDOUT: %.loc16_21.4 = load i32, ptr %tuple.elem1.loc16.tuple.elem, align 4, !dbg !20 -// CHECK:STDOUT: %.loc16_21.5.array.index = getelementptr inbounds [3 x i32], ptr %e.var, i32 0, {} zeroinitializer, !dbg !20 +// CHECK:STDOUT: %.loc16_21.5.array.index = getelementptr inbounds [3 x i32], ptr %e.var, i32 0, i64 1, !dbg !20 // CHECK:STDOUT: store i32 %.loc16_21.4, ptr %.loc16_21.5.array.index, align 4, !dbg !20 // CHECK:STDOUT: %tuple.elem2.loc16.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %d.var, i32 0, i32 2, !dbg !20 // CHECK:STDOUT: %.loc16_21.7 = load i32, ptr %tuple.elem2.loc16.tuple.elem, align 4, !dbg !20 -// CHECK:STDOUT: %.loc16_21.8.array.index = getelementptr inbounds [3 x i32], ptr %e.var, i32 0, {} zeroinitializer, !dbg !20 +// CHECK:STDOUT: %.loc16_21.8.array.index = getelementptr inbounds [3 x i32], ptr %e.var, i32 0, i64 2, !dbg !20 // CHECK:STDOUT: store i32 %.loc16_21.7, ptr %.loc16_21.8.array.index, align 4, !dbg !20 // CHECK:STDOUT: ret void, !dbg !21 // CHECK:STDOUT: } diff --git a/toolchain/lower/testdata/array/field.carbon b/toolchain/lower/testdata/array/field.carbon new file mode 100644 index 0000000000000..38d0b61979a5c --- /dev/null +++ b/toolchain/lower/testdata/array/field.carbon @@ -0,0 +1,85 @@ +// Part of the Carbon Language project, under the Apache License v2.0 with LLVM +// Exceptions. See /LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// AUTOUPDATE +// TIP: To test this file alone, run: +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/lower/testdata/array/field.carbon +// TIP: To dump output, run: +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/lower/testdata/array/field.carbon + +class A { + var v: [i32; 2]; + + // TODO: The LLVM IR we create for this crashes LLVM instruction selection. + // The gep indexes are completely bogus. + fn Init() -> A { return {.v = (1, 2)}; } + + fn Access[self: Self]() -> i32 { + return self.v[0]; + } + + fn Use[addr self: Self*]() -> i32 { + self->v[0] = 1; + return self->v[1]; + } +} + +// CHECK:STDOUT: ; ModuleID = 'field.carbon' +// CHECK:STDOUT: source_filename = "field.carbon" +// CHECK:STDOUT: +// CHECK:STDOUT: @A.val.loc16_40 = internal constant { [2 x i32] } { [2 x i32] [i32 1, i32 2] } +// CHECK:STDOUT: +// CHECK:STDOUT: define void @_CInit.A.Main(ptr sret({ [2 x i32] }) %return) !dbg !4 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %.loc16_39.2.v = getelementptr inbounds nuw { [2 x i32] }, ptr %return, i32 0, i32 0, !dbg !7 +// CHECK:STDOUT: %.loc16_38.3.array.index = getelementptr inbounds [2 x i32], ptr %.loc16_39.2.v, i32 0, i64 0, !dbg !8 +// CHECK:STDOUT: %.loc16_38.6.array.index = getelementptr inbounds [2 x i32], ptr %.loc16_39.2.v, i32 0, i64 1, !dbg !8 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %return, ptr align 4 @A.val.loc16_40, i64 8, i1 false), !dbg !9 +// CHECK:STDOUT: ret void, !dbg !9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: define i32 @_CAccess.A.Main(ptr %self) !dbg !10 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %.loc19_16.1.v = getelementptr inbounds nuw { [2 x i32] }, ptr %self, i32 0, i32 0, !dbg !11 +// CHECK:STDOUT: %.loc19_20.4.array.index = getelementptr inbounds [2 x i32], ptr %.loc19_16.1.v, i32 0, i32 0, !dbg !11 +// CHECK:STDOUT: %.loc19_20.5 = load i32, ptr %.loc19_20.4.array.index, align 4, !dbg !11 +// CHECK:STDOUT: ret i32 %.loc19_20.5, !dbg !12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: define i32 @_CUse.A.Main(ptr %self) !dbg !13 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %.loc23_9.2.v = getelementptr inbounds nuw { [2 x i32] }, ptr %self, i32 0, i32 0, !dbg !14 +// CHECK:STDOUT: %.loc23_14.3.array.index = getelementptr inbounds [2 x i32], ptr %.loc23_9.2.v, i32 0, i32 0, !dbg !14 +// CHECK:STDOUT: store i32 1, ptr %.loc23_14.3.array.index, align 4, !dbg !14 +// CHECK:STDOUT: %.loc24_16.2.v = getelementptr inbounds nuw { [2 x i32] }, ptr %self, i32 0, i32 0, !dbg !15 +// CHECK:STDOUT: %.loc24_21.3.array.index = getelementptr inbounds [2 x i32], ptr %.loc24_16.2.v, i32 0, i32 1, !dbg !15 +// CHECK:STDOUT: %.loc24_21.4 = load i32, ptr %.loc24_21.3.array.index, align 4, !dbg !15 +// CHECK:STDOUT: ret i32 %.loc24_21.4, !dbg !16 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) +// CHECK:STDOUT: declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 +// CHECK:STDOUT: +// CHECK:STDOUT: attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} +// CHECK:STDOUT: !llvm.dbg.cu = !{!2} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !3 = !DIFile(filename: "field.carbon", directory: "") +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "Init", linkageName: "_CInit.A.Main", scope: null, file: !3, line: 16, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) +// CHECK:STDOUT: !6 = !{} +// CHECK:STDOUT: !7 = !DILocation(line: 16, column: 27, scope: !4) +// CHECK:STDOUT: !8 = !DILocation(line: 16, column: 33, scope: !4) +// CHECK:STDOUT: !9 = !DILocation(line: 16, column: 20, scope: !4) +// CHECK:STDOUT: !10 = distinct !DISubprogram(name: "Access", linkageName: "_CAccess.A.Main", scope: null, file: !3, line: 18, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !11 = !DILocation(line: 19, column: 12, scope: !10) +// CHECK:STDOUT: !12 = !DILocation(line: 19, column: 5, scope: !10) +// CHECK:STDOUT: !13 = distinct !DISubprogram(name: "Use", linkageName: "_CUse.A.Main", scope: null, file: !3, line: 22, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !14 = !DILocation(line: 23, column: 5, scope: !13) +// CHECK:STDOUT: !15 = !DILocation(line: 24, column: 12, scope: !13) +// CHECK:STDOUT: !16 = !DILocation(line: 24, column: 5, scope: !13) diff --git a/toolchain/lower/testdata/array/function_param.carbon b/toolchain/lower/testdata/array/function_param.carbon index b4e2777b5c2d1..4b48d31463c96 100644 --- a/toolchain/lower/testdata/array/function_param.carbon +++ b/toolchain/lower/testdata/array/function_param.carbon @@ -31,9 +31,9 @@ fn G() -> i32 { // CHECK:STDOUT: define i32 @_CG.Main() !dbg !9 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.loc16_20.3.temp = alloca [3 x i32], align 4, !dbg !10 -// CHECK:STDOUT: %.loc16_20.4.array.index = getelementptr inbounds [3 x i32], ptr %.loc16_20.3.temp, i32 0, {} zeroinitializer, !dbg !10 -// CHECK:STDOUT: %.loc16_20.7.array.index = getelementptr inbounds [3 x i32], ptr %.loc16_20.3.temp, i32 0, {} zeroinitializer, !dbg !10 -// CHECK:STDOUT: %.loc16_20.10.array.index = getelementptr inbounds [3 x i32], ptr %.loc16_20.3.temp, i32 0, {} zeroinitializer, !dbg !10 +// CHECK:STDOUT: %.loc16_20.4.array.index = getelementptr inbounds [3 x i32], ptr %.loc16_20.3.temp, i32 0, i64 0, !dbg !10 +// CHECK:STDOUT: %.loc16_20.7.array.index = getelementptr inbounds [3 x i32], ptr %.loc16_20.3.temp, i32 0, i64 1, !dbg !10 +// CHECK:STDOUT: %.loc16_20.10.array.index = getelementptr inbounds [3 x i32], ptr %.loc16_20.3.temp, i32 0, i64 2, !dbg !10 // CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %.loc16_20.3.temp, ptr align 4 @array.loc16_20.13, i64 12, i1 false), !dbg !10 // CHECK:STDOUT: %F.call = call i32 @_CF.Main(ptr %.loc16_20.3.temp, i32 1), !dbg !11 // CHECK:STDOUT: ret i32 %F.call, !dbg !12 diff --git a/toolchain/lower/testdata/basics/numeric_literals.carbon b/toolchain/lower/testdata/basics/numeric_literals.carbon index 9166948197c72..e630627b39743 100644 --- a/toolchain/lower/testdata/basics/numeric_literals.carbon +++ b/toolchain/lower/testdata/basics/numeric_literals.carbon @@ -36,18 +36,18 @@ fn F() { // CHECK:STDOUT: define void @_CF.Main() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %ints.var = alloca [4 x i32], align 4, !dbg !7 -// CHECK:STDOUT: %.loc19_3.3.array.index = getelementptr inbounds [4 x i32], ptr %ints.var, i32 0, {} zeroinitializer, !dbg !8 -// CHECK:STDOUT: %.loc19_3.6.array.index = getelementptr inbounds [4 x i32], ptr %ints.var, i32 0, {} zeroinitializer, !dbg !8 -// CHECK:STDOUT: %.loc19_3.9.array.index = getelementptr inbounds [4 x i32], ptr %ints.var, i32 0, {} zeroinitializer, !dbg !8 -// CHECK:STDOUT: %.loc19_3.12.array.index = getelementptr inbounds [4 x i32], ptr %ints.var, i32 0, {} zeroinitializer, !dbg !8 +// CHECK:STDOUT: %.loc19_3.3.array.index = getelementptr inbounds [4 x i32], ptr %ints.var, i32 0, i64 0, !dbg !8 +// CHECK:STDOUT: %.loc19_3.6.array.index = getelementptr inbounds [4 x i32], ptr %ints.var, i32 0, i64 1, !dbg !8 +// CHECK:STDOUT: %.loc19_3.9.array.index = getelementptr inbounds [4 x i32], ptr %ints.var, i32 0, i64 2, !dbg !8 +// CHECK:STDOUT: %.loc19_3.12.array.index = getelementptr inbounds [4 x i32], ptr %ints.var, i32 0, i64 3, !dbg !8 // CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %ints.var, ptr align 4 @array.1.loc19_4, i64 16, i1 false), !dbg !9 // CHECK:STDOUT: %floats.var = alloca [6 x double], align 8, !dbg !10 -// CHECK:STDOUT: %.loc27_3.2.array.index = getelementptr inbounds [6 x double], ptr %floats.var, i32 0, {} zeroinitializer, !dbg !11 -// CHECK:STDOUT: %.loc27_3.4.array.index = getelementptr inbounds [6 x double], ptr %floats.var, i32 0, {} zeroinitializer, !dbg !11 -// CHECK:STDOUT: %.loc27_3.6.array.index = getelementptr inbounds [6 x double], ptr %floats.var, i32 0, {} zeroinitializer, !dbg !11 -// CHECK:STDOUT: %.loc27_3.8.array.index = getelementptr inbounds [6 x double], ptr %floats.var, i32 0, {} zeroinitializer, !dbg !11 -// CHECK:STDOUT: %.loc27_3.10.array.index = getelementptr inbounds [6 x double], ptr %floats.var, i32 0, {} zeroinitializer, !dbg !11 -// CHECK:STDOUT: %.loc27_3.12.array.index = getelementptr inbounds [6 x double], ptr %floats.var, i32 0, {} zeroinitializer, !dbg !11 +// CHECK:STDOUT: %.loc27_3.2.array.index = getelementptr inbounds [6 x double], ptr %floats.var, i32 0, i64 0, !dbg !11 +// CHECK:STDOUT: %.loc27_3.4.array.index = getelementptr inbounds [6 x double], ptr %floats.var, i32 0, i64 1, !dbg !11 +// CHECK:STDOUT: %.loc27_3.6.array.index = getelementptr inbounds [6 x double], ptr %floats.var, i32 0, i64 2, !dbg !11 +// CHECK:STDOUT: %.loc27_3.8.array.index = getelementptr inbounds [6 x double], ptr %floats.var, i32 0, i64 3, !dbg !11 +// CHECK:STDOUT: %.loc27_3.10.array.index = getelementptr inbounds [6 x double], ptr %floats.var, i32 0, i64 4, !dbg !11 +// CHECK:STDOUT: %.loc27_3.12.array.index = getelementptr inbounds [6 x double], ptr %floats.var, i32 0, i64 5, !dbg !11 // CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 8 %floats.var, ptr align 8 @array.2.loc27_4, i64 48, i1 false), !dbg !12 // CHECK:STDOUT: ret void, !dbg !13 // CHECK:STDOUT: } diff --git a/toolchain/lower/testdata/index/array_element_access.carbon b/toolchain/lower/testdata/index/array_element_access.carbon index 12b01c85495d6..3ea9f3996256c 100644 --- a/toolchain/lower/testdata/index/array_element_access.carbon +++ b/toolchain/lower/testdata/index/array_element_access.carbon @@ -34,8 +34,8 @@ fn Run() { // CHECK:STDOUT: // CHECK:STDOUT: define void @_CB.Main(ptr sret([2 x i32]) %return) !dbg !9 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc12_34.3.array.index = getelementptr inbounds [2 x i32], ptr %return, i32 0, {} zeroinitializer, !dbg !10 -// CHECK:STDOUT: %.loc12_34.6.array.index = getelementptr inbounds [2 x i32], ptr %return, i32 0, {} zeroinitializer, !dbg !10 +// CHECK:STDOUT: %.loc12_34.3.array.index = getelementptr inbounds [2 x i32], ptr %return, i32 0, i64 0, !dbg !10 +// CHECK:STDOUT: %.loc12_34.6.array.index = getelementptr inbounds [2 x i32], ptr %return, i32 0, i64 1, !dbg !10 // CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %return, ptr align 4 @array.loc12_35, i64 8, i1 false), !dbg !11 // CHECK:STDOUT: ret void, !dbg !11 // CHECK:STDOUT: } @@ -47,11 +47,11 @@ fn Run() { // CHECK:STDOUT: call void @_CA.Main(ptr %.loc15_23.1.temp), !dbg !14 // CHECK:STDOUT: %tuple.elem0.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %.loc15_23.1.temp, i32 0, i32 0, !dbg !14 // CHECK:STDOUT: %.loc15_23.3 = load i32, ptr %tuple.elem0.tuple.elem, align 4, !dbg !14 -// CHECK:STDOUT: %.loc15_23.4.array.index = getelementptr inbounds [2 x i32], ptr %a.var, i32 0, {} zeroinitializer, !dbg !14 +// CHECK:STDOUT: %.loc15_23.4.array.index = getelementptr inbounds [2 x i32], ptr %a.var, i32 0, i64 0, !dbg !14 // CHECK:STDOUT: store i32 %.loc15_23.3, ptr %.loc15_23.4.array.index, align 4, !dbg !14 // CHECK:STDOUT: %tuple.elem1.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %.loc15_23.1.temp, i32 0, i32 1, !dbg !14 // CHECK:STDOUT: %.loc15_23.6 = load i32, ptr %tuple.elem1.tuple.elem, align 4, !dbg !14 -// CHECK:STDOUT: %.loc15_23.7.array.index = getelementptr inbounds [2 x i32], ptr %a.var, i32 0, {} zeroinitializer, !dbg !14 +// CHECK:STDOUT: %.loc15_23.7.array.index = getelementptr inbounds [2 x i32], ptr %a.var, i32 0, i64 1, !dbg !14 // CHECK:STDOUT: store i32 %.loc15_23.6, ptr %.loc15_23.7.array.index, align 4, !dbg !14 // CHECK:STDOUT: %b.var = alloca i32, align 4, !dbg !15 // CHECK:STDOUT: store i32 1, ptr %b.var, align 4, !dbg !16 From f922988c8ccaaf68e703e3126a4a26709efb460f Mon Sep 17 00:00:00 2001 From: Jon Ross-Perkins Date: Mon, 16 Dec 2024 08:05:17 -0800 Subject: [PATCH 32/68] Update the vscode language server setup (#4663) Switches from js to ts, and starts bundling files in order to produce a better package for deployment. Fixes the README.md to be a more appropriate front page, moving dev content to development.md. Makes the path to `carbon` configurable so that it's more stable than just running in `bazel-bin`. This is built using suggestions from samples at https://github.com/microsoft/vscode-extension-samples/tree/main/lsp-sample and https://github.com/microsoft/vscode-extension-samples/tree/main/esbuild-sample. Note the esbuild in particular comes from complaints from `vsce` to use an option from https://code.visualstudio.com/api/working-with-extensions/bundling-extension, and esbuild is just the first option detailed there (I have no real opinion on options). I'm bumping the version, and will do a release after merging. --------- Co-authored-by: Richard Smith --- .pre-commit-config.yaml | 9 +- utils/vscode/.gitignore | 3 +- utils/vscode/.vscode/launch.json | 8 +- utils/vscode/.vscode/tasks.json | 55 + utils/vscode/.vscodeignore | 12 + utils/vscode/README.md | 50 +- utils/vscode/development.md | 51 + utils/vscode/esbuild.js | 88 ++ utils/vscode/eslint.config.mjs | 49 + utils/vscode/package-lock.json | 2473 +++++++++++++++++++++++++++--- utils/vscode/package.json | 37 +- utils/vscode/src/extension.js | 37 - utils/vscode/src/extension.ts | 53 + utils/vscode/tsconfig.json | 13 + 14 files changed, 2612 insertions(+), 326 deletions(-) create mode 100644 utils/vscode/.vscode/tasks.json create mode 100644 utils/vscode/.vscodeignore create mode 100644 utils/vscode/development.md create mode 100644 utils/vscode/esbuild.js create mode 100644 utils/vscode/eslint.config.mjs delete mode 100644 utils/vscode/src/extension.js create mode 100644 utils/vscode/src/extension.ts create mode 100644 utils/vscode/tsconfig.json diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7fb99b7b3b15a..9f87ffe72aff4 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -54,7 +54,7 @@ repos: name: prettier language: node additional_dependencies: ['prettier@3.3.3'] - types_or: [html, javascript, markdown, yaml] + types_or: [html, javascript, json, markdown, yaml] entry: npx prettier --write --log-level=warn - repo: local hooks: @@ -189,6 +189,11 @@ repos: - '// ' - '' - --custom_format + - '\.(js|ts|mjs)$' + - '/*' + - ' * ' + - ' */' + - --custom_format - '\.(l|lpp|y)$' - '/*' - '' @@ -221,9 +226,11 @@ repos: compile_flags.txt| github_tools/requirements.txt| third_party/.*| + utils/vscode/esbuild.js| website/.ruby-version| website/Gemfile.lock| .*\.def| + .*\.png| .*\.svg| .*/fuzzer_corpus/.*| .*/testdata/.*\.golden diff --git a/utils/vscode/.gitignore b/utils/vscode/.gitignore index bd29f4342d1a2..c3781ccca7fbf 100644 --- a/utils/vscode/.gitignore +++ b/utils/vscode/.gitignore @@ -2,5 +2,6 @@ # Exceptions. See /LICENSE for license information. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +*.vsix +/dist /node_modules -/out diff --git a/utils/vscode/.vscode/launch.json b/utils/vscode/.vscode/launch.json index 00ac3e940f40d..3da2a4e9c1027 100644 --- a/utils/vscode/.vscode/launch.json +++ b/utils/vscode/.vscode/launch.json @@ -1,7 +1,3 @@ -// Part of the Carbon Language project, under the Apache License v2.0 with LLVM -// Exceptions. See /LICENSE for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception - { "version": "0.2.0", "configurations": [ @@ -9,7 +5,9 @@ "name": "Run Extension", "type": "extensionHost", "request": "launch", - "args": ["--extensionDevelopmentPath=${workspaceFolder}"] + "args": ["--extensionDevelopmentPath=${workspaceFolder}"], + "outFiles": ["${workspaceFolder}/dist/**/*.js"], + "preLaunchTask": "${defaultBuildTask}" } ] } diff --git a/utils/vscode/.vscode/tasks.json b/utils/vscode/.vscode/tasks.json new file mode 100644 index 0000000000000..fb832824dd93a --- /dev/null +++ b/utils/vscode/.vscode/tasks.json @@ -0,0 +1,55 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "label": "watch", + "dependsOn": ["npm: watch:tsc", "npm: watch:esbuild"], + "presentation": { + "reveal": "never" + }, + "group": { + "kind": "build", + "isDefault": true + } + }, + { + "type": "npm", + "script": "watch:esbuild", + "group": "build", + "isBackground": true, + "label": "npm: watch:esbuild", + "presentation": { + "group": "watch", + "reveal": "never" + } + }, + { + "type": "npm", + "script": "watch:tsc", + "group": "build", + "problemMatcher": "$tsc-watch", + "isBackground": true, + "label": "npm: watch:tsc", + "presentation": { + "group": "watch", + "reveal": "never" + } + }, + { + "type": "npm", + "script": "watch-tests", + "problemMatcher": "$tsc-watch", + "isBackground": true, + "presentation": { + "reveal": "never", + "group": "watchers" + }, + "group": "build" + }, + { + "label": "tasks: watch-tests", + "dependsOn": ["npm: watch", "npm: watch-tests"], + "problemMatcher": [] + } + ] +} diff --git a/utils/vscode/.vscodeignore b/utils/vscode/.vscodeignore new file mode 100644 index 0000000000000..f1a47ce3ef4ab --- /dev/null +++ b/utils/vscode/.vscodeignore @@ -0,0 +1,12 @@ +# Part of the Carbon Language project, under the Apache License v2.0 with LLVM +# Exceptions. See /LICENSE for license information. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +.gitignore +.vscode/ +node_modules/ +src/ +development.md +esbuild.js +eslint.config.mjs +tsconfig.json diff --git a/utils/vscode/README.md b/utils/vscode/README.md index 95b7894c33221..cbf6dec1df665 100644 --- a/utils/vscode/README.md +++ b/utils/vscode/README.md @@ -1,39 +1,45 @@ +# Carbon Language + -# VS Code Extension for Carbon +This extension provides support for the +[Carbon Language](https://github.com/carbon-language/carbon-lang). -Currently only contains basic syntax highlighting. +This extension is currently experimental, and being developed alongside Carbon. -## Installing +## Quickstart -1. Install Node JS. -2. To generate VS Code extension file (.vsix). +1. Download and install a `carbon` + [release](https://github.com/carbon-language/carbon-lang/releases). + - By default, the extension will look for `carbon` under `./bazel-bin`. This + is for developers actively working on Carbon and running VS Code inside a + [carbon-lang](https://github.com/carbon-language/carbon-lang) clone. +2. Install the + [Carbon Language extension](https://marketplace.visualstudio.com/items?itemName=carbon-lang.carbon-vscode). +3. Configure the installed path to `carbon`. -```shell -npm install && npm run package -``` +## Configuration -3. Install the extension +The configuration is under `carbon-vscode.*`. At present, the only configuration +is the path to the `carbon` binary. This looks like: -```shell -code --install-extension out/carbon.vsix +``` +"carbon.carbonPath": "/path/to/carbon" ``` -## Development +## Communication -1. `bazel build //toolchain` in project root. -2. Open utils/vscode folder in VS Code. -3. Launch the extension using Run command (F5). -4. In the opened window, open the carbon-lang repository as folder. -5. Open a carbon file. -6. Open code outline (Ctrl+Shift+O). +See Carbon's +[collaboration systems](https://github.com/carbon-language/carbon-lang/blob/trunk/CONTRIBUTING.md#collaboration-systems). +We're most active on [Discord](https://discord.gg/ZjVdShJDAs) and have a +#editor-integrations channel. We'll also respond to questions on +[GitHub Discussions](https://github.com/carbon-language/carbon-lang/discussions). -To update dependencies: +## Documentation -```shell -npm update -``` +Carbon currently only has project-level documentation. See the +[GitHub repository](https://github.com/carbon-language/carbon-lang). diff --git a/utils/vscode/development.md b/utils/vscode/development.md new file mode 100644 index 0000000000000..7c85e18204334 --- /dev/null +++ b/utils/vscode/development.md @@ -0,0 +1,51 @@ +# Extension development + + + +Currently only contains basic syntax highlighting. + +## Releases + +This assumes NodeJS is installed, along with `vsce` (using +`npm install -g vsce`). + +1. `npm install && vsce publish` + +## Local installation + +This assumes NodeJS is installed, along with `vsce` (using +`npm install -g vsce`). + +1. `npm install && vsce package -o carbon.vsix && realpath carbon.vsix` + - This installs dependencies, builds the VSIX file, and prints the path + for installation. +2. Install the plugin: + - If you're using VS Code locally, run + `npm install && vsce package -o carbon.vsix && code --install-extension carbon.vsix` + - If you're using VS Code's remote mode: + 1. In vscode, open the + [command palette](https://code.visualstudio.com/docs/getstarted/userinterface#_command-palette) + and select "Extensions: Install from VSIX...". + 2. Enter the path printed by the above command. + +## Development + +1. `bazel build //toolchain` in project root. +2. Open utils/vscode folder in VS Code. +3. Launch the extension using Run command (F5). +4. In the opened window, open the carbon-lang repository as folder. +5. Open a carbon file. +6. Open code outline (Ctrl+Shift+O). + +## Debugging output + +1. Go to the "Output" panel. +2. In the top right, there is a dropdown; select "Carbon Language Server". + +## Updating dependencies + +To update dependencies, run `npm update`. diff --git a/utils/vscode/esbuild.js b/utils/vscode/esbuild.js new file mode 100644 index 0000000000000..278087acef98e --- /dev/null +++ b/utils/vscode/esbuild.js @@ -0,0 +1,88 @@ +/* + * MIT License + * + * Copyright (c) 2015 - present Microsoft Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +/* + * This supports using esbuild to bundle the extension for releases. This is + * invoked through package.json. + * + * For information about this, see: + * https://code.visualstudio.com/api/working-with-extensions/bundling-extension + */ + +const esbuild = require('esbuild'); + +const production = process.argv.includes('--production'); +const watch = process.argv.includes('--watch'); + +/** + * @type {import('esbuild').Plugin} + */ +const esbuildProblemMatcherPlugin = { + name: 'esbuild-problem-matcher', + + setup(build) { + build.onStart(() => { + console.log('[watch] build started'); + }); + build.onEnd((result) => { + result.errors.forEach(({ text, location }) => { + console.error(`✘ [ERROR] ${text}`); + console.error( + ` ${location.file}:${location.line}:${location.column}:` + ); + }); + console.log('[watch] build finished'); + }); + }, +}; + +async function main() { + const ctx = await esbuild.context({ + entryPoints: ['src/extension.ts'], + bundle: true, + format: 'cjs', + minify: production, + sourcemap: !production, + sourcesContent: false, + platform: 'node', + outfile: 'dist/extension.js', + external: ['vscode'], + logLevel: 'silent', + plugins: [ + /* add to the end of plugins array */ + esbuildProblemMatcherPlugin, + ], + }); + if (watch) { + await ctx.watch(); + } else { + await ctx.rebuild(); + await ctx.dispose(); + } +} + +main().catch((e) => { + console.error(e); + process.exit(1); +}); diff --git a/utils/vscode/eslint.config.mjs b/utils/vscode/eslint.config.mjs new file mode 100644 index 0000000000000..9049e086413b9 --- /dev/null +++ b/utils/vscode/eslint.config.mjs @@ -0,0 +1,49 @@ +/* + * Part of the Carbon Language project, under the Apache License v2.0 with LLVM + * Exceptions. See /LICENSE for license information. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + */ + +/* + * ESLint configuration. + * + * See https://eslint.style and https://typescript-eslint.io for additional + * linting options. + */ + +// @ts-check +import js from '@eslint/js'; +import tseslint from 'typescript-eslint'; +import stylistic from '@stylistic/eslint-plugin'; + +export default tseslint.config( + { + ignores: ['dist', 'out', 'esbuild.js'], + }, + js.configs.recommended, + ...tseslint.configs.recommended, + ...tseslint.configs.stylistic, + { + plugins: { + '@stylistic': stylistic, + }, + rules: { + curly: 'warn', + '@stylistic/semi': ['warn', 'always'], + '@typescript-eslint/no-empty-function': 'off', + '@typescript-eslint/naming-convention': [ + 'warn', + { + selector: 'import', + format: ['camelCase', 'PascalCase'], + }, + ], + '@typescript-eslint/no-unused-vars': [ + 'error', + { + argsIgnorePattern: '^_', + }, + ], + }, + } +); diff --git a/utils/vscode/package-lock.json b/utils/vscode/package-lock.json index eb6a7eac34038..bd71f33eaeb70 100644 --- a/utils/vscode/package-lock.json +++ b/utils/vscode/package-lock.json @@ -1,55 +1,50 @@ { - "name": "carbon-lang", - "version": "0.0.2", + "name": "carbon-vscode", + "version": "0.0.3", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "carbon-lang", - "version": "0.0.2", + "name": "carbon-vscode", + "version": "0.0.3", "dependencies": { - "@vscode/vsce": "^2.27.0", "vscode-languageclient": "^9.0.1" }, "devDependencies": { - "@vscode/vsce": "^2.27.0" + "@eslint/js": "^9.13.0", + "@stylistic/eslint-plugin": "^2.9.0", + "@types/node": "^20", + "@types/vscode": "^1.73.0", + "@vscode/vsce": "^2.27.0", + "esbuild": "^0.24.0", + "eslint": "^9.13.0", + "typescript": "^5.7.2", + "typescript-eslint": "^8.16.0" }, "engines": { "vscode": "^1.90.0" } }, "node_modules/@azure/abort-controller": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@azure/abort-controller/-/abort-controller-1.1.0.tgz", - "integrity": "sha512-TrRLIoSQVzfAJX9H1JeFjzAoDGcoK1IYX1UImfceTZpsyYfWr09Ss1aHW1y5TrrR3iq6RZLBwJ3E24uwPhwahw==", - "dev": true, - "dependencies": { - "tslib": "^2.2.0" - }, - "engines": { - "node": ">=12.0.0" - } - }, - "node_modules/@azure/core-auth": { - "version": "1.7.2", - "resolved": "https://registry.npmjs.org/@azure/core-auth/-/core-auth-1.7.2.tgz", - "integrity": "sha512-Igm/S3fDYmnMq1uKS38Ae1/m37B3zigdlZw+kocwEhh5GjyKjPrXKO2J6rzpC1wAxrNil/jX9BJRqBshyjnF3g==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@azure/abort-controller/-/abort-controller-2.1.2.tgz", + "integrity": "sha512-nBrLsEWm4J2u5LpAPjxADTlq3trDgVZZXHNKabeXZtpq3d3AbN/KGO82R87rdDz5/lYB024rtEf10/q0urNgsA==", "dev": true, "dependencies": { - "@azure/abort-controller": "^2.0.0", - "@azure/core-util": "^1.1.0", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@azure/core-auth/node_modules/@azure/abort-controller": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/@azure/abort-controller/-/abort-controller-2.1.2.tgz", - "integrity": "sha512-nBrLsEWm4J2u5LpAPjxADTlq3trDgVZZXHNKabeXZtpq3d3AbN/KGO82R87rdDz5/lYB024rtEf10/q0urNgsA==", + "node_modules/@azure/core-auth": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@azure/core-auth/-/core-auth-1.9.0.tgz", + "integrity": "sha512-FPwHpZywuyasDSLMqJ6fhbOK3TqUdviZNF8OqRGA4W5Ewib2lEEZ+pBsYcBa88B2NGO/SEnYPGhyBqNlE8ilSw==", "dev": true, "dependencies": { + "@azure/abort-controller": "^2.0.0", + "@azure/core-util": "^1.11.0", "tslib": "^2.6.2" }, "engines": { @@ -74,28 +69,16 @@ "node": ">=18.0.0" } }, - "node_modules/@azure/core-client/node_modules/@azure/abort-controller": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/@azure/abort-controller/-/abort-controller-2.1.2.tgz", - "integrity": "sha512-nBrLsEWm4J2u5LpAPjxADTlq3trDgVZZXHNKabeXZtpq3d3AbN/KGO82R87rdDz5/lYB024rtEf10/q0urNgsA==", - "dev": true, - "dependencies": { - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, "node_modules/@azure/core-rest-pipeline": { - "version": "1.16.0", - "resolved": "https://registry.npmjs.org/@azure/core-rest-pipeline/-/core-rest-pipeline-1.16.0.tgz", - "integrity": "sha512-CeuTvsXxCUmEuxH5g/aceuSl6w2EugvNHKAtKKVdiX915EjJJxAwfzNNWZreNnbxHZ2fi0zaM6wwS23x2JVqSQ==", + "version": "1.18.1", + "resolved": "https://registry.npmjs.org/@azure/core-rest-pipeline/-/core-rest-pipeline-1.18.1.tgz", + "integrity": "sha512-/wS73UEDrxroUEVywEm7J0p2c+IIiVxyfigCGfsKvCxxCET4V/Hef2aURqltrXMRjNmdmt5IuOgIpl8f6xdO5A==", "dev": true, "dependencies": { "@azure/abort-controller": "^2.0.0", - "@azure/core-auth": "^1.4.0", + "@azure/core-auth": "^1.8.0", "@azure/core-tracing": "^1.0.1", - "@azure/core-util": "^1.9.0", + "@azure/core-util": "^1.11.0", "@azure/logger": "^1.0.0", "http-proxy-agent": "^7.0.0", "https-proxy-agent": "^7.0.0", @@ -105,22 +88,10 @@ "node": ">=18.0.0" } }, - "node_modules/@azure/core-rest-pipeline/node_modules/@azure/abort-controller": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/@azure/abort-controller/-/abort-controller-2.1.2.tgz", - "integrity": "sha512-nBrLsEWm4J2u5LpAPjxADTlq3trDgVZZXHNKabeXZtpq3d3AbN/KGO82R87rdDz5/lYB024rtEf10/q0urNgsA==", - "dev": true, - "dependencies": { - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, "node_modules/@azure/core-tracing": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@azure/core-tracing/-/core-tracing-1.1.2.tgz", - "integrity": "sha512-dawW9ifvWAWmUm9/h+/UQ2jrdvjCJ7VJEuCJ6XVNudzcOwm53BFZH4Q845vjfgoUAM8ZxokvVNxNxAITc502YA==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@azure/core-tracing/-/core-tracing-1.2.0.tgz", + "integrity": "sha512-UKTiEJPkWcESPYJz3X5uKRYyOcJD+4nYph+KpfdPRnQJVrZfk0KJgdnaAWKfhsBBtAf/D58Az4AvCJEmWgIBAg==", "dev": true, "dependencies": { "tslib": "^2.6.2" @@ -130,9 +101,9 @@ } }, "node_modules/@azure/core-util": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@azure/core-util/-/core-util-1.9.0.tgz", - "integrity": "sha512-AfalUQ1ZppaKuxPPMsFEUdX6GZPB3d9paR9d/TTL7Ow2De8cJaC7ibi7kWVlFAVPCYo31OcnGymc0R89DX8Oaw==", + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/@azure/core-util/-/core-util-1.11.0.tgz", + "integrity": "sha512-DxOSLua+NdpWoSqULhjDyAZTXFdP/LKkqtYuxxz1SCN289zk3OG8UOpnCQAz/tygyACBtWp/BoO72ptK7msY8g==", "dev": true, "dependencies": { "@azure/abort-controller": "^2.0.0", @@ -142,33 +113,21 @@ "node": ">=18.0.0" } }, - "node_modules/@azure/core-util/node_modules/@azure/abort-controller": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/@azure/abort-controller/-/abort-controller-2.1.2.tgz", - "integrity": "sha512-nBrLsEWm4J2u5LpAPjxADTlq3trDgVZZXHNKabeXZtpq3d3AbN/KGO82R87rdDz5/lYB024rtEf10/q0urNgsA==", - "dev": true, - "dependencies": { - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, "node_modules/@azure/identity": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/@azure/identity/-/identity-4.2.1.tgz", - "integrity": "sha512-U8hsyC9YPcEIzoaObJlRDvp7KiF0MGS7xcWbyJSVvXRkC/HXo1f0oYeBYmEvVgRfacw7GHf6D6yAoh9JHz6A5Q==", + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/@azure/identity/-/identity-4.5.0.tgz", + "integrity": "sha512-EknvVmtBuSIic47xkOqyNabAme0RYTw52BTMz8eBgU1ysTyMrD1uOoM+JdS0J/4Yfp98IBT3osqq3BfwSaNaGQ==", "dev": true, "dependencies": { - "@azure/abort-controller": "^1.0.0", - "@azure/core-auth": "^1.5.0", - "@azure/core-client": "^1.4.0", - "@azure/core-rest-pipeline": "^1.1.0", + "@azure/abort-controller": "^2.0.0", + "@azure/core-auth": "^1.9.0", + "@azure/core-client": "^1.9.2", + "@azure/core-rest-pipeline": "^1.17.0", "@azure/core-tracing": "^1.0.0", - "@azure/core-util": "^1.3.0", + "@azure/core-util": "^1.11.0", "@azure/logger": "^1.0.0", - "@azure/msal-browser": "^3.11.1", - "@azure/msal-node": "^2.9.2", + "@azure/msal-browser": "^3.26.1", + "@azure/msal-node": "^2.15.0", "events": "^3.0.0", "jws": "^4.0.0", "open": "^8.0.0", @@ -180,9 +139,9 @@ } }, "node_modules/@azure/logger": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@azure/logger/-/logger-1.1.2.tgz", - "integrity": "sha512-l170uE7bsKpIU6B/giRc9i4NI0Mj+tANMMMxf7Zi/5cKzEqPayP7+X1WPrG7e+91JgY8N+7K7nF2WOi7iVhXvg==", + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/@azure/logger/-/logger-1.1.4.tgz", + "integrity": "sha512-4IXXzcCdLdlXuCG+8UKEwLA1T1NHqUfanhXYHiQTn+6sfWCZXduqbtXDGceg3Ce5QxTGo7EqmbV6Bi+aqKuClQ==", "dev": true, "dependencies": { "tslib": "^2.6.2" @@ -192,44 +151,904 @@ } }, "node_modules/@azure/msal-browser": { - "version": "3.17.0", - "resolved": "https://registry.npmjs.org/@azure/msal-browser/-/msal-browser-3.17.0.tgz", - "integrity": "sha512-csccKXmW2z7EkZ0I3yAoW/offQt+JECdTIV/KrnRoZyM7wCSsQWODpwod8ZhYy7iOyamcHApR9uCh0oD1M+0/A==", + "version": "3.27.0", + "resolved": "https://registry.npmjs.org/@azure/msal-browser/-/msal-browser-3.27.0.tgz", + "integrity": "sha512-+b4ZKSD8+vslCtVRVetkegEhOFMLP3rxDWJY212ct+2r6jVg6OSQKc1Qz3kCoXo0FgwaXkb+76TMZfpHp8QtgA==", "dev": true, "dependencies": { - "@azure/msal-common": "14.12.0" + "@azure/msal-common": "14.16.0" }, "engines": { "node": ">=0.8.0" } }, "node_modules/@azure/msal-common": { - "version": "14.12.0", - "resolved": "https://registry.npmjs.org/@azure/msal-common/-/msal-common-14.12.0.tgz", - "integrity": "sha512-IDDXmzfdwmDkv4SSmMEyAniJf6fDu3FJ7ncOjlxkDuT85uSnLEhZi3fGZpoR7T4XZpOMx9teM9GXBgrfJgyeBw==", + "version": "14.16.0", + "resolved": "https://registry.npmjs.org/@azure/msal-common/-/msal-common-14.16.0.tgz", + "integrity": "sha512-1KOZj9IpcDSwpNiQNjt0jDYZpQvNZay7QAEi/5DLubay40iGYtLzya/jbjRPLyOTZhEKyL1MzPuw2HqBCjceYA==", "dev": true, "engines": { "node": ">=0.8.0" } }, - "node_modules/@azure/msal-node": { - "version": "2.9.2", - "resolved": "https://registry.npmjs.org/@azure/msal-node/-/msal-node-2.9.2.tgz", - "integrity": "sha512-8tvi6Cos3m+0KmRbPjgkySXi+UQU/QiuVRFnrxIwt5xZlEEFa69O04RTaNESGgImyBBlYbo2mfE8/U8Bbdk1WQ==", + "node_modules/@azure/msal-node": { + "version": "2.16.2", + "resolved": "https://registry.npmjs.org/@azure/msal-node/-/msal-node-2.16.2.tgz", + "integrity": "sha512-An7l1hEr0w1HMMh1LU+rtDtqL7/jw74ORlc9Wnh06v7TU/xpG39/Zdr1ZJu3QpjUfKJ+E0/OXMW8DRSWTlh7qQ==", + "dev": true, + "dependencies": { + "@azure/msal-common": "14.16.0", + "jsonwebtoken": "^9.0.0", + "uuid": "^8.3.0" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.24.0.tgz", + "integrity": "sha512-WtKdFM7ls47zkKHFVzMz8opM7LkcsIp9amDUBIAWirg70RM71WRSjdILPsY5Uv1D42ZpUfaPILDlfactHgsRkw==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.24.0.tgz", + "integrity": "sha512-arAtTPo76fJ/ICkXWetLCc9EwEHKaeya4vMrReVlEIUCAUncH7M4bhMQ+M9Vf+FFOZJdTNMXNBrWwW+OXWpSew==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.24.0.tgz", + "integrity": "sha512-Vsm497xFM7tTIPYK9bNTYJyF/lsP590Qc1WxJdlB6ljCbdZKU9SY8i7+Iin4kyhV/KV5J2rOKsBQbB77Ab7L/w==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.24.0.tgz", + "integrity": "sha512-t8GrvnFkiIY7pa7mMgJd7p8p8qqYIz1NYiAoKc75Zyv73L3DZW++oYMSHPRarcotTKuSs6m3hTOa5CKHaS02TQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.24.0.tgz", + "integrity": "sha512-CKyDpRbK1hXwv79soeTJNHb5EiG6ct3efd/FTPdzOWdbZZfGhpbcqIpiD0+vwmpu0wTIL97ZRPZu8vUt46nBSw==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.24.0.tgz", + "integrity": "sha512-rgtz6flkVkh58od4PwTRqxbKH9cOjaXCMZgWD905JOzjFKW+7EiUObfd/Kav+A6Gyud6WZk9w+xu6QLytdi2OA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.24.0.tgz", + "integrity": "sha512-6Mtdq5nHggwfDNLAHkPlyLBpE5L6hwsuXZX8XNmHno9JuL2+bg2BX5tRkwjyfn6sKbxZTq68suOjgWqCicvPXA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.24.0.tgz", + "integrity": "sha512-D3H+xh3/zphoX8ck4S2RxKR6gHlHDXXzOf6f/9dbFt/NRBDIE33+cVa49Kil4WUjxMGW0ZIYBYtaGCa2+OsQwQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.24.0.tgz", + "integrity": "sha512-gJKIi2IjRo5G6Glxb8d3DzYXlxdEj2NlkixPsqePSZMhLudqPhtZ4BUrpIuTjJYXxvF9njql+vRjB2oaC9XpBw==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.24.0.tgz", + "integrity": "sha512-TDijPXTOeE3eaMkRYpcy3LarIg13dS9wWHRdwYRnzlwlA370rNdZqbcp0WTyyV/k2zSxfko52+C7jU5F9Tfj1g==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.24.0.tgz", + "integrity": "sha512-K40ip1LAcA0byL05TbCQ4yJ4swvnbzHscRmUilrmP9Am7//0UjPreh4lpYzvThT2Quw66MhjG//20mrufm40mA==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.24.0.tgz", + "integrity": "sha512-0mswrYP/9ai+CU0BzBfPMZ8RVm3RGAN/lmOMgW4aFUSOQBjA31UP8Mr6DDhWSuMwj7jaWOT0p0WoZ6jeHhrD7g==", + "cpu": [ + "loong64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.24.0.tgz", + "integrity": "sha512-hIKvXm0/3w/5+RDtCJeXqMZGkI2s4oMUGj3/jM0QzhgIASWrGO5/RlzAzm5nNh/awHE0A19h/CvHQe6FaBNrRA==", + "cpu": [ + "mips64el" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.24.0.tgz", + "integrity": "sha512-HcZh5BNq0aC52UoocJxaKORfFODWXZxtBaaZNuN3PUX3MoDsChsZqopzi5UupRhPHSEHotoiptqikjN/B77mYQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.24.0.tgz", + "integrity": "sha512-bEh7dMn/h3QxeR2KTy1DUszQjUrIHPZKyO6aN1X4BCnhfYhuQqedHaa5MxSQA/06j3GpiIlFGSsy1c7Gf9padw==", + "cpu": [ + "riscv64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.24.0.tgz", + "integrity": "sha512-ZcQ6+qRkw1UcZGPyrCiHHkmBaj9SiCD8Oqd556HldP+QlpUIe2Wgn3ehQGVoPOvZvtHm8HPx+bH20c9pvbkX3g==", + "cpu": [ + "s390x" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.24.0.tgz", + "integrity": "sha512-vbutsFqQ+foy3wSSbmjBXXIJ6PL3scghJoM8zCL142cGaZKAdCZHyf+Bpu/MmX9zT9Q0zFBVKb36Ma5Fzfa8xA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.24.0.tgz", + "integrity": "sha512-hjQ0R/ulkO8fCYFsG0FZoH+pWgTTDreqpqY7UnQntnaKv95uP5iW3+dChxnx7C3trQQU40S+OgWhUVwCjVFLvg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-arm64": { + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.24.0.tgz", + "integrity": "sha512-MD9uzzkPQbYehwcN583yx3Tu5M8EIoTD+tUgKF982WYL9Pf5rKy9ltgD0eUgs8pvKnmizxjXZyLt0z6DC3rRXg==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.24.0.tgz", + "integrity": "sha512-4ir0aY1NGUhIC1hdoCzr1+5b43mw99uNwVzhIq1OY3QcEwPDO3B7WNXBzaKY5Nsf1+N11i1eOfFcq+D/gOS15Q==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.24.0.tgz", + "integrity": "sha512-jVzdzsbM5xrotH+W5f1s+JtUy1UWgjU0Cf4wMvffTB8m6wP5/kx0KiaLHlbJO+dMgtxKV8RQ/JvtlFcdZ1zCPA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.24.0.tgz", + "integrity": "sha512-iKc8GAslzRpBytO2/aN3d2yb2z8XTVfNV0PjGlCxKo5SgWmNXx82I/Q3aG1tFfS+A2igVCY97TJ8tnYwpUWLCA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.24.0.tgz", + "integrity": "sha512-vQW36KZolfIudCcTnaTpmLQ24Ha1RjygBo39/aLkM2kmjkWmZGEJ5Gn9l5/7tzXA42QGIoWbICfg6KLLkIw6yw==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.24.0.tgz", + "integrity": "sha512-7IAFPrjSQIJrGsK6flwg7NFmwBoSTyF3rl7If0hNUFQU4ilTsEPL6GuMuU9BfIWVVGuRnuIidkSMC+c0Otu8IA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@eslint-community/eslint-utils": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.1.tgz", + "integrity": "sha512-s3O3waFUrMV8P/XaF/+ZTp1X9XBZW1a4B97ZnjQF2KYWaFD2A8KyFBsrsfSjEmjn3RGWAIuvlneuZm3CUK3jbA==", + "dev": true, + "dependencies": { + "eslint-visitor-keys": "^3.4.3" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" + } + }, + "node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@eslint-community/regexpp": { + "version": "4.12.1", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.1.tgz", + "integrity": "sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ==", + "dev": true, + "engines": { + "node": "^12.0.0 || ^14.0.0 || >=16.0.0" + } + }, + "node_modules/@eslint/config-array": { + "version": "0.19.1", + "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.19.1.tgz", + "integrity": "sha512-fo6Mtm5mWyKjA/Chy1BYTdn5mGJoDNjC7C64ug20ADsRDGrA85bN3uK3MaKbeRkRuuIEAR5N33Jr1pbm411/PA==", + "dev": true, + "dependencies": { + "@eslint/object-schema": "^2.1.5", + "debug": "^4.3.1", + "minimatch": "^3.1.2" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/config-array/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/@eslint/config-array/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/@eslint/core": { + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.9.1.tgz", + "integrity": "sha512-GuUdqkyyzQI5RMIWkHhvTWLCyLo1jNK3vzkSyaExH5kHPDHcuL2VOpHjmMY+y3+NC69qAKToBqldTBgYeLSr9Q==", + "dev": true, + "dependencies": { + "@types/json-schema": "^7.0.15" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/eslintrc": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.2.0.tgz", + "integrity": "sha512-grOjVNN8P3hjJn/eIETF1wwd12DdnwFDoyceUJLYYdkpbwq3nLi+4fqrTAONx7XDALqlL220wC/RHSC/QTI/0w==", + "dev": true, + "dependencies": { + "ajv": "^6.12.4", + "debug": "^4.3.2", + "espree": "^10.0.1", + "globals": "^14.0.0", + "ignore": "^5.2.0", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", + "minimatch": "^3.1.2", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@eslint/eslintrc/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/@eslint/eslintrc/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/@eslint/js": { + "version": "9.16.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.16.0.tgz", + "integrity": "sha512-tw2HxzQkrbeuvyj1tG2Yqq+0H9wGoI2IMk4EOsQeX+vmd75FtJAzf+gTA69WF+baUKRYQ3x2kbLE08js5OsTVg==", + "dev": true, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/object-schema": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.5.tgz", + "integrity": "sha512-o0bhxnL89h5Bae5T318nFoFzGy+YE5i/gGkoPAgkmTVdRKTiv3p8JHevPiPaMwoloKfEiiaHlawCqaZMqRm+XQ==", + "dev": true, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/plugin-kit": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.2.4.tgz", + "integrity": "sha512-zSkKow6H5Kdm0ZUQUB2kV5JIXqoG0+uH5YADhaEHswm664N9Db8dXSi0nMJpacpMf+MyyglF1vnZohpEg5yUtg==", + "dev": true, + "dependencies": { + "levn": "^0.4.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@humanfs/core": { + "version": "0.19.1", + "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.1.tgz", + "integrity": "sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA==", + "dev": true, + "engines": { + "node": ">=18.18.0" + } + }, + "node_modules/@humanfs/node": { + "version": "0.16.6", + "resolved": "https://registry.npmjs.org/@humanfs/node/-/node-0.16.6.tgz", + "integrity": "sha512-YuI2ZHQL78Q5HbhDiBA1X4LmYdXCKCMQIfw0pw7piHJwyREFebJUvrQN4cMssyES6x+vfUbx1CIpaQUKYdQZOw==", + "dev": true, + "dependencies": { + "@humanfs/core": "^0.19.1", + "@humanwhocodes/retry": "^0.3.0" + }, + "engines": { + "node": ">=18.18.0" + } + }, + "node_modules/@humanfs/node/node_modules/@humanwhocodes/retry": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.3.1.tgz", + "integrity": "sha512-JBxkERygn7Bv/GbN5Rv8Ul6LVknS+5Bp6RgDC/O8gEBU/yeH5Ui5C/OlWrTb6qct7LjjfT6Re2NxB0ln0yYybA==", + "dev": true, + "engines": { + "node": ">=18.18" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@humanwhocodes/module-importer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", + "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", + "dev": true, + "engines": { + "node": ">=12.22" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@humanwhocodes/retry": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.4.1.tgz", + "integrity": "sha512-c7hNEllBlenFTHBky65mhq8WD2kbN9Q6gk0bTk8lSBvc554jpXSkST1iePudpt7+A/AQvuHs9EMqjHDXMY1lrA==", + "dev": true, + "engines": { + "node": ">=18.18" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dev": true, + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dev": true, + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@stylistic/eslint-plugin": { + "version": "2.12.0", + "resolved": "https://registry.npmjs.org/@stylistic/eslint-plugin/-/eslint-plugin-2.12.0.tgz", + "integrity": "sha512-IvD2WXbOoSp0zNpyYbjdSyEjZtut78RYfj2WIlbChE7HFuposTK5X1hc5+4AyqYcjLXYdD5oo/sJtqMGFNRb1w==", + "dev": true, + "dependencies": { + "@typescript-eslint/utils": "^8.13.0", + "eslint-visitor-keys": "^4.2.0", + "espree": "^10.3.0", + "estraverse": "^5.3.0", + "picomatch": "^4.0.2" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "peerDependencies": { + "eslint": ">=8.40.0" + } + }, + "node_modules/@types/estree": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz", + "integrity": "sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==", + "dev": true + }, + "node_modules/@types/json-schema": { + "version": "7.0.15", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", + "dev": true + }, + "node_modules/@types/node": { + "version": "20.17.9", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.17.9.tgz", + "integrity": "sha512-0JOXkRyLanfGPE2QRCwgxhzlBAvaRdCNMcvbd7jFfpmD4eEXll7LRwy5ymJmyeZqk7Nh7eD2LeUyQ68BbndmXw==", + "dev": true, + "dependencies": { + "undici-types": "~6.19.2" + } + }, + "node_modules/@types/vscode": { + "version": "1.95.0", + "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.95.0.tgz", + "integrity": "sha512-0LBD8TEiNbet3NvWsmn59zLzOFu/txSlGxnv5yAFHCrhG9WvAnR3IvfHzMOs2aeWqgvNjq9pO99IUw8d3n+unw==", + "dev": true + }, + "node_modules/@typescript-eslint/eslint-plugin": { + "version": "8.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.18.0.tgz", + "integrity": "sha512-NR2yS7qUqCL7AIxdJUQf2MKKNDVNaig/dEB0GBLU7D+ZdHgK1NoH/3wsgO3OnPVipn51tG3MAwaODEGil70WEw==", + "dev": true, + "dependencies": { + "@eslint-community/regexpp": "^4.10.0", + "@typescript-eslint/scope-manager": "8.18.0", + "@typescript-eslint/type-utils": "8.18.0", + "@typescript-eslint/utils": "8.18.0", + "@typescript-eslint/visitor-keys": "8.18.0", + "graphemer": "^1.4.0", + "ignore": "^5.3.1", + "natural-compare": "^1.4.0", + "ts-api-utils": "^1.3.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "@typescript-eslint/parser": "^8.0.0 || ^8.0.0-alpha.0", + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <5.8.0" + } + }, + "node_modules/@typescript-eslint/parser": { + "version": "8.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.18.0.tgz", + "integrity": "sha512-hgUZ3kTEpVzKaK3uNibExUYm6SKKOmTU2BOxBSvOYwtJEPdVQ70kZJpPjstlnhCHcuc2WGfSbpKlb/69ttyN5Q==", + "dev": true, + "dependencies": { + "@typescript-eslint/scope-manager": "8.18.0", + "@typescript-eslint/types": "8.18.0", + "@typescript-eslint/typescript-estree": "8.18.0", + "@typescript-eslint/visitor-keys": "8.18.0", + "debug": "^4.3.4" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <5.8.0" + } + }, + "node_modules/@typescript-eslint/scope-manager": { + "version": "8.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.18.0.tgz", + "integrity": "sha512-PNGcHop0jkK2WVYGotk/hxj+UFLhXtGPiGtiaWgVBVP1jhMoMCHlTyJA+hEj4rszoSdLTK3fN4oOatrL0Cp+Xw==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "8.18.0", + "@typescript-eslint/visitor-keys": "8.18.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/type-utils": { + "version": "8.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.18.0.tgz", + "integrity": "sha512-er224jRepVAVLnMF2Q7MZJCq5CsdH2oqjP4dT7K6ij09Kyd+R21r7UVJrF0buMVdZS5QRhDzpvzAxHxabQadow==", + "dev": true, + "dependencies": { + "@typescript-eslint/typescript-estree": "8.18.0", + "@typescript-eslint/utils": "8.18.0", + "debug": "^4.3.4", + "ts-api-utils": "^1.3.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <5.8.0" + } + }, + "node_modules/@typescript-eslint/types": { + "version": "8.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.18.0.tgz", + "integrity": "sha512-FNYxgyTCAnFwTrzpBGq+zrnoTO4x0c1CKYY5MuUTzpScqmY5fmsh2o3+57lqdI3NZucBDCzDgdEbIaNfAjAHQA==", + "dev": true, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/typescript-estree": { + "version": "8.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.18.0.tgz", + "integrity": "sha512-rqQgFRu6yPkauz+ms3nQpohwejS8bvgbPyIDq13cgEDbkXt4LH4OkDMT0/fN1RUtzG8e8AKJyDBoocuQh8qNeg==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "8.18.0", + "@typescript-eslint/visitor-keys": "8.18.0", + "debug": "^4.3.4", + "fast-glob": "^3.3.2", + "is-glob": "^4.0.3", + "minimatch": "^9.0.4", + "semver": "^7.6.0", + "ts-api-utils": "^1.3.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "typescript": ">=4.8.4 <5.8.0" + } + }, + "node_modules/@typescript-eslint/utils": { + "version": "8.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.18.0.tgz", + "integrity": "sha512-p6GLdY383i7h5b0Qrfbix3Vc3+J2k6QWw6UMUeY5JGfm3C5LbZ4QIZzJNoNOfgyRe0uuYKjvVOsO/jD4SJO+xg==", + "dev": true, + "dependencies": { + "@eslint-community/eslint-utils": "^4.4.0", + "@typescript-eslint/scope-manager": "8.18.0", + "@typescript-eslint/types": "8.18.0", + "@typescript-eslint/typescript-estree": "8.18.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <5.8.0" + } + }, + "node_modules/@typescript-eslint/visitor-keys": { + "version": "8.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.18.0.tgz", + "integrity": "sha512-pCh/qEA8Lb1wVIqNvBke8UaRjJ6wrAWkJO5yyIbs8Yx6TNGYyfNjOo61tLv+WwLvoLPp4BQ8B7AHKijl8NGUfw==", "dev": true, "dependencies": { - "@azure/msal-common": "14.12.0", - "jsonwebtoken": "^9.0.0", - "uuid": "^8.3.0" + "@typescript-eslint/types": "8.18.0", + "eslint-visitor-keys": "^4.2.0" }, "engines": { - "node": ">=16" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" } }, "node_modules/@vscode/vsce": { - "version": "2.27.0", - "resolved": "https://registry.npmjs.org/@vscode/vsce/-/vsce-2.27.0.tgz", - "integrity": "sha512-FFUMBVSyyjjJpWszwqk7d4U3YllY8FdWslbUDMRki1x4ZjA3Z0hmRMfypWrjP9sptbSR9nyPFU4uqjhy2qRB/w==", + "version": "2.32.0", + "resolved": "https://registry.npmjs.org/@vscode/vsce/-/vsce-2.32.0.tgz", + "integrity": "sha512-3EFJfsgrSftIqt3EtdRcAygy/OJ3hstyI1cDmIgkU9CFZW5C+3djr6mfosndCUqcVYuyjmxOK1xmFp/Bq7+NIg==", "dev": true, "dependencies": { "@azure/identity": "^4.1.0", @@ -268,9 +1087,9 @@ } }, "node_modules/@vscode/vsce-sign": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@vscode/vsce-sign/-/vsce-sign-2.0.4.tgz", - "integrity": "sha512-0uL32egStKYfy60IqnynAChMTbL0oqpqk0Ew0YHiIb+fayuGZWADuIPHWUcY1GCnAA+VgchOPDMxnc2R3XGWEA==", + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@vscode/vsce-sign/-/vsce-sign-2.0.5.tgz", + "integrity": "sha512-GfYWrsT/vypTMDMgWDm75iDmAOMe7F71sZECJ+Ws6/xyIfmB3ELVnVN+LwMFAvmXY+e6eWhR2EzNGF/zAhWY3Q==", "dev": true, "hasInstallScript": true, "optionalDependencies": { @@ -402,18 +1221,74 @@ "win32" ] }, - "node_modules/agent-base": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.1.tgz", - "integrity": "sha512-H0TSyFNDMomMNJQBn8wFV5YC/2eJ+VXECwOadZJT554xP6cODZHPX3H9QMQECxvrgiSOP1pHjy1sMWQVYJOUOA==", + "node_modules/@vscode/vsce/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dev": true, "dependencies": { - "debug": "^4.3.4" + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/@vscode/vsce/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/acorn": { + "version": "8.14.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz", + "integrity": "sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==", + "dev": true, + "bin": { + "acorn": "bin/acorn" }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true, + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, + "node_modules/agent-base": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.3.tgz", + "integrity": "sha512-jRR5wdylq8CkOe6hei19GGZnxM6rBGwFl3Bg0YItGDimvjGtAvdZk4Pu6Cl4u4Igsws4a1fd1Vq3ezrhn4KmFw==", + "dev": true, "engines": { "node": ">= 14" } }, + "node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, "node_modules/ansi-styles": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", @@ -493,13 +1368,23 @@ "dev": true }, "node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/braces": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "dev": true, "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" + "fill-range": "^7.1.1" + }, + "engines": { + "node": ">=8" } }, "node_modules/buffer": { @@ -543,16 +1428,15 @@ "dev": true }, "node_modules/call-bind": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", - "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.8.tgz", + "integrity": "sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww==", "dev": true, "dependencies": { + "call-bind-apply-helpers": "^1.0.0", "es-define-property": "^1.0.0", - "es-errors": "^1.3.0", - "function-bind": "^1.1.2", "get-intrinsic": "^1.2.4", - "set-function-length": "^1.2.1" + "set-function-length": "^1.2.2" }, "engines": { "node": ">= 0.4" @@ -561,6 +1445,28 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/call-bind-apply-helpers": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.1.tgz", + "integrity": "sha512-BhYE+WDaywFg2TBWYNXAE+8B1ATnThNBqXHP5nQu0jWJdVvY2hvkpyB3qOmtmDePiS5/BDQ8wASEWGMWRG148g==", + "dev": true, + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true, + "engines": { + "node": ">=6" + } + }, "node_modules/chalk": { "version": "2.4.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", @@ -576,21 +1482,25 @@ } }, "node_modules/cheerio": { - "version": "1.0.0-rc.12", - "resolved": "https://registry.npmjs.org/cheerio/-/cheerio-1.0.0-rc.12.tgz", - "integrity": "sha512-VqR8m68vM46BNnuZ5NtnGBKIE/DfN0cRIzg9n40EIq9NOv90ayxLBXA8fXC5gquFRGJSTRqBq25Jt2ECLR431Q==", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/cheerio/-/cheerio-1.0.0.tgz", + "integrity": "sha512-quS9HgjQpdaXOvsZz82Oz7uxtXiy6UIsIQcpBj7HRw2M63Skasm9qlDocAM7jNuaxdhpPU7c4kJN+gA5MCu4ww==", "dev": true, "dependencies": { "cheerio-select": "^2.1.0", "dom-serializer": "^2.0.0", "domhandler": "^5.0.3", - "domutils": "^3.0.1", - "htmlparser2": "^8.0.1", - "parse5": "^7.0.0", - "parse5-htmlparser2-tree-adapter": "^7.0.0" + "domutils": "^3.1.0", + "encoding-sniffer": "^0.2.0", + "htmlparser2": "^9.1.0", + "parse5": "^7.1.2", + "parse5-htmlparser2-tree-adapter": "^7.0.0", + "parse5-parser-stream": "^7.1.2", + "undici": "^6.19.5", + "whatwg-mimetype": "^4.0.0" }, "engines": { - "node": ">= 6" + "node": ">=18.17" }, "funding": { "url": "https://github.com/cheeriojs/cheerio?sponsor=1" @@ -621,9 +1531,9 @@ "optional": true }, "node_modules/cockatiel": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/cockatiel/-/cockatiel-3.1.3.tgz", - "integrity": "sha512-xC759TpZ69d7HhfDp8m2WkRwEUiCkxY8Ee2OQH/3H6zmy2D/5Sm+zSTbPRa+V2QyjDtpMvjOIAOVjA2gp6N1kQ==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/cockatiel/-/cockatiel-3.2.1.tgz", + "integrity": "sha512-gfrHV6ZPkquExvMh9IOkKsBzNDk6sDuZ6DdBGUBkvFnTCqCxzpuq48RySgP0AnaqQkw2zynOFj9yly6T1Q2G5Q==", "dev": true, "engines": { "node": ">=16" @@ -671,6 +1581,20 @@ "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", "dev": true }, + "node_modules/cross-spawn": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", + "dev": true, + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, "node_modules/css-select": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/css-select/-/css-select-5.1.0.tgz", @@ -700,12 +1624,12 @@ } }, "node_modules/debug": { - "version": "4.3.5", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.5.tgz", - "integrity": "sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", "dev": true, "dependencies": { - "ms": "2.1.2" + "ms": "^2.1.3" }, "engines": { "node": ">=6.0" @@ -742,6 +1666,12 @@ "node": ">=4.0.0" } }, + "node_modules/deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true + }, "node_modules/define-data-property": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", @@ -842,6 +1772,20 @@ "url": "https://github.com/fb55/domutils?sponsor=1" } }, + "node_modules/dunder-proto": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.0.tgz", + "integrity": "sha512-9+Sj30DIu+4KvHqMfLUGLFYL2PkURSYMVXJyXe92nFRvlYq5hBjLEhblKB+vkd/WVlUYMWigiY07T91Fkk0+4A==", + "dev": true, + "dependencies": { + "call-bind-apply-helpers": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/ecdsa-sig-formatter": { "version": "1.0.11", "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz", @@ -851,56 +1795,355 @@ "safe-buffer": "^5.0.1" } }, + "node_modules/encoding-sniffer": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/encoding-sniffer/-/encoding-sniffer-0.2.0.tgz", + "integrity": "sha512-ju7Wq1kg04I3HtiYIOrUrdfdDvkyO9s5XM8QAj/bN61Yo/Vb4vgJxy5vi4Yxk01gWHbrofpPtpxM8bKger9jhg==", + "dev": true, + "dependencies": { + "iconv-lite": "^0.6.3", + "whatwg-encoding": "^3.1.1" + }, + "funding": { + "url": "https://github.com/fb55/encoding-sniffer?sponsor=1" + } + }, "node_modules/end-of-stream": { "version": "1.4.4", "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", "dev": true, - "optional": true, + "optional": true, + "dependencies": { + "once": "^1.4.0" + } + }, + "node_modules/entities": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", + "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", + "dev": true, + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, + "node_modules/es-define-property": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", + "dev": true, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "dev": true, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/esbuild": { + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.24.0.tgz", + "integrity": "sha512-FuLPevChGDshgSicjisSooU0cemp/sGXR841D5LHMB7mTVOmsEHcAxaH3irL53+8YDIeVNQEySh4DaYU/iuPqQ==", + "dev": true, + "hasInstallScript": true, + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.24.0", + "@esbuild/android-arm": "0.24.0", + "@esbuild/android-arm64": "0.24.0", + "@esbuild/android-x64": "0.24.0", + "@esbuild/darwin-arm64": "0.24.0", + "@esbuild/darwin-x64": "0.24.0", + "@esbuild/freebsd-arm64": "0.24.0", + "@esbuild/freebsd-x64": "0.24.0", + "@esbuild/linux-arm": "0.24.0", + "@esbuild/linux-arm64": "0.24.0", + "@esbuild/linux-ia32": "0.24.0", + "@esbuild/linux-loong64": "0.24.0", + "@esbuild/linux-mips64el": "0.24.0", + "@esbuild/linux-ppc64": "0.24.0", + "@esbuild/linux-riscv64": "0.24.0", + "@esbuild/linux-s390x": "0.24.0", + "@esbuild/linux-x64": "0.24.0", + "@esbuild/netbsd-x64": "0.24.0", + "@esbuild/openbsd-arm64": "0.24.0", + "@esbuild/openbsd-x64": "0.24.0", + "@esbuild/sunos-x64": "0.24.0", + "@esbuild/win32-arm64": "0.24.0", + "@esbuild/win32-ia32": "0.24.0", + "@esbuild/win32-x64": "0.24.0" + } + }, + "node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/eslint": { + "version": "9.16.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.16.0.tgz", + "integrity": "sha512-whp8mSQI4C8VXd+fLgSM0lh3UlmcFtVwUQjyKCFfsp+2ItAIYhlq/hqGahGqHE6cv9unM41VlqKk2VtKYR2TaA==", + "dev": true, + "dependencies": { + "@eslint-community/eslint-utils": "^4.2.0", + "@eslint-community/regexpp": "^4.12.1", + "@eslint/config-array": "^0.19.0", + "@eslint/core": "^0.9.0", + "@eslint/eslintrc": "^3.2.0", + "@eslint/js": "9.16.0", + "@eslint/plugin-kit": "^0.2.3", + "@humanfs/node": "^0.16.6", + "@humanwhocodes/module-importer": "^1.0.1", + "@humanwhocodes/retry": "^0.4.1", + "@types/estree": "^1.0.6", + "@types/json-schema": "^7.0.15", + "ajv": "^6.12.4", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.5", + "debug": "^4.3.2", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^8.2.0", + "eslint-visitor-keys": "^4.2.0", + "espree": "^10.3.0", + "esquery": "^1.5.0", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^8.0.0", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "ignore": "^5.2.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.1.2", + "natural-compare": "^1.4.0", + "optionator": "^0.9.3" + }, + "bin": { + "eslint": "bin/eslint.js" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://eslint.org/donate" + }, + "peerDependencies": { + "jiti": "*" + }, + "peerDependenciesMeta": { + "jiti": { + "optional": true + } + } + }, + "node_modules/eslint-scope": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.2.0.tgz", + "integrity": "sha512-PHlWUfG6lvPc3yvP5A4PNyBL1W8fkDUccmI21JUu/+GKZBoH/W5u6usENXUrWFRsyoW5ACUjFGgAFQp5gUlb/A==", + "dev": true, + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-visitor-keys": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz", + "integrity": "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==", + "dev": true, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/eslint/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/eslint/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/eslint/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/eslint/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/eslint/node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/eslint/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/eslint/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, "dependencies": { - "once": "^1.4.0" + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" } }, - "node_modules/entities": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", - "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", + "node_modules/espree": { + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-10.3.0.tgz", + "integrity": "sha512-0QYC8b24HWY8zjRnDTL6RiHfDbAWn63qb4LMj1Z4b076A4une81+z03Kg7l7mn/48PUTqoLptSXez8oknU8Clg==", "dev": true, + "dependencies": { + "acorn": "^8.14.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^4.2.0" + }, "engines": { - "node": ">=0.12" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { - "url": "https://github.com/fb55/entities?sponsor=1" + "url": "https://opencollective.com/eslint" } }, - "node_modules/es-define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", - "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", + "node_modules/esquery": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.6.0.tgz", + "integrity": "sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==", "dev": true, "dependencies": { - "get-intrinsic": "^1.2.4" + "estraverse": "^5.1.0" }, "engines": { - "node": ">= 0.4" + "node": ">=0.10" } }, - "node_modules/es-errors": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", - "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "node_modules/esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", "dev": true, + "dependencies": { + "estraverse": "^5.2.0" + }, "engines": { - "node": ">= 0.4" + "node": ">=4.0" } }, - "node_modules/escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", "dev": true, "engines": { - "node": ">=0.8.0" + "node": ">=4.0" + } + }, + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true, + "engines": { + "node": ">=0.10.0" } }, "node_modules/events": { @@ -922,6 +2165,61 @@ "node": ">=6" } }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true + }, + "node_modules/fast-glob": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", + "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", + "dev": true, + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" + }, + "engines": { + "node": ">=8.6.0" + } + }, + "node_modules/fast-glob/node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true + }, + "node_modules/fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", + "dev": true + }, + "node_modules/fastq": { + "version": "1.17.1", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz", + "integrity": "sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==", + "dev": true, + "dependencies": { + "reusify": "^1.0.4" + } + }, "node_modules/fd-slicer": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz", @@ -931,10 +2229,69 @@ "pend": "~1.2.0" } }, + "node_modules/file-entry-cache": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz", + "integrity": "sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==", + "dev": true, + "dependencies": { + "flat-cache": "^4.0.0" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/fill-range": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "dev": true, + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/flat-cache": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-4.0.1.tgz", + "integrity": "sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==", + "dev": true, + "dependencies": { + "flatted": "^3.2.9", + "keyv": "^4.5.4" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/flatted": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.2.tgz", + "integrity": "sha512-AiwGJM8YcNOaobumgtng+6NHuOqC3A7MixFeDafM3X9cIUM+xUXoS5Vfgf+OihAYe20fxqNM9yPBXJzRtZ/4eA==", + "dev": true + }, "node_modules/form-data": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", - "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.1.tgz", + "integrity": "sha512-tzN8e4TX8+kkxGPK8D5u0FNmjPUjw3lwC9lSLxxoB/+GtsJG91CO8bSWy73APlgAZzZbXEYZJuxjkHH2w+Ezhw==", "dev": true, "dependencies": { "asynckit": "^0.4.0", @@ -968,16 +2325,19 @@ } }, "node_modules/get-intrinsic": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", - "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.5.tgz", + "integrity": "sha512-Y4+pKa7XeRUPWFNvOOYHkRYrfzW07oraURSvjDmRVOJ748OrVmeXtpE4+GCEHncjCjkTxPNRt8kEbxDhsn6VTg==", "dev": true, "dependencies": { + "call-bind-apply-helpers": "^1.0.0", + "dunder-proto": "^1.0.0", + "es-define-property": "^1.0.1", "es-errors": "^1.3.0", "function-bind": "^1.1.2", - "has-proto": "^1.0.1", - "has-symbols": "^1.0.3", - "hasown": "^2.0.0" + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2" }, "engines": { "node": ">= 0.4" @@ -1014,18 +2374,70 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/gopd": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", - "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "node_modules/glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dev": true, + "dependencies": { + "is-glob": "^4.0.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/glob/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/glob/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dev": true, "dependencies": { - "get-intrinsic": "^1.1.3" + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/globals": { + "version": "14.0.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz", + "integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==", + "dev": true, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/gopd": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", + "dev": true, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/graphemer": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", + "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", + "dev": true + }, "node_modules/has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", @@ -1047,22 +2459,10 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/has-proto": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", - "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==", - "dev": true, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/has-symbols": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", - "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", "dev": true, "engines": { "node": ">= 0.4" @@ -1096,9 +2496,9 @@ } }, "node_modules/htmlparser2": { - "version": "8.0.2", - "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-8.0.2.tgz", - "integrity": "sha512-GYdjWKDkbRLkZ5geuHs5NY1puJ+PXwP7+fHPRz06Eirsb9ugf6d8kkXav6ADhcODhFFPMIXyxkxSuMf3D6NCFA==", + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-9.1.0.tgz", + "integrity": "sha512-5zfg6mHUoaer/97TxnGpxmbR7zJtPwIYFMZ/H5ucTlPZhKvtum05yiPK3Mgai3a0DyVxv7qYqoweaEd2nrYQzQ==", "dev": true, "funding": [ "https://github.com/fb55/htmlparser2?sponsor=1", @@ -1110,8 +2510,8 @@ "dependencies": { "domelementtype": "^2.3.0", "domhandler": "^5.0.3", - "domutils": "^3.0.1", - "entities": "^4.4.0" + "domutils": "^3.1.0", + "entities": "^4.5.0" } }, "node_modules/http-proxy-agent": { @@ -1128,18 +2528,30 @@ } }, "node_modules/https-proxy-agent": { - "version": "7.0.4", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.4.tgz", - "integrity": "sha512-wlwpilI7YdjSkWaQ/7omYBMTliDcmCN8OLihO6I9B86g06lMyAoqgoDpV0XqoaPOKj+0DIdAvnsWfyAAhmimcg==", + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz", + "integrity": "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==", "dev": true, "dependencies": { - "agent-base": "^7.0.2", + "agent-base": "^7.1.2", "debug": "4" }, "engines": { "node": ">= 14" } }, + "node_modules/iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "dev": true, + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/ieee754": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", @@ -1161,6 +2573,40 @@ ], "optional": true }, + "node_modules/ignore": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", + "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", + "dev": true, + "engines": { + "node": ">= 4" + } + }, + "node_modules/import-fresh": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", + "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", + "dev": true, + "dependencies": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", + "dev": true, + "engines": { + "node": ">=0.8.19" + } + }, "node_modules/inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", @@ -1200,6 +2646,36 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, + "engines": { + "node": ">=0.12.0" + } + }, "node_modules/is-wsl": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz", @@ -1212,10 +2688,46 @@ "node": ">=8" } }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true + }, + "node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/json-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", + "dev": true + }, + "node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "node_modules/json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", + "dev": true + }, "node_modules/jsonc-parser": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.1.tgz", - "integrity": "sha512-AilxAyFOAcK5wA1+LeaySVBrHsGQvUFCDWXKpZjzaL0PqW+xfBOttn8GNtWKFWqneyMZj41MWF9Kl6iPWLwgOA==", + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.3.1.tgz", + "integrity": "sha512-HUgH65KyejrUFPvHFPbqOY0rsFip3Bo5wb4ngvdi1EpCYWUQDC5V+Y7mZws+DLkr4M//zQJoanu1SP+87Dv1oQ==", "dev": true }, "node_modules/jsonwebtoken": { @@ -1294,6 +2806,15 @@ "prebuild-install": "^7.0.1" } }, + "node_modules/keyv": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", + "dev": true, + "dependencies": { + "json-buffer": "3.0.1" + } + }, "node_modules/leven": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz", @@ -1303,6 +2824,19 @@ "node": ">=6" } }, + "node_modules/levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "dependencies": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, "node_modules/linkify-it": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-3.0.3.tgz", @@ -1312,6 +2846,21 @@ "uc.micro": "^1.0.1" } }, + "node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/lodash.includes": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/lodash.includes/-/lodash.includes-4.3.0.tgz", @@ -1348,6 +2897,12 @@ "integrity": "sha512-0wJxfxH1wgO3GrbuP+dTTk7op+6L41QCXbGINEmD+ny/G/eCqGzxyCsh7159S+mgDDcoarnBw6PC1PS5+wUGgw==", "dev": true }, + "node_modules/lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true + }, "node_modules/lodash.once": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz", @@ -1397,6 +2952,40 @@ "integrity": "sha512-/sKlQJCBYVY9Ers9hqzKou4H6V5UWc/M59TH2dvkt+84itfnq7uFOMLpOiOS4ujvHP4etln18fmIxA5R5fll0g==", "dev": true }, + "node_modules/merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/micromatch": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", + "dev": true, + "dependencies": { + "braces": "^3.0.3", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/micromatch/node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, "node_modules/mime": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", @@ -1444,15 +3033,18 @@ } }, "node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", "dev": true, "dependencies": { - "brace-expansion": "^1.1.7" + "brace-expansion": "^2.0.1" }, "engines": { - "node": "*" + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, "node_modules/minimist": { @@ -1473,9 +3065,9 @@ "optional": true }, "node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", "dev": true }, "node_modules/mute-stream": { @@ -1491,10 +3083,16 @@ "dev": true, "optional": true }, + "node_modules/natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", + "dev": true + }, "node_modules/node-abi": { - "version": "3.65.0", - "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.65.0.tgz", - "integrity": "sha512-ThjYBfoDNr08AWx6hGaRbfPwxKV9kVzAzOzlLKbk2CuqXE2xnCh+cbAGnwM3t8Lq4v9rUB7VfondlkBckcJrVA==", + "version": "3.71.0", + "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.71.0.tgz", + "integrity": "sha512-SZ40vRiy/+wRTf21hxkkEjPJZpARzUMVcJoQse2EF8qkUWbbO2z7vd5oA/H6bVH6SZQ5STGcu0KRDS7biNRfxw==", "dev": true, "optional": true, "dependencies": { @@ -1524,10 +3122,13 @@ } }, "node_modules/object-inspect": { - "version": "1.13.1", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz", - "integrity": "sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==", + "version": "1.13.3", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.3.tgz", + "integrity": "sha512-kDCGIbxkDSXE3euJZZXzc6to7fCrKHNI/hSRQnRuQ+BWjFNzZwiFF8fj/6o2t2G9/jTj8PSIYTfCLelLZEeRpA==", "dev": true, + "engines": { + "node": ">= 0.4" + }, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -1558,6 +3159,65 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/optionator": { + "version": "0.9.4", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", + "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", + "dev": true, + "dependencies": { + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.5" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "dependencies": { + "callsites": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, "node_modules/parse-semver": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/parse-semver/-/parse-semver-1.1.1.tgz", @@ -1577,30 +3237,51 @@ } }, "node_modules/parse5": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.1.2.tgz", - "integrity": "sha512-Czj1WaSVpaoj0wbhMzLmWD69anp2WH7FXMB9n1Sy8/ZFF9jolSQVMu1Ij5WIyGmcBmhk7EOndpO4mIpihVqAXw==", + "version": "7.2.1", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.2.1.tgz", + "integrity": "sha512-BuBYQYlv1ckiPdQi/ohiivi9Sagc9JG+Ozs0r7b/0iK3sKmrb0b9FdWdBbOdx6hBCM/F9Ir82ofnBhtZOjCRPQ==", "dev": true, "dependencies": { - "entities": "^4.4.0" + "entities": "^4.5.0" }, "funding": { "url": "https://github.com/inikulin/parse5?sponsor=1" } }, "node_modules/parse5-htmlparser2-tree-adapter": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/parse5-htmlparser2-tree-adapter/-/parse5-htmlparser2-tree-adapter-7.0.0.tgz", - "integrity": "sha512-B77tOZrqqfUfnVcOrUvfdLbz4pu4RopLD/4vmu3HUPswwTA8OH0EMW9BlWR2B0RCoiZRAHEUu7IxeP1Pd1UU+g==", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/parse5-htmlparser2-tree-adapter/-/parse5-htmlparser2-tree-adapter-7.1.0.tgz", + "integrity": "sha512-ruw5xyKs6lrpo9x9rCZqZZnIUntICjQAd0Wsmp396Ul9lN/h+ifgVV1x1gZHi8euej6wTfpqX8j+BFQxF0NS/g==", + "dev": true, + "dependencies": { + "domhandler": "^5.0.3", + "parse5": "^7.0.0" + }, + "funding": { + "url": "https://github.com/inikulin/parse5?sponsor=1" + } + }, + "node_modules/parse5-parser-stream": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/parse5-parser-stream/-/parse5-parser-stream-7.1.2.tgz", + "integrity": "sha512-JyeQc9iwFLn5TbvvqACIF/VXG6abODeB3Fwmv/TGdLk2LfbWkaySGY72at4+Ty7EkPZj854u4CrICqNk2qIbow==", "dev": true, "dependencies": { - "domhandler": "^5.0.2", "parse5": "^7.0.0" }, "funding": { "url": "https://github.com/inikulin/parse5?sponsor=1" } }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", @@ -1610,12 +3291,33 @@ "node": ">=0.10.0" } }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/pend": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz", "integrity": "sha512-F3asv42UuXchdzt+xXqfW1OGlVBe+mxa2mqI0pg5yAHZPvFmY3Y6drSf/GQ1A86WgWEN9Kzh/WrgKa6iGcHXLg==", "dev": true }, + "node_modules/picomatch": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.2.tgz", + "integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, "node_modules/prebuild-install": { "version": "7.1.2", "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-7.1.2.tgz", @@ -1643,10 +3345,19 @@ "node": ">=10" } }, + "node_modules/prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true, + "engines": { + "node": ">= 0.8.0" + } + }, "node_modules/pump": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", - "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.2.tgz", + "integrity": "sha512-tUPXtzlGM8FE3P0ZL6DVs/3P58k9nk8/jZeQCurTJylQA8qFYzHFfhBJkuqyE0FifOsQ0uKWekiZ5g8wtr28cw==", "dev": true, "optional": true, "dependencies": { @@ -1654,10 +3365,19 @@ "once": "^1.3.1" } }, + "node_modules/punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "dev": true, + "engines": { + "node": ">=6" + } + }, "node_modules/qs": { - "version": "6.12.1", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.12.1.tgz", - "integrity": "sha512-zWmv4RSuB9r2mYQw3zxQuHWeU+42aKi1wWig/j4ele4ygELZ7PEO6MM7rim9oAQH2A5MWfsAVf/jPvTPgCbvUQ==", + "version": "6.13.1", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.1.tgz", + "integrity": "sha512-EJPeIn0CYrGu+hli1xilKAPXODtJ12T0sP63Ijx2/khC2JtuaN3JyNIpvmnkmaEtha9ocbG4A4cMcr+TvqvwQg==", "dev": true, "dependencies": { "side-channel": "^1.0.6" @@ -1669,6 +3389,26 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, "node_modules/rc": { "version": "1.2.8", "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", @@ -1685,6 +3425,16 @@ "rc": "cli.js" } }, + "node_modules/rc/node_modules/strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==", + "dev": true, + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/read": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/read/-/read-1.0.7.tgz", @@ -1712,6 +3462,48 @@ "node": ">= 6" } }, + "node_modules/resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true, + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, + "node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "queue-microtask": "^1.2.2" + } + }, "node_modules/safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", @@ -1732,6 +3524,12 @@ } ] }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true + }, "node_modules/sax": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/sax/-/sax-1.4.1.tgz", @@ -1739,9 +3537,9 @@ "dev": true }, "node_modules/semver": { - "version": "7.6.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", - "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==", + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", + "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", "bin": { "semver": "bin/semver.js" }, @@ -1766,6 +3564,27 @@ "node": ">= 0.4" } }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/side-channel": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz", @@ -1852,13 +3671,15 @@ } }, "node_modules/strip-json-comments": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", - "integrity": "sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", "dev": true, - "optional": true, "engines": { - "node": ">=0.10.0" + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/supports-color": { @@ -1912,10 +3733,34 @@ "node": ">=14.14" } }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/ts-api-utils": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.4.3.tgz", + "integrity": "sha512-i3eMG77UTMD0hZhgRS562pv83RC6ukSAC2GMNWc+9dieh/+jDM5u5YG+NHX6VNDRHQcHwmsTHctP9LhbC3WxVw==", + "dev": true, + "engines": { + "node": ">=16" + }, + "peerDependencies": { + "typescript": ">=4.2.0" + } + }, "node_modules/tslib": { - "version": "2.6.3", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.3.tgz", - "integrity": "sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ==", + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", "dev": true }, "node_modules/tunnel": { @@ -1940,6 +3785,18 @@ "node": "*" } }, + "node_modules/type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "dependencies": { + "prelude-ls": "^1.2.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, "node_modules/typed-rest-client": { "version": "1.8.11", "resolved": "https://registry.npmjs.org/typed-rest-client/-/typed-rest-client-1.8.11.tgz", @@ -1951,6 +3808,41 @@ "underscore": "^1.12.1" } }, + "node_modules/typescript": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.7.2.tgz", + "integrity": "sha512-i5t66RHxDvVN40HfDd1PsEThGNnlMCMT3jMUuoh9/0TaqWevNontacunWyN02LA9/fIbEWlcHZcgTKb9QoaLfg==", + "dev": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/typescript-eslint": { + "version": "8.18.0", + "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.18.0.tgz", + "integrity": "sha512-Xq2rRjn6tzVpAyHr3+nmSg1/9k9aIHnJ2iZeOH7cfGOWqTkXTm3kwpQglEuLGdNrYvPF+2gtAs+/KF5rjVo+WQ==", + "dev": true, + "dependencies": { + "@typescript-eslint/eslint-plugin": "8.18.0", + "@typescript-eslint/parser": "8.18.0", + "@typescript-eslint/utils": "8.18.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <5.8.0" + } + }, "node_modules/uc.micro": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-1.0.6.tgz", @@ -1958,11 +3850,35 @@ "dev": true }, "node_modules/underscore": { - "version": "1.13.6", - "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.13.6.tgz", - "integrity": "sha512-+A5Sja4HP1M08MaXya7p5LvjuM7K6q/2EaC0+iovj/wOcMsTzMvDFbasi/oSapiwOlt252IqsKqPjCl7huKS0A==", + "version": "1.13.7", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.13.7.tgz", + "integrity": "sha512-GMXzWtsc57XAtguZgaQViUOzs0KTkk8ojr3/xAxXLITqf/3EMwxC0inyETfDFjH/Krbhuep0HNbbjI9i/q3F3g==", + "dev": true + }, + "node_modules/undici": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/undici/-/undici-6.21.0.tgz", + "integrity": "sha512-BUgJXc752Kou3oOIuU1i+yZZypyZRqNPW0vqoMPl8VaoalSfeR0D8/t4iAS3yirs79SSMTxTag+ZC86uswv+Cw==", + "dev": true, + "engines": { + "node": ">=18.17" + } + }, + "node_modules/undici-types": { + "version": "6.19.8", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz", + "integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==", "dev": true }, + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "dependencies": { + "punycode": "^2.1.0" + } + }, "node_modules/url-join": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/url-join/-/url-join-4.0.1.tgz", @@ -2006,14 +3922,6 @@ "vscode": "^1.82.0" } }, - "node_modules/vscode-languageclient/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "dependencies": { - "balanced-match": "^1.0.0" - } - }, "node_modules/vscode-languageclient/node_modules/minimatch": { "version": "5.1.6", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", @@ -2039,6 +3947,51 @@ "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.17.5.tgz", "integrity": "sha512-Ld1VelNuX9pdF39h2Hgaeb5hEZM2Z3jUrrMgWQAu82jMtZp7p3vJT3BzToKtZI7NgQssZje5o0zryOrhQvzQAg==" }, + "node_modules/whatwg-encoding": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-3.1.1.tgz", + "integrity": "sha512-6qN4hJdMwfYBtE3YBTTHhoeuUrDBPZmbQaxWAqSALV/MeEnR5z1xd8UKud2RAkFoPkmB+hli1TZSnyi84xz1vQ==", + "dev": true, + "dependencies": { + "iconv-lite": "0.6.3" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/whatwg-mimetype": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-4.0.0.tgz", + "integrity": "sha512-QaKxh0eNIi2mE9p2vEdzfagOKHCcj1pJ56EEHGQOVxp8r9/iszLUUV7v89x9O1p/T+NlTM5W7jW6+cz4Fq1YVg==", + "dev": true, + "engines": { + "node": ">=18" + } + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/word-wrap": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", + "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", @@ -2091,6 +4044,18 @@ "dependencies": { "buffer-crc32": "~0.2.3" } + }, + "node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } } } } diff --git a/utils/vscode/package.json b/utils/vscode/package.json index a56569c43007d..5da8255e9d9a7 100644 --- a/utils/vscode/package.json +++ b/utils/vscode/package.json @@ -1,7 +1,7 @@ { "name": "carbon-vscode", "displayName": "Carbon Language", - "version": "0.0.2", + "version": "0.0.3", "publisher": "carbon-lang", "description": "Carbon language support for Visual Studio Code.", "repository": { @@ -15,7 +15,7 @@ ], "icon": "images/icon.png", "activationEvents": [], - "main": "./src/extension.js", + "main": "./dist/extension.js", "contributes": { "languages": [ { @@ -35,16 +35,41 @@ "scopeName": "source.carbon", "path": "./carbon.tmLanguage.json" } - ] + ], + "configuration": { + "type": "object", + "title": "Carbon Language", + "properties": { + "carbon.carbonPath": { + "type": "string", + "description": "The path to the 'carbon' binary." + } + } + } }, "scripts": { - "package": "mkdir -p out && vsce package -o out/carbon.vsix" + "vscode:prepublish": "npm run package", + "compile": "npm run check-types && npm run lint && node esbuild.js", + "watch": "npm-run-all -p watch:*", + "watch:esbuild": "node esbuild.js --watch", + "watch:tsc": "tsc --noEmit --watch --project tsconfig.json", + "package": "npm run check-types && npm run lint && node esbuild.js --production", + "compile-tests": "tsc -p . --outDir out", + "check-types": "tsc --noEmit", + "lint": "eslint" }, "devDependencies": { - "@vscode/vsce": "^2.27.0" + "@eslint/js": "^9.13.0", + "@stylistic/eslint-plugin": "^2.9.0", + "@types/node": "^20", + "@types/vscode": "^1.73.0", + "@vscode/vsce": "^2.27.0", + "esbuild": "^0.24.0", + "eslint": "^9.13.0", + "typescript": "^5.7.2", + "typescript-eslint": "^8.16.0" }, "dependencies": { - "@vscode/vsce": "^2.27.0", "vscode-languageclient": "^9.0.1" } } diff --git a/utils/vscode/src/extension.js b/utils/vscode/src/extension.js deleted file mode 100644 index 958a03e4f21ad..0000000000000 --- a/utils/vscode/src/extension.js +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Part of the Carbon Language project, under the Apache License v2.0 with LLVM - * Exceptions. See /LICENSE for license information. - * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception - */ - -const { LanguageClient } = require('vscode-languageclient/node'); - -function activate(context) { - const command = './bazel-bin/toolchain/install/run_carbon'; - const args = ['language-server']; - const serverOptions = { - run: { command: command, args: args }, - debug: { command: command, args: args }, - }; - - const clientOptions = { - documentSelector: [{ scheme: 'file', language: 'carbon' }], - }; - - const client = new LanguageClient( - 'languageServer', - 'Language Server for Carbon', - serverOptions, - clientOptions - ); - - // stop client on shutdown - context.subscriptions.push(client.start()); -} - -function deactivate() {} - -module.exports = { - activate, - deactivate, -}; diff --git a/utils/vscode/src/extension.ts b/utils/vscode/src/extension.ts new file mode 100644 index 0000000000000..d89c1216ae9fd --- /dev/null +++ b/utils/vscode/src/extension.ts @@ -0,0 +1,53 @@ +/* + * Part of the Carbon Language project, under the Apache License v2.0 with LLVM + * Exceptions. See /LICENSE for license information. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + */ + +/* + * This is the main launcher for the LSP extension. + */ + +import { workspace, ExtensionContext } from 'vscode'; + +import { + LanguageClient, + LanguageClientOptions, + ServerOptions, +} from 'vscode-languageclient/node'; + +let client: LanguageClient; + +export function activate(context: ExtensionContext) { + const settings = workspace.getConfiguration('carbon'); + + const serverOptions: ServerOptions = { + // The Carbon server can be configured, but we try to use bazel output as a + // fallback. + command: settings.get( + 'carbonPath', + context.asAbsolutePath('./bazel-bin/toolchain/install/run_carbon') + ), + args: ['language-server'], + }; + + const clientOptions: LanguageClientOptions = { + documentSelector: [{ language: 'carbon' }], + }; + + // Create and start the client. + client = new LanguageClient( + 'carbonLanguageServer', + 'Carbon Language Server', + serverOptions, + clientOptions + ); + client.start(); +} + +export function deactivate(): Thenable | undefined { + if (!client) { + return undefined; + } + return client.stop(); +} diff --git a/utils/vscode/tsconfig.json b/utils/vscode/tsconfig.json new file mode 100644 index 0000000000000..3e21c6c5704d3 --- /dev/null +++ b/utils/vscode/tsconfig.json @@ -0,0 +1,13 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es2020", + "lib": ["es2020"], + "outDir": "out", + "sourceMap": true, + "strict": true, + "rootDir": "src" + }, + "include": ["src"], + "exclude": ["node_modules"] +} From a10c79569ee697bcab5144af4ed06a78b43849d0 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Mon, 16 Dec 2024 14:19:23 -0800 Subject: [PATCH 33/68] Model `Core.Int` as a class type (#4644) Instead of treating `Core.Int` as the toolchain's builtin `IntType`, model it as a class that adapts the builtin type. This aligns us better with the intended language model, gives an associated library for `impl`s involving `Core.Int` to live within, and opens the door adding member functions to `Core.Int` if we decide that is desirable. Remarkably it also seems to make the formatted SemIR a little smaller, because a call to a generic class generates less IR than a call to a function. --- bazel/carbon_rules/defs.bzl | 68 +- core/BUILD | 1 + core/prelude/operators/as.carbon | 39 - core/prelude/types.carbon | 11 +- core/prelude/types/{i32.carbon => int.carbon} | 30 +- core/prelude/types/int_literal.carbon | 7 + core/prelude/types/uint.carbon | 33 + examples/sieve.carbon | 79 -- toolchain/check/context.cpp | 5 +- toolchain/check/context.h | 7 +- toolchain/check/eval.cpp | 23 +- toolchain/check/import_ref.cpp | 11 +- .../check/testdata/alias/fail_builtins.carbon | 8 +- .../testdata/array/array_in_place.carbon | 38 +- .../testdata/array/array_vs_tuple.carbon | 50 +- .../testdata/array/assign_return_value.carbon | 28 +- .../check/testdata/array/assign_var.carbon | 44 +- toolchain/check/testdata/array/base.carbon | 22 +- .../testdata/array/canonicalize_index.carbon | 102 +-- .../testdata/array/fail_bound_negative.carbon | 54 +- .../testdata/array/fail_bound_overflow.carbon | 10 +- .../testdata/array/fail_out_of_bound.carbon | 10 +- .../fail_out_of_bound_non_literal.carbon | 44 +- .../testdata/array/fail_type_mismatch.carbon | 52 +- .../testdata/array/function_param.carbon | 54 +- toolchain/check/testdata/array/import.carbon | 32 +- .../testdata/array/index_not_literal.carbon | 44 +- .../check/testdata/array/nine_elements.carbon | 52 +- .../testdata/as/adapter_conversion.carbon | 155 ++-- toolchain/check/testdata/as/as_type.carbon | 20 +- toolchain/check/testdata/as/basic.carbon | 28 +- .../testdata/as/fail_no_conversion.carbon | 30 +- .../check/testdata/as/fail_not_type.carbon | 10 +- toolchain/check/testdata/as/overloaded.carbon | 70 +- .../testdata/basics/builtin_types.carbon | 26 +- .../check/testdata/basics/fail_bad_run.carbon | 10 +- .../testdata/basics/fail_bad_run_2.carbon | 10 +- .../fail_numeric_literal_overflow.carbon | 36 +- .../testdata/basics/numeric_literals.carbon | 36 +- toolchain/check/testdata/basics/parens.carbon | 28 +- .../check/testdata/basics/run_i32.carbon | 24 +- .../testdata/basics/type_literals.carbon | 54 +- .../testdata/builtins/float/make_type.carbon | 58 +- .../check/testdata/builtins/int/and.carbon | 68 +- .../testdata/builtins/int/complement.carbon | 72 +- .../builtins/int/convert_checked.carbon | 702 +++++++----------- .../check/testdata/builtins/int/eq.carbon | 80 +- .../testdata/builtins/int/greater.carbon | 82 +- .../testdata/builtins/int/greater_eq.carbon | 82 +- .../testdata/builtins/int/left_shift.carbon | 222 +++--- .../check/testdata/builtins/int/less.carbon | 82 +- .../testdata/builtins/int/less_eq.carbon | 82 +- .../builtins/int/make_type_signed.carbon | 304 ++++---- .../builtins/int/make_type_unsigned.carbon | 160 ++-- .../check/testdata/builtins/int/neq.carbon | 48 +- .../check/testdata/builtins/int/or.carbon | 68 +- .../testdata/builtins/int/right_shift.carbon | 292 +++----- .../check/testdata/builtins/int/sadd.carbon | 262 +++---- .../check/testdata/builtins/int/sdiv.carbon | 256 +++---- .../check/testdata/builtins/int/smod.carbon | 256 +++---- .../check/testdata/builtins/int/smul.carbon | 138 ++-- .../testdata/builtins/int/snegate.carbon | 260 +++---- .../check/testdata/builtins/int/ssub.carbon | 158 ++-- .../check/testdata/builtins/int/uadd.carbon | 262 +++---- .../check/testdata/builtins/int/udiv.carbon | 256 +++---- .../check/testdata/builtins/int/umod.carbon | 256 +++---- .../check/testdata/builtins/int/umul.carbon | 138 ++-- .../testdata/builtins/int/unegate.carbon | 260 +++---- .../check/testdata/builtins/int/usub.carbon | 158 ++-- .../check/testdata/builtins/int/xor.carbon | 68 +- .../check/testdata/builtins/print.carbon | 30 +- .../testdata/class/access_modifers.carbon | 176 ++--- .../check/testdata/class/adapter/adapt.carbon | 38 +- .../testdata/class/adapter/adapt_copy.carbon | 89 +-- .../class/adapter/extend_adapt.carbon | 135 ++-- .../adapter/fail_adapt_with_subobjects.carbon | 84 +-- .../testdata/class/adapter/init_adapt.carbon | 84 +-- toolchain/check/testdata/class/base.carbon | 78 +- .../check/testdata/class/base_field.carbon | 60 +- .../check/testdata/class/base_method.carbon | 34 +- .../class/base_method_qualified.carbon | 38 +- toolchain/check/testdata/class/basic.carbon | 60 +- .../class/complete_in_member_fn.carbon | 24 +- .../testdata/class/compound_field.carbon | 78 +- .../testdata/class/derived_to_base.carbon | 60 +- .../check/testdata/class/fail_abstract.carbon | 70 +- .../testdata/class/fail_base_bad_type.carbon | 170 ++--- .../class/fail_compound_type_mismatch.carbon | 36 +- .../class/fail_derived_to_base.carbon | 40 +- .../class/fail_field_modifiers.carbon | 48 +- .../testdata/class/fail_generic_method.carbon | 36 +- .../testdata/class/fail_incomplete.carbon | 18 +- .../check/testdata/class/fail_init.carbon | 36 +- .../class/fail_init_as_inplace.carbon | 40 +- .../testdata/class/fail_member_of_let.carbon | 14 +- .../check/testdata/class/fail_scope.carbon | 28 +- .../testdata/class/fail_unbound_field.carbon | 30 +- .../testdata/class/fail_unknown_member.carbon | 22 +- .../check/testdata/class/field_access.carbon | 56 +- .../class/field_access_in_value.carbon | 56 +- .../check/testdata/class/generic/adapt.carbon | 273 +++---- .../class/generic/base_is_generic.carbon | 200 +++-- .../check/testdata/class/generic/call.carbon | 176 ++--- .../generic/complete_in_conversion.carbon | 205 ++--- .../check/testdata/class/generic/field.carbon | 41 +- .../testdata/class/generic/import.carbon | 170 ++--- .../check/testdata/class/generic/init.carbon | 57 +- .../class/generic/member_access.carbon | 53 +- .../class/generic/member_lookup.carbon | 62 +- .../testdata/class/generic/redeclare.carbon | 84 +-- .../testdata/class/generic/stringify.carbon | 62 +- toolchain/check/testdata/class/import.carbon | 90 ++- .../check/testdata/class/import_base.carbon | 100 ++- .../testdata/class/inheritance_access.carbon | 228 +++--- toolchain/check/testdata/class/init.carbon | 26 +- toolchain/check/testdata/class/init_as.carbon | 46 +- .../check/testdata/class/init_nested.carbon | 30 +- toolchain/check/testdata/class/method.carbon | 76 +- .../check/testdata/class/nested_name.carbon | 28 +- .../check/testdata/class/raw_self.carbon | 66 +- .../check/testdata/class/reenter_scope.carbon | 22 +- toolchain/check/testdata/class/reorder.carbon | 28 +- .../testdata/class/reorder_qualified.carbon | 76 +- toolchain/check/testdata/class/scope.carbon | 44 +- toolchain/check/testdata/class/self.carbon | 42 +- .../testdata/class/self_conversion.carbon | 48 +- .../check/testdata/class/self_type.carbon | 18 +- .../check/testdata/class/static_method.carbon | 22 +- .../class/syntactic_merge_literal.carbon | 56 +- .../class/todo_access_modifiers.carbon | 26 +- .../testdata/class/virtual_modifiers.carbon | 56 +- toolchain/check/testdata/const/basic.carbon | 22 +- .../check/testdata/const/collapse.carbon | 14 +- .../check/testdata/const/fail_collapse.carbon | 14 +- toolchain/check/testdata/const/import.carbon | 30 +- toolchain/check/testdata/deduce/array.carbon | 232 +++--- .../check/testdata/deduce/generic_type.carbon | 90 +-- .../check/testdata/deduce/int_float.carbon | 49 +- toolchain/check/testdata/deduce/tuple.carbon | 58 +- .../check/testdata/eval/aggregate.carbon | 98 +-- .../check/testdata/eval/fail_aggregate.carbon | 52 +- .../check/testdata/eval/fail_symbolic.carbon | 56 +- .../expr_category/in_place_tuple_init.carbon | 46 +- .../testdata/function/builtin/call.carbon | 62 +- .../function/builtin/definition.carbon | 18 +- .../function/builtin/fail_redefined.carbon | 78 +- .../testdata/function/builtin/method.carbon | 76 +- .../builtin/no_prelude/adapted_type.carbon | 12 +- .../no_prelude/call_from_operator.carbon | 274 +++---- .../function/builtin/no_prelude/import.carbon | 140 ++-- .../function/call/fail_not_callable.carbon | 10 +- .../function/call/fail_param_count.carbon | 18 +- .../function/call/fail_param_type.carbon | 10 +- .../call/fail_return_type_mismatch.carbon | 12 +- .../check/testdata/function/call/i32.carbon | 28 +- .../function/call/more_param_ir.carbon | 36 +- .../testdata/function/call/params_one.carbon | 20 +- .../function/call/params_one_comma.carbon | 22 +- .../testdata/function/call/params_two.carbon | 28 +- .../function/call/params_two_comma.carbon | 32 +- .../call/prefer_unqualified_lookup.carbon | 34 +- .../declaration/fail_param_in_type.carbon | 14 +- .../declaration/fail_param_redecl.carbon | 14 +- .../function/declaration/import.carbon | 222 ++---- .../declaration/param_same_name.carbon | 14 +- .../function/definition/import.carbon | 64 +- .../function/definition/params_one.carbon | 10 +- .../definition/params_one_comma.carbon | 10 +- .../function/definition/params_two.carbon | 14 +- .../definition/params_two_comma.carbon | 14 +- .../testdata/function/generic/deduce.carbon | 165 ++-- .../generic/fail_todo_param_in_type.carbon | 56 +- .../function/generic/resolve_used.carbon | 39 +- .../function/generic/return_slot.carbon | 45 +- .../function/generic/undefined.carbon | 94 +-- toolchain/check/testdata/global/decl.carbon | 10 +- .../check/testdata/global/simple_init.carbon | 20 +- .../testdata/global/simple_with_fun.carbon | 24 +- .../if/fail_reachable_fallthrough.carbon | 34 +- toolchain/check/testdata/if/fail_scope.carbon | 28 +- .../if/unreachable_fallthrough.carbon | 24 +- toolchain/check/testdata/if_expr/basic.carbon | 52 +- .../if_expr/constant_condition.carbon | 82 +- .../testdata/if_expr/control_flow.carbon | 34 +- .../if_expr/fail_not_in_function.carbon | 18 +- .../if_expr/fail_partial_constant.carbon | 40 +- .../check/testdata/if_expr/nested.carbon | 52 +- .../check/testdata/if_expr/struct.carbon | 38 +- toolchain/check/testdata/impl/compound.carbon | 88 +-- .../check/testdata/impl/declaration.carbon | 12 +- toolchain/check/testdata/impl/empty.carbon | 12 +- .../testdata/impl/extend_impl_generic.carbon | 44 +- .../testdata/impl/fail_call_invalid.carbon | 56 +- .../impl/fail_extend_impl_scope.carbon | 12 +- .../impl/fail_extend_impl_type_as.carbon | 20 +- .../impl/fail_extend_non_interface.carbon | 16 +- .../impl/fail_impl_bad_assoc_fn.carbon | 52 +- .../impl/fail_impl_bad_interface.carbon | 16 +- .../testdata/impl/fail_redefinition.carbon | 18 +- .../impl/fail_self_type_mismatch.carbon | 18 +- .../lookup/fail_todo_undefined_impl.carbon | 14 +- .../impl/lookup/instance_method.carbon | 24 +- .../check/testdata/impl/redeclaration.carbon | 26 +- .../index/array_element_access.carbon | 64 +- .../check/testdata/index/expr_category.carbon | 110 ++- .../index/fail_array_large_index.carbon | 56 +- .../index/fail_array_non_int_indexing.carbon | 34 +- .../fail_array_out_of_bound_access.carbon | 38 +- .../testdata/index/fail_expr_category.carbon | 84 +-- .../testdata/index/fail_invalid_base.carbon | 30 +- .../testdata/index/fail_name_not_found.carbon | 10 +- .../index/fail_negative_indexing.carbon | 38 +- .../testdata/interface/assoc_const.carbon | 10 +- .../fail_assoc_const_bad_default.carbon | 4 +- .../fail_todo_assoc_const_default.carbon | 32 +- .../fail_todo_define_default_fn_inline.carbon | 18 +- ..._todo_define_default_fn_out_of_line.carbon | 30 +- .../testdata/interface/member_lookup.carbon | 38 +- .../interface/todo_define_not_default.carbon | 44 +- .../ir/duplicate_name_same_line.carbon | 28 +- .../testdata/let/compile_time_bindings.carbon | 120 ++- toolchain/check/testdata/let/convert.carbon | 60 +- .../testdata/let/fail_duplicate_decl.carbon | 28 +- .../check/testdata/let/fail_generic.carbon | 20 +- .../testdata/let/fail_generic_import.carbon | 12 +- .../testdata/let/fail_missing_value.carbon | 14 +- .../check/testdata/let/fail_modifiers.carbon | 62 +- .../testdata/let/fail_use_in_init.carbon | 10 +- toolchain/check/testdata/let/generic.carbon | 12 +- .../check/testdata/let/generic_import.carbon | 12 +- toolchain/check/testdata/let/global.carbon | 24 +- toolchain/check/testdata/let/local.carbon | 18 +- .../check/testdata/let/shadowed_decl.carbon | 28 +- .../testdata/namespace/add_to_import.carbon | 24 +- .../check/testdata/namespace/alias.carbon | 28 +- .../namespace/fail_decl_in_alias.carbon | 20 +- .../testdata/namespace/fail_params.carbon | 10 +- .../check/testdata/namespace/shadow.carbon | 30 +- .../operators/builtin/assignment.carbon | 84 +-- .../fail_and_or_not_in_function.carbon | 14 +- .../fail_assignment_to_non_assignable.carbon | 72 +- .../fail_redundant_compound_access.carbon | 32 +- .../fail_type_mismatch_assignment.carbon | 24 +- .../builtin/fail_type_mismatch_once.carbon | 10 +- .../builtin/fail_unimplemented_op.carbon | 10 +- .../testdata/operators/overloaded/eq.carbon | 10 +- .../operators/overloaded/implicit_as.carbon | 79 +- .../operators/overloaded/index.carbon | 104 +-- .../package_expr/fail_not_found.carbon | 10 +- .../check/testdata/package_expr/syntax.carbon | 64 +- .../fail_conflict_no_namespaces.carbon | 10 +- .../packages/fail_import_type_error.carbon | 20 +- .../packages/implicit_imports_prelude.carbon | 30 +- .../testdata/pointer/address_of_deref.carbon | 28 +- .../testdata/pointer/address_of_lvalue.carbon | 76 +- toolchain/check/testdata/pointer/basic.carbon | 32 +- .../pointer/fail_address_of_value.carbon | 28 +- .../testdata/pointer/fail_deref_error.carbon | 14 +- .../pointer/fail_deref_not_pointer.carbon | 10 +- .../testdata/pointer/fail_deref_type.carbon | 18 +- .../check/testdata/pointer/import.carbon | 34 +- .../testdata/pointer/nested_const.carbon | 14 +- toolchain/check/testdata/pointer/types.carbon | 22 +- .../testdata/return/code_after_return.carbon | 2 +- .../return/code_after_return_value.carbon | 20 +- .../testdata/return/fail_call_in_type.carbon | 12 +- .../return/fail_missing_return.carbon | 10 +- .../fail_return_var_no_returned_var.carbon | 10 +- .../fail_return_with_returned_var.carbon | 48 +- .../return/fail_returned_var_shadow.carbon | 68 +- .../return/fail_returned_var_type.carbon | 10 +- .../testdata/return/fail_type_mismatch.carbon | 10 +- .../testdata/return/fail_value_missing.carbon | 10 +- .../testdata/return/fail_var_in_type.carbon | 10 +- .../no_prelude/import_convert_function.carbon | 280 +++---- .../check/testdata/return/returned_var.carbon | 52 +- .../testdata/return/returned_var_scope.carbon | 60 +- toolchain/check/testdata/return/struct.carbon | 20 +- toolchain/check/testdata/return/tuple.carbon | 32 +- toolchain/check/testdata/return/value.carbon | 20 +- .../testdata/struct/fail_assign_empty.carbon | 10 +- .../struct/fail_duplicate_name.carbon | 50 +- .../struct/fail_field_name_mismatch.carbon | 14 +- .../struct/fail_field_type_mismatch.carbon | 10 +- .../struct/fail_member_access_type.carbon | 8 +- .../struct/fail_non_member_access.carbon | 24 +- .../struct/fail_too_few_values.carbon | 14 +- .../testdata/struct/fail_type_assign.carbon | 16 +- toolchain/check/testdata/struct/import.carbon | 166 ++--- .../struct/literal_member_access.carbon | 22 +- .../testdata/struct/member_access.carbon | 28 +- .../struct/nested_struct_in_place.carbon | 54 +- .../check/testdata/struct/one_entry.carbon | 24 +- .../testdata/struct/reorder_fields.carbon | 22 +- .../testdata/struct/tuple_as_element.carbon | 44 +- .../check/testdata/struct/two_entries.carbon | 56 +- .../tuple/access/element_access.carbon | 36 +- .../tuple/access/fail_access_error.carbon | 36 +- .../tuple/access/fail_large_index.carbon | 40 +- .../access/fail_negative_indexing.carbon | 38 +- .../access/fail_non_deterministic_type.carbon | 44 +- .../tuple/access/fail_non_int_indexing.carbon | 36 +- .../tuple/access/fail_non_tuple_access.carbon | 26 +- .../access/fail_out_of_bound_access.carbon | 36 +- .../fail_out_of_bound_not_literal.carbon | 36 +- .../tuple/access/index_not_literal.carbon | 90 +-- .../tuple/access/return_value_access.carbon | 32 +- .../testdata/tuple/fail_assign_nested.carbon | 32 +- .../tuple/fail_element_type_mismatch.carbon | 28 +- .../tuple/fail_nested_incomplete.carbon | 14 +- .../tuple/fail_too_few_element.carbon | 18 +- .../testdata/tuple/fail_type_assign.carbon | 20 +- toolchain/check/testdata/tuple/import.carbon | 206 +++-- .../check/testdata/tuple/nested_tuple.carbon | 44 +- .../tuple/nested_tuple_in_place.carbon | 98 +-- .../check/testdata/tuple/one_element.carbon | 32 +- .../check/testdata/tuple/two_elements.carbon | 72 +- .../testdata/where_expr/constraints.carbon | 20 +- .../testdata/where_expr/dot_self_index.carbon | 30 +- .../testdata/where_expr/equal_rewrite.carbon | 100 +-- .../testdata/where_expr/fail_not_facet.carbon | 12 +- .../testdata/where_expr/non_generic.carbon | 10 +- toolchain/diagnostics/diagnostic_emitter.h | 2 +- toolchain/lower/testdata/array/field.carbon | 16 +- .../testdata/array/function_param.carbon | 6 +- .../testdata/function/generic/call.carbon | 16 +- .../function/generic/call_method.carbon | 4 +- .../index/array_element_access.carbon | 12 +- .../testdata/struct/member_access.carbon | 4 +- .../tuple/access/element_access.carbon | 8 +- toolchain/sem_ir/file.cpp | 1 - toolchain/sem_ir/file.h | 2 +- toolchain/sem_ir/inst_namer.cpp | 12 +- toolchain/sem_ir/name_scope.cpp | 23 + toolchain/sem_ir/name_scope.h | 22 +- toolchain/sem_ir/stringify_type.cpp | 10 +- toolchain/sem_ir/type_info.cpp | 60 ++ toolchain/sem_ir/type_info.h | 36 + toolchain/sem_ir/typed_insts.h | 4 +- 339 files changed, 7580 insertions(+), 11363 deletions(-) rename core/prelude/types/{i32.carbon => int.carbon} (79%) create mode 100644 core/prelude/types/int_literal.carbon create mode 100644 core/prelude/types/uint.carbon diff --git a/bazel/carbon_rules/defs.bzl b/bazel/carbon_rules/defs.bzl index f83a3a73b1896..4a3361dd86a81 100644 --- a/bazel/carbon_rules/defs.bzl +++ b/bazel/carbon_rules/defs.bzl @@ -14,40 +14,42 @@ def _carbon_binary_impl(ctx): toolchain_driver = ctx.executable.internal_target_toolchain_driver toolchain_data = ctx.files.internal_target_toolchain_data + # Build object files for the prelude and for the binary itself. + # TODO: Eventually the prelude should be build as a separate `carbon_library`. + srcs_and_flags = [ + (ctx.files.prelude_srcs, ["--no-prelude-import"]), + (ctx.files.srcs, []), + ] objs = [] - for src in ctx.files.srcs: - # Build each source file. For now, we pass all sources to each compile - # because we don't have visibility into dependencies and have no way to - # specify multiple output files. Object code for each input is written - # into the output file in turn, so the final carbon source file - # specified ends up determining the contents of the object file. - # - # TODO: This is a hack; replace with something better once the toolchain - # supports doing so. - # - # TODO: Switch to the `prefix_root` based rule similar to linking when - # the prelude moves there. - out = ctx.actions.declare_file("_objs/{0}/{1}o".format( - ctx.label.name, - src.short_path.removeprefix(ctx.label.package).removesuffix(src.extension), - )) - objs.append(out) - srcs_reordered = [s for s in ctx.files.srcs if s != src] + [src] - ctx.actions.run( - outputs = [out], - inputs = srcs_reordered, - executable = toolchain_driver, - tools = depset(toolchain_data), - arguments = ["compile", "--output=" + out.path] + [s.path for s in srcs_reordered], - mnemonic = "CarbonCompile", - progress_message = "Compiling " + src.short_path, - ) + for (srcs, extra_flags) in srcs_and_flags: + for src in srcs: + # Build each source file. For now, we pass all sources to each compile + # because we don't have visibility into dependencies and have no way to + # specify multiple output files. Object code for each input is written + # into the output file in turn, so the final carbon source file + # specified ends up determining the contents of the object file. + # + # TODO: This is a hack; replace with something better once the toolchain + # supports doing so. + # + # TODO: Switch to the `prefix_root` based rule similar to linking when + # the prelude moves there. + out = ctx.actions.declare_file("_objs/{0}/{1}o".format( + ctx.label.name, + src.short_path.removeprefix(ctx.label.package).removesuffix(src.extension), + )) + objs.append(out) + srcs_reordered = [s for s in srcs if s != src] + [src] + ctx.actions.run( + outputs = [out], + inputs = srcs_reordered, + executable = toolchain_driver, + tools = depset(toolchain_data), + arguments = ["compile", "--output=" + out.path] + [s.path for s in srcs_reordered] + extra_flags, + mnemonic = "CarbonCompile", + progress_message = "Compiling " + src.short_path, + ) - # For now, we assume that the prelude doesn't produce any necessary object - # code, and don't include the .o files for //core/prelude... in the final - # linked binary. - # - # TODO: This will need to be revisited eventually. bin = ctx.actions.declare_file(ctx.label.name) ctx.actions.run( outputs = [bin], @@ -90,6 +92,7 @@ _carbon_binary_internal = rule( executable = True, cfg = "target", ), + "prelude_srcs": attr.label_list(allow_files = [".carbon"]), "srcs": attr.label_list(allow_files = [".carbon"]), }, executable = True, @@ -105,6 +108,7 @@ def carbon_binary(name, srcs): _carbon_binary_internal( name = name, srcs = srcs, + prelude_srcs = ["//core:prelude_files"], # We synthesize two sets of attributes from mirrored `select`s here # because we want to select on an internal property of these attributes diff --git a/core/BUILD b/core/BUILD index d46493959417d..4a1028d21de81 100644 --- a/core/BUILD +++ b/core/BUILD @@ -8,6 +8,7 @@ load("//bazel/manifest:defs.bzl", "manifest") filegroup( name = "prelude_files", srcs = ["prelude.carbon"] + glob(["prelude/**/*.carbon"]), + visibility = ["//visibility:public"], ) # A list of prelude inputs. diff --git a/core/prelude/operators/as.carbon b/core/prelude/operators/as.carbon index 03d365463d7d1..abf43896b31f6 100644 --- a/core/prelude/operators/as.carbon +++ b/core/prelude/operators/as.carbon @@ -4,10 +4,6 @@ package Core library "prelude/operators/as"; -// For Core.Int, used below. -// TODO: Remove this when the below `impl`s are removed. -import library "prelude/types"; - interface As(Dest:! type) { fn Convert[self: Self]() -> Dest; } @@ -16,38 +12,3 @@ interface ImplicitAs(Dest:! type) { // TODO: extend As(Dest); fn Convert[self: Self]() -> Dest; } - -// TODO: These impls should live with Core.Int, but currently that's a builtin -// not a class type, so there is no other library these can go in. -impl forall [N:! IntLiteral()] IntLiteral() as ImplicitAs(Int(N)) { - fn Convert[self: Self]() -> Int(N) = "int.convert_checked"; -} - -impl forall [N:! IntLiteral()] IntLiteral() as ImplicitAs(UInt(N)) { - fn Convert[self: Self]() -> UInt(N) = "int.convert_checked"; -} - -impl forall [N:! IntLiteral()] Int(N) as ImplicitAs(IntLiteral()) { - fn Convert[self: Self]() -> IntLiteral() = "int.convert_checked"; -} - -impl forall [N:! IntLiteral()] UInt(N) as ImplicitAs(IntLiteral()) { - fn Convert[self: Self]() -> IntLiteral() = "int.convert_checked"; -} - -// TODO: Remove these once ImplicitAs extends As. -impl forall [N:! IntLiteral()] IntLiteral() as As(Int(N)) { - fn Convert[self: Self]() -> Int(N) = "int.convert_checked"; -} - -impl forall [N:! IntLiteral()] IntLiteral() as As(UInt(N)) { - fn Convert[self: Self]() -> UInt(N) = "int.convert_checked"; -} - -impl forall [N:! IntLiteral()] Int(N) as As(IntLiteral()) { - fn Convert[self: Self]() -> IntLiteral() = "int.convert_checked"; -} - -impl forall [N:! IntLiteral()] UInt(N) as As(IntLiteral()) { - fn Convert[self: Self]() -> IntLiteral() = "int.convert_checked"; -} diff --git a/core/prelude/types.carbon b/core/prelude/types.carbon index bb4b9ebb9db21..9ca9edba894be 100644 --- a/core/prelude/types.carbon +++ b/core/prelude/types.carbon @@ -5,13 +5,8 @@ package Core library "prelude/types"; export import library "prelude/types/bool"; +export import library "prelude/types/int_literal"; +export import library "prelude/types/int"; +export import library "prelude/types/uint"; -// TODO: Start importing `prelude/types/i32` here once we stop eagerly importing -// all `impl`s from all imported files. Currently, this introduces too much -// noise in the toolchain tests. -// import library "prelude/types/i32"; - -fn IntLiteral() -> type = "int_literal.make_type"; -fn Int(size: IntLiteral()) -> type = "int.make_type_signed"; -fn UInt(size: IntLiteral()) -> type = "int.make_type_unsigned"; fn Float(size: IntLiteral()) -> type = "float.make_type"; diff --git a/core/prelude/types/i32.carbon b/core/prelude/types/int.carbon similarity index 79% rename from core/prelude/types/i32.carbon rename to core/prelude/types/int.carbon index 540ebc5733ca5..600a7cecf07c6 100644 --- a/core/prelude/types/i32.carbon +++ b/core/prelude/types/int.carbon @@ -2,12 +2,36 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -package Core library "prelude/types/i32"; +package Core library "prelude/types/int"; -// For Int(): -import library "prelude/types"; +import library "prelude/types/int_literal"; import library "prelude/operators"; +private fn MakeInt(size: IntLiteral()) -> type = "int.make_type_signed"; + +class Int(N:! IntLiteral()) { + adapt MakeInt(N); +} + +impl forall [N:! IntLiteral()] IntLiteral() as ImplicitAs(Int(N)) { + fn Convert[self: Self]() -> Int(N) = "int.convert_checked"; +} + +impl forall [N:! IntLiteral()] Int(N) as ImplicitAs(IntLiteral()) { + fn Convert[self: Self]() -> IntLiteral() = "int.convert_checked"; +} + +// TODO: Remove these once ImplicitAs extends As. +impl forall [N:! IntLiteral()] IntLiteral() as As(Int(N)) { + fn Convert[self: Self]() -> Int(N) = "int.convert_checked"; +} + +impl forall [N:! IntLiteral()] Int(N) as As(IntLiteral()) { + fn Convert[self: Self]() -> IntLiteral() = "int.convert_checked"; +} + +// TODO: Make these operations generic. + impl i32 as Add { fn Op[self: Self](other: Self) -> Self = "int.sadd"; } diff --git a/core/prelude/types/int_literal.carbon b/core/prelude/types/int_literal.carbon new file mode 100644 index 0000000000000..5391b3faba515 --- /dev/null +++ b/core/prelude/types/int_literal.carbon @@ -0,0 +1,7 @@ +// Part of the Carbon Language project, under the Apache License v2.0 with LLVM +// Exceptions. See /LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +package Core library "prelude/types/int_literal"; + +fn IntLiteral() -> type = "int_literal.make_type"; diff --git a/core/prelude/types/uint.carbon b/core/prelude/types/uint.carbon new file mode 100644 index 0000000000000..e5d236992aa93 --- /dev/null +++ b/core/prelude/types/uint.carbon @@ -0,0 +1,33 @@ +// Part of the Carbon Language project, under the Apache License v2.0 with LLVM +// Exceptions. See /LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +package Core library "prelude/types/uint"; + +import library "prelude/types/int_literal"; +import library "prelude/operators"; + +private fn MakeUInt(size: IntLiteral()) -> type = "int.make_type_unsigned"; + +class UInt(N:! IntLiteral()) { + adapt MakeUInt(N); +} + +impl forall [N:! IntLiteral()] IntLiteral() as ImplicitAs(UInt(N)) { + fn Convert[self: Self]() -> UInt(N) = "int.convert_checked"; +} + +impl forall [N:! IntLiteral()] UInt(N) as ImplicitAs(IntLiteral()) { + fn Convert[self: Self]() -> IntLiteral() = "int.convert_checked"; +} + +// TODO: Remove these once ImplicitAs extends As. +impl forall [N:! IntLiteral()] IntLiteral() as As(UInt(N)) { + fn Convert[self: Self]() -> UInt(N) = "int.convert_checked"; +} + +impl forall [N:! IntLiteral()] UInt(N) as As(IntLiteral()) { + fn Convert[self: Self]() -> IntLiteral() = "int.convert_checked"; +} + +// TODO: Operations. diff --git a/examples/sieve.carbon b/examples/sieve.carbon index efe6e7c9a64e2..c882d7581003b 100644 --- a/examples/sieve.carbon +++ b/examples/sieve.carbon @@ -4,85 +4,6 @@ // Compute and return the number of primes less than 1000. -// TODO: Copied from core/prelude/types/i32.carbon. -// Because we don't deduplicate interfaces, the implementations in that file are -// treated as implementing a different interface from the one we import above. -// Remove the following, once we deduplicate interfaces. - -impl i32 as Core.Add { - fn Op[self: Self](other: Self) -> Self = "int.sadd"; -} -impl i32 as Core.AddAssign { - fn Op[addr self: Self*](other: Self) { - *self = *self + other; - } -} -impl i32 as Core.Inc { - fn Op[addr self: Self*]() { - *self += 1; - } -} - -impl i32 as Core.Div { - fn Op[self: Self](other: Self) -> Self = "int.sdiv"; -} -impl i32 as Core.DivAssign { - fn Op[addr self: Self*](other: Self) { - *self = *self / other; - } -} - -impl i32 as Core.Eq { - fn Equal[self: Self](other: Self) -> bool = "int.eq"; - fn NotEqual[self: Self](other: Self) -> bool = "int.neq"; -} - -impl i32 as Core.Mod { - fn Op[self: Self](other: Self) -> Self = "int.smod"; -} -impl i32 as Core.ModAssign { - fn Op[addr self: Self*](other: Self) { - *self = *self % other; - } -} - -impl i32 as Core.Mul { - fn Op[self: Self](other: Self) -> Self = "int.smul"; -} -impl i32 as Core.MulAssign { - fn Op[addr self: Self*](other: Self) { - *self = *self * other; - } -} - -impl i32 as Core.Negate { - fn Op[self: Self]() -> Self = "int.snegate"; -} - -impl i32 as Core.Ordered { - // TODO: fn Compare - fn Less[self: Self](other: Self) -> bool = "int.less"; - fn LessOrEquivalent[self: Self](other: Self) -> bool = "int.less_eq"; - fn Greater[self: Self](other: Self) -> bool = "int.greater"; - fn GreaterOrEquivalent[self: Self](other: Self) -> bool = "int.greater_eq"; -} - -impl i32 as Core.Sub { - fn Op[self: Self](other: Self) -> Self = "int.ssub"; -} -impl i32 as Core.SubAssign { - fn Op[addr self: Self*](other: Self) { - *self = *self - other; - } -} -impl i32 as Core.Dec { - fn Op[addr self: Self*]() { - *self -= 1; - } -} - -// --- - class Sieve { fn Make() -> Sieve { returned var s: Sieve; diff --git a/toolchain/check/context.cpp b/toolchain/check/context.cpp index 3b1c43c268f27..40199304e6ce0 100644 --- a/toolchain/check/context.cpp +++ b/toolchain/check/context.cpp @@ -1261,8 +1261,9 @@ class TypeCompleter { }; } // namespace -auto Context::TryToCompleteType(SemIR::TypeId type_id, SemIRLoc loc) -> bool { - return TypeCompleter(*this, loc, nullptr).Complete(type_id); +auto Context::TryToCompleteType(SemIR::TypeId type_id, SemIRLoc loc, + BuildDiagnosticFn diagnoser) -> bool { + return TypeCompleter(*this, loc, diagnoser).Complete(type_id); } auto Context::CompleteTypeOrCheckFail(SemIR::TypeId type_id) -> void { diff --git a/toolchain/check/context.h b/toolchain/check/context.h index 500624f936a5d..f884db6dfe33e 100644 --- a/toolchain/check/context.h +++ b/toolchain/check/context.h @@ -344,8 +344,11 @@ class Context { // symbolic. // // Avoid calling this where possible, as it can lead to coherence issues. - // TODO: Remove the remaining call to this and delete this function. - auto TryToCompleteType(SemIR::TypeId type_id, SemIRLoc loc) -> bool; + // However, it's important that we use it during monomorphization, where we + // don't want to trigger a request for more monomorphization. + // TODO: Remove the other call to this function. + auto TryToCompleteType(SemIR::TypeId type_id, SemIRLoc loc, + BuildDiagnosticFn diagnoser = nullptr) -> bool; // Completes the type `type_id`. CHECK-fails if it can't be completed. auto CompleteTypeOrCheckFail(SemIR::TypeId type_id) -> void; diff --git a/toolchain/check/eval.cpp b/toolchain/check/eval.cpp index b70ac1d0dcd9b..489e34057c4f4 100644 --- a/toolchain/check/eval.cpp +++ b/toolchain/check/eval.cpp @@ -1803,19 +1803,16 @@ static auto TryEvalInstInContext(EvalContext& eval_context, // If the type is a template constant, require it to be complete now. if (phase == Phase::Template) { - // No location is needed here because we know the type is not a symbolic - // constant. - complete_type_id = eval_context.context().AsCompleteType( - complete_type_id, SemIR::LocId::Invalid, [&] { - CARBON_DIAGNOSTIC(IncompleteTypeInMonomorphization, Error, - "{0} evaluates to incomplete type {1}", - SemIR::TypeId, SemIR::TypeId); - return eval_context.emitter().Build( - eval_context.GetDiagnosticLoc(inst_id), - IncompleteTypeInMonomorphization, - require_complete.complete_type_id, complete_type_id); - }); - if (complete_type_id == SemIR::ErrorInst::SingletonTypeId) { + if (!eval_context.context().TryToCompleteType( + complete_type_id, eval_context.GetDiagnosticLoc(inst_id), [&] { + CARBON_DIAGNOSTIC(IncompleteTypeInMonomorphization, Error, + "{0} evaluates to incomplete type {1}", + SemIR::TypeId, SemIR::TypeId); + return eval_context.emitter().Build( + eval_context.GetDiagnosticLoc(inst_id), + IncompleteTypeInMonomorphization, + require_complete.complete_type_id, complete_type_id); + })) { return SemIR::ErrorInst::SingletonConstantId; } return MakeConstantResult( diff --git a/toolchain/check/import_ref.cpp b/toolchain/check/import_ref.cpp index 6b317a0a7b6d5..fbc0cf0dcdf17 100644 --- a/toolchain/check/import_ref.cpp +++ b/toolchain/check/import_ref.cpp @@ -2292,8 +2292,12 @@ static auto TryResolveTypedInst(ImportRefResolver& resolver, SemIR::InstId import_inst_id) -> ResolveResult { const auto& name_scope = resolver.import_name_scopes().Get(inst.name_scope_id); + // A package from a different file becomes a child of the package here, as it + // would be if it were imported. auto parent_scope_id = - GetLocalNameScopeId(resolver, name_scope.parent_scope_id()); + inst.name_scope_id == SemIR::NameScopeId::Package + ? SemIR::NameScopeId::Package + : GetLocalNameScopeId(resolver, name_scope.parent_scope_id()); if (resolver.HasNewWork()) { return ResolveResult::Retry(); @@ -2312,6 +2316,11 @@ static auto TryResolveTypedInst(ImportRefResolver& resolver, auto name_id = GetLocalNameId(resolver, name_scope.name_id()); namespace_decl.name_scope_id = resolver.local_name_scopes().Add(inst_id, name_id, parent_scope_id); + // Namespaces from this package are eagerly imported, so anything we load here + // must be a closed import. + resolver.local_name_scopes() + .Get(namespace_decl.name_scope_id) + .set_is_closed_import(true); resolver.local_context().ReplaceInstBeforeConstantUse(inst_id, namespace_decl); return {.const_id = resolver.local_constant_values().Get(inst_id)}; diff --git a/toolchain/check/testdata/alias/fail_builtins.carbon b/toolchain/check/testdata/alias/fail_builtins.carbon index 62aabfe2fe076..b643a8cce065a 100644 --- a/toolchain/check/testdata/alias/fail_builtins.carbon +++ b/toolchain/check/testdata/alias/fail_builtins.carbon @@ -23,9 +23,7 @@ alias b = bool; // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %Bool.type: type = fn_type @Bool [template] // CHECK:STDOUT: %Bool: %Bool.type = struct_value () [template] // CHECK:STDOUT: } @@ -33,7 +31,7 @@ alias b = bool; // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .Bool = %import_ref.2 +// CHECK:STDOUT: .Bool = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -47,7 +45,7 @@ alias b = bool; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a: = bind_alias a, [template = ] // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %b: = bind_alias b, [template = ] diff --git a/toolchain/check/testdata/array/array_in_place.carbon b/toolchain/check/testdata/array/array_in_place.carbon index 5db589b566ee6..55fe9f4468aa1 100644 --- a/toolchain/check/testdata/array/array_in_place.carbon +++ b/toolchain/check/testdata/array/array_in_place.carbon @@ -18,9 +18,7 @@ fn G() { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (type, type, type) [template] // CHECK:STDOUT: %tuple.type.2: type = tuple_type (%i32, %i32, %i32) [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] @@ -36,7 +34,7 @@ fn G() { // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -54,19 +52,13 @@ fn G() { // CHECK:STDOUT: %return.param_patt: %tuple.type.2 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc11_12: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11_12: init type = call constants.%Int(%int_32.loc11_12) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc11_12: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc11_17: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11_17: init type = call constants.%Int(%int_32.loc11_17) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc11_17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc11_22: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11_22: init type = call constants.%Int(%int_32.loc11_22) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_25.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc11_12, %int.make_type_signed.loc11_17, %int.make_type_signed.loc11_22) -// CHECK:STDOUT: %.loc11_25.2: type = value_of_initializer %int.make_type_signed.loc11_12 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_25.3: type = converted %int.make_type_signed.loc11_12, %.loc11_25.2 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_25.4: type = value_of_initializer %int.make_type_signed.loc11_17 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_25.5: type = converted %int.make_type_signed.loc11_17, %.loc11_25.4 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_25.6: type = value_of_initializer %int.make_type_signed.loc11_22 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_25.7: type = converted %int.make_type_signed.loc11_22, %.loc11_25.6 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_25.8: type = converted %.loc11_25.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] +// CHECK:STDOUT: %i32.loc11_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_25.1: %tuple.type.1 = tuple_literal (%i32.loc11_12, %i32.loc11_17, %i32.loc11_22) +// CHECK:STDOUT: %.loc11_25.2: type = converted %.loc11_25.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %return.param: ref %tuple.type.2 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %tuple.type.2 = return_slot %return.param // CHECK:STDOUT: } @@ -78,20 +70,14 @@ fn G() { // CHECK:STDOUT: fn @G() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_32.loc14_12: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc14_12: init type = call constants.%Int(%int_32.loc14_12) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc14_12: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc14_17: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc14_17: init type = call constants.%Int(%int_32.loc14_17) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc14_17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc14_22: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc14_22: init type = call constants.%Int(%int_32.loc14_22) [template = constants.%i32] -// CHECK:STDOUT: %.loc14_25.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc14_12, %int.make_type_signed.loc14_17, %int.make_type_signed.loc14_22) +// CHECK:STDOUT: %i32.loc14_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc14_25.1: %tuple.type.1 = tuple_literal (%i32.loc14_12, %i32.loc14_17, %i32.loc14_22) // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2] -// CHECK:STDOUT: %.loc14_25.2: type = value_of_initializer %int.make_type_signed.loc14_12 [template = constants.%i32] -// CHECK:STDOUT: %.loc14_25.3: type = converted %int.make_type_signed.loc14_12, %.loc14_25.2 [template = constants.%i32] -// CHECK:STDOUT: %.loc14_25.4: type = value_of_initializer %int.make_type_signed.loc14_17 [template = constants.%i32] -// CHECK:STDOUT: %.loc14_25.5: type = converted %int.make_type_signed.loc14_17, %.loc14_25.4 [template = constants.%i32] -// CHECK:STDOUT: %.loc14_25.6: type = value_of_initializer %int.make_type_signed.loc14_22 [template = constants.%i32] -// CHECK:STDOUT: %.loc14_25.7: type = converted %int.make_type_signed.loc14_22, %.loc14_25.6 [template = constants.%i32] -// CHECK:STDOUT: %.loc14_25.8: type = converted %.loc14_25.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] +// CHECK:STDOUT: %.loc14_25.2: type = converted %.loc14_25.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %array_type: type = array_type %int_2, %tuple.type.2 [template = constants.%array_type] // CHECK:STDOUT: %v.var: ref %array_type = var v // CHECK:STDOUT: %v: ref %array_type = bind_name v, %v.var diff --git a/toolchain/check/testdata/array/array_vs_tuple.carbon b/toolchain/check/testdata/array/array_vs_tuple.carbon index a86251521fdea..1b616884bac3d 100644 --- a/toolchain/check/testdata/array/array_vs_tuple.carbon +++ b/toolchain/check/testdata/array/array_vs_tuple.carbon @@ -20,9 +20,7 @@ fn G() { // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %int_3.1: Core.IntLiteral = int_value 3 [template] // CHECK:STDOUT: %array_type: type = array_type %int_3.1, %i32 [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] @@ -30,16 +28,16 @@ fn G() { // CHECK:STDOUT: %tuple.type.1: type = tuple_type (Core.IntLiteral, Core.IntLiteral, Core.IntLiteral) [template] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] -// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_3.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_3.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_3.2: %i32 = int_value 3 [template] // CHECK:STDOUT: %array: %array_type = tuple_value (%int_1.2, %int_2.2, %int_3.2) [template] @@ -51,7 +49,7 @@ fn G() { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -69,10 +67,8 @@ fn G() { // CHECK:STDOUT: fn @G() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_32.loc13: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc13: init type = call constants.%Int(%int_32.loc13) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc13: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_3.loc13_16: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] -// CHECK:STDOUT: %.loc13_11.1: type = value_of_initializer %int.make_type_signed.loc13 [template = constants.%i32] -// CHECK:STDOUT: %.loc13_11.2: type = converted %int.make_type_signed.loc13, %.loc13_11.1 [template = constants.%i32] // CHECK:STDOUT: %array_type: type = array_type %int_3.loc13_16, %i32 [template = constants.%array_type] // CHECK:STDOUT: %a.var: ref %array_type = var a // CHECK:STDOUT: %a: ref %array_type = bind_name a, %a.var @@ -80,7 +76,7 @@ fn G() { // CHECK:STDOUT: %int_2.loc13_25: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %int_3.loc13_28: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] // CHECK:STDOUT: %.loc13_29.1: %tuple.type.1 = tuple_literal (%int_1.loc13_22, %int_2.loc13_25, %int_3.loc13_28) -// CHECK:STDOUT: %impl.elem0.loc13_29.1: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc13_29.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc13_29.1: = bound_method %int_1.loc13_22, %impl.elem0.loc13_29.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc13_29.1: = specific_function %Convert.bound.loc13_29.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc13_29.1: init %i32 = call %Convert.specific_fn.loc13_29.1(%int_1.loc13_22) [template = constants.%int_1.2] @@ -88,7 +84,7 @@ fn G() { // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0] // CHECK:STDOUT: %.loc13_29.3: ref %i32 = array_index %a.var, %int_0 // CHECK:STDOUT: %.loc13_29.4: init %i32 = initialize_from %.loc13_29.2 to %.loc13_29.3 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc13_29.2: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc13_29.2: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc13_29.2: = bound_method %int_2.loc13_25, %impl.elem0.loc13_29.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc13_29.2: = specific_function %Convert.bound.loc13_29.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc13_29.2: init %i32 = call %Convert.specific_fn.loc13_29.2(%int_2.loc13_25) [template = constants.%int_2.2] @@ -96,7 +92,7 @@ fn G() { // CHECK:STDOUT: %int_1.loc13_29: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %.loc13_29.6: ref %i32 = array_index %a.var, %int_1.loc13_29 // CHECK:STDOUT: %.loc13_29.7: init %i32 = initialize_from %.loc13_29.5 to %.loc13_29.6 [template = constants.%int_2.2] -// CHECK:STDOUT: %impl.elem0.loc13_29.3: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc13_29.3: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc13_29.3: = bound_method %int_3.loc13_28, %impl.elem0.loc13_29.3 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc13_29.3: = specific_function %Convert.bound.loc13_29.3, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc13_29.3: init %i32 = call %Convert.specific_fn.loc13_29.3(%int_3.loc13_28) [template = constants.%int_3.2] @@ -108,40 +104,34 @@ fn G() { // CHECK:STDOUT: %.loc13_30: init %array_type = converted %.loc13_29.1, %.loc13_29.11 [template = constants.%array] // CHECK:STDOUT: assign %a.var, %.loc13_30 // CHECK:STDOUT: %int_32.loc14_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc14_11: init type = call constants.%Int(%int_32.loc14_11) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc14_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc14_16: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc14_16: init type = call constants.%Int(%int_32.loc14_16) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc14_16: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc14_21: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc14_21: init type = call constants.%Int(%int_32.loc14_21) [template = constants.%i32] -// CHECK:STDOUT: %.loc14_24.1: %tuple.type.2 = tuple_literal (%int.make_type_signed.loc14_11, %int.make_type_signed.loc14_16, %int.make_type_signed.loc14_21) -// CHECK:STDOUT: %.loc14_24.2: type = value_of_initializer %int.make_type_signed.loc14_11 [template = constants.%i32] -// CHECK:STDOUT: %.loc14_24.3: type = converted %int.make_type_signed.loc14_11, %.loc14_24.2 [template = constants.%i32] -// CHECK:STDOUT: %.loc14_24.4: type = value_of_initializer %int.make_type_signed.loc14_16 [template = constants.%i32] -// CHECK:STDOUT: %.loc14_24.5: type = converted %int.make_type_signed.loc14_16, %.loc14_24.4 [template = constants.%i32] -// CHECK:STDOUT: %.loc14_24.6: type = value_of_initializer %int.make_type_signed.loc14_21 [template = constants.%i32] -// CHECK:STDOUT: %.loc14_24.7: type = converted %int.make_type_signed.loc14_21, %.loc14_24.6 [template = constants.%i32] -// CHECK:STDOUT: %.loc14_24.8: type = converted %.loc14_24.1, constants.%tuple.type.3 [template = constants.%tuple.type.3] +// CHECK:STDOUT: %i32.loc14_21: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc14_24.1: %tuple.type.2 = tuple_literal (%i32.loc14_11, %i32.loc14_16, %i32.loc14_21) +// CHECK:STDOUT: %.loc14_24.2: type = converted %.loc14_24.1, constants.%tuple.type.3 [template = constants.%tuple.type.3] // CHECK:STDOUT: %b.var: ref %tuple.type.3 = var b // CHECK:STDOUT: %b: ref %tuple.type.3 = bind_name b, %b.var // CHECK:STDOUT: %int_1.loc14: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_2.loc14: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %int_3.loc14: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] // CHECK:STDOUT: %.loc14_36.1: %tuple.type.1 = tuple_literal (%int_1.loc14, %int_2.loc14, %int_3.loc14) -// CHECK:STDOUT: %impl.elem0.loc14_36.1: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc14_36.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc14_36.1: = bound_method %int_1.loc14, %impl.elem0.loc14_36.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc14_36.1: = specific_function %Convert.bound.loc14_36.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc14_36.1: init %i32 = call %Convert.specific_fn.loc14_36.1(%int_1.loc14) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc14_36.2: init %i32 = converted %int_1.loc14, %int.convert_checked.loc14_36.1 [template = constants.%int_1.2] // CHECK:STDOUT: %tuple.elem0: ref %i32 = tuple_access %b.var, element0 // CHECK:STDOUT: %.loc14_36.3: init %i32 = initialize_from %.loc14_36.2 to %tuple.elem0 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc14_36.2: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc14_36.2: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc14_36.2: = bound_method %int_2.loc14, %impl.elem0.loc14_36.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc14_36.2: = specific_function %Convert.bound.loc14_36.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc14_36.2: init %i32 = call %Convert.specific_fn.loc14_36.2(%int_2.loc14) [template = constants.%int_2.2] // CHECK:STDOUT: %.loc14_36.4: init %i32 = converted %int_2.loc14, %int.convert_checked.loc14_36.2 [template = constants.%int_2.2] // CHECK:STDOUT: %tuple.elem1: ref %i32 = tuple_access %b.var, element1 // CHECK:STDOUT: %.loc14_36.5: init %i32 = initialize_from %.loc14_36.4 to %tuple.elem1 [template = constants.%int_2.2] -// CHECK:STDOUT: %impl.elem0.loc14_36.3: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc14_36.3: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc14_36.3: = bound_method %int_3.loc14, %impl.elem0.loc14_36.3 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc14_36.3: = specific_function %Convert.bound.loc14_36.3, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc14_36.3: init %i32 = call %Convert.specific_fn.loc14_36.3(%int_3.loc14) [template = constants.%int_3.2] diff --git a/toolchain/check/testdata/array/assign_return_value.carbon b/toolchain/check/testdata/array/assign_return_value.carbon index 8d75c49cdef79..93be65ea45e90 100644 --- a/toolchain/check/testdata/array/assign_return_value.carbon +++ b/toolchain/check/testdata/array/assign_return_value.carbon @@ -18,9 +18,7 @@ fn Run() { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (type) [template] // CHECK:STDOUT: %tuple.type.2: type = tuple_type (%i32) [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] @@ -28,10 +26,10 @@ fn Run() { // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %tuple.type.3: type = tuple_type (Core.IntLiteral) [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] // CHECK:STDOUT: %tuple: %tuple.type.2 = tuple_value (%int_0.2) [template] @@ -44,7 +42,7 @@ fn Run() { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -62,11 +60,9 @@ fn Run() { // CHECK:STDOUT: %return.param_patt: %tuple.type.2 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_16.1: %tuple.type.1 = tuple_literal (%int.make_type_signed) -// CHECK:STDOUT: %.loc11_16.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc11_16.3: type = converted %int.make_type_signed, %.loc11_16.2 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_16.4: type = converted %.loc11_16.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_16.1: %tuple.type.1 = tuple_literal (%i32) +// CHECK:STDOUT: %.loc11_16.2: type = converted %.loc11_16.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %return.param: ref %tuple.type.2 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %tuple.type.2 = return_slot %return.param // CHECK:STDOUT: } @@ -77,7 +73,7 @@ fn Run() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %.loc11_30.1: %tuple.type.3 = tuple_literal (%int_0) -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.2] @@ -91,10 +87,8 @@ fn Run() { // CHECK:STDOUT: fn @Run() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1] -// CHECK:STDOUT: %.loc14_11.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc14_11.2: type = converted %int.make_type_signed, %.loc14_11.1 [template = constants.%i32] // CHECK:STDOUT: %array_type: type = array_type %int_1, %i32 [template = constants.%array_type] // CHECK:STDOUT: %t.var: ref %array_type = var t // CHECK:STDOUT: %t: ref %array_type = bind_name t, %t.var diff --git a/toolchain/check/testdata/array/assign_var.carbon b/toolchain/check/testdata/array/assign_var.carbon index d92779d5dd3a9..5e6e03639d01c 100644 --- a/toolchain/check/testdata/array/assign_var.carbon +++ b/toolchain/check/testdata/array/assign_var.carbon @@ -15,9 +15,7 @@ var b: [i32; 3] = a; // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (type, type, type) [template] // CHECK:STDOUT: %tuple.type.2: type = tuple_type (%i32, %i32, %i32) [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] @@ -25,16 +23,16 @@ var b: [i32; 3] = a; // CHECK:STDOUT: %int_3.1: Core.IntLiteral = int_value 3 [template] // CHECK:STDOUT: %tuple.type.3: type = tuple_type (Core.IntLiteral, Core.IntLiteral, Core.IntLiteral) [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] -// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_3.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_3.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_3.2: %i32 = int_value 3 [template] // CHECK:STDOUT: %tuple: %tuple.type.2 = tuple_value (%int_1.2, %int_2.2, %int_3.2) [template] @@ -45,7 +43,7 @@ var b: [i32; 3] = a; // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -59,26 +57,18 @@ var b: [i32; 3] = a; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int_32.loc11_9: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11_9: init type = call constants.%Int(%int_32.loc11_9) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc11_9: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc11_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11_14: init type = call constants.%Int(%int_32.loc11_14) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc11_14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc11_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11_19: init type = call constants.%Int(%int_32.loc11_19) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_22.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc11_9, %int.make_type_signed.loc11_14, %int.make_type_signed.loc11_19) -// CHECK:STDOUT: %.loc11_22.2: type = value_of_initializer %int.make_type_signed.loc11_9 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_22.3: type = converted %int.make_type_signed.loc11_9, %.loc11_22.2 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_22.4: type = value_of_initializer %int.make_type_signed.loc11_14 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_22.5: type = converted %int.make_type_signed.loc11_14, %.loc11_22.4 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_22.6: type = value_of_initializer %int.make_type_signed.loc11_19 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_22.7: type = converted %int.make_type_signed.loc11_19, %.loc11_22.6 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_22.8: type = converted %.loc11_22.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] +// CHECK:STDOUT: %i32.loc11_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_22.1: %tuple.type.1 = tuple_literal (%i32.loc11_9, %i32.loc11_14, %i32.loc11_19) +// CHECK:STDOUT: %.loc11_22.2: type = converted %.loc11_22.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %a.var: ref %tuple.type.2 = var a // CHECK:STDOUT: %a: ref %tuple.type.2 = bind_name a, %a.var // CHECK:STDOUT: %int_32.loc12: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc12: init type = call constants.%Int(%int_32.loc12) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc12: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] -// CHECK:STDOUT: %.loc12_9.1: type = value_of_initializer %int.make_type_signed.loc12 [template = constants.%i32] -// CHECK:STDOUT: %.loc12_9.2: type = converted %int.make_type_signed.loc12, %.loc12_9.1 [template = constants.%i32] // CHECK:STDOUT: %array_type: type = array_type %int_3, %i32 [template = constants.%array_type] // CHECK:STDOUT: %b.var: ref %array_type = var b // CHECK:STDOUT: %b: ref %array_type = bind_name b, %b.var @@ -90,21 +80,21 @@ var b: [i32; 3] = a; // CHECK:STDOUT: %int_2.loc11: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] // CHECK:STDOUT: %.loc11_34.1: %tuple.type.3 = tuple_literal (%int_1.loc11, %int_2.loc11, %int_3) -// CHECK:STDOUT: %impl.elem0.loc11_34.1: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc11_34.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_34.1: = bound_method %int_1.loc11, %impl.elem0.loc11_34.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc11_34.1: = specific_function %Convert.bound.loc11_34.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc11_34.1: init %i32 = call %Convert.specific_fn.loc11_34.1(%int_1.loc11) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc11_34.2: init %i32 = converted %int_1.loc11, %int.convert_checked.loc11_34.1 [template = constants.%int_1.2] // CHECK:STDOUT: %tuple.elem0.loc11: ref %i32 = tuple_access file.%a.var, element0 // CHECK:STDOUT: %.loc11_34.3: init %i32 = initialize_from %.loc11_34.2 to %tuple.elem0.loc11 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc11_34.2: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc11_34.2: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_34.2: = bound_method %int_2.loc11, %impl.elem0.loc11_34.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc11_34.2: = specific_function %Convert.bound.loc11_34.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc11_34.2: init %i32 = call %Convert.specific_fn.loc11_34.2(%int_2.loc11) [template = constants.%int_2.2] // CHECK:STDOUT: %.loc11_34.4: init %i32 = converted %int_2.loc11, %int.convert_checked.loc11_34.2 [template = constants.%int_2.2] // CHECK:STDOUT: %tuple.elem1.loc11: ref %i32 = tuple_access file.%a.var, element1 // CHECK:STDOUT: %.loc11_34.5: init %i32 = initialize_from %.loc11_34.4 to %tuple.elem1.loc11 [template = constants.%int_2.2] -// CHECK:STDOUT: %impl.elem0.loc11_34.3: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc11_34.3: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_34.3: = bound_method %int_3, %impl.elem0.loc11_34.3 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc11_34.3: = specific_function %Convert.bound.loc11_34.3, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc11_34.3: init %i32 = call %Convert.specific_fn.loc11_34.3(%int_3) [template = constants.%int_3.2] diff --git a/toolchain/check/testdata/array/base.carbon b/toolchain/check/testdata/array/base.carbon index c398b4bf4dc82..21002ef401a59 100644 --- a/toolchain/check/testdata/array/base.carbon +++ b/toolchain/check/testdata/array/base.carbon @@ -16,19 +16,17 @@ var c: [(); 5] = ((), (), (), (), (),); // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %array_type.1: type = array_type %int_1.1, %i32 [template] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (Core.IntLiteral) [template] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] // CHECK:STDOUT: %array.1: %array_type.1 = tuple_value (%int_1.2) [template] @@ -53,8 +51,8 @@ var c: [(); 5] = ((), (), (), (), (),); // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 -// CHECK:STDOUT: .Float = %import_ref.38 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 +// CHECK:STDOUT: .Float = %import_ref.193 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -69,10 +67,8 @@ var c: [(); 5] = ((), (), (), (), (),); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %.loc11_9.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc11_9.2: type = converted %int.make_type_signed, %.loc11_9.1 [template = constants.%i32] // CHECK:STDOUT: %array_type.loc11: type = array_type %int_1, %i32 [template = constants.%array_type.1] // CHECK:STDOUT: %a.var: ref %array_type.1 = var a // CHECK:STDOUT: %a: ref %array_type.1 = bind_name a, %a.var @@ -96,7 +92,7 @@ var c: [(); 5] = ((), (), (), (), (),); // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_1.loc11: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %.loc11_22.1: %tuple.type.1 = tuple_literal (%int_1.loc11) -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1.loc11, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_1.loc11) [template = constants.%int_1.2] diff --git a/toolchain/check/testdata/array/canonicalize_index.carbon b/toolchain/check/testdata/array/canonicalize_index.carbon index 77c5ea3a44267..ede43d291df3b 100644 --- a/toolchain/check/testdata/array/canonicalize_index.carbon +++ b/toolchain/check/testdata/array/canonicalize_index.carbon @@ -19,56 +19,52 @@ let c: [i32; ConvertToU32(3)]* = &a; // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] -// CHECK:STDOUT: %Add.type: type = fn_type @Add [template] -// CHECK:STDOUT: %Add: %Add.type = struct_value () [template] -// CHECK:STDOUT: %UInt.type: type = fn_type @UInt [template] -// CHECK:STDOUT: %UInt: %UInt.type = struct_value () [template] -// CHECK:STDOUT: %u32: type = int_type unsigned, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] +// CHECK:STDOUT: %Add.type.1: type = fn_type @Add.1 [template] +// CHECK:STDOUT: %Add: %Add.type.1 = struct_value () [template] +// CHECK:STDOUT: %u32: type = class_type @UInt, @UInt(%int_32) [template] // CHECK:STDOUT: %ConvertToU32.type: type = fn_type @ConvertToU32 [template] // CHECK:STDOUT: %ConvertToU32: %ConvertToU32.type = struct_value () [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] // CHECK:STDOUT: %int_3.1: %i32 = int_value 3 [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.4, @impl.3(%int_32) [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %interface.10: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_3.1, %Convert.15 [template] -// CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.4(%int_32) [template] +// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.3, @impl.2(%int_32) [template] +// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [template] +// CHECK:STDOUT: %interface.6: = interface_witness (%Convert.11) [template] +// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_3.1, %Convert.11 [template] +// CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.3(%int_32) [template] // CHECK:STDOUT: %int_3.2: Core.IntLiteral = int_value 3 [template] // CHECK:STDOUT: %array_type: type = array_type %int_3.2, %i32 [template] // CHECK:STDOUT: %ptr: type = ptr_type %array_type [template] // CHECK:STDOUT: %tuple.type: type = tuple_type (Core.IntLiteral, Core.IntLiteral, Core.IntLiteral) [template] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template] -// CHECK:STDOUT: %Convert.bound.4: = bound_method %int_3.2, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.4: = bound_method %int_3.2, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.4: = specific_function %Convert.bound.4, @Convert.2(%int_32) [template] // CHECK:STDOUT: %array: %array_type = tuple_value (%int_1.2, %int_2.2, %int_3.1) [template] // CHECK:STDOUT: %int_3.3: %u32 = int_value 3 [template] -// CHECK:STDOUT: %Convert.type.16: type = fn_type @Convert.5, @impl.4(%int_32) [template] +// CHECK:STDOUT: %Convert.type.16: type = fn_type @Convert.8, @impl.32(%int_32) [template] // CHECK:STDOUT: %Convert.16: %Convert.type.16 = struct_value () [template] // CHECK:STDOUT: %interface.11: = interface_witness (%Convert.16) [template] // CHECK:STDOUT: %Convert.bound.5: = bound_method %int_3.3, %Convert.16 [template] -// CHECK:STDOUT: %Convert.specific_fn.5: = specific_function %Convert.bound.5, @Convert.5(%int_32) [template] +// CHECK:STDOUT: %Convert.specific_fn.5: = specific_function %Convert.bound.5, @Convert.8(%int_32) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .UInt = %import_ref.2 -// CHECK:STDOUT: .ImplicitAs = %import_ref.3 +// CHECK:STDOUT: .UInt = %import_ref.5 +// CHECK:STDOUT: .ImplicitAs = %import_ref.9 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -84,7 +80,7 @@ let c: [i32; ConvertToU32(3)]* = &a; // CHECK:STDOUT: .c = @__global_init.%c // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Add.decl: %Add.type = fn_decl @Add [template = constants.%Add] { +// CHECK:STDOUT: %Add.decl: %Add.type.1 = fn_decl @Add.1 [template = constants.%Add] { // CHECK:STDOUT: %a.patt: %i32 = binding_pattern a // CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: %i32 = binding_pattern b @@ -93,17 +89,11 @@ let c: [i32; ConvertToU32(3)]* = &a; // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc11_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11_11: init type = call constants.%Int(%int_32.loc11_11) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %int.make_type_signed.loc11_11 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_11.2: type = converted %int.make_type_signed.loc11_11, %.loc11_11.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc11_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc11_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11_19: init type = call constants.%Int(%int_32.loc11_19) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_19.1: type = value_of_initializer %int.make_type_signed.loc11_19 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_19.2: type = converted %int.make_type_signed.loc11_19, %.loc11_19.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc11_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc11_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11_27: init type = call constants.%Int(%int_32.loc11_27) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_27.1: type = value_of_initializer %int.make_type_signed.loc11_27 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_27.2: type = converted %int.make_type_signed.loc11_27, %.loc11_27.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc11_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 @@ -118,41 +108,35 @@ let c: [i32; ConvertToU32(3)]* = &a; // CHECK:STDOUT: %return.param_patt: %u32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc12_20: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32.loc12_20) [template = constants.%i32] -// CHECK:STDOUT: %.loc12_20.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc12_20.2: type = converted %int.make_type_signed, %.loc12_20.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc12_28: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_unsigned: init type = call constants.%UInt(%int_32.loc12_28) [template = constants.%u32] -// CHECK:STDOUT: %.loc12_28.1: type = value_of_initializer %int.make_type_unsigned [template = constants.%u32] -// CHECK:STDOUT: %.loc12_28.2: type = converted %int.make_type_unsigned, %.loc12_28.1 [template = constants.%u32] +// CHECK:STDOUT: %u32: type = class_type @UInt, @UInt(constants.%int_32) [template = constants.%u32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %u32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %u32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %int_32.loc14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc14: init type = call constants.%Int(%int_32.loc14) [template = constants.%i32] -// CHECK:STDOUT: %Add.ref: %Add.type = name_ref Add, %Add.decl [template = constants.%Add] +// CHECK:STDOUT: %i32.loc14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %Add.ref: %Add.type.1 = name_ref Add, %Add.decl [template = constants.%Add] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %impl.elem0.loc14_18: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc14_18: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc14_18: = bound_method %int_1, %impl.elem0.loc14_18 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc14_18: = specific_function %Convert.bound.loc14_18, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc14_18: init %i32 = call %Convert.specific_fn.loc14_18(%int_1) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc14_18.1: %i32 = value_of_initializer %int.convert_checked.loc14_18 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc14_18.2: %i32 = converted %int_1, %.loc14_18.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc14_21: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc14_21: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc14_21: = bound_method %int_2, %impl.elem0.loc14_21 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc14_21: = specific_function %Convert.bound.loc14_21, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc14_21: init %i32 = call %Convert.specific_fn.loc14_21(%int_2) [template = constants.%int_2.2] // CHECK:STDOUT: %.loc14_21.1: %i32 = value_of_initializer %int.convert_checked.loc14_21 [template = constants.%int_2.2] // CHECK:STDOUT: %.loc14_21.2: %i32 = converted %int_2, %.loc14_21.1 [template = constants.%int_2.2] // CHECK:STDOUT: %int.sadd: init %i32 = call %Add.ref(%.loc14_18.2, %.loc14_21.2) [template = constants.%int_3.1] -// CHECK:STDOUT: %.loc14_9.1: type = value_of_initializer %int.make_type_signed.loc14 [template = constants.%i32] -// CHECK:STDOUT: %.loc14_9.2: type = converted %int.make_type_signed.loc14, %.loc14_9.1 [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc14_22: %Convert.type.6 = interface_witness_access constants.%interface.10, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %impl.elem0.loc14_22: %Convert.type.5 = interface_witness_access constants.%interface.6, element0 [template = constants.%Convert.11] // CHECK:STDOUT: %Convert.bound.loc14_22: = bound_method %int.sadd, %impl.elem0.loc14_22 [template = constants.%Convert.bound.3] -// CHECK:STDOUT: %Convert.specific_fn.loc14_22: = specific_function %Convert.bound.loc14_22, @Convert.4(constants.%int_32) [template = constants.%Convert.specific_fn.3] +// CHECK:STDOUT: %Convert.specific_fn.loc14_22: = specific_function %Convert.bound.loc14_22, @Convert.3(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %.loc14_22.1: %i32 = value_of_initializer %int.sadd [template = constants.%int_3.1] // CHECK:STDOUT: %.loc14_22.2: %i32 = converted %int.sadd, %.loc14_22.1 [template = constants.%int_3.1] // CHECK:STDOUT: %int.convert_checked.loc14_22: init Core.IntLiteral = call %Convert.specific_fn.loc14_22(%.loc14_22.2) [template = constants.%int_3.2] @@ -162,28 +146,24 @@ let c: [i32; ConvertToU32(3)]* = &a; // CHECK:STDOUT: %a.var: ref %array_type = var a // CHECK:STDOUT: %a: ref %array_type = bind_name a, %a.var // CHECK:STDOUT: %int_32.loc15: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc15: init type = call constants.%Int(%int_32.loc15) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc15: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_3.loc15: Core.IntLiteral = int_value 3 [template = constants.%int_3.2] -// CHECK:STDOUT: %.loc15_9.1: type = value_of_initializer %int.make_type_signed.loc15 [template = constants.%i32] -// CHECK:STDOUT: %.loc15_9.2: type = converted %int.make_type_signed.loc15, %.loc15_9.1 [template = constants.%i32] // CHECK:STDOUT: %array_type.loc15: type = array_type %int_3.loc15, %i32 [template = constants.%array_type] // CHECK:STDOUT: %ptr.loc15: type = ptr_type %array_type [template = constants.%ptr] // CHECK:STDOUT: %int_32.loc16: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc16: init type = call constants.%Int(%int_32.loc16) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc16: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %ConvertToU32.ref: %ConvertToU32.type = name_ref ConvertToU32, %ConvertToU32.decl [template = constants.%ConvertToU32] // CHECK:STDOUT: %int_3.loc16: Core.IntLiteral = int_value 3 [template = constants.%int_3.2] -// CHECK:STDOUT: %impl.elem0.loc16_27: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc16_27: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc16_27: = bound_method %int_3.loc16, %impl.elem0.loc16_27 [template = constants.%Convert.bound.4] // CHECK:STDOUT: %Convert.specific_fn.loc16_27: = specific_function %Convert.bound.loc16_27, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.4] // CHECK:STDOUT: %int.convert_checked.loc16_27: init %i32 = call %Convert.specific_fn.loc16_27(%int_3.loc16) [template = constants.%int_3.1] // CHECK:STDOUT: %.loc16_27.1: %i32 = value_of_initializer %int.convert_checked.loc16_27 [template = constants.%int_3.1] // CHECK:STDOUT: %.loc16_27.2: %i32 = converted %int_3.loc16, %.loc16_27.1 [template = constants.%int_3.1] // CHECK:STDOUT: %int.convert_checked.loc16_28.1: init %u32 = call %ConvertToU32.ref(%.loc16_27.2) [template = constants.%int_3.3] -// CHECK:STDOUT: %.loc16_9.1: type = value_of_initializer %int.make_type_signed.loc16 [template = constants.%i32] -// CHECK:STDOUT: %.loc16_9.2: type = converted %int.make_type_signed.loc16, %.loc16_9.1 [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc16_28: %Convert.type.6 = interface_witness_access constants.%interface.11, element0 [template = constants.%Convert.16] +// CHECK:STDOUT: %impl.elem0.loc16_28: %Convert.type.5 = interface_witness_access constants.%interface.11, element0 [template = constants.%Convert.16] // CHECK:STDOUT: %Convert.bound.loc16_28: = bound_method %int.convert_checked.loc16_28.1, %impl.elem0.loc16_28 [template = constants.%Convert.bound.5] -// CHECK:STDOUT: %Convert.specific_fn.loc16_28: = specific_function %Convert.bound.loc16_28, @Convert.5(constants.%int_32) [template = constants.%Convert.specific_fn.5] +// CHECK:STDOUT: %Convert.specific_fn.loc16_28: = specific_function %Convert.bound.loc16_28, @Convert.8(constants.%int_32) [template = constants.%Convert.specific_fn.5] // CHECK:STDOUT: %.loc16_28.1: %u32 = value_of_initializer %int.convert_checked.loc16_28.1 [template = constants.%int_3.3] // CHECK:STDOUT: %.loc16_28.2: %u32 = converted %int.convert_checked.loc16_28.1, %.loc16_28.1 [template = constants.%int_3.3] // CHECK:STDOUT: %int.convert_checked.loc16_28.2: init Core.IntLiteral = call %Convert.specific_fn.loc16_28(%.loc16_28.2) [template = constants.%int_3.2] @@ -193,7 +173,7 @@ let c: [i32; ConvertToU32(3)]* = &a; // CHECK:STDOUT: %ptr.loc16: type = ptr_type %array_type [template = constants.%ptr] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Add(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.sadd"; +// CHECK:STDOUT: fn @Add.1(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.sadd"; // CHECK:STDOUT: // CHECK:STDOUT: fn @ConvertToU32(%a.param_patt: %i32) -> %u32 = "int.convert_checked"; // CHECK:STDOUT: @@ -203,7 +183,7 @@ let c: [i32; ConvertToU32(3)]* = &a; // CHECK:STDOUT: %int_2.loc14_31: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3.2] // CHECK:STDOUT: %.loc14_35.1: %tuple.type = tuple_literal (%int_1.loc14_28, %int_2.loc14_31, %int_3) -// CHECK:STDOUT: %impl.elem0.loc14_35.1: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc14_35.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc14_35.1: = bound_method %int_1.loc14_28, %impl.elem0.loc14_35.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc14_35.1: = specific_function %Convert.bound.loc14_35.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc14_35.1: init %i32 = call %Convert.specific_fn.loc14_35.1(%int_1.loc14_28) [template = constants.%int_1.2] @@ -211,7 +191,7 @@ let c: [i32; ConvertToU32(3)]* = &a; // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0] // CHECK:STDOUT: %.loc14_35.3: ref %i32 = array_index file.%a.var, %int_0 // CHECK:STDOUT: %.loc14_35.4: init %i32 = initialize_from %.loc14_35.2 to %.loc14_35.3 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc14_35.2: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc14_35.2: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc14_35.2: = bound_method %int_2.loc14_31, %impl.elem0.loc14_35.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc14_35.2: = specific_function %Convert.bound.loc14_35.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc14_35.2: init %i32 = call %Convert.specific_fn.loc14_35.2(%int_2.loc14_31) [template = constants.%int_2.2] @@ -219,7 +199,7 @@ let c: [i32; ConvertToU32(3)]* = &a; // CHECK:STDOUT: %int_1.loc14_35: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %.loc14_35.6: ref %i32 = array_index file.%a.var, %int_1.loc14_35 // CHECK:STDOUT: %.loc14_35.7: init %i32 = initialize_from %.loc14_35.5 to %.loc14_35.6 [template = constants.%int_2.2] -// CHECK:STDOUT: %impl.elem0.loc14_35.3: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc14_35.3: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc14_35.3: = bound_method %int_3, %impl.elem0.loc14_35.3 [template = constants.%Convert.bound.4] // CHECK:STDOUT: %Convert.specific_fn.loc14_35.3: = specific_function %Convert.bound.loc14_35.3, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.4] // CHECK:STDOUT: %int.convert_checked.loc14_35.3: init %i32 = call %Convert.specific_fn.loc14_35.3(%int_3) [template = constants.%int_3.1] diff --git a/toolchain/check/testdata/array/fail_bound_negative.carbon b/toolchain/check/testdata/array/fail_bound_negative.carbon index 800b5a21b4624..a262268b7a816 100644 --- a/toolchain/check/testdata/array/fail_bound_negative.carbon +++ b/toolchain/check/testdata/array/fail_bound_negative.carbon @@ -19,33 +19,31 @@ var a: [i32; Negate(1)]; // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] -// CHECK:STDOUT: %Negate.type: type = fn_type @Negate [template] -// CHECK:STDOUT: %Negate: %Negate.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] +// CHECK:STDOUT: %Negate.type.1: type = fn_type @Negate.1 [template] +// CHECK:STDOUT: %Negate: %Negate.type.1 = struct_value () [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] // CHECK:STDOUT: %int_-1.1: %i32 = int_value -1 [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.4, @impl.3(%int_32) [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %interface.10: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_-1.1, %Convert.15 [template] -// CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.4(%int_32) [template] +// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.3, @impl.2(%int_32) [template] +// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [template] +// CHECK:STDOUT: %interface.6: = interface_witness (%Convert.11) [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_-1.1, %Convert.11 [template] +// CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.3(%int_32) [template] // CHECK:STDOUT: %int_-1.2: Core.IntLiteral = int_value -1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -58,41 +56,35 @@ var a: [i32; Negate(1)]; // CHECK:STDOUT: .a = %a // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Negate.decl: %Negate.type = fn_decl @Negate [template = constants.%Negate] { +// CHECK:STDOUT: %Negate.decl: %Negate.type.1 = fn_decl @Negate.1 [template = constants.%Negate] { // CHECK:STDOUT: %n.patt: %i32 = binding_pattern n // CHECK:STDOUT: %n.param_patt: %i32 = value_param_pattern %n.patt, runtime_param0 // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc11_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11_14: init type = call constants.%Int(%int_32.loc11_14) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_14.1: type = value_of_initializer %int.make_type_signed.loc11_14 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_14.2: type = converted %int.make_type_signed.loc11_14, %.loc11_14.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc11_14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc11_22: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11_22: init type = call constants.%Int(%int_32.loc11_22) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_22.1: type = value_of_initializer %int.make_type_signed.loc11_22 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_22.2: type = converted %int.make_type_signed.loc11_22, %.loc11_22.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc11_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %n.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %n: %i32 = bind_name n, %n.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %Negate.ref: %Negate.type = name_ref Negate, %Negate.decl [template = constants.%Negate] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %Negate.ref: %Negate.type.1 = name_ref Negate, %Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc16_21: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc16_21: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc16_21: = bound_method %int_1, %impl.elem0.loc16_21 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc16_21: = specific_function %Convert.bound.loc16_21, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc16_21: init %i32 = call %Convert.specific_fn.loc16_21(%int_1) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc16_21.1: %i32 = value_of_initializer %int.convert_checked.loc16_21 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc16_21.2: %i32 = converted %int_1, %.loc16_21.1 [template = constants.%int_1.2] // CHECK:STDOUT: %int.snegate: init %i32 = call %Negate.ref(%.loc16_21.2) [template = constants.%int_-1.1] -// CHECK:STDOUT: %.loc16_9.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc16_9.2: type = converted %int.make_type_signed, %.loc16_9.1 [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc16_22: %Convert.type.6 = interface_witness_access constants.%interface.10, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %impl.elem0.loc16_22: %Convert.type.5 = interface_witness_access constants.%interface.6, element0 [template = constants.%Convert.11] // CHECK:STDOUT: %Convert.bound.loc16_22: = bound_method %int.snegate, %impl.elem0.loc16_22 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc16_22: = specific_function %Convert.bound.loc16_22, @Convert.4(constants.%int_32) [template = constants.%Convert.specific_fn.2] +// CHECK:STDOUT: %Convert.specific_fn.loc16_22: = specific_function %Convert.bound.loc16_22, @Convert.3(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %.loc16_22.1: %i32 = value_of_initializer %int.snegate [template = constants.%int_-1.1] // CHECK:STDOUT: %.loc16_22.2: %i32 = converted %int.snegate, %.loc16_22.1 [template = constants.%int_-1.1] // CHECK:STDOUT: %int.convert_checked.loc16_22: init Core.IntLiteral = call %Convert.specific_fn.loc16_22(%.loc16_22.2) [template = constants.%int_-1.2] @@ -103,5 +95,5 @@ var a: [i32; Negate(1)]; // CHECK:STDOUT: %a: ref = bind_name a, %a.var // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Negate(%n.param_patt: %i32) -> %i32 = "int.snegate"; +// CHECK:STDOUT: fn @Negate.1(%n.param_patt: %i32) -> %i32 = "int.snegate"; // CHECK:STDOUT: diff --git a/toolchain/check/testdata/array/fail_bound_overflow.carbon b/toolchain/check/testdata/array/fail_bound_overflow.carbon index d2ee2ebd969aa..4c2a086cf6832 100644 --- a/toolchain/check/testdata/array/fail_bound_overflow.carbon +++ b/toolchain/check/testdata/array/fail_bound_overflow.carbon @@ -26,9 +26,7 @@ var b: [1; 39999999999999999993]; // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %int_39999999999999999993: Core.IntLiteral = int_value 39999999999999999993 [template] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: } @@ -36,7 +34,7 @@ var b: [1; 39999999999999999993]; // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -50,10 +48,8 @@ var b: [1; 39999999999999999993]; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_39999999999999999993.loc15: Core.IntLiteral = int_value 39999999999999999993 [template = constants.%int_39999999999999999993] -// CHECK:STDOUT: %.loc15_9.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc15_9.2: type = converted %int.make_type_signed, %.loc15_9.1 [template = constants.%i32] // CHECK:STDOUT: %array_type.loc15: type = array_type %int_39999999999999999993.loc15, %i32 [template = ] // CHECK:STDOUT: %a.var: ref = var a // CHECK:STDOUT: %a: ref = bind_name a, %a.var diff --git a/toolchain/check/testdata/array/fail_out_of_bound.carbon b/toolchain/check/testdata/array/fail_out_of_bound.carbon index 6ee019eca07a6..2a6703503e50f 100644 --- a/toolchain/check/testdata/array/fail_out_of_bound.carbon +++ b/toolchain/check/testdata/array/fail_out_of_bound.carbon @@ -17,9 +17,7 @@ var a: [i32; 1] = (1, 2, 3); // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %array_type: type = array_type %int_1, %i32 [template] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template] @@ -29,7 +27,7 @@ var a: [i32; 1] = (1, 2, 3); // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -42,10 +40,8 @@ var a: [i32; 1] = (1, 2, 3); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1] -// CHECK:STDOUT: %.loc14_9.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc14_9.2: type = converted %int.make_type_signed, %.loc14_9.1 [template = constants.%i32] // CHECK:STDOUT: %array_type: type = array_type %int_1, %i32 [template = constants.%array_type] // CHECK:STDOUT: %a.var: ref %array_type = var a // CHECK:STDOUT: %a: ref %array_type = bind_name a, %a.var diff --git a/toolchain/check/testdata/array/fail_out_of_bound_non_literal.carbon b/toolchain/check/testdata/array/fail_out_of_bound_non_literal.carbon index d4c2f23e3de33..df76585e27475 100644 --- a/toolchain/check/testdata/array/fail_out_of_bound_non_literal.carbon +++ b/toolchain/check/testdata/array/fail_out_of_bound_non_literal.carbon @@ -18,9 +18,7 @@ var b: i32 = a[{.index = 3}.index]; // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %int_3.1: Core.IntLiteral = int_value 3 [template] // CHECK:STDOUT: %array_type: type = array_type %int_3.1, %i32 [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] @@ -28,16 +26,16 @@ var b: i32 = a[{.index = 3}.index]; // CHECK:STDOUT: %tuple.type: type = tuple_type (Core.IntLiteral, Core.IntLiteral, Core.IntLiteral) [template] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] -// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_3.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_3.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_3.2: %i32 = int_value 3 [template] // CHECK:STDOUT: %array: %array_type = tuple_value (%int_1.2, %int_2.2, %int_3.2) [template] @@ -48,7 +46,7 @@ var b: i32 = a[{.index = 3}.index]; // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -62,17 +60,13 @@ var b: i32 = a[{.index = 3}.index]; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int_32.loc11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11: init type = call constants.%Int(%int_32.loc11) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] -// CHECK:STDOUT: %.loc11_9.1: type = value_of_initializer %int.make_type_signed.loc11 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_9.2: type = converted %int.make_type_signed.loc11, %.loc11_9.1 [template = constants.%i32] // CHECK:STDOUT: %array_type: type = array_type %int_3, %i32 [template = constants.%array_type] // CHECK:STDOUT: %a.var: ref %array_type = var a // CHECK:STDOUT: %a: ref %array_type = bind_name a, %a.var // CHECK:STDOUT: %int_32.loc15: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc15: init type = call constants.%Int(%int_32.loc15) [template = constants.%i32] -// CHECK:STDOUT: %.loc15_8.1: type = value_of_initializer %int.make_type_signed.loc15 [template = constants.%i32] -// CHECK:STDOUT: %.loc15_8.2: type = converted %int.make_type_signed.loc15, %.loc15_8.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc15: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %b.var: ref %i32 = var b // CHECK:STDOUT: %b: ref %i32 = bind_name b, %b.var // CHECK:STDOUT: } @@ -83,7 +77,7 @@ var b: i32 = a[{.index = 3}.index]; // CHECK:STDOUT: %int_2.loc11_23: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %int_3.loc11: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] // CHECK:STDOUT: %.loc11_27.1: %tuple.type = tuple_literal (%int_1.loc11_20, %int_2.loc11_23, %int_3.loc11) -// CHECK:STDOUT: %impl.elem0.loc11_27.1: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc11_27.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_27.1: = bound_method %int_1.loc11_20, %impl.elem0.loc11_27.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc11_27.1: = specific_function %Convert.bound.loc11_27.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc11_27.1: init %i32 = call %Convert.specific_fn.loc11_27.1(%int_1.loc11_20) [template = constants.%int_1.2] @@ -91,7 +85,7 @@ var b: i32 = a[{.index = 3}.index]; // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0] // CHECK:STDOUT: %.loc11_27.3: ref %i32 = array_index file.%a.var, %int_0 // CHECK:STDOUT: %.loc11_27.4: init %i32 = initialize_from %.loc11_27.2 to %.loc11_27.3 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc11_27.2: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc11_27.2: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_27.2: = bound_method %int_2.loc11_23, %impl.elem0.loc11_27.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc11_27.2: = specific_function %Convert.bound.loc11_27.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc11_27.2: init %i32 = call %Convert.specific_fn.loc11_27.2(%int_2.loc11_23) [template = constants.%int_2.2] @@ -99,7 +93,7 @@ var b: i32 = a[{.index = 3}.index]; // CHECK:STDOUT: %int_1.loc11_27: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %.loc11_27.6: ref %i32 = array_index file.%a.var, %int_1.loc11_27 // CHECK:STDOUT: %.loc11_27.7: init %i32 = initialize_from %.loc11_27.5 to %.loc11_27.6 [template = constants.%int_2.2] -// CHECK:STDOUT: %impl.elem0.loc11_27.3: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc11_27.3: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_27.3: = bound_method %int_3.loc11, %impl.elem0.loc11_27.3 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc11_27.3: = specific_function %Convert.bound.loc11_27.3, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc11_27.3: init %i32 = call %Convert.specific_fn.loc11_27.3(%int_3.loc11) [template = constants.%int_3.2] @@ -117,18 +111,16 @@ var b: i32 = a[{.index = 3}.index]; // CHECK:STDOUT: %.loc15_27.2: %struct_type.index = converted %.loc15_27.1, %struct [template = constants.%struct] // CHECK:STDOUT: %.loc15_28.1: Core.IntLiteral = struct_access %.loc15_27.2, element0 [template = constants.%int_3.1] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc15_34.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc15_34.2: type = converted %int.make_type_signed, %.loc15_34.1 [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc15: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %impl.elem0.loc15: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc15: = bound_method %.loc15_28.1, %impl.elem0.loc15 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc15: = specific_function %Convert.bound.loc15, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc15: init %i32 = call %Convert.specific_fn.loc15(%.loc15_28.1) [template = constants.%int_3.2] // CHECK:STDOUT: %.loc15_28.2: %i32 = value_of_initializer %int.convert_checked.loc15 [template = constants.%int_3.2] // CHECK:STDOUT: %.loc15_28.3: %i32 = converted %.loc15_28.1, %.loc15_28.2 [template = constants.%int_3.2] -// CHECK:STDOUT: %.loc15_34.3: ref %i32 = array_index %a.ref, %.loc15_28.3 [template = ] -// CHECK:STDOUT: %.loc15_34.4: %i32 = bind_value %.loc15_34.3 -// CHECK:STDOUT: assign file.%b.var, %.loc15_34.4 +// CHECK:STDOUT: %.loc15_34.1: ref %i32 = array_index %a.ref, %.loc15_28.3 [template = ] +// CHECK:STDOUT: %.loc15_34.2: %i32 = bind_value %.loc15_34.1 +// CHECK:STDOUT: assign file.%b.var, %.loc15_34.2 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/array/fail_type_mismatch.carbon b/toolchain/check/testdata/array/fail_type_mismatch.carbon index 15afe0df36d70..072888fe8dad6 100644 --- a/toolchain/check/testdata/array/fail_type_mismatch.carbon +++ b/toolchain/check/testdata/array/fail_type_mismatch.carbon @@ -43,9 +43,7 @@ var d: [i32; 3] = t2; // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template] // CHECK:STDOUT: %array_type: type = array_type %int_3, %i32 [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] @@ -54,10 +52,10 @@ var d: [i32; 3] = t2; // CHECK:STDOUT: %tuple.type.1: type = tuple_type (Core.IntLiteral, String, String) [template] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] // CHECK:STDOUT: %tuple.type.2: type = tuple_type (type, type, type) [template] @@ -71,7 +69,7 @@ var d: [i32; 3] = t2; // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -89,54 +87,40 @@ var d: [i32; 3] = t2; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int_32.loc18: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc18: init type = call constants.%Int(%int_32.loc18) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc18: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_3.loc18: Core.IntLiteral = int_value 3 [template = constants.%int_3] -// CHECK:STDOUT: %.loc18_9.1: type = value_of_initializer %int.make_type_signed.loc18 [template = constants.%i32] -// CHECK:STDOUT: %.loc18_9.2: type = converted %int.make_type_signed.loc18, %.loc18_9.1 [template = constants.%i32] // CHECK:STDOUT: %array_type.loc18: type = array_type %int_3.loc18, %i32 [template = constants.%array_type] // CHECK:STDOUT: %a.var: ref %array_type = var a // CHECK:STDOUT: %a: ref %array_type = bind_name a, %a.var // CHECK:STDOUT: %int_32.loc20: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc20: init type = call constants.%Int(%int_32.loc20) [template = constants.%i32] -// CHECK:STDOUT: %.loc20_29.1: %tuple.type.2 = tuple_literal (%int.make_type_signed.loc20, String, String) -// CHECK:STDOUT: %.loc20_29.2: type = value_of_initializer %int.make_type_signed.loc20 [template = constants.%i32] -// CHECK:STDOUT: %.loc20_29.3: type = converted %int.make_type_signed.loc20, %.loc20_29.2 [template = constants.%i32] -// CHECK:STDOUT: %.loc20_29.4: type = converted %.loc20_29.1, constants.%tuple.type.3 [template = constants.%tuple.type.3] +// CHECK:STDOUT: %i32.loc20: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc20_29.1: %tuple.type.2 = tuple_literal (%i32.loc20, String, String) +// CHECK:STDOUT: %.loc20_29.2: type = converted %.loc20_29.1, constants.%tuple.type.3 [template = constants.%tuple.type.3] // CHECK:STDOUT: %t1.var: ref %tuple.type.3 = var t1 // CHECK:STDOUT: %t1: ref %tuple.type.3 = bind_name t1, %t1.var // CHECK:STDOUT: %int_32.loc28: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc28: init type = call constants.%Int(%int_32.loc28) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc28: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_3.loc28: Core.IntLiteral = int_value 3 [template = constants.%int_3] -// CHECK:STDOUT: %.loc28_9.1: type = value_of_initializer %int.make_type_signed.loc28 [template = constants.%i32] -// CHECK:STDOUT: %.loc28_9.2: type = converted %int.make_type_signed.loc28, %.loc28_9.1 [template = constants.%i32] // CHECK:STDOUT: %array_type.loc28: type = array_type %int_3.loc28, %i32 [template = constants.%array_type] // CHECK:STDOUT: %b.var: ref %array_type = var b // CHECK:STDOUT: %b: ref %array_type = bind_name b, %b.var // CHECK:STDOUT: %int_32.loc34: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc34: init type = call constants.%Int(%int_32.loc34) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc34: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_3.loc34: Core.IntLiteral = int_value 3 [template = constants.%int_3] -// CHECK:STDOUT: %.loc34_9.1: type = value_of_initializer %int.make_type_signed.loc34 [template = constants.%i32] -// CHECK:STDOUT: %.loc34_9.2: type = converted %int.make_type_signed.loc34, %.loc34_9.1 [template = constants.%i32] // CHECK:STDOUT: %array_type.loc34: type = array_type %int_3.loc34, %i32 [template = constants.%array_type] // CHECK:STDOUT: %c.var: ref %array_type = var c // CHECK:STDOUT: %c: ref %array_type = bind_name c, %c.var // CHECK:STDOUT: %int_32.loc36_10: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc36_10: init type = call constants.%Int(%int_32.loc36_10) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc36_10: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc36_15: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc36_15: init type = call constants.%Int(%int_32.loc36_15) [template = constants.%i32] -// CHECK:STDOUT: %.loc36_18.1: %tuple.type.6 = tuple_literal (%int.make_type_signed.loc36_10, %int.make_type_signed.loc36_15) -// CHECK:STDOUT: %.loc36_18.2: type = value_of_initializer %int.make_type_signed.loc36_10 [template = constants.%i32] -// CHECK:STDOUT: %.loc36_18.3: type = converted %int.make_type_signed.loc36_10, %.loc36_18.2 [template = constants.%i32] -// CHECK:STDOUT: %.loc36_18.4: type = value_of_initializer %int.make_type_signed.loc36_15 [template = constants.%i32] -// CHECK:STDOUT: %.loc36_18.5: type = converted %int.make_type_signed.loc36_15, %.loc36_18.4 [template = constants.%i32] -// CHECK:STDOUT: %.loc36_18.6: type = converted %.loc36_18.1, constants.%tuple.type.7 [template = constants.%tuple.type.7] +// CHECK:STDOUT: %i32.loc36_15: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc36_18.1: %tuple.type.6 = tuple_literal (%i32.loc36_10, %i32.loc36_15) +// CHECK:STDOUT: %.loc36_18.2: type = converted %.loc36_18.1, constants.%tuple.type.7 [template = constants.%tuple.type.7] // CHECK:STDOUT: %t2.var: ref %tuple.type.7 = var t2 // CHECK:STDOUT: %t2: ref %tuple.type.7 = bind_name t2, %t2.var // CHECK:STDOUT: %int_32.loc40: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc40: init type = call constants.%Int(%int_32.loc40) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc40: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_3.loc40: Core.IntLiteral = int_value 3 [template = constants.%int_3] -// CHECK:STDOUT: %.loc40_9.1: type = value_of_initializer %int.make_type_signed.loc40 [template = constants.%i32] -// CHECK:STDOUT: %.loc40_9.2: type = converted %int.make_type_signed.loc40, %.loc40_9.1 [template = constants.%i32] // CHECK:STDOUT: %array_type.loc40: type = array_type %int_3.loc40, %i32 [template = constants.%array_type] // CHECK:STDOUT: %d.var: ref %array_type = var d // CHECK:STDOUT: %d: ref %array_type = bind_name d, %d.var @@ -148,7 +132,7 @@ var d: [i32; 3] = t2; // CHECK:STDOUT: %str.loc18_23: String = string_literal "Hello" [template = constants.%str.1] // CHECK:STDOUT: %str.loc18_32: String = string_literal "World" [template = constants.%str.2] // CHECK:STDOUT: %.loc18_39.1: %tuple.type.1 = tuple_literal (%int_1.loc18, %str.loc18_23, %str.loc18_32) -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1.loc18, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_1.loc18) [template = constants.%int_1.2] diff --git a/toolchain/check/testdata/array/function_param.carbon b/toolchain/check/testdata/array/function_param.carbon index 6c6857b429966..e0cd796efac20 100644 --- a/toolchain/check/testdata/array/function_param.carbon +++ b/toolchain/check/testdata/array/function_param.carbon @@ -20,9 +20,7 @@ fn G() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %int_3.1: Core.IntLiteral = int_value 3 [template] // CHECK:STDOUT: %array_type: type = array_type %int_3.1, %i32 [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] @@ -34,16 +32,16 @@ fn G() -> i32 { // CHECK:STDOUT: %tuple.type: type = tuple_type (Core.IntLiteral, Core.IntLiteral, Core.IntLiteral) [template] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] -// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_3.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_3.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_3.2: %i32 = int_value 3 [template] // CHECK:STDOUT: %array: %array_type = tuple_value (%int_1.2, %int_2.2, %int_3.2) [template] @@ -52,7 +50,7 @@ fn G() -> i32 { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -74,19 +72,13 @@ fn G() -> i32 { // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc11_12: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11_12: init type = call constants.%Int(%int_32.loc11_12) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc11_12: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] -// CHECK:STDOUT: %.loc11_12.1: type = value_of_initializer %int.make_type_signed.loc11_12 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_12.2: type = converted %int.make_type_signed.loc11_12, %.loc11_12.1 [template = constants.%i32] // CHECK:STDOUT: %array_type: type = array_type %int_3, %i32 [template = constants.%array_type] // CHECK:STDOUT: %int_32.loc11_24: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11_24: init type = call constants.%Int(%int_32.loc11_24) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_24.1: type = value_of_initializer %int.make_type_signed.loc11_24 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_24.2: type = converted %int.make_type_signed.loc11_24, %.loc11_24.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc11_24: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc11_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11_32: init type = call constants.%Int(%int_32.loc11_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_32.1: type = value_of_initializer %int.make_type_signed.loc11_32 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_32.2: type = converted %int.make_type_signed.loc11_32, %.loc11_32.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc11_32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %arr.param: %array_type = value_param runtime_param0 // CHECK:STDOUT: %arr: %array_type = bind_name arr, %arr.param // CHECK:STDOUT: %i.param: %i32 = value_param runtime_param1 @@ -99,9 +91,7 @@ fn G() -> i32 { // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc15_11.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc15_11.2: type = converted %int.make_type_signed, %.loc15_11.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } @@ -112,13 +102,11 @@ fn G() -> i32 { // CHECK:STDOUT: %arr.ref: %array_type = name_ref arr, %arr // CHECK:STDOUT: %i.ref: %i32 = name_ref i, %i // CHECK:STDOUT: %int_32.loc12: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc12: init type = call constants.%Int(%int_32.loc12) [template = constants.%i32] -// CHECK:STDOUT: %.loc12_15.1: type = value_of_initializer %int.make_type_signed.loc12 [template = constants.%i32] -// CHECK:STDOUT: %.loc12_15.2: type = converted %int.make_type_signed.loc12, %.loc12_15.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc12_15.3: ref %array_type = value_as_ref %arr.ref -// CHECK:STDOUT: %.loc12_15.4: ref %i32 = array_index %.loc12_15.3, %i.ref -// CHECK:STDOUT: %.loc12_15.5: %i32 = bind_value %.loc12_15.4 -// CHECK:STDOUT: return %.loc12_15.5 +// CHECK:STDOUT: %i32.loc12: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc12_15.1: ref %array_type = value_as_ref %arr.ref +// CHECK:STDOUT: %.loc12_15.2: ref %i32 = array_index %.loc12_15.1, %i.ref +// CHECK:STDOUT: %.loc12_15.3: %i32 = bind_value %.loc12_15.2 +// CHECK:STDOUT: return %.loc12_15.3 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @G() -> %i32 { @@ -129,7 +117,7 @@ fn G() -> i32 { // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] // CHECK:STDOUT: %.loc16_20.1: %tuple.type = tuple_literal (%int_1.loc16_13, %int_2.loc16_16, %int_3) // CHECK:STDOUT: %int_1.loc16_23: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc16_20.1: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc16_20.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc16_20.1: = bound_method %int_1.loc16_13, %impl.elem0.loc16_20.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc16_20.1: = specific_function %Convert.bound.loc16_20.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc16_20.1: init %i32 = call %Convert.specific_fn.loc16_20.1(%int_1.loc16_13) [template = constants.%int_1.2] @@ -138,7 +126,7 @@ fn G() -> i32 { // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0] // CHECK:STDOUT: %.loc16_20.4: ref %i32 = array_index %.loc16_20.3, %int_0 // CHECK:STDOUT: %.loc16_20.5: init %i32 = initialize_from %.loc16_20.2 to %.loc16_20.4 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc16_20.2: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc16_20.2: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc16_20.2: = bound_method %int_2.loc16_16, %impl.elem0.loc16_20.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc16_20.2: = specific_function %Convert.bound.loc16_20.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc16_20.2: init %i32 = call %Convert.specific_fn.loc16_20.2(%int_2.loc16_16) [template = constants.%int_2.2] @@ -146,7 +134,7 @@ fn G() -> i32 { // CHECK:STDOUT: %int_1.loc16_20: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %.loc16_20.7: ref %i32 = array_index %.loc16_20.3, %int_1.loc16_20 // CHECK:STDOUT: %.loc16_20.8: init %i32 = initialize_from %.loc16_20.6 to %.loc16_20.7 [template = constants.%int_2.2] -// CHECK:STDOUT: %impl.elem0.loc16_20.3: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc16_20.3: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc16_20.3: = bound_method %int_3, %impl.elem0.loc16_20.3 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc16_20.3: = specific_function %Convert.bound.loc16_20.3, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc16_20.3: init %i32 = call %Convert.specific_fn.loc16_20.3(%int_3) [template = constants.%int_3.2] @@ -158,7 +146,7 @@ fn G() -> i32 { // CHECK:STDOUT: %.loc16_20.13: init %array_type = converted %.loc16_20.1, %.loc16_20.12 [template = constants.%array] // CHECK:STDOUT: %.loc16_20.14: ref %array_type = temporary %.loc16_20.3, %.loc16_20.13 // CHECK:STDOUT: %.loc16_20.15: %array_type = bind_value %.loc16_20.14 -// CHECK:STDOUT: %impl.elem0.loc16_23: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc16_23: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc16_23: = bound_method %int_1.loc16_23, %impl.elem0.loc16_23 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc16_23: = specific_function %Convert.bound.loc16_23, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc16_23: init %i32 = call %Convert.specific_fn.loc16_23(%int_1.loc16_23) [template = constants.%int_1.2] diff --git a/toolchain/check/testdata/array/import.carbon b/toolchain/check/testdata/array/import.carbon index c2779e390fd69..386005f97f55c 100644 --- a/toolchain/check/testdata/array/import.carbon +++ b/toolchain/check/testdata/array/import.carbon @@ -26,9 +26,7 @@ fn G(n: i32) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %int_42: Core.IntLiteral = int_value 42 [template] // CHECK:STDOUT: %array_type: type = array_type %int_42, %i32 [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] @@ -37,7 +35,7 @@ fn G(n: i32) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -54,10 +52,8 @@ fn G(n: i32) -> i32 { // CHECK:STDOUT: %return.param_patt: %array_type = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_42: Core.IntLiteral = int_value 42 [template = constants.%int_42] -// CHECK:STDOUT: %.loc4_12.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc4_12.2: type = converted %int.make_type_signed, %.loc4_12.1 [template = constants.%i32] // CHECK:STDOUT: %array_type: type = array_type %int_42, %i32 [template = constants.%array_type] // CHECK:STDOUT: %return.param: ref %array_type = out_param runtime_param0 // CHECK:STDOUT: %return: ref %array_type = return_slot %return.param @@ -70,9 +66,7 @@ fn G(n: i32) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] @@ -105,13 +99,9 @@ fn G(n: i32) -> i32 { // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc4_9: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc4_9: init type = call constants.%Int(%int_32.loc4_9) [template = constants.%i32] -// CHECK:STDOUT: %.loc4_9.1: type = value_of_initializer %int.make_type_signed.loc4_9 [template = constants.%i32] -// CHECK:STDOUT: %.loc4_9.2: type = converted %int.make_type_signed.loc4_9, %.loc4_9.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc4_9: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc4_17: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc4_17: init type = call constants.%Int(%int_32.loc4_17) [template = constants.%i32] -// CHECK:STDOUT: %.loc4_17.1: type = value_of_initializer %int.make_type_signed.loc4_17 [template = constants.%i32] -// CHECK:STDOUT: %.loc4_17.2: type = converted %int.make_type_signed.loc4_17, %.loc4_17.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc4_17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %n.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %n: %i32 = bind_name n, %n.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 @@ -127,12 +117,10 @@ fn G(n: i32) -> i32 { // CHECK:STDOUT: %n.ref: %i32 = name_ref n, %n // CHECK:STDOUT: %.loc5_12.2: ref %array_type = temporary %.loc5_12.1, %F.call // CHECK:STDOUT: %int_32.loc5: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc5: init type = call constants.%Int(%int_32.loc5) [template = constants.%i32] -// CHECK:STDOUT: %.loc5_15.1: type = value_of_initializer %int.make_type_signed.loc5 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_15.2: type = converted %int.make_type_signed.loc5, %.loc5_15.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_15.3: ref %i32 = array_index %.loc5_12.2, %n.ref -// CHECK:STDOUT: %.loc5_15.4: %i32 = bind_value %.loc5_15.3 -// CHECK:STDOUT: return %.loc5_15.4 +// CHECK:STDOUT: %i32.loc5: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc5_15.1: ref %i32 = array_index %.loc5_12.2, %n.ref +// CHECK:STDOUT: %.loc5_15.2: %i32 = bind_value %.loc5_15.1 +// CHECK:STDOUT: return %.loc5_15.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F() -> %array_type [from "library.carbon"]; diff --git a/toolchain/check/testdata/array/index_not_literal.carbon b/toolchain/check/testdata/array/index_not_literal.carbon index 02dcf910bcc20..6864670828873 100644 --- a/toolchain/check/testdata/array/index_not_literal.carbon +++ b/toolchain/check/testdata/array/index_not_literal.carbon @@ -15,9 +15,7 @@ var b: i32 = a[{.index = 2}.index]; // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %int_3.1: Core.IntLiteral = int_value 3 [template] // CHECK:STDOUT: %array_type: type = array_type %int_3.1, %i32 [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] @@ -25,16 +23,16 @@ var b: i32 = a[{.index = 2}.index]; // CHECK:STDOUT: %tuple.type: type = tuple_type (Core.IntLiteral, Core.IntLiteral, Core.IntLiteral) [template] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] -// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_3.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_3.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_3.2: %i32 = int_value 3 [template] // CHECK:STDOUT: %array: %array_type = tuple_value (%int_1.2, %int_2.2, %int_3.2) [template] @@ -45,7 +43,7 @@ var b: i32 = a[{.index = 2}.index]; // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -59,17 +57,13 @@ var b: i32 = a[{.index = 2}.index]; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int_32.loc11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11: init type = call constants.%Int(%int_32.loc11) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] -// CHECK:STDOUT: %.loc11_9.1: type = value_of_initializer %int.make_type_signed.loc11 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_9.2: type = converted %int.make_type_signed.loc11, %.loc11_9.1 [template = constants.%i32] // CHECK:STDOUT: %array_type: type = array_type %int_3, %i32 [template = constants.%array_type] // CHECK:STDOUT: %a.var: ref %array_type = var a // CHECK:STDOUT: %a: ref %array_type = bind_name a, %a.var // CHECK:STDOUT: %int_32.loc12: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc12: init type = call constants.%Int(%int_32.loc12) [template = constants.%i32] -// CHECK:STDOUT: %.loc12_8.1: type = value_of_initializer %int.make_type_signed.loc12 [template = constants.%i32] -// CHECK:STDOUT: %.loc12_8.2: type = converted %int.make_type_signed.loc12, %.loc12_8.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc12: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %b.var: ref %i32 = var b // CHECK:STDOUT: %b: ref %i32 = bind_name b, %b.var // CHECK:STDOUT: } @@ -80,7 +74,7 @@ var b: i32 = a[{.index = 2}.index]; // CHECK:STDOUT: %int_2.loc11_23: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] // CHECK:STDOUT: %.loc11_27.1: %tuple.type = tuple_literal (%int_1.loc11_20, %int_2.loc11_23, %int_3) -// CHECK:STDOUT: %impl.elem0.loc11_27.1: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc11_27.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_27.1: = bound_method %int_1.loc11_20, %impl.elem0.loc11_27.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc11_27.1: = specific_function %Convert.bound.loc11_27.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc11_27.1: init %i32 = call %Convert.specific_fn.loc11_27.1(%int_1.loc11_20) [template = constants.%int_1.2] @@ -88,7 +82,7 @@ var b: i32 = a[{.index = 2}.index]; // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0] // CHECK:STDOUT: %.loc11_27.3: ref %i32 = array_index file.%a.var, %int_0 // CHECK:STDOUT: %.loc11_27.4: init %i32 = initialize_from %.loc11_27.2 to %.loc11_27.3 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc11_27.2: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc11_27.2: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_27.2: = bound_method %int_2.loc11_23, %impl.elem0.loc11_27.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc11_27.2: = specific_function %Convert.bound.loc11_27.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc11_27.2: init %i32 = call %Convert.specific_fn.loc11_27.2(%int_2.loc11_23) [template = constants.%int_2.2] @@ -96,7 +90,7 @@ var b: i32 = a[{.index = 2}.index]; // CHECK:STDOUT: %int_1.loc11_27: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %.loc11_27.6: ref %i32 = array_index file.%a.var, %int_1.loc11_27 // CHECK:STDOUT: %.loc11_27.7: init %i32 = initialize_from %.loc11_27.5 to %.loc11_27.6 [template = constants.%int_2.2] -// CHECK:STDOUT: %impl.elem0.loc11_27.3: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc11_27.3: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_27.3: = bound_method %int_3, %impl.elem0.loc11_27.3 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc11_27.3: = specific_function %Convert.bound.loc11_27.3, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc11_27.3: init %i32 = call %Convert.specific_fn.loc11_27.3(%int_3) [template = constants.%int_3.2] @@ -114,18 +108,16 @@ var b: i32 = a[{.index = 2}.index]; // CHECK:STDOUT: %.loc12_27.2: %struct_type.index = converted %.loc12_27.1, %struct [template = constants.%struct] // CHECK:STDOUT: %.loc12_28.1: Core.IntLiteral = struct_access %.loc12_27.2, element0 [template = constants.%int_2.1] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc12_34.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc12_34.2: type = converted %int.make_type_signed, %.loc12_34.1 [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc12: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %impl.elem0.loc12: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc12: = bound_method %.loc12_28.1, %impl.elem0.loc12 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc12: = specific_function %Convert.bound.loc12, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc12: init %i32 = call %Convert.specific_fn.loc12(%.loc12_28.1) [template = constants.%int_2.2] // CHECK:STDOUT: %.loc12_28.2: %i32 = value_of_initializer %int.convert_checked.loc12 [template = constants.%int_2.2] // CHECK:STDOUT: %.loc12_28.3: %i32 = converted %.loc12_28.1, %.loc12_28.2 [template = constants.%int_2.2] -// CHECK:STDOUT: %.loc12_34.3: ref %i32 = array_index %a.ref, %.loc12_28.3 -// CHECK:STDOUT: %.loc12_34.4: %i32 = bind_value %.loc12_34.3 -// CHECK:STDOUT: assign file.%b.var, %.loc12_34.4 +// CHECK:STDOUT: %.loc12_34.1: ref %i32 = array_index %a.ref, %.loc12_28.3 +// CHECK:STDOUT: %.loc12_34.2: %i32 = bind_value %.loc12_34.1 +// CHECK:STDOUT: assign file.%b.var, %.loc12_34.2 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/array/nine_elements.carbon b/toolchain/check/testdata/array/nine_elements.carbon index bc6485d89df44..cd514aa9c9f77 100644 --- a/toolchain/check/testdata/array/nine_elements.carbon +++ b/toolchain/check/testdata/array/nine_elements.carbon @@ -14,9 +14,7 @@ var a: [i32; 9] = (1, 2, 3, 4, 5, 6, 7, 8, 9); // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %int_9.1: Core.IntLiteral = int_value 9 [template] // CHECK:STDOUT: %array_type: type = array_type %int_9.1, %i32 [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] @@ -30,34 +28,34 @@ var a: [i32; 9] = (1, 2, 3, 4, 5, 6, 7, 8, 9); // CHECK:STDOUT: %tuple.type: type = tuple_type (Core.IntLiteral, Core.IntLiteral, Core.IntLiteral, Core.IntLiteral, Core.IntLiteral, Core.IntLiteral, Core.IntLiteral, Core.IntLiteral, Core.IntLiteral) [template] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] -// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_3.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_3.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_3.2: %i32 = int_value 3 [template] -// CHECK:STDOUT: %Convert.bound.4: = bound_method %int_4.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.4: = bound_method %int_4.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.4: = specific_function %Convert.bound.4, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_4.2: %i32 = int_value 4 [template] -// CHECK:STDOUT: %Convert.bound.5: = bound_method %int_5.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.5: = bound_method %int_5.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.5: = specific_function %Convert.bound.5, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_5.2: %i32 = int_value 5 [template] -// CHECK:STDOUT: %Convert.bound.6: = bound_method %int_6.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.6: = bound_method %int_6.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.6: = specific_function %Convert.bound.6, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_6.2: %i32 = int_value 6 [template] -// CHECK:STDOUT: %Convert.bound.7: = bound_method %int_7.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.7: = bound_method %int_7.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.7: = specific_function %Convert.bound.7, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_7.2: %i32 = int_value 7 [template] -// CHECK:STDOUT: %Convert.bound.8: = bound_method %int_8.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.8: = bound_method %int_8.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.8: = specific_function %Convert.bound.8, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_8.2: %i32 = int_value 8 [template] -// CHECK:STDOUT: %Convert.bound.9: = bound_method %int_9.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.9: = bound_method %int_9.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.9: = specific_function %Convert.bound.9, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_9.2: %i32 = int_value 9 [template] // CHECK:STDOUT: %array: %array_type = tuple_value (%int_1.2, %int_2.2, %int_3.2, %int_4.2, %int_5.2, %int_6.2, %int_7.2, %int_8.2, %int_9.2) [template] @@ -66,7 +64,7 @@ var a: [i32; 9] = (1, 2, 3, 4, 5, 6, 7, 8, 9); // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -79,10 +77,8 @@ var a: [i32; 9] = (1, 2, 3, 4, 5, 6, 7, 8, 9); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_9: Core.IntLiteral = int_value 9 [template = constants.%int_9.1] -// CHECK:STDOUT: %.loc11_9.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc11_9.2: type = converted %int.make_type_signed, %.loc11_9.1 [template = constants.%i32] // CHECK:STDOUT: %array_type: type = array_type %int_9, %i32 [template = constants.%array_type] // CHECK:STDOUT: %a.var: ref %array_type = var a // CHECK:STDOUT: %a: ref %array_type = bind_name a, %a.var @@ -100,7 +96,7 @@ var a: [i32; 9] = (1, 2, 3, 4, 5, 6, 7, 8, 9); // CHECK:STDOUT: %int_8.loc11_41: Core.IntLiteral = int_value 8 [template = constants.%int_8.1] // CHECK:STDOUT: %int_9: Core.IntLiteral = int_value 9 [template = constants.%int_9.1] // CHECK:STDOUT: %.loc11_45.1: %tuple.type = tuple_literal (%int_1.loc11_20, %int_2.loc11_23, %int_3.loc11_26, %int_4.loc11_29, %int_5.loc11_32, %int_6.loc11_35, %int_7.loc11_38, %int_8.loc11_41, %int_9) -// CHECK:STDOUT: %impl.elem0.loc11_45.1: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc11_45.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_45.1: = bound_method %int_1.loc11_20, %impl.elem0.loc11_45.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc11_45.1: = specific_function %Convert.bound.loc11_45.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc11_45.1: init %i32 = call %Convert.specific_fn.loc11_45.1(%int_1.loc11_20) [template = constants.%int_1.2] @@ -108,7 +104,7 @@ var a: [i32; 9] = (1, 2, 3, 4, 5, 6, 7, 8, 9); // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0] // CHECK:STDOUT: %.loc11_45.3: ref %i32 = array_index file.%a.var, %int_0 // CHECK:STDOUT: %.loc11_45.4: init %i32 = initialize_from %.loc11_45.2 to %.loc11_45.3 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc11_45.2: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc11_45.2: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_45.2: = bound_method %int_2.loc11_23, %impl.elem0.loc11_45.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc11_45.2: = specific_function %Convert.bound.loc11_45.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc11_45.2: init %i32 = call %Convert.specific_fn.loc11_45.2(%int_2.loc11_23) [template = constants.%int_2.2] @@ -116,7 +112,7 @@ var a: [i32; 9] = (1, 2, 3, 4, 5, 6, 7, 8, 9); // CHECK:STDOUT: %int_1.loc11_45: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %.loc11_45.6: ref %i32 = array_index file.%a.var, %int_1.loc11_45 // CHECK:STDOUT: %.loc11_45.7: init %i32 = initialize_from %.loc11_45.5 to %.loc11_45.6 [template = constants.%int_2.2] -// CHECK:STDOUT: %impl.elem0.loc11_45.3: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc11_45.3: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_45.3: = bound_method %int_3.loc11_26, %impl.elem0.loc11_45.3 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc11_45.3: = specific_function %Convert.bound.loc11_45.3, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc11_45.3: init %i32 = call %Convert.specific_fn.loc11_45.3(%int_3.loc11_26) [template = constants.%int_3.2] @@ -124,7 +120,7 @@ var a: [i32; 9] = (1, 2, 3, 4, 5, 6, 7, 8, 9); // CHECK:STDOUT: %int_2.loc11_45: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %.loc11_45.9: ref %i32 = array_index file.%a.var, %int_2.loc11_45 // CHECK:STDOUT: %.loc11_45.10: init %i32 = initialize_from %.loc11_45.8 to %.loc11_45.9 [template = constants.%int_3.2] -// CHECK:STDOUT: %impl.elem0.loc11_45.4: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc11_45.4: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_45.4: = bound_method %int_4.loc11_29, %impl.elem0.loc11_45.4 [template = constants.%Convert.bound.4] // CHECK:STDOUT: %Convert.specific_fn.loc11_45.4: = specific_function %Convert.bound.loc11_45.4, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.4] // CHECK:STDOUT: %int.convert_checked.loc11_45.4: init %i32 = call %Convert.specific_fn.loc11_45.4(%int_4.loc11_29) [template = constants.%int_4.2] @@ -132,7 +128,7 @@ var a: [i32; 9] = (1, 2, 3, 4, 5, 6, 7, 8, 9); // CHECK:STDOUT: %int_3.loc11_45: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] // CHECK:STDOUT: %.loc11_45.12: ref %i32 = array_index file.%a.var, %int_3.loc11_45 // CHECK:STDOUT: %.loc11_45.13: init %i32 = initialize_from %.loc11_45.11 to %.loc11_45.12 [template = constants.%int_4.2] -// CHECK:STDOUT: %impl.elem0.loc11_45.5: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc11_45.5: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_45.5: = bound_method %int_5.loc11_32, %impl.elem0.loc11_45.5 [template = constants.%Convert.bound.5] // CHECK:STDOUT: %Convert.specific_fn.loc11_45.5: = specific_function %Convert.bound.loc11_45.5, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.5] // CHECK:STDOUT: %int.convert_checked.loc11_45.5: init %i32 = call %Convert.specific_fn.loc11_45.5(%int_5.loc11_32) [template = constants.%int_5.2] @@ -140,7 +136,7 @@ var a: [i32; 9] = (1, 2, 3, 4, 5, 6, 7, 8, 9); // CHECK:STDOUT: %int_4.loc11_45: Core.IntLiteral = int_value 4 [template = constants.%int_4.1] // CHECK:STDOUT: %.loc11_45.15: ref %i32 = array_index file.%a.var, %int_4.loc11_45 // CHECK:STDOUT: %.loc11_45.16: init %i32 = initialize_from %.loc11_45.14 to %.loc11_45.15 [template = constants.%int_5.2] -// CHECK:STDOUT: %impl.elem0.loc11_45.6: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc11_45.6: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_45.6: = bound_method %int_6.loc11_35, %impl.elem0.loc11_45.6 [template = constants.%Convert.bound.6] // CHECK:STDOUT: %Convert.specific_fn.loc11_45.6: = specific_function %Convert.bound.loc11_45.6, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.6] // CHECK:STDOUT: %int.convert_checked.loc11_45.6: init %i32 = call %Convert.specific_fn.loc11_45.6(%int_6.loc11_35) [template = constants.%int_6.2] @@ -148,7 +144,7 @@ var a: [i32; 9] = (1, 2, 3, 4, 5, 6, 7, 8, 9); // CHECK:STDOUT: %int_5.loc11_45: Core.IntLiteral = int_value 5 [template = constants.%int_5.1] // CHECK:STDOUT: %.loc11_45.18: ref %i32 = array_index file.%a.var, %int_5.loc11_45 // CHECK:STDOUT: %.loc11_45.19: init %i32 = initialize_from %.loc11_45.17 to %.loc11_45.18 [template = constants.%int_6.2] -// CHECK:STDOUT: %impl.elem0.loc11_45.7: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc11_45.7: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_45.7: = bound_method %int_7.loc11_38, %impl.elem0.loc11_45.7 [template = constants.%Convert.bound.7] // CHECK:STDOUT: %Convert.specific_fn.loc11_45.7: = specific_function %Convert.bound.loc11_45.7, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.7] // CHECK:STDOUT: %int.convert_checked.loc11_45.7: init %i32 = call %Convert.specific_fn.loc11_45.7(%int_7.loc11_38) [template = constants.%int_7.2] @@ -156,7 +152,7 @@ var a: [i32; 9] = (1, 2, 3, 4, 5, 6, 7, 8, 9); // CHECK:STDOUT: %int_6.loc11_45: Core.IntLiteral = int_value 6 [template = constants.%int_6.1] // CHECK:STDOUT: %.loc11_45.21: ref %i32 = array_index file.%a.var, %int_6.loc11_45 // CHECK:STDOUT: %.loc11_45.22: init %i32 = initialize_from %.loc11_45.20 to %.loc11_45.21 [template = constants.%int_7.2] -// CHECK:STDOUT: %impl.elem0.loc11_45.8: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc11_45.8: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_45.8: = bound_method %int_8.loc11_41, %impl.elem0.loc11_45.8 [template = constants.%Convert.bound.8] // CHECK:STDOUT: %Convert.specific_fn.loc11_45.8: = specific_function %Convert.bound.loc11_45.8, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.8] // CHECK:STDOUT: %int.convert_checked.loc11_45.8: init %i32 = call %Convert.specific_fn.loc11_45.8(%int_8.loc11_41) [template = constants.%int_8.2] @@ -164,7 +160,7 @@ var a: [i32; 9] = (1, 2, 3, 4, 5, 6, 7, 8, 9); // CHECK:STDOUT: %int_7.loc11_45: Core.IntLiteral = int_value 7 [template = constants.%int_7.1] // CHECK:STDOUT: %.loc11_45.24: ref %i32 = array_index file.%a.var, %int_7.loc11_45 // CHECK:STDOUT: %.loc11_45.25: init %i32 = initialize_from %.loc11_45.23 to %.loc11_45.24 [template = constants.%int_8.2] -// CHECK:STDOUT: %impl.elem0.loc11_45.9: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc11_45.9: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_45.9: = bound_method %int_9, %impl.elem0.loc11_45.9 [template = constants.%Convert.bound.9] // CHECK:STDOUT: %Convert.specific_fn.loc11_45.9: = specific_function %Convert.bound.loc11_45.9, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.9] // CHECK:STDOUT: %int.convert_checked.loc11_45.9: init %i32 = call %Convert.specific_fn.loc11_45.9(%int_9) [template = constants.%int_9.2] diff --git a/toolchain/check/testdata/as/adapter_conversion.carbon b/toolchain/check/testdata/as/adapter_conversion.carbon index f12a256395ea0..df56a25ad0dad 100644 --- a/toolchain/check/testdata/as/adapter_conversion.carbon +++ b/toolchain/check/testdata/as/adapter_conversion.carbon @@ -110,25 +110,23 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: constants { // CHECK:STDOUT: %A: type = class_type @A [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %A.elem: type = unbound_element_type %A, %i32 [template] // CHECK:STDOUT: %Make.type: type = fn_type @Make [template] // CHECK:STDOUT: %Make: %Make.type = struct_value () [template] // CHECK:STDOUT: %struct_type.x.y.1: type = struct_type {.x: %i32, .y: %i32} [template] -// CHECK:STDOUT: %complete_type.1: = complete_type_witness %struct_type.x.y.1 [template] +// CHECK:STDOUT: %complete_type.3: = complete_type_witness %struct_type.x.y.1 [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %struct_type.x.y.2: type = struct_type {.x: Core.IntLiteral, .y: Core.IntLiteral} [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] // CHECK:STDOUT: %A.val: %A = struct_value (%int_1.2, %int_2.2) [template] @@ -139,7 +137,7 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -173,15 +171,11 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: // CHECK:STDOUT: class @A { // CHECK:STDOUT: %int_32.loc5: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc5: init type = call constants.%Int(%int_32.loc5) [template = constants.%i32] -// CHECK:STDOUT: %.loc5_10.1: type = value_of_initializer %int.make_type_signed.loc5 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_10.2: type = converted %int.make_type_signed.loc5, %.loc5_10.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_8: %A.elem = field_decl x, element0 [template] +// CHECK:STDOUT: %i32.loc5: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc5: %A.elem = field_decl x, element0 [template] // CHECK:STDOUT: %int_32.loc6: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc6: init type = call constants.%Int(%int_32.loc6) [template = constants.%i32] -// CHECK:STDOUT: %.loc6_10.1: type = value_of_initializer %int.make_type_signed.loc6 [template = constants.%i32] -// CHECK:STDOUT: %.loc6_10.2: type = converted %int.make_type_signed.loc6, %.loc6_10.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc6_8: %A.elem = field_decl y, element1 [template] +// CHECK:STDOUT: %i32.loc6: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc6: %A.elem = field_decl y, element1 [template] // CHECK:STDOUT: %Make.decl: %Make.type = fn_decl @Make [template = constants.%Make] { // CHECK:STDOUT: %return.patt: %A = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %A = out_param_pattern %return.patt, runtime_param0 @@ -190,12 +184,12 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: %return.param: ref %A = out_param runtime_param0 // CHECK:STDOUT: %return: ref %A = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.x.y.1 [template = constants.%complete_type.1] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.x.y.1 [template = constants.%complete_type.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%A -// CHECK:STDOUT: .x = %.loc5_8 -// CHECK:STDOUT: .y = %.loc6_8 +// CHECK:STDOUT: .x = %.loc5 +// CHECK:STDOUT: .y = %.loc6 // CHECK:STDOUT: .Make = %Make.decl // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } @@ -203,7 +197,7 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: class @B { // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%A] // CHECK:STDOUT: adapt_decl %A.ref [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.x.y.1 [template = constants.%complete_type.1] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.x.y.1 [template = constants.%complete_type.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%B @@ -215,14 +209,14 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %.loc9_27.1: %struct_type.x.y.2 = struct_literal (%int_1, %int_2) -// CHECK:STDOUT: %impl.elem0.loc9_27.1: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc9_27.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc9_27.1: = bound_method %int_1, %impl.elem0.loc9_27.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc9_27.1: = specific_function %Convert.bound.loc9_27.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc9_27.1: init %i32 = call %Convert.specific_fn.loc9_27.1(%int_1) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc9_27.2: init %i32 = converted %int_1, %int.convert_checked.loc9_27.1 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc9_27.3: ref %i32 = class_element_access %return, element0 // CHECK:STDOUT: %.loc9_27.4: init %i32 = initialize_from %.loc9_27.2 to %.loc9_27.3 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc9_27.2: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc9_27.2: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc9_27.2: = bound_method %int_2, %impl.elem0.loc9_27.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc9_27.2: = specific_function %Convert.bound.loc9_27.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc9_27.2: init %i32 = call %Convert.specific_fn.loc9_27.2(%int_2) [template = constants.%int_2.2] @@ -239,14 +233,14 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %.loc17_31.1: %struct_type.x.y.2 = struct_literal (%int_1, %int_2) -// CHECK:STDOUT: %impl.elem0.loc17_31.1: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc17_31.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc17_31.1: = bound_method %int_1, %impl.elem0.loc17_31.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc17_31.1: = specific_function %Convert.bound.loc17_31.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc17_31.1: init %i32 = call %Convert.specific_fn.loc17_31.1(%int_1) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc17_31.2: init %i32 = converted %int_1, %int.convert_checked.loc17_31.1 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc17_31.3: ref %i32 = class_element_access file.%a_ref.var, element0 // CHECK:STDOUT: %.loc17_31.4: init %i32 = initialize_from %.loc17_31.2 to %.loc17_31.3 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc17_31.2: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc17_31.2: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc17_31.2: = bound_method %int_2, %impl.elem0.loc17_31.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc17_31.2: = specific_function %Convert.bound.loc17_31.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc17_31.2: init %i32 = call %Convert.specific_fn.loc17_31.2(%int_2) [template = constants.%int_2.2] @@ -286,24 +280,23 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: constants { // CHECK:STDOUT: %A: type = class_type @A [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] -// CHECK:STDOUT: %complete_type.1: = complete_type_witness %i32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] +// CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %complete_type.2: = complete_type_witness %i32.builtin [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @As(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.7, @impl.5(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_1.1, %Convert.14 [template] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.7(%int_32) [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.5, @impl.3(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound: = bound_method %int_1.1, %Convert.10 [template] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.5(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .As = %import_ref.2 +// CHECK:STDOUT: .As = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -320,18 +313,14 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: %A.decl: type = class_decl @A [template = constants.%A] {} {} // CHECK:STDOUT: %A.ref: type = name_ref A, %A.decl [template = constants.%A] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc9_8.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc9_8.2: type = converted %int.make_type_signed, %.loc9_8.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @A { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc5_12.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc5_12.2: type = converted %int.make_type_signed, %.loc5_12.1 [template = constants.%i32] -// CHECK:STDOUT: adapt_decl %.loc5_12.2 [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %i32 [template = constants.%complete_type.1] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: adapt_decl %i32 [template] +// CHECK:STDOUT: %complete_type: = complete_type_witness %i32.builtin [template = constants.%complete_type.2] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%A @@ -342,12 +331,10 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_32.loc8: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc8: init type = call constants.%Int(%int_32.loc8) [template = constants.%i32] -// CHECK:STDOUT: %.loc8_18.1: type = value_of_initializer %int.make_type_signed.loc8 [template = constants.%i32] -// CHECK:STDOUT: %.loc8_18.2: type = converted %int.make_type_signed.loc8, %.loc8_18.1 [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %i32.loc8: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1, %impl.elem0 [template = constants.%Convert.bound] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.7(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.5(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_1) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc8_15.1: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_1.2] // CHECK:STDOUT: %.loc8_15.2: %i32 = converted %int_1, %.loc8_15.1 [template = constants.%int_1.2] @@ -357,9 +344,7 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: %a: %A = bind_name a, %.loc8_23.2 // CHECK:STDOUT: %a.ref: %A = name_ref a, %a // CHECK:STDOUT: %int_32.loc9: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc9: init type = call constants.%Int(%int_32.loc9) [template = constants.%i32] -// CHECK:STDOUT: %.loc9_19.1: type = value_of_initializer %int.make_type_signed.loc9 [template = constants.%i32] -// CHECK:STDOUT: %.loc9_19.2: type = converted %int.make_type_signed.loc9, %.loc9_19.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc9: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc9_16.1: %i32 = as_compatible %a.ref // CHECK:STDOUT: %.loc9_16.2: %i32 = converted %a.ref, %.loc9_16.1 // CHECK:STDOUT: %n: %i32 = bind_name n, %.loc9_16.2 @@ -459,24 +444,22 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: constants { // CHECK:STDOUT: %A: type = class_type @A [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %A.elem: type = unbound_element_type %A, %i32 [template] // CHECK:STDOUT: %struct_type.x.y.1: type = struct_type {.x: %i32, .y: %i32} [template] -// CHECK:STDOUT: %complete_type.1: = complete_type_witness %struct_type.x.y.1 [template] +// CHECK:STDOUT: %complete_type.3: = complete_type_witness %struct_type.x.y.1 [template] // CHECK:STDOUT: %B: type = class_type @B [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %struct_type.x.y.2: type = struct_type {.x: Core.IntLiteral, .y: Core.IntLiteral} [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] // CHECK:STDOUT: %A.val: %A = struct_value (%int_1.2, %int_2.2) [template] @@ -485,7 +468,7 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -510,28 +493,24 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: // CHECK:STDOUT: class @A { // CHECK:STDOUT: %int_32.loc5: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc5: init type = call constants.%Int(%int_32.loc5) [template = constants.%i32] -// CHECK:STDOUT: %.loc5_10.1: type = value_of_initializer %int.make_type_signed.loc5 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_10.2: type = converted %int.make_type_signed.loc5, %.loc5_10.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_8: %A.elem = field_decl x, element0 [template] +// CHECK:STDOUT: %i32.loc5: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc5: %A.elem = field_decl x, element0 [template] // CHECK:STDOUT: %int_32.loc6: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc6: init type = call constants.%Int(%int_32.loc6) [template = constants.%i32] -// CHECK:STDOUT: %.loc6_10.1: type = value_of_initializer %int.make_type_signed.loc6 [template = constants.%i32] -// CHECK:STDOUT: %.loc6_10.2: type = converted %int.make_type_signed.loc6, %.loc6_10.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc6_8: %A.elem = field_decl y, element1 [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.x.y.1 [template = constants.%complete_type.1] +// CHECK:STDOUT: %i32.loc6: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc6: %A.elem = field_decl y, element1 [template] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.x.y.1 [template = constants.%complete_type.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%A -// CHECK:STDOUT: .x = %.loc5_8 -// CHECK:STDOUT: .y = %.loc6_8 +// CHECK:STDOUT: .x = %.loc5 +// CHECK:STDOUT: .y = %.loc6 // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @B { // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%A] // CHECK:STDOUT: adapt_decl %A.ref [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.x.y.1 [template = constants.%complete_type.1] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.x.y.1 [template = constants.%complete_type.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%B @@ -544,7 +523,7 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: %int_2.loc13: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %.loc13_34.1: %struct_type.x.y.2 = struct_literal (%int_1.loc13, %int_2.loc13) // CHECK:STDOUT: %A.ref.loc13: type = name_ref A, file.%A.decl [template = constants.%A] -// CHECK:STDOUT: %impl.elem0.loc13_34.1: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc13_34.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc13_34.1: = bound_method %int_1.loc13, %impl.elem0.loc13_34.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc13_34.1: = specific_function %Convert.bound.loc13_34.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc13_34.1: init %i32 = call %Convert.specific_fn.loc13_34.1(%int_1.loc13) [template = constants.%int_1.2] @@ -552,7 +531,7 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: %.loc13_34.3: ref %A = temporary_storage // CHECK:STDOUT: %.loc13_34.4: ref %i32 = class_element_access %.loc13_34.3, element0 // CHECK:STDOUT: %.loc13_34.5: init %i32 = initialize_from %.loc13_34.2 to %.loc13_34.4 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc13_34.2: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc13_34.2: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc13_34.2: = bound_method %int_2.loc13, %impl.elem0.loc13_34.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc13_34.2: = specific_function %Convert.bound.loc13_34.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc13_34.2: init %i32 = call %Convert.specific_fn.loc13_34.2(%int_2.loc13) [template = constants.%int_2.2] @@ -571,7 +550,7 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: %int_2.loc24: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %.loc24_33.1: %struct_type.x.y.2 = struct_literal (%int_1.loc24, %int_2.loc24) // CHECK:STDOUT: %A.ref.loc24: type = name_ref A, file.%A.decl [template = constants.%A] -// CHECK:STDOUT: %impl.elem0.loc24_33.1: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc24_33.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc24_33.1: = bound_method %int_1.loc24, %impl.elem0.loc24_33.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc24_33.1: = specific_function %Convert.bound.loc24_33.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc24_33.1: init %i32 = call %Convert.specific_fn.loc24_33.1(%int_1.loc24) [template = constants.%int_1.2] @@ -579,7 +558,7 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: %.loc24_33.3: ref %A = temporary_storage // CHECK:STDOUT: %.loc24_33.4: ref %i32 = class_element_access %.loc24_33.3, element0 // CHECK:STDOUT: %.loc24_33.5: init %i32 = initialize_from %.loc24_33.2 to %.loc24_33.4 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc24_33.2: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc24_33.2: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc24_33.2: = bound_method %int_2.loc24, %impl.elem0.loc24_33.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc24_33.2: = specific_function %Convert.bound.loc24_33.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc24_33.2: init %i32 = call %Convert.specific_fn.loc24_33.2(%int_2.loc24) [template = constants.%int_2.2] @@ -602,12 +581,10 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: constants { // CHECK:STDOUT: %A: type = class_type @A [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %A.elem: type = unbound_element_type %A, %i32 [template] // CHECK:STDOUT: %struct_type.x.1: type = struct_type {.x: %i32} [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.x.1 [template] +// CHECK:STDOUT: %complete_type.3: = complete_type_witness %struct_type.x.1 [template] // CHECK:STDOUT: %B: type = class_type @B [template] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %struct_type.x.2: type = struct_type {.x: Core.IntLiteral} [template] @@ -616,7 +593,7 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .As = %import_ref.2 +// CHECK:STDOUT: .As = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -639,22 +616,20 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: // CHECK:STDOUT: class @A { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc5_10.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc5_10.2: type = converted %int.make_type_signed, %.loc5_10.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_8: %A.elem = field_decl x, element0 [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.x.1 [template = constants.%complete_type] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc5: %A.elem = field_decl x, element0 [template] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.x.1 [template = constants.%complete_type.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%A -// CHECK:STDOUT: .x = %.loc5_8 +// CHECK:STDOUT: .x = %.loc5 // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @B { // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%A] // CHECK:STDOUT: adapt_decl %A.ref [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.x.1 [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.x.1 [template = constants.%complete_type.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%B diff --git a/toolchain/check/testdata/as/as_type.carbon b/toolchain/check/testdata/as/as_type.carbon index b1a35bcd670d5..c0e0cad4aa928 100644 --- a/toolchain/check/testdata/as/as_type.carbon +++ b/toolchain/check/testdata/as/as_type.carbon @@ -14,16 +14,14 @@ let t: type = (i32, i32) as type; // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (type, type) [template] // CHECK:STDOUT: %tuple.type.2: type = tuple_type (%i32, %i32) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -40,16 +38,12 @@ let t: type = (i32, i32) as type; // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_32.loc11_16: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11_16: init type = call constants.%Int(%int_32.loc11_16) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc11_16: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc11_21: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11_21: init type = call constants.%Int(%int_32.loc11_21) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_24: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc11_16, %int.make_type_signed.loc11_21) -// CHECK:STDOUT: %.loc11_26.1: type = value_of_initializer %int.make_type_signed.loc11_16 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_26.2: type = converted %int.make_type_signed.loc11_16, %.loc11_26.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_26.3: type = value_of_initializer %int.make_type_signed.loc11_21 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_26.4: type = converted %int.make_type_signed.loc11_21, %.loc11_26.3 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_26.5: type = converted %.loc11_24, constants.%tuple.type.2 [template = constants.%tuple.type.2] -// CHECK:STDOUT: %t: type = bind_name t, %.loc11_26.5 +// CHECK:STDOUT: %i32.loc11_21: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_24: %tuple.type.1 = tuple_literal (%i32.loc11_16, %i32.loc11_21) +// CHECK:STDOUT: %.loc11_26: type = converted %.loc11_24, constants.%tuple.type.2 [template = constants.%tuple.type.2] +// CHECK:STDOUT: %t: type = bind_name t, %.loc11_26 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/as/basic.carbon b/toolchain/check/testdata/as/basic.carbon index ec86080656be1..7093353206ac9 100644 --- a/toolchain/check/testdata/as/basic.carbon +++ b/toolchain/check/testdata/as/basic.carbon @@ -16,25 +16,23 @@ fn Main() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %Main.type: type = fn_type @Main [template] // CHECK:STDOUT: %Main: %Main.type = struct_value () [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @As(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.7, @impl.5(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_1.1, %Convert.14 [template] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.7(%int_32) [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.5, @impl.3(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound: = bound_method %int_1.1, %Convert.10 [template] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.5(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .As = %import_ref.2 +// CHECK:STDOUT: .As = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -51,9 +49,7 @@ fn Main() -> i32 { // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11: init type = call constants.%Int(%int_32.loc11) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_14.1: type = value_of_initializer %int.make_type_signed.loc11 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_14.2: type = converted %int.make_type_signed.loc11, %.loc11_14.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } @@ -63,12 +59,10 @@ fn Main() -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_32.loc12: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc12: init type = call constants.%Int(%int_32.loc12) [template = constants.%i32] -// CHECK:STDOUT: %.loc12_15.1: type = value_of_initializer %int.make_type_signed.loc12 [template = constants.%i32] -// CHECK:STDOUT: %.loc12_15.2: type = converted %int.make_type_signed.loc12, %.loc12_15.1 [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %i32.loc12: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1, %impl.elem0 [template = constants.%Convert.bound] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.7(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.5(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_1) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc12_12.1: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_1.2] // CHECK:STDOUT: %.loc12_12.2: %i32 = converted %int_1, %.loc12_12.1 [template = constants.%int_1.2] diff --git a/toolchain/check/testdata/as/fail_no_conversion.carbon b/toolchain/check/testdata/as/fail_no_conversion.carbon index 5bfd2ebcdabaf..69e583751d471 100644 --- a/toolchain/check/testdata/as/fail_no_conversion.carbon +++ b/toolchain/check/testdata/as/fail_no_conversion.carbon @@ -20,9 +20,7 @@ let n: (i32, i32) = 1 as (i32, i32); // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (type, type) [template] // CHECK:STDOUT: %tuple.type.2: type = tuple_type (%i32, %i32) [template] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template] @@ -31,7 +29,7 @@ let n: (i32, i32) = 1 as (i32, i32); // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .As = %import_ref.2 +// CHECK:STDOUT: .As = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -44,30 +42,22 @@ let n: (i32, i32) = 1 as (i32, i32); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int_32.loc17_9: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc17_9: init type = call constants.%Int(%int_32.loc17_9) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc17_9: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc17_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc17_14: init type = call constants.%Int(%int_32.loc17_14) [template = constants.%i32] -// CHECK:STDOUT: %.loc17_17.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc17_9, %int.make_type_signed.loc17_14) -// CHECK:STDOUT: %.loc17_17.2: type = value_of_initializer %int.make_type_signed.loc17_9 [template = constants.%i32] -// CHECK:STDOUT: %.loc17_17.3: type = converted %int.make_type_signed.loc17_9, %.loc17_17.2 [template = constants.%i32] -// CHECK:STDOUT: %.loc17_17.4: type = value_of_initializer %int.make_type_signed.loc17_14 [template = constants.%i32] -// CHECK:STDOUT: %.loc17_17.5: type = converted %int.make_type_signed.loc17_14, %.loc17_17.4 [template = constants.%i32] -// CHECK:STDOUT: %.loc17_17.6: type = converted %.loc17_17.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] +// CHECK:STDOUT: %i32.loc17_14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc17_17.1: %tuple.type.1 = tuple_literal (%i32.loc17_9, %i32.loc17_14) +// CHECK:STDOUT: %.loc17_17.2: type = converted %.loc17_17.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1] // CHECK:STDOUT: %int_32.loc17_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc17_27: init type = call constants.%Int(%int_32.loc17_27) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc17_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc17_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc17_32: init type = call constants.%Int(%int_32.loc17_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc17_35.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc17_27, %int.make_type_signed.loc17_32) -// CHECK:STDOUT: %.loc17_35.2: type = value_of_initializer %int.make_type_signed.loc17_27 [template = constants.%i32] -// CHECK:STDOUT: %.loc17_35.3: type = converted %int.make_type_signed.loc17_27, %.loc17_35.2 [template = constants.%i32] -// CHECK:STDOUT: %.loc17_35.4: type = value_of_initializer %int.make_type_signed.loc17_32 [template = constants.%i32] -// CHECK:STDOUT: %.loc17_35.5: type = converted %int.make_type_signed.loc17_32, %.loc17_35.4 [template = constants.%i32] -// CHECK:STDOUT: %.loc17_35.6: type = converted %.loc17_35.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] +// CHECK:STDOUT: %i32.loc17_32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc17_35.1: %tuple.type.1 = tuple_literal (%i32.loc17_27, %i32.loc17_32) +// CHECK:STDOUT: %.loc17_35.2: type = converted %.loc17_35.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %.loc17_23: %tuple.type.2 = converted %int_1, [template = ] // CHECK:STDOUT: %tuple.elem0: %i32 = tuple_access %.loc17_23, element0 [template = ] // CHECK:STDOUT: %n: %tuple.type.2 = bind_name n, diff --git a/toolchain/check/testdata/as/fail_not_type.carbon b/toolchain/check/testdata/as/fail_not_type.carbon index bc2c00c5ee85c..18c0aa0bdcf94 100644 --- a/toolchain/check/testdata/as/fail_not_type.carbon +++ b/toolchain/check/testdata/as/fail_not_type.carbon @@ -20,9 +20,7 @@ let n: i32 = 1 as 2; // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: } @@ -30,7 +28,7 @@ let n: i32 = 1 as 2; // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -43,9 +41,7 @@ let n: i32 = 1 as 2; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc17_8.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc17_8.2: type = converted %int.make_type_signed, %.loc17_8.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { diff --git a/toolchain/check/testdata/as/overloaded.carbon b/toolchain/check/testdata/as/overloaded.carbon index a831731d918c5..8212121495e51 100644 --- a/toolchain/check/testdata/as/overloaded.carbon +++ b/toolchain/check/testdata/as/overloaded.carbon @@ -27,12 +27,10 @@ let n: i32 = ((4 as i32) as X) as i32; // CHECK:STDOUT: constants { // CHECK:STDOUT: %X: type = class_type @X [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %X.elem: type = unbound_element_type %X, %i32 [template] // CHECK:STDOUT: %struct_type.n: type = struct_type {.n: %i32} [template] -// CHECK:STDOUT: %complete_type.1: = complete_type_witness %struct_type.n [template] +// CHECK:STDOUT: %complete_type.3: = complete_type_witness %struct_type.n [template] // CHECK:STDOUT: %As.type.1: type = generic_interface_type @As [template] // CHECK:STDOUT: %As.generic: %As.type.1 = struct_value () [template] // CHECK:STDOUT: %As.type.3: type = facet_type <@As, @As(%X)> [template] @@ -46,11 +44,11 @@ let n: i32 = ((4 as i32) as X) as i32; // CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.1, @As(%i32) [template] // CHECK:STDOUT: %interface.2: = interface_witness (%Convert.4) [template] // CHECK:STDOUT: %int_4.1: Core.IntLiteral = int_value 4 [template] -// CHECK:STDOUT: %Convert.type.17: type = fn_type @Convert.9, @impl.7(%int_32) [template] -// CHECK:STDOUT: %Convert.17: %Convert.type.17 = struct_value () [template] -// CHECK:STDOUT: %interface.11: = interface_witness (%Convert.17) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_4.1, %Convert.17 [template] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound.1, @Convert.9(%int_32) [template] +// CHECK:STDOUT: %Convert.type.13: type = fn_type @Convert.7, @impl.5(%int_32) [template] +// CHECK:STDOUT: %Convert.13: %Convert.type.13 = struct_value () [template] +// CHECK:STDOUT: %interface.7: = interface_witness (%Convert.13) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_4.1, %Convert.13 [template] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound.1, @Convert.7(%int_32) [template] // CHECK:STDOUT: %int_4.2: %i32 = int_value 4 [template] // CHECK:STDOUT: %Convert.bound.2: = bound_method %int_4.2, %Convert.2 [template] // CHECK:STDOUT: } @@ -58,11 +56,11 @@ let n: i32 = ((4 as i32) as X) as i32; // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .As = %import_ref.2 +// CHECK:STDOUT: .As = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.2: %As.type.1 = import_ref Core//prelude/operators/as, As, loaded [template = constants.%As.generic] +// CHECK:STDOUT: %import_ref.5: %As.type.1 = import_ref Core//prelude/operators/as, As, loaded [template = constants.%As.generic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -75,31 +73,25 @@ let n: i32 = ((4 as i32) as X) as i32; // CHECK:STDOUT: %X.decl: type = class_decl @X [template = constants.%X] {} {} // CHECK:STDOUT: impl_decl @impl.1 [template] {} { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc15_6.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc15_6.2: type = converted %int.make_type_signed, %.loc15_6.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] -// CHECK:STDOUT: %As.ref: %As.type.1 = name_ref As, imports.%import_ref.2 [template = constants.%As.generic] +// CHECK:STDOUT: %As.ref: %As.type.1 = name_ref As, imports.%import_ref.5 [template = constants.%As.generic] // CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [template = constants.%X] // CHECK:STDOUT: %As.type: type = facet_type <@As, @As(constants.%X)> [template = constants.%As.type.3] // CHECK:STDOUT: } // CHECK:STDOUT: impl_decl @impl.2 [template] {} { // CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [template = constants.%X] // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] -// CHECK:STDOUT: %As.ref: %As.type.1 = name_ref As, imports.%import_ref.2 [template = constants.%As.generic] +// CHECK:STDOUT: %As.ref: %As.type.1 = name_ref As, imports.%import_ref.5 [template = constants.%As.generic] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc19_22.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc19_22.2: type = converted %int.make_type_signed, %.loc19_22.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %As.type: type = facet_type <@As, @As(constants.%i32)> [template = constants.%As.type.4] // CHECK:STDOUT: } // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc23_8.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc23_8.2: type = converted %int.make_type_signed, %.loc23_8.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.1: %.loc15_6.2 as %As.type { +// CHECK:STDOUT: impl @impl.1: %i32 as %As.type { // CHECK:STDOUT: %Convert.decl: %Convert.type.2 = fn_decl @Convert.2 [template = constants.%Convert.2] { // CHECK:STDOUT: %self.patt: %i32 = binding_pattern self // CHECK:STDOUT: %self.param_patt: %i32 = value_param_pattern %self.patt, runtime_param0 @@ -107,9 +99,7 @@ let n: i32 = ((4 as i32) as X) as i32; // CHECK:STDOUT: %return.param_patt: %X = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc16_20.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc16_20.2: type = converted %int.make_type_signed, %.loc16_20.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [template = constants.%X] // CHECK:STDOUT: %self.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %self: %i32 = bind_name self, %self.param @@ -132,9 +122,7 @@ let n: i32 = ((4 as i32) as X) as i32; // CHECK:STDOUT: } { // CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [template = constants.%X] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc20_28.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc20_28.2: type = converted %int.make_type_signed, %.loc20_28.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %self.param: %X = value_param runtime_param0 // CHECK:STDOUT: %self: %X = bind_name self, %self.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 @@ -149,15 +137,13 @@ let n: i32 = ((4 as i32) as X) as i32; // CHECK:STDOUT: // CHECK:STDOUT: class @X { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc12_10.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc12_10.2: type = converted %int.make_type_signed, %.loc12_10.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc12_8: %X.elem = field_decl n, element0 [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.n [template = constants.%complete_type.1] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc12: %X.elem = field_decl n, element0 [template] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.n [template = constants.%complete_type.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%X -// CHECK:STDOUT: .n = %.loc12_8 +// CHECK:STDOUT: .n = %.loc12 // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } // CHECK:STDOUT: @@ -175,7 +161,7 @@ let n: i32 = ((4 as i32) as X) as i32; // CHECK:STDOUT: fn @Convert.3[%self.param_patt: %X]() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %self.ref: %X = name_ref self, %self -// CHECK:STDOUT: %n.ref: %X.elem = name_ref n, @X.%.loc12_8 [template = @X.%.loc12_8] +// CHECK:STDOUT: %n.ref: %X.elem = name_ref n, @X.%.loc12 [template = @X.%.loc12] // CHECK:STDOUT: %.loc20_45.1: ref %i32 = class_element_access %self.ref, element0 // CHECK:STDOUT: %.loc20_45.2: %i32 = bind_value %.loc20_45.1 // CHECK:STDOUT: return %.loc20_45.2 @@ -185,12 +171,10 @@ let n: i32 = ((4 as i32) as X) as i32; // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [template = constants.%int_4.1] // CHECK:STDOUT: %int_32.loc23_21: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc23_21: init type = call constants.%Int(%int_32.loc23_21) [template = constants.%i32] -// CHECK:STDOUT: %.loc23_21.1: type = value_of_initializer %int.make_type_signed.loc23_21 [template = constants.%i32] -// CHECK:STDOUT: %.loc23_21.2: type = converted %int.make_type_signed.loc23_21, %.loc23_21.1 [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc23_18: %Convert.type.5 = interface_witness_access constants.%interface.11, element0 [template = constants.%Convert.17] +// CHECK:STDOUT: %i32.loc23_21: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %impl.elem0.loc23_18: %Convert.type.5 = interface_witness_access constants.%interface.7, element0 [template = constants.%Convert.13] // CHECK:STDOUT: %Convert.bound.loc23_18: = bound_method %int_4, %impl.elem0.loc23_18 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound.loc23_18, @Convert.9(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound.loc23_18, @Convert.7(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_4) [template = constants.%int_4.2] // CHECK:STDOUT: %.loc23_18.1: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_4.2] // CHECK:STDOUT: %.loc23_18.2: %i32 = converted %int_4, %.loc23_18.1 [template = constants.%int_4.2] @@ -201,9 +185,7 @@ let n: i32 = ((4 as i32) as X) as i32; // CHECK:STDOUT: %Convert.call.loc23_26: init %X = call %Convert.bound.loc23_26(%.loc23_18.2) to %.loc23_26.1 // CHECK:STDOUT: %.loc23_26.2: init %X = converted %.loc23_18.2, %Convert.call.loc23_26 // CHECK:STDOUT: %int_32.loc23_35: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc23_35: init type = call constants.%Int(%int_32.loc23_35) [template = constants.%i32] -// CHECK:STDOUT: %.loc23_35.1: type = value_of_initializer %int.make_type_signed.loc23_35 [template = constants.%i32] -// CHECK:STDOUT: %.loc23_35.2: type = converted %int.make_type_signed.loc23_35, %.loc23_35.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc23_35: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %impl.elem0.loc23_32: %Convert.type.5 = interface_witness_access constants.%interface.2, element0 [template = constants.%Convert.4] // CHECK:STDOUT: %Convert.bound.loc23_32: = bound_method %.loc23_26.2, %impl.elem0.loc23_32 // CHECK:STDOUT: %.loc23_26.3: ref %X = temporary %.loc23_26.1, %.loc23_26.2 diff --git a/toolchain/check/testdata/basics/builtin_types.carbon b/toolchain/check/testdata/basics/builtin_types.carbon index 9dca841351c0a..33d0bc462bdb8 100644 --- a/toolchain/check/testdata/basics/builtin_types.carbon +++ b/toolchain/check/testdata/basics/builtin_types.carbon @@ -17,15 +17,13 @@ var test_type: type = i32; // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] // CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [template] @@ -38,8 +36,8 @@ var test_type: type = i32; // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 -// CHECK:STDOUT: .Float = %import_ref.38 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 +// CHECK:STDOUT: .Float = %import_ref.193 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -55,9 +53,7 @@ var test_type: type = i32; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_15.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc11_15.2: type = converted %int.make_type_signed, %.loc11_15.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %test_i32.var: ref %i32 = var test_i32 // CHECK:STDOUT: %test_i32: ref %i32 = bind_name test_i32, %test_i32.var // CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [template = constants.%int_64] @@ -73,7 +69,7 @@ var test_type: type = i32; // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.2] @@ -84,8 +80,8 @@ var test_type: type = i32; // CHECK:STDOUT: %str: String = string_literal "Test" [template = constants.%str] // CHECK:STDOUT: %test_str: String = bind_name test_str, %str // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: assign file.%test_type.var, %int.make_type_signed +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: assign file.%test_type.var, %i32 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/basics/fail_bad_run.carbon b/toolchain/check/testdata/basics/fail_bad_run.carbon index 496d471b4de7d..b926d7ef4c38b 100644 --- a/toolchain/check/testdata/basics/fail_bad_run.carbon +++ b/toolchain/check/testdata/basics/fail_bad_run.carbon @@ -23,14 +23,12 @@ fn Run() -> String {} // CHECK:STDOUT: %Run.type: type = fn_type @Run [template] // CHECK:STDOUT: %Run: %Run.type = struct_value () [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -50,9 +48,7 @@ fn Run() -> String {} // CHECK:STDOUT: %return: ref String = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc18_20.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc18_20.2: type = converted %int.make_type_signed, %.loc18_20.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Run() -> %return.param_patt: String { diff --git a/toolchain/check/testdata/basics/fail_bad_run_2.carbon b/toolchain/check/testdata/basics/fail_bad_run_2.carbon index 1c4a0bb8a9da3..e0e7c47161fe9 100644 --- a/toolchain/check/testdata/basics/fail_bad_run_2.carbon +++ b/toolchain/check/testdata/basics/fail_bad_run_2.carbon @@ -17,16 +17,14 @@ fn Run(n: i32) {} // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %Run.type: type = fn_type @Run [template] // CHECK:STDOUT: %Run: %Run.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -43,9 +41,7 @@ fn Run(n: i32) {} // CHECK:STDOUT: %n.param_patt: %i32 = value_param_pattern %n.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc14_11.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc14_11.2: type = converted %int.make_type_signed, %.loc14_11.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %n.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %n: %i32 = bind_name n, %n.param // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/basics/fail_numeric_literal_overflow.carbon b/toolchain/check/testdata/basics/fail_numeric_literal_overflow.carbon index 34ab40a7b460e..3a7a956a7d338 100644 --- a/toolchain/check/testdata/basics/fail_numeric_literal_overflow.carbon +++ b/toolchain/check/testdata/basics/fail_numeric_literal_overflow.carbon @@ -41,19 +41,17 @@ let e: f64 = 5.0e39999999999999999993; // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %int_39999999999999999993.1: Core.IntLiteral = int_value 39999999999999999993 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_39999999999999999993.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_39999999999999999993.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_39999999999999999993.2: %i32 = int_value 39999999999999999993 [template] // CHECK:STDOUT: %int_2147483648.1: Core.IntLiteral = int_value 2147483648 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2147483648.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2147483648.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2147483648.2: %i32 = int_value 2147483648 [template] // CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [template] @@ -64,8 +62,8 @@ let e: f64 = 5.0e39999999999999999993; // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 -// CHECK:STDOUT: .Float = %import_ref.38 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 +// CHECK:STDOUT: .Float = %import_ref.193 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -82,17 +80,11 @@ let e: f64 = 5.0e39999999999999999993; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int_32.loc15: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc15: init type = call constants.%Int(%int_32.loc15) [template = constants.%i32] -// CHECK:STDOUT: %.loc15_8.1: type = value_of_initializer %int.make_type_signed.loc15 [template = constants.%i32] -// CHECK:STDOUT: %.loc15_8.2: type = converted %int.make_type_signed.loc15, %.loc15_8.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc15: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc21: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc21: init type = call constants.%Int(%int_32.loc21) [template = constants.%i32] -// CHECK:STDOUT: %.loc21_8.1: type = value_of_initializer %int.make_type_signed.loc21 [template = constants.%i32] -// CHECK:STDOUT: %.loc21_8.2: type = converted %int.make_type_signed.loc21, %.loc21_8.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc21: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc27: init type = call constants.%Int(%int_32.loc27) [template = constants.%i32] -// CHECK:STDOUT: %.loc27_8.1: type = value_of_initializer %int.make_type_signed.loc27 [template = constants.%i32] -// CHECK:STDOUT: %.loc27_8.2: type = converted %int.make_type_signed.loc27, %.loc27_8.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_64.loc33: Core.IntLiteral = int_value 64 [template = constants.%int_64] // CHECK:STDOUT: %float.make_type.loc33: init type = call constants.%Float(%int_64.loc33) [template = f64] // CHECK:STDOUT: %.loc33_8.1: type = value_of_initializer %float.make_type.loc33 [template = f64] @@ -106,7 +98,7 @@ let e: f64 = 5.0e39999999999999999993; // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_39999999999999999993: Core.IntLiteral = int_value 39999999999999999993 [template = constants.%int_39999999999999999993.1] -// CHECK:STDOUT: %impl.elem0.loc15: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc15: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc15: = bound_method %int_39999999999999999993, %impl.elem0.loc15 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc15: = specific_function %Convert.bound.loc15, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc15: init %i32 = call %Convert.specific_fn.loc15(%int_39999999999999999993) [template = constants.%int_39999999999999999993.2] @@ -114,7 +106,7 @@ let e: f64 = 5.0e39999999999999999993; // CHECK:STDOUT: %.loc15_34.2: %i32 = converted %int_39999999999999999993, %.loc15_34.1 [template = constants.%int_39999999999999999993.2] // CHECK:STDOUT: %a: %i32 = bind_name a, %.loc15_34.2 // CHECK:STDOUT: %int_2147483648.loc21: Core.IntLiteral = int_value 2147483648 [template = constants.%int_2147483648.1] -// CHECK:STDOUT: %impl.elem0.loc21: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc21: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc21: = bound_method %int_2147483648.loc21, %impl.elem0.loc21 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc21: = specific_function %Convert.bound.loc21, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc21: init %i32 = call %Convert.specific_fn.loc21(%int_2147483648.loc21) [template = constants.%int_2147483648.2] @@ -122,7 +114,7 @@ let e: f64 = 5.0e39999999999999999993; // CHECK:STDOUT: %.loc21_27.2: %i32 = converted %int_2147483648.loc21, %.loc21_27.1 [template = constants.%int_2147483648.2] // CHECK:STDOUT: %b: %i32 = bind_name b, %.loc21_27.2 // CHECK:STDOUT: %int_2147483648.loc27: Core.IntLiteral = int_value 2147483648 [template = constants.%int_2147483648.1] -// CHECK:STDOUT: %impl.elem0.loc27: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc27: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc27: = bound_method %int_2147483648.loc27, %impl.elem0.loc27 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc27: = specific_function %Convert.bound.loc27, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc27: init %i32 = call %Convert.specific_fn.loc27(%int_2147483648.loc27) [template = constants.%int_2147483648.2] diff --git a/toolchain/check/testdata/basics/numeric_literals.carbon b/toolchain/check/testdata/basics/numeric_literals.carbon index 8cc57993a5395..052ab63f6f82f 100644 --- a/toolchain/check/testdata/basics/numeric_literals.carbon +++ b/toolchain/check/testdata/basics/numeric_literals.carbon @@ -35,9 +35,7 @@ fn F() { // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %int_6: Core.IntLiteral = int_value 6 [template] // CHECK:STDOUT: %array_type.1: type = array_type %int_6, %i32 [template] // CHECK:STDOUT: %int_8.1: Core.IntLiteral = int_value 8 [template] @@ -46,20 +44,20 @@ fn F() { // CHECK:STDOUT: %tuple.type.1: type = tuple_type (Core.IntLiteral, Core.IntLiteral, Core.IntLiteral, Core.IntLiteral, Core.IntLiteral, Core.IntLiteral) [template] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_8.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_8.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_8.2: %i32 = int_value 8 [template] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_9.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_9.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_9.2: %i32 = int_value 9 [template] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template] // CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [template] -// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_2147483647.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_2147483647.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2147483647.2: %i32 = int_value 2147483647 [template] // CHECK:STDOUT: %int_5: Core.IntLiteral = int_value 5 [template] @@ -81,8 +79,8 @@ fn F() { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 -// CHECK:STDOUT: .Float = %import_ref.38 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 +// CHECK:STDOUT: .Float = %import_ref.193 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -100,10 +98,8 @@ fn F() { // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_6.loc14: Core.IntLiteral = int_value 6 [template = constants.%int_6] -// CHECK:STDOUT: %.loc14_14.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc14_14.2: type = converted %int.make_type_signed, %.loc14_14.1 [template = constants.%i32] // CHECK:STDOUT: %array_type.loc14: type = array_type %int_6.loc14, %i32 [template = constants.%array_type.1] // CHECK:STDOUT: %ints.var: ref %array_type.1 = var ints // CHECK:STDOUT: %ints: ref %array_type.1 = bind_name ints, %ints.var @@ -114,7 +110,7 @@ fn F() { // CHECK:STDOUT: %int_2147483647.loc19: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] // CHECK:STDOUT: %int_2147483647.loc20: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] // CHECK:STDOUT: %.loc21_3.1: %tuple.type.1 = tuple_literal (%int_8.loc15, %int_9, %int_8.loc17, %int_8.loc18, %int_2147483647.loc19, %int_2147483647.loc20) -// CHECK:STDOUT: %impl.elem0.loc21_3.1: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc21_3.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc21_3.1: = bound_method %int_8.loc15, %impl.elem0.loc21_3.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc21_3.1: = specific_function %Convert.bound.loc21_3.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc21_3.1: init %i32 = call %Convert.specific_fn.loc21_3.1(%int_8.loc15) [template = constants.%int_8.2] @@ -122,7 +118,7 @@ fn F() { // CHECK:STDOUT: %int_0.loc21: Core.IntLiteral = int_value 0 [template = constants.%int_0] // CHECK:STDOUT: %.loc21_3.3: ref %i32 = array_index %ints.var, %int_0.loc21 // CHECK:STDOUT: %.loc21_3.4: init %i32 = initialize_from %.loc21_3.2 to %.loc21_3.3 [template = constants.%int_8.2] -// CHECK:STDOUT: %impl.elem0.loc21_3.2: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc21_3.2: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc21_3.2: = bound_method %int_9, %impl.elem0.loc21_3.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc21_3.2: = specific_function %Convert.bound.loc21_3.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc21_3.2: init %i32 = call %Convert.specific_fn.loc21_3.2(%int_9) [template = constants.%int_9.2] @@ -130,7 +126,7 @@ fn F() { // CHECK:STDOUT: %int_1.loc21: Core.IntLiteral = int_value 1 [template = constants.%int_1] // CHECK:STDOUT: %.loc21_3.6: ref %i32 = array_index %ints.var, %int_1.loc21 // CHECK:STDOUT: %.loc21_3.7: init %i32 = initialize_from %.loc21_3.5 to %.loc21_3.6 [template = constants.%int_9.2] -// CHECK:STDOUT: %impl.elem0.loc21_3.3: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc21_3.3: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc21_3.3: = bound_method %int_8.loc17, %impl.elem0.loc21_3.3 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc21_3.3: = specific_function %Convert.bound.loc21_3.3, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc21_3.3: init %i32 = call %Convert.specific_fn.loc21_3.3(%int_8.loc17) [template = constants.%int_8.2] @@ -138,7 +134,7 @@ fn F() { // CHECK:STDOUT: %int_2.loc21: Core.IntLiteral = int_value 2 [template = constants.%int_2] // CHECK:STDOUT: %.loc21_3.9: ref %i32 = array_index %ints.var, %int_2.loc21 // CHECK:STDOUT: %.loc21_3.10: init %i32 = initialize_from %.loc21_3.8 to %.loc21_3.9 [template = constants.%int_8.2] -// CHECK:STDOUT: %impl.elem0.loc21_3.4: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc21_3.4: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc21_3.4: = bound_method %int_8.loc18, %impl.elem0.loc21_3.4 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc21_3.4: = specific_function %Convert.bound.loc21_3.4, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc21_3.4: init %i32 = call %Convert.specific_fn.loc21_3.4(%int_8.loc18) [template = constants.%int_8.2] @@ -146,7 +142,7 @@ fn F() { // CHECK:STDOUT: %int_3.loc21: Core.IntLiteral = int_value 3 [template = constants.%int_3] // CHECK:STDOUT: %.loc21_3.12: ref %i32 = array_index %ints.var, %int_3.loc21 // CHECK:STDOUT: %.loc21_3.13: init %i32 = initialize_from %.loc21_3.11 to %.loc21_3.12 [template = constants.%int_8.2] -// CHECK:STDOUT: %impl.elem0.loc21_3.5: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc21_3.5: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc21_3.5: = bound_method %int_2147483647.loc19, %impl.elem0.loc21_3.5 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc21_3.5: = specific_function %Convert.bound.loc21_3.5, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc21_3.5: init %i32 = call %Convert.specific_fn.loc21_3.5(%int_2147483647.loc19) [template = constants.%int_2147483647.2] @@ -154,7 +150,7 @@ fn F() { // CHECK:STDOUT: %int_4.loc21: Core.IntLiteral = int_value 4 [template = constants.%int_4] // CHECK:STDOUT: %.loc21_3.15: ref %i32 = array_index %ints.var, %int_4.loc21 // CHECK:STDOUT: %.loc21_3.16: init %i32 = initialize_from %.loc21_3.14 to %.loc21_3.15 [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %impl.elem0.loc21_3.6: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc21_3.6: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc21_3.6: = bound_method %int_2147483647.loc20, %impl.elem0.loc21_3.6 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc21_3.6: = specific_function %Convert.bound.loc21_3.6, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc21_3.6: init %i32 = call %Convert.specific_fn.loc21_3.6(%int_2147483647.loc20) [template = constants.%int_2147483647.2] diff --git a/toolchain/check/testdata/basics/parens.carbon b/toolchain/check/testdata/basics/parens.carbon index 91e02f89f77bc..1ef20850d5ace 100644 --- a/toolchain/check/testdata/basics/parens.carbon +++ b/toolchain/check/testdata/basics/parens.carbon @@ -15,19 +15,17 @@ var b: i32 = ((2)); // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] // CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] // CHECK:STDOUT: } @@ -35,7 +33,7 @@ var b: i32 = ((2)); // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -49,15 +47,11 @@ var b: i32 = ((2)); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int_32.loc11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11: init type = call constants.%Int(%int_32.loc11) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_8.1: type = value_of_initializer %int.make_type_signed.loc11 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_8.2: type = converted %int.make_type_signed.loc11, %.loc11_8.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.var: ref %i32 = var a // CHECK:STDOUT: %a: ref %i32 = bind_name a, %a.var // CHECK:STDOUT: %int_32.loc12: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc12: init type = call constants.%Int(%int_32.loc12) [template = constants.%i32] -// CHECK:STDOUT: %.loc12_8.1: type = value_of_initializer %int.make_type_signed.loc12 [template = constants.%i32] -// CHECK:STDOUT: %.loc12_8.2: type = converted %int.make_type_signed.loc12, %.loc12_8.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc12: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %b.var: ref %i32 = var b // CHECK:STDOUT: %b: ref %i32 = bind_name b, %b.var // CHECK:STDOUT: } @@ -65,14 +59,14 @@ var b: i32 = ((2)); // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc11: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc11: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11: = bound_method %int_1, %impl.elem0.loc11 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc11: = specific_function %Convert.bound.loc11, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc11: init %i32 = call %Convert.specific_fn.loc11(%int_1) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc11: init %i32 = converted %int_1, %int.convert_checked.loc11 [template = constants.%int_1.2] // CHECK:STDOUT: assign file.%a.var, %.loc11 // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %impl.elem0.loc12: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc12: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc12: = bound_method %int_2, %impl.elem0.loc12 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc12: = specific_function %Convert.bound.loc12, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc12: init %i32 = call %Convert.specific_fn.loc12(%int_2) [template = constants.%int_2.2] diff --git a/toolchain/check/testdata/basics/run_i32.carbon b/toolchain/check/testdata/basics/run_i32.carbon index eebb406e67891..4fce75b49abf2 100644 --- a/toolchain/check/testdata/basics/run_i32.carbon +++ b/toolchain/check/testdata/basics/run_i32.carbon @@ -14,17 +14,15 @@ fn Run() -> i32 { return 0; } // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %Run.type: type = fn_type @Run [template] // CHECK:STDOUT: %Run: %Run.type = struct_value () [template] // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] // CHECK:STDOUT: } @@ -32,7 +30,7 @@ fn Run() -> i32 { return 0; } // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -49,22 +47,18 @@ fn Run() -> i32 { return 0; } // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_13.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc11_13.2: type = converted %int.make_type_signed, %.loc11_13.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_17.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc11_17.2: type = converted %int.make_type_signed, %.loc11_17.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Run() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.2] diff --git a/toolchain/check/testdata/basics/type_literals.carbon b/toolchain/check/testdata/basics/type_literals.carbon index d46c86b0f53c9..2fec59c203ab4 100644 --- a/toolchain/check/testdata/basics/type_literals.carbon +++ b/toolchain/check/testdata/basics/type_literals.carbon @@ -33,7 +33,10 @@ var test_i1: i1; // CHECK:STDERR: ^~~ // CHECK:STDERR: var test_i15: i15; -// CHECK:STDERR: fail_iN_bad_width.carbon:[[@LINE+4]]:23: error: integer type width of 1000000000 is greater than the maximum supported width of 8388608 [IntWidthTooLarge] +// CHECK:STDERR: fail_iN_bad_width.carbon:[[@LINE+7]]:23: error: integer type width of 1000000000 is greater than the maximum supported width of 8388608 [IntWidthTooLarge] +// CHECK:STDERR: var test_i1000000000: i1000000000; +// CHECK:STDERR: ^~~~~~~~~~~ +// CHECK:STDERR: fail_iN_bad_width.carbon:[[@LINE+4]]:23: note: in `i1000000000` used here [ResolvingSpecificHere] // CHECK:STDERR: var test_i1000000000: i1000000000; // CHECK:STDERR: ^~~~~~~~~~~ // CHECK:STDERR: @@ -74,7 +77,10 @@ var test_u1: u1; // CHECK:STDERR: ^~~ // CHECK:STDERR: var test_u15: u15; -// CHECK:STDERR: fail_uN_bad_width.carbon:[[@LINE+4]]:23: error: integer type width of 1000000000 is greater than the maximum supported width of 8388608 [IntWidthTooLarge] +// CHECK:STDERR: fail_uN_bad_width.carbon:[[@LINE+7]]:23: error: integer type width of 1000000000 is greater than the maximum supported width of 8388608 [IntWidthTooLarge] +// CHECK:STDERR: var test_u1000000000: u1000000000; +// CHECK:STDERR: ^~~~~~~~~~~ +// CHECK:STDERR: fail_uN_bad_width.carbon:[[@LINE+4]]:23: note: in `u1000000000` used here [ResolvingSpecificHere] // CHECK:STDERR: var test_u1000000000: u1000000000; // CHECK:STDERR: ^~~~~~~~~~~ // CHECK:STDERR: @@ -123,18 +129,16 @@ var test_f128: f128; // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_8: Core.IntLiteral = int_value 8 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i8: type = int_type signed, %int_8 [template] +// CHECK:STDOUT: %i8: type = class_type @Int, @Int(%int_8) [template] // CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [template] -// CHECK:STDOUT: %i16: type = int_type signed, %int_16 [template] +// CHECK:STDOUT: %i16: type = class_type @Int, @Int(%int_16) [template] // CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [template] -// CHECK:STDOUT: %i64: type = int_type signed, %int_64 [template] +// CHECK:STDOUT: %i64: type = class_type @Int, @Int(%int_64) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -149,21 +153,15 @@ var test_f128: f128; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int_8: Core.IntLiteral = int_value 8 [template = constants.%int_8] -// CHECK:STDOUT: %int.make_type_signed.loc3: init type = call constants.%Int(%int_8) [template = constants.%i8] -// CHECK:STDOUT: %.loc3_14.1: type = value_of_initializer %int.make_type_signed.loc3 [template = constants.%i8] -// CHECK:STDOUT: %.loc3_14.2: type = converted %int.make_type_signed.loc3, %.loc3_14.1 [template = constants.%i8] +// CHECK:STDOUT: %i8: type = class_type @Int, @Int(constants.%int_8) [template = constants.%i8] // CHECK:STDOUT: %test_i8.var: ref %i8 = var test_i8 // CHECK:STDOUT: %test_i8: ref %i8 = bind_name test_i8, %test_i8.var // CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [template = constants.%int_16] -// CHECK:STDOUT: %int.make_type_signed.loc4: init type = call constants.%Int(%int_16) [template = constants.%i16] -// CHECK:STDOUT: %.loc4_15.1: type = value_of_initializer %int.make_type_signed.loc4 [template = constants.%i16] -// CHECK:STDOUT: %.loc4_15.2: type = converted %int.make_type_signed.loc4, %.loc4_15.1 [template = constants.%i16] +// CHECK:STDOUT: %i16: type = class_type @Int, @Int(constants.%int_16) [template = constants.%i16] // CHECK:STDOUT: %test_i16.var: ref %i16 = var test_i16 // CHECK:STDOUT: %test_i16: ref %i16 = bind_name test_i16, %test_i16.var // CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %int.make_type_signed.loc5: init type = call constants.%Int(%int_64) [template = constants.%i64] -// CHECK:STDOUT: %.loc5_15.1: type = value_of_initializer %int.make_type_signed.loc5 [template = constants.%i64] -// CHECK:STDOUT: %.loc5_15.2: type = converted %int.make_type_signed.loc5, %.loc5_15.1 [template = constants.%i64] +// CHECK:STDOUT: %i64: type = class_type @Int, @Int(constants.%int_64) [template = constants.%i64] // CHECK:STDOUT: %test_i64.var: ref %i64 = var test_i64 // CHECK:STDOUT: %test_i64: ref %i64 = bind_name test_i64, %test_i64.var // CHECK:STDOUT: } @@ -179,18 +177,16 @@ var test_f128: f128; // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_8: Core.IntLiteral = int_value 8 [template] -// CHECK:STDOUT: %UInt.type: type = fn_type @UInt [template] -// CHECK:STDOUT: %UInt: %UInt.type = struct_value () [template] -// CHECK:STDOUT: %u8: type = int_type unsigned, %int_8 [template] +// CHECK:STDOUT: %u8: type = class_type @UInt, @UInt(%int_8) [template] // CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [template] -// CHECK:STDOUT: %u16: type = int_type unsigned, %int_16 [template] +// CHECK:STDOUT: %u16: type = class_type @UInt, @UInt(%int_16) [template] // CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [template] -// CHECK:STDOUT: %u64: type = int_type unsigned, %int_64 [template] +// CHECK:STDOUT: %u64: type = class_type @UInt, @UInt(%int_64) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .UInt = %import_ref +// CHECK:STDOUT: .UInt = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -205,21 +201,15 @@ var test_f128: f128; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int_8: Core.IntLiteral = int_value 8 [template = constants.%int_8] -// CHECK:STDOUT: %int.make_type_unsigned.loc3: init type = call constants.%UInt(%int_8) [template = constants.%u8] -// CHECK:STDOUT: %.loc3_14.1: type = value_of_initializer %int.make_type_unsigned.loc3 [template = constants.%u8] -// CHECK:STDOUT: %.loc3_14.2: type = converted %int.make_type_unsigned.loc3, %.loc3_14.1 [template = constants.%u8] +// CHECK:STDOUT: %u8: type = class_type @UInt, @UInt(constants.%int_8) [template = constants.%u8] // CHECK:STDOUT: %test_u8.var: ref %u8 = var test_u8 // CHECK:STDOUT: %test_u8: ref %u8 = bind_name test_u8, %test_u8.var // CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [template = constants.%int_16] -// CHECK:STDOUT: %int.make_type_unsigned.loc4: init type = call constants.%UInt(%int_16) [template = constants.%u16] -// CHECK:STDOUT: %.loc4_15.1: type = value_of_initializer %int.make_type_unsigned.loc4 [template = constants.%u16] -// CHECK:STDOUT: %.loc4_15.2: type = converted %int.make_type_unsigned.loc4, %.loc4_15.1 [template = constants.%u16] +// CHECK:STDOUT: %u16: type = class_type @UInt, @UInt(constants.%int_16) [template = constants.%u16] // CHECK:STDOUT: %test_u16.var: ref %u16 = var test_u16 // CHECK:STDOUT: %test_u16: ref %u16 = bind_name test_u16, %test_u16.var // CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %int.make_type_unsigned.loc5: init type = call constants.%UInt(%int_64) [template = constants.%u64] -// CHECK:STDOUT: %.loc5_15.1: type = value_of_initializer %int.make_type_unsigned.loc5 [template = constants.%u64] -// CHECK:STDOUT: %.loc5_15.2: type = converted %int.make_type_unsigned.loc5, %.loc5_15.1 [template = constants.%u64] +// CHECK:STDOUT: %u64: type = class_type @UInt, @UInt(constants.%int_64) [template = constants.%u64] // CHECK:STDOUT: %test_u64.var: ref %u64 = var test_u64 // CHECK:STDOUT: %test_u64: ref %u64 = bind_name test_u64, %test_u64.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/builtins/float/make_type.carbon b/toolchain/check/testdata/builtins/float/make_type.carbon index b94b72d37f769..7fb8e8f28e4f6 100644 --- a/toolchain/check/testdata/builtins/float/make_type.carbon +++ b/toolchain/check/testdata/builtins/float/make_type.carbon @@ -48,16 +48,14 @@ var dyn: Float(dyn_size); // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %Float.type: type = fn_type @Float [template] // CHECK:STDOUT: %Float: %Float.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -76,9 +74,7 @@ var dyn: Float(dyn_size); // CHECK:STDOUT: %return.param_patt: type = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc4_16.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc4_16.2: type = converted %int.make_type_signed, %.loc4_16.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %size.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %size: %i32 = bind_name size, %size.param // CHECK:STDOUT: %return.param: ref type = out_param runtime_param1 @@ -94,18 +90,16 @@ var dyn: Float(dyn_size); // CHECK:STDOUT: %Float.type: type = fn_type @Float [template] // CHECK:STDOUT: %Float: %Float.type = struct_value () [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %int_64.1: Core.IntLiteral = int_value 64 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_64.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound: = bound_method %int_64.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_64.2: %i32 = int_value 64 [template] // CHECK:STDOUT: %float: f64 = float_literal 0 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] // CHECK:STDOUT: %GetFloat.type: type = fn_type @GetFloat [template] // CHECK:STDOUT: %GetFloat: %GetFloat.type = struct_value () [template] // CHECK:STDOUT: } @@ -113,8 +107,8 @@ var dyn: Float(dyn_size); // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: %Float.type = import_ref Main//types, Float, loaded [template = constants.%Float] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 -// CHECK:STDOUT: .Int = %import_ref.38 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 +// CHECK:STDOUT: .Int = %import_ref.193 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -131,7 +125,7 @@ var dyn: Float(dyn_size); // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %Float.ref: %Float.type = name_ref Float, imports.%import_ref.1 [template = constants.%Float] // CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [template = constants.%int_64.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_64, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_64) [template = constants.%int_64.2] @@ -149,9 +143,7 @@ var dyn: Float(dyn_size); // CHECK:STDOUT: %return.param_patt: type = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc8_23.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc8_23.2: type = converted %int.make_type_signed, %.loc8_23.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %dyn_size.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %dyn_size: %i32 = bind_name dyn_size, %dyn_size.param // CHECK:STDOUT: %return.param: ref type = out_param runtime_param1 @@ -184,18 +176,16 @@ var dyn: Float(dyn_size); // CHECK:STDOUT: %Float.type: type = fn_type @Float [template] // CHECK:STDOUT: %Float: %Float.type = struct_value () [template] // CHECK:STDOUT: %int_32.1: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32.1 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32.1) [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32.1) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_32.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32.1) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_32.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32.1) [template] // CHECK:STDOUT: %int_32.2: %i32 = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] // CHECK:STDOUT: %int_64.1: Core.IntLiteral = int_value 64 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_64.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_64.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32.1) [template] // CHECK:STDOUT: %int_64.2: %i32 = int_value 64 [template] // CHECK:STDOUT: } @@ -203,8 +193,8 @@ var dyn: Float(dyn_size); // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: %Float.type = import_ref Main//types, Float, loaded [template = constants.%Float] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 -// CHECK:STDOUT: .Int = %import_ref.38 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 +// CHECK:STDOUT: .Int = %import_ref.193 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -222,7 +212,7 @@ var dyn: Float(dyn_size); // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %Float.ref.loc10: %Float.type = name_ref Float, imports.%import_ref.1 [template = constants.%Float] // CHECK:STDOUT: %int_32.loc10: Core.IntLiteral = int_value 32 [template = constants.%int_32.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_32.loc10, %impl.elem0 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32.1) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_32.loc10) [template = constants.%int_32.2] @@ -234,9 +224,7 @@ var dyn: Float(dyn_size); // CHECK:STDOUT: %invalid_float.var: ref = var invalid_float // CHECK:STDOUT: %invalid_float: ref = bind_name invalid_float, %invalid_float.var // CHECK:STDOUT: %int_32.loc12: Core.IntLiteral = int_value 32 [template = constants.%int_32.1] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32.loc12) [template = constants.%i32] -// CHECK:STDOUT: %.loc12_15.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc12_15.2: type = converted %int.make_type_signed, %.loc12_15.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32.1) [template = constants.%i32] // CHECK:STDOUT: %dyn_size.var: ref %i32 = var dyn_size // CHECK:STDOUT: %dyn_size: ref %i32 = bind_name dyn_size, %dyn_size.var // CHECK:STDOUT: %Float.ref.loc16: %Float.type = name_ref Float, imports.%import_ref.1 [template = constants.%Float] @@ -254,7 +242,7 @@ var dyn: Float(dyn_size); // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [template = constants.%int_64.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_64, %impl.elem0 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32.1) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_64) [template = constants.%int_64.2] diff --git a/toolchain/check/testdata/builtins/int/and.carbon b/toolchain/check/testdata/builtins/int/and.carbon index bc568e833de0d..be154cb47204f 100644 --- a/toolchain/check/testdata/builtins/int/and.carbon +++ b/toolchain/check/testdata/builtins/int/and.carbon @@ -23,30 +23,28 @@ fn RuntimeCall(a: i32, b: i32) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %And.type: type = fn_type @And [template] // CHECK:STDOUT: %And: %And.type = struct_value () [template] // CHECK:STDOUT: %int_12.1: Core.IntLiteral = int_value 12 [template] // CHECK:STDOUT: %int_10.1: Core.IntLiteral = int_value 10 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_12.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_12.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_12.2: %i32 = int_value 12 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_10.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_10.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_10.2: %i32 = int_value 10 [template] // CHECK:STDOUT: %int_8.1: %i32 = int_value 8 [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.4, @impl.3(%int_32) [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %interface.10: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_8.1, %Convert.15 [template] -// CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.4(%int_32) [template] +// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.3, @impl.2(%int_32) [template] +// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [template] +// CHECK:STDOUT: %interface.6: = interface_witness (%Convert.11) [template] +// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_8.1, %Convert.11 [template] +// CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.3(%int_32) [template] // CHECK:STDOUT: %int_8.2: Core.IntLiteral = int_value 8 [template] // CHECK:STDOUT: %array_type: type = array_type %int_8.2, %i32 [template] // CHECK:STDOUT: %ptr: type = ptr_type %array_type [template] @@ -57,7 +55,7 @@ fn RuntimeCall(a: i32, b: i32) -> i32 { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -81,17 +79,11 @@ fn RuntimeCall(a: i32, b: i32) -> i32 { // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc2_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc2_11: init type = call constants.%Int(%int_32.loc2_11) [template = constants.%i32] -// CHECK:STDOUT: %.loc2_11.1: type = value_of_initializer %int.make_type_signed.loc2_11 [template = constants.%i32] -// CHECK:STDOUT: %.loc2_11.2: type = converted %int.make_type_signed.loc2_11, %.loc2_11.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc2_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc2_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc2_19: init type = call constants.%Int(%int_32.loc2_19) [template = constants.%i32] -// CHECK:STDOUT: %.loc2_19.1: type = value_of_initializer %int.make_type_signed.loc2_19 [template = constants.%i32] -// CHECK:STDOUT: %.loc2_19.2: type = converted %int.make_type_signed.loc2_19, %.loc2_19.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc2_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc2_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc2_27: init type = call constants.%Int(%int_32.loc2_27) [template = constants.%i32] -// CHECK:STDOUT: %.loc2_27.1: type = value_of_initializer %int.make_type_signed.loc2_27 [template = constants.%i32] -// CHECK:STDOUT: %.loc2_27.2: type = converted %int.make_type_signed.loc2_27, %.loc2_27.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc2_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 @@ -100,28 +92,26 @@ fn RuntimeCall(a: i32, b: i32) -> i32 { // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %int_32.loc4: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc4: init type = call constants.%Int(%int_32.loc4) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc4: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %And.ref: %And.type = name_ref And, %And.decl [template = constants.%And] // CHECK:STDOUT: %int_12: Core.IntLiteral = int_value 12 [template = constants.%int_12.1] // CHECK:STDOUT: %int_10: Core.IntLiteral = int_value 10 [template = constants.%int_10.1] -// CHECK:STDOUT: %impl.elem0.loc4_20: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc4_20: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc4_20: = bound_method %int_12, %impl.elem0.loc4_20 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc4_20: = specific_function %Convert.bound.loc4_20, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc4_20: init %i32 = call %Convert.specific_fn.loc4_20(%int_12) [template = constants.%int_12.2] // CHECK:STDOUT: %.loc4_20.1: %i32 = value_of_initializer %int.convert_checked.loc4_20 [template = constants.%int_12.2] // CHECK:STDOUT: %.loc4_20.2: %i32 = converted %int_12, %.loc4_20.1 [template = constants.%int_12.2] -// CHECK:STDOUT: %impl.elem0.loc4_24: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc4_24: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc4_24: = bound_method %int_10, %impl.elem0.loc4_24 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc4_24: = specific_function %Convert.bound.loc4_24, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc4_24: init %i32 = call %Convert.specific_fn.loc4_24(%int_10) [template = constants.%int_10.2] // CHECK:STDOUT: %.loc4_24.1: %i32 = value_of_initializer %int.convert_checked.loc4_24 [template = constants.%int_10.2] // CHECK:STDOUT: %.loc4_24.2: %i32 = converted %int_10, %.loc4_24.1 [template = constants.%int_10.2] // CHECK:STDOUT: %int.and: init %i32 = call %And.ref(%.loc4_20.2, %.loc4_24.2) [template = constants.%int_8.1] -// CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_signed.loc4 [template = constants.%i32] -// CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_signed.loc4, %.loc4_11.1 [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc4_26: %Convert.type.6 = interface_witness_access constants.%interface.10, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %impl.elem0.loc4_26: %Convert.type.5 = interface_witness_access constants.%interface.6, element0 [template = constants.%Convert.11] // CHECK:STDOUT: %Convert.bound.loc4_26: = bound_method %int.and, %impl.elem0.loc4_26 [template = constants.%Convert.bound.3] -// CHECK:STDOUT: %Convert.specific_fn.loc4_26: = specific_function %Convert.bound.loc4_26, @Convert.4(constants.%int_32) [template = constants.%Convert.specific_fn.3] +// CHECK:STDOUT: %Convert.specific_fn.loc4_26: = specific_function %Convert.bound.loc4_26, @Convert.3(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %.loc4_26.1: %i32 = value_of_initializer %int.and [template = constants.%int_8.1] // CHECK:STDOUT: %.loc4_26.2: %i32 = converted %int.and, %.loc4_26.1 [template = constants.%int_8.1] // CHECK:STDOUT: %int.convert_checked.loc4_26: init Core.IntLiteral = call %Convert.specific_fn.loc4_26(%.loc4_26.2) [template = constants.%int_8.2] @@ -131,10 +121,8 @@ fn RuntimeCall(a: i32, b: i32) -> i32 { // CHECK:STDOUT: %arr.var: ref %array_type = var arr // CHECK:STDOUT: %arr: ref %array_type = bind_name arr, %arr.var // CHECK:STDOUT: %int_32.loc5: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc5: init type = call constants.%Int(%int_32.loc5) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc5: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_8: Core.IntLiteral = int_value 8 [template = constants.%int_8.2] -// CHECK:STDOUT: %.loc5_13.1: type = value_of_initializer %int.make_type_signed.loc5 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_13.2: type = converted %int.make_type_signed.loc5, %.loc5_13.1 [template = constants.%i32] // CHECK:STDOUT: %array_type.loc5: type = array_type %int_8, %i32 [template = constants.%array_type] // CHECK:STDOUT: %ptr: type = ptr_type %array_type [template = constants.%ptr] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { @@ -146,17 +134,11 @@ fn RuntimeCall(a: i32, b: i32) -> i32 { // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc7_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc7_19: init type = call constants.%Int(%int_32.loc7_19) [template = constants.%i32] -// CHECK:STDOUT: %.loc7_19.1: type = value_of_initializer %int.make_type_signed.loc7_19 [template = constants.%i32] -// CHECK:STDOUT: %.loc7_19.2: type = converted %int.make_type_signed.loc7_19, %.loc7_19.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc7_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc7_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc7_27: init type = call constants.%Int(%int_32.loc7_27) [template = constants.%i32] -// CHECK:STDOUT: %.loc7_27.1: type = value_of_initializer %int.make_type_signed.loc7_27 [template = constants.%i32] -// CHECK:STDOUT: %.loc7_27.2: type = converted %int.make_type_signed.loc7_27, %.loc7_27.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc7_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc7_35: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc7_35: init type = call constants.%Int(%int_32.loc7_35) [template = constants.%i32] -// CHECK:STDOUT: %.loc7_35.1: type = value_of_initializer %int.make_type_signed.loc7_35 [template = constants.%i32] -// CHECK:STDOUT: %.loc7_35.2: type = converted %int.make_type_signed.loc7_35, %.loc7_35.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc7_35: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 diff --git a/toolchain/check/testdata/builtins/int/complement.carbon b/toolchain/check/testdata/builtins/int/complement.carbon index 6394ed63515b7..7ab8b08777fc6 100644 --- a/toolchain/check/testdata/builtins/int/complement.carbon +++ b/toolchain/check/testdata/builtins/int/complement.carbon @@ -24,33 +24,31 @@ fn RuntimeCall(a: i32) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %Complement.type: type = fn_type @Complement [template] // CHECK:STDOUT: %Complement: %Complement.type = struct_value () [template] // CHECK:STDOUT: %And.type: type = fn_type @And [template] // CHECK:STDOUT: %And: %And.type = struct_value () [template] // CHECK:STDOUT: %int_1193046.1: Core.IntLiteral = int_value 1193046 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1193046.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1193046.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1193046.2: %i32 = int_value 1193046 [template] // CHECK:STDOUT: %int_-1193047: %i32 = int_value -1193047 [template] // CHECK:STDOUT: %int_16777215.1: Core.IntLiteral = int_value 16777215 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_16777215.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_16777215.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_16777215.2: %i32 = int_value 16777215 [template] // CHECK:STDOUT: %int_15584169.1: %i32 = int_value 15584169 [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.4, @impl.3(%int_32) [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %interface.10: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_15584169.1, %Convert.15 [template] -// CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.4(%int_32) [template] +// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.3, @impl.2(%int_32) [template] +// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [template] +// CHECK:STDOUT: %interface.6: = interface_witness (%Convert.11) [template] +// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_15584169.1, %Convert.11 [template] +// CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.3(%int_32) [template] // CHECK:STDOUT: %int_15584169.2: Core.IntLiteral = int_value 15584169 [template] // CHECK:STDOUT: %array_type: type = array_type %int_15584169.2, %i32 [template] // CHECK:STDOUT: %ptr: type = ptr_type %array_type [template] @@ -61,7 +59,7 @@ fn RuntimeCall(a: i32) -> i32 { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -84,13 +82,9 @@ fn RuntimeCall(a: i32) -> i32 { // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc2_18: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc2_18: init type = call constants.%Int(%int_32.loc2_18) [template = constants.%i32] -// CHECK:STDOUT: %.loc2_18.1: type = value_of_initializer %int.make_type_signed.loc2_18 [template = constants.%i32] -// CHECK:STDOUT: %.loc2_18.2: type = converted %int.make_type_signed.loc2_18, %.loc2_18.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc2_18: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc2_26: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc2_26: init type = call constants.%Int(%int_32.loc2_26) [template = constants.%i32] -// CHECK:STDOUT: %.loc2_26.1: type = value_of_initializer %int.make_type_signed.loc2_26 [template = constants.%i32] -// CHECK:STDOUT: %.loc2_26.2: type = converted %int.make_type_signed.loc2_26, %.loc2_26.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc2_26: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 @@ -105,17 +99,11 @@ fn RuntimeCall(a: i32) -> i32 { // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc3_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc3_11: init type = call constants.%Int(%int_32.loc3_11) [template = constants.%i32] -// CHECK:STDOUT: %.loc3_11.1: type = value_of_initializer %int.make_type_signed.loc3_11 [template = constants.%i32] -// CHECK:STDOUT: %.loc3_11.2: type = converted %int.make_type_signed.loc3_11, %.loc3_11.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc3_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc3_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc3_19: init type = call constants.%Int(%int_32.loc3_19) [template = constants.%i32] -// CHECK:STDOUT: %.loc3_19.1: type = value_of_initializer %int.make_type_signed.loc3_19 [template = constants.%i32] -// CHECK:STDOUT: %.loc3_19.2: type = converted %int.make_type_signed.loc3_19, %.loc3_19.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc3_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc3_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc3_27: init type = call constants.%Int(%int_32.loc3_27) [template = constants.%i32] -// CHECK:STDOUT: %.loc3_27.1: type = value_of_initializer %int.make_type_signed.loc3_27 [template = constants.%i32] -// CHECK:STDOUT: %.loc3_27.2: type = converted %int.make_type_signed.loc3_27, %.loc3_27.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc3_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 @@ -124,11 +112,11 @@ fn RuntimeCall(a: i32) -> i32 { // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %int_32.loc5: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc5: init type = call constants.%Int(%int_32.loc5) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc5: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %And.ref: %And.type = name_ref And, %And.decl [template = constants.%And] // CHECK:STDOUT: %Complement.ref: %Complement.type = name_ref Complement, %Complement.decl [template = constants.%Complement] // CHECK:STDOUT: %int_1193046: Core.IntLiteral = int_value 1193046 [template = constants.%int_1193046.1] -// CHECK:STDOUT: %impl.elem0.loc5_31: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc5_31: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc5_31: = bound_method %int_1193046, %impl.elem0.loc5_31 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc5_31: = specific_function %Convert.bound.loc5_31, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc5_31: init %i32 = call %Convert.specific_fn.loc5_31(%int_1193046) [template = constants.%int_1193046.2] @@ -138,18 +126,16 @@ fn RuntimeCall(a: i32) -> i32 { // CHECK:STDOUT: %int_16777215: Core.IntLiteral = int_value 16777215 [template = constants.%int_16777215.1] // CHECK:STDOUT: %.loc5_39.1: %i32 = value_of_initializer %int.complement [template = constants.%int_-1193047] // CHECK:STDOUT: %.loc5_39.2: %i32 = converted %int.complement, %.loc5_39.1 [template = constants.%int_-1193047] -// CHECK:STDOUT: %impl.elem0.loc5_42: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc5_42: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc5_42: = bound_method %int_16777215, %impl.elem0.loc5_42 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc5_42: = specific_function %Convert.bound.loc5_42, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc5_42: init %i32 = call %Convert.specific_fn.loc5_42(%int_16777215) [template = constants.%int_16777215.2] // CHECK:STDOUT: %.loc5_42.1: %i32 = value_of_initializer %int.convert_checked.loc5_42 [template = constants.%int_16777215.2] // CHECK:STDOUT: %.loc5_42.2: %i32 = converted %int_16777215, %.loc5_42.1 [template = constants.%int_16777215.2] // CHECK:STDOUT: %int.and: init %i32 = call %And.ref(%.loc5_39.2, %.loc5_42.2) [template = constants.%int_15584169.1] -// CHECK:STDOUT: %.loc5_11.1: type = value_of_initializer %int.make_type_signed.loc5 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_11.2: type = converted %int.make_type_signed.loc5, %.loc5_11.1 [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc5_50: %Convert.type.6 = interface_witness_access constants.%interface.10, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %impl.elem0.loc5_50: %Convert.type.5 = interface_witness_access constants.%interface.6, element0 [template = constants.%Convert.11] // CHECK:STDOUT: %Convert.bound.loc5_50: = bound_method %int.and, %impl.elem0.loc5_50 [template = constants.%Convert.bound.3] -// CHECK:STDOUT: %Convert.specific_fn.loc5_50: = specific_function %Convert.bound.loc5_50, @Convert.4(constants.%int_32) [template = constants.%Convert.specific_fn.3] +// CHECK:STDOUT: %Convert.specific_fn.loc5_50: = specific_function %Convert.bound.loc5_50, @Convert.3(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %.loc5_50.1: %i32 = value_of_initializer %int.and [template = constants.%int_15584169.1] // CHECK:STDOUT: %.loc5_50.2: %i32 = converted %int.and, %.loc5_50.1 [template = constants.%int_15584169.1] // CHECK:STDOUT: %int.convert_checked.loc5_50: init Core.IntLiteral = call %Convert.specific_fn.loc5_50(%.loc5_50.2) [template = constants.%int_15584169.2] @@ -159,10 +145,8 @@ fn RuntimeCall(a: i32) -> i32 { // CHECK:STDOUT: %arr.var: ref %array_type = var arr // CHECK:STDOUT: %arr: ref %array_type = bind_name arr, %arr.var // CHECK:STDOUT: %int_32.loc6: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc6: init type = call constants.%Int(%int_32.loc6) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc6: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_15584169: Core.IntLiteral = int_value 15584169 [template = constants.%int_15584169.2] -// CHECK:STDOUT: %.loc6_13.1: type = value_of_initializer %int.make_type_signed.loc6 [template = constants.%i32] -// CHECK:STDOUT: %.loc6_13.2: type = converted %int.make_type_signed.loc6, %.loc6_13.1 [template = constants.%i32] // CHECK:STDOUT: %array_type.loc6: type = array_type %int_15584169, %i32 [template = constants.%array_type] // CHECK:STDOUT: %ptr: type = ptr_type %array_type [template = constants.%ptr] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { @@ -172,13 +156,9 @@ fn RuntimeCall(a: i32) -> i32 { // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc8_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc8_19: init type = call constants.%Int(%int_32.loc8_19) [template = constants.%i32] -// CHECK:STDOUT: %.loc8_19.1: type = value_of_initializer %int.make_type_signed.loc8_19 [template = constants.%i32] -// CHECK:STDOUT: %.loc8_19.2: type = converted %int.make_type_signed.loc8_19, %.loc8_19.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc8_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc8_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc8_27: init type = call constants.%Int(%int_32.loc8_27) [template = constants.%i32] -// CHECK:STDOUT: %.loc8_27.1: type = value_of_initializer %int.make_type_signed.loc8_27 [template = constants.%i32] -// CHECK:STDOUT: %.loc8_27.2: type = converted %int.make_type_signed.loc8_27, %.loc8_27.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc8_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 diff --git a/toolchain/check/testdata/builtins/int/convert_checked.carbon b/toolchain/check/testdata/builtins/int/convert_checked.carbon index 19dab04fe00f0..31a00ee65264f 100644 --- a/toolchain/check/testdata/builtins/int/convert_checked.carbon +++ b/toolchain/check/testdata/builtins/int/convert_checked.carbon @@ -252,16 +252,12 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %NegateI32.type: type = fn_type @NegateI32 [template] // CHECK:STDOUT: %NegateI32: %NegateI32.type = struct_value () [template] // CHECK:STDOUT: %SubI32.type: type = fn_type @SubI32 [template] // CHECK:STDOUT: %SubI32: %SubI32.type = struct_value () [template] -// CHECK:STDOUT: %UInt.type: type = fn_type @UInt [template] -// CHECK:STDOUT: %UInt: %UInt.type = struct_value () [template] -// CHECK:STDOUT: %u32: type = int_type unsigned, %int_32 [template] +// CHECK:STDOUT: %u32: type = class_type @UInt, @UInt(%int_32) [template] // CHECK:STDOUT: %AddU32.type: type = fn_type @AddU32 [template] // CHECK:STDOUT: %AddU32: %AddU32.type = struct_value () [template] // CHECK:STDOUT: %IntLiteral.type: type = fn_type @IntLiteral [template] @@ -277,10 +273,10 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %IntLiteralToIntLiteral.type: type = fn_type @IntLiteralToIntLiteral [template] // CHECK:STDOUT: %IntLiteralToIntLiteral: %IntLiteralToIntLiteral.type = struct_value () [template] // CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [template] -// CHECK:STDOUT: %i16: type = int_type signed, %int_16 [template] +// CHECK:STDOUT: %i16: type = class_type @Int, @Int(%int_16) [template] // CHECK:STDOUT: %Int32ToInt16.type: type = fn_type @Int32ToInt16 [template] // CHECK:STDOUT: %Int32ToInt16: %Int32ToInt16.type = struct_value () [template] -// CHECK:STDOUT: %u16: type = int_type unsigned, %int_16 [template] +// CHECK:STDOUT: %u16: type = class_type @UInt, @UInt(%int_16) [template] // CHECK:STDOUT: %Int32ToUint16.type: type = fn_type @Int32ToUint16 [template] // CHECK:STDOUT: %Int32ToUint16: %Int32ToUint16.type = struct_value () [template] // CHECK:STDOUT: %Uint32ToInt16.type: type = fn_type @Uint32ToInt16 [template] @@ -292,10 +288,10 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %IntLiteralToUint16.type: type = fn_type @IntLiteralToUint16 [template] // CHECK:STDOUT: %IntLiteralToUint16: %IntLiteralToUint16.type = struct_value () [template] // CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [template] -// CHECK:STDOUT: %i64: type = int_type signed, %int_64 [template] +// CHECK:STDOUT: %i64: type = class_type @Int, @Int(%int_64) [template] // CHECK:STDOUT: %Int32ToInt64.type: type = fn_type @Int32ToInt64 [template] // CHECK:STDOUT: %Int32ToInt64: %Int32ToInt64.type = struct_value () [template] -// CHECK:STDOUT: %u64: type = int_type unsigned, %int_64 [template] +// CHECK:STDOUT: %u64: type = class_type @UInt, @UInt(%int_64) [template] // CHECK:STDOUT: %Int32ToUint64.type: type = fn_type @Int32ToUint64 [template] // CHECK:STDOUT: %Int32ToUint64: %Int32ToUint64.type = struct_value () [template] // CHECK:STDOUT: %Uint32ToInt64.type: type = fn_type @Uint32ToInt64 [template] @@ -311,7 +307,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .UInt = %import_ref.2 +// CHECK:STDOUT: .UInt = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -350,13 +346,9 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc4_17: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc4_17: init type = call constants.%Int(%int_32.loc4_17) [template = constants.%i32] -// CHECK:STDOUT: %.loc4_17.1: type = value_of_initializer %int.make_type_signed.loc4_17 [template = constants.%i32] -// CHECK:STDOUT: %.loc4_17.2: type = converted %int.make_type_signed.loc4_17, %.loc4_17.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc4_17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc4_25: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc4_25: init type = call constants.%Int(%int_32.loc4_25) [template = constants.%i32] -// CHECK:STDOUT: %.loc4_25.1: type = value_of_initializer %int.make_type_signed.loc4_25 [template = constants.%i32] -// CHECK:STDOUT: %.loc4_25.2: type = converted %int.make_type_signed.loc4_25, %.loc4_25.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc4_25: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 @@ -371,17 +363,11 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc5_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc5_14: init type = call constants.%Int(%int_32.loc5_14) [template = constants.%i32] -// CHECK:STDOUT: %.loc5_14.1: type = value_of_initializer %int.make_type_signed.loc5_14 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_14.2: type = converted %int.make_type_signed.loc5_14, %.loc5_14.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc5_14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc5_22: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc5_22: init type = call constants.%Int(%int_32.loc5_22) [template = constants.%i32] -// CHECK:STDOUT: %.loc5_22.1: type = value_of_initializer %int.make_type_signed.loc5_22 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_22.2: type = converted %int.make_type_signed.loc5_22, %.loc5_22.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc5_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc5_30: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc5_30: init type = call constants.%Int(%int_32.loc5_30) [template = constants.%i32] -// CHECK:STDOUT: %.loc5_30.1: type = value_of_initializer %int.make_type_signed.loc5_30 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_30.2: type = converted %int.make_type_signed.loc5_30, %.loc5_30.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc5_30: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 @@ -398,17 +384,11 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %return.param_patt: %u32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc6_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_unsigned.loc6_14: init type = call constants.%UInt(%int_32.loc6_14) [template = constants.%u32] -// CHECK:STDOUT: %.loc6_14.1: type = value_of_initializer %int.make_type_unsigned.loc6_14 [template = constants.%u32] -// CHECK:STDOUT: %.loc6_14.2: type = converted %int.make_type_unsigned.loc6_14, %.loc6_14.1 [template = constants.%u32] +// CHECK:STDOUT: %u32.loc6_14: type = class_type @UInt, @UInt(constants.%int_32) [template = constants.%u32] // CHECK:STDOUT: %int_32.loc6_22: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_unsigned.loc6_22: init type = call constants.%UInt(%int_32.loc6_22) [template = constants.%u32] -// CHECK:STDOUT: %.loc6_22.1: type = value_of_initializer %int.make_type_unsigned.loc6_22 [template = constants.%u32] -// CHECK:STDOUT: %.loc6_22.2: type = converted %int.make_type_unsigned.loc6_22, %.loc6_22.1 [template = constants.%u32] +// CHECK:STDOUT: %u32.loc6_22: type = class_type @UInt, @UInt(constants.%int_32) [template = constants.%u32] // CHECK:STDOUT: %int_32.loc6_30: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_unsigned.loc6_30: init type = call constants.%UInt(%int_32.loc6_30) [template = constants.%u32] -// CHECK:STDOUT: %.loc6_30.1: type = value_of_initializer %int.make_type_unsigned.loc6_30 [template = constants.%u32] -// CHECK:STDOUT: %.loc6_30.2: type = converted %int.make_type_unsigned.loc6_30, %.loc6_30.1 [template = constants.%u32] +// CHECK:STDOUT: %u32.loc6_30: type = class_type @UInt, @UInt(constants.%int_32) [template = constants.%u32] // CHECK:STDOUT: %a.param: %u32 = value_param runtime_param0 // CHECK:STDOUT: %a: %u32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %u32 = value_param runtime_param1 @@ -430,13 +410,9 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc10_20: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc10_20: init type = call constants.%Int(%int_32.loc10_20) [template = constants.%i32] -// CHECK:STDOUT: %.loc10_20.1: type = value_of_initializer %int.make_type_signed.loc10_20 [template = constants.%i32] -// CHECK:STDOUT: %.loc10_20.2: type = converted %int.make_type_signed.loc10_20, %.loc10_20.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc10_20: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc10_28: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc10_28: init type = call constants.%Int(%int_32.loc10_28) [template = constants.%i32] -// CHECK:STDOUT: %.loc10_28.1: type = value_of_initializer %int.make_type_signed.loc10_28 [template = constants.%i32] -// CHECK:STDOUT: %.loc10_28.2: type = converted %int.make_type_signed.loc10_28, %.loc10_28.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc10_28: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 @@ -449,13 +425,9 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %return.param_patt: %u32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc11_21: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32.loc11_21) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_21.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc11_21.2: type = converted %int.make_type_signed, %.loc11_21.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc11_29: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_unsigned: init type = call constants.%UInt(%int_32.loc11_29) [template = constants.%u32] -// CHECK:STDOUT: %.loc11_29.1: type = value_of_initializer %int.make_type_unsigned [template = constants.%u32] -// CHECK:STDOUT: %.loc11_29.2: type = converted %int.make_type_unsigned, %.loc11_29.1 [template = constants.%u32] +// CHECK:STDOUT: %u32: type = class_type @UInt, @UInt(constants.%int_32) [template = constants.%u32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %u32 = out_param runtime_param1 @@ -468,13 +440,9 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc12_21: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_unsigned: init type = call constants.%UInt(%int_32.loc12_21) [template = constants.%u32] -// CHECK:STDOUT: %.loc12_21.1: type = value_of_initializer %int.make_type_unsigned [template = constants.%u32] -// CHECK:STDOUT: %.loc12_21.2: type = converted %int.make_type_unsigned, %.loc12_21.1 [template = constants.%u32] +// CHECK:STDOUT: %u32: type = class_type @UInt, @UInt(constants.%int_32) [template = constants.%u32] // CHECK:STDOUT: %int_32.loc12_29: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32.loc12_29) [template = constants.%i32] -// CHECK:STDOUT: %.loc12_29.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc12_29.2: type = converted %int.make_type_signed, %.loc12_29.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %u32 = value_param runtime_param0 // CHECK:STDOUT: %a: %u32 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 @@ -487,13 +455,9 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %return.param_patt: %u32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc13_22: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_unsigned.loc13_22: init type = call constants.%UInt(%int_32.loc13_22) [template = constants.%u32] -// CHECK:STDOUT: %.loc13_22.1: type = value_of_initializer %int.make_type_unsigned.loc13_22 [template = constants.%u32] -// CHECK:STDOUT: %.loc13_22.2: type = converted %int.make_type_unsigned.loc13_22, %.loc13_22.1 [template = constants.%u32] +// CHECK:STDOUT: %u32.loc13_22: type = class_type @UInt, @UInt(constants.%int_32) [template = constants.%u32] // CHECK:STDOUT: %int_32.loc13_30: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_unsigned.loc13_30: init type = call constants.%UInt(%int_32.loc13_30) [template = constants.%u32] -// CHECK:STDOUT: %.loc13_30.1: type = value_of_initializer %int.make_type_unsigned.loc13_30 [template = constants.%u32] -// CHECK:STDOUT: %.loc13_30.2: type = converted %int.make_type_unsigned.loc13_30, %.loc13_30.1 [template = constants.%u32] +// CHECK:STDOUT: %u32.loc13_30: type = class_type @UInt, @UInt(constants.%int_32) [template = constants.%u32] // CHECK:STDOUT: %a.param: %u32 = value_param runtime_param0 // CHECK:STDOUT: %a: %u32 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %u32 = out_param runtime_param1 @@ -525,13 +489,9 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %return.param_patt: %i16 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc18_20: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc18_20.1: type = value_of_initializer %int.make_type_signed.loc18_20 [template = constants.%i32] -// CHECK:STDOUT: %.loc18_20.2: type = converted %int.make_type_signed.loc18_20, %.loc18_20.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [template = constants.%int_16] -// CHECK:STDOUT: %int.make_type_signed.loc18_28: init type = call constants.%Int(%int_16) [template = constants.%i16] -// CHECK:STDOUT: %.loc18_28.1: type = value_of_initializer %int.make_type_signed.loc18_28 [template = constants.%i16] -// CHECK:STDOUT: %.loc18_28.2: type = converted %int.make_type_signed.loc18_28, %.loc18_28.1 [template = constants.%i16] +// CHECK:STDOUT: %i16: type = class_type @Int, @Int(constants.%int_16) [template = constants.%i16] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %i16 = out_param runtime_param1 @@ -544,13 +504,9 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %return.param_patt: %u16 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc19_21.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc19_21.2: type = converted %int.make_type_signed, %.loc19_21.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [template = constants.%int_16] -// CHECK:STDOUT: %int.make_type_unsigned: init type = call constants.%UInt(%int_16) [template = constants.%u16] -// CHECK:STDOUT: %.loc19_29.1: type = value_of_initializer %int.make_type_unsigned [template = constants.%u16] -// CHECK:STDOUT: %.loc19_29.2: type = converted %int.make_type_unsigned, %.loc19_29.1 [template = constants.%u16] +// CHECK:STDOUT: %u16: type = class_type @UInt, @UInt(constants.%int_16) [template = constants.%u16] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %u16 = out_param runtime_param1 @@ -563,13 +519,9 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %return.param_patt: %i16 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_unsigned: init type = call constants.%UInt(%int_32) [template = constants.%u32] -// CHECK:STDOUT: %.loc20_21.1: type = value_of_initializer %int.make_type_unsigned [template = constants.%u32] -// CHECK:STDOUT: %.loc20_21.2: type = converted %int.make_type_unsigned, %.loc20_21.1 [template = constants.%u32] +// CHECK:STDOUT: %u32: type = class_type @UInt, @UInt(constants.%int_32) [template = constants.%u32] // CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [template = constants.%int_16] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_16) [template = constants.%i16] -// CHECK:STDOUT: %.loc20_29.1: type = value_of_initializer %int.make_type_signed [template = constants.%i16] -// CHECK:STDOUT: %.loc20_29.2: type = converted %int.make_type_signed, %.loc20_29.1 [template = constants.%i16] +// CHECK:STDOUT: %i16: type = class_type @Int, @Int(constants.%int_16) [template = constants.%i16] // CHECK:STDOUT: %a.param: %u32 = value_param runtime_param0 // CHECK:STDOUT: %a: %u32 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %i16 = out_param runtime_param1 @@ -582,13 +534,9 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %return.param_patt: %u16 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_unsigned.loc21_22: init type = call constants.%UInt(%int_32) [template = constants.%u32] -// CHECK:STDOUT: %.loc21_22.1: type = value_of_initializer %int.make_type_unsigned.loc21_22 [template = constants.%u32] -// CHECK:STDOUT: %.loc21_22.2: type = converted %int.make_type_unsigned.loc21_22, %.loc21_22.1 [template = constants.%u32] +// CHECK:STDOUT: %u32: type = class_type @UInt, @UInt(constants.%int_32) [template = constants.%u32] // CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [template = constants.%int_16] -// CHECK:STDOUT: %int.make_type_unsigned.loc21_30: init type = call constants.%UInt(%int_16) [template = constants.%u16] -// CHECK:STDOUT: %.loc21_30.1: type = value_of_initializer %int.make_type_unsigned.loc21_30 [template = constants.%u16] -// CHECK:STDOUT: %.loc21_30.2: type = converted %int.make_type_unsigned.loc21_30, %.loc21_30.1 [template = constants.%u16] +// CHECK:STDOUT: %u16: type = class_type @UInt, @UInt(constants.%int_16) [template = constants.%u16] // CHECK:STDOUT: %a.param: %u32 = value_param runtime_param0 // CHECK:STDOUT: %a: %u32 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %u16 = out_param runtime_param1 @@ -605,9 +553,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %.loc22_36.1: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral] // CHECK:STDOUT: %.loc22_36.2: type = converted %int_literal.make_type, %.loc22_36.1 [template = Core.IntLiteral] // CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [template = constants.%int_16] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_16) [template = constants.%i16] -// CHECK:STDOUT: %.loc22_42.1: type = value_of_initializer %int.make_type_signed [template = constants.%i16] -// CHECK:STDOUT: %.loc22_42.2: type = converted %int.make_type_signed, %.loc22_42.1 [template = constants.%i16] +// CHECK:STDOUT: %i16: type = class_type @Int, @Int(constants.%int_16) [template = constants.%i16] // CHECK:STDOUT: %a.param: Core.IntLiteral = value_param runtime_param0 // CHECK:STDOUT: %a: Core.IntLiteral = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %i16 = out_param runtime_param1 @@ -624,9 +570,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %.loc23_37.1: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral] // CHECK:STDOUT: %.loc23_37.2: type = converted %int_literal.make_type, %.loc23_37.1 [template = Core.IntLiteral] // CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [template = constants.%int_16] -// CHECK:STDOUT: %int.make_type_unsigned: init type = call constants.%UInt(%int_16) [template = constants.%u16] -// CHECK:STDOUT: %.loc23_43.1: type = value_of_initializer %int.make_type_unsigned [template = constants.%u16] -// CHECK:STDOUT: %.loc23_43.2: type = converted %int.make_type_unsigned, %.loc23_43.1 [template = constants.%u16] +// CHECK:STDOUT: %u16: type = class_type @UInt, @UInt(constants.%int_16) [template = constants.%u16] // CHECK:STDOUT: %a.param: Core.IntLiteral = value_param runtime_param0 // CHECK:STDOUT: %a: Core.IntLiteral = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %u16 = out_param runtime_param1 @@ -639,13 +583,9 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %return.param_patt: %i64 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc26_20: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc26_20.1: type = value_of_initializer %int.make_type_signed.loc26_20 [template = constants.%i32] -// CHECK:STDOUT: %.loc26_20.2: type = converted %int.make_type_signed.loc26_20, %.loc26_20.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %int.make_type_signed.loc26_28: init type = call constants.%Int(%int_64) [template = constants.%i64] -// CHECK:STDOUT: %.loc26_28.1: type = value_of_initializer %int.make_type_signed.loc26_28 [template = constants.%i64] -// CHECK:STDOUT: %.loc26_28.2: type = converted %int.make_type_signed.loc26_28, %.loc26_28.1 [template = constants.%i64] +// CHECK:STDOUT: %i64: type = class_type @Int, @Int(constants.%int_64) [template = constants.%i64] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %i64 = out_param runtime_param1 @@ -658,13 +598,9 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %return.param_patt: %u64 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc27_21.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc27_21.2: type = converted %int.make_type_signed, %.loc27_21.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %int.make_type_unsigned: init type = call constants.%UInt(%int_64) [template = constants.%u64] -// CHECK:STDOUT: %.loc27_29.1: type = value_of_initializer %int.make_type_unsigned [template = constants.%u64] -// CHECK:STDOUT: %.loc27_29.2: type = converted %int.make_type_unsigned, %.loc27_29.1 [template = constants.%u64] +// CHECK:STDOUT: %u64: type = class_type @UInt, @UInt(constants.%int_64) [template = constants.%u64] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %u64 = out_param runtime_param1 @@ -677,13 +613,9 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %return.param_patt: %i64 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_unsigned: init type = call constants.%UInt(%int_32) [template = constants.%u32] -// CHECK:STDOUT: %.loc28_21.1: type = value_of_initializer %int.make_type_unsigned [template = constants.%u32] -// CHECK:STDOUT: %.loc28_21.2: type = converted %int.make_type_unsigned, %.loc28_21.1 [template = constants.%u32] +// CHECK:STDOUT: %u32: type = class_type @UInt, @UInt(constants.%int_32) [template = constants.%u32] // CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_64) [template = constants.%i64] -// CHECK:STDOUT: %.loc28_29.1: type = value_of_initializer %int.make_type_signed [template = constants.%i64] -// CHECK:STDOUT: %.loc28_29.2: type = converted %int.make_type_signed, %.loc28_29.1 [template = constants.%i64] +// CHECK:STDOUT: %i64: type = class_type @Int, @Int(constants.%int_64) [template = constants.%i64] // CHECK:STDOUT: %a.param: %u32 = value_param runtime_param0 // CHECK:STDOUT: %a: %u32 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %i64 = out_param runtime_param1 @@ -696,13 +628,9 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %return.param_patt: %u64 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_unsigned.loc29_22: init type = call constants.%UInt(%int_32) [template = constants.%u32] -// CHECK:STDOUT: %.loc29_22.1: type = value_of_initializer %int.make_type_unsigned.loc29_22 [template = constants.%u32] -// CHECK:STDOUT: %.loc29_22.2: type = converted %int.make_type_unsigned.loc29_22, %.loc29_22.1 [template = constants.%u32] +// CHECK:STDOUT: %u32: type = class_type @UInt, @UInt(constants.%int_32) [template = constants.%u32] // CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %int.make_type_unsigned.loc29_30: init type = call constants.%UInt(%int_64) [template = constants.%u64] -// CHECK:STDOUT: %.loc29_30.1: type = value_of_initializer %int.make_type_unsigned.loc29_30 [template = constants.%u64] -// CHECK:STDOUT: %.loc29_30.2: type = converted %int.make_type_unsigned.loc29_30, %.loc29_30.1 [template = constants.%u64] +// CHECK:STDOUT: %u64: type = class_type @UInt, @UInt(constants.%int_64) [template = constants.%u64] // CHECK:STDOUT: %a.param: %u32 = value_param runtime_param0 // CHECK:STDOUT: %a: %u32 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %u64 = out_param runtime_param1 @@ -715,9 +643,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %return.param_patt: Core.IntLiteral = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc30_25.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc30_25.2: type = converted %int.make_type_signed, %.loc30_25.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [template = constants.%IntLiteral] // CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral] // CHECK:STDOUT: %.loc30_44.1: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral] @@ -734,9 +660,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %return.param_patt: Core.IntLiteral = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_unsigned: init type = call constants.%UInt(%int_32) [template = constants.%u32] -// CHECK:STDOUT: %.loc31_27.1: type = value_of_initializer %int.make_type_unsigned [template = constants.%u32] -// CHECK:STDOUT: %.loc31_27.2: type = converted %int.make_type_unsigned, %.loc31_27.1 [template = constants.%u32] +// CHECK:STDOUT: %u32: type = class_type @UInt, @UInt(constants.%int_32) [template = constants.%u32] // CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [template = constants.%IntLiteral] // CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral] // CHECK:STDOUT: %.loc31_46.1: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral] @@ -794,21 +718,19 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %Int32ToInt32.type: type = fn_type @Int32ToInt32 [template] // CHECK:STDOUT: %Int32ToInt32: %Int32ToInt32.type = struct_value () [template] // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_0.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] // CHECK:STDOUT: %int_2147483647.1: Core.IntLiteral = int_value 2147483647 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2147483647.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2147483647.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2147483647.2: %i32 = int_value 2147483647 [template] // CHECK:STDOUT: %SubI32.type: type = fn_type @SubI32 [template] @@ -817,7 +739,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %NegateI32: %NegateI32.type = struct_value () [template] // CHECK:STDOUT: %int_-2147483647: %i32 = int_value -2147483647 [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] // CHECK:STDOUT: %int_-2147483648: %i32 = int_value -2147483648 [template] @@ -855,7 +777,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %import_ref.21 = import_ref Main//int_ops, Uint32ToUintLiteral, unloaded // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.22 -// CHECK:STDOUT: .ImplicitAs = %import_ref.23 +// CHECK:STDOUT: .ImplicitAs = %import_ref.26 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -893,17 +815,11 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %int_32.loc5: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc5: init type = call constants.%Int(%int_32.loc5) [template = constants.%i32] -// CHECK:STDOUT: %.loc5_8.1: type = value_of_initializer %int.make_type_signed.loc5 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_8.2: type = converted %int.make_type_signed.loc5, %.loc5_8.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc5: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc6: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc6: init type = call constants.%Int(%int_32.loc6) [template = constants.%i32] -// CHECK:STDOUT: %.loc6_8.1: type = value_of_initializer %int.make_type_signed.loc6 [template = constants.%i32] -// CHECK:STDOUT: %.loc6_8.2: type = converted %int.make_type_signed.loc6, %.loc6_8.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc6: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc7: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc7: init type = call constants.%Int(%int_32.loc7) [template = constants.%i32] -// CHECK:STDOUT: %.loc7_8.1: type = value_of_initializer %int.make_type_signed.loc7 [template = constants.%i32] -// CHECK:STDOUT: %.loc7_8.2: type = converted %int.make_type_signed.loc7, %.loc7_8.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc7: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, imports.%import_ref.4 [template = constants.%IntLiteral] // CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral] // CHECK:STDOUT: %.loc8_19.1: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral] @@ -926,7 +842,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Int32ToInt32.ref.loc5: %Int32ToInt32.type = name_ref Int32ToInt32, imports.%import_ref.5 [template = constants.%Int32ToInt32] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0.loc5: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc5: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc5: = bound_method %int_0, %impl.elem0.loc5 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc5: = specific_function %Convert.bound.loc5, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc5_27: init %i32 = call %Convert.specific_fn.loc5(%int_0) [template = constants.%int_0.2] @@ -938,7 +854,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %a: %i32 = bind_name a, %.loc5_29.2 // CHECK:STDOUT: %Int32ToInt32.ref.loc6: %Int32ToInt32.type = name_ref Int32ToInt32, imports.%import_ref.5 [template = constants.%Int32ToInt32] // CHECK:STDOUT: %int_2147483647.loc6: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] -// CHECK:STDOUT: %impl.elem0.loc6: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc6: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc6: = bound_method %int_2147483647.loc6, %impl.elem0.loc6 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc6: = specific_function %Convert.bound.loc6, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc6_27: init %i32 = call %Convert.specific_fn.loc6(%int_2147483647.loc6) [template = constants.%int_2147483647.2] @@ -952,7 +868,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %SubI32.ref: %SubI32.type = name_ref SubI32, imports.%import_ref.2 [template = constants.%SubI32] // CHECK:STDOUT: %NegateI32.ref.loc7: %NegateI32.type = name_ref NegateI32, imports.%import_ref.1 [template = constants.%NegateI32] // CHECK:STDOUT: %int_2147483647.loc7: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] -// CHECK:STDOUT: %impl.elem0.loc7_44: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc7_44: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc7_44: = bound_method %int_2147483647.loc7, %impl.elem0.loc7_44 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc7_44: = specific_function %Convert.bound.loc7_44, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc7_44: init %i32 = call %Convert.specific_fn.loc7_44(%int_2147483647.loc7) [template = constants.%int_2147483647.2] @@ -962,7 +878,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %int_1.loc7: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %.loc7_55.1: %i32 = value_of_initializer %int.snegate.loc7 [template = constants.%int_-2147483647] // CHECK:STDOUT: %.loc7_55.2: %i32 = converted %int.snegate.loc7, %.loc7_55.1 [template = constants.%int_-2147483647] -// CHECK:STDOUT: %impl.elem0.loc7_58: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc7_58: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc7_58: = bound_method %int_1.loc7, %impl.elem0.loc7_58 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc7_58: = specific_function %Convert.bound.loc7_58, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc7_58: init %i32 = call %Convert.specific_fn.loc7_58(%int_1.loc7) [template = constants.%int_1.2] @@ -979,7 +895,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %Int32ToIntLiteral.ref: %Int32ToIntLiteral.type = name_ref Int32ToIntLiteral, imports.%import_ref.20 [template = constants.%Int32ToIntLiteral] // CHECK:STDOUT: %NegateI32.ref.loc8: %NegateI32.type = name_ref NegateI32, imports.%import_ref.1 [template = constants.%NegateI32] // CHECK:STDOUT: %int_1.loc8: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc8: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc8: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc8: = bound_method %int_1.loc8, %impl.elem0.loc8 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc8: = specific_function %Convert.bound.loc8, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc8_74: init %i32 = call %Convert.specific_fn.loc8(%int_1.loc8) [template = constants.%int_1.2] @@ -1002,23 +918,19 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %UInt.type: type = fn_type @UInt [template] -// CHECK:STDOUT: %UInt: %UInt.type = struct_value () [template] -// CHECK:STDOUT: %u32: type = int_type unsigned, %int_32 [template] +// CHECK:STDOUT: %u32: type = class_type @UInt, @UInt(%int_32) [template] // CHECK:STDOUT: %Int32ToUint32.type: type = fn_type @Int32ToUint32 [template] // CHECK:STDOUT: %Int32ToUint32: %Int32ToUint32.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %int_2147483647.1: Core.IntLiteral = int_value 2147483647 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_2147483647.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound: = bound_method %int_2147483647.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2147483647.2: %i32 = int_value 2147483647 [template] // CHECK:STDOUT: %int_2147483647.3: %u32 = int_value 2147483647 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] // CHECK:STDOUT: %Uint32ToInt32.type: type = fn_type @Uint32ToInt32 [template] // CHECK:STDOUT: %Uint32ToInt32: %Uint32ToInt32.type = struct_value () [template] // CHECK:STDOUT: } @@ -1047,8 +959,8 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %import_ref.21 = import_ref Main//int_ops, Uint32ToUintLiteral, unloaded // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .UInt = %import_ref.22 -// CHECK:STDOUT: .ImplicitAs = %import_ref.23 -// CHECK:STDOUT: .Int = %import_ref.59 +// CHECK:STDOUT: .ImplicitAs = %import_ref.29 +// CHECK:STDOUT: .Int = %import_ref.217 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -1084,13 +996,9 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %int_32.loc5: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_unsigned: init type = call constants.%UInt(%int_32.loc5) [template = constants.%u32] -// CHECK:STDOUT: %.loc5_10.1: type = value_of_initializer %int.make_type_unsigned [template = constants.%u32] -// CHECK:STDOUT: %.loc5_10.2: type = converted %int.make_type_unsigned, %.loc5_10.1 [template = constants.%u32] +// CHECK:STDOUT: %u32: type = class_type @UInt, @UInt(constants.%int_32) [template = constants.%u32] // CHECK:STDOUT: %int_32.loc6: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32.loc6) [template = constants.%i32] -// CHECK:STDOUT: %.loc6_20.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc6_20.2: type = converted %int.make_type_signed, %.loc6_20.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32ToUint32(%a.param_patt: %i32) -> %u32 = "int.convert_checked" [from "int_ops.carbon"]; @@ -1101,7 +1009,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Int32ToUint32.ref.loc5: %Int32ToUint32.type = name_ref Int32ToUint32, imports.%import_ref.6 [template = constants.%Int32ToUint32] // CHECK:STDOUT: %int_2147483647.loc5: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] -// CHECK:STDOUT: %impl.elem0.loc5: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc5: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc5: = bound_method %int_2147483647.loc5, %impl.elem0.loc5 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn.loc5: = specific_function %Convert.bound.loc5, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc5_30: init %i32 = call %Convert.specific_fn.loc5(%int_2147483647.loc5) [template = constants.%int_2147483647.2] @@ -1114,7 +1022,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %Uint32ToInt32.ref: %Uint32ToInt32.type = name_ref Uint32ToInt32, imports.%import_ref.7 [template = constants.%Uint32ToInt32] // CHECK:STDOUT: %Int32ToUint32.ref.loc6: %Int32ToUint32.type = name_ref Int32ToUint32, imports.%import_ref.6 [template = constants.%Int32ToUint32] // CHECK:STDOUT: %int_2147483647.loc6: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] -// CHECK:STDOUT: %impl.elem0.loc6: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc6: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc6: = bound_method %int_2147483647.loc6, %impl.elem0.loc6 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn.loc6: = specific_function %Convert.bound.loc6, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc6_54: init %i32 = call %Convert.specific_fn.loc6(%int_2147483647.loc6) [template = constants.%int_2147483647.2] @@ -1134,48 +1042,44 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [template] -// CHECK:STDOUT: %UInt.type: type = fn_type @UInt [template] -// CHECK:STDOUT: %UInt: %UInt.type = struct_value () [template] -// CHECK:STDOUT: %u16: type = int_type unsigned, %int_16 [template] +// CHECK:STDOUT: %u16: type = class_type @UInt, @UInt(%int_16) [template] // CHECK:STDOUT: %Int32ToUint16.type: type = fn_type @Int32ToUint16 [template] // CHECK:STDOUT: %Int32ToUint16: %Int32ToUint16.type = struct_value () [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_0.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] // CHECK:STDOUT: %int_0.3: %u16 = int_value 0 [template] // CHECK:STDOUT: %int_65535.1: Core.IntLiteral = int_value 65535 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_65535.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_65535.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_65535.2: %i32 = int_value 65535 [template] // CHECK:STDOUT: %int_65535.3: %u16 = int_value 65535 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i16: type = int_type signed, %int_16 [template] +// CHECK:STDOUT: %i16: type = class_type @Int, @Int(%int_16) [template] // CHECK:STDOUT: %Int32ToInt16.type: type = fn_type @Int32ToInt16 [template] // CHECK:STDOUT: %Int32ToInt16: %Int32ToInt16.type = struct_value () [template] // CHECK:STDOUT: %int_32767.1: Core.IntLiteral = int_value 32767 [template] -// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_32767.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_32767.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_32767.2: %i32 = int_value 32767 [template] // CHECK:STDOUT: %int_32767.3: %i16 = int_value 32767 [template] // CHECK:STDOUT: %NegateI32.type: type = fn_type @NegateI32 [template] // CHECK:STDOUT: %NegateI32: %NegateI32.type = struct_value () [template] // CHECK:STDOUT: %int_32768.1: Core.IntLiteral = int_value 32768 [template] -// CHECK:STDOUT: %Convert.bound.4: = bound_method %int_32768.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.4: = bound_method %int_32768.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.4: = specific_function %Convert.bound.4, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_32768.2: %i32 = int_value 32768 [template] // CHECK:STDOUT: %int_-32768.1: %i32 = int_value -32768 [template] // CHECK:STDOUT: %int_-32768.2: %i16 = int_value -32768 [template] // CHECK:STDOUT: %Uint32ToUint16.type: type = fn_type @Uint32ToUint16 [template] // CHECK:STDOUT: %Uint32ToUint16: %Uint32ToUint16.type = struct_value () [template] -// CHECK:STDOUT: %u32: type = int_type unsigned, %int_32 [template] +// CHECK:STDOUT: %u32: type = class_type @UInt, @UInt(%int_32) [template] // CHECK:STDOUT: %Int32ToUint32.type: type = fn_type @Int32ToUint32 [template] // CHECK:STDOUT: %Int32ToUint32: %Int32ToUint32.type = struct_value () [template] // CHECK:STDOUT: %int_0.4: %u32 = int_value 0 [template] @@ -1217,8 +1121,8 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %import_ref.21 = import_ref Main//int_ops, Uint32ToUintLiteral, unloaded // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .UInt = %import_ref.22 -// CHECK:STDOUT: .ImplicitAs = %import_ref.23 -// CHECK:STDOUT: .Int = %import_ref.59 +// CHECK:STDOUT: .ImplicitAs = %import_ref.29 +// CHECK:STDOUT: .Int = %import_ref.217 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -1264,53 +1168,29 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %int_16.loc5: Core.IntLiteral = int_value 16 [template = constants.%int_16] -// CHECK:STDOUT: %int.make_type_unsigned.loc5: init type = call constants.%UInt(%int_16.loc5) [template = constants.%u16] -// CHECK:STDOUT: %.loc5_8.1: type = value_of_initializer %int.make_type_unsigned.loc5 [template = constants.%u16] -// CHECK:STDOUT: %.loc5_8.2: type = converted %int.make_type_unsigned.loc5, %.loc5_8.1 [template = constants.%u16] +// CHECK:STDOUT: %u16.loc5: type = class_type @UInt, @UInt(constants.%int_16) [template = constants.%u16] // CHECK:STDOUT: %int_16.loc6: Core.IntLiteral = int_value 16 [template = constants.%int_16] -// CHECK:STDOUT: %int.make_type_unsigned.loc6: init type = call constants.%UInt(%int_16.loc6) [template = constants.%u16] -// CHECK:STDOUT: %.loc6_8.1: type = value_of_initializer %int.make_type_unsigned.loc6 [template = constants.%u16] -// CHECK:STDOUT: %.loc6_8.2: type = converted %int.make_type_unsigned.loc6, %.loc6_8.1 [template = constants.%u16] +// CHECK:STDOUT: %u16.loc6: type = class_type @UInt, @UInt(constants.%int_16) [template = constants.%u16] // CHECK:STDOUT: %int_16.loc8: Core.IntLiteral = int_value 16 [template = constants.%int_16] -// CHECK:STDOUT: %int.make_type_signed.loc8: init type = call constants.%Int(%int_16.loc8) [template = constants.%i16] -// CHECK:STDOUT: %.loc8_8.1: type = value_of_initializer %int.make_type_signed.loc8 [template = constants.%i16] -// CHECK:STDOUT: %.loc8_8.2: type = converted %int.make_type_signed.loc8, %.loc8_8.1 [template = constants.%i16] +// CHECK:STDOUT: %i16.loc8: type = class_type @Int, @Int(constants.%int_16) [template = constants.%i16] // CHECK:STDOUT: %int_16.loc9: Core.IntLiteral = int_value 16 [template = constants.%int_16] -// CHECK:STDOUT: %int.make_type_signed.loc9: init type = call constants.%Int(%int_16.loc9) [template = constants.%i16] -// CHECK:STDOUT: %.loc9_8.1: type = value_of_initializer %int.make_type_signed.loc9 [template = constants.%i16] -// CHECK:STDOUT: %.loc9_8.2: type = converted %int.make_type_signed.loc9, %.loc9_8.1 [template = constants.%i16] +// CHECK:STDOUT: %i16.loc9: type = class_type @Int, @Int(constants.%int_16) [template = constants.%i16] // CHECK:STDOUT: %int_16.loc11: Core.IntLiteral = int_value 16 [template = constants.%int_16] -// CHECK:STDOUT: %int.make_type_unsigned.loc11: init type = call constants.%UInt(%int_16.loc11) [template = constants.%u16] -// CHECK:STDOUT: %.loc11_8.1: type = value_of_initializer %int.make_type_unsigned.loc11 [template = constants.%u16] -// CHECK:STDOUT: %.loc11_8.2: type = converted %int.make_type_unsigned.loc11, %.loc11_8.1 [template = constants.%u16] +// CHECK:STDOUT: %u16.loc11: type = class_type @UInt, @UInt(constants.%int_16) [template = constants.%u16] // CHECK:STDOUT: %int_16.loc12: Core.IntLiteral = int_value 16 [template = constants.%int_16] -// CHECK:STDOUT: %int.make_type_unsigned.loc12: init type = call constants.%UInt(%int_16.loc12) [template = constants.%u16] -// CHECK:STDOUT: %.loc12_8.1: type = value_of_initializer %int.make_type_unsigned.loc12 [template = constants.%u16] -// CHECK:STDOUT: %.loc12_8.2: type = converted %int.make_type_unsigned.loc12, %.loc12_8.1 [template = constants.%u16] +// CHECK:STDOUT: %u16.loc12: type = class_type @UInt, @UInt(constants.%int_16) [template = constants.%u16] // CHECK:STDOUT: %int_16.loc14: Core.IntLiteral = int_value 16 [template = constants.%int_16] -// CHECK:STDOUT: %int.make_type_signed.loc14: init type = call constants.%Int(%int_16.loc14) [template = constants.%i16] -// CHECK:STDOUT: %.loc14_8.1: type = value_of_initializer %int.make_type_signed.loc14 [template = constants.%i16] -// CHECK:STDOUT: %.loc14_8.2: type = converted %int.make_type_signed.loc14, %.loc14_8.1 [template = constants.%i16] +// CHECK:STDOUT: %i16.loc14: type = class_type @Int, @Int(constants.%int_16) [template = constants.%i16] // CHECK:STDOUT: %int_16.loc15: Core.IntLiteral = int_value 16 [template = constants.%int_16] -// CHECK:STDOUT: %int.make_type_signed.loc15: init type = call constants.%Int(%int_16.loc15) [template = constants.%i16] -// CHECK:STDOUT: %.loc15_8.1: type = value_of_initializer %int.make_type_signed.loc15 [template = constants.%i16] -// CHECK:STDOUT: %.loc15_8.2: type = converted %int.make_type_signed.loc15, %.loc15_8.1 [template = constants.%i16] +// CHECK:STDOUT: %i16.loc15: type = class_type @Int, @Int(constants.%int_16) [template = constants.%i16] // CHECK:STDOUT: %int_16.loc17: Core.IntLiteral = int_value 16 [template = constants.%int_16] -// CHECK:STDOUT: %int.make_type_signed.loc17: init type = call constants.%Int(%int_16.loc17) [template = constants.%i16] -// CHECK:STDOUT: %.loc17_18.1: type = value_of_initializer %int.make_type_signed.loc17 [template = constants.%i16] -// CHECK:STDOUT: %.loc17_18.2: type = converted %int.make_type_signed.loc17, %.loc17_18.1 [template = constants.%i16] +// CHECK:STDOUT: %i16.loc17: type = class_type @Int, @Int(constants.%int_16) [template = constants.%i16] // CHECK:STDOUT: %int_16.loc18: Core.IntLiteral = int_value 16 [template = constants.%int_16] -// CHECK:STDOUT: %int.make_type_signed.loc18: init type = call constants.%Int(%int_16.loc18) [template = constants.%i16] -// CHECK:STDOUT: %.loc18_18.1: type = value_of_initializer %int.make_type_signed.loc18 [template = constants.%i16] -// CHECK:STDOUT: %.loc18_18.2: type = converted %int.make_type_signed.loc18, %.loc18_18.1 [template = constants.%i16] +// CHECK:STDOUT: %i16.loc18: type = class_type @Int, @Int(constants.%int_16) [template = constants.%i16] // CHECK:STDOUT: %int_16.loc20: Core.IntLiteral = int_value 16 [template = constants.%int_16] -// CHECK:STDOUT: %int.make_type_unsigned.loc20: init type = call constants.%UInt(%int_16.loc20) [template = constants.%u16] -// CHECK:STDOUT: %.loc20_18.1: type = value_of_initializer %int.make_type_unsigned.loc20 [template = constants.%u16] -// CHECK:STDOUT: %.loc20_18.2: type = converted %int.make_type_unsigned.loc20, %.loc20_18.1 [template = constants.%u16] +// CHECK:STDOUT: %u16.loc20: type = class_type @UInt, @UInt(constants.%int_16) [template = constants.%u16] // CHECK:STDOUT: %int_16.loc21: Core.IntLiteral = int_value 16 [template = constants.%int_16] -// CHECK:STDOUT: %int.make_type_unsigned.loc21: init type = call constants.%UInt(%int_16.loc21) [template = constants.%u16] -// CHECK:STDOUT: %.loc21_18.1: type = value_of_initializer %int.make_type_unsigned.loc21 [template = constants.%u16] -// CHECK:STDOUT: %.loc21_18.2: type = converted %int.make_type_unsigned.loc21, %.loc21_18.1 [template = constants.%u16] +// CHECK:STDOUT: %u16.loc21: type = class_type @UInt, @UInt(constants.%int_16) [template = constants.%u16] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32ToUint16(%a.param_patt: %i32) -> %u16 = "int.convert_checked" [from "int_ops.carbon"]; @@ -1335,7 +1215,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Int32ToUint16.ref.loc5: %Int32ToUint16.type = name_ref Int32ToUint16, imports.%import_ref.11 [template = constants.%Int32ToUint16] // CHECK:STDOUT: %int_0.loc5: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0.loc5: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc5: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc5: = bound_method %int_0.loc5, %impl.elem0.loc5 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc5: = specific_function %Convert.bound.loc5, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc5_28: init %i32 = call %Convert.specific_fn.loc5(%int_0.loc5) [template = constants.%int_0.2] @@ -1347,7 +1227,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %a: %u16 = bind_name a, %.loc5_30.2 // CHECK:STDOUT: %Int32ToUint16.ref.loc6: %Int32ToUint16.type = name_ref Int32ToUint16, imports.%import_ref.11 [template = constants.%Int32ToUint16] // CHECK:STDOUT: %int_65535.loc6: Core.IntLiteral = int_value 65535 [template = constants.%int_65535.1] -// CHECK:STDOUT: %impl.elem0.loc6: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc6: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc6: = bound_method %int_65535.loc6, %impl.elem0.loc6 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc6: = specific_function %Convert.bound.loc6, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc6_28: init %i32 = call %Convert.specific_fn.loc6(%int_65535.loc6) [template = constants.%int_65535.2] @@ -1359,7 +1239,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %b: %u16 = bind_name b, %.loc6_35.2 // CHECK:STDOUT: %Int32ToInt16.ref.loc8: %Int32ToInt16.type = name_ref Int32ToInt16, imports.%import_ref.10 [template = constants.%Int32ToInt16] // CHECK:STDOUT: %int_32767.loc8: Core.IntLiteral = int_value 32767 [template = constants.%int_32767.1] -// CHECK:STDOUT: %impl.elem0.loc8: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc8: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc8: = bound_method %int_32767.loc8, %impl.elem0.loc8 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc8: = specific_function %Convert.bound.loc8, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc8_27: init %i32 = call %Convert.specific_fn.loc8(%int_32767.loc8) [template = constants.%int_32767.2] @@ -1372,7 +1252,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %Int32ToInt16.ref.loc9: %Int32ToInt16.type = name_ref Int32ToInt16, imports.%import_ref.10 [template = constants.%Int32ToInt16] // CHECK:STDOUT: %NegateI32.ref.loc9: %NegateI32.type = name_ref NegateI32, imports.%import_ref.1 [template = constants.%NegateI32] // CHECK:STDOUT: %int_32768.loc9: Core.IntLiteral = int_value 32768 [template = constants.%int_32768.1] -// CHECK:STDOUT: %impl.elem0.loc9: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc9: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc9: = bound_method %int_32768.loc9, %impl.elem0.loc9 [template = constants.%Convert.bound.4] // CHECK:STDOUT: %Convert.specific_fn.loc9: = specific_function %Convert.bound.loc9, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.4] // CHECK:STDOUT: %int.convert_checked.loc9_37: init %i32 = call %Convert.specific_fn.loc9(%int_32768.loc9) [template = constants.%int_32768.2] @@ -1388,7 +1268,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %Uint32ToUint16.ref.loc11: %Uint32ToUint16.type = name_ref Uint32ToUint16, imports.%import_ref.13 [template = constants.%Uint32ToUint16] // CHECK:STDOUT: %Int32ToUint32.ref.loc11: %Int32ToUint32.type = name_ref Int32ToUint32, imports.%import_ref.6 [template = constants.%Int32ToUint32] // CHECK:STDOUT: %int_0.loc11: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0.loc11: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc11: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11: = bound_method %int_0.loc11, %impl.elem0.loc11 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc11: = specific_function %Convert.bound.loc11, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc11_43: init %i32 = call %Convert.specific_fn.loc11(%int_0.loc11) [template = constants.%int_0.2] @@ -1404,7 +1284,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %Uint32ToUint16.ref.loc12: %Uint32ToUint16.type = name_ref Uint32ToUint16, imports.%import_ref.13 [template = constants.%Uint32ToUint16] // CHECK:STDOUT: %Int32ToUint32.ref.loc12: %Int32ToUint32.type = name_ref Int32ToUint32, imports.%import_ref.6 [template = constants.%Int32ToUint32] // CHECK:STDOUT: %int_65535.loc12: Core.IntLiteral = int_value 65535 [template = constants.%int_65535.1] -// CHECK:STDOUT: %impl.elem0.loc12: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc12: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc12: = bound_method %int_65535.loc12, %impl.elem0.loc12 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc12: = specific_function %Convert.bound.loc12, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc12_43: init %i32 = call %Convert.specific_fn.loc12(%int_65535.loc12) [template = constants.%int_65535.2] @@ -1420,7 +1300,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %Uint32ToInt16.ref.loc14: %Uint32ToInt16.type = name_ref Uint32ToInt16, imports.%import_ref.12 [template = constants.%Uint32ToInt16] // CHECK:STDOUT: %Int32ToUint32.ref.loc14: %Int32ToUint32.type = name_ref Int32ToUint32, imports.%import_ref.6 [template = constants.%Int32ToUint32] // CHECK:STDOUT: %int_0.loc14: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0.loc14: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc14: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc14: = bound_method %int_0.loc14, %impl.elem0.loc14 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc14: = specific_function %Convert.bound.loc14, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc14_42: init %i32 = call %Convert.specific_fn.loc14(%int_0.loc14) [template = constants.%int_0.2] @@ -1436,7 +1316,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %Uint32ToInt16.ref.loc15: %Uint32ToInt16.type = name_ref Uint32ToInt16, imports.%import_ref.12 [template = constants.%Uint32ToInt16] // CHECK:STDOUT: %Int32ToUint32.ref.loc15: %Int32ToUint32.type = name_ref Int32ToUint32, imports.%import_ref.6 [template = constants.%Int32ToUint32] // CHECK:STDOUT: %int_32767.loc15: Core.IntLiteral = int_value 32767 [template = constants.%int_32767.1] -// CHECK:STDOUT: %impl.elem0.loc15: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc15: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc15: = bound_method %int_32767.loc15, %impl.elem0.loc15 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc15: = specific_function %Convert.bound.loc15, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc15_42: init %i32 = call %Convert.specific_fn.loc15(%int_32767.loc15) [template = constants.%int_32767.2] @@ -1453,7 +1333,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %Int32ToIntLiteral.ref.loc17: %Int32ToIntLiteral.type = name_ref Int32ToIntLiteral, imports.%import_ref.20 [template = constants.%Int32ToIntLiteral] // CHECK:STDOUT: %NegateI32.ref.loc17: %NegateI32.type = name_ref NegateI32, imports.%import_ref.1 [template = constants.%NegateI32] // CHECK:STDOUT: %int_32768.loc17: Core.IntLiteral = int_value 32768 [template = constants.%int_32768.1] -// CHECK:STDOUT: %impl.elem0.loc17: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc17: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc17: = bound_method %int_32768.loc17, %impl.elem0.loc17 [template = constants.%Convert.bound.4] // CHECK:STDOUT: %Convert.specific_fn.loc17: = specific_function %Convert.bound.loc17, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.4] // CHECK:STDOUT: %int.convert_checked.loc17_70: init %i32 = call %Convert.specific_fn.loc17(%int_32768.loc17) [template = constants.%int_32768.2] @@ -1472,7 +1352,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %IntLiteralToInt16.ref.loc18: %IntLiteralToInt16.type = name_ref IntLiteralToInt16, imports.%import_ref.14 [template = constants.%IntLiteralToInt16] // CHECK:STDOUT: %Int32ToIntLiteral.ref.loc18: %Int32ToIntLiteral.type = name_ref Int32ToIntLiteral, imports.%import_ref.20 [template = constants.%Int32ToIntLiteral] // CHECK:STDOUT: %int_32767.loc18: Core.IntLiteral = int_value 32767 [template = constants.%int_32767.1] -// CHECK:STDOUT: %impl.elem0.loc18: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc18: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc18: = bound_method %int_32767.loc18, %impl.elem0.loc18 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc18: = specific_function %Convert.bound.loc18, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc18_60: init %i32 = call %Convert.specific_fn.loc18(%int_32767.loc18) [template = constants.%int_32767.2] @@ -1488,7 +1368,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %IntLiteralToUint16.ref.loc20: %IntLiteralToUint16.type = name_ref IntLiteralToUint16, imports.%import_ref.15 [template = constants.%IntLiteralToUint16] // CHECK:STDOUT: %Int32ToIntLiteral.ref.loc20: %Int32ToIntLiteral.type = name_ref Int32ToIntLiteral, imports.%import_ref.20 [template = constants.%Int32ToIntLiteral] // CHECK:STDOUT: %int_0.loc20: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0.loc20: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc20: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc20: = bound_method %int_0.loc20, %impl.elem0.loc20 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc20: = specific_function %Convert.bound.loc20, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc20_61: init %i32 = call %Convert.specific_fn.loc20(%int_0.loc20) [template = constants.%int_0.2] @@ -1504,7 +1384,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %IntLiteralToUint16.ref.loc21: %IntLiteralToUint16.type = name_ref IntLiteralToUint16, imports.%import_ref.15 [template = constants.%IntLiteralToUint16] // CHECK:STDOUT: %Int32ToIntLiteral.ref.loc21: %Int32ToIntLiteral.type = name_ref Int32ToIntLiteral, imports.%import_ref.20 [template = constants.%Int32ToIntLiteral] // CHECK:STDOUT: %int_65535.loc21: Core.IntLiteral = int_value 65535 [template = constants.%int_65535.1] -// CHECK:STDOUT: %impl.elem0.loc21: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc21: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc21: = bound_method %int_65535.loc21, %impl.elem0.loc21 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc21: = specific_function %Convert.bound.loc21, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc21_61: init %i32 = call %Convert.specific_fn.loc21(%int_65535.loc21) [template = constants.%int_65535.2] @@ -1524,22 +1404,20 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [template] -// CHECK:STDOUT: %UInt.type: type = fn_type @UInt [template] -// CHECK:STDOUT: %UInt: %UInt.type = struct_value () [template] -// CHECK:STDOUT: %u64: type = int_type unsigned, %int_64 [template] +// CHECK:STDOUT: %u64: type = class_type @UInt, @UInt(%int_64) [template] // CHECK:STDOUT: %Uint32ToUint64.type: type = fn_type @Uint32ToUint64 [template] // CHECK:STDOUT: %Uint32ToUint64: %Uint32ToUint64.type = struct_value () [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %u32: type = int_type unsigned, %int_32 [template] +// CHECK:STDOUT: %u32: type = class_type @UInt, @UInt(%int_32) [template] // CHECK:STDOUT: %Int32ToUint32.type: type = fn_type @Int32ToUint32 [template] // CHECK:STDOUT: %Int32ToUint32: %Int32ToUint32.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_0.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] // CHECK:STDOUT: %int_0.3: %u32 = int_value 0 [template] @@ -1547,21 +1425,19 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %AddU32.type: type = fn_type @AddU32 [template] // CHECK:STDOUT: %AddU32: %AddU32.type = struct_value () [template] // CHECK:STDOUT: %int_2147483647.1: Core.IntLiteral = int_value 2147483647 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2147483647.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2147483647.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2147483647.2: %i32 = int_value 2147483647 [template] // CHECK:STDOUT: %int_2147483647.3: %u32 = int_value 2147483647 [template] // CHECK:STDOUT: %int_4294967294: %u32 = int_value 4294967294 [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] // CHECK:STDOUT: %int_1.3: %u32 = int_value 1 [template] // CHECK:STDOUT: %int_4294967295.1: %u32 = int_value 4294967295 [template] // CHECK:STDOUT: %int_4294967295.2: %u64 = int_value 4294967295 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i64: type = int_type signed, %int_64 [template] +// CHECK:STDOUT: %i64: type = class_type @Int, @Int(%int_64) [template] // CHECK:STDOUT: %Uint32ToInt64.type: type = fn_type @Uint32ToInt64 [template] // CHECK:STDOUT: %Uint32ToInt64: %Uint32ToInt64.type = struct_value () [template] // CHECK:STDOUT: %int_0.5: %i64 = int_value 0 [template] @@ -1592,8 +1468,8 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %import_ref.21 = import_ref Main//int_ops, Uint32ToUintLiteral, unloaded // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .UInt = %import_ref.22 -// CHECK:STDOUT: .ImplicitAs = %import_ref.23 -// CHECK:STDOUT: .Int = %import_ref.59 +// CHECK:STDOUT: .ImplicitAs = %import_ref.29 +// CHECK:STDOUT: .Int = %import_ref.217 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -1631,21 +1507,13 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %int_64.loc5: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %int.make_type_unsigned.loc5: init type = call constants.%UInt(%int_64.loc5) [template = constants.%u64] -// CHECK:STDOUT: %.loc5_8.1: type = value_of_initializer %int.make_type_unsigned.loc5 [template = constants.%u64] -// CHECK:STDOUT: %.loc5_8.2: type = converted %int.make_type_unsigned.loc5, %.loc5_8.1 [template = constants.%u64] +// CHECK:STDOUT: %u64.loc5: type = class_type @UInt, @UInt(constants.%int_64) [template = constants.%u64] // CHECK:STDOUT: %int_64.loc6: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %int.make_type_unsigned.loc6: init type = call constants.%UInt(%int_64.loc6) [template = constants.%u64] -// CHECK:STDOUT: %.loc6_8.1: type = value_of_initializer %int.make_type_unsigned.loc6 [template = constants.%u64] -// CHECK:STDOUT: %.loc6_8.2: type = converted %int.make_type_unsigned.loc6, %.loc6_8.1 [template = constants.%u64] +// CHECK:STDOUT: %u64.loc6: type = class_type @UInt, @UInt(constants.%int_64) [template = constants.%u64] // CHECK:STDOUT: %int_64.loc11: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %int.make_type_signed.loc11: init type = call constants.%Int(%int_64.loc11) [template = constants.%i64] -// CHECK:STDOUT: %.loc11_8.1: type = value_of_initializer %int.make_type_signed.loc11 [template = constants.%i64] -// CHECK:STDOUT: %.loc11_8.2: type = converted %int.make_type_signed.loc11, %.loc11_8.1 [template = constants.%i64] +// CHECK:STDOUT: %i64.loc11: type = class_type @Int, @Int(constants.%int_64) [template = constants.%i64] // CHECK:STDOUT: %int_64.loc12: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %int.make_type_signed.loc12: init type = call constants.%Int(%int_64.loc12) [template = constants.%i64] -// CHECK:STDOUT: %.loc12_8.1: type = value_of_initializer %int.make_type_signed.loc12 [template = constants.%i64] -// CHECK:STDOUT: %.loc12_8.2: type = converted %int.make_type_signed.loc12, %.loc12_8.1 [template = constants.%i64] +// CHECK:STDOUT: %i64.loc12: type = class_type @Int, @Int(constants.%int_64) [template = constants.%i64] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Uint32ToUint64(%a.param_patt: %u32) -> %u64 = "int.convert_checked" [from "int_ops.carbon"]; @@ -1661,7 +1529,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %Uint32ToUint64.ref.loc5: %Uint32ToUint64.type = name_ref Uint32ToUint64, imports.%import_ref.19 [template = constants.%Uint32ToUint64] // CHECK:STDOUT: %Int32ToUint32.ref.loc5: %Int32ToUint32.type = name_ref Int32ToUint32, imports.%import_ref.6 [template = constants.%Int32ToUint32] // CHECK:STDOUT: %int_0.loc5: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0.loc5: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc5: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc5: = bound_method %int_0.loc5, %impl.elem0.loc5 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc5: = specific_function %Convert.bound.loc5, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc5_43: init %i32 = call %Convert.specific_fn.loc5(%int_0.loc5) [template = constants.%int_0.2] @@ -1679,7 +1547,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %AddU32.ref.loc8: %AddU32.type = name_ref AddU32, imports.%import_ref.3 [template = constants.%AddU32] // CHECK:STDOUT: %Int32ToUint32.ref.loc8_12: %Int32ToUint32.type = name_ref Int32ToUint32, imports.%import_ref.6 [template = constants.%Int32ToUint32] // CHECK:STDOUT: %int_2147483647.loc8_26: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] -// CHECK:STDOUT: %impl.elem0.loc8_26: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc8_26: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc8_26: = bound_method %int_2147483647.loc8_26, %impl.elem0.loc8_26 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc8_26: = specific_function %Convert.bound.loc8_26, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc8_26: init %i32 = call %Convert.specific_fn.loc8_26(%int_2147483647.loc8_26) [template = constants.%int_2147483647.2] @@ -1688,7 +1556,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %int.convert_checked.loc8_37: init %u32 = call %Int32ToUint32.ref.loc8_12(%.loc8_26.2) [template = constants.%int_2147483647.3] // CHECK:STDOUT: %Int32ToUint32.ref.loc8_40: %Int32ToUint32.type = name_ref Int32ToUint32, imports.%import_ref.6 [template = constants.%Int32ToUint32] // CHECK:STDOUT: %int_2147483647.loc8_54: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] -// CHECK:STDOUT: %impl.elem0.loc8_54: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc8_54: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc8_54: = bound_method %int_2147483647.loc8_54, %impl.elem0.loc8_54 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc8_54: = specific_function %Convert.bound.loc8_54, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc8_54: init %i32 = call %Convert.specific_fn.loc8_54(%int_2147483647.loc8_54) [template = constants.%int_2147483647.2] @@ -1702,7 +1570,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %int.uadd.loc8: init %u32 = call %AddU32.ref.loc8(%.loc8_37.2, %.loc8_65.2) [template = constants.%int_4294967294] // CHECK:STDOUT: %Int32ToUint32.ref.loc9: %Int32ToUint32.type = name_ref Int32ToUint32, imports.%import_ref.6 [template = constants.%Int32ToUint32] // CHECK:STDOUT: %int_1.loc9: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc9: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc9: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc9: = bound_method %int_1.loc9, %impl.elem0.loc9 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc9: = specific_function %Convert.bound.loc9, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc9_19: init %i32 = call %Convert.specific_fn.loc9(%int_1.loc9) [template = constants.%int_1.2] @@ -1723,7 +1591,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %Uint32ToInt64.ref.loc11: %Uint32ToInt64.type = name_ref Uint32ToInt64, imports.%import_ref.18 [template = constants.%Uint32ToInt64] // CHECK:STDOUT: %Int32ToUint32.ref.loc11: %Int32ToUint32.type = name_ref Int32ToUint32, imports.%import_ref.6 [template = constants.%Int32ToUint32] // CHECK:STDOUT: %int_0.loc11: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0.loc11: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc11: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11: = bound_method %int_0.loc11, %impl.elem0.loc11 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc11: = specific_function %Convert.bound.loc11, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc11_42: init %i32 = call %Convert.specific_fn.loc11(%int_0.loc11) [template = constants.%int_0.2] @@ -1741,7 +1609,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %AddU32.ref.loc14: %AddU32.type = name_ref AddU32, imports.%import_ref.3 [template = constants.%AddU32] // CHECK:STDOUT: %Int32ToUint32.ref.loc14_12: %Int32ToUint32.type = name_ref Int32ToUint32, imports.%import_ref.6 [template = constants.%Int32ToUint32] // CHECK:STDOUT: %int_2147483647.loc14_26: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] -// CHECK:STDOUT: %impl.elem0.loc14_26: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc14_26: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc14_26: = bound_method %int_2147483647.loc14_26, %impl.elem0.loc14_26 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc14_26: = specific_function %Convert.bound.loc14_26, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc14_26: init %i32 = call %Convert.specific_fn.loc14_26(%int_2147483647.loc14_26) [template = constants.%int_2147483647.2] @@ -1750,7 +1618,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %int.convert_checked.loc14_37: init %u32 = call %Int32ToUint32.ref.loc14_12(%.loc14_26.2) [template = constants.%int_2147483647.3] // CHECK:STDOUT: %Int32ToUint32.ref.loc14_40: %Int32ToUint32.type = name_ref Int32ToUint32, imports.%import_ref.6 [template = constants.%Int32ToUint32] // CHECK:STDOUT: %int_2147483647.loc14_54: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] -// CHECK:STDOUT: %impl.elem0.loc14_54: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc14_54: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc14_54: = bound_method %int_2147483647.loc14_54, %impl.elem0.loc14_54 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc14_54: = specific_function %Convert.bound.loc14_54, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc14_54: init %i32 = call %Convert.specific_fn.loc14_54(%int_2147483647.loc14_54) [template = constants.%int_2147483647.2] @@ -1764,7 +1632,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %int.uadd.loc14: init %u32 = call %AddU32.ref.loc14(%.loc14_37.2, %.loc14_65.2) [template = constants.%int_4294967294] // CHECK:STDOUT: %Int32ToUint32.ref.loc15: %Int32ToUint32.type = name_ref Int32ToUint32, imports.%import_ref.6 [template = constants.%Int32ToUint32] // CHECK:STDOUT: %int_1.loc15: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc15: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc15: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc15: = bound_method %int_1.loc15, %impl.elem0.loc15 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc15: = specific_function %Convert.bound.loc15, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc15_19: init %i32 = call %Convert.specific_fn.loc15(%int_1.loc15) [template = constants.%int_1.2] @@ -1789,30 +1657,26 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [template] -// CHECK:STDOUT: %UInt.type: type = fn_type @UInt [template] -// CHECK:STDOUT: %UInt: %UInt.type = struct_value () [template] -// CHECK:STDOUT: %u64: type = int_type unsigned, %int_64 [template] +// CHECK:STDOUT: %u64: type = class_type @UInt, @UInt(%int_64) [template] // CHECK:STDOUT: %Int32ToUint64.type: type = fn_type @Int32ToUint64 [template] // CHECK:STDOUT: %Int32ToUint64: %Int32ToUint64.type = struct_value () [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_0.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] // CHECK:STDOUT: %int_0.3: %u64 = int_value 0 [template] // CHECK:STDOUT: %int_2147483647.1: Core.IntLiteral = int_value 2147483647 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2147483647.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2147483647.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2147483647.2: %i32 = int_value 2147483647 [template] // CHECK:STDOUT: %int_2147483647.3: %u64 = int_value 2147483647 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i64: type = int_type signed, %int_64 [template] +// CHECK:STDOUT: %i64: type = class_type @Int, @Int(%int_64) [template] // CHECK:STDOUT: %Int32ToInt64.type: type = fn_type @Int32ToInt64 [template] // CHECK:STDOUT: %Int32ToInt64: %Int32ToInt64.type = struct_value () [template] // CHECK:STDOUT: %SubI32.type: type = fn_type @SubI32 [template] @@ -1821,7 +1685,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %NegateI32: %NegateI32.type = struct_value () [template] // CHECK:STDOUT: %int_-2147483647: %i32 = int_value -2147483647 [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] // CHECK:STDOUT: %int_-2147483648.1: %i32 = int_value -2147483648 [template] @@ -1853,8 +1717,8 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %import_ref.21 = import_ref Main//int_ops, Uint32ToUintLiteral, unloaded // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .UInt = %import_ref.22 -// CHECK:STDOUT: .ImplicitAs = %import_ref.23 -// CHECK:STDOUT: .Int = %import_ref.59 +// CHECK:STDOUT: .ImplicitAs = %import_ref.29 +// CHECK:STDOUT: .Int = %import_ref.217 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -1892,21 +1756,13 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %int_64.loc5: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %int.make_type_unsigned.loc5: init type = call constants.%UInt(%int_64.loc5) [template = constants.%u64] -// CHECK:STDOUT: %.loc5_8.1: type = value_of_initializer %int.make_type_unsigned.loc5 [template = constants.%u64] -// CHECK:STDOUT: %.loc5_8.2: type = converted %int.make_type_unsigned.loc5, %.loc5_8.1 [template = constants.%u64] +// CHECK:STDOUT: %u64.loc5: type = class_type @UInt, @UInt(constants.%int_64) [template = constants.%u64] // CHECK:STDOUT: %int_64.loc6: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %int.make_type_unsigned.loc6: init type = call constants.%UInt(%int_64.loc6) [template = constants.%u64] -// CHECK:STDOUT: %.loc6_8.1: type = value_of_initializer %int.make_type_unsigned.loc6 [template = constants.%u64] -// CHECK:STDOUT: %.loc6_8.2: type = converted %int.make_type_unsigned.loc6, %.loc6_8.1 [template = constants.%u64] +// CHECK:STDOUT: %u64.loc6: type = class_type @UInt, @UInt(constants.%int_64) [template = constants.%u64] // CHECK:STDOUT: %int_64.loc8: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %int.make_type_signed.loc8: init type = call constants.%Int(%int_64.loc8) [template = constants.%i64] -// CHECK:STDOUT: %.loc8_8.1: type = value_of_initializer %int.make_type_signed.loc8 [template = constants.%i64] -// CHECK:STDOUT: %.loc8_8.2: type = converted %int.make_type_signed.loc8, %.loc8_8.1 [template = constants.%i64] +// CHECK:STDOUT: %i64.loc8: type = class_type @Int, @Int(constants.%int_64) [template = constants.%i64] // CHECK:STDOUT: %int_64.loc9: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %int.make_type_signed.loc9: init type = call constants.%Int(%int_64.loc9) [template = constants.%i64] -// CHECK:STDOUT: %.loc9_8.1: type = value_of_initializer %int.make_type_signed.loc9 [template = constants.%i64] -// CHECK:STDOUT: %.loc9_8.2: type = converted %int.make_type_signed.loc9, %.loc9_8.1 [template = constants.%i64] +// CHECK:STDOUT: %i64.loc9: type = class_type @Int, @Int(constants.%int_64) [template = constants.%i64] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32ToUint64(%a.param_patt: %i32) -> %u64 = "int.convert_checked" [from "int_ops.carbon"]; @@ -1921,7 +1777,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Int32ToUint64.ref.loc5: %Int32ToUint64.type = name_ref Int32ToUint64, imports.%import_ref.17 [template = constants.%Int32ToUint64] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0.loc5: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc5: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc5: = bound_method %int_0, %impl.elem0.loc5 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc5: = specific_function %Convert.bound.loc5, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc5_28: init %i32 = call %Convert.specific_fn.loc5(%int_0) [template = constants.%int_0.2] @@ -1933,7 +1789,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %a: %u64 = bind_name a, %.loc5_30.2 // CHECK:STDOUT: %Int32ToUint64.ref.loc6: %Int32ToUint64.type = name_ref Int32ToUint64, imports.%import_ref.17 [template = constants.%Int32ToUint64] // CHECK:STDOUT: %int_2147483647.loc6: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] -// CHECK:STDOUT: %impl.elem0.loc6: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc6: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc6: = bound_method %int_2147483647.loc6, %impl.elem0.loc6 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc6: = specific_function %Convert.bound.loc6, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc6_28: init %i32 = call %Convert.specific_fn.loc6(%int_2147483647.loc6) [template = constants.%int_2147483647.2] @@ -1947,7 +1803,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %SubI32.ref: %SubI32.type = name_ref SubI32, imports.%import_ref.2 [template = constants.%SubI32] // CHECK:STDOUT: %NegateI32.ref: %NegateI32.type = name_ref NegateI32, imports.%import_ref.1 [template = constants.%NegateI32] // CHECK:STDOUT: %int_2147483647.loc8: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] -// CHECK:STDOUT: %impl.elem0.loc8_44: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc8_44: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc8_44: = bound_method %int_2147483647.loc8, %impl.elem0.loc8_44 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc8_44: = specific_function %Convert.bound.loc8_44, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc8_44: init %i32 = call %Convert.specific_fn.loc8_44(%int_2147483647.loc8) [template = constants.%int_2147483647.2] @@ -1957,7 +1813,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %.loc8_55.1: %i32 = value_of_initializer %int.snegate [template = constants.%int_-2147483647] // CHECK:STDOUT: %.loc8_55.2: %i32 = converted %int.snegate, %.loc8_55.1 [template = constants.%int_-2147483647] -// CHECK:STDOUT: %impl.elem0.loc8_58: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc8_58: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc8_58: = bound_method %int_1, %impl.elem0.loc8_58 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc8_58: = specific_function %Convert.bound.loc8_58, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc8_58: init %i32 = call %Convert.specific_fn.loc8_58(%int_1) [template = constants.%int_1.2] @@ -1972,7 +1828,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %c: %i64 = bind_name c, %.loc8_61.2 // CHECK:STDOUT: %Int32ToInt64.ref.loc9: %Int32ToInt64.type = name_ref Int32ToInt64, imports.%import_ref.16 [template = constants.%Int32ToInt64] // CHECK:STDOUT: %int_2147483647.loc9: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] -// CHECK:STDOUT: %impl.elem0.loc9: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc9: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc9: = bound_method %int_2147483647.loc9, %impl.elem0.loc9 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc9: = specific_function %Convert.bound.loc9, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc9_27: init %i32 = call %Convert.specific_fn.loc9(%int_2147483647.loc9) [template = constants.%int_2147483647.2] @@ -1989,27 +1845,25 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %Uint32ToInt32.type: type = fn_type @Uint32ToInt32 [template] // CHECK:STDOUT: %Uint32ToInt32: %Uint32ToInt32.type = struct_value () [template] -// CHECK:STDOUT: %u32: type = int_type unsigned, %int_32 [template] +// CHECK:STDOUT: %u32: type = class_type @UInt, @UInt(%int_32) [template] // CHECK:STDOUT: %AddU32.type: type = fn_type @AddU32 [template] // CHECK:STDOUT: %AddU32: %AddU32.type = struct_value () [template] // CHECK:STDOUT: %Int32ToUint32.type: type = fn_type @Int32ToUint32 [template] // CHECK:STDOUT: %Int32ToUint32: %Int32ToUint32.type = struct_value () [template] // CHECK:STDOUT: %int_2147483647.1: Core.IntLiteral = int_value 2147483647 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_2147483647.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_2147483647.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2147483647.2: %i32 = int_value 2147483647 [template] // CHECK:STDOUT: %int_2147483647.3: %u32 = int_value 2147483647 [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] // CHECK:STDOUT: %int_1.3: %u32 = int_value 1 [template] @@ -2041,7 +1895,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %import_ref.21 = import_ref Main//int_ops, Uint32ToUintLiteral, unloaded // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.22 -// CHECK:STDOUT: .ImplicitAs = %import_ref.23 +// CHECK:STDOUT: .ImplicitAs = %import_ref.29 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -2076,9 +1930,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc5_19.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc5_19.2: type = converted %int.make_type_signed, %.loc5_19.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Uint32ToInt32(%a.param_patt: %u32) -> %i32 = "int.convert_checked" [from "int_ops.carbon"]; @@ -2093,7 +1945,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %AddU32.ref: %AddU32.type = name_ref AddU32, imports.%import_ref.3 [template = constants.%AddU32] // CHECK:STDOUT: %Int32ToUint32.ref.loc11: %Int32ToUint32.type = name_ref Int32ToUint32, imports.%import_ref.6 [template = constants.%Int32ToUint32] // CHECK:STDOUT: %int_2147483647: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] -// CHECK:STDOUT: %impl.elem0.loc11: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc11: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11: = bound_method %int_2147483647, %impl.elem0.loc11 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc11: = specific_function %Convert.bound.loc11, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc11_26: init %i32 = call %Convert.specific_fn.loc11(%int_2147483647) [template = constants.%int_2147483647.2] @@ -2102,7 +1954,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %int.convert_checked.loc11_37: init %u32 = call %Int32ToUint32.ref.loc11(%.loc11_26.2) [template = constants.%int_2147483647.3] // CHECK:STDOUT: %Int32ToUint32.ref.loc12: %Int32ToUint32.type = name_ref Int32ToUint32, imports.%import_ref.6 [template = constants.%Int32ToUint32] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc12: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc12: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc12: = bound_method %int_1, %impl.elem0.loc12 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc12: = specific_function %Convert.bound.loc12, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc12_26: init %i32 = call %Convert.specific_fn.loc12(%int_1) [template = constants.%int_1.2] @@ -2127,19 +1979,17 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i16: type = int_type signed, %int_16 [template] +// CHECK:STDOUT: %i16: type = class_type @Int, @Int(%int_16) [template] // CHECK:STDOUT: %Int32ToInt16.type: type = fn_type @Int32ToInt16 [template] // CHECK:STDOUT: %Int32ToInt16: %Int32ToInt16.type = struct_value () [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %int_32768.1: Core.IntLiteral = int_value 32768 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_32768.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound: = bound_method %int_32768.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_32768.2: %i32 = int_value 32768 [template] // CHECK:STDOUT: %int_32768.3: %i16 = int_value 32768 [template] @@ -2169,7 +2019,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %import_ref.21 = import_ref Main//int_ops, Uint32ToUintLiteral, unloaded // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.22 -// CHECK:STDOUT: .ImplicitAs = %import_ref.23 +// CHECK:STDOUT: .ImplicitAs = %import_ref.26 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -2204,9 +2054,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [template = constants.%int_16] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_16) [template = constants.%i16] -// CHECK:STDOUT: %.loc9_19.1: type = value_of_initializer %int.make_type_signed [template = constants.%i16] -// CHECK:STDOUT: %.loc9_19.2: type = converted %int.make_type_signed, %.loc9_19.1 [template = constants.%i16] +// CHECK:STDOUT: %i16: type = class_type @Int, @Int(constants.%int_16) [template = constants.%i16] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32ToInt16(%a.param_patt: %i32) -> %i16 = "int.convert_checked" [from "int_ops.carbon"]; @@ -2215,7 +2063,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Int32ToInt16.ref: %Int32ToInt16.type = name_ref Int32ToInt16, imports.%import_ref.10 [template = constants.%Int32ToInt16] // CHECK:STDOUT: %int_32768: Core.IntLiteral = int_value 32768 [template = constants.%int_32768.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_32768, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc9_38: init %i32 = call %Convert.specific_fn(%int_32768) [template = constants.%int_32768.2] @@ -2232,19 +2080,17 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [template] -// CHECK:STDOUT: %UInt.type: type = fn_type @UInt [template] -// CHECK:STDOUT: %UInt: %UInt.type = struct_value () [template] -// CHECK:STDOUT: %u16: type = int_type unsigned, %int_16 [template] +// CHECK:STDOUT: %u16: type = class_type @UInt, @UInt(%int_16) [template] // CHECK:STDOUT: %Int32ToUint16.type: type = fn_type @Int32ToUint16 [template] // CHECK:STDOUT: %Int32ToUint16: %Int32ToUint16.type = struct_value () [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %int_65536.1: Core.IntLiteral = int_value 65536 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_65536.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound: = bound_method %int_65536.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_65536.2: %i32 = int_value 65536 [template] // CHECK:STDOUT: %int_65536.3: %u16 = int_value 65536 [template] @@ -2274,7 +2120,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %import_ref.21 = import_ref Main//int_ops, Uint32ToUintLiteral, unloaded // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .UInt = %import_ref.22 -// CHECK:STDOUT: .ImplicitAs = %import_ref.23 +// CHECK:STDOUT: .ImplicitAs = %import_ref.29 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -2309,9 +2155,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [template = constants.%int_16] -// CHECK:STDOUT: %int.make_type_unsigned: init type = call constants.%UInt(%int_16) [template = constants.%u16] -// CHECK:STDOUT: %.loc9_19.1: type = value_of_initializer %int.make_type_unsigned [template = constants.%u16] -// CHECK:STDOUT: %.loc9_19.2: type = converted %int.make_type_unsigned, %.loc9_19.1 [template = constants.%u16] +// CHECK:STDOUT: %u16: type = class_type @UInt, @UInt(constants.%int_16) [template = constants.%u16] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32ToUint16(%a.param_patt: %i32) -> %u16 = "int.convert_checked" [from "int_ops.carbon"]; @@ -2320,7 +2164,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Int32ToUint16.ref: %Int32ToUint16.type = name_ref Int32ToUint16, imports.%import_ref.11 [template = constants.%Int32ToUint16] // CHECK:STDOUT: %int_65536: Core.IntLiteral = int_value 65536 [template = constants.%int_65536.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_65536, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc9_39: init %i32 = call %Convert.specific_fn(%int_65536) [template = constants.%int_65536.2] @@ -2337,22 +2181,20 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i16: type = int_type signed, %int_16 [template] +// CHECK:STDOUT: %i16: type = class_type @Int, @Int(%int_16) [template] // CHECK:STDOUT: %Uint32ToInt16.type: type = fn_type @Uint32ToInt16 [template] // CHECK:STDOUT: %Uint32ToInt16: %Uint32ToInt16.type = struct_value () [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %u32: type = int_type unsigned, %int_32 [template] +// CHECK:STDOUT: %u32: type = class_type @UInt, @UInt(%int_32) [template] // CHECK:STDOUT: %Int32ToUint32.type: type = fn_type @Int32ToUint32 [template] // CHECK:STDOUT: %Int32ToUint32: %Int32ToUint32.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %int_32768.1: Core.IntLiteral = int_value 32768 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_32768.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound: = bound_method %int_32768.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_32768.2: %i32 = int_value 32768 [template] // CHECK:STDOUT: %int_32768.3: %u32 = int_value 32768 [template] @@ -2383,7 +2225,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %import_ref.21 = import_ref Main//int_ops, Uint32ToUintLiteral, unloaded // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.22 -// CHECK:STDOUT: .ImplicitAs = %import_ref.23 +// CHECK:STDOUT: .ImplicitAs = %import_ref.29 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -2418,9 +2260,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [template = constants.%int_16] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_16) [template = constants.%i16] -// CHECK:STDOUT: %.loc9_19.1: type = value_of_initializer %int.make_type_signed [template = constants.%i16] -// CHECK:STDOUT: %.loc9_19.2: type = converted %int.make_type_signed, %.loc9_19.1 [template = constants.%i16] +// CHECK:STDOUT: %i16: type = class_type @Int, @Int(constants.%int_16) [template = constants.%i16] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Uint32ToInt16(%a.param_patt: %u32) -> %i16 = "int.convert_checked" [from "int_ops.carbon"]; @@ -2432,7 +2272,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %Uint32ToInt16.ref: %Uint32ToInt16.type = name_ref Uint32ToInt16, imports.%import_ref.12 [template = constants.%Uint32ToInt16] // CHECK:STDOUT: %Int32ToUint32.ref: %Int32ToUint32.type = name_ref Int32ToUint32, imports.%import_ref.6 [template = constants.%Int32ToUint32] // CHECK:STDOUT: %int_32768: Core.IntLiteral = int_value 32768 [template = constants.%int_32768.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_32768, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc9_53: init %i32 = call %Convert.specific_fn(%int_32768) [template = constants.%int_32768.2] @@ -2452,22 +2292,20 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [template] -// CHECK:STDOUT: %UInt.type: type = fn_type @UInt [template] -// CHECK:STDOUT: %UInt: %UInt.type = struct_value () [template] -// CHECK:STDOUT: %u16: type = int_type unsigned, %int_16 [template] +// CHECK:STDOUT: %u16: type = class_type @UInt, @UInt(%int_16) [template] // CHECK:STDOUT: %Uint32ToUint16.type: type = fn_type @Uint32ToUint16 [template] // CHECK:STDOUT: %Uint32ToUint16: %Uint32ToUint16.type = struct_value () [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %u32: type = int_type unsigned, %int_32 [template] +// CHECK:STDOUT: %u32: type = class_type @UInt, @UInt(%int_32) [template] // CHECK:STDOUT: %Int32ToUint32.type: type = fn_type @Int32ToUint32 [template] // CHECK:STDOUT: %Int32ToUint32: %Int32ToUint32.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %int_65536.1: Core.IntLiteral = int_value 65536 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_65536.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound: = bound_method %int_65536.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_65536.2: %i32 = int_value 65536 [template] // CHECK:STDOUT: %int_65536.3: %u32 = int_value 65536 [template] @@ -2498,7 +2336,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %import_ref.21 = import_ref Main//int_ops, Uint32ToUintLiteral, unloaded // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .UInt = %import_ref.22 -// CHECK:STDOUT: .ImplicitAs = %import_ref.23 +// CHECK:STDOUT: .ImplicitAs = %import_ref.29 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -2533,9 +2371,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [template = constants.%int_16] -// CHECK:STDOUT: %int.make_type_unsigned: init type = call constants.%UInt(%int_16) [template = constants.%u16] -// CHECK:STDOUT: %.loc9_19.1: type = value_of_initializer %int.make_type_unsigned [template = constants.%u16] -// CHECK:STDOUT: %.loc9_19.2: type = converted %int.make_type_unsigned, %.loc9_19.1 [template = constants.%u16] +// CHECK:STDOUT: %u16: type = class_type @UInt, @UInt(constants.%int_16) [template = constants.%u16] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Uint32ToUint16(%a.param_patt: %u32) -> %u16 = "int.convert_checked" [from "int_ops.carbon"]; @@ -2547,7 +2383,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %Uint32ToUint16.ref: %Uint32ToUint16.type = name_ref Uint32ToUint16, imports.%import_ref.13 [template = constants.%Uint32ToUint16] // CHECK:STDOUT: %Int32ToUint32.ref: %Int32ToUint32.type = name_ref Int32ToUint32, imports.%import_ref.6 [template = constants.%Int32ToUint32] // CHECK:STDOUT: %int_65536: Core.IntLiteral = int_value 65536 [template = constants.%int_65536.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_65536, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc9_54: init %i32 = call %Convert.specific_fn(%int_65536) [template = constants.%int_65536.2] @@ -2567,25 +2403,23 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [template] -// CHECK:STDOUT: %UInt.type: type = fn_type @UInt [template] -// CHECK:STDOUT: %UInt: %UInt.type = struct_value () [template] -// CHECK:STDOUT: %u16: type = int_type unsigned, %int_16 [template] +// CHECK:STDOUT: %u16: type = class_type @UInt, @UInt(%int_16) [template] // CHECK:STDOUT: %Int32ToUint16.type: type = fn_type @Int32ToUint16 [template] // CHECK:STDOUT: %Int32ToUint16: %Int32ToUint16.type = struct_value () [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %SubI32.type: type = fn_type @SubI32 [template] // CHECK:STDOUT: %SubI32: %SubI32.type = struct_value () [template] // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_0.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] // CHECK:STDOUT: %int_-1.1: %i32 = int_value -1 [template] @@ -2616,7 +2450,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %import_ref.21 = import_ref Main//int_ops, Uint32ToUintLiteral, unloaded // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .UInt = %import_ref.22 -// CHECK:STDOUT: .ImplicitAs = %import_ref.23 +// CHECK:STDOUT: .ImplicitAs = %import_ref.29 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -2651,9 +2485,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [template = constants.%int_16] -// CHECK:STDOUT: %int.make_type_unsigned: init type = call constants.%UInt(%int_16) [template = constants.%u16] -// CHECK:STDOUT: %.loc9_23.1: type = value_of_initializer %int.make_type_unsigned [template = constants.%u16] -// CHECK:STDOUT: %.loc9_23.2: type = converted %int.make_type_unsigned, %.loc9_23.1 [template = constants.%u16] +// CHECK:STDOUT: %u16: type = class_type @UInt, @UInt(constants.%int_16) [template = constants.%u16] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32ToUint16(%a.param_patt: %i32) -> %u16 = "int.convert_checked" [from "int_ops.carbon"]; @@ -2666,13 +2498,13 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %SubI32.ref: %SubI32.type = name_ref SubI32, imports.%import_ref.2 [template = constants.%SubI32] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc9_50: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc9_50: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc9_50: = bound_method %int_0, %impl.elem0.loc9_50 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc9_50: = specific_function %Convert.bound.loc9_50, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc9_50: init %i32 = call %Convert.specific_fn.loc9_50(%int_0) [template = constants.%int_0.2] // CHECK:STDOUT: %.loc9_50.1: %i32 = value_of_initializer %int.convert_checked.loc9_50 [template = constants.%int_0.2] // CHECK:STDOUT: %.loc9_50.2: %i32 = converted %int_0, %.loc9_50.1 [template = constants.%int_0.2] -// CHECK:STDOUT: %impl.elem0.loc9_53: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc9_53: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc9_53: = bound_method %int_1, %impl.elem0.loc9_53 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc9_53: = specific_function %Convert.bound.loc9_53, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc9_53: init %i32 = call %Convert.specific_fn.loc9_53(%int_1) [template = constants.%int_1.2] @@ -2692,24 +2524,22 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %UInt.type: type = fn_type @UInt [template] -// CHECK:STDOUT: %UInt: %UInt.type = struct_value () [template] -// CHECK:STDOUT: %u32: type = int_type unsigned, %int_32 [template] +// CHECK:STDOUT: %u32: type = class_type @UInt, @UInt(%int_32) [template] // CHECK:STDOUT: %Int32ToUint32.type: type = fn_type @Int32ToUint32 [template] // CHECK:STDOUT: %Int32ToUint32: %Int32ToUint32.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %SubI32.type: type = fn_type @SubI32 [template] // CHECK:STDOUT: %SubI32: %SubI32.type = struct_value () [template] // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_0.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] // CHECK:STDOUT: %int_-1.1: %i32 = int_value -1 [template] @@ -2740,7 +2570,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %import_ref.21 = import_ref Main//int_ops, Uint32ToUintLiteral, unloaded // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .UInt = %import_ref.22 -// CHECK:STDOUT: .ImplicitAs = %import_ref.23 +// CHECK:STDOUT: .ImplicitAs = %import_ref.29 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -2775,9 +2605,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_unsigned: init type = call constants.%UInt(%int_32) [template = constants.%u32] -// CHECK:STDOUT: %.loc9_23.1: type = value_of_initializer %int.make_type_unsigned [template = constants.%u32] -// CHECK:STDOUT: %.loc9_23.2: type = converted %int.make_type_unsigned, %.loc9_23.1 [template = constants.%u32] +// CHECK:STDOUT: %u32: type = class_type @UInt, @UInt(constants.%int_32) [template = constants.%u32] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32ToUint32(%a.param_patt: %i32) -> %u32 = "int.convert_checked" [from "int_ops.carbon"]; @@ -2790,13 +2618,13 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %SubI32.ref: %SubI32.type = name_ref SubI32, imports.%import_ref.2 [template = constants.%SubI32] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc9_50: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc9_50: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc9_50: = bound_method %int_0, %impl.elem0.loc9_50 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc9_50: = specific_function %Convert.bound.loc9_50, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc9_50: init %i32 = call %Convert.specific_fn.loc9_50(%int_0) [template = constants.%int_0.2] // CHECK:STDOUT: %.loc9_50.1: %i32 = value_of_initializer %int.convert_checked.loc9_50 [template = constants.%int_0.2] // CHECK:STDOUT: %.loc9_50.2: %i32 = converted %int_0, %.loc9_50.1 [template = constants.%int_0.2] -// CHECK:STDOUT: %impl.elem0.loc9_53: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc9_53: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc9_53: = bound_method %int_1, %impl.elem0.loc9_53 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc9_53: = specific_function %Convert.bound.loc9_53, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc9_53: init %i32 = call %Convert.specific_fn.loc9_53(%int_1) [template = constants.%int_1.2] @@ -2816,25 +2644,23 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [template] -// CHECK:STDOUT: %UInt.type: type = fn_type @UInt [template] -// CHECK:STDOUT: %UInt: %UInt.type = struct_value () [template] -// CHECK:STDOUT: %u64: type = int_type unsigned, %int_64 [template] +// CHECK:STDOUT: %u64: type = class_type @UInt, @UInt(%int_64) [template] // CHECK:STDOUT: %Int32ToUint64.type: type = fn_type @Int32ToUint64 [template] // CHECK:STDOUT: %Int32ToUint64: %Int32ToUint64.type = struct_value () [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %SubI32.type: type = fn_type @SubI32 [template] // CHECK:STDOUT: %SubI32: %SubI32.type = struct_value () [template] // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_0.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] // CHECK:STDOUT: %int_-1.1: %i32 = int_value -1 [template] @@ -2865,7 +2691,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %import_ref.21 = import_ref Main//int_ops, Uint32ToUintLiteral, unloaded // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .UInt = %import_ref.22 -// CHECK:STDOUT: .ImplicitAs = %import_ref.23 +// CHECK:STDOUT: .ImplicitAs = %import_ref.29 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -2900,9 +2726,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %int.make_type_unsigned: init type = call constants.%UInt(%int_64) [template = constants.%u64] -// CHECK:STDOUT: %.loc9_23.1: type = value_of_initializer %int.make_type_unsigned [template = constants.%u64] -// CHECK:STDOUT: %.loc9_23.2: type = converted %int.make_type_unsigned, %.loc9_23.1 [template = constants.%u64] +// CHECK:STDOUT: %u64: type = class_type @UInt, @UInt(constants.%int_64) [template = constants.%u64] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32ToUint64(%a.param_patt: %i32) -> %u64 = "int.convert_checked" [from "int_ops.carbon"]; @@ -2915,13 +2739,13 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %SubI32.ref: %SubI32.type = name_ref SubI32, imports.%import_ref.2 [template = constants.%SubI32] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc9_50: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc9_50: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc9_50: = bound_method %int_0, %impl.elem0.loc9_50 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc9_50: = specific_function %Convert.bound.loc9_50, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc9_50: init %i32 = call %Convert.specific_fn.loc9_50(%int_0) [template = constants.%int_0.2] // CHECK:STDOUT: %.loc9_50.1: %i32 = value_of_initializer %int.convert_checked.loc9_50 [template = constants.%int_0.2] // CHECK:STDOUT: %.loc9_50.2: %i32 = converted %int_0, %.loc9_50.1 [template = constants.%int_0.2] -// CHECK:STDOUT: %impl.elem0.loc9_53: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc9_53: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc9_53: = bound_method %int_1, %impl.elem0.loc9_53 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc9_53: = specific_function %Convert.bound.loc9_53, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc9_53: init %i32 = call %Convert.specific_fn.loc9_53(%int_1) [template = constants.%int_1.2] @@ -2941,21 +2765,19 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i16: type = int_type signed, %int_16 [template] +// CHECK:STDOUT: %i16: type = class_type @Int, @Int(%int_16) [template] // CHECK:STDOUT: %Int32ToInt16.type: type = fn_type @Int32ToInt16 [template] // CHECK:STDOUT: %Int32ToInt16: %Int32ToInt16.type = struct_value () [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %NegateI32.type: type = fn_type @NegateI32 [template] // CHECK:STDOUT: %NegateI32: %NegateI32.type = struct_value () [template] // CHECK:STDOUT: %int_32769.1: Core.IntLiteral = int_value 32769 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_32769.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound: = bound_method %int_32769.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_32769.2: %i32 = int_value 32769 [template] // CHECK:STDOUT: %int_-32769.1: %i32 = int_value -32769 [template] @@ -2986,7 +2808,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %import_ref.21 = import_ref Main//int_ops, Uint32ToUintLiteral, unloaded // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.22 -// CHECK:STDOUT: .ImplicitAs = %import_ref.23 +// CHECK:STDOUT: .ImplicitAs = %import_ref.26 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -3021,9 +2843,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [template = constants.%int_16] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_16) [template = constants.%i16] -// CHECK:STDOUT: %.loc9_20.1: type = value_of_initializer %int.make_type_signed [template = constants.%i16] -// CHECK:STDOUT: %.loc9_20.2: type = converted %int.make_type_signed, %.loc9_20.1 [template = constants.%i16] +// CHECK:STDOUT: %i16: type = class_type @Int, @Int(constants.%int_16) [template = constants.%i16] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32ToInt16(%a.param_patt: %i32) -> %i16 = "int.convert_checked" [from "int_ops.carbon"]; @@ -3035,7 +2855,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %Int32ToInt16.ref: %Int32ToInt16.type = name_ref Int32ToInt16, imports.%import_ref.10 [template = constants.%Int32ToInt16] // CHECK:STDOUT: %NegateI32.ref: %NegateI32.type = name_ref NegateI32, imports.%import_ref.1 [template = constants.%NegateI32] // CHECK:STDOUT: %int_32769: Core.IntLiteral = int_value 32769 [template = constants.%int_32769.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_32769, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc9_49: init %i32 = call %Convert.specific_fn(%int_32769) [template = constants.%int_32769.2] @@ -3055,25 +2875,23 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] // CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [template] -// CHECK:STDOUT: %i16: type = int_type signed, %int_16 [template] +// CHECK:STDOUT: %i16: type = class_type @Int, @Int(%int_16) [template] // CHECK:STDOUT: %Int32ToInt16.type: type = fn_type @Int32ToInt16 [template] // CHECK:STDOUT: %Int32ToInt16: %Int32ToInt16.type = struct_value () [template] // CHECK:STDOUT: %Int32ToInt32.type: type = fn_type @Int32ToInt32 [template] // CHECK:STDOUT: %Int32ToInt32: %Int32ToInt32.type = struct_value () [template] // CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [template] -// CHECK:STDOUT: %i64: type = int_type signed, %int_64 [template] +// CHECK:STDOUT: %i64: type = class_type @Int, @Int(%int_64) [template] // CHECK:STDOUT: %Int32ToInt64.type: type = fn_type @Int32ToInt64 [template] // CHECK:STDOUT: %Int32ToInt64: %Int32ToInt64.type = struct_value () [template] // CHECK:STDOUT: } @@ -3102,7 +2920,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %import_ref.21 = import_ref Main//int_ops, Uint32ToUintLiteral, unloaded // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.22 -// CHECK:STDOUT: .ImplicitAs = %import_ref.23 +// CHECK:STDOUT: .ImplicitAs = %import_ref.26 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -3140,21 +2958,13 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %int_32.loc5: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc5: init type = call constants.%Int(%int_32.loc5) [template = constants.%i32] -// CHECK:STDOUT: %.loc5_19.1: type = value_of_initializer %int.make_type_signed.loc5 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_19.2: type = converted %int.make_type_signed.loc5, %.loc5_19.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc5: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [template = constants.%int_16] -// CHECK:STDOUT: %int.make_type_signed.loc15: init type = call constants.%Int(%int_16) [template = constants.%i16] -// CHECK:STDOUT: %.loc15_34.1: type = value_of_initializer %int.make_type_signed.loc15 [template = constants.%i16] -// CHECK:STDOUT: %.loc15_34.2: type = converted %int.make_type_signed.loc15, %.loc15_34.1 [template = constants.%i16] +// CHECK:STDOUT: %i16: type = class_type @Int, @Int(constants.%int_16) [template = constants.%i16] // CHECK:STDOUT: %int_32.loc25: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc25: init type = call constants.%Int(%int_32.loc25) [template = constants.%i32] -// CHECK:STDOUT: %.loc25_32.1: type = value_of_initializer %int.make_type_signed.loc25 [template = constants.%i32] -// CHECK:STDOUT: %.loc25_32.2: type = converted %int.make_type_signed.loc25, %.loc25_32.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc25: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %int.make_type_signed.loc34: init type = call constants.%Int(%int_64) [template = constants.%i64] -// CHECK:STDOUT: %.loc34_33.1: type = value_of_initializer %int.make_type_signed.loc34 [template = constants.%i64] -// CHECK:STDOUT: %.loc34_33.2: type = converted %int.make_type_signed.loc34, %.loc34_33.1 [template = constants.%i64] +// CHECK:STDOUT: %i64: type = class_type @Int, @Int(constants.%int_64) [template = constants.%i64] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32ToInt16(%a.param_patt: %i32) -> %i16 = "int.convert_checked" [from "int_ops.carbon"]; @@ -3166,7 +2976,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc5: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.2] diff --git a/toolchain/check/testdata/builtins/int/eq.carbon b/toolchain/check/testdata/builtins/int/eq.carbon index 1859c8b8718fd..d8a3614bad6ea 100644 --- a/toolchain/check/testdata/builtins/int/eq.carbon +++ b/toolchain/check/testdata/builtins/int/eq.carbon @@ -37,30 +37,28 @@ fn WrongResult(a: i32, b: i32) -> i32 = "int.eq"; // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %Bool.type: type = fn_type @Bool [template] // CHECK:STDOUT: %Bool: %Bool.type = struct_value () [template] -// CHECK:STDOUT: %Eq.type: type = fn_type @Eq [template] -// CHECK:STDOUT: %Eq: %Eq.type = struct_value () [template] +// CHECK:STDOUT: %Eq.type.1: type = fn_type @Eq.1 [template] +// CHECK:STDOUT: %Eq: %Eq.type.1 = struct_value () [template] // CHECK:STDOUT: %True: type = class_type @True [template] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] -// CHECK:STDOUT: %complete_type.1: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %complete_type.3: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %False: type = class_type @False [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] // CHECK:STDOUT: %true: bool = bool_literal true [template] // CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] // CHECK:STDOUT: %false: bool = bool_literal false [template] @@ -71,8 +69,8 @@ fn WrongResult(a: i32, b: i32) -> i32 = "int.eq"; // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .Bool = %import_ref.2 -// CHECK:STDOUT: .ImplicitAs = %import_ref.3 +// CHECK:STDOUT: .Bool = %import_ref.5 +// CHECK:STDOUT: .ImplicitAs = %import_ref.6 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -88,7 +86,7 @@ fn WrongResult(a: i32, b: i32) -> i32 = "int.eq"; // CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Eq.decl: %Eq.type = fn_decl @Eq [template = constants.%Eq] { +// CHECK:STDOUT: %Eq.decl: %Eq.type.1 = fn_decl @Eq.1 [template = constants.%Eq] { // CHECK:STDOUT: %a.patt: %i32 = binding_pattern a // CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: %i32 = binding_pattern b @@ -97,13 +95,9 @@ fn WrongResult(a: i32, b: i32) -> i32 = "int.eq"; // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc2_10: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc2_10: init type = call constants.%Int(%int_32.loc2_10) [template = constants.%i32] -// CHECK:STDOUT: %.loc2_10.1: type = value_of_initializer %int.make_type_signed.loc2_10 [template = constants.%i32] -// CHECK:STDOUT: %.loc2_10.2: type = converted %int.make_type_signed.loc2_10, %.loc2_10.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc2_10: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc2_18: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc2_18: init type = call constants.%Int(%int_32.loc2_18) [template = constants.%i32] -// CHECK:STDOUT: %.loc2_18.1: type = value_of_initializer %int.make_type_signed.loc2_18 [template = constants.%i32] -// CHECK:STDOUT: %.loc2_18.2: type = converted %int.make_type_signed.loc2_18, %.loc2_18.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc2_18: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc2_26.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc2_26.2: type = converted %bool.make_type, %.loc2_26.1 [template = bool] @@ -138,13 +132,9 @@ fn WrongResult(a: i32, b: i32) -> i32 = "int.eq"; // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc12_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc12_19: init type = call constants.%Int(%int_32.loc12_19) [template = constants.%i32] -// CHECK:STDOUT: %.loc12_19.1: type = value_of_initializer %int.make_type_signed.loc12_19 [template = constants.%i32] -// CHECK:STDOUT: %.loc12_19.2: type = converted %int.make_type_signed.loc12_19, %.loc12_19.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc12_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc12_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc12_27: init type = call constants.%Int(%int_32.loc12_27) [template = constants.%i32] -// CHECK:STDOUT: %.loc12_27.1: type = value_of_initializer %int.make_type_signed.loc12_27 [template = constants.%i32] -// CHECK:STDOUT: %.loc12_27.2: type = converted %int.make_type_signed.loc12_27, %.loc12_27.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc12_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc12_35.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc12_35.2: type = converted %bool.make_type, %.loc12_35.1 [template = bool] @@ -158,7 +148,7 @@ fn WrongResult(a: i32, b: i32) -> i32 = "int.eq"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @True { -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%True @@ -166,28 +156,28 @@ fn WrongResult(a: i32, b: i32) -> i32 = "int.eq"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @False { -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%False // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Eq(%a.param_patt: %i32, %b.param_patt: %i32) -> bool = "int.eq"; +// CHECK:STDOUT: fn @Eq.1(%a.param_patt: %i32, %b.param_patt: %i32) -> bool = "int.eq"; // CHECK:STDOUT: // CHECK:STDOUT: fn @F(%true_.param_patt: %True, %false_.param_patt: %False) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %true_.ref: %True = name_ref true_, %true_ -// CHECK:STDOUT: %Eq.ref.loc8: %Eq.type = name_ref Eq, file.%Eq.decl [template = constants.%Eq] +// CHECK:STDOUT: %Eq.ref.loc8: %Eq.type.1 = name_ref Eq, file.%Eq.decl [template = constants.%Eq] // CHECK:STDOUT: %int_1.loc8_19: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_1.loc8_22: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc8_19: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc8_19: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc8_19: = bound_method %int_1.loc8_19, %impl.elem0.loc8_19 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc8_19: = specific_function %Convert.bound.loc8_19, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc8_19: init %i32 = call %Convert.specific_fn.loc8_19(%int_1.loc8_19) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc8_19.1: %i32 = value_of_initializer %int.convert_checked.loc8_19 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc8_19.2: %i32 = converted %int_1.loc8_19, %.loc8_19.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc8_22: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc8_22: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc8_22: = bound_method %int_1.loc8_22, %impl.elem0.loc8_22 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc8_22: = specific_function %Convert.bound.loc8_22, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc8_22: init %i32 = call %Convert.specific_fn.loc8_22(%int_1.loc8_22) [template = constants.%int_1.2] @@ -209,16 +199,16 @@ fn WrongResult(a: i32, b: i32) -> i32 = "int.eq"; // CHECK:STDOUT: !if.expr.result.loc8: // CHECK:STDOUT: %.loc8_13.3: type = block_arg !if.expr.result.loc8 [template = constants.%True] // CHECK:STDOUT: %false_.ref: %False = name_ref false_, %false_ -// CHECK:STDOUT: %Eq.ref.loc9: %Eq.type = name_ref Eq, file.%Eq.decl [template = constants.%Eq] +// CHECK:STDOUT: %Eq.ref.loc9: %Eq.type.1 = name_ref Eq, file.%Eq.decl [template = constants.%Eq] // CHECK:STDOUT: %int_1.loc9: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %impl.elem0.loc9_20: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc9_20: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc9_20: = bound_method %int_1.loc9, %impl.elem0.loc9_20 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc9_20: = specific_function %Convert.bound.loc9_20, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc9_20: init %i32 = call %Convert.specific_fn.loc9_20(%int_1.loc9) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc9_20.1: %i32 = value_of_initializer %int.convert_checked.loc9_20 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc9_20.2: %i32 = converted %int_1.loc9, %.loc9_20.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc9_23: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc9_23: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc9_23: = bound_method %int_2, %impl.elem0.loc9_23 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc9_23: = specific_function %Convert.bound.loc9_23, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc9_23: init %i32 = call %Convert.specific_fn.loc9_23(%int_2) [template = constants.%int_2.2] @@ -244,7 +234,7 @@ fn WrongResult(a: i32, b: i32) -> i32 = "int.eq"; // CHECK:STDOUT: // CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: %i32, %b.param_patt: %i32) -> bool { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Eq.ref: %Eq.type = name_ref Eq, file.%Eq.decl [template = constants.%Eq] +// CHECK:STDOUT: %Eq.ref: %Eq.type.1 = name_ref Eq, file.%Eq.decl [template = constants.%Eq] // CHECK:STDOUT: %a.ref: %i32 = name_ref a, %a // CHECK:STDOUT: %b.ref: %i32 = name_ref b, %b // CHECK:STDOUT: %int.eq: init bool = call %Eq.ref(%a.ref, %b.ref) @@ -257,16 +247,14 @@ fn WrongResult(a: i32, b: i32) -> i32 = "int.eq"; // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %WrongResult.type: type = fn_type @WrongResult [template] // CHECK:STDOUT: %WrongResult: %WrongResult.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -287,17 +275,11 @@ fn WrongResult(a: i32, b: i32) -> i32 = "int.eq"; // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc7_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc7_19: init type = call constants.%Int(%int_32.loc7_19) [template = constants.%i32] -// CHECK:STDOUT: %.loc7_19.1: type = value_of_initializer %int.make_type_signed.loc7_19 [template = constants.%i32] -// CHECK:STDOUT: %.loc7_19.2: type = converted %int.make_type_signed.loc7_19, %.loc7_19.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc7_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc7_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc7_27: init type = call constants.%Int(%int_32.loc7_27) [template = constants.%i32] -// CHECK:STDOUT: %.loc7_27.1: type = value_of_initializer %int.make_type_signed.loc7_27 [template = constants.%i32] -// CHECK:STDOUT: %.loc7_27.2: type = converted %int.make_type_signed.loc7_27, %.loc7_27.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc7_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc7_35: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc7_35: init type = call constants.%Int(%int_32.loc7_35) [template = constants.%i32] -// CHECK:STDOUT: %.loc7_35.1: type = value_of_initializer %int.make_type_signed.loc7_35 [template = constants.%i32] -// CHECK:STDOUT: %.loc7_35.2: type = converted %int.make_type_signed.loc7_35, %.loc7_35.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc7_35: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 diff --git a/toolchain/check/testdata/builtins/int/greater.carbon b/toolchain/check/testdata/builtins/int/greater.carbon index 1424735e65d22..430c602d3043a 100644 --- a/toolchain/check/testdata/builtins/int/greater.carbon +++ b/toolchain/check/testdata/builtins/int/greater.carbon @@ -32,36 +32,34 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %Bool.type: type = fn_type @Bool [template] // CHECK:STDOUT: %Bool: %Bool.type = struct_value () [template] // CHECK:STDOUT: %Greater.type: type = fn_type @Greater [template] // CHECK:STDOUT: %Greater: %Greater.type = struct_value () [template] -// CHECK:STDOUT: %Negate.type: type = fn_type @Negate [template] -// CHECK:STDOUT: %Negate: %Negate.type = struct_value () [template] +// CHECK:STDOUT: %Negate.type.1: type = fn_type @Negate.1 [template] +// CHECK:STDOUT: %Negate: %Negate.type.1 = struct_value () [template] // CHECK:STDOUT: %True: type = class_type @True [template] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] -// CHECK:STDOUT: %complete_type.1: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %complete_type.3: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %False: type = class_type @False [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] // CHECK:STDOUT: %false: bool = bool_literal false [template] // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] -// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_0.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] // CHECK:STDOUT: %true: bool = bool_literal true [template] @@ -73,8 +71,8 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .Bool = %import_ref.2 -// CHECK:STDOUT: .ImplicitAs = %import_ref.3 +// CHECK:STDOUT: .Bool = %import_ref.5 +// CHECK:STDOUT: .ImplicitAs = %import_ref.6 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -100,13 +98,9 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc2_15: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc2_15: init type = call constants.%Int(%int_32.loc2_15) [template = constants.%i32] -// CHECK:STDOUT: %.loc2_15.1: type = value_of_initializer %int.make_type_signed.loc2_15 [template = constants.%i32] -// CHECK:STDOUT: %.loc2_15.2: type = converted %int.make_type_signed.loc2_15, %.loc2_15.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc2_15: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc2_23: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc2_23: init type = call constants.%Int(%int_32.loc2_23) [template = constants.%i32] -// CHECK:STDOUT: %.loc2_23.1: type = value_of_initializer %int.make_type_signed.loc2_23 [template = constants.%i32] -// CHECK:STDOUT: %.loc2_23.2: type = converted %int.make_type_signed.loc2_23, %.loc2_23.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc2_23: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc2_31.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc2_31.2: type = converted %bool.make_type, %.loc2_31.1 [template = bool] @@ -117,20 +111,16 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %Negate.decl: %Negate.type = fn_decl @Negate [template = constants.%Negate] { +// CHECK:STDOUT: %Negate.decl: %Negate.type.1 = fn_decl @Negate.1 [template = constants.%Negate] { // CHECK:STDOUT: %a.patt: %i32 = binding_pattern a // CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc3_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc3_14: init type = call constants.%Int(%int_32.loc3_14) [template = constants.%i32] -// CHECK:STDOUT: %.loc3_14.1: type = value_of_initializer %int.make_type_signed.loc3_14 [template = constants.%i32] -// CHECK:STDOUT: %.loc3_14.2: type = converted %int.make_type_signed.loc3_14, %.loc3_14.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc3_14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc3_22: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc3_22: init type = call constants.%Int(%int_32.loc3_22) [template = constants.%i32] -// CHECK:STDOUT: %.loc3_22.1: type = value_of_initializer %int.make_type_signed.loc3_22 [template = constants.%i32] -// CHECK:STDOUT: %.loc3_22.2: type = converted %int.make_type_signed.loc3_22, %.loc3_22.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc3_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 @@ -160,13 +150,9 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc16_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc16_19: init type = call constants.%Int(%int_32.loc16_19) [template = constants.%i32] -// CHECK:STDOUT: %.loc16_19.1: type = value_of_initializer %int.make_type_signed.loc16_19 [template = constants.%i32] -// CHECK:STDOUT: %.loc16_19.2: type = converted %int.make_type_signed.loc16_19, %.loc16_19.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc16_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc16_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc16_27: init type = call constants.%Int(%int_32.loc16_27) [template = constants.%i32] -// CHECK:STDOUT: %.loc16_27.1: type = value_of_initializer %int.make_type_signed.loc16_27 [template = constants.%i32] -// CHECK:STDOUT: %.loc16_27.2: type = converted %int.make_type_signed.loc16_27, %.loc16_27.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc16_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc16_35.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc16_35.2: type = converted %bool.make_type, %.loc16_35.1 [template = bool] @@ -180,7 +166,7 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @True { -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%True @@ -188,7 +174,7 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @False { -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%False @@ -197,7 +183,7 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: // CHECK:STDOUT: fn @Greater(%a.param_patt: %i32, %b.param_patt: %i32) -> bool = "int.greater"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Negate(%a.param_patt: %i32) -> %i32 = "int.snegate"; +// CHECK:STDOUT: fn @Negate.1(%a.param_patt: %i32) -> %i32 = "int.snegate"; // CHECK:STDOUT: // CHECK:STDOUT: fn @F(%true_.param_patt: %True, %false_.param_patt: %False) { // CHECK:STDOUT: !entry: @@ -205,13 +191,13 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %Greater.ref.loc9: %Greater.type = name_ref Greater, file.%Greater.decl [template = constants.%Greater] // CHECK:STDOUT: %int_1.loc9: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %impl.elem0.loc9_25: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc9_25: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc9_25: = bound_method %int_1.loc9, %impl.elem0.loc9_25 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc9_25: = specific_function %Convert.bound.loc9_25, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc9_25: init %i32 = call %Convert.specific_fn.loc9_25(%int_1.loc9) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc9_25.1: %i32 = value_of_initializer %int.convert_checked.loc9_25 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc9_25.2: %i32 = converted %int_1.loc9, %.loc9_25.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc9_28: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc9_28: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc9_28: = bound_method %int_2, %impl.elem0.loc9_28 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc9_28: = specific_function %Convert.bound.loc9_28, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc9_28: init %i32 = call %Convert.specific_fn.loc9_28(%int_2) [template = constants.%int_2.2] @@ -236,13 +222,13 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %Greater.ref.loc10: %Greater.type = name_ref Greater, file.%Greater.decl [template = constants.%Greater] // CHECK:STDOUT: %int_1.loc10_25: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_1.loc10_28: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc10_25: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc10_25: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc10_25: = bound_method %int_1.loc10_25, %impl.elem0.loc10_25 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc10_25: = specific_function %Convert.bound.loc10_25, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc10_25: init %i32 = call %Convert.specific_fn.loc10_25(%int_1.loc10_25) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc10_25.1: %i32 = value_of_initializer %int.convert_checked.loc10_25 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc10_25.2: %i32 = converted %int_1.loc10_25, %.loc10_25.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc10_28: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc10_28: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc10_28: = bound_method %int_1.loc10_28, %impl.elem0.loc10_28 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc10_28: = specific_function %Convert.bound.loc10_28, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc10_28: init %i32 = call %Convert.specific_fn.loc10_28(%int_1.loc10_28) [template = constants.%int_1.2] @@ -267,13 +253,13 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %Greater.ref.loc11: %Greater.type = name_ref Greater, file.%Greater.decl [template = constants.%Greater] // CHECK:STDOUT: %int_1.loc11: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_0.loc11: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0.loc11_24: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc11_24: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_24: = bound_method %int_1.loc11, %impl.elem0.loc11_24 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc11_24: = specific_function %Convert.bound.loc11_24, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc11_24: init %i32 = call %Convert.specific_fn.loc11_24(%int_1.loc11) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc11_24.1: %i32 = value_of_initializer %int.convert_checked.loc11_24 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc11_24.2: %i32 = converted %int_1.loc11, %.loc11_24.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc11_27: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc11_27: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_27: = bound_method %int_0.loc11, %impl.elem0.loc11_27 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc11_27: = specific_function %Convert.bound.loc11_27, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc11_27: init %i32 = call %Convert.specific_fn.loc11_27(%int_0.loc11) [template = constants.%int_0.2] @@ -296,9 +282,9 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %.loc11_13.3: type = block_arg !if.expr.result.loc11 [template = constants.%True] // CHECK:STDOUT: %false_.ref.loc12: %False = name_ref false_, %false_ // CHECK:STDOUT: %Greater.ref.loc12: %Greater.type = name_ref Greater, file.%Greater.decl [template = constants.%Greater] -// CHECK:STDOUT: %Negate.ref.loc12: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] +// CHECK:STDOUT: %Negate.ref.loc12: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %int_1.loc12: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc12_32: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc12_32: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc12_32: = bound_method %int_1.loc12, %impl.elem0.loc12_32 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc12_32: = specific_function %Convert.bound.loc12_32, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc12_32: init %i32 = call %Convert.specific_fn.loc12_32(%int_1.loc12) [template = constants.%int_1.2] @@ -308,7 +294,7 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %int_0.loc12: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %.loc12_33.1: %i32 = value_of_initializer %int.snegate.loc12 [template = constants.%int_-1] // CHECK:STDOUT: %.loc12_33.2: %i32 = converted %int.snegate.loc12, %.loc12_33.1 [template = constants.%int_-1] -// CHECK:STDOUT: %impl.elem0.loc12_36: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc12_36: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc12_36: = bound_method %int_0.loc12, %impl.elem0.loc12_36 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc12_36: = specific_function %Convert.bound.loc12_36, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc12_36: init %i32 = call %Convert.specific_fn.loc12_36(%int_0.loc12) [template = constants.%int_0.2] @@ -332,16 +318,16 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %true_.ref.loc13: %True = name_ref true_, %true_ // CHECK:STDOUT: %Greater.ref.loc13: %Greater.type = name_ref Greater, file.%Greater.decl [template = constants.%Greater] // CHECK:STDOUT: %int_0.loc13: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %Negate.ref.loc13: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] +// CHECK:STDOUT: %Negate.ref.loc13: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %int_1.loc13: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc13_34: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc13_34: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc13_34: = bound_method %int_1.loc13, %impl.elem0.loc13_34 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc13_34: = specific_function %Convert.bound.loc13_34, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc13_34: init %i32 = call %Convert.specific_fn.loc13_34(%int_1.loc13) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc13_34.1: %i32 = value_of_initializer %int.convert_checked.loc13_34 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc13_34.2: %i32 = converted %int_1.loc13, %.loc13_34.1 [template = constants.%int_1.2] // CHECK:STDOUT: %int.snegate.loc13: init %i32 = call %Negate.ref.loc13(%.loc13_34.2) [template = constants.%int_-1] -// CHECK:STDOUT: %impl.elem0.loc13_24: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc13_24: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc13_24: = bound_method %int_0.loc13, %impl.elem0.loc13_24 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc13_24: = specific_function %Convert.bound.loc13_24, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc13_24: init %i32 = call %Convert.specific_fn.loc13_24(%int_0.loc13) [template = constants.%int_0.2] diff --git a/toolchain/check/testdata/builtins/int/greater_eq.carbon b/toolchain/check/testdata/builtins/int/greater_eq.carbon index 834e7811de0a6..b1c2f176a697e 100644 --- a/toolchain/check/testdata/builtins/int/greater_eq.carbon +++ b/toolchain/check/testdata/builtins/int/greater_eq.carbon @@ -32,37 +32,35 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %Bool.type: type = fn_type @Bool [template] // CHECK:STDOUT: %Bool: %Bool.type = struct_value () [template] // CHECK:STDOUT: %GreaterEq.type: type = fn_type @GreaterEq [template] // CHECK:STDOUT: %GreaterEq: %GreaterEq.type = struct_value () [template] -// CHECK:STDOUT: %Negate.type: type = fn_type @Negate [template] -// CHECK:STDOUT: %Negate: %Negate.type = struct_value () [template] +// CHECK:STDOUT: %Negate.type.1: type = fn_type @Negate.1 [template] +// CHECK:STDOUT: %Negate: %Negate.type.1 = struct_value () [template] // CHECK:STDOUT: %True: type = class_type @True [template] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] -// CHECK:STDOUT: %complete_type.1: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %complete_type.3: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %False: type = class_type @False [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] // CHECK:STDOUT: %false: bool = bool_literal false [template] // CHECK:STDOUT: %true: bool = bool_literal true [template] // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] -// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_0.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] // CHECK:STDOUT: %int_-1: %i32 = int_value -1 [template] @@ -73,8 +71,8 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .Bool = %import_ref.2 -// CHECK:STDOUT: .ImplicitAs = %import_ref.3 +// CHECK:STDOUT: .Bool = %import_ref.5 +// CHECK:STDOUT: .ImplicitAs = %import_ref.6 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -100,13 +98,9 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc2_17: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc2_17: init type = call constants.%Int(%int_32.loc2_17) [template = constants.%i32] -// CHECK:STDOUT: %.loc2_17.1: type = value_of_initializer %int.make_type_signed.loc2_17 [template = constants.%i32] -// CHECK:STDOUT: %.loc2_17.2: type = converted %int.make_type_signed.loc2_17, %.loc2_17.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc2_17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc2_25: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc2_25: init type = call constants.%Int(%int_32.loc2_25) [template = constants.%i32] -// CHECK:STDOUT: %.loc2_25.1: type = value_of_initializer %int.make_type_signed.loc2_25 [template = constants.%i32] -// CHECK:STDOUT: %.loc2_25.2: type = converted %int.make_type_signed.loc2_25, %.loc2_25.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc2_25: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc2_33.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc2_33.2: type = converted %bool.make_type, %.loc2_33.1 [template = bool] @@ -117,20 +111,16 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %Negate.decl: %Negate.type = fn_decl @Negate [template = constants.%Negate] { +// CHECK:STDOUT: %Negate.decl: %Negate.type.1 = fn_decl @Negate.1 [template = constants.%Negate] { // CHECK:STDOUT: %a.patt: %i32 = binding_pattern a // CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc3_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc3_14: init type = call constants.%Int(%int_32.loc3_14) [template = constants.%i32] -// CHECK:STDOUT: %.loc3_14.1: type = value_of_initializer %int.make_type_signed.loc3_14 [template = constants.%i32] -// CHECK:STDOUT: %.loc3_14.2: type = converted %int.make_type_signed.loc3_14, %.loc3_14.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc3_14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc3_22: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc3_22: init type = call constants.%Int(%int_32.loc3_22) [template = constants.%i32] -// CHECK:STDOUT: %.loc3_22.1: type = value_of_initializer %int.make_type_signed.loc3_22 [template = constants.%i32] -// CHECK:STDOUT: %.loc3_22.2: type = converted %int.make_type_signed.loc3_22, %.loc3_22.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc3_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 @@ -160,13 +150,9 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc16_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc16_19: init type = call constants.%Int(%int_32.loc16_19) [template = constants.%i32] -// CHECK:STDOUT: %.loc16_19.1: type = value_of_initializer %int.make_type_signed.loc16_19 [template = constants.%i32] -// CHECK:STDOUT: %.loc16_19.2: type = converted %int.make_type_signed.loc16_19, %.loc16_19.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc16_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc16_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc16_27: init type = call constants.%Int(%int_32.loc16_27) [template = constants.%i32] -// CHECK:STDOUT: %.loc16_27.1: type = value_of_initializer %int.make_type_signed.loc16_27 [template = constants.%i32] -// CHECK:STDOUT: %.loc16_27.2: type = converted %int.make_type_signed.loc16_27, %.loc16_27.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc16_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc16_35.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc16_35.2: type = converted %bool.make_type, %.loc16_35.1 [template = bool] @@ -180,7 +166,7 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @True { -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%True @@ -188,7 +174,7 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @False { -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%False @@ -197,7 +183,7 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: // CHECK:STDOUT: fn @GreaterEq(%a.param_patt: %i32, %b.param_patt: %i32) -> bool = "int.greater_eq"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Negate(%a.param_patt: %i32) -> %i32 = "int.snegate"; +// CHECK:STDOUT: fn @Negate.1(%a.param_patt: %i32) -> %i32 = "int.snegate"; // CHECK:STDOUT: // CHECK:STDOUT: fn @F(%true_.param_patt: %True, %false_.param_patt: %False) { // CHECK:STDOUT: !entry: @@ -205,13 +191,13 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %GreaterEq.ref.loc9: %GreaterEq.type = name_ref GreaterEq, file.%GreaterEq.decl [template = constants.%GreaterEq] // CHECK:STDOUT: %int_1.loc9: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %impl.elem0.loc9_27: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc9_27: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc9_27: = bound_method %int_1.loc9, %impl.elem0.loc9_27 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc9_27: = specific_function %Convert.bound.loc9_27, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc9_27: init %i32 = call %Convert.specific_fn.loc9_27(%int_1.loc9) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc9_27.1: %i32 = value_of_initializer %int.convert_checked.loc9_27 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc9_27.2: %i32 = converted %int_1.loc9, %.loc9_27.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc9_30: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc9_30: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc9_30: = bound_method %int_2, %impl.elem0.loc9_30 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc9_30: = specific_function %Convert.bound.loc9_30, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc9_30: init %i32 = call %Convert.specific_fn.loc9_30(%int_2) [template = constants.%int_2.2] @@ -236,13 +222,13 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %GreaterEq.ref.loc10: %GreaterEq.type = name_ref GreaterEq, file.%GreaterEq.decl [template = constants.%GreaterEq] // CHECK:STDOUT: %int_1.loc10_26: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_1.loc10_29: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc10_26: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc10_26: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc10_26: = bound_method %int_1.loc10_26, %impl.elem0.loc10_26 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc10_26: = specific_function %Convert.bound.loc10_26, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc10_26: init %i32 = call %Convert.specific_fn.loc10_26(%int_1.loc10_26) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc10_26.1: %i32 = value_of_initializer %int.convert_checked.loc10_26 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc10_26.2: %i32 = converted %int_1.loc10_26, %.loc10_26.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc10_29: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc10_29: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc10_29: = bound_method %int_1.loc10_29, %impl.elem0.loc10_29 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc10_29: = specific_function %Convert.bound.loc10_29, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc10_29: init %i32 = call %Convert.specific_fn.loc10_29(%int_1.loc10_29) [template = constants.%int_1.2] @@ -267,13 +253,13 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %GreaterEq.ref.loc11: %GreaterEq.type = name_ref GreaterEq, file.%GreaterEq.decl [template = constants.%GreaterEq] // CHECK:STDOUT: %int_1.loc11: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_0.loc11: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0.loc11_26: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc11_26: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_26: = bound_method %int_1.loc11, %impl.elem0.loc11_26 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc11_26: = specific_function %Convert.bound.loc11_26, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc11_26: init %i32 = call %Convert.specific_fn.loc11_26(%int_1.loc11) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc11_26.1: %i32 = value_of_initializer %int.convert_checked.loc11_26 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc11_26.2: %i32 = converted %int_1.loc11, %.loc11_26.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc11_29: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc11_29: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_29: = bound_method %int_0.loc11, %impl.elem0.loc11_29 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc11_29: = specific_function %Convert.bound.loc11_29, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc11_29: init %i32 = call %Convert.specific_fn.loc11_29(%int_0.loc11) [template = constants.%int_0.2] @@ -296,9 +282,9 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %.loc11_13.3: type = block_arg !if.expr.result.loc11 [template = constants.%True] // CHECK:STDOUT: %false_.ref.loc12: %False = name_ref false_, %false_ // CHECK:STDOUT: %GreaterEq.ref.loc12: %GreaterEq.type = name_ref GreaterEq, file.%GreaterEq.decl [template = constants.%GreaterEq] -// CHECK:STDOUT: %Negate.ref.loc12: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] +// CHECK:STDOUT: %Negate.ref.loc12: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %int_1.loc12: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc12_34: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc12_34: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc12_34: = bound_method %int_1.loc12, %impl.elem0.loc12_34 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc12_34: = specific_function %Convert.bound.loc12_34, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc12_34: init %i32 = call %Convert.specific_fn.loc12_34(%int_1.loc12) [template = constants.%int_1.2] @@ -308,7 +294,7 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %int_0.loc12: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %.loc12_35.1: %i32 = value_of_initializer %int.snegate.loc12 [template = constants.%int_-1] // CHECK:STDOUT: %.loc12_35.2: %i32 = converted %int.snegate.loc12, %.loc12_35.1 [template = constants.%int_-1] -// CHECK:STDOUT: %impl.elem0.loc12_38: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc12_38: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc12_38: = bound_method %int_0.loc12, %impl.elem0.loc12_38 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc12_38: = specific_function %Convert.bound.loc12_38, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc12_38: init %i32 = call %Convert.specific_fn.loc12_38(%int_0.loc12) [template = constants.%int_0.2] @@ -332,16 +318,16 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %true_.ref.loc13: %True = name_ref true_, %true_ // CHECK:STDOUT: %GreaterEq.ref.loc13: %GreaterEq.type = name_ref GreaterEq, file.%GreaterEq.decl [template = constants.%GreaterEq] // CHECK:STDOUT: %int_0.loc13: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %Negate.ref.loc13: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] +// CHECK:STDOUT: %Negate.ref.loc13: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %int_1.loc13: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc13_36: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc13_36: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc13_36: = bound_method %int_1.loc13, %impl.elem0.loc13_36 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc13_36: = specific_function %Convert.bound.loc13_36, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc13_36: init %i32 = call %Convert.specific_fn.loc13_36(%int_1.loc13) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc13_36.1: %i32 = value_of_initializer %int.convert_checked.loc13_36 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc13_36.2: %i32 = converted %int_1.loc13, %.loc13_36.1 [template = constants.%int_1.2] // CHECK:STDOUT: %int.snegate.loc13: init %i32 = call %Negate.ref.loc13(%.loc13_36.2) [template = constants.%int_-1] -// CHECK:STDOUT: %impl.elem0.loc13_26: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc13_26: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc13_26: = bound_method %int_0.loc13, %impl.elem0.loc13_26 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc13_26: = specific_function %Convert.bound.loc13_26, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc13_26: init %i32 = call %Convert.specific_fn.loc13_26(%int_0.loc13) [template = constants.%int_0.2] diff --git a/toolchain/check/testdata/builtins/int/left_shift.carbon b/toolchain/check/testdata/builtins/int/left_shift.carbon index a9add0883ef10..a76d6a00e7bbd 100644 --- a/toolchain/check/testdata/builtins/int/left_shift.carbon +++ b/toolchain/check/testdata/builtins/int/left_shift.carbon @@ -67,30 +67,28 @@ let negative: i32 = LeftShift(1, Negate(1)); // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] -// CHECK:STDOUT: %LeftShift.type: type = fn_type @LeftShift [template] -// CHECK:STDOUT: %LeftShift: %LeftShift.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] +// CHECK:STDOUT: %LeftShift.type.1: type = fn_type @LeftShift.1 [template] +// CHECK:STDOUT: %LeftShift: %LeftShift.type.1 = struct_value () [template] // CHECK:STDOUT: %int_5.1: Core.IntLiteral = int_value 5 [template] // CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_5.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_5.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_5.2: %i32 = int_value 5 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] // CHECK:STDOUT: %int_20.1: %i32 = int_value 20 [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.4, @impl.3(%int_32) [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %interface.10: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_20.1, %Convert.15 [template] -// CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.4(%int_32) [template] +// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.3, @impl.2(%int_32) [template] +// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [template] +// CHECK:STDOUT: %interface.6: = interface_witness (%Convert.11) [template] +// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_20.1, %Convert.11 [template] +// CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.3(%int_32) [template] // CHECK:STDOUT: %int_20.2: Core.IntLiteral = int_value 20 [template] // CHECK:STDOUT: %array_type: type = array_type %int_20.2, %i32 [template] // CHECK:STDOUT: %ptr: type = ptr_type %array_type [template] @@ -101,7 +99,7 @@ let negative: i32 = LeftShift(1, Negate(1)); // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -116,7 +114,7 @@ let negative: i32 = LeftShift(1, Negate(1)); // CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %LeftShift.decl: %LeftShift.type = fn_decl @LeftShift [template = constants.%LeftShift] { +// CHECK:STDOUT: %LeftShift.decl: %LeftShift.type.1 = fn_decl @LeftShift.1 [template = constants.%LeftShift] { // CHECK:STDOUT: %a.patt: %i32 = binding_pattern a // CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: %i32 = binding_pattern b @@ -125,17 +123,11 @@ let negative: i32 = LeftShift(1, Negate(1)); // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc2_17: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc2_17: init type = call constants.%Int(%int_32.loc2_17) [template = constants.%i32] -// CHECK:STDOUT: %.loc2_17.1: type = value_of_initializer %int.make_type_signed.loc2_17 [template = constants.%i32] -// CHECK:STDOUT: %.loc2_17.2: type = converted %int.make_type_signed.loc2_17, %.loc2_17.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc2_17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc2_25: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc2_25: init type = call constants.%Int(%int_32.loc2_25) [template = constants.%i32] -// CHECK:STDOUT: %.loc2_25.1: type = value_of_initializer %int.make_type_signed.loc2_25 [template = constants.%i32] -// CHECK:STDOUT: %.loc2_25.2: type = converted %int.make_type_signed.loc2_25, %.loc2_25.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc2_25: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc2_33: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc2_33: init type = call constants.%Int(%int_32.loc2_33) [template = constants.%i32] -// CHECK:STDOUT: %.loc2_33.1: type = value_of_initializer %int.make_type_signed.loc2_33 [template = constants.%i32] -// CHECK:STDOUT: %.loc2_33.2: type = converted %int.make_type_signed.loc2_33, %.loc2_33.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc2_33: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 @@ -144,28 +136,26 @@ let negative: i32 = LeftShift(1, Negate(1)); // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %int_32.loc4: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc4: init type = call constants.%Int(%int_32.loc4) [template = constants.%i32] -// CHECK:STDOUT: %LeftShift.ref: %LeftShift.type = name_ref LeftShift, %LeftShift.decl [template = constants.%LeftShift] +// CHECK:STDOUT: %i32.loc4: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %LeftShift.ref: %LeftShift.type.1 = name_ref LeftShift, %LeftShift.decl [template = constants.%LeftShift] // CHECK:STDOUT: %int_5: Core.IntLiteral = int_value 5 [template = constants.%int_5.1] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %impl.elem0.loc4_26: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc4_26: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc4_26: = bound_method %int_5, %impl.elem0.loc4_26 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc4_26: = specific_function %Convert.bound.loc4_26, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc4_26: init %i32 = call %Convert.specific_fn.loc4_26(%int_5) [template = constants.%int_5.2] // CHECK:STDOUT: %.loc4_26.1: %i32 = value_of_initializer %int.convert_checked.loc4_26 [template = constants.%int_5.2] // CHECK:STDOUT: %.loc4_26.2: %i32 = converted %int_5, %.loc4_26.1 [template = constants.%int_5.2] -// CHECK:STDOUT: %impl.elem0.loc4_29: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc4_29: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc4_29: = bound_method %int_2, %impl.elem0.loc4_29 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc4_29: = specific_function %Convert.bound.loc4_29, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc4_29: init %i32 = call %Convert.specific_fn.loc4_29(%int_2) [template = constants.%int_2.2] // CHECK:STDOUT: %.loc4_29.1: %i32 = value_of_initializer %int.convert_checked.loc4_29 [template = constants.%int_2.2] // CHECK:STDOUT: %.loc4_29.2: %i32 = converted %int_2, %.loc4_29.1 [template = constants.%int_2.2] // CHECK:STDOUT: %int.left_shift: init %i32 = call %LeftShift.ref(%.loc4_26.2, %.loc4_29.2) [template = constants.%int_20.1] -// CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_signed.loc4 [template = constants.%i32] -// CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_signed.loc4, %.loc4_11.1 [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc4_30: %Convert.type.6 = interface_witness_access constants.%interface.10, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %impl.elem0.loc4_30: %Convert.type.5 = interface_witness_access constants.%interface.6, element0 [template = constants.%Convert.11] // CHECK:STDOUT: %Convert.bound.loc4_30: = bound_method %int.left_shift, %impl.elem0.loc4_30 [template = constants.%Convert.bound.3] -// CHECK:STDOUT: %Convert.specific_fn.loc4_30: = specific_function %Convert.bound.loc4_30, @Convert.4(constants.%int_32) [template = constants.%Convert.specific_fn.3] +// CHECK:STDOUT: %Convert.specific_fn.loc4_30: = specific_function %Convert.bound.loc4_30, @Convert.3(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %.loc4_30.1: %i32 = value_of_initializer %int.left_shift [template = constants.%int_20.1] // CHECK:STDOUT: %.loc4_30.2: %i32 = converted %int.left_shift, %.loc4_30.1 [template = constants.%int_20.1] // CHECK:STDOUT: %int.convert_checked.loc4_30: init Core.IntLiteral = call %Convert.specific_fn.loc4_30(%.loc4_30.2) [template = constants.%int_20.2] @@ -175,10 +165,8 @@ let negative: i32 = LeftShift(1, Negate(1)); // CHECK:STDOUT: %arr.var: ref %array_type = var arr // CHECK:STDOUT: %arr: ref %array_type = bind_name arr, %arr.var // CHECK:STDOUT: %int_32.loc5: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc5: init type = call constants.%Int(%int_32.loc5) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc5: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_20: Core.IntLiteral = int_value 20 [template = constants.%int_20.2] -// CHECK:STDOUT: %.loc5_13.1: type = value_of_initializer %int.make_type_signed.loc5 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_13.2: type = converted %int.make_type_signed.loc5, %.loc5_13.1 [template = constants.%i32] // CHECK:STDOUT: %array_type.loc5: type = array_type %int_20, %i32 [template = constants.%array_type] // CHECK:STDOUT: %ptr: type = ptr_type %array_type [template = constants.%ptr] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { @@ -190,17 +178,11 @@ let negative: i32 = LeftShift(1, Negate(1)); // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc7_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc7_19: init type = call constants.%Int(%int_32.loc7_19) [template = constants.%i32] -// CHECK:STDOUT: %.loc7_19.1: type = value_of_initializer %int.make_type_signed.loc7_19 [template = constants.%i32] -// CHECK:STDOUT: %.loc7_19.2: type = converted %int.make_type_signed.loc7_19, %.loc7_19.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc7_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc7_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc7_27: init type = call constants.%Int(%int_32.loc7_27) [template = constants.%i32] -// CHECK:STDOUT: %.loc7_27.1: type = value_of_initializer %int.make_type_signed.loc7_27 [template = constants.%i32] -// CHECK:STDOUT: %.loc7_27.2: type = converted %int.make_type_signed.loc7_27, %.loc7_27.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc7_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc7_35: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc7_35: init type = call constants.%Int(%int_32.loc7_35) [template = constants.%i32] -// CHECK:STDOUT: %.loc7_35.1: type = value_of_initializer %int.make_type_signed.loc7_35 [template = constants.%i32] -// CHECK:STDOUT: %.loc7_35.2: type = converted %int.make_type_signed.loc7_35, %.loc7_35.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc7_35: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 @@ -210,11 +192,11 @@ let negative: i32 = LeftShift(1, Negate(1)); // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @LeftShift(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.left_shift"; +// CHECK:STDOUT: fn @LeftShift.1(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.left_shift"; // CHECK:STDOUT: // CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %LeftShift.ref: %LeftShift.type = name_ref LeftShift, file.%LeftShift.decl [template = constants.%LeftShift] +// CHECK:STDOUT: %LeftShift.ref: %LeftShift.type.1 = name_ref LeftShift, file.%LeftShift.decl [template = constants.%LeftShift] // CHECK:STDOUT: %a.ref: %i32 = name_ref a, %a // CHECK:STDOUT: %b.ref: %i32 = name_ref b, %b // CHECK:STDOUT: %int.left_shift: init %i32 = call %LeftShift.ref(%a.ref, %b.ref) @@ -235,40 +217,38 @@ let negative: i32 = LeftShift(1, Negate(1)); // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32.1: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32.1 [template] -// CHECK:STDOUT: %LeftShift.type: type = fn_type @LeftShift [template] -// CHECK:STDOUT: %LeftShift: %LeftShift.type = struct_value () [template] -// CHECK:STDOUT: %Negate.type: type = fn_type @Negate [template] -// CHECK:STDOUT: %Negate: %Negate.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32.1) [template] +// CHECK:STDOUT: %LeftShift.type.1: type = fn_type @LeftShift.1 [template] +// CHECK:STDOUT: %LeftShift: %LeftShift.type.1 = struct_value () [template] +// CHECK:STDOUT: %Negate.type.1: type = fn_type @Negate.1 [template] +// CHECK:STDOUT: %Negate: %Negate.type.1 = struct_value () [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %int_31.1: Core.IntLiteral = int_value 31 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32.1) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32.1) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32.1) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_31.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_31.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32.1) [template] // CHECK:STDOUT: %int_31.2: %i32 = int_value 31 [template] // CHECK:STDOUT: %int_-2147483648: %i32 = int_value -2147483648 [template] -// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_32.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_32.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.2(%int_32.1) [template] // CHECK:STDOUT: %int_32.2: %i32 = int_value 32 [template] // CHECK:STDOUT: %int_33.1: Core.IntLiteral = int_value 33 [template] -// CHECK:STDOUT: %Convert.bound.4: = bound_method %int_33.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.4: = bound_method %int_33.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.4: = specific_function %Convert.bound.4, @Convert.2(%int_32.1) [template] // CHECK:STDOUT: %int_33.2: %i32 = int_value 33 [template] // CHECK:STDOUT: %int_1000.1: Core.IntLiteral = int_value 1000 [template] -// CHECK:STDOUT: %Convert.bound.5: = bound_method %int_1000.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.5: = bound_method %int_1000.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.5: = specific_function %Convert.bound.5, @Convert.2(%int_32.1) [template] // CHECK:STDOUT: %int_1000.2: %i32 = int_value 1000 [template] // CHECK:STDOUT: %int_0.1: %i32 = int_value 0 [template] // CHECK:STDOUT: %int_0.2: Core.IntLiteral = int_value 0 [template] -// CHECK:STDOUT: %Convert.bound.6: = bound_method %int_0.2, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.6: = bound_method %int_0.2, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.6: = specific_function %Convert.bound.6, @Convert.2(%int_32.1) [template] // CHECK:STDOUT: %int_-1: %i32 = int_value -1 [template] // CHECK:STDOUT: } @@ -276,7 +256,7 @@ let negative: i32 = LeftShift(1, Negate(1)); // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -297,7 +277,7 @@ let negative: i32 = LeftShift(1, Negate(1)); // CHECK:STDOUT: .negative = @__global_init.%negative // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %LeftShift.decl: %LeftShift.type = fn_decl @LeftShift [template = constants.%LeftShift] { +// CHECK:STDOUT: %LeftShift.decl: %LeftShift.type.1 = fn_decl @LeftShift.1 [template = constants.%LeftShift] { // CHECK:STDOUT: %a.patt: %i32 = binding_pattern a // CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: %i32 = binding_pattern b @@ -306,17 +286,11 @@ let negative: i32 = LeftShift(1, Negate(1)); // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc4_17: Core.IntLiteral = int_value 32 [template = constants.%int_32.1] -// CHECK:STDOUT: %int.make_type_signed.loc4_17: init type = call constants.%Int(%int_32.loc4_17) [template = constants.%i32] -// CHECK:STDOUT: %.loc4_17.1: type = value_of_initializer %int.make_type_signed.loc4_17 [template = constants.%i32] -// CHECK:STDOUT: %.loc4_17.2: type = converted %int.make_type_signed.loc4_17, %.loc4_17.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc4_17: type = class_type @Int, @Int(constants.%int_32.1) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc4_25: Core.IntLiteral = int_value 32 [template = constants.%int_32.1] -// CHECK:STDOUT: %int.make_type_signed.loc4_25: init type = call constants.%Int(%int_32.loc4_25) [template = constants.%i32] -// CHECK:STDOUT: %.loc4_25.1: type = value_of_initializer %int.make_type_signed.loc4_25 [template = constants.%i32] -// CHECK:STDOUT: %.loc4_25.2: type = converted %int.make_type_signed.loc4_25, %.loc4_25.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc4_25: type = class_type @Int, @Int(constants.%int_32.1) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc4_33: Core.IntLiteral = int_value 32 [template = constants.%int_32.1] -// CHECK:STDOUT: %int.make_type_signed.loc4_33: init type = call constants.%Int(%int_32.loc4_33) [template = constants.%i32] -// CHECK:STDOUT: %.loc4_33.1: type = value_of_initializer %int.make_type_signed.loc4_33 [template = constants.%i32] -// CHECK:STDOUT: %.loc4_33.2: type = converted %int.make_type_signed.loc4_33, %.loc4_33.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc4_33: type = class_type @Int, @Int(constants.%int_32.1) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 @@ -324,75 +298,55 @@ let negative: i32 = LeftShift(1, Negate(1)); // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %Negate.decl: %Negate.type = fn_decl @Negate [template = constants.%Negate] { +// CHECK:STDOUT: %Negate.decl: %Negate.type.1 = fn_decl @Negate.1 [template = constants.%Negate] { // CHECK:STDOUT: %a.patt: %i32 = binding_pattern a // CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc5_14: Core.IntLiteral = int_value 32 [template = constants.%int_32.1] -// CHECK:STDOUT: %int.make_type_signed.loc5_14: init type = call constants.%Int(%int_32.loc5_14) [template = constants.%i32] -// CHECK:STDOUT: %.loc5_14.1: type = value_of_initializer %int.make_type_signed.loc5_14 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_14.2: type = converted %int.make_type_signed.loc5_14, %.loc5_14.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc5_14: type = class_type @Int, @Int(constants.%int_32.1) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc5_22: Core.IntLiteral = int_value 32 [template = constants.%int_32.1] -// CHECK:STDOUT: %int.make_type_signed.loc5_22: init type = call constants.%Int(%int_32.loc5_22) [template = constants.%i32] -// CHECK:STDOUT: %.loc5_22.1: type = value_of_initializer %int.make_type_signed.loc5_22 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_22.2: type = converted %int.make_type_signed.loc5_22, %.loc5_22.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc5_22: type = class_type @Int, @Int(constants.%int_32.1) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %int_32.loc8: Core.IntLiteral = int_value 32 [template = constants.%int_32.1] -// CHECK:STDOUT: %int.make_type_signed.loc8: init type = call constants.%Int(%int_32.loc8) [template = constants.%i32] -// CHECK:STDOUT: %.loc8_13.1: type = value_of_initializer %int.make_type_signed.loc8 [template = constants.%i32] -// CHECK:STDOUT: %.loc8_13.2: type = converted %int.make_type_signed.loc8, %.loc8_13.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc8: type = class_type @Int, @Int(constants.%int_32.1) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc13: Core.IntLiteral = int_value 32 [template = constants.%int_32.1] -// CHECK:STDOUT: %int.make_type_signed.loc13: init type = call constants.%Int(%int_32.loc13) [template = constants.%i32] -// CHECK:STDOUT: %.loc13_13.1: type = value_of_initializer %int.make_type_signed.loc13 [template = constants.%i32] -// CHECK:STDOUT: %.loc13_13.2: type = converted %int.make_type_signed.loc13, %.loc13_13.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc13: type = class_type @Int, @Int(constants.%int_32.1) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc18: Core.IntLiteral = int_value 32 [template = constants.%int_32.1] -// CHECK:STDOUT: %int.make_type_signed.loc18: init type = call constants.%Int(%int_32.loc18) [template = constants.%i32] -// CHECK:STDOUT: %.loc18_13.1: type = value_of_initializer %int.make_type_signed.loc18 [template = constants.%i32] -// CHECK:STDOUT: %.loc18_13.2: type = converted %int.make_type_signed.loc18, %.loc18_13.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc18: type = class_type @Int, @Int(constants.%int_32.1) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc21: Core.IntLiteral = int_value 32 [template = constants.%int_32.1] -// CHECK:STDOUT: %int.make_type_signed.loc21: init type = call constants.%Int(%int_32.loc21) [template = constants.%i32] -// CHECK:STDOUT: %.loc21_17.1: type = value_of_initializer %int.make_type_signed.loc21 [template = constants.%i32] -// CHECK:STDOUT: %.loc21_17.2: type = converted %int.make_type_signed.loc21, %.loc21_17.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc21: type = class_type @Int, @Int(constants.%int_32.1) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc26: Core.IntLiteral = int_value 32 [template = constants.%int_32.1] -// CHECK:STDOUT: %int.make_type_signed.loc26: init type = call constants.%Int(%int_32.loc26) [template = constants.%i32] -// CHECK:STDOUT: %.loc26_17.1: type = value_of_initializer %int.make_type_signed.loc26 [template = constants.%i32] -// CHECK:STDOUT: %.loc26_17.2: type = converted %int.make_type_signed.loc26, %.loc26_17.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc26: type = class_type @Int, @Int(constants.%int_32.1) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc29: Core.IntLiteral = int_value 32 [template = constants.%int_32.1] -// CHECK:STDOUT: %int.make_type_signed.loc29: init type = call constants.%Int(%int_32.loc29) [template = constants.%i32] -// CHECK:STDOUT: %.loc29_20.1: type = value_of_initializer %int.make_type_signed.loc29 [template = constants.%i32] -// CHECK:STDOUT: %.loc29_20.2: type = converted %int.make_type_signed.loc29, %.loc29_20.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc29: type = class_type @Int, @Int(constants.%int_32.1) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc34: Core.IntLiteral = int_value 32 [template = constants.%int_32.1] -// CHECK:STDOUT: %int.make_type_signed.loc34: init type = call constants.%Int(%int_32.loc34) [template = constants.%i32] -// CHECK:STDOUT: %.loc34_20.1: type = value_of_initializer %int.make_type_signed.loc34 [template = constants.%i32] -// CHECK:STDOUT: %.loc34_20.2: type = converted %int.make_type_signed.loc34, %.loc34_20.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc34: type = class_type @Int, @Int(constants.%int_32.1) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc40: Core.IntLiteral = int_value 32 [template = constants.%int_32.1] -// CHECK:STDOUT: %int.make_type_signed.loc40: init type = call constants.%Int(%int_32.loc40) [template = constants.%i32] -// CHECK:STDOUT: %.loc40_15.1: type = value_of_initializer %int.make_type_signed.loc40 [template = constants.%i32] -// CHECK:STDOUT: %.loc40_15.2: type = converted %int.make_type_signed.loc40, %.loc40_15.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc40: type = class_type @Int, @Int(constants.%int_32.1) [template = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @LeftShift(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.left_shift"; +// CHECK:STDOUT: fn @LeftShift.1(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.left_shift"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Negate(%a.param_patt: %i32) -> %i32 = "int.snegate"; +// CHECK:STDOUT: fn @Negate.1(%a.param_patt: %i32) -> %i32 = "int.snegate"; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %LeftShift.ref.loc8: %LeftShift.type = name_ref LeftShift, file.%LeftShift.decl [template = constants.%LeftShift] +// CHECK:STDOUT: %LeftShift.ref.loc8: %LeftShift.type.1 = name_ref LeftShift, file.%LeftShift.decl [template = constants.%LeftShift] // CHECK:STDOUT: %int_1.loc8: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_31.loc8: Core.IntLiteral = int_value 31 [template = constants.%int_31.1] -// CHECK:STDOUT: %impl.elem0.loc8_29: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc8_29: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc8_29: = bound_method %int_1.loc8, %impl.elem0.loc8_29 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc8_29: = specific_function %Convert.bound.loc8_29, @Convert.2(constants.%int_32.1) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc8_29: init %i32 = call %Convert.specific_fn.loc8_29(%int_1.loc8) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc8_29.1: %i32 = value_of_initializer %int.convert_checked.loc8_29 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc8_29.2: %i32 = converted %int_1.loc8, %.loc8_29.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc8_32: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc8_32: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc8_32: = bound_method %int_31.loc8, %impl.elem0.loc8_32 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc8_32: = specific_function %Convert.bound.loc8_32, @Convert.2(constants.%int_32.1) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc8_32: init %i32 = call %Convert.specific_fn.loc8_32(%int_31.loc8) [template = constants.%int_31.2] @@ -402,16 +356,16 @@ let negative: i32 = LeftShift(1, Negate(1)); // CHECK:STDOUT: %.loc8_35.1: %i32 = value_of_initializer %int.left_shift.loc8 [template = constants.%int_-2147483648] // CHECK:STDOUT: %.loc8_35.2: %i32 = converted %int.left_shift.loc8, %.loc8_35.1 [template = constants.%int_-2147483648] // CHECK:STDOUT: %size_1: %i32 = bind_name size_1, %.loc8_35.2 -// CHECK:STDOUT: %LeftShift.ref.loc13: %LeftShift.type = name_ref LeftShift, file.%LeftShift.decl [template = constants.%LeftShift] +// CHECK:STDOUT: %LeftShift.ref.loc13: %LeftShift.type.1 = name_ref LeftShift, file.%LeftShift.decl [template = constants.%LeftShift] // CHECK:STDOUT: %int_1.loc13: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_32.loc13: Core.IntLiteral = int_value 32 [template = constants.%int_32.1] -// CHECK:STDOUT: %impl.elem0.loc13_29: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc13_29: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc13_29: = bound_method %int_1.loc13, %impl.elem0.loc13_29 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc13_29: = specific_function %Convert.bound.loc13_29, @Convert.2(constants.%int_32.1) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc13_29: init %i32 = call %Convert.specific_fn.loc13_29(%int_1.loc13) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc13_29.1: %i32 = value_of_initializer %int.convert_checked.loc13_29 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc13_29.2: %i32 = converted %int_1.loc13, %.loc13_29.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc13_32: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc13_32: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc13_32: = bound_method %int_32.loc13, %impl.elem0.loc13_32 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc13_32: = specific_function %Convert.bound.loc13_32, @Convert.2(constants.%int_32.1) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc13_32: init %i32 = call %Convert.specific_fn.loc13_32(%int_32.loc13) [template = constants.%int_32.2] @@ -421,16 +375,16 @@ let negative: i32 = LeftShift(1, Negate(1)); // CHECK:STDOUT: %.loc13_35.1: %i32 = value_of_initializer %int.left_shift.loc13 [template = ] // CHECK:STDOUT: %.loc13_35.2: %i32 = converted %int.left_shift.loc13, %.loc13_35.1 [template = ] // CHECK:STDOUT: %size_2: %i32 = bind_name size_2, %.loc13_35.2 -// CHECK:STDOUT: %LeftShift.ref.loc18: %LeftShift.type = name_ref LeftShift, file.%LeftShift.decl [template = constants.%LeftShift] +// CHECK:STDOUT: %LeftShift.ref.loc18: %LeftShift.type.1 = name_ref LeftShift, file.%LeftShift.decl [template = constants.%LeftShift] // CHECK:STDOUT: %int_1.loc18: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_33: Core.IntLiteral = int_value 33 [template = constants.%int_33.1] -// CHECK:STDOUT: %impl.elem0.loc18_29: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc18_29: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc18_29: = bound_method %int_1.loc18, %impl.elem0.loc18_29 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc18_29: = specific_function %Convert.bound.loc18_29, @Convert.2(constants.%int_32.1) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc18_29: init %i32 = call %Convert.specific_fn.loc18_29(%int_1.loc18) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc18_29.1: %i32 = value_of_initializer %int.convert_checked.loc18_29 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc18_29.2: %i32 = converted %int_1.loc18, %.loc18_29.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc18_32: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc18_32: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc18_32: = bound_method %int_33, %impl.elem0.loc18_32 [template = constants.%Convert.bound.4] // CHECK:STDOUT: %Convert.specific_fn.loc18_32: = specific_function %Convert.bound.loc18_32, @Convert.2(constants.%int_32.1) [template = constants.%Convert.specific_fn.4] // CHECK:STDOUT: %int.convert_checked.loc18_32: init %i32 = call %Convert.specific_fn.loc18_32(%int_33) [template = constants.%int_33.2] @@ -440,16 +394,16 @@ let negative: i32 = LeftShift(1, Negate(1)); // CHECK:STDOUT: %.loc18_35.1: %i32 = value_of_initializer %int.left_shift.loc18 [template = ] // CHECK:STDOUT: %.loc18_35.2: %i32 = converted %int.left_shift.loc18, %.loc18_35.1 [template = ] // CHECK:STDOUT: %size_3: %i32 = bind_name size_3, %.loc18_35.2 -// CHECK:STDOUT: %LeftShift.ref.loc21: %LeftShift.type = name_ref LeftShift, file.%LeftShift.decl [template = constants.%LeftShift] +// CHECK:STDOUT: %LeftShift.ref.loc21: %LeftShift.type.1 = name_ref LeftShift, file.%LeftShift.decl [template = constants.%LeftShift] // CHECK:STDOUT: %int_1000.loc21: Core.IntLiteral = int_value 1000 [template = constants.%int_1000.1] // CHECK:STDOUT: %int_31.loc21: Core.IntLiteral = int_value 31 [template = constants.%int_31.1] -// CHECK:STDOUT: %impl.elem0.loc21_33: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc21_33: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc21_33: = bound_method %int_1000.loc21, %impl.elem0.loc21_33 [template = constants.%Convert.bound.5] // CHECK:STDOUT: %Convert.specific_fn.loc21_33: = specific_function %Convert.bound.loc21_33, @Convert.2(constants.%int_32.1) [template = constants.%Convert.specific_fn.5] // CHECK:STDOUT: %int.convert_checked.loc21_33: init %i32 = call %Convert.specific_fn.loc21_33(%int_1000.loc21) [template = constants.%int_1000.2] // CHECK:STDOUT: %.loc21_33.1: %i32 = value_of_initializer %int.convert_checked.loc21_33 [template = constants.%int_1000.2] // CHECK:STDOUT: %.loc21_33.2: %i32 = converted %int_1000.loc21, %.loc21_33.1 [template = constants.%int_1000.2] -// CHECK:STDOUT: %impl.elem0.loc21_39: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc21_39: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc21_39: = bound_method %int_31.loc21, %impl.elem0.loc21_39 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc21_39: = specific_function %Convert.bound.loc21_39, @Convert.2(constants.%int_32.1) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc21_39: init %i32 = call %Convert.specific_fn.loc21_39(%int_31.loc21) [template = constants.%int_31.2] @@ -459,16 +413,16 @@ let negative: i32 = LeftShift(1, Negate(1)); // CHECK:STDOUT: %.loc21_42.1: %i32 = value_of_initializer %int.left_shift.loc21 [template = constants.%int_0.1] // CHECK:STDOUT: %.loc21_42.2: %i32 = converted %int.left_shift.loc21, %.loc21_42.1 [template = constants.%int_0.1] // CHECK:STDOUT: %overflow_1: %i32 = bind_name overflow_1, %.loc21_42.2 -// CHECK:STDOUT: %LeftShift.ref.loc26: %LeftShift.type = name_ref LeftShift, file.%LeftShift.decl [template = constants.%LeftShift] +// CHECK:STDOUT: %LeftShift.ref.loc26: %LeftShift.type.1 = name_ref LeftShift, file.%LeftShift.decl [template = constants.%LeftShift] // CHECK:STDOUT: %int_1000.loc26: Core.IntLiteral = int_value 1000 [template = constants.%int_1000.1] // CHECK:STDOUT: %int_32.loc26: Core.IntLiteral = int_value 32 [template = constants.%int_32.1] -// CHECK:STDOUT: %impl.elem0.loc26_33: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc26_33: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc26_33: = bound_method %int_1000.loc26, %impl.elem0.loc26_33 [template = constants.%Convert.bound.5] // CHECK:STDOUT: %Convert.specific_fn.loc26_33: = specific_function %Convert.bound.loc26_33, @Convert.2(constants.%int_32.1) [template = constants.%Convert.specific_fn.5] // CHECK:STDOUT: %int.convert_checked.loc26_33: init %i32 = call %Convert.specific_fn.loc26_33(%int_1000.loc26) [template = constants.%int_1000.2] // CHECK:STDOUT: %.loc26_33.1: %i32 = value_of_initializer %int.convert_checked.loc26_33 [template = constants.%int_1000.2] // CHECK:STDOUT: %.loc26_33.2: %i32 = converted %int_1000.loc26, %.loc26_33.1 [template = constants.%int_1000.2] -// CHECK:STDOUT: %impl.elem0.loc26_39: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc26_39: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc26_39: = bound_method %int_32.loc26, %impl.elem0.loc26_39 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc26_39: = specific_function %Convert.bound.loc26_39, @Convert.2(constants.%int_32.1) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc26_39: init %i32 = call %Convert.specific_fn.loc26_39(%int_32.loc26) [template = constants.%int_32.2] @@ -478,16 +432,16 @@ let negative: i32 = LeftShift(1, Negate(1)); // CHECK:STDOUT: %.loc26_42.1: %i32 = value_of_initializer %int.left_shift.loc26 [template = ] // CHECK:STDOUT: %.loc26_42.2: %i32 = converted %int.left_shift.loc26, %.loc26_42.1 [template = ] // CHECK:STDOUT: %overflow_2: %i32 = bind_name overflow_2, %.loc26_42.2 -// CHECK:STDOUT: %LeftShift.ref.loc29: %LeftShift.type = name_ref LeftShift, file.%LeftShift.decl [template = constants.%LeftShift] +// CHECK:STDOUT: %LeftShift.ref.loc29: %LeftShift.type.1 = name_ref LeftShift, file.%LeftShift.decl [template = constants.%LeftShift] // CHECK:STDOUT: %int_0.loc29: Core.IntLiteral = int_value 0 [template = constants.%int_0.2] // CHECK:STDOUT: %int_31.loc29: Core.IntLiteral = int_value 31 [template = constants.%int_31.1] -// CHECK:STDOUT: %impl.elem0.loc29_36: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc29_36: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc29_36: = bound_method %int_0.loc29, %impl.elem0.loc29_36 [template = constants.%Convert.bound.6] // CHECK:STDOUT: %Convert.specific_fn.loc29_36: = specific_function %Convert.bound.loc29_36, @Convert.2(constants.%int_32.1) [template = constants.%Convert.specific_fn.6] // CHECK:STDOUT: %int.convert_checked.loc29_36: init %i32 = call %Convert.specific_fn.loc29_36(%int_0.loc29) [template = constants.%int_0.1] // CHECK:STDOUT: %.loc29_36.1: %i32 = value_of_initializer %int.convert_checked.loc29_36 [template = constants.%int_0.1] // CHECK:STDOUT: %.loc29_36.2: %i32 = converted %int_0.loc29, %.loc29_36.1 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0.loc29_39: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc29_39: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc29_39: = bound_method %int_31.loc29, %impl.elem0.loc29_39 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc29_39: = specific_function %Convert.bound.loc29_39, @Convert.2(constants.%int_32.1) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc29_39: init %i32 = call %Convert.specific_fn.loc29_39(%int_31.loc29) [template = constants.%int_31.2] @@ -497,16 +451,16 @@ let negative: i32 = LeftShift(1, Negate(1)); // CHECK:STDOUT: %.loc29_42.1: %i32 = value_of_initializer %int.left_shift.loc29 [template = constants.%int_0.1] // CHECK:STDOUT: %.loc29_42.2: %i32 = converted %int.left_shift.loc29, %.loc29_42.1 [template = constants.%int_0.1] // CHECK:STDOUT: %no_overflow_1: %i32 = bind_name no_overflow_1, %.loc29_42.2 -// CHECK:STDOUT: %LeftShift.ref.loc34: %LeftShift.type = name_ref LeftShift, file.%LeftShift.decl [template = constants.%LeftShift] +// CHECK:STDOUT: %LeftShift.ref.loc34: %LeftShift.type.1 = name_ref LeftShift, file.%LeftShift.decl [template = constants.%LeftShift] // CHECK:STDOUT: %int_0.loc34: Core.IntLiteral = int_value 0 [template = constants.%int_0.2] // CHECK:STDOUT: %int_32.loc34: Core.IntLiteral = int_value 32 [template = constants.%int_32.1] -// CHECK:STDOUT: %impl.elem0.loc34_36: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc34_36: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc34_36: = bound_method %int_0.loc34, %impl.elem0.loc34_36 [template = constants.%Convert.bound.6] // CHECK:STDOUT: %Convert.specific_fn.loc34_36: = specific_function %Convert.bound.loc34_36, @Convert.2(constants.%int_32.1) [template = constants.%Convert.specific_fn.6] // CHECK:STDOUT: %int.convert_checked.loc34_36: init %i32 = call %Convert.specific_fn.loc34_36(%int_0.loc34) [template = constants.%int_0.1] // CHECK:STDOUT: %.loc34_36.1: %i32 = value_of_initializer %int.convert_checked.loc34_36 [template = constants.%int_0.1] // CHECK:STDOUT: %.loc34_36.2: %i32 = converted %int_0.loc34, %.loc34_36.1 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0.loc34_39: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc34_39: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc34_39: = bound_method %int_32.loc34, %impl.elem0.loc34_39 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc34_39: = specific_function %Convert.bound.loc34_39, @Convert.2(constants.%int_32.1) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc34_39: init %i32 = call %Convert.specific_fn.loc34_39(%int_32.loc34) [template = constants.%int_32.2] @@ -516,18 +470,18 @@ let negative: i32 = LeftShift(1, Negate(1)); // CHECK:STDOUT: %.loc34_42.1: %i32 = value_of_initializer %int.left_shift.loc34 [template = ] // CHECK:STDOUT: %.loc34_42.2: %i32 = converted %int.left_shift.loc34, %.loc34_42.1 [template = ] // CHECK:STDOUT: %no_overflow_2: %i32 = bind_name no_overflow_2, %.loc34_42.2 -// CHECK:STDOUT: %LeftShift.ref.loc40: %LeftShift.type = name_ref LeftShift, file.%LeftShift.decl [template = constants.%LeftShift] +// CHECK:STDOUT: %LeftShift.ref.loc40: %LeftShift.type.1 = name_ref LeftShift, file.%LeftShift.decl [template = constants.%LeftShift] // CHECK:STDOUT: %int_1.loc40_31: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %Negate.ref: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] +// CHECK:STDOUT: %Negate.ref: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %int_1.loc40_41: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc40_41: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc40_41: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc40_41: = bound_method %int_1.loc40_41, %impl.elem0.loc40_41 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc40_41: = specific_function %Convert.bound.loc40_41, @Convert.2(constants.%int_32.1) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc40_41: init %i32 = call %Convert.specific_fn.loc40_41(%int_1.loc40_41) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc40_41.1: %i32 = value_of_initializer %int.convert_checked.loc40_41 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc40_41.2: %i32 = converted %int_1.loc40_41, %.loc40_41.1 [template = constants.%int_1.2] // CHECK:STDOUT: %int.snegate: init %i32 = call %Negate.ref(%.loc40_41.2) [template = constants.%int_-1] -// CHECK:STDOUT: %impl.elem0.loc40_31: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc40_31: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc40_31: = bound_method %int_1.loc40_31, %impl.elem0.loc40_31 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc40_31: = specific_function %Convert.bound.loc40_31, @Convert.2(constants.%int_32.1) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc40_31: init %i32 = call %Convert.specific_fn.loc40_31(%int_1.loc40_31) [template = constants.%int_1.2] diff --git a/toolchain/check/testdata/builtins/int/less.carbon b/toolchain/check/testdata/builtins/int/less.carbon index d5abc7671e309..6948816cc661c 100644 --- a/toolchain/check/testdata/builtins/int/less.carbon +++ b/toolchain/check/testdata/builtins/int/less.carbon @@ -32,37 +32,35 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %Bool.type: type = fn_type @Bool [template] // CHECK:STDOUT: %Bool: %Bool.type = struct_value () [template] // CHECK:STDOUT: %Less.type: type = fn_type @Less [template] // CHECK:STDOUT: %Less: %Less.type = struct_value () [template] -// CHECK:STDOUT: %Negate.type: type = fn_type @Negate [template] -// CHECK:STDOUT: %Negate: %Negate.type = struct_value () [template] +// CHECK:STDOUT: %Negate.type.1: type = fn_type @Negate.1 [template] +// CHECK:STDOUT: %Negate: %Negate.type.1 = struct_value () [template] // CHECK:STDOUT: %True: type = class_type @True [template] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] -// CHECK:STDOUT: %complete_type.1: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %complete_type.3: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %False: type = class_type @False [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] // CHECK:STDOUT: %true: bool = bool_literal true [template] // CHECK:STDOUT: %false: bool = bool_literal false [template] // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] -// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_0.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] // CHECK:STDOUT: %int_-1: %i32 = int_value -1 [template] @@ -73,8 +71,8 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .Bool = %import_ref.2 -// CHECK:STDOUT: .ImplicitAs = %import_ref.3 +// CHECK:STDOUT: .Bool = %import_ref.5 +// CHECK:STDOUT: .ImplicitAs = %import_ref.6 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -100,13 +98,9 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc2_12: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc2_12: init type = call constants.%Int(%int_32.loc2_12) [template = constants.%i32] -// CHECK:STDOUT: %.loc2_12.1: type = value_of_initializer %int.make_type_signed.loc2_12 [template = constants.%i32] -// CHECK:STDOUT: %.loc2_12.2: type = converted %int.make_type_signed.loc2_12, %.loc2_12.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc2_12: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc2_20: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc2_20: init type = call constants.%Int(%int_32.loc2_20) [template = constants.%i32] -// CHECK:STDOUT: %.loc2_20.1: type = value_of_initializer %int.make_type_signed.loc2_20 [template = constants.%i32] -// CHECK:STDOUT: %.loc2_20.2: type = converted %int.make_type_signed.loc2_20, %.loc2_20.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc2_20: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc2_28.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc2_28.2: type = converted %bool.make_type, %.loc2_28.1 [template = bool] @@ -117,20 +111,16 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %Negate.decl: %Negate.type = fn_decl @Negate [template = constants.%Negate] { +// CHECK:STDOUT: %Negate.decl: %Negate.type.1 = fn_decl @Negate.1 [template = constants.%Negate] { // CHECK:STDOUT: %a.patt: %i32 = binding_pattern a // CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc3_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc3_14: init type = call constants.%Int(%int_32.loc3_14) [template = constants.%i32] -// CHECK:STDOUT: %.loc3_14.1: type = value_of_initializer %int.make_type_signed.loc3_14 [template = constants.%i32] -// CHECK:STDOUT: %.loc3_14.2: type = converted %int.make_type_signed.loc3_14, %.loc3_14.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc3_14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc3_22: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc3_22: init type = call constants.%Int(%int_32.loc3_22) [template = constants.%i32] -// CHECK:STDOUT: %.loc3_22.1: type = value_of_initializer %int.make_type_signed.loc3_22 [template = constants.%i32] -// CHECK:STDOUT: %.loc3_22.2: type = converted %int.make_type_signed.loc3_22, %.loc3_22.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc3_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 @@ -160,13 +150,9 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc16_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc16_19: init type = call constants.%Int(%int_32.loc16_19) [template = constants.%i32] -// CHECK:STDOUT: %.loc16_19.1: type = value_of_initializer %int.make_type_signed.loc16_19 [template = constants.%i32] -// CHECK:STDOUT: %.loc16_19.2: type = converted %int.make_type_signed.loc16_19, %.loc16_19.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc16_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc16_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc16_27: init type = call constants.%Int(%int_32.loc16_27) [template = constants.%i32] -// CHECK:STDOUT: %.loc16_27.1: type = value_of_initializer %int.make_type_signed.loc16_27 [template = constants.%i32] -// CHECK:STDOUT: %.loc16_27.2: type = converted %int.make_type_signed.loc16_27, %.loc16_27.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc16_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc16_35.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc16_35.2: type = converted %bool.make_type, %.loc16_35.1 [template = bool] @@ -180,7 +166,7 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @True { -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%True @@ -188,7 +174,7 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @False { -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%False @@ -197,7 +183,7 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: // CHECK:STDOUT: fn @Less(%a.param_patt: %i32, %b.param_patt: %i32) -> bool = "int.less"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Negate(%a.param_patt: %i32) -> %i32 = "int.snegate"; +// CHECK:STDOUT: fn @Negate.1(%a.param_patt: %i32) -> %i32 = "int.snegate"; // CHECK:STDOUT: // CHECK:STDOUT: fn @F(%true_.param_patt: %True, %false_.param_patt: %False) { // CHECK:STDOUT: !entry: @@ -205,13 +191,13 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %Less.ref.loc9: %Less.type = name_ref Less, file.%Less.decl [template = constants.%Less] // CHECK:STDOUT: %int_1.loc9: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %impl.elem0.loc9_21: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc9_21: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc9_21: = bound_method %int_1.loc9, %impl.elem0.loc9_21 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc9_21: = specific_function %Convert.bound.loc9_21, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc9_21: init %i32 = call %Convert.specific_fn.loc9_21(%int_1.loc9) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc9_21.1: %i32 = value_of_initializer %int.convert_checked.loc9_21 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc9_21.2: %i32 = converted %int_1.loc9, %.loc9_21.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc9_24: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc9_24: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc9_24: = bound_method %int_2, %impl.elem0.loc9_24 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc9_24: = specific_function %Convert.bound.loc9_24, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc9_24: init %i32 = call %Convert.specific_fn.loc9_24(%int_2) [template = constants.%int_2.2] @@ -236,13 +222,13 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %Less.ref.loc10: %Less.type = name_ref Less, file.%Less.decl [template = constants.%Less] // CHECK:STDOUT: %int_1.loc10_22: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_1.loc10_25: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc10_22: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc10_22: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc10_22: = bound_method %int_1.loc10_22, %impl.elem0.loc10_22 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc10_22: = specific_function %Convert.bound.loc10_22, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc10_22: init %i32 = call %Convert.specific_fn.loc10_22(%int_1.loc10_22) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc10_22.1: %i32 = value_of_initializer %int.convert_checked.loc10_22 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc10_22.2: %i32 = converted %int_1.loc10_22, %.loc10_22.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc10_25: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc10_25: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc10_25: = bound_method %int_1.loc10_25, %impl.elem0.loc10_25 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc10_25: = specific_function %Convert.bound.loc10_25, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc10_25: init %i32 = call %Convert.specific_fn.loc10_25(%int_1.loc10_25) [template = constants.%int_1.2] @@ -267,13 +253,13 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %Less.ref.loc11: %Less.type = name_ref Less, file.%Less.decl [template = constants.%Less] // CHECK:STDOUT: %int_1.loc11: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_0.loc11: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0.loc11_22: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc11_22: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_22: = bound_method %int_1.loc11, %impl.elem0.loc11_22 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc11_22: = specific_function %Convert.bound.loc11_22, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc11_22: init %i32 = call %Convert.specific_fn.loc11_22(%int_1.loc11) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc11_22.1: %i32 = value_of_initializer %int.convert_checked.loc11_22 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc11_22.2: %i32 = converted %int_1.loc11, %.loc11_22.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc11_25: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc11_25: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_25: = bound_method %int_0.loc11, %impl.elem0.loc11_25 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc11_25: = specific_function %Convert.bound.loc11_25, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc11_25: init %i32 = call %Convert.specific_fn.loc11_25(%int_0.loc11) [template = constants.%int_0.2] @@ -296,9 +282,9 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %.loc11_14.3: type = block_arg !if.expr.result.loc11 [template = constants.%False] // CHECK:STDOUT: %true_.ref.loc12: %True = name_ref true_, %true_ // CHECK:STDOUT: %Less.ref.loc12: %Less.type = name_ref Less, file.%Less.decl [template = constants.%Less] -// CHECK:STDOUT: %Negate.ref.loc12: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] +// CHECK:STDOUT: %Negate.ref.loc12: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %int_1.loc12: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc12_28: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc12_28: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc12_28: = bound_method %int_1.loc12, %impl.elem0.loc12_28 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc12_28: = specific_function %Convert.bound.loc12_28, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc12_28: init %i32 = call %Convert.specific_fn.loc12_28(%int_1.loc12) [template = constants.%int_1.2] @@ -308,7 +294,7 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %int_0.loc12: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %.loc12_29.1: %i32 = value_of_initializer %int.snegate.loc12 [template = constants.%int_-1] // CHECK:STDOUT: %.loc12_29.2: %i32 = converted %int.snegate.loc12, %.loc12_29.1 [template = constants.%int_-1] -// CHECK:STDOUT: %impl.elem0.loc12_32: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc12_32: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc12_32: = bound_method %int_0.loc12, %impl.elem0.loc12_32 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc12_32: = specific_function %Convert.bound.loc12_32, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc12_32: init %i32 = call %Convert.specific_fn.loc12_32(%int_0.loc12) [template = constants.%int_0.2] @@ -332,16 +318,16 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %false_.ref.loc13: %False = name_ref false_, %false_ // CHECK:STDOUT: %Less.ref.loc13: %Less.type = name_ref Less, file.%Less.decl [template = constants.%Less] // CHECK:STDOUT: %int_0.loc13: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %Negate.ref.loc13: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] +// CHECK:STDOUT: %Negate.ref.loc13: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %int_1.loc13: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc13_32: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc13_32: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc13_32: = bound_method %int_1.loc13, %impl.elem0.loc13_32 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc13_32: = specific_function %Convert.bound.loc13_32, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc13_32: init %i32 = call %Convert.specific_fn.loc13_32(%int_1.loc13) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc13_32.1: %i32 = value_of_initializer %int.convert_checked.loc13_32 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc13_32.2: %i32 = converted %int_1.loc13, %.loc13_32.1 [template = constants.%int_1.2] // CHECK:STDOUT: %int.snegate.loc13: init %i32 = call %Negate.ref.loc13(%.loc13_32.2) [template = constants.%int_-1] -// CHECK:STDOUT: %impl.elem0.loc13_22: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc13_22: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc13_22: = bound_method %int_0.loc13, %impl.elem0.loc13_22 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc13_22: = specific_function %Convert.bound.loc13_22, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc13_22: init %i32 = call %Convert.specific_fn.loc13_22(%int_0.loc13) [template = constants.%int_0.2] diff --git a/toolchain/check/testdata/builtins/int/less_eq.carbon b/toolchain/check/testdata/builtins/int/less_eq.carbon index 87f787350caf4..0febd2da77e53 100644 --- a/toolchain/check/testdata/builtins/int/less_eq.carbon +++ b/toolchain/check/testdata/builtins/int/less_eq.carbon @@ -32,36 +32,34 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %Bool.type: type = fn_type @Bool [template] // CHECK:STDOUT: %Bool: %Bool.type = struct_value () [template] // CHECK:STDOUT: %LessEq.type: type = fn_type @LessEq [template] // CHECK:STDOUT: %LessEq: %LessEq.type = struct_value () [template] -// CHECK:STDOUT: %Negate.type: type = fn_type @Negate [template] -// CHECK:STDOUT: %Negate: %Negate.type = struct_value () [template] +// CHECK:STDOUT: %Negate.type.1: type = fn_type @Negate.1 [template] +// CHECK:STDOUT: %Negate: %Negate.type.1 = struct_value () [template] // CHECK:STDOUT: %True: type = class_type @True [template] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] -// CHECK:STDOUT: %complete_type.1: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %complete_type.3: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %False: type = class_type @False [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] // CHECK:STDOUT: %true: bool = bool_literal true [template] // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] -// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_0.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] // CHECK:STDOUT: %false: bool = bool_literal false [template] @@ -73,8 +71,8 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .Bool = %import_ref.2 -// CHECK:STDOUT: .ImplicitAs = %import_ref.3 +// CHECK:STDOUT: .Bool = %import_ref.5 +// CHECK:STDOUT: .ImplicitAs = %import_ref.6 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -100,13 +98,9 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc2_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc2_14: init type = call constants.%Int(%int_32.loc2_14) [template = constants.%i32] -// CHECK:STDOUT: %.loc2_14.1: type = value_of_initializer %int.make_type_signed.loc2_14 [template = constants.%i32] -// CHECK:STDOUT: %.loc2_14.2: type = converted %int.make_type_signed.loc2_14, %.loc2_14.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc2_14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc2_22: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc2_22: init type = call constants.%Int(%int_32.loc2_22) [template = constants.%i32] -// CHECK:STDOUT: %.loc2_22.1: type = value_of_initializer %int.make_type_signed.loc2_22 [template = constants.%i32] -// CHECK:STDOUT: %.loc2_22.2: type = converted %int.make_type_signed.loc2_22, %.loc2_22.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc2_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc2_30.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc2_30.2: type = converted %bool.make_type, %.loc2_30.1 [template = bool] @@ -117,20 +111,16 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %Negate.decl: %Negate.type = fn_decl @Negate [template = constants.%Negate] { +// CHECK:STDOUT: %Negate.decl: %Negate.type.1 = fn_decl @Negate.1 [template = constants.%Negate] { // CHECK:STDOUT: %a.patt: %i32 = binding_pattern a // CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc3_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc3_14: init type = call constants.%Int(%int_32.loc3_14) [template = constants.%i32] -// CHECK:STDOUT: %.loc3_14.1: type = value_of_initializer %int.make_type_signed.loc3_14 [template = constants.%i32] -// CHECK:STDOUT: %.loc3_14.2: type = converted %int.make_type_signed.loc3_14, %.loc3_14.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc3_14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc3_22: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc3_22: init type = call constants.%Int(%int_32.loc3_22) [template = constants.%i32] -// CHECK:STDOUT: %.loc3_22.1: type = value_of_initializer %int.make_type_signed.loc3_22 [template = constants.%i32] -// CHECK:STDOUT: %.loc3_22.2: type = converted %int.make_type_signed.loc3_22, %.loc3_22.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc3_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 @@ -160,13 +150,9 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc16_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc16_19: init type = call constants.%Int(%int_32.loc16_19) [template = constants.%i32] -// CHECK:STDOUT: %.loc16_19.1: type = value_of_initializer %int.make_type_signed.loc16_19 [template = constants.%i32] -// CHECK:STDOUT: %.loc16_19.2: type = converted %int.make_type_signed.loc16_19, %.loc16_19.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc16_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc16_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc16_27: init type = call constants.%Int(%int_32.loc16_27) [template = constants.%i32] -// CHECK:STDOUT: %.loc16_27.1: type = value_of_initializer %int.make_type_signed.loc16_27 [template = constants.%i32] -// CHECK:STDOUT: %.loc16_27.2: type = converted %int.make_type_signed.loc16_27, %.loc16_27.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc16_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc16_35.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc16_35.2: type = converted %bool.make_type, %.loc16_35.1 [template = bool] @@ -180,7 +166,7 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @True { -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%True @@ -188,7 +174,7 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @False { -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%False @@ -197,7 +183,7 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: // CHECK:STDOUT: fn @LessEq(%a.param_patt: %i32, %b.param_patt: %i32) -> bool = "int.less_eq"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Negate(%a.param_patt: %i32) -> %i32 = "int.snegate"; +// CHECK:STDOUT: fn @Negate.1(%a.param_patt: %i32) -> %i32 = "int.snegate"; // CHECK:STDOUT: // CHECK:STDOUT: fn @F(%true_.param_patt: %True, %false_.param_patt: %False) { // CHECK:STDOUT: !entry: @@ -205,13 +191,13 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %LessEq.ref.loc9: %LessEq.type = name_ref LessEq, file.%LessEq.decl [template = constants.%LessEq] // CHECK:STDOUT: %int_1.loc9: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %impl.elem0.loc9_23: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc9_23: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc9_23: = bound_method %int_1.loc9, %impl.elem0.loc9_23 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc9_23: = specific_function %Convert.bound.loc9_23, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc9_23: init %i32 = call %Convert.specific_fn.loc9_23(%int_1.loc9) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc9_23.1: %i32 = value_of_initializer %int.convert_checked.loc9_23 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc9_23.2: %i32 = converted %int_1.loc9, %.loc9_23.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc9_26: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc9_26: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc9_26: = bound_method %int_2, %impl.elem0.loc9_26 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc9_26: = specific_function %Convert.bound.loc9_26, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc9_26: init %i32 = call %Convert.specific_fn.loc9_26(%int_2) [template = constants.%int_2.2] @@ -236,13 +222,13 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %LessEq.ref.loc10: %LessEq.type = name_ref LessEq, file.%LessEq.decl [template = constants.%LessEq] // CHECK:STDOUT: %int_1.loc10_23: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_1.loc10_26: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc10_23: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc10_23: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc10_23: = bound_method %int_1.loc10_23, %impl.elem0.loc10_23 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc10_23: = specific_function %Convert.bound.loc10_23, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc10_23: init %i32 = call %Convert.specific_fn.loc10_23(%int_1.loc10_23) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc10_23.1: %i32 = value_of_initializer %int.convert_checked.loc10_23 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc10_23.2: %i32 = converted %int_1.loc10_23, %.loc10_23.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc10_26: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc10_26: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc10_26: = bound_method %int_1.loc10_26, %impl.elem0.loc10_26 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc10_26: = specific_function %Convert.bound.loc10_26, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc10_26: init %i32 = call %Convert.specific_fn.loc10_26(%int_1.loc10_26) [template = constants.%int_1.2] @@ -267,13 +253,13 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %LessEq.ref.loc11: %LessEq.type = name_ref LessEq, file.%LessEq.decl [template = constants.%LessEq] // CHECK:STDOUT: %int_1.loc11: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_0.loc11: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0.loc11_24: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc11_24: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_24: = bound_method %int_1.loc11, %impl.elem0.loc11_24 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc11_24: = specific_function %Convert.bound.loc11_24, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc11_24: init %i32 = call %Convert.specific_fn.loc11_24(%int_1.loc11) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc11_24.1: %i32 = value_of_initializer %int.convert_checked.loc11_24 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc11_24.2: %i32 = converted %int_1.loc11, %.loc11_24.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc11_27: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc11_27: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_27: = bound_method %int_0.loc11, %impl.elem0.loc11_27 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc11_27: = specific_function %Convert.bound.loc11_27, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc11_27: init %i32 = call %Convert.specific_fn.loc11_27(%int_0.loc11) [template = constants.%int_0.2] @@ -296,9 +282,9 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %.loc11_14.3: type = block_arg !if.expr.result.loc11 [template = constants.%False] // CHECK:STDOUT: %true_.ref.loc12: %True = name_ref true_, %true_ // CHECK:STDOUT: %LessEq.ref.loc12: %LessEq.type = name_ref LessEq, file.%LessEq.decl [template = constants.%LessEq] -// CHECK:STDOUT: %Negate.ref.loc12: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] +// CHECK:STDOUT: %Negate.ref.loc12: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %int_1.loc12: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc12_30: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc12_30: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc12_30: = bound_method %int_1.loc12, %impl.elem0.loc12_30 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc12_30: = specific_function %Convert.bound.loc12_30, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc12_30: init %i32 = call %Convert.specific_fn.loc12_30(%int_1.loc12) [template = constants.%int_1.2] @@ -308,7 +294,7 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %int_0.loc12: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %.loc12_31.1: %i32 = value_of_initializer %int.snegate.loc12 [template = constants.%int_-1] // CHECK:STDOUT: %.loc12_31.2: %i32 = converted %int.snegate.loc12, %.loc12_31.1 [template = constants.%int_-1] -// CHECK:STDOUT: %impl.elem0.loc12_34: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc12_34: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc12_34: = bound_method %int_0.loc12, %impl.elem0.loc12_34 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc12_34: = specific_function %Convert.bound.loc12_34, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc12_34: init %i32 = call %Convert.specific_fn.loc12_34(%int_0.loc12) [template = constants.%int_0.2] @@ -332,16 +318,16 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %false_.ref.loc13: %False = name_ref false_, %false_ // CHECK:STDOUT: %LessEq.ref.loc13: %LessEq.type = name_ref LessEq, file.%LessEq.decl [template = constants.%LessEq] // CHECK:STDOUT: %int_0.loc13: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %Negate.ref.loc13: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] +// CHECK:STDOUT: %Negate.ref.loc13: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %int_1.loc13: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc13_34: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc13_34: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc13_34: = bound_method %int_1.loc13, %impl.elem0.loc13_34 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc13_34: = specific_function %Convert.bound.loc13_34, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc13_34: init %i32 = call %Convert.specific_fn.loc13_34(%int_1.loc13) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc13_34.1: %i32 = value_of_initializer %int.convert_checked.loc13_34 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc13_34.2: %i32 = converted %int_1.loc13, %.loc13_34.1 [template = constants.%int_1.2] // CHECK:STDOUT: %int.snegate.loc13: init %i32 = call %Negate.ref.loc13(%.loc13_34.2) [template = constants.%int_-1] -// CHECK:STDOUT: %impl.elem0.loc13_24: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc13_24: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc13_24: = bound_method %int_0.loc13, %impl.elem0.loc13_24 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc13_24: = specific_function %Convert.bound.loc13_24, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc13_24: init %i32 = call %Convert.specific_fn.loc13_24(%int_0.loc13) [template = constants.%int_0.2] diff --git a/toolchain/check/testdata/builtins/int/make_type_signed.carbon b/toolchain/check/testdata/builtins/int/make_type_signed.carbon index cd8315d1700e7..5f5a11aebeddc 100644 --- a/toolchain/check/testdata/builtins/int/make_type_signed.carbon +++ b/toolchain/check/testdata/builtins/int/make_type_signed.carbon @@ -146,21 +146,21 @@ var m: Int(1000000000); // CHECK:STDOUT: %Int.type: type = fn_type @Int [template] // CHECK:STDOUT: %Int: %Int.type = struct_value () [template] // CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [template] -// CHECK:STDOUT: %i64: type = int_type signed, %int_64 [template] +// CHECK:STDOUT: %i64.builtin: type = int_type signed, %int_64 [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %int_13: Core.IntLiteral = int_value 13 [template] -// CHECK:STDOUT: %i13: type = int_type signed, %int_13 [template] +// CHECK:STDOUT: %i13.builtin: type = int_type signed, %int_13 [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] // CHECK:STDOUT: %IntLiteral.type: type = fn_type @IntLiteral [template] // CHECK:STDOUT: %IntLiteral: %IntLiteral.type = struct_value () [template] // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic] -// CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic] +// CHECK:STDOUT: %iN.builtin: type = int_type signed, %N [symbolic] // CHECK:STDOUT: %Symbolic.type: type = fn_type @Symbolic [template] // CHECK:STDOUT: %Symbolic: %Symbolic.type = struct_value () [template] -// CHECK:STDOUT: %require_complete: = require_complete_type %iN [symbolic] +// CHECK:STDOUT: %require_complete: = require_complete_type %iN.builtin [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -184,54 +184,54 @@ var m: Int(1000000000); // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %n.patt: %i64 = binding_pattern n -// CHECK:STDOUT: %n.param_patt: %i64 = value_param_pattern %n.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: %i64 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %i64 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %n.patt: %i64.builtin = binding_pattern n +// CHECK:STDOUT: %n.param_patt: %i64.builtin = value_param_pattern %n.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i64.builtin = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i64.builtin = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %Int.ref.loc6_9: %Int.type = name_ref Int, imports.%import_ref.2 [template = constants.%Int] // CHECK:STDOUT: %int_64.loc6_13: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %int.make_type_signed.loc6_15: init type = call %Int.ref.loc6_9(%int_64.loc6_13) [template = constants.%i64] -// CHECK:STDOUT: %.loc6_15.1: type = value_of_initializer %int.make_type_signed.loc6_15 [template = constants.%i64] -// CHECK:STDOUT: %.loc6_15.2: type = converted %int.make_type_signed.loc6_15, %.loc6_15.1 [template = constants.%i64] +// CHECK:STDOUT: %int.make_type_signed.loc6_15: init type = call %Int.ref.loc6_9(%int_64.loc6_13) [template = constants.%i64.builtin] +// CHECK:STDOUT: %.loc6_15.1: type = value_of_initializer %int.make_type_signed.loc6_15 [template = constants.%i64.builtin] +// CHECK:STDOUT: %.loc6_15.2: type = converted %int.make_type_signed.loc6_15, %.loc6_15.1 [template = constants.%i64.builtin] // CHECK:STDOUT: %Int.ref.loc6_21: %Int.type = name_ref Int, imports.%import_ref.2 [template = constants.%Int] // CHECK:STDOUT: %int_64.loc6_25: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %int.make_type_signed.loc6_27: init type = call %Int.ref.loc6_21(%int_64.loc6_25) [template = constants.%i64] -// CHECK:STDOUT: %.loc6_27.1: type = value_of_initializer %int.make_type_signed.loc6_27 [template = constants.%i64] -// CHECK:STDOUT: %.loc6_27.2: type = converted %int.make_type_signed.loc6_27, %.loc6_27.1 [template = constants.%i64] -// CHECK:STDOUT: %n.param: %i64 = value_param runtime_param0 -// CHECK:STDOUT: %n: %i64 = bind_name n, %n.param -// CHECK:STDOUT: %return.param: ref %i64 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref %i64 = return_slot %return.param +// CHECK:STDOUT: %int.make_type_signed.loc6_27: init type = call %Int.ref.loc6_21(%int_64.loc6_25) [template = constants.%i64.builtin] +// CHECK:STDOUT: %.loc6_27.1: type = value_of_initializer %int.make_type_signed.loc6_27 [template = constants.%i64.builtin] +// CHECK:STDOUT: %.loc6_27.2: type = converted %int.make_type_signed.loc6_27, %.loc6_27.1 [template = constants.%i64.builtin] +// CHECK:STDOUT: %n.param: %i64.builtin = value_param runtime_param0 +// CHECK:STDOUT: %n: %i64.builtin = bind_name n, %n.param +// CHECK:STDOUT: %return.param: ref %i64.builtin = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i64.builtin = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { -// CHECK:STDOUT: %n.patt: %i13 = binding_pattern n -// CHECK:STDOUT: %n.param_patt: %i13 = value_param_pattern %n.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: %i13 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %i13 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %n.patt: %i13.builtin = binding_pattern n +// CHECK:STDOUT: %n.param_patt: %i13.builtin = value_param_pattern %n.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i13.builtin = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i13.builtin = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %Int.ref.loc10_9: %Int.type = name_ref Int, imports.%import_ref.2 [template = constants.%Int] // CHECK:STDOUT: %int_13.loc10_13: Core.IntLiteral = int_value 13 [template = constants.%int_13] -// CHECK:STDOUT: %int.make_type_signed.loc10_15: init type = call %Int.ref.loc10_9(%int_13.loc10_13) [template = constants.%i13] -// CHECK:STDOUT: %.loc10_15.1: type = value_of_initializer %int.make_type_signed.loc10_15 [template = constants.%i13] -// CHECK:STDOUT: %.loc10_15.2: type = converted %int.make_type_signed.loc10_15, %.loc10_15.1 [template = constants.%i13] +// CHECK:STDOUT: %int.make_type_signed.loc10_15: init type = call %Int.ref.loc10_9(%int_13.loc10_13) [template = constants.%i13.builtin] +// CHECK:STDOUT: %.loc10_15.1: type = value_of_initializer %int.make_type_signed.loc10_15 [template = constants.%i13.builtin] +// CHECK:STDOUT: %.loc10_15.2: type = converted %int.make_type_signed.loc10_15, %.loc10_15.1 [template = constants.%i13.builtin] // CHECK:STDOUT: %Int.ref.loc10_21: %Int.type = name_ref Int, imports.%import_ref.2 [template = constants.%Int] // CHECK:STDOUT: %int_13.loc10_25: Core.IntLiteral = int_value 13 [template = constants.%int_13] -// CHECK:STDOUT: %int.make_type_signed.loc10_27: init type = call %Int.ref.loc10_21(%int_13.loc10_25) [template = constants.%i13] -// CHECK:STDOUT: %.loc10_27.1: type = value_of_initializer %int.make_type_signed.loc10_27 [template = constants.%i13] -// CHECK:STDOUT: %.loc10_27.2: type = converted %int.make_type_signed.loc10_27, %.loc10_27.1 [template = constants.%i13] -// CHECK:STDOUT: %n.param: %i13 = value_param runtime_param0 -// CHECK:STDOUT: %n: %i13 = bind_name n, %n.param -// CHECK:STDOUT: %return.param: ref %i13 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref %i13 = return_slot %return.param +// CHECK:STDOUT: %int.make_type_signed.loc10_27: init type = call %Int.ref.loc10_21(%int_13.loc10_25) [template = constants.%i13.builtin] +// CHECK:STDOUT: %.loc10_27.1: type = value_of_initializer %int.make_type_signed.loc10_27 [template = constants.%i13.builtin] +// CHECK:STDOUT: %.loc10_27.2: type = converted %int.make_type_signed.loc10_27, %.loc10_27.1 [template = constants.%i13.builtin] +// CHECK:STDOUT: %n.param: %i13.builtin = value_param runtime_param0 +// CHECK:STDOUT: %n: %i13.builtin = bind_name n, %n.param +// CHECK:STDOUT: %return.param: ref %i13.builtin = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i13.builtin = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %Symbolic.decl: %Symbolic.type = fn_decl @Symbolic [template = constants.%Symbolic] { // CHECK:STDOUT: %N.patt.loc14_13.1: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc14_13.2 (constants.%N.patt)] // CHECK:STDOUT: %N.param_patt: Core.IntLiteral = value_param_pattern %N.patt.loc14_13.1, runtime_param [symbolic = %N.patt.loc14_13.2 (constants.%N.patt)] -// CHECK:STDOUT: %x.patt: @Symbolic.%iN (%iN) = binding_pattern x -// CHECK:STDOUT: %x.param_patt: @Symbolic.%iN (%iN) = value_param_pattern %x.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: @Symbolic.%iN (%iN) = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: @Symbolic.%iN (%iN) = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %x.patt: @Symbolic.%iN.builtin (%iN.builtin) = binding_pattern x +// CHECK:STDOUT: %x.param_patt: @Symbolic.%iN.builtin (%iN.builtin) = value_param_pattern %x.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: @Symbolic.%iN.builtin (%iN.builtin) = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: @Symbolic.%iN.builtin (%iN.builtin) = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, imports.%import_ref.1 [template = constants.%IntLiteral] // CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral] @@ -239,34 +239,34 @@ var m: Int(1000000000); // CHECK:STDOUT: %.loc14_28.2: type = converted %int_literal.make_type, %.loc14_28.1 [template = Core.IntLiteral] // CHECK:STDOUT: %Int.ref.loc14_34: %Int.type = name_ref Int, imports.%import_ref.2 [template = constants.%Int] // CHECK:STDOUT: %N.ref.loc14_38: Core.IntLiteral = name_ref N, %N.loc14_13.1 [symbolic = %N.loc14_13.2 (constants.%N)] -// CHECK:STDOUT: %int.make_type_signed.loc14_39: init type = call %Int.ref.loc14_34(%N.ref.loc14_38) [symbolic = %iN (constants.%iN)] -// CHECK:STDOUT: %.loc14_39.1: type = value_of_initializer %int.make_type_signed.loc14_39 [symbolic = %iN (constants.%iN)] -// CHECK:STDOUT: %.loc14_39.2: type = converted %int.make_type_signed.loc14_39, %.loc14_39.1 [symbolic = %iN (constants.%iN)] +// CHECK:STDOUT: %int.make_type_signed.loc14_39: init type = call %Int.ref.loc14_34(%N.ref.loc14_38) [symbolic = %iN.builtin (constants.%iN.builtin)] +// CHECK:STDOUT: %.loc14_39.1: type = value_of_initializer %int.make_type_signed.loc14_39 [symbolic = %iN.builtin (constants.%iN.builtin)] +// CHECK:STDOUT: %.loc14_39.2: type = converted %int.make_type_signed.loc14_39, %.loc14_39.1 [symbolic = %iN.builtin (constants.%iN.builtin)] // CHECK:STDOUT: %Int.ref.loc14_45: %Int.type = name_ref Int, imports.%import_ref.2 [template = constants.%Int] // CHECK:STDOUT: %N.ref.loc14_49: Core.IntLiteral = name_ref N, %N.loc14_13.1 [symbolic = %N.loc14_13.2 (constants.%N)] -// CHECK:STDOUT: %int.make_type_signed.loc14_50: init type = call %Int.ref.loc14_45(%N.ref.loc14_49) [symbolic = %iN (constants.%iN)] -// CHECK:STDOUT: %.loc14_50.1: type = value_of_initializer %int.make_type_signed.loc14_50 [symbolic = %iN (constants.%iN)] -// CHECK:STDOUT: %.loc14_50.2: type = converted %int.make_type_signed.loc14_50, %.loc14_50.1 [symbolic = %iN (constants.%iN)] +// CHECK:STDOUT: %int.make_type_signed.loc14_50: init type = call %Int.ref.loc14_45(%N.ref.loc14_49) [symbolic = %iN.builtin (constants.%iN.builtin)] +// CHECK:STDOUT: %.loc14_50.1: type = value_of_initializer %int.make_type_signed.loc14_50 [symbolic = %iN.builtin (constants.%iN.builtin)] +// CHECK:STDOUT: %.loc14_50.2: type = converted %int.make_type_signed.loc14_50, %.loc14_50.1 [symbolic = %iN.builtin (constants.%iN.builtin)] // CHECK:STDOUT: %N.param: Core.IntLiteral = value_param runtime_param // CHECK:STDOUT: %N.loc14_13.1: Core.IntLiteral = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc14_13.2 (constants.%N)] -// CHECK:STDOUT: %x.param: @Symbolic.%iN (%iN) = value_param runtime_param0 -// CHECK:STDOUT: %x: @Symbolic.%iN (%iN) = bind_name x, %x.param -// CHECK:STDOUT: %return.param: ref @Symbolic.%iN (%iN) = out_param runtime_param1 -// CHECK:STDOUT: %return: ref @Symbolic.%iN (%iN) = return_slot %return.param +// CHECK:STDOUT: %x.param: @Symbolic.%iN.builtin (%iN.builtin) = value_param runtime_param0 +// CHECK:STDOUT: %x: @Symbolic.%iN.builtin (%iN.builtin) = bind_name x, %x.param +// CHECK:STDOUT: %return.param: ref @Symbolic.%iN.builtin (%iN.builtin) = out_param runtime_param1 +// CHECK:STDOUT: %return: ref @Symbolic.%iN.builtin (%iN.builtin) = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int(%n.param_patt: Core.IntLiteral) -> type = "int.make_type_signed" [from "types.carbon"]; // CHECK:STDOUT: -// CHECK:STDOUT: fn @F(%n.param_patt: %i64) -> %i64 { +// CHECK:STDOUT: fn @F(%n.param_patt: %i64.builtin) -> %i64.builtin { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %n.ref: %i64 = name_ref n, %n +// CHECK:STDOUT: %n.ref: %i64.builtin = name_ref n, %n // CHECK:STDOUT: return %n.ref // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @G(%n.param_patt: %i13) -> %i13 { +// CHECK:STDOUT: fn @G(%n.param_patt: %i13.builtin) -> %i13.builtin { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %n.ref: %i13 = name_ref n, %n +// CHECK:STDOUT: %n.ref: %i13.builtin = name_ref n, %n // CHECK:STDOUT: return %n.ref // CHECK:STDOUT: } // CHECK:STDOUT: @@ -275,14 +275,14 @@ var m: Int(1000000000); // CHECK:STDOUT: generic fn @Symbolic(%N.loc14_13.1: Core.IntLiteral) { // CHECK:STDOUT: %N.loc14_13.2: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N.loc14_13.2 (constants.%N)] // CHECK:STDOUT: %N.patt.loc14_13.2: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc14_13.2 (constants.%N.patt)] -// CHECK:STDOUT: %iN: type = int_type signed, %N.loc14_13.2 [symbolic = %iN (constants.%iN)] +// CHECK:STDOUT: %iN.builtin: type = int_type signed, %N.loc14_13.2 [symbolic = %iN.builtin (constants.%iN.builtin)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete: = require_complete_type @Symbolic.%iN (%iN) [symbolic = %require_complete (constants.%require_complete)] +// CHECK:STDOUT: %require_complete: = require_complete_type @Symbolic.%iN.builtin (%iN.builtin) [symbolic = %require_complete (constants.%require_complete)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%N.param_patt: Core.IntLiteral, %x.param_patt: @Symbolic.%iN (%iN)) -> @Symbolic.%iN (%iN) { +// CHECK:STDOUT: fn(%N.param_patt: Core.IntLiteral, %x.param_patt: @Symbolic.%iN.builtin (%iN.builtin)) -> @Symbolic.%iN.builtin (%iN.builtin) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %x.ref: @Symbolic.%iN (%iN) = name_ref x, %x +// CHECK:STDOUT: %x.ref: @Symbolic.%iN.builtin (%iN.builtin) = name_ref x, %x // CHECK:STDOUT: return %x.ref // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -290,7 +290,7 @@ var m: Int(1000000000); // CHECK:STDOUT: specific @Symbolic(constants.%N) { // CHECK:STDOUT: %N.loc14_13.2 => constants.%N // CHECK:STDOUT: %N.patt.loc14_13.2 => constants.%N -// CHECK:STDOUT: %iN => constants.%iN +// CHECK:STDOUT: %iN.builtin => constants.%iN.builtin // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- import_types.carbon @@ -299,29 +299,29 @@ var m: Int(1000000000); // CHECK:STDOUT: %Int.type: type = fn_type @Int [template] // CHECK:STDOUT: %Int: %Int.type = struct_value () [template] // CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [template] -// CHECK:STDOUT: %i64: type = int_type signed, %int_64 [template] +// CHECK:STDOUT: %i64.builtin: type = int_type signed, %int_64 [template] // CHECK:STDOUT: %UseF.type: type = fn_type @UseF [template] // CHECK:STDOUT: %UseF: %UseF.type = struct_value () [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %int_13: Core.IntLiteral = int_value 13 [template] -// CHECK:STDOUT: %i13: type = int_type signed, %int_13 [template] +// CHECK:STDOUT: %i13.builtin: type = int_type signed, %int_13 [template] // CHECK:STDOUT: %UseG.type: type = fn_type @UseG [template] // CHECK:STDOUT: %UseG: %UseG.type = struct_value () [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] // CHECK:STDOUT: %int_24: Core.IntLiteral = int_value 24 [template] -// CHECK:STDOUT: %i24: type = int_type signed, %int_24 [template] +// CHECK:STDOUT: %i24.builtin: type = int_type signed, %int_24 [template] // CHECK:STDOUT: %UseSymbolic.type: type = fn_type @UseSymbolic [template] // CHECK:STDOUT: %UseSymbolic: %UseSymbolic.type = struct_value () [template] // CHECK:STDOUT: %Symbolic.type: type = fn_type @Symbolic [template] // CHECK:STDOUT: %Symbolic: %Symbolic.type = struct_value () [template] // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] -// CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic] +// CHECK:STDOUT: %iN.builtin: type = int_type signed, %N [symbolic] // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic] -// CHECK:STDOUT: %require_complete: = require_complete_type %iN [symbolic] +// CHECK:STDOUT: %require_complete: = require_complete_type %iN.builtin [symbolic] // CHECK:STDOUT: %Symbolic.specific_fn: = specific_function %Symbolic, @Symbolic(%int_24) [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %i24 [template] +// CHECK:STDOUT: %complete_type: = complete_type_witness %i24.builtin [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -351,129 +351,129 @@ var m: Int(1000000000); // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %UseF.decl: %UseF.type = fn_decl @UseF [template = constants.%UseF] { -// CHECK:STDOUT: %n.patt: %i64 = binding_pattern n -// CHECK:STDOUT: %n.param_patt: %i64 = value_param_pattern %n.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: %i64 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %i64 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %n.patt: %i64.builtin = binding_pattern n +// CHECK:STDOUT: %n.param_patt: %i64.builtin = value_param_pattern %n.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i64.builtin = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i64.builtin = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %Int.ref.loc7_12: %Int.type = name_ref Int, imports.%import_ref.2 [template = constants.%Int] // CHECK:STDOUT: %int_64.loc7_16: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %int.make_type_signed.loc7_18: init type = call %Int.ref.loc7_12(%int_64.loc7_16) [template = constants.%i64] -// CHECK:STDOUT: %.loc7_18.1: type = value_of_initializer %int.make_type_signed.loc7_18 [template = constants.%i64] -// CHECK:STDOUT: %.loc7_18.2: type = converted %int.make_type_signed.loc7_18, %.loc7_18.1 [template = constants.%i64] +// CHECK:STDOUT: %int.make_type_signed.loc7_18: init type = call %Int.ref.loc7_12(%int_64.loc7_16) [template = constants.%i64.builtin] +// CHECK:STDOUT: %.loc7_18.1: type = value_of_initializer %int.make_type_signed.loc7_18 [template = constants.%i64.builtin] +// CHECK:STDOUT: %.loc7_18.2: type = converted %int.make_type_signed.loc7_18, %.loc7_18.1 [template = constants.%i64.builtin] // CHECK:STDOUT: %Int.ref.loc7_24: %Int.type = name_ref Int, imports.%import_ref.2 [template = constants.%Int] // CHECK:STDOUT: %int_64.loc7_28: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %int.make_type_signed.loc7_30: init type = call %Int.ref.loc7_24(%int_64.loc7_28) [template = constants.%i64] -// CHECK:STDOUT: %.loc7_30.1: type = value_of_initializer %int.make_type_signed.loc7_30 [template = constants.%i64] -// CHECK:STDOUT: %.loc7_30.2: type = converted %int.make_type_signed.loc7_30, %.loc7_30.1 [template = constants.%i64] -// CHECK:STDOUT: %n.param: %i64 = value_param runtime_param0 -// CHECK:STDOUT: %n: %i64 = bind_name n, %n.param -// CHECK:STDOUT: %return.param: ref %i64 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref %i64 = return_slot %return.param +// CHECK:STDOUT: %int.make_type_signed.loc7_30: init type = call %Int.ref.loc7_24(%int_64.loc7_28) [template = constants.%i64.builtin] +// CHECK:STDOUT: %.loc7_30.1: type = value_of_initializer %int.make_type_signed.loc7_30 [template = constants.%i64.builtin] +// CHECK:STDOUT: %.loc7_30.2: type = converted %int.make_type_signed.loc7_30, %.loc7_30.1 [template = constants.%i64.builtin] +// CHECK:STDOUT: %n.param: %i64.builtin = value_param runtime_param0 +// CHECK:STDOUT: %n: %i64.builtin = bind_name n, %n.param +// CHECK:STDOUT: %return.param: ref %i64.builtin = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i64.builtin = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %UseG.decl: %UseG.type = fn_decl @UseG [template = constants.%UseG] { -// CHECK:STDOUT: %n.patt: %i13 = binding_pattern n -// CHECK:STDOUT: %n.param_patt: %i13 = value_param_pattern %n.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: %i13 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %i13 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %n.patt: %i13.builtin = binding_pattern n +// CHECK:STDOUT: %n.param_patt: %i13.builtin = value_param_pattern %n.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i13.builtin = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i13.builtin = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %Int.ref.loc11_12: %Int.type = name_ref Int, imports.%import_ref.2 [template = constants.%Int] // CHECK:STDOUT: %int_13.loc11_16: Core.IntLiteral = int_value 13 [template = constants.%int_13] -// CHECK:STDOUT: %int.make_type_signed.loc11_18: init type = call %Int.ref.loc11_12(%int_13.loc11_16) [template = constants.%i13] -// CHECK:STDOUT: %.loc11_18.1: type = value_of_initializer %int.make_type_signed.loc11_18 [template = constants.%i13] -// CHECK:STDOUT: %.loc11_18.2: type = converted %int.make_type_signed.loc11_18, %.loc11_18.1 [template = constants.%i13] +// CHECK:STDOUT: %int.make_type_signed.loc11_18: init type = call %Int.ref.loc11_12(%int_13.loc11_16) [template = constants.%i13.builtin] +// CHECK:STDOUT: %.loc11_18.1: type = value_of_initializer %int.make_type_signed.loc11_18 [template = constants.%i13.builtin] +// CHECK:STDOUT: %.loc11_18.2: type = converted %int.make_type_signed.loc11_18, %.loc11_18.1 [template = constants.%i13.builtin] // CHECK:STDOUT: %Int.ref.loc11_24: %Int.type = name_ref Int, imports.%import_ref.2 [template = constants.%Int] // CHECK:STDOUT: %int_13.loc11_28: Core.IntLiteral = int_value 13 [template = constants.%int_13] -// CHECK:STDOUT: %int.make_type_signed.loc11_30: init type = call %Int.ref.loc11_24(%int_13.loc11_28) [template = constants.%i13] -// CHECK:STDOUT: %.loc11_30.1: type = value_of_initializer %int.make_type_signed.loc11_30 [template = constants.%i13] -// CHECK:STDOUT: %.loc11_30.2: type = converted %int.make_type_signed.loc11_30, %.loc11_30.1 [template = constants.%i13] -// CHECK:STDOUT: %n.param: %i13 = value_param runtime_param0 -// CHECK:STDOUT: %n: %i13 = bind_name n, %n.param -// CHECK:STDOUT: %return.param: ref %i13 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref %i13 = return_slot %return.param +// CHECK:STDOUT: %int.make_type_signed.loc11_30: init type = call %Int.ref.loc11_24(%int_13.loc11_28) [template = constants.%i13.builtin] +// CHECK:STDOUT: %.loc11_30.1: type = value_of_initializer %int.make_type_signed.loc11_30 [template = constants.%i13.builtin] +// CHECK:STDOUT: %.loc11_30.2: type = converted %int.make_type_signed.loc11_30, %.loc11_30.1 [template = constants.%i13.builtin] +// CHECK:STDOUT: %n.param: %i13.builtin = value_param runtime_param0 +// CHECK:STDOUT: %n: %i13.builtin = bind_name n, %n.param +// CHECK:STDOUT: %return.param: ref %i13.builtin = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i13.builtin = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %UseSymbolic.decl: %UseSymbolic.type = fn_decl @UseSymbolic [template = constants.%UseSymbolic] { -// CHECK:STDOUT: %n.patt: %i24 = binding_pattern n -// CHECK:STDOUT: %n.param_patt: %i24 = value_param_pattern %n.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: %i24 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %i24 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %n.patt: %i24.builtin = binding_pattern n +// CHECK:STDOUT: %n.param_patt: %i24.builtin = value_param_pattern %n.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i24.builtin = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i24.builtin = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %Int.ref.loc15_19: %Int.type = name_ref Int, imports.%import_ref.2 [template = constants.%Int] // CHECK:STDOUT: %int_24.loc15_23: Core.IntLiteral = int_value 24 [template = constants.%int_24] -// CHECK:STDOUT: %int.make_type_signed.loc15_25: init type = call %Int.ref.loc15_19(%int_24.loc15_23) [template = constants.%i24] -// CHECK:STDOUT: %.loc15_25.1: type = value_of_initializer %int.make_type_signed.loc15_25 [template = constants.%i24] -// CHECK:STDOUT: %.loc15_25.2: type = converted %int.make_type_signed.loc15_25, %.loc15_25.1 [template = constants.%i24] +// CHECK:STDOUT: %int.make_type_signed.loc15_25: init type = call %Int.ref.loc15_19(%int_24.loc15_23) [template = constants.%i24.builtin] +// CHECK:STDOUT: %.loc15_25.1: type = value_of_initializer %int.make_type_signed.loc15_25 [template = constants.%i24.builtin] +// CHECK:STDOUT: %.loc15_25.2: type = converted %int.make_type_signed.loc15_25, %.loc15_25.1 [template = constants.%i24.builtin] // CHECK:STDOUT: %Int.ref.loc15_31: %Int.type = name_ref Int, imports.%import_ref.2 [template = constants.%Int] // CHECK:STDOUT: %int_24.loc15_35: Core.IntLiteral = int_value 24 [template = constants.%int_24] -// CHECK:STDOUT: %int.make_type_signed.loc15_37: init type = call %Int.ref.loc15_31(%int_24.loc15_35) [template = constants.%i24] -// CHECK:STDOUT: %.loc15_37.1: type = value_of_initializer %int.make_type_signed.loc15_37 [template = constants.%i24] -// CHECK:STDOUT: %.loc15_37.2: type = converted %int.make_type_signed.loc15_37, %.loc15_37.1 [template = constants.%i24] -// CHECK:STDOUT: %n.param: %i24 = value_param runtime_param0 -// CHECK:STDOUT: %n: %i24 = bind_name n, %n.param -// CHECK:STDOUT: %return.param: ref %i24 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref %i24 = return_slot %return.param +// CHECK:STDOUT: %int.make_type_signed.loc15_37: init type = call %Int.ref.loc15_31(%int_24.loc15_35) [template = constants.%i24.builtin] +// CHECK:STDOUT: %.loc15_37.1: type = value_of_initializer %int.make_type_signed.loc15_37 [template = constants.%i24.builtin] +// CHECK:STDOUT: %.loc15_37.2: type = converted %int.make_type_signed.loc15_37, %.loc15_37.1 [template = constants.%i24.builtin] +// CHECK:STDOUT: %n.param: %i24.builtin = value_param runtime_param0 +// CHECK:STDOUT: %n: %i24.builtin = bind_name n, %n.param +// CHECK:STDOUT: %return.param: ref %i24.builtin = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i24.builtin = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int(%n.param_patt: Core.IntLiteral) -> type = "int.make_type_signed" [from "types.carbon"]; // CHECK:STDOUT: -// CHECK:STDOUT: fn @UseF(%n.param_patt: %i64) -> %i64 { +// CHECK:STDOUT: fn @UseF(%n.param_patt: %i64.builtin) -> %i64.builtin { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %F.ref: %F.type = name_ref F, imports.%import_ref.3 [template = constants.%F] -// CHECK:STDOUT: %n.ref: %i64 = name_ref n, %n -// CHECK:STDOUT: %F.call: init %i64 = call %F.ref(%n.ref) -// CHECK:STDOUT: %.loc8_14.1: %i64 = value_of_initializer %F.call -// CHECK:STDOUT: %.loc8_14.2: %i64 = converted %F.call, %.loc8_14.1 +// CHECK:STDOUT: %n.ref: %i64.builtin = name_ref n, %n +// CHECK:STDOUT: %F.call: init %i64.builtin = call %F.ref(%n.ref) +// CHECK:STDOUT: %.loc8_14.1: %i64.builtin = value_of_initializer %F.call +// CHECK:STDOUT: %.loc8_14.2: %i64.builtin = converted %F.call, %.loc8_14.1 // CHECK:STDOUT: return %.loc8_14.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F(%n.param_patt: %i64) -> %i64 [from "use_types.carbon"]; +// CHECK:STDOUT: fn @F(%n.param_patt: %i64.builtin) -> %i64.builtin [from "use_types.carbon"]; // CHECK:STDOUT: -// CHECK:STDOUT: fn @UseG(%n.param_patt: %i13) -> %i13 { +// CHECK:STDOUT: fn @UseG(%n.param_patt: %i13.builtin) -> %i13.builtin { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %G.ref: %G.type = name_ref G, imports.%import_ref.4 [template = constants.%G] -// CHECK:STDOUT: %n.ref: %i13 = name_ref n, %n -// CHECK:STDOUT: %G.call: init %i13 = call %G.ref(%n.ref) -// CHECK:STDOUT: %.loc12_14.1: %i13 = value_of_initializer %G.call -// CHECK:STDOUT: %.loc12_14.2: %i13 = converted %G.call, %.loc12_14.1 +// CHECK:STDOUT: %n.ref: %i13.builtin = name_ref n, %n +// CHECK:STDOUT: %G.call: init %i13.builtin = call %G.ref(%n.ref) +// CHECK:STDOUT: %.loc12_14.1: %i13.builtin = value_of_initializer %G.call +// CHECK:STDOUT: %.loc12_14.2: %i13.builtin = converted %G.call, %.loc12_14.1 // CHECK:STDOUT: return %.loc12_14.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @G(%n.param_patt: %i13) -> %i13 [from "use_types.carbon"]; +// CHECK:STDOUT: fn @G(%n.param_patt: %i13.builtin) -> %i13.builtin [from "use_types.carbon"]; // CHECK:STDOUT: -// CHECK:STDOUT: fn @UseSymbolic(%n.param_patt: %i24) -> %i24 { +// CHECK:STDOUT: fn @UseSymbolic(%n.param_patt: %i24.builtin) -> %i24.builtin { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Symbolic.ref: %Symbolic.type = name_ref Symbolic, imports.%import_ref.5 [template = constants.%Symbolic] // CHECK:STDOUT: %int_24.loc16: Core.IntLiteral = int_value 24 [template = constants.%int_24] -// CHECK:STDOUT: %n.ref: %i24 = name_ref n, %n +// CHECK:STDOUT: %n.ref: %i24.builtin = name_ref n, %n // CHECK:STDOUT: %Symbolic.specific_fn: = specific_function %Symbolic.ref, @Symbolic(constants.%int_24) [template = constants.%Symbolic.specific_fn] -// CHECK:STDOUT: %Symbolic.call: init %i24 = call %Symbolic.specific_fn(%n.ref) -// CHECK:STDOUT: %.loc16_25.1: %i24 = value_of_initializer %Symbolic.call -// CHECK:STDOUT: %.loc16_25.2: %i24 = converted %Symbolic.call, %.loc16_25.1 +// CHECK:STDOUT: %Symbolic.call: init %i24.builtin = call %Symbolic.specific_fn(%n.ref) +// CHECK:STDOUT: %.loc16_25.1: %i24.builtin = value_of_initializer %Symbolic.call +// CHECK:STDOUT: %.loc16_25.2: %i24.builtin = converted %Symbolic.call, %.loc16_25.1 // CHECK:STDOUT: return %.loc16_25.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Symbolic(constants.%N: Core.IntLiteral) [from "use_types.carbon"] { // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] -// CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)] +// CHECK:STDOUT: %iN.builtin: type = int_type signed, %N [symbolic = %iN.builtin (constants.%iN.builtin)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete: = require_complete_type @Symbolic.%iN (%iN) [symbolic = %require_complete (constants.%require_complete)] +// CHECK:STDOUT: %require_complete: = require_complete_type @Symbolic.%iN.builtin (%iN.builtin) [symbolic = %require_complete (constants.%require_complete)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%N.param_patt: Core.IntLiteral, %x.param_patt: @Symbolic.%iN (%iN)) -> @Symbolic.%iN (%iN); +// CHECK:STDOUT: fn(%N.param_patt: Core.IntLiteral, %x.param_patt: @Symbolic.%iN.builtin (%iN.builtin)) -> @Symbolic.%iN.builtin (%iN.builtin); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Symbolic(constants.%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %iN => constants.%iN +// CHECK:STDOUT: %iN.builtin => constants.%iN.builtin // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Symbolic(constants.%int_24) { // CHECK:STDOUT: %N => constants.%int_24 // CHECK:STDOUT: %N.patt => constants.%int_24 -// CHECK:STDOUT: %iN => constants.%i24 +// CHECK:STDOUT: %iN.builtin => constants.%i24.builtin // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete => constants.%complete_type @@ -520,28 +520,26 @@ var m: Int(1000000000); // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type.1: type = fn_type @Int.1 [template] -// CHECK:STDOUT: %Int.1: %Int.type.1 = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] -// CHECK:STDOUT: %Negate.type: type = fn_type @Negate [template] -// CHECK:STDOUT: %Negate: %Negate.type = struct_value () [template] -// CHECK:STDOUT: %Int.type.2: type = fn_type @Int.2 [template] +// CHECK:STDOUT: %i32: type = class_type @Int.2, @Int.2(%int_32) [template] +// CHECK:STDOUT: %Negate.type.1: type = fn_type @Negate.1 [template] +// CHECK:STDOUT: %Negate: %Negate.type.1 = struct_value () [template] +// CHECK:STDOUT: %Int.type.2: type = fn_type @Int.1 [template] // CHECK:STDOUT: %Int.2: %Int.type.2 = struct_value () [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] // CHECK:STDOUT: %int_-1.1: %i32 = int_value -1 [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.4, @impl.3(%int_32) [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %interface.10: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_-1.1, %Convert.15 [template] -// CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.4(%int_32) [template] +// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.3, @impl.2(%int_32) [template] +// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [template] +// CHECK:STDOUT: %interface.6: = interface_witness (%Convert.11) [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_-1.1, %Convert.11 [template] +// CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.3(%int_32) [template] // CHECK:STDOUT: %int_-1.2: Core.IntLiteral = int_value -1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -550,7 +548,7 @@ var m: Int(1000000000); // CHECK:STDOUT: %import_ref.2: %Int.type.2 = import_ref Main//types, Int, loaded [template = constants.%Int.2] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.3 -// CHECK:STDOUT: .ImplicitAs = %import_ref.4 +// CHECK:STDOUT: .ImplicitAs = %import_ref.7 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -566,38 +564,34 @@ var m: Int(1000000000); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %Negate.decl: %Negate.type = fn_decl @Negate [template = constants.%Negate] { +// CHECK:STDOUT: %Negate.decl: %Negate.type.1 = fn_decl @Negate.1 [template = constants.%Negate] { // CHECK:STDOUT: %n.patt: %i32 = binding_pattern n // CHECK:STDOUT: %n.param_patt: %i32 = value_param_pattern %n.patt, runtime_param0 // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc6_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc6_14: init type = call constants.%Int.1(%int_32.loc6_14) [template = constants.%i32] -// CHECK:STDOUT: %.loc6_14.1: type = value_of_initializer %int.make_type_signed.loc6_14 [template = constants.%i32] -// CHECK:STDOUT: %.loc6_14.2: type = converted %int.make_type_signed.loc6_14, %.loc6_14.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc6_14: type = class_type @Int.2, @Int.2(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc6_22: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc6_22: init type = call constants.%Int.1(%int_32.loc6_22) [template = constants.%i32] -// CHECK:STDOUT: %.loc6_22.1: type = value_of_initializer %int.make_type_signed.loc6_22 [template = constants.%i32] -// CHECK:STDOUT: %.loc6_22.2: type = converted %int.make_type_signed.loc6_22, %.loc6_22.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc6_22: type = class_type @Int.2, @Int.2(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %n.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %n: %i32 = bind_name n, %n.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %Int.ref: %Int.type.2 = name_ref Int, imports.%import_ref.2 [template = constants.%Int.2] -// CHECK:STDOUT: %Negate.ref: %Negate.type = name_ref Negate, %Negate.decl [template = constants.%Negate] +// CHECK:STDOUT: %Negate.ref: %Negate.type.1 = name_ref Negate, %Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc12_19: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc12_19: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc12_19: = bound_method %int_1, %impl.elem0.loc12_19 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc12_19: = specific_function %Convert.bound.loc12_19, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc12_19: init %i32 = call %Convert.specific_fn.loc12_19(%int_1) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc12_19.1: %i32 = value_of_initializer %int.convert_checked.loc12_19 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc12_19.2: %i32 = converted %int_1, %.loc12_19.1 [template = constants.%int_1.2] // CHECK:STDOUT: %int.snegate: init %i32 = call %Negate.ref(%.loc12_19.2) [template = constants.%int_-1.1] -// CHECK:STDOUT: %impl.elem0.loc12_20: %Convert.type.6 = interface_witness_access constants.%interface.10, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %impl.elem0.loc12_20: %Convert.type.5 = interface_witness_access constants.%interface.6, element0 [template = constants.%Convert.11] // CHECK:STDOUT: %Convert.bound.loc12_20: = bound_method %int.snegate, %impl.elem0.loc12_20 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc12_20: = specific_function %Convert.bound.loc12_20, @Convert.4(constants.%int_32) [template = constants.%Convert.specific_fn.2] +// CHECK:STDOUT: %Convert.specific_fn.loc12_20: = specific_function %Convert.bound.loc12_20, @Convert.3(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %.loc12_20.1: %i32 = value_of_initializer %int.snegate [template = constants.%int_-1.1] // CHECK:STDOUT: %.loc12_20.2: %i32 = converted %int.snegate, %.loc12_20.1 [template = constants.%int_-1.1] // CHECK:STDOUT: %int.convert_checked.loc12_20: init Core.IntLiteral = call %Convert.specific_fn.loc12_20(%.loc12_20.2) [template = constants.%int_-1.2] @@ -610,9 +604,9 @@ var m: Int(1000000000); // CHECK:STDOUT: %n: ref = bind_name n, %n.var // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Negate(%n.param_patt: %i32) -> %i32 = "int.snegate"; +// CHECK:STDOUT: fn @Negate.1(%n.param_patt: %i32) -> %i32 = "int.snegate"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Int.2(%n.param_patt: Core.IntLiteral) -> type = "int.make_type_signed" [from "types.carbon"]; +// CHECK:STDOUT: fn @Int.1(%n.param_patt: Core.IntLiteral) -> type = "int.make_type_signed" [from "types.carbon"]; // CHECK:STDOUT: // CHECK:STDOUT: --- fail_oversized.carbon // CHECK:STDOUT: diff --git a/toolchain/check/testdata/builtins/int/make_type_unsigned.carbon b/toolchain/check/testdata/builtins/int/make_type_unsigned.carbon index 71f18dc5f50e4..aba3e03aec4c1 100644 --- a/toolchain/check/testdata/builtins/int/make_type_unsigned.carbon +++ b/toolchain/check/testdata/builtins/int/make_type_unsigned.carbon @@ -127,21 +127,21 @@ var m: UInt(1000000000); // CHECK:STDOUT: %UInt.type: type = fn_type @UInt [template] // CHECK:STDOUT: %UInt: %UInt.type = struct_value () [template] // CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [template] -// CHECK:STDOUT: %u64: type = int_type unsigned, %int_64 [template] +// CHECK:STDOUT: %u64.builtin: type = int_type unsigned, %int_64 [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %int_13: Core.IntLiteral = int_value 13 [template] -// CHECK:STDOUT: %u13: type = int_type unsigned, %int_13 [template] +// CHECK:STDOUT: %u13.builtin: type = int_type unsigned, %int_13 [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] // CHECK:STDOUT: %IntLiteral.type: type = fn_type @IntLiteral [template] // CHECK:STDOUT: %IntLiteral: %IntLiteral.type = struct_value () [template] // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic] -// CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic] +// CHECK:STDOUT: %uN.builtin: type = int_type unsigned, %N [symbolic] // CHECK:STDOUT: %Symbolic.type: type = fn_type @Symbolic [template] // CHECK:STDOUT: %Symbolic: %Symbolic.type = struct_value () [template] -// CHECK:STDOUT: %require_complete: = require_complete_type %uN [symbolic] +// CHECK:STDOUT: %require_complete: = require_complete_type %uN.builtin [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -165,54 +165,54 @@ var m: UInt(1000000000); // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %n.patt: %u64 = binding_pattern n -// CHECK:STDOUT: %n.param_patt: %u64 = value_param_pattern %n.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: %u64 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %u64 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %n.patt: %u64.builtin = binding_pattern n +// CHECK:STDOUT: %n.param_patt: %u64.builtin = value_param_pattern %n.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %u64.builtin = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %u64.builtin = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %UInt.ref.loc6_9: %UInt.type = name_ref UInt, imports.%import_ref.2 [template = constants.%UInt] // CHECK:STDOUT: %int_64.loc6_14: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %int.make_type_unsigned.loc6_16: init type = call %UInt.ref.loc6_9(%int_64.loc6_14) [template = constants.%u64] -// CHECK:STDOUT: %.loc6_16.1: type = value_of_initializer %int.make_type_unsigned.loc6_16 [template = constants.%u64] -// CHECK:STDOUT: %.loc6_16.2: type = converted %int.make_type_unsigned.loc6_16, %.loc6_16.1 [template = constants.%u64] +// CHECK:STDOUT: %int.make_type_unsigned.loc6_16: init type = call %UInt.ref.loc6_9(%int_64.loc6_14) [template = constants.%u64.builtin] +// CHECK:STDOUT: %.loc6_16.1: type = value_of_initializer %int.make_type_unsigned.loc6_16 [template = constants.%u64.builtin] +// CHECK:STDOUT: %.loc6_16.2: type = converted %int.make_type_unsigned.loc6_16, %.loc6_16.1 [template = constants.%u64.builtin] // CHECK:STDOUT: %UInt.ref.loc6_22: %UInt.type = name_ref UInt, imports.%import_ref.2 [template = constants.%UInt] // CHECK:STDOUT: %int_64.loc6_27: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %int.make_type_unsigned.loc6_29: init type = call %UInt.ref.loc6_22(%int_64.loc6_27) [template = constants.%u64] -// CHECK:STDOUT: %.loc6_29.1: type = value_of_initializer %int.make_type_unsigned.loc6_29 [template = constants.%u64] -// CHECK:STDOUT: %.loc6_29.2: type = converted %int.make_type_unsigned.loc6_29, %.loc6_29.1 [template = constants.%u64] -// CHECK:STDOUT: %n.param: %u64 = value_param runtime_param0 -// CHECK:STDOUT: %n: %u64 = bind_name n, %n.param -// CHECK:STDOUT: %return.param: ref %u64 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref %u64 = return_slot %return.param +// CHECK:STDOUT: %int.make_type_unsigned.loc6_29: init type = call %UInt.ref.loc6_22(%int_64.loc6_27) [template = constants.%u64.builtin] +// CHECK:STDOUT: %.loc6_29.1: type = value_of_initializer %int.make_type_unsigned.loc6_29 [template = constants.%u64.builtin] +// CHECK:STDOUT: %.loc6_29.2: type = converted %int.make_type_unsigned.loc6_29, %.loc6_29.1 [template = constants.%u64.builtin] +// CHECK:STDOUT: %n.param: %u64.builtin = value_param runtime_param0 +// CHECK:STDOUT: %n: %u64.builtin = bind_name n, %n.param +// CHECK:STDOUT: %return.param: ref %u64.builtin = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %u64.builtin = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { -// CHECK:STDOUT: %n.patt: %u13 = binding_pattern n -// CHECK:STDOUT: %n.param_patt: %u13 = value_param_pattern %n.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: %u13 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %u13 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %n.patt: %u13.builtin = binding_pattern n +// CHECK:STDOUT: %n.param_patt: %u13.builtin = value_param_pattern %n.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %u13.builtin = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %u13.builtin = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %UInt.ref.loc10_9: %UInt.type = name_ref UInt, imports.%import_ref.2 [template = constants.%UInt] // CHECK:STDOUT: %int_13.loc10_14: Core.IntLiteral = int_value 13 [template = constants.%int_13] -// CHECK:STDOUT: %int.make_type_unsigned.loc10_16: init type = call %UInt.ref.loc10_9(%int_13.loc10_14) [template = constants.%u13] -// CHECK:STDOUT: %.loc10_16.1: type = value_of_initializer %int.make_type_unsigned.loc10_16 [template = constants.%u13] -// CHECK:STDOUT: %.loc10_16.2: type = converted %int.make_type_unsigned.loc10_16, %.loc10_16.1 [template = constants.%u13] +// CHECK:STDOUT: %int.make_type_unsigned.loc10_16: init type = call %UInt.ref.loc10_9(%int_13.loc10_14) [template = constants.%u13.builtin] +// CHECK:STDOUT: %.loc10_16.1: type = value_of_initializer %int.make_type_unsigned.loc10_16 [template = constants.%u13.builtin] +// CHECK:STDOUT: %.loc10_16.2: type = converted %int.make_type_unsigned.loc10_16, %.loc10_16.1 [template = constants.%u13.builtin] // CHECK:STDOUT: %UInt.ref.loc10_22: %UInt.type = name_ref UInt, imports.%import_ref.2 [template = constants.%UInt] // CHECK:STDOUT: %int_13.loc10_27: Core.IntLiteral = int_value 13 [template = constants.%int_13] -// CHECK:STDOUT: %int.make_type_unsigned.loc10_29: init type = call %UInt.ref.loc10_22(%int_13.loc10_27) [template = constants.%u13] -// CHECK:STDOUT: %.loc10_29.1: type = value_of_initializer %int.make_type_unsigned.loc10_29 [template = constants.%u13] -// CHECK:STDOUT: %.loc10_29.2: type = converted %int.make_type_unsigned.loc10_29, %.loc10_29.1 [template = constants.%u13] -// CHECK:STDOUT: %n.param: %u13 = value_param runtime_param0 -// CHECK:STDOUT: %n: %u13 = bind_name n, %n.param -// CHECK:STDOUT: %return.param: ref %u13 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref %u13 = return_slot %return.param +// CHECK:STDOUT: %int.make_type_unsigned.loc10_29: init type = call %UInt.ref.loc10_22(%int_13.loc10_27) [template = constants.%u13.builtin] +// CHECK:STDOUT: %.loc10_29.1: type = value_of_initializer %int.make_type_unsigned.loc10_29 [template = constants.%u13.builtin] +// CHECK:STDOUT: %.loc10_29.2: type = converted %int.make_type_unsigned.loc10_29, %.loc10_29.1 [template = constants.%u13.builtin] +// CHECK:STDOUT: %n.param: %u13.builtin = value_param runtime_param0 +// CHECK:STDOUT: %n: %u13.builtin = bind_name n, %n.param +// CHECK:STDOUT: %return.param: ref %u13.builtin = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %u13.builtin = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %Symbolic.decl: %Symbolic.type = fn_decl @Symbolic [template = constants.%Symbolic] { // CHECK:STDOUT: %N.patt.loc14_13.1: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc14_13.2 (constants.%N.patt)] // CHECK:STDOUT: %N.param_patt: Core.IntLiteral = value_param_pattern %N.patt.loc14_13.1, runtime_param [symbolic = %N.patt.loc14_13.2 (constants.%N.patt)] -// CHECK:STDOUT: %x.patt: @Symbolic.%uN (%uN) = binding_pattern x -// CHECK:STDOUT: %x.param_patt: @Symbolic.%uN (%uN) = value_param_pattern %x.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: @Symbolic.%uN (%uN) = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: @Symbolic.%uN (%uN) = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %x.patt: @Symbolic.%uN.builtin (%uN.builtin) = binding_pattern x +// CHECK:STDOUT: %x.param_patt: @Symbolic.%uN.builtin (%uN.builtin) = value_param_pattern %x.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: @Symbolic.%uN.builtin (%uN.builtin) = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: @Symbolic.%uN.builtin (%uN.builtin) = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, imports.%import_ref.1 [template = constants.%IntLiteral] // CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral] @@ -220,34 +220,34 @@ var m: UInt(1000000000); // CHECK:STDOUT: %.loc14_28.2: type = converted %int_literal.make_type, %.loc14_28.1 [template = Core.IntLiteral] // CHECK:STDOUT: %UInt.ref.loc14_34: %UInt.type = name_ref UInt, imports.%import_ref.2 [template = constants.%UInt] // CHECK:STDOUT: %N.ref.loc14_39: Core.IntLiteral = name_ref N, %N.loc14_13.1 [symbolic = %N.loc14_13.2 (constants.%N)] -// CHECK:STDOUT: %int.make_type_unsigned.loc14_40: init type = call %UInt.ref.loc14_34(%N.ref.loc14_39) [symbolic = %uN (constants.%uN)] -// CHECK:STDOUT: %.loc14_40.1: type = value_of_initializer %int.make_type_unsigned.loc14_40 [symbolic = %uN (constants.%uN)] -// CHECK:STDOUT: %.loc14_40.2: type = converted %int.make_type_unsigned.loc14_40, %.loc14_40.1 [symbolic = %uN (constants.%uN)] +// CHECK:STDOUT: %int.make_type_unsigned.loc14_40: init type = call %UInt.ref.loc14_34(%N.ref.loc14_39) [symbolic = %uN.builtin (constants.%uN.builtin)] +// CHECK:STDOUT: %.loc14_40.1: type = value_of_initializer %int.make_type_unsigned.loc14_40 [symbolic = %uN.builtin (constants.%uN.builtin)] +// CHECK:STDOUT: %.loc14_40.2: type = converted %int.make_type_unsigned.loc14_40, %.loc14_40.1 [symbolic = %uN.builtin (constants.%uN.builtin)] // CHECK:STDOUT: %UInt.ref.loc14_46: %UInt.type = name_ref UInt, imports.%import_ref.2 [template = constants.%UInt] // CHECK:STDOUT: %N.ref.loc14_51: Core.IntLiteral = name_ref N, %N.loc14_13.1 [symbolic = %N.loc14_13.2 (constants.%N)] -// CHECK:STDOUT: %int.make_type_unsigned.loc14_52: init type = call %UInt.ref.loc14_46(%N.ref.loc14_51) [symbolic = %uN (constants.%uN)] -// CHECK:STDOUT: %.loc14_52.1: type = value_of_initializer %int.make_type_unsigned.loc14_52 [symbolic = %uN (constants.%uN)] -// CHECK:STDOUT: %.loc14_52.2: type = converted %int.make_type_unsigned.loc14_52, %.loc14_52.1 [symbolic = %uN (constants.%uN)] +// CHECK:STDOUT: %int.make_type_unsigned.loc14_52: init type = call %UInt.ref.loc14_46(%N.ref.loc14_51) [symbolic = %uN.builtin (constants.%uN.builtin)] +// CHECK:STDOUT: %.loc14_52.1: type = value_of_initializer %int.make_type_unsigned.loc14_52 [symbolic = %uN.builtin (constants.%uN.builtin)] +// CHECK:STDOUT: %.loc14_52.2: type = converted %int.make_type_unsigned.loc14_52, %.loc14_52.1 [symbolic = %uN.builtin (constants.%uN.builtin)] // CHECK:STDOUT: %N.param: Core.IntLiteral = value_param runtime_param // CHECK:STDOUT: %N.loc14_13.1: Core.IntLiteral = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc14_13.2 (constants.%N)] -// CHECK:STDOUT: %x.param: @Symbolic.%uN (%uN) = value_param runtime_param0 -// CHECK:STDOUT: %x: @Symbolic.%uN (%uN) = bind_name x, %x.param -// CHECK:STDOUT: %return.param: ref @Symbolic.%uN (%uN) = out_param runtime_param1 -// CHECK:STDOUT: %return: ref @Symbolic.%uN (%uN) = return_slot %return.param +// CHECK:STDOUT: %x.param: @Symbolic.%uN.builtin (%uN.builtin) = value_param runtime_param0 +// CHECK:STDOUT: %x: @Symbolic.%uN.builtin (%uN.builtin) = bind_name x, %x.param +// CHECK:STDOUT: %return.param: ref @Symbolic.%uN.builtin (%uN.builtin) = out_param runtime_param1 +// CHECK:STDOUT: %return: ref @Symbolic.%uN.builtin (%uN.builtin) = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @UInt(%n.param_patt: Core.IntLiteral) -> type = "int.make_type_unsigned" [from "types.carbon"]; // CHECK:STDOUT: -// CHECK:STDOUT: fn @F(%n.param_patt: %u64) -> %u64 { +// CHECK:STDOUT: fn @F(%n.param_patt: %u64.builtin) -> %u64.builtin { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %n.ref: %u64 = name_ref n, %n +// CHECK:STDOUT: %n.ref: %u64.builtin = name_ref n, %n // CHECK:STDOUT: return %n.ref // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @G(%n.param_patt: %u13) -> %u13 { +// CHECK:STDOUT: fn @G(%n.param_patt: %u13.builtin) -> %u13.builtin { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %n.ref: %u13 = name_ref n, %n +// CHECK:STDOUT: %n.ref: %u13.builtin = name_ref n, %n // CHECK:STDOUT: return %n.ref // CHECK:STDOUT: } // CHECK:STDOUT: @@ -256,14 +256,14 @@ var m: UInt(1000000000); // CHECK:STDOUT: generic fn @Symbolic(%N.loc14_13.1: Core.IntLiteral) { // CHECK:STDOUT: %N.loc14_13.2: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N.loc14_13.2 (constants.%N)] // CHECK:STDOUT: %N.patt.loc14_13.2: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc14_13.2 (constants.%N.patt)] -// CHECK:STDOUT: %uN: type = int_type unsigned, %N.loc14_13.2 [symbolic = %uN (constants.%uN)] +// CHECK:STDOUT: %uN.builtin: type = int_type unsigned, %N.loc14_13.2 [symbolic = %uN.builtin (constants.%uN.builtin)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete: = require_complete_type @Symbolic.%uN (%uN) [symbolic = %require_complete (constants.%require_complete)] +// CHECK:STDOUT: %require_complete: = require_complete_type @Symbolic.%uN.builtin (%uN.builtin) [symbolic = %require_complete (constants.%require_complete)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%N.param_patt: Core.IntLiteral, %x.param_patt: @Symbolic.%uN (%uN)) -> @Symbolic.%uN (%uN) { +// CHECK:STDOUT: fn(%N.param_patt: Core.IntLiteral, %x.param_patt: @Symbolic.%uN.builtin (%uN.builtin)) -> @Symbolic.%uN.builtin (%uN.builtin) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %x.ref: @Symbolic.%uN (%uN) = name_ref x, %x +// CHECK:STDOUT: %x.ref: @Symbolic.%uN.builtin (%uN.builtin) = name_ref x, %x // CHECK:STDOUT: return %x.ref // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -271,7 +271,7 @@ var m: UInt(1000000000); // CHECK:STDOUT: specific @Symbolic(constants.%N) { // CHECK:STDOUT: %N.loc14_13.2 => constants.%N // CHECK:STDOUT: %N.patt.loc14_13.2 => constants.%N -// CHECK:STDOUT: %uN => constants.%uN +// CHECK:STDOUT: %uN.builtin => constants.%uN.builtin // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_zero_size.carbon @@ -315,28 +315,26 @@ var m: UInt(1000000000); // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] -// CHECK:STDOUT: %Negate.type: type = fn_type @Negate [template] -// CHECK:STDOUT: %Negate: %Negate.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] +// CHECK:STDOUT: %Negate.type.1: type = fn_type @Negate.1 [template] +// CHECK:STDOUT: %Negate: %Negate.type.1 = struct_value () [template] // CHECK:STDOUT: %UInt.type: type = fn_type @UInt [template] // CHECK:STDOUT: %UInt: %UInt.type = struct_value () [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] // CHECK:STDOUT: %int_-1.1: %i32 = int_value -1 [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.4, @impl.3(%int_32) [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %interface.10: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_-1.1, %Convert.15 [template] -// CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.4(%int_32) [template] +// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.3, @impl.2(%int_32) [template] +// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [template] +// CHECK:STDOUT: %interface.6: = interface_witness (%Convert.11) [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_-1.1, %Convert.11 [template] +// CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.3(%int_32) [template] // CHECK:STDOUT: %int_-1.2: Core.IntLiteral = int_value -1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -345,7 +343,7 @@ var m: UInt(1000000000); // CHECK:STDOUT: %import_ref.2: %UInt.type = import_ref Main//types, UInt, loaded [template = constants.%UInt] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.3 -// CHECK:STDOUT: .ImplicitAs = %import_ref.4 +// CHECK:STDOUT: .ImplicitAs = %import_ref.7 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -361,38 +359,34 @@ var m: UInt(1000000000); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %Negate.decl: %Negate.type = fn_decl @Negate [template = constants.%Negate] { +// CHECK:STDOUT: %Negate.decl: %Negate.type.1 = fn_decl @Negate.1 [template = constants.%Negate] { // CHECK:STDOUT: %n.patt: %i32 = binding_pattern n // CHECK:STDOUT: %n.param_patt: %i32 = value_param_pattern %n.patt, runtime_param0 // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc6_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc6_14: init type = call constants.%Int(%int_32.loc6_14) [template = constants.%i32] -// CHECK:STDOUT: %.loc6_14.1: type = value_of_initializer %int.make_type_signed.loc6_14 [template = constants.%i32] -// CHECK:STDOUT: %.loc6_14.2: type = converted %int.make_type_signed.loc6_14, %.loc6_14.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc6_14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc6_22: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc6_22: init type = call constants.%Int(%int_32.loc6_22) [template = constants.%i32] -// CHECK:STDOUT: %.loc6_22.1: type = value_of_initializer %int.make_type_signed.loc6_22 [template = constants.%i32] -// CHECK:STDOUT: %.loc6_22.2: type = converted %int.make_type_signed.loc6_22, %.loc6_22.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc6_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %n.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %n: %i32 = bind_name n, %n.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %UInt.ref: %UInt.type = name_ref UInt, imports.%import_ref.2 [template = constants.%UInt] -// CHECK:STDOUT: %Negate.ref: %Negate.type = name_ref Negate, %Negate.decl [template = constants.%Negate] +// CHECK:STDOUT: %Negate.ref: %Negate.type.1 = name_ref Negate, %Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc12_20: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc12_20: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc12_20: = bound_method %int_1, %impl.elem0.loc12_20 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc12_20: = specific_function %Convert.bound.loc12_20, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc12_20: init %i32 = call %Convert.specific_fn.loc12_20(%int_1) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc12_20.1: %i32 = value_of_initializer %int.convert_checked.loc12_20 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc12_20.2: %i32 = converted %int_1, %.loc12_20.1 [template = constants.%int_1.2] // CHECK:STDOUT: %int.snegate: init %i32 = call %Negate.ref(%.loc12_20.2) [template = constants.%int_-1.1] -// CHECK:STDOUT: %impl.elem0.loc12_21: %Convert.type.6 = interface_witness_access constants.%interface.10, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %impl.elem0.loc12_21: %Convert.type.5 = interface_witness_access constants.%interface.6, element0 [template = constants.%Convert.11] // CHECK:STDOUT: %Convert.bound.loc12_21: = bound_method %int.snegate, %impl.elem0.loc12_21 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc12_21: = specific_function %Convert.bound.loc12_21, @Convert.4(constants.%int_32) [template = constants.%Convert.specific_fn.2] +// CHECK:STDOUT: %Convert.specific_fn.loc12_21: = specific_function %Convert.bound.loc12_21, @Convert.3(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %.loc12_21.1: %i32 = value_of_initializer %int.snegate [template = constants.%int_-1.1] // CHECK:STDOUT: %.loc12_21.2: %i32 = converted %int.snegate, %.loc12_21.1 [template = constants.%int_-1.1] // CHECK:STDOUT: %int.convert_checked.loc12_21: init Core.IntLiteral = call %Convert.specific_fn.loc12_21(%.loc12_21.2) [template = constants.%int_-1.2] @@ -405,7 +399,7 @@ var m: UInt(1000000000); // CHECK:STDOUT: %n: ref = bind_name n, %n.var // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Negate(%n.param_patt: %i32) -> %i32 = "int.snegate"; +// CHECK:STDOUT: fn @Negate.1(%n.param_patt: %i32) -> %i32 = "int.snegate"; // CHECK:STDOUT: // CHECK:STDOUT: fn @UInt(%n.param_patt: Core.IntLiteral) -> type = "int.make_type_unsigned" [from "types.carbon"]; // CHECK:STDOUT: diff --git a/toolchain/check/testdata/builtins/int/neq.carbon b/toolchain/check/testdata/builtins/int/neq.carbon index 61fde3f19eb2a..d189bd30ca352 100644 --- a/toolchain/check/testdata/builtins/int/neq.carbon +++ b/toolchain/check/testdata/builtins/int/neq.carbon @@ -28,30 +28,28 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %Bool.type: type = fn_type @Bool [template] // CHECK:STDOUT: %Bool: %Bool.type = struct_value () [template] // CHECK:STDOUT: %Neq.type: type = fn_type @Neq [template] // CHECK:STDOUT: %Neq: %Neq.type = struct_value () [template] // CHECK:STDOUT: %True: type = class_type @True [template] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] -// CHECK:STDOUT: %complete_type.1: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %complete_type.3: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %False: type = class_type @False [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] // CHECK:STDOUT: %false: bool = bool_literal false [template] // CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] // CHECK:STDOUT: %true: bool = bool_literal true [template] @@ -62,8 +60,8 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .Bool = %import_ref.2 -// CHECK:STDOUT: .ImplicitAs = %import_ref.3 +// CHECK:STDOUT: .Bool = %import_ref.5 +// CHECK:STDOUT: .ImplicitAs = %import_ref.6 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -88,13 +86,9 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc2_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc2_11: init type = call constants.%Int(%int_32.loc2_11) [template = constants.%i32] -// CHECK:STDOUT: %.loc2_11.1: type = value_of_initializer %int.make_type_signed.loc2_11 [template = constants.%i32] -// CHECK:STDOUT: %.loc2_11.2: type = converted %int.make_type_signed.loc2_11, %.loc2_11.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc2_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc2_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc2_19: init type = call constants.%Int(%int_32.loc2_19) [template = constants.%i32] -// CHECK:STDOUT: %.loc2_19.1: type = value_of_initializer %int.make_type_signed.loc2_19 [template = constants.%i32] -// CHECK:STDOUT: %.loc2_19.2: type = converted %int.make_type_signed.loc2_19, %.loc2_19.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc2_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc2_27.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc2_27.2: type = converted %bool.make_type, %.loc2_27.1 [template = bool] @@ -129,13 +123,9 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc12_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc12_19: init type = call constants.%Int(%int_32.loc12_19) [template = constants.%i32] -// CHECK:STDOUT: %.loc12_19.1: type = value_of_initializer %int.make_type_signed.loc12_19 [template = constants.%i32] -// CHECK:STDOUT: %.loc12_19.2: type = converted %int.make_type_signed.loc12_19, %.loc12_19.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc12_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc12_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc12_27: init type = call constants.%Int(%int_32.loc12_27) [template = constants.%i32] -// CHECK:STDOUT: %.loc12_27.1: type = value_of_initializer %int.make_type_signed.loc12_27 [template = constants.%i32] -// CHECK:STDOUT: %.loc12_27.2: type = converted %int.make_type_signed.loc12_27, %.loc12_27.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc12_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc12_35.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc12_35.2: type = converted %bool.make_type, %.loc12_35.1 [template = bool] @@ -149,7 +139,7 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @True { -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%True @@ -157,7 +147,7 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @False { -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%False @@ -172,13 +162,13 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %Neq.ref.loc8: %Neq.type = name_ref Neq, file.%Neq.decl [template = constants.%Neq] // CHECK:STDOUT: %int_1.loc8_21: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_1.loc8_24: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc8_21: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc8_21: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc8_21: = bound_method %int_1.loc8_21, %impl.elem0.loc8_21 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc8_21: = specific_function %Convert.bound.loc8_21, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc8_21: init %i32 = call %Convert.specific_fn.loc8_21(%int_1.loc8_21) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc8_21.1: %i32 = value_of_initializer %int.convert_checked.loc8_21 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc8_21.2: %i32 = converted %int_1.loc8_21, %.loc8_21.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc8_24: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc8_24: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc8_24: = bound_method %int_1.loc8_24, %impl.elem0.loc8_24 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc8_24: = specific_function %Convert.bound.loc8_24, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc8_24: init %i32 = call %Convert.specific_fn.loc8_24(%int_1.loc8_24) [template = constants.%int_1.2] @@ -203,13 +193,13 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %Neq.ref.loc9: %Neq.type = name_ref Neq, file.%Neq.decl [template = constants.%Neq] // CHECK:STDOUT: %int_1.loc9: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %impl.elem0.loc9_20: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc9_20: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc9_20: = bound_method %int_1.loc9, %impl.elem0.loc9_20 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc9_20: = specific_function %Convert.bound.loc9_20, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc9_20: init %i32 = call %Convert.specific_fn.loc9_20(%int_1.loc9) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc9_20.1: %i32 = value_of_initializer %int.convert_checked.loc9_20 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc9_20.2: %i32 = converted %int_1.loc9, %.loc9_20.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc9_23: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc9_23: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc9_23: = bound_method %int_2, %impl.elem0.loc9_23 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc9_23: = specific_function %Convert.bound.loc9_23, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc9_23: init %i32 = call %Convert.specific_fn.loc9_23(%int_2) [template = constants.%int_2.2] diff --git a/toolchain/check/testdata/builtins/int/or.carbon b/toolchain/check/testdata/builtins/int/or.carbon index 53e4214bdf2f2..760ead62a98e3 100644 --- a/toolchain/check/testdata/builtins/int/or.carbon +++ b/toolchain/check/testdata/builtins/int/or.carbon @@ -23,30 +23,28 @@ fn RuntimeCall(a: i32, b: i32) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %Or.type: type = fn_type @Or [template] // CHECK:STDOUT: %Or: %Or.type = struct_value () [template] // CHECK:STDOUT: %int_12.1: Core.IntLiteral = int_value 12 [template] // CHECK:STDOUT: %int_10.1: Core.IntLiteral = int_value 10 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_12.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_12.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_12.2: %i32 = int_value 12 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_10.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_10.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_10.2: %i32 = int_value 10 [template] // CHECK:STDOUT: %int_14.1: %i32 = int_value 14 [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.4, @impl.3(%int_32) [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %interface.10: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_14.1, %Convert.15 [template] -// CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.4(%int_32) [template] +// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.3, @impl.2(%int_32) [template] +// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [template] +// CHECK:STDOUT: %interface.6: = interface_witness (%Convert.11) [template] +// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_14.1, %Convert.11 [template] +// CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.3(%int_32) [template] // CHECK:STDOUT: %int_14.2: Core.IntLiteral = int_value 14 [template] // CHECK:STDOUT: %array_type: type = array_type %int_14.2, %i32 [template] // CHECK:STDOUT: %ptr: type = ptr_type %array_type [template] @@ -57,7 +55,7 @@ fn RuntimeCall(a: i32, b: i32) -> i32 { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -81,17 +79,11 @@ fn RuntimeCall(a: i32, b: i32) -> i32 { // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc2_10: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc2_10: init type = call constants.%Int(%int_32.loc2_10) [template = constants.%i32] -// CHECK:STDOUT: %.loc2_10.1: type = value_of_initializer %int.make_type_signed.loc2_10 [template = constants.%i32] -// CHECK:STDOUT: %.loc2_10.2: type = converted %int.make_type_signed.loc2_10, %.loc2_10.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc2_10: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc2_18: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc2_18: init type = call constants.%Int(%int_32.loc2_18) [template = constants.%i32] -// CHECK:STDOUT: %.loc2_18.1: type = value_of_initializer %int.make_type_signed.loc2_18 [template = constants.%i32] -// CHECK:STDOUT: %.loc2_18.2: type = converted %int.make_type_signed.loc2_18, %.loc2_18.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc2_18: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc2_26: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc2_26: init type = call constants.%Int(%int_32.loc2_26) [template = constants.%i32] -// CHECK:STDOUT: %.loc2_26.1: type = value_of_initializer %int.make_type_signed.loc2_26 [template = constants.%i32] -// CHECK:STDOUT: %.loc2_26.2: type = converted %int.make_type_signed.loc2_26, %.loc2_26.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc2_26: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 @@ -100,28 +92,26 @@ fn RuntimeCall(a: i32, b: i32) -> i32 { // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %int_32.loc4: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc4: init type = call constants.%Int(%int_32.loc4) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc4: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %Or.ref: %Or.type = name_ref Or, %Or.decl [template = constants.%Or] // CHECK:STDOUT: %int_12: Core.IntLiteral = int_value 12 [template = constants.%int_12.1] // CHECK:STDOUT: %int_10: Core.IntLiteral = int_value 10 [template = constants.%int_10.1] -// CHECK:STDOUT: %impl.elem0.loc4_19: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc4_19: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc4_19: = bound_method %int_12, %impl.elem0.loc4_19 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc4_19: = specific_function %Convert.bound.loc4_19, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc4_19: init %i32 = call %Convert.specific_fn.loc4_19(%int_12) [template = constants.%int_12.2] // CHECK:STDOUT: %.loc4_19.1: %i32 = value_of_initializer %int.convert_checked.loc4_19 [template = constants.%int_12.2] // CHECK:STDOUT: %.loc4_19.2: %i32 = converted %int_12, %.loc4_19.1 [template = constants.%int_12.2] -// CHECK:STDOUT: %impl.elem0.loc4_23: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc4_23: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc4_23: = bound_method %int_10, %impl.elem0.loc4_23 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc4_23: = specific_function %Convert.bound.loc4_23, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc4_23: init %i32 = call %Convert.specific_fn.loc4_23(%int_10) [template = constants.%int_10.2] // CHECK:STDOUT: %.loc4_23.1: %i32 = value_of_initializer %int.convert_checked.loc4_23 [template = constants.%int_10.2] // CHECK:STDOUT: %.loc4_23.2: %i32 = converted %int_10, %.loc4_23.1 [template = constants.%int_10.2] // CHECK:STDOUT: %int.or: init %i32 = call %Or.ref(%.loc4_19.2, %.loc4_23.2) [template = constants.%int_14.1] -// CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_signed.loc4 [template = constants.%i32] -// CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_signed.loc4, %.loc4_11.1 [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc4_25: %Convert.type.6 = interface_witness_access constants.%interface.10, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %impl.elem0.loc4_25: %Convert.type.5 = interface_witness_access constants.%interface.6, element0 [template = constants.%Convert.11] // CHECK:STDOUT: %Convert.bound.loc4_25: = bound_method %int.or, %impl.elem0.loc4_25 [template = constants.%Convert.bound.3] -// CHECK:STDOUT: %Convert.specific_fn.loc4_25: = specific_function %Convert.bound.loc4_25, @Convert.4(constants.%int_32) [template = constants.%Convert.specific_fn.3] +// CHECK:STDOUT: %Convert.specific_fn.loc4_25: = specific_function %Convert.bound.loc4_25, @Convert.3(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %.loc4_25.1: %i32 = value_of_initializer %int.or [template = constants.%int_14.1] // CHECK:STDOUT: %.loc4_25.2: %i32 = converted %int.or, %.loc4_25.1 [template = constants.%int_14.1] // CHECK:STDOUT: %int.convert_checked.loc4_25: init Core.IntLiteral = call %Convert.specific_fn.loc4_25(%.loc4_25.2) [template = constants.%int_14.2] @@ -131,10 +121,8 @@ fn RuntimeCall(a: i32, b: i32) -> i32 { // CHECK:STDOUT: %arr.var: ref %array_type = var arr // CHECK:STDOUT: %arr: ref %array_type = bind_name arr, %arr.var // CHECK:STDOUT: %int_32.loc5: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc5: init type = call constants.%Int(%int_32.loc5) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc5: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_14: Core.IntLiteral = int_value 14 [template = constants.%int_14.2] -// CHECK:STDOUT: %.loc5_13.1: type = value_of_initializer %int.make_type_signed.loc5 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_13.2: type = converted %int.make_type_signed.loc5, %.loc5_13.1 [template = constants.%i32] // CHECK:STDOUT: %array_type.loc5: type = array_type %int_14, %i32 [template = constants.%array_type] // CHECK:STDOUT: %ptr: type = ptr_type %array_type [template = constants.%ptr] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { @@ -146,17 +134,11 @@ fn RuntimeCall(a: i32, b: i32) -> i32 { // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc7_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc7_19: init type = call constants.%Int(%int_32.loc7_19) [template = constants.%i32] -// CHECK:STDOUT: %.loc7_19.1: type = value_of_initializer %int.make_type_signed.loc7_19 [template = constants.%i32] -// CHECK:STDOUT: %.loc7_19.2: type = converted %int.make_type_signed.loc7_19, %.loc7_19.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc7_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc7_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc7_27: init type = call constants.%Int(%int_32.loc7_27) [template = constants.%i32] -// CHECK:STDOUT: %.loc7_27.1: type = value_of_initializer %int.make_type_signed.loc7_27 [template = constants.%i32] -// CHECK:STDOUT: %.loc7_27.2: type = converted %int.make_type_signed.loc7_27, %.loc7_27.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc7_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc7_35: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc7_35: init type = call constants.%Int(%int_32.loc7_35) [template = constants.%i32] -// CHECK:STDOUT: %.loc7_35.1: type = value_of_initializer %int.make_type_signed.loc7_35 [template = constants.%i32] -// CHECK:STDOUT: %.loc7_35.2: type = converted %int.make_type_signed.loc7_35, %.loc7_35.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc7_35: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 diff --git a/toolchain/check/testdata/builtins/int/right_shift.carbon b/toolchain/check/testdata/builtins/int/right_shift.carbon index b2b06e1c04e52..654ed666db699 100644 --- a/toolchain/check/testdata/builtins/int/right_shift.carbon +++ b/toolchain/check/testdata/builtins/int/right_shift.carbon @@ -68,30 +68,28 @@ let negative: i32 = RightShift(1, Negate(1)); // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] -// CHECK:STDOUT: %RightShift.type: type = fn_type @RightShift [template] -// CHECK:STDOUT: %RightShift: %RightShift.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] +// CHECK:STDOUT: %RightShift.type.1: type = fn_type @RightShift.1 [template] +// CHECK:STDOUT: %RightShift: %RightShift.type.1 = struct_value () [template] // CHECK:STDOUT: %int_22.1: Core.IntLiteral = int_value 22 [template] // CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_22.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_22.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_22.2: %i32 = int_value 22 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] // CHECK:STDOUT: %int_5.1: %i32 = int_value 5 [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.4, @impl.3(%int_32) [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %interface.10: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_5.1, %Convert.15 [template] -// CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.4(%int_32) [template] +// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.3, @impl.2(%int_32) [template] +// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [template] +// CHECK:STDOUT: %interface.6: = interface_witness (%Convert.11) [template] +// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_5.1, %Convert.11 [template] +// CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.3(%int_32) [template] // CHECK:STDOUT: %int_5.2: Core.IntLiteral = int_value 5 [template] // CHECK:STDOUT: %array_type: type = array_type %int_5.2, %i32 [template] // CHECK:STDOUT: %ptr: type = ptr_type %array_type [template] @@ -102,7 +100,7 @@ let negative: i32 = RightShift(1, Negate(1)); // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -117,7 +115,7 @@ let negative: i32 = RightShift(1, Negate(1)); // CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %RightShift.decl: %RightShift.type = fn_decl @RightShift [template = constants.%RightShift] { +// CHECK:STDOUT: %RightShift.decl: %RightShift.type.1 = fn_decl @RightShift.1 [template = constants.%RightShift] { // CHECK:STDOUT: %a.patt: %i32 = binding_pattern a // CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: %i32 = binding_pattern b @@ -126,17 +124,11 @@ let negative: i32 = RightShift(1, Negate(1)); // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc2_18: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc2_18: init type = call constants.%Int(%int_32.loc2_18) [template = constants.%i32] -// CHECK:STDOUT: %.loc2_18.1: type = value_of_initializer %int.make_type_signed.loc2_18 [template = constants.%i32] -// CHECK:STDOUT: %.loc2_18.2: type = converted %int.make_type_signed.loc2_18, %.loc2_18.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc2_18: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc2_26: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc2_26: init type = call constants.%Int(%int_32.loc2_26) [template = constants.%i32] -// CHECK:STDOUT: %.loc2_26.1: type = value_of_initializer %int.make_type_signed.loc2_26 [template = constants.%i32] -// CHECK:STDOUT: %.loc2_26.2: type = converted %int.make_type_signed.loc2_26, %.loc2_26.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc2_26: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc2_34: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc2_34: init type = call constants.%Int(%int_32.loc2_34) [template = constants.%i32] -// CHECK:STDOUT: %.loc2_34.1: type = value_of_initializer %int.make_type_signed.loc2_34 [template = constants.%i32] -// CHECK:STDOUT: %.loc2_34.2: type = converted %int.make_type_signed.loc2_34, %.loc2_34.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc2_34: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 @@ -145,28 +137,26 @@ let negative: i32 = RightShift(1, Negate(1)); // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %int_32.loc4: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc4: init type = call constants.%Int(%int_32.loc4) [template = constants.%i32] -// CHECK:STDOUT: %RightShift.ref: %RightShift.type = name_ref RightShift, %RightShift.decl [template = constants.%RightShift] +// CHECK:STDOUT: %i32.loc4: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %RightShift.ref: %RightShift.type.1 = name_ref RightShift, %RightShift.decl [template = constants.%RightShift] // CHECK:STDOUT: %int_22: Core.IntLiteral = int_value 22 [template = constants.%int_22.1] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %impl.elem0.loc4_27: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc4_27: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc4_27: = bound_method %int_22, %impl.elem0.loc4_27 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc4_27: = specific_function %Convert.bound.loc4_27, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc4_27: init %i32 = call %Convert.specific_fn.loc4_27(%int_22) [template = constants.%int_22.2] // CHECK:STDOUT: %.loc4_27.1: %i32 = value_of_initializer %int.convert_checked.loc4_27 [template = constants.%int_22.2] // CHECK:STDOUT: %.loc4_27.2: %i32 = converted %int_22, %.loc4_27.1 [template = constants.%int_22.2] -// CHECK:STDOUT: %impl.elem0.loc4_31: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc4_31: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc4_31: = bound_method %int_2, %impl.elem0.loc4_31 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc4_31: = specific_function %Convert.bound.loc4_31, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc4_31: init %i32 = call %Convert.specific_fn.loc4_31(%int_2) [template = constants.%int_2.2] // CHECK:STDOUT: %.loc4_31.1: %i32 = value_of_initializer %int.convert_checked.loc4_31 [template = constants.%int_2.2] // CHECK:STDOUT: %.loc4_31.2: %i32 = converted %int_2, %.loc4_31.1 [template = constants.%int_2.2] // CHECK:STDOUT: %int.right_shift: init %i32 = call %RightShift.ref(%.loc4_27.2, %.loc4_31.2) [template = constants.%int_5.1] -// CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_signed.loc4 [template = constants.%i32] -// CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_signed.loc4, %.loc4_11.1 [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc4_32: %Convert.type.6 = interface_witness_access constants.%interface.10, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %impl.elem0.loc4_32: %Convert.type.5 = interface_witness_access constants.%interface.6, element0 [template = constants.%Convert.11] // CHECK:STDOUT: %Convert.bound.loc4_32: = bound_method %int.right_shift, %impl.elem0.loc4_32 [template = constants.%Convert.bound.3] -// CHECK:STDOUT: %Convert.specific_fn.loc4_32: = specific_function %Convert.bound.loc4_32, @Convert.4(constants.%int_32) [template = constants.%Convert.specific_fn.3] +// CHECK:STDOUT: %Convert.specific_fn.loc4_32: = specific_function %Convert.bound.loc4_32, @Convert.3(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %.loc4_32.1: %i32 = value_of_initializer %int.right_shift [template = constants.%int_5.1] // CHECK:STDOUT: %.loc4_32.2: %i32 = converted %int.right_shift, %.loc4_32.1 [template = constants.%int_5.1] // CHECK:STDOUT: %int.convert_checked.loc4_32: init Core.IntLiteral = call %Convert.specific_fn.loc4_32(%.loc4_32.2) [template = constants.%int_5.2] @@ -176,10 +166,8 @@ let negative: i32 = RightShift(1, Negate(1)); // CHECK:STDOUT: %arr.var: ref %array_type = var arr // CHECK:STDOUT: %arr: ref %array_type = bind_name arr, %arr.var // CHECK:STDOUT: %int_32.loc5: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc5: init type = call constants.%Int(%int_32.loc5) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc5: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_5: Core.IntLiteral = int_value 5 [template = constants.%int_5.2] -// CHECK:STDOUT: %.loc5_13.1: type = value_of_initializer %int.make_type_signed.loc5 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_13.2: type = converted %int.make_type_signed.loc5, %.loc5_13.1 [template = constants.%i32] // CHECK:STDOUT: %array_type.loc5: type = array_type %int_5, %i32 [template = constants.%array_type] // CHECK:STDOUT: %ptr: type = ptr_type %array_type [template = constants.%ptr] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { @@ -191,17 +179,11 @@ let negative: i32 = RightShift(1, Negate(1)); // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc7_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc7_19: init type = call constants.%Int(%int_32.loc7_19) [template = constants.%i32] -// CHECK:STDOUT: %.loc7_19.1: type = value_of_initializer %int.make_type_signed.loc7_19 [template = constants.%i32] -// CHECK:STDOUT: %.loc7_19.2: type = converted %int.make_type_signed.loc7_19, %.loc7_19.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc7_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc7_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc7_27: init type = call constants.%Int(%int_32.loc7_27) [template = constants.%i32] -// CHECK:STDOUT: %.loc7_27.1: type = value_of_initializer %int.make_type_signed.loc7_27 [template = constants.%i32] -// CHECK:STDOUT: %.loc7_27.2: type = converted %int.make_type_signed.loc7_27, %.loc7_27.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc7_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc7_35: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc7_35: init type = call constants.%Int(%int_32.loc7_35) [template = constants.%i32] -// CHECK:STDOUT: %.loc7_35.1: type = value_of_initializer %int.make_type_signed.loc7_35 [template = constants.%i32] -// CHECK:STDOUT: %.loc7_35.2: type = converted %int.make_type_signed.loc7_35, %.loc7_35.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc7_35: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 @@ -211,11 +193,11 @@ let negative: i32 = RightShift(1, Negate(1)); // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @RightShift(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.right_shift"; +// CHECK:STDOUT: fn @RightShift.1(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.right_shift"; // CHECK:STDOUT: // CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %RightShift.ref: %RightShift.type = name_ref RightShift, file.%RightShift.decl [template = constants.%RightShift] +// CHECK:STDOUT: %RightShift.ref: %RightShift.type.1 = name_ref RightShift, file.%RightShift.decl [template = constants.%RightShift] // CHECK:STDOUT: %a.ref: %i32 = name_ref a, %a // CHECK:STDOUT: %b.ref: %i32 = name_ref b, %b // CHECK:STDOUT: %int.right_shift: init %i32 = call %RightShift.ref(%a.ref, %b.ref) @@ -236,43 +218,41 @@ let negative: i32 = RightShift(1, Negate(1)); // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] -// CHECK:STDOUT: %RightShift.type: type = fn_type @RightShift [template] -// CHECK:STDOUT: %RightShift: %RightShift.type = struct_value () [template] -// CHECK:STDOUT: %Negate.type: type = fn_type @Negate [template] -// CHECK:STDOUT: %Negate: %Negate.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] +// CHECK:STDOUT: %RightShift.type.1: type = fn_type @RightShift.1 [template] +// CHECK:STDOUT: %RightShift: %RightShift.type.1 = struct_value () [template] +// CHECK:STDOUT: %Negate.type.1: type = fn_type @Negate.1 [template] +// CHECK:STDOUT: %Negate: %Negate.type.1 = struct_value () [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] // CHECK:STDOUT: %int_-1: %i32 = int_value -1 [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.4, @impl.3(%int_32) [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %interface.10: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_1.2, %Convert.15 [template] -// CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.4(%int_32) [template] +// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.3, @impl.2(%int_32) [template] +// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [template] +// CHECK:STDOUT: %interface.6: = interface_witness (%Convert.11) [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_1.2, %Convert.11 [template] +// CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.3(%int_32) [template] // CHECK:STDOUT: %array_type.1: type = array_type %int_1.1, %i32 [template] // CHECK:STDOUT: %ptr.1: type = ptr_type %array_type.1 [template] // CHECK:STDOUT: %int_10.1: Core.IntLiteral = int_value 10 [template] -// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_10.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_10.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_10.2: %i32 = int_value 10 [template] // CHECK:STDOUT: %int_-10: %i32 = int_value -10 [template] // CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %Convert.bound.4: = bound_method %int_2.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.4: = bound_method %int_2.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.4: = specific_function %Convert.bound.4, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] // CHECK:STDOUT: %int_-3: %i32 = int_value -3 [template] // CHECK:STDOUT: %int_3.1: %i32 = int_value 3 [template] -// CHECK:STDOUT: %Convert.bound.5: = bound_method %int_3.1, %Convert.15 [template] -// CHECK:STDOUT: %Convert.specific_fn.5: = specific_function %Convert.bound.5, @Convert.4(%int_32) [template] +// CHECK:STDOUT: %Convert.bound.5: = bound_method %int_3.1, %Convert.11 [template] +// CHECK:STDOUT: %Convert.specific_fn.5: = specific_function %Convert.bound.5, @Convert.3(%int_32) [template] // CHECK:STDOUT: %int_3.2: Core.IntLiteral = int_value 3 [template] // CHECK:STDOUT: %array_type.2: type = array_type %int_3.2, %i32 [template] // CHECK:STDOUT: %ptr.2: type = ptr_type %array_type.2 [template] @@ -281,7 +261,7 @@ let negative: i32 = RightShift(1, Negate(1)); // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -298,7 +278,7 @@ let negative: i32 = RightShift(1, Negate(1)); // CHECK:STDOUT: .arr2_p = @__global_init.%arr2_p // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %RightShift.decl: %RightShift.type = fn_decl @RightShift [template = constants.%RightShift] { +// CHECK:STDOUT: %RightShift.decl: %RightShift.type.1 = fn_decl @RightShift.1 [template = constants.%RightShift] { // CHECK:STDOUT: %a.patt: %i32 = binding_pattern a // CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: %i32 = binding_pattern b @@ -307,17 +287,11 @@ let negative: i32 = RightShift(1, Negate(1)); // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc6_18: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc6_18: init type = call constants.%Int(%int_32.loc6_18) [template = constants.%i32] -// CHECK:STDOUT: %.loc6_18.1: type = value_of_initializer %int.make_type_signed.loc6_18 [template = constants.%i32] -// CHECK:STDOUT: %.loc6_18.2: type = converted %int.make_type_signed.loc6_18, %.loc6_18.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc6_18: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc6_26: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc6_26: init type = call constants.%Int(%int_32.loc6_26) [template = constants.%i32] -// CHECK:STDOUT: %.loc6_26.1: type = value_of_initializer %int.make_type_signed.loc6_26 [template = constants.%i32] -// CHECK:STDOUT: %.loc6_26.2: type = converted %int.make_type_signed.loc6_26, %.loc6_26.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc6_26: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc6_34: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc6_34: init type = call constants.%Int(%int_32.loc6_34) [template = constants.%i32] -// CHECK:STDOUT: %.loc6_34.1: type = value_of_initializer %int.make_type_signed.loc6_34 [template = constants.%i32] -// CHECK:STDOUT: %.loc6_34.2: type = converted %int.make_type_signed.loc6_34, %.loc6_34.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc6_34: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 @@ -325,32 +299,28 @@ let negative: i32 = RightShift(1, Negate(1)); // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %Negate.decl: %Negate.type = fn_decl @Negate [template = constants.%Negate] { +// CHECK:STDOUT: %Negate.decl: %Negate.type.1 = fn_decl @Negate.1 [template = constants.%Negate] { // CHECK:STDOUT: %a.patt: %i32 = binding_pattern a // CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc7_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc7_14: init type = call constants.%Int(%int_32.loc7_14) [template = constants.%i32] -// CHECK:STDOUT: %.loc7_14.1: type = value_of_initializer %int.make_type_signed.loc7_14 [template = constants.%i32] -// CHECK:STDOUT: %.loc7_14.2: type = converted %int.make_type_signed.loc7_14, %.loc7_14.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc7_14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc7_22: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc7_22: init type = call constants.%Int(%int_32.loc7_22) [template = constants.%i32] -// CHECK:STDOUT: %.loc7_22.1: type = value_of_initializer %int.make_type_signed.loc7_22 [template = constants.%i32] -// CHECK:STDOUT: %.loc7_22.2: type = converted %int.make_type_signed.loc7_22, %.loc7_22.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc7_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %int_32.loc10: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc10: init type = call constants.%Int(%int_32.loc10) [template = constants.%i32] -// CHECK:STDOUT: %Negate.ref.loc10_17: %Negate.type = name_ref Negate, %Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %RightShift.ref.loc10: %RightShift.type = name_ref RightShift, %RightShift.decl [template = constants.%RightShift] -// CHECK:STDOUT: %Negate.ref.loc10_35: %Negate.type = name_ref Negate, %Negate.decl [template = constants.%Negate] +// CHECK:STDOUT: %i32.loc10: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %Negate.ref.loc10_17: %Negate.type.1 = name_ref Negate, %Negate.decl [template = constants.%Negate] +// CHECK:STDOUT: %RightShift.ref.loc10: %RightShift.type.1 = name_ref RightShift, %RightShift.decl [template = constants.%RightShift] +// CHECK:STDOUT: %Negate.ref.loc10_35: %Negate.type.1 = name_ref Negate, %Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %int_1.loc10_42: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc10_42: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc10_42: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc10_42: = bound_method %int_1.loc10_42, %impl.elem0.loc10_42 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc10_42: = specific_function %Convert.bound.loc10_42, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc10_42: init %i32 = call %Convert.specific_fn.loc10_42(%int_1.loc10_42) [template = constants.%int_1.2] @@ -360,7 +330,7 @@ let negative: i32 = RightShift(1, Negate(1)); // CHECK:STDOUT: %int_1.loc10_46: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %.loc10_43.1: %i32 = value_of_initializer %int.snegate.loc10_43 [template = constants.%int_-1] // CHECK:STDOUT: %.loc10_43.2: %i32 = converted %int.snegate.loc10_43, %.loc10_43.1 [template = constants.%int_-1] -// CHECK:STDOUT: %impl.elem0.loc10_46: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc10_46: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc10_46: = bound_method %int_1.loc10_46, %impl.elem0.loc10_46 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc10_46: = specific_function %Convert.bound.loc10_46, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc10_46: init %i32 = call %Convert.specific_fn.loc10_46(%int_1.loc10_46) [template = constants.%int_1.2] @@ -370,11 +340,9 @@ let negative: i32 = RightShift(1, Negate(1)); // CHECK:STDOUT: %.loc10_47.1: %i32 = value_of_initializer %int.right_shift.loc10 [template = constants.%int_-1] // CHECK:STDOUT: %.loc10_47.2: %i32 = converted %int.right_shift.loc10, %.loc10_47.1 [template = constants.%int_-1] // CHECK:STDOUT: %int.snegate.loc10_48: init %i32 = call %Negate.ref.loc10_17(%.loc10_47.2) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc10_12.1: type = value_of_initializer %int.make_type_signed.loc10 [template = constants.%i32] -// CHECK:STDOUT: %.loc10_12.2: type = converted %int.make_type_signed.loc10, %.loc10_12.1 [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc10_48: %Convert.type.6 = interface_witness_access constants.%interface.10, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %impl.elem0.loc10_48: %Convert.type.5 = interface_witness_access constants.%interface.6, element0 [template = constants.%Convert.11] // CHECK:STDOUT: %Convert.bound.loc10_48: = bound_method %int.snegate.loc10_48, %impl.elem0.loc10_48 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc10_48: = specific_function %Convert.bound.loc10_48, @Convert.4(constants.%int_32) [template = constants.%Convert.specific_fn.2] +// CHECK:STDOUT: %Convert.specific_fn.loc10_48: = specific_function %Convert.bound.loc10_48, @Convert.3(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %.loc10_48.1: %i32 = value_of_initializer %int.snegate.loc10_48 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc10_48.2: %i32 = converted %int.snegate.loc10_48, %.loc10_48.1 [template = constants.%int_1.2] // CHECK:STDOUT: %int.convert_checked.loc10_48: init Core.IntLiteral = call %Convert.specific_fn.loc10_48(%.loc10_48.2) [template = constants.%int_1.1] @@ -384,19 +352,17 @@ let negative: i32 = RightShift(1, Negate(1)); // CHECK:STDOUT: %arr1.var: ref %array_type.1 = var arr1 // CHECK:STDOUT: %arr1: ref %array_type.1 = bind_name arr1, %arr1.var // CHECK:STDOUT: %int_32.loc11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11: init type = call constants.%Int(%int_32.loc11) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_1.loc11: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %.loc11_14.1: type = value_of_initializer %int.make_type_signed.loc11 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_14.2: type = converted %int.make_type_signed.loc11, %.loc11_14.1 [template = constants.%i32] // CHECK:STDOUT: %array_type.loc11: type = array_type %int_1.loc11, %i32 [template = constants.%array_type.1] // CHECK:STDOUT: %ptr.loc11: type = ptr_type %array_type.1 [template = constants.%ptr.1] // CHECK:STDOUT: %int_32.loc14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc14: init type = call constants.%Int(%int_32.loc14) [template = constants.%i32] -// CHECK:STDOUT: %Negate.ref.loc14_17: %Negate.type = name_ref Negate, %Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %RightShift.ref.loc14: %RightShift.type = name_ref RightShift, %RightShift.decl [template = constants.%RightShift] -// CHECK:STDOUT: %Negate.ref.loc14_35: %Negate.type = name_ref Negate, %Negate.decl [template = constants.%Negate] +// CHECK:STDOUT: %i32.loc14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %Negate.ref.loc14_17: %Negate.type.1 = name_ref Negate, %Negate.decl [template = constants.%Negate] +// CHECK:STDOUT: %RightShift.ref.loc14: %RightShift.type.1 = name_ref RightShift, %RightShift.decl [template = constants.%RightShift] +// CHECK:STDOUT: %Negate.ref.loc14_35: %Negate.type.1 = name_ref Negate, %Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %int_10: Core.IntLiteral = int_value 10 [template = constants.%int_10.1] -// CHECK:STDOUT: %impl.elem0.loc14_42: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc14_42: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc14_42: = bound_method %int_10, %impl.elem0.loc14_42 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc14_42: = specific_function %Convert.bound.loc14_42, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc14_42: init %i32 = call %Convert.specific_fn.loc14_42(%int_10) [template = constants.%int_10.2] @@ -406,7 +372,7 @@ let negative: i32 = RightShift(1, Negate(1)); // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %.loc14_44.1: %i32 = value_of_initializer %int.snegate.loc14_44 [template = constants.%int_-10] // CHECK:STDOUT: %.loc14_44.2: %i32 = converted %int.snegate.loc14_44, %.loc14_44.1 [template = constants.%int_-10] -// CHECK:STDOUT: %impl.elem0.loc14_47: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc14_47: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc14_47: = bound_method %int_2, %impl.elem0.loc14_47 [template = constants.%Convert.bound.4] // CHECK:STDOUT: %Convert.specific_fn.loc14_47: = specific_function %Convert.bound.loc14_47, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.4] // CHECK:STDOUT: %int.convert_checked.loc14_47: init %i32 = call %Convert.specific_fn.loc14_47(%int_2) [template = constants.%int_2.2] @@ -416,11 +382,9 @@ let negative: i32 = RightShift(1, Negate(1)); // CHECK:STDOUT: %.loc14_48.1: %i32 = value_of_initializer %int.right_shift.loc14 [template = constants.%int_-3] // CHECK:STDOUT: %.loc14_48.2: %i32 = converted %int.right_shift.loc14, %.loc14_48.1 [template = constants.%int_-3] // CHECK:STDOUT: %int.snegate.loc14_49: init %i32 = call %Negate.ref.loc14_17(%.loc14_48.2) [template = constants.%int_3.1] -// CHECK:STDOUT: %.loc14_12.1: type = value_of_initializer %int.make_type_signed.loc14 [template = constants.%i32] -// CHECK:STDOUT: %.loc14_12.2: type = converted %int.make_type_signed.loc14, %.loc14_12.1 [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc14_49: %Convert.type.6 = interface_witness_access constants.%interface.10, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %impl.elem0.loc14_49: %Convert.type.5 = interface_witness_access constants.%interface.6, element0 [template = constants.%Convert.11] // CHECK:STDOUT: %Convert.bound.loc14_49: = bound_method %int.snegate.loc14_49, %impl.elem0.loc14_49 [template = constants.%Convert.bound.5] -// CHECK:STDOUT: %Convert.specific_fn.loc14_49: = specific_function %Convert.bound.loc14_49, @Convert.4(constants.%int_32) [template = constants.%Convert.specific_fn.5] +// CHECK:STDOUT: %Convert.specific_fn.loc14_49: = specific_function %Convert.bound.loc14_49, @Convert.3(constants.%int_32) [template = constants.%Convert.specific_fn.5] // CHECK:STDOUT: %.loc14_49.1: %i32 = value_of_initializer %int.snegate.loc14_49 [template = constants.%int_3.1] // CHECK:STDOUT: %.loc14_49.2: %i32 = converted %int.snegate.loc14_49, %.loc14_49.1 [template = constants.%int_3.1] // CHECK:STDOUT: %int.convert_checked.loc14_49: init Core.IntLiteral = call %Convert.specific_fn.loc14_49(%.loc14_49.2) [template = constants.%int_3.2] @@ -430,17 +394,15 @@ let negative: i32 = RightShift(1, Negate(1)); // CHECK:STDOUT: %arr2.var: ref %array_type.2 = var arr2 // CHECK:STDOUT: %arr2: ref %array_type.2 = bind_name arr2, %arr2.var // CHECK:STDOUT: %int_32.loc15: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc15: init type = call constants.%Int(%int_32.loc15) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc15: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3.2] -// CHECK:STDOUT: %.loc15_14.1: type = value_of_initializer %int.make_type_signed.loc15 [template = constants.%i32] -// CHECK:STDOUT: %.loc15_14.2: type = converted %int.make_type_signed.loc15, %.loc15_14.1 [template = constants.%i32] // CHECK:STDOUT: %array_type.loc15: type = array_type %int_3, %i32 [template = constants.%array_type.2] // CHECK:STDOUT: %ptr.loc15: type = ptr_type %array_type.2 [template = constants.%ptr.2] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @RightShift(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.right_shift"; +// CHECK:STDOUT: fn @RightShift.1(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.right_shift"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Negate(%a.param_patt: %i32) -> %i32 = "int.snegate"; +// CHECK:STDOUT: fn @Negate.1(%a.param_patt: %i32) -> %i32 = "int.snegate"; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: @@ -457,31 +419,29 @@ let negative: i32 = RightShift(1, Negate(1)); // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32.1: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32.1 [template] -// CHECK:STDOUT: %RightShift.type: type = fn_type @RightShift [template] -// CHECK:STDOUT: %RightShift: %RightShift.type = struct_value () [template] -// CHECK:STDOUT: %Negate.type: type = fn_type @Negate [template] -// CHECK:STDOUT: %Negate: %Negate.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32.1) [template] +// CHECK:STDOUT: %RightShift.type.1: type = fn_type @RightShift.1 [template] +// CHECK:STDOUT: %RightShift: %RightShift.type.1 = struct_value () [template] +// CHECK:STDOUT: %Negate.type.1: type = fn_type @Negate.1 [template] +// CHECK:STDOUT: %Negate: %Negate.type.1 = struct_value () [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %int_31.1: Core.IntLiteral = int_value 31 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32.1) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32.1) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32.1) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_31.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_31.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32.1) [template] // CHECK:STDOUT: %int_31.2: %i32 = int_value 31 [template] // CHECK:STDOUT: %int_0: %i32 = int_value 0 [template] -// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_32.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_32.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.2(%int_32.1) [template] // CHECK:STDOUT: %int_32.2: %i32 = int_value 32 [template] // CHECK:STDOUT: %int_33.1: Core.IntLiteral = int_value 33 [template] -// CHECK:STDOUT: %Convert.bound.4: = bound_method %int_33.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.4: = bound_method %int_33.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.4: = specific_function %Convert.bound.4, @Convert.2(%int_32.1) [template] // CHECK:STDOUT: %int_33.2: %i32 = int_value 33 [template] // CHECK:STDOUT: %int_-1: %i32 = int_value -1 [template] @@ -490,7 +450,7 @@ let negative: i32 = RightShift(1, Negate(1)); // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -507,7 +467,7 @@ let negative: i32 = RightShift(1, Negate(1)); // CHECK:STDOUT: .negative = @__global_init.%negative // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %RightShift.decl: %RightShift.type = fn_decl @RightShift [template = constants.%RightShift] { +// CHECK:STDOUT: %RightShift.decl: %RightShift.type.1 = fn_decl @RightShift.1 [template = constants.%RightShift] { // CHECK:STDOUT: %a.patt: %i32 = binding_pattern a // CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: %i32 = binding_pattern b @@ -516,17 +476,11 @@ let negative: i32 = RightShift(1, Negate(1)); // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc4_18: Core.IntLiteral = int_value 32 [template = constants.%int_32.1] -// CHECK:STDOUT: %int.make_type_signed.loc4_18: init type = call constants.%Int(%int_32.loc4_18) [template = constants.%i32] -// CHECK:STDOUT: %.loc4_18.1: type = value_of_initializer %int.make_type_signed.loc4_18 [template = constants.%i32] -// CHECK:STDOUT: %.loc4_18.2: type = converted %int.make_type_signed.loc4_18, %.loc4_18.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc4_18: type = class_type @Int, @Int(constants.%int_32.1) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc4_26: Core.IntLiteral = int_value 32 [template = constants.%int_32.1] -// CHECK:STDOUT: %int.make_type_signed.loc4_26: init type = call constants.%Int(%int_32.loc4_26) [template = constants.%i32] -// CHECK:STDOUT: %.loc4_26.1: type = value_of_initializer %int.make_type_signed.loc4_26 [template = constants.%i32] -// CHECK:STDOUT: %.loc4_26.2: type = converted %int.make_type_signed.loc4_26, %.loc4_26.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc4_26: type = class_type @Int, @Int(constants.%int_32.1) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc4_34: Core.IntLiteral = int_value 32 [template = constants.%int_32.1] -// CHECK:STDOUT: %int.make_type_signed.loc4_34: init type = call constants.%Int(%int_32.loc4_34) [template = constants.%i32] -// CHECK:STDOUT: %.loc4_34.1: type = value_of_initializer %int.make_type_signed.loc4_34 [template = constants.%i32] -// CHECK:STDOUT: %.loc4_34.2: type = converted %int.make_type_signed.loc4_34, %.loc4_34.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc4_34: type = class_type @Int, @Int(constants.%int_32.1) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 @@ -534,59 +488,47 @@ let negative: i32 = RightShift(1, Negate(1)); // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %Negate.decl: %Negate.type = fn_decl @Negate [template = constants.%Negate] { +// CHECK:STDOUT: %Negate.decl: %Negate.type.1 = fn_decl @Negate.1 [template = constants.%Negate] { // CHECK:STDOUT: %a.patt: %i32 = binding_pattern a // CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc5_14: Core.IntLiteral = int_value 32 [template = constants.%int_32.1] -// CHECK:STDOUT: %int.make_type_signed.loc5_14: init type = call constants.%Int(%int_32.loc5_14) [template = constants.%i32] -// CHECK:STDOUT: %.loc5_14.1: type = value_of_initializer %int.make_type_signed.loc5_14 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_14.2: type = converted %int.make_type_signed.loc5_14, %.loc5_14.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc5_14: type = class_type @Int, @Int(constants.%int_32.1) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc5_22: Core.IntLiteral = int_value 32 [template = constants.%int_32.1] -// CHECK:STDOUT: %int.make_type_signed.loc5_22: init type = call constants.%Int(%int_32.loc5_22) [template = constants.%i32] -// CHECK:STDOUT: %.loc5_22.1: type = value_of_initializer %int.make_type_signed.loc5_22 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_22.2: type = converted %int.make_type_signed.loc5_22, %.loc5_22.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc5_22: type = class_type @Int, @Int(constants.%int_32.1) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %int_32.loc8: Core.IntLiteral = int_value 32 [template = constants.%int_32.1] -// CHECK:STDOUT: %int.make_type_signed.loc8: init type = call constants.%Int(%int_32.loc8) [template = constants.%i32] -// CHECK:STDOUT: %.loc8_13.1: type = value_of_initializer %int.make_type_signed.loc8 [template = constants.%i32] -// CHECK:STDOUT: %.loc8_13.2: type = converted %int.make_type_signed.loc8, %.loc8_13.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc8: type = class_type @Int, @Int(constants.%int_32.1) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc13: Core.IntLiteral = int_value 32 [template = constants.%int_32.1] -// CHECK:STDOUT: %int.make_type_signed.loc13: init type = call constants.%Int(%int_32.loc13) [template = constants.%i32] -// CHECK:STDOUT: %.loc13_13.1: type = value_of_initializer %int.make_type_signed.loc13 [template = constants.%i32] -// CHECK:STDOUT: %.loc13_13.2: type = converted %int.make_type_signed.loc13, %.loc13_13.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc13: type = class_type @Int, @Int(constants.%int_32.1) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc18: Core.IntLiteral = int_value 32 [template = constants.%int_32.1] -// CHECK:STDOUT: %int.make_type_signed.loc18: init type = call constants.%Int(%int_32.loc18) [template = constants.%i32] -// CHECK:STDOUT: %.loc18_13.1: type = value_of_initializer %int.make_type_signed.loc18 [template = constants.%i32] -// CHECK:STDOUT: %.loc18_13.2: type = converted %int.make_type_signed.loc18, %.loc18_13.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc18: type = class_type @Int, @Int(constants.%int_32.1) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc24: Core.IntLiteral = int_value 32 [template = constants.%int_32.1] -// CHECK:STDOUT: %int.make_type_signed.loc24: init type = call constants.%Int(%int_32.loc24) [template = constants.%i32] -// CHECK:STDOUT: %.loc24_15.1: type = value_of_initializer %int.make_type_signed.loc24 [template = constants.%i32] -// CHECK:STDOUT: %.loc24_15.2: type = converted %int.make_type_signed.loc24, %.loc24_15.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc24: type = class_type @Int, @Int(constants.%int_32.1) [template = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @RightShift(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.right_shift"; +// CHECK:STDOUT: fn @RightShift.1(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.right_shift"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Negate(%a.param_patt: %i32) -> %i32 = "int.snegate"; +// CHECK:STDOUT: fn @Negate.1(%a.param_patt: %i32) -> %i32 = "int.snegate"; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %RightShift.ref.loc8: %RightShift.type = name_ref RightShift, file.%RightShift.decl [template = constants.%RightShift] +// CHECK:STDOUT: %RightShift.ref.loc8: %RightShift.type.1 = name_ref RightShift, file.%RightShift.decl [template = constants.%RightShift] // CHECK:STDOUT: %int_1.loc8: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_31: Core.IntLiteral = int_value 31 [template = constants.%int_31.1] -// CHECK:STDOUT: %impl.elem0.loc8_30: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc8_30: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc8_30: = bound_method %int_1.loc8, %impl.elem0.loc8_30 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc8_30: = specific_function %Convert.bound.loc8_30, @Convert.2(constants.%int_32.1) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc8_30: init %i32 = call %Convert.specific_fn.loc8_30(%int_1.loc8) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc8_30.1: %i32 = value_of_initializer %int.convert_checked.loc8_30 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc8_30.2: %i32 = converted %int_1.loc8, %.loc8_30.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc8_33: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc8_33: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc8_33: = bound_method %int_31, %impl.elem0.loc8_33 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc8_33: = specific_function %Convert.bound.loc8_33, @Convert.2(constants.%int_32.1) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc8_33: init %i32 = call %Convert.specific_fn.loc8_33(%int_31) [template = constants.%int_31.2] @@ -596,16 +538,16 @@ let negative: i32 = RightShift(1, Negate(1)); // CHECK:STDOUT: %.loc8_36.1: %i32 = value_of_initializer %int.right_shift.loc8 [template = constants.%int_0] // CHECK:STDOUT: %.loc8_36.2: %i32 = converted %int.right_shift.loc8, %.loc8_36.1 [template = constants.%int_0] // CHECK:STDOUT: %size_1: %i32 = bind_name size_1, %.loc8_36.2 -// CHECK:STDOUT: %RightShift.ref.loc13: %RightShift.type = name_ref RightShift, file.%RightShift.decl [template = constants.%RightShift] +// CHECK:STDOUT: %RightShift.ref.loc13: %RightShift.type.1 = name_ref RightShift, file.%RightShift.decl [template = constants.%RightShift] // CHECK:STDOUT: %int_1.loc13: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32.1] -// CHECK:STDOUT: %impl.elem0.loc13_30: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc13_30: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc13_30: = bound_method %int_1.loc13, %impl.elem0.loc13_30 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc13_30: = specific_function %Convert.bound.loc13_30, @Convert.2(constants.%int_32.1) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc13_30: init %i32 = call %Convert.specific_fn.loc13_30(%int_1.loc13) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc13_30.1: %i32 = value_of_initializer %int.convert_checked.loc13_30 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc13_30.2: %i32 = converted %int_1.loc13, %.loc13_30.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc13_33: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc13_33: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc13_33: = bound_method %int_32, %impl.elem0.loc13_33 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc13_33: = specific_function %Convert.bound.loc13_33, @Convert.2(constants.%int_32.1) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc13_33: init %i32 = call %Convert.specific_fn.loc13_33(%int_32) [template = constants.%int_32.2] @@ -615,16 +557,16 @@ let negative: i32 = RightShift(1, Negate(1)); // CHECK:STDOUT: %.loc13_36.1: %i32 = value_of_initializer %int.right_shift.loc13 [template = ] // CHECK:STDOUT: %.loc13_36.2: %i32 = converted %int.right_shift.loc13, %.loc13_36.1 [template = ] // CHECK:STDOUT: %size_2: %i32 = bind_name size_2, %.loc13_36.2 -// CHECK:STDOUT: %RightShift.ref.loc18: %RightShift.type = name_ref RightShift, file.%RightShift.decl [template = constants.%RightShift] +// CHECK:STDOUT: %RightShift.ref.loc18: %RightShift.type.1 = name_ref RightShift, file.%RightShift.decl [template = constants.%RightShift] // CHECK:STDOUT: %int_1.loc18: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_33: Core.IntLiteral = int_value 33 [template = constants.%int_33.1] -// CHECK:STDOUT: %impl.elem0.loc18_30: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc18_30: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc18_30: = bound_method %int_1.loc18, %impl.elem0.loc18_30 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc18_30: = specific_function %Convert.bound.loc18_30, @Convert.2(constants.%int_32.1) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc18_30: init %i32 = call %Convert.specific_fn.loc18_30(%int_1.loc18) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc18_30.1: %i32 = value_of_initializer %int.convert_checked.loc18_30 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc18_30.2: %i32 = converted %int_1.loc18, %.loc18_30.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc18_33: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc18_33: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc18_33: = bound_method %int_33, %impl.elem0.loc18_33 [template = constants.%Convert.bound.4] // CHECK:STDOUT: %Convert.specific_fn.loc18_33: = specific_function %Convert.bound.loc18_33, @Convert.2(constants.%int_32.1) [template = constants.%Convert.specific_fn.4] // CHECK:STDOUT: %int.convert_checked.loc18_33: init %i32 = call %Convert.specific_fn.loc18_33(%int_33) [template = constants.%int_33.2] @@ -634,18 +576,18 @@ let negative: i32 = RightShift(1, Negate(1)); // CHECK:STDOUT: %.loc18_36.1: %i32 = value_of_initializer %int.right_shift.loc18 [template = ] // CHECK:STDOUT: %.loc18_36.2: %i32 = converted %int.right_shift.loc18, %.loc18_36.1 [template = ] // CHECK:STDOUT: %size_3: %i32 = bind_name size_3, %.loc18_36.2 -// CHECK:STDOUT: %RightShift.ref.loc24: %RightShift.type = name_ref RightShift, file.%RightShift.decl [template = constants.%RightShift] +// CHECK:STDOUT: %RightShift.ref.loc24: %RightShift.type.1 = name_ref RightShift, file.%RightShift.decl [template = constants.%RightShift] // CHECK:STDOUT: %int_1.loc24_32: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %Negate.ref: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] +// CHECK:STDOUT: %Negate.ref: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %int_1.loc24_42: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc24_42: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc24_42: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc24_42: = bound_method %int_1.loc24_42, %impl.elem0.loc24_42 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc24_42: = specific_function %Convert.bound.loc24_42, @Convert.2(constants.%int_32.1) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc24_42: init %i32 = call %Convert.specific_fn.loc24_42(%int_1.loc24_42) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc24_42.1: %i32 = value_of_initializer %int.convert_checked.loc24_42 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc24_42.2: %i32 = converted %int_1.loc24_42, %.loc24_42.1 [template = constants.%int_1.2] // CHECK:STDOUT: %int.snegate: init %i32 = call %Negate.ref(%.loc24_42.2) [template = constants.%int_-1] -// CHECK:STDOUT: %impl.elem0.loc24_32: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc24_32: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc24_32: = bound_method %int_1.loc24_32, %impl.elem0.loc24_32 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc24_32: = specific_function %Convert.bound.loc24_32, @Convert.2(constants.%int_32.1) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc24_32: init %i32 = call %Convert.specific_fn.loc24_32(%int_1.loc24_32) [template = constants.%int_1.2] diff --git a/toolchain/check/testdata/builtins/int/sadd.carbon b/toolchain/check/testdata/builtins/int/sadd.carbon index a416c54903358..2e9e4df436a39 100644 --- a/toolchain/check/testdata/builtins/int/sadd.carbon +++ b/toolchain/check/testdata/builtins/int/sadd.carbon @@ -93,30 +93,28 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] -// CHECK:STDOUT: %Add.type: type = fn_type @Add [template] -// CHECK:STDOUT: %Add: %Add.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] +// CHECK:STDOUT: %Add.type.1: type = fn_type @Add.1 [template] +// CHECK:STDOUT: %Add: %Add.type.1 = struct_value () [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] // CHECK:STDOUT: %int_3.1: %i32 = int_value 3 [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.4, @impl.3(%int_32) [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %interface.10: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_3.1, %Convert.15 [template] -// CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.4(%int_32) [template] +// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.3, @impl.2(%int_32) [template] +// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [template] +// CHECK:STDOUT: %interface.6: = interface_witness (%Convert.11) [template] +// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_3.1, %Convert.11 [template] +// CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.3(%int_32) [template] // CHECK:STDOUT: %int_3.2: Core.IntLiteral = int_value 3 [template] // CHECK:STDOUT: %array_type: type = array_type %int_3.2, %i32 [template] // CHECK:STDOUT: %ptr: type = ptr_type %array_type [template] @@ -127,7 +125,7 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -142,7 +140,7 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Add.decl: %Add.type = fn_decl @Add [template = constants.%Add] { +// CHECK:STDOUT: %Add.decl: %Add.type.1 = fn_decl @Add.1 [template = constants.%Add] { // CHECK:STDOUT: %a.patt: %i32 = binding_pattern a // CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: %i32 = binding_pattern b @@ -151,17 +149,11 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc2_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc2_11: init type = call constants.%Int(%int_32.loc2_11) [template = constants.%i32] -// CHECK:STDOUT: %.loc2_11.1: type = value_of_initializer %int.make_type_signed.loc2_11 [template = constants.%i32] -// CHECK:STDOUT: %.loc2_11.2: type = converted %int.make_type_signed.loc2_11, %.loc2_11.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc2_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc2_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc2_19: init type = call constants.%Int(%int_32.loc2_19) [template = constants.%i32] -// CHECK:STDOUT: %.loc2_19.1: type = value_of_initializer %int.make_type_signed.loc2_19 [template = constants.%i32] -// CHECK:STDOUT: %.loc2_19.2: type = converted %int.make_type_signed.loc2_19, %.loc2_19.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc2_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc2_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc2_27: init type = call constants.%Int(%int_32.loc2_27) [template = constants.%i32] -// CHECK:STDOUT: %.loc2_27.1: type = value_of_initializer %int.make_type_signed.loc2_27 [template = constants.%i32] -// CHECK:STDOUT: %.loc2_27.2: type = converted %int.make_type_signed.loc2_27, %.loc2_27.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc2_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 @@ -170,28 +162,26 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %int_32.loc4: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc4: init type = call constants.%Int(%int_32.loc4) [template = constants.%i32] -// CHECK:STDOUT: %Add.ref: %Add.type = name_ref Add, %Add.decl [template = constants.%Add] +// CHECK:STDOUT: %i32.loc4: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %Add.ref: %Add.type.1 = name_ref Add, %Add.decl [template = constants.%Add] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %impl.elem0.loc4_20: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc4_20: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc4_20: = bound_method %int_1, %impl.elem0.loc4_20 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc4_20: = specific_function %Convert.bound.loc4_20, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc4_20: init %i32 = call %Convert.specific_fn.loc4_20(%int_1) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc4_20.1: %i32 = value_of_initializer %int.convert_checked.loc4_20 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc4_20.2: %i32 = converted %int_1, %.loc4_20.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc4_23: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc4_23: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc4_23: = bound_method %int_2, %impl.elem0.loc4_23 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc4_23: = specific_function %Convert.bound.loc4_23, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc4_23: init %i32 = call %Convert.specific_fn.loc4_23(%int_2) [template = constants.%int_2.2] // CHECK:STDOUT: %.loc4_23.1: %i32 = value_of_initializer %int.convert_checked.loc4_23 [template = constants.%int_2.2] // CHECK:STDOUT: %.loc4_23.2: %i32 = converted %int_2, %.loc4_23.1 [template = constants.%int_2.2] // CHECK:STDOUT: %int.sadd: init %i32 = call %Add.ref(%.loc4_20.2, %.loc4_23.2) [template = constants.%int_3.1] -// CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_signed.loc4 [template = constants.%i32] -// CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_signed.loc4, %.loc4_11.1 [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc4_24: %Convert.type.6 = interface_witness_access constants.%interface.10, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %impl.elem0.loc4_24: %Convert.type.5 = interface_witness_access constants.%interface.6, element0 [template = constants.%Convert.11] // CHECK:STDOUT: %Convert.bound.loc4_24: = bound_method %int.sadd, %impl.elem0.loc4_24 [template = constants.%Convert.bound.3] -// CHECK:STDOUT: %Convert.specific_fn.loc4_24: = specific_function %Convert.bound.loc4_24, @Convert.4(constants.%int_32) [template = constants.%Convert.specific_fn.3] +// CHECK:STDOUT: %Convert.specific_fn.loc4_24: = specific_function %Convert.bound.loc4_24, @Convert.3(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %.loc4_24.1: %i32 = value_of_initializer %int.sadd [template = constants.%int_3.1] // CHECK:STDOUT: %.loc4_24.2: %i32 = converted %int.sadd, %.loc4_24.1 [template = constants.%int_3.1] // CHECK:STDOUT: %int.convert_checked.loc4_24: init Core.IntLiteral = call %Convert.specific_fn.loc4_24(%.loc4_24.2) [template = constants.%int_3.2] @@ -201,10 +191,8 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: %arr.var: ref %array_type = var arr // CHECK:STDOUT: %arr: ref %array_type = bind_name arr, %arr.var // CHECK:STDOUT: %int_32.loc5: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc5: init type = call constants.%Int(%int_32.loc5) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc5: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3.2] -// CHECK:STDOUT: %.loc5_13.1: type = value_of_initializer %int.make_type_signed.loc5 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_13.2: type = converted %int.make_type_signed.loc5, %.loc5_13.1 [template = constants.%i32] // CHECK:STDOUT: %array_type.loc5: type = array_type %int_3, %i32 [template = constants.%array_type] // CHECK:STDOUT: %ptr: type = ptr_type %array_type [template = constants.%ptr] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { @@ -216,17 +204,11 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc7_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc7_19: init type = call constants.%Int(%int_32.loc7_19) [template = constants.%i32] -// CHECK:STDOUT: %.loc7_19.1: type = value_of_initializer %int.make_type_signed.loc7_19 [template = constants.%i32] -// CHECK:STDOUT: %.loc7_19.2: type = converted %int.make_type_signed.loc7_19, %.loc7_19.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc7_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc7_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc7_27: init type = call constants.%Int(%int_32.loc7_27) [template = constants.%i32] -// CHECK:STDOUT: %.loc7_27.1: type = value_of_initializer %int.make_type_signed.loc7_27 [template = constants.%i32] -// CHECK:STDOUT: %.loc7_27.2: type = converted %int.make_type_signed.loc7_27, %.loc7_27.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc7_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc7_35: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc7_35: init type = call constants.%Int(%int_32.loc7_35) [template = constants.%i32] -// CHECK:STDOUT: %.loc7_35.1: type = value_of_initializer %int.make_type_signed.loc7_35 [template = constants.%i32] -// CHECK:STDOUT: %.loc7_35.2: type = converted %int.make_type_signed.loc7_35, %.loc7_35.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc7_35: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 @@ -236,11 +218,11 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Add(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.sadd"; +// CHECK:STDOUT: fn @Add.1(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.sadd"; // CHECK:STDOUT: // CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Add.ref: %Add.type = name_ref Add, file.%Add.decl [template = constants.%Add] +// CHECK:STDOUT: %Add.ref: %Add.type.1 = name_ref Add, file.%Add.decl [template = constants.%Add] // CHECK:STDOUT: %a.ref: %i32 = name_ref a, %a // CHECK:STDOUT: %b.ref: %i32 = name_ref b, %b // CHECK:STDOUT: %int.sadd: init %i32 = call %Add.ref(%a.ref, %b.ref) @@ -261,9 +243,7 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %TooFew.type: type = fn_type @TooFew [template] // CHECK:STDOUT: %TooFew: %TooFew.type = struct_value () [template] // CHECK:STDOUT: %TooMany.type: type = fn_type @TooMany [template] @@ -276,18 +256,18 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: %JustRight: %JustRight.type = struct_value () [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] // CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %int_3.1: Core.IntLiteral = int_value 3 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] -// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_3.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_3.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_3.2: %i32 = int_value 3 [template] // CHECK:STDOUT: %RuntimeCallTooFew.type: type = fn_type @RuntimeCallTooFew [template] @@ -301,8 +281,8 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .Bool = %import_ref.2 -// CHECK:STDOUT: .ImplicitAs = %import_ref.3 +// CHECK:STDOUT: .Bool = %import_ref.5 +// CHECK:STDOUT: .ImplicitAs = %import_ref.6 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -331,13 +311,9 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc8_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc8_14: init type = call constants.%Int(%int_32.loc8_14) [template = constants.%i32] -// CHECK:STDOUT: %.loc8_14.1: type = value_of_initializer %int.make_type_signed.loc8_14 [template = constants.%i32] -// CHECK:STDOUT: %.loc8_14.2: type = converted %int.make_type_signed.loc8_14, %.loc8_14.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc8_14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc8_22: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc8_22: init type = call constants.%Int(%int_32.loc8_22) [template = constants.%i32] -// CHECK:STDOUT: %.loc8_22.1: type = value_of_initializer %int.make_type_signed.loc8_22 [template = constants.%i32] -// CHECK:STDOUT: %.loc8_22.2: type = converted %int.make_type_signed.loc8_22, %.loc8_22.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc8_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 @@ -354,21 +330,13 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param3 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc13_15: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc13_15: init type = call constants.%Int(%int_32.loc13_15) [template = constants.%i32] -// CHECK:STDOUT: %.loc13_15.1: type = value_of_initializer %int.make_type_signed.loc13_15 [template = constants.%i32] -// CHECK:STDOUT: %.loc13_15.2: type = converted %int.make_type_signed.loc13_15, %.loc13_15.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc13_15: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc13_23: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc13_23: init type = call constants.%Int(%int_32.loc13_23) [template = constants.%i32] -// CHECK:STDOUT: %.loc13_23.1: type = value_of_initializer %int.make_type_signed.loc13_23 [template = constants.%i32] -// CHECK:STDOUT: %.loc13_23.2: type = converted %int.make_type_signed.loc13_23, %.loc13_23.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc13_23: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc13_31: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc13_31: init type = call constants.%Int(%int_32.loc13_31) [template = constants.%i32] -// CHECK:STDOUT: %.loc13_31.1: type = value_of_initializer %int.make_type_signed.loc13_31 [template = constants.%i32] -// CHECK:STDOUT: %.loc13_31.2: type = converted %int.make_type_signed.loc13_31, %.loc13_31.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc13_31: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc13_39: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc13_39: init type = call constants.%Int(%int_32.loc13_39) [template = constants.%i32] -// CHECK:STDOUT: %.loc13_39.1: type = value_of_initializer %int.make_type_signed.loc13_39 [template = constants.%i32] -// CHECK:STDOUT: %.loc13_39.2: type = converted %int.make_type_signed.loc13_39, %.loc13_39.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc13_39: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 @@ -387,13 +355,9 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc18_21: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc18_21: init type = call constants.%Int(%int_32.loc18_21) [template = constants.%i32] -// CHECK:STDOUT: %.loc18_21.1: type = value_of_initializer %int.make_type_signed.loc18_21 [template = constants.%i32] -// CHECK:STDOUT: %.loc18_21.2: type = converted %int.make_type_signed.loc18_21, %.loc18_21.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc18_21: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc18_29: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc18_29: init type = call constants.%Int(%int_32.loc18_29) [template = constants.%i32] -// CHECK:STDOUT: %.loc18_29.1: type = value_of_initializer %int.make_type_signed.loc18_29 [template = constants.%i32] -// CHECK:STDOUT: %.loc18_29.2: type = converted %int.make_type_signed.loc18_29, %.loc18_29.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc18_29: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc18_37.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc18_37.2: type = converted %bool.make_type, %.loc18_37.1 [template = bool] @@ -413,17 +377,11 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc19_17: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc19_17: init type = call constants.%Int(%int_32.loc19_17) [template = constants.%i32] -// CHECK:STDOUT: %.loc19_17.1: type = value_of_initializer %int.make_type_signed.loc19_17 [template = constants.%i32] -// CHECK:STDOUT: %.loc19_17.2: type = converted %int.make_type_signed.loc19_17, %.loc19_17.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc19_17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc19_25: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc19_25: init type = call constants.%Int(%int_32.loc19_25) [template = constants.%i32] -// CHECK:STDOUT: %.loc19_25.1: type = value_of_initializer %int.make_type_signed.loc19_25 [template = constants.%i32] -// CHECK:STDOUT: %.loc19_25.2: type = converted %int.make_type_signed.loc19_25, %.loc19_25.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc19_25: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc19_33: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc19_33: init type = call constants.%Int(%int_32.loc19_33) [template = constants.%i32] -// CHECK:STDOUT: %.loc19_33.1: type = value_of_initializer %int.make_type_signed.loc19_33 [template = constants.%i32] -// CHECK:STDOUT: %.loc19_33.2: type = converted %int.make_type_signed.loc19_33, %.loc19_33.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc19_33: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 @@ -432,79 +390,71 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %int_32.loc25: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc25: init type = call constants.%Int(%int_32.loc25) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc25: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %TooFew.ref: %TooFew.type = name_ref TooFew, %TooFew.decl [template = constants.%TooFew] // CHECK:STDOUT: %int_1.loc25: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc25: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc25: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc25: = bound_method %int_1.loc25, %impl.elem0.loc25 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc25: = specific_function %Convert.bound.loc25, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc25: init %i32 = call %Convert.specific_fn.loc25(%int_1.loc25) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc25_27.1: %i32 = value_of_initializer %int.convert_checked.loc25 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc25_27.2: %i32 = converted %int_1.loc25, %.loc25_27.1 [template = constants.%int_1.2] // CHECK:STDOUT: %TooFew.call: init %i32 = call %TooFew.ref(%.loc25_27.2) -// CHECK:STDOUT: %.loc25_15.1: type = value_of_initializer %int.make_type_signed.loc25 [template = constants.%i32] -// CHECK:STDOUT: %.loc25_15.2: type = converted %int.make_type_signed.loc25, %.loc25_15.1 [template = constants.%i32] // CHECK:STDOUT: %too_few.var: ref = var too_few // CHECK:STDOUT: %too_few: ref = bind_name too_few, %too_few.var // CHECK:STDOUT: %int_32.loc30: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc30: init type = call constants.%Int(%int_32.loc30) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc30: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %TooMany.ref: %TooMany.type = name_ref TooMany, %TooMany.decl [template = constants.%TooMany] // CHECK:STDOUT: %int_1.loc30: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_2.loc30: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %int_3.loc30: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] -// CHECK:STDOUT: %impl.elem0.loc30_29: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc30_29: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc30_29: = bound_method %int_1.loc30, %impl.elem0.loc30_29 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc30_29: = specific_function %Convert.bound.loc30_29, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc30_29: init %i32 = call %Convert.specific_fn.loc30_29(%int_1.loc30) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc30_29.1: %i32 = value_of_initializer %int.convert_checked.loc30_29 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc30_29.2: %i32 = converted %int_1.loc30, %.loc30_29.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc30_32: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc30_32: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc30_32: = bound_method %int_2.loc30, %impl.elem0.loc30_32 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc30_32: = specific_function %Convert.bound.loc30_32, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc30_32: init %i32 = call %Convert.specific_fn.loc30_32(%int_2.loc30) [template = constants.%int_2.2] // CHECK:STDOUT: %.loc30_32.1: %i32 = value_of_initializer %int.convert_checked.loc30_32 [template = constants.%int_2.2] // CHECK:STDOUT: %.loc30_32.2: %i32 = converted %int_2.loc30, %.loc30_32.1 [template = constants.%int_2.2] -// CHECK:STDOUT: %impl.elem0.loc30_35: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc30_35: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc30_35: = bound_method %int_3.loc30, %impl.elem0.loc30_35 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc30_35: = specific_function %Convert.bound.loc30_35, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc30_35: init %i32 = call %Convert.specific_fn.loc30_35(%int_3.loc30) [template = constants.%int_3.2] // CHECK:STDOUT: %.loc30_35.1: %i32 = value_of_initializer %int.convert_checked.loc30_35 [template = constants.%int_3.2] // CHECK:STDOUT: %.loc30_35.2: %i32 = converted %int_3.loc30, %.loc30_35.1 [template = constants.%int_3.2] // CHECK:STDOUT: %TooMany.call: init %i32 = call %TooMany.ref(%.loc30_29.2, %.loc30_32.2, %.loc30_35.2) -// CHECK:STDOUT: %.loc30_16.1: type = value_of_initializer %int.make_type_signed.loc30 [template = constants.%i32] -// CHECK:STDOUT: %.loc30_16.2: type = converted %int.make_type_signed.loc30, %.loc30_16.1 [template = constants.%i32] // CHECK:STDOUT: %too_many.var: ref = var too_many // CHECK:STDOUT: %too_many: ref = bind_name too_many, %too_many.var // CHECK:STDOUT: %int_32.loc35: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc35: init type = call constants.%Int(%int_32.loc35) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc35: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %BadReturnType.ref: %BadReturnType.type = name_ref BadReturnType, %BadReturnType.decl [template = constants.%BadReturnType] // CHECK:STDOUT: %int_1.loc35: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_2.loc35: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %impl.elem0.loc35_42: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc35_42: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc35_42: = bound_method %int_1.loc35, %impl.elem0.loc35_42 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc35_42: = specific_function %Convert.bound.loc35_42, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc35_42: init %i32 = call %Convert.specific_fn.loc35_42(%int_1.loc35) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc35_42.1: %i32 = value_of_initializer %int.convert_checked.loc35_42 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc35_42.2: %i32 = converted %int_1.loc35, %.loc35_42.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc35_45: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc35_45: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc35_45: = bound_method %int_2.loc35, %impl.elem0.loc35_45 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc35_45: = specific_function %Convert.bound.loc35_45, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc35_45: init %i32 = call %Convert.specific_fn.loc35_45(%int_2.loc35) [template = constants.%int_2.2] // CHECK:STDOUT: %.loc35_45.1: %i32 = value_of_initializer %int.convert_checked.loc35_45 [template = constants.%int_2.2] // CHECK:STDOUT: %.loc35_45.2: %i32 = converted %int_2.loc35, %.loc35_45.1 [template = constants.%int_2.2] // CHECK:STDOUT: %BadReturnType.call: init bool = call %BadReturnType.ref(%.loc35_42.2, %.loc35_45.2) -// CHECK:STDOUT: %.loc35_23.1: type = value_of_initializer %int.make_type_signed.loc35 [template = constants.%i32] -// CHECK:STDOUT: %.loc35_23.2: type = converted %int.make_type_signed.loc35, %.loc35_23.1 [template = constants.%i32] // CHECK:STDOUT: %bad_return_type.var: ref = var bad_return_type // CHECK:STDOUT: %bad_return_type: ref = bind_name bad_return_type, %bad_return_type.var // CHECK:STDOUT: %int_32.loc44: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc44: init type = call constants.%Int(%int_32.loc44) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc44: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %JustRight.ref: %JustRight.type = name_ref JustRight, %JustRight.decl [template = constants.%JustRight] // CHECK:STDOUT: %int_1.loc44: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_2.loc44: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %int_3.loc44: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] -// CHECK:STDOUT: %.loc44_16.1: type = value_of_initializer %int.make_type_signed.loc44 [template = constants.%i32] -// CHECK:STDOUT: %.loc44_16.2: type = converted %int.make_type_signed.loc44, %.loc44_16.1 [template = constants.%i32] // CHECK:STDOUT: %array_type: type = array_type , %i32 [template = ] // CHECK:STDOUT: %bad_call.var: ref = var bad_call // CHECK:STDOUT: %bad_call: ref = bind_name bad_call, %bad_call.var @@ -515,13 +465,9 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc46_25: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc46_25: init type = call constants.%Int(%int_32.loc46_25) [template = constants.%i32] -// CHECK:STDOUT: %.loc46_25.1: type = value_of_initializer %int.make_type_signed.loc46_25 [template = constants.%i32] -// CHECK:STDOUT: %.loc46_25.2: type = converted %int.make_type_signed.loc46_25, %.loc46_25.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc46_25: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc46_33: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc46_33: init type = call constants.%Int(%int_32.loc46_33) [template = constants.%i32] -// CHECK:STDOUT: %.loc46_33.1: type = value_of_initializer %int.make_type_signed.loc46_33 [template = constants.%i32] -// CHECK:STDOUT: %.loc46_33.2: type = converted %int.make_type_signed.loc46_33, %.loc46_33.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc46_33: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 @@ -538,21 +484,13 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param3 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc50_26: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc50_26: init type = call constants.%Int(%int_32.loc50_26) [template = constants.%i32] -// CHECK:STDOUT: %.loc50_26.1: type = value_of_initializer %int.make_type_signed.loc50_26 [template = constants.%i32] -// CHECK:STDOUT: %.loc50_26.2: type = converted %int.make_type_signed.loc50_26, %.loc50_26.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc50_26: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc50_34: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc50_34: init type = call constants.%Int(%int_32.loc50_34) [template = constants.%i32] -// CHECK:STDOUT: %.loc50_34.1: type = value_of_initializer %int.make_type_signed.loc50_34 [template = constants.%i32] -// CHECK:STDOUT: %.loc50_34.2: type = converted %int.make_type_signed.loc50_34, %.loc50_34.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc50_34: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc50_42: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc50_42: init type = call constants.%Int(%int_32.loc50_42) [template = constants.%i32] -// CHECK:STDOUT: %.loc50_42.1: type = value_of_initializer %int.make_type_signed.loc50_42 [template = constants.%i32] -// CHECK:STDOUT: %.loc50_42.2: type = converted %int.make_type_signed.loc50_42, %.loc50_42.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc50_42: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc50_50: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc50_50: init type = call constants.%Int(%int_32.loc50_50) [template = constants.%i32] -// CHECK:STDOUT: %.loc50_50.1: type = value_of_initializer %int.make_type_signed.loc50_50 [template = constants.%i32] -// CHECK:STDOUT: %.loc50_50.2: type = converted %int.make_type_signed.loc50_50, %.loc50_50.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc50_50: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 @@ -571,13 +509,9 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc54_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc54_32: init type = call constants.%Int(%int_32.loc54_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc54_32.1: type = value_of_initializer %int.make_type_signed.loc54_32 [template = constants.%i32] -// CHECK:STDOUT: %.loc54_32.2: type = converted %int.make_type_signed.loc54_32, %.loc54_32.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc54_32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc54_40: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc54_40: init type = call constants.%Int(%int_32.loc54_40) [template = constants.%i32] -// CHECK:STDOUT: %.loc54_40.1: type = value_of_initializer %int.make_type_signed.loc54_40 [template = constants.%i32] -// CHECK:STDOUT: %.loc54_40.2: type = converted %int.make_type_signed.loc54_40, %.loc54_40.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc54_40: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc54_48.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc54_48.2: type = converted %bool.make_type, %.loc54_48.1 [template = bool] @@ -635,25 +569,23 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] -// CHECK:STDOUT: %Add.type: type = fn_type @Add [template] -// CHECK:STDOUT: %Add: %Add.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] +// CHECK:STDOUT: %Add.type.1: type = fn_type @Add.1 [template] +// CHECK:STDOUT: %Add: %Add.type.1 = struct_value () [template] // CHECK:STDOUT: %int_2147483647.1: Core.IntLiteral = int_value 2147483647 [template] // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_2147483647.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_2147483647.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2147483647.2: %i32 = int_value 2147483647 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_0.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] // CHECK:STDOUT: %int_-2147483648: %i32 = int_value -2147483648 [template] @@ -662,7 +594,7 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -676,7 +608,7 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: .b = @__global_init.%b // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Add.decl: %Add.type = fn_decl @Add [template = constants.%Add] { +// CHECK:STDOUT: %Add.decl: %Add.type.1 = fn_decl @Add.1 [template = constants.%Add] { // CHECK:STDOUT: %a.patt: %i32 = binding_pattern a // CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: %i32 = binding_pattern b @@ -685,17 +617,11 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc4_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc4_11: init type = call constants.%Int(%int_32.loc4_11) [template = constants.%i32] -// CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_signed.loc4_11 [template = constants.%i32] -// CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_signed.loc4_11, %.loc4_11.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc4_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc4_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc4_19: init type = call constants.%Int(%int_32.loc4_19) [template = constants.%i32] -// CHECK:STDOUT: %.loc4_19.1: type = value_of_initializer %int.make_type_signed.loc4_19 [template = constants.%i32] -// CHECK:STDOUT: %.loc4_19.2: type = converted %int.make_type_signed.loc4_19, %.loc4_19.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc4_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc4_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc4_27: init type = call constants.%Int(%int_32.loc4_27) [template = constants.%i32] -// CHECK:STDOUT: %.loc4_27.1: type = value_of_initializer %int.make_type_signed.loc4_27 [template = constants.%i32] -// CHECK:STDOUT: %.loc4_27.2: type = converted %int.make_type_signed.loc4_27, %.loc4_27.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc4_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 @@ -704,29 +630,25 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %int_32.loc6: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc6: init type = call constants.%Int(%int_32.loc6) [template = constants.%i32] -// CHECK:STDOUT: %.loc6_8.1: type = value_of_initializer %int.make_type_signed.loc6 [template = constants.%i32] -// CHECK:STDOUT: %.loc6_8.2: type = converted %int.make_type_signed.loc6, %.loc6_8.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc6: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc10: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc10: init type = call constants.%Int(%int_32.loc10) [template = constants.%i32] -// CHECK:STDOUT: %.loc10_8.1: type = value_of_initializer %int.make_type_signed.loc10 [template = constants.%i32] -// CHECK:STDOUT: %.loc10_8.2: type = converted %int.make_type_signed.loc10, %.loc10_8.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc10: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Add(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.sadd"; +// CHECK:STDOUT: fn @Add.1(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.sadd"; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Add.ref.loc6: %Add.type = name_ref Add, file.%Add.decl [template = constants.%Add] +// CHECK:STDOUT: %Add.ref.loc6: %Add.type.1 = name_ref Add, file.%Add.decl [template = constants.%Add] // CHECK:STDOUT: %int_2147483647.loc6: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0.loc6_18: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc6_18: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc6_18: = bound_method %int_2147483647.loc6, %impl.elem0.loc6_18 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc6_18: = specific_function %Convert.bound.loc6_18, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc6_18: init %i32 = call %Convert.specific_fn.loc6_18(%int_2147483647.loc6) [template = constants.%int_2147483647.2] // CHECK:STDOUT: %.loc6_18.1: %i32 = value_of_initializer %int.convert_checked.loc6_18 [template = constants.%int_2147483647.2] // CHECK:STDOUT: %.loc6_18.2: %i32 = converted %int_2147483647.loc6, %.loc6_18.1 [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %impl.elem0.loc6_30: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc6_30: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc6_30: = bound_method %int_0, %impl.elem0.loc6_30 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc6_30: = specific_function %Convert.bound.loc6_30, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc6_30: init %i32 = call %Convert.specific_fn.loc6_30(%int_0) [template = constants.%int_0.2] @@ -736,16 +658,16 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: %.loc6_32.1: %i32 = value_of_initializer %int.sadd.loc6 [template = constants.%int_2147483647.2] // CHECK:STDOUT: %.loc6_32.2: %i32 = converted %int.sadd.loc6, %.loc6_32.1 [template = constants.%int_2147483647.2] // CHECK:STDOUT: %a: %i32 = bind_name a, %.loc6_32.2 -// CHECK:STDOUT: %Add.ref.loc10: %Add.type = name_ref Add, file.%Add.decl [template = constants.%Add] +// CHECK:STDOUT: %Add.ref.loc10: %Add.type.1 = name_ref Add, file.%Add.decl [template = constants.%Add] // CHECK:STDOUT: %int_2147483647.loc10: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc10_18: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc10_18: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc10_18: = bound_method %int_2147483647.loc10, %impl.elem0.loc10_18 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc10_18: = specific_function %Convert.bound.loc10_18, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc10_18: init %i32 = call %Convert.specific_fn.loc10_18(%int_2147483647.loc10) [template = constants.%int_2147483647.2] // CHECK:STDOUT: %.loc10_18.1: %i32 = value_of_initializer %int.convert_checked.loc10_18 [template = constants.%int_2147483647.2] // CHECK:STDOUT: %.loc10_18.2: %i32 = converted %int_2147483647.loc10, %.loc10_18.1 [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %impl.elem0.loc10_30: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc10_30: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc10_30: = bound_method %int_1, %impl.elem0.loc10_30 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc10_30: = specific_function %Convert.bound.loc10_30, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc10_30: init %i32 = call %Convert.specific_fn.loc10_30(%int_1) [template = constants.%int_1.2] diff --git a/toolchain/check/testdata/builtins/int/sdiv.carbon b/toolchain/check/testdata/builtins/int/sdiv.carbon index 16f03145da43d..a834a6133611e 100644 --- a/toolchain/check/testdata/builtins/int/sdiv.carbon +++ b/toolchain/check/testdata/builtins/int/sdiv.carbon @@ -61,30 +61,28 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] -// CHECK:STDOUT: %Div.type: type = fn_type @Div [template] -// CHECK:STDOUT: %Div: %Div.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] +// CHECK:STDOUT: %Div.type.1: type = fn_type @Div.1 [template] +// CHECK:STDOUT: %Div: %Div.type.1 = struct_value () [template] // CHECK:STDOUT: %int_3.1: Core.IntLiteral = int_value 3 [template] // CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_3.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_3.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_3.2: %i32 = int_value 3 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] // CHECK:STDOUT: %int_1.1: %i32 = int_value 1 [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.4, @impl.3(%int_32) [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %interface.10: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_1.1, %Convert.15 [template] -// CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.4(%int_32) [template] +// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.3, @impl.2(%int_32) [template] +// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [template] +// CHECK:STDOUT: %interface.6: = interface_witness (%Convert.11) [template] +// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_1.1, %Convert.11 [template] +// CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.3(%int_32) [template] // CHECK:STDOUT: %int_1.2: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %array_type: type = array_type %int_1.2, %i32 [template] // CHECK:STDOUT: %ptr: type = ptr_type %array_type [template] @@ -95,7 +93,7 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -110,7 +108,7 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Div.decl: %Div.type = fn_decl @Div [template = constants.%Div] { +// CHECK:STDOUT: %Div.decl: %Div.type.1 = fn_decl @Div.1 [template = constants.%Div] { // CHECK:STDOUT: %a.patt: %i32 = binding_pattern a // CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: %i32 = binding_pattern b @@ -119,17 +117,11 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc2_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc2_11: init type = call constants.%Int(%int_32.loc2_11) [template = constants.%i32] -// CHECK:STDOUT: %.loc2_11.1: type = value_of_initializer %int.make_type_signed.loc2_11 [template = constants.%i32] -// CHECK:STDOUT: %.loc2_11.2: type = converted %int.make_type_signed.loc2_11, %.loc2_11.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc2_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc2_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc2_19: init type = call constants.%Int(%int_32.loc2_19) [template = constants.%i32] -// CHECK:STDOUT: %.loc2_19.1: type = value_of_initializer %int.make_type_signed.loc2_19 [template = constants.%i32] -// CHECK:STDOUT: %.loc2_19.2: type = converted %int.make_type_signed.loc2_19, %.loc2_19.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc2_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc2_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc2_27: init type = call constants.%Int(%int_32.loc2_27) [template = constants.%i32] -// CHECK:STDOUT: %.loc2_27.1: type = value_of_initializer %int.make_type_signed.loc2_27 [template = constants.%i32] -// CHECK:STDOUT: %.loc2_27.2: type = converted %int.make_type_signed.loc2_27, %.loc2_27.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc2_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 @@ -138,28 +130,26 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %int_32.loc4: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc4: init type = call constants.%Int(%int_32.loc4) [template = constants.%i32] -// CHECK:STDOUT: %Div.ref: %Div.type = name_ref Div, %Div.decl [template = constants.%Div] +// CHECK:STDOUT: %i32.loc4: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %Div.ref: %Div.type.1 = name_ref Div, %Div.decl [template = constants.%Div] // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %impl.elem0.loc4_20: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc4_20: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc4_20: = bound_method %int_3, %impl.elem0.loc4_20 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc4_20: = specific_function %Convert.bound.loc4_20, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc4_20: init %i32 = call %Convert.specific_fn.loc4_20(%int_3) [template = constants.%int_3.2] // CHECK:STDOUT: %.loc4_20.1: %i32 = value_of_initializer %int.convert_checked.loc4_20 [template = constants.%int_3.2] // CHECK:STDOUT: %.loc4_20.2: %i32 = converted %int_3, %.loc4_20.1 [template = constants.%int_3.2] -// CHECK:STDOUT: %impl.elem0.loc4_23: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc4_23: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc4_23: = bound_method %int_2, %impl.elem0.loc4_23 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc4_23: = specific_function %Convert.bound.loc4_23, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc4_23: init %i32 = call %Convert.specific_fn.loc4_23(%int_2) [template = constants.%int_2.2] // CHECK:STDOUT: %.loc4_23.1: %i32 = value_of_initializer %int.convert_checked.loc4_23 [template = constants.%int_2.2] // CHECK:STDOUT: %.loc4_23.2: %i32 = converted %int_2, %.loc4_23.1 [template = constants.%int_2.2] // CHECK:STDOUT: %int.sdiv: init %i32 = call %Div.ref(%.loc4_20.2, %.loc4_23.2) [template = constants.%int_1.1] -// CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_signed.loc4 [template = constants.%i32] -// CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_signed.loc4, %.loc4_11.1 [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc4_24: %Convert.type.6 = interface_witness_access constants.%interface.10, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %impl.elem0.loc4_24: %Convert.type.5 = interface_witness_access constants.%interface.6, element0 [template = constants.%Convert.11] // CHECK:STDOUT: %Convert.bound.loc4_24: = bound_method %int.sdiv, %impl.elem0.loc4_24 [template = constants.%Convert.bound.3] -// CHECK:STDOUT: %Convert.specific_fn.loc4_24: = specific_function %Convert.bound.loc4_24, @Convert.4(constants.%int_32) [template = constants.%Convert.specific_fn.3] +// CHECK:STDOUT: %Convert.specific_fn.loc4_24: = specific_function %Convert.bound.loc4_24, @Convert.3(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %.loc4_24.1: %i32 = value_of_initializer %int.sdiv [template = constants.%int_1.1] // CHECK:STDOUT: %.loc4_24.2: %i32 = converted %int.sdiv, %.loc4_24.1 [template = constants.%int_1.1] // CHECK:STDOUT: %int.convert_checked.loc4_24: init Core.IntLiteral = call %Convert.specific_fn.loc4_24(%.loc4_24.2) [template = constants.%int_1.2] @@ -169,10 +159,8 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: %arr.var: ref %array_type = var arr // CHECK:STDOUT: %arr: ref %array_type = bind_name arr, %arr.var // CHECK:STDOUT: %int_32.loc5: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc5: init type = call constants.%Int(%int_32.loc5) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc5: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc5_13.1: type = value_of_initializer %int.make_type_signed.loc5 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_13.2: type = converted %int.make_type_signed.loc5, %.loc5_13.1 [template = constants.%i32] // CHECK:STDOUT: %array_type.loc5: type = array_type %int_1, %i32 [template = constants.%array_type] // CHECK:STDOUT: %ptr: type = ptr_type %array_type [template = constants.%ptr] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { @@ -184,17 +172,11 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc7_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc7_19: init type = call constants.%Int(%int_32.loc7_19) [template = constants.%i32] -// CHECK:STDOUT: %.loc7_19.1: type = value_of_initializer %int.make_type_signed.loc7_19 [template = constants.%i32] -// CHECK:STDOUT: %.loc7_19.2: type = converted %int.make_type_signed.loc7_19, %.loc7_19.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc7_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc7_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc7_27: init type = call constants.%Int(%int_32.loc7_27) [template = constants.%i32] -// CHECK:STDOUT: %.loc7_27.1: type = value_of_initializer %int.make_type_signed.loc7_27 [template = constants.%i32] -// CHECK:STDOUT: %.loc7_27.2: type = converted %int.make_type_signed.loc7_27, %.loc7_27.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc7_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc7_35: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc7_35: init type = call constants.%Int(%int_32.loc7_35) [template = constants.%i32] -// CHECK:STDOUT: %.loc7_35.1: type = value_of_initializer %int.make_type_signed.loc7_35 [template = constants.%i32] -// CHECK:STDOUT: %.loc7_35.2: type = converted %int.make_type_signed.loc7_35, %.loc7_35.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc7_35: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 @@ -204,11 +186,11 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Div(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.sdiv"; +// CHECK:STDOUT: fn @Div.1(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.sdiv"; // CHECK:STDOUT: // CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Div.ref: %Div.type = name_ref Div, file.%Div.decl [template = constants.%Div] +// CHECK:STDOUT: %Div.ref: %Div.type.1 = name_ref Div, file.%Div.decl [template = constants.%Div] // CHECK:STDOUT: %a.ref: %i32 = name_ref a, %a // CHECK:STDOUT: %b.ref: %i32 = name_ref b, %b // CHECK:STDOUT: %int.sdiv: init %i32 = call %Div.ref(%a.ref, %b.ref) @@ -229,26 +211,24 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] -// CHECK:STDOUT: %Div.type: type = fn_type @Div [template] -// CHECK:STDOUT: %Div: %Div.type = struct_value () [template] -// CHECK:STDOUT: %Sub.type: type = fn_type @Sub [template] -// CHECK:STDOUT: %Sub: %Sub.type = struct_value () [template] -// CHECK:STDOUT: %Negate.type: type = fn_type @Negate [template] -// CHECK:STDOUT: %Negate: %Negate.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] +// CHECK:STDOUT: %Div.type.1: type = fn_type @Div.1 [template] +// CHECK:STDOUT: %Div: %Div.type.1 = struct_value () [template] +// CHECK:STDOUT: %Sub.type.1: type = fn_type @Sub.1 [template] +// CHECK:STDOUT: %Sub: %Sub.type.1 = struct_value () [template] +// CHECK:STDOUT: %Negate.type.1: type = fn_type @Negate.1 [template] +// CHECK:STDOUT: %Negate: %Negate.type.1 = struct_value () [template] // CHECK:STDOUT: %int_2147483647.1: Core.IntLiteral = int_value 2147483647 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_2147483647.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_2147483647.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2147483647.2: %i32 = int_value 2147483647 [template] // CHECK:STDOUT: %int_-2147483647: %i32 = int_value -2147483647 [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] // CHECK:STDOUT: %int_-1: %i32 = int_value -1 [template] @@ -258,7 +238,7 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -275,7 +255,7 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: .c = @__global_init.%c // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Div.decl: %Div.type = fn_decl @Div [template = constants.%Div] { +// CHECK:STDOUT: %Div.decl: %Div.type.1 = fn_decl @Div.1 [template = constants.%Div] { // CHECK:STDOUT: %a.patt: %i32 = binding_pattern a // CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: %i32 = binding_pattern b @@ -284,17 +264,11 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc4_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc4_11: init type = call constants.%Int(%int_32.loc4_11) [template = constants.%i32] -// CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_signed.loc4_11 [template = constants.%i32] -// CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_signed.loc4_11, %.loc4_11.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc4_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc4_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc4_19: init type = call constants.%Int(%int_32.loc4_19) [template = constants.%i32] -// CHECK:STDOUT: %.loc4_19.1: type = value_of_initializer %int.make_type_signed.loc4_19 [template = constants.%i32] -// CHECK:STDOUT: %.loc4_19.2: type = converted %int.make_type_signed.loc4_19, %.loc4_19.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc4_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc4_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc4_27: init type = call constants.%Int(%int_32.loc4_27) [template = constants.%i32] -// CHECK:STDOUT: %.loc4_27.1: type = value_of_initializer %int.make_type_signed.loc4_27 [template = constants.%i32] -// CHECK:STDOUT: %.loc4_27.2: type = converted %int.make_type_signed.loc4_27, %.loc4_27.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc4_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 @@ -302,7 +276,7 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %Sub.decl: %Sub.type = fn_decl @Sub [template = constants.%Sub] { +// CHECK:STDOUT: %Sub.decl: %Sub.type.1 = fn_decl @Sub.1 [template = constants.%Sub] { // CHECK:STDOUT: %a.patt: %i32 = binding_pattern a // CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: %i32 = binding_pattern b @@ -311,17 +285,11 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc5_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc5_11: init type = call constants.%Int(%int_32.loc5_11) [template = constants.%i32] -// CHECK:STDOUT: %.loc5_11.1: type = value_of_initializer %int.make_type_signed.loc5_11 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_11.2: type = converted %int.make_type_signed.loc5_11, %.loc5_11.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc5_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc5_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc5_19: init type = call constants.%Int(%int_32.loc5_19) [template = constants.%i32] -// CHECK:STDOUT: %.loc5_19.1: type = value_of_initializer %int.make_type_signed.loc5_19 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_19.2: type = converted %int.make_type_signed.loc5_19, %.loc5_19.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc5_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc5_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc5_27: init type = call constants.%Int(%int_32.loc5_27) [template = constants.%i32] -// CHECK:STDOUT: %.loc5_27.1: type = value_of_initializer %int.make_type_signed.loc5_27 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_27.2: type = converted %int.make_type_signed.loc5_27, %.loc5_27.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc5_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 @@ -329,60 +297,50 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %Negate.decl: %Negate.type = fn_decl @Negate [template = constants.%Negate] { +// CHECK:STDOUT: %Negate.decl: %Negate.type.1 = fn_decl @Negate.1 [template = constants.%Negate] { // CHECK:STDOUT: %a.patt: %i32 = binding_pattern a // CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc6_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc6_14: init type = call constants.%Int(%int_32.loc6_14) [template = constants.%i32] -// CHECK:STDOUT: %.loc6_14.1: type = value_of_initializer %int.make_type_signed.loc6_14 [template = constants.%i32] -// CHECK:STDOUT: %.loc6_14.2: type = converted %int.make_type_signed.loc6_14, %.loc6_14.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc6_14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc6_22: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc6_22: init type = call constants.%Int(%int_32.loc6_22) [template = constants.%i32] -// CHECK:STDOUT: %.loc6_22.1: type = value_of_initializer %int.make_type_signed.loc6_22 [template = constants.%i32] -// CHECK:STDOUT: %.loc6_22.2: type = converted %int.make_type_signed.loc6_22, %.loc6_22.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc6_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %int_32.loc9: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc9: init type = call constants.%Int(%int_32.loc9) [template = constants.%i32] -// CHECK:STDOUT: %.loc9_8.1: type = value_of_initializer %int.make_type_signed.loc9 [template = constants.%i32] -// CHECK:STDOUT: %.loc9_8.2: type = converted %int.make_type_signed.loc9, %.loc9_8.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc9: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc12: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc12: init type = call constants.%Int(%int_32.loc12) [template = constants.%i32] -// CHECK:STDOUT: %.loc12_8.1: type = value_of_initializer %int.make_type_signed.loc12 [template = constants.%i32] -// CHECK:STDOUT: %.loc12_8.2: type = converted %int.make_type_signed.loc12, %.loc12_8.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc12: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc19: init type = call constants.%Int(%int_32.loc19) [template = constants.%i32] -// CHECK:STDOUT: %.loc19_8.1: type = value_of_initializer %int.make_type_signed.loc19 [template = constants.%i32] -// CHECK:STDOUT: %.loc19_8.2: type = converted %int.make_type_signed.loc19, %.loc19_8.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Div(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.sdiv"; +// CHECK:STDOUT: fn @Div.1(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.sdiv"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Sub(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.ssub"; +// CHECK:STDOUT: fn @Sub.1(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.ssub"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Negate(%a.param_patt: %i32) -> %i32 = "int.snegate"; +// CHECK:STDOUT: fn @Negate.1(%a.param_patt: %i32) -> %i32 = "int.snegate"; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Div.ref.loc9: %Div.type = name_ref Div, file.%Div.decl [template = constants.%Div] -// CHECK:STDOUT: %Negate.ref.loc9_18: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] +// CHECK:STDOUT: %Div.ref.loc9: %Div.type.1 = name_ref Div, file.%Div.decl [template = constants.%Div] +// CHECK:STDOUT: %Negate.ref.loc9_18: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %int_2147483647.loc9: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] -// CHECK:STDOUT: %impl.elem0.loc9_25: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc9_25: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc9_25: = bound_method %int_2147483647.loc9, %impl.elem0.loc9_25 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc9_25: = specific_function %Convert.bound.loc9_25, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc9_25: init %i32 = call %Convert.specific_fn.loc9_25(%int_2147483647.loc9) [template = constants.%int_2147483647.2] // CHECK:STDOUT: %.loc9_25.1: %i32 = value_of_initializer %int.convert_checked.loc9_25 [template = constants.%int_2147483647.2] // CHECK:STDOUT: %.loc9_25.2: %i32 = converted %int_2147483647.loc9, %.loc9_25.1 [template = constants.%int_2147483647.2] // CHECK:STDOUT: %int.snegate.loc9_36: init %i32 = call %Negate.ref.loc9_18(%.loc9_25.2) [template = constants.%int_-2147483647] -// CHECK:STDOUT: %Negate.ref.loc9_39: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] +// CHECK:STDOUT: %Negate.ref.loc9_39: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %int_1.loc9: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc9_46: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc9_46: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc9_46: = bound_method %int_1.loc9, %impl.elem0.loc9_46 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc9_46: = specific_function %Convert.bound.loc9_46, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc9_46: init %i32 = call %Convert.specific_fn.loc9_46(%int_1.loc9) [template = constants.%int_1.2] @@ -397,11 +355,11 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: %.loc9_49.1: %i32 = value_of_initializer %int.sdiv.loc9 [template = constants.%int_2147483647.2] // CHECK:STDOUT: %.loc9_49.2: %i32 = converted %int.sdiv.loc9, %.loc9_49.1 [template = constants.%int_2147483647.2] // CHECK:STDOUT: %a: %i32 = bind_name a, %.loc9_49.2 -// CHECK:STDOUT: %Div.ref.loc12: %Div.type = name_ref Div, file.%Div.decl [template = constants.%Div] -// CHECK:STDOUT: %Sub.ref.loc12: %Sub.type = name_ref Sub, file.%Sub.decl [template = constants.%Sub] -// CHECK:STDOUT: %Negate.ref.loc12: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] +// CHECK:STDOUT: %Div.ref.loc12: %Div.type.1 = name_ref Div, file.%Div.decl [template = constants.%Div] +// CHECK:STDOUT: %Sub.ref.loc12: %Sub.type.1 = name_ref Sub, file.%Sub.decl [template = constants.%Sub] +// CHECK:STDOUT: %Negate.ref.loc12: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %int_2147483647.loc12: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] -// CHECK:STDOUT: %impl.elem0.loc12_29: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc12_29: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc12_29: = bound_method %int_2147483647.loc12, %impl.elem0.loc12_29 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc12_29: = specific_function %Convert.bound.loc12_29, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc12_29: init %i32 = call %Convert.specific_fn.loc12_29(%int_2147483647.loc12) [template = constants.%int_2147483647.2] @@ -411,7 +369,7 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: %int_1.loc12_43: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %.loc12_40.1: %i32 = value_of_initializer %int.snegate.loc12 [template = constants.%int_-2147483647] // CHECK:STDOUT: %.loc12_40.2: %i32 = converted %int.snegate.loc12, %.loc12_40.1 [template = constants.%int_-2147483647] -// CHECK:STDOUT: %impl.elem0.loc12_43: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc12_43: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc12_43: = bound_method %int_1.loc12_43, %impl.elem0.loc12_43 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc12_43: = specific_function %Convert.bound.loc12_43, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc12_43: init %i32 = call %Convert.specific_fn.loc12_43(%int_1.loc12_43) [template = constants.%int_1.2] @@ -421,7 +379,7 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: %int_1.loc12_47: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %.loc12_44.1: %i32 = value_of_initializer %int.ssub.loc12 [template = constants.%int_-2147483648] // CHECK:STDOUT: %.loc12_44.2: %i32 = converted %int.ssub.loc12, %.loc12_44.1 [template = constants.%int_-2147483648] -// CHECK:STDOUT: %impl.elem0.loc12_47: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc12_47: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc12_47: = bound_method %int_1.loc12_47, %impl.elem0.loc12_47 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc12_47: = specific_function %Convert.bound.loc12_47, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc12_47: init %i32 = call %Convert.specific_fn.loc12_47(%int_1.loc12_47) [template = constants.%int_1.2] @@ -431,11 +389,11 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: %.loc12_49.1: %i32 = value_of_initializer %int.sdiv.loc12 [template = constants.%int_-2147483648] // CHECK:STDOUT: %.loc12_49.2: %i32 = converted %int.sdiv.loc12, %.loc12_49.1 [template = constants.%int_-2147483648] // CHECK:STDOUT: %b: %i32 = bind_name b, %.loc12_49.2 -// CHECK:STDOUT: %Div.ref.loc19: %Div.type = name_ref Div, file.%Div.decl [template = constants.%Div] -// CHECK:STDOUT: %Sub.ref.loc19: %Sub.type = name_ref Sub, file.%Sub.decl [template = constants.%Sub] -// CHECK:STDOUT: %Negate.ref.loc19_22: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] +// CHECK:STDOUT: %Div.ref.loc19: %Div.type.1 = name_ref Div, file.%Div.decl [template = constants.%Div] +// CHECK:STDOUT: %Sub.ref.loc19: %Sub.type.1 = name_ref Sub, file.%Sub.decl [template = constants.%Sub] +// CHECK:STDOUT: %Negate.ref.loc19_22: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %int_2147483647.loc19: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] -// CHECK:STDOUT: %impl.elem0.loc19_29: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc19_29: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc19_29: = bound_method %int_2147483647.loc19, %impl.elem0.loc19_29 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc19_29: = specific_function %Convert.bound.loc19_29, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc19_29: init %i32 = call %Convert.specific_fn.loc19_29(%int_2147483647.loc19) [template = constants.%int_2147483647.2] @@ -445,16 +403,16 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: %int_1.loc19_43: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %.loc19_40.1: %i32 = value_of_initializer %int.snegate.loc19_40 [template = constants.%int_-2147483647] // CHECK:STDOUT: %.loc19_40.2: %i32 = converted %int.snegate.loc19_40, %.loc19_40.1 [template = constants.%int_-2147483647] -// CHECK:STDOUT: %impl.elem0.loc19_43: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc19_43: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc19_43: = bound_method %int_1.loc19_43, %impl.elem0.loc19_43 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc19_43: = specific_function %Convert.bound.loc19_43, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc19_43: init %i32 = call %Convert.specific_fn.loc19_43(%int_1.loc19_43) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc19_43.1: %i32 = value_of_initializer %int.convert_checked.loc19_43 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc19_43.2: %i32 = converted %int_1.loc19_43, %.loc19_43.1 [template = constants.%int_1.2] // CHECK:STDOUT: %int.ssub.loc19: init %i32 = call %Sub.ref.loc19(%.loc19_40.2, %.loc19_43.2) [template = constants.%int_-2147483648] -// CHECK:STDOUT: %Negate.ref.loc19_47: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] +// CHECK:STDOUT: %Negate.ref.loc19_47: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %int_1.loc19_54: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc19_54: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc19_54: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc19_54: = bound_method %int_1.loc19_54, %impl.elem0.loc19_54 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc19_54: = specific_function %Convert.bound.loc19_54, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc19_54: init %i32 = call %Convert.specific_fn.loc19_54(%int_1.loc19_54) [template = constants.%int_1.2] @@ -476,21 +434,19 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] -// CHECK:STDOUT: %Div.type: type = fn_type @Div [template] -// CHECK:STDOUT: %Div: %Div.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] +// CHECK:STDOUT: %Div.type.1: type = fn_type @Div.1 [template] +// CHECK:STDOUT: %Div: %Div.type.1 = struct_value () [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_0.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] // CHECK:STDOUT: } @@ -498,7 +454,7 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -512,7 +468,7 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: .b = @__global_init.%b // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Div.decl: %Div.type = fn_decl @Div [template = constants.%Div] { +// CHECK:STDOUT: %Div.decl: %Div.type.1 = fn_decl @Div.1 [template = constants.%Div] { // CHECK:STDOUT: %a.patt: %i32 = binding_pattern a // CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: %i32 = binding_pattern b @@ -521,17 +477,11 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc4_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc4_11: init type = call constants.%Int(%int_32.loc4_11) [template = constants.%i32] -// CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_signed.loc4_11 [template = constants.%i32] -// CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_signed.loc4_11, %.loc4_11.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc4_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc4_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc4_19: init type = call constants.%Int(%int_32.loc4_19) [template = constants.%i32] -// CHECK:STDOUT: %.loc4_19.1: type = value_of_initializer %int.make_type_signed.loc4_19 [template = constants.%i32] -// CHECK:STDOUT: %.loc4_19.2: type = converted %int.make_type_signed.loc4_19, %.loc4_19.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc4_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc4_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc4_27: init type = call constants.%Int(%int_32.loc4_27) [template = constants.%i32] -// CHECK:STDOUT: %.loc4_27.1: type = value_of_initializer %int.make_type_signed.loc4_27 [template = constants.%i32] -// CHECK:STDOUT: %.loc4_27.2: type = converted %int.make_type_signed.loc4_27, %.loc4_27.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc4_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 @@ -540,29 +490,25 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %int_32.loc10: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc10: init type = call constants.%Int(%int_32.loc10) [template = constants.%i32] -// CHECK:STDOUT: %.loc10_8.1: type = value_of_initializer %int.make_type_signed.loc10 [template = constants.%i32] -// CHECK:STDOUT: %.loc10_8.2: type = converted %int.make_type_signed.loc10, %.loc10_8.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc10: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc15: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc15: init type = call constants.%Int(%int_32.loc15) [template = constants.%i32] -// CHECK:STDOUT: %.loc15_8.1: type = value_of_initializer %int.make_type_signed.loc15 [template = constants.%i32] -// CHECK:STDOUT: %.loc15_8.2: type = converted %int.make_type_signed.loc15, %.loc15_8.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc15: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Div(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.sdiv"; +// CHECK:STDOUT: fn @Div.1(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.sdiv"; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Div.ref.loc10: %Div.type = name_ref Div, file.%Div.decl [template = constants.%Div] +// CHECK:STDOUT: %Div.ref.loc10: %Div.type.1 = name_ref Div, file.%Div.decl [template = constants.%Div] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_0.loc10: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0.loc10_18: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc10_18: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc10_18: = bound_method %int_1, %impl.elem0.loc10_18 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc10_18: = specific_function %Convert.bound.loc10_18, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc10_18: init %i32 = call %Convert.specific_fn.loc10_18(%int_1) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc10_18.1: %i32 = value_of_initializer %int.convert_checked.loc10_18 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc10_18.2: %i32 = converted %int_1, %.loc10_18.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc10_21: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc10_21: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc10_21: = bound_method %int_0.loc10, %impl.elem0.loc10_21 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc10_21: = specific_function %Convert.bound.loc10_21, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc10_21: init %i32 = call %Convert.specific_fn.loc10_21(%int_0.loc10) [template = constants.%int_0.2] @@ -572,16 +518,16 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: %.loc10_23.1: %i32 = value_of_initializer %int.sdiv.loc10 [template = ] // CHECK:STDOUT: %.loc10_23.2: %i32 = converted %int.sdiv.loc10, %.loc10_23.1 [template = ] // CHECK:STDOUT: %a: %i32 = bind_name a, %.loc10_23.2 -// CHECK:STDOUT: %Div.ref.loc15: %Div.type = name_ref Div, file.%Div.decl [template = constants.%Div] +// CHECK:STDOUT: %Div.ref.loc15: %Div.type.1 = name_ref Div, file.%Div.decl [template = constants.%Div] // CHECK:STDOUT: %int_0.loc15_18: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %int_0.loc15_21: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0.loc15_18: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc15_18: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc15_18: = bound_method %int_0.loc15_18, %impl.elem0.loc15_18 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc15_18: = specific_function %Convert.bound.loc15_18, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc15_18: init %i32 = call %Convert.specific_fn.loc15_18(%int_0.loc15_18) [template = constants.%int_0.2] // CHECK:STDOUT: %.loc15_18.1: %i32 = value_of_initializer %int.convert_checked.loc15_18 [template = constants.%int_0.2] // CHECK:STDOUT: %.loc15_18.2: %i32 = converted %int_0.loc15_18, %.loc15_18.1 [template = constants.%int_0.2] -// CHECK:STDOUT: %impl.elem0.loc15_21: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc15_21: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc15_21: = bound_method %int_0.loc15_21, %impl.elem0.loc15_21 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc15_21: = specific_function %Convert.bound.loc15_21, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc15_21: init %i32 = call %Convert.specific_fn.loc15_21(%int_0.loc15_21) [template = constants.%int_0.2] diff --git a/toolchain/check/testdata/builtins/int/smod.carbon b/toolchain/check/testdata/builtins/int/smod.carbon index 56e1872126d77..514490a086f0f 100644 --- a/toolchain/check/testdata/builtins/int/smod.carbon +++ b/toolchain/check/testdata/builtins/int/smod.carbon @@ -64,30 +64,28 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] -// CHECK:STDOUT: %Mod.type: type = fn_type @Mod [template] -// CHECK:STDOUT: %Mod: %Mod.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] +// CHECK:STDOUT: %Mod.type.1: type = fn_type @Mod.1 [template] +// CHECK:STDOUT: %Mod: %Mod.type.1 = struct_value () [template] // CHECK:STDOUT: %int_5.1: Core.IntLiteral = int_value 5 [template] // CHECK:STDOUT: %int_3.1: Core.IntLiteral = int_value 3 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_5.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_5.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_5.2: %i32 = int_value 5 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_3.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_3.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_3.2: %i32 = int_value 3 [template] // CHECK:STDOUT: %int_2.1: %i32 = int_value 2 [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.4, @impl.3(%int_32) [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %interface.10: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_2.1, %Convert.15 [template] -// CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.4(%int_32) [template] +// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.3, @impl.2(%int_32) [template] +// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [template] +// CHECK:STDOUT: %interface.6: = interface_witness (%Convert.11) [template] +// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_2.1, %Convert.11 [template] +// CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.3(%int_32) [template] // CHECK:STDOUT: %int_2.2: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %array_type: type = array_type %int_2.2, %i32 [template] // CHECK:STDOUT: %ptr: type = ptr_type %array_type [template] @@ -98,7 +96,7 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -113,7 +111,7 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Mod.decl: %Mod.type = fn_decl @Mod [template = constants.%Mod] { +// CHECK:STDOUT: %Mod.decl: %Mod.type.1 = fn_decl @Mod.1 [template = constants.%Mod] { // CHECK:STDOUT: %a.patt: %i32 = binding_pattern a // CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: %i32 = binding_pattern b @@ -122,17 +120,11 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc2_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc2_11: init type = call constants.%Int(%int_32.loc2_11) [template = constants.%i32] -// CHECK:STDOUT: %.loc2_11.1: type = value_of_initializer %int.make_type_signed.loc2_11 [template = constants.%i32] -// CHECK:STDOUT: %.loc2_11.2: type = converted %int.make_type_signed.loc2_11, %.loc2_11.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc2_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc2_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc2_19: init type = call constants.%Int(%int_32.loc2_19) [template = constants.%i32] -// CHECK:STDOUT: %.loc2_19.1: type = value_of_initializer %int.make_type_signed.loc2_19 [template = constants.%i32] -// CHECK:STDOUT: %.loc2_19.2: type = converted %int.make_type_signed.loc2_19, %.loc2_19.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc2_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc2_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc2_27: init type = call constants.%Int(%int_32.loc2_27) [template = constants.%i32] -// CHECK:STDOUT: %.loc2_27.1: type = value_of_initializer %int.make_type_signed.loc2_27 [template = constants.%i32] -// CHECK:STDOUT: %.loc2_27.2: type = converted %int.make_type_signed.loc2_27, %.loc2_27.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc2_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 @@ -141,28 +133,26 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %int_32.loc4: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc4: init type = call constants.%Int(%int_32.loc4) [template = constants.%i32] -// CHECK:STDOUT: %Mod.ref: %Mod.type = name_ref Mod, %Mod.decl [template = constants.%Mod] +// CHECK:STDOUT: %i32.loc4: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %Mod.ref: %Mod.type.1 = name_ref Mod, %Mod.decl [template = constants.%Mod] // CHECK:STDOUT: %int_5: Core.IntLiteral = int_value 5 [template = constants.%int_5.1] // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] -// CHECK:STDOUT: %impl.elem0.loc4_20: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc4_20: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc4_20: = bound_method %int_5, %impl.elem0.loc4_20 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc4_20: = specific_function %Convert.bound.loc4_20, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc4_20: init %i32 = call %Convert.specific_fn.loc4_20(%int_5) [template = constants.%int_5.2] // CHECK:STDOUT: %.loc4_20.1: %i32 = value_of_initializer %int.convert_checked.loc4_20 [template = constants.%int_5.2] // CHECK:STDOUT: %.loc4_20.2: %i32 = converted %int_5, %.loc4_20.1 [template = constants.%int_5.2] -// CHECK:STDOUT: %impl.elem0.loc4_23: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc4_23: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc4_23: = bound_method %int_3, %impl.elem0.loc4_23 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc4_23: = specific_function %Convert.bound.loc4_23, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc4_23: init %i32 = call %Convert.specific_fn.loc4_23(%int_3) [template = constants.%int_3.2] // CHECK:STDOUT: %.loc4_23.1: %i32 = value_of_initializer %int.convert_checked.loc4_23 [template = constants.%int_3.2] // CHECK:STDOUT: %.loc4_23.2: %i32 = converted %int_3, %.loc4_23.1 [template = constants.%int_3.2] // CHECK:STDOUT: %int.smod: init %i32 = call %Mod.ref(%.loc4_20.2, %.loc4_23.2) [template = constants.%int_2.1] -// CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_signed.loc4 [template = constants.%i32] -// CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_signed.loc4, %.loc4_11.1 [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc4_24: %Convert.type.6 = interface_witness_access constants.%interface.10, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %impl.elem0.loc4_24: %Convert.type.5 = interface_witness_access constants.%interface.6, element0 [template = constants.%Convert.11] // CHECK:STDOUT: %Convert.bound.loc4_24: = bound_method %int.smod, %impl.elem0.loc4_24 [template = constants.%Convert.bound.3] -// CHECK:STDOUT: %Convert.specific_fn.loc4_24: = specific_function %Convert.bound.loc4_24, @Convert.4(constants.%int_32) [template = constants.%Convert.specific_fn.3] +// CHECK:STDOUT: %Convert.specific_fn.loc4_24: = specific_function %Convert.bound.loc4_24, @Convert.3(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %.loc4_24.1: %i32 = value_of_initializer %int.smod [template = constants.%int_2.1] // CHECK:STDOUT: %.loc4_24.2: %i32 = converted %int.smod, %.loc4_24.1 [template = constants.%int_2.1] // CHECK:STDOUT: %int.convert_checked.loc4_24: init Core.IntLiteral = call %Convert.specific_fn.loc4_24(%.loc4_24.2) [template = constants.%int_2.2] @@ -172,10 +162,8 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: %arr.var: ref %array_type = var arr // CHECK:STDOUT: %arr: ref %array_type = bind_name arr, %arr.var // CHECK:STDOUT: %int_32.loc5: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc5: init type = call constants.%Int(%int_32.loc5) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc5: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.2] -// CHECK:STDOUT: %.loc5_13.1: type = value_of_initializer %int.make_type_signed.loc5 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_13.2: type = converted %int.make_type_signed.loc5, %.loc5_13.1 [template = constants.%i32] // CHECK:STDOUT: %array_type.loc5: type = array_type %int_2, %i32 [template = constants.%array_type] // CHECK:STDOUT: %ptr: type = ptr_type %array_type [template = constants.%ptr] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { @@ -187,17 +175,11 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc7_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc7_19: init type = call constants.%Int(%int_32.loc7_19) [template = constants.%i32] -// CHECK:STDOUT: %.loc7_19.1: type = value_of_initializer %int.make_type_signed.loc7_19 [template = constants.%i32] -// CHECK:STDOUT: %.loc7_19.2: type = converted %int.make_type_signed.loc7_19, %.loc7_19.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc7_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc7_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc7_27: init type = call constants.%Int(%int_32.loc7_27) [template = constants.%i32] -// CHECK:STDOUT: %.loc7_27.1: type = value_of_initializer %int.make_type_signed.loc7_27 [template = constants.%i32] -// CHECK:STDOUT: %.loc7_27.2: type = converted %int.make_type_signed.loc7_27, %.loc7_27.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc7_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc7_35: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc7_35: init type = call constants.%Int(%int_32.loc7_35) [template = constants.%i32] -// CHECK:STDOUT: %.loc7_35.1: type = value_of_initializer %int.make_type_signed.loc7_35 [template = constants.%i32] -// CHECK:STDOUT: %.loc7_35.2: type = converted %int.make_type_signed.loc7_35, %.loc7_35.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc7_35: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 @@ -207,11 +189,11 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Mod(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.smod"; +// CHECK:STDOUT: fn @Mod.1(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.smod"; // CHECK:STDOUT: // CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Mod.ref: %Mod.type = name_ref Mod, file.%Mod.decl [template = constants.%Mod] +// CHECK:STDOUT: %Mod.ref: %Mod.type.1 = name_ref Mod, file.%Mod.decl [template = constants.%Mod] // CHECK:STDOUT: %a.ref: %i32 = name_ref a, %a // CHECK:STDOUT: %b.ref: %i32 = name_ref b, %b // CHECK:STDOUT: %int.smod: init %i32 = call %Mod.ref(%a.ref, %b.ref) @@ -232,26 +214,24 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] -// CHECK:STDOUT: %Mod.type: type = fn_type @Mod [template] -// CHECK:STDOUT: %Mod: %Mod.type = struct_value () [template] -// CHECK:STDOUT: %Sub.type: type = fn_type @Sub [template] -// CHECK:STDOUT: %Sub: %Sub.type = struct_value () [template] -// CHECK:STDOUT: %Negate.type: type = fn_type @Negate [template] -// CHECK:STDOUT: %Negate: %Negate.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] +// CHECK:STDOUT: %Mod.type.1: type = fn_type @Mod.1 [template] +// CHECK:STDOUT: %Mod: %Mod.type.1 = struct_value () [template] +// CHECK:STDOUT: %Sub.type.1: type = fn_type @Sub.1 [template] +// CHECK:STDOUT: %Sub: %Sub.type.1 = struct_value () [template] +// CHECK:STDOUT: %Negate.type.1: type = fn_type @Negate.1 [template] +// CHECK:STDOUT: %Negate: %Negate.type.1 = struct_value () [template] // CHECK:STDOUT: %int_2147483647.1: Core.IntLiteral = int_value 2147483647 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_2147483647.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_2147483647.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2147483647.2: %i32 = int_value 2147483647 [template] // CHECK:STDOUT: %int_-2147483647: %i32 = int_value -2147483647 [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] // CHECK:STDOUT: %int_-1: %i32 = int_value -1 [template] @@ -262,7 +242,7 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -279,7 +259,7 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: .c = @__global_init.%c // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Mod.decl: %Mod.type = fn_decl @Mod [template = constants.%Mod] { +// CHECK:STDOUT: %Mod.decl: %Mod.type.1 = fn_decl @Mod.1 [template = constants.%Mod] { // CHECK:STDOUT: %a.patt: %i32 = binding_pattern a // CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: %i32 = binding_pattern b @@ -288,17 +268,11 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc4_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc4_11: init type = call constants.%Int(%int_32.loc4_11) [template = constants.%i32] -// CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_signed.loc4_11 [template = constants.%i32] -// CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_signed.loc4_11, %.loc4_11.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc4_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc4_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc4_19: init type = call constants.%Int(%int_32.loc4_19) [template = constants.%i32] -// CHECK:STDOUT: %.loc4_19.1: type = value_of_initializer %int.make_type_signed.loc4_19 [template = constants.%i32] -// CHECK:STDOUT: %.loc4_19.2: type = converted %int.make_type_signed.loc4_19, %.loc4_19.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc4_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc4_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc4_27: init type = call constants.%Int(%int_32.loc4_27) [template = constants.%i32] -// CHECK:STDOUT: %.loc4_27.1: type = value_of_initializer %int.make_type_signed.loc4_27 [template = constants.%i32] -// CHECK:STDOUT: %.loc4_27.2: type = converted %int.make_type_signed.loc4_27, %.loc4_27.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc4_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 @@ -306,7 +280,7 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %Sub.decl: %Sub.type = fn_decl @Sub [template = constants.%Sub] { +// CHECK:STDOUT: %Sub.decl: %Sub.type.1 = fn_decl @Sub.1 [template = constants.%Sub] { // CHECK:STDOUT: %a.patt: %i32 = binding_pattern a // CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: %i32 = binding_pattern b @@ -315,17 +289,11 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc5_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc5_11: init type = call constants.%Int(%int_32.loc5_11) [template = constants.%i32] -// CHECK:STDOUT: %.loc5_11.1: type = value_of_initializer %int.make_type_signed.loc5_11 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_11.2: type = converted %int.make_type_signed.loc5_11, %.loc5_11.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc5_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc5_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc5_19: init type = call constants.%Int(%int_32.loc5_19) [template = constants.%i32] -// CHECK:STDOUT: %.loc5_19.1: type = value_of_initializer %int.make_type_signed.loc5_19 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_19.2: type = converted %int.make_type_signed.loc5_19, %.loc5_19.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc5_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc5_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc5_27: init type = call constants.%Int(%int_32.loc5_27) [template = constants.%i32] -// CHECK:STDOUT: %.loc5_27.1: type = value_of_initializer %int.make_type_signed.loc5_27 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_27.2: type = converted %int.make_type_signed.loc5_27, %.loc5_27.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc5_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 @@ -333,60 +301,50 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %Negate.decl: %Negate.type = fn_decl @Negate [template = constants.%Negate] { +// CHECK:STDOUT: %Negate.decl: %Negate.type.1 = fn_decl @Negate.1 [template = constants.%Negate] { // CHECK:STDOUT: %a.patt: %i32 = binding_pattern a // CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc6_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc6_14: init type = call constants.%Int(%int_32.loc6_14) [template = constants.%i32] -// CHECK:STDOUT: %.loc6_14.1: type = value_of_initializer %int.make_type_signed.loc6_14 [template = constants.%i32] -// CHECK:STDOUT: %.loc6_14.2: type = converted %int.make_type_signed.loc6_14, %.loc6_14.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc6_14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc6_22: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc6_22: init type = call constants.%Int(%int_32.loc6_22) [template = constants.%i32] -// CHECK:STDOUT: %.loc6_22.1: type = value_of_initializer %int.make_type_signed.loc6_22 [template = constants.%i32] -// CHECK:STDOUT: %.loc6_22.2: type = converted %int.make_type_signed.loc6_22, %.loc6_22.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc6_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %int_32.loc9: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc9: init type = call constants.%Int(%int_32.loc9) [template = constants.%i32] -// CHECK:STDOUT: %.loc9_8.1: type = value_of_initializer %int.make_type_signed.loc9 [template = constants.%i32] -// CHECK:STDOUT: %.loc9_8.2: type = converted %int.make_type_signed.loc9, %.loc9_8.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc9: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc12: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc12: init type = call constants.%Int(%int_32.loc12) [template = constants.%i32] -// CHECK:STDOUT: %.loc12_8.1: type = value_of_initializer %int.make_type_signed.loc12 [template = constants.%i32] -// CHECK:STDOUT: %.loc12_8.2: type = converted %int.make_type_signed.loc12, %.loc12_8.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc12: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc20: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc20: init type = call constants.%Int(%int_32.loc20) [template = constants.%i32] -// CHECK:STDOUT: %.loc20_8.1: type = value_of_initializer %int.make_type_signed.loc20 [template = constants.%i32] -// CHECK:STDOUT: %.loc20_8.2: type = converted %int.make_type_signed.loc20, %.loc20_8.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc20: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Mod(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.smod"; +// CHECK:STDOUT: fn @Mod.1(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.smod"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Sub(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.ssub"; +// CHECK:STDOUT: fn @Sub.1(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.ssub"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Negate(%a.param_patt: %i32) -> %i32 = "int.snegate"; +// CHECK:STDOUT: fn @Negate.1(%a.param_patt: %i32) -> %i32 = "int.snegate"; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Mod.ref.loc9: %Mod.type = name_ref Mod, file.%Mod.decl [template = constants.%Mod] -// CHECK:STDOUT: %Negate.ref.loc9_18: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] +// CHECK:STDOUT: %Mod.ref.loc9: %Mod.type.1 = name_ref Mod, file.%Mod.decl [template = constants.%Mod] +// CHECK:STDOUT: %Negate.ref.loc9_18: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %int_2147483647.loc9: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] -// CHECK:STDOUT: %impl.elem0.loc9_25: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc9_25: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc9_25: = bound_method %int_2147483647.loc9, %impl.elem0.loc9_25 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc9_25: = specific_function %Convert.bound.loc9_25, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc9_25: init %i32 = call %Convert.specific_fn.loc9_25(%int_2147483647.loc9) [template = constants.%int_2147483647.2] // CHECK:STDOUT: %.loc9_25.1: %i32 = value_of_initializer %int.convert_checked.loc9_25 [template = constants.%int_2147483647.2] // CHECK:STDOUT: %.loc9_25.2: %i32 = converted %int_2147483647.loc9, %.loc9_25.1 [template = constants.%int_2147483647.2] // CHECK:STDOUT: %int.snegate.loc9_36: init %i32 = call %Negate.ref.loc9_18(%.loc9_25.2) [template = constants.%int_-2147483647] -// CHECK:STDOUT: %Negate.ref.loc9_39: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] +// CHECK:STDOUT: %Negate.ref.loc9_39: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %int_1.loc9: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc9_46: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc9_46: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc9_46: = bound_method %int_1.loc9, %impl.elem0.loc9_46 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc9_46: = specific_function %Convert.bound.loc9_46, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc9_46: init %i32 = call %Convert.specific_fn.loc9_46(%int_1.loc9) [template = constants.%int_1.2] @@ -401,11 +359,11 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: %.loc9_49.1: %i32 = value_of_initializer %int.smod.loc9 [template = constants.%int_0] // CHECK:STDOUT: %.loc9_49.2: %i32 = converted %int.smod.loc9, %.loc9_49.1 [template = constants.%int_0] // CHECK:STDOUT: %a: %i32 = bind_name a, %.loc9_49.2 -// CHECK:STDOUT: %Mod.ref.loc12: %Mod.type = name_ref Mod, file.%Mod.decl [template = constants.%Mod] -// CHECK:STDOUT: %Sub.ref.loc12: %Sub.type = name_ref Sub, file.%Sub.decl [template = constants.%Sub] -// CHECK:STDOUT: %Negate.ref.loc12: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] +// CHECK:STDOUT: %Mod.ref.loc12: %Mod.type.1 = name_ref Mod, file.%Mod.decl [template = constants.%Mod] +// CHECK:STDOUT: %Sub.ref.loc12: %Sub.type.1 = name_ref Sub, file.%Sub.decl [template = constants.%Sub] +// CHECK:STDOUT: %Negate.ref.loc12: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %int_2147483647.loc12: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] -// CHECK:STDOUT: %impl.elem0.loc12_29: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc12_29: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc12_29: = bound_method %int_2147483647.loc12, %impl.elem0.loc12_29 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc12_29: = specific_function %Convert.bound.loc12_29, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc12_29: init %i32 = call %Convert.specific_fn.loc12_29(%int_2147483647.loc12) [template = constants.%int_2147483647.2] @@ -415,7 +373,7 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: %int_1.loc12_43: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %.loc12_40.1: %i32 = value_of_initializer %int.snegate.loc12 [template = constants.%int_-2147483647] // CHECK:STDOUT: %.loc12_40.2: %i32 = converted %int.snegate.loc12, %.loc12_40.1 [template = constants.%int_-2147483647] -// CHECK:STDOUT: %impl.elem0.loc12_43: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc12_43: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc12_43: = bound_method %int_1.loc12_43, %impl.elem0.loc12_43 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc12_43: = specific_function %Convert.bound.loc12_43, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc12_43: init %i32 = call %Convert.specific_fn.loc12_43(%int_1.loc12_43) [template = constants.%int_1.2] @@ -425,7 +383,7 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: %int_1.loc12_47: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %.loc12_44.1: %i32 = value_of_initializer %int.ssub.loc12 [template = constants.%int_-2147483648] // CHECK:STDOUT: %.loc12_44.2: %i32 = converted %int.ssub.loc12, %.loc12_44.1 [template = constants.%int_-2147483648] -// CHECK:STDOUT: %impl.elem0.loc12_47: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc12_47: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc12_47: = bound_method %int_1.loc12_47, %impl.elem0.loc12_47 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc12_47: = specific_function %Convert.bound.loc12_47, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc12_47: init %i32 = call %Convert.specific_fn.loc12_47(%int_1.loc12_47) [template = constants.%int_1.2] @@ -435,11 +393,11 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: %.loc12_49.1: %i32 = value_of_initializer %int.smod.loc12 [template = constants.%int_0] // CHECK:STDOUT: %.loc12_49.2: %i32 = converted %int.smod.loc12, %.loc12_49.1 [template = constants.%int_0] // CHECK:STDOUT: %b: %i32 = bind_name b, %.loc12_49.2 -// CHECK:STDOUT: %Mod.ref.loc20: %Mod.type = name_ref Mod, file.%Mod.decl [template = constants.%Mod] -// CHECK:STDOUT: %Sub.ref.loc20: %Sub.type = name_ref Sub, file.%Sub.decl [template = constants.%Sub] -// CHECK:STDOUT: %Negate.ref.loc20_22: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] +// CHECK:STDOUT: %Mod.ref.loc20: %Mod.type.1 = name_ref Mod, file.%Mod.decl [template = constants.%Mod] +// CHECK:STDOUT: %Sub.ref.loc20: %Sub.type.1 = name_ref Sub, file.%Sub.decl [template = constants.%Sub] +// CHECK:STDOUT: %Negate.ref.loc20_22: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %int_2147483647.loc20: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] -// CHECK:STDOUT: %impl.elem0.loc20_29: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc20_29: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc20_29: = bound_method %int_2147483647.loc20, %impl.elem0.loc20_29 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc20_29: = specific_function %Convert.bound.loc20_29, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc20_29: init %i32 = call %Convert.specific_fn.loc20_29(%int_2147483647.loc20) [template = constants.%int_2147483647.2] @@ -449,16 +407,16 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: %int_1.loc20_43: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %.loc20_40.1: %i32 = value_of_initializer %int.snegate.loc20_40 [template = constants.%int_-2147483647] // CHECK:STDOUT: %.loc20_40.2: %i32 = converted %int.snegate.loc20_40, %.loc20_40.1 [template = constants.%int_-2147483647] -// CHECK:STDOUT: %impl.elem0.loc20_43: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc20_43: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc20_43: = bound_method %int_1.loc20_43, %impl.elem0.loc20_43 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc20_43: = specific_function %Convert.bound.loc20_43, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc20_43: init %i32 = call %Convert.specific_fn.loc20_43(%int_1.loc20_43) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc20_43.1: %i32 = value_of_initializer %int.convert_checked.loc20_43 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc20_43.2: %i32 = converted %int_1.loc20_43, %.loc20_43.1 [template = constants.%int_1.2] // CHECK:STDOUT: %int.ssub.loc20: init %i32 = call %Sub.ref.loc20(%.loc20_40.2, %.loc20_43.2) [template = constants.%int_-2147483648] -// CHECK:STDOUT: %Negate.ref.loc20_47: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] +// CHECK:STDOUT: %Negate.ref.loc20_47: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %int_1.loc20_54: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc20_54: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc20_54: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc20_54: = bound_method %int_1.loc20_54, %impl.elem0.loc20_54 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc20_54: = specific_function %Convert.bound.loc20_54, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc20_54: init %i32 = call %Convert.specific_fn.loc20_54(%int_1.loc20_54) [template = constants.%int_1.2] @@ -480,21 +438,19 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] -// CHECK:STDOUT: %Mod.type: type = fn_type @Mod [template] -// CHECK:STDOUT: %Mod: %Mod.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] +// CHECK:STDOUT: %Mod.type.1: type = fn_type @Mod.1 [template] +// CHECK:STDOUT: %Mod: %Mod.type.1 = struct_value () [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_0.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] // CHECK:STDOUT: } @@ -502,7 +458,7 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -516,7 +472,7 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: .b = @__global_init.%b // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Mod.decl: %Mod.type = fn_decl @Mod [template = constants.%Mod] { +// CHECK:STDOUT: %Mod.decl: %Mod.type.1 = fn_decl @Mod.1 [template = constants.%Mod] { // CHECK:STDOUT: %a.patt: %i32 = binding_pattern a // CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: %i32 = binding_pattern b @@ -525,17 +481,11 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc4_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc4_11: init type = call constants.%Int(%int_32.loc4_11) [template = constants.%i32] -// CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_signed.loc4_11 [template = constants.%i32] -// CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_signed.loc4_11, %.loc4_11.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc4_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc4_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc4_19: init type = call constants.%Int(%int_32.loc4_19) [template = constants.%i32] -// CHECK:STDOUT: %.loc4_19.1: type = value_of_initializer %int.make_type_signed.loc4_19 [template = constants.%i32] -// CHECK:STDOUT: %.loc4_19.2: type = converted %int.make_type_signed.loc4_19, %.loc4_19.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc4_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc4_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc4_27: init type = call constants.%Int(%int_32.loc4_27) [template = constants.%i32] -// CHECK:STDOUT: %.loc4_27.1: type = value_of_initializer %int.make_type_signed.loc4_27 [template = constants.%i32] -// CHECK:STDOUT: %.loc4_27.2: type = converted %int.make_type_signed.loc4_27, %.loc4_27.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc4_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 @@ -544,29 +494,25 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %int_32.loc12: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc12: init type = call constants.%Int(%int_32.loc12) [template = constants.%i32] -// CHECK:STDOUT: %.loc12_8.1: type = value_of_initializer %int.make_type_signed.loc12 [template = constants.%i32] -// CHECK:STDOUT: %.loc12_8.2: type = converted %int.make_type_signed.loc12, %.loc12_8.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc12: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc17: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc17: init type = call constants.%Int(%int_32.loc17) [template = constants.%i32] -// CHECK:STDOUT: %.loc17_8.1: type = value_of_initializer %int.make_type_signed.loc17 [template = constants.%i32] -// CHECK:STDOUT: %.loc17_8.2: type = converted %int.make_type_signed.loc17, %.loc17_8.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Mod(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.smod"; +// CHECK:STDOUT: fn @Mod.1(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.smod"; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Mod.ref.loc12: %Mod.type = name_ref Mod, file.%Mod.decl [template = constants.%Mod] +// CHECK:STDOUT: %Mod.ref.loc12: %Mod.type.1 = name_ref Mod, file.%Mod.decl [template = constants.%Mod] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_0.loc12: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0.loc12_18: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc12_18: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc12_18: = bound_method %int_1, %impl.elem0.loc12_18 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc12_18: = specific_function %Convert.bound.loc12_18, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc12_18: init %i32 = call %Convert.specific_fn.loc12_18(%int_1) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc12_18.1: %i32 = value_of_initializer %int.convert_checked.loc12_18 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc12_18.2: %i32 = converted %int_1, %.loc12_18.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc12_21: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc12_21: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc12_21: = bound_method %int_0.loc12, %impl.elem0.loc12_21 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc12_21: = specific_function %Convert.bound.loc12_21, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc12_21: init %i32 = call %Convert.specific_fn.loc12_21(%int_0.loc12) [template = constants.%int_0.2] @@ -576,16 +522,16 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: %.loc12_23.1: %i32 = value_of_initializer %int.smod.loc12 [template = ] // CHECK:STDOUT: %.loc12_23.2: %i32 = converted %int.smod.loc12, %.loc12_23.1 [template = ] // CHECK:STDOUT: %a: %i32 = bind_name a, %.loc12_23.2 -// CHECK:STDOUT: %Mod.ref.loc17: %Mod.type = name_ref Mod, file.%Mod.decl [template = constants.%Mod] +// CHECK:STDOUT: %Mod.ref.loc17: %Mod.type.1 = name_ref Mod, file.%Mod.decl [template = constants.%Mod] // CHECK:STDOUT: %int_0.loc17_18: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %int_0.loc17_21: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0.loc17_18: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc17_18: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc17_18: = bound_method %int_0.loc17_18, %impl.elem0.loc17_18 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc17_18: = specific_function %Convert.bound.loc17_18, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc17_18: init %i32 = call %Convert.specific_fn.loc17_18(%int_0.loc17_18) [template = constants.%int_0.2] // CHECK:STDOUT: %.loc17_18.1: %i32 = value_of_initializer %int.convert_checked.loc17_18 [template = constants.%int_0.2] // CHECK:STDOUT: %.loc17_18.2: %i32 = converted %int_0.loc17_18, %.loc17_18.1 [template = constants.%int_0.2] -// CHECK:STDOUT: %impl.elem0.loc17_21: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc17_21: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc17_21: = bound_method %int_0.loc17_21, %impl.elem0.loc17_21 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc17_21: = specific_function %Convert.bound.loc17_21, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc17_21: init %i32 = call %Convert.specific_fn.loc17_21(%int_0.loc17_21) [template = constants.%int_0.2] diff --git a/toolchain/check/testdata/builtins/int/smul.carbon b/toolchain/check/testdata/builtins/int/smul.carbon index 7b66682a17549..28c34a728c36e 100644 --- a/toolchain/check/testdata/builtins/int/smul.carbon +++ b/toolchain/check/testdata/builtins/int/smul.carbon @@ -35,30 +35,28 @@ let b: i32 = Mul(0x8000, 0x10000); // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] -// CHECK:STDOUT: %Mul.type: type = fn_type @Mul [template] -// CHECK:STDOUT: %Mul: %Mul.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] +// CHECK:STDOUT: %Mul.type.1: type = fn_type @Mul.1 [template] +// CHECK:STDOUT: %Mul: %Mul.type.1 = struct_value () [template] // CHECK:STDOUT: %int_3.1: Core.IntLiteral = int_value 3 [template] // CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_3.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_3.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_3.2: %i32 = int_value 3 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] // CHECK:STDOUT: %int_6.1: %i32 = int_value 6 [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.4, @impl.3(%int_32) [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %interface.10: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_6.1, %Convert.15 [template] -// CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.4(%int_32) [template] +// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.3, @impl.2(%int_32) [template] +// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [template] +// CHECK:STDOUT: %interface.6: = interface_witness (%Convert.11) [template] +// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_6.1, %Convert.11 [template] +// CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.3(%int_32) [template] // CHECK:STDOUT: %int_6.2: Core.IntLiteral = int_value 6 [template] // CHECK:STDOUT: %array_type: type = array_type %int_6.2, %i32 [template] // CHECK:STDOUT: %ptr: type = ptr_type %array_type [template] @@ -69,7 +67,7 @@ let b: i32 = Mul(0x8000, 0x10000); // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -84,7 +82,7 @@ let b: i32 = Mul(0x8000, 0x10000); // CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Mul.decl: %Mul.type = fn_decl @Mul [template = constants.%Mul] { +// CHECK:STDOUT: %Mul.decl: %Mul.type.1 = fn_decl @Mul.1 [template = constants.%Mul] { // CHECK:STDOUT: %a.patt: %i32 = binding_pattern a // CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: %i32 = binding_pattern b @@ -93,17 +91,11 @@ let b: i32 = Mul(0x8000, 0x10000); // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc2_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc2_11: init type = call constants.%Int(%int_32.loc2_11) [template = constants.%i32] -// CHECK:STDOUT: %.loc2_11.1: type = value_of_initializer %int.make_type_signed.loc2_11 [template = constants.%i32] -// CHECK:STDOUT: %.loc2_11.2: type = converted %int.make_type_signed.loc2_11, %.loc2_11.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc2_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc2_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc2_19: init type = call constants.%Int(%int_32.loc2_19) [template = constants.%i32] -// CHECK:STDOUT: %.loc2_19.1: type = value_of_initializer %int.make_type_signed.loc2_19 [template = constants.%i32] -// CHECK:STDOUT: %.loc2_19.2: type = converted %int.make_type_signed.loc2_19, %.loc2_19.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc2_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc2_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc2_27: init type = call constants.%Int(%int_32.loc2_27) [template = constants.%i32] -// CHECK:STDOUT: %.loc2_27.1: type = value_of_initializer %int.make_type_signed.loc2_27 [template = constants.%i32] -// CHECK:STDOUT: %.loc2_27.2: type = converted %int.make_type_signed.loc2_27, %.loc2_27.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc2_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 @@ -112,28 +104,26 @@ let b: i32 = Mul(0x8000, 0x10000); // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %int_32.loc4: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc4: init type = call constants.%Int(%int_32.loc4) [template = constants.%i32] -// CHECK:STDOUT: %Mul.ref: %Mul.type = name_ref Mul, %Mul.decl [template = constants.%Mul] +// CHECK:STDOUT: %i32.loc4: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %Mul.ref: %Mul.type.1 = name_ref Mul, %Mul.decl [template = constants.%Mul] // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %impl.elem0.loc4_20: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc4_20: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc4_20: = bound_method %int_3, %impl.elem0.loc4_20 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc4_20: = specific_function %Convert.bound.loc4_20, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc4_20: init %i32 = call %Convert.specific_fn.loc4_20(%int_3) [template = constants.%int_3.2] // CHECK:STDOUT: %.loc4_20.1: %i32 = value_of_initializer %int.convert_checked.loc4_20 [template = constants.%int_3.2] // CHECK:STDOUT: %.loc4_20.2: %i32 = converted %int_3, %.loc4_20.1 [template = constants.%int_3.2] -// CHECK:STDOUT: %impl.elem0.loc4_23: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc4_23: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc4_23: = bound_method %int_2, %impl.elem0.loc4_23 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc4_23: = specific_function %Convert.bound.loc4_23, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc4_23: init %i32 = call %Convert.specific_fn.loc4_23(%int_2) [template = constants.%int_2.2] // CHECK:STDOUT: %.loc4_23.1: %i32 = value_of_initializer %int.convert_checked.loc4_23 [template = constants.%int_2.2] // CHECK:STDOUT: %.loc4_23.2: %i32 = converted %int_2, %.loc4_23.1 [template = constants.%int_2.2] // CHECK:STDOUT: %int.smul: init %i32 = call %Mul.ref(%.loc4_20.2, %.loc4_23.2) [template = constants.%int_6.1] -// CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_signed.loc4 [template = constants.%i32] -// CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_signed.loc4, %.loc4_11.1 [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc4_24: %Convert.type.6 = interface_witness_access constants.%interface.10, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %impl.elem0.loc4_24: %Convert.type.5 = interface_witness_access constants.%interface.6, element0 [template = constants.%Convert.11] // CHECK:STDOUT: %Convert.bound.loc4_24: = bound_method %int.smul, %impl.elem0.loc4_24 [template = constants.%Convert.bound.3] -// CHECK:STDOUT: %Convert.specific_fn.loc4_24: = specific_function %Convert.bound.loc4_24, @Convert.4(constants.%int_32) [template = constants.%Convert.specific_fn.3] +// CHECK:STDOUT: %Convert.specific_fn.loc4_24: = specific_function %Convert.bound.loc4_24, @Convert.3(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %.loc4_24.1: %i32 = value_of_initializer %int.smul [template = constants.%int_6.1] // CHECK:STDOUT: %.loc4_24.2: %i32 = converted %int.smul, %.loc4_24.1 [template = constants.%int_6.1] // CHECK:STDOUT: %int.convert_checked.loc4_24: init Core.IntLiteral = call %Convert.specific_fn.loc4_24(%.loc4_24.2) [template = constants.%int_6.2] @@ -143,10 +133,8 @@ let b: i32 = Mul(0x8000, 0x10000); // CHECK:STDOUT: %arr.var: ref %array_type = var arr // CHECK:STDOUT: %arr: ref %array_type = bind_name arr, %arr.var // CHECK:STDOUT: %int_32.loc5: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc5: init type = call constants.%Int(%int_32.loc5) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc5: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_6: Core.IntLiteral = int_value 6 [template = constants.%int_6.2] -// CHECK:STDOUT: %.loc5_13.1: type = value_of_initializer %int.make_type_signed.loc5 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_13.2: type = converted %int.make_type_signed.loc5, %.loc5_13.1 [template = constants.%i32] // CHECK:STDOUT: %array_type.loc5: type = array_type %int_6, %i32 [template = constants.%array_type] // CHECK:STDOUT: %ptr: type = ptr_type %array_type [template = constants.%ptr] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { @@ -158,17 +146,11 @@ let b: i32 = Mul(0x8000, 0x10000); // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc7_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc7_19: init type = call constants.%Int(%int_32.loc7_19) [template = constants.%i32] -// CHECK:STDOUT: %.loc7_19.1: type = value_of_initializer %int.make_type_signed.loc7_19 [template = constants.%i32] -// CHECK:STDOUT: %.loc7_19.2: type = converted %int.make_type_signed.loc7_19, %.loc7_19.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc7_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc7_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc7_27: init type = call constants.%Int(%int_32.loc7_27) [template = constants.%i32] -// CHECK:STDOUT: %.loc7_27.1: type = value_of_initializer %int.make_type_signed.loc7_27 [template = constants.%i32] -// CHECK:STDOUT: %.loc7_27.2: type = converted %int.make_type_signed.loc7_27, %.loc7_27.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc7_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc7_35: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc7_35: init type = call constants.%Int(%int_32.loc7_35) [template = constants.%i32] -// CHECK:STDOUT: %.loc7_35.1: type = value_of_initializer %int.make_type_signed.loc7_35 [template = constants.%i32] -// CHECK:STDOUT: %.loc7_35.2: type = converted %int.make_type_signed.loc7_35, %.loc7_35.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc7_35: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 @@ -178,11 +160,11 @@ let b: i32 = Mul(0x8000, 0x10000); // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Mul(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.smul"; +// CHECK:STDOUT: fn @Mul.1(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.smul"; // CHECK:STDOUT: // CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Mul.ref: %Mul.type = name_ref Mul, file.%Mul.decl [template = constants.%Mul] +// CHECK:STDOUT: %Mul.ref: %Mul.type.1 = name_ref Mul, file.%Mul.decl [template = constants.%Mul] // CHECK:STDOUT: %a.ref: %i32 = name_ref a, %a // CHECK:STDOUT: %b.ref: %i32 = name_ref b, %b // CHECK:STDOUT: %int.smul: init %i32 = call %Mul.ref(%a.ref, %b.ref) @@ -203,26 +185,24 @@ let b: i32 = Mul(0x8000, 0x10000); // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] -// CHECK:STDOUT: %Mul.type: type = fn_type @Mul [template] -// CHECK:STDOUT: %Mul: %Mul.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] +// CHECK:STDOUT: %Mul.type.1: type = fn_type @Mul.1 [template] +// CHECK:STDOUT: %Mul: %Mul.type.1 = struct_value () [template] // CHECK:STDOUT: %int_32767.1: Core.IntLiteral = int_value 32767 [template] // CHECK:STDOUT: %int_65536.1: Core.IntLiteral = int_value 65536 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_32767.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_32767.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_32767.2: %i32 = int_value 32767 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_65536.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_65536.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_65536.2: %i32 = int_value 65536 [template] // CHECK:STDOUT: %int_2147418112: %i32 = int_value 2147418112 [template] // CHECK:STDOUT: %int_32768.1: Core.IntLiteral = int_value 32768 [template] -// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_32768.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_32768.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_32768.2: %i32 = int_value 32768 [template] // CHECK:STDOUT: %int_-2147483648: %i32 = int_value -2147483648 [template] @@ -231,7 +211,7 @@ let b: i32 = Mul(0x8000, 0x10000); // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -245,7 +225,7 @@ let b: i32 = Mul(0x8000, 0x10000); // CHECK:STDOUT: .b = @__global_init.%b // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Mul.decl: %Mul.type = fn_decl @Mul [template = constants.%Mul] { +// CHECK:STDOUT: %Mul.decl: %Mul.type.1 = fn_decl @Mul.1 [template = constants.%Mul] { // CHECK:STDOUT: %a.patt: %i32 = binding_pattern a // CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: %i32 = binding_pattern b @@ -254,17 +234,11 @@ let b: i32 = Mul(0x8000, 0x10000); // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc4_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc4_11: init type = call constants.%Int(%int_32.loc4_11) [template = constants.%i32] -// CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_signed.loc4_11 [template = constants.%i32] -// CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_signed.loc4_11, %.loc4_11.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc4_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc4_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc4_19: init type = call constants.%Int(%int_32.loc4_19) [template = constants.%i32] -// CHECK:STDOUT: %.loc4_19.1: type = value_of_initializer %int.make_type_signed.loc4_19 [template = constants.%i32] -// CHECK:STDOUT: %.loc4_19.2: type = converted %int.make_type_signed.loc4_19, %.loc4_19.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc4_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc4_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc4_27: init type = call constants.%Int(%int_32.loc4_27) [template = constants.%i32] -// CHECK:STDOUT: %.loc4_27.1: type = value_of_initializer %int.make_type_signed.loc4_27 [template = constants.%i32] -// CHECK:STDOUT: %.loc4_27.2: type = converted %int.make_type_signed.loc4_27, %.loc4_27.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc4_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 @@ -273,29 +247,25 @@ let b: i32 = Mul(0x8000, 0x10000); // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %int_32.loc6: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc6: init type = call constants.%Int(%int_32.loc6) [template = constants.%i32] -// CHECK:STDOUT: %.loc6_8.1: type = value_of_initializer %int.make_type_signed.loc6 [template = constants.%i32] -// CHECK:STDOUT: %.loc6_8.2: type = converted %int.make_type_signed.loc6, %.loc6_8.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc6: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc10: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc10: init type = call constants.%Int(%int_32.loc10) [template = constants.%i32] -// CHECK:STDOUT: %.loc10_8.1: type = value_of_initializer %int.make_type_signed.loc10 [template = constants.%i32] -// CHECK:STDOUT: %.loc10_8.2: type = converted %int.make_type_signed.loc10, %.loc10_8.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc10: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Mul(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.smul"; +// CHECK:STDOUT: fn @Mul.1(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.smul"; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Mul.ref.loc6: %Mul.type = name_ref Mul, file.%Mul.decl [template = constants.%Mul] +// CHECK:STDOUT: %Mul.ref.loc6: %Mul.type.1 = name_ref Mul, file.%Mul.decl [template = constants.%Mul] // CHECK:STDOUT: %int_32767: Core.IntLiteral = int_value 32767 [template = constants.%int_32767.1] // CHECK:STDOUT: %int_65536.loc6: Core.IntLiteral = int_value 65536 [template = constants.%int_65536.1] -// CHECK:STDOUT: %impl.elem0.loc6_18: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc6_18: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc6_18: = bound_method %int_32767, %impl.elem0.loc6_18 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc6_18: = specific_function %Convert.bound.loc6_18, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc6_18: init %i32 = call %Convert.specific_fn.loc6_18(%int_32767) [template = constants.%int_32767.2] // CHECK:STDOUT: %.loc6_18.1: %i32 = value_of_initializer %int.convert_checked.loc6_18 [template = constants.%int_32767.2] // CHECK:STDOUT: %.loc6_18.2: %i32 = converted %int_32767, %.loc6_18.1 [template = constants.%int_32767.2] -// CHECK:STDOUT: %impl.elem0.loc6_26: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc6_26: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc6_26: = bound_method %int_65536.loc6, %impl.elem0.loc6_26 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc6_26: = specific_function %Convert.bound.loc6_26, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc6_26: init %i32 = call %Convert.specific_fn.loc6_26(%int_65536.loc6) [template = constants.%int_65536.2] @@ -305,16 +275,16 @@ let b: i32 = Mul(0x8000, 0x10000); // CHECK:STDOUT: %.loc6_34.1: %i32 = value_of_initializer %int.smul.loc6 [template = constants.%int_2147418112] // CHECK:STDOUT: %.loc6_34.2: %i32 = converted %int.smul.loc6, %.loc6_34.1 [template = constants.%int_2147418112] // CHECK:STDOUT: %a: %i32 = bind_name a, %.loc6_34.2 -// CHECK:STDOUT: %Mul.ref.loc10: %Mul.type = name_ref Mul, file.%Mul.decl [template = constants.%Mul] +// CHECK:STDOUT: %Mul.ref.loc10: %Mul.type.1 = name_ref Mul, file.%Mul.decl [template = constants.%Mul] // CHECK:STDOUT: %int_32768: Core.IntLiteral = int_value 32768 [template = constants.%int_32768.1] // CHECK:STDOUT: %int_65536.loc10: Core.IntLiteral = int_value 65536 [template = constants.%int_65536.1] -// CHECK:STDOUT: %impl.elem0.loc10_18: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc10_18: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc10_18: = bound_method %int_32768, %impl.elem0.loc10_18 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc10_18: = specific_function %Convert.bound.loc10_18, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc10_18: init %i32 = call %Convert.specific_fn.loc10_18(%int_32768) [template = constants.%int_32768.2] // CHECK:STDOUT: %.loc10_18.1: %i32 = value_of_initializer %int.convert_checked.loc10_18 [template = constants.%int_32768.2] // CHECK:STDOUT: %.loc10_18.2: %i32 = converted %int_32768, %.loc10_18.1 [template = constants.%int_32768.2] -// CHECK:STDOUT: %impl.elem0.loc10_26: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc10_26: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc10_26: = bound_method %int_65536.loc10, %impl.elem0.loc10_26 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc10_26: = specific_function %Convert.bound.loc10_26, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc10_26: init %i32 = call %Convert.specific_fn.loc10_26(%int_65536.loc10) [template = constants.%int_65536.2] diff --git a/toolchain/check/testdata/builtins/int/snegate.carbon b/toolchain/check/testdata/builtins/int/snegate.carbon index f4019fdfa8092..78e436b3f7fc1 100644 --- a/toolchain/check/testdata/builtins/int/snegate.carbon +++ b/toolchain/check/testdata/builtins/int/snegate.carbon @@ -120,30 +120,28 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] -// CHECK:STDOUT: %Negate.type: type = fn_type @Negate [template] -// CHECK:STDOUT: %Negate: %Negate.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] +// CHECK:STDOUT: %Negate.type.1: type = fn_type @Negate.1 [template] +// CHECK:STDOUT: %Negate: %Negate.type.1 = struct_value () [template] // CHECK:STDOUT: %int_123.1: Core.IntLiteral = int_value 123 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_123.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_123.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_123.2: %i32 = int_value 123 [template] // CHECK:STDOUT: %int_-123: %i32 = int_value -123 [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.4, @impl.3(%int_32) [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %interface.10: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_123.2, %Convert.15 [template] -// CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.4(%int_32) [template] +// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.3, @impl.2(%int_32) [template] +// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [template] +// CHECK:STDOUT: %interface.6: = interface_witness (%Convert.11) [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_123.2, %Convert.11 [template] +// CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.3(%int_32) [template] // CHECK:STDOUT: %array_type: type = array_type %int_123.1, %i32 [template] // CHECK:STDOUT: %ptr: type = ptr_type %array_type [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] // CHECK:STDOUT: %int_-1: %i32 = int_value -1 [template] @@ -154,7 +152,7 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -170,31 +168,27 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Negate.decl: %Negate.type = fn_decl @Negate [template = constants.%Negate] { +// CHECK:STDOUT: %Negate.decl: %Negate.type.1 = fn_decl @Negate.1 [template = constants.%Negate] { // CHECK:STDOUT: %a.patt: %i32 = binding_pattern a // CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc2_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc2_14: init type = call constants.%Int(%int_32.loc2_14) [template = constants.%i32] -// CHECK:STDOUT: %.loc2_14.1: type = value_of_initializer %int.make_type_signed.loc2_14 [template = constants.%i32] -// CHECK:STDOUT: %.loc2_14.2: type = converted %int.make_type_signed.loc2_14, %.loc2_14.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc2_14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc2_22: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc2_22: init type = call constants.%Int(%int_32.loc2_22) [template = constants.%i32] -// CHECK:STDOUT: %.loc2_22.1: type = value_of_initializer %int.make_type_signed.loc2_22 [template = constants.%i32] -// CHECK:STDOUT: %.loc2_22.2: type = converted %int.make_type_signed.loc2_22, %.loc2_22.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc2_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %int_32.loc4: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc4: init type = call constants.%Int(%int_32.loc4) [template = constants.%i32] -// CHECK:STDOUT: %Negate.ref.loc4_16: %Negate.type = name_ref Negate, %Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %Negate.ref.loc4_23: %Negate.type = name_ref Negate, %Negate.decl [template = constants.%Negate] +// CHECK:STDOUT: %i32.loc4: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %Negate.ref.loc4_16: %Negate.type.1 = name_ref Negate, %Negate.decl [template = constants.%Negate] +// CHECK:STDOUT: %Negate.ref.loc4_23: %Negate.type.1 = name_ref Negate, %Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %int_123.loc4: Core.IntLiteral = int_value 123 [template = constants.%int_123.1] -// CHECK:STDOUT: %impl.elem0.loc4_30: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc4_30: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc4_30: = bound_method %int_123.loc4, %impl.elem0.loc4_30 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc4_30: = specific_function %Convert.bound.loc4_30, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc4_30: init %i32 = call %Convert.specific_fn.loc4_30(%int_123.loc4) [template = constants.%int_123.2] @@ -204,11 +198,9 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %.loc4_33.1: %i32 = value_of_initializer %int.snegate.loc4_33 [template = constants.%int_-123] // CHECK:STDOUT: %.loc4_33.2: %i32 = converted %int.snegate.loc4_33, %.loc4_33.1 [template = constants.%int_-123] // CHECK:STDOUT: %int.snegate.loc4_34: init %i32 = call %Negate.ref.loc4_16(%.loc4_33.2) [template = constants.%int_123.2] -// CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_signed.loc4 [template = constants.%i32] -// CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_signed.loc4, %.loc4_11.1 [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc4_34: %Convert.type.6 = interface_witness_access constants.%interface.10, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %impl.elem0.loc4_34: %Convert.type.5 = interface_witness_access constants.%interface.6, element0 [template = constants.%Convert.11] // CHECK:STDOUT: %Convert.bound.loc4_34: = bound_method %int.snegate.loc4_34, %impl.elem0.loc4_34 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc4_34: = specific_function %Convert.bound.loc4_34, @Convert.4(constants.%int_32) [template = constants.%Convert.specific_fn.2] +// CHECK:STDOUT: %Convert.specific_fn.loc4_34: = specific_function %Convert.bound.loc4_34, @Convert.3(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %.loc4_34.1: %i32 = value_of_initializer %int.snegate.loc4_34 [template = constants.%int_123.2] // CHECK:STDOUT: %.loc4_34.2: %i32 = converted %int.snegate.loc4_34, %.loc4_34.1 [template = constants.%int_123.2] // CHECK:STDOUT: %int.convert_checked.loc4_34: init Core.IntLiteral = call %Convert.specific_fn.loc4_34(%.loc4_34.2) [template = constants.%int_123.1] @@ -218,16 +210,12 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %arr.var: ref %array_type = var arr // CHECK:STDOUT: %arr: ref %array_type = bind_name arr, %arr.var // CHECK:STDOUT: %int_32.loc5: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc5: init type = call constants.%Int(%int_32.loc5) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc5: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_123.loc5: Core.IntLiteral = int_value 123 [template = constants.%int_123.1] -// CHECK:STDOUT: %.loc5_13.1: type = value_of_initializer %int.make_type_signed.loc5 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_13.2: type = converted %int.make_type_signed.loc5, %.loc5_13.1 [template = constants.%i32] // CHECK:STDOUT: %array_type.loc5: type = array_type %int_123.loc5, %i32 [template = constants.%array_type] // CHECK:STDOUT: %ptr: type = ptr_type %array_type [template = constants.%ptr] // CHECK:STDOUT: %int_32.loc7: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc7: init type = call constants.%Int(%int_32.loc7) [template = constants.%i32] -// CHECK:STDOUT: %.loc7_8.1: type = value_of_initializer %int.make_type_signed.loc7 [template = constants.%i32] -// CHECK:STDOUT: %.loc7_8.2: type = converted %int.make_type_signed.loc7, %.loc7_8.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc7: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { // CHECK:STDOUT: %a.patt: %i32 = binding_pattern a // CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 @@ -237,17 +225,11 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc9_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc9_19: init type = call constants.%Int(%int_32.loc9_19) [template = constants.%i32] -// CHECK:STDOUT: %.loc9_19.1: type = value_of_initializer %int.make_type_signed.loc9_19 [template = constants.%i32] -// CHECK:STDOUT: %.loc9_19.2: type = converted %int.make_type_signed.loc9_19, %.loc9_19.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc9_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc9_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc9_27: init type = call constants.%Int(%int_32.loc9_27) [template = constants.%i32] -// CHECK:STDOUT: %.loc9_27.1: type = value_of_initializer %int.make_type_signed.loc9_27 [template = constants.%i32] -// CHECK:STDOUT: %.loc9_27.2: type = converted %int.make_type_signed.loc9_27, %.loc9_27.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc9_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc9_35: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc9_35: init type = call constants.%Int(%int_32.loc9_35) [template = constants.%i32] -// CHECK:STDOUT: %.loc9_35.1: type = value_of_initializer %int.make_type_signed.loc9_35 [template = constants.%i32] -// CHECK:STDOUT: %.loc9_35.2: type = converted %int.make_type_signed.loc9_35, %.loc9_35.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc9_35: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 @@ -257,11 +239,11 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Negate(%a.param_patt: %i32) -> %i32 = "int.snegate"; +// CHECK:STDOUT: fn @Negate.1(%a.param_patt: %i32) -> %i32 = "int.snegate"; // CHECK:STDOUT: // CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Negate.ref: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] +// CHECK:STDOUT: %Negate.ref: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %a.ref: %i32 = name_ref a, %a // CHECK:STDOUT: %int.snegate: init %i32 = call %Negate.ref(%a.ref) // CHECK:STDOUT: %.loc10_19.1: %i32 = value_of_initializer %int.snegate @@ -274,9 +256,9 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %arr.ref: ref %array_type = name_ref arr, file.%arr // CHECK:STDOUT: %addr: %ptr = addr_of %arr.ref // CHECK:STDOUT: %arr_p: %ptr = bind_name arr_p, %addr -// CHECK:STDOUT: %Negate.ref: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] +// CHECK:STDOUT: %Negate.ref: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1, %impl.elem0 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_1) [template = constants.%int_1.2] @@ -293,9 +275,7 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %TooFew.type: type = fn_type @TooFew [template] // CHECK:STDOUT: %TooFew: %TooFew.type = struct_value () [template] // CHECK:STDOUT: %TooMany.type: type = fn_type @TooMany [template] @@ -309,13 +289,13 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] // CHECK:STDOUT: %RuntimeCallTooFew.type: type = fn_type @RuntimeCallTooFew [template] @@ -329,8 +309,8 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .Bool = %import_ref.2 -// CHECK:STDOUT: .ImplicitAs = %import_ref.3 +// CHECK:STDOUT: .Bool = %import_ref.5 +// CHECK:STDOUT: .ImplicitAs = %import_ref.6 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -357,9 +337,7 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc8_16.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc8_16.2: type = converted %int.make_type_signed, %.loc8_16.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } @@ -372,17 +350,11 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc13_15: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc13_15: init type = call constants.%Int(%int_32.loc13_15) [template = constants.%i32] -// CHECK:STDOUT: %.loc13_15.1: type = value_of_initializer %int.make_type_signed.loc13_15 [template = constants.%i32] -// CHECK:STDOUT: %.loc13_15.2: type = converted %int.make_type_signed.loc13_15, %.loc13_15.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc13_15: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc13_23: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc13_23: init type = call constants.%Int(%int_32.loc13_23) [template = constants.%i32] -// CHECK:STDOUT: %.loc13_23.1: type = value_of_initializer %int.make_type_signed.loc13_23 [template = constants.%i32] -// CHECK:STDOUT: %.loc13_23.2: type = converted %int.make_type_signed.loc13_23, %.loc13_23.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc13_23: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc13_31: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc13_31: init type = call constants.%Int(%int_32.loc13_31) [template = constants.%i32] -// CHECK:STDOUT: %.loc13_31.1: type = value_of_initializer %int.make_type_signed.loc13_31 [template = constants.%i32] -// CHECK:STDOUT: %.loc13_31.2: type = converted %int.make_type_signed.loc13_31, %.loc13_31.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc13_31: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 @@ -397,9 +369,7 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc18_21.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc18_21.2: type = converted %int.make_type_signed, %.loc18_21.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc18_29.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc18_29.2: type = converted %bool.make_type, %.loc18_29.1 [template = bool] @@ -415,70 +385,58 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc19_17: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc19_17: init type = call constants.%Int(%int_32.loc19_17) [template = constants.%i32] -// CHECK:STDOUT: %.loc19_17.1: type = value_of_initializer %int.make_type_signed.loc19_17 [template = constants.%i32] -// CHECK:STDOUT: %.loc19_17.2: type = converted %int.make_type_signed.loc19_17, %.loc19_17.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc19_17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc19_25: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc19_25: init type = call constants.%Int(%int_32.loc19_25) [template = constants.%i32] -// CHECK:STDOUT: %.loc19_25.1: type = value_of_initializer %int.make_type_signed.loc19_25 [template = constants.%i32] -// CHECK:STDOUT: %.loc19_25.2: type = converted %int.make_type_signed.loc19_25, %.loc19_25.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc19_25: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %int_32.loc25: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc25: init type = call constants.%Int(%int_32.loc25) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc25: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %TooFew.ref: %TooFew.type = name_ref TooFew, %TooFew.decl [template = constants.%TooFew] // CHECK:STDOUT: %TooFew.call: init %i32 = call %TooFew.ref() -// CHECK:STDOUT: %.loc25_15.1: type = value_of_initializer %int.make_type_signed.loc25 [template = constants.%i32] -// CHECK:STDOUT: %.loc25_15.2: type = converted %int.make_type_signed.loc25, %.loc25_15.1 [template = constants.%i32] // CHECK:STDOUT: %too_few.var: ref = var too_few // CHECK:STDOUT: %too_few: ref = bind_name too_few, %too_few.var // CHECK:STDOUT: %int_32.loc30: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc30: init type = call constants.%Int(%int_32.loc30) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc30: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %TooMany.ref: %TooMany.type = name_ref TooMany, %TooMany.decl [template = constants.%TooMany] // CHECK:STDOUT: %int_1.loc30: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_2.loc30: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %impl.elem0.loc30_29: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc30_29: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc30_29: = bound_method %int_1.loc30, %impl.elem0.loc30_29 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc30_29: = specific_function %Convert.bound.loc30_29, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc30_29: init %i32 = call %Convert.specific_fn.loc30_29(%int_1.loc30) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc30_29.1: %i32 = value_of_initializer %int.convert_checked.loc30_29 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc30_29.2: %i32 = converted %int_1.loc30, %.loc30_29.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc30_32: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc30_32: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc30_32: = bound_method %int_2.loc30, %impl.elem0.loc30_32 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc30_32: = specific_function %Convert.bound.loc30_32, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc30_32: init %i32 = call %Convert.specific_fn.loc30_32(%int_2.loc30) [template = constants.%int_2.2] // CHECK:STDOUT: %.loc30_32.1: %i32 = value_of_initializer %int.convert_checked.loc30_32 [template = constants.%int_2.2] // CHECK:STDOUT: %.loc30_32.2: %i32 = converted %int_2.loc30, %.loc30_32.1 [template = constants.%int_2.2] // CHECK:STDOUT: %TooMany.call: init %i32 = call %TooMany.ref(%.loc30_29.2, %.loc30_32.2) -// CHECK:STDOUT: %.loc30_16.1: type = value_of_initializer %int.make_type_signed.loc30 [template = constants.%i32] -// CHECK:STDOUT: %.loc30_16.2: type = converted %int.make_type_signed.loc30, %.loc30_16.1 [template = constants.%i32] // CHECK:STDOUT: %too_many.var: ref = var too_many // CHECK:STDOUT: %too_many: ref = bind_name too_many, %too_many.var // CHECK:STDOUT: %int_32.loc35: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc35: init type = call constants.%Int(%int_32.loc35) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc35: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %BadReturnType.ref: %BadReturnType.type = name_ref BadReturnType, %BadReturnType.decl [template = constants.%BadReturnType] // CHECK:STDOUT: %int_1.loc35: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc35: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc35: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc35: = bound_method %int_1.loc35, %impl.elem0.loc35 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc35: = specific_function %Convert.bound.loc35, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc35: init %i32 = call %Convert.specific_fn.loc35(%int_1.loc35) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc35_42.1: %i32 = value_of_initializer %int.convert_checked.loc35 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc35_42.2: %i32 = converted %int_1.loc35, %.loc35_42.1 [template = constants.%int_1.2] // CHECK:STDOUT: %BadReturnType.call: init bool = call %BadReturnType.ref(%.loc35_42.2) -// CHECK:STDOUT: %.loc35_23.1: type = value_of_initializer %int.make_type_signed.loc35 [template = constants.%i32] -// CHECK:STDOUT: %.loc35_23.2: type = converted %int.make_type_signed.loc35, %.loc35_23.1 [template = constants.%i32] // CHECK:STDOUT: %bad_return_type.var: ref = var bad_return_type // CHECK:STDOUT: %bad_return_type: ref = bind_name bad_return_type, %bad_return_type.var // CHECK:STDOUT: %int_32.loc44: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc44: init type = call constants.%Int(%int_32.loc44) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc44: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %JustRight.ref: %JustRight.type = name_ref JustRight, %JustRight.decl [template = constants.%JustRight] // CHECK:STDOUT: %int_1.loc44: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_2.loc44: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %.loc44_16.1: type = value_of_initializer %int.make_type_signed.loc44 [template = constants.%i32] -// CHECK:STDOUT: %.loc44_16.2: type = converted %int.make_type_signed.loc44, %.loc44_16.1 [template = constants.%i32] // CHECK:STDOUT: %array_type: type = array_type , %i32 [template = ] // CHECK:STDOUT: %bad_call.var: ref = var bad_call // CHECK:STDOUT: %bad_call: ref = bind_name bad_call, %bad_call.var @@ -489,13 +447,9 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc46_25: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc46_25: init type = call constants.%Int(%int_32.loc46_25) [template = constants.%i32] -// CHECK:STDOUT: %.loc46_25.1: type = value_of_initializer %int.make_type_signed.loc46_25 [template = constants.%i32] -// CHECK:STDOUT: %.loc46_25.2: type = converted %int.make_type_signed.loc46_25, %.loc46_25.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc46_25: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc46_33: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc46_33: init type = call constants.%Int(%int_32.loc46_33) [template = constants.%i32] -// CHECK:STDOUT: %.loc46_33.1: type = value_of_initializer %int.make_type_signed.loc46_33 [template = constants.%i32] -// CHECK:STDOUT: %.loc46_33.2: type = converted %int.make_type_signed.loc46_33, %.loc46_33.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc46_33: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 @@ -512,21 +466,13 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param3 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc57_26: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc57_26: init type = call constants.%Int(%int_32.loc57_26) [template = constants.%i32] -// CHECK:STDOUT: %.loc57_26.1: type = value_of_initializer %int.make_type_signed.loc57_26 [template = constants.%i32] -// CHECK:STDOUT: %.loc57_26.2: type = converted %int.make_type_signed.loc57_26, %.loc57_26.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc57_26: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc57_34: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc57_34: init type = call constants.%Int(%int_32.loc57_34) [template = constants.%i32] -// CHECK:STDOUT: %.loc57_34.1: type = value_of_initializer %int.make_type_signed.loc57_34 [template = constants.%i32] -// CHECK:STDOUT: %.loc57_34.2: type = converted %int.make_type_signed.loc57_34, %.loc57_34.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc57_34: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc57_42: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc57_42: init type = call constants.%Int(%int_32.loc57_42) [template = constants.%i32] -// CHECK:STDOUT: %.loc57_42.1: type = value_of_initializer %int.make_type_signed.loc57_42 [template = constants.%i32] -// CHECK:STDOUT: %.loc57_42.2: type = converted %int.make_type_signed.loc57_42, %.loc57_42.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc57_42: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc57_50: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc57_50: init type = call constants.%Int(%int_32.loc57_50) [template = constants.%i32] -// CHECK:STDOUT: %.loc57_50.1: type = value_of_initializer %int.make_type_signed.loc57_50 [template = constants.%i32] -// CHECK:STDOUT: %.loc57_50.2: type = converted %int.make_type_signed.loc57_50, %.loc57_50.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc57_50: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 @@ -545,13 +491,9 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc68_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc68_32: init type = call constants.%Int(%int_32.loc68_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc68_32.1: type = value_of_initializer %int.make_type_signed.loc68_32 [template = constants.%i32] -// CHECK:STDOUT: %.loc68_32.2: type = converted %int.make_type_signed.loc68_32, %.loc68_32.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc68_32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc68_40: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc68_40: init type = call constants.%Int(%int_32.loc68_40) [template = constants.%i32] -// CHECK:STDOUT: %.loc68_40.1: type = value_of_initializer %int.make_type_signed.loc68_40 [template = constants.%i32] -// CHECK:STDOUT: %.loc68_40.2: type = converted %int.make_type_signed.loc68_40, %.loc68_40.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc68_40: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc68_48.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc68_48.2: type = converted %bool.make_type, %.loc68_48.1 [template = bool] @@ -600,24 +542,22 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] -// CHECK:STDOUT: %Negate.type: type = fn_type @Negate [template] -// CHECK:STDOUT: %Negate: %Negate.type = struct_value () [template] -// CHECK:STDOUT: %Sub.type: type = fn_type @Sub [template] -// CHECK:STDOUT: %Sub: %Sub.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] +// CHECK:STDOUT: %Negate.type.1: type = fn_type @Negate.1 [template] +// CHECK:STDOUT: %Negate: %Negate.type.1 = struct_value () [template] +// CHECK:STDOUT: %Sub.type.1: type = fn_type @Sub.1 [template] +// CHECK:STDOUT: %Sub: %Sub.type.1 = struct_value () [template] // CHECK:STDOUT: %int_2147483647.1: Core.IntLiteral = int_value 2147483647 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_2147483647.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_2147483647.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2147483647.2: %i32 = int_value 2147483647 [template] // CHECK:STDOUT: %int_-2147483647: %i32 = int_value -2147483647 [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] // CHECK:STDOUT: %int_-2147483648: %i32 = int_value -2147483648 [template] @@ -626,7 +566,7 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -641,26 +581,22 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: .b = @__global_init.%b // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Negate.decl: %Negate.type = fn_decl @Negate [template = constants.%Negate] { +// CHECK:STDOUT: %Negate.decl: %Negate.type.1 = fn_decl @Negate.1 [template = constants.%Negate] { // CHECK:STDOUT: %a.patt: %i32 = binding_pattern a // CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc4_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc4_14: init type = call constants.%Int(%int_32.loc4_14) [template = constants.%i32] -// CHECK:STDOUT: %.loc4_14.1: type = value_of_initializer %int.make_type_signed.loc4_14 [template = constants.%i32] -// CHECK:STDOUT: %.loc4_14.2: type = converted %int.make_type_signed.loc4_14, %.loc4_14.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc4_14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc4_22: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc4_22: init type = call constants.%Int(%int_32.loc4_22) [template = constants.%i32] -// CHECK:STDOUT: %.loc4_22.1: type = value_of_initializer %int.make_type_signed.loc4_22 [template = constants.%i32] -// CHECK:STDOUT: %.loc4_22.2: type = converted %int.make_type_signed.loc4_22, %.loc4_22.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc4_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %Sub.decl: %Sub.type = fn_decl @Sub [template = constants.%Sub] { +// CHECK:STDOUT: %Sub.decl: %Sub.type.1 = fn_decl @Sub.1 [template = constants.%Sub] { // CHECK:STDOUT: %a.patt: %i32 = binding_pattern a // CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: %i32 = binding_pattern b @@ -669,17 +605,11 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc5_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc5_11: init type = call constants.%Int(%int_32.loc5_11) [template = constants.%i32] -// CHECK:STDOUT: %.loc5_11.1: type = value_of_initializer %int.make_type_signed.loc5_11 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_11.2: type = converted %int.make_type_signed.loc5_11, %.loc5_11.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc5_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc5_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc5_19: init type = call constants.%Int(%int_32.loc5_19) [template = constants.%i32] -// CHECK:STDOUT: %.loc5_19.1: type = value_of_initializer %int.make_type_signed.loc5_19 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_19.2: type = converted %int.make_type_signed.loc5_19, %.loc5_19.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc5_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc5_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc5_27: init type = call constants.%Int(%int_32.loc5_27) [template = constants.%i32] -// CHECK:STDOUT: %.loc5_27.1: type = value_of_initializer %int.make_type_signed.loc5_27 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_27.2: type = converted %int.make_type_signed.loc5_27, %.loc5_27.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc5_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 @@ -688,25 +618,21 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %int_32.loc8: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc8: init type = call constants.%Int(%int_32.loc8) [template = constants.%i32] -// CHECK:STDOUT: %.loc8_8.1: type = value_of_initializer %int.make_type_signed.loc8 [template = constants.%i32] -// CHECK:STDOUT: %.loc8_8.2: type = converted %int.make_type_signed.loc8, %.loc8_8.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc8: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc14: init type = call constants.%Int(%int_32.loc14) [template = constants.%i32] -// CHECK:STDOUT: %.loc14_8.1: type = value_of_initializer %int.make_type_signed.loc14 [template = constants.%i32] -// CHECK:STDOUT: %.loc14_8.2: type = converted %int.make_type_signed.loc14, %.loc14_8.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Negate(%a.param_patt: %i32) -> %i32 = "int.snegate"; +// CHECK:STDOUT: fn @Negate.1(%a.param_patt: %i32) -> %i32 = "int.snegate"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Sub(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.ssub"; +// CHECK:STDOUT: fn @Sub.1(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.ssub"; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Negate.ref.loc8_14: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %Negate.ref.loc8_21: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] +// CHECK:STDOUT: %Negate.ref.loc8_14: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] +// CHECK:STDOUT: %Negate.ref.loc8_21: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %int_2147483647.loc8: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] -// CHECK:STDOUT: %impl.elem0.loc8: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc8: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc8: = bound_method %int_2147483647.loc8, %impl.elem0.loc8 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc8: = specific_function %Convert.bound.loc8, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc8: init %i32 = call %Convert.specific_fn.loc8(%int_2147483647.loc8) [template = constants.%int_2147483647.2] @@ -719,11 +645,11 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %.loc8_40.1: %i32 = value_of_initializer %int.snegate.loc8_39 [template = constants.%int_2147483647.2] // CHECK:STDOUT: %.loc8_40.2: %i32 = converted %int.snegate.loc8_39, %.loc8_40.1 [template = constants.%int_2147483647.2] // CHECK:STDOUT: %a: %i32 = bind_name a, %.loc8_40.2 -// CHECK:STDOUT: %Negate.ref.loc14_14: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %Sub.ref: %Sub.type = name_ref Sub, file.%Sub.decl [template = constants.%Sub] -// CHECK:STDOUT: %Negate.ref.loc14_25: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] +// CHECK:STDOUT: %Negate.ref.loc14_14: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] +// CHECK:STDOUT: %Sub.ref: %Sub.type.1 = name_ref Sub, file.%Sub.decl [template = constants.%Sub] +// CHECK:STDOUT: %Negate.ref.loc14_25: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %int_2147483647.loc14: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] -// CHECK:STDOUT: %impl.elem0.loc14_32: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc14_32: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc14_32: = bound_method %int_2147483647.loc14, %impl.elem0.loc14_32 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc14_32: = specific_function %Convert.bound.loc14_32, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc14_32: init %i32 = call %Convert.specific_fn.loc14_32(%int_2147483647.loc14) [template = constants.%int_2147483647.2] @@ -733,7 +659,7 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %.loc14_42.1: %i32 = value_of_initializer %int.snegate.loc14_42 [template = constants.%int_-2147483647] // CHECK:STDOUT: %.loc14_42.2: %i32 = converted %int.snegate.loc14_42, %.loc14_42.1 [template = constants.%int_-2147483647] -// CHECK:STDOUT: %impl.elem0.loc14_45: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc14_45: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc14_45: = bound_method %int_1, %impl.elem0.loc14_45 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc14_45: = specific_function %Convert.bound.loc14_45, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc14_45: init %i32 = call %Convert.specific_fn.loc14_45(%int_1) [template = constants.%int_1.2] diff --git a/toolchain/check/testdata/builtins/int/ssub.carbon b/toolchain/check/testdata/builtins/int/ssub.carbon index 37ceb09c81dbd..946ff54e71424 100644 --- a/toolchain/check/testdata/builtins/int/ssub.carbon +++ b/toolchain/check/testdata/builtins/int/ssub.carbon @@ -36,30 +36,28 @@ let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] -// CHECK:STDOUT: %Sub.type: type = fn_type @Sub [template] -// CHECK:STDOUT: %Sub: %Sub.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] +// CHECK:STDOUT: %Sub.type.1: type = fn_type @Sub.1 [template] +// CHECK:STDOUT: %Sub: %Sub.type.1 = struct_value () [template] // CHECK:STDOUT: %int_3.1: Core.IntLiteral = int_value 3 [template] // CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_3.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_3.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_3.2: %i32 = int_value 3 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] // CHECK:STDOUT: %int_1.1: %i32 = int_value 1 [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.4, @impl.3(%int_32) [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %interface.10: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_1.1, %Convert.15 [template] -// CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.4(%int_32) [template] +// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.3, @impl.2(%int_32) [template] +// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [template] +// CHECK:STDOUT: %interface.6: = interface_witness (%Convert.11) [template] +// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_1.1, %Convert.11 [template] +// CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.3(%int_32) [template] // CHECK:STDOUT: %int_1.2: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %array_type: type = array_type %int_1.2, %i32 [template] // CHECK:STDOUT: %ptr: type = ptr_type %array_type [template] @@ -70,7 +68,7 @@ let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -85,7 +83,7 @@ let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Sub.decl: %Sub.type = fn_decl @Sub [template = constants.%Sub] { +// CHECK:STDOUT: %Sub.decl: %Sub.type.1 = fn_decl @Sub.1 [template = constants.%Sub] { // CHECK:STDOUT: %a.patt: %i32 = binding_pattern a // CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: %i32 = binding_pattern b @@ -94,17 +92,11 @@ let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc2_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc2_11: init type = call constants.%Int(%int_32.loc2_11) [template = constants.%i32] -// CHECK:STDOUT: %.loc2_11.1: type = value_of_initializer %int.make_type_signed.loc2_11 [template = constants.%i32] -// CHECK:STDOUT: %.loc2_11.2: type = converted %int.make_type_signed.loc2_11, %.loc2_11.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc2_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc2_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc2_19: init type = call constants.%Int(%int_32.loc2_19) [template = constants.%i32] -// CHECK:STDOUT: %.loc2_19.1: type = value_of_initializer %int.make_type_signed.loc2_19 [template = constants.%i32] -// CHECK:STDOUT: %.loc2_19.2: type = converted %int.make_type_signed.loc2_19, %.loc2_19.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc2_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc2_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc2_27: init type = call constants.%Int(%int_32.loc2_27) [template = constants.%i32] -// CHECK:STDOUT: %.loc2_27.1: type = value_of_initializer %int.make_type_signed.loc2_27 [template = constants.%i32] -// CHECK:STDOUT: %.loc2_27.2: type = converted %int.make_type_signed.loc2_27, %.loc2_27.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc2_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 @@ -113,28 +105,26 @@ let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %int_32.loc4: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc4: init type = call constants.%Int(%int_32.loc4) [template = constants.%i32] -// CHECK:STDOUT: %Sub.ref: %Sub.type = name_ref Sub, %Sub.decl [template = constants.%Sub] +// CHECK:STDOUT: %i32.loc4: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %Sub.ref: %Sub.type.1 = name_ref Sub, %Sub.decl [template = constants.%Sub] // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %impl.elem0.loc4_20: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc4_20: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc4_20: = bound_method %int_3, %impl.elem0.loc4_20 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc4_20: = specific_function %Convert.bound.loc4_20, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc4_20: init %i32 = call %Convert.specific_fn.loc4_20(%int_3) [template = constants.%int_3.2] // CHECK:STDOUT: %.loc4_20.1: %i32 = value_of_initializer %int.convert_checked.loc4_20 [template = constants.%int_3.2] // CHECK:STDOUT: %.loc4_20.2: %i32 = converted %int_3, %.loc4_20.1 [template = constants.%int_3.2] -// CHECK:STDOUT: %impl.elem0.loc4_23: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc4_23: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc4_23: = bound_method %int_2, %impl.elem0.loc4_23 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc4_23: = specific_function %Convert.bound.loc4_23, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc4_23: init %i32 = call %Convert.specific_fn.loc4_23(%int_2) [template = constants.%int_2.2] // CHECK:STDOUT: %.loc4_23.1: %i32 = value_of_initializer %int.convert_checked.loc4_23 [template = constants.%int_2.2] // CHECK:STDOUT: %.loc4_23.2: %i32 = converted %int_2, %.loc4_23.1 [template = constants.%int_2.2] // CHECK:STDOUT: %int.ssub: init %i32 = call %Sub.ref(%.loc4_20.2, %.loc4_23.2) [template = constants.%int_1.1] -// CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_signed.loc4 [template = constants.%i32] -// CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_signed.loc4, %.loc4_11.1 [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc4_24: %Convert.type.6 = interface_witness_access constants.%interface.10, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %impl.elem0.loc4_24: %Convert.type.5 = interface_witness_access constants.%interface.6, element0 [template = constants.%Convert.11] // CHECK:STDOUT: %Convert.bound.loc4_24: = bound_method %int.ssub, %impl.elem0.loc4_24 [template = constants.%Convert.bound.3] -// CHECK:STDOUT: %Convert.specific_fn.loc4_24: = specific_function %Convert.bound.loc4_24, @Convert.4(constants.%int_32) [template = constants.%Convert.specific_fn.3] +// CHECK:STDOUT: %Convert.specific_fn.loc4_24: = specific_function %Convert.bound.loc4_24, @Convert.3(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %.loc4_24.1: %i32 = value_of_initializer %int.ssub [template = constants.%int_1.1] // CHECK:STDOUT: %.loc4_24.2: %i32 = converted %int.ssub, %.loc4_24.1 [template = constants.%int_1.1] // CHECK:STDOUT: %int.convert_checked.loc4_24: init Core.IntLiteral = call %Convert.specific_fn.loc4_24(%.loc4_24.2) [template = constants.%int_1.2] @@ -144,10 +134,8 @@ let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDOUT: %arr.var: ref %array_type = var arr // CHECK:STDOUT: %arr: ref %array_type = bind_name arr, %arr.var // CHECK:STDOUT: %int_32.loc5: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc5: init type = call constants.%Int(%int_32.loc5) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc5: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc5_13.1: type = value_of_initializer %int.make_type_signed.loc5 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_13.2: type = converted %int.make_type_signed.loc5, %.loc5_13.1 [template = constants.%i32] // CHECK:STDOUT: %array_type.loc5: type = array_type %int_1, %i32 [template = constants.%array_type] // CHECK:STDOUT: %ptr: type = ptr_type %array_type [template = constants.%ptr] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { @@ -159,17 +147,11 @@ let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc7_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc7_19: init type = call constants.%Int(%int_32.loc7_19) [template = constants.%i32] -// CHECK:STDOUT: %.loc7_19.1: type = value_of_initializer %int.make_type_signed.loc7_19 [template = constants.%i32] -// CHECK:STDOUT: %.loc7_19.2: type = converted %int.make_type_signed.loc7_19, %.loc7_19.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc7_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc7_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc7_27: init type = call constants.%Int(%int_32.loc7_27) [template = constants.%i32] -// CHECK:STDOUT: %.loc7_27.1: type = value_of_initializer %int.make_type_signed.loc7_27 [template = constants.%i32] -// CHECK:STDOUT: %.loc7_27.2: type = converted %int.make_type_signed.loc7_27, %.loc7_27.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc7_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc7_35: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc7_35: init type = call constants.%Int(%int_32.loc7_35) [template = constants.%i32] -// CHECK:STDOUT: %.loc7_35.1: type = value_of_initializer %int.make_type_signed.loc7_35 [template = constants.%i32] -// CHECK:STDOUT: %.loc7_35.2: type = converted %int.make_type_signed.loc7_35, %.loc7_35.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc7_35: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 @@ -179,11 +161,11 @@ let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Sub(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.ssub"; +// CHECK:STDOUT: fn @Sub.1(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.ssub"; // CHECK:STDOUT: // CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Sub.ref: %Sub.type = name_ref Sub, file.%Sub.decl [template = constants.%Sub] +// CHECK:STDOUT: %Sub.ref: %Sub.type.1 = name_ref Sub, file.%Sub.decl [template = constants.%Sub] // CHECK:STDOUT: %a.ref: %i32 = name_ref a, %a // CHECK:STDOUT: %b.ref: %i32 = name_ref b, %b // CHECK:STDOUT: %int.ssub: init %i32 = call %Sub.ref(%a.ref, %b.ref) @@ -204,31 +186,29 @@ let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] -// CHECK:STDOUT: %Sub.type: type = fn_type @Sub [template] -// CHECK:STDOUT: %Sub: %Sub.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] +// CHECK:STDOUT: %Sub.type.1: type = fn_type @Sub.1 [template] +// CHECK:STDOUT: %Sub: %Sub.type.1 = struct_value () [template] // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %int_2147483647.1: Core.IntLiteral = int_value 2147483647 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_0.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2147483647.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2147483647.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2147483647.2: %i32 = int_value 2147483647 [template] // CHECK:STDOUT: %int_-2147483647: %i32 = int_value -2147483647 [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] // CHECK:STDOUT: %int_-2147483648: %i32 = int_value -2147483648 [template] // CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %Convert.bound.4: = bound_method %int_2.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.4: = bound_method %int_2.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.4: = specific_function %Convert.bound.4, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] // CHECK:STDOUT: } @@ -236,7 +216,7 @@ let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -251,7 +231,7 @@ let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDOUT: .c = @__global_init.%c // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Sub.decl: %Sub.type = fn_decl @Sub [template = constants.%Sub] { +// CHECK:STDOUT: %Sub.decl: %Sub.type.1 = fn_decl @Sub.1 [template = constants.%Sub] { // CHECK:STDOUT: %a.patt: %i32 = binding_pattern a // CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: %i32 = binding_pattern b @@ -260,17 +240,11 @@ let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc4_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc4_11: init type = call constants.%Int(%int_32.loc4_11) [template = constants.%i32] -// CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_signed.loc4_11 [template = constants.%i32] -// CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_signed.loc4_11, %.loc4_11.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc4_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc4_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc4_19: init type = call constants.%Int(%int_32.loc4_19) [template = constants.%i32] -// CHECK:STDOUT: %.loc4_19.1: type = value_of_initializer %int.make_type_signed.loc4_19 [template = constants.%i32] -// CHECK:STDOUT: %.loc4_19.2: type = converted %int.make_type_signed.loc4_19, %.loc4_19.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc4_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc4_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc4_27: init type = call constants.%Int(%int_32.loc4_27) [template = constants.%i32] -// CHECK:STDOUT: %.loc4_27.1: type = value_of_initializer %int.make_type_signed.loc4_27 [template = constants.%i32] -// CHECK:STDOUT: %.loc4_27.2: type = converted %int.make_type_signed.loc4_27, %.loc4_27.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc4_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 @@ -279,33 +253,27 @@ let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %int_32.loc6: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc6: init type = call constants.%Int(%int_32.loc6) [template = constants.%i32] -// CHECK:STDOUT: %.loc6_8.1: type = value_of_initializer %int.make_type_signed.loc6 [template = constants.%i32] -// CHECK:STDOUT: %.loc6_8.2: type = converted %int.make_type_signed.loc6, %.loc6_8.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc6: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc7: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc7: init type = call constants.%Int(%int_32.loc7) [template = constants.%i32] -// CHECK:STDOUT: %.loc7_8.1: type = value_of_initializer %int.make_type_signed.loc7 [template = constants.%i32] -// CHECK:STDOUT: %.loc7_8.2: type = converted %int.make_type_signed.loc7, %.loc7_8.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc7: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11: init type = call constants.%Int(%int_32.loc11) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_8.1: type = value_of_initializer %int.make_type_signed.loc11 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_8.2: type = converted %int.make_type_signed.loc11, %.loc11_8.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Sub(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.ssub"; +// CHECK:STDOUT: fn @Sub.1(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.ssub"; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Sub.ref.loc6: %Sub.type = name_ref Sub, file.%Sub.decl [template = constants.%Sub] +// CHECK:STDOUT: %Sub.ref.loc6: %Sub.type.1 = name_ref Sub, file.%Sub.decl [template = constants.%Sub] // CHECK:STDOUT: %int_0.loc6: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %int_2147483647.loc6: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] -// CHECK:STDOUT: %impl.elem0.loc6_18: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc6_18: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc6_18: = bound_method %int_0.loc6, %impl.elem0.loc6_18 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc6_18: = specific_function %Convert.bound.loc6_18, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc6_18: init %i32 = call %Convert.specific_fn.loc6_18(%int_0.loc6) [template = constants.%int_0.2] // CHECK:STDOUT: %.loc6_18.1: %i32 = value_of_initializer %int.convert_checked.loc6_18 [template = constants.%int_0.2] // CHECK:STDOUT: %.loc6_18.2: %i32 = converted %int_0.loc6, %.loc6_18.1 [template = constants.%int_0.2] -// CHECK:STDOUT: %impl.elem0.loc6_21: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc6_21: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc6_21: = bound_method %int_2147483647.loc6, %impl.elem0.loc6_21 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc6_21: = specific_function %Convert.bound.loc6_21, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc6_21: init %i32 = call %Convert.specific_fn.loc6_21(%int_2147483647.loc6) [template = constants.%int_2147483647.2] @@ -315,17 +283,17 @@ let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDOUT: %.loc6_32.1: %i32 = value_of_initializer %int.ssub.loc6 [template = constants.%int_-2147483647] // CHECK:STDOUT: %.loc6_32.2: %i32 = converted %int.ssub.loc6, %.loc6_32.1 [template = constants.%int_-2147483647] // CHECK:STDOUT: %a: %i32 = bind_name a, %.loc6_32.2 -// CHECK:STDOUT: %Sub.ref.loc7_14: %Sub.type = name_ref Sub, file.%Sub.decl [template = constants.%Sub] -// CHECK:STDOUT: %Sub.ref.loc7_18: %Sub.type = name_ref Sub, file.%Sub.decl [template = constants.%Sub] +// CHECK:STDOUT: %Sub.ref.loc7_14: %Sub.type.1 = name_ref Sub, file.%Sub.decl [template = constants.%Sub] +// CHECK:STDOUT: %Sub.ref.loc7_18: %Sub.type.1 = name_ref Sub, file.%Sub.decl [template = constants.%Sub] // CHECK:STDOUT: %int_0.loc7: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %int_2147483647.loc7: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] -// CHECK:STDOUT: %impl.elem0.loc7_22: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc7_22: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc7_22: = bound_method %int_0.loc7, %impl.elem0.loc7_22 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc7_22: = specific_function %Convert.bound.loc7_22, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc7_22: init %i32 = call %Convert.specific_fn.loc7_22(%int_0.loc7) [template = constants.%int_0.2] // CHECK:STDOUT: %.loc7_22.1: %i32 = value_of_initializer %int.convert_checked.loc7_22 [template = constants.%int_0.2] // CHECK:STDOUT: %.loc7_22.2: %i32 = converted %int_0.loc7, %.loc7_22.1 [template = constants.%int_0.2] -// CHECK:STDOUT: %impl.elem0.loc7_25: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc7_25: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc7_25: = bound_method %int_2147483647.loc7, %impl.elem0.loc7_25 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc7_25: = specific_function %Convert.bound.loc7_25, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc7_25: init %i32 = call %Convert.specific_fn.loc7_25(%int_2147483647.loc7) [template = constants.%int_2147483647.2] @@ -335,7 +303,7 @@ let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %.loc7_35.1: %i32 = value_of_initializer %int.ssub.loc7_35 [template = constants.%int_-2147483647] // CHECK:STDOUT: %.loc7_35.2: %i32 = converted %int.ssub.loc7_35, %.loc7_35.1 [template = constants.%int_-2147483647] -// CHECK:STDOUT: %impl.elem0.loc7_38: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc7_38: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc7_38: = bound_method %int_1, %impl.elem0.loc7_38 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc7_38: = specific_function %Convert.bound.loc7_38, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc7_38: init %i32 = call %Convert.specific_fn.loc7_38(%int_1) [template = constants.%int_1.2] @@ -345,17 +313,17 @@ let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDOUT: %.loc7_40.1: %i32 = value_of_initializer %int.ssub.loc7_39 [template = constants.%int_-2147483648] // CHECK:STDOUT: %.loc7_40.2: %i32 = converted %int.ssub.loc7_39, %.loc7_40.1 [template = constants.%int_-2147483648] // CHECK:STDOUT: %b: %i32 = bind_name b, %.loc7_40.2 -// CHECK:STDOUT: %Sub.ref.loc11_14: %Sub.type = name_ref Sub, file.%Sub.decl [template = constants.%Sub] -// CHECK:STDOUT: %Sub.ref.loc11_18: %Sub.type = name_ref Sub, file.%Sub.decl [template = constants.%Sub] +// CHECK:STDOUT: %Sub.ref.loc11_14: %Sub.type.1 = name_ref Sub, file.%Sub.decl [template = constants.%Sub] +// CHECK:STDOUT: %Sub.ref.loc11_18: %Sub.type.1 = name_ref Sub, file.%Sub.decl [template = constants.%Sub] // CHECK:STDOUT: %int_0.loc11: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %int_2147483647.loc11: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] -// CHECK:STDOUT: %impl.elem0.loc11_22: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc11_22: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_22: = bound_method %int_0.loc11, %impl.elem0.loc11_22 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc11_22: = specific_function %Convert.bound.loc11_22, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc11_22: init %i32 = call %Convert.specific_fn.loc11_22(%int_0.loc11) [template = constants.%int_0.2] // CHECK:STDOUT: %.loc11_22.1: %i32 = value_of_initializer %int.convert_checked.loc11_22 [template = constants.%int_0.2] // CHECK:STDOUT: %.loc11_22.2: %i32 = converted %int_0.loc11, %.loc11_22.1 [template = constants.%int_0.2] -// CHECK:STDOUT: %impl.elem0.loc11_25: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc11_25: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_25: = bound_method %int_2147483647.loc11, %impl.elem0.loc11_25 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc11_25: = specific_function %Convert.bound.loc11_25, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc11_25: init %i32 = call %Convert.specific_fn.loc11_25(%int_2147483647.loc11) [template = constants.%int_2147483647.2] @@ -365,7 +333,7 @@ let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %.loc11_35.1: %i32 = value_of_initializer %int.ssub.loc11_35 [template = constants.%int_-2147483647] // CHECK:STDOUT: %.loc11_35.2: %i32 = converted %int.ssub.loc11_35, %.loc11_35.1 [template = constants.%int_-2147483647] -// CHECK:STDOUT: %impl.elem0.loc11_38: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc11_38: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_38: = bound_method %int_2, %impl.elem0.loc11_38 [template = constants.%Convert.bound.4] // CHECK:STDOUT: %Convert.specific_fn.loc11_38: = specific_function %Convert.bound.loc11_38, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.4] // CHECK:STDOUT: %int.convert_checked.loc11_38: init %i32 = call %Convert.specific_fn.loc11_38(%int_2) [template = constants.%int_2.2] diff --git a/toolchain/check/testdata/builtins/int/uadd.carbon b/toolchain/check/testdata/builtins/int/uadd.carbon index 85ad072365d18..4d45c1f842dea 100644 --- a/toolchain/check/testdata/builtins/int/uadd.carbon +++ b/toolchain/check/testdata/builtins/int/uadd.carbon @@ -90,30 +90,28 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] -// CHECK:STDOUT: %Add.type: type = fn_type @Add [template] -// CHECK:STDOUT: %Add: %Add.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] +// CHECK:STDOUT: %Add.type.1: type = fn_type @Add.1 [template] +// CHECK:STDOUT: %Add: %Add.type.1 = struct_value () [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] // CHECK:STDOUT: %int_3.1: %i32 = int_value 3 [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.4, @impl.3(%int_32) [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %interface.10: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_3.1, %Convert.15 [template] -// CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.4(%int_32) [template] +// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.3, @impl.2(%int_32) [template] +// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [template] +// CHECK:STDOUT: %interface.6: = interface_witness (%Convert.11) [template] +// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_3.1, %Convert.11 [template] +// CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.3(%int_32) [template] // CHECK:STDOUT: %int_3.2: Core.IntLiteral = int_value 3 [template] // CHECK:STDOUT: %array_type: type = array_type %int_3.2, %i32 [template] // CHECK:STDOUT: %ptr: type = ptr_type %array_type [template] @@ -124,7 +122,7 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -139,7 +137,7 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Add.decl: %Add.type = fn_decl @Add [template = constants.%Add] { +// CHECK:STDOUT: %Add.decl: %Add.type.1 = fn_decl @Add.1 [template = constants.%Add] { // CHECK:STDOUT: %a.patt: %i32 = binding_pattern a // CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: %i32 = binding_pattern b @@ -148,17 +146,11 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc2_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc2_11: init type = call constants.%Int(%int_32.loc2_11) [template = constants.%i32] -// CHECK:STDOUT: %.loc2_11.1: type = value_of_initializer %int.make_type_signed.loc2_11 [template = constants.%i32] -// CHECK:STDOUT: %.loc2_11.2: type = converted %int.make_type_signed.loc2_11, %.loc2_11.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc2_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc2_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc2_19: init type = call constants.%Int(%int_32.loc2_19) [template = constants.%i32] -// CHECK:STDOUT: %.loc2_19.1: type = value_of_initializer %int.make_type_signed.loc2_19 [template = constants.%i32] -// CHECK:STDOUT: %.loc2_19.2: type = converted %int.make_type_signed.loc2_19, %.loc2_19.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc2_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc2_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc2_27: init type = call constants.%Int(%int_32.loc2_27) [template = constants.%i32] -// CHECK:STDOUT: %.loc2_27.1: type = value_of_initializer %int.make_type_signed.loc2_27 [template = constants.%i32] -// CHECK:STDOUT: %.loc2_27.2: type = converted %int.make_type_signed.loc2_27, %.loc2_27.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc2_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 @@ -167,28 +159,26 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %int_32.loc4: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc4: init type = call constants.%Int(%int_32.loc4) [template = constants.%i32] -// CHECK:STDOUT: %Add.ref: %Add.type = name_ref Add, %Add.decl [template = constants.%Add] +// CHECK:STDOUT: %i32.loc4: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %Add.ref: %Add.type.1 = name_ref Add, %Add.decl [template = constants.%Add] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %impl.elem0.loc4_20: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc4_20: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc4_20: = bound_method %int_1, %impl.elem0.loc4_20 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc4_20: = specific_function %Convert.bound.loc4_20, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc4_20: init %i32 = call %Convert.specific_fn.loc4_20(%int_1) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc4_20.1: %i32 = value_of_initializer %int.convert_checked.loc4_20 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc4_20.2: %i32 = converted %int_1, %.loc4_20.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc4_23: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc4_23: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc4_23: = bound_method %int_2, %impl.elem0.loc4_23 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc4_23: = specific_function %Convert.bound.loc4_23, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc4_23: init %i32 = call %Convert.specific_fn.loc4_23(%int_2) [template = constants.%int_2.2] // CHECK:STDOUT: %.loc4_23.1: %i32 = value_of_initializer %int.convert_checked.loc4_23 [template = constants.%int_2.2] // CHECK:STDOUT: %.loc4_23.2: %i32 = converted %int_2, %.loc4_23.1 [template = constants.%int_2.2] // CHECK:STDOUT: %int.uadd: init %i32 = call %Add.ref(%.loc4_20.2, %.loc4_23.2) [template = constants.%int_3.1] -// CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_signed.loc4 [template = constants.%i32] -// CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_signed.loc4, %.loc4_11.1 [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc4_24: %Convert.type.6 = interface_witness_access constants.%interface.10, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %impl.elem0.loc4_24: %Convert.type.5 = interface_witness_access constants.%interface.6, element0 [template = constants.%Convert.11] // CHECK:STDOUT: %Convert.bound.loc4_24: = bound_method %int.uadd, %impl.elem0.loc4_24 [template = constants.%Convert.bound.3] -// CHECK:STDOUT: %Convert.specific_fn.loc4_24: = specific_function %Convert.bound.loc4_24, @Convert.4(constants.%int_32) [template = constants.%Convert.specific_fn.3] +// CHECK:STDOUT: %Convert.specific_fn.loc4_24: = specific_function %Convert.bound.loc4_24, @Convert.3(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %.loc4_24.1: %i32 = value_of_initializer %int.uadd [template = constants.%int_3.1] // CHECK:STDOUT: %.loc4_24.2: %i32 = converted %int.uadd, %.loc4_24.1 [template = constants.%int_3.1] // CHECK:STDOUT: %int.convert_checked.loc4_24: init Core.IntLiteral = call %Convert.specific_fn.loc4_24(%.loc4_24.2) [template = constants.%int_3.2] @@ -198,10 +188,8 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: %arr.var: ref %array_type = var arr // CHECK:STDOUT: %arr: ref %array_type = bind_name arr, %arr.var // CHECK:STDOUT: %int_32.loc5: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc5: init type = call constants.%Int(%int_32.loc5) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc5: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3.2] -// CHECK:STDOUT: %.loc5_13.1: type = value_of_initializer %int.make_type_signed.loc5 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_13.2: type = converted %int.make_type_signed.loc5, %.loc5_13.1 [template = constants.%i32] // CHECK:STDOUT: %array_type.loc5: type = array_type %int_3, %i32 [template = constants.%array_type] // CHECK:STDOUT: %ptr: type = ptr_type %array_type [template = constants.%ptr] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { @@ -213,17 +201,11 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc7_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc7_19: init type = call constants.%Int(%int_32.loc7_19) [template = constants.%i32] -// CHECK:STDOUT: %.loc7_19.1: type = value_of_initializer %int.make_type_signed.loc7_19 [template = constants.%i32] -// CHECK:STDOUT: %.loc7_19.2: type = converted %int.make_type_signed.loc7_19, %.loc7_19.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc7_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc7_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc7_27: init type = call constants.%Int(%int_32.loc7_27) [template = constants.%i32] -// CHECK:STDOUT: %.loc7_27.1: type = value_of_initializer %int.make_type_signed.loc7_27 [template = constants.%i32] -// CHECK:STDOUT: %.loc7_27.2: type = converted %int.make_type_signed.loc7_27, %.loc7_27.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc7_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc7_35: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc7_35: init type = call constants.%Int(%int_32.loc7_35) [template = constants.%i32] -// CHECK:STDOUT: %.loc7_35.1: type = value_of_initializer %int.make_type_signed.loc7_35 [template = constants.%i32] -// CHECK:STDOUT: %.loc7_35.2: type = converted %int.make_type_signed.loc7_35, %.loc7_35.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc7_35: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 @@ -233,11 +215,11 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Add(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.uadd"; +// CHECK:STDOUT: fn @Add.1(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.uadd"; // CHECK:STDOUT: // CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Add.ref: %Add.type = name_ref Add, file.%Add.decl [template = constants.%Add] +// CHECK:STDOUT: %Add.ref: %Add.type.1 = name_ref Add, file.%Add.decl [template = constants.%Add] // CHECK:STDOUT: %a.ref: %i32 = name_ref a, %a // CHECK:STDOUT: %b.ref: %i32 = name_ref b, %b // CHECK:STDOUT: %int.uadd: init %i32 = call %Add.ref(%a.ref, %b.ref) @@ -258,9 +240,7 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %TooFew.type: type = fn_type @TooFew [template] // CHECK:STDOUT: %TooFew: %TooFew.type = struct_value () [template] // CHECK:STDOUT: %TooMany.type: type = fn_type @TooMany [template] @@ -273,18 +253,18 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: %JustRight: %JustRight.type = struct_value () [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] // CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %int_3.1: Core.IntLiteral = int_value 3 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] -// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_3.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_3.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_3.2: %i32 = int_value 3 [template] // CHECK:STDOUT: %RuntimeCallTooFew.type: type = fn_type @RuntimeCallTooFew [template] @@ -298,8 +278,8 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .Bool = %import_ref.2 -// CHECK:STDOUT: .ImplicitAs = %import_ref.3 +// CHECK:STDOUT: .Bool = %import_ref.5 +// CHECK:STDOUT: .ImplicitAs = %import_ref.6 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -328,13 +308,9 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc8_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc8_14: init type = call constants.%Int(%int_32.loc8_14) [template = constants.%i32] -// CHECK:STDOUT: %.loc8_14.1: type = value_of_initializer %int.make_type_signed.loc8_14 [template = constants.%i32] -// CHECK:STDOUT: %.loc8_14.2: type = converted %int.make_type_signed.loc8_14, %.loc8_14.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc8_14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc8_22: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc8_22: init type = call constants.%Int(%int_32.loc8_22) [template = constants.%i32] -// CHECK:STDOUT: %.loc8_22.1: type = value_of_initializer %int.make_type_signed.loc8_22 [template = constants.%i32] -// CHECK:STDOUT: %.loc8_22.2: type = converted %int.make_type_signed.loc8_22, %.loc8_22.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc8_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 @@ -351,21 +327,13 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param3 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc13_15: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc13_15: init type = call constants.%Int(%int_32.loc13_15) [template = constants.%i32] -// CHECK:STDOUT: %.loc13_15.1: type = value_of_initializer %int.make_type_signed.loc13_15 [template = constants.%i32] -// CHECK:STDOUT: %.loc13_15.2: type = converted %int.make_type_signed.loc13_15, %.loc13_15.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc13_15: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc13_23: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc13_23: init type = call constants.%Int(%int_32.loc13_23) [template = constants.%i32] -// CHECK:STDOUT: %.loc13_23.1: type = value_of_initializer %int.make_type_signed.loc13_23 [template = constants.%i32] -// CHECK:STDOUT: %.loc13_23.2: type = converted %int.make_type_signed.loc13_23, %.loc13_23.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc13_23: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc13_31: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc13_31: init type = call constants.%Int(%int_32.loc13_31) [template = constants.%i32] -// CHECK:STDOUT: %.loc13_31.1: type = value_of_initializer %int.make_type_signed.loc13_31 [template = constants.%i32] -// CHECK:STDOUT: %.loc13_31.2: type = converted %int.make_type_signed.loc13_31, %.loc13_31.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc13_31: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc13_39: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc13_39: init type = call constants.%Int(%int_32.loc13_39) [template = constants.%i32] -// CHECK:STDOUT: %.loc13_39.1: type = value_of_initializer %int.make_type_signed.loc13_39 [template = constants.%i32] -// CHECK:STDOUT: %.loc13_39.2: type = converted %int.make_type_signed.loc13_39, %.loc13_39.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc13_39: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 @@ -384,13 +352,9 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc18_21: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc18_21: init type = call constants.%Int(%int_32.loc18_21) [template = constants.%i32] -// CHECK:STDOUT: %.loc18_21.1: type = value_of_initializer %int.make_type_signed.loc18_21 [template = constants.%i32] -// CHECK:STDOUT: %.loc18_21.2: type = converted %int.make_type_signed.loc18_21, %.loc18_21.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc18_21: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc18_29: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc18_29: init type = call constants.%Int(%int_32.loc18_29) [template = constants.%i32] -// CHECK:STDOUT: %.loc18_29.1: type = value_of_initializer %int.make_type_signed.loc18_29 [template = constants.%i32] -// CHECK:STDOUT: %.loc18_29.2: type = converted %int.make_type_signed.loc18_29, %.loc18_29.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc18_29: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc18_37.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc18_37.2: type = converted %bool.make_type, %.loc18_37.1 [template = bool] @@ -410,17 +374,11 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc19_17: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc19_17: init type = call constants.%Int(%int_32.loc19_17) [template = constants.%i32] -// CHECK:STDOUT: %.loc19_17.1: type = value_of_initializer %int.make_type_signed.loc19_17 [template = constants.%i32] -// CHECK:STDOUT: %.loc19_17.2: type = converted %int.make_type_signed.loc19_17, %.loc19_17.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc19_17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc19_25: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc19_25: init type = call constants.%Int(%int_32.loc19_25) [template = constants.%i32] -// CHECK:STDOUT: %.loc19_25.1: type = value_of_initializer %int.make_type_signed.loc19_25 [template = constants.%i32] -// CHECK:STDOUT: %.loc19_25.2: type = converted %int.make_type_signed.loc19_25, %.loc19_25.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc19_25: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc19_33: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc19_33: init type = call constants.%Int(%int_32.loc19_33) [template = constants.%i32] -// CHECK:STDOUT: %.loc19_33.1: type = value_of_initializer %int.make_type_signed.loc19_33 [template = constants.%i32] -// CHECK:STDOUT: %.loc19_33.2: type = converted %int.make_type_signed.loc19_33, %.loc19_33.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc19_33: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 @@ -429,79 +387,71 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %int_32.loc25: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc25: init type = call constants.%Int(%int_32.loc25) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc25: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %TooFew.ref: %TooFew.type = name_ref TooFew, %TooFew.decl [template = constants.%TooFew] // CHECK:STDOUT: %int_1.loc25: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc25: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc25: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc25: = bound_method %int_1.loc25, %impl.elem0.loc25 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc25: = specific_function %Convert.bound.loc25, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc25: init %i32 = call %Convert.specific_fn.loc25(%int_1.loc25) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc25_27.1: %i32 = value_of_initializer %int.convert_checked.loc25 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc25_27.2: %i32 = converted %int_1.loc25, %.loc25_27.1 [template = constants.%int_1.2] // CHECK:STDOUT: %TooFew.call: init %i32 = call %TooFew.ref(%.loc25_27.2) -// CHECK:STDOUT: %.loc25_15.1: type = value_of_initializer %int.make_type_signed.loc25 [template = constants.%i32] -// CHECK:STDOUT: %.loc25_15.2: type = converted %int.make_type_signed.loc25, %.loc25_15.1 [template = constants.%i32] // CHECK:STDOUT: %too_few.var: ref = var too_few // CHECK:STDOUT: %too_few: ref = bind_name too_few, %too_few.var // CHECK:STDOUT: %int_32.loc30: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc30: init type = call constants.%Int(%int_32.loc30) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc30: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %TooMany.ref: %TooMany.type = name_ref TooMany, %TooMany.decl [template = constants.%TooMany] // CHECK:STDOUT: %int_1.loc30: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_2.loc30: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %int_3.loc30: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] -// CHECK:STDOUT: %impl.elem0.loc30_29: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc30_29: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc30_29: = bound_method %int_1.loc30, %impl.elem0.loc30_29 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc30_29: = specific_function %Convert.bound.loc30_29, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc30_29: init %i32 = call %Convert.specific_fn.loc30_29(%int_1.loc30) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc30_29.1: %i32 = value_of_initializer %int.convert_checked.loc30_29 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc30_29.2: %i32 = converted %int_1.loc30, %.loc30_29.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc30_32: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc30_32: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc30_32: = bound_method %int_2.loc30, %impl.elem0.loc30_32 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc30_32: = specific_function %Convert.bound.loc30_32, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc30_32: init %i32 = call %Convert.specific_fn.loc30_32(%int_2.loc30) [template = constants.%int_2.2] // CHECK:STDOUT: %.loc30_32.1: %i32 = value_of_initializer %int.convert_checked.loc30_32 [template = constants.%int_2.2] // CHECK:STDOUT: %.loc30_32.2: %i32 = converted %int_2.loc30, %.loc30_32.1 [template = constants.%int_2.2] -// CHECK:STDOUT: %impl.elem0.loc30_35: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc30_35: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc30_35: = bound_method %int_3.loc30, %impl.elem0.loc30_35 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc30_35: = specific_function %Convert.bound.loc30_35, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc30_35: init %i32 = call %Convert.specific_fn.loc30_35(%int_3.loc30) [template = constants.%int_3.2] // CHECK:STDOUT: %.loc30_35.1: %i32 = value_of_initializer %int.convert_checked.loc30_35 [template = constants.%int_3.2] // CHECK:STDOUT: %.loc30_35.2: %i32 = converted %int_3.loc30, %.loc30_35.1 [template = constants.%int_3.2] // CHECK:STDOUT: %TooMany.call: init %i32 = call %TooMany.ref(%.loc30_29.2, %.loc30_32.2, %.loc30_35.2) -// CHECK:STDOUT: %.loc30_16.1: type = value_of_initializer %int.make_type_signed.loc30 [template = constants.%i32] -// CHECK:STDOUT: %.loc30_16.2: type = converted %int.make_type_signed.loc30, %.loc30_16.1 [template = constants.%i32] // CHECK:STDOUT: %too_many.var: ref = var too_many // CHECK:STDOUT: %too_many: ref = bind_name too_many, %too_many.var // CHECK:STDOUT: %int_32.loc35: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc35: init type = call constants.%Int(%int_32.loc35) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc35: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %BadReturnType.ref: %BadReturnType.type = name_ref BadReturnType, %BadReturnType.decl [template = constants.%BadReturnType] // CHECK:STDOUT: %int_1.loc35: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_2.loc35: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %impl.elem0.loc35_42: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc35_42: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc35_42: = bound_method %int_1.loc35, %impl.elem0.loc35_42 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc35_42: = specific_function %Convert.bound.loc35_42, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc35_42: init %i32 = call %Convert.specific_fn.loc35_42(%int_1.loc35) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc35_42.1: %i32 = value_of_initializer %int.convert_checked.loc35_42 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc35_42.2: %i32 = converted %int_1.loc35, %.loc35_42.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc35_45: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc35_45: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc35_45: = bound_method %int_2.loc35, %impl.elem0.loc35_45 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc35_45: = specific_function %Convert.bound.loc35_45, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc35_45: init %i32 = call %Convert.specific_fn.loc35_45(%int_2.loc35) [template = constants.%int_2.2] // CHECK:STDOUT: %.loc35_45.1: %i32 = value_of_initializer %int.convert_checked.loc35_45 [template = constants.%int_2.2] // CHECK:STDOUT: %.loc35_45.2: %i32 = converted %int_2.loc35, %.loc35_45.1 [template = constants.%int_2.2] // CHECK:STDOUT: %BadReturnType.call: init bool = call %BadReturnType.ref(%.loc35_42.2, %.loc35_45.2) -// CHECK:STDOUT: %.loc35_23.1: type = value_of_initializer %int.make_type_signed.loc35 [template = constants.%i32] -// CHECK:STDOUT: %.loc35_23.2: type = converted %int.make_type_signed.loc35, %.loc35_23.1 [template = constants.%i32] // CHECK:STDOUT: %bad_return_type.var: ref = var bad_return_type // CHECK:STDOUT: %bad_return_type: ref = bind_name bad_return_type, %bad_return_type.var // CHECK:STDOUT: %int_32.loc43: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc43: init type = call constants.%Int(%int_32.loc43) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc43: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %JustRight.ref: %JustRight.type = name_ref JustRight, %JustRight.decl [template = constants.%JustRight] // CHECK:STDOUT: %int_1.loc43: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_2.loc43: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %int_3.loc43: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] -// CHECK:STDOUT: %.loc43_16.1: type = value_of_initializer %int.make_type_signed.loc43 [template = constants.%i32] -// CHECK:STDOUT: %.loc43_16.2: type = converted %int.make_type_signed.loc43, %.loc43_16.1 [template = constants.%i32] // CHECK:STDOUT: %array_type: type = array_type , %i32 [template = ] // CHECK:STDOUT: %bad_call.var: ref = var bad_call // CHECK:STDOUT: %bad_call: ref = bind_name bad_call, %bad_call.var @@ -512,13 +462,9 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc45_25: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc45_25: init type = call constants.%Int(%int_32.loc45_25) [template = constants.%i32] -// CHECK:STDOUT: %.loc45_25.1: type = value_of_initializer %int.make_type_signed.loc45_25 [template = constants.%i32] -// CHECK:STDOUT: %.loc45_25.2: type = converted %int.make_type_signed.loc45_25, %.loc45_25.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc45_25: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc45_33: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc45_33: init type = call constants.%Int(%int_32.loc45_33) [template = constants.%i32] -// CHECK:STDOUT: %.loc45_33.1: type = value_of_initializer %int.make_type_signed.loc45_33 [template = constants.%i32] -// CHECK:STDOUT: %.loc45_33.2: type = converted %int.make_type_signed.loc45_33, %.loc45_33.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc45_33: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 @@ -535,21 +481,13 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param3 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc49_26: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc49_26: init type = call constants.%Int(%int_32.loc49_26) [template = constants.%i32] -// CHECK:STDOUT: %.loc49_26.1: type = value_of_initializer %int.make_type_signed.loc49_26 [template = constants.%i32] -// CHECK:STDOUT: %.loc49_26.2: type = converted %int.make_type_signed.loc49_26, %.loc49_26.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc49_26: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc49_34: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc49_34: init type = call constants.%Int(%int_32.loc49_34) [template = constants.%i32] -// CHECK:STDOUT: %.loc49_34.1: type = value_of_initializer %int.make_type_signed.loc49_34 [template = constants.%i32] -// CHECK:STDOUT: %.loc49_34.2: type = converted %int.make_type_signed.loc49_34, %.loc49_34.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc49_34: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc49_42: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc49_42: init type = call constants.%Int(%int_32.loc49_42) [template = constants.%i32] -// CHECK:STDOUT: %.loc49_42.1: type = value_of_initializer %int.make_type_signed.loc49_42 [template = constants.%i32] -// CHECK:STDOUT: %.loc49_42.2: type = converted %int.make_type_signed.loc49_42, %.loc49_42.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc49_42: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc49_50: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc49_50: init type = call constants.%Int(%int_32.loc49_50) [template = constants.%i32] -// CHECK:STDOUT: %.loc49_50.1: type = value_of_initializer %int.make_type_signed.loc49_50 [template = constants.%i32] -// CHECK:STDOUT: %.loc49_50.2: type = converted %int.make_type_signed.loc49_50, %.loc49_50.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc49_50: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 @@ -568,13 +506,9 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc53_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc53_32: init type = call constants.%Int(%int_32.loc53_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc53_32.1: type = value_of_initializer %int.make_type_signed.loc53_32 [template = constants.%i32] -// CHECK:STDOUT: %.loc53_32.2: type = converted %int.make_type_signed.loc53_32, %.loc53_32.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc53_32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc53_40: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc53_40: init type = call constants.%Int(%int_32.loc53_40) [template = constants.%i32] -// CHECK:STDOUT: %.loc53_40.1: type = value_of_initializer %int.make_type_signed.loc53_40 [template = constants.%i32] -// CHECK:STDOUT: %.loc53_40.2: type = converted %int.make_type_signed.loc53_40, %.loc53_40.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc53_40: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc53_48.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc53_48.2: type = converted %bool.make_type, %.loc53_48.1 [template = bool] @@ -632,25 +566,23 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] -// CHECK:STDOUT: %Add.type: type = fn_type @Add [template] -// CHECK:STDOUT: %Add: %Add.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] +// CHECK:STDOUT: %Add.type.1: type = fn_type @Add.1 [template] +// CHECK:STDOUT: %Add: %Add.type.1 = struct_value () [template] // CHECK:STDOUT: %int_2147483647.1: Core.IntLiteral = int_value 2147483647 [template] // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_2147483647.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_2147483647.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2147483647.2: %i32 = int_value 2147483647 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_0.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] // CHECK:STDOUT: %int_-2147483648: %i32 = int_value -2147483648 [template] @@ -659,7 +591,7 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -673,7 +605,7 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: .b = @__global_init.%b // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Add.decl: %Add.type = fn_decl @Add [template = constants.%Add] { +// CHECK:STDOUT: %Add.decl: %Add.type.1 = fn_decl @Add.1 [template = constants.%Add] { // CHECK:STDOUT: %a.patt: %i32 = binding_pattern a // CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: %i32 = binding_pattern b @@ -682,17 +614,11 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc4_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc4_11: init type = call constants.%Int(%int_32.loc4_11) [template = constants.%i32] -// CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_signed.loc4_11 [template = constants.%i32] -// CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_signed.loc4_11, %.loc4_11.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc4_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc4_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc4_19: init type = call constants.%Int(%int_32.loc4_19) [template = constants.%i32] -// CHECK:STDOUT: %.loc4_19.1: type = value_of_initializer %int.make_type_signed.loc4_19 [template = constants.%i32] -// CHECK:STDOUT: %.loc4_19.2: type = converted %int.make_type_signed.loc4_19, %.loc4_19.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc4_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc4_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc4_27: init type = call constants.%Int(%int_32.loc4_27) [template = constants.%i32] -// CHECK:STDOUT: %.loc4_27.1: type = value_of_initializer %int.make_type_signed.loc4_27 [template = constants.%i32] -// CHECK:STDOUT: %.loc4_27.2: type = converted %int.make_type_signed.loc4_27, %.loc4_27.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc4_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 @@ -701,29 +627,25 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %int_32.loc7: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc7: init type = call constants.%Int(%int_32.loc7) [template = constants.%i32] -// CHECK:STDOUT: %.loc7_8.1: type = value_of_initializer %int.make_type_signed.loc7 [template = constants.%i32] -// CHECK:STDOUT: %.loc7_8.2: type = converted %int.make_type_signed.loc7, %.loc7_8.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc7: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc8: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc8: init type = call constants.%Int(%int_32.loc8) [template = constants.%i32] -// CHECK:STDOUT: %.loc8_8.1: type = value_of_initializer %int.make_type_signed.loc8 [template = constants.%i32] -// CHECK:STDOUT: %.loc8_8.2: type = converted %int.make_type_signed.loc8, %.loc8_8.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc8: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Add(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.uadd"; +// CHECK:STDOUT: fn @Add.1(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.uadd"; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Add.ref.loc7: %Add.type = name_ref Add, file.%Add.decl [template = constants.%Add] +// CHECK:STDOUT: %Add.ref.loc7: %Add.type.1 = name_ref Add, file.%Add.decl [template = constants.%Add] // CHECK:STDOUT: %int_2147483647.loc7: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0.loc7_18: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc7_18: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc7_18: = bound_method %int_2147483647.loc7, %impl.elem0.loc7_18 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc7_18: = specific_function %Convert.bound.loc7_18, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc7_18: init %i32 = call %Convert.specific_fn.loc7_18(%int_2147483647.loc7) [template = constants.%int_2147483647.2] // CHECK:STDOUT: %.loc7_18.1: %i32 = value_of_initializer %int.convert_checked.loc7_18 [template = constants.%int_2147483647.2] // CHECK:STDOUT: %.loc7_18.2: %i32 = converted %int_2147483647.loc7, %.loc7_18.1 [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %impl.elem0.loc7_30: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc7_30: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc7_30: = bound_method %int_0, %impl.elem0.loc7_30 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc7_30: = specific_function %Convert.bound.loc7_30, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc7_30: init %i32 = call %Convert.specific_fn.loc7_30(%int_0) [template = constants.%int_0.2] @@ -733,16 +655,16 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: %.loc7_32.1: %i32 = value_of_initializer %int.uadd.loc7 [template = constants.%int_2147483647.2] // CHECK:STDOUT: %.loc7_32.2: %i32 = converted %int.uadd.loc7, %.loc7_32.1 [template = constants.%int_2147483647.2] // CHECK:STDOUT: %a: %i32 = bind_name a, %.loc7_32.2 -// CHECK:STDOUT: %Add.ref.loc8: %Add.type = name_ref Add, file.%Add.decl [template = constants.%Add] +// CHECK:STDOUT: %Add.ref.loc8: %Add.type.1 = name_ref Add, file.%Add.decl [template = constants.%Add] // CHECK:STDOUT: %int_2147483647.loc8: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc8_18: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc8_18: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc8_18: = bound_method %int_2147483647.loc8, %impl.elem0.loc8_18 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc8_18: = specific_function %Convert.bound.loc8_18, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc8_18: init %i32 = call %Convert.specific_fn.loc8_18(%int_2147483647.loc8) [template = constants.%int_2147483647.2] // CHECK:STDOUT: %.loc8_18.1: %i32 = value_of_initializer %int.convert_checked.loc8_18 [template = constants.%int_2147483647.2] // CHECK:STDOUT: %.loc8_18.2: %i32 = converted %int_2147483647.loc8, %.loc8_18.1 [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %impl.elem0.loc8_30: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc8_30: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc8_30: = bound_method %int_1, %impl.elem0.loc8_30 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc8_30: = specific_function %Convert.bound.loc8_30, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc8_30: init %i32 = call %Convert.specific_fn.loc8_30(%int_1) [template = constants.%int_1.2] diff --git a/toolchain/check/testdata/builtins/int/udiv.carbon b/toolchain/check/testdata/builtins/int/udiv.carbon index 23a9d6f2fa284..aa6b80315153b 100644 --- a/toolchain/check/testdata/builtins/int/udiv.carbon +++ b/toolchain/check/testdata/builtins/int/udiv.carbon @@ -57,30 +57,28 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] -// CHECK:STDOUT: %Div.type: type = fn_type @Div [template] -// CHECK:STDOUT: %Div: %Div.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] +// CHECK:STDOUT: %Div.type.1: type = fn_type @Div.1 [template] +// CHECK:STDOUT: %Div: %Div.type.1 = struct_value () [template] // CHECK:STDOUT: %int_3.1: Core.IntLiteral = int_value 3 [template] // CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_3.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_3.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_3.2: %i32 = int_value 3 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] // CHECK:STDOUT: %int_1.1: %i32 = int_value 1 [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.4, @impl.3(%int_32) [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %interface.10: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_1.1, %Convert.15 [template] -// CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.4(%int_32) [template] +// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.3, @impl.2(%int_32) [template] +// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [template] +// CHECK:STDOUT: %interface.6: = interface_witness (%Convert.11) [template] +// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_1.1, %Convert.11 [template] +// CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.3(%int_32) [template] // CHECK:STDOUT: %int_1.2: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %array_type: type = array_type %int_1.2, %i32 [template] // CHECK:STDOUT: %ptr: type = ptr_type %array_type [template] @@ -91,7 +89,7 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -106,7 +104,7 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Div.decl: %Div.type = fn_decl @Div [template = constants.%Div] { +// CHECK:STDOUT: %Div.decl: %Div.type.1 = fn_decl @Div.1 [template = constants.%Div] { // CHECK:STDOUT: %a.patt: %i32 = binding_pattern a // CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: %i32 = binding_pattern b @@ -115,17 +113,11 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc2_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc2_11: init type = call constants.%Int(%int_32.loc2_11) [template = constants.%i32] -// CHECK:STDOUT: %.loc2_11.1: type = value_of_initializer %int.make_type_signed.loc2_11 [template = constants.%i32] -// CHECK:STDOUT: %.loc2_11.2: type = converted %int.make_type_signed.loc2_11, %.loc2_11.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc2_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc2_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc2_19: init type = call constants.%Int(%int_32.loc2_19) [template = constants.%i32] -// CHECK:STDOUT: %.loc2_19.1: type = value_of_initializer %int.make_type_signed.loc2_19 [template = constants.%i32] -// CHECK:STDOUT: %.loc2_19.2: type = converted %int.make_type_signed.loc2_19, %.loc2_19.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc2_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc2_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc2_27: init type = call constants.%Int(%int_32.loc2_27) [template = constants.%i32] -// CHECK:STDOUT: %.loc2_27.1: type = value_of_initializer %int.make_type_signed.loc2_27 [template = constants.%i32] -// CHECK:STDOUT: %.loc2_27.2: type = converted %int.make_type_signed.loc2_27, %.loc2_27.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc2_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 @@ -134,28 +126,26 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %int_32.loc4: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc4: init type = call constants.%Int(%int_32.loc4) [template = constants.%i32] -// CHECK:STDOUT: %Div.ref: %Div.type = name_ref Div, %Div.decl [template = constants.%Div] +// CHECK:STDOUT: %i32.loc4: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %Div.ref: %Div.type.1 = name_ref Div, %Div.decl [template = constants.%Div] // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %impl.elem0.loc4_20: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc4_20: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc4_20: = bound_method %int_3, %impl.elem0.loc4_20 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc4_20: = specific_function %Convert.bound.loc4_20, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc4_20: init %i32 = call %Convert.specific_fn.loc4_20(%int_3) [template = constants.%int_3.2] // CHECK:STDOUT: %.loc4_20.1: %i32 = value_of_initializer %int.convert_checked.loc4_20 [template = constants.%int_3.2] // CHECK:STDOUT: %.loc4_20.2: %i32 = converted %int_3, %.loc4_20.1 [template = constants.%int_3.2] -// CHECK:STDOUT: %impl.elem0.loc4_23: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc4_23: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc4_23: = bound_method %int_2, %impl.elem0.loc4_23 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc4_23: = specific_function %Convert.bound.loc4_23, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc4_23: init %i32 = call %Convert.specific_fn.loc4_23(%int_2) [template = constants.%int_2.2] // CHECK:STDOUT: %.loc4_23.1: %i32 = value_of_initializer %int.convert_checked.loc4_23 [template = constants.%int_2.2] // CHECK:STDOUT: %.loc4_23.2: %i32 = converted %int_2, %.loc4_23.1 [template = constants.%int_2.2] // CHECK:STDOUT: %int.udiv: init %i32 = call %Div.ref(%.loc4_20.2, %.loc4_23.2) [template = constants.%int_1.1] -// CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_signed.loc4 [template = constants.%i32] -// CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_signed.loc4, %.loc4_11.1 [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc4_24: %Convert.type.6 = interface_witness_access constants.%interface.10, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %impl.elem0.loc4_24: %Convert.type.5 = interface_witness_access constants.%interface.6, element0 [template = constants.%Convert.11] // CHECK:STDOUT: %Convert.bound.loc4_24: = bound_method %int.udiv, %impl.elem0.loc4_24 [template = constants.%Convert.bound.3] -// CHECK:STDOUT: %Convert.specific_fn.loc4_24: = specific_function %Convert.bound.loc4_24, @Convert.4(constants.%int_32) [template = constants.%Convert.specific_fn.3] +// CHECK:STDOUT: %Convert.specific_fn.loc4_24: = specific_function %Convert.bound.loc4_24, @Convert.3(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %.loc4_24.1: %i32 = value_of_initializer %int.udiv [template = constants.%int_1.1] // CHECK:STDOUT: %.loc4_24.2: %i32 = converted %int.udiv, %.loc4_24.1 [template = constants.%int_1.1] // CHECK:STDOUT: %int.convert_checked.loc4_24: init Core.IntLiteral = call %Convert.specific_fn.loc4_24(%.loc4_24.2) [template = constants.%int_1.2] @@ -165,10 +155,8 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: %arr.var: ref %array_type = var arr // CHECK:STDOUT: %arr: ref %array_type = bind_name arr, %arr.var // CHECK:STDOUT: %int_32.loc5: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc5: init type = call constants.%Int(%int_32.loc5) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc5: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc5_13.1: type = value_of_initializer %int.make_type_signed.loc5 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_13.2: type = converted %int.make_type_signed.loc5, %.loc5_13.1 [template = constants.%i32] // CHECK:STDOUT: %array_type.loc5: type = array_type %int_1, %i32 [template = constants.%array_type] // CHECK:STDOUT: %ptr: type = ptr_type %array_type [template = constants.%ptr] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { @@ -180,17 +168,11 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc7_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc7_19: init type = call constants.%Int(%int_32.loc7_19) [template = constants.%i32] -// CHECK:STDOUT: %.loc7_19.1: type = value_of_initializer %int.make_type_signed.loc7_19 [template = constants.%i32] -// CHECK:STDOUT: %.loc7_19.2: type = converted %int.make_type_signed.loc7_19, %.loc7_19.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc7_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc7_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc7_27: init type = call constants.%Int(%int_32.loc7_27) [template = constants.%i32] -// CHECK:STDOUT: %.loc7_27.1: type = value_of_initializer %int.make_type_signed.loc7_27 [template = constants.%i32] -// CHECK:STDOUT: %.loc7_27.2: type = converted %int.make_type_signed.loc7_27, %.loc7_27.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc7_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc7_35: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc7_35: init type = call constants.%Int(%int_32.loc7_35) [template = constants.%i32] -// CHECK:STDOUT: %.loc7_35.1: type = value_of_initializer %int.make_type_signed.loc7_35 [template = constants.%i32] -// CHECK:STDOUT: %.loc7_35.2: type = converted %int.make_type_signed.loc7_35, %.loc7_35.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc7_35: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 @@ -200,11 +182,11 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Div(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.udiv"; +// CHECK:STDOUT: fn @Div.1(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.udiv"; // CHECK:STDOUT: // CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Div.ref: %Div.type = name_ref Div, file.%Div.decl [template = constants.%Div] +// CHECK:STDOUT: %Div.ref: %Div.type.1 = name_ref Div, file.%Div.decl [template = constants.%Div] // CHECK:STDOUT: %a.ref: %i32 = name_ref a, %a // CHECK:STDOUT: %b.ref: %i32 = name_ref b, %b // CHECK:STDOUT: %int.udiv: init %i32 = call %Div.ref(%a.ref, %b.ref) @@ -225,26 +207,24 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] -// CHECK:STDOUT: %Div.type: type = fn_type @Div [template] -// CHECK:STDOUT: %Div: %Div.type = struct_value () [template] -// CHECK:STDOUT: %Sub.type: type = fn_type @Sub [template] -// CHECK:STDOUT: %Sub: %Sub.type = struct_value () [template] -// CHECK:STDOUT: %Negate.type: type = fn_type @Negate [template] -// CHECK:STDOUT: %Negate: %Negate.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] +// CHECK:STDOUT: %Div.type.1: type = fn_type @Div.1 [template] +// CHECK:STDOUT: %Div: %Div.type.1 = struct_value () [template] +// CHECK:STDOUT: %Sub.type.1: type = fn_type @Sub.1 [template] +// CHECK:STDOUT: %Sub: %Sub.type.1 = struct_value () [template] +// CHECK:STDOUT: %Negate.type.1: type = fn_type @Negate.1 [template] +// CHECK:STDOUT: %Negate: %Negate.type.1 = struct_value () [template] // CHECK:STDOUT: %int_2147483647.1: Core.IntLiteral = int_value 2147483647 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_2147483647.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_2147483647.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2147483647.2: %i32 = int_value 2147483647 [template] // CHECK:STDOUT: %int_-2147483647: %i32 = int_value -2147483647 [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] // CHECK:STDOUT: %int_-1: %i32 = int_value -1 [template] @@ -255,7 +235,7 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -272,7 +252,7 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: .c = @__global_init.%c // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Div.decl: %Div.type = fn_decl @Div [template = constants.%Div] { +// CHECK:STDOUT: %Div.decl: %Div.type.1 = fn_decl @Div.1 [template = constants.%Div] { // CHECK:STDOUT: %a.patt: %i32 = binding_pattern a // CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: %i32 = binding_pattern b @@ -281,17 +261,11 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc4_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc4_11: init type = call constants.%Int(%int_32.loc4_11) [template = constants.%i32] -// CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_signed.loc4_11 [template = constants.%i32] -// CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_signed.loc4_11, %.loc4_11.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc4_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc4_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc4_19: init type = call constants.%Int(%int_32.loc4_19) [template = constants.%i32] -// CHECK:STDOUT: %.loc4_19.1: type = value_of_initializer %int.make_type_signed.loc4_19 [template = constants.%i32] -// CHECK:STDOUT: %.loc4_19.2: type = converted %int.make_type_signed.loc4_19, %.loc4_19.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc4_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc4_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc4_27: init type = call constants.%Int(%int_32.loc4_27) [template = constants.%i32] -// CHECK:STDOUT: %.loc4_27.1: type = value_of_initializer %int.make_type_signed.loc4_27 [template = constants.%i32] -// CHECK:STDOUT: %.loc4_27.2: type = converted %int.make_type_signed.loc4_27, %.loc4_27.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc4_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 @@ -299,7 +273,7 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %Sub.decl: %Sub.type = fn_decl @Sub [template = constants.%Sub] { +// CHECK:STDOUT: %Sub.decl: %Sub.type.1 = fn_decl @Sub.1 [template = constants.%Sub] { // CHECK:STDOUT: %a.patt: %i32 = binding_pattern a // CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: %i32 = binding_pattern b @@ -308,17 +282,11 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc5_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc5_11: init type = call constants.%Int(%int_32.loc5_11) [template = constants.%i32] -// CHECK:STDOUT: %.loc5_11.1: type = value_of_initializer %int.make_type_signed.loc5_11 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_11.2: type = converted %int.make_type_signed.loc5_11, %.loc5_11.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc5_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc5_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc5_19: init type = call constants.%Int(%int_32.loc5_19) [template = constants.%i32] -// CHECK:STDOUT: %.loc5_19.1: type = value_of_initializer %int.make_type_signed.loc5_19 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_19.2: type = converted %int.make_type_signed.loc5_19, %.loc5_19.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc5_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc5_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc5_27: init type = call constants.%Int(%int_32.loc5_27) [template = constants.%i32] -// CHECK:STDOUT: %.loc5_27.1: type = value_of_initializer %int.make_type_signed.loc5_27 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_27.2: type = converted %int.make_type_signed.loc5_27, %.loc5_27.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc5_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 @@ -326,60 +294,50 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %Negate.decl: %Negate.type = fn_decl @Negate [template = constants.%Negate] { +// CHECK:STDOUT: %Negate.decl: %Negate.type.1 = fn_decl @Negate.1 [template = constants.%Negate] { // CHECK:STDOUT: %a.patt: %i32 = binding_pattern a // CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc6_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc6_14: init type = call constants.%Int(%int_32.loc6_14) [template = constants.%i32] -// CHECK:STDOUT: %.loc6_14.1: type = value_of_initializer %int.make_type_signed.loc6_14 [template = constants.%i32] -// CHECK:STDOUT: %.loc6_14.2: type = converted %int.make_type_signed.loc6_14, %.loc6_14.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc6_14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc6_22: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc6_22: init type = call constants.%Int(%int_32.loc6_22) [template = constants.%i32] -// CHECK:STDOUT: %.loc6_22.1: type = value_of_initializer %int.make_type_signed.loc6_22 [template = constants.%i32] -// CHECK:STDOUT: %.loc6_22.2: type = converted %int.make_type_signed.loc6_22, %.loc6_22.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc6_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %int_32.loc9: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc9: init type = call constants.%Int(%int_32.loc9) [template = constants.%i32] -// CHECK:STDOUT: %.loc9_8.1: type = value_of_initializer %int.make_type_signed.loc9 [template = constants.%i32] -// CHECK:STDOUT: %.loc9_8.2: type = converted %int.make_type_signed.loc9, %.loc9_8.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc9: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc12: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc12: init type = call constants.%Int(%int_32.loc12) [template = constants.%i32] -// CHECK:STDOUT: %.loc12_8.1: type = value_of_initializer %int.make_type_signed.loc12 [template = constants.%i32] -// CHECK:STDOUT: %.loc12_8.2: type = converted %int.make_type_signed.loc12, %.loc12_8.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc12: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc15: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc15: init type = call constants.%Int(%int_32.loc15) [template = constants.%i32] -// CHECK:STDOUT: %.loc15_8.1: type = value_of_initializer %int.make_type_signed.loc15 [template = constants.%i32] -// CHECK:STDOUT: %.loc15_8.2: type = converted %int.make_type_signed.loc15, %.loc15_8.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc15: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Div(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.udiv"; +// CHECK:STDOUT: fn @Div.1(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.udiv"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Sub(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.usub"; +// CHECK:STDOUT: fn @Sub.1(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.usub"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Negate(%a.param_patt: %i32) -> %i32 = "int.unegate"; +// CHECK:STDOUT: fn @Negate.1(%a.param_patt: %i32) -> %i32 = "int.unegate"; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Div.ref.loc9: %Div.type = name_ref Div, file.%Div.decl [template = constants.%Div] -// CHECK:STDOUT: %Negate.ref.loc9_18: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] +// CHECK:STDOUT: %Div.ref.loc9: %Div.type.1 = name_ref Div, file.%Div.decl [template = constants.%Div] +// CHECK:STDOUT: %Negate.ref.loc9_18: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %int_2147483647.loc9: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] -// CHECK:STDOUT: %impl.elem0.loc9_25: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc9_25: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc9_25: = bound_method %int_2147483647.loc9, %impl.elem0.loc9_25 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc9_25: = specific_function %Convert.bound.loc9_25, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc9_25: init %i32 = call %Convert.specific_fn.loc9_25(%int_2147483647.loc9) [template = constants.%int_2147483647.2] // CHECK:STDOUT: %.loc9_25.1: %i32 = value_of_initializer %int.convert_checked.loc9_25 [template = constants.%int_2147483647.2] // CHECK:STDOUT: %.loc9_25.2: %i32 = converted %int_2147483647.loc9, %.loc9_25.1 [template = constants.%int_2147483647.2] // CHECK:STDOUT: %int.unegate.loc9_36: init %i32 = call %Negate.ref.loc9_18(%.loc9_25.2) [template = constants.%int_-2147483647] -// CHECK:STDOUT: %Negate.ref.loc9_39: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] +// CHECK:STDOUT: %Negate.ref.loc9_39: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %int_1.loc9: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc9_46: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc9_46: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc9_46: = bound_method %int_1.loc9, %impl.elem0.loc9_46 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc9_46: = specific_function %Convert.bound.loc9_46, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc9_46: init %i32 = call %Convert.specific_fn.loc9_46(%int_1.loc9) [template = constants.%int_1.2] @@ -394,11 +352,11 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: %.loc9_49.1: %i32 = value_of_initializer %int.udiv.loc9 [template = constants.%int_0] // CHECK:STDOUT: %.loc9_49.2: %i32 = converted %int.udiv.loc9, %.loc9_49.1 [template = constants.%int_0] // CHECK:STDOUT: %a: %i32 = bind_name a, %.loc9_49.2 -// CHECK:STDOUT: %Div.ref.loc12: %Div.type = name_ref Div, file.%Div.decl [template = constants.%Div] -// CHECK:STDOUT: %Sub.ref.loc12: %Sub.type = name_ref Sub, file.%Sub.decl [template = constants.%Sub] -// CHECK:STDOUT: %Negate.ref.loc12: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] +// CHECK:STDOUT: %Div.ref.loc12: %Div.type.1 = name_ref Div, file.%Div.decl [template = constants.%Div] +// CHECK:STDOUT: %Sub.ref.loc12: %Sub.type.1 = name_ref Sub, file.%Sub.decl [template = constants.%Sub] +// CHECK:STDOUT: %Negate.ref.loc12: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %int_2147483647.loc12: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] -// CHECK:STDOUT: %impl.elem0.loc12_29: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc12_29: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc12_29: = bound_method %int_2147483647.loc12, %impl.elem0.loc12_29 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc12_29: = specific_function %Convert.bound.loc12_29, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc12_29: init %i32 = call %Convert.specific_fn.loc12_29(%int_2147483647.loc12) [template = constants.%int_2147483647.2] @@ -408,7 +366,7 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: %int_1.loc12_43: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %.loc12_40.1: %i32 = value_of_initializer %int.unegate.loc12 [template = constants.%int_-2147483647] // CHECK:STDOUT: %.loc12_40.2: %i32 = converted %int.unegate.loc12, %.loc12_40.1 [template = constants.%int_-2147483647] -// CHECK:STDOUT: %impl.elem0.loc12_43: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc12_43: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc12_43: = bound_method %int_1.loc12_43, %impl.elem0.loc12_43 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc12_43: = specific_function %Convert.bound.loc12_43, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc12_43: init %i32 = call %Convert.specific_fn.loc12_43(%int_1.loc12_43) [template = constants.%int_1.2] @@ -418,7 +376,7 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: %int_1.loc12_47: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %.loc12_44.1: %i32 = value_of_initializer %int.usub.loc12 [template = constants.%int_-2147483648] // CHECK:STDOUT: %.loc12_44.2: %i32 = converted %int.usub.loc12, %.loc12_44.1 [template = constants.%int_-2147483648] -// CHECK:STDOUT: %impl.elem0.loc12_47: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc12_47: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc12_47: = bound_method %int_1.loc12_47, %impl.elem0.loc12_47 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc12_47: = specific_function %Convert.bound.loc12_47, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc12_47: init %i32 = call %Convert.specific_fn.loc12_47(%int_1.loc12_47) [template = constants.%int_1.2] @@ -428,11 +386,11 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: %.loc12_49.1: %i32 = value_of_initializer %int.udiv.loc12 [template = constants.%int_-2147483648] // CHECK:STDOUT: %.loc12_49.2: %i32 = converted %int.udiv.loc12, %.loc12_49.1 [template = constants.%int_-2147483648] // CHECK:STDOUT: %b: %i32 = bind_name b, %.loc12_49.2 -// CHECK:STDOUT: %Div.ref.loc15: %Div.type = name_ref Div, file.%Div.decl [template = constants.%Div] -// CHECK:STDOUT: %Sub.ref.loc15: %Sub.type = name_ref Sub, file.%Sub.decl [template = constants.%Sub] -// CHECK:STDOUT: %Negate.ref.loc15_22: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] +// CHECK:STDOUT: %Div.ref.loc15: %Div.type.1 = name_ref Div, file.%Div.decl [template = constants.%Div] +// CHECK:STDOUT: %Sub.ref.loc15: %Sub.type.1 = name_ref Sub, file.%Sub.decl [template = constants.%Sub] +// CHECK:STDOUT: %Negate.ref.loc15_22: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %int_2147483647.loc15: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] -// CHECK:STDOUT: %impl.elem0.loc15_29: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc15_29: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc15_29: = bound_method %int_2147483647.loc15, %impl.elem0.loc15_29 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc15_29: = specific_function %Convert.bound.loc15_29, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc15_29: init %i32 = call %Convert.specific_fn.loc15_29(%int_2147483647.loc15) [template = constants.%int_2147483647.2] @@ -442,16 +400,16 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: %int_1.loc15_43: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %.loc15_40.1: %i32 = value_of_initializer %int.unegate.loc15_40 [template = constants.%int_-2147483647] // CHECK:STDOUT: %.loc15_40.2: %i32 = converted %int.unegate.loc15_40, %.loc15_40.1 [template = constants.%int_-2147483647] -// CHECK:STDOUT: %impl.elem0.loc15_43: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc15_43: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc15_43: = bound_method %int_1.loc15_43, %impl.elem0.loc15_43 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc15_43: = specific_function %Convert.bound.loc15_43, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc15_43: init %i32 = call %Convert.specific_fn.loc15_43(%int_1.loc15_43) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc15_43.1: %i32 = value_of_initializer %int.convert_checked.loc15_43 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc15_43.2: %i32 = converted %int_1.loc15_43, %.loc15_43.1 [template = constants.%int_1.2] // CHECK:STDOUT: %int.usub.loc15: init %i32 = call %Sub.ref.loc15(%.loc15_40.2, %.loc15_43.2) [template = constants.%int_-2147483648] -// CHECK:STDOUT: %Negate.ref.loc15_47: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] +// CHECK:STDOUT: %Negate.ref.loc15_47: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %int_1.loc15_54: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc15_54: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc15_54: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc15_54: = bound_method %int_1.loc15_54, %impl.elem0.loc15_54 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc15_54: = specific_function %Convert.bound.loc15_54, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc15_54: init %i32 = call %Convert.specific_fn.loc15_54(%int_1.loc15_54) [template = constants.%int_1.2] @@ -473,21 +431,19 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] -// CHECK:STDOUT: %Div.type: type = fn_type @Div [template] -// CHECK:STDOUT: %Div: %Div.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] +// CHECK:STDOUT: %Div.type.1: type = fn_type @Div.1 [template] +// CHECK:STDOUT: %Div: %Div.type.1 = struct_value () [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_0.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] // CHECK:STDOUT: } @@ -495,7 +451,7 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -509,7 +465,7 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: .b = @__global_init.%b // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Div.decl: %Div.type = fn_decl @Div [template = constants.%Div] { +// CHECK:STDOUT: %Div.decl: %Div.type.1 = fn_decl @Div.1 [template = constants.%Div] { // CHECK:STDOUT: %a.patt: %i32 = binding_pattern a // CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: %i32 = binding_pattern b @@ -518,17 +474,11 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc4_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc4_11: init type = call constants.%Int(%int_32.loc4_11) [template = constants.%i32] -// CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_signed.loc4_11 [template = constants.%i32] -// CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_signed.loc4_11, %.loc4_11.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc4_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc4_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc4_19: init type = call constants.%Int(%int_32.loc4_19) [template = constants.%i32] -// CHECK:STDOUT: %.loc4_19.1: type = value_of_initializer %int.make_type_signed.loc4_19 [template = constants.%i32] -// CHECK:STDOUT: %.loc4_19.2: type = converted %int.make_type_signed.loc4_19, %.loc4_19.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc4_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc4_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc4_27: init type = call constants.%Int(%int_32.loc4_27) [template = constants.%i32] -// CHECK:STDOUT: %.loc4_27.1: type = value_of_initializer %int.make_type_signed.loc4_27 [template = constants.%i32] -// CHECK:STDOUT: %.loc4_27.2: type = converted %int.make_type_signed.loc4_27, %.loc4_27.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc4_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 @@ -537,29 +487,25 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %int_32.loc10: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc10: init type = call constants.%Int(%int_32.loc10) [template = constants.%i32] -// CHECK:STDOUT: %.loc10_8.1: type = value_of_initializer %int.make_type_signed.loc10 [template = constants.%i32] -// CHECK:STDOUT: %.loc10_8.2: type = converted %int.make_type_signed.loc10, %.loc10_8.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc10: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc15: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc15: init type = call constants.%Int(%int_32.loc15) [template = constants.%i32] -// CHECK:STDOUT: %.loc15_8.1: type = value_of_initializer %int.make_type_signed.loc15 [template = constants.%i32] -// CHECK:STDOUT: %.loc15_8.2: type = converted %int.make_type_signed.loc15, %.loc15_8.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc15: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Div(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.udiv"; +// CHECK:STDOUT: fn @Div.1(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.udiv"; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Div.ref.loc10: %Div.type = name_ref Div, file.%Div.decl [template = constants.%Div] +// CHECK:STDOUT: %Div.ref.loc10: %Div.type.1 = name_ref Div, file.%Div.decl [template = constants.%Div] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_0.loc10: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0.loc10_18: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc10_18: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc10_18: = bound_method %int_1, %impl.elem0.loc10_18 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc10_18: = specific_function %Convert.bound.loc10_18, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc10_18: init %i32 = call %Convert.specific_fn.loc10_18(%int_1) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc10_18.1: %i32 = value_of_initializer %int.convert_checked.loc10_18 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc10_18.2: %i32 = converted %int_1, %.loc10_18.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc10_21: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc10_21: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc10_21: = bound_method %int_0.loc10, %impl.elem0.loc10_21 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc10_21: = specific_function %Convert.bound.loc10_21, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc10_21: init %i32 = call %Convert.specific_fn.loc10_21(%int_0.loc10) [template = constants.%int_0.2] @@ -569,16 +515,16 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: %.loc10_23.1: %i32 = value_of_initializer %int.udiv.loc10 [template = ] // CHECK:STDOUT: %.loc10_23.2: %i32 = converted %int.udiv.loc10, %.loc10_23.1 [template = ] // CHECK:STDOUT: %a: %i32 = bind_name a, %.loc10_23.2 -// CHECK:STDOUT: %Div.ref.loc15: %Div.type = name_ref Div, file.%Div.decl [template = constants.%Div] +// CHECK:STDOUT: %Div.ref.loc15: %Div.type.1 = name_ref Div, file.%Div.decl [template = constants.%Div] // CHECK:STDOUT: %int_0.loc15_18: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %int_0.loc15_21: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0.loc15_18: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc15_18: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc15_18: = bound_method %int_0.loc15_18, %impl.elem0.loc15_18 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc15_18: = specific_function %Convert.bound.loc15_18, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc15_18: init %i32 = call %Convert.specific_fn.loc15_18(%int_0.loc15_18) [template = constants.%int_0.2] // CHECK:STDOUT: %.loc15_18.1: %i32 = value_of_initializer %int.convert_checked.loc15_18 [template = constants.%int_0.2] // CHECK:STDOUT: %.loc15_18.2: %i32 = converted %int_0.loc15_18, %.loc15_18.1 [template = constants.%int_0.2] -// CHECK:STDOUT: %impl.elem0.loc15_21: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc15_21: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc15_21: = bound_method %int_0.loc15_21, %impl.elem0.loc15_21 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc15_21: = specific_function %Convert.bound.loc15_21, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc15_21: init %i32 = call %Convert.specific_fn.loc15_21(%int_0.loc15_21) [template = constants.%int_0.2] diff --git a/toolchain/check/testdata/builtins/int/umod.carbon b/toolchain/check/testdata/builtins/int/umod.carbon index 895dfe6e16d71..4cac02d36ec57 100644 --- a/toolchain/check/testdata/builtins/int/umod.carbon +++ b/toolchain/check/testdata/builtins/int/umod.carbon @@ -59,30 +59,28 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] -// CHECK:STDOUT: %Mod.type: type = fn_type @Mod [template] -// CHECK:STDOUT: %Mod: %Mod.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] +// CHECK:STDOUT: %Mod.type.1: type = fn_type @Mod.1 [template] +// CHECK:STDOUT: %Mod: %Mod.type.1 = struct_value () [template] // CHECK:STDOUT: %int_5.1: Core.IntLiteral = int_value 5 [template] // CHECK:STDOUT: %int_3.1: Core.IntLiteral = int_value 3 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_5.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_5.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_5.2: %i32 = int_value 5 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_3.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_3.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_3.2: %i32 = int_value 3 [template] // CHECK:STDOUT: %int_2.1: %i32 = int_value 2 [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.4, @impl.3(%int_32) [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %interface.10: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_2.1, %Convert.15 [template] -// CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.4(%int_32) [template] +// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.3, @impl.2(%int_32) [template] +// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [template] +// CHECK:STDOUT: %interface.6: = interface_witness (%Convert.11) [template] +// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_2.1, %Convert.11 [template] +// CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.3(%int_32) [template] // CHECK:STDOUT: %int_2.2: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %array_type: type = array_type %int_2.2, %i32 [template] // CHECK:STDOUT: %ptr: type = ptr_type %array_type [template] @@ -93,7 +91,7 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -108,7 +106,7 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Mod.decl: %Mod.type = fn_decl @Mod [template = constants.%Mod] { +// CHECK:STDOUT: %Mod.decl: %Mod.type.1 = fn_decl @Mod.1 [template = constants.%Mod] { // CHECK:STDOUT: %a.patt: %i32 = binding_pattern a // CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: %i32 = binding_pattern b @@ -117,17 +115,11 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc2_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc2_11: init type = call constants.%Int(%int_32.loc2_11) [template = constants.%i32] -// CHECK:STDOUT: %.loc2_11.1: type = value_of_initializer %int.make_type_signed.loc2_11 [template = constants.%i32] -// CHECK:STDOUT: %.loc2_11.2: type = converted %int.make_type_signed.loc2_11, %.loc2_11.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc2_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc2_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc2_19: init type = call constants.%Int(%int_32.loc2_19) [template = constants.%i32] -// CHECK:STDOUT: %.loc2_19.1: type = value_of_initializer %int.make_type_signed.loc2_19 [template = constants.%i32] -// CHECK:STDOUT: %.loc2_19.2: type = converted %int.make_type_signed.loc2_19, %.loc2_19.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc2_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc2_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc2_27: init type = call constants.%Int(%int_32.loc2_27) [template = constants.%i32] -// CHECK:STDOUT: %.loc2_27.1: type = value_of_initializer %int.make_type_signed.loc2_27 [template = constants.%i32] -// CHECK:STDOUT: %.loc2_27.2: type = converted %int.make_type_signed.loc2_27, %.loc2_27.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc2_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 @@ -136,28 +128,26 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %int_32.loc4: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc4: init type = call constants.%Int(%int_32.loc4) [template = constants.%i32] -// CHECK:STDOUT: %Mod.ref: %Mod.type = name_ref Mod, %Mod.decl [template = constants.%Mod] +// CHECK:STDOUT: %i32.loc4: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %Mod.ref: %Mod.type.1 = name_ref Mod, %Mod.decl [template = constants.%Mod] // CHECK:STDOUT: %int_5: Core.IntLiteral = int_value 5 [template = constants.%int_5.1] // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] -// CHECK:STDOUT: %impl.elem0.loc4_20: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc4_20: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc4_20: = bound_method %int_5, %impl.elem0.loc4_20 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc4_20: = specific_function %Convert.bound.loc4_20, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc4_20: init %i32 = call %Convert.specific_fn.loc4_20(%int_5) [template = constants.%int_5.2] // CHECK:STDOUT: %.loc4_20.1: %i32 = value_of_initializer %int.convert_checked.loc4_20 [template = constants.%int_5.2] // CHECK:STDOUT: %.loc4_20.2: %i32 = converted %int_5, %.loc4_20.1 [template = constants.%int_5.2] -// CHECK:STDOUT: %impl.elem0.loc4_23: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc4_23: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc4_23: = bound_method %int_3, %impl.elem0.loc4_23 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc4_23: = specific_function %Convert.bound.loc4_23, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc4_23: init %i32 = call %Convert.specific_fn.loc4_23(%int_3) [template = constants.%int_3.2] // CHECK:STDOUT: %.loc4_23.1: %i32 = value_of_initializer %int.convert_checked.loc4_23 [template = constants.%int_3.2] // CHECK:STDOUT: %.loc4_23.2: %i32 = converted %int_3, %.loc4_23.1 [template = constants.%int_3.2] // CHECK:STDOUT: %int.umod: init %i32 = call %Mod.ref(%.loc4_20.2, %.loc4_23.2) [template = constants.%int_2.1] -// CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_signed.loc4 [template = constants.%i32] -// CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_signed.loc4, %.loc4_11.1 [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc4_24: %Convert.type.6 = interface_witness_access constants.%interface.10, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %impl.elem0.loc4_24: %Convert.type.5 = interface_witness_access constants.%interface.6, element0 [template = constants.%Convert.11] // CHECK:STDOUT: %Convert.bound.loc4_24: = bound_method %int.umod, %impl.elem0.loc4_24 [template = constants.%Convert.bound.3] -// CHECK:STDOUT: %Convert.specific_fn.loc4_24: = specific_function %Convert.bound.loc4_24, @Convert.4(constants.%int_32) [template = constants.%Convert.specific_fn.3] +// CHECK:STDOUT: %Convert.specific_fn.loc4_24: = specific_function %Convert.bound.loc4_24, @Convert.3(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %.loc4_24.1: %i32 = value_of_initializer %int.umod [template = constants.%int_2.1] // CHECK:STDOUT: %.loc4_24.2: %i32 = converted %int.umod, %.loc4_24.1 [template = constants.%int_2.1] // CHECK:STDOUT: %int.convert_checked.loc4_24: init Core.IntLiteral = call %Convert.specific_fn.loc4_24(%.loc4_24.2) [template = constants.%int_2.2] @@ -167,10 +157,8 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: %arr.var: ref %array_type = var arr // CHECK:STDOUT: %arr: ref %array_type = bind_name arr, %arr.var // CHECK:STDOUT: %int_32.loc5: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc5: init type = call constants.%Int(%int_32.loc5) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc5: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.2] -// CHECK:STDOUT: %.loc5_13.1: type = value_of_initializer %int.make_type_signed.loc5 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_13.2: type = converted %int.make_type_signed.loc5, %.loc5_13.1 [template = constants.%i32] // CHECK:STDOUT: %array_type.loc5: type = array_type %int_2, %i32 [template = constants.%array_type] // CHECK:STDOUT: %ptr: type = ptr_type %array_type [template = constants.%ptr] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { @@ -182,17 +170,11 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc7_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc7_19: init type = call constants.%Int(%int_32.loc7_19) [template = constants.%i32] -// CHECK:STDOUT: %.loc7_19.1: type = value_of_initializer %int.make_type_signed.loc7_19 [template = constants.%i32] -// CHECK:STDOUT: %.loc7_19.2: type = converted %int.make_type_signed.loc7_19, %.loc7_19.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc7_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc7_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc7_27: init type = call constants.%Int(%int_32.loc7_27) [template = constants.%i32] -// CHECK:STDOUT: %.loc7_27.1: type = value_of_initializer %int.make_type_signed.loc7_27 [template = constants.%i32] -// CHECK:STDOUT: %.loc7_27.2: type = converted %int.make_type_signed.loc7_27, %.loc7_27.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc7_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc7_35: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc7_35: init type = call constants.%Int(%int_32.loc7_35) [template = constants.%i32] -// CHECK:STDOUT: %.loc7_35.1: type = value_of_initializer %int.make_type_signed.loc7_35 [template = constants.%i32] -// CHECK:STDOUT: %.loc7_35.2: type = converted %int.make_type_signed.loc7_35, %.loc7_35.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc7_35: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 @@ -202,11 +184,11 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Mod(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.umod"; +// CHECK:STDOUT: fn @Mod.1(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.umod"; // CHECK:STDOUT: // CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Mod.ref: %Mod.type = name_ref Mod, file.%Mod.decl [template = constants.%Mod] +// CHECK:STDOUT: %Mod.ref: %Mod.type.1 = name_ref Mod, file.%Mod.decl [template = constants.%Mod] // CHECK:STDOUT: %a.ref: %i32 = name_ref a, %a // CHECK:STDOUT: %b.ref: %i32 = name_ref b, %b // CHECK:STDOUT: %int.umod: init %i32 = call %Mod.ref(%a.ref, %b.ref) @@ -227,26 +209,24 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] -// CHECK:STDOUT: %Mod.type: type = fn_type @Mod [template] -// CHECK:STDOUT: %Mod: %Mod.type = struct_value () [template] -// CHECK:STDOUT: %Sub.type: type = fn_type @Sub [template] -// CHECK:STDOUT: %Sub: %Sub.type = struct_value () [template] -// CHECK:STDOUT: %Negate.type: type = fn_type @Negate [template] -// CHECK:STDOUT: %Negate: %Negate.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] +// CHECK:STDOUT: %Mod.type.1: type = fn_type @Mod.1 [template] +// CHECK:STDOUT: %Mod: %Mod.type.1 = struct_value () [template] +// CHECK:STDOUT: %Sub.type.1: type = fn_type @Sub.1 [template] +// CHECK:STDOUT: %Sub: %Sub.type.1 = struct_value () [template] +// CHECK:STDOUT: %Negate.type.1: type = fn_type @Negate.1 [template] +// CHECK:STDOUT: %Negate: %Negate.type.1 = struct_value () [template] // CHECK:STDOUT: %int_2147483647.1: Core.IntLiteral = int_value 2147483647 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_2147483647.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_2147483647.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2147483647.2: %i32 = int_value 2147483647 [template] // CHECK:STDOUT: %int_-2147483647: %i32 = int_value -2147483647 [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] // CHECK:STDOUT: %int_-1: %i32 = int_value -1 [template] @@ -257,7 +237,7 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -274,7 +254,7 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: .c = @__global_init.%c // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Mod.decl: %Mod.type = fn_decl @Mod [template = constants.%Mod] { +// CHECK:STDOUT: %Mod.decl: %Mod.type.1 = fn_decl @Mod.1 [template = constants.%Mod] { // CHECK:STDOUT: %a.patt: %i32 = binding_pattern a // CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: %i32 = binding_pattern b @@ -283,17 +263,11 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc4_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc4_11: init type = call constants.%Int(%int_32.loc4_11) [template = constants.%i32] -// CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_signed.loc4_11 [template = constants.%i32] -// CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_signed.loc4_11, %.loc4_11.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc4_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc4_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc4_19: init type = call constants.%Int(%int_32.loc4_19) [template = constants.%i32] -// CHECK:STDOUT: %.loc4_19.1: type = value_of_initializer %int.make_type_signed.loc4_19 [template = constants.%i32] -// CHECK:STDOUT: %.loc4_19.2: type = converted %int.make_type_signed.loc4_19, %.loc4_19.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc4_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc4_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc4_27: init type = call constants.%Int(%int_32.loc4_27) [template = constants.%i32] -// CHECK:STDOUT: %.loc4_27.1: type = value_of_initializer %int.make_type_signed.loc4_27 [template = constants.%i32] -// CHECK:STDOUT: %.loc4_27.2: type = converted %int.make_type_signed.loc4_27, %.loc4_27.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc4_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 @@ -301,7 +275,7 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %Sub.decl: %Sub.type = fn_decl @Sub [template = constants.%Sub] { +// CHECK:STDOUT: %Sub.decl: %Sub.type.1 = fn_decl @Sub.1 [template = constants.%Sub] { // CHECK:STDOUT: %a.patt: %i32 = binding_pattern a // CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: %i32 = binding_pattern b @@ -310,17 +284,11 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc5_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc5_11: init type = call constants.%Int(%int_32.loc5_11) [template = constants.%i32] -// CHECK:STDOUT: %.loc5_11.1: type = value_of_initializer %int.make_type_signed.loc5_11 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_11.2: type = converted %int.make_type_signed.loc5_11, %.loc5_11.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc5_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc5_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc5_19: init type = call constants.%Int(%int_32.loc5_19) [template = constants.%i32] -// CHECK:STDOUT: %.loc5_19.1: type = value_of_initializer %int.make_type_signed.loc5_19 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_19.2: type = converted %int.make_type_signed.loc5_19, %.loc5_19.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc5_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc5_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc5_27: init type = call constants.%Int(%int_32.loc5_27) [template = constants.%i32] -// CHECK:STDOUT: %.loc5_27.1: type = value_of_initializer %int.make_type_signed.loc5_27 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_27.2: type = converted %int.make_type_signed.loc5_27, %.loc5_27.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc5_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 @@ -328,60 +296,50 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %Negate.decl: %Negate.type = fn_decl @Negate [template = constants.%Negate] { +// CHECK:STDOUT: %Negate.decl: %Negate.type.1 = fn_decl @Negate.1 [template = constants.%Negate] { // CHECK:STDOUT: %a.patt: %i32 = binding_pattern a // CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc6_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc6_14: init type = call constants.%Int(%int_32.loc6_14) [template = constants.%i32] -// CHECK:STDOUT: %.loc6_14.1: type = value_of_initializer %int.make_type_signed.loc6_14 [template = constants.%i32] -// CHECK:STDOUT: %.loc6_14.2: type = converted %int.make_type_signed.loc6_14, %.loc6_14.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc6_14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc6_22: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc6_22: init type = call constants.%Int(%int_32.loc6_22) [template = constants.%i32] -// CHECK:STDOUT: %.loc6_22.1: type = value_of_initializer %int.make_type_signed.loc6_22 [template = constants.%i32] -// CHECK:STDOUT: %.loc6_22.2: type = converted %int.make_type_signed.loc6_22, %.loc6_22.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc6_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %int_32.loc9: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc9: init type = call constants.%Int(%int_32.loc9) [template = constants.%i32] -// CHECK:STDOUT: %.loc9_8.1: type = value_of_initializer %int.make_type_signed.loc9 [template = constants.%i32] -// CHECK:STDOUT: %.loc9_8.2: type = converted %int.make_type_signed.loc9, %.loc9_8.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc9: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc12: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc12: init type = call constants.%Int(%int_32.loc12) [template = constants.%i32] -// CHECK:STDOUT: %.loc12_8.1: type = value_of_initializer %int.make_type_signed.loc12 [template = constants.%i32] -// CHECK:STDOUT: %.loc12_8.2: type = converted %int.make_type_signed.loc12, %.loc12_8.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc12: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc15: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc15: init type = call constants.%Int(%int_32.loc15) [template = constants.%i32] -// CHECK:STDOUT: %.loc15_8.1: type = value_of_initializer %int.make_type_signed.loc15 [template = constants.%i32] -// CHECK:STDOUT: %.loc15_8.2: type = converted %int.make_type_signed.loc15, %.loc15_8.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc15: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Mod(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.umod"; +// CHECK:STDOUT: fn @Mod.1(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.umod"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Sub(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.usub"; +// CHECK:STDOUT: fn @Sub.1(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.usub"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Negate(%a.param_patt: %i32) -> %i32 = "int.unegate"; +// CHECK:STDOUT: fn @Negate.1(%a.param_patt: %i32) -> %i32 = "int.unegate"; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Mod.ref.loc9: %Mod.type = name_ref Mod, file.%Mod.decl [template = constants.%Mod] -// CHECK:STDOUT: %Negate.ref.loc9_18: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] +// CHECK:STDOUT: %Mod.ref.loc9: %Mod.type.1 = name_ref Mod, file.%Mod.decl [template = constants.%Mod] +// CHECK:STDOUT: %Negate.ref.loc9_18: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %int_2147483647.loc9: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] -// CHECK:STDOUT: %impl.elem0.loc9_25: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc9_25: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc9_25: = bound_method %int_2147483647.loc9, %impl.elem0.loc9_25 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc9_25: = specific_function %Convert.bound.loc9_25, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc9_25: init %i32 = call %Convert.specific_fn.loc9_25(%int_2147483647.loc9) [template = constants.%int_2147483647.2] // CHECK:STDOUT: %.loc9_25.1: %i32 = value_of_initializer %int.convert_checked.loc9_25 [template = constants.%int_2147483647.2] // CHECK:STDOUT: %.loc9_25.2: %i32 = converted %int_2147483647.loc9, %.loc9_25.1 [template = constants.%int_2147483647.2] // CHECK:STDOUT: %int.unegate.loc9_36: init %i32 = call %Negate.ref.loc9_18(%.loc9_25.2) [template = constants.%int_-2147483647] -// CHECK:STDOUT: %Negate.ref.loc9_39: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] +// CHECK:STDOUT: %Negate.ref.loc9_39: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %int_1.loc9: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc9_46: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc9_46: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc9_46: = bound_method %int_1.loc9, %impl.elem0.loc9_46 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc9_46: = specific_function %Convert.bound.loc9_46, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc9_46: init %i32 = call %Convert.specific_fn.loc9_46(%int_1.loc9) [template = constants.%int_1.2] @@ -396,11 +354,11 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: %.loc9_49.1: %i32 = value_of_initializer %int.umod.loc9 [template = constants.%int_-2147483647] // CHECK:STDOUT: %.loc9_49.2: %i32 = converted %int.umod.loc9, %.loc9_49.1 [template = constants.%int_-2147483647] // CHECK:STDOUT: %a: %i32 = bind_name a, %.loc9_49.2 -// CHECK:STDOUT: %Mod.ref.loc12: %Mod.type = name_ref Mod, file.%Mod.decl [template = constants.%Mod] -// CHECK:STDOUT: %Sub.ref.loc12: %Sub.type = name_ref Sub, file.%Sub.decl [template = constants.%Sub] -// CHECK:STDOUT: %Negate.ref.loc12: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] +// CHECK:STDOUT: %Mod.ref.loc12: %Mod.type.1 = name_ref Mod, file.%Mod.decl [template = constants.%Mod] +// CHECK:STDOUT: %Sub.ref.loc12: %Sub.type.1 = name_ref Sub, file.%Sub.decl [template = constants.%Sub] +// CHECK:STDOUT: %Negate.ref.loc12: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %int_2147483647.loc12: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] -// CHECK:STDOUT: %impl.elem0.loc12_29: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc12_29: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc12_29: = bound_method %int_2147483647.loc12, %impl.elem0.loc12_29 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc12_29: = specific_function %Convert.bound.loc12_29, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc12_29: init %i32 = call %Convert.specific_fn.loc12_29(%int_2147483647.loc12) [template = constants.%int_2147483647.2] @@ -410,7 +368,7 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: %int_1.loc12_43: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %.loc12_40.1: %i32 = value_of_initializer %int.unegate.loc12 [template = constants.%int_-2147483647] // CHECK:STDOUT: %.loc12_40.2: %i32 = converted %int.unegate.loc12, %.loc12_40.1 [template = constants.%int_-2147483647] -// CHECK:STDOUT: %impl.elem0.loc12_43: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc12_43: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc12_43: = bound_method %int_1.loc12_43, %impl.elem0.loc12_43 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc12_43: = specific_function %Convert.bound.loc12_43, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc12_43: init %i32 = call %Convert.specific_fn.loc12_43(%int_1.loc12_43) [template = constants.%int_1.2] @@ -420,7 +378,7 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: %int_1.loc12_47: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %.loc12_44.1: %i32 = value_of_initializer %int.usub.loc12 [template = constants.%int_-2147483648] // CHECK:STDOUT: %.loc12_44.2: %i32 = converted %int.usub.loc12, %.loc12_44.1 [template = constants.%int_-2147483648] -// CHECK:STDOUT: %impl.elem0.loc12_47: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc12_47: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc12_47: = bound_method %int_1.loc12_47, %impl.elem0.loc12_47 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc12_47: = specific_function %Convert.bound.loc12_47, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc12_47: init %i32 = call %Convert.specific_fn.loc12_47(%int_1.loc12_47) [template = constants.%int_1.2] @@ -430,11 +388,11 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: %.loc12_49.1: %i32 = value_of_initializer %int.umod.loc12 [template = constants.%int_0] // CHECK:STDOUT: %.loc12_49.2: %i32 = converted %int.umod.loc12, %.loc12_49.1 [template = constants.%int_0] // CHECK:STDOUT: %b: %i32 = bind_name b, %.loc12_49.2 -// CHECK:STDOUT: %Mod.ref.loc15: %Mod.type = name_ref Mod, file.%Mod.decl [template = constants.%Mod] -// CHECK:STDOUT: %Sub.ref.loc15: %Sub.type = name_ref Sub, file.%Sub.decl [template = constants.%Sub] -// CHECK:STDOUT: %Negate.ref.loc15_22: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] +// CHECK:STDOUT: %Mod.ref.loc15: %Mod.type.1 = name_ref Mod, file.%Mod.decl [template = constants.%Mod] +// CHECK:STDOUT: %Sub.ref.loc15: %Sub.type.1 = name_ref Sub, file.%Sub.decl [template = constants.%Sub] +// CHECK:STDOUT: %Negate.ref.loc15_22: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %int_2147483647.loc15: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] -// CHECK:STDOUT: %impl.elem0.loc15_29: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc15_29: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc15_29: = bound_method %int_2147483647.loc15, %impl.elem0.loc15_29 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc15_29: = specific_function %Convert.bound.loc15_29, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc15_29: init %i32 = call %Convert.specific_fn.loc15_29(%int_2147483647.loc15) [template = constants.%int_2147483647.2] @@ -444,16 +402,16 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: %int_1.loc15_43: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %.loc15_40.1: %i32 = value_of_initializer %int.unegate.loc15_40 [template = constants.%int_-2147483647] // CHECK:STDOUT: %.loc15_40.2: %i32 = converted %int.unegate.loc15_40, %.loc15_40.1 [template = constants.%int_-2147483647] -// CHECK:STDOUT: %impl.elem0.loc15_43: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc15_43: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc15_43: = bound_method %int_1.loc15_43, %impl.elem0.loc15_43 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc15_43: = specific_function %Convert.bound.loc15_43, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc15_43: init %i32 = call %Convert.specific_fn.loc15_43(%int_1.loc15_43) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc15_43.1: %i32 = value_of_initializer %int.convert_checked.loc15_43 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc15_43.2: %i32 = converted %int_1.loc15_43, %.loc15_43.1 [template = constants.%int_1.2] // CHECK:STDOUT: %int.usub.loc15: init %i32 = call %Sub.ref.loc15(%.loc15_40.2, %.loc15_43.2) [template = constants.%int_-2147483648] -// CHECK:STDOUT: %Negate.ref.loc15_47: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] +// CHECK:STDOUT: %Negate.ref.loc15_47: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %int_1.loc15_54: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc15_54: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc15_54: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc15_54: = bound_method %int_1.loc15_54, %impl.elem0.loc15_54 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc15_54: = specific_function %Convert.bound.loc15_54, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc15_54: init %i32 = call %Convert.specific_fn.loc15_54(%int_1.loc15_54) [template = constants.%int_1.2] @@ -475,21 +433,19 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] -// CHECK:STDOUT: %Mod.type: type = fn_type @Mod [template] -// CHECK:STDOUT: %Mod: %Mod.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] +// CHECK:STDOUT: %Mod.type.1: type = fn_type @Mod.1 [template] +// CHECK:STDOUT: %Mod: %Mod.type.1 = struct_value () [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_0.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] // CHECK:STDOUT: } @@ -497,7 +453,7 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -511,7 +467,7 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: .b = @__global_init.%b // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Mod.decl: %Mod.type = fn_decl @Mod [template = constants.%Mod] { +// CHECK:STDOUT: %Mod.decl: %Mod.type.1 = fn_decl @Mod.1 [template = constants.%Mod] { // CHECK:STDOUT: %a.patt: %i32 = binding_pattern a // CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: %i32 = binding_pattern b @@ -520,17 +476,11 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc4_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc4_11: init type = call constants.%Int(%int_32.loc4_11) [template = constants.%i32] -// CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_signed.loc4_11 [template = constants.%i32] -// CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_signed.loc4_11, %.loc4_11.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc4_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc4_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc4_19: init type = call constants.%Int(%int_32.loc4_19) [template = constants.%i32] -// CHECK:STDOUT: %.loc4_19.1: type = value_of_initializer %int.make_type_signed.loc4_19 [template = constants.%i32] -// CHECK:STDOUT: %.loc4_19.2: type = converted %int.make_type_signed.loc4_19, %.loc4_19.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc4_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc4_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc4_27: init type = call constants.%Int(%int_32.loc4_27) [template = constants.%i32] -// CHECK:STDOUT: %.loc4_27.1: type = value_of_initializer %int.make_type_signed.loc4_27 [template = constants.%i32] -// CHECK:STDOUT: %.loc4_27.2: type = converted %int.make_type_signed.loc4_27, %.loc4_27.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc4_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 @@ -539,29 +489,25 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %int_32.loc12: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc12: init type = call constants.%Int(%int_32.loc12) [template = constants.%i32] -// CHECK:STDOUT: %.loc12_8.1: type = value_of_initializer %int.make_type_signed.loc12 [template = constants.%i32] -// CHECK:STDOUT: %.loc12_8.2: type = converted %int.make_type_signed.loc12, %.loc12_8.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc12: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc17: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc17: init type = call constants.%Int(%int_32.loc17) [template = constants.%i32] -// CHECK:STDOUT: %.loc17_8.1: type = value_of_initializer %int.make_type_signed.loc17 [template = constants.%i32] -// CHECK:STDOUT: %.loc17_8.2: type = converted %int.make_type_signed.loc17, %.loc17_8.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Mod(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.umod"; +// CHECK:STDOUT: fn @Mod.1(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.umod"; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Mod.ref.loc12: %Mod.type = name_ref Mod, file.%Mod.decl [template = constants.%Mod] +// CHECK:STDOUT: %Mod.ref.loc12: %Mod.type.1 = name_ref Mod, file.%Mod.decl [template = constants.%Mod] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_0.loc12: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0.loc12_18: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc12_18: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc12_18: = bound_method %int_1, %impl.elem0.loc12_18 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc12_18: = specific_function %Convert.bound.loc12_18, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc12_18: init %i32 = call %Convert.specific_fn.loc12_18(%int_1) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc12_18.1: %i32 = value_of_initializer %int.convert_checked.loc12_18 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc12_18.2: %i32 = converted %int_1, %.loc12_18.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc12_21: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc12_21: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc12_21: = bound_method %int_0.loc12, %impl.elem0.loc12_21 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc12_21: = specific_function %Convert.bound.loc12_21, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc12_21: init %i32 = call %Convert.specific_fn.loc12_21(%int_0.loc12) [template = constants.%int_0.2] @@ -571,16 +517,16 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: %.loc12_23.1: %i32 = value_of_initializer %int.umod.loc12 [template = ] // CHECK:STDOUT: %.loc12_23.2: %i32 = converted %int.umod.loc12, %.loc12_23.1 [template = ] // CHECK:STDOUT: %a: %i32 = bind_name a, %.loc12_23.2 -// CHECK:STDOUT: %Mod.ref.loc17: %Mod.type = name_ref Mod, file.%Mod.decl [template = constants.%Mod] +// CHECK:STDOUT: %Mod.ref.loc17: %Mod.type.1 = name_ref Mod, file.%Mod.decl [template = constants.%Mod] // CHECK:STDOUT: %int_0.loc17_18: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %int_0.loc17_21: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0.loc17_18: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc17_18: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc17_18: = bound_method %int_0.loc17_18, %impl.elem0.loc17_18 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc17_18: = specific_function %Convert.bound.loc17_18, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc17_18: init %i32 = call %Convert.specific_fn.loc17_18(%int_0.loc17_18) [template = constants.%int_0.2] // CHECK:STDOUT: %.loc17_18.1: %i32 = value_of_initializer %int.convert_checked.loc17_18 [template = constants.%int_0.2] // CHECK:STDOUT: %.loc17_18.2: %i32 = converted %int_0.loc17_18, %.loc17_18.1 [template = constants.%int_0.2] -// CHECK:STDOUT: %impl.elem0.loc17_21: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc17_21: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc17_21: = bound_method %int_0.loc17_21, %impl.elem0.loc17_21 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc17_21: = specific_function %Convert.bound.loc17_21, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc17_21: init %i32 = call %Convert.specific_fn.loc17_21(%int_0.loc17_21) [template = constants.%int_0.2] diff --git a/toolchain/check/testdata/builtins/int/umul.carbon b/toolchain/check/testdata/builtins/int/umul.carbon index 55394d1ac5cbb..87eff36d2ee55 100644 --- a/toolchain/check/testdata/builtins/int/umul.carbon +++ b/toolchain/check/testdata/builtins/int/umul.carbon @@ -32,30 +32,28 @@ let b: i32 = Mul(0x8000, 0x10000); // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] -// CHECK:STDOUT: %Mul.type: type = fn_type @Mul [template] -// CHECK:STDOUT: %Mul: %Mul.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] +// CHECK:STDOUT: %Mul.type.1: type = fn_type @Mul.1 [template] +// CHECK:STDOUT: %Mul: %Mul.type.1 = struct_value () [template] // CHECK:STDOUT: %int_3.1: Core.IntLiteral = int_value 3 [template] // CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_3.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_3.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_3.2: %i32 = int_value 3 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] // CHECK:STDOUT: %int_6.1: %i32 = int_value 6 [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.4, @impl.3(%int_32) [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %interface.10: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_6.1, %Convert.15 [template] -// CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.4(%int_32) [template] +// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.3, @impl.2(%int_32) [template] +// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [template] +// CHECK:STDOUT: %interface.6: = interface_witness (%Convert.11) [template] +// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_6.1, %Convert.11 [template] +// CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.3(%int_32) [template] // CHECK:STDOUT: %int_6.2: Core.IntLiteral = int_value 6 [template] // CHECK:STDOUT: %array_type: type = array_type %int_6.2, %i32 [template] // CHECK:STDOUT: %ptr: type = ptr_type %array_type [template] @@ -66,7 +64,7 @@ let b: i32 = Mul(0x8000, 0x10000); // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -81,7 +79,7 @@ let b: i32 = Mul(0x8000, 0x10000); // CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Mul.decl: %Mul.type = fn_decl @Mul [template = constants.%Mul] { +// CHECK:STDOUT: %Mul.decl: %Mul.type.1 = fn_decl @Mul.1 [template = constants.%Mul] { // CHECK:STDOUT: %a.patt: %i32 = binding_pattern a // CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: %i32 = binding_pattern b @@ -90,17 +88,11 @@ let b: i32 = Mul(0x8000, 0x10000); // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc2_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc2_11: init type = call constants.%Int(%int_32.loc2_11) [template = constants.%i32] -// CHECK:STDOUT: %.loc2_11.1: type = value_of_initializer %int.make_type_signed.loc2_11 [template = constants.%i32] -// CHECK:STDOUT: %.loc2_11.2: type = converted %int.make_type_signed.loc2_11, %.loc2_11.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc2_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc2_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc2_19: init type = call constants.%Int(%int_32.loc2_19) [template = constants.%i32] -// CHECK:STDOUT: %.loc2_19.1: type = value_of_initializer %int.make_type_signed.loc2_19 [template = constants.%i32] -// CHECK:STDOUT: %.loc2_19.2: type = converted %int.make_type_signed.loc2_19, %.loc2_19.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc2_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc2_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc2_27: init type = call constants.%Int(%int_32.loc2_27) [template = constants.%i32] -// CHECK:STDOUT: %.loc2_27.1: type = value_of_initializer %int.make_type_signed.loc2_27 [template = constants.%i32] -// CHECK:STDOUT: %.loc2_27.2: type = converted %int.make_type_signed.loc2_27, %.loc2_27.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc2_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 @@ -109,28 +101,26 @@ let b: i32 = Mul(0x8000, 0x10000); // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %int_32.loc4: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc4: init type = call constants.%Int(%int_32.loc4) [template = constants.%i32] -// CHECK:STDOUT: %Mul.ref: %Mul.type = name_ref Mul, %Mul.decl [template = constants.%Mul] +// CHECK:STDOUT: %i32.loc4: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %Mul.ref: %Mul.type.1 = name_ref Mul, %Mul.decl [template = constants.%Mul] // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %impl.elem0.loc4_20: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc4_20: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc4_20: = bound_method %int_3, %impl.elem0.loc4_20 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc4_20: = specific_function %Convert.bound.loc4_20, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc4_20: init %i32 = call %Convert.specific_fn.loc4_20(%int_3) [template = constants.%int_3.2] // CHECK:STDOUT: %.loc4_20.1: %i32 = value_of_initializer %int.convert_checked.loc4_20 [template = constants.%int_3.2] // CHECK:STDOUT: %.loc4_20.2: %i32 = converted %int_3, %.loc4_20.1 [template = constants.%int_3.2] -// CHECK:STDOUT: %impl.elem0.loc4_23: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc4_23: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc4_23: = bound_method %int_2, %impl.elem0.loc4_23 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc4_23: = specific_function %Convert.bound.loc4_23, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc4_23: init %i32 = call %Convert.specific_fn.loc4_23(%int_2) [template = constants.%int_2.2] // CHECK:STDOUT: %.loc4_23.1: %i32 = value_of_initializer %int.convert_checked.loc4_23 [template = constants.%int_2.2] // CHECK:STDOUT: %.loc4_23.2: %i32 = converted %int_2, %.loc4_23.1 [template = constants.%int_2.2] // CHECK:STDOUT: %int.umul: init %i32 = call %Mul.ref(%.loc4_20.2, %.loc4_23.2) [template = constants.%int_6.1] -// CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_signed.loc4 [template = constants.%i32] -// CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_signed.loc4, %.loc4_11.1 [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc4_24: %Convert.type.6 = interface_witness_access constants.%interface.10, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %impl.elem0.loc4_24: %Convert.type.5 = interface_witness_access constants.%interface.6, element0 [template = constants.%Convert.11] // CHECK:STDOUT: %Convert.bound.loc4_24: = bound_method %int.umul, %impl.elem0.loc4_24 [template = constants.%Convert.bound.3] -// CHECK:STDOUT: %Convert.specific_fn.loc4_24: = specific_function %Convert.bound.loc4_24, @Convert.4(constants.%int_32) [template = constants.%Convert.specific_fn.3] +// CHECK:STDOUT: %Convert.specific_fn.loc4_24: = specific_function %Convert.bound.loc4_24, @Convert.3(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %.loc4_24.1: %i32 = value_of_initializer %int.umul [template = constants.%int_6.1] // CHECK:STDOUT: %.loc4_24.2: %i32 = converted %int.umul, %.loc4_24.1 [template = constants.%int_6.1] // CHECK:STDOUT: %int.convert_checked.loc4_24: init Core.IntLiteral = call %Convert.specific_fn.loc4_24(%.loc4_24.2) [template = constants.%int_6.2] @@ -140,10 +130,8 @@ let b: i32 = Mul(0x8000, 0x10000); // CHECK:STDOUT: %arr.var: ref %array_type = var arr // CHECK:STDOUT: %arr: ref %array_type = bind_name arr, %arr.var // CHECK:STDOUT: %int_32.loc5: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc5: init type = call constants.%Int(%int_32.loc5) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc5: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_6: Core.IntLiteral = int_value 6 [template = constants.%int_6.2] -// CHECK:STDOUT: %.loc5_13.1: type = value_of_initializer %int.make_type_signed.loc5 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_13.2: type = converted %int.make_type_signed.loc5, %.loc5_13.1 [template = constants.%i32] // CHECK:STDOUT: %array_type.loc5: type = array_type %int_6, %i32 [template = constants.%array_type] // CHECK:STDOUT: %ptr: type = ptr_type %array_type [template = constants.%ptr] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { @@ -155,17 +143,11 @@ let b: i32 = Mul(0x8000, 0x10000); // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc7_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc7_19: init type = call constants.%Int(%int_32.loc7_19) [template = constants.%i32] -// CHECK:STDOUT: %.loc7_19.1: type = value_of_initializer %int.make_type_signed.loc7_19 [template = constants.%i32] -// CHECK:STDOUT: %.loc7_19.2: type = converted %int.make_type_signed.loc7_19, %.loc7_19.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc7_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc7_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc7_27: init type = call constants.%Int(%int_32.loc7_27) [template = constants.%i32] -// CHECK:STDOUT: %.loc7_27.1: type = value_of_initializer %int.make_type_signed.loc7_27 [template = constants.%i32] -// CHECK:STDOUT: %.loc7_27.2: type = converted %int.make_type_signed.loc7_27, %.loc7_27.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc7_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc7_35: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc7_35: init type = call constants.%Int(%int_32.loc7_35) [template = constants.%i32] -// CHECK:STDOUT: %.loc7_35.1: type = value_of_initializer %int.make_type_signed.loc7_35 [template = constants.%i32] -// CHECK:STDOUT: %.loc7_35.2: type = converted %int.make_type_signed.loc7_35, %.loc7_35.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc7_35: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 @@ -175,11 +157,11 @@ let b: i32 = Mul(0x8000, 0x10000); // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Mul(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.umul"; +// CHECK:STDOUT: fn @Mul.1(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.umul"; // CHECK:STDOUT: // CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Mul.ref: %Mul.type = name_ref Mul, file.%Mul.decl [template = constants.%Mul] +// CHECK:STDOUT: %Mul.ref: %Mul.type.1 = name_ref Mul, file.%Mul.decl [template = constants.%Mul] // CHECK:STDOUT: %a.ref: %i32 = name_ref a, %a // CHECK:STDOUT: %b.ref: %i32 = name_ref b, %b // CHECK:STDOUT: %int.umul: init %i32 = call %Mul.ref(%a.ref, %b.ref) @@ -200,26 +182,24 @@ let b: i32 = Mul(0x8000, 0x10000); // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] -// CHECK:STDOUT: %Mul.type: type = fn_type @Mul [template] -// CHECK:STDOUT: %Mul: %Mul.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] +// CHECK:STDOUT: %Mul.type.1: type = fn_type @Mul.1 [template] +// CHECK:STDOUT: %Mul: %Mul.type.1 = struct_value () [template] // CHECK:STDOUT: %int_32767.1: Core.IntLiteral = int_value 32767 [template] // CHECK:STDOUT: %int_65536.1: Core.IntLiteral = int_value 65536 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_32767.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_32767.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_32767.2: %i32 = int_value 32767 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_65536.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_65536.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_65536.2: %i32 = int_value 65536 [template] // CHECK:STDOUT: %int_2147418112: %i32 = int_value 2147418112 [template] // CHECK:STDOUT: %int_32768.1: Core.IntLiteral = int_value 32768 [template] -// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_32768.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_32768.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_32768.2: %i32 = int_value 32768 [template] // CHECK:STDOUT: %int_-2147483648: %i32 = int_value -2147483648 [template] @@ -228,7 +208,7 @@ let b: i32 = Mul(0x8000, 0x10000); // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -242,7 +222,7 @@ let b: i32 = Mul(0x8000, 0x10000); // CHECK:STDOUT: .b = @__global_init.%b // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Mul.decl: %Mul.type = fn_decl @Mul [template = constants.%Mul] { +// CHECK:STDOUT: %Mul.decl: %Mul.type.1 = fn_decl @Mul.1 [template = constants.%Mul] { // CHECK:STDOUT: %a.patt: %i32 = binding_pattern a // CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: %i32 = binding_pattern b @@ -251,17 +231,11 @@ let b: i32 = Mul(0x8000, 0x10000); // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc4_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc4_11: init type = call constants.%Int(%int_32.loc4_11) [template = constants.%i32] -// CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_signed.loc4_11 [template = constants.%i32] -// CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_signed.loc4_11, %.loc4_11.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc4_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc4_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc4_19: init type = call constants.%Int(%int_32.loc4_19) [template = constants.%i32] -// CHECK:STDOUT: %.loc4_19.1: type = value_of_initializer %int.make_type_signed.loc4_19 [template = constants.%i32] -// CHECK:STDOUT: %.loc4_19.2: type = converted %int.make_type_signed.loc4_19, %.loc4_19.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc4_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc4_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc4_27: init type = call constants.%Int(%int_32.loc4_27) [template = constants.%i32] -// CHECK:STDOUT: %.loc4_27.1: type = value_of_initializer %int.make_type_signed.loc4_27 [template = constants.%i32] -// CHECK:STDOUT: %.loc4_27.2: type = converted %int.make_type_signed.loc4_27, %.loc4_27.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc4_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 @@ -270,29 +244,25 @@ let b: i32 = Mul(0x8000, 0x10000); // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %int_32.loc6: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc6: init type = call constants.%Int(%int_32.loc6) [template = constants.%i32] -// CHECK:STDOUT: %.loc6_8.1: type = value_of_initializer %int.make_type_signed.loc6 [template = constants.%i32] -// CHECK:STDOUT: %.loc6_8.2: type = converted %int.make_type_signed.loc6, %.loc6_8.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc6: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc7: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc7: init type = call constants.%Int(%int_32.loc7) [template = constants.%i32] -// CHECK:STDOUT: %.loc7_8.1: type = value_of_initializer %int.make_type_signed.loc7 [template = constants.%i32] -// CHECK:STDOUT: %.loc7_8.2: type = converted %int.make_type_signed.loc7, %.loc7_8.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc7: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Mul(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.umul"; +// CHECK:STDOUT: fn @Mul.1(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.umul"; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Mul.ref.loc6: %Mul.type = name_ref Mul, file.%Mul.decl [template = constants.%Mul] +// CHECK:STDOUT: %Mul.ref.loc6: %Mul.type.1 = name_ref Mul, file.%Mul.decl [template = constants.%Mul] // CHECK:STDOUT: %int_32767: Core.IntLiteral = int_value 32767 [template = constants.%int_32767.1] // CHECK:STDOUT: %int_65536.loc6: Core.IntLiteral = int_value 65536 [template = constants.%int_65536.1] -// CHECK:STDOUT: %impl.elem0.loc6_18: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc6_18: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc6_18: = bound_method %int_32767, %impl.elem0.loc6_18 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc6_18: = specific_function %Convert.bound.loc6_18, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc6_18: init %i32 = call %Convert.specific_fn.loc6_18(%int_32767) [template = constants.%int_32767.2] // CHECK:STDOUT: %.loc6_18.1: %i32 = value_of_initializer %int.convert_checked.loc6_18 [template = constants.%int_32767.2] // CHECK:STDOUT: %.loc6_18.2: %i32 = converted %int_32767, %.loc6_18.1 [template = constants.%int_32767.2] -// CHECK:STDOUT: %impl.elem0.loc6_26: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc6_26: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc6_26: = bound_method %int_65536.loc6, %impl.elem0.loc6_26 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc6_26: = specific_function %Convert.bound.loc6_26, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc6_26: init %i32 = call %Convert.specific_fn.loc6_26(%int_65536.loc6) [template = constants.%int_65536.2] @@ -302,16 +272,16 @@ let b: i32 = Mul(0x8000, 0x10000); // CHECK:STDOUT: %.loc6_34.1: %i32 = value_of_initializer %int.umul.loc6 [template = constants.%int_2147418112] // CHECK:STDOUT: %.loc6_34.2: %i32 = converted %int.umul.loc6, %.loc6_34.1 [template = constants.%int_2147418112] // CHECK:STDOUT: %a: %i32 = bind_name a, %.loc6_34.2 -// CHECK:STDOUT: %Mul.ref.loc7: %Mul.type = name_ref Mul, file.%Mul.decl [template = constants.%Mul] +// CHECK:STDOUT: %Mul.ref.loc7: %Mul.type.1 = name_ref Mul, file.%Mul.decl [template = constants.%Mul] // CHECK:STDOUT: %int_32768: Core.IntLiteral = int_value 32768 [template = constants.%int_32768.1] // CHECK:STDOUT: %int_65536.loc7: Core.IntLiteral = int_value 65536 [template = constants.%int_65536.1] -// CHECK:STDOUT: %impl.elem0.loc7_18: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc7_18: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc7_18: = bound_method %int_32768, %impl.elem0.loc7_18 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc7_18: = specific_function %Convert.bound.loc7_18, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc7_18: init %i32 = call %Convert.specific_fn.loc7_18(%int_32768) [template = constants.%int_32768.2] // CHECK:STDOUT: %.loc7_18.1: %i32 = value_of_initializer %int.convert_checked.loc7_18 [template = constants.%int_32768.2] // CHECK:STDOUT: %.loc7_18.2: %i32 = converted %int_32768, %.loc7_18.1 [template = constants.%int_32768.2] -// CHECK:STDOUT: %impl.elem0.loc7_26: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc7_26: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc7_26: = bound_method %int_65536.loc7, %impl.elem0.loc7_26 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc7_26: = specific_function %Convert.bound.loc7_26, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc7_26: init %i32 = call %Convert.specific_fn.loc7_26(%int_65536.loc7) [template = constants.%int_65536.2] diff --git a/toolchain/check/testdata/builtins/int/unegate.carbon b/toolchain/check/testdata/builtins/int/unegate.carbon index 64b29a835526c..ac618441a9b3b 100644 --- a/toolchain/check/testdata/builtins/int/unegate.carbon +++ b/toolchain/check/testdata/builtins/int/unegate.carbon @@ -116,30 +116,28 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] -// CHECK:STDOUT: %Negate.type: type = fn_type @Negate [template] -// CHECK:STDOUT: %Negate: %Negate.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] +// CHECK:STDOUT: %Negate.type.1: type = fn_type @Negate.1 [template] +// CHECK:STDOUT: %Negate: %Negate.type.1 = struct_value () [template] // CHECK:STDOUT: %int_123.1: Core.IntLiteral = int_value 123 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_123.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_123.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_123.2: %i32 = int_value 123 [template] // CHECK:STDOUT: %int_-123: %i32 = int_value -123 [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.4, @impl.3(%int_32) [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %interface.10: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_123.2, %Convert.15 [template] -// CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.4(%int_32) [template] +// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.3, @impl.2(%int_32) [template] +// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [template] +// CHECK:STDOUT: %interface.6: = interface_witness (%Convert.11) [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_123.2, %Convert.11 [template] +// CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.3(%int_32) [template] // CHECK:STDOUT: %array_type: type = array_type %int_123.1, %i32 [template] // CHECK:STDOUT: %ptr: type = ptr_type %array_type [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] // CHECK:STDOUT: %int_-1: %i32 = int_value -1 [template] @@ -150,7 +148,7 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -166,31 +164,27 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Negate.decl: %Negate.type = fn_decl @Negate [template = constants.%Negate] { +// CHECK:STDOUT: %Negate.decl: %Negate.type.1 = fn_decl @Negate.1 [template = constants.%Negate] { // CHECK:STDOUT: %a.patt: %i32 = binding_pattern a // CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc2_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc2_14: init type = call constants.%Int(%int_32.loc2_14) [template = constants.%i32] -// CHECK:STDOUT: %.loc2_14.1: type = value_of_initializer %int.make_type_signed.loc2_14 [template = constants.%i32] -// CHECK:STDOUT: %.loc2_14.2: type = converted %int.make_type_signed.loc2_14, %.loc2_14.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc2_14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc2_22: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc2_22: init type = call constants.%Int(%int_32.loc2_22) [template = constants.%i32] -// CHECK:STDOUT: %.loc2_22.1: type = value_of_initializer %int.make_type_signed.loc2_22 [template = constants.%i32] -// CHECK:STDOUT: %.loc2_22.2: type = converted %int.make_type_signed.loc2_22, %.loc2_22.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc2_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %int_32.loc4: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc4: init type = call constants.%Int(%int_32.loc4) [template = constants.%i32] -// CHECK:STDOUT: %Negate.ref.loc4_16: %Negate.type = name_ref Negate, %Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %Negate.ref.loc4_23: %Negate.type = name_ref Negate, %Negate.decl [template = constants.%Negate] +// CHECK:STDOUT: %i32.loc4: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %Negate.ref.loc4_16: %Negate.type.1 = name_ref Negate, %Negate.decl [template = constants.%Negate] +// CHECK:STDOUT: %Negate.ref.loc4_23: %Negate.type.1 = name_ref Negate, %Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %int_123.loc4: Core.IntLiteral = int_value 123 [template = constants.%int_123.1] -// CHECK:STDOUT: %impl.elem0.loc4_30: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc4_30: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc4_30: = bound_method %int_123.loc4, %impl.elem0.loc4_30 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc4_30: = specific_function %Convert.bound.loc4_30, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc4_30: init %i32 = call %Convert.specific_fn.loc4_30(%int_123.loc4) [template = constants.%int_123.2] @@ -200,11 +194,9 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %.loc4_33.1: %i32 = value_of_initializer %int.unegate.loc4_33 [template = constants.%int_-123] // CHECK:STDOUT: %.loc4_33.2: %i32 = converted %int.unegate.loc4_33, %.loc4_33.1 [template = constants.%int_-123] // CHECK:STDOUT: %int.unegate.loc4_34: init %i32 = call %Negate.ref.loc4_16(%.loc4_33.2) [template = constants.%int_123.2] -// CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_signed.loc4 [template = constants.%i32] -// CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_signed.loc4, %.loc4_11.1 [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc4_34: %Convert.type.6 = interface_witness_access constants.%interface.10, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %impl.elem0.loc4_34: %Convert.type.5 = interface_witness_access constants.%interface.6, element0 [template = constants.%Convert.11] // CHECK:STDOUT: %Convert.bound.loc4_34: = bound_method %int.unegate.loc4_34, %impl.elem0.loc4_34 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc4_34: = specific_function %Convert.bound.loc4_34, @Convert.4(constants.%int_32) [template = constants.%Convert.specific_fn.2] +// CHECK:STDOUT: %Convert.specific_fn.loc4_34: = specific_function %Convert.bound.loc4_34, @Convert.3(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %.loc4_34.1: %i32 = value_of_initializer %int.unegate.loc4_34 [template = constants.%int_123.2] // CHECK:STDOUT: %.loc4_34.2: %i32 = converted %int.unegate.loc4_34, %.loc4_34.1 [template = constants.%int_123.2] // CHECK:STDOUT: %int.convert_checked.loc4_34: init Core.IntLiteral = call %Convert.specific_fn.loc4_34(%.loc4_34.2) [template = constants.%int_123.1] @@ -214,16 +206,12 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %arr.var: ref %array_type = var arr // CHECK:STDOUT: %arr: ref %array_type = bind_name arr, %arr.var // CHECK:STDOUT: %int_32.loc5: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc5: init type = call constants.%Int(%int_32.loc5) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc5: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_123.loc5: Core.IntLiteral = int_value 123 [template = constants.%int_123.1] -// CHECK:STDOUT: %.loc5_13.1: type = value_of_initializer %int.make_type_signed.loc5 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_13.2: type = converted %int.make_type_signed.loc5, %.loc5_13.1 [template = constants.%i32] // CHECK:STDOUT: %array_type.loc5: type = array_type %int_123.loc5, %i32 [template = constants.%array_type] // CHECK:STDOUT: %ptr: type = ptr_type %array_type [template = constants.%ptr] // CHECK:STDOUT: %int_32.loc7: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc7: init type = call constants.%Int(%int_32.loc7) [template = constants.%i32] -// CHECK:STDOUT: %.loc7_8.1: type = value_of_initializer %int.make_type_signed.loc7 [template = constants.%i32] -// CHECK:STDOUT: %.loc7_8.2: type = converted %int.make_type_signed.loc7, %.loc7_8.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc7: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { // CHECK:STDOUT: %a.patt: %i32 = binding_pattern a // CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 @@ -233,17 +221,11 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc9_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc9_19: init type = call constants.%Int(%int_32.loc9_19) [template = constants.%i32] -// CHECK:STDOUT: %.loc9_19.1: type = value_of_initializer %int.make_type_signed.loc9_19 [template = constants.%i32] -// CHECK:STDOUT: %.loc9_19.2: type = converted %int.make_type_signed.loc9_19, %.loc9_19.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc9_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc9_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc9_27: init type = call constants.%Int(%int_32.loc9_27) [template = constants.%i32] -// CHECK:STDOUT: %.loc9_27.1: type = value_of_initializer %int.make_type_signed.loc9_27 [template = constants.%i32] -// CHECK:STDOUT: %.loc9_27.2: type = converted %int.make_type_signed.loc9_27, %.loc9_27.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc9_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc9_35: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc9_35: init type = call constants.%Int(%int_32.loc9_35) [template = constants.%i32] -// CHECK:STDOUT: %.loc9_35.1: type = value_of_initializer %int.make_type_signed.loc9_35 [template = constants.%i32] -// CHECK:STDOUT: %.loc9_35.2: type = converted %int.make_type_signed.loc9_35, %.loc9_35.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc9_35: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 @@ -253,11 +235,11 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Negate(%a.param_patt: %i32) -> %i32 = "int.unegate"; +// CHECK:STDOUT: fn @Negate.1(%a.param_patt: %i32) -> %i32 = "int.unegate"; // CHECK:STDOUT: // CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Negate.ref: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] +// CHECK:STDOUT: %Negate.ref: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %a.ref: %i32 = name_ref a, %a // CHECK:STDOUT: %int.unegate: init %i32 = call %Negate.ref(%a.ref) // CHECK:STDOUT: %.loc10_19.1: %i32 = value_of_initializer %int.unegate @@ -270,9 +252,9 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %arr.ref: ref %array_type = name_ref arr, file.%arr // CHECK:STDOUT: %addr: %ptr = addr_of %arr.ref // CHECK:STDOUT: %arr_p: %ptr = bind_name arr_p, %addr -// CHECK:STDOUT: %Negate.ref: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] +// CHECK:STDOUT: %Negate.ref: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1, %impl.elem0 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_1) [template = constants.%int_1.2] @@ -289,9 +271,7 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %TooFew.type: type = fn_type @TooFew [template] // CHECK:STDOUT: %TooFew: %TooFew.type = struct_value () [template] // CHECK:STDOUT: %TooMany.type: type = fn_type @TooMany [template] @@ -305,13 +285,13 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] // CHECK:STDOUT: %RuntimeCallTooFew.type: type = fn_type @RuntimeCallTooFew [template] @@ -325,8 +305,8 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .Bool = %import_ref.2 -// CHECK:STDOUT: .ImplicitAs = %import_ref.3 +// CHECK:STDOUT: .Bool = %import_ref.5 +// CHECK:STDOUT: .ImplicitAs = %import_ref.6 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -353,9 +333,7 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc8_16.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc8_16.2: type = converted %int.make_type_signed, %.loc8_16.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } @@ -368,17 +346,11 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc13_15: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc13_15: init type = call constants.%Int(%int_32.loc13_15) [template = constants.%i32] -// CHECK:STDOUT: %.loc13_15.1: type = value_of_initializer %int.make_type_signed.loc13_15 [template = constants.%i32] -// CHECK:STDOUT: %.loc13_15.2: type = converted %int.make_type_signed.loc13_15, %.loc13_15.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc13_15: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc13_23: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc13_23: init type = call constants.%Int(%int_32.loc13_23) [template = constants.%i32] -// CHECK:STDOUT: %.loc13_23.1: type = value_of_initializer %int.make_type_signed.loc13_23 [template = constants.%i32] -// CHECK:STDOUT: %.loc13_23.2: type = converted %int.make_type_signed.loc13_23, %.loc13_23.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc13_23: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc13_31: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc13_31: init type = call constants.%Int(%int_32.loc13_31) [template = constants.%i32] -// CHECK:STDOUT: %.loc13_31.1: type = value_of_initializer %int.make_type_signed.loc13_31 [template = constants.%i32] -// CHECK:STDOUT: %.loc13_31.2: type = converted %int.make_type_signed.loc13_31, %.loc13_31.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc13_31: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 @@ -393,9 +365,7 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc18_21.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc18_21.2: type = converted %int.make_type_signed, %.loc18_21.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc18_29.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc18_29.2: type = converted %bool.make_type, %.loc18_29.1 [template = bool] @@ -411,70 +381,58 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc19_17: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc19_17: init type = call constants.%Int(%int_32.loc19_17) [template = constants.%i32] -// CHECK:STDOUT: %.loc19_17.1: type = value_of_initializer %int.make_type_signed.loc19_17 [template = constants.%i32] -// CHECK:STDOUT: %.loc19_17.2: type = converted %int.make_type_signed.loc19_17, %.loc19_17.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc19_17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc19_25: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc19_25: init type = call constants.%Int(%int_32.loc19_25) [template = constants.%i32] -// CHECK:STDOUT: %.loc19_25.1: type = value_of_initializer %int.make_type_signed.loc19_25 [template = constants.%i32] -// CHECK:STDOUT: %.loc19_25.2: type = converted %int.make_type_signed.loc19_25, %.loc19_25.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc19_25: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %int_32.loc25: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc25: init type = call constants.%Int(%int_32.loc25) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc25: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %TooFew.ref: %TooFew.type = name_ref TooFew, %TooFew.decl [template = constants.%TooFew] // CHECK:STDOUT: %TooFew.call: init %i32 = call %TooFew.ref() -// CHECK:STDOUT: %.loc25_15.1: type = value_of_initializer %int.make_type_signed.loc25 [template = constants.%i32] -// CHECK:STDOUT: %.loc25_15.2: type = converted %int.make_type_signed.loc25, %.loc25_15.1 [template = constants.%i32] // CHECK:STDOUT: %too_few.var: ref = var too_few // CHECK:STDOUT: %too_few: ref = bind_name too_few, %too_few.var // CHECK:STDOUT: %int_32.loc30: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc30: init type = call constants.%Int(%int_32.loc30) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc30: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %TooMany.ref: %TooMany.type = name_ref TooMany, %TooMany.decl [template = constants.%TooMany] // CHECK:STDOUT: %int_1.loc30: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_2.loc30: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %impl.elem0.loc30_29: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc30_29: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc30_29: = bound_method %int_1.loc30, %impl.elem0.loc30_29 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc30_29: = specific_function %Convert.bound.loc30_29, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc30_29: init %i32 = call %Convert.specific_fn.loc30_29(%int_1.loc30) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc30_29.1: %i32 = value_of_initializer %int.convert_checked.loc30_29 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc30_29.2: %i32 = converted %int_1.loc30, %.loc30_29.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc30_32: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc30_32: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc30_32: = bound_method %int_2.loc30, %impl.elem0.loc30_32 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc30_32: = specific_function %Convert.bound.loc30_32, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc30_32: init %i32 = call %Convert.specific_fn.loc30_32(%int_2.loc30) [template = constants.%int_2.2] // CHECK:STDOUT: %.loc30_32.1: %i32 = value_of_initializer %int.convert_checked.loc30_32 [template = constants.%int_2.2] // CHECK:STDOUT: %.loc30_32.2: %i32 = converted %int_2.loc30, %.loc30_32.1 [template = constants.%int_2.2] // CHECK:STDOUT: %TooMany.call: init %i32 = call %TooMany.ref(%.loc30_29.2, %.loc30_32.2) -// CHECK:STDOUT: %.loc30_16.1: type = value_of_initializer %int.make_type_signed.loc30 [template = constants.%i32] -// CHECK:STDOUT: %.loc30_16.2: type = converted %int.make_type_signed.loc30, %.loc30_16.1 [template = constants.%i32] // CHECK:STDOUT: %too_many.var: ref = var too_many // CHECK:STDOUT: %too_many: ref = bind_name too_many, %too_many.var // CHECK:STDOUT: %int_32.loc35: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc35: init type = call constants.%Int(%int_32.loc35) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc35: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %BadReturnType.ref: %BadReturnType.type = name_ref BadReturnType, %BadReturnType.decl [template = constants.%BadReturnType] // CHECK:STDOUT: %int_1.loc35: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc35: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc35: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc35: = bound_method %int_1.loc35, %impl.elem0.loc35 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc35: = specific_function %Convert.bound.loc35, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc35: init %i32 = call %Convert.specific_fn.loc35(%int_1.loc35) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc35_42.1: %i32 = value_of_initializer %int.convert_checked.loc35 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc35_42.2: %i32 = converted %int_1.loc35, %.loc35_42.1 [template = constants.%int_1.2] // CHECK:STDOUT: %BadReturnType.call: init bool = call %BadReturnType.ref(%.loc35_42.2) -// CHECK:STDOUT: %.loc35_23.1: type = value_of_initializer %int.make_type_signed.loc35 [template = constants.%i32] -// CHECK:STDOUT: %.loc35_23.2: type = converted %int.make_type_signed.loc35, %.loc35_23.1 [template = constants.%i32] // CHECK:STDOUT: %bad_return_type.var: ref = var bad_return_type // CHECK:STDOUT: %bad_return_type: ref = bind_name bad_return_type, %bad_return_type.var // CHECK:STDOUT: %int_32.loc44: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc44: init type = call constants.%Int(%int_32.loc44) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc44: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %JustRight.ref: %JustRight.type = name_ref JustRight, %JustRight.decl [template = constants.%JustRight] // CHECK:STDOUT: %int_1.loc44: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_2.loc44: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %.loc44_16.1: type = value_of_initializer %int.make_type_signed.loc44 [template = constants.%i32] -// CHECK:STDOUT: %.loc44_16.2: type = converted %int.make_type_signed.loc44, %.loc44_16.1 [template = constants.%i32] // CHECK:STDOUT: %array_type: type = array_type , %i32 [template = ] // CHECK:STDOUT: %bad_call.var: ref = var bad_call // CHECK:STDOUT: %bad_call: ref = bind_name bad_call, %bad_call.var @@ -485,13 +443,9 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc46_25: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc46_25: init type = call constants.%Int(%int_32.loc46_25) [template = constants.%i32] -// CHECK:STDOUT: %.loc46_25.1: type = value_of_initializer %int.make_type_signed.loc46_25 [template = constants.%i32] -// CHECK:STDOUT: %.loc46_25.2: type = converted %int.make_type_signed.loc46_25, %.loc46_25.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc46_25: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc46_33: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc46_33: init type = call constants.%Int(%int_32.loc46_33) [template = constants.%i32] -// CHECK:STDOUT: %.loc46_33.1: type = value_of_initializer %int.make_type_signed.loc46_33 [template = constants.%i32] -// CHECK:STDOUT: %.loc46_33.2: type = converted %int.make_type_signed.loc46_33, %.loc46_33.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc46_33: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 @@ -508,21 +462,13 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param3 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc57_26: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc57_26: init type = call constants.%Int(%int_32.loc57_26) [template = constants.%i32] -// CHECK:STDOUT: %.loc57_26.1: type = value_of_initializer %int.make_type_signed.loc57_26 [template = constants.%i32] -// CHECK:STDOUT: %.loc57_26.2: type = converted %int.make_type_signed.loc57_26, %.loc57_26.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc57_26: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc57_34: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc57_34: init type = call constants.%Int(%int_32.loc57_34) [template = constants.%i32] -// CHECK:STDOUT: %.loc57_34.1: type = value_of_initializer %int.make_type_signed.loc57_34 [template = constants.%i32] -// CHECK:STDOUT: %.loc57_34.2: type = converted %int.make_type_signed.loc57_34, %.loc57_34.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc57_34: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc57_42: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc57_42: init type = call constants.%Int(%int_32.loc57_42) [template = constants.%i32] -// CHECK:STDOUT: %.loc57_42.1: type = value_of_initializer %int.make_type_signed.loc57_42 [template = constants.%i32] -// CHECK:STDOUT: %.loc57_42.2: type = converted %int.make_type_signed.loc57_42, %.loc57_42.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc57_42: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc57_50: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc57_50: init type = call constants.%Int(%int_32.loc57_50) [template = constants.%i32] -// CHECK:STDOUT: %.loc57_50.1: type = value_of_initializer %int.make_type_signed.loc57_50 [template = constants.%i32] -// CHECK:STDOUT: %.loc57_50.2: type = converted %int.make_type_signed.loc57_50, %.loc57_50.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc57_50: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 @@ -541,13 +487,9 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc68_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc68_32: init type = call constants.%Int(%int_32.loc68_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc68_32.1: type = value_of_initializer %int.make_type_signed.loc68_32 [template = constants.%i32] -// CHECK:STDOUT: %.loc68_32.2: type = converted %int.make_type_signed.loc68_32, %.loc68_32.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc68_32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc68_40: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc68_40: init type = call constants.%Int(%int_32.loc68_40) [template = constants.%i32] -// CHECK:STDOUT: %.loc68_40.1: type = value_of_initializer %int.make_type_signed.loc68_40 [template = constants.%i32] -// CHECK:STDOUT: %.loc68_40.2: type = converted %int.make_type_signed.loc68_40, %.loc68_40.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc68_40: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc68_48.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc68_48.2: type = converted %bool.make_type, %.loc68_48.1 [template = bool] @@ -596,24 +538,22 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] -// CHECK:STDOUT: %Negate.type: type = fn_type @Negate [template] -// CHECK:STDOUT: %Negate: %Negate.type = struct_value () [template] -// CHECK:STDOUT: %Sub.type: type = fn_type @Sub [template] -// CHECK:STDOUT: %Sub: %Sub.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] +// CHECK:STDOUT: %Negate.type.1: type = fn_type @Negate.1 [template] +// CHECK:STDOUT: %Negate: %Negate.type.1 = struct_value () [template] +// CHECK:STDOUT: %Sub.type.1: type = fn_type @Sub.1 [template] +// CHECK:STDOUT: %Sub: %Sub.type.1 = struct_value () [template] // CHECK:STDOUT: %int_2147483647.1: Core.IntLiteral = int_value 2147483647 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_2147483647.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_2147483647.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2147483647.2: %i32 = int_value 2147483647 [template] // CHECK:STDOUT: %int_-2147483647: %i32 = int_value -2147483647 [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] // CHECK:STDOUT: %int_-2147483648: %i32 = int_value -2147483648 [template] @@ -622,7 +562,7 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -637,26 +577,22 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: .b = @__global_init.%b // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Negate.decl: %Negate.type = fn_decl @Negate [template = constants.%Negate] { +// CHECK:STDOUT: %Negate.decl: %Negate.type.1 = fn_decl @Negate.1 [template = constants.%Negate] { // CHECK:STDOUT: %a.patt: %i32 = binding_pattern a // CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc4_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc4_14: init type = call constants.%Int(%int_32.loc4_14) [template = constants.%i32] -// CHECK:STDOUT: %.loc4_14.1: type = value_of_initializer %int.make_type_signed.loc4_14 [template = constants.%i32] -// CHECK:STDOUT: %.loc4_14.2: type = converted %int.make_type_signed.loc4_14, %.loc4_14.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc4_14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc4_22: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc4_22: init type = call constants.%Int(%int_32.loc4_22) [template = constants.%i32] -// CHECK:STDOUT: %.loc4_22.1: type = value_of_initializer %int.make_type_signed.loc4_22 [template = constants.%i32] -// CHECK:STDOUT: %.loc4_22.2: type = converted %int.make_type_signed.loc4_22, %.loc4_22.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc4_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %Sub.decl: %Sub.type = fn_decl @Sub [template = constants.%Sub] { +// CHECK:STDOUT: %Sub.decl: %Sub.type.1 = fn_decl @Sub.1 [template = constants.%Sub] { // CHECK:STDOUT: %a.patt: %i32 = binding_pattern a // CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: %i32 = binding_pattern b @@ -665,17 +601,11 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc5_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc5_11: init type = call constants.%Int(%int_32.loc5_11) [template = constants.%i32] -// CHECK:STDOUT: %.loc5_11.1: type = value_of_initializer %int.make_type_signed.loc5_11 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_11.2: type = converted %int.make_type_signed.loc5_11, %.loc5_11.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc5_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc5_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc5_19: init type = call constants.%Int(%int_32.loc5_19) [template = constants.%i32] -// CHECK:STDOUT: %.loc5_19.1: type = value_of_initializer %int.make_type_signed.loc5_19 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_19.2: type = converted %int.make_type_signed.loc5_19, %.loc5_19.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc5_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc5_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc5_27: init type = call constants.%Int(%int_32.loc5_27) [template = constants.%i32] -// CHECK:STDOUT: %.loc5_27.1: type = value_of_initializer %int.make_type_signed.loc5_27 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_27.2: type = converted %int.make_type_signed.loc5_27, %.loc5_27.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc5_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 @@ -684,25 +614,21 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %int_32.loc8: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc8: init type = call constants.%Int(%int_32.loc8) [template = constants.%i32] -// CHECK:STDOUT: %.loc8_8.1: type = value_of_initializer %int.make_type_signed.loc8 [template = constants.%i32] -// CHECK:STDOUT: %.loc8_8.2: type = converted %int.make_type_signed.loc8, %.loc8_8.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc8: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11: init type = call constants.%Int(%int_32.loc11) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_8.1: type = value_of_initializer %int.make_type_signed.loc11 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_8.2: type = converted %int.make_type_signed.loc11, %.loc11_8.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Negate(%a.param_patt: %i32) -> %i32 = "int.unegate"; +// CHECK:STDOUT: fn @Negate.1(%a.param_patt: %i32) -> %i32 = "int.unegate"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Sub(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.usub"; +// CHECK:STDOUT: fn @Sub.1(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.usub"; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Negate.ref.loc8_14: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %Negate.ref.loc8_21: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] +// CHECK:STDOUT: %Negate.ref.loc8_14: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] +// CHECK:STDOUT: %Negate.ref.loc8_21: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %int_2147483647.loc8: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] -// CHECK:STDOUT: %impl.elem0.loc8: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc8: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc8: = bound_method %int_2147483647.loc8, %impl.elem0.loc8 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc8: = specific_function %Convert.bound.loc8, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc8: init %i32 = call %Convert.specific_fn.loc8(%int_2147483647.loc8) [template = constants.%int_2147483647.2] @@ -715,11 +641,11 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %.loc8_40.1: %i32 = value_of_initializer %int.unegate.loc8_39 [template = constants.%int_2147483647.2] // CHECK:STDOUT: %.loc8_40.2: %i32 = converted %int.unegate.loc8_39, %.loc8_40.1 [template = constants.%int_2147483647.2] // CHECK:STDOUT: %a: %i32 = bind_name a, %.loc8_40.2 -// CHECK:STDOUT: %Negate.ref.loc11_14: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %Sub.ref: %Sub.type = name_ref Sub, file.%Sub.decl [template = constants.%Sub] -// CHECK:STDOUT: %Negate.ref.loc11_25: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] +// CHECK:STDOUT: %Negate.ref.loc11_14: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] +// CHECK:STDOUT: %Sub.ref: %Sub.type.1 = name_ref Sub, file.%Sub.decl [template = constants.%Sub] +// CHECK:STDOUT: %Negate.ref.loc11_25: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %int_2147483647.loc11: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] -// CHECK:STDOUT: %impl.elem0.loc11_32: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc11_32: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_32: = bound_method %int_2147483647.loc11, %impl.elem0.loc11_32 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc11_32: = specific_function %Convert.bound.loc11_32, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc11_32: init %i32 = call %Convert.specific_fn.loc11_32(%int_2147483647.loc11) [template = constants.%int_2147483647.2] @@ -729,7 +655,7 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %.loc11_42.1: %i32 = value_of_initializer %int.unegate.loc11_42 [template = constants.%int_-2147483647] // CHECK:STDOUT: %.loc11_42.2: %i32 = converted %int.unegate.loc11_42, %.loc11_42.1 [template = constants.%int_-2147483647] -// CHECK:STDOUT: %impl.elem0.loc11_45: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc11_45: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_45: = bound_method %int_1, %impl.elem0.loc11_45 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc11_45: = specific_function %Convert.bound.loc11_45, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc11_45: init %i32 = call %Convert.specific_fn.loc11_45(%int_1) [template = constants.%int_1.2] diff --git a/toolchain/check/testdata/builtins/int/usub.carbon b/toolchain/check/testdata/builtins/int/usub.carbon index 613188df4255c..3e2f4fcdee5e6 100644 --- a/toolchain/check/testdata/builtins/int/usub.carbon +++ b/toolchain/check/testdata/builtins/int/usub.carbon @@ -33,30 +33,28 @@ let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] -// CHECK:STDOUT: %Sub.type: type = fn_type @Sub [template] -// CHECK:STDOUT: %Sub: %Sub.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] +// CHECK:STDOUT: %Sub.type.1: type = fn_type @Sub.1 [template] +// CHECK:STDOUT: %Sub: %Sub.type.1 = struct_value () [template] // CHECK:STDOUT: %int_3.1: Core.IntLiteral = int_value 3 [template] // CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_3.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_3.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_3.2: %i32 = int_value 3 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] // CHECK:STDOUT: %int_1.1: %i32 = int_value 1 [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.4, @impl.3(%int_32) [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %interface.10: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_1.1, %Convert.15 [template] -// CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.4(%int_32) [template] +// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.3, @impl.2(%int_32) [template] +// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [template] +// CHECK:STDOUT: %interface.6: = interface_witness (%Convert.11) [template] +// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_1.1, %Convert.11 [template] +// CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.3(%int_32) [template] // CHECK:STDOUT: %int_1.2: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %array_type: type = array_type %int_1.2, %i32 [template] // CHECK:STDOUT: %ptr: type = ptr_type %array_type [template] @@ -67,7 +65,7 @@ let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -82,7 +80,7 @@ let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Sub.decl: %Sub.type = fn_decl @Sub [template = constants.%Sub] { +// CHECK:STDOUT: %Sub.decl: %Sub.type.1 = fn_decl @Sub.1 [template = constants.%Sub] { // CHECK:STDOUT: %a.patt: %i32 = binding_pattern a // CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: %i32 = binding_pattern b @@ -91,17 +89,11 @@ let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc2_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc2_11: init type = call constants.%Int(%int_32.loc2_11) [template = constants.%i32] -// CHECK:STDOUT: %.loc2_11.1: type = value_of_initializer %int.make_type_signed.loc2_11 [template = constants.%i32] -// CHECK:STDOUT: %.loc2_11.2: type = converted %int.make_type_signed.loc2_11, %.loc2_11.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc2_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc2_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc2_19: init type = call constants.%Int(%int_32.loc2_19) [template = constants.%i32] -// CHECK:STDOUT: %.loc2_19.1: type = value_of_initializer %int.make_type_signed.loc2_19 [template = constants.%i32] -// CHECK:STDOUT: %.loc2_19.2: type = converted %int.make_type_signed.loc2_19, %.loc2_19.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc2_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc2_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc2_27: init type = call constants.%Int(%int_32.loc2_27) [template = constants.%i32] -// CHECK:STDOUT: %.loc2_27.1: type = value_of_initializer %int.make_type_signed.loc2_27 [template = constants.%i32] -// CHECK:STDOUT: %.loc2_27.2: type = converted %int.make_type_signed.loc2_27, %.loc2_27.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc2_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 @@ -110,28 +102,26 @@ let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %int_32.loc4: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc4: init type = call constants.%Int(%int_32.loc4) [template = constants.%i32] -// CHECK:STDOUT: %Sub.ref: %Sub.type = name_ref Sub, %Sub.decl [template = constants.%Sub] +// CHECK:STDOUT: %i32.loc4: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %Sub.ref: %Sub.type.1 = name_ref Sub, %Sub.decl [template = constants.%Sub] // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %impl.elem0.loc4_20: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc4_20: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc4_20: = bound_method %int_3, %impl.elem0.loc4_20 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc4_20: = specific_function %Convert.bound.loc4_20, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc4_20: init %i32 = call %Convert.specific_fn.loc4_20(%int_3) [template = constants.%int_3.2] // CHECK:STDOUT: %.loc4_20.1: %i32 = value_of_initializer %int.convert_checked.loc4_20 [template = constants.%int_3.2] // CHECK:STDOUT: %.loc4_20.2: %i32 = converted %int_3, %.loc4_20.1 [template = constants.%int_3.2] -// CHECK:STDOUT: %impl.elem0.loc4_23: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc4_23: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc4_23: = bound_method %int_2, %impl.elem0.loc4_23 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc4_23: = specific_function %Convert.bound.loc4_23, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc4_23: init %i32 = call %Convert.specific_fn.loc4_23(%int_2) [template = constants.%int_2.2] // CHECK:STDOUT: %.loc4_23.1: %i32 = value_of_initializer %int.convert_checked.loc4_23 [template = constants.%int_2.2] // CHECK:STDOUT: %.loc4_23.2: %i32 = converted %int_2, %.loc4_23.1 [template = constants.%int_2.2] // CHECK:STDOUT: %int.usub: init %i32 = call %Sub.ref(%.loc4_20.2, %.loc4_23.2) [template = constants.%int_1.1] -// CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_signed.loc4 [template = constants.%i32] -// CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_signed.loc4, %.loc4_11.1 [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc4_24: %Convert.type.6 = interface_witness_access constants.%interface.10, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %impl.elem0.loc4_24: %Convert.type.5 = interface_witness_access constants.%interface.6, element0 [template = constants.%Convert.11] // CHECK:STDOUT: %Convert.bound.loc4_24: = bound_method %int.usub, %impl.elem0.loc4_24 [template = constants.%Convert.bound.3] -// CHECK:STDOUT: %Convert.specific_fn.loc4_24: = specific_function %Convert.bound.loc4_24, @Convert.4(constants.%int_32) [template = constants.%Convert.specific_fn.3] +// CHECK:STDOUT: %Convert.specific_fn.loc4_24: = specific_function %Convert.bound.loc4_24, @Convert.3(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %.loc4_24.1: %i32 = value_of_initializer %int.usub [template = constants.%int_1.1] // CHECK:STDOUT: %.loc4_24.2: %i32 = converted %int.usub, %.loc4_24.1 [template = constants.%int_1.1] // CHECK:STDOUT: %int.convert_checked.loc4_24: init Core.IntLiteral = call %Convert.specific_fn.loc4_24(%.loc4_24.2) [template = constants.%int_1.2] @@ -141,10 +131,8 @@ let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDOUT: %arr.var: ref %array_type = var arr // CHECK:STDOUT: %arr: ref %array_type = bind_name arr, %arr.var // CHECK:STDOUT: %int_32.loc5: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc5: init type = call constants.%Int(%int_32.loc5) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc5: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc5_13.1: type = value_of_initializer %int.make_type_signed.loc5 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_13.2: type = converted %int.make_type_signed.loc5, %.loc5_13.1 [template = constants.%i32] // CHECK:STDOUT: %array_type.loc5: type = array_type %int_1, %i32 [template = constants.%array_type] // CHECK:STDOUT: %ptr: type = ptr_type %array_type [template = constants.%ptr] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { @@ -156,17 +144,11 @@ let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc7_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc7_19: init type = call constants.%Int(%int_32.loc7_19) [template = constants.%i32] -// CHECK:STDOUT: %.loc7_19.1: type = value_of_initializer %int.make_type_signed.loc7_19 [template = constants.%i32] -// CHECK:STDOUT: %.loc7_19.2: type = converted %int.make_type_signed.loc7_19, %.loc7_19.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc7_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc7_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc7_27: init type = call constants.%Int(%int_32.loc7_27) [template = constants.%i32] -// CHECK:STDOUT: %.loc7_27.1: type = value_of_initializer %int.make_type_signed.loc7_27 [template = constants.%i32] -// CHECK:STDOUT: %.loc7_27.2: type = converted %int.make_type_signed.loc7_27, %.loc7_27.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc7_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc7_35: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc7_35: init type = call constants.%Int(%int_32.loc7_35) [template = constants.%i32] -// CHECK:STDOUT: %.loc7_35.1: type = value_of_initializer %int.make_type_signed.loc7_35 [template = constants.%i32] -// CHECK:STDOUT: %.loc7_35.2: type = converted %int.make_type_signed.loc7_35, %.loc7_35.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc7_35: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 @@ -176,11 +158,11 @@ let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Sub(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.usub"; +// CHECK:STDOUT: fn @Sub.1(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.usub"; // CHECK:STDOUT: // CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Sub.ref: %Sub.type = name_ref Sub, file.%Sub.decl [template = constants.%Sub] +// CHECK:STDOUT: %Sub.ref: %Sub.type.1 = name_ref Sub, file.%Sub.decl [template = constants.%Sub] // CHECK:STDOUT: %a.ref: %i32 = name_ref a, %a // CHECK:STDOUT: %b.ref: %i32 = name_ref b, %b // CHECK:STDOUT: %int.usub: init %i32 = call %Sub.ref(%a.ref, %b.ref) @@ -201,31 +183,29 @@ let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] -// CHECK:STDOUT: %Sub.type: type = fn_type @Sub [template] -// CHECK:STDOUT: %Sub: %Sub.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] +// CHECK:STDOUT: %Sub.type.1: type = fn_type @Sub.1 [template] +// CHECK:STDOUT: %Sub: %Sub.type.1 = struct_value () [template] // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %int_2147483647.1: Core.IntLiteral = int_value 2147483647 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_0.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2147483647.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2147483647.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2147483647.2: %i32 = int_value 2147483647 [template] // CHECK:STDOUT: %int_-2147483647: %i32 = int_value -2147483647 [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] // CHECK:STDOUT: %int_-2147483648: %i32 = int_value -2147483648 [template] // CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %Convert.bound.4: = bound_method %int_2.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.4: = bound_method %int_2.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.4: = specific_function %Convert.bound.4, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] // CHECK:STDOUT: } @@ -233,7 +213,7 @@ let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -248,7 +228,7 @@ let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDOUT: .c = @__global_init.%c // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Sub.decl: %Sub.type = fn_decl @Sub [template = constants.%Sub] { +// CHECK:STDOUT: %Sub.decl: %Sub.type.1 = fn_decl @Sub.1 [template = constants.%Sub] { // CHECK:STDOUT: %a.patt: %i32 = binding_pattern a // CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: %i32 = binding_pattern b @@ -257,17 +237,11 @@ let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc4_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc4_11: init type = call constants.%Int(%int_32.loc4_11) [template = constants.%i32] -// CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_signed.loc4_11 [template = constants.%i32] -// CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_signed.loc4_11, %.loc4_11.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc4_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc4_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc4_19: init type = call constants.%Int(%int_32.loc4_19) [template = constants.%i32] -// CHECK:STDOUT: %.loc4_19.1: type = value_of_initializer %int.make_type_signed.loc4_19 [template = constants.%i32] -// CHECK:STDOUT: %.loc4_19.2: type = converted %int.make_type_signed.loc4_19, %.loc4_19.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc4_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc4_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc4_27: init type = call constants.%Int(%int_32.loc4_27) [template = constants.%i32] -// CHECK:STDOUT: %.loc4_27.1: type = value_of_initializer %int.make_type_signed.loc4_27 [template = constants.%i32] -// CHECK:STDOUT: %.loc4_27.2: type = converted %int.make_type_signed.loc4_27, %.loc4_27.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc4_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 @@ -276,33 +250,27 @@ let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %int_32.loc6: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc6: init type = call constants.%Int(%int_32.loc6) [template = constants.%i32] -// CHECK:STDOUT: %.loc6_8.1: type = value_of_initializer %int.make_type_signed.loc6 [template = constants.%i32] -// CHECK:STDOUT: %.loc6_8.2: type = converted %int.make_type_signed.loc6, %.loc6_8.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc6: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc7: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc7: init type = call constants.%Int(%int_32.loc7) [template = constants.%i32] -// CHECK:STDOUT: %.loc7_8.1: type = value_of_initializer %int.make_type_signed.loc7 [template = constants.%i32] -// CHECK:STDOUT: %.loc7_8.2: type = converted %int.make_type_signed.loc7, %.loc7_8.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc7: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc8: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc8: init type = call constants.%Int(%int_32.loc8) [template = constants.%i32] -// CHECK:STDOUT: %.loc8_8.1: type = value_of_initializer %int.make_type_signed.loc8 [template = constants.%i32] -// CHECK:STDOUT: %.loc8_8.2: type = converted %int.make_type_signed.loc8, %.loc8_8.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc8: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Sub(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.usub"; +// CHECK:STDOUT: fn @Sub.1(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.usub"; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Sub.ref.loc6: %Sub.type = name_ref Sub, file.%Sub.decl [template = constants.%Sub] +// CHECK:STDOUT: %Sub.ref.loc6: %Sub.type.1 = name_ref Sub, file.%Sub.decl [template = constants.%Sub] // CHECK:STDOUT: %int_0.loc6: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %int_2147483647.loc6: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] -// CHECK:STDOUT: %impl.elem0.loc6_18: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc6_18: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc6_18: = bound_method %int_0.loc6, %impl.elem0.loc6_18 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc6_18: = specific_function %Convert.bound.loc6_18, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc6_18: init %i32 = call %Convert.specific_fn.loc6_18(%int_0.loc6) [template = constants.%int_0.2] // CHECK:STDOUT: %.loc6_18.1: %i32 = value_of_initializer %int.convert_checked.loc6_18 [template = constants.%int_0.2] // CHECK:STDOUT: %.loc6_18.2: %i32 = converted %int_0.loc6, %.loc6_18.1 [template = constants.%int_0.2] -// CHECK:STDOUT: %impl.elem0.loc6_21: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc6_21: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc6_21: = bound_method %int_2147483647.loc6, %impl.elem0.loc6_21 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc6_21: = specific_function %Convert.bound.loc6_21, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc6_21: init %i32 = call %Convert.specific_fn.loc6_21(%int_2147483647.loc6) [template = constants.%int_2147483647.2] @@ -312,17 +280,17 @@ let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDOUT: %.loc6_32.1: %i32 = value_of_initializer %int.usub.loc6 [template = constants.%int_-2147483647] // CHECK:STDOUT: %.loc6_32.2: %i32 = converted %int.usub.loc6, %.loc6_32.1 [template = constants.%int_-2147483647] // CHECK:STDOUT: %a: %i32 = bind_name a, %.loc6_32.2 -// CHECK:STDOUT: %Sub.ref.loc7_14: %Sub.type = name_ref Sub, file.%Sub.decl [template = constants.%Sub] -// CHECK:STDOUT: %Sub.ref.loc7_18: %Sub.type = name_ref Sub, file.%Sub.decl [template = constants.%Sub] +// CHECK:STDOUT: %Sub.ref.loc7_14: %Sub.type.1 = name_ref Sub, file.%Sub.decl [template = constants.%Sub] +// CHECK:STDOUT: %Sub.ref.loc7_18: %Sub.type.1 = name_ref Sub, file.%Sub.decl [template = constants.%Sub] // CHECK:STDOUT: %int_0.loc7: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %int_2147483647.loc7: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] -// CHECK:STDOUT: %impl.elem0.loc7_22: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc7_22: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc7_22: = bound_method %int_0.loc7, %impl.elem0.loc7_22 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc7_22: = specific_function %Convert.bound.loc7_22, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc7_22: init %i32 = call %Convert.specific_fn.loc7_22(%int_0.loc7) [template = constants.%int_0.2] // CHECK:STDOUT: %.loc7_22.1: %i32 = value_of_initializer %int.convert_checked.loc7_22 [template = constants.%int_0.2] // CHECK:STDOUT: %.loc7_22.2: %i32 = converted %int_0.loc7, %.loc7_22.1 [template = constants.%int_0.2] -// CHECK:STDOUT: %impl.elem0.loc7_25: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc7_25: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc7_25: = bound_method %int_2147483647.loc7, %impl.elem0.loc7_25 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc7_25: = specific_function %Convert.bound.loc7_25, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc7_25: init %i32 = call %Convert.specific_fn.loc7_25(%int_2147483647.loc7) [template = constants.%int_2147483647.2] @@ -332,7 +300,7 @@ let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %.loc7_35.1: %i32 = value_of_initializer %int.usub.loc7_35 [template = constants.%int_-2147483647] // CHECK:STDOUT: %.loc7_35.2: %i32 = converted %int.usub.loc7_35, %.loc7_35.1 [template = constants.%int_-2147483647] -// CHECK:STDOUT: %impl.elem0.loc7_38: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc7_38: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc7_38: = bound_method %int_1, %impl.elem0.loc7_38 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc7_38: = specific_function %Convert.bound.loc7_38, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc7_38: init %i32 = call %Convert.specific_fn.loc7_38(%int_1) [template = constants.%int_1.2] @@ -342,17 +310,17 @@ let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDOUT: %.loc7_40.1: %i32 = value_of_initializer %int.usub.loc7_39 [template = constants.%int_-2147483648] // CHECK:STDOUT: %.loc7_40.2: %i32 = converted %int.usub.loc7_39, %.loc7_40.1 [template = constants.%int_-2147483648] // CHECK:STDOUT: %b: %i32 = bind_name b, %.loc7_40.2 -// CHECK:STDOUT: %Sub.ref.loc8_14: %Sub.type = name_ref Sub, file.%Sub.decl [template = constants.%Sub] -// CHECK:STDOUT: %Sub.ref.loc8_18: %Sub.type = name_ref Sub, file.%Sub.decl [template = constants.%Sub] +// CHECK:STDOUT: %Sub.ref.loc8_14: %Sub.type.1 = name_ref Sub, file.%Sub.decl [template = constants.%Sub] +// CHECK:STDOUT: %Sub.ref.loc8_18: %Sub.type.1 = name_ref Sub, file.%Sub.decl [template = constants.%Sub] // CHECK:STDOUT: %int_0.loc8: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %int_2147483647.loc8: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] -// CHECK:STDOUT: %impl.elem0.loc8_22: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc8_22: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc8_22: = bound_method %int_0.loc8, %impl.elem0.loc8_22 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc8_22: = specific_function %Convert.bound.loc8_22, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc8_22: init %i32 = call %Convert.specific_fn.loc8_22(%int_0.loc8) [template = constants.%int_0.2] // CHECK:STDOUT: %.loc8_22.1: %i32 = value_of_initializer %int.convert_checked.loc8_22 [template = constants.%int_0.2] // CHECK:STDOUT: %.loc8_22.2: %i32 = converted %int_0.loc8, %.loc8_22.1 [template = constants.%int_0.2] -// CHECK:STDOUT: %impl.elem0.loc8_25: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc8_25: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc8_25: = bound_method %int_2147483647.loc8, %impl.elem0.loc8_25 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc8_25: = specific_function %Convert.bound.loc8_25, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc8_25: init %i32 = call %Convert.specific_fn.loc8_25(%int_2147483647.loc8) [template = constants.%int_2147483647.2] @@ -362,7 +330,7 @@ let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %.loc8_35.1: %i32 = value_of_initializer %int.usub.loc8_35 [template = constants.%int_-2147483647] // CHECK:STDOUT: %.loc8_35.2: %i32 = converted %int.usub.loc8_35, %.loc8_35.1 [template = constants.%int_-2147483647] -// CHECK:STDOUT: %impl.elem0.loc8_38: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc8_38: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc8_38: = bound_method %int_2, %impl.elem0.loc8_38 [template = constants.%Convert.bound.4] // CHECK:STDOUT: %Convert.specific_fn.loc8_38: = specific_function %Convert.bound.loc8_38, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.4] // CHECK:STDOUT: %int.convert_checked.loc8_38: init %i32 = call %Convert.specific_fn.loc8_38(%int_2) [template = constants.%int_2.2] diff --git a/toolchain/check/testdata/builtins/int/xor.carbon b/toolchain/check/testdata/builtins/int/xor.carbon index 0834a7b9cd303..de1754bd8d933 100644 --- a/toolchain/check/testdata/builtins/int/xor.carbon +++ b/toolchain/check/testdata/builtins/int/xor.carbon @@ -23,30 +23,28 @@ fn RuntimeCall(a: i32, b: i32) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %Xor.type: type = fn_type @Xor [template] // CHECK:STDOUT: %Xor: %Xor.type = struct_value () [template] // CHECK:STDOUT: %int_12.1: Core.IntLiteral = int_value 12 [template] // CHECK:STDOUT: %int_10.1: Core.IntLiteral = int_value 10 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_12.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_12.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_12.2: %i32 = int_value 12 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_10.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_10.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_10.2: %i32 = int_value 10 [template] // CHECK:STDOUT: %int_6.1: %i32 = int_value 6 [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.4, @impl.3(%int_32) [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %interface.10: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_6.1, %Convert.15 [template] -// CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.4(%int_32) [template] +// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.3, @impl.2(%int_32) [template] +// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [template] +// CHECK:STDOUT: %interface.6: = interface_witness (%Convert.11) [template] +// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_6.1, %Convert.11 [template] +// CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.3(%int_32) [template] // CHECK:STDOUT: %int_6.2: Core.IntLiteral = int_value 6 [template] // CHECK:STDOUT: %array_type: type = array_type %int_6.2, %i32 [template] // CHECK:STDOUT: %ptr: type = ptr_type %array_type [template] @@ -57,7 +55,7 @@ fn RuntimeCall(a: i32, b: i32) -> i32 { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -81,17 +79,11 @@ fn RuntimeCall(a: i32, b: i32) -> i32 { // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc2_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc2_11: init type = call constants.%Int(%int_32.loc2_11) [template = constants.%i32] -// CHECK:STDOUT: %.loc2_11.1: type = value_of_initializer %int.make_type_signed.loc2_11 [template = constants.%i32] -// CHECK:STDOUT: %.loc2_11.2: type = converted %int.make_type_signed.loc2_11, %.loc2_11.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc2_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc2_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc2_19: init type = call constants.%Int(%int_32.loc2_19) [template = constants.%i32] -// CHECK:STDOUT: %.loc2_19.1: type = value_of_initializer %int.make_type_signed.loc2_19 [template = constants.%i32] -// CHECK:STDOUT: %.loc2_19.2: type = converted %int.make_type_signed.loc2_19, %.loc2_19.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc2_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc2_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc2_27: init type = call constants.%Int(%int_32.loc2_27) [template = constants.%i32] -// CHECK:STDOUT: %.loc2_27.1: type = value_of_initializer %int.make_type_signed.loc2_27 [template = constants.%i32] -// CHECK:STDOUT: %.loc2_27.2: type = converted %int.make_type_signed.loc2_27, %.loc2_27.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc2_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 @@ -100,28 +92,26 @@ fn RuntimeCall(a: i32, b: i32) -> i32 { // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %int_32.loc4: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc4: init type = call constants.%Int(%int_32.loc4) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc4: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %Xor.ref: %Xor.type = name_ref Xor, %Xor.decl [template = constants.%Xor] // CHECK:STDOUT: %int_12: Core.IntLiteral = int_value 12 [template = constants.%int_12.1] // CHECK:STDOUT: %int_10: Core.IntLiteral = int_value 10 [template = constants.%int_10.1] -// CHECK:STDOUT: %impl.elem0.loc4_20: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc4_20: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc4_20: = bound_method %int_12, %impl.elem0.loc4_20 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc4_20: = specific_function %Convert.bound.loc4_20, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc4_20: init %i32 = call %Convert.specific_fn.loc4_20(%int_12) [template = constants.%int_12.2] // CHECK:STDOUT: %.loc4_20.1: %i32 = value_of_initializer %int.convert_checked.loc4_20 [template = constants.%int_12.2] // CHECK:STDOUT: %.loc4_20.2: %i32 = converted %int_12, %.loc4_20.1 [template = constants.%int_12.2] -// CHECK:STDOUT: %impl.elem0.loc4_24: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc4_24: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc4_24: = bound_method %int_10, %impl.elem0.loc4_24 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc4_24: = specific_function %Convert.bound.loc4_24, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc4_24: init %i32 = call %Convert.specific_fn.loc4_24(%int_10) [template = constants.%int_10.2] // CHECK:STDOUT: %.loc4_24.1: %i32 = value_of_initializer %int.convert_checked.loc4_24 [template = constants.%int_10.2] // CHECK:STDOUT: %.loc4_24.2: %i32 = converted %int_10, %.loc4_24.1 [template = constants.%int_10.2] // CHECK:STDOUT: %int.xor: init %i32 = call %Xor.ref(%.loc4_20.2, %.loc4_24.2) [template = constants.%int_6.1] -// CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_signed.loc4 [template = constants.%i32] -// CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_signed.loc4, %.loc4_11.1 [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc4_26: %Convert.type.6 = interface_witness_access constants.%interface.10, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %impl.elem0.loc4_26: %Convert.type.5 = interface_witness_access constants.%interface.6, element0 [template = constants.%Convert.11] // CHECK:STDOUT: %Convert.bound.loc4_26: = bound_method %int.xor, %impl.elem0.loc4_26 [template = constants.%Convert.bound.3] -// CHECK:STDOUT: %Convert.specific_fn.loc4_26: = specific_function %Convert.bound.loc4_26, @Convert.4(constants.%int_32) [template = constants.%Convert.specific_fn.3] +// CHECK:STDOUT: %Convert.specific_fn.loc4_26: = specific_function %Convert.bound.loc4_26, @Convert.3(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %.loc4_26.1: %i32 = value_of_initializer %int.xor [template = constants.%int_6.1] // CHECK:STDOUT: %.loc4_26.2: %i32 = converted %int.xor, %.loc4_26.1 [template = constants.%int_6.1] // CHECK:STDOUT: %int.convert_checked.loc4_26: init Core.IntLiteral = call %Convert.specific_fn.loc4_26(%.loc4_26.2) [template = constants.%int_6.2] @@ -131,10 +121,8 @@ fn RuntimeCall(a: i32, b: i32) -> i32 { // CHECK:STDOUT: %arr.var: ref %array_type = var arr // CHECK:STDOUT: %arr: ref %array_type = bind_name arr, %arr.var // CHECK:STDOUT: %int_32.loc5: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc5: init type = call constants.%Int(%int_32.loc5) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc5: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_6: Core.IntLiteral = int_value 6 [template = constants.%int_6.2] -// CHECK:STDOUT: %.loc5_13.1: type = value_of_initializer %int.make_type_signed.loc5 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_13.2: type = converted %int.make_type_signed.loc5, %.loc5_13.1 [template = constants.%i32] // CHECK:STDOUT: %array_type.loc5: type = array_type %int_6, %i32 [template = constants.%array_type] // CHECK:STDOUT: %ptr: type = ptr_type %array_type [template = constants.%ptr] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { @@ -146,17 +134,11 @@ fn RuntimeCall(a: i32, b: i32) -> i32 { // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc7_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc7_19: init type = call constants.%Int(%int_32.loc7_19) [template = constants.%i32] -// CHECK:STDOUT: %.loc7_19.1: type = value_of_initializer %int.make_type_signed.loc7_19 [template = constants.%i32] -// CHECK:STDOUT: %.loc7_19.2: type = converted %int.make_type_signed.loc7_19, %.loc7_19.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc7_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc7_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc7_27: init type = call constants.%Int(%int_32.loc7_27) [template = constants.%i32] -// CHECK:STDOUT: %.loc7_27.1: type = value_of_initializer %int.make_type_signed.loc7_27 [template = constants.%i32] -// CHECK:STDOUT: %.loc7_27.2: type = converted %int.make_type_signed.loc7_27, %.loc7_27.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc7_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc7_35: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc7_35: init type = call constants.%Int(%int_32.loc7_35) [template = constants.%i32] -// CHECK:STDOUT: %.loc7_35.1: type = value_of_initializer %int.make_type_signed.loc7_35 [template = constants.%i32] -// CHECK:STDOUT: %.loc7_35.2: type = converted %int.make_type_signed.loc7_35, %.loc7_35.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc7_35: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 diff --git a/toolchain/check/testdata/builtins/print.carbon b/toolchain/check/testdata/builtins/print.carbon index 1d7a4d4b27821..d321a0039bb49 100644 --- a/toolchain/check/testdata/builtins/print.carbon +++ b/toolchain/check/testdata/builtins/print.carbon @@ -20,26 +20,24 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %Print.type.1: type = fn_type @Print.1 [template] // CHECK:STDOUT: %Print.1: %Print.type.1 = struct_value () [template] // CHECK:STDOUT: %Main.type: type = fn_type @Main [template] // CHECK:STDOUT: %Main: %Main.type = struct_value () [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] // CHECK:STDOUT: %Print.type.2: type = fn_type @Print.2 [template] // CHECK:STDOUT: %Print.2: %Print.type.2 = struct_value () [template] // CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] // CHECK:STDOUT: } @@ -47,12 +45,12 @@ fn Main() { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 -// CHECK:STDOUT: .Print = %import_ref.38 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 +// CHECK:STDOUT: .Print = %import_ref.193 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.38: %Print.type.2 = import_ref Core//prelude, Print, loaded [template = constants.%Print.2] +// CHECK:STDOUT: %import_ref.193: %Print.type.2 = import_ref Core//prelude, Print, loaded [template = constants.%Print.2] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -67,9 +65,7 @@ fn Main() { // CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_13.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc11_13.2: type = converted %int.make_type_signed, %.loc11_13.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: } @@ -82,7 +78,7 @@ fn Main() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Print.ref.loc14: %Print.type.1 = name_ref Print, file.%Print.decl [template = constants.%Print.1] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc14: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc14: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc14: = bound_method %int_1, %impl.elem0.loc14 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc14: = specific_function %Convert.bound.loc14, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc14: init %i32 = call %Convert.specific_fn.loc14(%int_1) [template = constants.%int_1.2] @@ -90,9 +86,9 @@ fn Main() { // CHECK:STDOUT: %.loc14_9.2: %i32 = converted %int_1, %.loc14_9.1 [template = constants.%int_1.2] // CHECK:STDOUT: %print.int.loc14: init %empty_tuple.type = call %Print.ref.loc14(%.loc14_9.2) // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] -// CHECK:STDOUT: %Print.ref.loc16: %Print.type.2 = name_ref Print, imports.%import_ref.38 [template = constants.%Print.2] +// CHECK:STDOUT: %Print.ref.loc16: %Print.type.2 = name_ref Print, imports.%import_ref.193 [template = constants.%Print.2] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %impl.elem0.loc16: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc16: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc16: = bound_method %int_2, %impl.elem0.loc16 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc16: = specific_function %Convert.bound.loc16, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc16: init %i32 = call %Convert.specific_fn.loc16(%int_2) [template = constants.%int_2.2] diff --git a/toolchain/check/testdata/class/access_modifers.carbon b/toolchain/check/testdata/class/access_modifers.carbon index f4e0fbf4cd241..14157472dd793 100644 --- a/toolchain/check/testdata/class/access_modifers.carbon +++ b/toolchain/check/testdata/class/access_modifers.carbon @@ -150,16 +150,14 @@ class A { // CHECK:STDOUT: constants { // CHECK:STDOUT: %Circle: type = class_type @Circle [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %Circle.elem: type = unbound_element_type %Circle, %i32 [template] // CHECK:STDOUT: %int_5.1: Core.IntLiteral = int_value 5 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_5.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_5.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_5.2: %i32 = int_value 5 [template] // CHECK:STDOUT: %SomeInternalFunction.type: type = fn_type @SomeInternalFunction [template] @@ -167,9 +165,9 @@ class A { // CHECK:STDOUT: %Make.type: type = fn_type @Make [template] // CHECK:STDOUT: %Make: %Make.type = struct_value () [template] // CHECK:STDOUT: %struct_type.radius.1: type = struct_type {.radius: %i32} [template] -// CHECK:STDOUT: %complete_type.3: = complete_type_witness %struct_type.radius.1 [template] +// CHECK:STDOUT: %complete_type.4: = complete_type_witness %struct_type.radius.1 [template] // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_0.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] // CHECK:STDOUT: %struct_type.radius.2: type = struct_type {.radius: Core.IntLiteral} [template] @@ -181,7 +179,7 @@ class A { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -200,16 +198,12 @@ class A { // CHECK:STDOUT: // CHECK:STDOUT: class @Circle { // CHECK:STDOUT: %int_32.loc5: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc5: init type = call constants.%Int(%int_32.loc5) [template = constants.%i32] -// CHECK:STDOUT: %.loc5_23.1: type = value_of_initializer %int.make_type_signed.loc5 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_23.2: type = converted %int.make_type_signed.loc5, %.loc5_23.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_21: %Circle.elem = field_decl radius, element0 [template] +// CHECK:STDOUT: %i32.loc5: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc5: %Circle.elem = field_decl radius, element0 [template] // CHECK:STDOUT: %int_32.loc6: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc6: init type = call constants.%Int(%int_32.loc6) [template = constants.%i32] -// CHECK:STDOUT: %.loc6_39.1: type = value_of_initializer %int.make_type_signed.loc6 [template = constants.%i32] -// CHECK:STDOUT: %.loc6_39.2: type = converted %int.make_type_signed.loc6, %.loc6_39.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc6: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_5: Core.IntLiteral = int_value 5 [template = constants.%int_5.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_5, %impl.elem0 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_5) [template = constants.%int_5.2] @@ -221,9 +215,7 @@ class A { // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc8_40.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc8_40.2: type = converted %int.make_type_signed, %.loc8_40.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } @@ -235,11 +227,11 @@ class A { // CHECK:STDOUT: %return.param: ref %Circle = out_param runtime_param0 // CHECK:STDOUT: %return: ref %Circle = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.radius.1 [template = constants.%complete_type.3] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.radius.1 [template = constants.%complete_type.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Circle -// CHECK:STDOUT: .radius [private] = %.loc5_21 +// CHECK:STDOUT: .radius [private] = %.loc5 // CHECK:STDOUT: .SOME_INTERNAL_CONSTANT [private] = %SOME_INTERNAL_CONSTANT // CHECK:STDOUT: .SomeInternalFunction [private] = %SomeInternalFunction.decl // CHECK:STDOUT: .Make = %Make.decl @@ -249,7 +241,7 @@ class A { // CHECK:STDOUT: fn @SomeInternalFunction() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.2] @@ -262,7 +254,7 @@ class A { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_5: Core.IntLiteral = int_value 5 [template = constants.%int_5.1] // CHECK:STDOUT: %.loc13_24.1: %struct_type.radius.2 = struct_literal (%int_5) -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_5, %impl.elem0 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_5) [template = constants.%int_5.2] @@ -285,9 +277,7 @@ class A { // CHECK:STDOUT: %.loc18_36.3: %Circle = bind_value %.loc18_36.2 // CHECK:STDOUT: %circle: %Circle = bind_name circle, %.loc18_36.3 // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc26_15.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc26_15.2: type = converted %int.make_type_signed, %.loc26_15.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %circle.ref.loc26: %Circle = name_ref circle, %circle // CHECK:STDOUT: %radius.ref.loc26: = name_ref radius, [template = ] // CHECK:STDOUT: %radius: %i32 = bind_name radius, @@ -307,19 +297,17 @@ class A { // CHECK:STDOUT: constants { // CHECK:STDOUT: %A: type = class_type @A [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %A.elem: type = unbound_element_type %A, %i32 [template] // CHECK:STDOUT: %struct_type.x: type = struct_type {.x: %i32} [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.x [template] +// CHECK:STDOUT: %complete_type.3: = complete_type_witness %struct_type.x [template] // CHECK:STDOUT: %Run.type: type = fn_type @Run [template] // CHECK:STDOUT: %Run: %Run.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -338,24 +326,20 @@ class A { // CHECK:STDOUT: // CHECK:STDOUT: class @A { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc5_20.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc5_20.2: type = converted %int.make_type_signed, %.loc5_20.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_18: %A.elem = field_decl x, element0 [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.x [template = constants.%complete_type] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc5: %A.elem = field_decl x, element0 [template] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.x [template = constants.%complete_type.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%A -// CHECK:STDOUT: .x [protected] = %.loc5_18 +// CHECK:STDOUT: .x [protected] = %.loc5 // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Run() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc16_10.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc16_10.2: type = converted %int.make_type_signed, %.loc16_10.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%A] // CHECK:STDOUT: %x.ref: = name_ref x, [template = ] // CHECK:STDOUT: %x: %i32 = bind_name x, @@ -367,9 +351,7 @@ class A { // CHECK:STDOUT: constants { // CHECK:STDOUT: %Circle: type = class_type @Circle [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %Circle.elem: type = unbound_element_type %Circle, %i32 [template] // CHECK:STDOUT: %GetRadius.type: type = fn_type @GetRadius [template] // CHECK:STDOUT: %GetRadius: %GetRadius.type = struct_value () [template] @@ -378,13 +360,13 @@ class A { // CHECK:STDOUT: %Compute.type: type = fn_type @Compute [template] // CHECK:STDOUT: %Compute: %Compute.type = struct_value () [template] // CHECK:STDOUT: %struct_type.radius: type = struct_type {.radius: %i32} [template] -// CHECK:STDOUT: %complete_type.1: = complete_type_witness %struct_type.radius [template] +// CHECK:STDOUT: %complete_type.3: = complete_type_witness %struct_type.radius [template] // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] // CHECK:STDOUT: } @@ -392,7 +374,7 @@ class A { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -409,10 +391,8 @@ class A { // CHECK:STDOUT: // CHECK:STDOUT: class @Circle { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc5_23.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc5_23.2: type = converted %int.make_type_signed, %.loc5_23.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_21: %Circle.elem = field_decl radius, element0 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc5: %Circle.elem = field_decl radius, element0 [template] // CHECK:STDOUT: %GetRadius.decl: %GetRadius.type = fn_decl @GetRadius [template = constants.%GetRadius] { // CHECK:STDOUT: %self.patt: %Circle = binding_pattern self // CHECK:STDOUT: %self.param_patt: %Circle = value_param_pattern %self.patt, runtime_param0 @@ -421,9 +401,7 @@ class A { // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Circle [template = constants.%Circle] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc7_33.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc7_33.2: type = converted %int.make_type_signed, %.loc7_33.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %self.param: %Circle = value_param runtime_param0 // CHECK:STDOUT: %self: %Circle = bind_name self, %self.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 @@ -434,9 +412,7 @@ class A { // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_40.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc11_40.2: type = converted %int.make_type_signed, %.loc11_40.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } @@ -448,19 +424,17 @@ class A { // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Circle [template = constants.%Circle] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc15_31.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc15_31.2: type = converted %int.make_type_signed, %.loc15_31.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %self.param: %Circle = value_param runtime_param0 // CHECK:STDOUT: %self: %Circle = bind_name self, %self.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.radius [template = constants.%complete_type.1] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.radius [template = constants.%complete_type.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Circle -// CHECK:STDOUT: .radius [private] = %.loc5_21 +// CHECK:STDOUT: .radius [private] = %.loc5 // CHECK:STDOUT: .GetRadius = %GetRadius.decl // CHECK:STDOUT: .SomeInternalFunction [private] = %SomeInternalFunction.decl // CHECK:STDOUT: .Compute = %Compute.decl @@ -470,7 +444,7 @@ class A { // CHECK:STDOUT: fn @GetRadius[%self.param_patt: %Circle]() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %self.ref: %Circle = name_ref self, %self -// CHECK:STDOUT: %radius.ref: %Circle.elem = name_ref radius, @Circle.%.loc5_21 [template = @Circle.%.loc5_21] +// CHECK:STDOUT: %radius.ref: %Circle.elem = name_ref radius, @Circle.%.loc5 [template = @Circle.%.loc5] // CHECK:STDOUT: %.loc8_16.1: ref %i32 = class_element_access %self.ref, element0 // CHECK:STDOUT: %.loc8_16.2: %i32 = bind_value %.loc8_16.1 // CHECK:STDOUT: return %.loc8_16.2 @@ -479,7 +453,7 @@ class A { // CHECK:STDOUT: fn @SomeInternalFunction() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.2] @@ -503,25 +477,23 @@ class A { // CHECK:STDOUT: constants { // CHECK:STDOUT: %A: type = class_type @A [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %int_5.1: Core.IntLiteral = int_value 5 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_5.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound: = bound_method %int_5.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_5.2: %i32 = int_value 5 [template] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] -// CHECK:STDOUT: %complete_type.3: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %complete_type.4: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -536,25 +508,21 @@ class A { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %A.decl: type = class_decl @A [template = constants.%A] {} {} // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc8_8.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc8_8.2: type = converted %int.make_type_signed, %.loc8_8.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @A { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc5_10.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc5_10.2: type = converted %int.make_type_signed, %.loc5_10.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_5: Core.IntLiteral = int_value 5 [template = constants.%int_5.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_5, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_5) [template = constants.%int_5.2] // CHECK:STDOUT: %.loc5_17.1: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_5.2] // CHECK:STDOUT: %.loc5_17.2: %i32 = converted %int_5, %.loc5_17.1 [template = constants.%int_5.2] // CHECK:STDOUT: %x: %i32 = bind_name x, %.loc5_17.2 -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.3] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%A @@ -575,25 +543,23 @@ class A { // CHECK:STDOUT: constants { // CHECK:STDOUT: %A: type = class_type @A [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %int_5.1: Core.IntLiteral = int_value 5 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_5.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound: = bound_method %int_5.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_5.2: %i32 = int_value 5 [template] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] -// CHECK:STDOUT: %complete_type.3: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %complete_type.4: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -609,22 +575,16 @@ class A { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %A.decl: type = class_decl @A [template = constants.%A] {} {} // CHECK:STDOUT: %int_32.loc16: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc16: init type = call constants.%Int(%int_32.loc16) [template = constants.%i32] -// CHECK:STDOUT: %.loc16_8.1: type = value_of_initializer %int.make_type_signed.loc16 [template = constants.%i32] -// CHECK:STDOUT: %.loc16_8.2: type = converted %int.make_type_signed.loc16, %.loc16_8.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc16: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc23: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc23: init type = call constants.%Int(%int_32.loc23) [template = constants.%i32] -// CHECK:STDOUT: %.loc23_8.1: type = value_of_initializer %int.make_type_signed.loc23 [template = constants.%i32] -// CHECK:STDOUT: %.loc23_8.2: type = converted %int.make_type_signed.loc23, %.loc23_8.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc23: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @A { // CHECK:STDOUT: %int_32.loc5: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc5: init type = call constants.%Int(%int_32.loc5) [template = constants.%i32] -// CHECK:STDOUT: %.loc5_20.1: type = value_of_initializer %int.make_type_signed.loc5 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_20.2: type = converted %int.make_type_signed.loc5, %.loc5_20.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc5: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_5.loc5: Core.IntLiteral = int_value 5 [template = constants.%int_5.1] -// CHECK:STDOUT: %impl.elem0.loc5: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc5: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc5: = bound_method %int_5.loc5, %impl.elem0.loc5 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn.loc5: = specific_function %Convert.bound.loc5, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc5: init %i32 = call %Convert.specific_fn.loc5(%int_5.loc5) [template = constants.%int_5.2] @@ -632,18 +592,16 @@ class A { // CHECK:STDOUT: %.loc5_27.2: %i32 = converted %int_5.loc5, %.loc5_27.1 [template = constants.%int_5.2] // CHECK:STDOUT: %x: %i32 = bind_name x, %.loc5_27.2 // CHECK:STDOUT: %int_32.loc6: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc6: init type = call constants.%Int(%int_32.loc6) [template = constants.%i32] -// CHECK:STDOUT: %.loc6_18.1: type = value_of_initializer %int.make_type_signed.loc6 [template = constants.%i32] -// CHECK:STDOUT: %.loc6_18.2: type = converted %int.make_type_signed.loc6, %.loc6_18.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc6: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_5.loc6: Core.IntLiteral = int_value 5 [template = constants.%int_5.1] -// CHECK:STDOUT: %impl.elem0.loc6: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc6: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc6: = bound_method %int_5.loc6, %impl.elem0.loc6 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn.loc6: = specific_function %Convert.bound.loc6, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc6: init %i32 = call %Convert.specific_fn.loc6(%int_5.loc6) [template = constants.%int_5.2] // CHECK:STDOUT: %.loc6_25.1: %i32 = value_of_initializer %int.convert_checked.loc6 [template = constants.%int_5.2] // CHECK:STDOUT: %.loc6_25.2: %i32 = converted %int_5.loc6, %.loc6_25.1 [template = constants.%int_5.2] // CHECK:STDOUT: %y: %i32 = bind_name y, %.loc6_25.2 -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.3] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%A diff --git a/toolchain/check/testdata/class/adapter/adapt.carbon b/toolchain/check/testdata/class/adapter/adapt.carbon index 6a2e359b1e517..9799d4dfe38c8 100644 --- a/toolchain/check/testdata/class/adapter/adapt.carbon +++ b/toolchain/check/testdata/class/adapter/adapt.carbon @@ -50,19 +50,17 @@ fn F(a: AdaptNotExtend) { // CHECK:STDOUT: constants { // CHECK:STDOUT: %SomeClass: type = class_type @SomeClass [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %SomeClass.elem: type = unbound_element_type %SomeClass, %i32 [template] // CHECK:STDOUT: %struct_type.a.b: type = struct_type {.a: %i32, .b: %i32} [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a.b [template] +// CHECK:STDOUT: %complete_type.3: = complete_type_witness %struct_type.a.b [template] // CHECK:STDOUT: %SomeClassAdapter: type = class_type @SomeClassAdapter [template] // CHECK:STDOUT: %StructAdapter: type = class_type @StructAdapter [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -83,28 +81,24 @@ fn F(a: AdaptNotExtend) { // CHECK:STDOUT: // CHECK:STDOUT: class @SomeClass { // CHECK:STDOUT: %int_32.loc5: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc5: init type = call constants.%Int(%int_32.loc5) [template = constants.%i32] -// CHECK:STDOUT: %.loc5_10.1: type = value_of_initializer %int.make_type_signed.loc5 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_10.2: type = converted %int.make_type_signed.loc5, %.loc5_10.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_8: %SomeClass.elem = field_decl a, element0 [template] +// CHECK:STDOUT: %i32.loc5: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc5: %SomeClass.elem = field_decl a, element0 [template] // CHECK:STDOUT: %int_32.loc6: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc6: init type = call constants.%Int(%int_32.loc6) [template = constants.%i32] -// CHECK:STDOUT: %.loc6_10.1: type = value_of_initializer %int.make_type_signed.loc6 [template = constants.%i32] -// CHECK:STDOUT: %.loc6_10.2: type = converted %int.make_type_signed.loc6, %.loc6_10.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc6_8: %SomeClass.elem = field_decl b, element1 [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a.b [template = constants.%complete_type] +// CHECK:STDOUT: %i32.loc6: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc6: %SomeClass.elem = field_decl b, element1 [template] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a.b [template = constants.%complete_type.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%SomeClass -// CHECK:STDOUT: .a = %.loc5_8 -// CHECK:STDOUT: .b = %.loc6_8 +// CHECK:STDOUT: .a = %.loc5 +// CHECK:STDOUT: .b = %.loc6 // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @SomeClassAdapter { // CHECK:STDOUT: %SomeClass.ref: type = name_ref SomeClass, file.%SomeClass.decl [template = constants.%SomeClass] // CHECK:STDOUT: adapt_decl %SomeClass.ref [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a.b [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a.b [template = constants.%complete_type.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%SomeClassAdapter @@ -113,16 +107,12 @@ fn F(a: AdaptNotExtend) { // CHECK:STDOUT: // CHECK:STDOUT: class @StructAdapter { // CHECK:STDOUT: %int_32.loc14_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc14_14: init type = call constants.%Int(%int_32.loc14_14) [template = constants.%i32] -// CHECK:STDOUT: %.loc14_14.1: type = value_of_initializer %int.make_type_signed.loc14_14 [template = constants.%i32] -// CHECK:STDOUT: %.loc14_14.2: type = converted %int.make_type_signed.loc14_14, %.loc14_14.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc14_14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc14_23: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc14_23: init type = call constants.%Int(%int_32.loc14_23) [template = constants.%i32] -// CHECK:STDOUT: %.loc14_23.1: type = value_of_initializer %int.make_type_signed.loc14_23 [template = constants.%i32] -// CHECK:STDOUT: %.loc14_23.2: type = converted %int.make_type_signed.loc14_23, %.loc14_23.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc14_23: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %struct_type.a.b: type = struct_type {.a: %i32, .b: %i32} [template = constants.%struct_type.a.b] // CHECK:STDOUT: adapt_decl %struct_type.a.b [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a.b [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a.b [template = constants.%complete_type.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%StructAdapter diff --git a/toolchain/check/testdata/class/adapter/adapt_copy.carbon b/toolchain/check/testdata/class/adapter/adapt_copy.carbon index f5b29484f8ee0..4c36fadfdfbba 100644 --- a/toolchain/check/testdata/class/adapter/adapt_copy.carbon +++ b/toolchain/check/testdata/class/adapter/adapt_copy.carbon @@ -105,10 +105,9 @@ fn H(a: AdaptNoncopyableIndirect) -> AdaptNoncopyableIndirect { // CHECK:STDOUT: constants { // CHECK:STDOUT: %AdaptCopyable: type = class_type @AdaptCopyable [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %i32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] +// CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %complete_type.2: = complete_type_witness %i32.builtin [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (type, type) [template] @@ -119,7 +118,7 @@ fn H(a: AdaptNoncopyableIndirect) -> AdaptNoncopyableIndirect { // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -155,18 +154,14 @@ fn H(a: AdaptNoncopyableIndirect) -> AdaptNoncopyableIndirect { // CHECK:STDOUT: } { // CHECK:STDOUT: %AdaptCopyable.ref.loc15_16: type = name_ref AdaptCopyable, file.%AdaptCopyable.decl [template = constants.%AdaptCopyable] // CHECK:STDOUT: %int_32.loc15_31: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc15_31: init type = call constants.%Int(%int_32.loc15_31) [template = constants.%i32] -// CHECK:STDOUT: %.loc15_34.1: %tuple.type.1 = tuple_literal (%AdaptCopyable.ref.loc15_16, %int.make_type_signed.loc15_31) -// CHECK:STDOUT: %.loc15_34.2: type = value_of_initializer %int.make_type_signed.loc15_31 [template = constants.%i32] -// CHECK:STDOUT: %.loc15_34.3: type = converted %int.make_type_signed.loc15_31, %.loc15_34.2 [template = constants.%i32] -// CHECK:STDOUT: %.loc15_34.4: type = converted %.loc15_34.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] +// CHECK:STDOUT: %i32.loc15_31: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc15_34.1: %tuple.type.1 = tuple_literal (%AdaptCopyable.ref.loc15_16, %i32.loc15_31) +// CHECK:STDOUT: %.loc15_34.2: type = converted %.loc15_34.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %AdaptCopyable.ref.loc15_41: type = name_ref AdaptCopyable, file.%AdaptCopyable.decl [template = constants.%AdaptCopyable] // CHECK:STDOUT: %int_32.loc15_56: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc15_56: init type = call constants.%Int(%int_32.loc15_56) [template = constants.%i32] -// CHECK:STDOUT: %.loc15_59.1: %tuple.type.1 = tuple_literal (%AdaptCopyable.ref.loc15_41, %int.make_type_signed.loc15_56) -// CHECK:STDOUT: %.loc15_59.2: type = value_of_initializer %int.make_type_signed.loc15_56 [template = constants.%i32] -// CHECK:STDOUT: %.loc15_59.3: type = converted %int.make_type_signed.loc15_56, %.loc15_59.2 [template = constants.%i32] -// CHECK:STDOUT: %.loc15_59.4: type = converted %.loc15_59.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] +// CHECK:STDOUT: %i32.loc15_56: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc15_59.1: %tuple.type.1 = tuple_literal (%AdaptCopyable.ref.loc15_41, %i32.loc15_56) +// CHECK:STDOUT: %.loc15_59.2: type = converted %.loc15_59.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %c.param: %tuple.type.2 = value_param runtime_param0 // CHECK:STDOUT: %c: %tuple.type.2 = bind_name c, %c.param // CHECK:STDOUT: %return.param: ref %tuple.type.2 = out_param runtime_param1 @@ -176,11 +171,9 @@ fn H(a: AdaptNoncopyableIndirect) -> AdaptNoncopyableIndirect { // CHECK:STDOUT: // CHECK:STDOUT: class @AdaptCopyable { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc5_12.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc5_12.2: type = converted %int.make_type_signed, %.loc5_12.1 [template = constants.%i32] -// CHECK:STDOUT: adapt_decl %.loc5_12.2 [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %i32 [template = constants.%complete_type] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: adapt_decl %i32 [template] +// CHECK:STDOUT: %complete_type: = complete_type_witness %i32.builtin [template = constants.%complete_type.2] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%AdaptCopyable @@ -203,11 +196,9 @@ fn H(a: AdaptNoncopyableIndirect) -> AdaptNoncopyableIndirect { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %AdaptCopyable.ref.loc16: type = name_ref AdaptCopyable, file.%AdaptCopyable.decl [template = constants.%AdaptCopyable] // CHECK:STDOUT: %int_32.loc16: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc16: init type = call constants.%Int(%int_32.loc16) [template = constants.%i32] -// CHECK:STDOUT: %.loc16_29.1: %tuple.type.1 = tuple_literal (%AdaptCopyable.ref.loc16, %int.make_type_signed.loc16) -// CHECK:STDOUT: %.loc16_29.2: type = value_of_initializer %int.make_type_signed.loc16 [template = constants.%i32] -// CHECK:STDOUT: %.loc16_29.3: type = converted %int.make_type_signed.loc16, %.loc16_29.2 [template = constants.%i32] -// CHECK:STDOUT: %.loc16_29.4: type = converted %.loc16_29.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] +// CHECK:STDOUT: %i32.loc16: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc16_29.1: %tuple.type.1 = tuple_literal (%AdaptCopyable.ref.loc16, %i32.loc16) +// CHECK:STDOUT: %.loc16_29.2: type = converted %.loc16_29.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %d.var: ref %tuple.type.2 = var d // CHECK:STDOUT: %d: ref %tuple.type.2 = bind_name d, %d.var // CHECK:STDOUT: %c.ref: %tuple.type.2 = name_ref c, %c @@ -239,19 +230,17 @@ fn H(a: AdaptNoncopyableIndirect) -> AdaptNoncopyableIndirect { // CHECK:STDOUT: constants { // CHECK:STDOUT: %AdaptTuple: type = class_type @AdaptTuple [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (type, type) [template] // CHECK:STDOUT: %tuple.type.2: type = tuple_type (%i32, %i32) [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %tuple.type.2 [template] +// CHECK:STDOUT: %complete_type.3: = complete_type_witness %tuple.type.2 [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -282,17 +271,13 @@ fn H(a: AdaptNoncopyableIndirect) -> AdaptNoncopyableIndirect { // CHECK:STDOUT: // CHECK:STDOUT: class @AdaptTuple { // CHECK:STDOUT: %int_32.loc5_10: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc5_10: init type = call constants.%Int(%int_32.loc5_10) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc5_10: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc5_15: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc5_15: init type = call constants.%Int(%int_32.loc5_15) [template = constants.%i32] -// CHECK:STDOUT: %.loc5_18: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc5_10, %int.make_type_signed.loc5_15) -// CHECK:STDOUT: %.loc5_19.1: type = value_of_initializer %int.make_type_signed.loc5_10 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_19.2: type = converted %int.make_type_signed.loc5_10, %.loc5_19.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_19.3: type = value_of_initializer %int.make_type_signed.loc5_15 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_19.4: type = converted %int.make_type_signed.loc5_15, %.loc5_19.3 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_19.5: type = converted %.loc5_18, constants.%tuple.type.2 [template = constants.%tuple.type.2] -// CHECK:STDOUT: adapt_decl %.loc5_19.5 [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %tuple.type.2 [template = constants.%complete_type] +// CHECK:STDOUT: %i32.loc5_15: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc5_18: %tuple.type.1 = tuple_literal (%i32.loc5_10, %i32.loc5_15) +// CHECK:STDOUT: %.loc5_19: type = converted %.loc5_18, constants.%tuple.type.2 [template = constants.%tuple.type.2] +// CHECK:STDOUT: adapt_decl %.loc5_19 [template] +// CHECK:STDOUT: %complete_type: = complete_type_witness %tuple.type.2 [template = constants.%complete_type.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%AdaptTuple @@ -392,19 +377,17 @@ fn H(a: AdaptNoncopyableIndirect) -> AdaptNoncopyableIndirect { // CHECK:STDOUT: %complete_type.1: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %AdaptNoncopyableIndirect: type = class_type @AdaptNoncopyableIndirect [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (type, type, type) [template] // CHECK:STDOUT: %tuple.type.2: type = tuple_type (%i32, %Noncopyable, %i32) [template] -// CHECK:STDOUT: %complete_type.2: = complete_type_witness %tuple.type.2 [template] +// CHECK:STDOUT: %complete_type.4: = complete_type_witness %tuple.type.2 [template] // CHECK:STDOUT: %H.type: type = fn_type @H [template] // CHECK:STDOUT: %H: %H.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -445,18 +428,14 @@ fn H(a: AdaptNoncopyableIndirect) -> AdaptNoncopyableIndirect { // CHECK:STDOUT: // CHECK:STDOUT: class @AdaptNoncopyableIndirect { // CHECK:STDOUT: %int_32.loc9_10: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc9_10: init type = call constants.%Int(%int_32.loc9_10) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc9_10: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %Noncopyable.ref: type = name_ref Noncopyable, file.%Noncopyable.decl [template = constants.%Noncopyable] // CHECK:STDOUT: %int_32.loc9_28: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc9_28: init type = call constants.%Int(%int_32.loc9_28) [template = constants.%i32] -// CHECK:STDOUT: %.loc9_31: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc9_10, %Noncopyable.ref, %int.make_type_signed.loc9_28) -// CHECK:STDOUT: %.loc9_32.1: type = value_of_initializer %int.make_type_signed.loc9_10 [template = constants.%i32] -// CHECK:STDOUT: %.loc9_32.2: type = converted %int.make_type_signed.loc9_10, %.loc9_32.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc9_32.3: type = value_of_initializer %int.make_type_signed.loc9_28 [template = constants.%i32] -// CHECK:STDOUT: %.loc9_32.4: type = converted %int.make_type_signed.loc9_28, %.loc9_32.3 [template = constants.%i32] -// CHECK:STDOUT: %.loc9_32.5: type = converted %.loc9_31, constants.%tuple.type.2 [template = constants.%tuple.type.2] -// CHECK:STDOUT: adapt_decl %.loc9_32.5 [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %tuple.type.2 [template = constants.%complete_type.2] +// CHECK:STDOUT: %i32.loc9_28: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc9_31: %tuple.type.1 = tuple_literal (%i32.loc9_10, %Noncopyable.ref, %i32.loc9_28) +// CHECK:STDOUT: %.loc9_32: type = converted %.loc9_31, constants.%tuple.type.2 [template = constants.%tuple.type.2] +// CHECK:STDOUT: adapt_decl %.loc9_32 [template] +// CHECK:STDOUT: %complete_type: = complete_type_witness %tuple.type.2 [template = constants.%complete_type.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%AdaptNoncopyableIndirect diff --git a/toolchain/check/testdata/class/adapter/extend_adapt.carbon b/toolchain/check/testdata/class/adapter/extend_adapt.carbon index 3959adb39ad26..3c624e91a6c7d 100644 --- a/toolchain/check/testdata/class/adapter/extend_adapt.carbon +++ b/toolchain/check/testdata/class/adapter/extend_adapt.carbon @@ -143,17 +143,15 @@ fn F(a: IntAdapter) -> i32 { // CHECK:STDOUT: %SomeClassAdapter: type = class_type @SomeClassAdapter [template] // CHECK:STDOUT: %SomeClass: type = class_type @SomeClass [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %SomeClass.elem: type = unbound_element_type %SomeClass, %i32 [template] // CHECK:STDOUT: %StaticMemberFunction.type: type = fn_type @StaticMemberFunction [template] // CHECK:STDOUT: %StaticMemberFunction: %StaticMemberFunction.type = struct_value () [template] // CHECK:STDOUT: %AdapterMethod.type: type = fn_type @AdapterMethod [template] // CHECK:STDOUT: %AdapterMethod: %AdapterMethod.type = struct_value () [template] // CHECK:STDOUT: %struct_type.a.b: type = struct_type {.a: %i32, .b: %i32} [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a.b [template] +// CHECK:STDOUT: %complete_type.3: = complete_type_witness %struct_type.a.b [template] // CHECK:STDOUT: %TestStaticMemberFunction.type: type = fn_type @TestStaticMemberFunction [template] // CHECK:STDOUT: %TestStaticMemberFunction: %TestStaticMemberFunction.type = struct_value () [template] // CHECK:STDOUT: %TestAdapterMethod.type: type = fn_type @TestAdapterMethod [template] @@ -162,7 +160,7 @@ fn F(a: IntAdapter) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -201,7 +199,7 @@ fn F(a: IntAdapter) -> i32 { // CHECK:STDOUT: class @SomeClassAdapter { // CHECK:STDOUT: %SomeClass.ref: type = name_ref SomeClass, file.%SomeClass.decl [template = constants.%SomeClass] // CHECK:STDOUT: adapt_decl %SomeClass.ref [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a.b [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a.b [template = constants.%complete_type.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%SomeClassAdapter @@ -211,15 +209,11 @@ fn F(a: IntAdapter) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: class @SomeClass { // CHECK:STDOUT: %int_32.loc7: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc7: init type = call constants.%Int(%int_32.loc7) [template = constants.%i32] -// CHECK:STDOUT: %.loc7_10.1: type = value_of_initializer %int.make_type_signed.loc7 [template = constants.%i32] -// CHECK:STDOUT: %.loc7_10.2: type = converted %int.make_type_signed.loc7, %.loc7_10.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc7_8: %SomeClass.elem = field_decl a, element0 [template] +// CHECK:STDOUT: %i32.loc7: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc7: %SomeClass.elem = field_decl a, element0 [template] // CHECK:STDOUT: %int_32.loc8: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc8: init type = call constants.%Int(%int_32.loc8) [template = constants.%i32] -// CHECK:STDOUT: %.loc8_10.1: type = value_of_initializer %int.make_type_signed.loc8 [template = constants.%i32] -// CHECK:STDOUT: %.loc8_10.2: type = converted %int.make_type_signed.loc8, %.loc8_10.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc8_8: %SomeClass.elem = field_decl b, element1 [template] +// CHECK:STDOUT: %i32.loc8: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc8: %SomeClass.elem = field_decl b, element1 [template] // CHECK:STDOUT: %StaticMemberFunction.decl: %StaticMemberFunction.type = fn_decl @StaticMemberFunction [template = constants.%StaticMemberFunction] {} {} // CHECK:STDOUT: %AdapterMethod.decl: %AdapterMethod.type = fn_decl @AdapterMethod [template = constants.%AdapterMethod] { // CHECK:STDOUT: %self.patt: %SomeClassAdapter = binding_pattern self @@ -229,12 +223,12 @@ fn F(a: IntAdapter) -> i32 { // CHECK:STDOUT: %self.param: %SomeClassAdapter = value_param runtime_param0 // CHECK:STDOUT: %self: %SomeClassAdapter = bind_name self, %self.param // CHECK:STDOUT: } -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a.b [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a.b [template = constants.%complete_type.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%SomeClass -// CHECK:STDOUT: .a = %.loc7_8 -// CHECK:STDOUT: .b = %.loc8_8 +// CHECK:STDOUT: .a = %.loc7 +// CHECK:STDOUT: .b = %.loc8 // CHECK:STDOUT: .StaticMemberFunction = %StaticMemberFunction.decl // CHECK:STDOUT: .AdapterMethod = %AdapterMethod.decl // CHECK:STDOUT: complete_type_witness = %complete_type @@ -348,12 +342,10 @@ fn F(a: IntAdapter) -> i32 { // CHECK:STDOUT: constants { // CHECK:STDOUT: %SomeClass: type = class_type @SomeClass [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %SomeClass.elem: type = unbound_element_type %SomeClass, %i32 [template] // CHECK:STDOUT: %struct_type.a.b: type = struct_type {.a: %i32, .b: %i32} [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a.b [template] +// CHECK:STDOUT: %complete_type.3: = complete_type_witness %struct_type.a.b [template] // CHECK:STDOUT: %SomeClassAdapter: type = class_type @SomeClassAdapter [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] @@ -362,7 +354,7 @@ fn F(a: IntAdapter) -> i32 { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -386,9 +378,7 @@ fn F(a: IntAdapter) -> i32 { // CHECK:STDOUT: } { // CHECK:STDOUT: %SomeClassAdapter.ref: type = name_ref SomeClassAdapter, file.%SomeClassAdapter.decl [template = constants.%SomeClassAdapter] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc13_30.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc13_30.2: type = converted %int.make_type_signed, %.loc13_30.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %SomeClassAdapter = value_param runtime_param0 // CHECK:STDOUT: %a: %SomeClassAdapter = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 @@ -398,28 +388,24 @@ fn F(a: IntAdapter) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: class @SomeClass { // CHECK:STDOUT: %int_32.loc5: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc5: init type = call constants.%Int(%int_32.loc5) [template = constants.%i32] -// CHECK:STDOUT: %.loc5_10.1: type = value_of_initializer %int.make_type_signed.loc5 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_10.2: type = converted %int.make_type_signed.loc5, %.loc5_10.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_8: %SomeClass.elem = field_decl a, element0 [template] +// CHECK:STDOUT: %i32.loc5: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc5: %SomeClass.elem = field_decl a, element0 [template] // CHECK:STDOUT: %int_32.loc6: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc6: init type = call constants.%Int(%int_32.loc6) [template = constants.%i32] -// CHECK:STDOUT: %.loc6_10.1: type = value_of_initializer %int.make_type_signed.loc6 [template = constants.%i32] -// CHECK:STDOUT: %.loc6_10.2: type = converted %int.make_type_signed.loc6, %.loc6_10.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc6_8: %SomeClass.elem = field_decl b, element1 [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a.b [template = constants.%complete_type] +// CHECK:STDOUT: %i32.loc6: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc6: %SomeClass.elem = field_decl b, element1 [template] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a.b [template = constants.%complete_type.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%SomeClass -// CHECK:STDOUT: .a = %.loc5_8 -// CHECK:STDOUT: .b = %.loc6_8 +// CHECK:STDOUT: .a = %.loc5 +// CHECK:STDOUT: .b = %.loc6 // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @SomeClassAdapter { // CHECK:STDOUT: %SomeClass.ref: type = name_ref SomeClass, file.%SomeClass.decl [template = constants.%SomeClass] // CHECK:STDOUT: adapt_decl %SomeClass.ref [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a.b [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a.b [template = constants.%complete_type.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%SomeClassAdapter @@ -430,7 +416,7 @@ fn F(a: IntAdapter) -> i32 { // CHECK:STDOUT: fn @F(%a.param_patt: %SomeClassAdapter) -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %SomeClassAdapter = name_ref a, %a -// CHECK:STDOUT: %b.ref: %SomeClass.elem = name_ref b, @SomeClass.%.loc6_8 [template = @SomeClass.%.loc6_8] +// CHECK:STDOUT: %b.ref: %SomeClass.elem = name_ref b, @SomeClass.%.loc6 [template = @SomeClass.%.loc6] // CHECK:STDOUT: %.loc21_11.1: %SomeClass = converted %a.ref, [template = ] // CHECK:STDOUT: %.loc21_11.2: %i32 = class_element_access , element1 [template = ] // CHECK:STDOUT: return @@ -441,18 +427,16 @@ fn F(a: IntAdapter) -> i32 { // CHECK:STDOUT: constants { // CHECK:STDOUT: %StructAdapter: type = class_type @StructAdapter [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %struct_type.a.b: type = struct_type {.a: %i32, .b: %i32} [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a.b [template] +// CHECK:STDOUT: %complete_type.3: = complete_type_witness %struct_type.a.b [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -474,9 +458,7 @@ fn F(a: IntAdapter) -> i32 { // CHECK:STDOUT: } { // CHECK:STDOUT: %StructAdapter.ref: type = name_ref StructAdapter, file.%StructAdapter.decl [template = constants.%StructAdapter] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc8_27.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc8_27.2: type = converted %int.make_type_signed, %.loc8_27.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %StructAdapter = value_param runtime_param0 // CHECK:STDOUT: %a: %StructAdapter = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 @@ -486,16 +468,12 @@ fn F(a: IntAdapter) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: class @StructAdapter { // CHECK:STDOUT: %int_32.loc5_21: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc5_21: init type = call constants.%Int(%int_32.loc5_21) [template = constants.%i32] -// CHECK:STDOUT: %.loc5_21.1: type = value_of_initializer %int.make_type_signed.loc5_21 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_21.2: type = converted %int.make_type_signed.loc5_21, %.loc5_21.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc5_21: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc5_30: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc5_30: init type = call constants.%Int(%int_32.loc5_30) [template = constants.%i32] -// CHECK:STDOUT: %.loc5_30.1: type = value_of_initializer %int.make_type_signed.loc5_30 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_30.2: type = converted %int.make_type_signed.loc5_30, %.loc5_30.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc5_30: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %struct_type.a.b: type = struct_type {.a: %i32, .b: %i32} [template = constants.%struct_type.a.b] // CHECK:STDOUT: adapt_decl %struct_type.a.b [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a.b [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a.b [template = constants.%complete_type.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%StructAdapter @@ -515,12 +493,10 @@ fn F(a: IntAdapter) -> i32 { // CHECK:STDOUT: constants { // CHECK:STDOUT: %TupleAdapter: type = class_type @TupleAdapter [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (type, type) [template] // CHECK:STDOUT: %tuple.type.2: type = tuple_type (%i32, %i32) [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %tuple.type.2 [template] +// CHECK:STDOUT: %complete_type.3: = complete_type_witness %tuple.type.2 [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template] @@ -528,7 +504,7 @@ fn F(a: IntAdapter) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -550,9 +526,7 @@ fn F(a: IntAdapter) -> i32 { // CHECK:STDOUT: } { // CHECK:STDOUT: %TupleAdapter.ref: type = name_ref TupleAdapter, file.%TupleAdapter.decl [template = constants.%TupleAdapter] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc8_26.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc8_26.2: type = converted %int.make_type_signed, %.loc8_26.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %TupleAdapter = value_param runtime_param0 // CHECK:STDOUT: %a: %TupleAdapter = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 @@ -562,21 +536,17 @@ fn F(a: IntAdapter) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: class @TupleAdapter { // CHECK:STDOUT: %int_32.loc5_17: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc5_17: init type = call constants.%Int(%int_32.loc5_17) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc5_17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc5_22: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc5_22: init type = call constants.%Int(%int_32.loc5_22) [template = constants.%i32] -// CHECK:STDOUT: %.loc5_25: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc5_17, %int.make_type_signed.loc5_22) -// CHECK:STDOUT: %.loc5_26.1: type = value_of_initializer %int.make_type_signed.loc5_17 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_26.2: type = converted %int.make_type_signed.loc5_17, %.loc5_26.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_26.3: type = value_of_initializer %int.make_type_signed.loc5_22 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_26.4: type = converted %int.make_type_signed.loc5_22, %.loc5_26.3 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_26.5: type = converted %.loc5_25, constants.%tuple.type.2 [template = constants.%tuple.type.2] -// CHECK:STDOUT: adapt_decl %.loc5_26.5 [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %tuple.type.2 [template = constants.%complete_type] +// CHECK:STDOUT: %i32.loc5_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc5_25: %tuple.type.1 = tuple_literal (%i32.loc5_17, %i32.loc5_22) +// CHECK:STDOUT: %.loc5_26: type = converted %.loc5_25, constants.%tuple.type.2 [template = constants.%tuple.type.2] +// CHECK:STDOUT: adapt_decl %.loc5_26 [template] +// CHECK:STDOUT: %complete_type: = complete_type_witness %tuple.type.2 [template = constants.%complete_type.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%TupleAdapter -// CHECK:STDOUT: extend %.loc5_26.5 +// CHECK:STDOUT: extend %.loc5_26 // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } // CHECK:STDOUT: @@ -596,10 +566,9 @@ fn F(a: IntAdapter) -> i32 { // CHECK:STDOUT: %MakeInt: %MakeInt.type = struct_value () [template] // CHECK:STDOUT: %IntAdapter: type = class_type @IntAdapter [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %i32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %complete_type.1: = complete_type_witness %i32.builtin [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: } @@ -611,7 +580,7 @@ fn F(a: IntAdapter) -> i32 { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: %IntLiteral.type = import_ref Core//prelude/types, IntLiteral, loaded [template = constants.%IntLiteral] +// CHECK:STDOUT: %import_ref.1: %IntLiteral.type = import_ref Core//prelude/types/int_literal, IntLiteral, loaded [template = constants.%IntLiteral] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -647,9 +616,7 @@ fn F(a: IntAdapter) -> i32 { // CHECK:STDOUT: } { // CHECK:STDOUT: %IntAdapter.ref: type = name_ref IntAdapter, file.%IntAdapter.decl [template = constants.%IntAdapter] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc10_24.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc10_24.2: type = converted %int.make_type_signed, %.loc10_24.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %IntAdapter = value_param runtime_param0 // CHECK:STDOUT: %a: %IntAdapter = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 @@ -660,11 +627,11 @@ fn F(a: IntAdapter) -> i32 { // CHECK:STDOUT: class @IntAdapter { // CHECK:STDOUT: %MakeInt.ref: %MakeInt.type = name_ref MakeInt, file.%MakeInt.decl [template = constants.%MakeInt] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call %MakeInt.ref(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc7_27.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc7_27.2: type = converted %int.make_type_signed, %.loc7_27.1 [template = constants.%i32] +// CHECK:STDOUT: %int.make_type_signed: init type = call %MakeInt.ref(%int_32) [template = constants.%i32.builtin] +// CHECK:STDOUT: %.loc7_27.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32.builtin] +// CHECK:STDOUT: %.loc7_27.2: type = converted %int.make_type_signed, %.loc7_27.1 [template = constants.%i32.builtin] // CHECK:STDOUT: adapt_decl %.loc7_27.2 [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %i32 [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %i32.builtin [template = constants.%complete_type.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%IntAdapter diff --git a/toolchain/check/testdata/class/adapter/fail_adapt_with_subobjects.carbon b/toolchain/check/testdata/class/adapter/fail_adapt_with_subobjects.carbon index 8a0867e15f7ab..85d278e74ab4c 100644 --- a/toolchain/check/testdata/class/adapter/fail_adapt_with_subobjects.carbon +++ b/toolchain/check/testdata/class/adapter/fail_adapt_with_subobjects.carbon @@ -79,18 +79,16 @@ class AdaptWithBaseAndFields { // CHECK:STDOUT: constants { // CHECK:STDOUT: %Base: type = class_type @Base [template] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %complete_type.1: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %AdaptWithBase: type = class_type @AdaptWithBase [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %AdaptWithBase.elem: type = unbound_element_type %AdaptWithBase, %Base [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -108,7 +106,7 @@ class AdaptWithBaseAndFields { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Base { -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Base @@ -117,10 +115,8 @@ class AdaptWithBaseAndFields { // CHECK:STDOUT: // CHECK:STDOUT: class @AdaptWithBase { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc10_12.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc10_12.2: type = converted %int.make_type_signed, %.loc10_12.1 [template = constants.%i32] -// CHECK:STDOUT: adapt_decl %.loc10_12.2 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: adapt_decl %i32 [template] // CHECK:STDOUT: %Base.ref: type = name_ref Base, file.%Base.decl [template = constants.%Base] // CHECK:STDOUT: %.loc15: %AdaptWithBase.elem = base_decl %Base.ref, element [template] // CHECK:STDOUT: @@ -136,9 +132,7 @@ class AdaptWithBaseAndFields { // CHECK:STDOUT: constants { // CHECK:STDOUT: %AdaptWithField: type = class_type @AdaptWithField [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %AdaptWithField.elem: type = unbound_element_type %AdaptWithField, %i32 [template] // CHECK:STDOUT: %AdaptWithFields: type = class_type @AdaptWithFields [template] // CHECK:STDOUT: %AdaptWithFields.elem: type = unbound_element_type %AdaptWithFields, %i32 [template] @@ -146,7 +140,7 @@ class AdaptWithBaseAndFields { // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -165,49 +159,37 @@ class AdaptWithBaseAndFields { // CHECK:STDOUT: // CHECK:STDOUT: class @AdaptWithField { // CHECK:STDOUT: %int_32.loc8: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc8: init type = call constants.%Int(%int_32.loc8) [template = constants.%i32] -// CHECK:STDOUT: %.loc8_12.1: type = value_of_initializer %int.make_type_signed.loc8 [template = constants.%i32] -// CHECK:STDOUT: %.loc8_12.2: type = converted %int.make_type_signed.loc8, %.loc8_12.1 [template = constants.%i32] -// CHECK:STDOUT: adapt_decl %.loc8_12.2 [template] +// CHECK:STDOUT: %i32.loc8: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: adapt_decl %i32.loc8 [template] // CHECK:STDOUT: %int_32.loc13: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc13: init type = call constants.%Int(%int_32.loc13) [template = constants.%i32] -// CHECK:STDOUT: %.loc13_10.1: type = value_of_initializer %int.make_type_signed.loc13 [template = constants.%i32] -// CHECK:STDOUT: %.loc13_10.2: type = converted %int.make_type_signed.loc13, %.loc13_10.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc13_8: %AdaptWithField.elem = field_decl n, element [template] +// CHECK:STDOUT: %i32.loc13: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc13: %AdaptWithField.elem = field_decl n, element [template] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%AdaptWithField -// CHECK:STDOUT: .n = %.loc13_8 +// CHECK:STDOUT: .n = %.loc13 // CHECK:STDOUT: complete_type_witness = // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @AdaptWithFields { // CHECK:STDOUT: %int_32.loc20: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc20: init type = call constants.%Int(%int_32.loc20) [template = constants.%i32] -// CHECK:STDOUT: %.loc20_12.1: type = value_of_initializer %int.make_type_signed.loc20 [template = constants.%i32] -// CHECK:STDOUT: %.loc20_12.2: type = converted %int.make_type_signed.loc20, %.loc20_12.1 [template = constants.%i32] -// CHECK:STDOUT: adapt_decl %.loc20_12.2 [template] +// CHECK:STDOUT: %i32.loc20: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: adapt_decl %i32.loc20 [template] // CHECK:STDOUT: %int_32.loc25: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc25: init type = call constants.%Int(%int_32.loc25) [template = constants.%i32] -// CHECK:STDOUT: %.loc25_10.1: type = value_of_initializer %int.make_type_signed.loc25 [template = constants.%i32] -// CHECK:STDOUT: %.loc25_10.2: type = converted %int.make_type_signed.loc25, %.loc25_10.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc25_8: %AdaptWithFields.elem = field_decl a, element [template] +// CHECK:STDOUT: %i32.loc25: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc25: %AdaptWithFields.elem = field_decl a, element [template] // CHECK:STDOUT: %int_32.loc26: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc26: init type = call constants.%Int(%int_32.loc26) [template = constants.%i32] -// CHECK:STDOUT: %.loc26_10.1: type = value_of_initializer %int.make_type_signed.loc26 [template = constants.%i32] -// CHECK:STDOUT: %.loc26_10.2: type = converted %int.make_type_signed.loc26, %.loc26_10.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc26_8: %AdaptWithFields.elem = field_decl b, element [template] +// CHECK:STDOUT: %i32.loc26: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc26: %AdaptWithFields.elem = field_decl b, element [template] // CHECK:STDOUT: %int_32.loc27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc27: init type = call constants.%Int(%int_32.loc27) [template = constants.%i32] -// CHECK:STDOUT: %.loc27_10.1: type = value_of_initializer %int.make_type_signed.loc27 [template = constants.%i32] -// CHECK:STDOUT: %.loc27_10.2: type = converted %int.make_type_signed.loc27, %.loc27_10.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc27_8: %AdaptWithFields.elem = field_decl c, element [template] +// CHECK:STDOUT: %i32.loc27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc27: %AdaptWithFields.elem = field_decl c, element [template] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%AdaptWithFields -// CHECK:STDOUT: .a = %.loc25_8 -// CHECK:STDOUT: .b = %.loc26_8 -// CHECK:STDOUT: .c = %.loc27_8 +// CHECK:STDOUT: .a = %.loc25 +// CHECK:STDOUT: .b = %.loc26 +// CHECK:STDOUT: .c = %.loc27 // CHECK:STDOUT: complete_type_witness = // CHECK:STDOUT: } // CHECK:STDOUT: @@ -216,19 +198,17 @@ class AdaptWithBaseAndFields { // CHECK:STDOUT: constants { // CHECK:STDOUT: %Base: type = class_type @Base [template] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %complete_type.1: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %AdaptWithBaseAndFields: type = class_type @AdaptWithBaseAndFields [template] // CHECK:STDOUT: %AdaptWithBaseAndFields.elem.1: type = unbound_element_type %AdaptWithBaseAndFields, %Base [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %AdaptWithBaseAndFields.elem.2: type = unbound_element_type %AdaptWithBaseAndFields, %i32 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -246,7 +226,7 @@ class AdaptWithBaseAndFields { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Base { -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Base @@ -257,10 +237,8 @@ class AdaptWithBaseAndFields { // CHECK:STDOUT: %Base.ref: type = name_ref Base, file.%Base.decl [template = constants.%Base] // CHECK:STDOUT: %.loc7: %AdaptWithBaseAndFields.elem.1 = base_decl %Base.ref, element [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc8_10.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc8_10.2: type = converted %int.make_type_signed, %.loc8_10.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc8_8: %AdaptWithBaseAndFields.elem.2 = field_decl n, element [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc8: %AdaptWithBaseAndFields.elem.2 = field_decl n, element [template] // CHECK:STDOUT: %.loc15_10: %empty_struct_type = struct_literal () // CHECK:STDOUT: %.loc15_11: type = converted %.loc15_10, constants.%empty_struct_type [template = constants.%empty_struct_type] // CHECK:STDOUT: adapt_decl %.loc15_11 [template] @@ -268,7 +246,7 @@ class AdaptWithBaseAndFields { // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%AdaptWithBaseAndFields // CHECK:STDOUT: .base = %.loc7 -// CHECK:STDOUT: .n = %.loc8_8 +// CHECK:STDOUT: .n = %.loc8 // CHECK:STDOUT: extend %Base.ref // CHECK:STDOUT: complete_type_witness = // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/adapter/init_adapt.carbon b/toolchain/check/testdata/class/adapter/init_adapt.carbon index 7ab5d6abecf3a..db23ec1c7ff97 100644 --- a/toolchain/check/testdata/class/adapter/init_adapt.carbon +++ b/toolchain/check/testdata/class/adapter/init_adapt.carbon @@ -96,24 +96,22 @@ var e: C = MakeAdaptC(); // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %C.elem: type = unbound_element_type %C, %i32 [template] // CHECK:STDOUT: %struct_type.a.b.1: type = struct_type {.a: %i32, .b: %i32} [template] -// CHECK:STDOUT: %complete_type.1: = complete_type_witness %struct_type.a.b.1 [template] +// CHECK:STDOUT: %complete_type.3: = complete_type_witness %struct_type.a.b.1 [template] // CHECK:STDOUT: %AdaptC: type = class_type @AdaptC [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %struct_type.a.b.2: type = struct_type {.a: Core.IntLiteral, .b: Core.IntLiteral} [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] // CHECK:STDOUT: %C.val: %C = struct_value (%int_1.2, %int_2.2) [template] @@ -126,7 +124,7 @@ var e: C = MakeAdaptC(); // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -177,28 +175,24 @@ var e: C = MakeAdaptC(); // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: %int_32.loc5: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc5: init type = call constants.%Int(%int_32.loc5) [template = constants.%i32] -// CHECK:STDOUT: %.loc5_10.1: type = value_of_initializer %int.make_type_signed.loc5 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_10.2: type = converted %int.make_type_signed.loc5, %.loc5_10.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_8: %C.elem = field_decl a, element0 [template] +// CHECK:STDOUT: %i32.loc5: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc5: %C.elem = field_decl a, element0 [template] // CHECK:STDOUT: %int_32.loc6: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc6: init type = call constants.%Int(%int_32.loc6) [template = constants.%i32] -// CHECK:STDOUT: %.loc6_10.1: type = value_of_initializer %int.make_type_signed.loc6 [template = constants.%i32] -// CHECK:STDOUT: %.loc6_10.2: type = converted %int.make_type_signed.loc6, %.loc6_10.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc6_8: %C.elem = field_decl b, element1 [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a.b.1 [template = constants.%complete_type.1] +// CHECK:STDOUT: %i32.loc6: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc6: %C.elem = field_decl b, element1 [template] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a.b.1 [template = constants.%complete_type.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C -// CHECK:STDOUT: .a = %.loc5_8 -// CHECK:STDOUT: .b = %.loc6_8 +// CHECK:STDOUT: .a = %.loc5 +// CHECK:STDOUT: .b = %.loc6 // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @AdaptC { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: adapt_decl %C.ref [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a.b.1 [template = constants.%complete_type.1] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a.b.1 [template = constants.%complete_type.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%AdaptC @@ -214,7 +208,7 @@ var e: C = MakeAdaptC(); // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %.loc13_27.1: %struct_type.a.b.2 = struct_literal (%int_1, %int_2) -// CHECK:STDOUT: %impl.elem0.loc13_27.1: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc13_27.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc13_27.1: = bound_method %int_1, %impl.elem0.loc13_27.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc13_27.1: = specific_function %Convert.bound.loc13_27.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc13_27.1: init %i32 = call %Convert.specific_fn.loc13_27.1(%int_1) [template = constants.%int_1.2] @@ -222,7 +216,7 @@ var e: C = MakeAdaptC(); // CHECK:STDOUT: %.loc13_27.3: ref %C = temporary_storage // CHECK:STDOUT: %.loc13_27.4: ref %i32 = class_element_access %.loc13_27.3, element0 // CHECK:STDOUT: %.loc13_27.5: init %i32 = initialize_from %.loc13_27.2 to %.loc13_27.4 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc13_27.2: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc13_27.2: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc13_27.2: = bound_method %int_2, %impl.elem0.loc13_27.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc13_27.2: = specific_function %Convert.bound.loc13_27.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc13_27.2: init %i32 = call %Convert.specific_fn.loc13_27.2(%int_2) [template = constants.%int_2.2] @@ -266,24 +260,22 @@ var e: C = MakeAdaptC(); // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %C.elem: type = unbound_element_type %C, %i32 [template] // CHECK:STDOUT: %struct_type.a.b.1: type = struct_type {.a: %i32, .b: %i32} [template] -// CHECK:STDOUT: %complete_type.1: = complete_type_witness %struct_type.a.b.1 [template] +// CHECK:STDOUT: %complete_type.3: = complete_type_witness %struct_type.a.b.1 [template] // CHECK:STDOUT: %AdaptC: type = class_type @AdaptC [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %struct_type.a.b.2: type = struct_type {.a: Core.IntLiteral, .b: Core.IntLiteral} [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] // CHECK:STDOUT: %C.val: %C = struct_value (%int_1.2, %int_2.2) [template] @@ -296,7 +288,7 @@ var e: C = MakeAdaptC(); // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -347,28 +339,24 @@ var e: C = MakeAdaptC(); // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: %int_32.loc5: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc5: init type = call constants.%Int(%int_32.loc5) [template = constants.%i32] -// CHECK:STDOUT: %.loc5_10.1: type = value_of_initializer %int.make_type_signed.loc5 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_10.2: type = converted %int.make_type_signed.loc5, %.loc5_10.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_8: %C.elem = field_decl a, element0 [template] +// CHECK:STDOUT: %i32.loc5: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc5: %C.elem = field_decl a, element0 [template] // CHECK:STDOUT: %int_32.loc6: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc6: init type = call constants.%Int(%int_32.loc6) [template = constants.%i32] -// CHECK:STDOUT: %.loc6_10.1: type = value_of_initializer %int.make_type_signed.loc6 [template = constants.%i32] -// CHECK:STDOUT: %.loc6_10.2: type = converted %int.make_type_signed.loc6, %.loc6_10.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc6_8: %C.elem = field_decl b, element1 [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a.b.1 [template = constants.%complete_type.1] +// CHECK:STDOUT: %i32.loc6: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc6: %C.elem = field_decl b, element1 [template] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a.b.1 [template = constants.%complete_type.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C -// CHECK:STDOUT: .a = %.loc5_8 -// CHECK:STDOUT: .b = %.loc6_8 +// CHECK:STDOUT: .a = %.loc5 +// CHECK:STDOUT: .b = %.loc6 // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @AdaptC { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: adapt_decl %C.ref [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a.b.1 [template = constants.%complete_type.1] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a.b.1 [template = constants.%complete_type.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%AdaptC @@ -384,7 +372,7 @@ var e: C = MakeAdaptC(); // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %.loc13_27.1: %struct_type.a.b.2 = struct_literal (%int_1, %int_2) -// CHECK:STDOUT: %impl.elem0.loc13_27.1: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc13_27.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc13_27.1: = bound_method %int_1, %impl.elem0.loc13_27.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc13_27.1: = specific_function %Convert.bound.loc13_27.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc13_27.1: init %i32 = call %Convert.specific_fn.loc13_27.1(%int_1) [template = constants.%int_1.2] @@ -392,7 +380,7 @@ var e: C = MakeAdaptC(); // CHECK:STDOUT: %.loc13_27.3: ref %C = temporary_storage // CHECK:STDOUT: %.loc13_27.4: ref %i32 = class_element_access %.loc13_27.3, element0 // CHECK:STDOUT: %.loc13_27.5: init %i32 = initialize_from %.loc13_27.2 to %.loc13_27.4 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc13_27.2: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc13_27.2: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc13_27.2: = bound_method %int_2, %impl.elem0.loc13_27.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc13_27.2: = specific_function %Convert.bound.loc13_27.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc13_27.2: init %i32 = call %Convert.specific_fn.loc13_27.2(%int_2) [template = constants.%int_2.2] diff --git a/toolchain/check/testdata/class/base.carbon b/toolchain/check/testdata/class/base.carbon index 59e5ed451ff4a..1206470ba429d 100644 --- a/toolchain/check/testdata/class/base.carbon +++ b/toolchain/check/testdata/class/base.carbon @@ -49,17 +49,15 @@ class Derived { // CHECK:STDOUT: constants { // CHECK:STDOUT: %Base: type = class_type @Base [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %Base.elem: type = unbound_element_type %Base, %i32 [template] // CHECK:STDOUT: %struct_type.b.1: type = struct_type {.b: %i32} [template] -// CHECK:STDOUT: %complete_type.1: = complete_type_witness %struct_type.b.1 [template] +// CHECK:STDOUT: %complete_type.3: = complete_type_witness %struct_type.b.1 [template] // CHECK:STDOUT: %Derived: type = class_type @Derived [template] // CHECK:STDOUT: %Derived.elem.1: type = unbound_element_type %Derived, %Base [template] // CHECK:STDOUT: %Derived.elem.2: type = unbound_element_type %Derived, %i32 [template] // CHECK:STDOUT: %struct_type.base.d.1: type = struct_type {.base: %Base, .d: %i32} [template] -// CHECK:STDOUT: %complete_type.2: = complete_type_witness %struct_type.base.d.1 [template] +// CHECK:STDOUT: %complete_type.4: = complete_type_witness %struct_type.base.d.1 [template] // CHECK:STDOUT: %Make.type: type = fn_type @Make [template] // CHECK:STDOUT: %Make: %Make.type = struct_value () [template] // CHECK:STDOUT: %int_4.1: Core.IntLiteral = int_value 4 [template] @@ -67,14 +65,14 @@ class Derived { // CHECK:STDOUT: %int_7.1: Core.IntLiteral = int_value 7 [template] // CHECK:STDOUT: %struct_type.base.d.3: type = struct_type {.base: %struct_type.b.2, .d: Core.IntLiteral} [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_4.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_4.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_4.2: %i32 = int_value 4 [template] // CHECK:STDOUT: %Base.val: %Base = struct_value (%int_4.2) [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_7.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_7.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_7.2: %i32 = int_value 7 [template] // CHECK:STDOUT: %Derived.val: %Derived = struct_value (%Base.val, %int_7.2) [template] @@ -87,7 +85,7 @@ class Derived { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -120,15 +118,11 @@ class Derived { // CHECK:STDOUT: } { // CHECK:STDOUT: %Derived.ref: type = name_ref Derived, file.%Derived.decl [template = constants.%Derived] // CHECK:STDOUT: %int_32.loc17_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc17_27: init type = call constants.%Int(%int_32.loc17_27) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc17_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc17_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc17_32: init type = call constants.%Int(%int_32.loc17_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc17_35.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc17_27, %int.make_type_signed.loc17_32) -// CHECK:STDOUT: %.loc17_35.2: type = value_of_initializer %int.make_type_signed.loc17_27 [template = constants.%i32] -// CHECK:STDOUT: %.loc17_35.3: type = converted %int.make_type_signed.loc17_27, %.loc17_35.2 [template = constants.%i32] -// CHECK:STDOUT: %.loc17_35.4: type = value_of_initializer %int.make_type_signed.loc17_32 [template = constants.%i32] -// CHECK:STDOUT: %.loc17_35.5: type = converted %int.make_type_signed.loc17_32, %.loc17_35.4 [template = constants.%i32] -// CHECK:STDOUT: %.loc17_35.6: type = converted %.loc17_35.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] +// CHECK:STDOUT: %i32.loc17_32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc17_35.1: %tuple.type.1 = tuple_literal (%i32.loc17_27, %i32.loc17_32) +// CHECK:STDOUT: %.loc17_35.2: type = converted %.loc17_35.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %d.param: %Derived = value_param runtime_param0 // CHECK:STDOUT: %d: %Derived = bind_name d, %d.param // CHECK:STDOUT: %return.param: ref %tuple.type.2 = out_param runtime_param1 @@ -138,15 +132,13 @@ class Derived { // CHECK:STDOUT: // CHECK:STDOUT: class @Base { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc4_10.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc4_10.2: type = converted %int.make_type_signed, %.loc4_10.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc4_8: %Base.elem = field_decl b, element0 [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.b.1 [template = constants.%complete_type.1] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc4: %Base.elem = field_decl b, element0 [template] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.b.1 [template = constants.%complete_type.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Base -// CHECK:STDOUT: .b = %.loc4_8 +// CHECK:STDOUT: .b = %.loc4 // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } // CHECK:STDOUT: @@ -154,16 +146,14 @@ class Derived { // CHECK:STDOUT: %Base.ref: type = name_ref Base, file.%Base.decl [template = constants.%Base] // CHECK:STDOUT: %.loc8: %Derived.elem.1 = base_decl %Base.ref, element0 [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc10_10.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc10_10.2: type = converted %int.make_type_signed, %.loc10_10.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc10_8: %Derived.elem.2 = field_decl d, element1 [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.base.d.1 [template = constants.%complete_type.2] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc10: %Derived.elem.2 = field_decl d, element1 [template] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.base.d.1 [template = constants.%complete_type.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Derived // CHECK:STDOUT: .base = %.loc8 -// CHECK:STDOUT: .d = %.loc10_8 +// CHECK:STDOUT: .d = %.loc10 // CHECK:STDOUT: extend %Base.ref // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } @@ -174,7 +164,7 @@ class Derived { // CHECK:STDOUT: %.loc14_26.1: %struct_type.b.2 = struct_literal (%int_4) // CHECK:STDOUT: %int_7: Core.IntLiteral = int_value 7 [template = constants.%int_7.1] // CHECK:STDOUT: %.loc14_35.1: %struct_type.base.d.3 = struct_literal (%.loc14_26.1, %int_7) -// CHECK:STDOUT: %impl.elem0.loc14_26: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc14_26: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc14_26: = bound_method %int_4, %impl.elem0.loc14_26 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc14_26: = specific_function %Convert.bound.loc14_26, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc14_26: init %i32 = call %Convert.specific_fn.loc14_26(%int_4) [template = constants.%int_4.2] @@ -184,7 +174,7 @@ class Derived { // CHECK:STDOUT: %.loc14_26.4: init %i32 = initialize_from %.loc14_26.2 to %.loc14_26.3 [template = constants.%int_4.2] // CHECK:STDOUT: %.loc14_26.5: init %Base = class_init (%.loc14_26.4), %.loc14_35.2 [template = constants.%Base.val] // CHECK:STDOUT: %.loc14_35.3: init %Base = converted %.loc14_26.1, %.loc14_26.5 [template = constants.%Base.val] -// CHECK:STDOUT: %impl.elem0.loc14_35: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc14_35: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc14_35: = bound_method %int_7, %impl.elem0.loc14_35 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc14_35: = specific_function %Convert.bound.loc14_35, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc14_35: init %i32 = call %Convert.specific_fn.loc14_35(%int_7) [template = constants.%int_7.2] @@ -199,14 +189,14 @@ class Derived { // CHECK:STDOUT: fn @Access(%d.param_patt: %Derived) -> %return.param_patt: %tuple.type.2 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %d.ref.loc18_11: %Derived = name_ref d, %d -// CHECK:STDOUT: %d.ref.loc18_12: %Derived.elem.2 = name_ref d, @Derived.%.loc10_8 [template = @Derived.%.loc10_8] +// CHECK:STDOUT: %d.ref.loc18_12: %Derived.elem.2 = name_ref d, @Derived.%.loc10 [template = @Derived.%.loc10] // CHECK:STDOUT: %.loc18_12.1: ref %i32 = class_element_access %d.ref.loc18_11, element1 // CHECK:STDOUT: %.loc18_12.2: %i32 = bind_value %.loc18_12.1 // CHECK:STDOUT: %d.ref.loc18_16: %Derived = name_ref d, %d // CHECK:STDOUT: %base.ref: %Derived.elem.1 = name_ref base, @Derived.%.loc8 [template = @Derived.%.loc8] // CHECK:STDOUT: %.loc18_17.1: ref %Base = class_element_access %d.ref.loc18_16, element0 // CHECK:STDOUT: %.loc18_17.2: %Base = bind_value %.loc18_17.1 -// CHECK:STDOUT: %b.ref: %Base.elem = name_ref b, @Base.%.loc4_8 [template = @Base.%.loc4_8] +// CHECK:STDOUT: %b.ref: %Base.elem = name_ref b, @Base.%.loc4 [template = @Base.%.loc4] // CHECK:STDOUT: %.loc18_22.1: ref %i32 = class_element_access %.loc18_17.2, element0 // CHECK:STDOUT: %.loc18_22.2: %i32 = bind_value %.loc18_22.1 // CHECK:STDOUT: %.loc18_24.1: %tuple.type.2 = tuple_literal (%.loc18_12.2, %.loc18_22.2) @@ -227,17 +217,15 @@ class Derived { // CHECK:STDOUT: %complete_type.1: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %Derived: type = class_type @Derived [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %Derived.elem: type = unbound_element_type %Derived, %i32 [template] // CHECK:STDOUT: %struct_type.d: type = struct_type {.d: %i32} [template] -// CHECK:STDOUT: %complete_type.2: = complete_type_witness %struct_type.d [template] +// CHECK:STDOUT: %complete_type.4: = complete_type_witness %struct_type.d [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -264,16 +252,14 @@ class Derived { // CHECK:STDOUT: // CHECK:STDOUT: class @Derived { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc7_10.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc7_10.2: type = converted %int.make_type_signed, %.loc7_10.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc7_8: %Derived.elem = field_decl d, element0 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc7: %Derived.elem = field_decl d, element0 [template] // CHECK:STDOUT: %Base.ref: type = name_ref Base, file.%Base.decl [template = constants.%Base] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.d [template = constants.%complete_type.2] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.d [template = constants.%complete_type.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Derived -// CHECK:STDOUT: .d = %.loc7_8 +// CHECK:STDOUT: .d = %.loc7 // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/base_field.carbon b/toolchain/check/testdata/class/base_field.carbon index 135c9e53d683b..52868facb66c3 100644 --- a/toolchain/check/testdata/class/base_field.carbon +++ b/toolchain/check/testdata/class/base_field.carbon @@ -30,17 +30,15 @@ fn Access(p: Derived*) -> i32* { // CHECK:STDOUT: constants { // CHECK:STDOUT: %Base: type = class_type @Base [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %Base.elem: type = unbound_element_type %Base, %i32 [template] // CHECK:STDOUT: %struct_type.a.b.c: type = struct_type {.a: %i32, .b: %i32, .c: %i32} [template] -// CHECK:STDOUT: %complete_type.1: = complete_type_witness %struct_type.a.b.c [template] +// CHECK:STDOUT: %complete_type.3: = complete_type_witness %struct_type.a.b.c [template] // CHECK:STDOUT: %Derived: type = class_type @Derived [template] // CHECK:STDOUT: %Derived.elem.1: type = unbound_element_type %Derived, %Base [template] // CHECK:STDOUT: %Derived.elem.2: type = unbound_element_type %Derived, %i32 [template] // CHECK:STDOUT: %struct_type.base.d.e.1: type = struct_type {.base: %Base, .d: %i32, .e: %i32} [template] -// CHECK:STDOUT: %complete_type.2: = complete_type_witness %struct_type.base.d.e.1 [template] +// CHECK:STDOUT: %complete_type.4: = complete_type_witness %struct_type.base.d.e.1 [template] // CHECK:STDOUT: %ptr.2: type = ptr_type %Derived [template] // CHECK:STDOUT: %ptr.3: type = ptr_type %i32 [template] // CHECK:STDOUT: %Access.type: type = fn_type @Access [template] @@ -49,7 +47,7 @@ fn Access(p: Derived*) -> i32* { // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -74,9 +72,7 @@ fn Access(p: Derived*) -> i32* { // CHECK:STDOUT: %Derived.ref: type = name_ref Derived, file.%Derived.decl [template = constants.%Derived] // CHECK:STDOUT: %ptr.loc24_21: type = ptr_type %Derived [template = constants.%ptr.2] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc24_30.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc24_30.2: type = converted %int.make_type_signed, %.loc24_30.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %ptr.loc24_30: type = ptr_type %i32 [template = constants.%ptr.3] // CHECK:STDOUT: %p.param: %ptr.2 = value_param runtime_param0 // CHECK:STDOUT: %p: %ptr.2 = bind_name p, %p.param @@ -87,27 +83,21 @@ fn Access(p: Derived*) -> i32* { // CHECK:STDOUT: // CHECK:STDOUT: class @Base { // CHECK:STDOUT: %int_32.loc12: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc12: init type = call constants.%Int(%int_32.loc12) [template = constants.%i32] -// CHECK:STDOUT: %.loc12_10.1: type = value_of_initializer %int.make_type_signed.loc12 [template = constants.%i32] -// CHECK:STDOUT: %.loc12_10.2: type = converted %int.make_type_signed.loc12, %.loc12_10.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc12_8: %Base.elem = field_decl a, element0 [template] +// CHECK:STDOUT: %i32.loc12: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc12: %Base.elem = field_decl a, element0 [template] // CHECK:STDOUT: %int_32.loc13: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc13: init type = call constants.%Int(%int_32.loc13) [template = constants.%i32] -// CHECK:STDOUT: %.loc13_10.1: type = value_of_initializer %int.make_type_signed.loc13 [template = constants.%i32] -// CHECK:STDOUT: %.loc13_10.2: type = converted %int.make_type_signed.loc13, %.loc13_10.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc13_8: %Base.elem = field_decl b, element1 [template] +// CHECK:STDOUT: %i32.loc13: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc13: %Base.elem = field_decl b, element1 [template] // CHECK:STDOUT: %int_32.loc14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc14: init type = call constants.%Int(%int_32.loc14) [template = constants.%i32] -// CHECK:STDOUT: %.loc14_10.1: type = value_of_initializer %int.make_type_signed.loc14 [template = constants.%i32] -// CHECK:STDOUT: %.loc14_10.2: type = converted %int.make_type_signed.loc14, %.loc14_10.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc14_8: %Base.elem = field_decl c, element2 [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a.b.c [template = constants.%complete_type.1] +// CHECK:STDOUT: %i32.loc14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc14: %Base.elem = field_decl c, element2 [template] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a.b.c [template = constants.%complete_type.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Base -// CHECK:STDOUT: .a = %.loc12_8 -// CHECK:STDOUT: .b = %.loc13_8 -// CHECK:STDOUT: .c = %.loc14_8 +// CHECK:STDOUT: .a = %.loc12 +// CHECK:STDOUT: .b = %.loc13 +// CHECK:STDOUT: .c = %.loc14 // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } // CHECK:STDOUT: @@ -115,22 +105,18 @@ fn Access(p: Derived*) -> i32* { // CHECK:STDOUT: %Base.ref: type = name_ref Base, file.%Base.decl [template = constants.%Base] // CHECK:STDOUT: %.loc18: %Derived.elem.1 = base_decl %Base.ref, element0 [template] // CHECK:STDOUT: %int_32.loc20: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc20: init type = call constants.%Int(%int_32.loc20) [template = constants.%i32] -// CHECK:STDOUT: %.loc20_10.1: type = value_of_initializer %int.make_type_signed.loc20 [template = constants.%i32] -// CHECK:STDOUT: %.loc20_10.2: type = converted %int.make_type_signed.loc20, %.loc20_10.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc20_8: %Derived.elem.2 = field_decl d, element1 [template] +// CHECK:STDOUT: %i32.loc20: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc20: %Derived.elem.2 = field_decl d, element1 [template] // CHECK:STDOUT: %int_32.loc21: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc21: init type = call constants.%Int(%int_32.loc21) [template = constants.%i32] -// CHECK:STDOUT: %.loc21_10.1: type = value_of_initializer %int.make_type_signed.loc21 [template = constants.%i32] -// CHECK:STDOUT: %.loc21_10.2: type = converted %int.make_type_signed.loc21, %.loc21_10.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc21_8: %Derived.elem.2 = field_decl e, element2 [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.base.d.e.1 [template = constants.%complete_type.2] +// CHECK:STDOUT: %i32.loc21: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc21: %Derived.elem.2 = field_decl e, element2 [template] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.base.d.e.1 [template = constants.%complete_type.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Derived // CHECK:STDOUT: .base = %.loc18 -// CHECK:STDOUT: .d = %.loc20_8 -// CHECK:STDOUT: .e = %.loc21_8 +// CHECK:STDOUT: .d = %.loc20 +// CHECK:STDOUT: .e = %.loc21 // CHECK:STDOUT: extend %Base.ref // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } @@ -139,7 +125,7 @@ fn Access(p: Derived*) -> i32* { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %p.ref: %ptr.2 = name_ref p, %p // CHECK:STDOUT: %.loc25_12: ref %Derived = deref %p.ref -// CHECK:STDOUT: %c.ref: %Base.elem = name_ref c, @Base.%.loc14_8 [template = @Base.%.loc14_8] +// CHECK:STDOUT: %c.ref: %Base.elem = name_ref c, @Base.%.loc14 [template = @Base.%.loc14] // CHECK:STDOUT: %.loc25_15.1: ref %Base = class_element_access %.loc25_12, element0 // CHECK:STDOUT: %.loc25_15.2: ref %Base = converted %.loc25_12, %.loc25_15.1 // CHECK:STDOUT: %.loc25_15.3: ref %i32 = class_element_access %.loc25_15.2, element2 diff --git a/toolchain/check/testdata/class/base_method.carbon b/toolchain/check/testdata/class/base_method.carbon index b2907d2d4fade..7e148f16e3722 100644 --- a/toolchain/check/testdata/class/base_method.carbon +++ b/toolchain/check/testdata/class/base_method.carbon @@ -31,28 +31,26 @@ fn Call(p: Derived*) { // CHECK:STDOUT: constants { // CHECK:STDOUT: %Base: type = class_type @Base [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %Base.elem: type = unbound_element_type %Base, %i32 [template] // CHECK:STDOUT: %ptr.1: type = ptr_type %Base [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %struct_type.a: type = struct_type {.a: %i32} [template] -// CHECK:STDOUT: %complete_type.1: = complete_type_witness %struct_type.a [template] +// CHECK:STDOUT: %complete_type.3: = complete_type_witness %struct_type.a [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] // CHECK:STDOUT: %Derived: type = class_type @Derived [template] // CHECK:STDOUT: %Derived.elem: type = unbound_element_type %Derived, %Base [template] // CHECK:STDOUT: %struct_type.base.1: type = struct_type {.base: %Base} [template] -// CHECK:STDOUT: %complete_type.4: = complete_type_witness %struct_type.base.1 [template] +// CHECK:STDOUT: %complete_type.5: = complete_type_witness %struct_type.base.1 [template] // CHECK:STDOUT: %ptr.3: type = ptr_type %Derived [template] // CHECK:STDOUT: %Call.type: type = fn_type @Call [template] // CHECK:STDOUT: %Call: %Call.type = struct_value () [template] @@ -61,7 +59,7 @@ fn Call(p: Derived*) { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -100,10 +98,8 @@ fn Call(p: Derived*) { // CHECK:STDOUT: // CHECK:STDOUT: class @Base { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc12_10.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc12_10.2: type = converted %int.make_type_signed, %.loc12_10.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc12_8: %Base.elem = field_decl a, element0 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc12: %Base.elem = field_decl a, element0 [template] // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %self.patt: %ptr.1 = binding_pattern self // CHECK:STDOUT: %self.param_patt: %ptr.1 = value_param_pattern %self.patt, runtime_param0 @@ -114,11 +110,11 @@ fn Call(p: Derived*) { // CHECK:STDOUT: %self.param.loc14: %ptr.1 = value_param runtime_param0 // CHECK:STDOUT: %self.loc14: %ptr.1 = bind_name self, %self.param.loc14 // CHECK:STDOUT: } -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a [template = constants.%complete_type.1] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a [template = constants.%complete_type.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Base -// CHECK:STDOUT: .a = %.loc12_8 +// CHECK:STDOUT: .a = %.loc12 // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } @@ -126,7 +122,7 @@ fn Call(p: Derived*) { // CHECK:STDOUT: class @Derived { // CHECK:STDOUT: %Base.ref: type = name_ref Base, file.%Base.decl [template = constants.%Base] // CHECK:STDOUT: %.loc22: %Derived.elem = base_decl %Base.ref, element0 [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.base.1 [template = constants.%complete_type.4] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.base.1 [template = constants.%complete_type.5] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Derived @@ -139,10 +135,10 @@ fn Call(p: Derived*) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %self.ref: %ptr.1 = name_ref self, %self.loc17 // CHECK:STDOUT: %.loc18_4: ref %Base = deref %self.ref -// CHECK:STDOUT: %a.ref: %Base.elem = name_ref a, @Base.%.loc12_8 [template = @Base.%.loc12_8] +// CHECK:STDOUT: %a.ref: %Base.elem = name_ref a, @Base.%.loc12 [template = @Base.%.loc12] // CHECK:STDOUT: %.loc18_10: ref %i32 = class_element_access %.loc18_4, element0 // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_1) [template = constants.%int_1.2] diff --git a/toolchain/check/testdata/class/base_method_qualified.carbon b/toolchain/check/testdata/class/base_method_qualified.carbon index a0eeac0e13a2f..44f6e73974989 100644 --- a/toolchain/check/testdata/class/base_method_qualified.carbon +++ b/toolchain/check/testdata/class/base_method_qualified.carbon @@ -44,22 +44,20 @@ fn PassDerivedToBaseIndirect(p: Derived*) -> i32 { // CHECK:STDOUT: %Derived: type = class_type @Derived [template] // CHECK:STDOUT: %Base: type = class_type @Base [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %F.type.1: type = fn_type @F.1 [template] // CHECK:STDOUT: %F.1: %F.type.1 = struct_value () [template] // CHECK:STDOUT: %G.type.1: type = fn_type @G.1 [template] // CHECK:STDOUT: %G.1: %G.type.1 = struct_value () [template] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] -// CHECK:STDOUT: %complete_type.1: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %complete_type.2: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %Derived.elem: type = unbound_element_type %Derived, %Base [template] // CHECK:STDOUT: %F.type.2: type = fn_type @F.2 [template] // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [template] // CHECK:STDOUT: %G.type.2: type = fn_type @G.2 [template] // CHECK:STDOUT: %G.2: %G.type.2 = struct_value () [template] // CHECK:STDOUT: %struct_type.base.1: type = struct_type {.base: %Base} [template] -// CHECK:STDOUT: %complete_type.2: = complete_type_witness %struct_type.base.1 [template] +// CHECK:STDOUT: %complete_type.3: = complete_type_witness %struct_type.base.1 [template] // CHECK:STDOUT: %Call.type: type = fn_type @Call [template] // CHECK:STDOUT: %Call: %Call.type = struct_value () [template] // CHECK:STDOUT: %ptr.3: type = ptr_type %Derived [template] @@ -73,7 +71,7 @@ fn PassDerivedToBaseIndirect(p: Derived*) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -101,9 +99,7 @@ fn PassDerivedToBaseIndirect(p: Derived*) -> i32 { // CHECK:STDOUT: } { // CHECK:STDOUT: %Derived.ref: type = name_ref Derived, file.%Derived.decl.loc11 [template = constants.%Derived] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc25_24.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc25_24.2: type = converted %int.make_type_signed, %.loc25_24.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %Derived = value_param runtime_param0 // CHECK:STDOUT: %a: %Derived = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 @@ -118,9 +114,7 @@ fn PassDerivedToBaseIndirect(p: Derived*) -> i32 { // CHECK:STDOUT: %Derived.ref: type = name_ref Derived, file.%Derived.decl.loc11 [template = constants.%Derived] // CHECK:STDOUT: %ptr: type = ptr_type %Derived [template = constants.%ptr.3] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc29_33.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc29_33.2: type = converted %int.make_type_signed, %.loc29_33.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %p.param: %ptr.3 = value_param runtime_param0 // CHECK:STDOUT: %p: %ptr.3 = bind_name p, %p.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 @@ -134,9 +128,7 @@ fn PassDerivedToBaseIndirect(p: Derived*) -> i32 { // CHECK:STDOUT: } { // CHECK:STDOUT: %Derived.ref: type = name_ref Derived, file.%Derived.decl.loc11 [template = constants.%Derived] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc33_37.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc33_37.2: type = converted %int.make_type_signed, %.loc33_37.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %Derived = value_param runtime_param0 // CHECK:STDOUT: %a: %Derived = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 @@ -151,9 +143,7 @@ fn PassDerivedToBaseIndirect(p: Derived*) -> i32 { // CHECK:STDOUT: %Derived.ref: type = name_ref Derived, file.%Derived.decl.loc11 [template = constants.%Derived] // CHECK:STDOUT: %ptr: type = ptr_type %Derived [template = constants.%ptr.3] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc37_46.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc37_46.2: type = converted %int.make_type_signed, %.loc37_46.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %p.param: %ptr.3 = value_param runtime_param0 // CHECK:STDOUT: %p: %ptr.3 = bind_name p, %p.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 @@ -180,7 +170,7 @@ fn PassDerivedToBaseIndirect(p: Derived*) -> i32 { // CHECK:STDOUT: %self.param: %Derived = value_param runtime_param0 // CHECK:STDOUT: %self: %Derived = bind_name self, %self.param // CHECK:STDOUT: } -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.base.1 [template = constants.%complete_type.2] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.base.1 [template = constants.%complete_type.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Derived @@ -200,9 +190,7 @@ fn PassDerivedToBaseIndirect(p: Derived*) -> i32 { // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Base [template = constants.%Base] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc14_25.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc14_25.2: type = converted %int.make_type_signed, %.loc14_25.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %self.param: %Base = value_param runtime_param0 // CHECK:STDOUT: %self: %Base = bind_name self, %self.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 @@ -216,15 +204,13 @@ fn PassDerivedToBaseIndirect(p: Derived*) -> i32 { // CHECK:STDOUT: } { // CHECK:STDOUT: %Derived.ref: type = name_ref Derived, file.%Derived.decl.loc11 [template = constants.%Derived] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc15_28.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc15_28.2: type = converted %int.make_type_signed, %.loc15_28.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %self.param: %Derived = value_param runtime_param0 // CHECK:STDOUT: %self: %Derived = bind_name self, %self.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.2] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Base diff --git a/toolchain/check/testdata/class/basic.carbon b/toolchain/check/testdata/class/basic.carbon index 0eee260bce2bb..ec52c5abbfa8a 100644 --- a/toolchain/check/testdata/class/basic.carbon +++ b/toolchain/check/testdata/class/basic.carbon @@ -31,24 +31,22 @@ fn Run() -> i32 { // CHECK:STDOUT: constants { // CHECK:STDOUT: %Class: type = class_type @Class [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] // CHECK:STDOUT: %Class.elem: type = unbound_element_type %Class, %i32 [template] // CHECK:STDOUT: %struct_type.k: type = struct_type {.k: %i32} [template] -// CHECK:STDOUT: %complete_type.1: = complete_type_witness %struct_type.k [template] +// CHECK:STDOUT: %complete_type.3: = complete_type_witness %struct_type.k [template] // CHECK:STDOUT: %Run.type: type = fn_type @Run [template] // CHECK:STDOUT: %Run: %Run.type = struct_value () [template] // CHECK:STDOUT: %int_4.1: Core.IntLiteral = int_value 4 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_4.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound: = bound_method %int_4.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_4.2: %i32 = int_value 4 [template] // CHECK:STDOUT: } @@ -56,7 +54,7 @@ fn Run() -> i32 { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -77,13 +75,9 @@ fn Run() -> i32 { // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc21_15: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc21_15: init type = call constants.%Int(%int_32.loc21_15) [template = constants.%i32] -// CHECK:STDOUT: %.loc21_15.1: type = value_of_initializer %int.make_type_signed.loc21_15 [template = constants.%i32] -// CHECK:STDOUT: %.loc21_15.2: type = converted %int.make_type_signed.loc21_15, %.loc21_15.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc21_15: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc21_23: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc21_23: init type = call constants.%Int(%int_32.loc21_23) [template = constants.%i32] -// CHECK:STDOUT: %.loc21_23.1: type = value_of_initializer %int.make_type_signed.loc21_23 [template = constants.%i32] -// CHECK:STDOUT: %.loc21_23.2: type = converted %int.make_type_signed.loc21_23, %.loc21_23.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc21_23: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %n.param.loc21: %i32 = value_param runtime_param0 // CHECK:STDOUT: %n.loc21: %i32 = bind_name n, %n.param.loc21 // CHECK:STDOUT: %return.param.loc21: ref %i32 = out_param runtime_param1 @@ -94,16 +88,12 @@ fn Run() -> i32 { // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc25_13.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc25_13.2: type = converted %int.make_type_signed, %.loc25_13.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc25_17.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc25_17.2: type = converted %int.make_type_signed, %.loc25_17.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Class { @@ -114,13 +104,9 @@ fn Run() -> i32 { // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc12_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc12_11: init type = call constants.%Int(%int_32.loc12_11) [template = constants.%i32] -// CHECK:STDOUT: %.loc12_11.1: type = value_of_initializer %int.make_type_signed.loc12_11 [template = constants.%i32] -// CHECK:STDOUT: %.loc12_11.2: type = converted %int.make_type_signed.loc12_11, %.loc12_11.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc12_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc12_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc12_19: init type = call constants.%Int(%int_32.loc12_19) [template = constants.%i32] -// CHECK:STDOUT: %.loc12_19.1: type = value_of_initializer %int.make_type_signed.loc12_19 [template = constants.%i32] -// CHECK:STDOUT: %.loc12_19.2: type = converted %int.make_type_signed.loc12_19, %.loc12_19.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc12_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %n.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %n: %i32 = bind_name n, %n.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 @@ -133,30 +119,24 @@ fn Run() -> i32 { // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc16_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc16_11: init type = call constants.%Int(%int_32.loc16_11) [template = constants.%i32] -// CHECK:STDOUT: %.loc16_11.1: type = value_of_initializer %int.make_type_signed.loc16_11 [template = constants.%i32] -// CHECK:STDOUT: %.loc16_11.2: type = converted %int.make_type_signed.loc16_11, %.loc16_11.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc16_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc16_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc16_19: init type = call constants.%Int(%int_32.loc16_19) [template = constants.%i32] -// CHECK:STDOUT: %.loc16_19.1: type = value_of_initializer %int.make_type_signed.loc16_19 [template = constants.%i32] -// CHECK:STDOUT: %.loc16_19.2: type = converted %int.make_type_signed.loc16_19, %.loc16_19.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc16_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %n.param.loc16: %i32 = value_param runtime_param0 // CHECK:STDOUT: %n.loc16: %i32 = bind_name n, %n.param.loc16 // CHECK:STDOUT: %return.param.loc16: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return.loc16: ref %i32 = return_slot %return.param.loc16 // CHECK:STDOUT: } // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc18_10.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc18_10.2: type = converted %int.make_type_signed, %.loc18_10.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc18_8: %Class.elem = field_decl k, element0 [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.k [template = constants.%complete_type.1] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc18: %Class.elem = field_decl k, element0 [template] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.k [template = constants.%complete_type.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: .G = %G.decl -// CHECK:STDOUT: .k = %.loc18_8 +// CHECK:STDOUT: .k = %.loc18 // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } // CHECK:STDOUT: @@ -177,7 +157,7 @@ fn Run() -> i32 { // CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class] // CHECK:STDOUT: %F.ref: %F.type = name_ref F, @Class.%F.decl [template = constants.%F] // CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [template = constants.%int_4.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_4, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_4) [template = constants.%int_4.2] diff --git a/toolchain/check/testdata/class/complete_in_member_fn.carbon b/toolchain/check/testdata/class/complete_in_member_fn.carbon index 9883a0491536b..50b7d737294c0 100644 --- a/toolchain/check/testdata/class/complete_in_member_fn.carbon +++ b/toolchain/check/testdata/class/complete_in_member_fn.carbon @@ -19,19 +19,17 @@ class C { // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %C.elem: type = unbound_element_type %C, %i32 [template] // CHECK:STDOUT: %struct_type.a: type = struct_type {.a: %i32} [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a [template] +// CHECK:STDOUT: %complete_type.3: = complete_type_witness %struct_type.a [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -55,32 +53,28 @@ class C { // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc12_17.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc12_17.2: type = converted %int.make_type_signed, %.loc12_17.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %c.param: %C = value_param runtime_param0 // CHECK:STDOUT: %c: %C = bind_name c, %c.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc14_10.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc14_10.2: type = converted %int.make_type_signed, %.loc14_10.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc14_8: %C.elem = field_decl a, element0 [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a [template = constants.%complete_type] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc14: %C.elem = field_decl a, element0 [template] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a [template = constants.%complete_type.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: .a = %.loc14_8 +// CHECK:STDOUT: .a = %.loc14 // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F(%c.param_patt: %C) -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %c.ref: %C = name_ref c, %c -// CHECK:STDOUT: %a.ref: %C.elem = name_ref a, @C.%.loc14_8 [template = @C.%.loc14_8] +// CHECK:STDOUT: %a.ref: %C.elem = name_ref a, @C.%.loc14 [template = @C.%.loc14] // CHECK:STDOUT: %.loc12_31.1: ref %i32 = class_element_access %c.ref, element0 // CHECK:STDOUT: %.loc12_31.2: %i32 = bind_value %.loc12_31.1 // CHECK:STDOUT: return %.loc12_31.2 diff --git a/toolchain/check/testdata/class/compound_field.carbon b/toolchain/check/testdata/class/compound_field.carbon index bc75232f9999f..c0186b5d0d09a 100644 --- a/toolchain/check/testdata/class/compound_field.carbon +++ b/toolchain/check/testdata/class/compound_field.carbon @@ -42,17 +42,15 @@ fn AccessBaseIndirect(p: Derived*) -> i32* { // CHECK:STDOUT: constants { // CHECK:STDOUT: %Base: type = class_type @Base [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %Base.elem: type = unbound_element_type %Base, %i32 [template] // CHECK:STDOUT: %struct_type.a.b.c: type = struct_type {.a: %i32, .b: %i32, .c: %i32} [template] -// CHECK:STDOUT: %complete_type.1: = complete_type_witness %struct_type.a.b.c [template] +// CHECK:STDOUT: %complete_type.3: = complete_type_witness %struct_type.a.b.c [template] // CHECK:STDOUT: %Derived: type = class_type @Derived [template] // CHECK:STDOUT: %Derived.elem.1: type = unbound_element_type %Derived, %Base [template] // CHECK:STDOUT: %Derived.elem.2: type = unbound_element_type %Derived, %i32 [template] // CHECK:STDOUT: %struct_type.base.d.e.1: type = struct_type {.base: %Base, .d: %i32, .e: %i32} [template] -// CHECK:STDOUT: %complete_type.2: = complete_type_witness %struct_type.base.d.e.1 [template] +// CHECK:STDOUT: %complete_type.4: = complete_type_witness %struct_type.base.d.e.1 [template] // CHECK:STDOUT: %AccessDerived.type: type = fn_type @AccessDerived [template] // CHECK:STDOUT: %AccessDerived: %AccessDerived.type = struct_value () [template] // CHECK:STDOUT: %AccessBase.type: type = fn_type @AccessBase [template] @@ -67,7 +65,7 @@ fn AccessBaseIndirect(p: Derived*) -> i32* { // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -94,9 +92,7 @@ fn AccessBaseIndirect(p: Derived*) -> i32* { // CHECK:STDOUT: } { // CHECK:STDOUT: %Derived.ref.loc24: type = name_ref Derived, file.%Derived.decl [template = constants.%Derived] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc24_33.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc24_33.2: type = converted %int.make_type_signed, %.loc24_33.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %d.param: %Derived = value_param runtime_param0 // CHECK:STDOUT: %d: %Derived = bind_name d, %d.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 @@ -110,9 +106,7 @@ fn AccessBaseIndirect(p: Derived*) -> i32* { // CHECK:STDOUT: } { // CHECK:STDOUT: %Derived.ref: type = name_ref Derived, file.%Derived.decl [template = constants.%Derived] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc28_30.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc28_30.2: type = converted %int.make_type_signed, %.loc28_30.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %d.param: %Derived = value_param runtime_param0 // CHECK:STDOUT: %d: %Derived = bind_name d, %d.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 @@ -127,9 +121,7 @@ fn AccessBaseIndirect(p: Derived*) -> i32* { // CHECK:STDOUT: %Derived.ref.loc32: type = name_ref Derived, file.%Derived.decl [template = constants.%Derived] // CHECK:STDOUT: %ptr.loc32_36: type = ptr_type %Derived [template = constants.%ptr.4] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc32_45.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc32_45.2: type = converted %int.make_type_signed, %.loc32_45.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %ptr.loc32_45: type = ptr_type %i32 [template = constants.%ptr.5] // CHECK:STDOUT: %p.param: %ptr.4 = value_param runtime_param0 // CHECK:STDOUT: %p: %ptr.4 = bind_name p, %p.param @@ -145,9 +137,7 @@ fn AccessBaseIndirect(p: Derived*) -> i32* { // CHECK:STDOUT: %Derived.ref: type = name_ref Derived, file.%Derived.decl [template = constants.%Derived] // CHECK:STDOUT: %ptr.loc36_33: type = ptr_type %Derived [template = constants.%ptr.4] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc36_42.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc36_42.2: type = converted %int.make_type_signed, %.loc36_42.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %ptr.loc36_42: type = ptr_type %i32 [template = constants.%ptr.5] // CHECK:STDOUT: %p.param: %ptr.4 = value_param runtime_param0 // CHECK:STDOUT: %p: %ptr.4 = bind_name p, %p.param @@ -158,27 +148,21 @@ fn AccessBaseIndirect(p: Derived*) -> i32* { // CHECK:STDOUT: // CHECK:STDOUT: class @Base { // CHECK:STDOUT: %int_32.loc12: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc12: init type = call constants.%Int(%int_32.loc12) [template = constants.%i32] -// CHECK:STDOUT: %.loc12_10.1: type = value_of_initializer %int.make_type_signed.loc12 [template = constants.%i32] -// CHECK:STDOUT: %.loc12_10.2: type = converted %int.make_type_signed.loc12, %.loc12_10.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc12_8: %Base.elem = field_decl a, element0 [template] +// CHECK:STDOUT: %i32.loc12: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc12: %Base.elem = field_decl a, element0 [template] // CHECK:STDOUT: %int_32.loc13: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc13: init type = call constants.%Int(%int_32.loc13) [template = constants.%i32] -// CHECK:STDOUT: %.loc13_10.1: type = value_of_initializer %int.make_type_signed.loc13 [template = constants.%i32] -// CHECK:STDOUT: %.loc13_10.2: type = converted %int.make_type_signed.loc13, %.loc13_10.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc13_8: %Base.elem = field_decl b, element1 [template] +// CHECK:STDOUT: %i32.loc13: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc13: %Base.elem = field_decl b, element1 [template] // CHECK:STDOUT: %int_32.loc14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc14: init type = call constants.%Int(%int_32.loc14) [template = constants.%i32] -// CHECK:STDOUT: %.loc14_10.1: type = value_of_initializer %int.make_type_signed.loc14 [template = constants.%i32] -// CHECK:STDOUT: %.loc14_10.2: type = converted %int.make_type_signed.loc14, %.loc14_10.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc14_8: %Base.elem = field_decl c, element2 [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a.b.c [template = constants.%complete_type.1] +// CHECK:STDOUT: %i32.loc14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc14: %Base.elem = field_decl c, element2 [template] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a.b.c [template = constants.%complete_type.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Base -// CHECK:STDOUT: .a = %.loc12_8 -// CHECK:STDOUT: .b = %.loc13_8 -// CHECK:STDOUT: .c = %.loc14_8 +// CHECK:STDOUT: .a = %.loc12 +// CHECK:STDOUT: .b = %.loc13 +// CHECK:STDOUT: .c = %.loc14 // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } // CHECK:STDOUT: @@ -186,22 +170,18 @@ fn AccessBaseIndirect(p: Derived*) -> i32* { // CHECK:STDOUT: %Base.ref: type = name_ref Base, file.%Base.decl [template = constants.%Base] // CHECK:STDOUT: %.loc18: %Derived.elem.1 = base_decl %Base.ref, element0 [template] // CHECK:STDOUT: %int_32.loc20: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc20: init type = call constants.%Int(%int_32.loc20) [template = constants.%i32] -// CHECK:STDOUT: %.loc20_10.1: type = value_of_initializer %int.make_type_signed.loc20 [template = constants.%i32] -// CHECK:STDOUT: %.loc20_10.2: type = converted %int.make_type_signed.loc20, %.loc20_10.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc20_8: %Derived.elem.2 = field_decl d, element1 [template] +// CHECK:STDOUT: %i32.loc20: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc20: %Derived.elem.2 = field_decl d, element1 [template] // CHECK:STDOUT: %int_32.loc21: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc21: init type = call constants.%Int(%int_32.loc21) [template = constants.%i32] -// CHECK:STDOUT: %.loc21_10.1: type = value_of_initializer %int.make_type_signed.loc21 [template = constants.%i32] -// CHECK:STDOUT: %.loc21_10.2: type = converted %int.make_type_signed.loc21, %.loc21_10.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc21_8: %Derived.elem.2 = field_decl e, element2 [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.base.d.e.1 [template = constants.%complete_type.2] +// CHECK:STDOUT: %i32.loc21: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc21: %Derived.elem.2 = field_decl e, element2 [template] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.base.d.e.1 [template = constants.%complete_type.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Derived // CHECK:STDOUT: .base = %.loc18 -// CHECK:STDOUT: .d = %.loc20_8 -// CHECK:STDOUT: .e = %.loc21_8 +// CHECK:STDOUT: .d = %.loc20 +// CHECK:STDOUT: .e = %.loc21 // CHECK:STDOUT: extend %Base.ref // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } @@ -210,7 +190,7 @@ fn AccessBaseIndirect(p: Derived*) -> i32* { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %d.ref.loc25_10: %Derived = name_ref d, %d // CHECK:STDOUT: %Derived.ref.loc25: type = name_ref Derived, file.%Derived.decl [template = constants.%Derived] -// CHECK:STDOUT: %d.ref.loc25_20: %Derived.elem.2 = name_ref d, @Derived.%.loc20_8 [template = @Derived.%.loc20_8] +// CHECK:STDOUT: %d.ref.loc25_20: %Derived.elem.2 = name_ref d, @Derived.%.loc20 [template = @Derived.%.loc20] // CHECK:STDOUT: %.loc25_11.1: ref %i32 = class_element_access %d.ref.loc25_10, element1 // CHECK:STDOUT: %.loc25_11.2: %i32 = bind_value %.loc25_11.1 // CHECK:STDOUT: return %.loc25_11.2 @@ -220,7 +200,7 @@ fn AccessBaseIndirect(p: Derived*) -> i32* { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %d.ref: %Derived = name_ref d, %d // CHECK:STDOUT: %Base.ref: type = name_ref Base, file.%Base.decl [template = constants.%Base] -// CHECK:STDOUT: %b.ref: %Base.elem = name_ref b, @Base.%.loc13_8 [template = @Base.%.loc13_8] +// CHECK:STDOUT: %b.ref: %Base.elem = name_ref b, @Base.%.loc13 [template = @Base.%.loc13] // CHECK:STDOUT: %.loc29_11.1: ref %Base = class_element_access %d.ref, element0 // CHECK:STDOUT: %.loc29_11.2: ref %Base = converted %d.ref, %.loc29_11.1 // CHECK:STDOUT: %.loc29_11.3: ref %i32 = class_element_access %.loc29_11.2, element1 @@ -232,7 +212,7 @@ fn AccessBaseIndirect(p: Derived*) -> i32* { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %p.ref: %ptr.4 = name_ref p, %p // CHECK:STDOUT: %Derived.ref.loc33: type = name_ref Derived, file.%Derived.decl [template = constants.%Derived] -// CHECK:STDOUT: %d.ref: %Derived.elem.2 = name_ref d, @Derived.%.loc20_8 [template = @Derived.%.loc20_8] +// CHECK:STDOUT: %d.ref: %Derived.elem.2 = name_ref d, @Derived.%.loc20 [template = @Derived.%.loc20] // CHECK:STDOUT: %.loc33_12.1: ref %Derived = deref %p.ref // CHECK:STDOUT: %.loc33_12.2: ref %i32 = class_element_access %.loc33_12.1, element1 // CHECK:STDOUT: %addr: %ptr.5 = addr_of %.loc33_12.2 @@ -243,7 +223,7 @@ fn AccessBaseIndirect(p: Derived*) -> i32* { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %p.ref: %ptr.4 = name_ref p, %p // CHECK:STDOUT: %Base.ref: type = name_ref Base, file.%Base.decl [template = constants.%Base] -// CHECK:STDOUT: %b.ref: %Base.elem = name_ref b, @Base.%.loc13_8 [template = @Base.%.loc13_8] +// CHECK:STDOUT: %b.ref: %Base.elem = name_ref b, @Base.%.loc13 [template = @Base.%.loc13] // CHECK:STDOUT: %.loc37_12.1: ref %Derived = deref %p.ref // CHECK:STDOUT: %.loc37_12.2: ref %Base = class_element_access %.loc37_12.1, element0 // CHECK:STDOUT: %.loc37_12.3: ref %Base = converted %.loc37_12.1, %.loc37_12.2 diff --git a/toolchain/check/testdata/class/derived_to_base.carbon b/toolchain/check/testdata/class/derived_to_base.carbon index fd48d738f92d9..d21ea07f24b2c 100644 --- a/toolchain/check/testdata/class/derived_to_base.carbon +++ b/toolchain/check/testdata/class/derived_to_base.carbon @@ -43,22 +43,20 @@ fn ConvertInit() { // CHECK:STDOUT: constants { // CHECK:STDOUT: %A: type = class_type @A [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %A.elem: type = unbound_element_type %A, %i32 [template] // CHECK:STDOUT: %struct_type.a.1: type = struct_type {.a: %i32} [template] -// CHECK:STDOUT: %complete_type.1: = complete_type_witness %struct_type.a.1 [template] +// CHECK:STDOUT: %complete_type.3: = complete_type_witness %struct_type.a.1 [template] // CHECK:STDOUT: %B: type = class_type @B [template] // CHECK:STDOUT: %B.elem.1: type = unbound_element_type %B, %A [template] // CHECK:STDOUT: %B.elem.2: type = unbound_element_type %B, %i32 [template] // CHECK:STDOUT: %struct_type.base.b.1: type = struct_type {.base: %A, .b: %i32} [template] -// CHECK:STDOUT: %complete_type.2: = complete_type_witness %struct_type.base.b.1 [template] +// CHECK:STDOUT: %complete_type.4: = complete_type_witness %struct_type.base.b.1 [template] // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %C.elem.1: type = unbound_element_type %C, %B [template] // CHECK:STDOUT: %C.elem.2: type = unbound_element_type %C, %i32 [template] // CHECK:STDOUT: %struct_type.base.c.1: type = struct_type {.base: %B, .c: %i32} [template] -// CHECK:STDOUT: %complete_type.3: = complete_type_witness %struct_type.base.c.1 [template] +// CHECK:STDOUT: %complete_type.5: = complete_type_witness %struct_type.base.c.1 [template] // CHECK:STDOUT: %ptr.4: type = ptr_type %C [template] // CHECK:STDOUT: %ptr.5: type = ptr_type %B [template] // CHECK:STDOUT: %ConvertCToB.type: type = fn_type @ConvertCToB [template] @@ -81,18 +79,18 @@ fn ConvertInit() { // CHECK:STDOUT: %int_3.1: Core.IntLiteral = int_value 3 [template] // CHECK:STDOUT: %struct_type.base.c.3: type = struct_type {.base: %struct_type.base.b.3, .c: Core.IntLiteral} [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] // CHECK:STDOUT: %A.val: %A = struct_value (%int_1.2) [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] // CHECK:STDOUT: %B.val: %B = struct_value (%A.val, %int_2.2) [template] -// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_3.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_3.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_3.2: %i32 = int_value 3 [template] // CHECK:STDOUT: %C.val: %C = struct_value (%B.val, %int_3.2) [template] @@ -101,7 +99,7 @@ fn ConvertInit() { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -197,15 +195,13 @@ fn ConvertInit() { // CHECK:STDOUT: // CHECK:STDOUT: class @A { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc12_10.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc12_10.2: type = converted %int.make_type_signed, %.loc12_10.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc12_8: %A.elem = field_decl a, element0 [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a.1 [template = constants.%complete_type.1] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc12: %A.elem = field_decl a, element0 [template] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a.1 [template = constants.%complete_type.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%A -// CHECK:STDOUT: .a = %.loc12_8 +// CHECK:STDOUT: .a = %.loc12 // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } // CHECK:STDOUT: @@ -213,16 +209,14 @@ fn ConvertInit() { // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%A] // CHECK:STDOUT: %.loc16: %B.elem.1 = base_decl %A.ref, element0 [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc17_10.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc17_10.2: type = converted %int.make_type_signed, %.loc17_10.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc17_8: %B.elem.2 = field_decl b, element1 [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.base.b.1 [template = constants.%complete_type.2] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc17: %B.elem.2 = field_decl b, element1 [template] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.base.b.1 [template = constants.%complete_type.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%B // CHECK:STDOUT: .base = %.loc16 -// CHECK:STDOUT: .b = %.loc17_8 +// CHECK:STDOUT: .b = %.loc17 // CHECK:STDOUT: extend %A.ref // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } @@ -231,16 +225,14 @@ fn ConvertInit() { // CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [template = constants.%B] // CHECK:STDOUT: %.loc21: %C.elem.1 = base_decl %B.ref, element0 [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc22_10.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc22_10.2: type = converted %int.make_type_signed, %.loc22_10.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc22_8: %C.elem.2 = field_decl c, element1 [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.base.c.1 [template = constants.%complete_type.3] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc22: %C.elem.2 = field_decl c, element1 [template] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.base.c.1 [template = constants.%complete_type.5] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: .base = %.loc21 -// CHECK:STDOUT: .c = %.loc22_8 +// CHECK:STDOUT: .c = %.loc22 // CHECK:STDOUT: extend %B.ref // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } @@ -310,7 +302,7 @@ fn ConvertInit() { // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] // CHECK:STDOUT: %.loc38_57.1: %struct_type.base.c.3 = struct_literal (%.loc38_48.1, %int_3) // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %impl.elem0.loc38_39: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc38_39: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc38_39: = bound_method %int_1, %impl.elem0.loc38_39 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc38_39: = specific_function %Convert.bound.loc38_39, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc38_39: init %i32 = call %Convert.specific_fn.loc38_39(%int_1) [template = constants.%int_1.2] @@ -322,7 +314,7 @@ fn ConvertInit() { // CHECK:STDOUT: %.loc38_39.4: init %i32 = initialize_from %.loc38_39.2 to %.loc38_39.3 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc38_39.5: init %A = class_init (%.loc38_39.4), %.loc38_48.2 [template = constants.%A.val] // CHECK:STDOUT: %.loc38_48.3: init %A = converted %.loc38_39.1, %.loc38_39.5 [template = constants.%A.val] -// CHECK:STDOUT: %impl.elem0.loc38_48: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc38_48: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc38_48: = bound_method %int_2, %impl.elem0.loc38_48 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc38_48: = specific_function %Convert.bound.loc38_48, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc38_48: init %i32 = call %Convert.specific_fn.loc38_48(%int_2) [template = constants.%int_2.2] @@ -331,7 +323,7 @@ fn ConvertInit() { // CHECK:STDOUT: %.loc38_48.6: init %i32 = initialize_from %.loc38_48.4 to %.loc38_48.5 [template = constants.%int_2.2] // CHECK:STDOUT: %.loc38_48.7: init %B = class_init (%.loc38_48.3, %.loc38_48.6), %.loc38_57.3 [template = constants.%B.val] // CHECK:STDOUT: %.loc38_57.4: init %B = converted %.loc38_48.1, %.loc38_48.7 [template = constants.%B.val] -// CHECK:STDOUT: %impl.elem0.loc38_57: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc38_57: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc38_57: = bound_method %int_3, %impl.elem0.loc38_57 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc38_57: = specific_function %Convert.bound.loc38_57, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc38_57: init %i32 = call %Convert.specific_fn.loc38_57(%int_3) [template = constants.%int_3.2] diff --git a/toolchain/check/testdata/class/fail_abstract.carbon b/toolchain/check/testdata/class/fail_abstract.carbon index 410dcef16b33c..7d5dd15499e90 100644 --- a/toolchain/check/testdata/class/fail_abstract.carbon +++ b/toolchain/check/testdata/class/fail_abstract.carbon @@ -448,12 +448,10 @@ fn CallReturnAbstract() { // CHECK:STDOUT: %Derived: type = class_type @Derived [template] // CHECK:STDOUT: %Derived.elem.1: type = unbound_element_type %Derived, %Abstract [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %Derived.elem.2: type = unbound_element_type %Derived, %i32 [template] // CHECK:STDOUT: %struct_type.base.d.1: type = struct_type {.base: %Abstract, .d: %i32} [template] -// CHECK:STDOUT: %complete_type.2: = complete_type_witness %struct_type.base.d.1 [template] +// CHECK:STDOUT: %complete_type.4: = complete_type_witness %struct_type.base.d.1 [template] // CHECK:STDOUT: %Make.type: type = fn_type @Make [template] // CHECK:STDOUT: %Make: %Make.type = struct_value () [template] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template] @@ -464,7 +462,7 @@ fn CallReturnAbstract() { // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -502,16 +500,14 @@ fn CallReturnAbstract() { // CHECK:STDOUT: %Abstract.ref: type = name_ref Abstract, file.%Abstract.decl [template = constants.%Abstract] // CHECK:STDOUT: %.loc8: %Derived.elem.1 = base_decl %Abstract.ref, element0 [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc10_10.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc10_10.2: type = converted %int.make_type_signed, %.loc10_10.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc10_8: %Derived.elem.2 = field_decl d, element1 [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.base.d.1 [template = constants.%complete_type.2] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc10: %Derived.elem.2 = field_decl d, element1 [template] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.base.d.1 [template = constants.%complete_type.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Derived // CHECK:STDOUT: .base = %.loc8 -// CHECK:STDOUT: .d = %.loc10_8 +// CHECK:STDOUT: .d = %.loc10 // CHECK:STDOUT: extend %Abstract.ref // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } @@ -534,19 +530,17 @@ fn CallReturnAbstract() { // CHECK:STDOUT: %Derived: type = class_type @Derived [template] // CHECK:STDOUT: %Derived.elem.1: type = unbound_element_type %Derived, %Abstract [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %Derived.elem.2: type = unbound_element_type %Derived, %i32 [template] // CHECK:STDOUT: %struct_type.base.d: type = struct_type {.base: %Abstract, .d: %i32} [template] -// CHECK:STDOUT: %complete_type.2: = complete_type_witness %struct_type.base.d [template] +// CHECK:STDOUT: %complete_type.4: = complete_type_witness %struct_type.base.d [template] // CHECK:STDOUT: %Return.type: type = fn_type @Return [template] // CHECK:STDOUT: %Return: %Return.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -589,16 +583,14 @@ fn CallReturnAbstract() { // CHECK:STDOUT: %Abstract.ref: type = name_ref Abstract, file.%Abstract.decl [template = constants.%Abstract] // CHECK:STDOUT: %.loc8: %Derived.elem.1 = base_decl %Abstract.ref, element0 [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc10_10.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc10_10.2: type = converted %int.make_type_signed, %.loc10_10.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc10_8: %Derived.elem.2 = field_decl d, element1 [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.base.d [template = constants.%complete_type.2] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc10: %Derived.elem.2 = field_decl d, element1 [template] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.base.d [template = constants.%complete_type.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Derived // CHECK:STDOUT: .base = %.loc8 -// CHECK:STDOUT: .d = %.loc10_8 +// CHECK:STDOUT: .d = %.loc10 // CHECK:STDOUT: extend %Abstract.ref // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } @@ -614,24 +606,22 @@ fn CallReturnAbstract() { // CHECK:STDOUT: constants { // CHECK:STDOUT: %Abstract: type = class_type @Abstract [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %Abstract.elem: type = unbound_element_type %Abstract, %i32 [template] // CHECK:STDOUT: %struct_type.a: type = struct_type {.a: %i32} [template] -// CHECK:STDOUT: %complete_type.1: = complete_type_witness %struct_type.a [template] +// CHECK:STDOUT: %complete_type.3: = complete_type_witness %struct_type.a [template] // CHECK:STDOUT: %Derived: type = class_type @Derived [template] // CHECK:STDOUT: %Derived.elem.1: type = unbound_element_type %Derived, %Abstract [template] // CHECK:STDOUT: %Derived.elem.2: type = unbound_element_type %Derived, %i32 [template] // CHECK:STDOUT: %struct_type.base.d.1: type = struct_type {.base: %Abstract, .d: %i32} [template] -// CHECK:STDOUT: %complete_type.2: = complete_type_witness %struct_type.base.d.1 [template] +// CHECK:STDOUT: %complete_type.4: = complete_type_witness %struct_type.base.d.1 [template] // CHECK:STDOUT: %Access.type: type = fn_type @Access [template] // CHECK:STDOUT: %Access: %Access.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -655,9 +645,7 @@ fn CallReturnAbstract() { // CHECK:STDOUT: } { // CHECK:STDOUT: %Derived.ref: type = name_ref Derived, file.%Derived.decl [template = constants.%Derived] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc14_26.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc14_26.2: type = converted %int.make_type_signed, %.loc14_26.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %d.param: %Derived = value_param runtime_param0 // CHECK:STDOUT: %d: %Derived = bind_name d, %d.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 @@ -667,15 +655,13 @@ fn CallReturnAbstract() { // CHECK:STDOUT: // CHECK:STDOUT: class @Abstract { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc5_10.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc5_10.2: type = converted %int.make_type_signed, %.loc5_10.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_8: %Abstract.elem = field_decl a, element0 [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a [template = constants.%complete_type.1] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc5: %Abstract.elem = field_decl a, element0 [template] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a [template = constants.%complete_type.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Abstract -// CHECK:STDOUT: .a = %.loc5_8 +// CHECK:STDOUT: .a = %.loc5 // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } // CHECK:STDOUT: @@ -683,16 +669,14 @@ fn CallReturnAbstract() { // CHECK:STDOUT: %Abstract.ref: type = name_ref Abstract, file.%Abstract.decl [template = constants.%Abstract] // CHECK:STDOUT: %.loc9: %Derived.elem.1 = base_decl %Abstract.ref, element0 [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_10.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc11_10.2: type = converted %int.make_type_signed, %.loc11_10.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_8: %Derived.elem.2 = field_decl d, element1 [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.base.d.1 [template = constants.%complete_type.2] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc11: %Derived.elem.2 = field_decl d, element1 [template] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.base.d.1 [template = constants.%complete_type.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Derived // CHECK:STDOUT: .base = %.loc9 -// CHECK:STDOUT: .d = %.loc11_8 +// CHECK:STDOUT: .d = %.loc11 // CHECK:STDOUT: extend %Abstract.ref // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/fail_base_bad_type.carbon b/toolchain/check/testdata/class/fail_base_bad_type.carbon index fe003970a5f36..a8507308fa66a 100644 --- a/toolchain/check/testdata/class/fail_base_bad_type.carbon +++ b/toolchain/check/testdata/class/fail_base_bad_type.carbon @@ -54,15 +54,12 @@ class DeriveFromi32 { // It's not really important whether this conversion produces an error or not, // but it shouldn't crash. -// CHECK:STDERR: fail_derive_from_i32.carbon:[[@LINE+7]]:53: error: cannot implicitly convert from `DeriveFromi32*` to `i32*` [ImplicitAsConversionFailure] -// CHECK:STDERR: fn ConvertToBadBasei32(p: DeriveFromi32*) -> i32* { return p; } -// CHECK:STDERR: ^~~~~~~~~ -// CHECK:STDERR: fail_derive_from_i32.carbon:[[@LINE+4]]:53: note: type `DeriveFromi32*` does not implement interface `Core.ImplicitAs(i32*)` [MissingImplInMemberAccessNote] -// CHECK:STDERR: fn ConvertToBadBasei32(p: DeriveFromi32*) -> i32* { return p; } -// CHECK:STDERR: ^~~~~~~~~ -// CHECK:STDERR: fn ConvertToBadBasei32(p: DeriveFromi32*) -> i32* { return p; } +// CHECK:STDERR: fail_derive_from_i32.carbon:[[@LINE+4]]:70: error: member name `n` not found in `DeriveFromi32` [MemberNameNotFoundInScope] +// CHECK:STDERR: fn AccessMemberWithInvalidBasei32(p: DeriveFromi32*) -> i32 { return (*p).n; } +// CHECK:STDERR: ^~~~~~ +// CHECK:STDERR: fn AccessMemberWithInvalidBasei32(p: DeriveFromi32*) -> i32 { return (*p).n; } // --- fail_derive_from_tuple.carbon @@ -186,16 +183,14 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: %DeriveFromError: type = class_type @DeriveFromError [template] // CHECK:STDOUT: %ptr: type = ptr_type %DeriveFromError [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %AccessMemberWithInvalidBaseError.type: type = fn_type @AccessMemberWithInvalidBaseError [template] // CHECK:STDOUT: %AccessMemberWithInvalidBaseError: %AccessMemberWithInvalidBaseError.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -218,9 +213,7 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: %DeriveFromError.ref: type = name_ref DeriveFromError, file.%DeriveFromError.decl [template = constants.%DeriveFromError] // CHECK:STDOUT: %ptr: type = ptr_type %DeriveFromError [template = constants.%ptr] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc13_61.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc13_61.2: type = converted %int.make_type_signed, %.loc13_61.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %p.param: %ptr = value_param runtime_param0 // CHECK:STDOUT: %p: %ptr = bind_name p, %p.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 @@ -243,7 +236,7 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: fn @AccessMemberWithInvalidBaseError(%p.param_patt: %ptr) -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %p.ref: %ptr = name_ref p, %p -// CHECK:STDOUT: %.loc13_75: ref %DeriveFromError = deref %p.ref +// CHECK:STDOUT: %.loc13: ref %DeriveFromError = deref %p.ref // CHECK:STDOUT: %n.ref: = name_ref n, [template = ] // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -254,9 +247,7 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: %DeriveFromNonType: type = class_type @DeriveFromNonType [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] // CHECK:STDOUT: %ptr: type = ptr_type %DeriveFromNonType [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %AccessMemberWithInvalidBasNonType.type: type = fn_type @AccessMemberWithInvalidBasNonType [template] // CHECK:STDOUT: %AccessMemberWithInvalidBasNonType: %AccessMemberWithInvalidBasNonType.type = struct_value () [template] // CHECK:STDOUT: } @@ -264,7 +255,7 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .ImplicitAs = %import_ref.1 -// CHECK:STDOUT: .Int = %import_ref.37 +// CHECK:STDOUT: .Int = %import_ref.7 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -287,9 +278,7 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: %DeriveFromNonType.ref: type = name_ref DeriveFromNonType, file.%DeriveFromNonType.decl [template = constants.%DeriveFromNonType] // CHECK:STDOUT: %ptr: type = ptr_type %DeriveFromNonType [template = constants.%ptr] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc15_64.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc15_64.2: type = converted %int.make_type_signed, %.loc15_64.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %p.param: %ptr = value_param runtime_param0 // CHECK:STDOUT: %p: %ptr = bind_name p, %p.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 @@ -313,7 +302,7 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: fn @AccessMemberWithInvalidBasNonType(%p.param_patt: %ptr) -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %p.ref: %ptr = name_ref p, %p -// CHECK:STDOUT: %.loc15_78: ref %DeriveFromNonType = deref %p.ref +// CHECK:STDOUT: %.loc15: ref %DeriveFromNonType = deref %p.ref // CHECK:STDOUT: %n.ref: = name_ref n, [template = ] // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -323,9 +312,10 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: constants { // CHECK:STDOUT: %DeriveFromi32: type = class_type @DeriveFromi32 [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] +// CHECK:STDOUT: %DeriveFromi32.elem: type = unbound_element_type %DeriveFromi32, %i32 [template] +// CHECK:STDOUT: %struct_type.base: type = struct_type {.base: %i32} [template] +// CHECK:STDOUT: %complete_type.3: = complete_type_witness %struct_type.base [template] // CHECK:STDOUT: %ptr.1: type = ptr_type %DeriveFromi32 [template] // CHECK:STDOUT: %ptr.2: type = ptr_type %i32 [template] // CHECK:STDOUT: %ConvertToBadBasei32.type: type = fn_type @ConvertToBadBasei32 [template] @@ -337,7 +327,6 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -359,12 +348,10 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: %return.param_patt: %ptr.2 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %DeriveFromi32.ref: type = name_ref DeriveFromi32, file.%DeriveFromi32.decl [template = constants.%DeriveFromi32] -// CHECK:STDOUT: %ptr.loc21_40: type = ptr_type %DeriveFromi32 [template = constants.%ptr.1] +// CHECK:STDOUT: %ptr.loc14_40: type = ptr_type %DeriveFromi32 [template = constants.%ptr.1] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc21_49.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc21_49.2: type = converted %int.make_type_signed, %.loc21_49.1 [template = constants.%i32] -// CHECK:STDOUT: %ptr.loc21_49: type = ptr_type %i32 [template = constants.%ptr.2] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %ptr.loc14_49: type = ptr_type %i32 [template = constants.%ptr.2] // CHECK:STDOUT: %p.param: %ptr.1 = value_param runtime_param0 // CHECK:STDOUT: %p: %ptr.1 = bind_name p, %p.param // CHECK:STDOUT: %return.param: ref %ptr.2 = out_param runtime_param1 @@ -379,9 +366,7 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: %DeriveFromi32.ref: type = name_ref DeriveFromi32, file.%DeriveFromi32.decl [template = constants.%DeriveFromi32] // CHECK:STDOUT: %ptr: type = ptr_type %DeriveFromi32 [template = constants.%ptr.1] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc23_57.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc23_57.2: type = converted %int.make_type_signed, %.loc23_57.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %p.param: %ptr.1 = value_param runtime_param0 // CHECK:STDOUT: %p: %ptr.1 = bind_name p, %p.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 @@ -391,30 +376,31 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: class @DeriveFromi32 { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc9_16.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc9_16.2: type = converted %int.make_type_signed, %.loc9_16.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc9_19: = base_decl , element0 [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness [template = ] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc9: %DeriveFromi32.elem = base_decl %i32, element0 [template] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.base [template = constants.%complete_type.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%DeriveFromi32 -// CHECK:STDOUT: .base = %.loc9_19 -// CHECK:STDOUT: has_error +// CHECK:STDOUT: .base = %.loc9 +// CHECK:STDOUT: extend %i32 // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @ConvertToBadBasei32(%p.param_patt: %ptr.1) -> %ptr.2 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %p.ref: %ptr.1 = name_ref p, %p -// CHECK:STDOUT: %.loc21_61: %ptr.2 = converted %p.ref, [template = ] -// CHECK:STDOUT: return +// CHECK:STDOUT: %.loc14_61.1: ref %DeriveFromi32 = deref %p.ref +// CHECK:STDOUT: %.loc14_61.2: ref %i32 = class_element_access %.loc14_61.1, element0 +// CHECK:STDOUT: %addr: %ptr.2 = addr_of %.loc14_61.2 +// CHECK:STDOUT: %.loc14_61.3: %ptr.2 = converted %p.ref, %addr +// CHECK:STDOUT: return %.loc14_61.3 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @AccessMemberWithInvalidBasei32(%p.param_patt: %ptr.1) -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %p.ref: %ptr.1 = name_ref p, %p -// CHECK:STDOUT: %.loc23_71: ref %DeriveFromi32 = deref %p.ref +// CHECK:STDOUT: %.loc20: ref %DeriveFromi32 = deref %p.ref // CHECK:STDOUT: %n.ref: = name_ref n, [template = ] // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -424,7 +410,7 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: constants { // CHECK:STDOUT: %Base: type = class_type @Base [template] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %complete_type.1: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %DeriveFromTuple: type = class_type @DeriveFromTuple [template] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (type) [template] // CHECK:STDOUT: %tuple.type.2: type = tuple_type (%Base) [template] @@ -433,9 +419,7 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: %ConvertToBadBaseTuple.type: type = fn_type @ConvertToBadBaseTuple [template] // CHECK:STDOUT: %ConvertToBadBaseTuple: %ConvertToBadBaseTuple.type = struct_value () [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %AccessMemberWithInvalidBaseTuple.type: type = fn_type @AccessMemberWithInvalidBaseTuple [template] // CHECK:STDOUT: %AccessMemberWithInvalidBaseTuple: %AccessMemberWithInvalidBaseTuple.type = struct_value () [template] // CHECK:STDOUT: } @@ -443,7 +427,7 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .ImplicitAs = %import_ref.1 -// CHECK:STDOUT: .Int = %import_ref.37 +// CHECK:STDOUT: .Int = %import_ref.7 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -486,9 +470,7 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: %DeriveFromTuple.ref: type = name_ref DeriveFromTuple, file.%DeriveFromTuple.decl [template = constants.%DeriveFromTuple] // CHECK:STDOUT: %ptr: type = ptr_type %DeriveFromTuple [template = constants.%ptr.2] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc23_61.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc23_61.2: type = converted %int.make_type_signed, %.loc23_61.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %p.param: %ptr.2 = value_param runtime_param0 // CHECK:STDOUT: %p: %ptr.2 = bind_name p, %p.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 @@ -497,7 +479,7 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Base { -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Base @@ -528,7 +510,7 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: fn @AccessMemberWithInvalidBaseTuple(%p.param_patt: %ptr.2) -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %p.ref: %ptr.2 = name_ref p, %p -// CHECK:STDOUT: %.loc23_75: ref %DeriveFromTuple = deref %p.ref +// CHECK:STDOUT: %.loc23: ref %DeriveFromTuple = deref %p.ref // CHECK:STDOUT: %n.ref: = name_ref n, [template = ] // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -538,9 +520,7 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: constants { // CHECK:STDOUT: %DeriveFromStruct: type = class_type @DeriveFromStruct [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %struct_type.a.b: type = struct_type {.a: %i32, .b: %i32} [template] // CHECK:STDOUT: %ptr.1: type = ptr_type %struct_type.a.b [template] // CHECK:STDOUT: %ptr.2: type = ptr_type %DeriveFromStruct [template] @@ -553,7 +533,7 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -577,13 +557,9 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: %DeriveFromStruct.ref: type = name_ref DeriveFromStruct, file.%DeriveFromStruct.decl [template = constants.%DeriveFromStruct] // CHECK:STDOUT: %ptr.loc21_46: type = ptr_type %DeriveFromStruct [template = constants.%ptr.2] // CHECK:STDOUT: %int_32.loc21_57: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc21_57: init type = call constants.%Int(%int_32.loc21_57) [template = constants.%i32] -// CHECK:STDOUT: %.loc21_57.1: type = value_of_initializer %int.make_type_signed.loc21_57 [template = constants.%i32] -// CHECK:STDOUT: %.loc21_57.2: type = converted %int.make_type_signed.loc21_57, %.loc21_57.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc21_57: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc21_66: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc21_66: init type = call constants.%Int(%int_32.loc21_66) [template = constants.%i32] -// CHECK:STDOUT: %.loc21_66.1: type = value_of_initializer %int.make_type_signed.loc21_66 [template = constants.%i32] -// CHECK:STDOUT: %.loc21_66.2: type = converted %int.make_type_signed.loc21_66, %.loc21_66.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc21_66: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %struct_type.a.b: type = struct_type {.a: %i32, .b: %i32} [template = constants.%struct_type.a.b] // CHECK:STDOUT: %ptr.loc21_70: type = ptr_type %struct_type.a.b [template = constants.%ptr.1] // CHECK:STDOUT: %p.param: %ptr.2 = value_param runtime_param0 @@ -600,9 +576,7 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: %DeriveFromStruct.ref: type = name_ref DeriveFromStruct, file.%DeriveFromStruct.decl [template = constants.%DeriveFromStruct] // CHECK:STDOUT: %ptr: type = ptr_type %DeriveFromStruct [template = constants.%ptr.2] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc24_63.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc24_63.2: type = converted %int.make_type_signed, %.loc24_63.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %p.param: %ptr.2 = value_param runtime_param0 // CHECK:STDOUT: %p: %ptr.2 = bind_name p, %p.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 @@ -612,20 +586,16 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: class @DeriveFromStruct { // CHECK:STDOUT: %int_32.loc11_21: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11_21: init type = call constants.%Int(%int_32.loc11_21) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_21.1: type = value_of_initializer %int.make_type_signed.loc11_21 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_21.2: type = converted %int.make_type_signed.loc11_21, %.loc11_21.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc11_21: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc11_30: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11_30: init type = call constants.%Int(%int_32.loc11_30) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_30.1: type = value_of_initializer %int.make_type_signed.loc11_30 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_30.2: type = converted %int.make_type_signed.loc11_30, %.loc11_30.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc11_30: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %struct_type.a.b: type = struct_type {.a: %i32, .b: %i32} [template = constants.%struct_type.a.b] -// CHECK:STDOUT: %.loc11_34: = base_decl , element0 [template] +// CHECK:STDOUT: %.loc11: = base_decl , element0 [template] // CHECK:STDOUT: %complete_type: = complete_type_witness [template = ] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%DeriveFromStruct -// CHECK:STDOUT: .base = %.loc11_34 +// CHECK:STDOUT: .base = %.loc11 // CHECK:STDOUT: has_error // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } @@ -633,14 +603,14 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: fn @ConvertToBadBaseStruct(%p.param_patt: %ptr.2) -> %ptr.1 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %p.ref: %ptr.2 = name_ref p, %p -// CHECK:STDOUT: %.loc21_82: %ptr.1 = converted %p.ref, [template = ] +// CHECK:STDOUT: %.loc21: %ptr.1 = converted %p.ref, [template = ] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @AccessMemberWithInvalidBaseStruct(%p.param_patt: %ptr.2) -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %p.ref: %ptr.2 = name_ref p, %p -// CHECK:STDOUT: %.loc24_77: ref %DeriveFromStruct = deref %p.ref +// CHECK:STDOUT: %.loc24: ref %DeriveFromStruct = deref %p.ref // CHECK:STDOUT: %n.ref: = name_ref n, [template = ] // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -655,9 +625,7 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: %ConvertToBadBaseIncomplete.type: type = fn_type @ConvertToBadBaseIncomplete [template] // CHECK:STDOUT: %ConvertToBadBaseIncomplete: %ConvertToBadBaseIncomplete.type = struct_value () [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %AccessMemberWithInvalidBaseIncomplete.type: type = fn_type @AccessMemberWithInvalidBaseIncomplete [template] // CHECK:STDOUT: %AccessMemberWithInvalidBaseIncomplete: %AccessMemberWithInvalidBaseIncomplete.type = struct_value () [template] // CHECK:STDOUT: } @@ -665,7 +633,7 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .ImplicitAs = %import_ref.1 -// CHECK:STDOUT: .Int = %import_ref.37 +// CHECK:STDOUT: .Int = %import_ref.7 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -706,9 +674,7 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: %DeriveFromIncomplete.ref: type = name_ref DeriveFromIncomplete, file.%DeriveFromIncomplete.decl [template = constants.%DeriveFromIncomplete] // CHECK:STDOUT: %ptr: type = ptr_type %DeriveFromIncomplete [template = constants.%ptr.1] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc30_71.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc30_71.2: type = converted %int.make_type_signed, %.loc30_71.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %p.param: %ptr.1 = value_param runtime_param0 // CHECK:STDOUT: %p: %ptr.1 = bind_name p, %p.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 @@ -740,7 +706,7 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: fn @AccessMemberWithInvalidBaseIncomplete(%p.param_patt: %ptr.1) -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %p.ref: %ptr.1 = name_ref p, %p -// CHECK:STDOUT: %.loc30_85: ref %DeriveFromIncomplete = deref %p.ref +// CHECK:STDOUT: %.loc30: ref %DeriveFromIncomplete = deref %p.ref // CHECK:STDOUT: %n.ref: = name_ref n, [template = ] // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -750,16 +716,14 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: constants { // CHECK:STDOUT: %Final: type = class_type @Final [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %Final.elem: type = unbound_element_type %Final, %i32 [template] // CHECK:STDOUT: %struct_type.a: type = struct_type {.a: %i32} [template] -// CHECK:STDOUT: %complete_type.1: = complete_type_witness %struct_type.a [template] +// CHECK:STDOUT: %complete_type.3: = complete_type_witness %struct_type.a [template] // CHECK:STDOUT: %DeriveFromFinal: type = class_type @DeriveFromFinal [template] // CHECK:STDOUT: %DeriveFromFinal.elem: type = unbound_element_type %DeriveFromFinal, %Final [template] // CHECK:STDOUT: %struct_type.base.1: type = struct_type {.base: %Final} [template] -// CHECK:STDOUT: %complete_type.2: = complete_type_witness %struct_type.base.1 [template] +// CHECK:STDOUT: %complete_type.4: = complete_type_witness %struct_type.base.1 [template] // CHECK:STDOUT: %ptr.2: type = ptr_type %DeriveFromFinal [template] // CHECK:STDOUT: %ptr.3: type = ptr_type %Final [template] // CHECK:STDOUT: %ConvertToBadBaseFinal.type: type = fn_type @ConvertToBadBaseFinal [template] @@ -772,7 +736,7 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -814,9 +778,7 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: %DeriveFromFinal.ref: type = name_ref DeriveFromFinal, file.%DeriveFromFinal.decl [template = constants.%DeriveFromFinal] // CHECK:STDOUT: %ptr: type = ptr_type %DeriveFromFinal [template = constants.%ptr.2] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc21_72.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc21_72.2: type = converted %int.make_type_signed, %.loc21_72.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %p.param: %ptr.2 = value_param runtime_param0 // CHECK:STDOUT: %p: %ptr.2 = bind_name p, %p.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 @@ -831,9 +793,7 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: %DeriveFromFinal.ref: type = name_ref DeriveFromFinal, file.%DeriveFromFinal.decl [template = constants.%DeriveFromFinal] // CHECK:STDOUT: %ptr: type = ptr_type %DeriveFromFinal [template = constants.%ptr.2] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc25_70.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc25_70.2: type = converted %int.make_type_signed, %.loc25_70.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %p.param: %ptr.2 = value_param runtime_param0 // CHECK:STDOUT: %p: %ptr.2 = bind_name p, %p.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 @@ -843,22 +803,20 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: class @Final { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc5_10.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc5_10.2: type = converted %int.make_type_signed, %.loc5_10.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_8: %Final.elem = field_decl a, element0 [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a [template = constants.%complete_type.1] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc5: %Final.elem = field_decl a, element0 [template] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a [template = constants.%complete_type.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Final -// CHECK:STDOUT: .a = %.loc5_8 +// CHECK:STDOUT: .a = %.loc5 // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @DeriveFromFinal { // CHECK:STDOUT: %Final.ref: type = name_ref Final, file.%Final.decl [template = constants.%Final] // CHECK:STDOUT: %.loc13: %DeriveFromFinal.elem = base_decl %Final.ref, element0 [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.base.1 [template = constants.%complete_type.2] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.base.1 [template = constants.%complete_type.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%DeriveFromFinal @@ -881,7 +839,7 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %p.ref: %ptr.2 = name_ref p, %p // CHECK:STDOUT: %.loc22_11: ref %DeriveFromFinal = deref %p.ref -// CHECK:STDOUT: %a.ref: %Final.elem = name_ref a, @Final.%.loc5_8 [template = @Final.%.loc5_8] +// CHECK:STDOUT: %a.ref: %Final.elem = name_ref a, @Final.%.loc5 [template = @Final.%.loc5] // CHECK:STDOUT: %.loc22_14.1: ref %Final = class_element_access %.loc22_11, element0 // CHECK:STDOUT: %.loc22_14.2: ref %Final = converted %.loc22_11, %.loc22_14.1 // CHECK:STDOUT: %.loc22_14.3: ref %i32 = class_element_access %.loc22_14.2, element0 diff --git a/toolchain/check/testdata/class/fail_compound_type_mismatch.carbon b/toolchain/check/testdata/class/fail_compound_type_mismatch.carbon index 80224c35fc376..6cddd1cf7dc85 100644 --- a/toolchain/check/testdata/class/fail_compound_type_mismatch.carbon +++ b/toolchain/check/testdata/class/fail_compound_type_mismatch.carbon @@ -31,16 +31,14 @@ fn AccessBInA(a: A) -> i32 { // CHECK:STDOUT: constants { // CHECK:STDOUT: %A: type = class_type @A [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %A.elem: type = unbound_element_type %A, %i32 [template] // CHECK:STDOUT: %struct_type.a: type = struct_type {.a: %i32} [template] -// CHECK:STDOUT: %complete_type.1: = complete_type_witness %struct_type.a [template] +// CHECK:STDOUT: %complete_type.3: = complete_type_witness %struct_type.a [template] // CHECK:STDOUT: %B: type = class_type @B [template] // CHECK:STDOUT: %B.elem: type = unbound_element_type %B, %i32 [template] // CHECK:STDOUT: %struct_type.b: type = struct_type {.b: %i32} [template] -// CHECK:STDOUT: %complete_type.2: = complete_type_witness %struct_type.b [template] +// CHECK:STDOUT: %complete_type.4: = complete_type_witness %struct_type.b [template] // CHECK:STDOUT: %AccessBInA.type: type = fn_type @AccessBInA [template] // CHECK:STDOUT: %AccessBInA: %AccessBInA.type = struct_value () [template] // CHECK:STDOUT: } @@ -48,7 +46,7 @@ fn AccessBInA(a: A) -> i32 { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -72,9 +70,7 @@ fn AccessBInA(a: A) -> i32 { // CHECK:STDOUT: } { // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%A] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc19_24.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc19_24.2: type = converted %int.make_type_signed, %.loc19_24.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %A = value_param runtime_param0 // CHECK:STDOUT: %a: %A = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 @@ -84,29 +80,25 @@ fn AccessBInA(a: A) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: class @A { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc12_10.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc12_10.2: type = converted %int.make_type_signed, %.loc12_10.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc12_8: %A.elem = field_decl a, element0 [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a [template = constants.%complete_type.1] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc12: %A.elem = field_decl a, element0 [template] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a [template = constants.%complete_type.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%A -// CHECK:STDOUT: .a = %.loc12_8 +// CHECK:STDOUT: .a = %.loc12 // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @B { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc16_10.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc16_10.2: type = converted %int.make_type_signed, %.loc16_10.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc16_8: %B.elem = field_decl b, element0 [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.b [template = constants.%complete_type.2] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc16: %B.elem = field_decl b, element0 [template] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.b [template = constants.%complete_type.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%B -// CHECK:STDOUT: .b = %.loc16_8 +// CHECK:STDOUT: .b = %.loc16 // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } // CHECK:STDOUT: @@ -114,7 +106,7 @@ fn AccessBInA(a: A) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %A = name_ref a, %a // CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [template = constants.%B] -// CHECK:STDOUT: %b.ref: %B.elem = name_ref b, @B.%.loc16_8 [template = @B.%.loc16_8] +// CHECK:STDOUT: %b.ref: %B.elem = name_ref b, @B.%.loc16 [template = @B.%.loc16] // CHECK:STDOUT: %.loc26_11.1: %B = converted %a.ref, [template = ] // CHECK:STDOUT: %.loc26_11.2: %i32 = class_element_access , element0 [template = ] // CHECK:STDOUT: return diff --git a/toolchain/check/testdata/class/fail_derived_to_base.carbon b/toolchain/check/testdata/class/fail_derived_to_base.carbon index 2d9ef7c6f38b4..a4cbf0c1d80ab 100644 --- a/toolchain/check/testdata/class/fail_derived_to_base.carbon +++ b/toolchain/check/testdata/class/fail_derived_to_base.carbon @@ -45,19 +45,17 @@ fn ConvertIncomplete(p: Incomplete*) -> A2* { return p; } // CHECK:STDOUT: constants { // CHECK:STDOUT: %A1: type = class_type @A1 [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %A1.elem: type = unbound_element_type %A1, %i32 [template] // CHECK:STDOUT: %struct_type.a: type = struct_type {.a: %i32} [template] -// CHECK:STDOUT: %complete_type.1: = complete_type_witness %struct_type.a [template] +// CHECK:STDOUT: %complete_type.3: = complete_type_witness %struct_type.a [template] // CHECK:STDOUT: %A2: type = class_type @A2 [template] // CHECK:STDOUT: %A2.elem: type = unbound_element_type %A2, %i32 [template] // CHECK:STDOUT: %B2: type = class_type @B2 [template] // CHECK:STDOUT: %B2.elem.1: type = unbound_element_type %B2, %A2 [template] // CHECK:STDOUT: %B2.elem.2: type = unbound_element_type %B2, %i32 [template] // CHECK:STDOUT: %struct_type.base.b.1: type = struct_type {.base: %A2, .b: %i32} [template] -// CHECK:STDOUT: %complete_type.2: = complete_type_witness %struct_type.base.b.1 [template] +// CHECK:STDOUT: %complete_type.4: = complete_type_witness %struct_type.base.b.1 [template] // CHECK:STDOUT: %ptr.2: type = ptr_type %B2 [template] // CHECK:STDOUT: %ptr.3: type = ptr_type %A1 [template] // CHECK:STDOUT: %ConvertUnrelated.type: type = fn_type @ConvertUnrelated [template] @@ -72,7 +70,7 @@ fn ConvertIncomplete(p: Incomplete*) -> A2* { return p; } // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -127,29 +125,25 @@ fn ConvertIncomplete(p: Incomplete*) -> A2* { return p; } // CHECK:STDOUT: // CHECK:STDOUT: class @A1 { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc12_10.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc12_10.2: type = converted %int.make_type_signed, %.loc12_10.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc12_8: %A1.elem = field_decl a, element0 [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a [template = constants.%complete_type.1] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc12: %A1.elem = field_decl a, element0 [template] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a [template = constants.%complete_type.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%A1 -// CHECK:STDOUT: .a = %.loc12_8 +// CHECK:STDOUT: .a = %.loc12 // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @A2 { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc16_10.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc16_10.2: type = converted %int.make_type_signed, %.loc16_10.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc16_8: %A2.elem = field_decl a, element0 [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a [template = constants.%complete_type.1] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc16: %A2.elem = field_decl a, element0 [template] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a [template = constants.%complete_type.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%A2 -// CHECK:STDOUT: .a = %.loc16_8 +// CHECK:STDOUT: .a = %.loc16 // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } // CHECK:STDOUT: @@ -157,16 +151,14 @@ fn ConvertIncomplete(p: Incomplete*) -> A2* { return p; } // CHECK:STDOUT: %A2.ref: type = name_ref A2, file.%A2.decl [template = constants.%A2] // CHECK:STDOUT: %.loc20: %B2.elem.1 = base_decl %A2.ref, element0 [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc21_10.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc21_10.2: type = converted %int.make_type_signed, %.loc21_10.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc21_8: %B2.elem.2 = field_decl b, element1 [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.base.b.1 [template = constants.%complete_type.2] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc21: %B2.elem.2 = field_decl b, element1 [template] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.base.b.1 [template = constants.%complete_type.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%B2 // CHECK:STDOUT: .base = %.loc20 -// CHECK:STDOUT: .b = %.loc21_8 +// CHECK:STDOUT: .b = %.loc21 // CHECK:STDOUT: extend %A2.ref // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/fail_field_modifiers.carbon b/toolchain/check/testdata/class/fail_field_modifiers.carbon index 9277231dc92a9..45a26d9633d07 100644 --- a/toolchain/check/testdata/class/fail_field_modifiers.carbon +++ b/toolchain/check/testdata/class/fail_field_modifiers.carbon @@ -39,30 +39,28 @@ class Class { // CHECK:STDOUT: constants { // CHECK:STDOUT: %Class: type = class_type @Class [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %Class.elem: type = unbound_element_type %Class, %i32 [template] // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_0.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] // CHECK:STDOUT: %struct_type.j.k: type = struct_type {.j: %i32, .k: %i32} [template] -// CHECK:STDOUT: %complete_type.3: = complete_type_witness %struct_type.j.k [template] +// CHECK:STDOUT: %complete_type.4: = complete_type_witness %struct_type.j.k [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -79,21 +77,15 @@ class Class { // CHECK:STDOUT: // CHECK:STDOUT: class @Class { // CHECK:STDOUT: %int_32.loc17: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc17: init type = call constants.%Int(%int_32.loc17) [template = constants.%i32] -// CHECK:STDOUT: %.loc17_18.1: type = value_of_initializer %int.make_type_signed.loc17 [template = constants.%i32] -// CHECK:STDOUT: %.loc17_18.2: type = converted %int.make_type_signed.loc17, %.loc17_18.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc17_16: %Class.elem = field_decl j, element0 [template] +// CHECK:STDOUT: %i32.loc17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc17: %Class.elem = field_decl j, element0 [template] // CHECK:STDOUT: %int_32.loc23: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc23: init type = call constants.%Int(%int_32.loc23) [template = constants.%i32] -// CHECK:STDOUT: %.loc23_16.1: type = value_of_initializer %int.make_type_signed.loc23 [template = constants.%i32] -// CHECK:STDOUT: %.loc23_16.2: type = converted %int.make_type_signed.loc23, %.loc23_16.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc23_14: %Class.elem = field_decl k, element1 [template] +// CHECK:STDOUT: %i32.loc23: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc23: %Class.elem = field_decl k, element1 [template] // CHECK:STDOUT: %int_32.loc29: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc29: init type = call constants.%Int(%int_32.loc29) [template = constants.%i32] -// CHECK:STDOUT: %.loc29_18.1: type = value_of_initializer %int.make_type_signed.loc29 [template = constants.%i32] -// CHECK:STDOUT: %.loc29_18.2: type = converted %int.make_type_signed.loc29, %.loc29_18.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc29: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0.loc29: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc29: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc29: = bound_method %int_0, %impl.elem0.loc29 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc29: = specific_function %Convert.bound.loc29, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc29: init %i32 = call %Convert.specific_fn.loc29(%int_0) [template = constants.%int_0.2] @@ -101,23 +93,21 @@ class Class { // CHECK:STDOUT: %.loc29_25.2: %i32 = converted %int_0, %.loc29_25.1 [template = constants.%int_0.2] // CHECK:STDOUT: %l: %i32 = bind_name l, %.loc29_25.2 // CHECK:STDOUT: %int_32.loc34: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc34: init type = call constants.%Int(%int_32.loc34) [template = constants.%i32] -// CHECK:STDOUT: %.loc34_16.1: type = value_of_initializer %int.make_type_signed.loc34 [template = constants.%i32] -// CHECK:STDOUT: %.loc34_16.2: type = converted %int.make_type_signed.loc34, %.loc34_16.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc34: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc34: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc34: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc34: = bound_method %int_1, %impl.elem0.loc34 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc34: = specific_function %Convert.bound.loc34, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc34: init %i32 = call %Convert.specific_fn.loc34(%int_1) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc34_23.1: %i32 = value_of_initializer %int.convert_checked.loc34 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc34_23.2: %i32 = converted %int_1, %.loc34_23.1 [template = constants.%int_1.2] // CHECK:STDOUT: %m: %i32 = bind_name m, %.loc34_23.2 -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.j.k [template = constants.%complete_type.3] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.j.k [template = constants.%complete_type.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class -// CHECK:STDOUT: .j = %.loc17_16 -// CHECK:STDOUT: .k = %.loc23_14 +// CHECK:STDOUT: .j = %.loc17 +// CHECK:STDOUT: .k = %.loc23 // CHECK:STDOUT: .l = %l // CHECK:STDOUT: .m = %m // CHECK:STDOUT: complete_type_witness = %complete_type diff --git a/toolchain/check/testdata/class/fail_generic_method.carbon b/toolchain/check/testdata/class/fail_generic_method.carbon index 699ee973995c6..159e1833d04dd 100644 --- a/toolchain/check/testdata/class/fail_generic_method.carbon +++ b/toolchain/check/testdata/class/fail_generic_method.carbon @@ -39,25 +39,23 @@ fn Class(N:! i32).F[self: Self](n: T) {} // CHECK:STDOUT: %Class.type: type = generic_class_type @Class [template] // CHECK:STDOUT: %Class.generic: %Class.type = struct_value () [template] // CHECK:STDOUT: %Class: type = class_type @Class, @Class(%T) [symbolic] -// CHECK:STDOUT: %require_complete: = require_complete_type %T [symbolic] +// CHECK:STDOUT: %require_complete.1: = require_complete_type %T [symbolic] // CHECK:STDOUT: %Class.elem: type = unbound_element_type %Class, %T [symbolic] // CHECK:STDOUT: %F.type: type = fn_type @F, @Class(%T) [symbolic] // CHECK:STDOUT: %F: %F.type = struct_value () [symbolic] // CHECK:STDOUT: %struct_type.a: type = struct_type {.a: %T} [symbolic] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a [symbolic] +// CHECK:STDOUT: %complete_type.1: = complete_type_witness %struct_type.a [symbolic] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] -// CHECK:STDOUT: %N: %i32 = bind_symbolic_name N, 0 [symbolic] -// CHECK:STDOUT: %N.patt: %i32 = symbolic_binding_pattern N, 0 [symbolic] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] +// CHECK:STDOUT: %N.2: %i32 = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %N.patt.2: %i32 = symbolic_binding_pattern N, 0 [symbolic] // CHECK:STDOUT: %.type: type = fn_type @.1 [template] // CHECK:STDOUT: %.1: %.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -83,11 +81,9 @@ fn Class(N:! i32).F[self: Self](n: T) {} // CHECK:STDOUT: %n.param_patt: = value_param_pattern %n.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc32_14.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc32_14.2: type = converted %int.make_type_signed, %.loc32_14.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %N.param: %i32 = value_param runtime_param -// CHECK:STDOUT: %N.loc32_10.1: %i32 = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc32_10.2 (constants.%N)] +// CHECK:STDOUT: %N.loc32_10.1: %i32 = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc32_10.2 (constants.%N.2)] // CHECK:STDOUT: %Self.ref: = name_ref Self, [template = ] // CHECK:STDOUT: %T.ref: = name_ref T, [template = ] // CHECK:STDOUT: %self.param: = value_param runtime_param0 @@ -102,13 +98,13 @@ fn Class(N:! i32).F[self: Self](n: T) {} // CHECK:STDOUT: %T.patt.loc11_13.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc11_13.2 (constants.%T.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete: = require_complete_type @Class.%T.loc11_13.2 (%T) [symbolic = %require_complete (constants.%require_complete)] +// CHECK:STDOUT: %require_complete: = require_complete_type @Class.%T.loc11_13.2 (%T) [symbolic = %require_complete (constants.%require_complete.1)] // CHECK:STDOUT: %Class: type = class_type @Class, @Class(%T.loc11_13.2) [symbolic = %Class (constants.%Class)] // CHECK:STDOUT: %Class.elem: type = unbound_element_type @Class.%Class (%Class), @Class.%T.loc11_13.2 (%T) [symbolic = %Class.elem (constants.%Class.elem)] // CHECK:STDOUT: %F.type: type = fn_type @F, @Class(%T.loc11_13.2) [symbolic = %F.type (constants.%F.type)] // CHECK:STDOUT: %F: @Class.%F.type (%F.type) = struct_value () [symbolic = %F (constants.%F)] // CHECK:STDOUT: %struct_type.a: type = struct_type {.a: @Class.%T.loc11_13.2 (%T)} [symbolic = %struct_type.a (constants.%struct_type.a)] -// CHECK:STDOUT: %complete_type.loc14_1.2: = complete_type_witness @Class.%struct_type.a (%struct_type.a) [symbolic = %complete_type.loc14_1.2 (constants.%complete_type)] +// CHECK:STDOUT: %complete_type.loc14_1.2: = complete_type_witness @Class.%struct_type.a (%struct_type.a) [symbolic = %complete_type.loc14_1.2 (constants.%complete_type.1)] // CHECK:STDOUT: // CHECK:STDOUT: class { // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc11_13.1 [symbolic = %T.loc11_13.2 (constants.%T)] @@ -127,7 +123,7 @@ fn Class(N:! i32).F[self: Self](n: T) {} // CHECK:STDOUT: %n.param: @F.%T (%T) = value_param runtime_param1 // CHECK:STDOUT: %n: @F.%T (%T) = bind_name n, %n.param // CHECK:STDOUT: } -// CHECK:STDOUT: %complete_type.loc14_1.1: = complete_type_witness %struct_type.a [symbolic = %complete_type.loc14_1.2 (constants.%complete_type)] +// CHECK:STDOUT: %complete_type.loc14_1.1: = complete_type_witness %struct_type.a [symbolic = %complete_type.loc14_1.2 (constants.%complete_type.1)] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class @@ -145,8 +141,8 @@ fn Class(N:! i32).F[self: Self](n: T) {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @.1(%N.loc32_10.1: %i32) { -// CHECK:STDOUT: %N.loc32_10.2: %i32 = bind_symbolic_name N, 0 [symbolic = %N.loc32_10.2 (constants.%N)] -// CHECK:STDOUT: %N.patt: %i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %N.loc32_10.2: %i32 = bind_symbolic_name N, 0 [symbolic = %N.loc32_10.2 (constants.%N.2)] +// CHECK:STDOUT: %N.patt: %i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt.2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: @@ -176,8 +172,8 @@ fn Class(N:! i32).F[self: Self](n: T) {} // CHECK:STDOUT: %T.patt.loc11_13.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @.1(constants.%N) { -// CHECK:STDOUT: %N.loc32_10.2 => constants.%N -// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: specific @.1(constants.%N.2) { +// CHECK:STDOUT: %N.loc32_10.2 => constants.%N.2 +// CHECK:STDOUT: %N.patt => constants.%N.2 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/fail_incomplete.carbon b/toolchain/check/testdata/class/fail_incomplete.carbon index b21382bba518c..982296f8646ad 100644 --- a/toolchain/check/testdata/class/fail_incomplete.carbon +++ b/toolchain/check/testdata/class/fail_incomplete.carbon @@ -187,9 +187,7 @@ class C { // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] // CHECK:STDOUT: %ptr.1: type = ptr_type %Class [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] // CHECK:STDOUT: %MemberAccess.type: type = fn_type @MemberAccess [template] @@ -209,14 +207,14 @@ class C { // CHECK:STDOUT: %IncompleteAddrSelf: type = class_type @IncompleteAddrSelf [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %complete_type.3: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %CallIncompleteAddrSelf.type: type = fn_type @CallIncompleteAddrSelf [template] // CHECK:STDOUT: %CallIncompleteAddrSelf: %CallIncompleteAddrSelf.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -264,9 +262,7 @@ class C { // CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class] // CHECK:STDOUT: %ptr: type = ptr_type %Class [template = constants.%ptr.1] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc44_20.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc44_20.2: type = converted %int.make_type_signed, %.loc44_20.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %p.param: %ptr.1 = value_param runtime_param0 // CHECK:STDOUT: %p: %ptr.1 = bind_name p, %p.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 @@ -281,9 +277,7 @@ class C { // CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class] // CHECK:STDOUT: %ptr: type = ptr_type %Class [template = constants.%ptr.1] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc55_31.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc55_31.2: type = converted %int.make_type_signed, %.loc55_31.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %p.param: %ptr.1 = value_param runtime_param0 // CHECK:STDOUT: %p: %ptr.1 = bind_name p, %p.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 @@ -363,7 +357,7 @@ class C { // CHECK:STDOUT: %self.param: %ptr.1 = value_param runtime_param0 // CHECK:STDOUT: %self: %ptr.1 = bind_name self, %self.param // CHECK:STDOUT: } -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%IncompleteAddrSelf diff --git a/toolchain/check/testdata/class/fail_init.carbon b/toolchain/check/testdata/class/fail_init.carbon index 461a2839c8733..f713a96dec8f3 100644 --- a/toolchain/check/testdata/class/fail_init.carbon +++ b/toolchain/check/testdata/class/fail_init.carbon @@ -35,12 +35,10 @@ fn F() { // CHECK:STDOUT: constants { // CHECK:STDOUT: %Class: type = class_type @Class [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %Class.elem: type = unbound_element_type %Class, %i32 [template] // CHECK:STDOUT: %struct_type.a.b: type = struct_type {.a: %i32, .b: %i32} [template] -// CHECK:STDOUT: %complete_type.1: = complete_type_witness %struct_type.a.b [template] +// CHECK:STDOUT: %complete_type.3: = complete_type_witness %struct_type.a.b [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] @@ -48,10 +46,10 @@ fn F() { // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %struct_type.a.c: type = struct_type {.a: Core.IntLiteral, .c: Core.IntLiteral} [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template] @@ -61,7 +59,7 @@ fn F() { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -80,21 +78,17 @@ fn F() { // CHECK:STDOUT: // CHECK:STDOUT: class @Class { // CHECK:STDOUT: %int_32.loc12: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc12: init type = call constants.%Int(%int_32.loc12) [template = constants.%i32] -// CHECK:STDOUT: %.loc12_10.1: type = value_of_initializer %int.make_type_signed.loc12 [template = constants.%i32] -// CHECK:STDOUT: %.loc12_10.2: type = converted %int.make_type_signed.loc12, %.loc12_10.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc12_8: %Class.elem = field_decl a, element0 [template] +// CHECK:STDOUT: %i32.loc12: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc12: %Class.elem = field_decl a, element0 [template] // CHECK:STDOUT: %int_32.loc13: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc13: init type = call constants.%Int(%int_32.loc13) [template = constants.%i32] -// CHECK:STDOUT: %.loc13_10.1: type = value_of_initializer %int.make_type_signed.loc13 [template = constants.%i32] -// CHECK:STDOUT: %.loc13_10.2: type = converted %int.make_type_signed.loc13, %.loc13_10.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc13_8: %Class.elem = field_decl b, element1 [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a.b [template = constants.%complete_type.1] +// CHECK:STDOUT: %i32.loc13: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc13: %Class.elem = field_decl b, element1 [template] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a.b [template = constants.%complete_type.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class -// CHECK:STDOUT: .a = %.loc12_8 -// CHECK:STDOUT: .b = %.loc13_8 +// CHECK:STDOUT: .a = %.loc12 +// CHECK:STDOUT: .b = %.loc13 // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } // CHECK:STDOUT: @@ -110,7 +104,7 @@ fn F() { // CHECK:STDOUT: %int_2.loc26: Core.IntLiteral = int_value 2 [template = constants.%int_2] // CHECK:STDOUT: %.loc26_18.1: %struct_type.a.c = struct_literal (%int_1.loc26, %int_2.loc26) // CHECK:STDOUT: %Class.ref.loc26: type = name_ref Class, file.%Class.decl [template = constants.%Class] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1.loc26, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_1.loc26) [template = constants.%int_1.2] diff --git a/toolchain/check/testdata/class/fail_init_as_inplace.carbon b/toolchain/check/testdata/class/fail_init_as_inplace.carbon index 85d03a93dba8d..b25bb19094bf6 100644 --- a/toolchain/check/testdata/class/fail_init_as_inplace.carbon +++ b/toolchain/check/testdata/class/fail_init_as_inplace.carbon @@ -31,13 +31,11 @@ fn F() { // CHECK:STDOUT: constants { // CHECK:STDOUT: %Class: type = class_type @Class [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %Class.elem: type = unbound_element_type %Class, %i32 [template] // CHECK:STDOUT: %struct_type.a.b.1: type = struct_type {.a: %i32, .b: %i32} [template] -// CHECK:STDOUT: %complete_type.1: = complete_type_witness %struct_type.a.b.1 [template] +// CHECK:STDOUT: %complete_type.3: = complete_type_witness %struct_type.a.b.1 [template] // CHECK:STDOUT: %ptr.1: type = ptr_type %Class [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] @@ -47,13 +45,13 @@ fn F() { // CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %struct_type.a.b.2: type = struct_type {.a: Core.IntLiteral, .b: Core.IntLiteral} [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] // CHECK:STDOUT: %Class.val: %Class = struct_value (%int_1.2, %int_2.2) [template] @@ -62,7 +60,7 @@ fn F() { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -91,21 +89,17 @@ fn F() { // CHECK:STDOUT: // CHECK:STDOUT: class @Class { // CHECK:STDOUT: %int_32.loc12: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc12: init type = call constants.%Int(%int_32.loc12) [template = constants.%i32] -// CHECK:STDOUT: %.loc12_10.1: type = value_of_initializer %int.make_type_signed.loc12 [template = constants.%i32] -// CHECK:STDOUT: %.loc12_10.2: type = converted %int.make_type_signed.loc12, %.loc12_10.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc12_8: %Class.elem = field_decl a, element0 [template] +// CHECK:STDOUT: %i32.loc12: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc12: %Class.elem = field_decl a, element0 [template] // CHECK:STDOUT: %int_32.loc13: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc13: init type = call constants.%Int(%int_32.loc13) [template = constants.%i32] -// CHECK:STDOUT: %.loc13_10.1: type = value_of_initializer %int.make_type_signed.loc13 [template = constants.%i32] -// CHECK:STDOUT: %.loc13_10.2: type = converted %int.make_type_signed.loc13, %.loc13_10.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc13_8: %Class.elem = field_decl b, element1 [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a.b.1 [template = constants.%complete_type.1] +// CHECK:STDOUT: %i32.loc13: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc13: %Class.elem = field_decl b, element1 [template] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a.b.1 [template = constants.%complete_type.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class -// CHECK:STDOUT: .a = %.loc12_8 -// CHECK:STDOUT: .b = %.loc13_8 +// CHECK:STDOUT: .a = %.loc12 +// CHECK:STDOUT: .b = %.loc13 // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } // CHECK:STDOUT: @@ -120,7 +114,7 @@ fn F() { // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %.loc25_33.1: %struct_type.a.b.2 = struct_literal (%int_1, %int_2) // CHECK:STDOUT: %Class.ref.loc25_38: type = name_ref Class, file.%Class.decl [template = constants.%Class] -// CHECK:STDOUT: %impl.elem0.loc25_33.1: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc25_33.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc25_33.1: = bound_method %int_1, %impl.elem0.loc25_33.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc25_33.1: = specific_function %Convert.bound.loc25_33.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc25_33.1: init %i32 = call %Convert.specific_fn.loc25_33.1(%int_1) [template = constants.%int_1.2] @@ -128,7 +122,7 @@ fn F() { // CHECK:STDOUT: %.loc25_33.3: ref %Class = temporary_storage // CHECK:STDOUT: %.loc25_33.4: ref %i32 = class_element_access %.loc25_33.3, element0 // CHECK:STDOUT: %.loc25_33.5: init %i32 = initialize_from %.loc25_33.2 to %.loc25_33.4 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc25_33.2: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc25_33.2: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc25_33.2: = bound_method %int_2, %impl.elem0.loc25_33.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc25_33.2: = specific_function %Convert.bound.loc25_33.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc25_33.2: init %i32 = call %Convert.specific_fn.loc25_33.2(%int_2) [template = constants.%int_2.2] diff --git a/toolchain/check/testdata/class/fail_member_of_let.carbon b/toolchain/check/testdata/class/fail_member_of_let.carbon index fef660637c490..ef0e209f2ff32 100644 --- a/toolchain/check/testdata/class/fail_member_of_let.carbon +++ b/toolchain/check/testdata/class/fail_member_of_let.carbon @@ -30,20 +30,18 @@ fn T.F() {} // CHECK:STDOUT: constants { // CHECK:STDOUT: %Class: type = class_type @Class [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %complete_type.2: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %.type: type = fn_type @.1 [template] // CHECK:STDOUT: %.1: %.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -66,13 +64,11 @@ fn T.F() {} // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc12_13.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc12_13.2: type = converted %int.make_type_signed, %.loc12_13.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.2] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class diff --git a/toolchain/check/testdata/class/fail_scope.carbon b/toolchain/check/testdata/class/fail_scope.carbon index dae0ca2e4bd4a..634f57c17370a 100644 --- a/toolchain/check/testdata/class/fail_scope.carbon +++ b/toolchain/check/testdata/class/fail_scope.carbon @@ -26,19 +26,17 @@ fn G() -> i32 { // CHECK:STDOUT: constants { // CHECK:STDOUT: %Class: type = class_type @Class [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] -// CHECK:STDOUT: %complete_type.1: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %complete_type.2: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] @@ -48,7 +46,7 @@ fn G() -> i32 { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -67,9 +65,7 @@ fn G() -> i32 { // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc17_11.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc17_11.2: type = converted %int.make_type_signed, %.loc17_11.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } @@ -81,13 +77,11 @@ fn G() -> i32 { // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc12_13.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc12_13.2: type = converted %int.make_type_signed, %.loc12_13.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.2] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class @@ -98,7 +92,7 @@ fn G() -> i32 { // CHECK:STDOUT: fn @F() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_1) [template = constants.%int_1.2] diff --git a/toolchain/check/testdata/class/fail_unbound_field.carbon b/toolchain/check/testdata/class/fail_unbound_field.carbon index 2422a432b7718..3c28b48a51fb6 100644 --- a/toolchain/check/testdata/class/fail_unbound_field.carbon +++ b/toolchain/check/testdata/class/fail_unbound_field.carbon @@ -31,21 +31,19 @@ fn G() -> i32 { // CHECK:STDOUT: constants { // CHECK:STDOUT: %Class: type = class_type @Class [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %Class.elem: type = unbound_element_type %Class, %i32 [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %struct_type.field: type = struct_type {.field: %i32} [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.field [template] +// CHECK:STDOUT: %complete_type.3: = complete_type_witness %struct_type.field [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -64,9 +62,7 @@ fn G() -> i32 { // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc22_11.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc22_11.2: type = converted %int.make_type_signed, %.loc22_11.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } @@ -74,40 +70,36 @@ fn G() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: class @Class { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc12_14.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc12_14.2: type = converted %int.make_type_signed, %.loc12_14.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc12_12: %Class.elem = field_decl field, element0 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc12: %Class.elem = field_decl field, element0 [template] // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc13_13.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc13_13.2: type = converted %int.make_type_signed, %.loc13_13.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.field [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.field [template = constants.%complete_type.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class -// CHECK:STDOUT: .field = %.loc12_12 +// CHECK:STDOUT: .field = %.loc12 // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F() -> %i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %field.ref: %Class.elem = name_ref field, @Class.%.loc12_12 [template = @Class.%.loc12_12] +// CHECK:STDOUT: %field.ref: %Class.elem = name_ref field, @Class.%.loc12 [template = @Class.%.loc12] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @G() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class] -// CHECK:STDOUT: %field.ref: %Class.elem = name_ref field, @Class.%.loc12_12 [template = @Class.%.loc12_12] +// CHECK:STDOUT: %field.ref: %Class.elem = name_ref field, @Class.%.loc12 [template = @Class.%.loc12] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/fail_unknown_member.carbon b/toolchain/check/testdata/class/fail_unknown_member.carbon index af1131b3d35b4..f381b0f3297d3 100644 --- a/toolchain/check/testdata/class/fail_unknown_member.carbon +++ b/toolchain/check/testdata/class/fail_unknown_member.carbon @@ -25,19 +25,17 @@ fn G(c: Class) -> i32 { // CHECK:STDOUT: constants { // CHECK:STDOUT: %Class: type = class_type @Class [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %Class.elem: type = unbound_element_type %Class, %i32 [template] // CHECK:STDOUT: %struct_type.n: type = struct_type {.n: %i32} [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.n [template] +// CHECK:STDOUT: %complete_type.3: = complete_type_witness %struct_type.n [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -59,9 +57,7 @@ fn G(c: Class) -> i32 { // CHECK:STDOUT: } { // CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc15_19.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc15_19.2: type = converted %int.make_type_signed, %.loc15_19.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %c.param: %Class = value_param runtime_param0 // CHECK:STDOUT: %c: %Class = bind_name c, %c.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 @@ -71,15 +67,13 @@ fn G(c: Class) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: class @Class { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc12_10.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc12_10.2: type = converted %int.make_type_signed, %.loc12_10.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc12_8: %Class.elem = field_decl n, element0 [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.n [template = constants.%complete_type] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc12: %Class.elem = field_decl n, element0 [template] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.n [template = constants.%complete_type.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class -// CHECK:STDOUT: .n = %.loc12_8 +// CHECK:STDOUT: .n = %.loc12 // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/field_access.carbon b/toolchain/check/testdata/class/field_access.carbon index 9d43cd28cd1ae..e237f048eebc9 100644 --- a/toolchain/check/testdata/class/field_access.carbon +++ b/toolchain/check/testdata/class/field_access.carbon @@ -26,24 +26,22 @@ fn Run() { // CHECK:STDOUT: constants { // CHECK:STDOUT: %Class: type = class_type @Class [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %Class.elem: type = unbound_element_type %Class, %i32 [template] // CHECK:STDOUT: %struct_type.j.k: type = struct_type {.j: %i32, .k: %i32} [template] -// CHECK:STDOUT: %complete_type.1: = complete_type_witness %struct_type.j.k [template] +// CHECK:STDOUT: %complete_type.3: = complete_type_witness %struct_type.j.k [template] // CHECK:STDOUT: %Run.type: type = fn_type @Run [template] // CHECK:STDOUT: %Run: %Run.type = struct_value () [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] // CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] // CHECK:STDOUT: } @@ -51,7 +49,7 @@ fn Run() { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -70,21 +68,17 @@ fn Run() { // CHECK:STDOUT: // CHECK:STDOUT: class @Class { // CHECK:STDOUT: %int_32.loc12: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc12: init type = call constants.%Int(%int_32.loc12) [template = constants.%i32] -// CHECK:STDOUT: %.loc12_10.1: type = value_of_initializer %int.make_type_signed.loc12 [template = constants.%i32] -// CHECK:STDOUT: %.loc12_10.2: type = converted %int.make_type_signed.loc12, %.loc12_10.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc12_8: %Class.elem = field_decl j, element0 [template] +// CHECK:STDOUT: %i32.loc12: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc12: %Class.elem = field_decl j, element0 [template] // CHECK:STDOUT: %int_32.loc13: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc13: init type = call constants.%Int(%int_32.loc13) [template = constants.%i32] -// CHECK:STDOUT: %.loc13_10.1: type = value_of_initializer %int.make_type_signed.loc13 [template = constants.%i32] -// CHECK:STDOUT: %.loc13_10.2: type = converted %int.make_type_signed.loc13, %.loc13_10.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc13_8: %Class.elem = field_decl k, element1 [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.j.k [template = constants.%complete_type.1] +// CHECK:STDOUT: %i32.loc13: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc13: %Class.elem = field_decl k, element1 [template] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.j.k [template = constants.%complete_type.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class -// CHECK:STDOUT: .j = %.loc12_8 -// CHECK:STDOUT: .k = %.loc13_8 +// CHECK:STDOUT: .j = %.loc12 +// CHECK:STDOUT: .k = %.loc13 // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } // CHECK:STDOUT: @@ -94,44 +88,40 @@ fn Run() { // CHECK:STDOUT: %c.var: ref %Class = var c // CHECK:STDOUT: %c: ref %Class = bind_name c, %c.var // CHECK:STDOUT: %c.ref.loc18: ref %Class = name_ref c, %c -// CHECK:STDOUT: %j.ref.loc18: %Class.elem = name_ref j, @Class.%.loc12_8 [template = @Class.%.loc12_8] +// CHECK:STDOUT: %j.ref.loc18: %Class.elem = name_ref j, @Class.%.loc12 [template = @Class.%.loc12] // CHECK:STDOUT: %.loc18_4: ref %i32 = class_element_access %c.ref.loc18, element0 // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc18: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc18: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc18: = bound_method %int_1, %impl.elem0.loc18 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc18: = specific_function %Convert.bound.loc18, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc18: init %i32 = call %Convert.specific_fn.loc18(%int_1) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc18_7: init %i32 = converted %int_1, %int.convert_checked.loc18 [template = constants.%int_1.2] // CHECK:STDOUT: assign %.loc18_4, %.loc18_7 // CHECK:STDOUT: %c.ref.loc19: ref %Class = name_ref c, %c -// CHECK:STDOUT: %k.ref.loc19: %Class.elem = name_ref k, @Class.%.loc13_8 [template = @Class.%.loc13_8] +// CHECK:STDOUT: %k.ref.loc19: %Class.elem = name_ref k, @Class.%.loc13 [template = @Class.%.loc13] // CHECK:STDOUT: %.loc19_4: ref %i32 = class_element_access %c.ref.loc19, element1 // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %impl.elem0.loc19: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc19: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc19: = bound_method %int_2, %impl.elem0.loc19 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc19: = specific_function %Convert.bound.loc19, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc19: init %i32 = call %Convert.specific_fn.loc19(%int_2) [template = constants.%int_2.2] // CHECK:STDOUT: %.loc19_7: init %i32 = converted %int_2, %int.convert_checked.loc19 [template = constants.%int_2.2] // CHECK:STDOUT: assign %.loc19_4, %.loc19_7 // CHECK:STDOUT: %int_32.loc20: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc20: init type = call constants.%Int(%int_32.loc20) [template = constants.%i32] -// CHECK:STDOUT: %.loc20_11.1: type = value_of_initializer %int.make_type_signed.loc20 [template = constants.%i32] -// CHECK:STDOUT: %.loc20_11.2: type = converted %int.make_type_signed.loc20, %.loc20_11.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc20: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %cj.var: ref %i32 = var cj // CHECK:STDOUT: %cj: ref %i32 = bind_name cj, %cj.var // CHECK:STDOUT: %c.ref.loc20: ref %Class = name_ref c, %c -// CHECK:STDOUT: %j.ref.loc20: %Class.elem = name_ref j, @Class.%.loc12_8 [template = @Class.%.loc12_8] +// CHECK:STDOUT: %j.ref.loc20: %Class.elem = name_ref j, @Class.%.loc12 [template = @Class.%.loc12] // CHECK:STDOUT: %.loc20_18.1: ref %i32 = class_element_access %c.ref.loc20, element0 // CHECK:STDOUT: %.loc20_18.2: %i32 = bind_value %.loc20_18.1 // CHECK:STDOUT: assign %cj.var, %.loc20_18.2 // CHECK:STDOUT: %int_32.loc21: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc21: init type = call constants.%Int(%int_32.loc21) [template = constants.%i32] -// CHECK:STDOUT: %.loc21_11.1: type = value_of_initializer %int.make_type_signed.loc21 [template = constants.%i32] -// CHECK:STDOUT: %.loc21_11.2: type = converted %int.make_type_signed.loc21, %.loc21_11.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc21: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %ck.var: ref %i32 = var ck // CHECK:STDOUT: %ck: ref %i32 = bind_name ck, %ck.var // CHECK:STDOUT: %c.ref.loc21: ref %Class = name_ref c, %c -// CHECK:STDOUT: %k.ref.loc21: %Class.elem = name_ref k, @Class.%.loc13_8 [template = @Class.%.loc13_8] +// CHECK:STDOUT: %k.ref.loc21: %Class.elem = name_ref k, @Class.%.loc13 [template = @Class.%.loc13] // CHECK:STDOUT: %.loc21_18.1: ref %i32 = class_element_access %c.ref.loc21, element1 // CHECK:STDOUT: %.loc21_18.2: %i32 = bind_value %.loc21_18.1 // CHECK:STDOUT: assign %ck.var, %.loc21_18.2 diff --git a/toolchain/check/testdata/class/field_access_in_value.carbon b/toolchain/check/testdata/class/field_access_in_value.carbon index 9361826dc84bf..748ddba84a38b 100644 --- a/toolchain/check/testdata/class/field_access_in_value.carbon +++ b/toolchain/check/testdata/class/field_access_in_value.carbon @@ -27,24 +27,22 @@ fn Test() { // CHECK:STDOUT: constants { // CHECK:STDOUT: %Class: type = class_type @Class [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %Class.elem: type = unbound_element_type %Class, %i32 [template] // CHECK:STDOUT: %struct_type.j.k: type = struct_type {.j: %i32, .k: %i32} [template] -// CHECK:STDOUT: %complete_type.1: = complete_type_witness %struct_type.j.k [template] +// CHECK:STDOUT: %complete_type.3: = complete_type_witness %struct_type.j.k [template] // CHECK:STDOUT: %Test.type: type = fn_type @Test [template] // CHECK:STDOUT: %Test: %Test.type = struct_value () [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] // CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] // CHECK:STDOUT: } @@ -52,7 +50,7 @@ fn Test() { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -71,21 +69,17 @@ fn Test() { // CHECK:STDOUT: // CHECK:STDOUT: class @Class { // CHECK:STDOUT: %int_32.loc12: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc12: init type = call constants.%Int(%int_32.loc12) [template = constants.%i32] -// CHECK:STDOUT: %.loc12_10.1: type = value_of_initializer %int.make_type_signed.loc12 [template = constants.%i32] -// CHECK:STDOUT: %.loc12_10.2: type = converted %int.make_type_signed.loc12, %.loc12_10.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc12_8: %Class.elem = field_decl j, element0 [template] +// CHECK:STDOUT: %i32.loc12: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc12: %Class.elem = field_decl j, element0 [template] // CHECK:STDOUT: %int_32.loc13: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc13: init type = call constants.%Int(%int_32.loc13) [template = constants.%i32] -// CHECK:STDOUT: %.loc13_10.1: type = value_of_initializer %int.make_type_signed.loc13 [template = constants.%i32] -// CHECK:STDOUT: %.loc13_10.2: type = converted %int.make_type_signed.loc13, %.loc13_10.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc13_8: %Class.elem = field_decl k, element1 [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.j.k [template = constants.%complete_type.1] +// CHECK:STDOUT: %i32.loc13: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc13: %Class.elem = field_decl k, element1 [template] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.j.k [template = constants.%complete_type.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class -// CHECK:STDOUT: .j = %.loc12_8 -// CHECK:STDOUT: .k = %.loc13_8 +// CHECK:STDOUT: .j = %.loc12 +// CHECK:STDOUT: .k = %.loc13 // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } // CHECK:STDOUT: @@ -95,20 +89,20 @@ fn Test() { // CHECK:STDOUT: %cv.var: ref %Class = var cv // CHECK:STDOUT: %cv: ref %Class = bind_name cv, %cv.var // CHECK:STDOUT: %cv.ref.loc18: ref %Class = name_ref cv, %cv -// CHECK:STDOUT: %j.ref.loc18: %Class.elem = name_ref j, @Class.%.loc12_8 [template = @Class.%.loc12_8] +// CHECK:STDOUT: %j.ref.loc18: %Class.elem = name_ref j, @Class.%.loc12 [template = @Class.%.loc12] // CHECK:STDOUT: %.loc18_5: ref %i32 = class_element_access %cv.ref.loc18, element0 // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc18: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc18: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc18: = bound_method %int_1, %impl.elem0.loc18 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc18: = specific_function %Convert.bound.loc18, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc18: init %i32 = call %Convert.specific_fn.loc18(%int_1) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc18_8: init %i32 = converted %int_1, %int.convert_checked.loc18 [template = constants.%int_1.2] // CHECK:STDOUT: assign %.loc18_5, %.loc18_8 // CHECK:STDOUT: %cv.ref.loc19: ref %Class = name_ref cv, %cv -// CHECK:STDOUT: %k.ref.loc19: %Class.elem = name_ref k, @Class.%.loc13_8 [template = @Class.%.loc13_8] +// CHECK:STDOUT: %k.ref.loc19: %Class.elem = name_ref k, @Class.%.loc13 [template = @Class.%.loc13] // CHECK:STDOUT: %.loc19_5: ref %i32 = class_element_access %cv.ref.loc19, element1 // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %impl.elem0.loc19: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc19: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc19: = bound_method %int_2, %impl.elem0.loc19 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc19: = specific_function %Convert.bound.loc19, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc19: init %i32 = call %Convert.specific_fn.loc19(%int_2) [template = constants.%int_2.2] @@ -119,24 +113,20 @@ fn Test() { // CHECK:STDOUT: %.loc20: %Class = bind_value %cv.ref.loc20 // CHECK:STDOUT: %c: %Class = bind_name c, %.loc20 // CHECK:STDOUT: %int_32.loc21: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc21: init type = call constants.%Int(%int_32.loc21) [template = constants.%i32] -// CHECK:STDOUT: %.loc21_11.1: type = value_of_initializer %int.make_type_signed.loc21 [template = constants.%i32] -// CHECK:STDOUT: %.loc21_11.2: type = converted %int.make_type_signed.loc21, %.loc21_11.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc21: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %cj.var: ref %i32 = var cj // CHECK:STDOUT: %cj: ref %i32 = bind_name cj, %cj.var // CHECK:STDOUT: %c.ref.loc21: %Class = name_ref c, %c -// CHECK:STDOUT: %j.ref.loc21: %Class.elem = name_ref j, @Class.%.loc12_8 [template = @Class.%.loc12_8] +// CHECK:STDOUT: %j.ref.loc21: %Class.elem = name_ref j, @Class.%.loc12 [template = @Class.%.loc12] // CHECK:STDOUT: %.loc21_18.1: ref %i32 = class_element_access %c.ref.loc21, element0 // CHECK:STDOUT: %.loc21_18.2: %i32 = bind_value %.loc21_18.1 // CHECK:STDOUT: assign %cj.var, %.loc21_18.2 // CHECK:STDOUT: %int_32.loc22: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc22: init type = call constants.%Int(%int_32.loc22) [template = constants.%i32] -// CHECK:STDOUT: %.loc22_11.1: type = value_of_initializer %int.make_type_signed.loc22 [template = constants.%i32] -// CHECK:STDOUT: %.loc22_11.2: type = converted %int.make_type_signed.loc22, %.loc22_11.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %ck.var: ref %i32 = var ck // CHECK:STDOUT: %ck: ref %i32 = bind_name ck, %ck.var // CHECK:STDOUT: %c.ref.loc22: %Class = name_ref c, %c -// CHECK:STDOUT: %k.ref.loc22: %Class.elem = name_ref k, @Class.%.loc13_8 [template = @Class.%.loc13_8] +// CHECK:STDOUT: %k.ref.loc22: %Class.elem = name_ref k, @Class.%.loc13 [template = @Class.%.loc13] // CHECK:STDOUT: %.loc22_18.1: ref %i32 = class_element_access %c.ref.loc22, element1 // CHECK:STDOUT: %.loc22_18.2: %i32 = bind_value %.loc22_18.1 // CHECK:STDOUT: assign %ck.var, %.loc22_18.2 diff --git a/toolchain/check/testdata/class/generic/adapt.carbon b/toolchain/check/testdata/class/generic/adapt.carbon index 031f2b22e1f70..ea77155603697 100644 --- a/toolchain/check/testdata/class/generic/adapt.carbon +++ b/toolchain/check/testdata/class/generic/adapt.carbon @@ -128,27 +128,26 @@ fn ImportedConvertLocal(a: Adapter(C)) -> i32 { // CHECK:STDOUT: %C.type: type = generic_class_type @C [template] // CHECK:STDOUT: %C.generic: %C.type = struct_value () [template] // CHECK:STDOUT: %C.1: type = class_type @C, @C(%T) [symbolic] -// CHECK:STDOUT: %require_complete: = require_complete_type %T [symbolic] +// CHECK:STDOUT: %require_complete.1: = require_complete_type %T [symbolic] // CHECK:STDOUT: %C.elem.1: type = unbound_element_type %C.1, %T [symbolic] // CHECK:STDOUT: %struct_type.x.1: type = struct_type {.x: %T} [symbolic] // CHECK:STDOUT: %complete_type.1: = complete_type_witness %struct_type.x.1 [symbolic] // CHECK:STDOUT: %Adapter: type = class_type @Adapter [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %C.2: type = class_type @C, @C(%i32) [template] -// CHECK:STDOUT: %complete_type.2: = complete_type_witness %i32 [template] +// CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %complete_type.3: = complete_type_witness %i32.builtin [template] // CHECK:STDOUT: %C.elem.2: type = unbound_element_type %C.2, %i32 [template] // CHECK:STDOUT: %struct_type.x.2: type = struct_type {.x: %i32} [template] -// CHECK:STDOUT: %complete_type.3: = complete_type_witness %struct_type.x.2 [template] +// CHECK:STDOUT: %complete_type.4: = complete_type_witness %struct_type.x.2 [template] // CHECK:STDOUT: %Access.type: type = fn_type @Access [template] // CHECK:STDOUT: %Access: %Access.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -178,9 +177,7 @@ fn ImportedConvertLocal(a: Adapter(C)) -> i32 { // CHECK:STDOUT: } { // CHECK:STDOUT: %Adapter.ref: type = name_ref Adapter, file.%Adapter.decl [template = constants.%Adapter] // CHECK:STDOUT: %int_32.loc12: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc12: init type = call constants.%Int(%int_32.loc12) [template = constants.%i32] -// CHECK:STDOUT: %.loc12_26.1: type = value_of_initializer %int.make_type_signed.loc12 [template = constants.%i32] -// CHECK:STDOUT: %.loc12_26.2: type = converted %int.make_type_signed.loc12, %.loc12_26.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc12: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %Adapter = value_param runtime_param0 // CHECK:STDOUT: %a: %Adapter = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 @@ -193,7 +190,7 @@ fn ImportedConvertLocal(a: Adapter(C)) -> i32 { // CHECK:STDOUT: %T.patt.loc4_9.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_9.2 (constants.%T.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete: = require_complete_type @C.%T.loc4_9.2 (%T) [symbolic = %require_complete (constants.%require_complete)] +// CHECK:STDOUT: %require_complete: = require_complete_type @C.%T.loc4_9.2 (%T) [symbolic = %require_complete (constants.%require_complete.1)] // CHECK:STDOUT: %C: type = class_type @C, @C(%T.loc4_9.2) [symbolic = %C (constants.%C.1)] // CHECK:STDOUT: %C.elem: type = unbound_element_type @C.%C (%C.1), @C.%T.loc4_9.2 (%T) [symbolic = %C.elem (constants.%C.elem.1)] // CHECK:STDOUT: %struct_type.x: type = struct_type {.x: @C.%T.loc4_9.2 (%T)} [symbolic = %struct_type.x (constants.%struct_type.x.1)] @@ -214,12 +211,10 @@ fn ImportedConvertLocal(a: Adapter(C)) -> i32 { // CHECK:STDOUT: class @Adapter { // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [template = constants.%C.generic] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc9_14.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc9_14.2: type = converted %int.make_type_signed, %.loc9_14.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %C: type = class_type @C, @C(constants.%i32) [template = constants.%C.2] // CHECK:STDOUT: adapt_decl %C [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.x.2 [template = constants.%complete_type.3] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.x.2 [template = constants.%complete_type.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Adapter @@ -231,9 +226,7 @@ fn ImportedConvertLocal(a: Adapter(C)) -> i32 { // CHECK:STDOUT: %a.ref: %Adapter = name_ref a, %a // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [template = constants.%C.generic] // CHECK:STDOUT: %int_32.loc13: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc13: init type = call constants.%Int(%int_32.loc13) [template = constants.%i32] -// CHECK:STDOUT: %.loc13_21.1: type = value_of_initializer %int.make_type_signed.loc13 [template = constants.%i32] -// CHECK:STDOUT: %.loc13_21.2: type = converted %int.make_type_signed.loc13, %.loc13_21.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc13: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %C: type = class_type @C, @C(constants.%i32) [template = constants.%C.2] // CHECK:STDOUT: %.loc13_13.1: %C.2 = as_compatible %a.ref // CHECK:STDOUT: %.loc13_13.2: %C.2 = converted %a.ref, %.loc13_13.1 @@ -258,11 +251,11 @@ fn ImportedConvertLocal(a: Adapter(C)) -> i32 { // CHECK:STDOUT: %T.patt.loc4_9.2 => constants.%i32 // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete => constants.%complete_type.2 +// CHECK:STDOUT: %require_complete => constants.%complete_type.3 // CHECK:STDOUT: %C => constants.%C.2 // CHECK:STDOUT: %C.elem => constants.%C.elem.2 // CHECK:STDOUT: %struct_type.x => constants.%struct_type.x.2 -// CHECK:STDOUT: %complete_type.loc6_1.2 => constants.%complete_type.3 +// CHECK:STDOUT: %complete_type.loc6_1.2 => constants.%complete_type.4 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- import_adapt_specific_type.carbon @@ -270,23 +263,22 @@ fn ImportedConvertLocal(a: Adapter(C)) -> i32 { // CHECK:STDOUT: constants { // CHECK:STDOUT: %Adapter: type = class_type @Adapter [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %C.type: type = generic_class_type @C [template] // CHECK:STDOUT: %C.generic: %C.type = struct_value () [template] // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] // CHECK:STDOUT: %struct_type.x.1: type = struct_type {.x: %T} [symbolic] -// CHECK:STDOUT: %complete_type.1: = complete_type_witness %struct_type.x.1 [symbolic] +// CHECK:STDOUT: %complete_type.2: = complete_type_witness %struct_type.x.1 [symbolic] // CHECK:STDOUT: %C.1: type = class_type @C, @C(%T) [symbolic] // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %C.2: type = class_type @C, @C(%i32) [template] // CHECK:STDOUT: %struct_type.x.2: type = struct_type {.x: %i32} [template] -// CHECK:STDOUT: %complete_type.2: = complete_type_witness %struct_type.x.2 [template] -// CHECK:STDOUT: %require_complete: = require_complete_type %T [symbolic] +// CHECK:STDOUT: %complete_type.3: = complete_type_witness %struct_type.x.2 [template] +// CHECK:STDOUT: %require_complete.2: = require_complete_type %T [symbolic] // CHECK:STDOUT: %C.elem.1: type = unbound_element_type %C.1, %T [symbolic] -// CHECK:STDOUT: %complete_type.3: = complete_type_witness %i32 [template] +// CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %complete_type.4: = complete_type_witness %i32.builtin [template] // CHECK:STDOUT: %C.elem.2: type = unbound_element_type %C.2, %i32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] // CHECK:STDOUT: %ImportedAccess.type: type = fn_type @ImportedAccess [template] // CHECK:STDOUT: %ImportedAccess: %ImportedAccess.type = struct_value () [template] // CHECK:STDOUT: } @@ -296,15 +288,15 @@ fn ImportedConvertLocal(a: Adapter(C)) -> i32 { // CHECK:STDOUT: %import_ref.2: type = import_ref Main//adapt_specific_type, Adapter, loaded [template = constants.%Adapter] // CHECK:STDOUT: %import_ref.3 = import_ref Main//adapt_specific_type, Access, unloaded // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref.10 +// CHECK:STDOUT: .Int = %import_ref.13 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.4: = import_ref Main//adapt_specific_type, loc6_1, loaded [symbolic = @C.%complete_type (constants.%complete_type.1)] -// CHECK:STDOUT: %import_ref.5 = import_ref Main//adapt_specific_type, inst27 [no loc], unloaded -// CHECK:STDOUT: %import_ref.6: @C.%C.elem (%C.elem.1) = import_ref Main//adapt_specific_type, loc5_8, loaded [template = %.1] -// CHECK:STDOUT: %import_ref.8: = import_ref Main//adapt_specific_type, loc10_1, loaded [template = constants.%complete_type.2] -// CHECK:STDOUT: %import_ref.9 = import_ref Main//adapt_specific_type, inst42 [no loc], unloaded +// CHECK:STDOUT: %import_ref.7: = import_ref Main//adapt_specific_type, loc6_1, loaded [symbolic = @C.%complete_type (constants.%complete_type.2)] +// CHECK:STDOUT: %import_ref.8 = import_ref Main//adapt_specific_type, inst27 [no loc], unloaded +// CHECK:STDOUT: %import_ref.9: @C.%C.elem (%C.elem.1) = import_ref Main//adapt_specific_type, loc5_8, loaded [template = %.1] +// CHECK:STDOUT: %import_ref.11: = import_ref Main//adapt_specific_type, loc10_1, loaded [template = constants.%complete_type.3] +// CHECK:STDOUT: %import_ref.12 = import_ref Main//adapt_specific_type, inst42 [no loc], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -325,9 +317,7 @@ fn ImportedConvertLocal(a: Adapter(C)) -> i32 { // CHECK:STDOUT: } { // CHECK:STDOUT: %Adapter.ref: type = name_ref Adapter, imports.%import_ref.2 [template = constants.%Adapter] // CHECK:STDOUT: %int_32.loc6: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc6: init type = call constants.%Int(%int_32.loc6) [template = constants.%i32] -// CHECK:STDOUT: %.loc6_34.1: type = value_of_initializer %int.make_type_signed.loc6 [template = constants.%i32] -// CHECK:STDOUT: %.loc6_34.2: type = converted %int.make_type_signed.loc6, %.loc6_34.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc6: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %Adapter = value_param runtime_param0 // CHECK:STDOUT: %a: %Adapter = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 @@ -337,8 +327,8 @@ fn ImportedConvertLocal(a: Adapter(C)) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: class @Adapter [from "adapt_specific_type.carbon"] { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.9 -// CHECK:STDOUT: complete_type_witness = imports.%import_ref.8 +// CHECK:STDOUT: .Self = imports.%import_ref.12 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.11 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic class @C(constants.%T: type) [from "adapt_specific_type.carbon"] { @@ -346,17 +336,17 @@ fn ImportedConvertLocal(a: Adapter(C)) -> i32 { // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt (constants.%T.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete: = require_complete_type @C.%T (%T) [symbolic = %require_complete (constants.%require_complete)] +// CHECK:STDOUT: %require_complete: = require_complete_type @C.%T (%T) [symbolic = %require_complete (constants.%require_complete.2)] // CHECK:STDOUT: %C: type = class_type @C, @C(%T) [symbolic = %C (constants.%C.1)] // CHECK:STDOUT: %C.elem: type = unbound_element_type @C.%C (%C.1), @C.%T (%T) [symbolic = %C.elem (constants.%C.elem.1)] // CHECK:STDOUT: %struct_type.x: type = struct_type {.x: @C.%T (%T)} [symbolic = %struct_type.x (constants.%struct_type.x.1)] -// CHECK:STDOUT: %complete_type: = complete_type_witness @C.%struct_type.x (%struct_type.x.1) [symbolic = %complete_type (constants.%complete_type.1)] +// CHECK:STDOUT: %complete_type: = complete_type_witness @C.%struct_type.x (%struct_type.x.1) [symbolic = %complete_type (constants.%complete_type.2)] // CHECK:STDOUT: // CHECK:STDOUT: class { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.5 -// CHECK:STDOUT: .x = imports.%import_ref.6 -// CHECK:STDOUT: complete_type_witness = imports.%import_ref.4 +// CHECK:STDOUT: .Self = imports.%import_ref.8 +// CHECK:STDOUT: .x = imports.%import_ref.9 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.7 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -365,13 +355,11 @@ fn ImportedConvertLocal(a: Adapter(C)) -> i32 { // CHECK:STDOUT: %a.ref: %Adapter = name_ref a, %a // CHECK:STDOUT: %C.ref: %C.type = name_ref C, imports.%import_ref.1 [template = constants.%C.generic] // CHECK:STDOUT: %int_32.loc7: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc7: init type = call constants.%Int(%int_32.loc7) [template = constants.%i32] -// CHECK:STDOUT: %.loc7_21.1: type = value_of_initializer %int.make_type_signed.loc7 [template = constants.%i32] -// CHECK:STDOUT: %.loc7_21.2: type = converted %int.make_type_signed.loc7, %.loc7_21.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc7: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %C: type = class_type @C, @C(constants.%i32) [template = constants.%C.2] // CHECK:STDOUT: %.loc7_13.1: %C.2 = as_compatible %a.ref // CHECK:STDOUT: %.loc7_13.2: %C.2 = converted %a.ref, %.loc7_13.1 -// CHECK:STDOUT: %x.ref: %C.elem.2 = name_ref x, imports.%import_ref.6 [template = imports.%.1] +// CHECK:STDOUT: %x.ref: %C.elem.2 = name_ref x, imports.%import_ref.9 [template = imports.%.1] // CHECK:STDOUT: %.loc7_23.1: ref %i32 = class_element_access %.loc7_13.2, element0 // CHECK:STDOUT: %.loc7_23.2: %i32 = bind_value %.loc7_23.1 // CHECK:STDOUT: return %.loc7_23.2 @@ -387,11 +375,11 @@ fn ImportedConvertLocal(a: Adapter(C)) -> i32 { // CHECK:STDOUT: %T.patt => constants.%i32 // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete => constants.%complete_type.3 +// CHECK:STDOUT: %require_complete => constants.%complete_type.4 // CHECK:STDOUT: %C => constants.%C.2 // CHECK:STDOUT: %C.elem => constants.%C.elem.2 // CHECK:STDOUT: %struct_type.x => constants.%struct_type.x.2 -// CHECK:STDOUT: %complete_type => constants.%complete_type.2 +// CHECK:STDOUT: %complete_type => constants.%complete_type.3 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @C(%T) { @@ -413,14 +401,13 @@ fn ImportedConvertLocal(a: Adapter(C)) -> i32 { // CHECK:STDOUT: %complete_type.1: = complete_type_witness %struct_type.x.1 [symbolic] // CHECK:STDOUT: %Adapter: type = class_type @Adapter [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %C.2: type = class_type @C, @C(%i32) [template] -// CHECK:STDOUT: %complete_type.2: = complete_type_witness %i32 [template] +// CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %complete_type.3: = complete_type_witness %i32.builtin [template] // CHECK:STDOUT: %C.elem.2: type = unbound_element_type %C.2, %i32 [template] // CHECK:STDOUT: %struct_type.x.2: type = struct_type {.x: %i32} [template] -// CHECK:STDOUT: %complete_type.3: = complete_type_witness %struct_type.x.2 [template] +// CHECK:STDOUT: %complete_type.4: = complete_type_witness %struct_type.x.2 [template] // CHECK:STDOUT: %Access.type: type = fn_type @Access [template] // CHECK:STDOUT: %Access: %Access.type = struct_value () [template] // CHECK:STDOUT: } @@ -428,7 +415,7 @@ fn ImportedConvertLocal(a: Adapter(C)) -> i32 { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -458,9 +445,7 @@ fn ImportedConvertLocal(a: Adapter(C)) -> i32 { // CHECK:STDOUT: } { // CHECK:STDOUT: %Adapter.ref: type = name_ref Adapter, file.%Adapter.decl [template = constants.%Adapter] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc12_26.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc12_26.2: type = converted %int.make_type_signed, %.loc12_26.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %Adapter = value_param runtime_param0 // CHECK:STDOUT: %a: %Adapter = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 @@ -494,12 +479,10 @@ fn ImportedConvertLocal(a: Adapter(C)) -> i32 { // CHECK:STDOUT: class @Adapter { // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [template = constants.%C.generic] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc9_21.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc9_21.2: type = converted %int.make_type_signed, %.loc9_21.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %C: type = class_type @C, @C(constants.%i32) [template = constants.%C.2] // CHECK:STDOUT: adapt_decl %C [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.x.2 [template = constants.%complete_type.3] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.x.2 [template = constants.%complete_type.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Adapter @@ -531,11 +514,11 @@ fn ImportedConvertLocal(a: Adapter(C)) -> i32 { // CHECK:STDOUT: %T.patt.loc4_9.2 => constants.%i32 // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete => constants.%complete_type.2 +// CHECK:STDOUT: %require_complete => constants.%complete_type.3 // CHECK:STDOUT: %C => constants.%C.2 // CHECK:STDOUT: %C.elem => constants.%C.elem.2 // CHECK:STDOUT: %struct_type.x => constants.%struct_type.x.2 -// CHECK:STDOUT: %complete_type.loc6_1.2 => constants.%complete_type.3 +// CHECK:STDOUT: %complete_type.loc6_1.2 => constants.%complete_type.4 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- extend_adapt_specific_type_library.carbon @@ -546,25 +529,24 @@ fn ImportedConvertLocal(a: Adapter(C)) -> i32 { // CHECK:STDOUT: %C.type: type = generic_class_type @C [template] // CHECK:STDOUT: %C.generic: %C.type = struct_value () [template] // CHECK:STDOUT: %C.1: type = class_type @C, @C(%T) [symbolic] -// CHECK:STDOUT: %require_complete: = require_complete_type %T [symbolic] +// CHECK:STDOUT: %require_complete.1: = require_complete_type %T [symbolic] // CHECK:STDOUT: %C.elem.1: type = unbound_element_type %C.1, %T [symbolic] // CHECK:STDOUT: %struct_type.x.1: type = struct_type {.x: %T} [symbolic] // CHECK:STDOUT: %complete_type.1: = complete_type_witness %struct_type.x.1 [symbolic] // CHECK:STDOUT: %Adapter: type = class_type @Adapter [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %C.2: type = class_type @C, @C(%i32) [template] -// CHECK:STDOUT: %complete_type.2: = complete_type_witness %i32 [template] +// CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %complete_type.3: = complete_type_witness %i32.builtin [template] // CHECK:STDOUT: %C.elem.2: type = unbound_element_type %C.2, %i32 [template] // CHECK:STDOUT: %struct_type.x.2: type = struct_type {.x: %i32} [template] -// CHECK:STDOUT: %complete_type.3: = complete_type_witness %struct_type.x.2 [template] +// CHECK:STDOUT: %complete_type.4: = complete_type_witness %struct_type.x.2 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -592,7 +574,7 @@ fn ImportedConvertLocal(a: Adapter(C)) -> i32 { // CHECK:STDOUT: %T.patt.loc7_9.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc7_9.2 (constants.%T.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete: = require_complete_type @C.%T.loc7_9.2 (%T) [symbolic = %require_complete (constants.%require_complete)] +// CHECK:STDOUT: %require_complete: = require_complete_type @C.%T.loc7_9.2 (%T) [symbolic = %require_complete (constants.%require_complete.1)] // CHECK:STDOUT: %C: type = class_type @C, @C(%T.loc7_9.2) [symbolic = %C (constants.%C.1)] // CHECK:STDOUT: %C.elem: type = unbound_element_type @C.%C (%C.1), @C.%T.loc7_9.2 (%T) [symbolic = %C.elem (constants.%C.elem.1)] // CHECK:STDOUT: %struct_type.x: type = struct_type {.x: @C.%T.loc7_9.2 (%T)} [symbolic = %struct_type.x (constants.%struct_type.x.1)] @@ -613,12 +595,10 @@ fn ImportedConvertLocal(a: Adapter(C)) -> i32 { // CHECK:STDOUT: class @Adapter { // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [template = constants.%C.generic] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc12_21.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc12_21.2: type = converted %int.make_type_signed, %.loc12_21.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %C: type = class_type @C, @C(constants.%i32) [template = constants.%C.2] // CHECK:STDOUT: adapt_decl %C [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.x.2 [template = constants.%complete_type.3] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.x.2 [template = constants.%complete_type.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Adapter @@ -641,11 +621,11 @@ fn ImportedConvertLocal(a: Adapter(C)) -> i32 { // CHECK:STDOUT: %T.patt.loc7_9.2 => constants.%i32 // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete => constants.%complete_type.2 +// CHECK:STDOUT: %require_complete => constants.%complete_type.3 // CHECK:STDOUT: %C => constants.%C.2 // CHECK:STDOUT: %C.elem => constants.%C.elem.2 // CHECK:STDOUT: %struct_type.x => constants.%struct_type.x.2 -// CHECK:STDOUT: %complete_type.loc9_1.2 => constants.%complete_type.3 +// CHECK:STDOUT: %complete_type.loc9_1.2 => constants.%complete_type.4 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_todo_import_extend_adapt_specific_type.carbon @@ -653,21 +633,20 @@ fn ImportedConvertLocal(a: Adapter(C)) -> i32 { // CHECK:STDOUT: constants { // CHECK:STDOUT: %Adapter: type = class_type @Adapter [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] // CHECK:STDOUT: %struct_type.x.1: type = struct_type {.x: %T} [symbolic] -// CHECK:STDOUT: %complete_type.1: = complete_type_witness %struct_type.x.1 [symbolic] +// CHECK:STDOUT: %complete_type.2: = complete_type_witness %struct_type.x.1 [symbolic] // CHECK:STDOUT: %C.1: type = class_type @C, @C(%T) [symbolic] // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %C.2: type = class_type @C, @C(%i32) [template] // CHECK:STDOUT: %struct_type.x.2: type = struct_type {.x: %i32} [template] -// CHECK:STDOUT: %complete_type.2: = complete_type_witness %struct_type.x.2 [template] -// CHECK:STDOUT: %require_complete.1: = require_complete_type %T [symbolic] +// CHECK:STDOUT: %complete_type.3: = complete_type_witness %struct_type.x.2 [template] +// CHECK:STDOUT: %require_complete.2: = require_complete_type %T [symbolic] // CHECK:STDOUT: %C.elem.1: type = unbound_element_type %C.1, %T [symbolic] -// CHECK:STDOUT: %complete_type.3: = complete_type_witness %i32 [template] +// CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %complete_type.4: = complete_type_witness %i32.builtin [template] // CHECK:STDOUT: %C.elem.2: type = unbound_element_type %C.2, %i32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] // CHECK:STDOUT: %ImportedAccess.type: type = fn_type @ImportedAccess [template] // CHECK:STDOUT: %ImportedAccess: %ImportedAccess.type = struct_value () [template] // CHECK:STDOUT: } @@ -676,17 +655,17 @@ fn ImportedConvertLocal(a: Adapter(C)) -> i32 { // CHECK:STDOUT: %import_ref.1 = import_ref Main//extend_adapt_specific_type_library, C, unloaded // CHECK:STDOUT: %import_ref.2: type = import_ref Main//extend_adapt_specific_type_library, Adapter, loaded [template = constants.%Adapter] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref.10 -// CHECK:STDOUT: .ImplicitAs = %import_ref.11 +// CHECK:STDOUT: .Int = %import_ref.13 +// CHECK:STDOUT: .ImplicitAs = %import_ref.14 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.3: = import_ref Main//extend_adapt_specific_type_library, loc9_1, loaded [symbolic = @C.%complete_type (constants.%complete_type.1)] -// CHECK:STDOUT: %import_ref.4 = import_ref Main//extend_adapt_specific_type_library, inst27 [no loc], unloaded -// CHECK:STDOUT: %import_ref.5: @C.%C.elem (%C.elem.1) = import_ref Main//extend_adapt_specific_type_library, loc8_8, loaded [template = %.1] -// CHECK:STDOUT: %import_ref.7: = import_ref Main//extend_adapt_specific_type_library, loc13_1, loaded [template = constants.%complete_type.2] -// CHECK:STDOUT: %import_ref.8 = import_ref Main//extend_adapt_specific_type_library, inst42 [no loc], unloaded -// CHECK:STDOUT: %import_ref.9: type = import_ref Main//extend_adapt_specific_type_library, loc12_21, loaded [template = constants.%C.2] +// CHECK:STDOUT: %import_ref.6: = import_ref Main//extend_adapt_specific_type_library, loc9_1, loaded [symbolic = @C.%complete_type (constants.%complete_type.2)] +// CHECK:STDOUT: %import_ref.7 = import_ref Main//extend_adapt_specific_type_library, inst27 [no loc], unloaded +// CHECK:STDOUT: %import_ref.8: @C.%C.elem (%C.elem.1) = import_ref Main//extend_adapt_specific_type_library, loc8_8, loaded [template = %.1] +// CHECK:STDOUT: %import_ref.10: = import_ref Main//extend_adapt_specific_type_library, loc13_1, loaded [template = constants.%complete_type.3] +// CHECK:STDOUT: %import_ref.11 = import_ref Main//extend_adapt_specific_type_library, inst42 [no loc], unloaded +// CHECK:STDOUT: %import_ref.12: type = import_ref Main//extend_adapt_specific_type_library, loc12_21, loaded [template = constants.%C.2] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -706,9 +685,7 @@ fn ImportedConvertLocal(a: Adapter(C)) -> i32 { // CHECK:STDOUT: } { // CHECK:STDOUT: %Adapter.ref: type = name_ref Adapter, imports.%import_ref.2 [template = constants.%Adapter] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc6_34.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc6_34.2: type = converted %int.make_type_signed, %.loc6_34.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %Adapter = value_param runtime_param0 // CHECK:STDOUT: %a: %Adapter = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 @@ -718,9 +695,9 @@ fn ImportedConvertLocal(a: Adapter(C)) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: class @Adapter [from "extend_adapt_specific_type_library.carbon"] { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.8 -// CHECK:STDOUT: extend imports.%import_ref.9 -// CHECK:STDOUT: complete_type_witness = imports.%import_ref.7 +// CHECK:STDOUT: .Self = imports.%import_ref.11 +// CHECK:STDOUT: extend imports.%import_ref.12 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.10 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic class @C(constants.%T: type) [from "extend_adapt_specific_type_library.carbon"] { @@ -728,24 +705,24 @@ fn ImportedConvertLocal(a: Adapter(C)) -> i32 { // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt (constants.%T.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete: = require_complete_type @C.%T (%T) [symbolic = %require_complete (constants.%require_complete.1)] +// CHECK:STDOUT: %require_complete: = require_complete_type @C.%T (%T) [symbolic = %require_complete (constants.%require_complete.2)] // CHECK:STDOUT: %C: type = class_type @C, @C(%T) [symbolic = %C (constants.%C.1)] // CHECK:STDOUT: %C.elem: type = unbound_element_type @C.%C (%C.1), @C.%T (%T) [symbolic = %C.elem (constants.%C.elem.1)] // CHECK:STDOUT: %struct_type.x: type = struct_type {.x: @C.%T (%T)} [symbolic = %struct_type.x (constants.%struct_type.x.1)] -// CHECK:STDOUT: %complete_type: = complete_type_witness @C.%struct_type.x (%struct_type.x.1) [symbolic = %complete_type (constants.%complete_type.1)] +// CHECK:STDOUT: %complete_type: = complete_type_witness @C.%struct_type.x (%struct_type.x.1) [symbolic = %complete_type (constants.%complete_type.2)] // CHECK:STDOUT: // CHECK:STDOUT: class { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.4 -// CHECK:STDOUT: .x = imports.%import_ref.5 -// CHECK:STDOUT: complete_type_witness = imports.%import_ref.3 +// CHECK:STDOUT: .Self = imports.%import_ref.7 +// CHECK:STDOUT: .x = imports.%import_ref.8 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.6 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @ImportedAccess(%a.param_patt: %Adapter) -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %Adapter = name_ref a, %a -// CHECK:STDOUT: %x.ref: %C.elem.2 = name_ref x, imports.%import_ref.5 [template = imports.%.1] +// CHECK:STDOUT: %x.ref: %C.elem.2 = name_ref x, imports.%import_ref.8 [template = imports.%.1] // CHECK:STDOUT: %.loc14_11.1: %C.2 = converted %a.ref, [template = ] // CHECK:STDOUT: %.loc14_11.2: %i32 = class_element_access , element0 [template = ] // CHECK:STDOUT: return @@ -761,11 +738,11 @@ fn ImportedConvertLocal(a: Adapter(C)) -> i32 { // CHECK:STDOUT: %T.patt => constants.%i32 // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete => constants.%complete_type.3 +// CHECK:STDOUT: %require_complete => constants.%complete_type.4 // CHECK:STDOUT: %C => constants.%C.2 // CHECK:STDOUT: %C.elem => constants.%C.elem.2 // CHECK:STDOUT: %struct_type.x => constants.%struct_type.x.2 -// CHECK:STDOUT: %complete_type => constants.%complete_type.2 +// CHECK:STDOUT: %complete_type => constants.%complete_type.3 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @C(%T) { @@ -781,21 +758,21 @@ fn ImportedConvertLocal(a: Adapter(C)) -> i32 { // CHECK:STDOUT: %Adapter.type: type = generic_class_type @Adapter [template] // CHECK:STDOUT: %Adapter.generic: %Adapter.type = struct_value () [template] // CHECK:STDOUT: %Adapter.1: type = class_type @Adapter, @Adapter(%T) [symbolic] -// CHECK:STDOUT: %require_complete: = require_complete_type %T [symbolic] +// CHECK:STDOUT: %require_complete.1: = require_complete_type %T [symbolic] // CHECK:STDOUT: %complete_type.1: = complete_type_witness %T [symbolic] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %Adapter.2: type = class_type @Adapter, @Adapter(%i32) [template] // CHECK:STDOUT: %Convert.type: type = fn_type @Convert [template] // CHECK:STDOUT: %Convert: %Convert.type = struct_value () [template] -// CHECK:STDOUT: %complete_type.2: = complete_type_witness %i32 [template] +// CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %complete_type.3: = complete_type_witness %i32.builtin [template] +// CHECK:STDOUT: %complete_type.4: = complete_type_witness %i32 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -823,14 +800,10 @@ fn ImportedConvertLocal(a: Adapter(C)) -> i32 { // CHECK:STDOUT: } { // CHECK:STDOUT: %Adapter.ref: %Adapter.type = name_ref Adapter, file.%Adapter.decl [template = constants.%Adapter.generic] // CHECK:STDOUT: %int_32.loc8_23: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc8_23: init type = call constants.%Int(%int_32.loc8_23) [template = constants.%i32] -// CHECK:STDOUT: %.loc8_26.1: type = value_of_initializer %int.make_type_signed.loc8_23 [template = constants.%i32] -// CHECK:STDOUT: %.loc8_26.2: type = converted %int.make_type_signed.loc8_23, %.loc8_26.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc8_23: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %Adapter: type = class_type @Adapter, @Adapter(constants.%i32) [template = constants.%Adapter.2] // CHECK:STDOUT: %int_32.loc8_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc8_32: init type = call constants.%Int(%int_32.loc8_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc8_32.1: type = value_of_initializer %int.make_type_signed.loc8_32 [template = constants.%i32] -// CHECK:STDOUT: %.loc8_32.2: type = converted %int.make_type_signed.loc8_32, %.loc8_32.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc8_32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %Adapter.2 = value_param runtime_param0 // CHECK:STDOUT: %a: %Adapter.2 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 @@ -843,7 +816,7 @@ fn ImportedConvertLocal(a: Adapter(C)) -> i32 { // CHECK:STDOUT: %T.patt.loc4_15.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_15.2 (constants.%T.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete: = require_complete_type @Adapter.%T.loc4_15.2 (%T) [symbolic = %require_complete (constants.%require_complete)] +// CHECK:STDOUT: %require_complete: = require_complete_type @Adapter.%T.loc4_15.2 (%T) [symbolic = %require_complete (constants.%require_complete.1)] // CHECK:STDOUT: %complete_type.loc6_1.2: = complete_type_witness @Adapter.%T.loc4_15.2 (%T) [symbolic = %complete_type.loc6_1.2 (constants.%complete_type.1)] // CHECK:STDOUT: // CHECK:STDOUT: class { @@ -861,9 +834,7 @@ fn ImportedConvertLocal(a: Adapter(C)) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %Adapter.2 = name_ref a, %a // CHECK:STDOUT: %int_32.loc9: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc9: init type = call constants.%Int(%int_32.loc9) [template = constants.%i32] -// CHECK:STDOUT: %.loc9_15.1: type = value_of_initializer %int.make_type_signed.loc9 [template = constants.%i32] -// CHECK:STDOUT: %.loc9_15.2: type = converted %int.make_type_signed.loc9, %.loc9_15.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc9: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc9_12.1: %i32 = as_compatible %a.ref // CHECK:STDOUT: %.loc9_12.2: %i32 = converted %a.ref, %.loc9_12.1 // CHECK:STDOUT: return %.loc9_12.2 @@ -879,8 +850,8 @@ fn ImportedConvertLocal(a: Adapter(C)) -> i32 { // CHECK:STDOUT: %T.patt.loc4_15.2 => constants.%i32 // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete => constants.%complete_type.2 -// CHECK:STDOUT: %complete_type.loc6_1.2 => constants.%complete_type.2 +// CHECK:STDOUT: %require_complete => constants.%complete_type.3 +// CHECK:STDOUT: %complete_type.loc6_1.2 => constants.%complete_type.4 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- import_adapt_generic_type.carbon @@ -891,23 +862,23 @@ fn ImportedConvertLocal(a: Adapter(C)) -> i32 { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] // CHECK:STDOUT: %complete_type.1: = complete_type_witness %T [symbolic] // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] -// CHECK:STDOUT: %require_complete: = require_complete_type %T [symbolic] +// CHECK:STDOUT: %require_complete.1: = require_complete_type %T [symbolic] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %Adapter.2: type = class_type @Adapter, @Adapter(%i32) [template] // CHECK:STDOUT: %ImportedConvert.type: type = fn_type @ImportedConvert [template] // CHECK:STDOUT: %ImportedConvert: %ImportedConvert.type = struct_value () [template] -// CHECK:STDOUT: %complete_type.2: = complete_type_witness %i32 [template] +// CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %complete_type.3: = complete_type_witness %i32.builtin [template] +// CHECK:STDOUT: %complete_type.4: = complete_type_witness %i32 [template] // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %C.elem: type = unbound_element_type %C, %i32 [template] // CHECK:STDOUT: %struct_type.n: type = struct_type {.n: %i32} [template] -// CHECK:STDOUT: %complete_type.3: = complete_type_witness %struct_type.n [template] +// CHECK:STDOUT: %complete_type.5: = complete_type_witness %struct_type.n [template] // CHECK:STDOUT: %Adapter.3: type = class_type @Adapter, @Adapter(%C) [template] // CHECK:STDOUT: %ImportedConvertLocal.type: type = fn_type @ImportedConvertLocal [template] // CHECK:STDOUT: %ImportedConvertLocal: %ImportedConvertLocal.type = struct_value () [template] -// CHECK:STDOUT: %complete_type.4: = complete_type_witness %C [template] +// CHECK:STDOUT: %complete_type.6: = complete_type_witness %C [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -941,14 +912,10 @@ fn ImportedConvertLocal(a: Adapter(C)) -> i32 { // CHECK:STDOUT: } { // CHECK:STDOUT: %Adapter.ref: %Adapter.type = name_ref Adapter, imports.%import_ref.1 [template = constants.%Adapter.generic] // CHECK:STDOUT: %int_32.loc6_31: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc6_31: init type = call constants.%Int(%int_32.loc6_31) [template = constants.%i32] -// CHECK:STDOUT: %.loc6_34.1: type = value_of_initializer %int.make_type_signed.loc6_31 [template = constants.%i32] -// CHECK:STDOUT: %.loc6_34.2: type = converted %int.make_type_signed.loc6_31, %.loc6_34.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc6_31: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %Adapter: type = class_type @Adapter, @Adapter(constants.%i32) [template = constants.%Adapter.2] // CHECK:STDOUT: %int_32.loc6_40: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc6_40: init type = call constants.%Int(%int_32.loc6_40) [template = constants.%i32] -// CHECK:STDOUT: %.loc6_40.1: type = value_of_initializer %int.make_type_signed.loc6_40 [template = constants.%i32] -// CHECK:STDOUT: %.loc6_40.2: type = converted %int.make_type_signed.loc6_40, %.loc6_40.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc6_40: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %Adapter.2 = value_param runtime_param0 // CHECK:STDOUT: %a: %Adapter.2 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 @@ -965,9 +932,7 @@ fn ImportedConvertLocal(a: Adapter(C)) -> i32 { // CHECK:STDOUT: %C.ref.loc14: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %Adapter: type = class_type @Adapter, @Adapter(constants.%C) [template = constants.%Adapter.3] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc14_43.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc14_43.2: type = converted %int.make_type_signed, %.loc14_43.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %Adapter.3 = value_param runtime_param0 // CHECK:STDOUT: %a: %Adapter.3 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 @@ -980,7 +945,7 @@ fn ImportedConvertLocal(a: Adapter(C)) -> i32 { // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt (constants.%T.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete: = require_complete_type @Adapter.%T (%T) [symbolic = %require_complete (constants.%require_complete)] +// CHECK:STDOUT: %require_complete: = require_complete_type @Adapter.%T (%T) [symbolic = %require_complete (constants.%require_complete.1)] // CHECK:STDOUT: %complete_type: = complete_type_witness @Adapter.%T (%T) [symbolic = %complete_type (constants.%complete_type.1)] // CHECK:STDOUT: // CHECK:STDOUT: class { @@ -992,15 +957,13 @@ fn ImportedConvertLocal(a: Adapter(C)) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_10.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc11_10.2: type = converted %int.make_type_signed, %.loc11_10.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_8: %C.elem = field_decl n, element0 [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.n [template = constants.%complete_type.3] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc11: %C.elem = field_decl n, element0 [template] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.n [template = constants.%complete_type.5] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C -// CHECK:STDOUT: .n = %.loc11_8 +// CHECK:STDOUT: .n = %.loc11 // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1008,9 +971,7 @@ fn ImportedConvertLocal(a: Adapter(C)) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %Adapter.2 = name_ref a, %a // CHECK:STDOUT: %int_32.loc7: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc7: init type = call constants.%Int(%int_32.loc7) [template = constants.%i32] -// CHECK:STDOUT: %.loc7_15.1: type = value_of_initializer %int.make_type_signed.loc7 [template = constants.%i32] -// CHECK:STDOUT: %.loc7_15.2: type = converted %int.make_type_signed.loc7, %.loc7_15.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc7: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc7_12.1: %i32 = as_compatible %a.ref // CHECK:STDOUT: %.loc7_12.2: %i32 = converted %a.ref, %.loc7_12.1 // CHECK:STDOUT: return %.loc7_12.2 @@ -1022,7 +983,7 @@ fn ImportedConvertLocal(a: Adapter(C)) -> i32 { // CHECK:STDOUT: %C.ref.loc15: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %.loc15_13.1: %C = as_compatible %a.ref // CHECK:STDOUT: %.loc15_13.2: %C = converted %a.ref, %.loc15_13.1 -// CHECK:STDOUT: %n.ref: %C.elem = name_ref n, @C.%.loc11_8 [template = @C.%.loc11_8] +// CHECK:STDOUT: %n.ref: %C.elem = name_ref n, @C.%.loc11 [template = @C.%.loc11] // CHECK:STDOUT: %.loc15_18.1: ref %i32 = class_element_access %.loc15_13.2, element0 // CHECK:STDOUT: %.loc15_18.2: %i32 = bind_value %.loc15_18.1 // CHECK:STDOUT: return %.loc15_18.2 @@ -1038,8 +999,8 @@ fn ImportedConvertLocal(a: Adapter(C)) -> i32 { // CHECK:STDOUT: %T.patt => constants.%i32 // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete => constants.%complete_type.2 -// CHECK:STDOUT: %complete_type => constants.%complete_type.2 +// CHECK:STDOUT: %require_complete => constants.%complete_type.3 +// CHECK:STDOUT: %complete_type => constants.%complete_type.4 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Adapter(constants.%C) { @@ -1047,7 +1008,7 @@ fn ImportedConvertLocal(a: Adapter(C)) -> i32 { // CHECK:STDOUT: %T.patt => constants.%C // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete => constants.%complete_type.3 -// CHECK:STDOUT: %complete_type => constants.%complete_type.4 +// CHECK:STDOUT: %require_complete => constants.%complete_type.5 +// CHECK:STDOUT: %complete_type => constants.%complete_type.6 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/generic/base_is_generic.carbon b/toolchain/check/testdata/class/generic/base_is_generic.carbon index 4f9da912f1a1f..42d0a42729e50 100644 --- a/toolchain/check/testdata/class/generic/base_is_generic.carbon +++ b/toolchain/check/testdata/class/generic/base_is_generic.carbon @@ -92,33 +92,31 @@ fn H() { // CHECK:STDOUT: %Base.type: type = generic_class_type @Base [template] // CHECK:STDOUT: %Base.generic: %Base.type = struct_value () [template] // CHECK:STDOUT: %Base.1: type = class_type @Base, @Base(%T) [symbolic] -// CHECK:STDOUT: %require_complete: = require_complete_type %T [symbolic] +// CHECK:STDOUT: %require_complete.1: = require_complete_type %T [symbolic] // CHECK:STDOUT: %Base.elem.1: type = unbound_element_type %Base.1, %T [symbolic] // CHECK:STDOUT: %struct_type.x.1: type = struct_type {.x: %T} [symbolic] // CHECK:STDOUT: %complete_type.1: = complete_type_witness %struct_type.x.1 [symbolic] // CHECK:STDOUT: %Param: type = class_type @Param [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %Param.elem: type = unbound_element_type %Param, %i32 [template] // CHECK:STDOUT: %struct_type.y: type = struct_type {.y: %i32} [template] -// CHECK:STDOUT: %complete_type.2: = complete_type_witness %struct_type.y [template] +// CHECK:STDOUT: %complete_type.4: = complete_type_witness %struct_type.y [template] // CHECK:STDOUT: %Derived: type = class_type @Derived [template] // CHECK:STDOUT: %Base.2: type = class_type @Base, @Base(%Param) [template] // CHECK:STDOUT: %Base.elem.2: type = unbound_element_type %Base.2, %Param [template] // CHECK:STDOUT: %struct_type.x.2: type = struct_type {.x: %Param} [template] -// CHECK:STDOUT: %complete_type.3: = complete_type_witness %struct_type.x.2 [template] +// CHECK:STDOUT: %complete_type.5: = complete_type_witness %struct_type.x.2 [template] // CHECK:STDOUT: %Derived.elem: type = unbound_element_type %Derived, %Base.2 [template] // CHECK:STDOUT: %struct_type.base.1: type = struct_type {.base: %Base.2} [template] -// CHECK:STDOUT: %complete_type.4: = complete_type_witness %struct_type.base.1 [template] +// CHECK:STDOUT: %complete_type.6: = complete_type_witness %struct_type.base.1 [template] // CHECK:STDOUT: %DoubleFieldAccess.type: type = fn_type @DoubleFieldAccess [template] // CHECK:STDOUT: %DoubleFieldAccess: %DoubleFieldAccess.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -150,9 +148,7 @@ fn H() { // CHECK:STDOUT: } { // CHECK:STDOUT: %Derived.ref: type = name_ref Derived, file.%Derived.decl [template = constants.%Derived] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc16_37.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc16_37.2: type = converted %int.make_type_signed, %.loc16_37.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %d.param: %Derived = value_param runtime_param0 // CHECK:STDOUT: %d: %Derived = bind_name d, %d.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 @@ -165,7 +161,7 @@ fn H() { // CHECK:STDOUT: %T.patt.loc4_17.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_17.2 (constants.%T.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete: = require_complete_type @Base.%T.loc4_17.2 (%T) [symbolic = %require_complete (constants.%require_complete)] +// CHECK:STDOUT: %require_complete: = require_complete_type @Base.%T.loc4_17.2 (%T) [symbolic = %require_complete (constants.%require_complete.1)] // CHECK:STDOUT: %Base: type = class_type @Base, @Base(%T.loc4_17.2) [symbolic = %Base (constants.%Base.1)] // CHECK:STDOUT: %Base.elem: type = unbound_element_type @Base.%Base (%Base.1), @Base.%T.loc4_17.2 (%T) [symbolic = %Base.elem (constants.%Base.elem.1)] // CHECK:STDOUT: %struct_type.x: type = struct_type {.x: @Base.%T.loc4_17.2 (%T)} [symbolic = %struct_type.x (constants.%struct_type.x.1)] @@ -185,15 +181,13 @@ fn H() { // CHECK:STDOUT: // CHECK:STDOUT: class @Param { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc9_10.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc9_10.2: type = converted %int.make_type_signed, %.loc9_10.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc9_8: %Param.elem = field_decl y, element0 [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.y [template = constants.%complete_type.2] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc9: %Param.elem = field_decl y, element0 [template] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.y [template = constants.%complete_type.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Param -// CHECK:STDOUT: .y = %.loc9_8 +// CHECK:STDOUT: .y = %.loc9 // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } // CHECK:STDOUT: @@ -202,7 +196,7 @@ fn H() { // CHECK:STDOUT: %Param.ref: type = name_ref Param, file.%Param.decl [template = constants.%Param] // CHECK:STDOUT: %Base: type = class_type @Base, @Base(constants.%Param) [template = constants.%Base.2] // CHECK:STDOUT: %.loc13: %Derived.elem = base_decl %Base, element0 [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.base.1 [template = constants.%complete_type.4] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.base.1 [template = constants.%complete_type.6] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Derived @@ -218,7 +212,7 @@ fn H() { // CHECK:STDOUT: %.loc17_11.1: ref %Base.2 = class_element_access %d.ref, element0 // CHECK:STDOUT: %.loc17_11.2: ref %Base.2 = converted %d.ref, %.loc17_11.1 // CHECK:STDOUT: %.loc17_11.3: ref %Param = class_element_access %.loc17_11.2, element0 -// CHECK:STDOUT: %y.ref: %Param.elem = name_ref y, @Param.%.loc9_8 [template = @Param.%.loc9_8] +// CHECK:STDOUT: %y.ref: %Param.elem = name_ref y, @Param.%.loc9 [template = @Param.%.loc9] // CHECK:STDOUT: %.loc17_13.1: ref %i32 = class_element_access %.loc17_11.3, element0 // CHECK:STDOUT: %.loc17_13.2: %i32 = bind_value %.loc17_13.1 // CHECK:STDOUT: return %.loc17_13.2 @@ -239,11 +233,11 @@ fn H() { // CHECK:STDOUT: %T.patt.loc4_17.2 => constants.%Param // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete => constants.%complete_type.2 +// CHECK:STDOUT: %require_complete => constants.%complete_type.4 // CHECK:STDOUT: %Base => constants.%Base.2 // CHECK:STDOUT: %Base.elem => constants.%Base.elem.2 // CHECK:STDOUT: %struct_type.x => constants.%struct_type.x.2 -// CHECK:STDOUT: %complete_type.loc6_1.2 => constants.%complete_type.3 +// CHECK:STDOUT: %complete_type.loc6_1.2 => constants.%complete_type.5 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- import.carbon @@ -252,24 +246,22 @@ fn H() { // CHECK:STDOUT: %Derived: type = class_type @Derived [template] // CHECK:STDOUT: %Param: type = class_type @Param [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %struct_type.y: type = struct_type {.y: %i32} [template] -// CHECK:STDOUT: %complete_type.1: = complete_type_witness %struct_type.y [template] +// CHECK:STDOUT: %complete_type.2: = complete_type_witness %struct_type.y [template] // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] // CHECK:STDOUT: %struct_type.x.1: type = struct_type {.x: %T} [symbolic] -// CHECK:STDOUT: %complete_type.2: = complete_type_witness %struct_type.x.1 [symbolic] +// CHECK:STDOUT: %complete_type.3: = complete_type_witness %struct_type.x.1 [symbolic] // CHECK:STDOUT: %Base.1: type = class_type @Base, @Base(%T) [symbolic] // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %Base.2: type = class_type @Base, @Base(%Param) [template] // CHECK:STDOUT: %struct_type.base.1: type = struct_type {.base: %Base.2} [template] -// CHECK:STDOUT: %complete_type.3: = complete_type_witness %struct_type.base.1 [template] -// CHECK:STDOUT: %require_complete: = require_complete_type %T [symbolic] +// CHECK:STDOUT: %complete_type.4: = complete_type_witness %struct_type.base.1 [template] +// CHECK:STDOUT: %require_complete.2: = require_complete_type %T [symbolic] // CHECK:STDOUT: %Base.elem.1: type = unbound_element_type %Base.1, %T [symbolic] // CHECK:STDOUT: %Base.elem.2: type = unbound_element_type %Base.2, %Param [template] // CHECK:STDOUT: %struct_type.x.2: type = struct_type {.x: %Param} [template] -// CHECK:STDOUT: %complete_type.4: = complete_type_witness %struct_type.x.2 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %complete_type.5: = complete_type_witness %struct_type.x.2 [template] // CHECK:STDOUT: %ImportedDoubleFieldAccess.type: type = fn_type @ImportedDoubleFieldAccess [template] // CHECK:STDOUT: %ImportedDoubleFieldAccess: %ImportedDoubleFieldAccess.type = struct_value () [template] // CHECK:STDOUT: %Param.elem: type = unbound_element_type %Param, %i32 [template] @@ -281,20 +273,20 @@ fn H() { // CHECK:STDOUT: %import_ref.3: type = import_ref Main//extend_generic_base, Derived, loaded [template = constants.%Derived] // CHECK:STDOUT: %import_ref.4 = import_ref Main//extend_generic_base, DoubleFieldAccess, unloaded // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref.16 +// CHECK:STDOUT: .Int = %import_ref.19 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.5: = import_ref Main//extend_generic_base, loc10_1, loaded [template = constants.%complete_type.1] -// CHECK:STDOUT: %import_ref.6 = import_ref Main//extend_generic_base, inst42 [no loc], unloaded -// CHECK:STDOUT: %import_ref.7: %Param.elem = import_ref Main//extend_generic_base, loc9_8, loaded [template = %.1] -// CHECK:STDOUT: %import_ref.8: = import_ref Main//extend_generic_base, loc6_1, loaded [symbolic = @Base.%complete_type (constants.%complete_type.2)] -// CHECK:STDOUT: %import_ref.9 = import_ref Main//extend_generic_base, inst27 [no loc], unloaded -// CHECK:STDOUT: %import_ref.10: @Base.%Base.elem (%Base.elem.1) = import_ref Main//extend_generic_base, loc5_8, loaded [template = %.2] -// CHECK:STDOUT: %import_ref.12: = import_ref Main//extend_generic_base, loc14_1, loaded [template = constants.%complete_type.3] -// CHECK:STDOUT: %import_ref.13 = import_ref Main//extend_generic_base, inst63 [no loc], unloaded -// CHECK:STDOUT: %import_ref.14 = import_ref Main//extend_generic_base, loc13_27, unloaded -// CHECK:STDOUT: %import_ref.15: type = import_ref Main//extend_generic_base, loc13_26, loaded [template = constants.%Base.2] +// CHECK:STDOUT: %import_ref.8: = import_ref Main//extend_generic_base, loc10_1, loaded [template = constants.%complete_type.2] +// CHECK:STDOUT: %import_ref.9 = import_ref Main//extend_generic_base, inst42 [no loc], unloaded +// CHECK:STDOUT: %import_ref.10: %Param.elem = import_ref Main//extend_generic_base, loc9_8, loaded [template = %.1] +// CHECK:STDOUT: %import_ref.11: = import_ref Main//extend_generic_base, loc6_1, loaded [symbolic = @Base.%complete_type (constants.%complete_type.3)] +// CHECK:STDOUT: %import_ref.12 = import_ref Main//extend_generic_base, inst27 [no loc], unloaded +// CHECK:STDOUT: %import_ref.13: @Base.%Base.elem (%Base.elem.1) = import_ref Main//extend_generic_base, loc5_8, loaded [template = %.2] +// CHECK:STDOUT: %import_ref.15: = import_ref Main//extend_generic_base, loc14_1, loaded [template = constants.%complete_type.4] +// CHECK:STDOUT: %import_ref.16 = import_ref Main//extend_generic_base, inst76 [no loc], unloaded +// CHECK:STDOUT: %import_ref.17 = import_ref Main//extend_generic_base, loc13_27, unloaded +// CHECK:STDOUT: %import_ref.18: type = import_ref Main//extend_generic_base, loc13_26, loaded [template = constants.%Base.2] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -316,9 +308,7 @@ fn H() { // CHECK:STDOUT: } { // CHECK:STDOUT: %Derived.ref: type = name_ref Derived, imports.%import_ref.3 [template = constants.%Derived] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc6_45.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc6_45.2: type = converted %int.make_type_signed, %.loc6_45.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %d.param: %Derived = value_param runtime_param0 // CHECK:STDOUT: %d: %Derived = bind_name d, %d.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 @@ -328,17 +318,17 @@ fn H() { // CHECK:STDOUT: // CHECK:STDOUT: class @Derived [from "extend_generic_base.carbon"] { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.13 -// CHECK:STDOUT: .base = imports.%import_ref.14 -// CHECK:STDOUT: extend imports.%import_ref.15 -// CHECK:STDOUT: complete_type_witness = imports.%import_ref.12 +// CHECK:STDOUT: .Self = imports.%import_ref.16 +// CHECK:STDOUT: .base = imports.%import_ref.17 +// CHECK:STDOUT: extend imports.%import_ref.18 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.15 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Param [from "extend_generic_base.carbon"] { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.6 -// CHECK:STDOUT: .y = imports.%import_ref.7 -// CHECK:STDOUT: complete_type_witness = imports.%import_ref.5 +// CHECK:STDOUT: .Self = imports.%import_ref.9 +// CHECK:STDOUT: .y = imports.%import_ref.10 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.8 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic class @Base(constants.%T: type) [from "extend_generic_base.carbon"] { @@ -346,28 +336,28 @@ fn H() { // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt (constants.%T.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete: = require_complete_type @Base.%T (%T) [symbolic = %require_complete (constants.%require_complete)] +// CHECK:STDOUT: %require_complete: = require_complete_type @Base.%T (%T) [symbolic = %require_complete (constants.%require_complete.2)] // CHECK:STDOUT: %Base: type = class_type @Base, @Base(%T) [symbolic = %Base (constants.%Base.1)] // CHECK:STDOUT: %Base.elem: type = unbound_element_type @Base.%Base (%Base.1), @Base.%T (%T) [symbolic = %Base.elem (constants.%Base.elem.1)] // CHECK:STDOUT: %struct_type.x: type = struct_type {.x: @Base.%T (%T)} [symbolic = %struct_type.x (constants.%struct_type.x.1)] -// CHECK:STDOUT: %complete_type: = complete_type_witness @Base.%struct_type.x (%struct_type.x.1) [symbolic = %complete_type (constants.%complete_type.2)] +// CHECK:STDOUT: %complete_type: = complete_type_witness @Base.%struct_type.x (%struct_type.x.1) [symbolic = %complete_type (constants.%complete_type.3)] // CHECK:STDOUT: // CHECK:STDOUT: class { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.9 -// CHECK:STDOUT: .x = imports.%import_ref.10 -// CHECK:STDOUT: complete_type_witness = imports.%import_ref.8 +// CHECK:STDOUT: .Self = imports.%import_ref.12 +// CHECK:STDOUT: .x = imports.%import_ref.13 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.11 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @ImportedDoubleFieldAccess(%d.param_patt: %Derived) -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %d.ref: %Derived = name_ref d, %d -// CHECK:STDOUT: %x.ref: %Base.elem.2 = name_ref x, imports.%import_ref.10 [template = imports.%.2] +// CHECK:STDOUT: %x.ref: %Base.elem.2 = name_ref x, imports.%import_ref.13 [template = imports.%.2] // CHECK:STDOUT: %.loc7_11.1: ref %Base.2 = class_element_access %d.ref, element0 // CHECK:STDOUT: %.loc7_11.2: ref %Base.2 = converted %d.ref, %.loc7_11.1 // CHECK:STDOUT: %.loc7_11.3: ref %Param = class_element_access %.loc7_11.2, element0 -// CHECK:STDOUT: %y.ref: %Param.elem = name_ref y, imports.%import_ref.7 [template = imports.%.1] +// CHECK:STDOUT: %y.ref: %Param.elem = name_ref y, imports.%import_ref.10 [template = imports.%.1] // CHECK:STDOUT: %.loc7_13.1: ref %i32 = class_element_access %.loc7_11.3, element0 // CHECK:STDOUT: %.loc7_13.2: %i32 = bind_value %.loc7_13.1 // CHECK:STDOUT: return %.loc7_13.2 @@ -383,11 +373,11 @@ fn H() { // CHECK:STDOUT: %T.patt => constants.%Param // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete => constants.%complete_type.1 +// CHECK:STDOUT: %require_complete => constants.%complete_type.2 // CHECK:STDOUT: %Base => constants.%Base.2 // CHECK:STDOUT: %Base.elem => constants.%Base.elem.2 // CHECK:STDOUT: %struct_type.x => constants.%struct_type.x.2 -// CHECK:STDOUT: %complete_type => constants.%complete_type.4 +// CHECK:STDOUT: %complete_type => constants.%complete_type.5 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Base(%T) { @@ -526,23 +516,22 @@ fn H() { // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] +// CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %complete_type.4: = complete_type_witness %i32.builtin [template] // CHECK:STDOUT: %C.2: type = class_type @C, @C(%i32) [template] // CHECK:STDOUT: %X.3: type = class_type @X, @X(%i32) [template] // CHECK:STDOUT: %G.type.3: type = fn_type @G, @X(%i32) [template] // CHECK:STDOUT: %G.3: %G.type.3 = struct_value () [template] // CHECK:STDOUT: %C.elem.2: type = unbound_element_type %C.2, %X.3 [template] // CHECK:STDOUT: %struct_type.base.2: type = struct_type {.base: %X.3} [template] -// CHECK:STDOUT: %complete_type.3: = complete_type_witness %struct_type.base.2 [template] +// CHECK:STDOUT: %complete_type.5: = complete_type_witness %struct_type.base.2 [template] // CHECK:STDOUT: %G.specific_fn.2: = specific_function %G.3, @G(%i32) [template] -// CHECK:STDOUT: %complete_type.4: = complete_type_witness %i32 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -650,14 +639,10 @@ fn H() { // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_32.loc13_10: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc13_10: init type = call constants.%Int(%int_32.loc13_10) [template = constants.%i32] -// CHECK:STDOUT: %.loc13_10.1: type = value_of_initializer %int.make_type_signed.loc13_10 [template = constants.%i32] -// CHECK:STDOUT: %.loc13_10.2: type = converted %int.make_type_signed.loc13_10, %.loc13_10.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc13_10: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [template = constants.%C.generic] // CHECK:STDOUT: %int_32.loc13_18: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc13_18: init type = call constants.%Int(%int_32.loc13_18) [template = constants.%i32] -// CHECK:STDOUT: %.loc13_21.1: type = value_of_initializer %int.make_type_signed.loc13_18 [template = constants.%i32] -// CHECK:STDOUT: %.loc13_21.2: type = converted %int.make_type_signed.loc13_18, %.loc13_21.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc13_18: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %C: type = class_type @C, @C(constants.%i32) [template = constants.%C.2] // CHECK:STDOUT: %.loc13_22: %G.type.3 = specific_constant @X.%G.decl, @X(constants.%i32) [template = constants.%G.3] // CHECK:STDOUT: %G.ref: %G.type.3 = name_ref G, %.loc13_22 [template = constants.%G.3] @@ -736,7 +721,7 @@ fn H() { // CHECK:STDOUT: %C => constants.%C.2 // CHECK:STDOUT: %C.elem => constants.%C.elem.2 // CHECK:STDOUT: %struct_type.base => constants.%struct_type.base.2 -// CHECK:STDOUT: %complete_type.loc10_1.2 => constants.%complete_type.3 +// CHECK:STDOUT: %complete_type.loc10_1.2 => constants.%complete_type.5 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @X(constants.%i32) { @@ -764,26 +749,26 @@ fn H() { // CHECK:STDOUT: %H.type: type = fn_type @H [template] // CHECK:STDOUT: %H: %H.type = struct_value () [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] +// CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %complete_type.2: = complete_type_witness %i32.builtin [template] // CHECK:STDOUT: %C.type: type = generic_class_type @C [template] // CHECK:STDOUT: %C.generic: %C.type = struct_value () [template] // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] -// CHECK:STDOUT: %complete_type.1: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %complete_type.3: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %U: type = bind_symbolic_name U, 0 [symbolic] // CHECK:STDOUT: %U.patt: type = symbolic_binding_pattern U, 0 [symbolic] // CHECK:STDOUT: %X.2: type = class_type @X, @X(%T) [symbolic] // CHECK:STDOUT: %C.1: type = class_type @C, @C(%T) [symbolic] // CHECK:STDOUT: %C.elem.1: type = unbound_element_type %C.1, %X.2 [symbolic] // CHECK:STDOUT: %struct_type.base.1: type = struct_type {.base: %X.2} [symbolic] -// CHECK:STDOUT: %complete_type.2: = complete_type_witness %struct_type.base.1 [symbolic] +// CHECK:STDOUT: %complete_type.4: = complete_type_witness %struct_type.base.1 [symbolic] // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %G.type.1: type = fn_type @G, @X(%U) [symbolic] // CHECK:STDOUT: %G.1: %G.type.1 = struct_value () [symbolic] -// CHECK:STDOUT: %require_complete.1: = require_complete_type %X.2 [symbolic] -// CHECK:STDOUT: %require_complete.2: = require_complete_type %U [symbolic] +// CHECK:STDOUT: %require_complete.2: = require_complete_type %X.2 [symbolic] +// CHECK:STDOUT: %require_complete.3: = require_complete_type %U [symbolic] // CHECK:STDOUT: %G.specific_fn.1: = specific_function %G.1, @G(%U) [symbolic] // CHECK:STDOUT: %G.type.2: type = fn_type @G, @X(%T) [symbolic] // CHECK:STDOUT: %G.2: %G.type.2 = struct_value () [symbolic] @@ -793,9 +778,8 @@ fn H() { // CHECK:STDOUT: %G.3: %G.type.3 = struct_value () [template] // CHECK:STDOUT: %C.elem.2: type = unbound_element_type %C.2, %X.3 [template] // CHECK:STDOUT: %struct_type.base.2: type = struct_type {.base: %X.3} [template] -// CHECK:STDOUT: %complete_type.3: = complete_type_witness %struct_type.base.2 [template] +// CHECK:STDOUT: %complete_type.5: = complete_type_witness %struct_type.base.2 [template] // CHECK:STDOUT: %G.specific_fn.2: = specific_function %G.3, @G(%i32) [template] -// CHECK:STDOUT: %complete_type.4: = complete_type_witness %i32 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -807,13 +791,13 @@ fn H() { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.5: = import_ref Main//extend_generic_symbolic_base, loc6_1, loaded [template = constants.%complete_type.1] -// CHECK:STDOUT: %import_ref.6 = import_ref Main//extend_generic_symbolic_base, inst27 [no loc], unloaded -// CHECK:STDOUT: %import_ref.7: @X.%G.type (%G.type.1) = import_ref Main//extend_generic_symbolic_base, loc5_15, loaded [symbolic = @X.%G (constants.%G.1)] -// CHECK:STDOUT: %import_ref.9: = import_ref Main//extend_generic_symbolic_base, loc10_1, loaded [symbolic = @C.%complete_type (constants.%complete_type.2)] -// CHECK:STDOUT: %import_ref.10 = import_ref Main//extend_generic_symbolic_base, inst68 [no loc], unloaded -// CHECK:STDOUT: %import_ref.11 = import_ref Main//extend_generic_symbolic_base, loc9_20, unloaded -// CHECK:STDOUT: %import_ref.12: type = import_ref Main//extend_generic_symbolic_base, loc9_19, loaded [symbolic = @C.%X (constants.%X.2)] +// CHECK:STDOUT: %import_ref.8: = import_ref Main//extend_generic_symbolic_base, loc6_1, loaded [template = constants.%complete_type.3] +// CHECK:STDOUT: %import_ref.9 = import_ref Main//extend_generic_symbolic_base, inst27 [no loc], unloaded +// CHECK:STDOUT: %import_ref.10: @X.%G.type (%G.type.1) = import_ref Main//extend_generic_symbolic_base, loc5_15, loaded [symbolic = @X.%G (constants.%G.1)] +// CHECK:STDOUT: %import_ref.12: = import_ref Main//extend_generic_symbolic_base, loc10_1, loaded [symbolic = @C.%complete_type (constants.%complete_type.4)] +// CHECK:STDOUT: %import_ref.13 = import_ref Main//extend_generic_symbolic_base, inst68 [no loc], unloaded +// CHECK:STDOUT: %import_ref.14 = import_ref Main//extend_generic_symbolic_base, loc9_20, unloaded +// CHECK:STDOUT: %import_ref.15: type = import_ref Main//extend_generic_symbolic_base, loc9_19, loaded [symbolic = @C.%X (constants.%X.2)] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -835,18 +819,18 @@ fn H() { // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %X: type = class_type @X, @X(%T) [symbolic = %X (constants.%X.2)] -// CHECK:STDOUT: %require_complete: = require_complete_type @C.%X (%X.2) [symbolic = %require_complete (constants.%require_complete.1)] +// CHECK:STDOUT: %require_complete: = require_complete_type @C.%X (%X.2) [symbolic = %require_complete (constants.%require_complete.2)] // CHECK:STDOUT: %C: type = class_type @C, @C(%T) [symbolic = %C (constants.%C.1)] // CHECK:STDOUT: %C.elem: type = unbound_element_type @C.%C (%C.1), @C.%X (%X.2) [symbolic = %C.elem (constants.%C.elem.1)] // CHECK:STDOUT: %struct_type.base: type = struct_type {.base: @C.%X (%X.2)} [symbolic = %struct_type.base (constants.%struct_type.base.1)] -// CHECK:STDOUT: %complete_type: = complete_type_witness @C.%struct_type.base (%struct_type.base.1) [symbolic = %complete_type (constants.%complete_type.2)] +// CHECK:STDOUT: %complete_type: = complete_type_witness @C.%struct_type.base (%struct_type.base.1) [symbolic = %complete_type (constants.%complete_type.4)] // CHECK:STDOUT: // CHECK:STDOUT: class { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.10 -// CHECK:STDOUT: .base = imports.%import_ref.11 -// CHECK:STDOUT: extend imports.%import_ref.12 -// CHECK:STDOUT: complete_type_witness = imports.%import_ref.9 +// CHECK:STDOUT: .Self = imports.%import_ref.13 +// CHECK:STDOUT: .base = imports.%import_ref.14 +// CHECK:STDOUT: extend imports.%import_ref.15 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.12 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -860,25 +844,21 @@ fn H() { // CHECK:STDOUT: // CHECK:STDOUT: class { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.6 -// CHECK:STDOUT: .G = imports.%import_ref.7 -// CHECK:STDOUT: complete_type_witness = imports.%import_ref.5 +// CHECK:STDOUT: .Self = imports.%import_ref.9 +// CHECK:STDOUT: .G = imports.%import_ref.10 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.8 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @H() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_32.loc7_10: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc7_10: init type = call constants.%Int(%int_32.loc7_10) [template = constants.%i32] -// CHECK:STDOUT: %.loc7_10.1: type = value_of_initializer %int.make_type_signed.loc7_10 [template = constants.%i32] -// CHECK:STDOUT: %.loc7_10.2: type = converted %int.make_type_signed.loc7_10, %.loc7_10.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc7_10: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %C.ref: %C.type = name_ref C, imports.%import_ref.2 [template = constants.%C.generic] // CHECK:STDOUT: %int_32.loc7_18: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc7_18: init type = call constants.%Int(%int_32.loc7_18) [template = constants.%i32] -// CHECK:STDOUT: %.loc7_21.1: type = value_of_initializer %int.make_type_signed.loc7_18 [template = constants.%i32] -// CHECK:STDOUT: %.loc7_21.2: type = converted %int.make_type_signed.loc7_18, %.loc7_21.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc7_18: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %C: type = class_type @C, @C(constants.%i32) [template = constants.%C.2] -// CHECK:STDOUT: %.loc7_22: %G.type.3 = specific_constant imports.%import_ref.7, @X(constants.%i32) [template = constants.%G.3] +// CHECK:STDOUT: %.loc7_22: %G.type.3 = specific_constant imports.%import_ref.10, @X(constants.%i32) [template = constants.%G.3] // CHECK:STDOUT: %G.ref: %G.type.3 = name_ref G, %.loc7_22 [template = constants.%G.3] // CHECK:STDOUT: %G.specific_fn: = specific_function %G.ref, @G(constants.%i32) [template = constants.%G.specific_fn.2] // CHECK:STDOUT: %G.call: init %i32 = call %G.specific_fn() @@ -892,7 +872,7 @@ fn H() { // CHECK:STDOUT: %U: type = bind_symbolic_name U, 0 [symbolic = %U (constants.%U)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete: = require_complete_type @G.%U (%U) [symbolic = %require_complete (constants.%require_complete.2)] +// CHECK:STDOUT: %require_complete: = require_complete_type @G.%U (%U) [symbolic = %require_complete (constants.%require_complete.3)] // CHECK:STDOUT: %G.type: type = fn_type @G, @X(%U) [symbolic = %G.type (constants.%G.type.1)] // CHECK:STDOUT: %G: @G.%G.type (%G.type.1) = struct_value () [symbolic = %G (constants.%G.1)] // CHECK:STDOUT: %G.specific_fn: = specific_function %G, @G(%U) [symbolic = %G.specific_fn (constants.%G.specific_fn.1)] @@ -942,7 +922,7 @@ fn H() { // CHECK:STDOUT: %U => constants.%U // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete => constants.%require_complete.2 +// CHECK:STDOUT: %require_complete => constants.%require_complete.3 // CHECK:STDOUT: %G.type => constants.%G.type.1 // CHECK:STDOUT: %G => constants.%G.1 // CHECK:STDOUT: %G.specific_fn => constants.%G.specific_fn.1 @@ -963,11 +943,11 @@ fn H() { // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %X => constants.%X.3 -// CHECK:STDOUT: %require_complete => constants.%complete_type.1 +// CHECK:STDOUT: %require_complete => constants.%complete_type.3 // CHECK:STDOUT: %C => constants.%C.2 // CHECK:STDOUT: %C.elem => constants.%C.elem.2 // CHECK:STDOUT: %struct_type.base => constants.%struct_type.base.2 -// CHECK:STDOUT: %complete_type => constants.%complete_type.3 +// CHECK:STDOUT: %complete_type => constants.%complete_type.5 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @X(constants.%i32) { @@ -983,7 +963,7 @@ fn H() { // CHECK:STDOUT: %U => constants.%i32 // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete => constants.%complete_type.4 +// CHECK:STDOUT: %require_complete => constants.%complete_type.2 // CHECK:STDOUT: %G.type => constants.%G.type.3 // CHECK:STDOUT: %G => constants.%G.3 // CHECK:STDOUT: %G.specific_fn => constants.%G.specific_fn.2 diff --git a/toolchain/check/testdata/class/generic/call.carbon b/toolchain/check/testdata/class/generic/call.carbon index 1f3613066ef56..066cbe25b9e85 100644 --- a/toolchain/check/testdata/class/generic/call.carbon +++ b/toolchain/check/testdata/class/generic/call.carbon @@ -91,29 +91,27 @@ class Outer(T:! type) { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] -// CHECK:STDOUT: %N.1: %i32 = bind_symbolic_name N, 1 [symbolic] -// CHECK:STDOUT: %N.patt.1: %i32 = symbolic_binding_pattern N, 1 [symbolic] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] +// CHECK:STDOUT: %N.2: %i32 = bind_symbolic_name N, 1 [symbolic] +// CHECK:STDOUT: %N.patt.2: %i32 = symbolic_binding_pattern N, 1 [symbolic] // CHECK:STDOUT: %Class.type: type = generic_class_type @Class [template] // CHECK:STDOUT: %Class.generic: %Class.type = struct_value () [template] -// CHECK:STDOUT: %Class.1: type = class_type @Class, @Class(%T, %N.1) [symbolic] +// CHECK:STDOUT: %Class.1: type = class_type @Class, @Class(%T, %N.2) [symbolic] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] -// CHECK:STDOUT: %complete_type.1: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %complete_type.2: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %ptr.1: type = ptr_type %i32 [template] // CHECK:STDOUT: %int_5.1: Core.IntLiteral = int_value 5 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_5.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_5.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_5.2: %i32 = int_value 5 [template] // CHECK:STDOUT: %Class.2: type = class_type @Class, @Class(%ptr.1, %int_5.2) [template] // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_0.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] // CHECK:STDOUT: %Class.3: type = class_type @Class, @Class(%empty_tuple.type, %int_0.2) [template] @@ -122,7 +120,7 @@ class Outer(T:! type) { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -139,26 +137,22 @@ class Outer(T:! type) { // CHECK:STDOUT: %Class.decl: %Class.type = class_decl @Class [template = constants.%Class.generic] { // CHECK:STDOUT: %T.patt.loc4_13.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_13.2 (constants.%T.patt)] // CHECK:STDOUT: %T.param_patt: type = value_param_pattern %T.patt.loc4_13.1, runtime_param [symbolic = %T.patt.loc4_13.2 (constants.%T.patt)] -// CHECK:STDOUT: %N.patt.loc4_23.1: %i32 = symbolic_binding_pattern N, 1 [symbolic = %N.patt.loc4_23.2 (constants.%N.patt.1)] -// CHECK:STDOUT: %N.param_patt: %i32 = value_param_pattern %N.patt.loc4_23.1, runtime_param [symbolic = %N.patt.loc4_23.2 (constants.%N.patt.1)] +// CHECK:STDOUT: %N.patt.loc4_23.1: %i32 = symbolic_binding_pattern N, 1 [symbolic = %N.patt.loc4_23.2 (constants.%N.patt.2)] +// CHECK:STDOUT: %N.param_patt: %i32 = value_param_pattern %N.patt.loc4_23.1, runtime_param [symbolic = %N.patt.loc4_23.2 (constants.%N.patt.2)] // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc4_27.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc4_27.2: type = converted %int.make_type_signed, %.loc4_27.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %T.param: type = value_param runtime_param // CHECK:STDOUT: %T.loc4_13.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc4_13.2 (constants.%T)] // CHECK:STDOUT: %N.param: %i32 = value_param runtime_param -// CHECK:STDOUT: %N.loc4_23.1: %i32 = bind_symbolic_name N, 1, %N.param [symbolic = %N.loc4_23.2 (constants.%N.1)] +// CHECK:STDOUT: %N.loc4_23.1: %i32 = bind_symbolic_name N, 1, %N.param [symbolic = %N.loc4_23.2 (constants.%N.2)] // CHECK:STDOUT: } // CHECK:STDOUT: %Class.ref.loc6: %Class.type = name_ref Class, %Class.decl [template = constants.%Class.generic] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc6_17.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc6_17.2: type = converted %int.make_type_signed, %.loc6_17.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %ptr: type = ptr_type %i32 [template = constants.%ptr.1] // CHECK:STDOUT: %int_5: Core.IntLiteral = int_value 5 [template = constants.%int_5.1] -// CHECK:STDOUT: %impl.elem0.loc6: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc6: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc6: = bound_method %int_5, %impl.elem0.loc6 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc6: = specific_function %Convert.bound.loc6, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc6: init %i32 = call %Convert.specific_fn.loc6(%int_5) [template = constants.%int_5.2] @@ -171,7 +165,7 @@ class Outer(T:! type) { // CHECK:STDOUT: %.loc9_15: %empty_tuple.type = tuple_literal () // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %.loc9_19.1: type = converted %.loc9_15, constants.%empty_tuple.type [template = constants.%empty_tuple.type] -// CHECK:STDOUT: %impl.elem0.loc9: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc9: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc9: = bound_method %int_0, %impl.elem0.loc9 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc9: = specific_function %Convert.bound.loc9, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc9: init %i32 = call %Convert.specific_fn.loc9(%int_0) [template = constants.%int_0.2] @@ -185,13 +179,13 @@ class Outer(T:! type) { // CHECK:STDOUT: generic class @Class(%T.loc4_13.1: type, %N.loc4_23.1: %i32) { // CHECK:STDOUT: %T.loc4_13.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_13.2 (constants.%T)] // CHECK:STDOUT: %T.patt.loc4_13.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_13.2 (constants.%T.patt)] -// CHECK:STDOUT: %N.loc4_23.2: %i32 = bind_symbolic_name N, 1 [symbolic = %N.loc4_23.2 (constants.%N.1)] -// CHECK:STDOUT: %N.patt.loc4_23.2: %i32 = symbolic_binding_pattern N, 1 [symbolic = %N.patt.loc4_23.2 (constants.%N.patt.1)] +// CHECK:STDOUT: %N.loc4_23.2: %i32 = bind_symbolic_name N, 1 [symbolic = %N.loc4_23.2 (constants.%N.2)] +// CHECK:STDOUT: %N.patt.loc4_23.2: %i32 = symbolic_binding_pattern N, 1 [symbolic = %N.patt.loc4_23.2 (constants.%N.patt.2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: class { -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.2] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class.1 @@ -199,11 +193,11 @@ class Outer(T:! type) { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Class(constants.%T, constants.%N.1) { +// CHECK:STDOUT: specific @Class(constants.%T, constants.%N.2) { // CHECK:STDOUT: %T.loc4_13.2 => constants.%T // CHECK:STDOUT: %T.patt.loc4_13.2 => constants.%T -// CHECK:STDOUT: %N.loc4_23.2 => constants.%N.1 -// CHECK:STDOUT: %N.patt.loc4_23.2 => constants.%N.1 +// CHECK:STDOUT: %N.loc4_23.2 => constants.%N.2 +// CHECK:STDOUT: %N.patt.loc4_23.2 => constants.%N.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(constants.%ptr.1, constants.%int_5.2) { @@ -230,22 +224,20 @@ class Outer(T:! type) { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] -// CHECK:STDOUT: %N: %i32 = bind_symbolic_name N, 1 [symbolic] -// CHECK:STDOUT: %N.patt: %i32 = symbolic_binding_pattern N, 1 [symbolic] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] +// CHECK:STDOUT: %N.2: %i32 = bind_symbolic_name N, 1 [symbolic] +// CHECK:STDOUT: %N.patt.2: %i32 = symbolic_binding_pattern N, 1 [symbolic] // CHECK:STDOUT: %Class.type: type = generic_class_type @Class [template] // CHECK:STDOUT: %Class.generic: %Class.type = struct_value () [template] -// CHECK:STDOUT: %Class: type = class_type @Class, @Class(%T, %N) [symbolic] +// CHECK:STDOUT: %Class: type = class_type @Class, @Class(%T, %N.2) [symbolic] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %complete_type.2: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %ptr: type = ptr_type %i32 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -261,23 +253,19 @@ class Outer(T:! type) { // CHECK:STDOUT: %Class.decl: %Class.type = class_decl @Class [template = constants.%Class.generic] { // CHECK:STDOUT: %T.patt.loc4_13.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_13.2 (constants.%T.patt)] // CHECK:STDOUT: %T.param_patt: type = value_param_pattern %T.patt.loc4_13.1, runtime_param [symbolic = %T.patt.loc4_13.2 (constants.%T.patt)] -// CHECK:STDOUT: %N.patt.loc4_23.1: %i32 = symbolic_binding_pattern N, 1 [symbolic = %N.patt.loc4_23.2 (constants.%N.patt)] -// CHECK:STDOUT: %N.param_patt: %i32 = value_param_pattern %N.patt.loc4_23.1, runtime_param [symbolic = %N.patt.loc4_23.2 (constants.%N.patt)] +// CHECK:STDOUT: %N.patt.loc4_23.1: %i32 = symbolic_binding_pattern N, 1 [symbolic = %N.patt.loc4_23.2 (constants.%N.patt.2)] +// CHECK:STDOUT: %N.param_patt: %i32 = value_param_pattern %N.patt.loc4_23.1, runtime_param [symbolic = %N.patt.loc4_23.2 (constants.%N.patt.2)] // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc4_27.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc4_27.2: type = converted %int.make_type_signed, %.loc4_27.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %T.param: type = value_param runtime_param // CHECK:STDOUT: %T.loc4_13.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc4_13.2 (constants.%T)] // CHECK:STDOUT: %N.param: %i32 = value_param runtime_param -// CHECK:STDOUT: %N.loc4_23.1: %i32 = bind_symbolic_name N, 1, %N.param [symbolic = %N.loc4_23.2 (constants.%N)] +// CHECK:STDOUT: %N.loc4_23.1: %i32 = bind_symbolic_name N, 1, %N.param [symbolic = %N.loc4_23.2 (constants.%N.2)] // CHECK:STDOUT: } // CHECK:STDOUT: %Class.ref: %Class.type = name_ref Class, %Class.decl [template = constants.%Class.generic] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc13_17.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc13_17.2: type = converted %int.make_type_signed, %.loc13_17.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %ptr: type = ptr_type %i32 [template = constants.%ptr] // CHECK:STDOUT: %a.var: ref = var a // CHECK:STDOUT: %a: ref = bind_name a, %a.var @@ -286,13 +274,13 @@ class Outer(T:! type) { // CHECK:STDOUT: generic class @Class(%T.loc4_13.1: type, %N.loc4_23.1: %i32) { // CHECK:STDOUT: %T.loc4_13.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_13.2 (constants.%T)] // CHECK:STDOUT: %T.patt.loc4_13.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_13.2 (constants.%T.patt)] -// CHECK:STDOUT: %N.loc4_23.2: %i32 = bind_symbolic_name N, 1 [symbolic = %N.loc4_23.2 (constants.%N)] -// CHECK:STDOUT: %N.patt.loc4_23.2: %i32 = symbolic_binding_pattern N, 1 [symbolic = %N.patt.loc4_23.2 (constants.%N.patt)] +// CHECK:STDOUT: %N.loc4_23.2: %i32 = bind_symbolic_name N, 1 [symbolic = %N.loc4_23.2 (constants.%N.2)] +// CHECK:STDOUT: %N.patt.loc4_23.2: %i32 = symbolic_binding_pattern N, 1 [symbolic = %N.patt.loc4_23.2 (constants.%N.patt.2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: class { -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.2] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class @@ -300,11 +288,11 @@ class Outer(T:! type) { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Class(constants.%T, constants.%N) { +// CHECK:STDOUT: specific @Class(constants.%T, constants.%N.2) { // CHECK:STDOUT: %T.loc4_13.2 => constants.%T // CHECK:STDOUT: %T.patt.loc4_13.2 => constants.%T -// CHECK:STDOUT: %N.loc4_23.2 => constants.%N -// CHECK:STDOUT: %N.patt.loc4_23.2 => constants.%N +// CHECK:STDOUT: %N.loc4_23.2 => constants.%N.2 +// CHECK:STDOUT: %N.patt.loc4_23.2 => constants.%N.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_too_many.carbon @@ -313,16 +301,14 @@ class Outer(T:! type) { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] -// CHECK:STDOUT: %N: %i32 = bind_symbolic_name N, 1 [symbolic] -// CHECK:STDOUT: %N.patt: %i32 = symbolic_binding_pattern N, 1 [symbolic] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] +// CHECK:STDOUT: %N.2: %i32 = bind_symbolic_name N, 1 [symbolic] +// CHECK:STDOUT: %N.patt.2: %i32 = symbolic_binding_pattern N, 1 [symbolic] // CHECK:STDOUT: %Class.type: type = generic_class_type @Class [template] // CHECK:STDOUT: %Class.generic: %Class.type = struct_value () [template] -// CHECK:STDOUT: %Class: type = class_type @Class, @Class(%T, %N) [symbolic] +// CHECK:STDOUT: %Class: type = class_type @Class, @Class(%T, %N.2) [symbolic] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %complete_type.2: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %ptr: type = ptr_type %i32 [template] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template] @@ -330,7 +316,7 @@ class Outer(T:! type) { // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -346,23 +332,19 @@ class Outer(T:! type) { // CHECK:STDOUT: %Class.decl: %Class.type = class_decl @Class [template = constants.%Class.generic] { // CHECK:STDOUT: %T.patt.loc4_13.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_13.2 (constants.%T.patt)] // CHECK:STDOUT: %T.param_patt: type = value_param_pattern %T.patt.loc4_13.1, runtime_param [symbolic = %T.patt.loc4_13.2 (constants.%T.patt)] -// CHECK:STDOUT: %N.patt.loc4_23.1: %i32 = symbolic_binding_pattern N, 1 [symbolic = %N.patt.loc4_23.2 (constants.%N.patt)] -// CHECK:STDOUT: %N.param_patt: %i32 = value_param_pattern %N.patt.loc4_23.1, runtime_param [symbolic = %N.patt.loc4_23.2 (constants.%N.patt)] +// CHECK:STDOUT: %N.patt.loc4_23.1: %i32 = symbolic_binding_pattern N, 1 [symbolic = %N.patt.loc4_23.2 (constants.%N.patt.2)] +// CHECK:STDOUT: %N.param_patt: %i32 = value_param_pattern %N.patt.loc4_23.1, runtime_param [symbolic = %N.patt.loc4_23.2 (constants.%N.patt.2)] // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc4_27.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc4_27.2: type = converted %int.make_type_signed, %.loc4_27.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %T.param: type = value_param runtime_param // CHECK:STDOUT: %T.loc4_13.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc4_13.2 (constants.%T)] // CHECK:STDOUT: %N.param: %i32 = value_param runtime_param -// CHECK:STDOUT: %N.loc4_23.1: %i32 = bind_symbolic_name N, 1, %N.param [symbolic = %N.loc4_23.2 (constants.%N)] +// CHECK:STDOUT: %N.loc4_23.1: %i32 = bind_symbolic_name N, 1, %N.param [symbolic = %N.loc4_23.2 (constants.%N.2)] // CHECK:STDOUT: } // CHECK:STDOUT: %Class.ref: %Class.type = name_ref Class, %Class.decl [template = constants.%Class.generic] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc13_17.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc13_17.2: type = converted %int.make_type_signed, %.loc13_17.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %ptr: type = ptr_type %i32 [template = constants.%ptr] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2] @@ -373,13 +355,13 @@ class Outer(T:! type) { // CHECK:STDOUT: generic class @Class(%T.loc4_13.1: type, %N.loc4_23.1: %i32) { // CHECK:STDOUT: %T.loc4_13.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_13.2 (constants.%T)] // CHECK:STDOUT: %T.patt.loc4_13.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_13.2 (constants.%T.patt)] -// CHECK:STDOUT: %N.loc4_23.2: %i32 = bind_symbolic_name N, 1 [symbolic = %N.loc4_23.2 (constants.%N)] -// CHECK:STDOUT: %N.patt.loc4_23.2: %i32 = symbolic_binding_pattern N, 1 [symbolic = %N.patt.loc4_23.2 (constants.%N.patt)] +// CHECK:STDOUT: %N.loc4_23.2: %i32 = bind_symbolic_name N, 1 [symbolic = %N.loc4_23.2 (constants.%N.2)] +// CHECK:STDOUT: %N.patt.loc4_23.2: %i32 = symbolic_binding_pattern N, 1 [symbolic = %N.patt.loc4_23.2 (constants.%N.patt.2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: class { -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.2] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class @@ -387,11 +369,11 @@ class Outer(T:! type) { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Class(constants.%T, constants.%N) { +// CHECK:STDOUT: specific @Class(constants.%T, constants.%N.2) { // CHECK:STDOUT: %T.loc4_13.2 => constants.%T // CHECK:STDOUT: %T.patt.loc4_13.2 => constants.%T -// CHECK:STDOUT: %N.loc4_23.2 => constants.%N -// CHECK:STDOUT: %N.patt.loc4_23.2 => constants.%N +// CHECK:STDOUT: %N.loc4_23.2 => constants.%N.2 +// CHECK:STDOUT: %N.patt.loc4_23.2 => constants.%N.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_no_conversion.carbon @@ -400,16 +382,14 @@ class Outer(T:! type) { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] -// CHECK:STDOUT: %N.1: %i32 = bind_symbolic_name N, 1 [symbolic] -// CHECK:STDOUT: %N.patt.1: %i32 = symbolic_binding_pattern N, 1 [symbolic] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] +// CHECK:STDOUT: %N.2: %i32 = bind_symbolic_name N, 1 [symbolic] +// CHECK:STDOUT: %N.patt.2: %i32 = symbolic_binding_pattern N, 1 [symbolic] // CHECK:STDOUT: %Class.type: type = generic_class_type @Class [template] // CHECK:STDOUT: %Class.generic: %Class.type = struct_value () [template] -// CHECK:STDOUT: %Class: type = class_type @Class, @Class(%T, %N.1) [symbolic] +// CHECK:STDOUT: %Class: type = class_type @Class, @Class(%T, %N.2) [symbolic] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %complete_type.2: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %int_5: Core.IntLiteral = int_value 5 [template] // CHECK:STDOUT: %ptr: type = ptr_type %i32 [template] // CHECK:STDOUT: } @@ -417,7 +397,7 @@ class Outer(T:! type) { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -433,26 +413,22 @@ class Outer(T:! type) { // CHECK:STDOUT: %Class.decl: %Class.type = class_decl @Class [template = constants.%Class.generic] { // CHECK:STDOUT: %T.patt.loc4_13.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_13.2 (constants.%T.patt)] // CHECK:STDOUT: %T.param_patt: type = value_param_pattern %T.patt.loc4_13.1, runtime_param [symbolic = %T.patt.loc4_13.2 (constants.%T.patt)] -// CHECK:STDOUT: %N.patt.loc4_23.1: %i32 = symbolic_binding_pattern N, 1 [symbolic = %N.patt.loc4_23.2 (constants.%N.patt.1)] -// CHECK:STDOUT: %N.param_patt: %i32 = value_param_pattern %N.patt.loc4_23.1, runtime_param [symbolic = %N.patt.loc4_23.2 (constants.%N.patt.1)] +// CHECK:STDOUT: %N.patt.loc4_23.1: %i32 = symbolic_binding_pattern N, 1 [symbolic = %N.patt.loc4_23.2 (constants.%N.patt.2)] +// CHECK:STDOUT: %N.param_patt: %i32 = value_param_pattern %N.patt.loc4_23.1, runtime_param [symbolic = %N.patt.loc4_23.2 (constants.%N.patt.2)] // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc4_27.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc4_27.2: type = converted %int.make_type_signed, %.loc4_27.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %T.param: type = value_param runtime_param // CHECK:STDOUT: %T.loc4_13.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc4_13.2 (constants.%T)] // CHECK:STDOUT: %N.param: %i32 = value_param runtime_param -// CHECK:STDOUT: %N.loc4_23.1: %i32 = bind_symbolic_name N, 1, %N.param [symbolic = %N.loc4_23.2 (constants.%N.1)] +// CHECK:STDOUT: %N.loc4_23.1: %i32 = bind_symbolic_name N, 1, %N.param [symbolic = %N.loc4_23.2 (constants.%N.2)] // CHECK:STDOUT: } // CHECK:STDOUT: %Class.ref: %Class.type = name_ref Class, %Class.decl [template = constants.%Class.generic] // CHECK:STDOUT: %int_5: Core.IntLiteral = int_value 5 [template = constants.%int_5] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc15_20.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc15_20.2: type = converted %int.make_type_signed, %.loc15_20.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %ptr: type = ptr_type %i32 [template = constants.%ptr] -// CHECK:STDOUT: %.loc15_21: type = converted %int_5, [template = ] +// CHECK:STDOUT: %.loc15: type = converted %int_5, [template = ] // CHECK:STDOUT: %a.var: ref = var a // CHECK:STDOUT: %a: ref = bind_name a, %a.var // CHECK:STDOUT: } @@ -460,13 +436,13 @@ class Outer(T:! type) { // CHECK:STDOUT: generic class @Class(%T.loc4_13.1: type, %N.loc4_23.1: %i32) { // CHECK:STDOUT: %T.loc4_13.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_13.2 (constants.%T)] // CHECK:STDOUT: %T.patt.loc4_13.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_13.2 (constants.%T.patt)] -// CHECK:STDOUT: %N.loc4_23.2: %i32 = bind_symbolic_name N, 1 [symbolic = %N.loc4_23.2 (constants.%N.1)] -// CHECK:STDOUT: %N.patt.loc4_23.2: %i32 = symbolic_binding_pattern N, 1 [symbolic = %N.patt.loc4_23.2 (constants.%N.patt.1)] +// CHECK:STDOUT: %N.loc4_23.2: %i32 = bind_symbolic_name N, 1 [symbolic = %N.loc4_23.2 (constants.%N.2)] +// CHECK:STDOUT: %N.patt.loc4_23.2: %i32 = symbolic_binding_pattern N, 1 [symbolic = %N.patt.loc4_23.2 (constants.%N.patt.2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: class { -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.2] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class @@ -474,11 +450,11 @@ class Outer(T:! type) { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Class(constants.%T, constants.%N.1) { +// CHECK:STDOUT: specific @Class(constants.%T, constants.%N.2) { // CHECK:STDOUT: %T.loc4_13.2 => constants.%T // CHECK:STDOUT: %T.patt.loc4_13.2 => constants.%T -// CHECK:STDOUT: %N.loc4_23.2 => constants.%N.1 -// CHECK:STDOUT: %N.patt.loc4_23.2 => constants.%N.1 +// CHECK:STDOUT: %N.loc4_23.2 => constants.%N.2 +// CHECK:STDOUT: %N.patt.loc4_23.2 => constants.%N.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- call_in_nested_return_type.carbon diff --git a/toolchain/check/testdata/class/generic/complete_in_conversion.carbon b/toolchain/check/testdata/class/generic/complete_in_conversion.carbon index 6ab05b239223f..87243bb9824d1 100644 --- a/toolchain/check/testdata/class/generic/complete_in_conversion.carbon +++ b/toolchain/check/testdata/class/generic/complete_in_conversion.carbon @@ -10,15 +10,17 @@ // --- fail_derived_to_base.carbon +fn Int(N: Core.IntLiteral()) -> type = "int.make_type_signed"; + base class B {} class A(N:! i32) { extend base: B; // CHECK:STDERR: fail_derived_to_base.carbon:[[@LINE+3]]:10: error: integer type width of 0 is not positive [IntWidthNotPositive] - // CHECK:STDERR: var n: Core.Int(N); - // CHECK:STDERR: ^~~~~~~~~~~ - var n: Core.Int(N); + // CHECK:STDERR: var n: Int(N); + // CHECK:STDERR: ^~~~~~ + var n: Int(N); } fn F(a: A(0)*) { @@ -31,37 +33,39 @@ fn F(a: A(0)*) { // CHECK:STDOUT: --- fail_derived_to_base.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { +// CHECK:STDOUT: %IntLiteral.type: type = fn_type @IntLiteral [template] +// CHECK:STDOUT: %IntLiteral: %IntLiteral.type = struct_value () [template] +// CHECK:STDOUT: %Int.type.1: type = fn_type @Int.1 [template] +// CHECK:STDOUT: %Int.1: %Int.type.1 = struct_value () [template] // CHECK:STDOUT: %B: type = class_type @B [template] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] // CHECK:STDOUT: %complete_type.1: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] -// CHECK:STDOUT: %N.1: %i32 = bind_symbolic_name N, 0 [symbolic] -// CHECK:STDOUT: %N.patt.1: %i32 = symbolic_binding_pattern N, 0 [symbolic] +// CHECK:STDOUT: %i32: type = class_type @Int.2, @Int.2(%int_32) [template] +// CHECK:STDOUT: %N.2: %i32 = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %N.patt.2: %i32 = symbolic_binding_pattern N, 0 [symbolic] // CHECK:STDOUT: %A.type: type = generic_class_type @A [template] // CHECK:STDOUT: %A.generic: %A.type = struct_value () [template] -// CHECK:STDOUT: %A.1: type = class_type @A, @A(%N.1) [symbolic] +// CHECK:STDOUT: %A.1: type = class_type @A, @A(%N.2) [symbolic] // CHECK:STDOUT: %A.elem.1: type = unbound_element_type %A.1, %B [symbolic] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.type.13: type = fn_type @Convert.4, @impl.3(%int_32) [template] -// CHECK:STDOUT: %Convert.13: %Convert.type.13 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.13) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %N.1, %Convert.13 [symbolic] -// CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.4(%int_32) [symbolic] -// CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %Convert.specific_fn.1(%N.1) [symbolic] -// CHECK:STDOUT: %iN.2: type = int_type signed, %int.convert_checked [symbolic] -// CHECK:STDOUT: %require_complete.7: = require_complete_type %iN.2 [symbolic] -// CHECK:STDOUT: %A.elem.2: type = unbound_element_type %A.1, %iN.2 [symbolic] -// CHECK:STDOUT: %struct_type.base.n: type = struct_type {.base: %B, .n: %iN.2} [symbolic] -// CHECK:STDOUT: %complete_type.3: = complete_type_witness %struct_type.base.n [symbolic] +// CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.3, @impl.2(%int_32) [template] +// CHECK:STDOUT: %Convert.9: %Convert.type.9 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.9) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %N.2, %Convert.9 [symbolic] +// CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.3(%int_32) [symbolic] +// CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %Convert.specific_fn.1(%N.2) [symbolic] +// CHECK:STDOUT: %iN.builtin.2: type = int_type signed, %int.convert_checked [symbolic] +// CHECK:STDOUT: %require_complete.5: = require_complete_type %iN.builtin.2 [symbolic] +// CHECK:STDOUT: %A.elem.2: type = unbound_element_type %A.1, %iN.builtin.2 [symbolic] +// CHECK:STDOUT: %struct_type.base.n: type = struct_type {.base: %B, .n: %iN.builtin.2} [symbolic] +// CHECK:STDOUT: %complete_type.4: = complete_type_witness %struct_type.base.n [symbolic] // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %interface.10: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_0.1, %Convert.15 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [template] +// CHECK:STDOUT: %interface.6: = interface_witness (%Convert.11) [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_0.1, %Convert.11 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] // CHECK:STDOUT: %A.2: type = class_type @A, @A(%int_0.2) [template] @@ -70,39 +74,55 @@ fn F(a: A(0)*) { // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %ptr.3: type = ptr_type %B [template] // CHECK:STDOUT: %A.elem.3: type = unbound_element_type %A.2, %B [template] -// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_0.2, %Convert.13 [template] -// CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.4(%int_32) [template] +// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_0.2, %Convert.9 [template] +// CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.3(%int_32) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .IntLiteral = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.6 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: %Int.type = import_ref Core//prelude/types, Int, loaded [template = constants.%Int] +// CHECK:STDOUT: %import_ref.1: %IntLiteral.type = import_ref Core//prelude/types/int_literal, IntLiteral, loaded [template = constants.%IntLiteral] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Int = %Int.decl // CHECK:STDOUT: .B = %B.decl // CHECK:STDOUT: .A = %A.decl // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %Int.decl: %Int.type.1 = fn_decl @Int.1 [template = constants.%Int.1] { +// CHECK:STDOUT: %N.patt: Core.IntLiteral = binding_pattern N +// CHECK:STDOUT: %N.param_patt: Core.IntLiteral = value_param_pattern %N.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: type = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: type = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] +// CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, imports.%import_ref.1 [template = constants.%IntLiteral] +// CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral] +// CHECK:STDOUT: %.loc2_27.1: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral] +// CHECK:STDOUT: %.loc2_27.2: type = converted %int_literal.make_type, %.loc2_27.1 [template = Core.IntLiteral] +// CHECK:STDOUT: %N.param: Core.IntLiteral = value_param runtime_param0 +// CHECK:STDOUT: %N: Core.IntLiteral = bind_name N, %N.param +// CHECK:STDOUT: %return.param: ref type = out_param runtime_param1 +// CHECK:STDOUT: %return: ref type = return_slot %return.param +// CHECK:STDOUT: } // CHECK:STDOUT: %B.decl: type = class_decl @B [template = constants.%B] {} {} // CHECK:STDOUT: %A.decl: %A.type = class_decl @A [template = constants.%A.generic] { -// CHECK:STDOUT: %N.patt.loc4_9.1: %i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc4_9.2 (constants.%N.patt.1)] -// CHECK:STDOUT: %N.param_patt: %i32 = value_param_pattern %N.patt.loc4_9.1, runtime_param [symbolic = %N.patt.loc4_9.2 (constants.%N.patt.1)] +// CHECK:STDOUT: %N.patt.loc6_9.1: %i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc6_9.2 (constants.%N.patt.2)] +// CHECK:STDOUT: %N.param_patt: %i32 = value_param_pattern %N.patt.loc6_9.1, runtime_param [symbolic = %N.patt.loc6_9.2 (constants.%N.patt.2)] // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc4: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc4_13.1: type = value_of_initializer %int.make_type_signed.loc4 [template = constants.%i32] -// CHECK:STDOUT: %.loc4_13.2: type = converted %int.make_type_signed.loc4, %.loc4_13.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int.2, @Int.2(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %N.param: %i32 = value_param runtime_param -// CHECK:STDOUT: %N.loc4_9.1: %i32 = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc4_9.2 (constants.%N.1)] +// CHECK:STDOUT: %N.loc6_9.1: %i32 = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc6_9.2 (constants.%N.2)] // CHECK:STDOUT: } // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %a.patt: %ptr.2 = binding_pattern a @@ -110,14 +130,14 @@ fn F(a: A(0)*) { // CHECK:STDOUT: } { // CHECK:STDOUT: %A.ref: %A.type = name_ref A, file.%A.decl [template = constants.%A.generic] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.14 = interface_witness_access constants.%interface.10, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %impl.elem0: %Convert.type.10 = interface_witness_access constants.%interface.6, element0 [template = constants.%Convert.11] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc13_12.1: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc13_12.2: %i32 = converted %int_0, %.loc13_12.1 [template = constants.%int_0.2] +// CHECK:STDOUT: %.loc15_12.1: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_0.2] +// CHECK:STDOUT: %.loc15_12.2: %i32 = converted %int_0, %.loc15_12.1 [template = constants.%int_0.2] // CHECK:STDOUT: %A: type = class_type @A, @A(constants.%int_0.2) [template = constants.%A.2] -// CHECK:STDOUT: %ptr.loc13: type = ptr_type %A.2 [template = constants.%ptr.2] +// CHECK:STDOUT: %ptr.loc15: type = ptr_type %A.2 [template = constants.%ptr.2] // CHECK:STDOUT: %a.param: %ptr.2 = value_param runtime_param0 // CHECK:STDOUT: %a: %ptr.2 = bind_name a, %a.param // CHECK:STDOUT: } @@ -131,86 +151,87 @@ fn F(a: A(0)*) { // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @A(%N.loc4_9.1: %i32) { -// CHECK:STDOUT: %N.loc4_9.2: %i32 = bind_symbolic_name N, 0 [symbolic = %N.loc4_9.2 (constants.%N.1)] -// CHECK:STDOUT: %N.patt.loc4_9.2: %i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc4_9.2 (constants.%N.patt.1)] +// CHECK:STDOUT: generic class @A(%N.loc6_9.1: %i32) { +// CHECK:STDOUT: %N.loc6_9.2: %i32 = bind_symbolic_name N, 0 [symbolic = %N.loc6_9.2 (constants.%N.2)] +// CHECK:STDOUT: %N.patt.loc6_9.2: %i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc6_9.2 (constants.%N.patt.2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %A: type = class_type @A, @A(%N.loc4_9.2) [symbolic = %A (constants.%A.1)] -// CHECK:STDOUT: %A.elem.loc5: type = unbound_element_type @A.%A (%A.1), %B [symbolic = %A.elem.loc5 (constants.%A.elem.1)] -// CHECK:STDOUT: %Convert.bound.loc10_19.2: = bound_method %N.loc4_9.2, constants.%Convert.13 [symbolic = %Convert.bound.loc10_19.2 (constants.%Convert.bound.1)] -// CHECK:STDOUT: %Convert.specific_fn.loc10_19.2: = specific_function %Convert.bound.loc10_19.2, @Convert.4(constants.%int_32) [symbolic = %Convert.specific_fn.loc10_19.2 (constants.%Convert.specific_fn.1)] -// CHECK:STDOUT: %int.convert_checked.loc10_19.2: init Core.IntLiteral = call %Convert.specific_fn.loc10_19.2(%N.loc4_9.2) [symbolic = %int.convert_checked.loc10_19.2 (constants.%int.convert_checked)] -// CHECK:STDOUT: %iN: type = int_type signed, %int.convert_checked.loc10_19.2 [symbolic = %iN (constants.%iN.2)] -// CHECK:STDOUT: %require_complete: = require_complete_type @A.%iN (%iN.2) [symbolic = %require_complete (constants.%require_complete.7)] -// CHECK:STDOUT: %A.elem.loc10: type = unbound_element_type @A.%A (%A.1), @A.%iN (%iN.2) [symbolic = %A.elem.loc10 (constants.%A.elem.2)] -// CHECK:STDOUT: %struct_type.base.n: type = struct_type {.base: %B, .n: @A.%iN (%iN.2)} [symbolic = %struct_type.base.n (constants.%struct_type.base.n)] -// CHECK:STDOUT: %complete_type.loc11_1.2: = complete_type_witness @A.%struct_type.base.n (%struct_type.base.n) [symbolic = %complete_type.loc11_1.2 (constants.%complete_type.3)] +// CHECK:STDOUT: %A: type = class_type @A, @A(%N.loc6_9.2) [symbolic = %A (constants.%A.1)] +// CHECK:STDOUT: %A.elem.loc7: type = unbound_element_type @A.%A (%A.1), %B [symbolic = %A.elem.loc7 (constants.%A.elem.1)] +// CHECK:STDOUT: %Convert.bound.loc12_14.2: = bound_method %N.loc6_9.2, constants.%Convert.9 [symbolic = %Convert.bound.loc12_14.2 (constants.%Convert.bound.1)] +// CHECK:STDOUT: %Convert.specific_fn.loc12_14.2: = specific_function %Convert.bound.loc12_14.2, @Convert.3(constants.%int_32) [symbolic = %Convert.specific_fn.loc12_14.2 (constants.%Convert.specific_fn.1)] +// CHECK:STDOUT: %int.convert_checked.loc12_14.2: init Core.IntLiteral = call %Convert.specific_fn.loc12_14.2(%N.loc6_9.2) [symbolic = %int.convert_checked.loc12_14.2 (constants.%int.convert_checked)] +// CHECK:STDOUT: %iN.builtin: type = int_type signed, %int.convert_checked.loc12_14.2 [symbolic = %iN.builtin (constants.%iN.builtin.2)] +// CHECK:STDOUT: %require_complete: = require_complete_type @A.%iN.builtin (%iN.builtin.2) [symbolic = %require_complete (constants.%require_complete.5)] +// CHECK:STDOUT: %A.elem.loc12: type = unbound_element_type @A.%A (%A.1), @A.%iN.builtin (%iN.builtin.2) [symbolic = %A.elem.loc12 (constants.%A.elem.2)] +// CHECK:STDOUT: %struct_type.base.n: type = struct_type {.base: %B, .n: @A.%iN.builtin (%iN.builtin.2)} [symbolic = %struct_type.base.n (constants.%struct_type.base.n)] +// CHECK:STDOUT: %complete_type.loc13_1.2: = complete_type_witness @A.%struct_type.base.n (%struct_type.base.n) [symbolic = %complete_type.loc13_1.2 (constants.%complete_type.4)] // CHECK:STDOUT: // CHECK:STDOUT: class { // CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [template = constants.%B] -// CHECK:STDOUT: %.loc5: @A.%A.elem.loc5 (%A.elem.1) = base_decl %B.ref, element0 [template] -// CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] -// CHECK:STDOUT: %Int.ref: %Int.type = name_ref Int, imports.%import_ref.1 [template = constants.%Int] -// CHECK:STDOUT: %N.ref: %i32 = name_ref N, %N.loc4_9.1 [symbolic = %N.loc4_9.2 (constants.%N.1)] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.13] -// CHECK:STDOUT: %Convert.bound.loc10_19.1: = bound_method %N.ref, %impl.elem0 [symbolic = %Convert.bound.loc10_19.2 (constants.%Convert.bound.1)] -// CHECK:STDOUT: %Convert.specific_fn.loc10_19.1: = specific_function %Convert.bound.loc10_19.1, @Convert.4(constants.%int_32) [symbolic = %Convert.specific_fn.loc10_19.2 (constants.%Convert.specific_fn.1)] -// CHECK:STDOUT: %int.convert_checked.loc10_19.1: init Core.IntLiteral = call %Convert.specific_fn.loc10_19.1(%N.ref) [symbolic = %int.convert_checked.loc10_19.2 (constants.%int.convert_checked)] -// CHECK:STDOUT: %.loc10_19.1: Core.IntLiteral = value_of_initializer %int.convert_checked.loc10_19.1 [symbolic = %int.convert_checked.loc10_19.2 (constants.%int.convert_checked)] -// CHECK:STDOUT: %.loc10_19.2: Core.IntLiteral = converted %N.ref, %.loc10_19.1 [symbolic = %int.convert_checked.loc10_19.2 (constants.%int.convert_checked)] -// CHECK:STDOUT: %int.make_type_signed.loc10: init type = call %Int.ref(%.loc10_19.2) [symbolic = %iN (constants.%iN.2)] -// CHECK:STDOUT: %.loc10_20.1: type = value_of_initializer %int.make_type_signed.loc10 [symbolic = %iN (constants.%iN.2)] -// CHECK:STDOUT: %.loc10_20.2: type = converted %int.make_type_signed.loc10, %.loc10_20.1 [symbolic = %iN (constants.%iN.2)] -// CHECK:STDOUT: %.loc10_8: @A.%A.elem.loc10 (%A.elem.2) = field_decl n, element1 [template] -// CHECK:STDOUT: %complete_type.loc11_1.1: = complete_type_witness %struct_type.base.n [symbolic = %complete_type.loc11_1.2 (constants.%complete_type.3)] +// CHECK:STDOUT: %.loc7: @A.%A.elem.loc7 (%A.elem.1) = base_decl %B.ref, element0 [template] +// CHECK:STDOUT: %Int.ref: %Int.type.1 = name_ref Int, file.%Int.decl [template = constants.%Int.1] +// CHECK:STDOUT: %N.ref: %i32 = name_ref N, %N.loc6_9.1 [symbolic = %N.loc6_9.2 (constants.%N.2)] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.9] +// CHECK:STDOUT: %Convert.bound.loc12_14.1: = bound_method %N.ref, %impl.elem0 [symbolic = %Convert.bound.loc12_14.2 (constants.%Convert.bound.1)] +// CHECK:STDOUT: %Convert.specific_fn.loc12_14.1: = specific_function %Convert.bound.loc12_14.1, @Convert.3(constants.%int_32) [symbolic = %Convert.specific_fn.loc12_14.2 (constants.%Convert.specific_fn.1)] +// CHECK:STDOUT: %int.convert_checked.loc12_14.1: init Core.IntLiteral = call %Convert.specific_fn.loc12_14.1(%N.ref) [symbolic = %int.convert_checked.loc12_14.2 (constants.%int.convert_checked)] +// CHECK:STDOUT: %.loc12_14.1: Core.IntLiteral = value_of_initializer %int.convert_checked.loc12_14.1 [symbolic = %int.convert_checked.loc12_14.2 (constants.%int.convert_checked)] +// CHECK:STDOUT: %.loc12_14.2: Core.IntLiteral = converted %N.ref, %.loc12_14.1 [symbolic = %int.convert_checked.loc12_14.2 (constants.%int.convert_checked)] +// CHECK:STDOUT: %int.make_type_signed: init type = call %Int.ref(%.loc12_14.2) [symbolic = %iN.builtin (constants.%iN.builtin.2)] +// CHECK:STDOUT: %.loc12_15.1: type = value_of_initializer %int.make_type_signed [symbolic = %iN.builtin (constants.%iN.builtin.2)] +// CHECK:STDOUT: %.loc12_15.2: type = converted %int.make_type_signed, %.loc12_15.1 [symbolic = %iN.builtin (constants.%iN.builtin.2)] +// CHECK:STDOUT: %.loc12_8: @A.%A.elem.loc12 (%A.elem.2) = field_decl n, element1 [template] +// CHECK:STDOUT: %complete_type.loc13_1.1: = complete_type_witness %struct_type.base.n [symbolic = %complete_type.loc13_1.2 (constants.%complete_type.4)] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%A.1 -// CHECK:STDOUT: .base = %.loc5 -// CHECK:STDOUT: .n = %.loc10_8 +// CHECK:STDOUT: .base = %.loc7 +// CHECK:STDOUT: .n = %.loc12_8 // CHECK:STDOUT: extend %B.ref -// CHECK:STDOUT: complete_type_witness = %complete_type.loc11_1.1 +// CHECK:STDOUT: complete_type_witness = %complete_type.loc13_1.1 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Int.1(%N.param_patt: Core.IntLiteral) -> type = "int.make_type_signed"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @F(%a.param_patt: %ptr.2) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [template = constants.%B] -// CHECK:STDOUT: %ptr.loc17: type = ptr_type %B [template = constants.%ptr.3] +// CHECK:STDOUT: %ptr.loc19: type = ptr_type %B [template = constants.%ptr.3] // CHECK:STDOUT: %a.ref: %ptr.2 = name_ref a, %a -// CHECK:STDOUT: %.loc17_16.1: ref %A.2 = deref %a.ref -// CHECK:STDOUT: %.loc17_16.2: ref %B = class_element_access %.loc17_16.1, element0 -// CHECK:STDOUT: %addr: %ptr.3 = addr_of %.loc17_16.2 -// CHECK:STDOUT: %.loc17_16.3: %ptr.3 = converted %a.ref, %addr -// CHECK:STDOUT: %b: %ptr.3 = bind_name b, %.loc17_16.3 +// CHECK:STDOUT: %.loc19_16.1: ref %A.2 = deref %a.ref +// CHECK:STDOUT: %.loc19_16.2: ref %B = class_element_access %.loc19_16.1, element0 +// CHECK:STDOUT: %addr: %ptr.3 = addr_of %.loc19_16.2 +// CHECK:STDOUT: %.loc19_16.3: %ptr.3 = converted %a.ref, %addr +// CHECK:STDOUT: %b: %ptr.3 = bind_name b, %.loc19_16.3 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @A(constants.%N.1) { -// CHECK:STDOUT: %N.loc4_9.2 => constants.%N.1 -// CHECK:STDOUT: %N.patt.loc4_9.2 => constants.%N.1 +// CHECK:STDOUT: specific @A(constants.%N.2) { +// CHECK:STDOUT: %N.loc6_9.2 => constants.%N.2 +// CHECK:STDOUT: %N.patt.loc6_9.2 => constants.%N.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @A(%N.loc4_9.2) { -// CHECK:STDOUT: %N.loc4_9.2 => constants.%N.1 -// CHECK:STDOUT: %N.patt.loc4_9.2 => constants.%N.1 +// CHECK:STDOUT: specific @A(%N.loc6_9.2) { +// CHECK:STDOUT: %N.loc6_9.2 => constants.%N.2 +// CHECK:STDOUT: %N.patt.loc6_9.2 => constants.%N.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @A(constants.%int_0.2) { -// CHECK:STDOUT: %N.loc4_9.2 => constants.%int_0.2 -// CHECK:STDOUT: %N.patt.loc4_9.2 => constants.%int_0.2 +// CHECK:STDOUT: %N.loc6_9.2 => constants.%int_0.2 +// CHECK:STDOUT: %N.patt.loc6_9.2 => constants.%int_0.2 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %A => constants.%A.2 -// CHECK:STDOUT: %A.elem.loc5 => constants.%A.elem.3 -// CHECK:STDOUT: %Convert.bound.loc10_19.2 => constants.%Convert.bound.3 -// CHECK:STDOUT: %Convert.specific_fn.loc10_19.2 => constants.%Convert.specific_fn.3 -// CHECK:STDOUT: %int.convert_checked.loc10_19.2 => constants.%int_0.1 -// CHECK:STDOUT: %iN => +// CHECK:STDOUT: %A.elem.loc7 => constants.%A.elem.3 +// CHECK:STDOUT: %Convert.bound.loc12_14.2 => constants.%Convert.bound.3 +// CHECK:STDOUT: %Convert.specific_fn.loc12_14.2 => constants.%Convert.specific_fn.3 +// CHECK:STDOUT: %int.convert_checked.loc12_14.2 => constants.%int_0.1 +// CHECK:STDOUT: %iN.builtin => // CHECK:STDOUT: %require_complete => -// CHECK:STDOUT: %A.elem.loc10 => +// CHECK:STDOUT: %A.elem.loc12 => // CHECK:STDOUT: %struct_type.base.n => -// CHECK:STDOUT: %complete_type.loc11_1.2 => +// CHECK:STDOUT: %complete_type.loc13_1.2 => // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/generic/field.carbon b/toolchain/check/testdata/class/generic/field.carbon index 1ebf70f19f5b9..d5dbf7c26a876 100644 --- a/toolchain/check/testdata/class/generic/field.carbon +++ b/toolchain/check/testdata/class/generic/field.carbon @@ -37,34 +37,33 @@ fn H(U:! type, c: Class(U)) -> U { // CHECK:STDOUT: %struct_type.x.1: type = struct_type {.x: %T} [symbolic] // CHECK:STDOUT: %complete_type.1: = complete_type_witness %struct_type.x.1 [symbolic] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %Class.2: type = class_type @Class, @Class(%i32) [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %complete_type.2: = complete_type_witness %i32 [template] +// CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %complete_type.3: = complete_type_witness %i32.builtin [template] // CHECK:STDOUT: %Class.elem.2: type = unbound_element_type %Class.2, %i32 [template] // CHECK:STDOUT: %struct_type.x.2: type = struct_type {.x: %i32} [template] -// CHECK:STDOUT: %complete_type.3: = complete_type_witness %struct_type.x.2 [template] +// CHECK:STDOUT: %complete_type.4: = complete_type_witness %struct_type.x.2 [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] -// CHECK:STDOUT: %require_complete.2: = require_complete_type %Class.1 [symbolic] +// CHECK:STDOUT: %require_complete.3: = require_complete_type %Class.1 [symbolic] // CHECK:STDOUT: %U: type = bind_symbolic_name U, 0 [symbolic] // CHECK:STDOUT: %U.patt: type = symbolic_binding_pattern U, 0 [symbolic] // CHECK:STDOUT: %Class.3: type = class_type @Class, @Class(%U) [symbolic] // CHECK:STDOUT: %H.type: type = fn_type @H [template] // CHECK:STDOUT: %H: %H.type = struct_value () [template] -// CHECK:STDOUT: %require_complete.3: = require_complete_type %U [symbolic] +// CHECK:STDOUT: %require_complete.4: = require_complete_type %U [symbolic] // CHECK:STDOUT: %Class.elem.3: type = unbound_element_type %Class.3, %U [symbolic] // CHECK:STDOUT: %struct_type.x.3: type = struct_type {.x: %U} [symbolic] -// CHECK:STDOUT: %complete_type.4: = complete_type_witness %struct_type.x.3 [symbolic] -// CHECK:STDOUT: %require_complete.4: = require_complete_type %Class.3 [symbolic] +// CHECK:STDOUT: %complete_type.5: = complete_type_witness %struct_type.x.3 [symbolic] +// CHECK:STDOUT: %require_complete.5: = require_complete_type %Class.3 [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -94,14 +93,10 @@ fn H(U:! type, c: Class(U)) -> U { // CHECK:STDOUT: } { // CHECK:STDOUT: %Class.ref: %Class.type = name_ref Class, file.%Class.decl [template = constants.%Class.generic] // CHECK:STDOUT: %int_32.loc15_15: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc15_15: init type = call constants.%Int(%int_32.loc15_15) [template = constants.%i32] -// CHECK:STDOUT: %.loc15_18.1: type = value_of_initializer %int.make_type_signed.loc15_15 [template = constants.%i32] -// CHECK:STDOUT: %.loc15_18.2: type = converted %int.make_type_signed.loc15_15, %.loc15_18.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc15_15: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %Class: type = class_type @Class, @Class(constants.%i32) [template = constants.%Class.2] // CHECK:STDOUT: %int_32.loc15_24: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc15_24: init type = call constants.%Int(%int_32.loc15_24) [template = constants.%i32] -// CHECK:STDOUT: %.loc15_24.1: type = value_of_initializer %int.make_type_signed.loc15_24 [template = constants.%i32] -// CHECK:STDOUT: %.loc15_24.2: type = converted %int.make_type_signed.loc15_24, %.loc15_24.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc15_24: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %c.param: %Class.2 = value_param runtime_param0 // CHECK:STDOUT: %c: %Class.2 = bind_name c, %c.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 @@ -185,7 +180,7 @@ fn H(U:! type, c: Class(U)) -> U { // CHECK:STDOUT: %Class.loc19_26.2: type = class_type @Class, @Class(%T.loc19_6.2) [symbolic = %Class.loc19_26.2 (constants.%Class.1)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete.loc19: = require_complete_type @G.%Class.loc19_26.2 (%Class.1) [symbolic = %require_complete.loc19 (constants.%require_complete.2)] +// CHECK:STDOUT: %require_complete.loc19: = require_complete_type @G.%Class.loc19_26.2 (%Class.1) [symbolic = %require_complete.loc19 (constants.%require_complete.3)] // CHECK:STDOUT: %Class.elem: type = unbound_element_type @G.%Class.loc19_26.2 (%Class.1), @G.%T.loc19_6.2 (%T) [symbolic = %Class.elem (constants.%Class.elem.1)] // CHECK:STDOUT: %require_complete.loc20: = require_complete_type @G.%T.loc19_6.2 (%T) [symbolic = %require_complete.loc20 (constants.%require_complete.1)] // CHECK:STDOUT: @@ -205,8 +200,8 @@ fn H(U:! type, c: Class(U)) -> U { // CHECK:STDOUT: %Class.loc23_26.2: type = class_type @Class, @Class(%U.loc23_6.2) [symbolic = %Class.loc23_26.2 (constants.%Class.3)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete.loc23_29: = require_complete_type @H.%U.loc23_6.2 (%U) [symbolic = %require_complete.loc23_29 (constants.%require_complete.3)] -// CHECK:STDOUT: %require_complete.loc23_17: = require_complete_type @H.%Class.loc23_26.2 (%Class.3) [symbolic = %require_complete.loc23_17 (constants.%require_complete.4)] +// CHECK:STDOUT: %require_complete.loc23_29: = require_complete_type @H.%U.loc23_6.2 (%U) [symbolic = %require_complete.loc23_29 (constants.%require_complete.4)] +// CHECK:STDOUT: %require_complete.loc23_17: = require_complete_type @H.%Class.loc23_26.2 (%Class.3) [symbolic = %require_complete.loc23_17 (constants.%require_complete.5)] // CHECK:STDOUT: %Class.elem: type = unbound_element_type @H.%Class.loc23_26.2 (%Class.3), @H.%U.loc23_6.2 (%U) [symbolic = %Class.elem (constants.%Class.elem.3)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%U.param_patt: type, %c.param_patt: @H.%Class.loc23_26.2 (%Class.3)) -> @H.%U.loc23_6.2 (%U) { @@ -241,11 +236,11 @@ fn H(U:! type, c: Class(U)) -> U { // CHECK:STDOUT: %T.patt.loc11_13.2 => constants.%i32 // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete => constants.%complete_type.2 +// CHECK:STDOUT: %require_complete => constants.%complete_type.3 // CHECK:STDOUT: %Class => constants.%Class.2 // CHECK:STDOUT: %Class.elem => constants.%Class.elem.2 // CHECK:STDOUT: %struct_type.x => constants.%struct_type.x.2 -// CHECK:STDOUT: %complete_type.loc13_1.2 => constants.%complete_type.3 +// CHECK:STDOUT: %complete_type.loc13_1.2 => constants.%complete_type.4 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(@G.%T.loc19_6.2) { @@ -264,11 +259,11 @@ fn H(U:! type, c: Class(U)) -> U { // CHECK:STDOUT: %T.patt.loc11_13.2 => constants.%U // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete => constants.%require_complete.3 +// CHECK:STDOUT: %require_complete => constants.%require_complete.4 // CHECK:STDOUT: %Class => constants.%Class.3 // CHECK:STDOUT: %Class.elem => constants.%Class.elem.3 // CHECK:STDOUT: %struct_type.x => constants.%struct_type.x.3 -// CHECK:STDOUT: %complete_type.loc13_1.2 => constants.%complete_type.4 +// CHECK:STDOUT: %complete_type.loc13_1.2 => constants.%complete_type.5 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(@H.%U.loc23_6.2) { diff --git a/toolchain/check/testdata/class/generic/import.carbon b/toolchain/check/testdata/class/generic/import.carbon index 27d0e3273086b..c174a35d87bd8 100644 --- a/toolchain/check/testdata/class/generic/import.carbon +++ b/toolchain/check/testdata/class/generic/import.carbon @@ -95,20 +95,18 @@ class Class(U:! type) { // CHECK:STDOUT: %CompleteClass.generic: %CompleteClass.type = struct_value () [template] // CHECK:STDOUT: %CompleteClass.1: type = class_type @CompleteClass, @CompleteClass(%T) [symbolic] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %CompleteClass.elem: type = unbound_element_type %CompleteClass.1, %i32 [symbolic] // CHECK:STDOUT: %F.type.1: type = fn_type @F.1, @CompleteClass(%T) [symbolic] // CHECK:STDOUT: %F.1: %F.type.1 = struct_value () [symbolic] // CHECK:STDOUT: %struct_type.n: type = struct_type {.n: %i32} [template] -// CHECK:STDOUT: %complete_type.1: = complete_type_witness %struct_type.n [template] +// CHECK:STDOUT: %complete_type.3: = complete_type_witness %struct_type.n [template] // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] // CHECK:STDOUT: %CompleteClass.2: type = class_type @CompleteClass, @CompleteClass(%i32) [template] @@ -119,7 +117,7 @@ class Class(U:! type) { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -153,9 +151,7 @@ class Class(U:! type) { // CHECK:STDOUT: } { // CHECK:STDOUT: %CompleteClass.ref: %CompleteClass.type = name_ref CompleteClass, file.%CompleteClass.decl [template = constants.%CompleteClass.generic] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_28.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc11_28.2: type = converted %int.make_type_signed, %.loc11_28.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %CompleteClass: type = class_type @CompleteClass, @CompleteClass(constants.%i32) [template = constants.%CompleteClass.2] // CHECK:STDOUT: %return.param: ref %CompleteClass.2 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %CompleteClass.2 = return_slot %return.param @@ -181,26 +177,22 @@ class Class(U:! type) { // CHECK:STDOUT: // CHECK:STDOUT: class { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc7_10.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc7_10.2: type = converted %int.make_type_signed, %.loc7_10.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc7_8: @CompleteClass.%CompleteClass.elem (%CompleteClass.elem) = field_decl n, element0 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc7: @CompleteClass.%CompleteClass.elem (%CompleteClass.elem) = field_decl n, element0 [template] // CHECK:STDOUT: %F.decl: @CompleteClass.%F.type (%F.type.1) = fn_decl @F.1 [symbolic = @CompleteClass.%F (constants.%F.1)] { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc8_13.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc8_13.2: type = converted %int.make_type_signed, %.loc8_13.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.n [template = constants.%complete_type.1] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.n [template = constants.%complete_type.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%CompleteClass.1 -// CHECK:STDOUT: .n = %.loc7_8 +// CHECK:STDOUT: .n = %.loc7 // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } @@ -212,7 +204,7 @@ class Class(U:! type) { // CHECK:STDOUT: fn() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.2] @@ -255,27 +247,25 @@ class Class(U:! type) { // CHECK:STDOUT: --- foo.impl.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %Class.type: type = generic_class_type @Class [template] // CHECK:STDOUT: %Class.generic: %Class.type = struct_value () [template] // CHECK:STDOUT: %Class: type = class_type @Class, @Class(%T) [symbolic] -// CHECK:STDOUT: %require_complete.7: = require_complete_type %T [symbolic] +// CHECK:STDOUT: %require_complete.5: = require_complete_type %T [symbolic] // CHECK:STDOUT: %Class.elem: type = unbound_element_type %Class, %T [symbolic] // CHECK:STDOUT: %struct_type.x: type = struct_type {.x: %T} [symbolic] -// CHECK:STDOUT: %complete_type.1: = complete_type_witness %struct_type.x [symbolic] +// CHECK:STDOUT: %complete_type.3: = complete_type_witness %struct_type.x [symbolic] // CHECK:STDOUT: %CompleteClass.type: type = generic_class_type @CompleteClass [template] // CHECK:STDOUT: %CompleteClass.generic: %CompleteClass.type = struct_value () [template] -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] // CHECK:STDOUT: %struct_type.n.1: type = struct_type {.n: %i32} [template] -// CHECK:STDOUT: %complete_type.2: = complete_type_witness %struct_type.n.1 [template] +// CHECK:STDOUT: %complete_type.4: = complete_type_witness %struct_type.n.1 [template] // CHECK:STDOUT: %CompleteClass.1: type = class_type @CompleteClass, @CompleteClass(%T) [symbolic] // CHECK:STDOUT: %CompleteClass.elem.1: type = unbound_element_type %CompleteClass.1, %i32 [symbolic] // CHECK:STDOUT: %F.type.1: type = fn_type @F.1, @CompleteClass(%T) [symbolic] // CHECK:STDOUT: %F.1: %F.type.1 = struct_value () [symbolic] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] // CHECK:STDOUT: %CompleteClass.2: type = class_type @CompleteClass, @CompleteClass(%i32) [template] // CHECK:STDOUT: %F.type.2: type = fn_type @F.2 [template] // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [template] @@ -284,11 +274,11 @@ class Class(U:! type) { // CHECK:STDOUT: %F.3: %F.type.3 = struct_value () [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %struct_type.n.2: type = struct_type {.n: Core.IntLiteral} [template] -// CHECK:STDOUT: %Convert.type.13: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] // CHECK:STDOUT: %CompleteClass.val: %CompleteClass.2 = struct_value (%int_1.2) [template] @@ -297,15 +287,15 @@ class Class(U:! type) { // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.2: %CompleteClass.type = import_ref Main//foo, CompleteClass, loaded [template = constants.%CompleteClass.generic] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref.42 -// CHECK:STDOUT: .ImplicitAs = %import_ref.43 +// CHECK:STDOUT: .Int = %import_ref.197 +// CHECK:STDOUT: .ImplicitAs = %import_ref.198 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.38: = import_ref Main//foo, loc9_1, loaded [template = constants.%complete_type.2] -// CHECK:STDOUT: %import_ref.39 = import_ref Main//foo, inst37 [no loc], unloaded -// CHECK:STDOUT: %import_ref.40 = import_ref Main//foo, loc7_8, unloaded -// CHECK:STDOUT: %import_ref.41 = import_ref Main//foo, loc8_17, unloaded +// CHECK:STDOUT: %import_ref.193: = import_ref Main//foo, loc9_1, loaded [template = constants.%complete_type.4] +// CHECK:STDOUT: %import_ref.194 = import_ref Main//foo, inst37 [no loc], unloaded +// CHECK:STDOUT: %import_ref.195 = import_ref Main//foo, loc7_8, unloaded +// CHECK:STDOUT: %import_ref.196 = import_ref Main//foo, loc8_17, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -331,9 +321,7 @@ class Class(U:! type) { // CHECK:STDOUT: } { // CHECK:STDOUT: %CompleteClass.ref: %CompleteClass.type = name_ref CompleteClass, imports.%import_ref.2 [template = constants.%CompleteClass.generic] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc8_28.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc8_28.2: type = converted %int.make_type_signed, %.loc8_28.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %CompleteClass: type = class_type @CompleteClass, @CompleteClass(constants.%i32) [template = constants.%CompleteClass.2] // CHECK:STDOUT: %return.param: ref %CompleteClass.2 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %CompleteClass.2 = return_slot %return.param @@ -345,16 +333,16 @@ class Class(U:! type) { // CHECK:STDOUT: %T.patt.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.1 (constants.%T.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete: = require_complete_type @Class.%T.1 (%T) [symbolic = %require_complete (constants.%require_complete.7)] +// CHECK:STDOUT: %require_complete: = require_complete_type @Class.%T.1 (%T) [symbolic = %require_complete (constants.%require_complete.5)] // CHECK:STDOUT: %Class: type = class_type @Class, @Class(%T.1) [symbolic = %Class (constants.%Class)] // CHECK:STDOUT: %Class.elem: type = unbound_element_type @Class.%Class (%Class), @Class.%T.1 (%T) [symbolic = %Class.elem (constants.%Class.elem)] // CHECK:STDOUT: %struct_type.x: type = struct_type {.x: @Class.%T.1 (%T)} [symbolic = %struct_type.x (constants.%struct_type.x)] -// CHECK:STDOUT: %complete_type.loc6_1.2: = complete_type_witness @Class.%struct_type.x (%struct_type.x) [symbolic = %complete_type.loc6_1.2 (constants.%complete_type.1)] +// CHECK:STDOUT: %complete_type.loc6_1.2: = complete_type_witness @Class.%struct_type.x (%struct_type.x) [symbolic = %complete_type.loc6_1.2 (constants.%complete_type.3)] // CHECK:STDOUT: // CHECK:STDOUT: class { // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc4 [symbolic = %T.1 (constants.%T)] // CHECK:STDOUT: %.loc5: @Class.%Class.elem (%Class.elem) = field_decl x, element0 [template] -// CHECK:STDOUT: %complete_type.loc6_1.1: = complete_type_witness %struct_type.x [symbolic = %complete_type.loc6_1.2 (constants.%complete_type.1)] +// CHECK:STDOUT: %complete_type.loc6_1.1: = complete_type_witness %struct_type.x [symbolic = %complete_type.loc6_1.2 (constants.%complete_type.3)] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class @@ -375,10 +363,10 @@ class Class(U:! type) { // CHECK:STDOUT: // CHECK:STDOUT: class { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.39 -// CHECK:STDOUT: .n = imports.%import_ref.40 -// CHECK:STDOUT: .F = imports.%import_ref.41 -// CHECK:STDOUT: complete_type_witness = imports.%import_ref.38 +// CHECK:STDOUT: .Self = imports.%import_ref.194 +// CHECK:STDOUT: .n = imports.%import_ref.195 +// CHECK:STDOUT: .F = imports.%import_ref.196 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.193 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -392,7 +380,7 @@ class Class(U:! type) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %.loc9_17.1: %struct_type.n.2 = struct_literal (%int_1) -// CHECK:STDOUT: %impl.elem0: %Convert.type.13 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0: %Convert.type.9 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_1) [template = constants.%int_1.2] @@ -447,15 +435,13 @@ class Class(U:! type) { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %UseMethod.type: type = fn_type @UseMethod [template] // CHECK:STDOUT: %UseMethod: %UseMethod.type = struct_value () [template] // CHECK:STDOUT: %CompleteClass.type: type = generic_class_type @CompleteClass [template] // CHECK:STDOUT: %CompleteClass.generic: %CompleteClass.type = struct_value () [template] // CHECK:STDOUT: %struct_type.n: type = struct_type {.n: %i32} [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.n [template] +// CHECK:STDOUT: %complete_type.3: = complete_type_witness %struct_type.n [template] // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] // CHECK:STDOUT: %CompleteClass.1: type = class_type @CompleteClass, @CompleteClass(%T) [symbolic] // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] @@ -482,10 +468,10 @@ class Class(U:! type) { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.5: = import_ref Main//foo, loc9_1, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.6 = import_ref Main//foo, inst37 [no loc], unloaded -// CHECK:STDOUT: %import_ref.7: @CompleteClass.%CompleteClass.elem (%CompleteClass.elem.1) = import_ref Main//foo, loc7_8, loaded [template = %.1] -// CHECK:STDOUT: %import_ref.8: @CompleteClass.%F.type (%F.type.1) = import_ref Main//foo, loc8_17, loaded [symbolic = @CompleteClass.%F (constants.%F.1)] +// CHECK:STDOUT: %import_ref.8: = import_ref Main//foo, loc9_1, loaded [template = constants.%complete_type.3] +// CHECK:STDOUT: %import_ref.9 = import_ref Main//foo, inst37 [no loc], unloaded +// CHECK:STDOUT: %import_ref.10: @CompleteClass.%CompleteClass.elem (%CompleteClass.elem.1) = import_ref Main//foo, loc7_8, loaded [template = %.1] +// CHECK:STDOUT: %import_ref.11: @CompleteClass.%F.type (%F.type.1) = import_ref Main//foo, loc8_17, loaded [symbolic = @CompleteClass.%F (constants.%F.1)] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -504,9 +490,7 @@ class Class(U:! type) { // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc5: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc5: init type = call constants.%Int(%int_32.loc5) [template = constants.%i32] -// CHECK:STDOUT: %.loc5_19.1: type = value_of_initializer %int.make_type_signed.loc5 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_19.2: type = converted %int.make_type_signed.loc5, %.loc5_19.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc5: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } @@ -515,9 +499,7 @@ class Class(U:! type) { // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc10: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc10: init type = call constants.%Int(%int_32.loc10) [template = constants.%i32] -// CHECK:STDOUT: %.loc10_18.1: type = value_of_initializer %int.make_type_signed.loc10 [template = constants.%i32] -// CHECK:STDOUT: %.loc10_18.2: type = converted %int.make_type_signed.loc10, %.loc10_18.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc10: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } @@ -535,10 +517,10 @@ class Class(U:! type) { // CHECK:STDOUT: // CHECK:STDOUT: class { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.6 -// CHECK:STDOUT: .n = imports.%import_ref.7 -// CHECK:STDOUT: .F = imports.%import_ref.8 -// CHECK:STDOUT: complete_type_witness = imports.%import_ref.5 +// CHECK:STDOUT: .Self = imports.%import_ref.9 +// CHECK:STDOUT: .n = imports.%import_ref.10 +// CHECK:STDOUT: .F = imports.%import_ref.11 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.8 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -546,18 +528,16 @@ class Class(U:! type) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %CompleteClass.ref: %CompleteClass.type = name_ref CompleteClass, imports.%import_ref.2 [template = constants.%CompleteClass.generic] // CHECK:STDOUT: %int_32.loc6: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc6: init type = call constants.%Int(%int_32.loc6) [template = constants.%i32] -// CHECK:STDOUT: %.loc6_27.1: type = value_of_initializer %int.make_type_signed.loc6 [template = constants.%i32] -// CHECK:STDOUT: %.loc6_27.2: type = converted %int.make_type_signed.loc6, %.loc6_27.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc6: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %CompleteClass: type = class_type @CompleteClass, @CompleteClass(constants.%i32) [template = constants.%CompleteClass.2] // CHECK:STDOUT: %v.var: ref %CompleteClass.2 = var v // CHECK:STDOUT: %v: ref %CompleteClass.2 = bind_name v, %v.var // CHECK:STDOUT: %F.ref.loc6: %F.type.3 = name_ref F, imports.%import_ref.3 [template = constants.%F.3] -// CHECK:STDOUT: %.loc6_7: ref %CompleteClass.2 = splice_block %v.var {} -// CHECK:STDOUT: %F.call.loc6: init %CompleteClass.2 = call %F.ref.loc6() to %.loc6_7 +// CHECK:STDOUT: %.loc6: ref %CompleteClass.2 = splice_block %v.var {} +// CHECK:STDOUT: %F.call.loc6: init %CompleteClass.2 = call %F.ref.loc6() to %.loc6 // CHECK:STDOUT: assign %v.var, %F.call.loc6 // CHECK:STDOUT: %v.ref: ref %CompleteClass.2 = name_ref v, %v -// CHECK:STDOUT: %.loc7_11: %F.type.2 = specific_constant imports.%import_ref.8, @CompleteClass(constants.%i32) [template = constants.%F.2] +// CHECK:STDOUT: %.loc7_11: %F.type.2 = specific_constant imports.%import_ref.11, @CompleteClass(constants.%i32) [template = constants.%F.2] // CHECK:STDOUT: %F.ref.loc7: %F.type.2 = name_ref F, %.loc7_11 [template = constants.%F.2] // CHECK:STDOUT: %F.specific_fn: = specific_function %F.ref.loc7, @F.1(constants.%i32) [template = constants.%F.specific_fn] // CHECK:STDOUT: %F.call.loc7: init %i32 = call %F.specific_fn() @@ -578,18 +558,16 @@ class Class(U:! type) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %CompleteClass.ref: %CompleteClass.type = name_ref CompleteClass, imports.%import_ref.2 [template = constants.%CompleteClass.generic] // CHECK:STDOUT: %int_32.loc11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11: init type = call constants.%Int(%int_32.loc11) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_27.1: type = value_of_initializer %int.make_type_signed.loc11 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_27.2: type = converted %int.make_type_signed.loc11, %.loc11_27.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %CompleteClass: type = class_type @CompleteClass, @CompleteClass(constants.%i32) [template = constants.%CompleteClass.2] // CHECK:STDOUT: %v.var: ref %CompleteClass.2 = var v // CHECK:STDOUT: %v: ref %CompleteClass.2 = bind_name v, %v.var // CHECK:STDOUT: %F.ref: %F.type.3 = name_ref F, imports.%import_ref.3 [template = constants.%F.3] -// CHECK:STDOUT: %.loc11_7: ref %CompleteClass.2 = splice_block %v.var {} -// CHECK:STDOUT: %F.call: init %CompleteClass.2 = call %F.ref() to %.loc11_7 +// CHECK:STDOUT: %.loc11: ref %CompleteClass.2 = splice_block %v.var {} +// CHECK:STDOUT: %F.call: init %CompleteClass.2 = call %F.ref() to %.loc11 // CHECK:STDOUT: assign %v.var, %F.call // CHECK:STDOUT: %v.ref: ref %CompleteClass.2 = name_ref v, %v -// CHECK:STDOUT: %n.ref: %CompleteClass.elem.2 = name_ref n, imports.%import_ref.7 [template = imports.%.1] +// CHECK:STDOUT: %n.ref: %CompleteClass.elem.2 = name_ref n, imports.%import_ref.10 [template = imports.%.1] // CHECK:STDOUT: %.loc12_11.1: ref %i32 = class_element_access %v.ref, element0 // CHECK:STDOUT: %.loc12_11.2: %i32 = bind_value %.loc12_11.1 // CHECK:STDOUT: return %.loc12_11.2 @@ -636,17 +614,15 @@ class Class(U:! type) { // CHECK:STDOUT: %CompleteClass.type: type = generic_class_type @CompleteClass [template] // CHECK:STDOUT: %CompleteClass.generic: %CompleteClass.type = struct_value () [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %struct_type.n: type = struct_type {.n: %i32} [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.n [template] +// CHECK:STDOUT: %complete_type.2: = complete_type_witness %struct_type.n [template] // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] // CHECK:STDOUT: %CompleteClass.1: type = class_type @CompleteClass, @CompleteClass(%T) [symbolic] // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %CompleteClass.elem.1: type = unbound_element_type %CompleteClass.1, %i32 [symbolic] // CHECK:STDOUT: %F.type.1: type = fn_type @F.1, @CompleteClass(%T) [symbolic] // CHECK:STDOUT: %F.1: %F.type.1 = struct_value () [symbolic] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] // CHECK:STDOUT: %ptr.1: type = ptr_type %i32 [template] // CHECK:STDOUT: %CompleteClass.2: type = class_type @CompleteClass, @CompleteClass(%ptr.1) [template] // CHECK:STDOUT: %CompleteClass.elem.2: type = unbound_element_type %CompleteClass.2, %i32 [template] @@ -665,15 +641,15 @@ class Class(U:! type) { // CHECK:STDOUT: %import_ref.2: %CompleteClass.type = import_ref Main//foo, CompleteClass, loaded [template = constants.%CompleteClass.generic] // CHECK:STDOUT: %import_ref.3: %F.type.3 = import_ref Main//foo, F, loaded [template = constants.%F.3] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref.8 -// CHECK:STDOUT: .ImplicitAs = %import_ref.9 +// CHECK:STDOUT: .Int = %import_ref.11 +// CHECK:STDOUT: .ImplicitAs = %import_ref.12 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.4: = import_ref Main//foo, loc9_1, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.5 = import_ref Main//foo, inst37 [no loc], unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Main//foo, loc7_8, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref Main//foo, loc8_17, unloaded +// CHECK:STDOUT: %import_ref.7: = import_ref Main//foo, loc9_1, loaded [template = constants.%complete_type.2] +// CHECK:STDOUT: %import_ref.8 = import_ref Main//foo, inst37 [no loc], unloaded +// CHECK:STDOUT: %import_ref.9 = import_ref Main//foo, loc7_8, unloaded +// CHECK:STDOUT: %import_ref.10 = import_ref Main//foo, loc8_17, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -701,10 +677,10 @@ class Class(U:! type) { // CHECK:STDOUT: // CHECK:STDOUT: class { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.5 -// CHECK:STDOUT: .n = imports.%import_ref.6 -// CHECK:STDOUT: .F = imports.%import_ref.7 -// CHECK:STDOUT: complete_type_witness = imports.%import_ref.4 +// CHECK:STDOUT: .Self = imports.%import_ref.8 +// CHECK:STDOUT: .n = imports.%import_ref.9 +// CHECK:STDOUT: .F = imports.%import_ref.10 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.7 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -712,9 +688,7 @@ class Class(U:! type) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %CompleteClass.ref: %CompleteClass.type = name_ref CompleteClass, imports.%import_ref.2 [template = constants.%CompleteClass.generic] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc14_27.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc14_27.2: type = converted %int.make_type_signed, %.loc14_27.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %ptr: type = ptr_type %i32 [template = constants.%ptr.1] // CHECK:STDOUT: %CompleteClass: type = class_type @CompleteClass, @CompleteClass(constants.%ptr.1) [template = constants.%CompleteClass.2] // CHECK:STDOUT: %v.var: ref %CompleteClass.2 = var v diff --git a/toolchain/check/testdata/class/generic/init.carbon b/toolchain/check/testdata/class/generic/init.carbon index bdfea5f7833f2..4867fa4d679ff 100644 --- a/toolchain/check/testdata/class/generic/init.carbon +++ b/toolchain/check/testdata/class/generic/init.carbon @@ -58,21 +58,20 @@ fn InitFromAdaptedSpecific(x: i32) -> i32 { // CHECK:STDOUT: %InitFromStructGeneric: %InitFromStructGeneric.type = struct_value () [template] // CHECK:STDOUT: %require_complete.2: = require_complete_type %Class.1 [symbolic] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %InitFromStructSpecific.type: type = fn_type @InitFromStructSpecific [template] // CHECK:STDOUT: %InitFromStructSpecific: %InitFromStructSpecific.type = struct_value () [template] +// CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %complete_type.3: = complete_type_witness %i32.builtin [template] // CHECK:STDOUT: %Class.2: type = class_type @Class, @Class(%i32) [template] -// CHECK:STDOUT: %complete_type.2: = complete_type_witness %i32 [template] // CHECK:STDOUT: %Class.elem.2: type = unbound_element_type %Class.2, %i32 [template] // CHECK:STDOUT: %struct_type.k.2: type = struct_type {.k: %i32} [template] -// CHECK:STDOUT: %complete_type.3: = complete_type_witness %struct_type.k.2 [template] +// CHECK:STDOUT: %complete_type.4: = complete_type_witness %struct_type.k.2 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -117,13 +116,9 @@ fn InitFromAdaptedSpecific(x: i32) -> i32 { // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc13_30: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc13_30: init type = call constants.%Int(%int_32.loc13_30) [template = constants.%i32] -// CHECK:STDOUT: %.loc13_30.1: type = value_of_initializer %int.make_type_signed.loc13_30 [template = constants.%i32] -// CHECK:STDOUT: %.loc13_30.2: type = converted %int.make_type_signed.loc13_30, %.loc13_30.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc13_30: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc13_38: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc13_38: init type = call constants.%Int(%int_32.loc13_38) [template = constants.%i32] -// CHECK:STDOUT: %.loc13_38.1: type = value_of_initializer %int.make_type_signed.loc13_38 [template = constants.%i32] -// CHECK:STDOUT: %.loc13_38.2: type = converted %int.make_type_signed.loc13_38, %.loc13_38.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc13_38: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %x.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %x: %i32 = bind_name x, %x.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 @@ -191,9 +186,7 @@ fn InitFromAdaptedSpecific(x: i32) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Class.ref: %Class.type = name_ref Class, file.%Class.decl [template = constants.%Class.generic] // CHECK:STDOUT: %int_32.loc14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc14: init type = call constants.%Int(%int_32.loc14) [template = constants.%i32] -// CHECK:STDOUT: %.loc14_19.1: type = value_of_initializer %int.make_type_signed.loc14 [template = constants.%i32] -// CHECK:STDOUT: %.loc14_19.2: type = converted %int.make_type_signed.loc14, %.loc14_19.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %Class: type = class_type @Class, @Class(constants.%i32) [template = constants.%Class.2] // CHECK:STDOUT: %v.var: ref %Class.2 = var v // CHECK:STDOUT: %v: ref %Class.2 = bind_name v, %v.var @@ -243,11 +236,11 @@ fn InitFromAdaptedSpecific(x: i32) -> i32 { // CHECK:STDOUT: %T.patt.loc4_13.2 => constants.%i32 // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete => constants.%complete_type.2 +// CHECK:STDOUT: %require_complete => constants.%complete_type.3 // CHECK:STDOUT: %Class => constants.%Class.2 // CHECK:STDOUT: %Class.elem => constants.%Class.elem.2 // CHECK:STDOUT: %struct_type.k => constants.%struct_type.k.2 -// CHECK:STDOUT: %complete_type.loc6_1.2 => constants.%complete_type.3 +// CHECK:STDOUT: %complete_type.loc6_1.2 => constants.%complete_type.4 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- adapt.carbon @@ -264,18 +257,18 @@ fn InitFromAdaptedSpecific(x: i32) -> i32 { // CHECK:STDOUT: %InitFromAdaptedGeneric: %InitFromAdaptedGeneric.type = struct_value () [template] // CHECK:STDOUT: %require_complete.2: = require_complete_type %Adapt.1 [symbolic] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %InitFromAdaptedSpecific.type: type = fn_type @InitFromAdaptedSpecific [template] // CHECK:STDOUT: %InitFromAdaptedSpecific: %InitFromAdaptedSpecific.type = struct_value () [template] +// CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %complete_type.3: = complete_type_witness %i32.builtin [template] // CHECK:STDOUT: %Adapt.2: type = class_type @Adapt, @Adapt(%i32) [template] -// CHECK:STDOUT: %complete_type.2: = complete_type_witness %i32 [template] +// CHECK:STDOUT: %complete_type.4: = complete_type_witness %i32 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -320,13 +313,9 @@ fn InitFromAdaptedSpecific(x: i32) -> i32 { // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc12_31: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc12_31: init type = call constants.%Int(%int_32.loc12_31) [template = constants.%i32] -// CHECK:STDOUT: %.loc12_31.1: type = value_of_initializer %int.make_type_signed.loc12_31 [template = constants.%i32] -// CHECK:STDOUT: %.loc12_31.2: type = converted %int.make_type_signed.loc12_31, %.loc12_31.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc12_31: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc12_39: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc12_39: init type = call constants.%Int(%int_32.loc12_39) [template = constants.%i32] -// CHECK:STDOUT: %.loc12_39.1: type = value_of_initializer %int.make_type_signed.loc12_39 [template = constants.%i32] -// CHECK:STDOUT: %.loc12_39.2: type = converted %int.make_type_signed.loc12_39, %.loc12_39.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc12_39: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %x.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %x: %i32 = bind_name x, %x.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 @@ -382,16 +371,12 @@ fn InitFromAdaptedSpecific(x: i32) -> i32 { // CHECK:STDOUT: %x.ref: %i32 = name_ref x, %x // CHECK:STDOUT: %Adapt.ref: %Adapt.type = name_ref Adapt, file.%Adapt.decl [template = constants.%Adapt.generic] // CHECK:STDOUT: %int_32.loc13_22: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc13_22: init type = call constants.%Int(%int_32.loc13_22) [template = constants.%i32] -// CHECK:STDOUT: %.loc13_25.1: type = value_of_initializer %int.make_type_signed.loc13_22 [template = constants.%i32] -// CHECK:STDOUT: %.loc13_25.2: type = converted %int.make_type_signed.loc13_22, %.loc13_25.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc13_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %Adapt: type = class_type @Adapt, @Adapt(constants.%i32) [template = constants.%Adapt.2] // CHECK:STDOUT: %.loc13_13.1: %Adapt.2 = as_compatible %x.ref // CHECK:STDOUT: %.loc13_13.2: %Adapt.2 = converted %x.ref, %.loc13_13.1 // CHECK:STDOUT: %int_32.loc13_31: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc13_31: init type = call constants.%Int(%int_32.loc13_31) [template = constants.%i32] -// CHECK:STDOUT: %.loc13_31.1: type = value_of_initializer %int.make_type_signed.loc13_31 [template = constants.%i32] -// CHECK:STDOUT: %.loc13_31.2: type = converted %int.make_type_signed.loc13_31, %.loc13_31.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc13_31: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc13_28.1: %i32 = as_compatible %.loc13_13.2 // CHECK:STDOUT: %.loc13_28.2: %i32 = converted %.loc13_13.2, %.loc13_28.1 // CHECK:STDOUT: return %.loc13_28.2 @@ -421,7 +406,7 @@ fn InitFromAdaptedSpecific(x: i32) -> i32 { // CHECK:STDOUT: %T.patt.loc4_13.2 => constants.%i32 // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete => constants.%complete_type.2 -// CHECK:STDOUT: %complete_type.loc6_1.2 => constants.%complete_type.2 +// CHECK:STDOUT: %require_complete => constants.%complete_type.3 +// CHECK:STDOUT: %complete_type.loc6_1.2 => constants.%complete_type.4 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/generic/member_access.carbon b/toolchain/check/testdata/class/generic/member_access.carbon index 34d75357ab9a8..de070de3df3bc 100644 --- a/toolchain/check/testdata/class/generic/member_access.carbon +++ b/toolchain/check/testdata/class/generic/member_access.carbon @@ -70,33 +70,32 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: %require_complete.3: = require_complete_type %ptr.2 [symbolic] // CHECK:STDOUT: %require_complete.4: = require_complete_type %ptr.1 [symbolic] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %Class.2: type = class_type @Class, @Class(%i32) [template] // CHECK:STDOUT: %DirectFieldAccess.type: type = fn_type @DirectFieldAccess [template] // CHECK:STDOUT: %DirectFieldAccess: %DirectFieldAccess.type = struct_value () [template] -// CHECK:STDOUT: %complete_type.2: = complete_type_witness %i32 [template] +// CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %complete_type.3: = complete_type_witness %i32.builtin [template] // CHECK:STDOUT: %Class.elem.2: type = unbound_element_type %Class.2, %i32 [template] // CHECK:STDOUT: %Get.type.2: type = fn_type @Get, @Class(%i32) [template] // CHECK:STDOUT: %Get.2: %Get.type.2 = struct_value () [template] // CHECK:STDOUT: %GetAddr.type.2: type = fn_type @GetAddr, @Class(%i32) [template] // CHECK:STDOUT: %GetAddr.2: %GetAddr.type.2 = struct_value () [template] // CHECK:STDOUT: %struct_type.x.2: type = struct_type {.x: %i32} [template] -// CHECK:STDOUT: %complete_type.3: = complete_type_witness %struct_type.x.2 [template] +// CHECK:STDOUT: %complete_type.4: = complete_type_witness %struct_type.x.2 [template] // CHECK:STDOUT: %MethodCall.type: type = fn_type @MethodCall [template] // CHECK:STDOUT: %MethodCall: %MethodCall.type = struct_value () [template] // CHECK:STDOUT: %ptr.5: type = ptr_type %Class.2 [template] // CHECK:STDOUT: %AddrMethodCall.type: type = fn_type @AddrMethodCall [template] // CHECK:STDOUT: %AddrMethodCall: %AddrMethodCall.type = struct_value () [template] // CHECK:STDOUT: %ptr.6: type = ptr_type %i32 [template] -// CHECK:STDOUT: %complete_type.4: = complete_type_witness %ptr.6 [template] -// CHECK:STDOUT: %complete_type.5: = complete_type_witness %ptr.5 [template] +// CHECK:STDOUT: %complete_type.5: = complete_type_witness %ptr.6 [template] +// CHECK:STDOUT: %complete_type.6: = complete_type_witness %ptr.5 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -126,14 +125,10 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: } { // CHECK:STDOUT: %Class.ref: %Class.type = name_ref Class, file.%Class.decl [template = constants.%Class.generic] // CHECK:STDOUT: %int_32.loc10_31: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc10_31: init type = call constants.%Int(%int_32.loc10_31) [template = constants.%i32] -// CHECK:STDOUT: %.loc10_34.1: type = value_of_initializer %int.make_type_signed.loc10_31 [template = constants.%i32] -// CHECK:STDOUT: %.loc10_34.2: type = converted %int.make_type_signed.loc10_31, %.loc10_34.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc10_31: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %Class: type = class_type @Class, @Class(constants.%i32) [template = constants.%Class.2] // CHECK:STDOUT: %int_32.loc10_40: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc10_40: init type = call constants.%Int(%int_32.loc10_40) [template = constants.%i32] -// CHECK:STDOUT: %.loc10_40.1: type = value_of_initializer %int.make_type_signed.loc10_40 [template = constants.%i32] -// CHECK:STDOUT: %.loc10_40.2: type = converted %int.make_type_signed.loc10_40, %.loc10_40.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc10_40: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %x.param: %Class.2 = value_param runtime_param0 // CHECK:STDOUT: %x: %Class.2 = bind_name x, %x.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 @@ -147,14 +142,10 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: } { // CHECK:STDOUT: %Class.ref: %Class.type = name_ref Class, file.%Class.decl [template = constants.%Class.generic] // CHECK:STDOUT: %int_32.loc14_24: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc14_24: init type = call constants.%Int(%int_32.loc14_24) [template = constants.%i32] -// CHECK:STDOUT: %.loc14_27.1: type = value_of_initializer %int.make_type_signed.loc14_24 [template = constants.%i32] -// CHECK:STDOUT: %.loc14_27.2: type = converted %int.make_type_signed.loc14_24, %.loc14_27.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc14_24: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %Class: type = class_type @Class, @Class(constants.%i32) [template = constants.%Class.2] // CHECK:STDOUT: %int_32.loc14_33: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc14_33: init type = call constants.%Int(%int_32.loc14_33) [template = constants.%i32] -// CHECK:STDOUT: %.loc14_33.1: type = value_of_initializer %int.make_type_signed.loc14_33 [template = constants.%i32] -// CHECK:STDOUT: %.loc14_33.2: type = converted %int.make_type_signed.loc14_33, %.loc14_33.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc14_33: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %x.param: %Class.2 = value_param runtime_param0 // CHECK:STDOUT: %x: %Class.2 = bind_name x, %x.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 @@ -168,15 +159,11 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: } { // CHECK:STDOUT: %Class.ref: %Class.type = name_ref Class, file.%Class.decl [template = constants.%Class.generic] // CHECK:STDOUT: %int_32.loc18_28: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc18_28: init type = call constants.%Int(%int_32.loc18_28) [template = constants.%i32] -// CHECK:STDOUT: %.loc18_31.1: type = value_of_initializer %int.make_type_signed.loc18_28 [template = constants.%i32] -// CHECK:STDOUT: %.loc18_31.2: type = converted %int.make_type_signed.loc18_28, %.loc18_31.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc18_28: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %Class: type = class_type @Class, @Class(constants.%i32) [template = constants.%Class.2] // CHECK:STDOUT: %ptr: type = ptr_type %Class.2 [template = constants.%ptr.5] // CHECK:STDOUT: %int_32.loc18_38: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc18_38: init type = call constants.%Int(%int_32.loc18_38) [template = constants.%i32] -// CHECK:STDOUT: %.loc18_38.1: type = value_of_initializer %int.make_type_signed.loc18_38 [template = constants.%i32] -// CHECK:STDOUT: %.loc18_38.2: type = converted %int.make_type_signed.loc18_38, %.loc18_38.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc18_38: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %p.param: %ptr.5 = value_param runtime_param0 // CHECK:STDOUT: %p: %ptr.5 = bind_name p, %p.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 @@ -373,7 +360,7 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: %T.patt.loc2_13.2 => constants.%i32 // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete => constants.%complete_type.2 +// CHECK:STDOUT: %require_complete => constants.%complete_type.3 // CHECK:STDOUT: %Class => constants.%Class.2 // CHECK:STDOUT: %Class.elem => constants.%Class.elem.2 // CHECK:STDOUT: %Get.type => constants.%Get.type.2 @@ -381,7 +368,7 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: %GetAddr.type => constants.%GetAddr.type.2 // CHECK:STDOUT: %GetAddr => constants.%GetAddr.2 // CHECK:STDOUT: %struct_type.x => constants.%struct_type.x.2 -// CHECK:STDOUT: %complete_type.loc8_1.2 => constants.%complete_type.3 +// CHECK:STDOUT: %complete_type.loc8_1.2 => constants.%complete_type.4 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Get(constants.%i32) { @@ -389,9 +376,9 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: %Class => constants.%Class.2 // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete.loc5_14 => constants.%complete_type.3 +// CHECK:STDOUT: %require_complete.loc5_14 => constants.%complete_type.4 // CHECK:STDOUT: %Class.elem => constants.%Class.elem.2 -// CHECK:STDOUT: %require_complete.loc5_42 => constants.%complete_type.2 +// CHECK:STDOUT: %require_complete.loc5_42 => constants.%complete_type.3 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @GetAddr(constants.%i32) { @@ -401,9 +388,9 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: %ptr.loc7_38.1 => constants.%ptr.6 // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete.loc7_34 => constants.%complete_type.4 -// CHECK:STDOUT: %require_complete.loc7_23 => constants.%complete_type.5 -// CHECK:STDOUT: %require_complete.loc7_54 => constants.%complete_type.3 +// CHECK:STDOUT: %require_complete.loc7_34 => constants.%complete_type.5 +// CHECK:STDOUT: %require_complete.loc7_23 => constants.%complete_type.6 +// CHECK:STDOUT: %require_complete.loc7_54 => constants.%complete_type.4 // CHECK:STDOUT: %Class.elem => constants.%Class.elem.2 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/generic/member_lookup.carbon b/toolchain/check/testdata/class/generic/member_lookup.carbon index aef2efd7d1403..1b5eb73d30272 100644 --- a/toolchain/check/testdata/class/generic/member_lookup.carbon +++ b/toolchain/check/testdata/class/generic/member_lookup.carbon @@ -95,26 +95,25 @@ fn AccessMissingConcrete(x: Derived(i32)) -> i32 { // CHECK:STDOUT: %AccessBase.type: type = fn_type @AccessBase [template] // CHECK:STDOUT: %AccessBase: %AccessBase.type = struct_value () [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %Derived.2: type = class_type @Derived, @Derived(%i32) [template] // CHECK:STDOUT: %AccessConcrete.type: type = fn_type @AccessConcrete [template] // CHECK:STDOUT: %AccessConcrete: %AccessConcrete.type = struct_value () [template] +// CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %complete_type.4: = complete_type_witness %i32.builtin [template] // CHECK:STDOUT: %Base.2: type = class_type @Base, @Base(%i32) [template] -// CHECK:STDOUT: %complete_type.3: = complete_type_witness %i32 [template] // CHECK:STDOUT: %Base.elem.2: type = unbound_element_type %Base.2, %i32 [template] // CHECK:STDOUT: %struct_type.b.2: type = struct_type {.b: %i32} [template] -// CHECK:STDOUT: %complete_type.4: = complete_type_witness %struct_type.b.2 [template] +// CHECK:STDOUT: %complete_type.5: = complete_type_witness %struct_type.b.2 [template] // CHECK:STDOUT: %Derived.elem.3: type = unbound_element_type %Derived.2, %Base.2 [template] // CHECK:STDOUT: %Derived.elem.4: type = unbound_element_type %Derived.2, %i32 [template] // CHECK:STDOUT: %struct_type.base.d.3: type = struct_type {.base: %Base.2, .d: %i32} [template] -// CHECK:STDOUT: %complete_type.5: = complete_type_witness %struct_type.base.d.3 [template] +// CHECK:STDOUT: %complete_type.6: = complete_type_witness %struct_type.base.d.3 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -190,14 +189,10 @@ fn AccessMissingConcrete(x: Derived(i32)) -> i32 { // CHECK:STDOUT: } { // CHECK:STDOUT: %Derived.ref: %Derived.type = name_ref Derived, file.%Derived.decl [template = constants.%Derived.generic] // CHECK:STDOUT: %int_32.loc21_30: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc21_30: init type = call constants.%Int(%int_32.loc21_30) [template = constants.%i32] -// CHECK:STDOUT: %.loc21_33.1: type = value_of_initializer %int.make_type_signed.loc21_30 [template = constants.%i32] -// CHECK:STDOUT: %.loc21_33.2: type = converted %int.make_type_signed.loc21_30, %.loc21_33.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc21_30: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %Derived: type = class_type @Derived, @Derived(constants.%i32) [template = constants.%Derived.2] // CHECK:STDOUT: %int_32.loc21_39: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc21_39: init type = call constants.%Int(%int_32.loc21_39) [template = constants.%i32] -// CHECK:STDOUT: %.loc21_39.1: type = value_of_initializer %int.make_type_signed.loc21_39 [template = constants.%i32] -// CHECK:STDOUT: %.loc21_39.2: type = converted %int.make_type_signed.loc21_39, %.loc21_39.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc21_39: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %x.param: %Derived.2 = value_param runtime_param0 // CHECK:STDOUT: %x: %Derived.2 = bind_name x, %x.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 @@ -390,13 +385,13 @@ fn AccessMissingConcrete(x: Derived(i32)) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Base.loc9_22.2 => constants.%Base.2 -// CHECK:STDOUT: %require_complete.loc9 => constants.%complete_type.4 +// CHECK:STDOUT: %require_complete.loc9 => constants.%complete_type.5 // CHECK:STDOUT: %Derived => constants.%Derived.2 // CHECK:STDOUT: %Derived.elem.loc9 => constants.%Derived.elem.3 -// CHECK:STDOUT: %require_complete.loc10 => constants.%complete_type.3 +// CHECK:STDOUT: %require_complete.loc10 => constants.%complete_type.4 // CHECK:STDOUT: %Derived.elem.loc10 => constants.%Derived.elem.4 // CHECK:STDOUT: %struct_type.base.d => constants.%struct_type.base.d.3 -// CHECK:STDOUT: %complete_type.loc11_1.2 => constants.%complete_type.5 +// CHECK:STDOUT: %complete_type.loc11_1.2 => constants.%complete_type.6 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Base(constants.%i32) { @@ -404,11 +399,11 @@ fn AccessMissingConcrete(x: Derived(i32)) -> i32 { // CHECK:STDOUT: %T.patt.loc4_17.2 => constants.%i32 // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete => constants.%complete_type.3 +// CHECK:STDOUT: %require_complete => constants.%complete_type.4 // CHECK:STDOUT: %Base => constants.%Base.2 // CHECK:STDOUT: %Base.elem => constants.%Base.elem.2 // CHECK:STDOUT: %struct_type.b => constants.%struct_type.b.2 -// CHECK:STDOUT: %complete_type.loc6_1.2 => constants.%complete_type.4 +// CHECK:STDOUT: %complete_type.loc6_1.2 => constants.%complete_type.5 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_no_member.carbon @@ -437,26 +432,25 @@ fn AccessMissingConcrete(x: Derived(i32)) -> i32 { // CHECK:STDOUT: %AccessMissingDerived: %AccessMissingDerived.type = struct_value () [template] // CHECK:STDOUT: %require_complete.3: = require_complete_type %Derived.1 [symbolic] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %Derived.2: type = class_type @Derived, @Derived(%i32) [template] // CHECK:STDOUT: %AccessMissingConcrete.type: type = fn_type @AccessMissingConcrete [template] // CHECK:STDOUT: %AccessMissingConcrete: %AccessMissingConcrete.type = struct_value () [template] +// CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %complete_type.4: = complete_type_witness %i32.builtin [template] // CHECK:STDOUT: %Base.2: type = class_type @Base, @Base(%i32) [template] -// CHECK:STDOUT: %complete_type.3: = complete_type_witness %i32 [template] // CHECK:STDOUT: %Base.elem.2: type = unbound_element_type %Base.2, %i32 [template] // CHECK:STDOUT: %struct_type.b.2: type = struct_type {.b: %i32} [template] -// CHECK:STDOUT: %complete_type.4: = complete_type_witness %struct_type.b.2 [template] +// CHECK:STDOUT: %complete_type.5: = complete_type_witness %struct_type.b.2 [template] // CHECK:STDOUT: %Derived.elem.3: type = unbound_element_type %Derived.2, %Base.2 [template] // CHECK:STDOUT: %Derived.elem.4: type = unbound_element_type %Derived.2, %i32 [template] // CHECK:STDOUT: %struct_type.base.d.3: type = struct_type {.base: %Base.2, .d: %i32} [template] -// CHECK:STDOUT: %complete_type.5: = complete_type_witness %struct_type.base.d.3 [template] +// CHECK:STDOUT: %complete_type.6: = complete_type_witness %struct_type.base.d.3 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -532,14 +526,10 @@ fn AccessMissingConcrete(x: Derived(i32)) -> i32 { // CHECK:STDOUT: } { // CHECK:STDOUT: %Derived.ref: %Derived.type = name_ref Derived, file.%Derived.decl [template = constants.%Derived.generic] // CHECK:STDOUT: %int_32.loc29_37: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc29_37: init type = call constants.%Int(%int_32.loc29_37) [template = constants.%i32] -// CHECK:STDOUT: %.loc29_40.1: type = value_of_initializer %int.make_type_signed.loc29_37 [template = constants.%i32] -// CHECK:STDOUT: %.loc29_40.2: type = converted %int.make_type_signed.loc29_37, %.loc29_40.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc29_37: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %Derived: type = class_type @Derived, @Derived(constants.%i32) [template = constants.%Derived.2] // CHECK:STDOUT: %int_32.loc29_46: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc29_46: init type = call constants.%Int(%int_32.loc29_46) [template = constants.%i32] -// CHECK:STDOUT: %.loc29_46.1: type = value_of_initializer %int.make_type_signed.loc29_46 [template = constants.%i32] -// CHECK:STDOUT: %.loc29_46.2: type = converted %int.make_type_signed.loc29_46, %.loc29_46.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc29_46: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %x.param: %Derived.2 = value_param runtime_param0 // CHECK:STDOUT: %x: %Derived.2 = bind_name x, %x.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 @@ -718,13 +708,13 @@ fn AccessMissingConcrete(x: Derived(i32)) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Base.loc9_22.2 => constants.%Base.2 -// CHECK:STDOUT: %require_complete.loc9 => constants.%complete_type.4 +// CHECK:STDOUT: %require_complete.loc9 => constants.%complete_type.5 // CHECK:STDOUT: %Derived => constants.%Derived.2 // CHECK:STDOUT: %Derived.elem.loc9 => constants.%Derived.elem.3 -// CHECK:STDOUT: %require_complete.loc10 => constants.%complete_type.3 +// CHECK:STDOUT: %require_complete.loc10 => constants.%complete_type.4 // CHECK:STDOUT: %Derived.elem.loc10 => constants.%Derived.elem.4 // CHECK:STDOUT: %struct_type.base.d => constants.%struct_type.base.d.3 -// CHECK:STDOUT: %complete_type.loc11_1.2 => constants.%complete_type.5 +// CHECK:STDOUT: %complete_type.loc11_1.2 => constants.%complete_type.6 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Base(constants.%i32) { @@ -732,10 +722,10 @@ fn AccessMissingConcrete(x: Derived(i32)) -> i32 { // CHECK:STDOUT: %T.patt.loc4_17.2 => constants.%i32 // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete => constants.%complete_type.3 +// CHECK:STDOUT: %require_complete => constants.%complete_type.4 // CHECK:STDOUT: %Base => constants.%Base.2 // CHECK:STDOUT: %Base.elem => constants.%Base.elem.2 // CHECK:STDOUT: %struct_type.b => constants.%struct_type.b.2 -// CHECK:STDOUT: %complete_type.loc6_1.2 => constants.%complete_type.4 +// CHECK:STDOUT: %complete_type.loc6_1.2 => constants.%complete_type.5 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/generic/redeclare.carbon b/toolchain/check/testdata/class/generic/redeclare.carbon index 17e39d80b9c7a..bb0eb10ba11ec 100644 --- a/toolchain/check/testdata/class/generic/redeclare.carbon +++ b/toolchain/check/testdata/class/generic/redeclare.carbon @@ -209,27 +209,25 @@ class E(U:! type) {} // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] -// CHECK:STDOUT: %N.1: %i32 = bind_symbolic_name N, 0 [symbolic] -// CHECK:STDOUT: %N.patt.1: %i32 = symbolic_binding_pattern N, 0 [symbolic] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] +// CHECK:STDOUT: %N.2: %i32 = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %N.patt.2: %i32 = symbolic_binding_pattern N, 0 [symbolic] // CHECK:STDOUT: %B.type: type = generic_class_type @B [template] // CHECK:STDOUT: %B.generic: %B.type = struct_value () [template] // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] -// CHECK:STDOUT: %N.2: %T = bind_symbolic_name N, 1 [symbolic] -// CHECK:STDOUT: %N.patt.2: %T = symbolic_binding_pattern N, 1 [symbolic] +// CHECK:STDOUT: %N.3: %T = bind_symbolic_name N, 1 [symbolic] +// CHECK:STDOUT: %N.patt.3: %T = symbolic_binding_pattern N, 1 [symbolic] // CHECK:STDOUT: %.type: type = generic_class_type @.1 [template] // CHECK:STDOUT: %.generic: %.type = struct_value () [template] -// CHECK:STDOUT: %.1: type = class_type @.1, @.1(%T, %N.2) [symbolic] +// CHECK:STDOUT: %.1: type = class_type @.1, @.1(%T, %N.3) [symbolic] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %complete_type.2: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -242,33 +240,31 @@ class E(U:! type) {} // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %B.decl: %B.type = class_decl @B [template = constants.%B.generic] { -// CHECK:STDOUT: %N.patt.loc4_9.1: %i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc4_9.2 (constants.%N.patt.1)] -// CHECK:STDOUT: %N.param_patt: %i32 = value_param_pattern %N.patt.loc4_9.1, runtime_param [symbolic = %N.patt.loc4_9.2 (constants.%N.patt.1)] +// CHECK:STDOUT: %N.patt.loc4_9.1: %i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc4_9.2 (constants.%N.patt.2)] +// CHECK:STDOUT: %N.param_patt: %i32 = value_param_pattern %N.patt.loc4_9.1, runtime_param [symbolic = %N.patt.loc4_9.2 (constants.%N.patt.2)] // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc4_13.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc4_13.2: type = converted %int.make_type_signed, %.loc4_13.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %N.param: %i32 = value_param runtime_param -// CHECK:STDOUT: %N.loc4_9.1: %i32 = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc4_9.2 (constants.%N.1)] +// CHECK:STDOUT: %N.loc4_9.1: %i32 = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc4_9.2 (constants.%N.2)] // CHECK:STDOUT: } // CHECK:STDOUT: %.decl: %.type = class_decl @.1 [template = constants.%.generic] { // CHECK:STDOUT: %T.patt.loc12_9.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc12_9.2 (constants.%T.patt)] // CHECK:STDOUT: %T.param_patt: type = value_param_pattern %T.patt.loc12_9.1, runtime_param [symbolic = %T.patt.loc12_9.2 (constants.%T.patt)] -// CHECK:STDOUT: %N.patt.loc12_19.1: @.1.%T.loc12_9.2 (%T) = symbolic_binding_pattern N, 1 [symbolic = %N.patt.loc12_19.2 (constants.%N.patt.2)] -// CHECK:STDOUT: %N.param_patt: @.1.%T.loc12_9.2 (%T) = value_param_pattern %N.patt.loc12_19.1, runtime_param [symbolic = %N.patt.loc12_19.2 (constants.%N.patt.2)] +// CHECK:STDOUT: %N.patt.loc12_19.1: @.1.%T.loc12_9.2 (%T) = symbolic_binding_pattern N, 1 [symbolic = %N.patt.loc12_19.2 (constants.%N.patt.3)] +// CHECK:STDOUT: %N.param_patt: @.1.%T.loc12_9.2 (%T) = value_param_pattern %N.patt.loc12_19.1, runtime_param [symbolic = %N.patt.loc12_19.2 (constants.%N.patt.3)] // CHECK:STDOUT: } { // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc12_9.1 [symbolic = %T.loc12_9.2 (constants.%T)] // CHECK:STDOUT: %T.param: type = value_param runtime_param // CHECK:STDOUT: %T.loc12_9.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc12_9.2 (constants.%T)] // CHECK:STDOUT: %N.param: @.1.%T.loc12_9.2 (%T) = value_param runtime_param -// CHECK:STDOUT: %N.loc12_19.1: @.1.%T.loc12_9.2 (%T) = bind_symbolic_name N, 1, %N.param [symbolic = %N.loc12_19.2 (constants.%N.2)] +// CHECK:STDOUT: %N.loc12_19.1: @.1.%T.loc12_9.2 (%T) = bind_symbolic_name N, 1, %N.param [symbolic = %N.loc12_19.2 (constants.%N.3)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic class @B(%N.loc4_9.1: %i32) { -// CHECK:STDOUT: %N.loc4_9.2: %i32 = bind_symbolic_name N, 0 [symbolic = %N.loc4_9.2 (constants.%N.1)] -// CHECK:STDOUT: %N.patt.loc4_9.2: %i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc4_9.2 (constants.%N.patt.1)] +// CHECK:STDOUT: %N.loc4_9.2: %i32 = bind_symbolic_name N, 0 [symbolic = %N.loc4_9.2 (constants.%N.2)] +// CHECK:STDOUT: %N.patt.loc4_9.2: %i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc4_9.2 (constants.%N.patt.2)] // CHECK:STDOUT: // CHECK:STDOUT: class; // CHECK:STDOUT: } @@ -276,13 +272,13 @@ class E(U:! type) {} // CHECK:STDOUT: generic class @.1(%T.loc12_9.1: type, %N.loc12_19.1: @.1.%T.loc12_9.2 (%T)) { // CHECK:STDOUT: %T.loc12_9.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc12_9.2 (constants.%T)] // CHECK:STDOUT: %T.patt.loc12_9.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc12_9.2 (constants.%T.patt)] -// CHECK:STDOUT: %N.loc12_19.2: %T = bind_symbolic_name N, 1 [symbolic = %N.loc12_19.2 (constants.%N.2)] -// CHECK:STDOUT: %N.patt.loc12_19.2: %T = symbolic_binding_pattern N, 1 [symbolic = %N.patt.loc12_19.2 (constants.%N.patt.2)] +// CHECK:STDOUT: %N.loc12_19.2: %T = bind_symbolic_name N, 1 [symbolic = %N.loc12_19.2 (constants.%N.3)] +// CHECK:STDOUT: %N.patt.loc12_19.2: %T = symbolic_binding_pattern N, 1 [symbolic = %N.patt.loc12_19.2 (constants.%N.patt.3)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: class { -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.2] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%.1 @@ -290,16 +286,16 @@ class E(U:! type) {} // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @B(constants.%N.1) { -// CHECK:STDOUT: %N.loc4_9.2 => constants.%N.1 -// CHECK:STDOUT: %N.patt.loc4_9.2 => constants.%N.1 +// CHECK:STDOUT: specific @B(constants.%N.2) { +// CHECK:STDOUT: %N.loc4_9.2 => constants.%N.2 +// CHECK:STDOUT: %N.patt.loc4_9.2 => constants.%N.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @.1(constants.%T, constants.%N.2) { +// CHECK:STDOUT: specific @.1(constants.%T, constants.%N.3) { // CHECK:STDOUT: %T.loc12_9.2 => constants.%T // CHECK:STDOUT: %T.patt.loc12_9.2 => constants.%T -// CHECK:STDOUT: %N.loc12_19.2 => constants.%N.2 -// CHECK:STDOUT: %N.patt.loc12_19.2 => constants.%N.2 +// CHECK:STDOUT: %N.loc12_19.2 => constants.%N.3 +// CHECK:STDOUT: %N.patt.loc12_19.2 => constants.%N.3 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_mismatch_param_count.carbon @@ -310,21 +306,19 @@ class E(U:! type) {} // CHECK:STDOUT: %C.type: type = generic_class_type @C [template] // CHECK:STDOUT: %C.generic: %C.type = struct_value () [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %U: %i32 = bind_symbolic_name U, 1 [symbolic] // CHECK:STDOUT: %U.patt: %i32 = symbolic_binding_pattern U, 1 [symbolic] // CHECK:STDOUT: %.type: type = generic_class_type @.1 [template] // CHECK:STDOUT: %.generic: %.type = struct_value () [template] // CHECK:STDOUT: %.1: type = class_type @.1, @.1(%T, %U) [symbolic] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %complete_type.2: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -350,9 +344,7 @@ class E(U:! type) {} // CHECK:STDOUT: %U.param_patt: %i32 = value_param_pattern %U.patt.loc12_19.1, runtime_param [symbolic = %U.patt.loc12_19.2 (constants.%U.patt)] // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc12_23.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc12_23.2: type = converted %int.make_type_signed, %.loc12_23.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %T.param: type = value_param runtime_param // CHECK:STDOUT: %T.loc12_9.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc12_9.2 (constants.%T)] // CHECK:STDOUT: %U.param: %i32 = value_param runtime_param @@ -376,7 +368,7 @@ class E(U:! type) {} // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: class { -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.2] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%.1 @@ -404,21 +396,19 @@ class E(U:! type) {} // CHECK:STDOUT: %D.type: type = generic_class_type @D [template] // CHECK:STDOUT: %D.generic: %D.type = struct_value () [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %T.2: %i32 = bind_symbolic_name T, 0 [symbolic] // CHECK:STDOUT: %T.patt.2: %i32 = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %.type: type = generic_class_type @.1 [template] // CHECK:STDOUT: %.generic: %.type = struct_value () [template] // CHECK:STDOUT: %.1: type = class_type @.1, @.1(%T.2) [symbolic] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %complete_type.2: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -442,9 +432,7 @@ class E(U:! type) {} // CHECK:STDOUT: %T.param_patt: %i32 = value_param_pattern %T.patt.loc12_9.1, runtime_param [symbolic = %T.patt.loc12_9.2 (constants.%T.patt.2)] // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc12_13.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc12_13.2: type = converted %int.make_type_signed, %.loc12_13.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %T.param: %i32 = value_param runtime_param // CHECK:STDOUT: %T.loc12_9.1: %i32 = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc12_9.2 (constants.%T.2)] // CHECK:STDOUT: } @@ -464,7 +452,7 @@ class E(U:! type) {} // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: class { -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.2] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%.1 diff --git a/toolchain/check/testdata/class/generic/stringify.carbon b/toolchain/check/testdata/class/generic/stringify.carbon index 382f305d4ee72..b3626e94639f9 100644 --- a/toolchain/check/testdata/class/generic/stringify.carbon +++ b/toolchain/check/testdata/class/generic/stringify.carbon @@ -137,15 +137,13 @@ var v: C(123) = (); // CHECK:STDOUT: %Inner.generic.1: %Inner.type.1 = struct_value () [symbolic] // CHECK:STDOUT: %Inner.1: type = class_type @Inner, @Inner(%T, %U) [symbolic] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %complete_type.1: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %ptr.1: type = ptr_type %empty_struct_type [template] // CHECK:STDOUT: %Outer.2: type = class_type @Outer, @Outer(%ptr.1) [template] // CHECK:STDOUT: %Inner.type.2: type = generic_class_type @Inner, @Outer(%ptr.1) [template] // CHECK:STDOUT: %Inner.generic.2: %Inner.type.2 = struct_value () [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %struct_type.a: type = struct_type {.a: %i32} [template] // CHECK:STDOUT: %ptr.2: type = ptr_type %struct_type.a [template] // CHECK:STDOUT: %Inner.2: type = class_type @Inner, @Inner(%ptr.1, %ptr.2) [template] @@ -154,7 +152,7 @@ var v: C(123) = (); // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -190,9 +188,7 @@ var v: C(123) = (); // CHECK:STDOUT: %.loc19_18: %Inner.type.2 = specific_constant @Outer.%Inner.decl, @Outer(constants.%ptr.1) [template = constants.%Inner.generic.2] // CHECK:STDOUT: %Inner.ref: %Inner.type.2 = name_ref Inner, %.loc19_18 [template = constants.%Inner.generic.2] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc19_30.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc19_30.2: type = converted %int.make_type_signed, %.loc19_30.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %struct_type.a: type = struct_type {.a: %i32} [template = constants.%struct_type.a] // CHECK:STDOUT: %ptr.loc19_34: type = ptr_type %struct_type.a [template = constants.%ptr.2] // CHECK:STDOUT: %Inner: type = class_type @Inner, @Inner(constants.%ptr.1, constants.%ptr.2) [template = constants.%Inner.2] @@ -216,7 +212,7 @@ var v: C(123) = (); // CHECK:STDOUT: %U.param: type = value_param runtime_param // CHECK:STDOUT: %U.loc5_15.1: type = bind_symbolic_name U, 1, %U.param [symbolic = %U.loc5_15.2 (constants.%U)] // CHECK:STDOUT: } -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Outer.1 @@ -232,7 +228,7 @@ var v: C(123) = (); // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: class { -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Inner.1 @@ -283,23 +279,21 @@ var v: C(123) = (); // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] -// CHECK:STDOUT: %N.1: %i32 = bind_symbolic_name N, 0 [symbolic] -// CHECK:STDOUT: %N.patt.1: %i32 = symbolic_binding_pattern N, 0 [symbolic] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] +// CHECK:STDOUT: %N.2: %i32 = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %N.patt.2: %i32 = symbolic_binding_pattern N, 0 [symbolic] // CHECK:STDOUT: %C.type: type = generic_class_type @C [template] // CHECK:STDOUT: %C.generic: %C.type = struct_value () [template] -// CHECK:STDOUT: %C.1: type = class_type @C, @C(%N.1) [symbolic] +// CHECK:STDOUT: %C.1: type = class_type @C, @C(%N.2) [symbolic] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] -// CHECK:STDOUT: %complete_type.1: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %complete_type.2: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %int_123.1: Core.IntLiteral = int_value 123 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_123.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound: = bound_method %int_123.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_123.2: %i32 = int_value 123 [template] // CHECK:STDOUT: %C.2: type = class_type @C, @C(%int_123.2) [template] @@ -308,7 +302,7 @@ var v: C(123) = (); // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -322,19 +316,17 @@ var v: C(123) = (); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %C.decl: %C.type = class_decl @C [template = constants.%C.generic] { -// CHECK:STDOUT: %N.patt.loc4_9.1: %i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc4_9.2 (constants.%N.patt.1)] -// CHECK:STDOUT: %N.param_patt: %i32 = value_param_pattern %N.patt.loc4_9.1, runtime_param [symbolic = %N.patt.loc4_9.2 (constants.%N.patt.1)] +// CHECK:STDOUT: %N.patt.loc4_9.1: %i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc4_9.2 (constants.%N.patt.2)] +// CHECK:STDOUT: %N.param_patt: %i32 = value_param_pattern %N.patt.loc4_9.1, runtime_param [symbolic = %N.patt.loc4_9.2 (constants.%N.patt.2)] // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc4_13.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc4_13.2: type = converted %int.make_type_signed, %.loc4_13.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %N.param: %i32 = value_param runtime_param -// CHECK:STDOUT: %N.loc4_9.1: %i32 = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc4_9.2 (constants.%N.1)] +// CHECK:STDOUT: %N.loc4_9.1: %i32 = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc4_9.2 (constants.%N.2)] // CHECK:STDOUT: } // CHECK:STDOUT: %C.ref: %C.type = name_ref C, %C.decl [template = constants.%C.generic] // CHECK:STDOUT: %int_123: Core.IntLiteral = int_value 123 [template = constants.%int_123.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_123, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_123) [template = constants.%int_123.2] @@ -346,13 +338,13 @@ var v: C(123) = (); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic class @C(%N.loc4_9.1: %i32) { -// CHECK:STDOUT: %N.loc4_9.2: %i32 = bind_symbolic_name N, 0 [symbolic = %N.loc4_9.2 (constants.%N.1)] -// CHECK:STDOUT: %N.patt.loc4_9.2: %i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc4_9.2 (constants.%N.patt.1)] +// CHECK:STDOUT: %N.loc4_9.2: %i32 = bind_symbolic_name N, 0 [symbolic = %N.loc4_9.2 (constants.%N.2)] +// CHECK:STDOUT: %N.patt.loc4_9.2: %i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc4_9.2 (constants.%N.patt.2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: class { -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.2] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C.1 @@ -368,9 +360,9 @@ var v: C(123) = (); // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @C(constants.%N.1) { -// CHECK:STDOUT: %N.loc4_9.2 => constants.%N.1 -// CHECK:STDOUT: %N.patt.loc4_9.2 => constants.%N.1 +// CHECK:STDOUT: specific @C(constants.%N.2) { +// CHECK:STDOUT: %N.loc4_9.2 => constants.%N.2 +// CHECK:STDOUT: %N.patt.loc4_9.2 => constants.%N.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @C(constants.%int_123.2) { diff --git a/toolchain/check/testdata/class/import.carbon b/toolchain/check/testdata/class/import.carbon index 2dc900296825a..8dda32981715a 100644 --- a/toolchain/check/testdata/class/import.carbon +++ b/toolchain/check/testdata/class/import.carbon @@ -57,12 +57,10 @@ fn Run() { // CHECK:STDOUT: %complete_type.1: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %Field: type = class_type @Field [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %Field.elem: type = unbound_element_type %Field, %i32 [template] // CHECK:STDOUT: %struct_type.x: type = struct_type {.x: %i32} [template] -// CHECK:STDOUT: %complete_type.2: = complete_type_witness %struct_type.x [template] +// CHECK:STDOUT: %complete_type.4: = complete_type_witness %struct_type.x [template] // CHECK:STDOUT: %ForwardDeclared: type = class_type @ForwardDeclared [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] @@ -74,7 +72,7 @@ fn Run() { // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -106,15 +104,13 @@ fn Run() { // CHECK:STDOUT: // CHECK:STDOUT: class @Field { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc8_10.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc8_10.2: type = converted %int.make_type_signed, %.loc8_10.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc8_8: %Field.elem = field_decl x, element0 [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.x [template = constants.%complete_type.2] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc8: %Field.elem = field_decl x, element0 [template] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.x [template = constants.%complete_type.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Field -// CHECK:STDOUT: .x = %.loc8_8 +// CHECK:STDOUT: .x = %.loc8 // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } // CHECK:STDOUT: @@ -164,22 +160,22 @@ fn Run() { // CHECK:STDOUT: %Empty.val: %Empty = struct_value () [template] // CHECK:STDOUT: %Field: type = class_type @Field [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %struct_type.x.1: type = struct_type {.x: %i32} [template] -// CHECK:STDOUT: %complete_type.2: = complete_type_witness %struct_type.x.1 [template] +// CHECK:STDOUT: %complete_type.3: = complete_type_witness %struct_type.x.1 [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %struct_type.x.2: type = struct_type {.x: Core.IntLiteral} [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] // CHECK:STDOUT: %Field.val: %Field = struct_value (%int_1.2) [template] // CHECK:STDOUT: %Field.elem: type = unbound_element_type %Field, %i32 [template] // CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] // CHECK:STDOUT: %ForwardDeclared.1: type = class_type @ForwardDeclared.1 [template] @@ -199,23 +195,23 @@ fn Run() { // CHECK:STDOUT: %import_ref.3: type = import_ref Main//a, ForwardDeclared, loaded [template = constants.%ForwardDeclared.1] // CHECK:STDOUT: %import_ref.4: type = import_ref Main//a, Incomplete, loaded [template = constants.%Incomplete] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .ImplicitAs = %import_ref.10 +// CHECK:STDOUT: .ImplicitAs = %import_ref.13 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.5: = import_ref Main//a, loc5_1, loaded [template = constants.%complete_type.1] // CHECK:STDOUT: %import_ref.6 = import_ref Main//a, inst16 [no loc], unloaded -// CHECK:STDOUT: %import_ref.7: = import_ref Main//a, loc9_1, loaded [template = constants.%complete_type.2] -// CHECK:STDOUT: %import_ref.8 = import_ref Main//a, inst21 [no loc], unloaded -// CHECK:STDOUT: %import_ref.9: %Field.elem = import_ref Main//a, loc8_8, loaded [template = %.1] -// CHECK:STDOUT: %import_ref.46: = import_ref Main//a, loc16_1, loaded [template = constants.%complete_type.1] -// CHECK:STDOUT: %import_ref.47 = import_ref Main//a, inst43 [no loc], unloaded -// CHECK:STDOUT: %import_ref.48: %F.type = import_ref Main//a, loc14_21, loaded [template = constants.%F] -// CHECK:STDOUT: %import_ref.49: %G.type = import_ref Main//a, loc15_27, loaded [template = constants.%G] -// CHECK:STDOUT: %import_ref.50: = import_ref Main//a, loc16_1, loaded [template = constants.%complete_type.1] -// CHECK:STDOUT: %import_ref.51 = import_ref Main//a, inst43 [no loc], unloaded -// CHECK:STDOUT: %import_ref.52 = import_ref Main//a, loc14_21, unloaded -// CHECK:STDOUT: %import_ref.53 = import_ref Main//a, loc15_27, unloaded +// CHECK:STDOUT: %import_ref.10: = import_ref Main//a, loc9_1, loaded [template = constants.%complete_type.3] +// CHECK:STDOUT: %import_ref.11 = import_ref Main//a, inst21 [no loc], unloaded +// CHECK:STDOUT: %import_ref.12: %Field.elem = import_ref Main//a, loc8_8, loaded [template = %.1] +// CHECK:STDOUT: %import_ref.201: = import_ref Main//a, loc16_1, loaded [template = constants.%complete_type.1] +// CHECK:STDOUT: %import_ref.202 = import_ref Main//a, inst56 [no loc], unloaded +// CHECK:STDOUT: %import_ref.203: %F.type = import_ref Main//a, loc14_21, loaded [template = constants.%F] +// CHECK:STDOUT: %import_ref.204: %G.type = import_ref Main//a, loc15_27, loaded [template = constants.%G] +// CHECK:STDOUT: %import_ref.205: = import_ref Main//a, loc16_1, loaded [template = constants.%complete_type.1] +// CHECK:STDOUT: %import_ref.206 = import_ref Main//a, inst56 [no loc], unloaded +// CHECK:STDOUT: %import_ref.207 = import_ref Main//a, loc14_21, unloaded +// CHECK:STDOUT: %import_ref.208 = import_ref Main//a, loc15_27, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -240,25 +236,25 @@ fn Run() { // CHECK:STDOUT: // CHECK:STDOUT: class @Field [from "a.carbon"] { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.8 -// CHECK:STDOUT: .x = imports.%import_ref.9 -// CHECK:STDOUT: complete_type_witness = imports.%import_ref.7 +// CHECK:STDOUT: .Self = imports.%import_ref.11 +// CHECK:STDOUT: .x = imports.%import_ref.12 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.10 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @ForwardDeclared.1 [from "a.carbon"] { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.47 -// CHECK:STDOUT: .F = imports.%import_ref.48 -// CHECK:STDOUT: .G = imports.%import_ref.49 -// CHECK:STDOUT: complete_type_witness = imports.%import_ref.46 +// CHECK:STDOUT: .Self = imports.%import_ref.202 +// CHECK:STDOUT: .F = imports.%import_ref.203 +// CHECK:STDOUT: .G = imports.%import_ref.204 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.201 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @ForwardDeclared.2 [from "a.carbon"] { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.51 -// CHECK:STDOUT: .F = imports.%import_ref.52 -// CHECK:STDOUT: .G = imports.%import_ref.53 -// CHECK:STDOUT: complete_type_witness = imports.%import_ref.50 +// CHECK:STDOUT: .Self = imports.%import_ref.206 +// CHECK:STDOUT: .F = imports.%import_ref.207 +// CHECK:STDOUT: .G = imports.%import_ref.208 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.205 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Incomplete [from "a.carbon"]; @@ -277,7 +273,7 @@ fn Run() { // CHECK:STDOUT: %b: ref %Field = bind_name b, %b.var // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %.loc9_25.1: %struct_type.x.2 = struct_literal (%int_1) -// CHECK:STDOUT: %impl.elem0.loc9: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc9: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc9: = bound_method %int_1, %impl.elem0.loc9 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc9: = specific_function %Convert.bound.loc9, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc9: init %i32 = call %Convert.specific_fn.loc9(%int_1) [template = constants.%int_1.2] @@ -288,10 +284,10 @@ fn Run() { // CHECK:STDOUT: %.loc9_26: init %Field = converted %.loc9_25.1, %.loc9_25.5 [template = constants.%Field.val] // CHECK:STDOUT: assign %b.var, %.loc9_26 // CHECK:STDOUT: %b.ref: ref %Field = name_ref b, %b -// CHECK:STDOUT: %x.ref: %Field.elem = name_ref x, imports.%import_ref.9 [template = imports.%.1] +// CHECK:STDOUT: %x.ref: %Field.elem = name_ref x, imports.%import_ref.12 [template = imports.%.1] // CHECK:STDOUT: %.loc10_4: ref %i32 = class_element_access %b.ref, element0 // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %impl.elem0.loc10: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc10: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc10: = bound_method %int_2, %impl.elem0.loc10 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc10: = specific_function %Convert.bound.loc10, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc10: init %i32 = call %Convert.specific_fn.loc10(%int_2) [template = constants.%int_2.2] @@ -305,12 +301,12 @@ fn Run() { // CHECK:STDOUT: %.loc12_30: init %ForwardDeclared.1 = converted %.loc12_29.1, %.loc12_29.2 [template = constants.%ForwardDeclared.val] // CHECK:STDOUT: assign %c.var, %.loc12_30 // CHECK:STDOUT: %c.ref.loc13: ref %ForwardDeclared.1 = name_ref c, %c -// CHECK:STDOUT: %F.ref: %F.type = name_ref F, imports.%import_ref.48 [template = constants.%F] +// CHECK:STDOUT: %F.ref: %F.type = name_ref F, imports.%import_ref.203 [template = constants.%F] // CHECK:STDOUT: %F.bound: = bound_method %c.ref.loc13, %F.ref // CHECK:STDOUT: %.loc13: %ForwardDeclared.1 = bind_value %c.ref.loc13 // CHECK:STDOUT: %F.call: init %empty_tuple.type = call %F.bound(%.loc13) // CHECK:STDOUT: %c.ref.loc14: ref %ForwardDeclared.1 = name_ref c, %c -// CHECK:STDOUT: %G.ref: %G.type = name_ref G, imports.%import_ref.49 [template = constants.%G] +// CHECK:STDOUT: %G.ref: %G.type = name_ref G, imports.%import_ref.204 [template = constants.%G] // CHECK:STDOUT: %G.bound: = bound_method %c.ref.loc14, %G.ref // CHECK:STDOUT: %addr.loc14: %ptr.3 = addr_of %c.ref.loc14 // CHECK:STDOUT: %G.call: init %empty_tuple.type = call %G.bound(%addr.loc14) @@ -330,5 +326,5 @@ fn Run() { // CHECK:STDOUT: // CHECK:STDOUT: fn @F[%self.param_patt: %ForwardDeclared.1]() [from "a.carbon"]; // CHECK:STDOUT: -// CHECK:STDOUT: fn @G[addr .inst419: %ptr.3]() [from "a.carbon"]; +// CHECK:STDOUT: fn @G[addr .inst605: %ptr.3]() [from "a.carbon"]; // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/import_base.carbon b/toolchain/check/testdata/class/import_base.carbon index c7984b69f5d30..25c1c062f52c1 100644 --- a/toolchain/check/testdata/class/import_base.carbon +++ b/toolchain/check/testdata/class/import_base.carbon @@ -45,21 +45,19 @@ fn Run() { // CHECK:STDOUT: %Unused.type: type = fn_type @Unused [template] // CHECK:STDOUT: %Unused: %Unused.type = struct_value () [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %Base.elem: type = unbound_element_type %Base, %i32 [template] // CHECK:STDOUT: %struct_type.x.unused: type = struct_type {.x: %i32, .unused: %i32} [template] -// CHECK:STDOUT: %complete_type.1: = complete_type_witness %struct_type.x.unused [template] +// CHECK:STDOUT: %complete_type.3: = complete_type_witness %struct_type.x.unused [template] // CHECK:STDOUT: %Child: type = class_type @Child [template] // CHECK:STDOUT: %Child.elem: type = unbound_element_type %Child, %Base [template] // CHECK:STDOUT: %struct_type.base: type = struct_type {.base: %Base} [template] -// CHECK:STDOUT: %complete_type.2: = complete_type_witness %struct_type.base [template] +// CHECK:STDOUT: %complete_type.4: = complete_type_witness %struct_type.base [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -94,30 +92,26 @@ fn Run() { // CHECK:STDOUT: %self: %Base = bind_name self, %self.param // CHECK:STDOUT: } // CHECK:STDOUT: %int_32.loc8: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc8: init type = call constants.%Int(%int_32.loc8) [template = constants.%i32] -// CHECK:STDOUT: %.loc8_10.1: type = value_of_initializer %int.make_type_signed.loc8 [template = constants.%i32] -// CHECK:STDOUT: %.loc8_10.2: type = converted %int.make_type_signed.loc8, %.loc8_10.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc8_8: %Base.elem = field_decl x, element0 [template] +// CHECK:STDOUT: %i32.loc8: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc8: %Base.elem = field_decl x, element0 [template] // CHECK:STDOUT: %int_32.loc9: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc9: init type = call constants.%Int(%int_32.loc9) [template = constants.%i32] -// CHECK:STDOUT: %.loc9_15.1: type = value_of_initializer %int.make_type_signed.loc9 [template = constants.%i32] -// CHECK:STDOUT: %.loc9_15.2: type = converted %int.make_type_signed.loc9, %.loc9_15.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc9_13: %Base.elem = field_decl unused, element1 [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.x.unused [template = constants.%complete_type.1] +// CHECK:STDOUT: %i32.loc9: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc9: %Base.elem = field_decl unused, element1 [template] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.x.unused [template = constants.%complete_type.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Base // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: .Unused = %Unused.decl -// CHECK:STDOUT: .x = %.loc8_8 -// CHECK:STDOUT: .unused = %.loc9_13 +// CHECK:STDOUT: .x = %.loc8 +// CHECK:STDOUT: .unused = %.loc9 // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Child { // CHECK:STDOUT: %Base.ref: type = name_ref Base, file.%Base.decl [template = constants.%Base] // CHECK:STDOUT: %.loc13: %Child.elem = base_decl %Base.ref, element0 [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.base [template = constants.%complete_type.2] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.base [template = constants.%complete_type.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Child @@ -139,30 +133,30 @@ fn Run() { // CHECK:STDOUT: %Child: type = class_type @Child [template] // CHECK:STDOUT: %Base: type = class_type @Base [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %struct_type.x.unused.1: type = struct_type {.x: %i32, .unused: %i32} [template] -// CHECK:STDOUT: %complete_type.1: = complete_type_witness %struct_type.x.unused.1 [template] +// CHECK:STDOUT: %complete_type.2: = complete_type_witness %struct_type.x.unused.1 [template] // CHECK:STDOUT: %struct_type.base.1: type = struct_type {.base: %Base} [template] -// CHECK:STDOUT: %complete_type.2: = complete_type_witness %struct_type.base.1 [template] +// CHECK:STDOUT: %complete_type.3: = complete_type_witness %struct_type.base.1 [template] // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %struct_type.x.unused.2: type = struct_type {.x: Core.IntLiteral, .unused: Core.IntLiteral} [template] // CHECK:STDOUT: %struct_type.base.3: type = struct_type {.base: %struct_type.x.unused.2} [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_0.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] // CHECK:STDOUT: %Base.val: %Base = struct_value (%int_0.2, %int_1.2) [template] // CHECK:STDOUT: %Child.val: %Child = struct_value (%Base.val) [template] // CHECK:STDOUT: %Base.elem: type = unbound_element_type %Base, %i32 [template] // CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_2.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_2.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] @@ -173,20 +167,20 @@ fn Run() { // CHECK:STDOUT: %import_ref.1 = import_ref Main//a, Base, unloaded // CHECK:STDOUT: %import_ref.2: type = import_ref Main//a, Child, loaded [template = constants.%Child] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .ImplicitAs = %import_ref.14 +// CHECK:STDOUT: .ImplicitAs = %import_ref.17 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.3: = import_ref Main//a, loc10_1, loaded [template = constants.%complete_type.1] -// CHECK:STDOUT: %import_ref.4 = import_ref Main//a, inst16 [no loc], unloaded -// CHECK:STDOUT: %import_ref.5: %F.type = import_ref Main//a, loc5_21, loaded [template = constants.%F] -// CHECK:STDOUT: %import_ref.6 = import_ref Main//a, loc6_26, unloaded -// CHECK:STDOUT: %import_ref.7: %Base.elem = import_ref Main//a, loc8_8, loaded [template = %.1] -// CHECK:STDOUT: %import_ref.8 = import_ref Main//a, loc9_13, unloaded -// CHECK:STDOUT: %import_ref.10: = import_ref Main//a, loc14_1, loaded [template = constants.%complete_type.2] -// CHECK:STDOUT: %import_ref.11 = import_ref Main//a, inst59 [no loc], unloaded -// CHECK:STDOUT: %import_ref.12 = import_ref Main//a, loc13_20, unloaded -// CHECK:STDOUT: %import_ref.13: type = import_ref Main//a, loc13_16, loaded [template = constants.%Base] +// CHECK:STDOUT: %import_ref.6: = import_ref Main//a, loc10_1, loaded [template = constants.%complete_type.2] +// CHECK:STDOUT: %import_ref.7 = import_ref Main//a, inst16 [no loc], unloaded +// CHECK:STDOUT: %import_ref.8: %F.type = import_ref Main//a, loc5_21, loaded [template = constants.%F] +// CHECK:STDOUT: %import_ref.9 = import_ref Main//a, loc6_26, unloaded +// CHECK:STDOUT: %import_ref.10: %Base.elem = import_ref Main//a, loc8_8, loaded [template = %.1] +// CHECK:STDOUT: %import_ref.11 = import_ref Main//a, loc9_13, unloaded +// CHECK:STDOUT: %import_ref.13: = import_ref Main//a, loc14_1, loaded [template = constants.%complete_type.3] +// CHECK:STDOUT: %import_ref.14 = import_ref Main//a, inst70 [no loc], unloaded +// CHECK:STDOUT: %import_ref.15 = import_ref Main//a, loc13_20, unloaded +// CHECK:STDOUT: %import_ref.16: type = import_ref Main//a, loc13_16, loaded [template = constants.%Base] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -203,20 +197,20 @@ fn Run() { // CHECK:STDOUT: // CHECK:STDOUT: class @Child [from "a.carbon"] { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.11 -// CHECK:STDOUT: .base = imports.%import_ref.12 -// CHECK:STDOUT: extend imports.%import_ref.13 -// CHECK:STDOUT: complete_type_witness = imports.%import_ref.10 +// CHECK:STDOUT: .Self = imports.%import_ref.14 +// CHECK:STDOUT: .base = imports.%import_ref.15 +// CHECK:STDOUT: extend imports.%import_ref.16 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.13 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Base [from "a.carbon"] { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.4 -// CHECK:STDOUT: .F = imports.%import_ref.5 -// CHECK:STDOUT: .Unused = imports.%import_ref.6 -// CHECK:STDOUT: .x = imports.%import_ref.7 -// CHECK:STDOUT: .unused = imports.%import_ref.8 -// CHECK:STDOUT: complete_type_witness = imports.%import_ref.3 +// CHECK:STDOUT: .Self = imports.%import_ref.7 +// CHECK:STDOUT: .F = imports.%import_ref.8 +// CHECK:STDOUT: .Unused = imports.%import_ref.9 +// CHECK:STDOUT: .x = imports.%import_ref.10 +// CHECK:STDOUT: .unused = imports.%import_ref.11 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.6 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Run() { @@ -228,7 +222,7 @@ fn Run() { // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %.loc7_47.1: %struct_type.x.unused.2 = struct_literal (%int_0, %int_1) // CHECK:STDOUT: %.loc7_48.1: %struct_type.base.3 = struct_literal (%.loc7_47.1) -// CHECK:STDOUT: %impl.elem0.loc7_47.1: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc7_47.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc7_47.1: = bound_method %int_0, %impl.elem0.loc7_47.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc7_47.1: = specific_function %Convert.bound.loc7_47.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc7_47.1: init %i32 = call %Convert.specific_fn.loc7_47.1(%int_0) [template = constants.%int_0.2] @@ -236,7 +230,7 @@ fn Run() { // CHECK:STDOUT: %.loc7_48.2: ref %Base = class_element_access %a.var, element0 // CHECK:STDOUT: %.loc7_47.3: ref %i32 = class_element_access %.loc7_48.2, element0 // CHECK:STDOUT: %.loc7_47.4: init %i32 = initialize_from %.loc7_47.2 to %.loc7_47.3 [template = constants.%int_0.2] -// CHECK:STDOUT: %impl.elem0.loc7_47.2: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc7_47.2: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc7_47.2: = bound_method %int_1, %impl.elem0.loc7_47.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc7_47.2: = specific_function %Convert.bound.loc7_47.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc7_47.2: init %i32 = call %Convert.specific_fn.loc7_47.2(%int_1) [template = constants.%int_1.2] @@ -249,19 +243,19 @@ fn Run() { // CHECK:STDOUT: %.loc7_49: init %Child = converted %.loc7_48.1, %.loc7_48.4 [template = constants.%Child.val] // CHECK:STDOUT: assign %a.var, %.loc7_49 // CHECK:STDOUT: %a.ref.loc8: ref %Child = name_ref a, %a -// CHECK:STDOUT: %x.ref: %Base.elem = name_ref x, imports.%import_ref.7 [template = imports.%.1] +// CHECK:STDOUT: %x.ref: %Base.elem = name_ref x, imports.%import_ref.10 [template = imports.%.1] // CHECK:STDOUT: %.loc8_4.1: ref %Base = class_element_access %a.ref.loc8, element0 // CHECK:STDOUT: %.loc8_4.2: ref %Base = converted %a.ref.loc8, %.loc8_4.1 // CHECK:STDOUT: %.loc8_4.3: ref %i32 = class_element_access %.loc8_4.2, element0 // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %impl.elem0.loc8: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc8: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc8: = bound_method %int_2, %impl.elem0.loc8 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc8: = specific_function %Convert.bound.loc8, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc8: init %i32 = call %Convert.specific_fn.loc8(%int_2) [template = constants.%int_2.2] // CHECK:STDOUT: %.loc8_7: init %i32 = converted %int_2, %int.convert_checked.loc8 [template = constants.%int_2.2] // CHECK:STDOUT: assign %.loc8_4.3, %.loc8_7 // CHECK:STDOUT: %a.ref.loc9: ref %Child = name_ref a, %a -// CHECK:STDOUT: %F.ref: %F.type = name_ref F, imports.%import_ref.5 [template = constants.%F] +// CHECK:STDOUT: %F.ref: %F.type = name_ref F, imports.%import_ref.8 [template = constants.%F] // CHECK:STDOUT: %F.bound: = bound_method %a.ref.loc9, %F.ref // CHECK:STDOUT: %.loc9_3.1: ref %Base = class_element_access %a.ref.loc9, element0 // CHECK:STDOUT: %.loc9_3.2: ref %Base = converted %a.ref.loc9, %.loc9_3.1 diff --git a/toolchain/check/testdata/class/inheritance_access.carbon b/toolchain/check/testdata/class/inheritance_access.carbon index 8e5b9fcaa438b..3e6157e419e1f 100644 --- a/toolchain/check/testdata/class/inheritance_access.carbon +++ b/toolchain/check/testdata/class/inheritance_access.carbon @@ -231,12 +231,10 @@ class B { // CHECK:STDOUT: constants { // CHECK:STDOUT: %Shape: type = class_type @Shape [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %Shape.elem: type = unbound_element_type %Shape, %i32 [template] // CHECK:STDOUT: %struct_type.x.y: type = struct_type {.x: %i32, .y: %i32} [template] -// CHECK:STDOUT: %complete_type.1: = complete_type_witness %struct_type.x.y [template] +// CHECK:STDOUT: %complete_type.3: = complete_type_witness %struct_type.x.y [template] // CHECK:STDOUT: %Circle: type = class_type @Circle [template] // CHECK:STDOUT: %Circle.elem: type = unbound_element_type %Circle, %Shape [template] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (type, type) [template] @@ -244,12 +242,12 @@ class B { // CHECK:STDOUT: %GetPosition.type: type = fn_type @GetPosition [template] // CHECK:STDOUT: %GetPosition: %GetPosition.type = struct_value () [template] // CHECK:STDOUT: %struct_type.base.1: type = struct_type {.base: %Shape} [template] -// CHECK:STDOUT: %complete_type.2: = complete_type_witness %struct_type.base.1 [template] +// CHECK:STDOUT: %complete_type.4: = complete_type_witness %struct_type.base.1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -268,21 +266,17 @@ class B { // CHECK:STDOUT: // CHECK:STDOUT: class @Shape { // CHECK:STDOUT: %int_32.loc5: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc5: init type = call constants.%Int(%int_32.loc5) [template = constants.%i32] -// CHECK:STDOUT: %.loc5_20.1: type = value_of_initializer %int.make_type_signed.loc5 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_20.2: type = converted %int.make_type_signed.loc5, %.loc5_20.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_18: %Shape.elem = field_decl x, element0 [template] +// CHECK:STDOUT: %i32.loc5: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc5: %Shape.elem = field_decl x, element0 [template] // CHECK:STDOUT: %int_32.loc6: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc6: init type = call constants.%Int(%int_32.loc6) [template = constants.%i32] -// CHECK:STDOUT: %.loc6_20.1: type = value_of_initializer %int.make_type_signed.loc6 [template = constants.%i32] -// CHECK:STDOUT: %.loc6_20.2: type = converted %int.make_type_signed.loc6, %.loc6_20.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc6_18: %Shape.elem = field_decl y, element1 [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.x.y [template = constants.%complete_type.1] +// CHECK:STDOUT: %i32.loc6: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc6: %Shape.elem = field_decl y, element1 [template] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.x.y [template = constants.%complete_type.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Shape -// CHECK:STDOUT: .x [protected] = %.loc5_18 -// CHECK:STDOUT: .y [protected] = %.loc6_18 +// CHECK:STDOUT: .x [protected] = %.loc5 +// CHECK:STDOUT: .y [protected] = %.loc6 // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } // CHECK:STDOUT: @@ -297,21 +291,17 @@ class B { // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Circle [template = constants.%Circle] // CHECK:STDOUT: %int_32.loc12_36: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc12_36: init type = call constants.%Int(%int_32.loc12_36) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc12_36: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc12_41: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc12_41: init type = call constants.%Int(%int_32.loc12_41) [template = constants.%i32] -// CHECK:STDOUT: %.loc12_44.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc12_36, %int.make_type_signed.loc12_41) -// CHECK:STDOUT: %.loc12_44.2: type = value_of_initializer %int.make_type_signed.loc12_36 [template = constants.%i32] -// CHECK:STDOUT: %.loc12_44.3: type = converted %int.make_type_signed.loc12_36, %.loc12_44.2 [template = constants.%i32] -// CHECK:STDOUT: %.loc12_44.4: type = value_of_initializer %int.make_type_signed.loc12_41 [template = constants.%i32] -// CHECK:STDOUT: %.loc12_44.5: type = converted %int.make_type_signed.loc12_41, %.loc12_44.4 [template = constants.%i32] -// CHECK:STDOUT: %.loc12_44.6: type = converted %.loc12_44.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] +// CHECK:STDOUT: %i32.loc12_41: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc12_44.1: %tuple.type.1 = tuple_literal (%i32.loc12_36, %i32.loc12_41) +// CHECK:STDOUT: %.loc12_44.2: type = converted %.loc12_44.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %self.param: %Circle = value_param runtime_param0 // CHECK:STDOUT: %self: %Circle = bind_name self, %self.param // CHECK:STDOUT: %return.param: ref %tuple.type.2 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %tuple.type.2 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.base.1 [template = constants.%complete_type.2] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.base.1 [template = constants.%complete_type.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Circle @@ -324,12 +314,12 @@ class B { // CHECK:STDOUT: fn @GetPosition[%self.param_patt: %Circle]() -> %return.param_patt: %tuple.type.2 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %self.ref.loc13_13: %Circle = name_ref self, %self -// CHECK:STDOUT: %x.ref: %Shape.elem = name_ref x, @Shape.%.loc5_18 [template = @Shape.%.loc5_18] +// CHECK:STDOUT: %x.ref: %Shape.elem = name_ref x, @Shape.%.loc5 [template = @Shape.%.loc5] // CHECK:STDOUT: %.loc13_17.1: ref %Shape = class_element_access %self.ref.loc13_13, element0 // CHECK:STDOUT: %.loc13_17.2: ref %Shape = converted %self.ref.loc13_13, %.loc13_17.1 // CHECK:STDOUT: %.loc13_17.3: ref %i32 = class_element_access %.loc13_17.2, element0 // CHECK:STDOUT: %self.ref.loc13_21: %Circle = name_ref self, %self -// CHECK:STDOUT: %y.ref: %Shape.elem = name_ref y, @Shape.%.loc6_18 [template = @Shape.%.loc6_18] +// CHECK:STDOUT: %y.ref: %Shape.elem = name_ref y, @Shape.%.loc6 [template = @Shape.%.loc6] // CHECK:STDOUT: %.loc13_25.1: ref %Shape = class_element_access %self.ref.loc13_21, element0 // CHECK:STDOUT: %.loc13_25.2: ref %Shape = converted %self.ref.loc13_21, %.loc13_25.1 // CHECK:STDOUT: %.loc13_25.3: ref %i32 = class_element_access %.loc13_25.2, element1 @@ -357,25 +347,23 @@ class B { // CHECK:STDOUT: %B: type = class_type @B [template] // CHECK:STDOUT: %B.elem: type = unbound_element_type %B, %A [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %F.type.2: type = fn_type @F.2 [template] // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [template] // CHECK:STDOUT: %struct_type.base.1: type = struct_type {.base: %A} [template] -// CHECK:STDOUT: %complete_type.2: = complete_type_witness %struct_type.base.1 [template] +// CHECK:STDOUT: %complete_type.3: = complete_type_witness %struct_type.base.1 [template] // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %C.elem: type = unbound_element_type %C, %B [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] // CHECK:STDOUT: %struct_type.base.3: type = struct_type {.base: %B} [template] -// CHECK:STDOUT: %complete_type.3: = complete_type_witness %struct_type.base.3 [template] +// CHECK:STDOUT: %complete_type.4: = complete_type_witness %struct_type.base.3 [template] // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -412,13 +400,11 @@ class B { // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc10_21.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc10_21.2: type = converted %int.make_type_signed, %.loc10_21.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.base.1 [template = constants.%complete_type.2] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.base.1 [template = constants.%complete_type.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%B @@ -445,7 +431,7 @@ class B { // CHECK:STDOUT: %return.param: ref %empty_tuple.type = out_param runtime_param1 // CHECK:STDOUT: %return: ref %empty_tuple.type = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.base.3 [template = constants.%complete_type.3] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.base.3 [template = constants.%complete_type.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C @@ -476,21 +462,19 @@ class B { // CHECK:STDOUT: constants { // CHECK:STDOUT: %A: type = class_type @A [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %int_5.1: Core.IntLiteral = int_value 5 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_5.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound: = bound_method %int_5.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_5.2: %i32 = int_value 5 [template] // CHECK:STDOUT: %SomeProtectedFunction.type: type = fn_type @SomeProtectedFunction [template] // CHECK:STDOUT: %SomeProtectedFunction: %SomeProtectedFunction.type = struct_value () [template] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] -// CHECK:STDOUT: %complete_type.3: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %complete_type.4: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %B: type = class_type @B [template] // CHECK:STDOUT: %B.elem: type = unbound_element_type %B, %A [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] @@ -498,13 +482,13 @@ class B { // CHECK:STDOUT: %H.type: type = fn_type @H [template] // CHECK:STDOUT: %H: %H.type = struct_value () [template] // CHECK:STDOUT: %struct_type.base: type = struct_type {.base: %A} [template] -// CHECK:STDOUT: %complete_type.4: = complete_type_witness %struct_type.base [template] +// CHECK:STDOUT: %complete_type.5: = complete_type_witness %struct_type.base [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -523,11 +507,9 @@ class B { // CHECK:STDOUT: // CHECK:STDOUT: class @A { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc5_32.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc5_32.2: type = converted %int.make_type_signed, %.loc5_32.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_5: Core.IntLiteral = int_value 5 [template = constants.%int_5.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_5, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_5) [template = constants.%int_5.2] @@ -539,13 +521,11 @@ class B { // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc6_43.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc6_43.2: type = converted %int.make_type_signed, %.loc6_43.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.3] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%A @@ -562,9 +542,7 @@ class B { // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc14_13.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc14_13.2: type = converted %int.make_type_signed, %.loc14_13.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } @@ -573,13 +551,11 @@ class B { // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc18_13.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc18_13.2: type = converted %int.make_type_signed, %.loc18_13.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.base [template = constants.%complete_type.4] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.base [template = constants.%complete_type.5] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%B @@ -593,7 +569,7 @@ class B { // CHECK:STDOUT: fn @SomeProtectedFunction() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_5: Core.IntLiteral = int_value 5 [template = constants.%int_5.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_5, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_5) [template = constants.%int_5.2] @@ -624,23 +600,21 @@ class B { // CHECK:STDOUT: constants { // CHECK:STDOUT: %Shape: type = class_type @Shape [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %Shape.elem: type = unbound_element_type %Shape, %i32 [template] // CHECK:STDOUT: %struct_type.y: type = struct_type {.y: %i32} [template] -// CHECK:STDOUT: %complete_type.1: = complete_type_witness %struct_type.y [template] +// CHECK:STDOUT: %complete_type.3: = complete_type_witness %struct_type.y [template] // CHECK:STDOUT: %Square: type = class_type @Square [template] // CHECK:STDOUT: %Square.elem: type = unbound_element_type %Square, %Shape [template] // CHECK:STDOUT: %GetPosition.type: type = fn_type @GetPosition [template] // CHECK:STDOUT: %GetPosition: %GetPosition.type = struct_value () [template] // CHECK:STDOUT: %struct_type.base.1: type = struct_type {.base: %Shape} [template] -// CHECK:STDOUT: %complete_type.2: = complete_type_witness %struct_type.base.1 [template] +// CHECK:STDOUT: %complete_type.4: = complete_type_witness %struct_type.base.1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -659,15 +633,13 @@ class B { // CHECK:STDOUT: // CHECK:STDOUT: class @Shape { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc5_18.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc5_18.2: type = converted %int.make_type_signed, %.loc5_18.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_16: %Shape.elem = field_decl y, element0 [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.y [template = constants.%complete_type.1] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc5: %Shape.elem = field_decl y, element0 [template] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.y [template = constants.%complete_type.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Shape -// CHECK:STDOUT: .y [private] = %.loc5_16 +// CHECK:STDOUT: .y [private] = %.loc5 // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } // CHECK:STDOUT: @@ -682,15 +654,13 @@ class B { // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Square [template = constants.%Square] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_35.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc11_35.2: type = converted %int.make_type_signed, %.loc11_35.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %self.param: %Square = value_param runtime_param0 // CHECK:STDOUT: %self: %Square = bind_name self, %self.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.base.1 [template = constants.%complete_type.2] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.base.1 [template = constants.%complete_type.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Square @@ -962,19 +932,17 @@ class B { // CHECK:STDOUT: constants { // CHECK:STDOUT: %A: type = class_type @A [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %int_5.1: Core.IntLiteral = int_value 5 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_5.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound: = bound_method %int_5.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_5.2: %i32 = int_value 5 [template] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] -// CHECK:STDOUT: %complete_type.3: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %complete_type.4: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %Internal: type = class_type @Internal [template] // CHECK:STDOUT: %B: type = class_type @B [template] // CHECK:STDOUT: %B.elem: type = unbound_element_type %B, %Internal [template] @@ -983,13 +951,13 @@ class B { // CHECK:STDOUT: %SomeFunc.type: type = fn_type @SomeFunc [template] // CHECK:STDOUT: %SomeFunc: %SomeFunc.type = struct_value () [template] // CHECK:STDOUT: %struct_type.internal.1: type = struct_type {.internal: %Internal} [template] -// CHECK:STDOUT: %complete_type.4: = complete_type_witness %struct_type.internal.1 [template] +// CHECK:STDOUT: %complete_type.5: = complete_type_witness %struct_type.internal.1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -1010,11 +978,9 @@ class B { // CHECK:STDOUT: // CHECK:STDOUT: class @A { // CHECK:STDOUT: %int_32.loc5: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc5: init type = call constants.%Int(%int_32.loc5) [template = constants.%i32] -// CHECK:STDOUT: %.loc5_42.1: type = value_of_initializer %int.make_type_signed.loc5 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_42.2: type = converted %int.make_type_signed.loc5, %.loc5_42.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc5: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_5.loc5: Core.IntLiteral = int_value 5 [template = constants.%int_5.1] -// CHECK:STDOUT: %impl.elem0.loc5: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc5: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc5: = bound_method %int_5.loc5, %impl.elem0.loc5 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn.loc5: = specific_function %Convert.bound.loc5, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc5: init %i32 = call %Convert.specific_fn.loc5(%int_5.loc5) [template = constants.%int_5.2] @@ -1022,18 +988,16 @@ class B { // CHECK:STDOUT: %.loc5_49.2: %i32 = converted %int_5.loc5, %.loc5_49.1 [template = constants.%int_5.2] // CHECK:STDOUT: %SOME_PROTECTED_CONSTANT: %i32 = bind_name SOME_PROTECTED_CONSTANT, %.loc5_49.2 // CHECK:STDOUT: %int_32.loc6: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc6: init type = call constants.%Int(%int_32.loc6) [template = constants.%i32] -// CHECK:STDOUT: %.loc6_38.1: type = value_of_initializer %int.make_type_signed.loc6 [template = constants.%i32] -// CHECK:STDOUT: %.loc6_38.2: type = converted %int.make_type_signed.loc6, %.loc6_38.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc6: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_5.loc6: Core.IntLiteral = int_value 5 [template = constants.%int_5.1] -// CHECK:STDOUT: %impl.elem0.loc6: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc6: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc6: = bound_method %int_5.loc6, %impl.elem0.loc6 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn.loc6: = specific_function %Convert.bound.loc6, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc6: init %i32 = call %Convert.specific_fn.loc6(%int_5.loc6) [template = constants.%int_5.2] // CHECK:STDOUT: %.loc6_45.1: %i32 = value_of_initializer %int.convert_checked.loc6 [template = constants.%int_5.2] // CHECK:STDOUT: %.loc6_45.2: %i32 = converted %int_5.loc6, %.loc6_45.1 [template = constants.%int_5.2] // CHECK:STDOUT: %SOME_PRIVATE_CONSTANT: %i32 = bind_name SOME_PRIVATE_CONSTANT, %.loc6_45.2 -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.3] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%A @@ -1044,18 +1008,16 @@ class B { // CHECK:STDOUT: // CHECK:STDOUT: class @Internal { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc10_36.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc10_36.2: type = converted %int.make_type_signed, %.loc10_36.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_5: Core.IntLiteral = int_value 5 [template = constants.%int_5.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_5, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_5) [template = constants.%int_5.2] // CHECK:STDOUT: %.loc10_43.1: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_5.2] // CHECK:STDOUT: %.loc10_43.2: %i32 = converted %int_5, %.loc10_43.1 [template = constants.%int_5.2] // CHECK:STDOUT: %INTERNAL_CONSTANT: %i32 = bind_name INTERNAL_CONSTANT, %.loc10_43.2 -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.3] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Internal @@ -1071,9 +1033,7 @@ class B { // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc16_13.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc16_13.2: type = converted %int.make_type_signed, %.loc16_13.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } @@ -1085,15 +1045,13 @@ class B { // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%B [template = constants.%B] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc36_32.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc36_32.2: type = converted %int.make_type_signed, %.loc36_32.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %self.param: %B = value_param runtime_param0 // CHECK:STDOUT: %self: %B = bind_name self, %self.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.internal.1 [template = constants.%complete_type.4] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.internal.1 [template = constants.%complete_type.5] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%B @@ -1127,23 +1085,21 @@ class B { // CHECK:STDOUT: constants { // CHECK:STDOUT: %A: type = class_type @A [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %A.elem: type = unbound_element_type %A, %i32 [template] // CHECK:STDOUT: %struct_type.x: type = struct_type {.x: %i32} [template] -// CHECK:STDOUT: %complete_type.1: = complete_type_witness %struct_type.x [template] +// CHECK:STDOUT: %complete_type.3: = complete_type_witness %struct_type.x [template] // CHECK:STDOUT: %B: type = class_type @B [template] // CHECK:STDOUT: %B.elem: type = unbound_element_type %B, %A [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %struct_type.base.1: type = struct_type {.base: %A} [template] -// CHECK:STDOUT: %complete_type.2: = complete_type_witness %struct_type.base.1 [template] +// CHECK:STDOUT: %complete_type.4: = complete_type_witness %struct_type.base.1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -1162,15 +1118,13 @@ class B { // CHECK:STDOUT: // CHECK:STDOUT: class @A { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc5_18.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc5_18.2: type = converted %int.make_type_signed, %.loc5_18.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_16: %A.elem = field_decl x, element0 [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.x [template = constants.%complete_type.1] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc5: %A.elem = field_decl x, element0 [template] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.x [template = constants.%complete_type.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%A -// CHECK:STDOUT: .x [private] = %.loc5_16 +// CHECK:STDOUT: .x [private] = %.loc5 // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1185,7 +1139,7 @@ class B { // CHECK:STDOUT: %self.param: %B = value_param runtime_param0 // CHECK:STDOUT: %self: %B = bind_name self, %self.param // CHECK:STDOUT: } -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.base.1 [template = constants.%complete_type.2] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.base.1 [template = constants.%complete_type.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%B @@ -1208,23 +1162,21 @@ class B { // CHECK:STDOUT: constants { // CHECK:STDOUT: %A: type = class_type @A [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %A.elem: type = unbound_element_type %A, %i32 [template] // CHECK:STDOUT: %struct_type.x: type = struct_type {.x: %i32} [template] -// CHECK:STDOUT: %complete_type.1: = complete_type_witness %struct_type.x [template] +// CHECK:STDOUT: %complete_type.3: = complete_type_witness %struct_type.x [template] // CHECK:STDOUT: %B: type = class_type @B [template] // CHECK:STDOUT: %B.elem: type = unbound_element_type %B, %A [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %struct_type.base.1: type = struct_type {.base: %A} [template] -// CHECK:STDOUT: %complete_type.2: = complete_type_witness %struct_type.base.1 [template] +// CHECK:STDOUT: %complete_type.4: = complete_type_witness %struct_type.base.1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -1243,15 +1195,13 @@ class B { // CHECK:STDOUT: // CHECK:STDOUT: class @A { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc5_20.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc5_20.2: type = converted %int.make_type_signed, %.loc5_20.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_18: %A.elem = field_decl x, element0 [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.x [template = constants.%complete_type.1] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc5: %A.elem = field_decl x, element0 [template] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.x [template = constants.%complete_type.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%A -// CHECK:STDOUT: .x [protected] = %.loc5_18 +// CHECK:STDOUT: .x [protected] = %.loc5 // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1266,7 +1216,7 @@ class B { // CHECK:STDOUT: %self.param: %B = value_param runtime_param0 // CHECK:STDOUT: %self: %B = bind_name self, %self.param // CHECK:STDOUT: } -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.base.1 [template = constants.%complete_type.2] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.base.1 [template = constants.%complete_type.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%B @@ -1280,7 +1230,7 @@ class B { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %self.ref: %B = name_ref self, %self // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%A] -// CHECK:STDOUT: %x.ref: %A.elem = name_ref x, @A.%.loc5_18 [template = @A.%.loc5_18] +// CHECK:STDOUT: %x.ref: %A.elem = name_ref x, @A.%.loc5 [template = @A.%.loc5] // CHECK:STDOUT: %.loc12_9.1: ref %A = class_element_access %self.ref, element0 // CHECK:STDOUT: %.loc12_9.2: ref %A = converted %self.ref, %.loc12_9.1 // CHECK:STDOUT: %.loc12_9.3: ref %i32 = class_element_access %.loc12_9.2, element0 diff --git a/toolchain/check/testdata/class/init.carbon b/toolchain/check/testdata/class/init.carbon index 952972a660ea4..4864e383294a5 100644 --- a/toolchain/check/testdata/class/init.carbon +++ b/toolchain/check/testdata/class/init.carbon @@ -26,14 +26,12 @@ fn MakeReorder(n: i32, next: Class*) -> Class { // CHECK:STDOUT: constants { // CHECK:STDOUT: %Class: type = class_type @Class [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %Class.elem.1: type = unbound_element_type %Class, %i32 [template] // CHECK:STDOUT: %ptr.1: type = ptr_type %Class [template] // CHECK:STDOUT: %Class.elem.2: type = unbound_element_type %Class, %ptr.1 [template] // CHECK:STDOUT: %struct_type.n.next: type = struct_type {.n: %i32, .next: %ptr.1} [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.n.next [template] +// CHECK:STDOUT: %complete_type.3: = complete_type_witness %struct_type.n.next [template] // CHECK:STDOUT: %Make.type: type = fn_type @Make [template] // CHECK:STDOUT: %Make: %Make.type = struct_value () [template] // CHECK:STDOUT: %MakeReorder.type: type = fn_type @MakeReorder [template] @@ -43,7 +41,7 @@ fn MakeReorder(n: i32, next: Class*) -> Class { // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -67,9 +65,7 @@ fn MakeReorder(n: i32, next: Class*) -> Class { // CHECK:STDOUT: %return.param_patt: %Class = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc16_12.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc16_12.2: type = converted %int.make_type_signed, %.loc16_12.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %Class.ref.loc16_23: type = name_ref Class, file.%Class.decl [template = constants.%Class] // CHECK:STDOUT: %ptr: type = ptr_type %Class [template = constants.%ptr.1] // CHECK:STDOUT: %Class.ref.loc16_34: type = name_ref Class, file.%Class.decl [template = constants.%Class] @@ -89,9 +85,7 @@ fn MakeReorder(n: i32, next: Class*) -> Class { // CHECK:STDOUT: %return.param_patt: %Class = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc20_19.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc20_19.2: type = converted %int.make_type_signed, %.loc20_19.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %Class.ref.loc20_30: type = name_ref Class, file.%Class.decl [template = constants.%Class] // CHECK:STDOUT: %ptr: type = ptr_type %Class [template = constants.%ptr.1] // CHECK:STDOUT: %Class.ref.loc20_41: type = name_ref Class, file.%Class.decl [template = constants.%Class] @@ -106,18 +100,16 @@ fn MakeReorder(n: i32, next: Class*) -> Class { // CHECK:STDOUT: // CHECK:STDOUT: class @Class { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc12_10.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc12_10.2: type = converted %int.make_type_signed, %.loc12_10.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc12_8: %Class.elem.1 = field_decl n, element0 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc12: %Class.elem.1 = field_decl n, element0 [template] // CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class] // CHECK:STDOUT: %ptr: type = ptr_type %Class [template = constants.%ptr.1] // CHECK:STDOUT: %.loc13: %Class.elem.2 = field_decl next, element1 [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.n.next [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.n.next [template = constants.%complete_type.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class -// CHECK:STDOUT: .n = %.loc12_8 +// CHECK:STDOUT: .n = %.loc12 // CHECK:STDOUT: .next = %.loc13 // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/init_as.carbon b/toolchain/check/testdata/class/init_as.carbon index ff35a2ba27e7d..ae17bfe7c386e 100644 --- a/toolchain/check/testdata/class/init_as.carbon +++ b/toolchain/check/testdata/class/init_as.carbon @@ -22,25 +22,23 @@ fn F() -> i32 { // CHECK:STDOUT: constants { // CHECK:STDOUT: %Class: type = class_type @Class [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %Class.elem: type = unbound_element_type %Class, %i32 [template] // CHECK:STDOUT: %struct_type.a.b.1: type = struct_type {.a: %i32, .b: %i32} [template] -// CHECK:STDOUT: %complete_type.1: = complete_type_witness %struct_type.a.b.1 [template] +// CHECK:STDOUT: %complete_type.3: = complete_type_witness %struct_type.a.b.1 [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %struct_type.a.b.2: type = struct_type {.a: Core.IntLiteral, .b: Core.IntLiteral} [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] // CHECK:STDOUT: %Class.val: %Class = struct_value (%int_1.2, %int_2.2) [template] @@ -49,7 +47,7 @@ fn F() -> i32 { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -68,9 +66,7 @@ fn F() -> i32 { // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc16_11.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc16_11.2: type = converted %int.make_type_signed, %.loc16_11.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } @@ -78,21 +74,17 @@ fn F() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: class @Class { // CHECK:STDOUT: %int_32.loc12: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc12: init type = call constants.%Int(%int_32.loc12) [template = constants.%i32] -// CHECK:STDOUT: %.loc12_10.1: type = value_of_initializer %int.make_type_signed.loc12 [template = constants.%i32] -// CHECK:STDOUT: %.loc12_10.2: type = converted %int.make_type_signed.loc12, %.loc12_10.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc12_8: %Class.elem = field_decl a, element0 [template] +// CHECK:STDOUT: %i32.loc12: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc12: %Class.elem = field_decl a, element0 [template] // CHECK:STDOUT: %int_32.loc13: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc13: init type = call constants.%Int(%int_32.loc13) [template = constants.%i32] -// CHECK:STDOUT: %.loc13_10.1: type = value_of_initializer %int.make_type_signed.loc13 [template = constants.%i32] -// CHECK:STDOUT: %.loc13_10.2: type = converted %int.make_type_signed.loc13, %.loc13_10.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc13_8: %Class.elem = field_decl b, element1 [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a.b.1 [template = constants.%complete_type.1] +// CHECK:STDOUT: %i32.loc13: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc13: %Class.elem = field_decl b, element1 [template] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a.b.1 [template = constants.%complete_type.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class -// CHECK:STDOUT: .a = %.loc12_8 -// CHECK:STDOUT: .b = %.loc13_8 +// CHECK:STDOUT: .a = %.loc12 +// CHECK:STDOUT: .b = %.loc13 // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } // CHECK:STDOUT: @@ -102,7 +94,7 @@ fn F() -> i32 { // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %.loc17_26.1: %struct_type.a.b.2 = struct_literal (%int_1, %int_2) // CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class] -// CHECK:STDOUT: %impl.elem0.loc17_26.1: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc17_26.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc17_26.1: = bound_method %int_1, %impl.elem0.loc17_26.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc17_26.1: = specific_function %Convert.bound.loc17_26.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc17_26.1: init %i32 = call %Convert.specific_fn.loc17_26.1(%int_1) [template = constants.%int_1.2] @@ -110,7 +102,7 @@ fn F() -> i32 { // CHECK:STDOUT: %.loc17_26.3: ref %Class = temporary_storage // CHECK:STDOUT: %.loc17_26.4: ref %i32 = class_element_access %.loc17_26.3, element0 // CHECK:STDOUT: %.loc17_26.5: init %i32 = initialize_from %.loc17_26.2 to %.loc17_26.4 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc17_26.2: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc17_26.2: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc17_26.2: = bound_method %int_2, %impl.elem0.loc17_26.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc17_26.2: = specific_function %Convert.bound.loc17_26.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc17_26.2: init %i32 = call %Convert.specific_fn.loc17_26.2(%int_2) [template = constants.%int_2.2] @@ -120,7 +112,7 @@ fn F() -> i32 { // CHECK:STDOUT: %.loc17_26.9: init %Class = class_init (%.loc17_26.5, %.loc17_26.8), %.loc17_26.3 [template = constants.%Class.val] // CHECK:STDOUT: %.loc17_26.10: ref %Class = temporary %.loc17_26.3, %.loc17_26.9 // CHECK:STDOUT: %.loc17_28: ref %Class = converted %.loc17_26.1, %.loc17_26.10 -// CHECK:STDOUT: %a.ref: %Class.elem = name_ref a, @Class.%.loc12_8 [template = @Class.%.loc12_8] +// CHECK:STDOUT: %a.ref: %Class.elem = name_ref a, @Class.%.loc12 [template = @Class.%.loc12] // CHECK:STDOUT: %.loc17_37.1: ref %i32 = class_element_access %.loc17_28, element0 // CHECK:STDOUT: %.loc17_37.2: %i32 = bind_value %.loc17_37.1 // CHECK:STDOUT: return %.loc17_37.2 diff --git a/toolchain/check/testdata/class/init_nested.carbon b/toolchain/check/testdata/class/init_nested.carbon index bda2de2154cab..921120aabeabf 100644 --- a/toolchain/check/testdata/class/init_nested.carbon +++ b/toolchain/check/testdata/class/init_nested.carbon @@ -29,25 +29,23 @@ fn MakeOuter() -> Outer { // CHECK:STDOUT: constants { // CHECK:STDOUT: %Inner: type = class_type @Inner [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %Inner.elem: type = unbound_element_type %Inner, %i32 [template] // CHECK:STDOUT: %struct_type.a.b: type = struct_type {.a: %i32, .b: %i32} [template] -// CHECK:STDOUT: %complete_type.1: = complete_type_witness %struct_type.a.b [template] +// CHECK:STDOUT: %complete_type.3: = complete_type_witness %struct_type.a.b [template] // CHECK:STDOUT: %MakeInner.type: type = fn_type @MakeInner [template] // CHECK:STDOUT: %MakeInner: %MakeInner.type = struct_value () [template] // CHECK:STDOUT: %Outer: type = class_type @Outer [template] // CHECK:STDOUT: %Outer.elem: type = unbound_element_type %Outer, %Inner [template] // CHECK:STDOUT: %struct_type.c.d.1: type = struct_type {.c: %Inner, .d: %Inner} [template] -// CHECK:STDOUT: %complete_type.2: = complete_type_witness %struct_type.c.d.1 [template] +// CHECK:STDOUT: %complete_type.4: = complete_type_witness %struct_type.c.d.1 [template] // CHECK:STDOUT: %MakeOuter.type: type = fn_type @MakeOuter [template] // CHECK:STDOUT: %MakeOuter: %MakeOuter.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -84,21 +82,17 @@ fn MakeOuter() -> Outer { // CHECK:STDOUT: // CHECK:STDOUT: class @Inner { // CHECK:STDOUT: %int_32.loc12: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc12: init type = call constants.%Int(%int_32.loc12) [template = constants.%i32] -// CHECK:STDOUT: %.loc12_10.1: type = value_of_initializer %int.make_type_signed.loc12 [template = constants.%i32] -// CHECK:STDOUT: %.loc12_10.2: type = converted %int.make_type_signed.loc12, %.loc12_10.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc12_8: %Inner.elem = field_decl a, element0 [template] +// CHECK:STDOUT: %i32.loc12: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc12: %Inner.elem = field_decl a, element0 [template] // CHECK:STDOUT: %int_32.loc13: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc13: init type = call constants.%Int(%int_32.loc13) [template = constants.%i32] -// CHECK:STDOUT: %.loc13_10.1: type = value_of_initializer %int.make_type_signed.loc13 [template = constants.%i32] -// CHECK:STDOUT: %.loc13_10.2: type = converted %int.make_type_signed.loc13, %.loc13_10.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc13_8: %Inner.elem = field_decl b, element1 [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a.b [template = constants.%complete_type.1] +// CHECK:STDOUT: %i32.loc13: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc13: %Inner.elem = field_decl b, element1 [template] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a.b [template = constants.%complete_type.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Inner -// CHECK:STDOUT: .a = %.loc12_8 -// CHECK:STDOUT: .b = %.loc13_8 +// CHECK:STDOUT: .a = %.loc12 +// CHECK:STDOUT: .b = %.loc13 // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } // CHECK:STDOUT: @@ -107,7 +101,7 @@ fn MakeOuter() -> Outer { // CHECK:STDOUT: %.loc19: %Outer.elem = field_decl c, element0 [template] // CHECK:STDOUT: %Inner.ref.loc20: type = name_ref Inner, file.%Inner.decl [template = constants.%Inner] // CHECK:STDOUT: %.loc20: %Outer.elem = field_decl d, element1 [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.c.d.1 [template = constants.%complete_type.2] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.c.d.1 [template = constants.%complete_type.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Outer diff --git a/toolchain/check/testdata/class/method.carbon b/toolchain/check/testdata/class/method.carbon index 44cac1cd71851..da12f212d428e 100644 --- a/toolchain/check/testdata/class/method.carbon +++ b/toolchain/check/testdata/class/method.carbon @@ -63,9 +63,7 @@ fn CallGOnInitializingExpr() -> i32 { // CHECK:STDOUT: constants { // CHECK:STDOUT: %Class: type = class_type @Class [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %ptr.1: type = ptr_type %Class [template] @@ -73,7 +71,7 @@ fn CallGOnInitializingExpr() -> i32 { // CHECK:STDOUT: %G: %G.type = struct_value () [template] // CHECK:STDOUT: %Class.elem: type = unbound_element_type %Class, %i32 [template] // CHECK:STDOUT: %struct_type.k.1: type = struct_type {.k: %i32} [template] -// CHECK:STDOUT: %complete_type.1: = complete_type_witness %struct_type.k.1 [template] +// CHECK:STDOUT: %complete_type.3: = complete_type_witness %struct_type.k.1 [template] // CHECK:STDOUT: %Call.type: type = fn_type @Call [template] // CHECK:STDOUT: %Call: %Call.type = struct_value () [template] // CHECK:STDOUT: %CallAlias.type: type = fn_type @CallAlias [template] @@ -83,10 +81,10 @@ fn CallGOnInitializingExpr() -> i32 { // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %struct_type.k.2: type = struct_type {.k: Core.IntLiteral} [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] // CHECK:STDOUT: %Class.val: %Class = struct_value (%int_1.2) [template] @@ -107,7 +105,7 @@ fn CallGOnInitializingExpr() -> i32 { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -137,9 +135,7 @@ fn CallGOnInitializingExpr() -> i32 { // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref.loc20: type = name_ref Self, constants.%Class [template = constants.%Class] // CHECK:STDOUT: %int_32.loc20: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc20: init type = call constants.%Int(%int_32.loc20) [template = constants.%i32] -// CHECK:STDOUT: %.loc20_29.1: type = value_of_initializer %int.make_type_signed.loc20 [template = constants.%i32] -// CHECK:STDOUT: %.loc20_29.2: type = converted %int.make_type_signed.loc20, %.loc20_29.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc20: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %self.param.loc20: %Class = value_param runtime_param0 // CHECK:STDOUT: %self.loc20: %Class = bind_name self, %self.param.loc20 // CHECK:STDOUT: %return.param.loc20: ref %i32 = out_param runtime_param1 @@ -153,9 +149,7 @@ fn CallGOnInitializingExpr() -> i32 { // CHECK:STDOUT: } { // CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc24_22.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc24_22.2: type = converted %int.make_type_signed, %.loc24_22.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %c.param: %Class = value_param runtime_param0 // CHECK:STDOUT: %c: %Class = bind_name c, %c.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 @@ -169,9 +163,7 @@ fn CallGOnInitializingExpr() -> i32 { // CHECK:STDOUT: } { // CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc30_27.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc30_27.2: type = converted %int.make_type_signed, %.loc30_27.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %c.param: %Class = value_param runtime_param0 // CHECK:STDOUT: %c: %Class = bind_name c, %c.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 @@ -182,9 +174,7 @@ fn CallGOnInitializingExpr() -> i32 { // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc34_32.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc34_32.2: type = converted %int.make_type_signed, %.loc34_32.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } @@ -193,9 +183,7 @@ fn CallGOnInitializingExpr() -> i32 { // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc38_22.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc38_22.2: type = converted %int.make_type_signed, %.loc38_22.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } @@ -208,9 +196,7 @@ fn CallGOnInitializingExpr() -> i32 { // CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class] // CHECK:STDOUT: %ptr: type = ptr_type %Class [template = constants.%ptr.1] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc43_38.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc43_38.2: type = converted %int.make_type_signed, %.loc43_38.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %p.param: %ptr.1 = value_param runtime_param0 // CHECK:STDOUT: %p: %ptr.1 = bind_name p, %p.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 @@ -225,9 +211,7 @@ fn CallGOnInitializingExpr() -> i32 { // CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class] // CHECK:STDOUT: %ptr: type = ptr_type %Class [template = constants.%ptr.1] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc47_38.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc47_38.2: type = converted %int.make_type_signed, %.loc47_38.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %p.param: %ptr.1 = value_param runtime_param0 // CHECK:STDOUT: %p: %ptr.1 = bind_name p, %p.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 @@ -246,9 +230,7 @@ fn CallGOnInitializingExpr() -> i32 { // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc53_33.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc53_33.2: type = converted %int.make_type_signed, %.loc53_33.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } @@ -257,9 +239,7 @@ fn CallGOnInitializingExpr() -> i32 { // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc57_33.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc57_33.2: type = converted %int.make_type_signed, %.loc57_33.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } @@ -274,9 +254,7 @@ fn CallGOnInitializingExpr() -> i32 { // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref.loc12: type = name_ref Self, constants.%Class [template = constants.%Class] // CHECK:STDOUT: %int_32.loc12: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc12: init type = call constants.%Int(%int_32.loc12) [template = constants.%i32] -// CHECK:STDOUT: %.loc12_25.1: type = value_of_initializer %int.make_type_signed.loc12 [template = constants.%i32] -// CHECK:STDOUT: %.loc12_25.2: type = converted %int.make_type_signed.loc12, %.loc12_25.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc12: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %self.param.loc12: %Class = value_param runtime_param0 // CHECK:STDOUT: %self.loc12: %Class = bind_name self, %self.param.loc12 // CHECK:STDOUT: %return.param.loc12: ref %i32 = out_param runtime_param1 @@ -285,16 +263,14 @@ fn CallGOnInitializingExpr() -> i32 { // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %self.patt: %ptr.1 = binding_pattern self // CHECK:STDOUT: %self.param_patt: %ptr.1 = value_param_pattern %self.patt, runtime_param0 -// CHECK:STDOUT: %.loc13_8: auto = addr_pattern %self.param_patt +// CHECK:STDOUT: %.loc13: auto = addr_pattern %self.param_patt // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Class [template = constants.%Class] // CHECK:STDOUT: %ptr: type = ptr_type %Class [template = constants.%ptr.1] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc13_31.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc13_31.2: type = converted %int.make_type_signed, %.loc13_31.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %self.param: %ptr.1 = value_param runtime_param0 // CHECK:STDOUT: %self: %ptr.1 = bind_name self, %self.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 @@ -303,25 +279,23 @@ fn CallGOnInitializingExpr() -> i32 { // CHECK:STDOUT: %F.ref: %F.type = name_ref F, %F.decl [template = constants.%F] // CHECK:STDOUT: %A: %F.type = bind_alias A, %F.decl [template = constants.%F] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc17_10.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc17_10.2: type = converted %int.make_type_signed, %.loc17_10.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc17_8: %Class.elem = field_decl k, element0 [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.k.1 [template = constants.%complete_type.1] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc17: %Class.elem = field_decl k, element0 [template] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.k.1 [template = constants.%complete_type.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: .G = %G.decl // CHECK:STDOUT: .A = %A -// CHECK:STDOUT: .k = %.loc17_8 +// CHECK:STDOUT: .k = %.loc17 // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F[%self.param_patt: %Class]() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %self.ref: %Class = name_ref self, %self.loc20 -// CHECK:STDOUT: %k.ref: %Class.elem = name_ref k, @Class.%.loc17_8 [template = @Class.%.loc17_8] +// CHECK:STDOUT: %k.ref: %Class.elem = name_ref k, @Class.%.loc17 [template = @Class.%.loc17] // CHECK:STDOUT: %.loc21_14.1: ref %i32 = class_element_access %self.ref, element0 // CHECK:STDOUT: %.loc21_14.2: %i32 = bind_value %.loc21_14.1 // CHECK:STDOUT: return %.loc21_14.2 @@ -356,7 +330,7 @@ fn CallGOnInitializingExpr() -> i32 { // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %.loc35_18.1: %struct_type.k.2 = struct_literal (%int_1) // CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_1) [template = constants.%int_1.2] diff --git a/toolchain/check/testdata/class/nested_name.carbon b/toolchain/check/testdata/class/nested_name.carbon index 370e751d5c197..3c30950e6d657 100644 --- a/toolchain/check/testdata/class/nested_name.carbon +++ b/toolchain/check/testdata/class/nested_name.carbon @@ -28,14 +28,12 @@ fn G(o: Outer) { // CHECK:STDOUT: %Outer: type = class_type @Outer [template] // CHECK:STDOUT: %Inner: type = class_type @Inner [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %Inner.elem: type = unbound_element_type %Inner, %i32 [template] // CHECK:STDOUT: %struct_type.n: type = struct_type {.n: %i32} [template] -// CHECK:STDOUT: %complete_type.1: = complete_type_witness %struct_type.n [template] +// CHECK:STDOUT: %complete_type.3: = complete_type_witness %struct_type.n [template] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] -// CHECK:STDOUT: %complete_type.2: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %complete_type.4: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] @@ -44,7 +42,7 @@ fn G(o: Outer) { // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -68,9 +66,7 @@ fn G(o: Outer) { // CHECK:STDOUT: %Outer.ref: type = name_ref Outer, file.%Outer.decl [template = constants.%Outer] // CHECK:STDOUT: %Inner.ref: type = name_ref Inner, @Outer.%Inner.decl [template = constants.%Inner] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc17_26.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc17_26.2: type = converted %int.make_type_signed, %.loc17_26.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %oi.param: %Inner = value_param runtime_param0 // CHECK:STDOUT: %oi: %Inner = bind_name oi, %oi.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 @@ -88,7 +84,7 @@ fn G(o: Outer) { // CHECK:STDOUT: // CHECK:STDOUT: class @Outer { // CHECK:STDOUT: %Inner.decl: type = class_decl @Inner [template = constants.%Inner] {} {} -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.2] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Outer @@ -98,22 +94,20 @@ fn G(o: Outer) { // CHECK:STDOUT: // CHECK:STDOUT: class @Inner { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc13_12.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc13_12.2: type = converted %int.make_type_signed, %.loc13_12.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc13_10: %Inner.elem = field_decl n, element0 [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.n [template = constants.%complete_type.1] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc13: %Inner.elem = field_decl n, element0 [template] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.n [template = constants.%complete_type.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Inner -// CHECK:STDOUT: .n = %.loc13_10 +// CHECK:STDOUT: .n = %.loc13 // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F(%oi.param_patt: %Inner) -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %oi.ref: %Inner = name_ref oi, %oi -// CHECK:STDOUT: %n.ref: %Inner.elem = name_ref n, @Inner.%.loc13_10 [template = @Inner.%.loc13_10] +// CHECK:STDOUT: %n.ref: %Inner.elem = name_ref n, @Inner.%.loc13 [template = @Inner.%.loc13] // CHECK:STDOUT: %.loc18_12.1: ref %i32 = class_element_access %oi.ref, element0 // CHECK:STDOUT: %.loc18_12.2: %i32 = bind_value %.loc18_12.1 // CHECK:STDOUT: return %.loc18_12.2 diff --git a/toolchain/check/testdata/class/raw_self.carbon b/toolchain/check/testdata/class/raw_self.carbon index d44e54661030d..9c884c627548e 100644 --- a/toolchain/check/testdata/class/raw_self.carbon +++ b/toolchain/check/testdata/class/raw_self.carbon @@ -28,9 +28,7 @@ fn Class.G[self: Self](r#self: i32) -> (i32, i32) { // CHECK:STDOUT: %Class: type = class_type @Class [template] // CHECK:STDOUT: %ptr.1: type = ptr_type %Class [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (type, type) [template] @@ -39,12 +37,12 @@ fn Class.G[self: Self](r#self: i32) -> (i32, i32) { // CHECK:STDOUT: %G: %G.type = struct_value () [template] // CHECK:STDOUT: %Class.elem: type = unbound_element_type %Class, %i32 [template] // CHECK:STDOUT: %struct_type.n: type = struct_type {.n: %i32} [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.n [template] +// CHECK:STDOUT: %complete_type.3: = complete_type_witness %struct_type.n [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -60,16 +58,14 @@ fn Class.G[self: Self](r#self: i32) -> (i32, i32) { // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %self.patt.loc17_17: %ptr.1 = binding_pattern self // CHECK:STDOUT: %self.param_patt.loc17_21: %ptr.1 = value_param_pattern %self.patt.loc17_17, runtime_param0 -// CHECK:STDOUT: %.loc17_12: auto = addr_pattern %self.param_patt.loc17_21 +// CHECK:STDOUT: %.loc17: auto = addr_pattern %self.param_patt.loc17_21 // CHECK:STDOUT: %self.patt.loc17_30: %i32 = binding_pattern r#self // CHECK:STDOUT: %self.param_patt.loc17_36: %i32 = value_param_pattern %self.patt.loc17_30, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref.loc17: type = name_ref Self, constants.%Class [template = constants.%Class] // CHECK:STDOUT: %ptr.loc17: type = ptr_type %Class [template = constants.%ptr.1] // CHECK:STDOUT: %int_32.loc17: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc17: init type = call constants.%Int(%int_32.loc17) [template = constants.%i32] -// CHECK:STDOUT: %.loc17_38.1: type = value_of_initializer %int.make_type_signed.loc17 [template = constants.%i32] -// CHECK:STDOUT: %.loc17_38.2: type = converted %int.make_type_signed.loc17, %.loc17_38.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %self.param.loc17_21: %ptr.1 = value_param runtime_param0 // CHECK:STDOUT: %self.loc17_17: %ptr.1 = bind_name self, %self.param.loc17_21 // CHECK:STDOUT: %self.param.loc17_36: %i32 = value_param runtime_param1 @@ -85,19 +81,13 @@ fn Class.G[self: Self](r#self: i32) -> (i32, i32) { // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref.loc21: type = name_ref Self, constants.%Class [template = constants.%Class] // CHECK:STDOUT: %int_32.loc21_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc21_32: init type = call constants.%Int(%int_32.loc21_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc21_32.1: type = value_of_initializer %int.make_type_signed.loc21_32 [template = constants.%i32] -// CHECK:STDOUT: %.loc21_32.2: type = converted %int.make_type_signed.loc21_32, %.loc21_32.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc21_32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc21_41: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc21_41: init type = call constants.%Int(%int_32.loc21_41) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc21_41: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc21_46: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc21_46: init type = call constants.%Int(%int_32.loc21_46) [template = constants.%i32] -// CHECK:STDOUT: %.loc21_49.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc21_41, %int.make_type_signed.loc21_46) -// CHECK:STDOUT: %.loc21_49.2: type = value_of_initializer %int.make_type_signed.loc21_41 [template = constants.%i32] -// CHECK:STDOUT: %.loc21_49.3: type = converted %int.make_type_signed.loc21_41, %.loc21_49.2 [template = constants.%i32] -// CHECK:STDOUT: %.loc21_49.4: type = value_of_initializer %int.make_type_signed.loc21_46 [template = constants.%i32] -// CHECK:STDOUT: %.loc21_49.5: type = converted %int.make_type_signed.loc21_46, %.loc21_49.4 [template = constants.%i32] -// CHECK:STDOUT: %.loc21_49.6: type = converted %.loc21_49.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] +// CHECK:STDOUT: %i32.loc21_46: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc21_49.1: %tuple.type.1 = tuple_literal (%i32.loc21_41, %i32.loc21_46) +// CHECK:STDOUT: %.loc21_49.2: type = converted %.loc21_49.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %self.param.loc21_16: %Class = value_param runtime_param0 // CHECK:STDOUT: %self.loc21_12: %Class = bind_name self, %self.param.loc21_16 // CHECK:STDOUT: %self.param.loc21_30: %i32 = value_param runtime_param1 @@ -111,16 +101,14 @@ fn Class.G[self: Self](r#self: i32) -> (i32, i32) { // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %self.patt.loc17_17: %ptr.1 = binding_pattern self // CHECK:STDOUT: %self.param_patt.loc17_21: %ptr.1 = value_param_pattern %self.patt.loc17_17, runtime_param0 -// CHECK:STDOUT: %.loc17_12: auto = addr_pattern %self.param_patt.loc17_21 +// CHECK:STDOUT: %.loc17: auto = addr_pattern %self.param_patt.loc17_21 // CHECK:STDOUT: %self.patt.loc17_30: %i32 = binding_pattern r#self // CHECK:STDOUT: %self.param_patt.loc17_36: %i32 = value_param_pattern %self.patt.loc17_30, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref.loc12: type = name_ref Self, constants.%Class [template = constants.%Class] // CHECK:STDOUT: %ptr.loc12: type = ptr_type %Class [template = constants.%ptr.1] // CHECK:STDOUT: %int_32.loc12: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc12: init type = call constants.%Int(%int_32.loc12) [template = constants.%i32] -// CHECK:STDOUT: %.loc12_34.1: type = value_of_initializer %int.make_type_signed.loc12 [template = constants.%i32] -// CHECK:STDOUT: %.loc12_34.2: type = converted %int.make_type_signed.loc12, %.loc12_34.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc12: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %self.param.loc12_17: %ptr.1 = value_param runtime_param0 // CHECK:STDOUT: %self.loc12_13: %ptr.1 = bind_name self, %self.param.loc12_17 // CHECK:STDOUT: %self.param.loc12_32: %i32 = value_param runtime_param1 @@ -136,19 +124,13 @@ fn Class.G[self: Self](r#self: i32) -> (i32, i32) { // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref.loc13: type = name_ref Self, constants.%Class [template = constants.%Class] // CHECK:STDOUT: %int_32.loc13_28: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc13_28: init type = call constants.%Int(%int_32.loc13_28) [template = constants.%i32] -// CHECK:STDOUT: %.loc13_28.1: type = value_of_initializer %int.make_type_signed.loc13_28 [template = constants.%i32] -// CHECK:STDOUT: %.loc13_28.2: type = converted %int.make_type_signed.loc13_28, %.loc13_28.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc13_28: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc13_37: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc13_37: init type = call constants.%Int(%int_32.loc13_37) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc13_37: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc13_42: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc13_42: init type = call constants.%Int(%int_32.loc13_42) [template = constants.%i32] -// CHECK:STDOUT: %.loc13_45.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc13_37, %int.make_type_signed.loc13_42) -// CHECK:STDOUT: %.loc13_45.2: type = value_of_initializer %int.make_type_signed.loc13_37 [template = constants.%i32] -// CHECK:STDOUT: %.loc13_45.3: type = converted %int.make_type_signed.loc13_37, %.loc13_45.2 [template = constants.%i32] -// CHECK:STDOUT: %.loc13_45.4: type = value_of_initializer %int.make_type_signed.loc13_42 [template = constants.%i32] -// CHECK:STDOUT: %.loc13_45.5: type = converted %int.make_type_signed.loc13_42, %.loc13_45.4 [template = constants.%i32] -// CHECK:STDOUT: %.loc13_45.6: type = converted %.loc13_45.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] +// CHECK:STDOUT: %i32.loc13_42: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc13_45.1: %tuple.type.1 = tuple_literal (%i32.loc13_37, %i32.loc13_42) +// CHECK:STDOUT: %.loc13_45.2: type = converted %.loc13_45.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %self.param.loc13_12: %Class = value_param runtime_param0 // CHECK:STDOUT: %self.loc13_8: %Class = bind_name self, %self.param.loc13_12 // CHECK:STDOUT: %self.param.loc13_26: %i32 = value_param runtime_param1 @@ -157,17 +139,15 @@ fn Class.G[self: Self](r#self: i32) -> (i32, i32) { // CHECK:STDOUT: %return.loc13: ref %tuple.type.2 = return_slot %return.param.loc13 // CHECK:STDOUT: } // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc14_10.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc14_10.2: type = converted %int.make_type_signed, %.loc14_10.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc14_8: %Class.elem = field_decl n, element0 [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.n [template = constants.%complete_type] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc14: %Class.elem = field_decl n, element0 [template] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.n [template = constants.%complete_type.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: .G = %G.decl -// CHECK:STDOUT: .n = %.loc14_8 +// CHECK:STDOUT: .n = %.loc14 // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } // CHECK:STDOUT: @@ -175,7 +155,7 @@ fn Class.G[self: Self](r#self: i32) -> (i32, i32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %self.ref.loc18_5: %ptr.1 = name_ref self, %self.loc17_17 // CHECK:STDOUT: %.loc18_4: ref %Class = deref %self.ref.loc18_5 -// CHECK:STDOUT: %n.ref: %Class.elem = name_ref n, @Class.%.loc14_8 [template = @Class.%.loc14_8] +// CHECK:STDOUT: %n.ref: %Class.elem = name_ref n, @Class.%.loc14 [template = @Class.%.loc14] // CHECK:STDOUT: %.loc18_10: ref %i32 = class_element_access %.loc18_4, element0 // CHECK:STDOUT: %self.ref.loc18_15: %i32 = name_ref r#self, %self.loc17_30 // CHECK:STDOUT: assign %.loc18_10, %self.ref.loc18_15 @@ -185,7 +165,7 @@ fn Class.G[self: Self](r#self: i32) -> (i32, i32) { // CHECK:STDOUT: fn @G[%self.param_patt.loc21_16: %Class](%self.param_patt.loc21_30: %i32) -> %return.param_patt: %tuple.type.2 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %self.ref.loc22_11: %Class = name_ref self, %self.loc21_12 -// CHECK:STDOUT: %n.ref: %Class.elem = name_ref n, @Class.%.loc14_8 [template = @Class.%.loc14_8] +// CHECK:STDOUT: %n.ref: %Class.elem = name_ref n, @Class.%.loc14 [template = @Class.%.loc14] // CHECK:STDOUT: %.loc22_15.1: ref %i32 = class_element_access %self.ref.loc22_11, element0 // CHECK:STDOUT: %.loc22_15.2: %i32 = bind_value %.loc22_15.1 // CHECK:STDOUT: %self.ref.loc22_19: %i32 = name_ref r#self, %self.loc21_24 diff --git a/toolchain/check/testdata/class/reenter_scope.carbon b/toolchain/check/testdata/class/reenter_scope.carbon index 6accdd6456f37..cd7ee591a9154 100644 --- a/toolchain/check/testdata/class/reenter_scope.carbon +++ b/toolchain/check/testdata/class/reenter_scope.carbon @@ -23,20 +23,18 @@ fn Class.F() -> i32 { // CHECK:STDOUT: constants { // CHECK:STDOUT: %Class: type = class_type @Class [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %complete_type.2: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -54,9 +52,7 @@ fn Class.F() -> i32 { // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc16: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc16: init type = call constants.%Int(%int_32.loc16) [template = constants.%i32] -// CHECK:STDOUT: %.loc16_17.1: type = value_of_initializer %int.make_type_signed.loc16 [template = constants.%i32] -// CHECK:STDOUT: %.loc16_17.2: type = converted %int.make_type_signed.loc16, %.loc16_17.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc16: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %return.param.loc16: ref %i32 = out_param runtime_param0 // CHECK:STDOUT: %return.loc16: ref %i32 = return_slot %return.param.loc16 // CHECK:STDOUT: } @@ -68,9 +64,7 @@ fn Class.F() -> i32 { // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc12: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc12: init type = call constants.%Int(%int_32.loc12) [template = constants.%i32] -// CHECK:STDOUT: %.loc12_13.1: type = value_of_initializer %int.make_type_signed.loc12 [template = constants.%i32] -// CHECK:STDOUT: %.loc12_13.2: type = converted %int.make_type_signed.loc12, %.loc12_13.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc12: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %return.param.loc12: ref %i32 = out_param runtime_param0 // CHECK:STDOUT: %return.loc12: ref %i32 = return_slot %return.param.loc12 // CHECK:STDOUT: } @@ -79,13 +73,11 @@ fn Class.F() -> i32 { // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc13_13.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc13_13.2: type = converted %int.make_type_signed, %.loc13_13.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.2] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class diff --git a/toolchain/check/testdata/class/reorder.carbon b/toolchain/check/testdata/class/reorder.carbon index 63c4e2b18a2dd..2bebd570b3472 100644 --- a/toolchain/check/testdata/class/reorder.carbon +++ b/toolchain/check/testdata/class/reorder.carbon @@ -23,21 +23,19 @@ class Class { // CHECK:STDOUT: constants { // CHECK:STDOUT: %Class: type = class_type @Class [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] -// CHECK:STDOUT: %complete_type.1: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %complete_type.2: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] // CHECK:STDOUT: } @@ -45,7 +43,7 @@ class Class { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -66,9 +64,7 @@ class Class { // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc12_13.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc12_13.2: type = converted %int.make_type_signed, %.loc12_13.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } @@ -77,13 +73,11 @@ class Class { // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc16_13.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc16_13.2: type = converted %int.make_type_signed, %.loc16_13.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.2] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class @@ -105,7 +99,7 @@ class Class { // CHECK:STDOUT: fn @F() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_1) [template = constants.%int_1.2] diff --git a/toolchain/check/testdata/class/reorder_qualified.carbon b/toolchain/check/testdata/class/reorder_qualified.carbon index 4332d925468fe..1e751bccc03c1 100644 --- a/toolchain/check/testdata/class/reorder_qualified.carbon +++ b/toolchain/check/testdata/class/reorder_qualified.carbon @@ -56,12 +56,10 @@ class A { // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template] // CHECK:STDOUT: %BF: %BF.type = struct_value () [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %B.elem: type = unbound_element_type %B, %i32 [template] // CHECK:STDOUT: %struct_type.b.1: type = struct_type {.b: %i32} [template] -// CHECK:STDOUT: %complete_type.1: = complete_type_witness %struct_type.b.1 [template] +// CHECK:STDOUT: %complete_type.3: = complete_type_witness %struct_type.b.1 [template] // CHECK:STDOUT: %D: type = class_type @D [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] @@ -69,42 +67,42 @@ class A { // CHECK:STDOUT: %DF: %DF.type = struct_value () [template] // CHECK:STDOUT: %D.elem: type = unbound_element_type %D, %i32 [template] // CHECK:STDOUT: %struct_type.d.1: type = struct_type {.d: %i32} [template] -// CHECK:STDOUT: %complete_type.2: = complete_type_witness %struct_type.d.1 [template] +// CHECK:STDOUT: %complete_type.4: = complete_type_witness %struct_type.d.1 [template] // CHECK:STDOUT: %CF.type: type = fn_type @CF [template] // CHECK:STDOUT: %CF: %CF.type = struct_value () [template] // CHECK:STDOUT: %C.elem: type = unbound_element_type %C, %i32 [template] // CHECK:STDOUT: %struct_type.c.1: type = struct_type {.c: %i32} [template] -// CHECK:STDOUT: %complete_type.3: = complete_type_witness %struct_type.c.1 [template] +// CHECK:STDOUT: %complete_type.5: = complete_type_witness %struct_type.c.1 [template] // CHECK:STDOUT: %AF.type: type = fn_type @AF [template] // CHECK:STDOUT: %AF: %AF.type = struct_value () [template] // CHECK:STDOUT: %A.elem: type = unbound_element_type %A, %i32 [template] // CHECK:STDOUT: %struct_type.a.1: type = struct_type {.a: %i32} [template] -// CHECK:STDOUT: %complete_type.4: = complete_type_witness %struct_type.a.1 [template] +// CHECK:STDOUT: %complete_type.6: = complete_type_witness %struct_type.a.1 [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %struct_type.a.2: type = struct_type {.a: Core.IntLiteral} [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] // CHECK:STDOUT: %A.val: %A = struct_value (%int_1.2) [template] // CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %struct_type.b.2: type = struct_type {.b: Core.IntLiteral} [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] // CHECK:STDOUT: %B.val: %B = struct_value (%int_2.2) [template] // CHECK:STDOUT: %int_3.1: Core.IntLiteral = int_value 3 [template] // CHECK:STDOUT: %struct_type.c.2: type = struct_type {.c: Core.IntLiteral} [template] -// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_3.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_3.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_3.2: %i32 = int_value 3 [template] // CHECK:STDOUT: %C.val: %C = struct_value (%int_3.2) [template] // CHECK:STDOUT: %int_4.1: Core.IntLiteral = int_value 4 [template] // CHECK:STDOUT: %struct_type.d.2: type = struct_type {.d: Core.IntLiteral} [template] -// CHECK:STDOUT: %Convert.bound.4: = bound_method %int_4.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.4: = bound_method %int_4.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.4: = specific_function %Convert.bound.4, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_4.2: %i32 = int_value 4 [template] // CHECK:STDOUT: %D.val: %D = struct_value (%int_4.2) [template] @@ -113,7 +111,7 @@ class A { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -133,17 +131,15 @@ class A { // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: %AF.decl: %AF.type = fn_decl @AF [template = constants.%AF] {} {} // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc46_10.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc46_10.2: type = converted %int.make_type_signed, %.loc46_10.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc46_8: %A.elem = field_decl a, element0 [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a.1 [template = constants.%complete_type.4] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc46: %A.elem = field_decl a, element0 [template] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a.1 [template = constants.%complete_type.6] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%A // CHECK:STDOUT: .B = %B.decl // CHECK:STDOUT: .AF = %AF.decl -// CHECK:STDOUT: .a = %.loc46_8 +// CHECK:STDOUT: .a = %.loc46 // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } // CHECK:STDOUT: @@ -151,17 +147,15 @@ class A { // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: %BF.decl: %BF.type = fn_decl @BF [template = constants.%BF] {} {} // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc16_12.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc16_12.2: type = converted %int.make_type_signed, %.loc16_12.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc16_10: %B.elem = field_decl b, element0 [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.b.1 [template = constants.%complete_type.1] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc16: %B.elem = field_decl b, element0 [template] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.b.1 [template = constants.%complete_type.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%B // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: .BF = %BF.decl -// CHECK:STDOUT: .b = %.loc16_10 +// CHECK:STDOUT: .b = %.loc16 // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } // CHECK:STDOUT: @@ -170,17 +164,15 @@ class A { // CHECK:STDOUT: %DF.decl: %DF.type = fn_decl @DF [template = constants.%DF] {} {} // CHECK:STDOUT: %CF.decl: %CF.type = fn_decl @CF [template = constants.%CF] {} {} // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc42_12.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc42_12.2: type = converted %int.make_type_signed, %.loc42_12.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc42_10: %C.elem = field_decl c, element0 [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.c.1 [template = constants.%complete_type.3] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc42: %C.elem = field_decl c, element0 [template] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.c.1 [template = constants.%complete_type.5] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: .D = %D.decl // CHECK:STDOUT: .CF = %CF.decl -// CHECK:STDOUT: .c = %.loc42_10 +// CHECK:STDOUT: .c = %.loc42 // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } // CHECK:STDOUT: @@ -188,17 +180,15 @@ class A { // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {} // CHECK:STDOUT: %DF.decl: %DF.type = fn_decl @DF [template = constants.%DF] {} {} // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc24_14.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc24_14.2: type = converted %int.make_type_signed, %.loc24_14.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc24_12: %D.elem = field_decl d, element0 [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.d.1 [template = constants.%complete_type.2] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc24: %D.elem = field_decl d, element0 [template] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.d.1 [template = constants.%complete_type.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%D // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: .DF = %DF.decl -// CHECK:STDOUT: .d = %.loc24_12 +// CHECK:STDOUT: .d = %.loc24 // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } // CHECK:STDOUT: @@ -213,7 +203,7 @@ class A { // CHECK:STDOUT: %a: ref %A = bind_name a, %a.var // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %.loc29_25.1: %struct_type.a.2 = struct_literal (%int_1) -// CHECK:STDOUT: %impl.elem0.loc29: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc29: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc29: = bound_method %int_1, %impl.elem0.loc29 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc29: = specific_function %Convert.bound.loc29, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc29: init %i32 = call %Convert.specific_fn.loc29(%int_1) [template = constants.%int_1.2] @@ -228,7 +218,7 @@ class A { // CHECK:STDOUT: %b: ref %B = bind_name b, %b.var // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %.loc30_25.1: %struct_type.b.2 = struct_literal (%int_2) -// CHECK:STDOUT: %impl.elem0.loc30: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc30: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc30: = bound_method %int_2, %impl.elem0.loc30 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc30: = specific_function %Convert.bound.loc30, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc30: init %i32 = call %Convert.specific_fn.loc30(%int_2) [template = constants.%int_2.2] @@ -243,7 +233,7 @@ class A { // CHECK:STDOUT: %c: ref %C = bind_name c, %c.var // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] // CHECK:STDOUT: %.loc31_25.1: %struct_type.c.2 = struct_literal (%int_3) -// CHECK:STDOUT: %impl.elem0.loc31: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc31: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc31: = bound_method %int_3, %impl.elem0.loc31 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc31: = specific_function %Convert.bound.loc31, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc31: init %i32 = call %Convert.specific_fn.loc31(%int_3) [template = constants.%int_3.2] @@ -258,7 +248,7 @@ class A { // CHECK:STDOUT: %d: ref %D = bind_name d, %d.var // CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [template = constants.%int_4.1] // CHECK:STDOUT: %.loc32_25.1: %struct_type.d.2 = struct_literal (%int_4) -// CHECK:STDOUT: %impl.elem0.loc32: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc32: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc32: = bound_method %int_4, %impl.elem0.loc32 [template = constants.%Convert.bound.4] // CHECK:STDOUT: %Convert.specific_fn.loc32: = specific_function %Convert.bound.loc32, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.4] // CHECK:STDOUT: %int.convert_checked.loc32: init %i32 = call %Convert.specific_fn.loc32(%int_4) [template = constants.%int_4.2] diff --git a/toolchain/check/testdata/class/scope.carbon b/toolchain/check/testdata/class/scope.carbon index 16f7fe3fceea8..37d7a955a74fb 100644 --- a/toolchain/check/testdata/class/scope.carbon +++ b/toolchain/check/testdata/class/scope.carbon @@ -32,27 +32,25 @@ fn Run() { // CHECK:STDOUT: constants { // CHECK:STDOUT: %Class: type = class_type @Class [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %F.type.1: type = fn_type @F.1 [template] // CHECK:STDOUT: %F.1: %F.type.1 = struct_value () [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] -// CHECK:STDOUT: %complete_type.1: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %complete_type.2: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] // CHECK:STDOUT: %F.type.2: type = fn_type @F.2 [template] // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [template] // CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] // CHECK:STDOUT: %Run.type: type = fn_type @Run [template] @@ -62,7 +60,7 @@ fn Run() { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -82,9 +80,7 @@ fn Run() { // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc21_11.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc21_11.2: type = converted %int.make_type_signed, %.loc21_11.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } @@ -97,9 +93,7 @@ fn Run() { // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc12_13.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc12_13.2: type = converted %int.make_type_signed, %.loc12_13.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } @@ -108,13 +102,11 @@ fn Run() { // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc16_13.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc16_13.2: type = converted %int.make_type_signed, %.loc16_13.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.2] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class @@ -126,7 +118,7 @@ fn Run() { // CHECK:STDOUT: fn @F.1() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1, %impl.elem0 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_1) [template = constants.%int_1.2] @@ -147,7 +139,7 @@ fn Run() { // CHECK:STDOUT: fn @F.2() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_2, %impl.elem0 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_2) [template = constants.%int_2.2] @@ -159,18 +151,14 @@ fn Run() { // CHECK:STDOUT: fn @Run() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_32.loc26: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc26: init type = call constants.%Int(%int_32.loc26) [template = constants.%i32] -// CHECK:STDOUT: %.loc26_10.1: type = value_of_initializer %int.make_type_signed.loc26 [template = constants.%i32] -// CHECK:STDOUT: %.loc26_10.2: type = converted %int.make_type_signed.loc26, %.loc26_10.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc26: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.var: ref %i32 = var a // CHECK:STDOUT: %a: ref %i32 = bind_name a, %a.var // CHECK:STDOUT: %F.ref.loc26: %F.type.2 = name_ref F, file.%F.decl [template = constants.%F.2] // CHECK:STDOUT: %F.call.loc26: init %i32 = call %F.ref.loc26() // CHECK:STDOUT: assign %a.var, %F.call.loc26 // CHECK:STDOUT: %int_32.loc27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc27: init type = call constants.%Int(%int_32.loc27) [template = constants.%i32] -// CHECK:STDOUT: %.loc27_10.1: type = value_of_initializer %int.make_type_signed.loc27 [template = constants.%i32] -// CHECK:STDOUT: %.loc27_10.2: type = converted %int.make_type_signed.loc27, %.loc27_10.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %b.var: ref %i32 = var b // CHECK:STDOUT: %b: ref %i32 = bind_name b, %b.var // CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class] diff --git a/toolchain/check/testdata/class/self.carbon b/toolchain/check/testdata/class/self.carbon index 4ba9a050fa960..eda1353e5c407 100644 --- a/toolchain/check/testdata/class/self.carbon +++ b/toolchain/check/testdata/class/self.carbon @@ -46,9 +46,7 @@ class Class { // CHECK:STDOUT: constants { // CHECK:STDOUT: %Class: type = class_type @Class [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %ptr.1: type = ptr_type %Class [template] @@ -56,12 +54,12 @@ class Class { // CHECK:STDOUT: %G: %G.type = struct_value () [template] // CHECK:STDOUT: %Class.elem: type = unbound_element_type %Class, %i32 [template] // CHECK:STDOUT: %struct_type.n: type = struct_type {.n: %i32} [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.n [template] +// CHECK:STDOUT: %complete_type.3: = complete_type_witness %struct_type.n [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -82,9 +80,7 @@ class Class { // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref.loc11: type = name_ref Self, constants.%Class [template = constants.%Class] // CHECK:STDOUT: %int_32.loc11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11: init type = call constants.%Int(%int_32.loc11) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_29.1: type = value_of_initializer %int.make_type_signed.loc11 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_29.2: type = converted %int.make_type_signed.loc11, %.loc11_29.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %self.param.loc11: %Class = value_param runtime_param0 // CHECK:STDOUT: %self.loc11: %Class = bind_name self, %self.param.loc11 // CHECK:STDOUT: %return.param.loc11: ref %i32 = out_param runtime_param1 @@ -93,16 +89,14 @@ class Class { // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %self.patt: %ptr.1 = binding_pattern self // CHECK:STDOUT: %self.param_patt: %ptr.1 = value_param_pattern %self.patt, runtime_param0 -// CHECK:STDOUT: %.loc15_12: auto = addr_pattern %self.param_patt +// CHECK:STDOUT: %.loc15: auto = addr_pattern %self.param_patt // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref.loc15: type = name_ref Self, constants.%Class [template = constants.%Class] // CHECK:STDOUT: %ptr.loc15: type = ptr_type %Class [template = constants.%ptr.1] // CHECK:STDOUT: %int_32.loc15: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc15: init type = call constants.%Int(%int_32.loc15) [template = constants.%i32] -// CHECK:STDOUT: %.loc15_35.1: type = value_of_initializer %int.make_type_signed.loc15 [template = constants.%i32] -// CHECK:STDOUT: %.loc15_35.2: type = converted %int.make_type_signed.loc15, %.loc15_35.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc15: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %self.param.loc15: %ptr.1 = value_param runtime_param0 // CHECK:STDOUT: %self.loc15: %ptr.1 = bind_name self, %self.param.loc15 // CHECK:STDOUT: %return.param.loc15: ref %i32 = out_param runtime_param1 @@ -119,9 +113,7 @@ class Class { // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref.loc5: type = name_ref Self, constants.%Class [template = constants.%Class] // CHECK:STDOUT: %int_32.loc5: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc5: init type = call constants.%Int(%int_32.loc5) [template = constants.%i32] -// CHECK:STDOUT: %.loc5_25.1: type = value_of_initializer %int.make_type_signed.loc5 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_25.2: type = converted %int.make_type_signed.loc5, %.loc5_25.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc5: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %self.param.loc5: %Class = value_param runtime_param0 // CHECK:STDOUT: %self.loc5: %Class = bind_name self, %self.param.loc5 // CHECK:STDOUT: %return.param.loc5: ref %i32 = out_param runtime_param1 @@ -130,40 +122,36 @@ class Class { // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %self.patt: %ptr.1 = binding_pattern self // CHECK:STDOUT: %self.param_patt: %ptr.1 = value_param_pattern %self.patt, runtime_param0 -// CHECK:STDOUT: %.loc15_12: auto = addr_pattern %self.param_patt +// CHECK:STDOUT: %.loc15: auto = addr_pattern %self.param_patt // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref.loc6: type = name_ref Self, constants.%Class [template = constants.%Class] // CHECK:STDOUT: %ptr.loc6: type = ptr_type %Class [template = constants.%ptr.1] // CHECK:STDOUT: %int_32.loc6: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc6: init type = call constants.%Int(%int_32.loc6) [template = constants.%i32] -// CHECK:STDOUT: %.loc6_31.1: type = value_of_initializer %int.make_type_signed.loc6 [template = constants.%i32] -// CHECK:STDOUT: %.loc6_31.2: type = converted %int.make_type_signed.loc6, %.loc6_31.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc6: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %self.param.loc6: %ptr.1 = value_param runtime_param0 // CHECK:STDOUT: %self.loc6: %ptr.1 = bind_name self, %self.param.loc6 // CHECK:STDOUT: %return.param.loc6: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return.loc6: ref %i32 = return_slot %return.param.loc6 // CHECK:STDOUT: } // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc8_10.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc8_10.2: type = converted %int.make_type_signed, %.loc8_10.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc8_8: %Class.elem = field_decl n, element0 [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.n [template = constants.%complete_type] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc8: %Class.elem = field_decl n, element0 [template] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.n [template = constants.%complete_type.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: .G = %G.decl -// CHECK:STDOUT: .n = %.loc8_8 +// CHECK:STDOUT: .n = %.loc8 // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F[%self.param_patt: %Class]() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %self.ref: %Class = name_ref self, %self.loc11 -// CHECK:STDOUT: %n.ref: %Class.elem = name_ref n, @Class.%.loc8_8 [template = @Class.%.loc8_8] +// CHECK:STDOUT: %n.ref: %Class.elem = name_ref n, @Class.%.loc8 [template = @Class.%.loc8] // CHECK:STDOUT: %.loc12_14.1: ref %i32 = class_element_access %self.ref, element0 // CHECK:STDOUT: %.loc12_14.2: %i32 = bind_value %.loc12_14.1 // CHECK:STDOUT: return %.loc12_14.2 @@ -173,7 +161,7 @@ class Class { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %self.ref: %ptr.1 = name_ref self, %self.loc15 // CHECK:STDOUT: %.loc16_11: ref %Class = deref %self.ref -// CHECK:STDOUT: %n.ref: %Class.elem = name_ref n, @Class.%.loc8_8 [template = @Class.%.loc8_8] +// CHECK:STDOUT: %n.ref: %Class.elem = name_ref n, @Class.%.loc8 [template = @Class.%.loc8] // CHECK:STDOUT: %.loc16_17.1: ref %i32 = class_element_access %.loc16_11, element0 // CHECK:STDOUT: %.loc16_17.2: %i32 = bind_value %.loc16_17.1 // CHECK:STDOUT: return %.loc16_17.2 diff --git a/toolchain/check/testdata/class/self_conversion.carbon b/toolchain/check/testdata/class/self_conversion.carbon index a53b5be0226be..93b5fa090ecdc 100644 --- a/toolchain/check/testdata/class/self_conversion.carbon +++ b/toolchain/check/testdata/class/self_conversion.carbon @@ -37,13 +37,11 @@ fn Call(p: Derived*) -> i32 { // CHECK:STDOUT: constants { // CHECK:STDOUT: %Base: type = class_type @Base [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %Base.elem: type = unbound_element_type %Base, %i32 [template] // CHECK:STDOUT: %struct_type.a: type = struct_type {.a: %i32} [template] -// CHECK:STDOUT: %complete_type.1: = complete_type_witness %struct_type.a [template] +// CHECK:STDOUT: %complete_type.3: = complete_type_witness %struct_type.a [template] // CHECK:STDOUT: %Derived: type = class_type @Derived [template] // CHECK:STDOUT: %Derived.elem: type = unbound_element_type %Derived, %Base [template] // CHECK:STDOUT: %SelfBase.type: type = fn_type @SelfBase [template] @@ -52,13 +50,13 @@ fn Call(p: Derived*) -> i32 { // CHECK:STDOUT: %AddrSelfBase.type: type = fn_type @AddrSelfBase [template] // CHECK:STDOUT: %AddrSelfBase: %AddrSelfBase.type = struct_value () [template] // CHECK:STDOUT: %struct_type.base.1: type = struct_type {.base: %Base} [template] -// CHECK:STDOUT: %complete_type.2: = complete_type_witness %struct_type.base.1 [template] +// CHECK:STDOUT: %complete_type.4: = complete_type_witness %struct_type.base.1 [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] // CHECK:STDOUT: %ptr.3: type = ptr_type %Derived [template] @@ -69,7 +67,7 @@ fn Call(p: Derived*) -> i32 { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -93,9 +91,7 @@ fn Call(p: Derived*) -> i32 { // CHECK:STDOUT: } { // CHECK:STDOUT: %Base.ref.loc22: type = name_ref Base, file.%Base.decl [template = constants.%Base] // CHECK:STDOUT: %int_32.loc22: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc22: init type = call constants.%Int(%int_32.loc22) [template = constants.%i32] -// CHECK:STDOUT: %.loc22_38.1: type = value_of_initializer %int.make_type_signed.loc22 [template = constants.%i32] -// CHECK:STDOUT: %.loc22_38.2: type = converted %int.make_type_signed.loc22, %.loc22_38.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %self.param.loc22: %Base = value_param runtime_param0 // CHECK:STDOUT: %self.loc22: %Base = bind_name self, %self.param.loc22 // CHECK:STDOUT: %return.param.loc22: ref %i32 = out_param runtime_param1 @@ -120,9 +116,7 @@ fn Call(p: Derived*) -> i32 { // CHECK:STDOUT: %Derived.ref: type = name_ref Derived, file.%Derived.decl [template = constants.%Derived] // CHECK:STDOUT: %ptr: type = ptr_type %Derived [template = constants.%ptr.3] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc30_25.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc30_25.2: type = converted %int.make_type_signed, %.loc30_25.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %p.param: %ptr.3 = value_param runtime_param0 // CHECK:STDOUT: %p: %ptr.3 = bind_name p, %p.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 @@ -132,15 +126,13 @@ fn Call(p: Derived*) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: class @Base { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc12_10.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc12_10.2: type = converted %int.make_type_signed, %.loc12_10.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc12_8: %Base.elem = field_decl a, element0 [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a [template = constants.%complete_type.1] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc12: %Base.elem = field_decl a, element0 [template] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a [template = constants.%complete_type.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Base -// CHECK:STDOUT: .a = %.loc12_8 +// CHECK:STDOUT: .a = %.loc12 // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } // CHECK:STDOUT: @@ -155,9 +147,7 @@ fn Call(p: Derived*) -> i32 { // CHECK:STDOUT: } { // CHECK:STDOUT: %Base.ref.loc18: type = name_ref Base, file.%Base.decl [template = constants.%Base] // CHECK:STDOUT: %int_32.loc18: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc18: init type = call constants.%Int(%int_32.loc18) [template = constants.%i32] -// CHECK:STDOUT: %.loc18_32.1: type = value_of_initializer %int.make_type_signed.loc18 [template = constants.%i32] -// CHECK:STDOUT: %.loc18_32.2: type = converted %int.make_type_signed.loc18, %.loc18_32.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc18: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %self.param.loc18: %Base = value_param runtime_param0 // CHECK:STDOUT: %self.loc18: %Base = bind_name self, %self.param.loc18 // CHECK:STDOUT: %return.param.loc18: ref %i32 = out_param runtime_param1 @@ -173,7 +163,7 @@ fn Call(p: Derived*) -> i32 { // CHECK:STDOUT: %self.param.loc19: %ptr.2 = value_param runtime_param0 // CHECK:STDOUT: %self.loc19: %ptr.2 = bind_name self, %self.param.loc19 // CHECK:STDOUT: } -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.base.1 [template = constants.%complete_type.2] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.base.1 [template = constants.%complete_type.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Derived @@ -187,7 +177,7 @@ fn Call(p: Derived*) -> i32 { // CHECK:STDOUT: fn @SelfBase[%self.param_patt: %Base]() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %self.ref: %Base = name_ref self, %self.loc22 -// CHECK:STDOUT: %a.ref: %Base.elem = name_ref a, @Base.%.loc12_8 [template = @Base.%.loc12_8] +// CHECK:STDOUT: %a.ref: %Base.elem = name_ref a, @Base.%.loc12 [template = @Base.%.loc12] // CHECK:STDOUT: %.loc23_14.1: ref %i32 = class_element_access %self.ref, element0 // CHECK:STDOUT: %.loc23_14.2: %i32 = bind_value %.loc23_14.1 // CHECK:STDOUT: return %.loc23_14.2 @@ -197,10 +187,10 @@ fn Call(p: Derived*) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %self.ref: %ptr.2 = name_ref self, %self.loc26 // CHECK:STDOUT: %.loc27_4: ref %Base = deref %self.ref -// CHECK:STDOUT: %a.ref: %Base.elem = name_ref a, @Base.%.loc12_8 [template = @Base.%.loc12_8] +// CHECK:STDOUT: %a.ref: %Base.elem = name_ref a, @Base.%.loc12 [template = @Base.%.loc12] // CHECK:STDOUT: %.loc27_10: ref %i32 = class_element_access %.loc27_4, element0 // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_1) [template = constants.%int_1.2] diff --git a/toolchain/check/testdata/class/self_type.carbon b/toolchain/check/testdata/class/self_type.carbon index ab00635c14684..31ff802a5992a 100644 --- a/toolchain/check/testdata/class/self_type.carbon +++ b/toolchain/check/testdata/class/self_type.carbon @@ -27,9 +27,7 @@ fn Class.F[self: Self]() -> i32 { // CHECK:STDOUT: constants { // CHECK:STDOUT: %Class: type = class_type @Class [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %Make.type: type = fn_type @Make [template] @@ -37,12 +35,12 @@ fn Class.F[self: Self]() -> i32 { // CHECK:STDOUT: %ptr.1: type = ptr_type %Class [template] // CHECK:STDOUT: %Class.elem: type = unbound_element_type %Class, %ptr.1 [template] // CHECK:STDOUT: %struct_type.p: type = struct_type {.p: %ptr.1} [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.p [template] +// CHECK:STDOUT: %complete_type.2: = complete_type_witness %struct_type.p [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -63,9 +61,7 @@ fn Class.F[self: Self]() -> i32 { // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref.loc21: type = name_ref Self, constants.%Class [template = constants.%Class] // CHECK:STDOUT: %int_32.loc21: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc21: init type = call constants.%Int(%int_32.loc21) [template = constants.%i32] -// CHECK:STDOUT: %.loc21_29.1: type = value_of_initializer %int.make_type_signed.loc21 [template = constants.%i32] -// CHECK:STDOUT: %.loc21_29.2: type = converted %int.make_type_signed.loc21, %.loc21_29.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc21: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %self.param.loc21: %Class = value_param runtime_param0 // CHECK:STDOUT: %self.loc21: %Class = bind_name self, %self.param.loc21 // CHECK:STDOUT: %return.param.loc21: ref %i32 = out_param runtime_param1 @@ -82,9 +78,7 @@ fn Class.F[self: Self]() -> i32 { // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref.loc12: type = name_ref Self, constants.%Class [template = constants.%Class] // CHECK:STDOUT: %int_32.loc12: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc12: init type = call constants.%Int(%int_32.loc12) [template = constants.%i32] -// CHECK:STDOUT: %.loc12_25.1: type = value_of_initializer %int.make_type_signed.loc12 [template = constants.%i32] -// CHECK:STDOUT: %.loc12_25.2: type = converted %int.make_type_signed.loc12, %.loc12_25.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc12: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %self.param.loc12: %Class = value_param runtime_param0 // CHECK:STDOUT: %self.loc12: %Class = bind_name self, %self.param.loc12 // CHECK:STDOUT: %return.param.loc12: ref %i32 = out_param runtime_param1 @@ -101,7 +95,7 @@ fn Class.F[self: Self]() -> i32 { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Class [template = constants.%Class] // CHECK:STDOUT: %ptr: type = ptr_type %Class [template = constants.%ptr.1] // CHECK:STDOUT: %.loc18: %Class.elem = field_decl p, element0 [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.p [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.p [template = constants.%complete_type.2] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class diff --git a/toolchain/check/testdata/class/static_method.carbon b/toolchain/check/testdata/class/static_method.carbon index 944fc6efd0d87..1f533238d1074 100644 --- a/toolchain/check/testdata/class/static_method.carbon +++ b/toolchain/check/testdata/class/static_method.carbon @@ -22,20 +22,18 @@ fn Run() -> i32 { // CHECK:STDOUT: constants { // CHECK:STDOUT: %Class: type = class_type @Class [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %complete_type.2: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %Run.type: type = fn_type @Run [template] // CHECK:STDOUT: %Run: %Run.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -54,16 +52,12 @@ fn Run() -> i32 { // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc15_13.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc15_13.2: type = converted %int.make_type_signed, %.loc15_13.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc15_17.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc15_17.2: type = converted %int.make_type_signed, %.loc15_17.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Class { @@ -72,13 +66,11 @@ fn Run() -> i32 { // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc12_13.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc12_13.2: type = converted %int.make_type_signed, %.loc12_13.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.2] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class diff --git a/toolchain/check/testdata/class/syntactic_merge_literal.carbon b/toolchain/check/testdata/class/syntactic_merge_literal.carbon index 9a119e08d0145..f29cab40ed0e8 100644 --- a/toolchain/check/testdata/class/syntactic_merge_literal.carbon +++ b/toolchain/check/testdata/class/syntactic_merge_literal.carbon @@ -34,22 +34,20 @@ class D(b:! C(1_000)) {} // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %a: %i32 = bind_symbolic_name a, 0 [symbolic] // CHECK:STDOUT: %a.patt: %i32 = symbolic_binding_pattern a, 0 [symbolic] // CHECK:STDOUT: %C.type: type = generic_class_type @C [template] // CHECK:STDOUT: %C.generic: %C.type = struct_value () [template] // CHECK:STDOUT: %C.1: type = class_type @C, @C(%a) [symbolic] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] -// CHECK:STDOUT: %complete_type.1: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %complete_type.2: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %int_1000.1: Core.IntLiteral = int_value 1000 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_1000.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound: = bound_method %int_1000.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1000.2: %i32 = int_value 1000 [template] // CHECK:STDOUT: %C.2: type = class_type @C, @C(%int_1000.2) [template] @@ -63,7 +61,7 @@ class D(b:! C(1_000)) {} // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -81,9 +79,7 @@ class D(b:! C(1_000)) {} // CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt.loc4_9.1, runtime_param [symbolic = %a.patt.loc4_9.2 (constants.%a.patt)] // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc4_13.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc4_13.2: type = converted %int.make_type_signed, %.loc4_13.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param // CHECK:STDOUT: %a.loc4_9.1: %i32 = bind_symbolic_name a, 0, %a.param [symbolic = %a.loc4_9.2 (constants.%a)] // CHECK:STDOUT: } @@ -93,7 +89,7 @@ class D(b:! C(1_000)) {} // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc5: %C.type = name_ref C, file.%C.decl [template = constants.%C.generic] // CHECK:STDOUT: %int_1000.loc5: Core.IntLiteral = int_value 1000 [template = constants.%int_1000.1] -// CHECK:STDOUT: %impl.elem0.loc5: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc5: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc5: = bound_method %int_1000.loc5, %impl.elem0.loc5 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn.loc5: = specific_function %Convert.bound.loc5, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc5: init %i32 = call %Convert.specific_fn.loc5(%int_1000.loc5) [template = constants.%int_1000.2] @@ -109,7 +105,7 @@ class D(b:! C(1_000)) {} // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref.loc6: %C.type = name_ref C, file.%C.decl [template = constants.%C.generic] // CHECK:STDOUT: %int_1000.loc6: Core.IntLiteral = int_value 1000 [template = constants.%int_1000.1] -// CHECK:STDOUT: %impl.elem0.loc6: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc6: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc6: = bound_method %int_1000.loc6, %impl.elem0.loc6 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn.loc6: = specific_function %Convert.bound.loc6, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc6: init %i32 = call %Convert.specific_fn.loc6(%int_1000.loc6) [template = constants.%int_1000.2] @@ -128,7 +124,7 @@ class D(b:! C(1_000)) {} // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: class { -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.2] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C.1 @@ -143,7 +139,7 @@ class D(b:! C(1_000)) {} // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: class { -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.2] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%D @@ -170,22 +166,20 @@ class D(b:! C(1_000)) {} // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %a: %i32 = bind_symbolic_name a, 0 [symbolic] // CHECK:STDOUT: %a.patt: %i32 = symbolic_binding_pattern a, 0 [symbolic] // CHECK:STDOUT: %C.type: type = generic_class_type @C [template] // CHECK:STDOUT: %C.generic: %C.type = struct_value () [template] // CHECK:STDOUT: %C.1: type = class_type @C, @C(%a) [symbolic] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] -// CHECK:STDOUT: %complete_type.1: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %complete_type.2: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %int_1000.1: Core.IntLiteral = int_value 1000 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_1000.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound: = bound_method %int_1000.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1000.2: %i32 = int_value 1000 [template] // CHECK:STDOUT: %C.2: type = class_type @C, @C(%int_1000.2) [template] @@ -201,7 +195,7 @@ class D(b:! C(1_000)) {} // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -219,9 +213,7 @@ class D(b:! C(1_000)) {} // CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt.loc4_9.1, runtime_param [symbolic = %a.patt.loc4_9.2 (constants.%a.patt)] // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc4_13.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc4_13.2: type = converted %int.make_type_signed, %.loc4_13.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param // CHECK:STDOUT: %a.loc4_9.1: %i32 = bind_symbolic_name a, 0, %a.param [symbolic = %a.loc4_9.2 (constants.%a)] // CHECK:STDOUT: } @@ -231,7 +223,7 @@ class D(b:! C(1_000)) {} // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [template = constants.%C.generic] // CHECK:STDOUT: %int_1000: Core.IntLiteral = int_value 1000 [template = constants.%int_1000.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1000, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_1000) [template = constants.%int_1000.2] @@ -247,7 +239,7 @@ class D(b:! C(1_000)) {} // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [template = constants.%C.generic] // CHECK:STDOUT: %int_1000: Core.IntLiteral = int_value 1000 [template = constants.%int_1000.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1000, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_1000) [template = constants.%int_1000.2] @@ -266,7 +258,7 @@ class D(b:! C(1_000)) {} // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: class { -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.2] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C.1 @@ -288,7 +280,7 @@ class D(b:! C(1_000)) {} // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: class { -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.2] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%.1 diff --git a/toolchain/check/testdata/class/todo_access_modifiers.carbon b/toolchain/check/testdata/class/todo_access_modifiers.carbon index 6a38d499b254c..5ca3193059b69 100644 --- a/toolchain/check/testdata/class/todo_access_modifiers.carbon +++ b/toolchain/check/testdata/class/todo_access_modifiers.carbon @@ -28,17 +28,15 @@ class Access { // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %Access.elem: type = unbound_element_type %Access, %i32 [template] // CHECK:STDOUT: %struct_type.k.l: type = struct_type {.k: %i32, .l: %i32} [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.k.l [template] +// CHECK:STDOUT: %complete_type.3: = complete_type_witness %struct_type.k.l [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -57,23 +55,19 @@ class Access { // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {} // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] {} {} // CHECK:STDOUT: %int_32.loc17: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc17: init type = call constants.%Int(%int_32.loc17) [template = constants.%i32] -// CHECK:STDOUT: %.loc17_18.1: type = value_of_initializer %int.make_type_signed.loc17 [template = constants.%i32] -// CHECK:STDOUT: %.loc17_18.2: type = converted %int.make_type_signed.loc17, %.loc17_18.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc17_16: %Access.elem = field_decl k, element0 [template] +// CHECK:STDOUT: %i32.loc17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc17: %Access.elem = field_decl k, element0 [template] // CHECK:STDOUT: %int_32.loc19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc19: init type = call constants.%Int(%int_32.loc19) [template = constants.%i32] -// CHECK:STDOUT: %.loc19_20.1: type = value_of_initializer %int.make_type_signed.loc19 [template = constants.%i32] -// CHECK:STDOUT: %.loc19_20.2: type = converted %int.make_type_signed.loc19, %.loc19_20.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc19_18: %Access.elem = field_decl l, element1 [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.k.l [template = constants.%complete_type] +// CHECK:STDOUT: %i32.loc19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc19: %Access.elem = field_decl l, element1 [template] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.k.l [template = constants.%complete_type.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Access // CHECK:STDOUT: .F [private] = %F.decl // CHECK:STDOUT: .G [protected] = %G.decl -// CHECK:STDOUT: .k [private] = %.loc17_16 -// CHECK:STDOUT: .l [protected] = %.loc19_18 +// CHECK:STDOUT: .k [private] = %.loc17 +// CHECK:STDOUT: .l [protected] = %.loc19 // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/virtual_modifiers.carbon b/toolchain/check/testdata/class/virtual_modifiers.carbon index e68d6da249484..2e9bca9f20758 100644 --- a/toolchain/check/testdata/class/virtual_modifiers.carbon +++ b/toolchain/check/testdata/class/virtual_modifiers.carbon @@ -500,33 +500,31 @@ class Derived { // CHECK:STDOUT: constants { // CHECK:STDOUT: %Base: type = class_type @Base [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %Base.elem: type = unbound_element_type %Base, %i32 [template] // CHECK:STDOUT: %F.type.1: type = fn_type @F.1 [template] // CHECK:STDOUT: %F.1: %F.type.1 = struct_value () [template] // CHECK:STDOUT: %ptr.1: type = ptr_type [template] // CHECK:STDOUT: %struct_type.vptr.m1.m2: type = struct_type {.: %ptr.1, .m1: %i32, .m2: %i32} [template] -// CHECK:STDOUT: %complete_type.1: = complete_type_witness %struct_type.vptr.m1.m2 [template] +// CHECK:STDOUT: %complete_type.3: = complete_type_witness %struct_type.vptr.m1.m2 [template] // CHECK:STDOUT: %F.type.2: type = fn_type @F.2 [template] // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [template] // CHECK:STDOUT: %int_3.1: Core.IntLiteral = int_value 3 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_3.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_3.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_3.2: %i32 = int_value 3 [template] // CHECK:STDOUT: %struct_type.m2.m1.1: type = struct_type {.m2: %i32, .m1: %i32} [template] // CHECK:STDOUT: %int_5.1: Core.IntLiteral = int_value 5 [template] // CHECK:STDOUT: %struct_type.m2.m1.2: type = struct_type {.m2: Core.IntLiteral, .m1: Core.IntLiteral} [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_5.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_5.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_5.2: %i32 = int_value 5 [template] // CHECK:STDOUT: %int_4.1: Core.IntLiteral = int_value 4 [template] -// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_4.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_4.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_4.2: %i32 = int_value 4 [template] // CHECK:STDOUT: } @@ -534,7 +532,7 @@ class Derived { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -553,22 +551,18 @@ class Derived { // CHECK:STDOUT: // CHECK:STDOUT: class @Base { // CHECK:STDOUT: %int_32.loc5: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc5: init type = call constants.%Int(%int_32.loc5) [template = constants.%i32] -// CHECK:STDOUT: %.loc5_11.1: type = value_of_initializer %int.make_type_signed.loc5 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_11.2: type = converted %int.make_type_signed.loc5, %.loc5_11.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_9: %Base.elem = field_decl m1, element1 [template] +// CHECK:STDOUT: %i32.loc5: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc5: %Base.elem = field_decl m1, element1 [template] // CHECK:STDOUT: %int_32.loc6: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc6: init type = call constants.%Int(%int_32.loc6) [template = constants.%i32] -// CHECK:STDOUT: %.loc6_11.1: type = value_of_initializer %int.make_type_signed.loc6 [template = constants.%i32] -// CHECK:STDOUT: %.loc6_11.2: type = converted %int.make_type_signed.loc6, %.loc6_11.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc6_9: %Base.elem = field_decl m2, element2 [template] +// CHECK:STDOUT: %i32.loc6: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc6: %Base.elem = field_decl m2, element2 [template] // CHECK:STDOUT: %F.decl: %F.type.1 = fn_decl @F.1 [template = constants.%F.1] {} {} -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.vptr.m1.m2 [template = constants.%complete_type.1] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.vptr.m1.m2 [template = constants.%complete_type.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Base -// CHECK:STDOUT: .m1 = %.loc5_9 -// CHECK:STDOUT: .m2 = %.loc6_9 +// CHECK:STDOUT: .m1 = %.loc5 +// CHECK:STDOUT: .m2 = %.loc6 // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } @@ -578,18 +572,16 @@ class Derived { // CHECK:STDOUT: fn @F.2() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc12_10.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc12_10.2: type = converted %int.make_type_signed, %.loc12_10.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %i.var: ref %i32 = var i // CHECK:STDOUT: %i: ref %i32 = bind_name i, %i.var // CHECK:STDOUT: %int_3.loc12: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] -// CHECK:STDOUT: %impl.elem0.loc12: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc12: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc12: = bound_method %int_3.loc12, %impl.elem0.loc12 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc12: = specific_function %Convert.bound.loc12, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc12: init %i32 = call %Convert.specific_fn.loc12(%int_3.loc12) [template = constants.%int_3.2] -// CHECK:STDOUT: %.loc12_17: init %i32 = converted %int_3.loc12, %int.convert_checked.loc12 [template = constants.%int_3.2] -// CHECK:STDOUT: assign %i.var, %.loc12_17 +// CHECK:STDOUT: %.loc12: init %i32 = converted %int_3.loc12, %int.convert_checked.loc12 [template = constants.%int_3.2] +// CHECK:STDOUT: assign %i.var, %.loc12 // CHECK:STDOUT: %Base.ref.loc14: type = name_ref Base, file.%Base.decl [template = constants.%Base] // CHECK:STDOUT: %b1.var: ref %Base = var b1 // CHECK:STDOUT: %b1: ref %Base = bind_name b1, %b1.var @@ -617,14 +609,14 @@ class Derived { // CHECK:STDOUT: %.loc15_35.2: ref %ptr.1 = class_element_access %b2.var, element0 // CHECK:STDOUT: %.loc15_35.3: ref %ptr.1 = vtable_ptr // CHECK:STDOUT: %.loc15_35.4: init %ptr.1 = initialize_from %.loc15_35.3 to %.loc15_35.2 -// CHECK:STDOUT: %impl.elem0.loc15_35.1: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc15_35.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc15_35.1: = bound_method %int_5, %impl.elem0.loc15_35.1 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc15_35.1: = specific_function %Convert.bound.loc15_35.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc15_35.1: init %i32 = call %Convert.specific_fn.loc15_35.1(%int_5) [template = constants.%int_5.2] // CHECK:STDOUT: %.loc15_35.5: init %i32 = converted %int_5, %int.convert_checked.loc15_35.1 [template = constants.%int_5.2] // CHECK:STDOUT: %.loc15_35.6: ref %i32 = class_element_access %b2.var, element2 // CHECK:STDOUT: %.loc15_35.7: init %i32 = initialize_from %.loc15_35.5 to %.loc15_35.6 [template = constants.%int_5.2] -// CHECK:STDOUT: %impl.elem0.loc15_35.2: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc15_35.2: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc15_35.2: = bound_method %int_3.loc15, %impl.elem0.loc15_35.2 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc15_35.2: = specific_function %Convert.bound.loc15_35.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc15_35.2: init %i32 = call %Convert.specific_fn.loc15_35.2(%int_3.loc15) [template = constants.%int_3.2] @@ -635,10 +627,10 @@ class Derived { // CHECK:STDOUT: %.loc15_36: init %Base = converted %.loc15_35.1, %.loc15_35.11 // CHECK:STDOUT: assign %b2.var, %.loc15_36 // CHECK:STDOUT: %b1.ref: ref %Base = name_ref b1, %b1 -// CHECK:STDOUT: %m2.ref: %Base.elem = name_ref m2, @Base.%.loc6_9 [template = @Base.%.loc6_9] +// CHECK:STDOUT: %m2.ref: %Base.elem = name_ref m2, @Base.%.loc6 [template = @Base.%.loc6] // CHECK:STDOUT: %.loc18_5: ref %i32 = class_element_access %b1.ref, element2 // CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [template = constants.%int_4.1] -// CHECK:STDOUT: %impl.elem0.loc18: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc18: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc18: = bound_method %int_4, %impl.elem0.loc18 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc18: = specific_function %Convert.bound.loc18, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc18: init %i32 = call %Convert.specific_fn.loc18(%int_4) [template = constants.%int_4.2] diff --git a/toolchain/check/testdata/const/basic.carbon b/toolchain/check/testdata/const/basic.carbon index e3261af2b580d..7d9ac7c06746a 100644 --- a/toolchain/check/testdata/const/basic.carbon +++ b/toolchain/check/testdata/const/basic.carbon @@ -20,9 +20,7 @@ fn B(p: const (i32*)) -> const (i32*) { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %const.1: type = const_type %i32 [template] // CHECK:STDOUT: %ptr.1: type = ptr_type %const.1 [template] // CHECK:STDOUT: %ptr.2: type = ptr_type %ptr.1 [template] @@ -36,7 +34,7 @@ fn B(p: const (i32*)) -> const (i32*) { // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -56,16 +54,12 @@ fn B(p: const (i32*)) -> const (i32*) { // CHECK:STDOUT: %return.param_patt: %ptr.2 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc11_15: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11_15: init type = call constants.%Int(%int_32.loc11_15) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_9.1: type = value_of_initializer %int.make_type_signed.loc11_15 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_9.2: type = converted %int.make_type_signed.loc11_15, %.loc11_9.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc11_15: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %const.loc11_9: type = const_type %i32 [template = constants.%const.1] // CHECK:STDOUT: %ptr.loc11_18: type = ptr_type %const.1 [template = constants.%ptr.1] // CHECK:STDOUT: %ptr.loc11_19: type = ptr_type %ptr.1 [template = constants.%ptr.2] // CHECK:STDOUT: %int_32.loc11_31: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11_31: init type = call constants.%Int(%int_32.loc11_31) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_25.1: type = value_of_initializer %int.make_type_signed.loc11_31 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_25.2: type = converted %int.make_type_signed.loc11_31, %.loc11_25.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc11_31: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %const.loc11_25: type = const_type %i32 [template = constants.%const.1] // CHECK:STDOUT: %ptr.loc11_34: type = ptr_type %const.1 [template = constants.%ptr.1] // CHECK:STDOUT: %ptr.loc11_35: type = ptr_type %ptr.1 [template = constants.%ptr.2] @@ -81,15 +75,11 @@ fn B(p: const (i32*)) -> const (i32*) { // CHECK:STDOUT: %return.param_patt: %const.2 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc15_16: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc15_16: init type = call constants.%Int(%int_32.loc15_16) [template = constants.%i32] -// CHECK:STDOUT: %.loc15_19.1: type = value_of_initializer %int.make_type_signed.loc15_16 [template = constants.%i32] -// CHECK:STDOUT: %.loc15_19.2: type = converted %int.make_type_signed.loc15_16, %.loc15_19.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc15_16: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %ptr.loc15_19: type = ptr_type %i32 [template = constants.%ptr.3] // CHECK:STDOUT: %const.loc15_9: type = const_type %ptr.3 [template = constants.%const.2] // CHECK:STDOUT: %int_32.loc15_33: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc15_33: init type = call constants.%Int(%int_32.loc15_33) [template = constants.%i32] -// CHECK:STDOUT: %.loc15_36.1: type = value_of_initializer %int.make_type_signed.loc15_33 [template = constants.%i32] -// CHECK:STDOUT: %.loc15_36.2: type = converted %int.make_type_signed.loc15_33, %.loc15_36.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc15_33: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %ptr.loc15_36: type = ptr_type %i32 [template = constants.%ptr.3] // CHECK:STDOUT: %const.loc15_26: type = const_type %ptr.3 [template = constants.%const.2] // CHECK:STDOUT: %p.param: %const.2 = value_param runtime_param0 diff --git a/toolchain/check/testdata/const/collapse.carbon b/toolchain/check/testdata/const/collapse.carbon index c6666ec4adbcc..78a508b4f57cf 100644 --- a/toolchain/check/testdata/const/collapse.carbon +++ b/toolchain/check/testdata/const/collapse.carbon @@ -20,9 +20,7 @@ fn F(p: const i32**) -> const (const i32)** { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %const: type = const_type %i32 [template] // CHECK:STDOUT: %ptr.1: type = ptr_type %const [template] // CHECK:STDOUT: %ptr.2: type = ptr_type %ptr.1 [template] @@ -32,7 +30,7 @@ fn F(p: const i32**) -> const (const i32)** { // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -51,16 +49,12 @@ fn F(p: const i32**) -> const (const i32)** { // CHECK:STDOUT: %return.param_patt: %ptr.2 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc15_15: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc15_15: init type = call constants.%Int(%int_32.loc15_15) [template = constants.%i32] -// CHECK:STDOUT: %.loc15_9.1: type = value_of_initializer %int.make_type_signed.loc15_15 [template = constants.%i32] -// CHECK:STDOUT: %.loc15_9.2: type = converted %int.make_type_signed.loc15_15, %.loc15_9.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc15_15: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %const.loc15_9: type = const_type %i32 [template = constants.%const] // CHECK:STDOUT: %ptr.loc15_18: type = ptr_type %const [template = constants.%ptr.1] // CHECK:STDOUT: %ptr.loc15_19: type = ptr_type %ptr.1 [template = constants.%ptr.2] // CHECK:STDOUT: %int_32.loc15_38: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc15_38: init type = call constants.%Int(%int_32.loc15_38) [template = constants.%i32] -// CHECK:STDOUT: %.loc15_32.1: type = value_of_initializer %int.make_type_signed.loc15_38 [template = constants.%i32] -// CHECK:STDOUT: %.loc15_32.2: type = converted %int.make_type_signed.loc15_38, %.loc15_32.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc15_38: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %const.loc15_32: type = const_type %i32 [template = constants.%const] // CHECK:STDOUT: %const.loc15_25: type = const_type %const [template = constants.%const] // CHECK:STDOUT: %ptr.loc15_42: type = ptr_type %const [template = constants.%ptr.1] diff --git a/toolchain/check/testdata/const/fail_collapse.carbon b/toolchain/check/testdata/const/fail_collapse.carbon index 9cffd7c0824de..9a2ca3f3f0e8b 100644 --- a/toolchain/check/testdata/const/fail_collapse.carbon +++ b/toolchain/check/testdata/const/fail_collapse.carbon @@ -26,9 +26,7 @@ fn G(p: const (const i32)**) -> i32** { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %const: type = const_type %i32 [template] // CHECK:STDOUT: %ptr.1: type = ptr_type %const [template] // CHECK:STDOUT: %ptr.2: type = ptr_type %ptr.1 [template] @@ -41,7 +39,7 @@ fn G(p: const (const i32)**) -> i32** { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -60,17 +58,13 @@ fn G(p: const (const i32)**) -> i32** { // CHECK:STDOUT: %return.param_patt: %ptr.4 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc15_22: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc15_22: init type = call constants.%Int(%int_32.loc15_22) [template = constants.%i32] -// CHECK:STDOUT: %.loc15_16.1: type = value_of_initializer %int.make_type_signed.loc15_22 [template = constants.%i32] -// CHECK:STDOUT: %.loc15_16.2: type = converted %int.make_type_signed.loc15_22, %.loc15_16.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc15_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %const.loc15_16: type = const_type %i32 [template = constants.%const] // CHECK:STDOUT: %const.loc15_9: type = const_type %const [template = constants.%const] // CHECK:STDOUT: %ptr.loc15_26: type = ptr_type %const [template = constants.%ptr.1] // CHECK:STDOUT: %ptr.loc15_27: type = ptr_type %ptr.1 [template = constants.%ptr.2] // CHECK:STDOUT: %int_32.loc15_33: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc15_33: init type = call constants.%Int(%int_32.loc15_33) [template = constants.%i32] -// CHECK:STDOUT: %.loc15_36.1: type = value_of_initializer %int.make_type_signed.loc15_33 [template = constants.%i32] -// CHECK:STDOUT: %.loc15_36.2: type = converted %int.make_type_signed.loc15_33, %.loc15_36.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc15_33: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %ptr.loc15_36: type = ptr_type %i32 [template = constants.%ptr.3] // CHECK:STDOUT: %ptr.loc15_37: type = ptr_type %ptr.3 [template = constants.%ptr.4] // CHECK:STDOUT: %p.param: %ptr.2 = value_param runtime_param0 diff --git a/toolchain/check/testdata/const/import.carbon b/toolchain/check/testdata/const/import.carbon index 07a9930fc1cc6..6542ef8664921 100644 --- a/toolchain/check/testdata/const/import.carbon +++ b/toolchain/check/testdata/const/import.carbon @@ -30,9 +30,7 @@ var a_ptr: const i32* = a_ptr_ref; // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %const: type = const_type %i32 [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] @@ -41,7 +39,7 @@ var a_ptr: const i32* = a_ptr_ref; // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -60,24 +58,18 @@ var a_ptr: const i32* = a_ptr_ref; // CHECK:STDOUT: %return.param_patt: %const = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_signed, %.loc4_11.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %const: type = const_type %i32 [template = constants.%const] // CHECK:STDOUT: %return.param: ref %const = out_param runtime_param0 // CHECK:STDOUT: %return: ref %const = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %int_32.loc6: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc6: init type = call constants.%Int(%int_32.loc6) [template = constants.%i32] -// CHECK:STDOUT: %.loc6_12.1: type = value_of_initializer %int.make_type_signed.loc6 [template = constants.%i32] -// CHECK:STDOUT: %.loc6_12.2: type = converted %int.make_type_signed.loc6, %.loc6_12.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc6: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %const.loc6: type = const_type %i32 [template = constants.%const] // CHECK:STDOUT: %a_ref.var: ref %const = var a_ref // CHECK:STDOUT: %a_ref: ref %const = bind_name a_ref, %a_ref.var // CHECK:STDOUT: %int_32.loc7: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc7: init type = call constants.%Int(%int_32.loc7) [template = constants.%i32] -// CHECK:STDOUT: %.loc7_16.1: type = value_of_initializer %int.make_type_signed.loc7 [template = constants.%i32] -// CHECK:STDOUT: %.loc7_16.2: type = converted %int.make_type_signed.loc7, %.loc7_16.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc7: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %const.loc7: type = const_type %i32 [template = constants.%const] // CHECK:STDOUT: %ptr: type = ptr_type %const [template = constants.%ptr] // CHECK:STDOUT: %a_ptr_ref.var: ref %ptr = var a_ptr_ref @@ -101,9 +93,7 @@ var a_ptr: const i32* = a_ptr_ref; // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %const: type = const_type %i32 [template] // CHECK:STDOUT: %ptr: type = ptr_type %const [template] // CHECK:STDOUT: } @@ -132,17 +122,13 @@ var a_ptr: const i32* = a_ptr_ref; // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int_32.loc6: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc6: init type = call constants.%Int(%int_32.loc6) [template = constants.%i32] -// CHECK:STDOUT: %.loc6_8.1: type = value_of_initializer %int.make_type_signed.loc6 [template = constants.%i32] -// CHECK:STDOUT: %.loc6_8.2: type = converted %int.make_type_signed.loc6, %.loc6_8.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc6: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %const.loc6: type = const_type %i32 [template = constants.%const] // CHECK:STDOUT: %ptr.loc6: type = ptr_type %const [template = constants.%ptr] // CHECK:STDOUT: %a.var: ref %ptr = var a // CHECK:STDOUT: %a: ref %ptr = bind_name a, %a.var // CHECK:STDOUT: %int_32.loc7: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc7: init type = call constants.%Int(%int_32.loc7) [template = constants.%i32] -// CHECK:STDOUT: %.loc7_12.1: type = value_of_initializer %int.make_type_signed.loc7 [template = constants.%i32] -// CHECK:STDOUT: %.loc7_12.2: type = converted %int.make_type_signed.loc7, %.loc7_12.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc7: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %const.loc7: type = const_type %i32 [template = constants.%const] // CHECK:STDOUT: %ptr.loc7: type = ptr_type %const [template = constants.%ptr] // CHECK:STDOUT: %a_ptr.var: ref %ptr = var a_ptr diff --git a/toolchain/check/testdata/deduce/array.carbon b/toolchain/check/testdata/deduce/array.carbon index 598049b5ebcdc..7d54e8d6624a7 100644 --- a/toolchain/check/testdata/deduce/array.carbon +++ b/toolchain/check/testdata/deduce/array.carbon @@ -113,14 +113,12 @@ fn G() -> C { // CHECK:STDOUT: %require_complete.2: = require_complete_type %array_type.1 [symbolic] // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] @@ -132,13 +130,13 @@ fn G() -> C { // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %array: %array_type.2 = tuple_value (%C.val, %C.val, %C.val) [template] // CHECK:STDOUT: %F.specific_fn: = specific_function %F, @F(%C) [template] -// CHECK:STDOUT: %complete_type.4: = complete_type_witness %array_type.2 [template] +// CHECK:STDOUT: %complete_type.5: = complete_type_witness %array_type.2 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -204,19 +202,17 @@ fn G() -> C { // CHECK:STDOUT: %a.ref: @F.%array_type.loc6_24.2 (%array_type.1) = name_ref a, %a // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc6_44.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc6_44.2: type = converted %int.make_type_signed, %.loc6_44.1 [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.2] // CHECK:STDOUT: %.loc6_43.1: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_0.2] // CHECK:STDOUT: %.loc6_43.2: %i32 = converted %int_0, %.loc6_43.1 [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc6_44.3: ref @F.%array_type.loc6_24.2 (%array_type.1) = value_as_ref %a.ref -// CHECK:STDOUT: %.loc6_44.4: ref @F.%T.loc6_6.2 (%T) = array_index %.loc6_44.3, %.loc6_43.2 -// CHECK:STDOUT: %.loc6_44.5: @F.%T.loc6_6.2 (%T) = bind_value %.loc6_44.4 -// CHECK:STDOUT: return %.loc6_44.5 +// CHECK:STDOUT: %.loc6_44.1: ref @F.%array_type.loc6_24.2 (%array_type.1) = value_as_ref %a.ref +// CHECK:STDOUT: %.loc6_44.2: ref @F.%T.loc6_6.2 (%T) = array_index %.loc6_44.1, %.loc6_43.2 +// CHECK:STDOUT: %.loc6_44.3: @F.%T.loc6_6.2 (%T) = bind_value %.loc6_44.2 +// CHECK:STDOUT: return %.loc6_44.3 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -268,7 +264,7 @@ fn G() -> C { // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete.loc6_27 => constants.%complete_type.1 -// CHECK:STDOUT: %require_complete.loc6_17 => constants.%complete_type.4 +// CHECK:STDOUT: %require_complete.loc6_17 => constants.%complete_type.5 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_todo_bound_only.carbon @@ -278,18 +274,16 @@ fn G() -> C { // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] // CHECK:STDOUT: %complete_type.1: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] -// CHECK:STDOUT: %N.1: %i32 = bind_symbolic_name N, 0 [symbolic] -// CHECK:STDOUT: %N.patt.1: %i32 = symbolic_binding_pattern N, 0 [symbolic] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] +// CHECK:STDOUT: %N.2: %i32 = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %N.patt.2: %i32 = symbolic_binding_pattern N, 0 [symbolic] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.type.13: type = fn_type @Convert.4, @impl.3(%int_32) [template] -// CHECK:STDOUT: %Convert.13: %Convert.type.13 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.13) [template] -// CHECK:STDOUT: %Convert.bound: = bound_method %N.1, %Convert.13 [symbolic] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.4(%int_32) [symbolic] -// CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %Convert.specific_fn(%N.1) [symbolic] +// CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.3, @impl.2(%int_32) [template] +// CHECK:STDOUT: %Convert.9: %Convert.type.9 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.9) [template] +// CHECK:STDOUT: %Convert.bound: = bound_method %N.2, %Convert.9 [symbolic] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.3(%int_32) [symbolic] +// CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %Convert.specific_fn(%N.2) [symbolic] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] @@ -307,7 +301,7 @@ fn G() -> C { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -323,32 +317,28 @@ fn G() -> C { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %N.patt.loc10_6.1: %i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc10_6.2 (constants.%N.patt.1)] -// CHECK:STDOUT: %N.param_patt: %i32 = value_param_pattern %N.patt.loc10_6.1, runtime_param [symbolic = %N.patt.loc10_6.2 (constants.%N.patt.1)] +// CHECK:STDOUT: %N.patt.loc10_6.1: %i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc10_6.2 (constants.%N.patt.2)] +// CHECK:STDOUT: %N.param_patt: %i32 = value_param_pattern %N.patt.loc10_6.1, runtime_param [symbolic = %N.patt.loc10_6.2 (constants.%N.patt.2)] // CHECK:STDOUT: %a.patt: = binding_pattern a // CHECK:STDOUT: %a.param_patt: = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc10_10: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc10_10: init type = call constants.%Int(%int_32.loc10_10) [template = constants.%i32] -// CHECK:STDOUT: %.loc10_10.1: type = value_of_initializer %int.make_type_signed.loc10_10 [template = constants.%i32] -// CHECK:STDOUT: %.loc10_10.2: type = converted %int.make_type_signed.loc10_10, %.loc10_10.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc10_10: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %N.ref.loc10_22: %i32 = name_ref N, %N.loc10_6.1 [symbolic = %N.loc10_6.2 (constants.%N.1)] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.13] +// CHECK:STDOUT: %N.ref.loc10_22: %i32 = name_ref N, %N.loc10_6.1 [symbolic = %N.loc10_6.2 (constants.%N.2)] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.9] // CHECK:STDOUT: %Convert.bound.loc10_22.1: = bound_method %N.ref.loc10_22, %impl.elem0 [symbolic = %Convert.bound.loc10_22.2 (constants.%Convert.bound)] -// CHECK:STDOUT: %Convert.specific_fn.loc10_22.1: = specific_function %Convert.bound.loc10_22.1, @Convert.4(constants.%int_32) [symbolic = %Convert.specific_fn.loc10_22.2 (constants.%Convert.specific_fn)] +// CHECK:STDOUT: %Convert.specific_fn.loc10_22.1: = specific_function %Convert.bound.loc10_22.1, @Convert.3(constants.%int_32) [symbolic = %Convert.specific_fn.loc10_22.2 (constants.%Convert.specific_fn)] // CHECK:STDOUT: %int.convert_checked.loc10_22.1: init Core.IntLiteral = call %Convert.specific_fn.loc10_22.1(%N.ref.loc10_22) [symbolic = %int.convert_checked.loc10_22.2 (constants.%int.convert_checked)] // CHECK:STDOUT: %.loc10_22.1: Core.IntLiteral = value_of_initializer %int.convert_checked.loc10_22.1 [symbolic = %int.convert_checked.loc10_22.2 (constants.%int.convert_checked)] // CHECK:STDOUT: %.loc10_22.2: Core.IntLiteral = converted %N.ref.loc10_22, %.loc10_22.1 [symbolic = %int.convert_checked.loc10_22.2 (constants.%int.convert_checked)] // CHECK:STDOUT: %array_type: type = array_type %.loc10_22.2, %C [template = ] // CHECK:STDOUT: %int_32.loc10_29: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc10_29: init type = call constants.%Int(%int_32.loc10_29) [template = constants.%i32] -// CHECK:STDOUT: %.loc10_29.1: type = value_of_initializer %int.make_type_signed.loc10_29 [template = constants.%i32] -// CHECK:STDOUT: %.loc10_29.2: type = converted %int.make_type_signed.loc10_29, %.loc10_29.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc10_29: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %N.param: %i32 = value_param runtime_param -// CHECK:STDOUT: %N.loc10_6.1: %i32 = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc10_6.2 (constants.%N.1)] +// CHECK:STDOUT: %N.loc10_6.1: %i32 = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc10_6.2 (constants.%N.2)] // CHECK:STDOUT: %a.param: = value_param runtime_param0 // CHECK:STDOUT: %a: = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 @@ -373,17 +363,17 @@ fn G() -> C { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @F(%N.loc10_6.1: %i32) { -// CHECK:STDOUT: %N.loc10_6.2: %i32 = bind_symbolic_name N, 0 [symbolic = %N.loc10_6.2 (constants.%N.1)] -// CHECK:STDOUT: %N.patt.loc10_6.2: %i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc10_6.2 (constants.%N.patt.1)] -// CHECK:STDOUT: %Convert.bound.loc10_22.2: = bound_method %N.loc10_6.2, constants.%Convert.13 [symbolic = %Convert.bound.loc10_22.2 (constants.%Convert.bound)] -// CHECK:STDOUT: %Convert.specific_fn.loc10_22.2: = specific_function %Convert.bound.loc10_22.2, @Convert.4(constants.%int_32) [symbolic = %Convert.specific_fn.loc10_22.2 (constants.%Convert.specific_fn)] +// CHECK:STDOUT: %N.loc10_6.2: %i32 = bind_symbolic_name N, 0 [symbolic = %N.loc10_6.2 (constants.%N.2)] +// CHECK:STDOUT: %N.patt.loc10_6.2: %i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc10_6.2 (constants.%N.patt.2)] +// CHECK:STDOUT: %Convert.bound.loc10_22.2: = bound_method %N.loc10_6.2, constants.%Convert.9 [symbolic = %Convert.bound.loc10_22.2 (constants.%Convert.bound)] +// CHECK:STDOUT: %Convert.specific_fn.loc10_22.2: = specific_function %Convert.bound.loc10_22.2, @Convert.3(constants.%int_32) [symbolic = %Convert.specific_fn.loc10_22.2 (constants.%Convert.specific_fn)] // CHECK:STDOUT: %int.convert_checked.loc10_22.2: init Core.IntLiteral = call %Convert.specific_fn.loc10_22.2(%N.loc10_6.2) [symbolic = %int.convert_checked.loc10_22.2 (constants.%int.convert_checked)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: fn[%N.param_patt: %i32](%a.param_patt: ) -> %i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %N.ref.loc10_42: %i32 = name_ref N, %N.loc10_6.1 [symbolic = %N.loc10_6.2 (constants.%N.1)] +// CHECK:STDOUT: %N.ref.loc10_42: %i32 = name_ref N, %N.loc10_6.1 [symbolic = %N.loc10_6.2 (constants.%N.2)] // CHECK:STDOUT: return %N.ref.loc10_42 // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -419,9 +409,9 @@ fn G() -> C { // CHECK:STDOUT: return to %return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @F(constants.%N.1) { -// CHECK:STDOUT: %N.loc10_6.2 => constants.%N.1 -// CHECK:STDOUT: %N.patt.loc10_6.2 => constants.%N.1 +// CHECK:STDOUT: specific @F(constants.%N.2) { +// CHECK:STDOUT: %N.loc10_6.2 => constants.%N.2 +// CHECK:STDOUT: %N.patt.loc10_6.2 => constants.%N.2 // CHECK:STDOUT: %Convert.bound.loc10_22.2 => constants.%Convert.bound // CHECK:STDOUT: %Convert.specific_fn.loc10_22.2 => constants.%Convert.specific_fn // CHECK:STDOUT: %int.convert_checked.loc10_22.2 => constants.%int.convert_checked @@ -436,18 +426,16 @@ fn G() -> C { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] -// CHECK:STDOUT: %N.1: %i32 = bind_symbolic_name N, 1 [symbolic] -// CHECK:STDOUT: %N.patt.1: %i32 = symbolic_binding_pattern N, 1 [symbolic] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] +// CHECK:STDOUT: %N.2: %i32 = bind_symbolic_name N, 1 [symbolic] +// CHECK:STDOUT: %N.patt.2: %i32 = symbolic_binding_pattern N, 1 [symbolic] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.type.13: type = fn_type @Convert.4, @impl.3(%int_32) [template] -// CHECK:STDOUT: %Convert.13: %Convert.type.13 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.13) [template] -// CHECK:STDOUT: %Convert.bound: = bound_method %N.1, %Convert.13 [symbolic] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.4(%int_32) [symbolic] -// CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %Convert.specific_fn(%N.1) [symbolic] +// CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.3, @impl.2(%int_32) [template] +// CHECK:STDOUT: %Convert.9: %Convert.type.9 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.9) [template] +// CHECK:STDOUT: %Convert.bound: = bound_method %N.2, %Convert.9 [symbolic] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.3(%int_32) [symbolic] +// CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %Convert.specific_fn(%N.2) [symbolic] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] @@ -465,7 +453,7 @@ fn G() -> C { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -483,22 +471,20 @@ fn G() -> C { // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %T.patt.loc10_6.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc10_6.2 (constants.%T.patt)] // CHECK:STDOUT: %T.param_patt: type = value_param_pattern %T.patt.loc10_6.1, runtime_param [symbolic = %T.patt.loc10_6.2 (constants.%T.patt)] -// CHECK:STDOUT: %N.patt.loc10_16.1: %i32 = symbolic_binding_pattern N, 1 [symbolic = %N.patt.loc10_16.2 (constants.%N.patt.1)] -// CHECK:STDOUT: %N.param_patt: %i32 = value_param_pattern %N.patt.loc10_16.1, runtime_param [symbolic = %N.patt.loc10_16.2 (constants.%N.patt.1)] +// CHECK:STDOUT: %N.patt.loc10_16.1: %i32 = symbolic_binding_pattern N, 1 [symbolic = %N.patt.loc10_16.2 (constants.%N.patt.2)] +// CHECK:STDOUT: %N.param_patt: %i32 = value_param_pattern %N.patt.loc10_16.1, runtime_param [symbolic = %N.patt.loc10_16.2 (constants.%N.patt.2)] // CHECK:STDOUT: %a.patt: = binding_pattern a // CHECK:STDOUT: %a.param_patt: = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %return.patt: @F.%T.loc10_6.2 (%T) = return_slot_pattern // CHECK:STDOUT: %return.param_patt: @F.%T.loc10_6.2 (%T) = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc10_20.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc10_20.2: type = converted %int.make_type_signed, %.loc10_20.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %T.ref.loc10_29: type = name_ref T, %T.loc10_6.1 [symbolic = %T.loc10_6.2 (constants.%T)] -// CHECK:STDOUT: %N.ref: %i32 = name_ref N, %N.loc10_16.1 [symbolic = %N.loc10_16.2 (constants.%N.1)] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.13] +// CHECK:STDOUT: %N.ref: %i32 = name_ref N, %N.loc10_16.1 [symbolic = %N.loc10_16.2 (constants.%N.2)] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.9] // CHECK:STDOUT: %Convert.bound.loc10_32.1: = bound_method %N.ref, %impl.elem0 [symbolic = %Convert.bound.loc10_32.2 (constants.%Convert.bound)] -// CHECK:STDOUT: %Convert.specific_fn.loc10_32.1: = specific_function %Convert.bound.loc10_32.1, @Convert.4(constants.%int_32) [symbolic = %Convert.specific_fn.loc10_32.2 (constants.%Convert.specific_fn)] +// CHECK:STDOUT: %Convert.specific_fn.loc10_32.1: = specific_function %Convert.bound.loc10_32.1, @Convert.3(constants.%int_32) [symbolic = %Convert.specific_fn.loc10_32.2 (constants.%Convert.specific_fn)] // CHECK:STDOUT: %int.convert_checked.loc10_32.1: init Core.IntLiteral = call %Convert.specific_fn.loc10_32.1(%N.ref) [symbolic = %int.convert_checked.loc10_32.2 (constants.%int.convert_checked)] // CHECK:STDOUT: %.loc10_32.1: Core.IntLiteral = value_of_initializer %int.convert_checked.loc10_32.1 [symbolic = %int.convert_checked.loc10_32.2 (constants.%int.convert_checked)] // CHECK:STDOUT: %.loc10_32.2: Core.IntLiteral = converted %N.ref, %.loc10_32.1 [symbolic = %int.convert_checked.loc10_32.2 (constants.%int.convert_checked)] @@ -507,7 +493,7 @@ fn G() -> C { // CHECK:STDOUT: %T.param: type = value_param runtime_param // CHECK:STDOUT: %T.loc10_6.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc10_6.2 (constants.%T)] // CHECK:STDOUT: %N.param: %i32 = value_param runtime_param -// CHECK:STDOUT: %N.loc10_16.1: %i32 = bind_symbolic_name N, 1, %N.param [symbolic = %N.loc10_16.2 (constants.%N.1)] +// CHECK:STDOUT: %N.loc10_16.1: %i32 = bind_symbolic_name N, 1, %N.param [symbolic = %N.loc10_16.2 (constants.%N.2)] // CHECK:STDOUT: %a.param: = value_param runtime_param0 // CHECK:STDOUT: %a: = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref @F.%T.loc10_6.2 (%T) = out_param runtime_param1 @@ -534,10 +520,10 @@ fn G() -> C { // CHECK:STDOUT: generic fn @F(%T.loc10_6.1: type, %N.loc10_16.1: %i32) { // CHECK:STDOUT: %T.loc10_6.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc10_6.2 (constants.%T)] // CHECK:STDOUT: %T.patt.loc10_6.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc10_6.2 (constants.%T.patt)] -// CHECK:STDOUT: %N.loc10_16.2: %i32 = bind_symbolic_name N, 1 [symbolic = %N.loc10_16.2 (constants.%N.1)] -// CHECK:STDOUT: %N.patt.loc10_16.2: %i32 = symbolic_binding_pattern N, 1 [symbolic = %N.patt.loc10_16.2 (constants.%N.patt.1)] -// CHECK:STDOUT: %Convert.bound.loc10_32.2: = bound_method %N.loc10_16.2, constants.%Convert.13 [symbolic = %Convert.bound.loc10_32.2 (constants.%Convert.bound)] -// CHECK:STDOUT: %Convert.specific_fn.loc10_32.2: = specific_function %Convert.bound.loc10_32.2, @Convert.4(constants.%int_32) [symbolic = %Convert.specific_fn.loc10_32.2 (constants.%Convert.specific_fn)] +// CHECK:STDOUT: %N.loc10_16.2: %i32 = bind_symbolic_name N, 1 [symbolic = %N.loc10_16.2 (constants.%N.2)] +// CHECK:STDOUT: %N.patt.loc10_16.2: %i32 = symbolic_binding_pattern N, 1 [symbolic = %N.patt.loc10_16.2 (constants.%N.patt.2)] +// CHECK:STDOUT: %Convert.bound.loc10_32.2: = bound_method %N.loc10_16.2, constants.%Convert.9 [symbolic = %Convert.bound.loc10_32.2 (constants.%Convert.bound)] +// CHECK:STDOUT: %Convert.specific_fn.loc10_32.2: = specific_function %Convert.bound.loc10_32.2, @Convert.3(constants.%int_32) [symbolic = %Convert.specific_fn.loc10_32.2 (constants.%Convert.specific_fn)] // CHECK:STDOUT: %int.convert_checked.loc10_32.2: init Core.IntLiteral = call %Convert.specific_fn.loc10_32.2(%N.loc10_16.2) [symbolic = %int.convert_checked.loc10_32.2 (constants.%int.convert_checked)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%T.param_patt: type, %N.param_patt: %i32](%a.param_patt: ) -> @F.%T.loc10_6.2 (%T); @@ -574,11 +560,11 @@ fn G() -> C { // CHECK:STDOUT: return to %return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @F(constants.%T, constants.%N.1) { +// CHECK:STDOUT: specific @F(constants.%T, constants.%N.2) { // CHECK:STDOUT: %T.loc10_6.2 => constants.%T // CHECK:STDOUT: %T.patt.loc10_6.2 => constants.%T -// CHECK:STDOUT: %N.loc10_16.2 => constants.%N.1 -// CHECK:STDOUT: %N.patt.loc10_16.2 => constants.%N.1 +// CHECK:STDOUT: %N.loc10_16.2 => constants.%N.2 +// CHECK:STDOUT: %N.patt.loc10_16.2 => constants.%N.2 // CHECK:STDOUT: %Convert.bound.loc10_32.2 => constants.%Convert.bound // CHECK:STDOUT: %Convert.specific_fn.loc10_32.2 => constants.%Convert.specific_fn // CHECK:STDOUT: %int.convert_checked.loc10_32.2 => constants.%int.convert_checked @@ -600,14 +586,12 @@ fn G() -> C { // CHECK:STDOUT: %require_complete.2: = require_complete_type %array_type.1 [symbolic] // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] @@ -620,13 +604,13 @@ fn G() -> C { // CHECK:STDOUT: %array: %array_type.2 = tuple_value (%C.val, %C.val, %C.val) [template] // CHECK:STDOUT: %array_type.3: type = array_type %int_2, %C [template] // CHECK:STDOUT: %F.specific_fn: = specific_function %F, @F(%C) [template] -// CHECK:STDOUT: %complete_type.4: = complete_type_witness %array_type.3 [template] +// CHECK:STDOUT: %complete_type.5: = complete_type_witness %array_type.3 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -692,19 +676,17 @@ fn G() -> C { // CHECK:STDOUT: %a.ref: @F.%array_type.loc6_24.2 (%array_type.1) = name_ref a, %a // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc6_44.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc6_44.2: type = converted %int.make_type_signed, %.loc6_44.1 [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.2] // CHECK:STDOUT: %.loc6_43.1: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_0.2] // CHECK:STDOUT: %.loc6_43.2: %i32 = converted %int_0, %.loc6_43.1 [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc6_44.3: ref @F.%array_type.loc6_24.2 (%array_type.1) = value_as_ref %a.ref -// CHECK:STDOUT: %.loc6_44.4: ref @F.%T.loc6_6.2 (%T) = array_index %.loc6_44.3, %.loc6_43.2 -// CHECK:STDOUT: %.loc6_44.5: @F.%T.loc6_6.2 (%T) = bind_value %.loc6_44.4 -// CHECK:STDOUT: return %.loc6_44.5 +// CHECK:STDOUT: %.loc6_44.1: ref @F.%array_type.loc6_24.2 (%array_type.1) = value_as_ref %a.ref +// CHECK:STDOUT: %.loc6_44.2: ref @F.%T.loc6_6.2 (%T) = array_index %.loc6_44.1, %.loc6_43.2 +// CHECK:STDOUT: %.loc6_44.3: @F.%T.loc6_6.2 (%T) = bind_value %.loc6_44.2 +// CHECK:STDOUT: return %.loc6_44.3 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -756,7 +738,7 @@ fn G() -> C { // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete.loc6_27 => constants.%complete_type.1 -// CHECK:STDOUT: %require_complete.loc6_17 => constants.%complete_type.4 +// CHECK:STDOUT: %require_complete.loc6_17 => constants.%complete_type.5 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_type_mismatch.carbon @@ -767,18 +749,16 @@ fn G() -> C { // CHECK:STDOUT: %complete_type.1: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %D: type = class_type @D [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] -// CHECK:STDOUT: %N.1: %i32 = bind_symbolic_name N, 0 [symbolic] -// CHECK:STDOUT: %N.patt.1: %i32 = symbolic_binding_pattern N, 0 [symbolic] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] +// CHECK:STDOUT: %N.2: %i32 = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %N.patt.2: %i32 = symbolic_binding_pattern N, 0 [symbolic] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.type.13: type = fn_type @Convert.4, @impl.3(%int_32) [template] -// CHECK:STDOUT: %Convert.13: %Convert.type.13 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.13) [template] -// CHECK:STDOUT: %Convert.bound: = bound_method %N.1, %Convert.13 [symbolic] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.4(%int_32) [symbolic] -// CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %Convert.specific_fn(%N.1) [symbolic] +// CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.3, @impl.2(%int_32) [template] +// CHECK:STDOUT: %Convert.9: %Convert.type.9 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.9) [template] +// CHECK:STDOUT: %Convert.bound: = bound_method %N.2, %Convert.9 [symbolic] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.3(%int_32) [symbolic] +// CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %Convert.specific_fn(%N.2) [symbolic] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] @@ -796,7 +776,7 @@ fn G() -> C { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -814,32 +794,28 @@ fn G() -> C { // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: %D.decl: type = class_decl @D [template = constants.%D] {} {} // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %N.patt.loc10_6.1: %i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc10_6.2 (constants.%N.patt.1)] -// CHECK:STDOUT: %N.param_patt: %i32 = value_param_pattern %N.patt.loc10_6.1, runtime_param [symbolic = %N.patt.loc10_6.2 (constants.%N.patt.1)] +// CHECK:STDOUT: %N.patt.loc10_6.1: %i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc10_6.2 (constants.%N.patt.2)] +// CHECK:STDOUT: %N.param_patt: %i32 = value_param_pattern %N.patt.loc10_6.1, runtime_param [symbolic = %N.patt.loc10_6.2 (constants.%N.patt.2)] // CHECK:STDOUT: %a.patt: = binding_pattern a // CHECK:STDOUT: %a.param_patt: = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc10_10: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc10_10: init type = call constants.%Int(%int_32.loc10_10) [template = constants.%i32] -// CHECK:STDOUT: %.loc10_10.1: type = value_of_initializer %int.make_type_signed.loc10_10 [template = constants.%i32] -// CHECK:STDOUT: %.loc10_10.2: type = converted %int.make_type_signed.loc10_10, %.loc10_10.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc10_10: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %N.ref.loc10_22: %i32 = name_ref N, %N.loc10_6.1 [symbolic = %N.loc10_6.2 (constants.%N.1)] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.13] +// CHECK:STDOUT: %N.ref.loc10_22: %i32 = name_ref N, %N.loc10_6.1 [symbolic = %N.loc10_6.2 (constants.%N.2)] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.9] // CHECK:STDOUT: %Convert.bound.loc10_22.1: = bound_method %N.ref.loc10_22, %impl.elem0 [symbolic = %Convert.bound.loc10_22.2 (constants.%Convert.bound)] -// CHECK:STDOUT: %Convert.specific_fn.loc10_22.1: = specific_function %Convert.bound.loc10_22.1, @Convert.4(constants.%int_32) [symbolic = %Convert.specific_fn.loc10_22.2 (constants.%Convert.specific_fn)] +// CHECK:STDOUT: %Convert.specific_fn.loc10_22.1: = specific_function %Convert.bound.loc10_22.1, @Convert.3(constants.%int_32) [symbolic = %Convert.specific_fn.loc10_22.2 (constants.%Convert.specific_fn)] // CHECK:STDOUT: %int.convert_checked.loc10_22.1: init Core.IntLiteral = call %Convert.specific_fn.loc10_22.1(%N.ref.loc10_22) [symbolic = %int.convert_checked.loc10_22.2 (constants.%int.convert_checked)] // CHECK:STDOUT: %.loc10_22.1: Core.IntLiteral = value_of_initializer %int.convert_checked.loc10_22.1 [symbolic = %int.convert_checked.loc10_22.2 (constants.%int.convert_checked)] // CHECK:STDOUT: %.loc10_22.2: Core.IntLiteral = converted %N.ref.loc10_22, %.loc10_22.1 [symbolic = %int.convert_checked.loc10_22.2 (constants.%int.convert_checked)] // CHECK:STDOUT: %array_type: type = array_type %.loc10_22.2, %C [template = ] // CHECK:STDOUT: %int_32.loc10_29: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc10_29: init type = call constants.%Int(%int_32.loc10_29) [template = constants.%i32] -// CHECK:STDOUT: %.loc10_29.1: type = value_of_initializer %int.make_type_signed.loc10_29 [template = constants.%i32] -// CHECK:STDOUT: %.loc10_29.2: type = converted %int.make_type_signed.loc10_29, %.loc10_29.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc10_29: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %N.param: %i32 = value_param runtime_param -// CHECK:STDOUT: %N.loc10_6.1: %i32 = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc10_6.2 (constants.%N.1)] +// CHECK:STDOUT: %N.loc10_6.1: %i32 = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc10_6.2 (constants.%N.2)] // CHECK:STDOUT: %a.param: = value_param runtime_param0 // CHECK:STDOUT: %a: = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 @@ -872,17 +848,17 @@ fn G() -> C { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @F(%N.loc10_6.1: %i32) { -// CHECK:STDOUT: %N.loc10_6.2: %i32 = bind_symbolic_name N, 0 [symbolic = %N.loc10_6.2 (constants.%N.1)] -// CHECK:STDOUT: %N.patt.loc10_6.2: %i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc10_6.2 (constants.%N.patt.1)] -// CHECK:STDOUT: %Convert.bound.loc10_22.2: = bound_method %N.loc10_6.2, constants.%Convert.13 [symbolic = %Convert.bound.loc10_22.2 (constants.%Convert.bound)] -// CHECK:STDOUT: %Convert.specific_fn.loc10_22.2: = specific_function %Convert.bound.loc10_22.2, @Convert.4(constants.%int_32) [symbolic = %Convert.specific_fn.loc10_22.2 (constants.%Convert.specific_fn)] +// CHECK:STDOUT: %N.loc10_6.2: %i32 = bind_symbolic_name N, 0 [symbolic = %N.loc10_6.2 (constants.%N.2)] +// CHECK:STDOUT: %N.patt.loc10_6.2: %i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc10_6.2 (constants.%N.patt.2)] +// CHECK:STDOUT: %Convert.bound.loc10_22.2: = bound_method %N.loc10_6.2, constants.%Convert.9 [symbolic = %Convert.bound.loc10_22.2 (constants.%Convert.bound)] +// CHECK:STDOUT: %Convert.specific_fn.loc10_22.2: = specific_function %Convert.bound.loc10_22.2, @Convert.3(constants.%int_32) [symbolic = %Convert.specific_fn.loc10_22.2 (constants.%Convert.specific_fn)] // CHECK:STDOUT: %int.convert_checked.loc10_22.2: init Core.IntLiteral = call %Convert.specific_fn.loc10_22.2(%N.loc10_6.2) [symbolic = %int.convert_checked.loc10_22.2 (constants.%int.convert_checked)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: fn[%N.param_patt: %i32](%a.param_patt: ) -> %i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %N.ref.loc10_42: %i32 = name_ref N, %N.loc10_6.1 [symbolic = %N.loc10_6.2 (constants.%N.1)] +// CHECK:STDOUT: %N.ref.loc10_42: %i32 = name_ref N, %N.loc10_6.1 [symbolic = %N.loc10_6.2 (constants.%N.2)] // CHECK:STDOUT: return %N.ref.loc10_42 // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -918,9 +894,9 @@ fn G() -> C { // CHECK:STDOUT: return to %return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @F(constants.%N.1) { -// CHECK:STDOUT: %N.loc10_6.2 => constants.%N.1 -// CHECK:STDOUT: %N.patt.loc10_6.2 => constants.%N.1 +// CHECK:STDOUT: specific @F(constants.%N.2) { +// CHECK:STDOUT: %N.loc10_6.2 => constants.%N.2 +// CHECK:STDOUT: %N.patt.loc10_6.2 => constants.%N.2 // CHECK:STDOUT: %Convert.bound.loc10_22.2 => constants.%Convert.bound // CHECK:STDOUT: %Convert.specific_fn.loc10_22.2 => constants.%Convert.specific_fn // CHECK:STDOUT: %int.convert_checked.loc10_22.2 => constants.%int.convert_checked diff --git a/toolchain/check/testdata/deduce/generic_type.carbon b/toolchain/check/testdata/deduce/generic_type.carbon index bca8f464f5c13..12e4bd39d9d35 100644 --- a/toolchain/check/testdata/deduce/generic_type.carbon +++ b/toolchain/check/testdata/deduce/generic_type.carbon @@ -757,27 +757,25 @@ fn G() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] -// CHECK:STDOUT: %N.1: %i32 = bind_symbolic_name N, 0 [symbolic] -// CHECK:STDOUT: %N.patt.1: %i32 = symbolic_binding_pattern N, 0 [symbolic] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] +// CHECK:STDOUT: %N.2: %i32 = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %N.patt.2: %i32 = symbolic_binding_pattern N, 0 [symbolic] // CHECK:STDOUT: %WithNontype.type: type = generic_class_type @WithNontype [template] // CHECK:STDOUT: %WithNontype.generic: %WithNontype.type = struct_value () [template] -// CHECK:STDOUT: %WithNontype.1: type = class_type @WithNontype, @WithNontype(%N.1) [symbolic] +// CHECK:STDOUT: %WithNontype.1: type = class_type @WithNontype, @WithNontype(%N.2) [symbolic] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] -// CHECK:STDOUT: %complete_type.1: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %complete_type.2: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %require_complete.1: = require_complete_type %WithNontype.1 [symbolic] +// CHECK:STDOUT: %require_complete.2: = require_complete_type %WithNontype.1 [symbolic] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] // CHECK:STDOUT: %WithNontype.2: type = class_type @WithNontype, @WithNontype(%int_0.2) [template] @@ -788,7 +786,7 @@ fn G() -> i32 { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -803,37 +801,31 @@ fn G() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %WithNontype.decl: %WithNontype.type = class_decl @WithNontype [template = constants.%WithNontype.generic] { -// CHECK:STDOUT: %N.patt.loc4_19.1: %i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc4_19.2 (constants.%N.patt.1)] -// CHECK:STDOUT: %N.param_patt: %i32 = value_param_pattern %N.patt.loc4_19.1, runtime_param [symbolic = %N.patt.loc4_19.2 (constants.%N.patt.1)] +// CHECK:STDOUT: %N.patt.loc4_19.1: %i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc4_19.2 (constants.%N.patt.2)] +// CHECK:STDOUT: %N.param_patt: %i32 = value_param_pattern %N.patt.loc4_19.1, runtime_param [symbolic = %N.patt.loc4_19.2 (constants.%N.patt.2)] // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc4_23.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc4_23.2: type = converted %int.make_type_signed, %.loc4_23.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %N.param: %i32 = value_param runtime_param -// CHECK:STDOUT: %N.loc4_19.1: %i32 = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc4_19.2 (constants.%N.1)] +// CHECK:STDOUT: %N.loc4_19.1: %i32 = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc4_19.2 (constants.%N.2)] // CHECK:STDOUT: } // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %N.patt.loc6_6.1: %i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc6_6.2 (constants.%N.patt.1)] -// CHECK:STDOUT: %N.param_patt: %i32 = value_param_pattern %N.patt.loc6_6.1, runtime_param [symbolic = %N.patt.loc6_6.2 (constants.%N.patt.1)] +// CHECK:STDOUT: %N.patt.loc6_6.1: %i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc6_6.2 (constants.%N.patt.2)] +// CHECK:STDOUT: %N.param_patt: %i32 = value_param_pattern %N.patt.loc6_6.1, runtime_param [symbolic = %N.patt.loc6_6.2 (constants.%N.patt.2)] // CHECK:STDOUT: %x.patt: @F.%WithNontype.loc6_31.2 (%WithNontype.1) = binding_pattern x // CHECK:STDOUT: %x.param_patt: @F.%WithNontype.loc6_31.2 (%WithNontype.1) = value_param_pattern %x.patt, runtime_param0 // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc6_10: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc6_10: init type = call constants.%Int(%int_32.loc6_10) [template = constants.%i32] -// CHECK:STDOUT: %.loc6_10.1: type = value_of_initializer %int.make_type_signed.loc6_10 [template = constants.%i32] -// CHECK:STDOUT: %.loc6_10.2: type = converted %int.make_type_signed.loc6_10, %.loc6_10.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc6_10: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %WithNontype.ref: %WithNontype.type = name_ref WithNontype, file.%WithNontype.decl [template = constants.%WithNontype.generic] -// CHECK:STDOUT: %N.ref.loc6_30: %i32 = name_ref N, %N.loc6_6.1 [symbolic = %N.loc6_6.2 (constants.%N.1)] -// CHECK:STDOUT: %WithNontype.loc6_31.1: type = class_type @WithNontype, @WithNontype(constants.%N.1) [symbolic = %WithNontype.loc6_31.2 (constants.%WithNontype.1)] +// CHECK:STDOUT: %N.ref.loc6_30: %i32 = name_ref N, %N.loc6_6.1 [symbolic = %N.loc6_6.2 (constants.%N.2)] +// CHECK:STDOUT: %WithNontype.loc6_31.1: type = class_type @WithNontype, @WithNontype(constants.%N.2) [symbolic = %WithNontype.loc6_31.2 (constants.%WithNontype.1)] // CHECK:STDOUT: %int_32.loc6_37: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc6_37: init type = call constants.%Int(%int_32.loc6_37) [template = constants.%i32] -// CHECK:STDOUT: %.loc6_37.1: type = value_of_initializer %int.make_type_signed.loc6_37 [template = constants.%i32] -// CHECK:STDOUT: %.loc6_37.2: type = converted %int.make_type_signed.loc6_37, %.loc6_37.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc6_37: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %N.param: %i32 = value_param runtime_param -// CHECK:STDOUT: %N.loc6_6.1: %i32 = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc6_6.2 (constants.%N.1)] +// CHECK:STDOUT: %N.loc6_6.1: %i32 = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc6_6.2 (constants.%N.2)] // CHECK:STDOUT: %x.param: @F.%WithNontype.loc6_31.2 (%WithNontype.1) = value_param runtime_param0 // CHECK:STDOUT: %x: @F.%WithNontype.loc6_31.2 (%WithNontype.1) = bind_name x, %x.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 @@ -844,22 +836,20 @@ fn G() -> i32 { // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc8_11.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc8_11.2: type = converted %int.make_type_signed, %.loc8_11.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic class @WithNontype(%N.loc4_19.1: %i32) { -// CHECK:STDOUT: %N.loc4_19.2: %i32 = bind_symbolic_name N, 0 [symbolic = %N.loc4_19.2 (constants.%N.1)] -// CHECK:STDOUT: %N.patt.loc4_19.2: %i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc4_19.2 (constants.%N.patt.1)] +// CHECK:STDOUT: %N.loc4_19.2: %i32 = bind_symbolic_name N, 0 [symbolic = %N.loc4_19.2 (constants.%N.2)] +// CHECK:STDOUT: %N.patt.loc4_19.2: %i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc4_19.2 (constants.%N.patt.2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: class { -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.2] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%WithNontype.1 @@ -868,16 +858,16 @@ fn G() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @F(%N.loc6_6.1: %i32) { -// CHECK:STDOUT: %N.loc6_6.2: %i32 = bind_symbolic_name N, 0 [symbolic = %N.loc6_6.2 (constants.%N.1)] -// CHECK:STDOUT: %N.patt.loc6_6.2: %i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc6_6.2 (constants.%N.patt.1)] +// CHECK:STDOUT: %N.loc6_6.2: %i32 = bind_symbolic_name N, 0 [symbolic = %N.loc6_6.2 (constants.%N.2)] +// CHECK:STDOUT: %N.patt.loc6_6.2: %i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc6_6.2 (constants.%N.patt.2)] // CHECK:STDOUT: %WithNontype.loc6_31.2: type = class_type @WithNontype, @WithNontype(%N.loc6_6.2) [symbolic = %WithNontype.loc6_31.2 (constants.%WithNontype.1)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete: = require_complete_type @F.%WithNontype.loc6_31.2 (%WithNontype.1) [symbolic = %require_complete (constants.%require_complete.1)] +// CHECK:STDOUT: %require_complete: = require_complete_type @F.%WithNontype.loc6_31.2 (%WithNontype.1) [symbolic = %require_complete (constants.%require_complete.2)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%N.param_patt: %i32](%x.param_patt: @F.%WithNontype.loc6_31.2 (%WithNontype.1)) -> %i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %N.ref.loc6_50: %i32 = name_ref N, %N.loc6_6.1 [symbolic = %N.loc6_6.2 (constants.%N.1)] +// CHECK:STDOUT: %N.ref.loc6_50: %i32 = name_ref N, %N.loc6_6.1 [symbolic = %N.loc6_6.2 (constants.%N.2)] // CHECK:STDOUT: return %N.ref.loc6_50 // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -888,7 +878,7 @@ fn G() -> i32 { // CHECK:STDOUT: %.loc9_13.1: %empty_struct_type = struct_literal () // CHECK:STDOUT: %WithNontype.ref: %WithNontype.type = name_ref WithNontype, file.%WithNontype.decl [template = constants.%WithNontype.generic] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.2] @@ -907,21 +897,21 @@ fn G() -> i32 { // CHECK:STDOUT: return %.loc9_33.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @WithNontype(constants.%N.1) { -// CHECK:STDOUT: %N.loc4_19.2 => constants.%N.1 -// CHECK:STDOUT: %N.patt.loc4_19.2 => constants.%N.1 +// CHECK:STDOUT: specific @WithNontype(constants.%N.2) { +// CHECK:STDOUT: %N.loc4_19.2 => constants.%N.2 +// CHECK:STDOUT: %N.patt.loc4_19.2 => constants.%N.2 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @WithNontype(@F.%N.loc6_6.2) { -// CHECK:STDOUT: %N.loc4_19.2 => constants.%N.1 -// CHECK:STDOUT: %N.patt.loc4_19.2 => constants.%N.1 +// CHECK:STDOUT: %N.loc4_19.2 => constants.%N.2 +// CHECK:STDOUT: %N.patt.loc4_19.2 => constants.%N.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @F(constants.%N.1) { -// CHECK:STDOUT: %N.loc6_6.2 => constants.%N.1 -// CHECK:STDOUT: %N.patt.loc6_6.2 => constants.%N.1 +// CHECK:STDOUT: specific @F(constants.%N.2) { +// CHECK:STDOUT: %N.loc6_6.2 => constants.%N.2 +// CHECK:STDOUT: %N.patt.loc6_6.2 => constants.%N.2 // CHECK:STDOUT: %WithNontype.loc6_31.2 => constants.%WithNontype.1 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -938,6 +928,6 @@ fn G() -> i32 { // CHECK:STDOUT: %WithNontype.loc6_31.2 => constants.%WithNontype.2 // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete => constants.%complete_type.1 +// CHECK:STDOUT: %require_complete => constants.%complete_type.2 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/deduce/int_float.carbon b/toolchain/check/testdata/deduce/int_float.carbon index 90b616c100b49..e6fefe00175bc 100644 --- a/toolchain/check/testdata/deduce/int_float.carbon +++ b/toolchain/check/testdata/deduce/int_float.carbon @@ -43,18 +43,19 @@ fn G(a: f64) -> Core.IntLiteral() { // CHECK:STDOUT: %IntLiteral: %IntLiteral.type = struct_value () [template] // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic] +// CHECK:STDOUT: %Int.type: type = generic_class_type @Int [template] +// CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [template] +// CHECK:STDOUT: %Int: type = class_type @Int, @Int(%N) [symbolic] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %require_complete: = require_complete_type %iN [symbolic] +// CHECK:STDOUT: %require_complete.2: = require_complete_type %Int [symbolic] // CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [template] -// CHECK:STDOUT: %i64: type = int_type signed, %int_64 [template] +// CHECK:STDOUT: %i64: type = class_type @Int, @Int(%int_64) [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] +// CHECK:STDOUT: %i64.builtin: type = int_type signed, %int_64 [template] +// CHECK:STDOUT: %complete_type.2: = complete_type_witness %i64.builtin [template] // CHECK:STDOUT: %F.specific_fn: = specific_function %F, @F(%int_64) [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %i64 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -64,8 +65,8 @@ fn G(a: f64) -> Core.IntLiteral() { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: %IntLiteral.type = import_ref Core//prelude/types, IntLiteral, loaded [template = constants.%IntLiteral] -// CHECK:STDOUT: %import_ref.2: %Int.type = import_ref Core//prelude/types, Int, loaded [template = constants.%Int] +// CHECK:STDOUT: %import_ref.1: %IntLiteral.type = import_ref Core//prelude/types/int_literal, IntLiteral, loaded [template = constants.%IntLiteral] +// CHECK:STDOUT: %import_ref.2: %Int.type = import_ref Core//prelude/types/int, Int, loaded [template = constants.%Int.generic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -78,8 +79,8 @@ fn G(a: f64) -> Core.IntLiteral() { // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %N.patt.loc4_6.1: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc4_6.2 (constants.%N.patt)] // CHECK:STDOUT: %N.param_patt: Core.IntLiteral = value_param_pattern %N.patt.loc4_6.1, runtime_param [symbolic = %N.patt.loc4_6.2 (constants.%N.patt)] -// CHECK:STDOUT: %n.patt: @F.%iN (%iN) = binding_pattern n -// CHECK:STDOUT: %n.param_patt: @F.%iN (%iN) = value_param_pattern %n.patt, runtime_param0 +// CHECK:STDOUT: %n.patt: @F.%Int.loc4_42.2 (%Int) = binding_pattern n +// CHECK:STDOUT: %n.param_patt: @F.%Int.loc4_42.2 (%Int) = value_param_pattern %n.patt, runtime_param0 // CHECK:STDOUT: %return.patt: Core.IntLiteral = return_slot_pattern // CHECK:STDOUT: %return.param_patt: Core.IntLiteral = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { @@ -89,11 +90,9 @@ fn G(a: f64) -> Core.IntLiteral() { // CHECK:STDOUT: %.loc4_26.1: type = value_of_initializer %int_literal.make_type.loc4_26 [template = Core.IntLiteral] // CHECK:STDOUT: %.loc4_26.2: type = converted %int_literal.make_type.loc4_26, %.loc4_26.1 [template = Core.IntLiteral] // CHECK:STDOUT: %Core.ref.loc4_32: = name_ref Core, imports.%Core [template = imports.%Core] -// CHECK:STDOUT: %Int.ref: %Int.type = name_ref Int, imports.%import_ref.2 [template = constants.%Int] +// CHECK:STDOUT: %Int.ref: %Int.type = name_ref Int, imports.%import_ref.2 [template = constants.%Int.generic] // CHECK:STDOUT: %N.ref.loc4: Core.IntLiteral = name_ref N, %N.loc4_6.1 [symbolic = %N.loc4_6.2 (constants.%N)] -// CHECK:STDOUT: %int.make_type_signed: init type = call %Int.ref(%N.ref.loc4) [symbolic = %iN (constants.%iN)] -// CHECK:STDOUT: %.loc4_42.1: type = value_of_initializer %int.make_type_signed [symbolic = %iN (constants.%iN)] -// CHECK:STDOUT: %.loc4_42.2: type = converted %int.make_type_signed, %.loc4_42.1 [symbolic = %iN (constants.%iN)] +// CHECK:STDOUT: %Int.loc4_42.1: type = class_type @Int, @Int(constants.%N) [symbolic = %Int.loc4_42.2 (constants.%Int)] // CHECK:STDOUT: %Core.ref.loc4_48: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %IntLiteral.ref.loc4_52: %IntLiteral.type = name_ref IntLiteral, imports.%import_ref.1 [template = constants.%IntLiteral] // CHECK:STDOUT: %int_literal.make_type.loc4_64: init type = call %IntLiteral.ref.loc4_52() [template = Core.IntLiteral] @@ -101,8 +100,8 @@ fn G(a: f64) -> Core.IntLiteral() { // CHECK:STDOUT: %.loc4_64.2: type = converted %int_literal.make_type.loc4_64, %.loc4_64.1 [template = Core.IntLiteral] // CHECK:STDOUT: %N.param: Core.IntLiteral = value_param runtime_param // CHECK:STDOUT: %N.loc4_6.1: Core.IntLiteral = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc4_6.2 (constants.%N)] -// CHECK:STDOUT: %n.param: @F.%iN (%iN) = value_param runtime_param0 -// CHECK:STDOUT: %n: @F.%iN (%iN) = bind_name n, %n.param +// CHECK:STDOUT: %n.param: @F.%Int.loc4_42.2 (%Int) = value_param runtime_param0 +// CHECK:STDOUT: %n: @F.%Int.loc4_42.2 (%Int) = bind_name n, %n.param // CHECK:STDOUT: %return.param: ref Core.IntLiteral = out_param runtime_param1 // CHECK:STDOUT: %return: ref Core.IntLiteral = return_slot %return.param // CHECK:STDOUT: } @@ -113,9 +112,7 @@ fn G(a: f64) -> Core.IntLiteral() { // CHECK:STDOUT: %return.param_patt: Core.IntLiteral = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_64) [template = constants.%i64] -// CHECK:STDOUT: %.loc8_9.1: type = value_of_initializer %int.make_type_signed [template = constants.%i64] -// CHECK:STDOUT: %.loc8_9.2: type = converted %int.make_type_signed, %.loc8_9.1 [template = constants.%i64] +// CHECK:STDOUT: %i64: type = class_type @Int, @Int(constants.%int_64) [template = constants.%i64] // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, imports.%import_ref.1 [template = constants.%IntLiteral] // CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral] @@ -131,12 +128,12 @@ fn G(a: f64) -> Core.IntLiteral() { // CHECK:STDOUT: generic fn @F(%N.loc4_6.1: Core.IntLiteral) { // CHECK:STDOUT: %N.loc4_6.2: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N.loc4_6.2 (constants.%N)] // CHECK:STDOUT: %N.patt.loc4_6.2: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc4_6.2 (constants.%N.patt)] -// CHECK:STDOUT: %iN: type = int_type signed, %N.loc4_6.2 [symbolic = %iN (constants.%iN)] +// CHECK:STDOUT: %Int.loc4_42.2: type = class_type @Int, @Int(%N.loc4_6.2) [symbolic = %Int.loc4_42.2 (constants.%Int)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete: = require_complete_type @F.%iN (%iN) [symbolic = %require_complete (constants.%require_complete)] +// CHECK:STDOUT: %require_complete: = require_complete_type @F.%Int.loc4_42.2 (%Int) [symbolic = %require_complete (constants.%require_complete.2)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%N.param_patt: Core.IntLiteral](%n.param_patt: @F.%iN (%iN)) -> Core.IntLiteral { +// CHECK:STDOUT: fn[%N.param_patt: Core.IntLiteral](%n.param_patt: @F.%Int.loc4_42.2 (%Int)) -> Core.IntLiteral { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %N.ref.loc5: Core.IntLiteral = name_ref N, %N.loc4_6.1 [symbolic = %N.loc4_6.2 (constants.%N)] // CHECK:STDOUT: return %N.ref.loc5 @@ -157,16 +154,16 @@ fn G(a: f64) -> Core.IntLiteral() { // CHECK:STDOUT: specific @F(constants.%N) { // CHECK:STDOUT: %N.loc4_6.2 => constants.%N // CHECK:STDOUT: %N.patt.loc4_6.2 => constants.%N -// CHECK:STDOUT: %iN => constants.%iN +// CHECK:STDOUT: %Int.loc4_42.2 => constants.%Int // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%int_64) { // CHECK:STDOUT: %N.loc4_6.2 => constants.%int_64 // CHECK:STDOUT: %N.patt.loc4_6.2 => constants.%int_64 -// CHECK:STDOUT: %iN => constants.%i64 +// CHECK:STDOUT: %Int.loc4_42.2 => constants.%i64 // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete => constants.%complete_type +// CHECK:STDOUT: %require_complete => constants.%complete_type.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_todo_float.carbon @@ -192,7 +189,7 @@ fn G(a: f64) -> Core.IntLiteral() { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: %IntLiteral.type = import_ref Core//prelude/types, IntLiteral, loaded [template = constants.%IntLiteral] +// CHECK:STDOUT: %import_ref.1: %IntLiteral.type = import_ref Core//prelude/types/int_literal, IntLiteral, loaded [template = constants.%IntLiteral] // CHECK:STDOUT: %import_ref.2: %Float.type = import_ref Core//prelude/types, Float, loaded [template = constants.%Float] // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/deduce/tuple.carbon b/toolchain/check/testdata/deduce/tuple.carbon index 1b6a7ba588e1b..223a9ccd4dcff 100644 --- a/toolchain/check/testdata/deduce/tuple.carbon +++ b/toolchain/check/testdata/deduce/tuple.carbon @@ -225,9 +225,7 @@ fn G(pair: (C, D)) -> D { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (type, type) [template] // CHECK:STDOUT: %tuple.type.2: type = tuple_type (%i32, %i32) [template] // CHECK:STDOUT: %Pair: %tuple.type.2 = bind_symbolic_name Pair, 0 [symbolic] @@ -236,7 +234,7 @@ fn G(pair: (C, D)) -> D { // CHECK:STDOUT: %HasPair.generic: %HasPair.type = struct_value () [template] // CHECK:STDOUT: %HasPair.1: type = class_type @HasPair, @HasPair(%Pair) [symbolic] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] -// CHECK:STDOUT: %complete_type.1: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %complete_type.2: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %A: %i32 = bind_symbolic_name A, 0 [symbolic] // CHECK:STDOUT: %A.patt: %i32 = symbolic_binding_pattern A, 0 [symbolic] // CHECK:STDOUT: %B: %i32 = bind_symbolic_name B, 1 [symbolic] @@ -245,18 +243,18 @@ fn G(pair: (C, D)) -> D { // CHECK:STDOUT: %HasPair.2: type = class_type @HasPair, @HasPair(%tuple.1) [symbolic] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %require_complete.1: = require_complete_type %HasPair.2 [symbolic] +// CHECK:STDOUT: %require_complete.2: = require_complete_type %HasPair.2 [symbolic] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %tuple.type.3: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] // CHECK:STDOUT: %tuple.2: %tuple.type.2 = tuple_value (%int_1.2, %int_2.2) [template] @@ -269,7 +267,7 @@ fn G(pair: (C, D)) -> D { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -288,15 +286,11 @@ fn G(pair: (C, D)) -> D { // CHECK:STDOUT: %Pair.param_patt: %tuple.type.2 = value_param_pattern %Pair.patt.loc4_15.1, runtime_param [symbolic = %Pair.patt.loc4_15.2 (constants.%Pair.patt)] // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc4_23: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc4_23: init type = call constants.%Int(%int_32.loc4_23) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc4_23: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc4_28: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc4_28: init type = call constants.%Int(%int_32.loc4_28) [template = constants.%i32] -// CHECK:STDOUT: %.loc4_31.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc4_23, %int.make_type_signed.loc4_28) -// CHECK:STDOUT: %.loc4_31.2: type = value_of_initializer %int.make_type_signed.loc4_23 [template = constants.%i32] -// CHECK:STDOUT: %.loc4_31.3: type = converted %int.make_type_signed.loc4_23, %.loc4_31.2 [template = constants.%i32] -// CHECK:STDOUT: %.loc4_31.4: type = value_of_initializer %int.make_type_signed.loc4_28 [template = constants.%i32] -// CHECK:STDOUT: %.loc4_31.5: type = converted %int.make_type_signed.loc4_28, %.loc4_31.4 [template = constants.%i32] -// CHECK:STDOUT: %.loc4_31.6: type = converted %.loc4_31.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] +// CHECK:STDOUT: %i32.loc4_28: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc4_31.1: %tuple.type.1 = tuple_literal (%i32.loc4_23, %i32.loc4_28) +// CHECK:STDOUT: %.loc4_31.2: type = converted %.loc4_31.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %Pair.param: %tuple.type.2 = value_param runtime_param // CHECK:STDOUT: %Pair.loc4_15.1: %tuple.type.2 = bind_symbolic_name Pair, 0, %Pair.param [symbolic = %Pair.loc4_15.2 (constants.%Pair)] // CHECK:STDOUT: } @@ -311,13 +305,9 @@ fn G(pair: (C, D)) -> D { // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc6_10: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc6_10: init type = call constants.%Int(%int_32.loc6_10) [template = constants.%i32] -// CHECK:STDOUT: %.loc6_10.1: type = value_of_initializer %int.make_type_signed.loc6_10 [template = constants.%i32] -// CHECK:STDOUT: %.loc6_10.2: type = converted %int.make_type_signed.loc6_10, %.loc6_10.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc6_10: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc6_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc6_19: init type = call constants.%Int(%int_32.loc6_19) [template = constants.%i32] -// CHECK:STDOUT: %.loc6_19.1: type = value_of_initializer %int.make_type_signed.loc6_19 [template = constants.%i32] -// CHECK:STDOUT: %.loc6_19.2: type = converted %int.make_type_signed.loc6_19, %.loc6_19.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc6_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %HasPair.ref: %HasPair.type = name_ref HasPair, file.%HasPair.decl [template = constants.%HasPair.generic] // CHECK:STDOUT: %A.ref: %i32 = name_ref A, %A.loc6_6.1 [symbolic = %A.loc6_6.2 (constants.%A)] // CHECK:STDOUT: %B.ref.loc6_39: %i32 = name_ref B, %B.loc6_15.1 [symbolic = %B.loc6_15.2 (constants.%B)] @@ -326,9 +316,7 @@ fn G(pair: (C, D)) -> D { // CHECK:STDOUT: %.loc6_41: %tuple.type.2 = converted %.loc6_40, %tuple.loc6_40.1 [symbolic = %tuple.loc6_40.2 (constants.%tuple.1)] // CHECK:STDOUT: %HasPair.loc6_41.1: type = class_type @HasPair, @HasPair(constants.%tuple.1) [symbolic = %HasPair.loc6_41.2 (constants.%HasPair.2)] // CHECK:STDOUT: %int_32.loc6_47: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc6_47: init type = call constants.%Int(%int_32.loc6_47) [template = constants.%i32] -// CHECK:STDOUT: %.loc6_47.1: type = value_of_initializer %int.make_type_signed.loc6_47 [template = constants.%i32] -// CHECK:STDOUT: %.loc6_47.2: type = converted %int.make_type_signed.loc6_47, %.loc6_47.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc6_47: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %A.param: %i32 = value_param runtime_param // CHECK:STDOUT: %A.loc6_6.1: %i32 = bind_symbolic_name A, 0, %A.param [symbolic = %A.loc6_6.2 (constants.%A)] // CHECK:STDOUT: %B.param: %i32 = value_param runtime_param @@ -348,13 +336,13 @@ fn G(pair: (C, D)) -> D { // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %.loc8_22.1: %tuple.type.3 = tuple_literal (%int_1, %int_2) -// CHECK:STDOUT: %impl.elem0.loc8_22.1: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc8_22.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc8_22.1: = bound_method %int_1, %impl.elem0.loc8_22.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc8_22.1: = specific_function %Convert.bound.loc8_22.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc8_22.1: init %i32 = call %Convert.specific_fn.loc8_22.1(%int_1) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc8_22.2: %i32 = value_of_initializer %int.convert_checked.loc8_22.1 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc8_22.3: %i32 = converted %int_1, %.loc8_22.2 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc8_22.2: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc8_22.2: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc8_22.2: = bound_method %int_2, %impl.elem0.loc8_22.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc8_22.2: = specific_function %Convert.bound.loc8_22.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc8_22.2: init %i32 = call %Convert.specific_fn.loc8_22.2(%int_2) [template = constants.%int_2.2] @@ -364,9 +352,7 @@ fn G(pair: (C, D)) -> D { // CHECK:STDOUT: %.loc8_23: %tuple.type.2 = converted %.loc8_22.1, %tuple [template = constants.%tuple.2] // CHECK:STDOUT: %HasPair: type = class_type @HasPair, @HasPair(constants.%tuple.2) [template = constants.%HasPair.3] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc8_29.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc8_29.2: type = converted %int.make_type_signed, %.loc8_29.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %h.param: %HasPair.3 = value_param runtime_param0 // CHECK:STDOUT: %h: %HasPair.3 = bind_name h, %h.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 @@ -381,7 +367,7 @@ fn G(pair: (C, D)) -> D { // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: class { -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.2] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%HasPair.1 @@ -398,7 +384,7 @@ fn G(pair: (C, D)) -> D { // CHECK:STDOUT: %HasPair.loc6_41.2: type = class_type @HasPair, @HasPair(%tuple.loc6_40.2) [symbolic = %HasPair.loc6_41.2 (constants.%HasPair.2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete: = require_complete_type @F.%HasPair.loc6_41.2 (%HasPair.2) [symbolic = %require_complete (constants.%require_complete.1)] +// CHECK:STDOUT: %require_complete: = require_complete_type @F.%HasPair.loc6_41.2 (%HasPair.2) [symbolic = %require_complete (constants.%require_complete.2)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%A.param_patt: %i32, %B.param_patt: %i32](%h.param_patt: @F.%HasPair.loc6_41.2 (%HasPair.2)) -> %i32 { // CHECK:STDOUT: !entry: @@ -460,7 +446,7 @@ fn G(pair: (C, D)) -> D { // CHECK:STDOUT: %HasPair.loc6_41.2 => constants.%HasPair.3 // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete => constants.%complete_type.1 +// CHECK:STDOUT: %require_complete => constants.%complete_type.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_inconsistent.carbon diff --git a/toolchain/check/testdata/eval/aggregate.carbon b/toolchain/check/testdata/eval/aggregate.carbon index a2839c49ff9e8..c9aa14b37a8fa 100644 --- a/toolchain/check/testdata/eval/aggregate.carbon +++ b/toolchain/check/testdata/eval/aggregate.carbon @@ -20,22 +20,20 @@ var struct_access: [i32; 1] = (0,) as [i32; {.a = 3, .b = 1}.b]; // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (type, type) [template] // CHECK:STDOUT: %tuple.type.2: type = tuple_type (%i32, %i32) [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %tuple.type.3: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] // CHECK:STDOUT: %tuple.1: %tuple.type.2 = tuple_value (%int_1.2, %int_2.2) [template] @@ -43,7 +41,7 @@ var struct_access: [i32; 1] = (0,) as [i32; {.a = 3, .b = 1}.b]; // CHECK:STDOUT: %int_3.1: Core.IntLiteral = int_value 3 [template] // CHECK:STDOUT: %struct_type.c.b.a: type = struct_type {.c: Core.IntLiteral, .b: Core.IntLiteral, .a: Core.IntLiteral} [template] // CHECK:STDOUT: %struct_type.b.a.c: type = struct_type {.b: %i32, .a: %i32, .c: %i32} [template] -// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_3.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_3.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_3.2: %i32 = int_value 3 [template] // CHECK:STDOUT: %struct.1: %struct_type.b.a.c = struct_value (%int_2.2, %int_1.2, %int_3.2) [template] @@ -56,7 +54,7 @@ var struct_access: [i32; 1] = (0,) as [i32; {.a = 3, .b = 1}.b]; // CHECK:STDOUT: %int_9: Core.IntLiteral = int_value 9 [template] // CHECK:STDOUT: %tuple.type.5: type = tuple_type (Core.IntLiteral, Core.IntLiteral, Core.IntLiteral, Core.IntLiteral) [template] // CHECK:STDOUT: %tuple.2: %tuple.type.5 = tuple_value (%int_5, %int_7, %int_1.1, %int_9) [template] -// CHECK:STDOUT: %Convert.bound.4: = bound_method %int_0.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.4: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.4: = specific_function %Convert.bound.4, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] // CHECK:STDOUT: %array: %array_type = tuple_value (%int_0.2) [template] @@ -67,7 +65,7 @@ var struct_access: [i32; 1] = (0,) as [i32; {.a = 3, .b = 1}.b]; // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -83,45 +81,31 @@ var struct_access: [i32; 1] = (0,) as [i32; {.a = 3, .b = 1}.b]; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int_32.loc11_18: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11_18: init type = call constants.%Int(%int_32.loc11_18) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc11_18: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc11_23: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11_23: init type = call constants.%Int(%int_32.loc11_23) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_26.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc11_18, %int.make_type_signed.loc11_23) -// CHECK:STDOUT: %.loc11_26.2: type = value_of_initializer %int.make_type_signed.loc11_18 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_26.3: type = converted %int.make_type_signed.loc11_18, %.loc11_26.2 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_26.4: type = value_of_initializer %int.make_type_signed.loc11_23 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_26.5: type = converted %int.make_type_signed.loc11_23, %.loc11_26.4 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_26.6: type = converted %.loc11_26.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] +// CHECK:STDOUT: %i32.loc11_23: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_26.1: %tuple.type.1 = tuple_literal (%i32.loc11_18, %i32.loc11_23) +// CHECK:STDOUT: %.loc11_26.2: type = converted %.loc11_26.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %tuple_copy.var: ref %tuple.type.2 = var tuple_copy // CHECK:STDOUT: %tuple_copy: ref %tuple.type.2 = bind_name tuple_copy, %tuple_copy.var // CHECK:STDOUT: %int_32.loc13_23: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc13_23: init type = call constants.%Int(%int_32.loc13_23) [template = constants.%i32] -// CHECK:STDOUT: %.loc13_23.1: type = value_of_initializer %int.make_type_signed.loc13_23 [template = constants.%i32] -// CHECK:STDOUT: %.loc13_23.2: type = converted %int.make_type_signed.loc13_23, %.loc13_23.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc13_23: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc13_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc13_32: init type = call constants.%Int(%int_32.loc13_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc13_32.1: type = value_of_initializer %int.make_type_signed.loc13_32 [template = constants.%i32] -// CHECK:STDOUT: %.loc13_32.2: type = converted %int.make_type_signed.loc13_32, %.loc13_32.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc13_32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc13_41: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc13_41: init type = call constants.%Int(%int_32.loc13_41) [template = constants.%i32] -// CHECK:STDOUT: %.loc13_41.1: type = value_of_initializer %int.make_type_signed.loc13_41 [template = constants.%i32] -// CHECK:STDOUT: %.loc13_41.2: type = converted %int.make_type_signed.loc13_41, %.loc13_41.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc13_41: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %struct_type.a.b.c: type = struct_type {.a: %i32, .b: %i32, .c: %i32} [template = constants.%struct_type.a.b.c] // CHECK:STDOUT: %struct_copy.var: ref %struct_type.a.b.c = var struct_copy // CHECK:STDOUT: %struct_copy: ref %struct_type.a.b.c = bind_name struct_copy, %struct_copy.var // CHECK:STDOUT: %int_32.loc15: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc15: init type = call constants.%Int(%int_32.loc15) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc15: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_1.loc15: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %.loc15_19.1: type = value_of_initializer %int.make_type_signed.loc15 [template = constants.%i32] -// CHECK:STDOUT: %.loc15_19.2: type = converted %int.make_type_signed.loc15, %.loc15_19.1 [template = constants.%i32] // CHECK:STDOUT: %array_type.loc15: type = array_type %int_1.loc15, %i32 [template = constants.%array_type] // CHECK:STDOUT: %tuple_index.var: ref %array_type = var tuple_index // CHECK:STDOUT: %tuple_index: ref %array_type = bind_name tuple_index, %tuple_index.var // CHECK:STDOUT: %int_32.loc17: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc17: init type = call constants.%Int(%int_32.loc17) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_1.loc17: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %.loc17_21.1: type = value_of_initializer %int.make_type_signed.loc17 [template = constants.%i32] -// CHECK:STDOUT: %.loc17_21.2: type = converted %int.make_type_signed.loc17, %.loc17_21.1 [template = constants.%i32] // CHECK:STDOUT: %array_type.loc17: type = array_type %int_1.loc17, %i32 [template = constants.%array_type] // CHECK:STDOUT: %struct_access.var: ref %array_type = var struct_access // CHECK:STDOUT: %struct_access: ref %array_type = bind_name struct_access, %struct_access.var @@ -133,22 +117,18 @@ var struct_access: [i32; 1] = (0,) as [i32; {.a = 3, .b = 1}.b]; // CHECK:STDOUT: %int_2.loc11: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %.loc11_35.1: %tuple.type.3 = tuple_literal (%int_1.loc11, %int_2.loc11) // CHECK:STDOUT: %int_32.loc11_41: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11_41: init type = call constants.%Int(%int_32.loc11_41) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc11_41: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc11_46: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11_46: init type = call constants.%Int(%int_32.loc11_46) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_49.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc11_41, %int.make_type_signed.loc11_46) -// CHECK:STDOUT: %.loc11_49.2: type = value_of_initializer %int.make_type_signed.loc11_41 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_49.3: type = converted %int.make_type_signed.loc11_41, %.loc11_49.2 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_49.4: type = value_of_initializer %int.make_type_signed.loc11_46 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_49.5: type = converted %int.make_type_signed.loc11_46, %.loc11_49.4 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_49.6: type = converted %.loc11_49.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] -// CHECK:STDOUT: %impl.elem0.loc11_35.1: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %i32.loc11_46: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_49.1: %tuple.type.1 = tuple_literal (%i32.loc11_41, %i32.loc11_46) +// CHECK:STDOUT: %.loc11_49.2: type = converted %.loc11_49.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] +// CHECK:STDOUT: %impl.elem0.loc11_35.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_35.1: = bound_method %int_1.loc11, %impl.elem0.loc11_35.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc11_35.1: = specific_function %Convert.bound.loc11_35.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc11_35.1: init %i32 = call %Convert.specific_fn.loc11_35.1(%int_1.loc11) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc11_35.2: %i32 = value_of_initializer %int.convert_checked.loc11_35.1 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc11_35.3: %i32 = converted %int_1.loc11, %.loc11_35.2 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc11_35.2: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc11_35.2: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_35.2: = bound_method %int_2.loc11, %impl.elem0.loc11_35.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc11_35.2: = specific_function %Convert.bound.loc11_35.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc11_35.2: init %i32 = call %Convert.specific_fn.loc11_35.2(%int_2.loc11) [template = constants.%int_2.2] @@ -170,31 +150,25 @@ var struct_access: [i32; 1] = (0,) as [i32; {.a = 3, .b = 1}.b]; // CHECK:STDOUT: %int_1.loc13: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %.loc13_71.1: %struct_type.c.b.a = struct_literal (%int_3.loc13, %int_2.loc13, %int_1.loc13) // CHECK:STDOUT: %int_32.loc13_81: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc13_81: init type = call constants.%Int(%int_32.loc13_81) [template = constants.%i32] -// CHECK:STDOUT: %.loc13_81.1: type = value_of_initializer %int.make_type_signed.loc13_81 [template = constants.%i32] -// CHECK:STDOUT: %.loc13_81.2: type = converted %int.make_type_signed.loc13_81, %.loc13_81.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc13_81: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc13_90: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc13_90: init type = call constants.%Int(%int_32.loc13_90) [template = constants.%i32] -// CHECK:STDOUT: %.loc13_90.1: type = value_of_initializer %int.make_type_signed.loc13_90 [template = constants.%i32] -// CHECK:STDOUT: %.loc13_90.2: type = converted %int.make_type_signed.loc13_90, %.loc13_90.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc13_90: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc13_99: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc13_99: init type = call constants.%Int(%int_32.loc13_99) [template = constants.%i32] -// CHECK:STDOUT: %.loc13_99.1: type = value_of_initializer %int.make_type_signed.loc13_99 [template = constants.%i32] -// CHECK:STDOUT: %.loc13_99.2: type = converted %int.make_type_signed.loc13_99, %.loc13_99.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc13_99: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %struct_type.b.a.c: type = struct_type {.b: %i32, .a: %i32, .c: %i32} [template = constants.%struct_type.b.a.c] -// CHECK:STDOUT: %impl.elem0.loc13_71.1: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc13_71.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc13_71.1: = bound_method %int_2.loc13, %impl.elem0.loc13_71.1 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc13_71.1: = specific_function %Convert.bound.loc13_71.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc13_71.1: init %i32 = call %Convert.specific_fn.loc13_71.1(%int_2.loc13) [template = constants.%int_2.2] // CHECK:STDOUT: %.loc13_71.2: %i32 = value_of_initializer %int.convert_checked.loc13_71.1 [template = constants.%int_2.2] // CHECK:STDOUT: %.loc13_71.3: %i32 = converted %int_2.loc13, %.loc13_71.2 [template = constants.%int_2.2] -// CHECK:STDOUT: %impl.elem0.loc13_71.2: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc13_71.2: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc13_71.2: = bound_method %int_1.loc13, %impl.elem0.loc13_71.2 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc13_71.2: = specific_function %Convert.bound.loc13_71.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc13_71.2: init %i32 = call %Convert.specific_fn.loc13_71.2(%int_1.loc13) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc13_71.4: %i32 = value_of_initializer %int.convert_checked.loc13_71.2 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc13_71.5: %i32 = converted %int_1.loc13, %.loc13_71.4 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc13_71.3: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc13_71.3: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc13_71.3: = bound_method %int_3.loc13, %impl.elem0.loc13_71.3 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc13_71.3: = specific_function %Convert.bound.loc13_71.3, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc13_71.3: init %i32 = call %Convert.specific_fn.loc13_71.3(%int_3.loc13) [template = constants.%int_3.2] @@ -217,7 +191,7 @@ var struct_access: [i32; 1] = (0,) as [i32; {.a = 3, .b = 1}.b]; // CHECK:STDOUT: %int_0.loc15_30: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %.loc15_32.1: %tuple.type.4 = tuple_literal (%int_0.loc15_30) // CHECK:STDOUT: %int_32.loc15: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc15: init type = call constants.%Int(%int_32.loc15) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc15: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_5: Core.IntLiteral = int_value 5 [template = constants.%int_5] // CHECK:STDOUT: %int_7: Core.IntLiteral = int_value 7 [template = constants.%int_7] // CHECK:STDOUT: %int_1.loc15: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] @@ -227,10 +201,8 @@ var struct_access: [i32; 1] = (0,) as [i32; {.a = 3, .b = 1}.b]; // CHECK:STDOUT: %tuple.loc15: %tuple.type.5 = tuple_value (%int_5, %int_7, %int_1.loc15, %int_9) [template = constants.%tuple.2] // CHECK:STDOUT: %.loc15_54.2: %tuple.type.5 = converted %.loc15_54.1, %tuple.loc15 [template = constants.%tuple.2] // CHECK:STDOUT: %tuple.elem2: Core.IntLiteral = tuple_access %.loc15_54.2, element2 [template = constants.%int_1.1] -// CHECK:STDOUT: %.loc15_38.1: type = value_of_initializer %int.make_type_signed.loc15 [template = constants.%i32] -// CHECK:STDOUT: %.loc15_38.2: type = converted %int.make_type_signed.loc15, %.loc15_38.1 [template = constants.%i32] // CHECK:STDOUT: %array_type.loc15: type = array_type %tuple.elem2, %i32 [template = constants.%array_type] -// CHECK:STDOUT: %impl.elem0.loc15: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc15: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc15: = bound_method %int_0.loc15_30, %impl.elem0.loc15 [template = constants.%Convert.bound.4] // CHECK:STDOUT: %Convert.specific_fn.loc15: = specific_function %Convert.bound.loc15, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.4] // CHECK:STDOUT: %int.convert_checked.loc15: init %i32 = call %Convert.specific_fn.loc15(%int_0.loc15_30) [template = constants.%int_0.2] @@ -245,17 +217,15 @@ var struct_access: [i32; 1] = (0,) as [i32; {.a = 3, .b = 1}.b]; // CHECK:STDOUT: %int_0.loc17_32: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %.loc17_34.1: %tuple.type.4 = tuple_literal (%int_0.loc17_32) // CHECK:STDOUT: %int_32.loc17: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc17: init type = call constants.%Int(%int_32.loc17) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_3.loc17: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] // CHECK:STDOUT: %int_1.loc17: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %.loc17_60.1: %struct_type.a.b = struct_literal (%int_3.loc17, %int_1.loc17) // CHECK:STDOUT: %struct.loc17: %struct_type.a.b = struct_value (%int_3.loc17, %int_1.loc17) [template = constants.%struct.3] // CHECK:STDOUT: %.loc17_60.2: %struct_type.a.b = converted %.loc17_60.1, %struct.loc17 [template = constants.%struct.3] // CHECK:STDOUT: %.loc17_61: Core.IntLiteral = struct_access %.loc17_60.2, element1 [template = constants.%int_1.1] -// CHECK:STDOUT: %.loc17_40.1: type = value_of_initializer %int.make_type_signed.loc17 [template = constants.%i32] -// CHECK:STDOUT: %.loc17_40.2: type = converted %int.make_type_signed.loc17, %.loc17_40.1 [template = constants.%i32] // CHECK:STDOUT: %array_type.loc17: type = array_type %.loc17_61, %i32 [template = constants.%array_type] -// CHECK:STDOUT: %impl.elem0.loc17: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc17: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc17: = bound_method %int_0.loc17_32, %impl.elem0.loc17 [template = constants.%Convert.bound.4] // CHECK:STDOUT: %Convert.specific_fn.loc17: = specific_function %Convert.bound.loc17, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.4] // CHECK:STDOUT: %int.convert_checked.loc17: init %i32 = call %Convert.specific_fn.loc17(%int_0.loc17_32) [template = constants.%int_0.2] diff --git a/toolchain/check/testdata/eval/fail_aggregate.carbon b/toolchain/check/testdata/eval/fail_aggregate.carbon index 572220207c2bc..5c171d007fbaa 100644 --- a/toolchain/check/testdata/eval/fail_aggregate.carbon +++ b/toolchain/check/testdata/eval/fail_aggregate.carbon @@ -19,9 +19,7 @@ var array_index: [i32; 1] = (0,) as [i32; ((5, 7, 1, 9) as [i32; 4])[2]]; // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %array_type.1: type = array_type %int_1.1, %i32 [template] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template] @@ -33,25 +31,25 @@ var array_index: [i32; 1] = (0,) as [i32; ((5, 7, 1, 9) as [i32; 4])[2]]; // CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [template] // CHECK:STDOUT: %array_type.2: type = array_type %int_4, %i32 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_5.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_5.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_5.2: %i32 = int_value 5 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_7.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_7.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_7.2: %i32 = int_value 7 [template] // CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template] -// CHECK:STDOUT: %Convert.bound.4: = bound_method %int_9.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.4: = bound_method %int_9.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.4: = specific_function %Convert.bound.4, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_9.2: %i32 = int_value 9 [template] // CHECK:STDOUT: %array: %array_type.2 = tuple_value (%int_5.2, %int_7.2, %int_1.2, %int_9.2) [template] -// CHECK:STDOUT: %Convert.bound.5: = bound_method %int_2.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.5: = bound_method %int_2.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.5: = specific_function %Convert.bound.5, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] // CHECK:STDOUT: } @@ -59,7 +57,7 @@ var array_index: [i32; 1] = (0,) as [i32; ((5, 7, 1, 9) as [i32; 4])[2]]; // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -72,10 +70,8 @@ var array_index: [i32; 1] = (0,) as [i32; ((5, 7, 1, 9) as [i32; 4])[2]]; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %.loc16_19.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc16_19.2: type = converted %int.make_type_signed, %.loc16_19.1 [template = constants.%i32] // CHECK:STDOUT: %array_type: type = array_type %int_1, %i32 [template = constants.%array_type.1] // CHECK:STDOUT: %array_index.var: ref %array_type.1 = var array_index // CHECK:STDOUT: %array_index: ref %array_type.1 = bind_name array_index, %array_index.var @@ -86,19 +82,17 @@ var array_index: [i32; 1] = (0,) as [i32; ((5, 7, 1, 9) as [i32; 4])[2]]; // CHECK:STDOUT: %int_0.loc16_30: Core.IntLiteral = int_value 0 [template = constants.%int_0] // CHECK:STDOUT: %.loc16_32: %tuple.type.1 = tuple_literal (%int_0.loc16_30) // CHECK:STDOUT: %int_32.loc16_38: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc16_38: init type = call constants.%Int(%int_32.loc16_38) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc16_38: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_5: Core.IntLiteral = int_value 5 [template = constants.%int_5.1] // CHECK:STDOUT: %int_7: Core.IntLiteral = int_value 7 [template = constants.%int_7.1] // CHECK:STDOUT: %int_1.loc16_51: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_9: Core.IntLiteral = int_value 9 [template = constants.%int_9.1] // CHECK:STDOUT: %.loc16_55.1: %tuple.type.2 = tuple_literal (%int_5, %int_7, %int_1.loc16_51, %int_9) // CHECK:STDOUT: %int_32.loc16_61: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc16_61: init type = call constants.%Int(%int_32.loc16_61) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc16_61: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [template = constants.%int_4] -// CHECK:STDOUT: %.loc16_61.1: type = value_of_initializer %int.make_type_signed.loc16_61 [template = constants.%i32] -// CHECK:STDOUT: %.loc16_61.2: type = converted %int.make_type_signed.loc16_61, %.loc16_61.1 [template = constants.%i32] // CHECK:STDOUT: %array_type: type = array_type %int_4, %i32 [template = constants.%array_type.2] -// CHECK:STDOUT: %impl.elem0.loc16_55.1: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc16_55.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc16_55.1: = bound_method %int_5, %impl.elem0.loc16_55.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc16_55.1: = specific_function %Convert.bound.loc16_55.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc16_55.1: init %i32 = call %Convert.specific_fn.loc16_55.1(%int_5) [template = constants.%int_5.2] @@ -107,7 +101,7 @@ var array_index: [i32; 1] = (0,) as [i32; ((5, 7, 1, 9) as [i32; 4])[2]]; // CHECK:STDOUT: %int_0.loc16_55: Core.IntLiteral = int_value 0 [template = constants.%int_0] // CHECK:STDOUT: %.loc16_55.4: ref %i32 = array_index %.loc16_55.3, %int_0.loc16_55 // CHECK:STDOUT: %.loc16_55.5: init %i32 = initialize_from %.loc16_55.2 to %.loc16_55.4 [template = constants.%int_5.2] -// CHECK:STDOUT: %impl.elem0.loc16_55.2: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc16_55.2: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc16_55.2: = bound_method %int_7, %impl.elem0.loc16_55.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc16_55.2: = specific_function %Convert.bound.loc16_55.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc16_55.2: init %i32 = call %Convert.specific_fn.loc16_55.2(%int_7) [template = constants.%int_7.2] @@ -115,7 +109,7 @@ var array_index: [i32; 1] = (0,) as [i32; ((5, 7, 1, 9) as [i32; 4])[2]]; // CHECK:STDOUT: %int_1.loc16_55: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %.loc16_55.7: ref %i32 = array_index %.loc16_55.3, %int_1.loc16_55 // CHECK:STDOUT: %.loc16_55.8: init %i32 = initialize_from %.loc16_55.6 to %.loc16_55.7 [template = constants.%int_7.2] -// CHECK:STDOUT: %impl.elem0.loc16_55.3: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc16_55.3: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc16_55.3: = bound_method %int_1.loc16_51, %impl.elem0.loc16_55.3 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc16_55.3: = specific_function %Convert.bound.loc16_55.3, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc16_55.3: init %i32 = call %Convert.specific_fn.loc16_55.3(%int_1.loc16_51) [template = constants.%int_1.2] @@ -123,7 +117,7 @@ var array_index: [i32; 1] = (0,) as [i32; ((5, 7, 1, 9) as [i32; 4])[2]]; // CHECK:STDOUT: %int_2.loc16_55: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %.loc16_55.10: ref %i32 = array_index %.loc16_55.3, %int_2.loc16_55 // CHECK:STDOUT: %.loc16_55.11: init %i32 = initialize_from %.loc16_55.9 to %.loc16_55.10 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc16_55.4: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc16_55.4: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc16_55.4: = bound_method %int_9, %impl.elem0.loc16_55.4 [template = constants.%Convert.bound.4] // CHECK:STDOUT: %Convert.specific_fn.loc16_55.4: = specific_function %Convert.bound.loc16_55.4, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.4] // CHECK:STDOUT: %int.convert_checked.loc16_55.4: init %i32 = call %Convert.specific_fn.loc16_55.4(%int_9) [template = constants.%int_9.2] @@ -136,19 +130,15 @@ var array_index: [i32; 1] = (0,) as [i32; ((5, 7, 1, 9) as [i32; 4])[2]]; // CHECK:STDOUT: %int_2.loc16_70: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %.loc16_57.2: ref %array_type.2 = temporary %.loc16_55.3, %.loc16_57.1 // CHECK:STDOUT: %int_32.loc16_71: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc16_71: init type = call constants.%Int(%int_32.loc16_71) [template = constants.%i32] -// CHECK:STDOUT: %.loc16_71.1: type = value_of_initializer %int.make_type_signed.loc16_71 [template = constants.%i32] -// CHECK:STDOUT: %.loc16_71.2: type = converted %int.make_type_signed.loc16_71, %.loc16_71.1 [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc16_70: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %i32.loc16_71: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %impl.elem0.loc16_70: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc16_70: = bound_method %int_2.loc16_70, %impl.elem0.loc16_70 [template = constants.%Convert.bound.5] // CHECK:STDOUT: %Convert.specific_fn.loc16_70: = specific_function %Convert.bound.loc16_70, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.5] // CHECK:STDOUT: %int.convert_checked.loc16_70: init %i32 = call %Convert.specific_fn.loc16_70(%int_2.loc16_70) [template = constants.%int_2.2] // CHECK:STDOUT: %.loc16_70.1: %i32 = value_of_initializer %int.convert_checked.loc16_70 [template = constants.%int_2.2] // CHECK:STDOUT: %.loc16_70.2: %i32 = converted %int_2.loc16_70, %.loc16_70.1 [template = constants.%int_2.2] -// CHECK:STDOUT: %.loc16_71.3: ref %i32 = array_index %.loc16_57.2, %.loc16_70.2 -// CHECK:STDOUT: %.loc16_71.4: %i32 = bind_value %.loc16_71.3 -// CHECK:STDOUT: %.loc16_38.1: type = value_of_initializer %int.make_type_signed.loc16_38 [template = constants.%i32] -// CHECK:STDOUT: %.loc16_38.2: type = converted %int.make_type_signed.loc16_38, %.loc16_38.1 [template = constants.%i32] +// CHECK:STDOUT: %.loc16_71.1: ref %i32 = array_index %.loc16_57.2, %.loc16_70.2 +// CHECK:STDOUT: %.loc16_71.2: %i32 = bind_value %.loc16_71.1 // CHECK:STDOUT: assign file.%array_index.var, // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/eval/fail_symbolic.carbon b/toolchain/check/testdata/eval/fail_symbolic.carbon index 0a287e61aff75..00f64b707eef5 100644 --- a/toolchain/check/testdata/eval/fail_symbolic.carbon +++ b/toolchain/check/testdata/eval/fail_symbolic.carbon @@ -20,26 +20,24 @@ fn G(N:! i32) { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] -// CHECK:STDOUT: %N.1: %i32 = bind_symbolic_name N, 0 [symbolic] -// CHECK:STDOUT: %N.patt.1: %i32 = symbolic_binding_pattern N, 0 [symbolic] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] +// CHECK:STDOUT: %N.2: %i32 = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %N.patt.2: %i32 = symbolic_binding_pattern N, 0 [symbolic] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.type.13: type = fn_type @Convert.4, @impl.3(%int_32) [template] -// CHECK:STDOUT: %Convert.13: %Convert.type.13 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.13) [template] -// CHECK:STDOUT: %Convert.bound: = bound_method %N.1, %Convert.13 [symbolic] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.4(%int_32) [symbolic] -// CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %Convert.specific_fn(%N.1) [symbolic] +// CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.3, @impl.2(%int_32) [template] +// CHECK:STDOUT: %Convert.9: %Convert.type.9 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.9) [template] +// CHECK:STDOUT: %Convert.bound: = bound_method %N.2, %Convert.9 [symbolic] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.3(%int_32) [symbolic] +// CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %Convert.specific_fn(%N.2) [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -52,37 +50,33 @@ fn G(N:! i32) { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { -// CHECK:STDOUT: %N.patt.loc12_6.1: %i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc12_6.2 (constants.%N.patt.1)] -// CHECK:STDOUT: %N.param_patt: %i32 = value_param_pattern %N.patt.loc12_6.1, runtime_param [symbolic = %N.patt.loc12_6.2 (constants.%N.patt.1)] +// CHECK:STDOUT: %N.patt.loc12_6.1: %i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc12_6.2 (constants.%N.patt.2)] +// CHECK:STDOUT: %N.param_patt: %i32 = value_param_pattern %N.patt.loc12_6.1, runtime_param [symbolic = %N.patt.loc12_6.2 (constants.%N.patt.2)] // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc12: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc12: init type = call constants.%Int(%int_32.loc12) [template = constants.%i32] -// CHECK:STDOUT: %.loc12_10.1: type = value_of_initializer %int.make_type_signed.loc12 [template = constants.%i32] -// CHECK:STDOUT: %.loc12_10.2: type = converted %int.make_type_signed.loc12, %.loc12_10.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc12: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %N.param: %i32 = value_param runtime_param -// CHECK:STDOUT: %N.loc12_6.1: %i32 = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc12_6.2 (constants.%N.1)] +// CHECK:STDOUT: %N.loc12_6.1: %i32 = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc12_6.2 (constants.%N.2)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @G(%N.loc12_6.1: %i32) { -// CHECK:STDOUT: %N.loc12_6.2: %i32 = bind_symbolic_name N, 0 [symbolic = %N.loc12_6.2 (constants.%N.1)] -// CHECK:STDOUT: %N.patt.loc12_6.2: %i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc12_6.2 (constants.%N.patt.1)] +// CHECK:STDOUT: %N.loc12_6.2: %i32 = bind_symbolic_name N, 0 [symbolic = %N.loc12_6.2 (constants.%N.2)] +// CHECK:STDOUT: %N.patt.loc12_6.2: %i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc12_6.2 (constants.%N.patt.2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Convert.bound.loc16_16.2: = bound_method %N.loc12_6.2, constants.%Convert.13 [symbolic = %Convert.bound.loc16_16.2 (constants.%Convert.bound)] -// CHECK:STDOUT: %Convert.specific_fn.loc16_16.2: = specific_function %Convert.bound.loc16_16.2, @Convert.4(constants.%int_32) [symbolic = %Convert.specific_fn.loc16_16.2 (constants.%Convert.specific_fn)] +// CHECK:STDOUT: %Convert.bound.loc16_16.2: = bound_method %N.loc12_6.2, constants.%Convert.9 [symbolic = %Convert.bound.loc16_16.2 (constants.%Convert.bound)] +// CHECK:STDOUT: %Convert.specific_fn.loc16_16.2: = specific_function %Convert.bound.loc16_16.2, @Convert.3(constants.%int_32) [symbolic = %Convert.specific_fn.loc16_16.2 (constants.%Convert.specific_fn)] // CHECK:STDOUT: %int.convert_checked.loc16_16.2: init Core.IntLiteral = call %Convert.specific_fn.loc16_16.2(%N.loc12_6.2) [symbolic = %int.convert_checked.loc16_16.2 (constants.%int.convert_checked)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%N.param_patt: %i32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_32.loc16: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc16: init type = call constants.%Int(%int_32.loc16) [template = constants.%i32] -// CHECK:STDOUT: %N.ref: %i32 = name_ref N, %N.loc12_6.1 [symbolic = %N.loc12_6.2 (constants.%N.1)] -// CHECK:STDOUT: %.loc16_11.1: type = value_of_initializer %int.make_type_signed.loc16 [template = constants.%i32] -// CHECK:STDOUT: %.loc16_11.2: type = converted %int.make_type_signed.loc16, %.loc16_11.1 [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.13] +// CHECK:STDOUT: %i32.loc16: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %N.ref: %i32 = name_ref N, %N.loc12_6.1 [symbolic = %N.loc12_6.2 (constants.%N.2)] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.9] // CHECK:STDOUT: %Convert.bound.loc16_16.1: = bound_method %N.ref, %impl.elem0 [symbolic = %Convert.bound.loc16_16.2 (constants.%Convert.bound)] -// CHECK:STDOUT: %Convert.specific_fn.loc16_16.1: = specific_function %Convert.bound.loc16_16.1, @Convert.4(constants.%int_32) [symbolic = %Convert.specific_fn.loc16_16.2 (constants.%Convert.specific_fn)] +// CHECK:STDOUT: %Convert.specific_fn.loc16_16.1: = specific_function %Convert.bound.loc16_16.1, @Convert.3(constants.%int_32) [symbolic = %Convert.specific_fn.loc16_16.2 (constants.%Convert.specific_fn)] // CHECK:STDOUT: %int.convert_checked.loc16_16.1: init Core.IntLiteral = call %Convert.specific_fn.loc16_16.1(%N.ref) [symbolic = %int.convert_checked.loc16_16.2 (constants.%int.convert_checked)] // CHECK:STDOUT: %.loc16_16.1: Core.IntLiteral = value_of_initializer %int.convert_checked.loc16_16.1 [symbolic = %int.convert_checked.loc16_16.2 (constants.%int.convert_checked)] // CHECK:STDOUT: %.loc16_16.2: Core.IntLiteral = converted %N.ref, %.loc16_16.1 [symbolic = %int.convert_checked.loc16_16.2 (constants.%int.convert_checked)] @@ -93,8 +87,8 @@ fn G(N:! i32) { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @G(constants.%N.1) { -// CHECK:STDOUT: %N.loc12_6.2 => constants.%N.1 -// CHECK:STDOUT: %N.patt.loc12_6.2 => constants.%N.1 +// CHECK:STDOUT: specific @G(constants.%N.2) { +// CHECK:STDOUT: %N.loc12_6.2 => constants.%N.2 +// CHECK:STDOUT: %N.patt.loc12_6.2 => constants.%N.2 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/expr_category/in_place_tuple_init.carbon b/toolchain/check/testdata/expr_category/in_place_tuple_init.carbon index e37098aad791b..5a2f2d6b7323f 100644 --- a/toolchain/check/testdata/expr_category/in_place_tuple_init.carbon +++ b/toolchain/check/testdata/expr_category/in_place_tuple_init.carbon @@ -24,9 +24,7 @@ fn H() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (type, type) [template] // CHECK:STDOUT: %tuple.type.2: type = tuple_type (%i32, %i32) [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] @@ -40,7 +38,7 @@ fn H() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -59,15 +57,11 @@ fn H() -> i32 { // CHECK:STDOUT: %return.param_patt: %tuple.type.2 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc11_12: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11_12: init type = call constants.%Int(%int_32.loc11_12) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc11_12: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc11_17: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11_17: init type = call constants.%Int(%int_32.loc11_17) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_20.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc11_12, %int.make_type_signed.loc11_17) -// CHECK:STDOUT: %.loc11_20.2: type = value_of_initializer %int.make_type_signed.loc11_12 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_20.3: type = converted %int.make_type_signed.loc11_12, %.loc11_20.2 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_20.4: type = value_of_initializer %int.make_type_signed.loc11_17 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_20.5: type = converted %int.make_type_signed.loc11_17, %.loc11_20.4 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_20.6: type = converted %.loc11_20.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] +// CHECK:STDOUT: %i32.loc11_17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_20.1: %tuple.type.1 = tuple_literal (%i32.loc11_12, %i32.loc11_17) +// CHECK:STDOUT: %.loc11_20.2: type = converted %.loc11_20.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %return.param: ref %tuple.type.2 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %tuple.type.2 = return_slot %return.param // CHECK:STDOUT: } @@ -76,15 +70,11 @@ fn H() -> i32 { // CHECK:STDOUT: %return.param_patt: %tuple.type.2 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc13_12: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc13_12: init type = call constants.%Int(%int_32.loc13_12) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc13_12: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc13_17: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc13_17: init type = call constants.%Int(%int_32.loc13_17) [template = constants.%i32] -// CHECK:STDOUT: %.loc13_20.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc13_12, %int.make_type_signed.loc13_17) -// CHECK:STDOUT: %.loc13_20.2: type = value_of_initializer %int.make_type_signed.loc13_12 [template = constants.%i32] -// CHECK:STDOUT: %.loc13_20.3: type = converted %int.make_type_signed.loc13_12, %.loc13_20.2 [template = constants.%i32] -// CHECK:STDOUT: %.loc13_20.4: type = value_of_initializer %int.make_type_signed.loc13_17 [template = constants.%i32] -// CHECK:STDOUT: %.loc13_20.5: type = converted %int.make_type_signed.loc13_17, %.loc13_20.4 [template = constants.%i32] -// CHECK:STDOUT: %.loc13_20.6: type = converted %.loc13_20.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] +// CHECK:STDOUT: %i32.loc13_17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc13_20.1: %tuple.type.1 = tuple_literal (%i32.loc13_12, %i32.loc13_17) +// CHECK:STDOUT: %.loc13_20.2: type = converted %.loc13_20.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %return.param: ref %tuple.type.2 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %tuple.type.2 = return_slot %return.param // CHECK:STDOUT: } @@ -93,9 +83,7 @@ fn H() -> i32 { // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc19_11.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc19_11.2: type = converted %int.make_type_signed, %.loc19_11.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } @@ -106,15 +94,11 @@ fn H() -> i32 { // CHECK:STDOUT: fn @G() -> %return.param_patt: %tuple.type.2 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_32.loc14_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc14_11: init type = call constants.%Int(%int_32.loc14_11) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc14_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc14_16: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc14_16: init type = call constants.%Int(%int_32.loc14_16) [template = constants.%i32] -// CHECK:STDOUT: %.loc14_19.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc14_11, %int.make_type_signed.loc14_16) -// CHECK:STDOUT: %.loc14_19.2: type = value_of_initializer %int.make_type_signed.loc14_11 [template = constants.%i32] -// CHECK:STDOUT: %.loc14_19.3: type = converted %int.make_type_signed.loc14_11, %.loc14_19.2 [template = constants.%i32] -// CHECK:STDOUT: %.loc14_19.4: type = value_of_initializer %int.make_type_signed.loc14_16 [template = constants.%i32] -// CHECK:STDOUT: %.loc14_19.5: type = converted %int.make_type_signed.loc14_16, %.loc14_19.4 [template = constants.%i32] -// CHECK:STDOUT: %.loc14_19.6: type = converted %.loc14_19.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] +// CHECK:STDOUT: %i32.loc14_16: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc14_19.1: %tuple.type.1 = tuple_literal (%i32.loc14_11, %i32.loc14_16) +// CHECK:STDOUT: %.loc14_19.2: type = converted %.loc14_19.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %v.var: ref %tuple.type.2 = var v // CHECK:STDOUT: %v: ref %tuple.type.2 = bind_name v, %v.var // CHECK:STDOUT: %F.ref.loc14: %F.type = name_ref F, file.%F.decl [template = constants.%F] diff --git a/toolchain/check/testdata/function/builtin/call.carbon b/toolchain/check/testdata/function/builtin/call.carbon index e84eddbb68eac..85b951881c5d5 100644 --- a/toolchain/check/testdata/function/builtin/call.carbon +++ b/toolchain/check/testdata/function/builtin/call.carbon @@ -16,30 +16,28 @@ var arr: [i32; Add(1, 2)]; // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] -// CHECK:STDOUT: %Add.type: type = fn_type @Add [template] -// CHECK:STDOUT: %Add: %Add.type = struct_value () [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] +// CHECK:STDOUT: %Add.type.1: type = fn_type @Add.1 [template] +// CHECK:STDOUT: %Add: %Add.type.1 = struct_value () [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] // CHECK:STDOUT: %int_3.1: %i32 = int_value 3 [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.4, @impl.3(%int_32) [template] -// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template] -// CHECK:STDOUT: %interface.10: = interface_witness (%Convert.15) [template] -// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_3.1, %Convert.15 [template] -// CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.4(%int_32) [template] +// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.3, @impl.2(%int_32) [template] +// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [template] +// CHECK:STDOUT: %interface.6: = interface_witness (%Convert.11) [template] +// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_3.1, %Convert.11 [template] +// CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.3(%int_32) [template] // CHECK:STDOUT: %int_3.2: Core.IntLiteral = int_value 3 [template] // CHECK:STDOUT: %array_type: type = array_type %int_3.2, %i32 [template] // CHECK:STDOUT: } @@ -47,7 +45,7 @@ var arr: [i32; Add(1, 2)]; // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -60,7 +58,7 @@ var arr: [i32; Add(1, 2)]; // CHECK:STDOUT: .arr = %arr // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Add.decl: %Add.type = fn_decl @Add [template = constants.%Add] { +// CHECK:STDOUT: %Add.decl: %Add.type.1 = fn_decl @Add.1 [template = constants.%Add] { // CHECK:STDOUT: %a.patt: %i32 = binding_pattern a // CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: %i32 = binding_pattern b @@ -69,17 +67,11 @@ var arr: [i32; Add(1, 2)]; // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc11_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11_11: init type = call constants.%Int(%int_32.loc11_11) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %int.make_type_signed.loc11_11 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_11.2: type = converted %int.make_type_signed.loc11_11, %.loc11_11.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc11_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc11_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11_19: init type = call constants.%Int(%int_32.loc11_19) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_19.1: type = value_of_initializer %int.make_type_signed.loc11_19 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_19.2: type = converted %int.make_type_signed.loc11_19, %.loc11_19.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc11_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc11_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11_27: init type = call constants.%Int(%int_32.loc11_27) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_27.1: type = value_of_initializer %int.make_type_signed.loc11_27 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_27.2: type = converted %int.make_type_signed.loc11_27, %.loc11_27.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc11_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 @@ -88,28 +80,26 @@ var arr: [i32; Add(1, 2)]; // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %Add.ref: %Add.type = name_ref Add, %Add.decl [template = constants.%Add] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %Add.ref: %Add.type.1 = name_ref Add, %Add.decl [template = constants.%Add] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %impl.elem0.loc13_20: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc13_20: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc13_20: = bound_method %int_1, %impl.elem0.loc13_20 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc13_20: = specific_function %Convert.bound.loc13_20, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc13_20: init %i32 = call %Convert.specific_fn.loc13_20(%int_1) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc13_20.1: %i32 = value_of_initializer %int.convert_checked.loc13_20 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc13_20.2: %i32 = converted %int_1, %.loc13_20.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc13_23: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc13_23: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc13_23: = bound_method %int_2, %impl.elem0.loc13_23 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc13_23: = specific_function %Convert.bound.loc13_23, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc13_23: init %i32 = call %Convert.specific_fn.loc13_23(%int_2) [template = constants.%int_2.2] // CHECK:STDOUT: %.loc13_23.1: %i32 = value_of_initializer %int.convert_checked.loc13_23 [template = constants.%int_2.2] // CHECK:STDOUT: %.loc13_23.2: %i32 = converted %int_2, %.loc13_23.1 [template = constants.%int_2.2] // CHECK:STDOUT: %int.sadd: init %i32 = call %Add.ref(%.loc13_20.2, %.loc13_23.2) [template = constants.%int_3.1] -// CHECK:STDOUT: %.loc13_11.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc13_11.2: type = converted %int.make_type_signed, %.loc13_11.1 [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc13_24: %Convert.type.6 = interface_witness_access constants.%interface.10, element0 [template = constants.%Convert.15] +// CHECK:STDOUT: %impl.elem0.loc13_24: %Convert.type.5 = interface_witness_access constants.%interface.6, element0 [template = constants.%Convert.11] // CHECK:STDOUT: %Convert.bound.loc13_24: = bound_method %int.sadd, %impl.elem0.loc13_24 [template = constants.%Convert.bound.3] -// CHECK:STDOUT: %Convert.specific_fn.loc13_24: = specific_function %Convert.bound.loc13_24, @Convert.4(constants.%int_32) [template = constants.%Convert.specific_fn.3] +// CHECK:STDOUT: %Convert.specific_fn.loc13_24: = specific_function %Convert.bound.loc13_24, @Convert.3(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %.loc13_24.1: %i32 = value_of_initializer %int.sadd [template = constants.%int_3.1] // CHECK:STDOUT: %.loc13_24.2: %i32 = converted %int.sadd, %.loc13_24.1 [template = constants.%int_3.1] // CHECK:STDOUT: %int.convert_checked.loc13_24: init Core.IntLiteral = call %Convert.specific_fn.loc13_24(%.loc13_24.2) [template = constants.%int_3.2] @@ -120,5 +110,5 @@ var arr: [i32; Add(1, 2)]; // CHECK:STDOUT: %arr: ref %array_type = bind_name arr, %arr.var // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Add(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.sadd"; +// CHECK:STDOUT: fn @Add.1(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.sadd"; // CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/builtin/definition.carbon b/toolchain/check/testdata/function/builtin/definition.carbon index d37f0479c322a..7e23baf037f00 100644 --- a/toolchain/check/testdata/function/builtin/definition.carbon +++ b/toolchain/check/testdata/function/builtin/definition.carbon @@ -14,16 +14,14 @@ fn Add(a: i32, b: i32) -> i32 = "int.sadd"; // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %Add.type: type = fn_type @Add [template] // CHECK:STDOUT: %Add: %Add.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -44,17 +42,11 @@ fn Add(a: i32, b: i32) -> i32 = "int.sadd"; // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc11_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11_11: init type = call constants.%Int(%int_32.loc11_11) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %int.make_type_signed.loc11_11 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_11.2: type = converted %int.make_type_signed.loc11_11, %.loc11_11.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc11_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc11_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11_19: init type = call constants.%Int(%int_32.loc11_19) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_19.1: type = value_of_initializer %int.make_type_signed.loc11_19 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_19.2: type = converted %int.make_type_signed.loc11_19, %.loc11_19.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc11_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc11_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11_27: init type = call constants.%Int(%int_32.loc11_27) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_27.1: type = value_of_initializer %int.make_type_signed.loc11_27 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_27.2: type = converted %int.make_type_signed.loc11_27, %.loc11_27.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc11_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 diff --git a/toolchain/check/testdata/function/builtin/fail_redefined.carbon b/toolchain/check/testdata/function/builtin/fail_redefined.carbon index b7c85e15afd1d..6cdd3ec65d335 100644 --- a/toolchain/check/testdata/function/builtin/fail_redefined.carbon +++ b/toolchain/check/testdata/function/builtin/fail_redefined.carbon @@ -41,9 +41,7 @@ fn C(n: i32, m: i32) -> i32 = "int.sadd"; // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %A.type: type = fn_type @A [template] // CHECK:STDOUT: %A: %A.type = struct_value () [template] // CHECK:STDOUT: %B.type: type = fn_type @B [template] @@ -54,7 +52,7 @@ fn C(n: i32, m: i32) -> i32 = "int.sadd"; // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -77,17 +75,11 @@ fn C(n: i32, m: i32) -> i32 = "int.sadd"; // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc11_9: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11_9: init type = call constants.%Int(%int_32.loc11_9) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_9.1: type = value_of_initializer %int.make_type_signed.loc11_9 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_9.2: type = converted %int.make_type_signed.loc11_9, %.loc11_9.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc11_9: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc11_17: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11_17: init type = call constants.%Int(%int_32.loc11_17) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_17.1: type = value_of_initializer %int.make_type_signed.loc11_17 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_17.2: type = converted %int.make_type_signed.loc11_17, %.loc11_17.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc11_17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc11_25: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11_25: init type = call constants.%Int(%int_32.loc11_25) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_25.1: type = value_of_initializer %int.make_type_signed.loc11_25 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_25.2: type = converted %int.make_type_signed.loc11_25, %.loc11_25.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc11_25: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %n.param.loc11: %i32 = value_param runtime_param0 // CHECK:STDOUT: %n.loc11: %i32 = bind_name n, %n.param.loc11 // CHECK:STDOUT: %m.param.loc11: %i32 = value_param runtime_param1 @@ -104,17 +96,11 @@ fn C(n: i32, m: i32) -> i32 = "int.sadd"; // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc19_9: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc19_9: init type = call constants.%Int(%int_32.loc19_9) [template = constants.%i32] -// CHECK:STDOUT: %.loc19_9.1: type = value_of_initializer %int.make_type_signed.loc19_9 [template = constants.%i32] -// CHECK:STDOUT: %.loc19_9.2: type = converted %int.make_type_signed.loc19_9, %.loc19_9.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc19_9: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc19_17: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc19_17: init type = call constants.%Int(%int_32.loc19_17) [template = constants.%i32] -// CHECK:STDOUT: %.loc19_17.1: type = value_of_initializer %int.make_type_signed.loc19_17 [template = constants.%i32] -// CHECK:STDOUT: %.loc19_17.2: type = converted %int.make_type_signed.loc19_17, %.loc19_17.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc19_17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc19_25: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc19_25: init type = call constants.%Int(%int_32.loc19_25) [template = constants.%i32] -// CHECK:STDOUT: %.loc19_25.1: type = value_of_initializer %int.make_type_signed.loc19_25 [template = constants.%i32] -// CHECK:STDOUT: %.loc19_25.2: type = converted %int.make_type_signed.loc19_25, %.loc19_25.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc19_25: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %n.param.loc19: %i32 = value_param runtime_param0 // CHECK:STDOUT: %n.loc19: %i32 = bind_name n, %n.param.loc19 // CHECK:STDOUT: %m.param.loc19: %i32 = value_param runtime_param1 @@ -131,17 +117,11 @@ fn C(n: i32, m: i32) -> i32 = "int.sadd"; // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc21_9: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc21_9: init type = call constants.%Int(%int_32.loc21_9) [template = constants.%i32] -// CHECK:STDOUT: %.loc21_9.1: type = value_of_initializer %int.make_type_signed.loc21_9 [template = constants.%i32] -// CHECK:STDOUT: %.loc21_9.2: type = converted %int.make_type_signed.loc21_9, %.loc21_9.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc21_9: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc21_17: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc21_17: init type = call constants.%Int(%int_32.loc21_17) [template = constants.%i32] -// CHECK:STDOUT: %.loc21_17.1: type = value_of_initializer %int.make_type_signed.loc21_17 [template = constants.%i32] -// CHECK:STDOUT: %.loc21_17.2: type = converted %int.make_type_signed.loc21_17, %.loc21_17.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc21_17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc21_25: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc21_25: init type = call constants.%Int(%int_32.loc21_25) [template = constants.%i32] -// CHECK:STDOUT: %.loc21_25.1: type = value_of_initializer %int.make_type_signed.loc21_25 [template = constants.%i32] -// CHECK:STDOUT: %.loc21_25.2: type = converted %int.make_type_signed.loc21_25, %.loc21_25.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc21_25: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %n.param.loc21: %i32 = value_param runtime_param0 // CHECK:STDOUT: %n.loc21: %i32 = bind_name n, %n.param.loc21 // CHECK:STDOUT: %m.param.loc21: %i32 = value_param runtime_param1 @@ -158,17 +138,11 @@ fn C(n: i32, m: i32) -> i32 = "int.sadd"; // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc29_9: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc29_9: init type = call constants.%Int(%int_32.loc29_9) [template = constants.%i32] -// CHECK:STDOUT: %.loc29_9.1: type = value_of_initializer %int.make_type_signed.loc29_9 [template = constants.%i32] -// CHECK:STDOUT: %.loc29_9.2: type = converted %int.make_type_signed.loc29_9, %.loc29_9.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc29_9: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc29_17: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc29_17: init type = call constants.%Int(%int_32.loc29_17) [template = constants.%i32] -// CHECK:STDOUT: %.loc29_17.1: type = value_of_initializer %int.make_type_signed.loc29_17 [template = constants.%i32] -// CHECK:STDOUT: %.loc29_17.2: type = converted %int.make_type_signed.loc29_17, %.loc29_17.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc29_17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc29_25: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc29_25: init type = call constants.%Int(%int_32.loc29_25) [template = constants.%i32] -// CHECK:STDOUT: %.loc29_25.1: type = value_of_initializer %int.make_type_signed.loc29_25 [template = constants.%i32] -// CHECK:STDOUT: %.loc29_25.2: type = converted %int.make_type_signed.loc29_25, %.loc29_25.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc29_25: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %n.param.loc29: %i32 = value_param runtime_param0 // CHECK:STDOUT: %n.loc29: %i32 = bind_name n, %n.param.loc29 // CHECK:STDOUT: %m.param.loc29: %i32 = value_param runtime_param1 @@ -185,17 +159,11 @@ fn C(n: i32, m: i32) -> i32 = "int.sadd"; // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc31_9: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc31_9: init type = call constants.%Int(%int_32.loc31_9) [template = constants.%i32] -// CHECK:STDOUT: %.loc31_9.1: type = value_of_initializer %int.make_type_signed.loc31_9 [template = constants.%i32] -// CHECK:STDOUT: %.loc31_9.2: type = converted %int.make_type_signed.loc31_9, %.loc31_9.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc31_9: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc31_17: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc31_17: init type = call constants.%Int(%int_32.loc31_17) [template = constants.%i32] -// CHECK:STDOUT: %.loc31_17.1: type = value_of_initializer %int.make_type_signed.loc31_17 [template = constants.%i32] -// CHECK:STDOUT: %.loc31_17.2: type = converted %int.make_type_signed.loc31_17, %.loc31_17.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc31_17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc31_25: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc31_25: init type = call constants.%Int(%int_32.loc31_25) [template = constants.%i32] -// CHECK:STDOUT: %.loc31_25.1: type = value_of_initializer %int.make_type_signed.loc31_25 [template = constants.%i32] -// CHECK:STDOUT: %.loc31_25.2: type = converted %int.make_type_signed.loc31_25, %.loc31_25.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc31_25: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %n.param.loc31: %i32 = value_param runtime_param0 // CHECK:STDOUT: %n.loc31: %i32 = bind_name n, %n.param.loc31 // CHECK:STDOUT: %m.param.loc31: %i32 = value_param runtime_param1 @@ -212,17 +180,11 @@ fn C(n: i32, m: i32) -> i32 = "int.sadd"; // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc38_9: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc38_9: init type = call constants.%Int(%int_32.loc38_9) [template = constants.%i32] -// CHECK:STDOUT: %.loc38_9.1: type = value_of_initializer %int.make_type_signed.loc38_9 [template = constants.%i32] -// CHECK:STDOUT: %.loc38_9.2: type = converted %int.make_type_signed.loc38_9, %.loc38_9.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc38_9: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc38_17: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc38_17: init type = call constants.%Int(%int_32.loc38_17) [template = constants.%i32] -// CHECK:STDOUT: %.loc38_17.1: type = value_of_initializer %int.make_type_signed.loc38_17 [template = constants.%i32] -// CHECK:STDOUT: %.loc38_17.2: type = converted %int.make_type_signed.loc38_17, %.loc38_17.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc38_17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc38_25: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc38_25: init type = call constants.%Int(%int_32.loc38_25) [template = constants.%i32] -// CHECK:STDOUT: %.loc38_25.1: type = value_of_initializer %int.make_type_signed.loc38_25 [template = constants.%i32] -// CHECK:STDOUT: %.loc38_25.2: type = converted %int.make_type_signed.loc38_25, %.loc38_25.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc38_25: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %n.param.loc38: %i32 = value_param runtime_param0 // CHECK:STDOUT: %n.loc38: %i32 = bind_name n, %n.param.loc38 // CHECK:STDOUT: %m.param.loc38: %i32 = value_param runtime_param1 diff --git a/toolchain/check/testdata/function/builtin/method.carbon b/toolchain/check/testdata/function/builtin/method.carbon index 429893efdee86..0e484d50fbbe5 100644 --- a/toolchain/check/testdata/function/builtin/method.carbon +++ b/toolchain/check/testdata/function/builtin/method.carbon @@ -29,37 +29,35 @@ var arr: [i32; (1 as i32).(I.F)(2)]; // CHECK:STDOUT: %F.assoc_type: type = assoc_entity_type %I.type, %F.type.1 [template] // CHECK:STDOUT: %assoc0.1: %F.assoc_type = assoc_entity element0, @I.%F.decl [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %F.type.2: type = fn_type @F.2 [template] // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [template] // CHECK:STDOUT: %I.facet: %I.type = facet_value %i32, %i32 [template] // CHECK:STDOUT: %interface.1: = interface_witness (%F.2) [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @As(%i32) [template] -// CHECK:STDOUT: %Convert.type.7: type = fn_type @Convert.2, @ImplicitAs(Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.7, @impl.6(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.10: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.14 [template] -// CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.7(%int_32) [template] +// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.2, @ImplicitAs(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.5, @impl.4(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.6: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] +// CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.5(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] // CHECK:STDOUT: %F.bound: = bound_method %int_1.2, %F.2 [template] // CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.2, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.16: type = fn_type @Convert.3, @impl.2(%int_32) [template] -// CHECK:STDOUT: %Convert.16: %Convert.type.16 = struct_value () [template] -// CHECK:STDOUT: %interface.11: = interface_witness (%Convert.16) [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.16 [template] +// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.2, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.12: type = fn_type @Convert.3, @impl.2(%int_32) [template] +// CHECK:STDOUT: %Convert.12: %Convert.type.12 = struct_value () [template] +// CHECK:STDOUT: %interface.7: = interface_witness (%Convert.12) [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.12 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.3(%int_32) [template] // CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] // CHECK:STDOUT: %int_3.1: %i32 = int_value 3 [template] -// CHECK:STDOUT: %Convert.type.17: type = fn_type @Convert.5, @impl.4(%int_32) [template] -// CHECK:STDOUT: %Convert.17: %Convert.type.17 = struct_value () [template] -// CHECK:STDOUT: %interface.12: = interface_witness (%Convert.17) [template] -// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_3.1, %Convert.17 [template] -// CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.5(%int_32) [template] +// CHECK:STDOUT: %Convert.type.13: type = fn_type @Convert.4, @impl.3(%int_32) [template] +// CHECK:STDOUT: %Convert.13: %Convert.type.13 = struct_value () [template] +// CHECK:STDOUT: %interface.8: = interface_witness (%Convert.13) [template] +// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_3.1, %Convert.13 [template] +// CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.4(%int_32) [template] // CHECK:STDOUT: %int_3.2: Core.IntLiteral = int_value 3 [template] // CHECK:STDOUT: %array_type: type = array_type %int_3.2, %i32 [template] // CHECK:STDOUT: } @@ -67,8 +65,8 @@ var arr: [i32; (1 as i32).(I.F)(2)]; // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .As = %import_ref.2 -// CHECK:STDOUT: .ImplicitAs = %import_ref.38 +// CHECK:STDOUT: .As = %import_ref.5 +// CHECK:STDOUT: .ImplicitAs = %import_ref.193 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -84,21 +82,17 @@ var arr: [i32; (1 as i32).(I.F)(2)]; // CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%I.type] {} {} // CHECK:STDOUT: impl_decl @impl.1 [template] {} { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc15_6.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc15_6.2: type = converted %int.make_type_signed, %.loc15_6.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%I.type] // CHECK:STDOUT: } // CHECK:STDOUT: %int_32.loc19_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc19_11: init type = call constants.%Int(%int_32.loc19_11) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc19_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_32.loc19_22: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc19_22: init type = call constants.%Int(%int_32.loc19_22) [template = constants.%i32] -// CHECK:STDOUT: %.loc19_22.1: type = value_of_initializer %int.make_type_signed.loc19_22 [template = constants.%i32] -// CHECK:STDOUT: %.loc19_22.2: type = converted %int.make_type_signed.loc19_22, %.loc19_22.1 [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc19_19: %Convert.type.2 = interface_witness_access constants.%interface.10, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %i32.loc19_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %impl.elem0.loc19_19: %Convert.type.2 = interface_witness_access constants.%interface.6, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc19_19: = bound_method %int_1, %impl.elem0.loc19_19 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc19_19: = specific_function %Convert.bound.loc19_19, @Convert.7(constants.%int_32) [template = constants.%Convert.specific_fn.1] +// CHECK:STDOUT: %Convert.specific_fn.loc19_19: = specific_function %Convert.bound.loc19_19, @Convert.5(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc19_19: init %i32 = call %Convert.specific_fn.loc19_19(%int_1) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc19_19.1: %i32 = value_of_initializer %int.convert_checked.loc19_19 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc19_19.2: %i32 = converted %int_1, %.loc19_19.1 [template = constants.%int_1.2] @@ -107,18 +101,16 @@ var arr: [i32; (1 as i32).(I.F)(2)]; // CHECK:STDOUT: %impl.elem0.loc19_26: %F.type.1 = interface_witness_access constants.%interface.1, element0 [template = constants.%F.2] // CHECK:STDOUT: %F.bound: = bound_method %.loc19_19.2, %impl.elem0.loc19_26 [template = constants.%F.bound] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %impl.elem0.loc19_33: %Convert.type.15 = interface_witness_access constants.%interface.11, element0 [template = constants.%Convert.16] +// CHECK:STDOUT: %impl.elem0.loc19_33: %Convert.type.11 = interface_witness_access constants.%interface.7, element0 [template = constants.%Convert.12] // CHECK:STDOUT: %Convert.bound.loc19_33: = bound_method %int_2, %impl.elem0.loc19_33 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc19_33: = specific_function %Convert.bound.loc19_33, @Convert.3(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc19_33: init %i32 = call %Convert.specific_fn.loc19_33(%int_2) [template = constants.%int_2.2] // CHECK:STDOUT: %.loc19_33.1: %i32 = value_of_initializer %int.convert_checked.loc19_33 [template = constants.%int_2.2] // CHECK:STDOUT: %.loc19_33.2: %i32 = converted %int_2, %.loc19_33.1 [template = constants.%int_2.2] // CHECK:STDOUT: %int.sadd: init %i32 = call %F.bound(%.loc19_19.2, %.loc19_33.2) [template = constants.%int_3.1] -// CHECK:STDOUT: %.loc19_11.1: type = value_of_initializer %int.make_type_signed.loc19_11 [template = constants.%i32] -// CHECK:STDOUT: %.loc19_11.2: type = converted %int.make_type_signed.loc19_11, %.loc19_11.1 [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc19_34: %Convert.type.7 = interface_witness_access constants.%interface.12, element0 [template = constants.%Convert.17] +// CHECK:STDOUT: %impl.elem0.loc19_34: %Convert.type.6 = interface_witness_access constants.%interface.8, element0 [template = constants.%Convert.13] // CHECK:STDOUT: %Convert.bound.loc19_34: = bound_method %int.sadd, %impl.elem0.loc19_34 [template = constants.%Convert.bound.3] -// CHECK:STDOUT: %Convert.specific_fn.loc19_34: = specific_function %Convert.bound.loc19_34, @Convert.5(constants.%int_32) [template = constants.%Convert.specific_fn.3] +// CHECK:STDOUT: %Convert.specific_fn.loc19_34: = specific_function %Convert.bound.loc19_34, @Convert.4(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %.loc19_34.1: %i32 = value_of_initializer %int.sadd [template = constants.%int_3.1] // CHECK:STDOUT: %.loc19_34.2: %i32 = converted %int.sadd, %.loc19_34.1 [template = constants.%int_3.1] // CHECK:STDOUT: %int.convert_checked.loc19_34: init Core.IntLiteral = call %Convert.specific_fn.loc19_34(%.loc19_34.2) [template = constants.%int_3.2] @@ -163,7 +155,7 @@ var arr: [i32; (1 as i32).(I.F)(2)]; // CHECK:STDOUT: witness = (%F.decl) // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.1: %.loc15_6.2 as %I.ref { +// CHECK:STDOUT: impl @impl.1: %i32 as %I.ref { // CHECK:STDOUT: %F.decl: %F.type.2 = fn_decl @F.2 [template = constants.%F.2] { // CHECK:STDOUT: %self.patt: %i32 = binding_pattern self // CHECK:STDOUT: %self.param_patt: %i32 = value_param_pattern %self.patt, runtime_param0 @@ -173,17 +165,11 @@ var arr: [i32; (1 as i32).(I.F)(2)]; // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc16_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc16_14: init type = call constants.%Int(%int_32.loc16_14) [template = constants.%i32] -// CHECK:STDOUT: %.loc16_14.1: type = value_of_initializer %int.make_type_signed.loc16_14 [template = constants.%i32] -// CHECK:STDOUT: %.loc16_14.2: type = converted %int.make_type_signed.loc16_14, %.loc16_14.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc16_14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc16_26: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc16_26: init type = call constants.%Int(%int_32.loc16_26) [template = constants.%i32] -// CHECK:STDOUT: %.loc16_26.1: type = value_of_initializer %int.make_type_signed.loc16_26 [template = constants.%i32] -// CHECK:STDOUT: %.loc16_26.2: type = converted %int.make_type_signed.loc16_26, %.loc16_26.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc16_26: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc16_34: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc16_34: init type = call constants.%Int(%int_32.loc16_34) [template = constants.%i32] -// CHECK:STDOUT: %.loc16_34.1: type = value_of_initializer %int.make_type_signed.loc16_34 [template = constants.%i32] -// CHECK:STDOUT: %.loc16_34.2: type = converted %int.make_type_signed.loc16_34, %.loc16_34.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc16_34: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %self.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %self: %i32 = bind_name self, %self.param // CHECK:STDOUT: %other.param: %i32 = value_param runtime_param1 diff --git a/toolchain/check/testdata/function/builtin/no_prelude/adapted_type.carbon b/toolchain/check/testdata/function/builtin/no_prelude/adapted_type.carbon index 2a37adfecceea..a48d4495fe86e 100644 --- a/toolchain/check/testdata/function/builtin/no_prelude/adapted_type.carbon +++ b/toolchain/check/testdata/function/builtin/no_prelude/adapted_type.carbon @@ -56,10 +56,10 @@ fn Int(N: MyIntLiteral) -> type = "int.make_type_signed"; // CHECK:STDOUT: %Int: %Int.type = struct_value () [template] // CHECK:STDOUT: %MyInt32: type = class_type @MyInt32 [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [template] // CHECK:STDOUT: %Make.type: type = fn_type @Make [template] // CHECK:STDOUT: %Make: %Make.type = struct_value () [template] -// CHECK:STDOUT: %complete_type.2: = complete_type_witness %i32 [template] +// CHECK:STDOUT: %complete_type.2: = complete_type_witness %i32.builtin [template] // CHECK:STDOUT: %MyAdd.type: type = fn_type @MyAdd [template] // CHECK:STDOUT: %MyAdd: %MyAdd.type = struct_value () [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] @@ -154,9 +154,9 @@ fn Int(N: MyIntLiteral) -> type = "int.make_type_signed"; // CHECK:STDOUT: %MyIntLiteral.ref: type = name_ref MyIntLiteral, file.%MyIntLiteral.decl [template = constants.%MyIntLiteral] // CHECK:STDOUT: %.loc13_16.1: %MyIntLiteral = as_compatible %int_32 [template = constants.%int_32] // CHECK:STDOUT: %.loc13_16.2: %MyIntLiteral = converted %int_32, %.loc13_16.1 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call %Int.ref(%.loc13_16.2) [template = constants.%i32] -// CHECK:STDOUT: %.loc13_32.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc13_32.2: type = converted %int.make_type_signed, %.loc13_32.1 [template = constants.%i32] +// CHECK:STDOUT: %int.make_type_signed: init type = call %Int.ref(%.loc13_16.2) [template = constants.%i32.builtin] +// CHECK:STDOUT: %.loc13_32.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32.builtin] +// CHECK:STDOUT: %.loc13_32.2: type = converted %int.make_type_signed, %.loc13_32.1 [template = constants.%i32.builtin] // CHECK:STDOUT: adapt_decl %.loc13_32.2 [template] // CHECK:STDOUT: %Make.decl: %Make.type = fn_decl @Make [template = constants.%Make] { // CHECK:STDOUT: %a.patt: %MyIntLiteral = binding_pattern a @@ -171,7 +171,7 @@ fn Int(N: MyIntLiteral) -> type = "int.make_type_signed"; // CHECK:STDOUT: %return.param.loc15: ref %MyInt32 = out_param runtime_param1 // CHECK:STDOUT: %return.loc15: ref %MyInt32 = return_slot %return.param.loc15 // CHECK:STDOUT: } -// CHECK:STDOUT: %complete_type: = complete_type_witness %i32 [template = constants.%complete_type.2] +// CHECK:STDOUT: %complete_type: = complete_type_witness %i32.builtin [template = constants.%complete_type.2] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%MyInt32 diff --git a/toolchain/check/testdata/function/builtin/no_prelude/call_from_operator.carbon b/toolchain/check/testdata/function/builtin/no_prelude/call_from_operator.carbon index 930f2a6bc9d00..6175929c41512 100644 --- a/toolchain/check/testdata/function/builtin/no_prelude/call_from_operator.carbon +++ b/toolchain/check/testdata/function/builtin/no_prelude/call_from_operator.carbon @@ -84,24 +84,24 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: %Convert.assoc_type.2: type = assoc_entity_type %ImplicitAs.type.2, %Convert.type.2 [symbolic] // CHECK:STDOUT: %assoc0.3: %Convert.assoc_type.2 = assoc_entity element0, @ImplicitAs.%Convert.decl [symbolic] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [template] // CHECK:STDOUT: %Op.type.2: type = fn_type @Op.2 [template] // CHECK:STDOUT: %Op.2: %Op.type.2 = struct_value () [template] -// CHECK:STDOUT: %Add.facet: %Add.type = facet_value %i32, %i32 [template] +// CHECK:STDOUT: %Add.facet: %Add.type = facet_value %i32.builtin, %i32.builtin [template] // CHECK:STDOUT: %interface.1: = interface_witness (%Op.2) [template] -// CHECK:STDOUT: %As.type.3: type = facet_type <@As, @As(%i32)> [template] +// CHECK:STDOUT: %As.type.3: type = facet_type <@As, @As(%i32.builtin)> [template] // CHECK:STDOUT: %Convert.type.3: type = fn_type @Convert.3 [template] // CHECK:STDOUT: %Convert.3: %Convert.type.3 = struct_value () [template] -// CHECK:STDOUT: %Convert.type.4: type = fn_type @Convert.1, @As(%i32) [template] +// CHECK:STDOUT: %Convert.type.4: type = fn_type @Convert.1, @As(%i32.builtin) [template] // CHECK:STDOUT: %Convert.4: %Convert.type.4 = struct_value () [template] // CHECK:STDOUT: %Convert.assoc_type.3: type = assoc_entity_type %As.type.3, %Convert.type.4 [template] // CHECK:STDOUT: %assoc0.4: %Convert.assoc_type.3 = assoc_entity element0, @As.%Convert.decl [template] // CHECK:STDOUT: %As.facet: %As.type.2 = facet_value Core.IntLiteral, Core.IntLiteral [symbolic] // CHECK:STDOUT: %interface.2: = interface_witness (%Convert.3) [template] -// CHECK:STDOUT: %ImplicitAs.type.3: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] +// CHECK:STDOUT: %ImplicitAs.type.3: type = facet_type <@ImplicitAs, @ImplicitAs(%i32.builtin)> [template] // CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.4 [template] // CHECK:STDOUT: %Convert.5: %Convert.type.5 = struct_value () [template] -// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.2, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.2, @ImplicitAs(%i32.builtin) [template] // CHECK:STDOUT: %Convert.6: %Convert.type.6 = struct_value () [template] // CHECK:STDOUT: %Convert.assoc_type.4: type = assoc_entity_type %ImplicitAs.type.3, %Convert.type.6 [template] // CHECK:STDOUT: %assoc0.5: %Convert.assoc_type.4 = assoc_entity element0, @ImplicitAs.%Convert.decl [template] @@ -114,7 +114,7 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: %Convert.8: %Convert.type.8 = struct_value () [template] // CHECK:STDOUT: %Convert.assoc_type.5: type = assoc_entity_type %ImplicitAs.type.4, %Convert.type.8 [template] // CHECK:STDOUT: %assoc0.6: %Convert.assoc_type.5 = assoc_entity element0, @ImplicitAs.%Convert.decl [template] -// CHECK:STDOUT: %ImplicitAs.facet.2: %ImplicitAs.type.2 = facet_value %i32, %i32 [symbolic] +// CHECK:STDOUT: %ImplicitAs.facet.2: %ImplicitAs.type.2 = facet_value %i32.builtin, %i32.builtin [symbolic] // CHECK:STDOUT: %interface.4: = interface_witness (%Convert.7) [template] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -165,9 +165,9 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: } // CHECK:STDOUT: impl_decl @impl.1 [template] {} { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc19_6.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc19_6.2: type = converted %int.make_type_signed, %.loc19_6.1 [template = constants.%i32] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32.builtin] +// CHECK:STDOUT: %.loc19_6.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32.builtin] +// CHECK:STDOUT: %.loc19_6.2: type = converted %int.make_type_signed, %.loc19_6.1 [template = constants.%i32.builtin] // CHECK:STDOUT: %Add.ref: type = name_ref Add, file.%Add.decl [template = constants.%Add.type] // CHECK:STDOUT: } // CHECK:STDOUT: impl_decl @impl.2 [template] {} { @@ -177,10 +177,10 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: %.loc23_17.2: type = converted %int_literal.make_type, %.loc23_17.1 [template = Core.IntLiteral] // CHECK:STDOUT: %As.ref: %As.type.1 = name_ref As, file.%As.decl [template = constants.%As.generic] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc23_28.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc23_28.2: type = converted %int.make_type_signed, %.loc23_28.1 [template = constants.%i32] -// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(constants.%i32)> [template = constants.%As.type.3] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32.builtin] +// CHECK:STDOUT: %.loc23_28.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32.builtin] +// CHECK:STDOUT: %.loc23_28.2: type = converted %int.make_type_signed, %.loc23_28.1 [template = constants.%i32.builtin] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(constants.%i32.builtin)> [template = constants.%As.type.3] // CHECK:STDOUT: } // CHECK:STDOUT: impl_decl @impl.3 [template] {} { // CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [template = constants.%IntLiteral] @@ -189,16 +189,16 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: %.loc27_17.2: type = converted %int_literal.make_type, %.loc27_17.1 [template = Core.IntLiteral] // CHECK:STDOUT: %ImplicitAs.ref: %ImplicitAs.type.1 = name_ref ImplicitAs, file.%ImplicitAs.decl [template = constants.%ImplicitAs.generic] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc27_36.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc27_36.2: type = converted %int.make_type_signed, %.loc27_36.1 [template = constants.%i32] -// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(constants.%i32)> [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32.builtin] +// CHECK:STDOUT: %.loc27_36.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32.builtin] +// CHECK:STDOUT: %.loc27_36.2: type = converted %int.make_type_signed, %.loc27_36.1 [template = constants.%i32.builtin] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(constants.%i32.builtin)> [template = constants.%ImplicitAs.type.3] // CHECK:STDOUT: } // CHECK:STDOUT: impl_decl @impl.4 [template] {} { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc31_6.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc31_6.2: type = converted %int.make_type_signed, %.loc31_6.1 [template = constants.%i32] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32.builtin] +// CHECK:STDOUT: %.loc31_6.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32.builtin] +// CHECK:STDOUT: %.loc31_6.2: type = converted %int.make_type_signed, %.loc31_6.1 [template = constants.%i32.builtin] // CHECK:STDOUT: %ImplicitAs.ref: %ImplicitAs.type.1 = name_ref ImplicitAs, file.%ImplicitAs.decl [template = constants.%ImplicitAs.generic] // CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [template = constants.%IntLiteral] // CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral] @@ -322,22 +322,22 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.1: %.loc19_6.2 as %Add.ref { // CHECK:STDOUT: %Op.decl: %Op.type.2 = fn_decl @Op.2 [template = constants.%Op.2] { -// CHECK:STDOUT: %self.patt: %i32 = binding_pattern self -// CHECK:STDOUT: %self.param_patt: %i32 = value_param_pattern %self.patt, runtime_param0 -// CHECK:STDOUT: %other.patt: %i32 = binding_pattern other -// CHECK:STDOUT: %other.param_patt: %i32 = value_param_pattern %other.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 +// CHECK:STDOUT: %self.patt: %i32.builtin = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %i32.builtin = value_param_pattern %self.patt, runtime_param0 +// CHECK:STDOUT: %other.patt: %i32.builtin = binding_pattern other +// CHECK:STDOUT: %other.param_patt: %i32.builtin = value_param_pattern %other.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32.builtin = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32.builtin = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref.loc20_15: type = name_ref Self, @impl.1.%.loc19_6.2 [template = constants.%i32] -// CHECK:STDOUT: %Self.ref.loc20_28: type = name_ref Self, @impl.1.%.loc19_6.2 [template = constants.%i32] -// CHECK:STDOUT: %Self.ref.loc20_37: type = name_ref Self, @impl.1.%.loc19_6.2 [template = constants.%i32] -// CHECK:STDOUT: %self.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %self: %i32 = bind_name self, %self.param -// CHECK:STDOUT: %other.param: %i32 = value_param runtime_param1 -// CHECK:STDOUT: %other: %i32 = bind_name other, %other.param -// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param +// CHECK:STDOUT: %Self.ref.loc20_15: type = name_ref Self, @impl.1.%.loc19_6.2 [template = constants.%i32.builtin] +// CHECK:STDOUT: %Self.ref.loc20_28: type = name_ref Self, @impl.1.%.loc19_6.2 [template = constants.%i32.builtin] +// CHECK:STDOUT: %Self.ref.loc20_37: type = name_ref Self, @impl.1.%.loc19_6.2 [template = constants.%i32.builtin] +// CHECK:STDOUT: %self.param: %i32.builtin = value_param runtime_param0 +// CHECK:STDOUT: %self: %i32.builtin = bind_name self, %self.param +// CHECK:STDOUT: %other.param: %i32.builtin = value_param runtime_param1 +// CHECK:STDOUT: %other: %i32.builtin = bind_name other, %other.param +// CHECK:STDOUT: %return.param: ref %i32.builtin = out_param runtime_param2 +// CHECK:STDOUT: %return: ref %i32.builtin = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %interface: = interface_witness (%Op.decl) [template = constants.%interface.1] // CHECK:STDOUT: @@ -350,18 +350,18 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: %Convert.decl: %Convert.type.3 = fn_decl @Convert.3 [template = constants.%Convert.3] { // CHECK:STDOUT: %self.patt: Core.IntLiteral = binding_pattern self // CHECK:STDOUT: %self.param_patt: Core.IntLiteral = value_param_pattern %self.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32.builtin = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32.builtin = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref: type = name_ref Self, @impl.2.%.loc23_17.2 [template = Core.IntLiteral] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc24_31.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc24_31.2: type = converted %int.make_type_signed, %.loc24_31.1 [template = constants.%i32] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32.builtin] +// CHECK:STDOUT: %.loc24_31.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32.builtin] +// CHECK:STDOUT: %.loc24_31.2: type = converted %int.make_type_signed, %.loc24_31.1 [template = constants.%i32.builtin] // CHECK:STDOUT: %self.param: Core.IntLiteral = value_param runtime_param0 // CHECK:STDOUT: %self: Core.IntLiteral = bind_name self, %self.param -// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param +// CHECK:STDOUT: %return.param: ref %i32.builtin = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32.builtin = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %interface: = interface_witness (%Convert.decl) [template = constants.%interface.2] // CHECK:STDOUT: @@ -374,18 +374,18 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: %Convert.decl: %Convert.type.5 = fn_decl @Convert.4 [template = constants.%Convert.5] { // CHECK:STDOUT: %self.patt: Core.IntLiteral = binding_pattern self // CHECK:STDOUT: %self.param_patt: Core.IntLiteral = value_param_pattern %self.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32.builtin = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32.builtin = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref: type = name_ref Self, @impl.3.%.loc27_17.2 [template = Core.IntLiteral] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc28_31.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc28_31.2: type = converted %int.make_type_signed, %.loc28_31.1 [template = constants.%i32] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32.builtin] +// CHECK:STDOUT: %.loc28_31.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32.builtin] +// CHECK:STDOUT: %.loc28_31.2: type = converted %int.make_type_signed, %.loc28_31.1 [template = constants.%i32.builtin] // CHECK:STDOUT: %self.param: Core.IntLiteral = value_param runtime_param0 // CHECK:STDOUT: %self: Core.IntLiteral = bind_name self, %self.param -// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param +// CHECK:STDOUT: %return.param: ref %i32.builtin = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32.builtin = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %interface: = interface_witness (%Convert.decl) [template = constants.%interface.3] // CHECK:STDOUT: @@ -396,18 +396,18 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.4: %.loc31_6.2 as %ImplicitAs.type { // CHECK:STDOUT: %Convert.decl: %Convert.type.7 = fn_decl @Convert.5 [template = constants.%Convert.7] { -// CHECK:STDOUT: %self.patt: %i32 = binding_pattern self -// CHECK:STDOUT: %self.param_patt: %i32 = value_param_pattern %self.patt, runtime_param0 +// CHECK:STDOUT: %self.patt: %i32.builtin = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %i32.builtin = value_param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: %return.patt: Core.IntLiteral = return_slot_pattern // CHECK:STDOUT: %return.param_patt: Core.IntLiteral = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref: type = name_ref Self, @impl.4.%.loc31_6.2 [template = constants.%i32] +// CHECK:STDOUT: %Self.ref: type = name_ref Self, @impl.4.%.loc31_6.2 [template = constants.%i32.builtin] // CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [template = constants.%IntLiteral] // CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral] // CHECK:STDOUT: %.loc32_42.1: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral] // CHECK:STDOUT: %.loc32_42.2: type = converted %int_literal.make_type, %.loc32_42.1 [template = Core.IntLiteral] -// CHECK:STDOUT: %self.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %self: %i32 = bind_name self, %self.param +// CHECK:STDOUT: %self.param: %i32.builtin = value_param runtime_param0 +// CHECK:STDOUT: %self: %i32.builtin = bind_name self, %self.param // CHECK:STDOUT: %return.param: ref Core.IntLiteral = out_param runtime_param1 // CHECK:STDOUT: %return: ref Core.IntLiteral = return_slot %return.param // CHECK:STDOUT: } @@ -447,13 +447,13 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: fn[%self.param_patt: @Convert.2.%Self.as_type.loc16_20.1 (%Self.as_type.3)]() -> @Convert.2.%T (%T); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Op.2[%self.param_patt: %i32](%other.param_patt: %i32) -> %i32 = "int.sadd"; +// CHECK:STDOUT: fn @Op.2[%self.param_patt: %i32.builtin](%other.param_patt: %i32.builtin) -> %i32.builtin = "int.sadd"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Convert.3[%self.param_patt: Core.IntLiteral]() -> %i32 = "int.convert_checked"; +// CHECK:STDOUT: fn @Convert.3[%self.param_patt: Core.IntLiteral]() -> %i32.builtin = "int.convert_checked"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Convert.4[%self.param_patt: Core.IntLiteral]() -> %i32 = "int.convert_checked"; +// CHECK:STDOUT: fn @Convert.4[%self.param_patt: Core.IntLiteral]() -> %i32.builtin = "int.convert_checked"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Convert.5[%self.param_patt: %i32]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: fn @Convert.5[%self.param_patt: %i32.builtin]() -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: // CHECK:STDOUT: specific @Op.1(constants.%Self.1) { // CHECK:STDOUT: %Self => constants.%Self.1 @@ -506,12 +506,12 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: // CHECK:STDOUT: specific @Op.1(constants.%Add.facet) { // CHECK:STDOUT: %Self => constants.%Add.facet -// CHECK:STDOUT: %Self.as_type.loc8_15.1 => constants.%i32 +// CHECK:STDOUT: %Self.as_type.loc8_15.1 => constants.%i32.builtin // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @As(constants.%i32) { -// CHECK:STDOUT: %T.loc11_14.2 => constants.%i32 -// CHECK:STDOUT: %T.patt.loc11_14.2 => constants.%i32 +// CHECK:STDOUT: specific @As(constants.%i32.builtin) { +// CHECK:STDOUT: %T.loc11_14.2 => constants.%i32.builtin +// CHECK:STDOUT: %T.patt.loc11_14.2 => constants.%i32.builtin // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %As.type => constants.%As.type.3 @@ -522,16 +522,16 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: %assoc0.loc12_32.2 => constants.%assoc0.4 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Convert.1(constants.%i32, constants.%As.facet) { -// CHECK:STDOUT: %T => constants.%i32 +// CHECK:STDOUT: specific @Convert.1(constants.%i32.builtin, constants.%As.facet) { +// CHECK:STDOUT: %T => constants.%i32.builtin // CHECK:STDOUT: %As.type => constants.%As.type.3 // CHECK:STDOUT: %Self => constants.%As.facet // CHECK:STDOUT: %Self.as_type.loc12_20.1 => Core.IntLiteral // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @ImplicitAs(constants.%i32) { -// CHECK:STDOUT: %T.loc15_22.2 => constants.%i32 -// CHECK:STDOUT: %T.patt.loc15_22.2 => constants.%i32 +// CHECK:STDOUT: specific @ImplicitAs(constants.%i32.builtin) { +// CHECK:STDOUT: %T.loc15_22.2 => constants.%i32.builtin +// CHECK:STDOUT: %T.patt.loc15_22.2 => constants.%i32.builtin // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 @@ -542,8 +542,8 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: %assoc0.loc16_32.2 => constants.%assoc0.5 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Convert.2(constants.%i32, constants.%ImplicitAs.facet.1) { -// CHECK:STDOUT: %T => constants.%i32 +// CHECK:STDOUT: specific @Convert.2(constants.%i32.builtin, constants.%ImplicitAs.facet.1) { +// CHECK:STDOUT: %T => constants.%i32.builtin // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 // CHECK:STDOUT: %Self => constants.%ImplicitAs.facet.1 // CHECK:STDOUT: %Self.as_type.loc16_20.1 => Core.IntLiteral @@ -566,7 +566,7 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: %T => Core.IntLiteral // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.4 // CHECK:STDOUT: %Self => constants.%ImplicitAs.facet.2 -// CHECK:STDOUT: %Self.as_type.loc16_20.1 => constants.%i32 +// CHECK:STDOUT: %Self.as_type.loc16_20.1 => constants.%i32.builtin // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- user.carbon @@ -575,7 +575,7 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] // CHECK:STDOUT: %Int.type: type = fn_type @Int [template] // CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] // CHECK:STDOUT: %As.type.2: type = facet_type <@As, @As(%T)> [symbolic] @@ -586,8 +586,8 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: %Self.as_type.1: type = facet_access_type %Self.1 [symbolic] // CHECK:STDOUT: %Convert.assoc_type.1: type = assoc_entity_type %As.type.2, %Convert.type.1 [symbolic] // CHECK:STDOUT: %assoc0.1: %Convert.assoc_type.1 = assoc_entity element0, imports.%import_ref.6 [symbolic] -// CHECK:STDOUT: %As.type.3: type = facet_type <@As, @As(%i32)> [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @As(%i32) [template] +// CHECK:STDOUT: %As.type.3: type = facet_type <@As, @As(%i32.builtin)> [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @As(%i32.builtin) [template] // CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [template] // CHECK:STDOUT: %Convert.assoc_type.2: type = assoc_entity_type %As.type.3, %Convert.type.2 [template] // CHECK:STDOUT: %assoc0.2: %Convert.assoc_type.2 = assoc_entity element0, imports.%import_ref.6 [template] @@ -596,13 +596,13 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: %Self.2: %Add.type = bind_symbolic_name Self, 0 [symbolic] // CHECK:STDOUT: %ImplicitAs.type.2: type = facet_type <@ImplicitAs, @ImplicitAs(%T)> [symbolic] // CHECK:STDOUT: %Self.3: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic] -// CHECK:STDOUT: %ImplicitAs.type.3: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] +// CHECK:STDOUT: %ImplicitAs.type.3: type = facet_type <@ImplicitAs, @ImplicitAs(%i32.builtin)> [template] // CHECK:STDOUT: %Convert.type.3: type = fn_type @Convert.2, @ImplicitAs(%T) [symbolic] // CHECK:STDOUT: %Convert.3: %Convert.type.3 = struct_value () [symbolic] // CHECK:STDOUT: %Self.as_type.2: type = facet_access_type %Self.3 [symbolic] // CHECK:STDOUT: %Convert.assoc_type.3: type = assoc_entity_type %ImplicitAs.type.2, %Convert.type.3 [symbolic] // CHECK:STDOUT: %assoc0.4: %Convert.assoc_type.3 = assoc_entity element0, imports.%import_ref.23 [symbolic] -// CHECK:STDOUT: %Convert.type.4: type = fn_type @Convert.2, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.4: type = fn_type @Convert.2, @ImplicitAs(%i32.builtin) [template] // CHECK:STDOUT: %Convert.4: %Convert.type.4 = struct_value () [template] // CHECK:STDOUT: %Convert.assoc_type.4: type = assoc_entity_type %ImplicitAs.type.3, %Convert.type.4 [template] // CHECK:STDOUT: %assoc0.5: %Convert.assoc_type.4 = assoc_entity element0, imports.%import_ref.24 [template] @@ -615,10 +615,10 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: %Convert.6: %Convert.type.6 = struct_value () [template] // CHECK:STDOUT: %interface.1: = interface_witness (%Convert.6) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.6 [template] -// CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] +// CHECK:STDOUT: %int_1.2: %i32.builtin = int_value 1 [template] // CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.6 [template] -// CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] +// CHECK:STDOUT: %int_2.2: %i32.builtin = int_value 2 [template] // CHECK:STDOUT: %Op.type.1: type = fn_type @Op.1 [template] // CHECK:STDOUT: %Self.as_type.3: type = facet_access_type %Self.2 [symbolic] // CHECK:STDOUT: %Op.assoc_type: type = assoc_entity_type %Add.type, %Op.type.1 [template] @@ -627,21 +627,21 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: %Op.2: %Op.type.2 = struct_value () [template] // CHECK:STDOUT: %interface.2: = interface_witness (%Op.2) [template] // CHECK:STDOUT: %Op.bound.1: = bound_method %int_1.2, %Op.2 [template] -// CHECK:STDOUT: %int_3.1: %i32 = int_value 3 [template] +// CHECK:STDOUT: %int_3.1: %i32.builtin = int_value 3 [template] // CHECK:STDOUT: %assoc0.8: %Convert.assoc_type.3 = assoc_entity element0, imports.%import_ref.32 [symbolic] // CHECK:STDOUT: %Convert.type.7: type = fn_type @Convert.4 [template] // CHECK:STDOUT: %Convert.7: %Convert.type.7 = struct_value () [template] // CHECK:STDOUT: %interface.3: = interface_witness (%Convert.7) [template] // CHECK:STDOUT: %Convert.bound.3: = bound_method %int_3.1, %Convert.7 [template] // CHECK:STDOUT: %int_3.2: Core.IntLiteral = int_value 3 [template] -// CHECK:STDOUT: %array_type: type = array_type %int_3.2, %i32 [template] +// CHECK:STDOUT: %array_type: type = array_type %int_3.2, %i32.builtin [template] // CHECK:STDOUT: %int_4.1: Core.IntLiteral = int_value 4 [template] // CHECK:STDOUT: %Convert.bound.4: = bound_method %int_3.2, %Convert.6 [template] // CHECK:STDOUT: %Convert.bound.5: = bound_method %int_4.1, %Convert.6 [template] -// CHECK:STDOUT: %int_4.2: %i32 = int_value 4 [template] +// CHECK:STDOUT: %int_4.2: %i32.builtin = int_value 4 [template] // CHECK:STDOUT: %Op.bound.2: = bound_method %int_3.1, %Op.2 [template] -// CHECK:STDOUT: %int_7: %i32 = int_value 7 [template] -// CHECK:STDOUT: %tuple.type: type = tuple_type (Core.IntLiteral, Core.IntLiteral, %i32) [template] +// CHECK:STDOUT: %int_7: %i32.builtin = int_value 7 [template] +// CHECK:STDOUT: %tuple.type: type = tuple_type (Core.IntLiteral, Core.IntLiteral, %i32.builtin) [template] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %Convert.type.8: type = fn_type @Convert.5 [template] // CHECK:STDOUT: %Convert.8: %Convert.type.8 = struct_value () [template] @@ -666,7 +666,7 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: %import_ref.8 = import_ref Core//default, inst38 [no loc], unloaded // CHECK:STDOUT: %import_ref.9: %Op.assoc_type = import_ref Core//default, loc8_41, loaded [template = constants.%assoc0.7] // CHECK:STDOUT: %import_ref.10 = import_ref Core//default, Op, unloaded -// CHECK:STDOUT: %import_ref.11: type = import_ref Core//default, loc19_6, loaded [template = constants.%i32] +// CHECK:STDOUT: %import_ref.11: type = import_ref Core//default, loc19_6, loaded [template = constants.%i32.builtin] // CHECK:STDOUT: %import_ref.12: type = import_ref Core//default, loc19_13, loaded [template = constants.%Add.type] // CHECK:STDOUT: %import_ref.13: = import_ref Core//default, loc19_17, loaded [template = constants.%interface.2] // CHECK:STDOUT: %import_ref.14: type = import_ref Core//default, loc23_17, loaded [template = Core.IntLiteral] @@ -679,7 +679,7 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: %import_ref.21: type = import_ref Core//default, loc27_36, loaded [template = constants.%ImplicitAs.type.3] // CHECK:STDOUT: %import_ref.22: = import_ref Core//default, loc27_38, loaded [template = constants.%interface.4] // CHECK:STDOUT: %import_ref.23 = import_ref Core//default, loc16_32, unloaded -// CHECK:STDOUT: %import_ref.25: type = import_ref Core//default, loc31_6, loaded [template = constants.%i32] +// CHECK:STDOUT: %import_ref.25: type = import_ref Core//default, loc31_6, loaded [template = constants.%i32.builtin] // CHECK:STDOUT: %import_ref.26: type = import_ref Core//default, loc31_36, loaded [template = constants.%ImplicitAs.type.4] // CHECK:STDOUT: %import_ref.27: = import_ref Core//default, loc31_38, loaded [template = constants.%interface.3] // CHECK:STDOUT: } @@ -691,40 +691,40 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int_32.loc4_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc4_11: init type = call constants.%Int(%int_32.loc4_11) [template = constants.%i32] +// CHECK:STDOUT: %int.make_type_signed.loc4_11: init type = call constants.%Int(%int_32.loc4_11) [template = constants.%i32.builtin] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_32.loc4_22: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc4_22: init type = call constants.%Int(%int_32.loc4_22) [template = constants.%i32] -// CHECK:STDOUT: %.loc4_22.1: type = value_of_initializer %int.make_type_signed.loc4_22 [template = constants.%i32] -// CHECK:STDOUT: %.loc4_22.2: type = converted %int.make_type_signed.loc4_22, %.loc4_22.1 [template = constants.%i32] +// CHECK:STDOUT: %int.make_type_signed.loc4_22: init type = call constants.%Int(%int_32.loc4_22) [template = constants.%i32.builtin] +// CHECK:STDOUT: %.loc4_22.1: type = value_of_initializer %int.make_type_signed.loc4_22 [template = constants.%i32.builtin] +// CHECK:STDOUT: %.loc4_22.2: type = converted %int.make_type_signed.loc4_22, %.loc4_22.1 [template = constants.%i32.builtin] // CHECK:STDOUT: %impl.elem0.loc4_19: %Convert.type.2 = interface_witness_access constants.%interface.1, element0 [template = constants.%Convert.6] // CHECK:STDOUT: %Convert.bound.loc4_19: = bound_method %int_1, %impl.elem0.loc4_19 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %int.convert_checked.loc4_19: init %i32 = call %Convert.bound.loc4_19(%int_1) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc4_19.1: %i32 = value_of_initializer %int.convert_checked.loc4_19 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc4_19.2: %i32 = converted %int_1, %.loc4_19.1 [template = constants.%int_1.2] +// CHECK:STDOUT: %int.convert_checked.loc4_19: init %i32.builtin = call %Convert.bound.loc4_19(%int_1) [template = constants.%int_1.2] +// CHECK:STDOUT: %.loc4_19.1: %i32.builtin = value_of_initializer %int.convert_checked.loc4_19 [template = constants.%int_1.2] +// CHECK:STDOUT: %.loc4_19.2: %i32.builtin = converted %int_1, %.loc4_19.1 [template = constants.%int_1.2] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %int_32.loc4_35: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc4_35: init type = call constants.%Int(%int_32.loc4_35) [template = constants.%i32] -// CHECK:STDOUT: %.loc4_35.1: type = value_of_initializer %int.make_type_signed.loc4_35 [template = constants.%i32] -// CHECK:STDOUT: %.loc4_35.2: type = converted %int.make_type_signed.loc4_35, %.loc4_35.1 [template = constants.%i32] +// CHECK:STDOUT: %int.make_type_signed.loc4_35: init type = call constants.%Int(%int_32.loc4_35) [template = constants.%i32.builtin] +// CHECK:STDOUT: %.loc4_35.1: type = value_of_initializer %int.make_type_signed.loc4_35 [template = constants.%i32.builtin] +// CHECK:STDOUT: %.loc4_35.2: type = converted %int.make_type_signed.loc4_35, %.loc4_35.1 [template = constants.%i32.builtin] // CHECK:STDOUT: %impl.elem0.loc4_32: %Convert.type.2 = interface_witness_access constants.%interface.1, element0 [template = constants.%Convert.6] // CHECK:STDOUT: %Convert.bound.loc4_32: = bound_method %int_2, %impl.elem0.loc4_32 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %int.convert_checked.loc4_32: init %i32 = call %Convert.bound.loc4_32(%int_2) [template = constants.%int_2.2] -// CHECK:STDOUT: %.loc4_32.1: %i32 = value_of_initializer %int.convert_checked.loc4_32 [template = constants.%int_2.2] -// CHECK:STDOUT: %.loc4_32.2: %i32 = converted %int_2, %.loc4_32.1 [template = constants.%int_2.2] +// CHECK:STDOUT: %int.convert_checked.loc4_32: init %i32.builtin = call %Convert.bound.loc4_32(%int_2) [template = constants.%int_2.2] +// CHECK:STDOUT: %.loc4_32.1: %i32.builtin = value_of_initializer %int.convert_checked.loc4_32 [template = constants.%int_2.2] +// CHECK:STDOUT: %.loc4_32.2: %i32.builtin = converted %int_2, %.loc4_32.1 [template = constants.%int_2.2] // CHECK:STDOUT: %impl.elem0.loc4_27.1: %Op.type.1 = interface_witness_access constants.%interface.2, element0 [template = constants.%Op.2] // CHECK:STDOUT: %Op.bound: = bound_method %.loc4_19.2, %impl.elem0.loc4_27.1 [template = constants.%Op.bound.1] -// CHECK:STDOUT: %int.sadd: init %i32 = call %Op.bound(%.loc4_19.2, %.loc4_32.2) [template = constants.%int_3.1] -// CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_signed.loc4_11 [template = constants.%i32] -// CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_signed.loc4_11, %.loc4_11.1 [template = constants.%i32] +// CHECK:STDOUT: %int.sadd: init %i32.builtin = call %Op.bound(%.loc4_19.2, %.loc4_32.2) [template = constants.%int_3.1] +// CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_signed.loc4_11 [template = constants.%i32.builtin] +// CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_signed.loc4_11, %.loc4_11.1 [template = constants.%i32.builtin] // CHECK:STDOUT: %impl.elem0.loc4_27.2: %Convert.type.5 = interface_witness_access constants.%interface.3, element0 [template = constants.%Convert.7] // CHECK:STDOUT: %Convert.bound.loc4_27: = bound_method %int.sadd, %impl.elem0.loc4_27.2 [template = constants.%Convert.bound.3] -// CHECK:STDOUT: %.loc4_27.1: %i32 = value_of_initializer %int.sadd [template = constants.%int_3.1] -// CHECK:STDOUT: %.loc4_27.2: %i32 = converted %int.sadd, %.loc4_27.1 [template = constants.%int_3.1] +// CHECK:STDOUT: %.loc4_27.1: %i32.builtin = value_of_initializer %int.sadd [template = constants.%int_3.1] +// CHECK:STDOUT: %.loc4_27.2: %i32.builtin = converted %int.sadd, %.loc4_27.1 [template = constants.%int_3.1] // CHECK:STDOUT: %int.convert_checked.loc4_27: init Core.IntLiteral = call %Convert.bound.loc4_27(%.loc4_27.2) [template = constants.%int_3.2] // CHECK:STDOUT: %.loc4_27.3: Core.IntLiteral = value_of_initializer %int.convert_checked.loc4_27 [template = constants.%int_3.2] // CHECK:STDOUT: %.loc4_27.4: Core.IntLiteral = converted %int.sadd, %.loc4_27.3 [template = constants.%int_3.2] -// CHECK:STDOUT: %array_type: type = array_type %.loc4_27.4, %i32 [template = constants.%array_type] +// CHECK:STDOUT: %array_type: type = array_type %.loc4_27.4, %i32.builtin [template = constants.%array_type] // CHECK:STDOUT: %arr.var: ref %array_type = var arr // CHECK:STDOUT: %arr: ref %array_type = bind_name arr, %arr.var // CHECK:STDOUT: } @@ -816,7 +816,7 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: fn[%self.param_patt: @Convert.2.%Self.as_type (%Self.as_type.2)]() -> @Convert.2.%T (%T); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Convert.3[%self.param_patt: Core.IntLiteral]() -> %i32 = "int.convert_checked" [from "core.carbon"]; +// CHECK:STDOUT: fn @Convert.3[%self.param_patt: Core.IntLiteral]() -> %i32.builtin = "int.convert_checked" [from "core.carbon"]; // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Op.1(constants.%Self.2: %Add.type) [from "core.carbon"] { // CHECK:STDOUT: %Self: %Add.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.2)] @@ -825,11 +825,11 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: fn[%self.param_patt: @Op.1.%Self.as_type (%Self.as_type.3)](%other.param_patt: @Op.1.%Self.as_type (%Self.as_type.3)) -> @Op.1.%Self.as_type (%Self.as_type.3); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Op.2[%self.param_patt: %i32](%other.param_patt: %i32) -> %i32 = "int.sadd" [from "core.carbon"]; +// CHECK:STDOUT: fn @Op.2[%self.param_patt: %i32.builtin](%other.param_patt: %i32.builtin) -> %i32.builtin = "int.sadd" [from "core.carbon"]; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Convert.4[%self.param_patt: %i32]() -> Core.IntLiteral = "int.convert_checked" [from "core.carbon"]; +// CHECK:STDOUT: fn @Convert.4[%self.param_patt: %i32.builtin]() -> Core.IntLiteral = "int.convert_checked" [from "core.carbon"]; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Convert.5[%self.param_patt: Core.IntLiteral]() -> %i32 = "int.convert_checked" [from "core.carbon"]; +// CHECK:STDOUT: fn @Convert.5[%self.param_patt: Core.IntLiteral]() -> %i32.builtin = "int.convert_checked" [from "core.carbon"]; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: @@ -837,45 +837,45 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: %int_4.loc4_47: Core.IntLiteral = int_value 4 [template = constants.%int_4.1] // CHECK:STDOUT: %int_3.loc4_51: Core.IntLiteral = int_value 3 [template = constants.%int_3.2] // CHECK:STDOUT: %int_32.loc4_56: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc4_56: init type = call constants.%Int(%int_32.loc4_56) [template = constants.%i32] -// CHECK:STDOUT: %.loc4_56.1: type = value_of_initializer %int.make_type_signed.loc4_56 [template = constants.%i32] -// CHECK:STDOUT: %.loc4_56.2: type = converted %int.make_type_signed.loc4_56, %.loc4_56.1 [template = constants.%i32] +// CHECK:STDOUT: %int.make_type_signed.loc4_56: init type = call constants.%Int(%int_32.loc4_56) [template = constants.%i32.builtin] +// CHECK:STDOUT: %.loc4_56.1: type = value_of_initializer %int.make_type_signed.loc4_56 [template = constants.%i32.builtin] +// CHECK:STDOUT: %.loc4_56.2: type = converted %int.make_type_signed.loc4_56, %.loc4_56.1 [template = constants.%i32.builtin] // CHECK:STDOUT: %impl.elem0.loc4_53: %Convert.type.2 = interface_witness_access constants.%interface.1, element0 [template = constants.%Convert.6] // CHECK:STDOUT: %Convert.bound.loc4_53: = bound_method %int_3.loc4_51, %impl.elem0.loc4_53 [template = constants.%Convert.bound.4] -// CHECK:STDOUT: %int.convert_checked.loc4_53: init %i32 = call %Convert.bound.loc4_53(%int_3.loc4_51) [template = constants.%int_3.1] -// CHECK:STDOUT: %.loc4_53.1: %i32 = value_of_initializer %int.convert_checked.loc4_53 [template = constants.%int_3.1] -// CHECK:STDOUT: %.loc4_53.2: %i32 = converted %int_3.loc4_51, %.loc4_53.1 [template = constants.%int_3.1] +// CHECK:STDOUT: %int.convert_checked.loc4_53: init %i32.builtin = call %Convert.bound.loc4_53(%int_3.loc4_51) [template = constants.%int_3.1] +// CHECK:STDOUT: %.loc4_53.1: %i32.builtin = value_of_initializer %int.convert_checked.loc4_53 [template = constants.%int_3.1] +// CHECK:STDOUT: %.loc4_53.2: %i32.builtin = converted %int_3.loc4_51, %.loc4_53.1 [template = constants.%int_3.1] // CHECK:STDOUT: %int_4.loc4_64: Core.IntLiteral = int_value 4 [template = constants.%int_4.1] // CHECK:STDOUT: %int_32.loc4_69: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc4_69: init type = call constants.%Int(%int_32.loc4_69) [template = constants.%i32] -// CHECK:STDOUT: %.loc4_69.1: type = value_of_initializer %int.make_type_signed.loc4_69 [template = constants.%i32] -// CHECK:STDOUT: %.loc4_69.2: type = converted %int.make_type_signed.loc4_69, %.loc4_69.1 [template = constants.%i32] +// CHECK:STDOUT: %int.make_type_signed.loc4_69: init type = call constants.%Int(%int_32.loc4_69) [template = constants.%i32.builtin] +// CHECK:STDOUT: %.loc4_69.1: type = value_of_initializer %int.make_type_signed.loc4_69 [template = constants.%i32.builtin] +// CHECK:STDOUT: %.loc4_69.2: type = converted %int.make_type_signed.loc4_69, %.loc4_69.1 [template = constants.%i32.builtin] // CHECK:STDOUT: %impl.elem0.loc4_66: %Convert.type.2 = interface_witness_access constants.%interface.1, element0 [template = constants.%Convert.6] // CHECK:STDOUT: %Convert.bound.loc4_66: = bound_method %int_4.loc4_64, %impl.elem0.loc4_66 [template = constants.%Convert.bound.5] -// CHECK:STDOUT: %int.convert_checked.loc4_66: init %i32 = call %Convert.bound.loc4_66(%int_4.loc4_64) [template = constants.%int_4.2] -// CHECK:STDOUT: %.loc4_66.1: %i32 = value_of_initializer %int.convert_checked.loc4_66 [template = constants.%int_4.2] -// CHECK:STDOUT: %.loc4_66.2: %i32 = converted %int_4.loc4_64, %.loc4_66.1 [template = constants.%int_4.2] +// CHECK:STDOUT: %int.convert_checked.loc4_66: init %i32.builtin = call %Convert.bound.loc4_66(%int_4.loc4_64) [template = constants.%int_4.2] +// CHECK:STDOUT: %.loc4_66.1: %i32.builtin = value_of_initializer %int.convert_checked.loc4_66 [template = constants.%int_4.2] +// CHECK:STDOUT: %.loc4_66.2: %i32.builtin = converted %int_4.loc4_64, %.loc4_66.1 [template = constants.%int_4.2] // CHECK:STDOUT: %impl.elem0.loc4_61: %Op.type.1 = interface_witness_access constants.%interface.2, element0 [template = constants.%Op.2] // CHECK:STDOUT: %Op.bound: = bound_method %.loc4_53.2, %impl.elem0.loc4_61 [template = constants.%Op.bound.2] -// CHECK:STDOUT: %int.sadd: init %i32 = call %Op.bound(%.loc4_53.2, %.loc4_66.2) [template = constants.%int_7] +// CHECK:STDOUT: %int.sadd: init %i32.builtin = call %Op.bound(%.loc4_53.2, %.loc4_66.2) [template = constants.%int_7] // CHECK:STDOUT: %.loc4_73.1: %tuple.type = tuple_literal (%int_3.loc4_44, %int_4.loc4_47, %int.sadd) // CHECK:STDOUT: %impl.elem0.loc4_73.1: %Convert.type.4 = interface_witness_access constants.%interface.4, element0 [template = constants.%Convert.8] // CHECK:STDOUT: %Convert.bound.loc4_73.1: = bound_method %int_3.loc4_44, %impl.elem0.loc4_73.1 [template = constants.%Convert.bound.6] -// CHECK:STDOUT: %int.convert_checked.loc4_73.1: init %i32 = call %Convert.bound.loc4_73.1(%int_3.loc4_44) [template = constants.%int_3.1] -// CHECK:STDOUT: %.loc4_73.2: init %i32 = converted %int_3.loc4_44, %int.convert_checked.loc4_73.1 [template = constants.%int_3.1] +// CHECK:STDOUT: %int.convert_checked.loc4_73.1: init %i32.builtin = call %Convert.bound.loc4_73.1(%int_3.loc4_44) [template = constants.%int_3.1] +// CHECK:STDOUT: %.loc4_73.2: init %i32.builtin = converted %int_3.loc4_44, %int.convert_checked.loc4_73.1 [template = constants.%int_3.1] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0] -// CHECK:STDOUT: %.loc4_73.3: ref %i32 = array_index file.%arr.var, %int_0 -// CHECK:STDOUT: %.loc4_73.4: init %i32 = initialize_from %.loc4_73.2 to %.loc4_73.3 [template = constants.%int_3.1] +// CHECK:STDOUT: %.loc4_73.3: ref %i32.builtin = array_index file.%arr.var, %int_0 +// CHECK:STDOUT: %.loc4_73.4: init %i32.builtin = initialize_from %.loc4_73.2 to %.loc4_73.3 [template = constants.%int_3.1] // CHECK:STDOUT: %impl.elem0.loc4_73.2: %Convert.type.4 = interface_witness_access constants.%interface.4, element0 [template = constants.%Convert.8] // CHECK:STDOUT: %Convert.bound.loc4_73.2: = bound_method %int_4.loc4_47, %impl.elem0.loc4_73.2 [template = constants.%Convert.bound.7] -// CHECK:STDOUT: %int.convert_checked.loc4_73.2: init %i32 = call %Convert.bound.loc4_73.2(%int_4.loc4_47) [template = constants.%int_4.2] -// CHECK:STDOUT: %.loc4_73.5: init %i32 = converted %int_4.loc4_47, %int.convert_checked.loc4_73.2 [template = constants.%int_4.2] +// CHECK:STDOUT: %int.convert_checked.loc4_73.2: init %i32.builtin = call %Convert.bound.loc4_73.2(%int_4.loc4_47) [template = constants.%int_4.2] +// CHECK:STDOUT: %.loc4_73.5: init %i32.builtin = converted %int_4.loc4_47, %int.convert_checked.loc4_73.2 [template = constants.%int_4.2] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %.loc4_73.6: ref %i32 = array_index file.%arr.var, %int_1 -// CHECK:STDOUT: %.loc4_73.7: init %i32 = initialize_from %.loc4_73.5 to %.loc4_73.6 [template = constants.%int_4.2] +// CHECK:STDOUT: %.loc4_73.6: ref %i32.builtin = array_index file.%arr.var, %int_1 +// CHECK:STDOUT: %.loc4_73.7: init %i32.builtin = initialize_from %.loc4_73.5 to %.loc4_73.6 [template = constants.%int_4.2] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %.loc4_73.8: ref %i32 = array_index file.%arr.var, %int_2 -// CHECK:STDOUT: %.loc4_73.9: init %i32 = initialize_from %int.sadd to %.loc4_73.8 [template = constants.%int_7] +// CHECK:STDOUT: %.loc4_73.8: ref %i32.builtin = array_index file.%arr.var, %int_2 +// CHECK:STDOUT: %.loc4_73.9: init %i32.builtin = initialize_from %int.sadd to %.loc4_73.8 [template = constants.%int_7] // CHECK:STDOUT: %.loc4_73.10: init %array_type = array_init (%.loc4_73.4, %.loc4_73.7, %.loc4_73.9) to file.%arr.var [template = constants.%array] // CHECK:STDOUT: %.loc4_74: init %array_type = converted %.loc4_73.1, %.loc4_73.10 [template = constants.%array] // CHECK:STDOUT: assign file.%arr.var, %.loc4_74 @@ -904,9 +904,9 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: %Self.as_type => constants.%Self.as_type.1 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @As(constants.%i32) { -// CHECK:STDOUT: %T => constants.%i32 -// CHECK:STDOUT: %T.patt => constants.%i32 +// CHECK:STDOUT: specific @As(constants.%i32.builtin) { +// CHECK:STDOUT: %T => constants.%i32.builtin +// CHECK:STDOUT: %T.patt => constants.%i32.builtin // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %As.type => constants.%As.type.3 @@ -922,9 +922,9 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: %T.patt => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @ImplicitAs(constants.%i32) { -// CHECK:STDOUT: %T => constants.%i32 -// CHECK:STDOUT: %T.patt => constants.%i32 +// CHECK:STDOUT: specific @ImplicitAs(constants.%i32.builtin) { +// CHECK:STDOUT: %T => constants.%i32.builtin +// CHECK:STDOUT: %T.patt => constants.%i32.builtin // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 diff --git a/toolchain/check/testdata/function/builtin/no_prelude/import.carbon b/toolchain/check/testdata/function/builtin/no_prelude/import.carbon index b074158331ddb..323b98e6ff1f1 100644 --- a/toolchain/check/testdata/function/builtin/no_prelude/import.carbon +++ b/toolchain/check/testdata/function/builtin/no_prelude/import.carbon @@ -35,7 +35,7 @@ var arr: [i32; Core.AsIntLiteral(Core.TestAdd(Core.AsI32(1), Core.AsI32(2)))] = // CHECK:STDOUT: %Int.type: type = fn_type @Int [template] // CHECK:STDOUT: %Int: %Int.type = struct_value () [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [template] // CHECK:STDOUT: %AsI32.type: type = fn_type @AsI32 [template] // CHECK:STDOUT: %AsI32: %AsI32.type = struct_value () [template] // CHECK:STDOUT: %AsIntLiteral.type: type = fn_type @AsIntLiteral [template] @@ -77,67 +77,67 @@ var arr: [i32; Core.AsIntLiteral(Core.TestAdd(Core.AsI32(1), Core.AsI32(2)))] = // CHECK:STDOUT: %AsI32.decl: %AsI32.type = fn_decl @AsI32 [template = constants.%AsI32] { // CHECK:STDOUT: %a.patt: Core.IntLiteral = binding_pattern a // CHECK:STDOUT: %a.param_patt: Core.IntLiteral = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32.builtin = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32.builtin = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [template = constants.%IntLiteral] // CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral] // CHECK:STDOUT: %.loc8_24.1: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral] // CHECK:STDOUT: %.loc8_24.2: type = converted %int_literal.make_type, %.loc8_24.1 [template = Core.IntLiteral] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc8_30.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc8_30.2: type = converted %int.make_type_signed, %.loc8_30.1 [template = constants.%i32] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32.builtin] +// CHECK:STDOUT: %.loc8_30.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32.builtin] +// CHECK:STDOUT: %.loc8_30.2: type = converted %int.make_type_signed, %.loc8_30.1 [template = constants.%i32.builtin] // CHECK:STDOUT: %a.param: Core.IntLiteral = value_param runtime_param0 // CHECK:STDOUT: %a: Core.IntLiteral = bind_name a, %a.param -// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param +// CHECK:STDOUT: %return.param: ref %i32.builtin = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32.builtin = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %AsIntLiteral.decl: %AsIntLiteral.type = fn_decl @AsIntLiteral [template = constants.%AsIntLiteral] { -// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %a.patt: %i32.builtin = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32.builtin = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %return.patt: Core.IntLiteral = return_slot_pattern // CHECK:STDOUT: %return.param_patt: Core.IntLiteral = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc9_20.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc9_20.2: type = converted %int.make_type_signed, %.loc9_20.1 [template = constants.%i32] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32.builtin] +// CHECK:STDOUT: %.loc9_20.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32.builtin] +// CHECK:STDOUT: %.loc9_20.2: type = converted %int.make_type_signed, %.loc9_20.1 [template = constants.%i32.builtin] // CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [template = constants.%IntLiteral] // CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral] // CHECK:STDOUT: %.loc9_39.1: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral] // CHECK:STDOUT: %.loc9_39.2: type = converted %int_literal.make_type, %.loc9_39.1 [template = Core.IntLiteral] -// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %a.param: %i32.builtin = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32.builtin = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref Core.IntLiteral = out_param runtime_param1 // CHECK:STDOUT: %return: ref Core.IntLiteral = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %TestAdd.decl: %TestAdd.type = fn_decl @TestAdd [template = constants.%TestAdd] { -// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 +// CHECK:STDOUT: %a.patt: %i32.builtin = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32.builtin = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %b.patt: %i32.builtin = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %i32.builtin = value_param_pattern %b.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32.builtin = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32.builtin = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc11_15: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11_15: init type = call constants.%Int(%int_32.loc11_15) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_15.1: type = value_of_initializer %int.make_type_signed.loc11_15 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_15.2: type = converted %int.make_type_signed.loc11_15, %.loc11_15.1 [template = constants.%i32] +// CHECK:STDOUT: %int.make_type_signed.loc11_15: init type = call constants.%Int(%int_32.loc11_15) [template = constants.%i32.builtin] +// CHECK:STDOUT: %.loc11_15.1: type = value_of_initializer %int.make_type_signed.loc11_15 [template = constants.%i32.builtin] +// CHECK:STDOUT: %.loc11_15.2: type = converted %int.make_type_signed.loc11_15, %.loc11_15.1 [template = constants.%i32.builtin] // CHECK:STDOUT: %int_32.loc11_23: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11_23: init type = call constants.%Int(%int_32.loc11_23) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_23.1: type = value_of_initializer %int.make_type_signed.loc11_23 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_23.2: type = converted %int.make_type_signed.loc11_23, %.loc11_23.1 [template = constants.%i32] +// CHECK:STDOUT: %int.make_type_signed.loc11_23: init type = call constants.%Int(%int_32.loc11_23) [template = constants.%i32.builtin] +// CHECK:STDOUT: %.loc11_23.1: type = value_of_initializer %int.make_type_signed.loc11_23 [template = constants.%i32.builtin] +// CHECK:STDOUT: %.loc11_23.2: type = converted %int.make_type_signed.loc11_23, %.loc11_23.1 [template = constants.%i32.builtin] // CHECK:STDOUT: %int_32.loc11_31: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11_31: init type = call constants.%Int(%int_32.loc11_31) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_31.1: type = value_of_initializer %int.make_type_signed.loc11_31 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_31.2: type = converted %int.make_type_signed.loc11_31, %.loc11_31.1 [template = constants.%i32] -// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 -// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param +// CHECK:STDOUT: %int.make_type_signed.loc11_31: init type = call constants.%Int(%int_32.loc11_31) [template = constants.%i32.builtin] +// CHECK:STDOUT: %.loc11_31.1: type = value_of_initializer %int.make_type_signed.loc11_31 [template = constants.%i32.builtin] +// CHECK:STDOUT: %.loc11_31.2: type = converted %int.make_type_signed.loc11_31, %.loc11_31.1 [template = constants.%i32.builtin] +// CHECK:STDOUT: %a.param: %i32.builtin = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32.builtin = bind_name a, %a.param +// CHECK:STDOUT: %b.param: %i32.builtin = value_param runtime_param1 +// CHECK:STDOUT: %b: %i32.builtin = bind_name b, %b.param +// CHECK:STDOUT: %return.param: ref %i32.builtin = out_param runtime_param2 +// CHECK:STDOUT: %return: ref %i32.builtin = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -145,11 +145,11 @@ var arr: [i32; Core.AsIntLiteral(Core.TestAdd(Core.AsI32(1), Core.AsI32(2)))] = // CHECK:STDOUT: // CHECK:STDOUT: fn @Int(%N.param_patt: Core.IntLiteral) -> type = "int.make_type_signed"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @AsI32(%a.param_patt: Core.IntLiteral) -> %i32 = "int.convert_checked"; +// CHECK:STDOUT: fn @AsI32(%a.param_patt: Core.IntLiteral) -> %i32.builtin = "int.convert_checked"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @AsIntLiteral(%a.param_patt: %i32) -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: fn @AsIntLiteral(%a.param_patt: %i32.builtin) -> Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @TestAdd(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.sadd"; +// CHECK:STDOUT: fn @TestAdd(%a.param_patt: %i32.builtin, %b.param_patt: %i32.builtin) -> %i32.builtin = "int.sadd"; // CHECK:STDOUT: // CHECK:STDOUT: --- use.carbon // CHECK:STDOUT: @@ -157,7 +157,7 @@ var arr: [i32; Core.AsIntLiteral(Core.TestAdd(Core.AsI32(1), Core.AsI32(2)))] = // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] // CHECK:STDOUT: %Int.type: type = fn_type @Int [template] // CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [template] // CHECK:STDOUT: %AsIntLiteral.type: type = fn_type @AsIntLiteral [template] // CHECK:STDOUT: %AsIntLiteral: %AsIntLiteral.type = struct_value () [template] // CHECK:STDOUT: %TestAdd.type: type = fn_type @TestAdd [template] @@ -165,13 +165,13 @@ var arr: [i32; Core.AsIntLiteral(Core.TestAdd(Core.AsI32(1), Core.AsI32(2)))] = // CHECK:STDOUT: %AsI32.type: type = fn_type @AsI32 [template] // CHECK:STDOUT: %AsI32: %AsI32.type = struct_value () [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] +// CHECK:STDOUT: %int_1.2: %i32.builtin = int_value 1 [template] // CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] -// CHECK:STDOUT: %int_3.1: %i32 = int_value 3 [template] +// CHECK:STDOUT: %int_2.2: %i32.builtin = int_value 2 [template] +// CHECK:STDOUT: %int_3.1: %i32.builtin = int_value 3 [template] // CHECK:STDOUT: %int_3.2: Core.IntLiteral = int_value 3 [template] -// CHECK:STDOUT: %array_type: type = array_type %int_3.2, %i32 [template] -// CHECK:STDOUT: %tuple.type: type = tuple_type (%i32, %i32, %i32) [template] +// CHECK:STDOUT: %array_type: type = array_type %int_3.2, %i32.builtin [template] +// CHECK:STDOUT: %tuple.type: type = tuple_type (%i32.builtin, %i32.builtin, %i32.builtin) [template] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %array: %array_type = tuple_value (%int_1.2, %int_2.2, %int_3.1) [template] // CHECK:STDOUT: } @@ -196,7 +196,7 @@ var arr: [i32; Core.AsIntLiteral(Core.TestAdd(Core.AsI32(1), Core.AsI32(2)))] = // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32.builtin] // CHECK:STDOUT: %Core.ref.loc4_16: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %AsIntLiteral.ref: %AsIntLiteral.type = name_ref AsIntLiteral, imports.%import_ref.2 [template = constants.%AsIntLiteral] // CHECK:STDOUT: %Core.ref.loc4_34: = name_ref Core, imports.%Core [template = imports.%Core] @@ -204,60 +204,60 @@ var arr: [i32; Core.AsIntLiteral(Core.TestAdd(Core.AsI32(1), Core.AsI32(2)))] = // CHECK:STDOUT: %Core.ref.loc4_47: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %AsI32.ref.loc4_51: %AsI32.type = name_ref AsI32, imports.%import_ref.4 [template = constants.%AsI32] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %int.convert_checked.loc4_59: init %i32 = call %AsI32.ref.loc4_51(%int_1) [template = constants.%int_1.2] +// CHECK:STDOUT: %int.convert_checked.loc4_59: init %i32.builtin = call %AsI32.ref.loc4_51(%int_1) [template = constants.%int_1.2] // CHECK:STDOUT: %Core.ref.loc4_62: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %AsI32.ref.loc4_66: %AsI32.type = name_ref AsI32, imports.%import_ref.4 [template = constants.%AsI32] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %int.convert_checked.loc4_74: init %i32 = call %AsI32.ref.loc4_66(%int_2) [template = constants.%int_2.2] -// CHECK:STDOUT: %.loc4_59.1: %i32 = value_of_initializer %int.convert_checked.loc4_59 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc4_59.2: %i32 = converted %int.convert_checked.loc4_59, %.loc4_59.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc4_74.1: %i32 = value_of_initializer %int.convert_checked.loc4_74 [template = constants.%int_2.2] -// CHECK:STDOUT: %.loc4_74.2: %i32 = converted %int.convert_checked.loc4_74, %.loc4_74.1 [template = constants.%int_2.2] -// CHECK:STDOUT: %int.sadd: init %i32 = call %TestAdd.ref(%.loc4_59.2, %.loc4_74.2) [template = constants.%int_3.1] -// CHECK:STDOUT: %.loc4_75.1: %i32 = value_of_initializer %int.sadd [template = constants.%int_3.1] -// CHECK:STDOUT: %.loc4_75.2: %i32 = converted %int.sadd, %.loc4_75.1 [template = constants.%int_3.1] +// CHECK:STDOUT: %int.convert_checked.loc4_74: init %i32.builtin = call %AsI32.ref.loc4_66(%int_2) [template = constants.%int_2.2] +// CHECK:STDOUT: %.loc4_59.1: %i32.builtin = value_of_initializer %int.convert_checked.loc4_59 [template = constants.%int_1.2] +// CHECK:STDOUT: %.loc4_59.2: %i32.builtin = converted %int.convert_checked.loc4_59, %.loc4_59.1 [template = constants.%int_1.2] +// CHECK:STDOUT: %.loc4_74.1: %i32.builtin = value_of_initializer %int.convert_checked.loc4_74 [template = constants.%int_2.2] +// CHECK:STDOUT: %.loc4_74.2: %i32.builtin = converted %int.convert_checked.loc4_74, %.loc4_74.1 [template = constants.%int_2.2] +// CHECK:STDOUT: %int.sadd: init %i32.builtin = call %TestAdd.ref(%.loc4_59.2, %.loc4_74.2) [template = constants.%int_3.1] +// CHECK:STDOUT: %.loc4_75.1: %i32.builtin = value_of_initializer %int.sadd [template = constants.%int_3.1] +// CHECK:STDOUT: %.loc4_75.2: %i32.builtin = converted %int.sadd, %.loc4_75.1 [template = constants.%int_3.1] // CHECK:STDOUT: %int.convert_checked.loc4_76: init Core.IntLiteral = call %AsIntLiteral.ref(%.loc4_75.2) [template = constants.%int_3.2] -// CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_signed, %.loc4_11.1 [template = constants.%i32] +// CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32.builtin] +// CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_signed, %.loc4_11.1 [template = constants.%i32.builtin] // CHECK:STDOUT: %.loc4_76.1: Core.IntLiteral = value_of_initializer %int.convert_checked.loc4_76 [template = constants.%int_3.2] // CHECK:STDOUT: %.loc4_76.2: Core.IntLiteral = converted %int.convert_checked.loc4_76, %.loc4_76.1 [template = constants.%int_3.2] -// CHECK:STDOUT: %array_type: type = array_type %.loc4_76.2, %i32 [template = constants.%array_type] +// CHECK:STDOUT: %array_type: type = array_type %.loc4_76.2, %i32.builtin [template = constants.%array_type] // CHECK:STDOUT: %arr.var: ref %array_type = var arr // CHECK:STDOUT: %arr: ref %array_type = bind_name arr, %arr.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int(%N.param_patt: Core.IntLiteral) -> type = "int.make_type_signed" [from "core.carbon"]; // CHECK:STDOUT: -// CHECK:STDOUT: fn @AsIntLiteral(%a.param_patt: %i32) -> Core.IntLiteral = "int.convert_checked" [from "core.carbon"]; +// CHECK:STDOUT: fn @AsIntLiteral(%a.param_patt: %i32.builtin) -> Core.IntLiteral = "int.convert_checked" [from "core.carbon"]; // CHECK:STDOUT: -// CHECK:STDOUT: fn @TestAdd(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.sadd" [from "core.carbon"]; +// CHECK:STDOUT: fn @TestAdd(%a.param_patt: %i32.builtin, %b.param_patt: %i32.builtin) -> %i32.builtin = "int.sadd" [from "core.carbon"]; // CHECK:STDOUT: -// CHECK:STDOUT: fn @AsI32(%a.param_patt: Core.IntLiteral) -> %i32 = "int.convert_checked" [from "core.carbon"]; +// CHECK:STDOUT: fn @AsI32(%a.param_patt: Core.IntLiteral) -> %i32.builtin = "int.convert_checked" [from "core.carbon"]; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Core.ref.loc4_82: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %AsI32.ref.loc4_86: %AsI32.type = name_ref AsI32, imports.%import_ref.4 [template = constants.%AsI32] // CHECK:STDOUT: %int_1.loc4_93: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %int.convert_checked.loc4_94: init %i32 = call %AsI32.ref.loc4_86(%int_1.loc4_93) [template = constants.%int_1.2] +// CHECK:STDOUT: %int.convert_checked.loc4_94: init %i32.builtin = call %AsI32.ref.loc4_86(%int_1.loc4_93) [template = constants.%int_1.2] // CHECK:STDOUT: %Core.ref.loc4_97: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %AsI32.ref.loc4_101: %AsI32.type = name_ref AsI32, imports.%import_ref.4 [template = constants.%AsI32] // CHECK:STDOUT: %int_2.loc4_108: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %int.convert_checked.loc4_109: init %i32 = call %AsI32.ref.loc4_101(%int_2.loc4_108) [template = constants.%int_2.2] +// CHECK:STDOUT: %int.convert_checked.loc4_109: init %i32.builtin = call %AsI32.ref.loc4_101(%int_2.loc4_108) [template = constants.%int_2.2] // CHECK:STDOUT: %Core.ref.loc4_112: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %AsI32.ref.loc4_116: %AsI32.type = name_ref AsI32, imports.%import_ref.4 [template = constants.%AsI32] // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3.2] -// CHECK:STDOUT: %int.convert_checked.loc4_124: init %i32 = call %AsI32.ref.loc4_116(%int_3) [template = constants.%int_3.1] +// CHECK:STDOUT: %int.convert_checked.loc4_124: init %i32.builtin = call %AsI32.ref.loc4_116(%int_3) [template = constants.%int_3.1] // CHECK:STDOUT: %.loc4_125.1: %tuple.type = tuple_literal (%int.convert_checked.loc4_94, %int.convert_checked.loc4_109, %int.convert_checked.loc4_124) // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0] -// CHECK:STDOUT: %.loc4_125.2: ref %i32 = array_index file.%arr.var, %int_0 -// CHECK:STDOUT: %.loc4_125.3: init %i32 = initialize_from %int.convert_checked.loc4_94 to %.loc4_125.2 [template = constants.%int_1.2] +// CHECK:STDOUT: %.loc4_125.2: ref %i32.builtin = array_index file.%arr.var, %int_0 +// CHECK:STDOUT: %.loc4_125.3: init %i32.builtin = initialize_from %int.convert_checked.loc4_94 to %.loc4_125.2 [template = constants.%int_1.2] // CHECK:STDOUT: %int_1.loc4_125: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %.loc4_125.4: ref %i32 = array_index file.%arr.var, %int_1.loc4_125 -// CHECK:STDOUT: %.loc4_125.5: init %i32 = initialize_from %int.convert_checked.loc4_109 to %.loc4_125.4 [template = constants.%int_2.2] +// CHECK:STDOUT: %.loc4_125.4: ref %i32.builtin = array_index file.%arr.var, %int_1.loc4_125 +// CHECK:STDOUT: %.loc4_125.5: init %i32.builtin = initialize_from %int.convert_checked.loc4_109 to %.loc4_125.4 [template = constants.%int_2.2] // CHECK:STDOUT: %int_2.loc4_125: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %.loc4_125.6: ref %i32 = array_index file.%arr.var, %int_2.loc4_125 -// CHECK:STDOUT: %.loc4_125.7: init %i32 = initialize_from %int.convert_checked.loc4_124 to %.loc4_125.6 [template = constants.%int_3.1] +// CHECK:STDOUT: %.loc4_125.6: ref %i32.builtin = array_index file.%arr.var, %int_2.loc4_125 +// CHECK:STDOUT: %.loc4_125.7: init %i32.builtin = initialize_from %int.convert_checked.loc4_124 to %.loc4_125.6 [template = constants.%int_3.1] // CHECK:STDOUT: %.loc4_125.8: init %array_type = array_init (%.loc4_125.3, %.loc4_125.5, %.loc4_125.7) to file.%arr.var [template = constants.%array] // CHECK:STDOUT: %.loc4_126: init %array_type = converted %.loc4_125.1, %.loc4_125.8 [template = constants.%array] // CHECK:STDOUT: assign file.%arr.var, %.loc4_126 diff --git a/toolchain/check/testdata/function/call/fail_not_callable.carbon b/toolchain/check/testdata/function/call/fail_not_callable.carbon index 1734c132b8ab6..bf4252f757528 100644 --- a/toolchain/check/testdata/function/call/fail_not_callable.carbon +++ b/toolchain/check/testdata/function/call/fail_not_callable.carbon @@ -21,15 +21,13 @@ fn Run() { // CHECK:STDOUT: %Run.type: type = fn_type @Run [template] // CHECK:STDOUT: %Run: %Run.type = struct_value () [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %str: String = string_literal "hello" [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -47,9 +45,7 @@ fn Run() { // CHECK:STDOUT: fn @Run() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc15_10.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc15_10.2: type = converted %int.make_type_signed, %.loc15_10.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %x.var: ref %i32 = var x // CHECK:STDOUT: %x: ref %i32 = bind_name x, %x.var // CHECK:STDOUT: %str: String = string_literal "hello" [template = constants.%str] diff --git a/toolchain/check/testdata/function/call/fail_param_count.carbon b/toolchain/check/testdata/function/call/fail_param_count.carbon index 205cd54e9085a..abfbc572e780e 100644 --- a/toolchain/check/testdata/function/call/fail_param_count.carbon +++ b/toolchain/check/testdata/function/call/fail_param_count.carbon @@ -70,9 +70,7 @@ fn Main() { // CHECK:STDOUT: %Run0.type: type = fn_type @Run0 [template] // CHECK:STDOUT: %Run0: %Run0.type = struct_value () [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %Run1.type: type = fn_type @Run1 [template] // CHECK:STDOUT: %Run1: %Run1.type = struct_value () [template] // CHECK:STDOUT: %Run2.type: type = fn_type @Run2 [template] @@ -85,7 +83,7 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -106,9 +104,7 @@ fn Main() { // CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc12_12.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc12_12.2: type = converted %int.make_type_signed, %.loc12_12.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: } @@ -119,13 +115,9 @@ fn Main() { // CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc13_12: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc13_12: init type = call constants.%Int(%int_32.loc13_12) [template = constants.%i32] -// CHECK:STDOUT: %.loc13_12.1: type = value_of_initializer %int.make_type_signed.loc13_12 [template = constants.%i32] -// CHECK:STDOUT: %.loc13_12.2: type = converted %int.make_type_signed.loc13_12, %.loc13_12.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc13_12: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc13_20: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc13_20: init type = call constants.%Int(%int_32.loc13_20) [template = constants.%i32] -// CHECK:STDOUT: %.loc13_20.1: type = value_of_initializer %int.make_type_signed.loc13_20 [template = constants.%i32] -// CHECK:STDOUT: %.loc13_20.2: type = converted %int.make_type_signed.loc13_20, %.loc13_20.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc13_20: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 diff --git a/toolchain/check/testdata/function/call/fail_param_type.carbon b/toolchain/check/testdata/function/call/fail_param_type.carbon index d8c62c916c500..d83e4bc2810e9 100644 --- a/toolchain/check/testdata/function/call/fail_param_type.carbon +++ b/toolchain/check/testdata/function/call/fail_param_type.carbon @@ -27,10 +27,8 @@ fn F() { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] @@ -41,7 +39,7 @@ fn F() { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -59,9 +57,7 @@ fn F() { // CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_9.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc11_9.2: type = converted %int.make_type_signed, %.loc11_9.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/function/call/fail_return_type_mismatch.carbon b/toolchain/check/testdata/function/call/fail_return_type_mismatch.carbon index 57f653b1e173c..84f125a43aa5b 100644 --- a/toolchain/check/testdata/function/call/fail_return_type_mismatch.carbon +++ b/toolchain/check/testdata/function/call/fail_return_type_mismatch.carbon @@ -32,16 +32,14 @@ fn Run() { // CHECK:STDOUT: %Run.type: type = fn_type @Run [template] // CHECK:STDOUT: %Run: %Run.type = struct_value () [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Float = %import_ref.1 // CHECK:STDOUT: .Int = %import_ref.2 -// CHECK:STDOUT: .ImplicitAs = %import_ref.3 +// CHECK:STDOUT: .ImplicitAs = %import_ref.6 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -77,14 +75,12 @@ fn Run() { // CHECK:STDOUT: fn @Run() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc20_10.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc20_10.2: type = converted %int.make_type_signed, %.loc20_10.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %x.var: ref %i32 = var x // CHECK:STDOUT: %x: ref %i32 = bind_name x, %x.var // CHECK:STDOUT: %Foo.ref: %Foo.type = name_ref Foo, file.%Foo.decl [template = constants.%Foo] // CHECK:STDOUT: %Foo.call: init f64 = call %Foo.ref() -// CHECK:STDOUT: %.loc20_21: %i32 = converted %Foo.call, [template = ] +// CHECK:STDOUT: %.loc20: %i32 = converted %Foo.call, [template = ] // CHECK:STDOUT: assign %x.var, // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/function/call/i32.carbon b/toolchain/check/testdata/function/call/i32.carbon index 066fe3a7a3670..f86058a34f7dd 100644 --- a/toolchain/check/testdata/function/call/i32.carbon +++ b/toolchain/check/testdata/function/call/i32.carbon @@ -20,19 +20,17 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %Echo.type: type = fn_type @Echo [template] // CHECK:STDOUT: %Echo: %Echo.type = struct_value () [template] // CHECK:STDOUT: %Main.type: type = fn_type @Main [template] // CHECK:STDOUT: %Main: %Main.type = struct_value () [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] // CHECK:STDOUT: } @@ -40,7 +38,7 @@ fn Main() { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -60,13 +58,9 @@ fn Main() { // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc11_12: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11_12: init type = call constants.%Int(%int_32.loc11_12) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_12.1: type = value_of_initializer %int.make_type_signed.loc11_12 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_12.2: type = converted %int.make_type_signed.loc11_12, %.loc11_12.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc11_12: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc11_20: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11_20: init type = call constants.%Int(%int_32.loc11_20) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_20.1: type = value_of_initializer %int.make_type_signed.loc11_20 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_20.2: type = converted %int.make_type_signed.loc11_20, %.loc11_20.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc11_20: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 @@ -84,14 +78,12 @@ fn Main() { // CHECK:STDOUT: fn @Main() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc16_10.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc16_10.2: type = converted %int.make_type_signed, %.loc16_10.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %b.var: ref %i32 = var b // CHECK:STDOUT: %b: ref %i32 = bind_name b, %b.var // CHECK:STDOUT: %Echo.ref: %Echo.type = name_ref Echo, file.%Echo.decl [template = constants.%Echo] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_1) [template = constants.%int_1.2] diff --git a/toolchain/check/testdata/function/call/more_param_ir.carbon b/toolchain/check/testdata/function/call/more_param_ir.carbon index 6b972cdcea410..b506d7dd3fc92 100644 --- a/toolchain/check/testdata/function/call/more_param_ir.carbon +++ b/toolchain/check/testdata/function/call/more_param_ir.carbon @@ -20,10 +20,8 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %Foo.type: type = fn_type @Foo [template] // CHECK:STDOUT: %Foo: %Foo.type = struct_value () [template] // CHECK:STDOUT: %Main.type: type = fn_type @Main [template] @@ -33,16 +31,16 @@ fn Main() { // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %tuple.type.3: type = tuple_type (Core.IntLiteral) [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] // CHECK:STDOUT: %tuple: %tuple.type.2 = tuple_value (%int_1.2) [template] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %int_6.1: Core.IntLiteral = int_value 6 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_6.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_6.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_6.2: %i32 = int_value 6 [template] // CHECK:STDOUT: } @@ -50,7 +48,7 @@ fn Main() { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -70,13 +68,9 @@ fn Main() { // CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc11_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11_11: init type = call constants.%Int(%int_32.loc11_11) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %int.make_type_signed.loc11_11 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_11.2: type = converted %int.make_type_signed.loc11_11, %.loc11_11.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc11_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc11_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11_19: init type = call constants.%Int(%int_32.loc11_19) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_19.1: type = value_of_initializer %int.make_type_signed.loc11_19 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_19.2: type = converted %int.make_type_signed.loc11_19, %.loc11_19.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc11_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 @@ -93,16 +87,14 @@ fn Main() { // CHECK:STDOUT: fn @Main() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc14_15.1: %tuple.type.1 = tuple_literal (%int.make_type_signed) -// CHECK:STDOUT: %.loc14_15.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc14_15.3: type = converted %int.make_type_signed, %.loc14_15.2 [template = constants.%i32] -// CHECK:STDOUT: %.loc14_15.4: type = converted %.loc14_15.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc14_15.1: %tuple.type.1 = tuple_literal (%i32) +// CHECK:STDOUT: %.loc14_15.2: type = converted %.loc14_15.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %x.var: ref %tuple.type.2 = var x // CHECK:STDOUT: %x: ref %tuple.type.2 = bind_name x, %x.var // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %.loc14_22.1: %tuple.type.3 = tuple_literal (%int_1) -// CHECK:STDOUT: %impl.elem0.loc14: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc14: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc14: = bound_method %int_1, %impl.elem0.loc14 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc14: = specific_function %Convert.bound.loc14, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc14: init %i32 = call %Convert.specific_fn.loc14(%int_1) [template = constants.%int_1.2] @@ -116,7 +108,7 @@ fn Main() { // CHECK:STDOUT: %tuple.elem0: ref %i32 = tuple_access %x.ref, element0 // CHECK:STDOUT: %int_6: Core.IntLiteral = int_value 6 [template = constants.%int_6.1] // CHECK:STDOUT: %.loc16_8: %i32 = bind_value %tuple.elem0 -// CHECK:STDOUT: %impl.elem0.loc16: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc16: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc16: = bound_method %int_6, %impl.elem0.loc16 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc16: = specific_function %Convert.bound.loc16, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc16: init %i32 = call %Convert.specific_fn.loc16(%int_6) [template = constants.%int_6.2] diff --git a/toolchain/check/testdata/function/call/params_one.carbon b/toolchain/check/testdata/function/call/params_one.carbon index 7892a6019ba6a..6fd70f091a0ea 100644 --- a/toolchain/check/testdata/function/call/params_one.carbon +++ b/toolchain/check/testdata/function/call/params_one.carbon @@ -18,20 +18,18 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %Foo.type: type = fn_type @Foo [template] // CHECK:STDOUT: %Foo: %Foo.type = struct_value () [template] // CHECK:STDOUT: %Main.type: type = fn_type @Main [template] // CHECK:STDOUT: %Main: %Main.type = struct_value () [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] // CHECK:STDOUT: } @@ -39,7 +37,7 @@ fn Main() { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -57,9 +55,7 @@ fn Main() { // CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc11_11.2: type = converted %int.make_type_signed, %.loc11_11.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: } @@ -75,7 +71,7 @@ fn Main() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Foo.ref: %Foo.type = name_ref Foo, file.%Foo.decl [template = constants.%Foo] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_1) [template = constants.%int_1.2] diff --git a/toolchain/check/testdata/function/call/params_one_comma.carbon b/toolchain/check/testdata/function/call/params_one_comma.carbon index c376f1bc65b3a..688f10f5e0b7e 100644 --- a/toolchain/check/testdata/function/call/params_one_comma.carbon +++ b/toolchain/check/testdata/function/call/params_one_comma.carbon @@ -19,20 +19,18 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %Foo.type: type = fn_type @Foo [template] // CHECK:STDOUT: %Foo: %Foo.type = struct_value () [template] // CHECK:STDOUT: %Main.type: type = fn_type @Main [template] // CHECK:STDOUT: %Main: %Main.type = struct_value () [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] // CHECK:STDOUT: } @@ -40,7 +38,7 @@ fn Main() { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -58,9 +56,7 @@ fn Main() { // CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc11_11.2: type = converted %int.make_type_signed, %.loc11_11.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: } @@ -76,7 +72,7 @@ fn Main() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Foo.ref.loc14: %Foo.type = name_ref Foo, file.%Foo.decl [template = constants.%Foo] // CHECK:STDOUT: %int_1.loc14: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc14: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc14: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc14: = bound_method %int_1.loc14, %impl.elem0.loc14 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn.loc14: = specific_function %Convert.bound.loc14, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc14: init %i32 = call %Convert.specific_fn.loc14(%int_1.loc14) [template = constants.%int_1.2] @@ -85,7 +81,7 @@ fn Main() { // CHECK:STDOUT: %Foo.call.loc14: init %empty_tuple.type = call %Foo.ref.loc14(%.loc14_7.2) // CHECK:STDOUT: %Foo.ref.loc15: %Foo.type = name_ref Foo, file.%Foo.decl [template = constants.%Foo] // CHECK:STDOUT: %int_1.loc15: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc15: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc15: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc15: = bound_method %int_1.loc15, %impl.elem0.loc15 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn.loc15: = specific_function %Convert.bound.loc15, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc15: init %i32 = call %Convert.specific_fn.loc15(%int_1.loc15) [template = constants.%int_1.2] diff --git a/toolchain/check/testdata/function/call/params_two.carbon b/toolchain/check/testdata/function/call/params_two.carbon index 75ba6109eb9c7..5f0c2b2ed1969 100644 --- a/toolchain/check/testdata/function/call/params_two.carbon +++ b/toolchain/check/testdata/function/call/params_two.carbon @@ -18,10 +18,8 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %Foo.type: type = fn_type @Foo [template] // CHECK:STDOUT: %Foo: %Foo.type = struct_value () [template] // CHECK:STDOUT: %Main.type: type = fn_type @Main [template] @@ -29,13 +27,13 @@ fn Main() { // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] // CHECK:STDOUT: } @@ -43,7 +41,7 @@ fn Main() { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -63,13 +61,9 @@ fn Main() { // CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc11_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11_11: init type = call constants.%Int(%int_32.loc11_11) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %int.make_type_signed.loc11_11 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_11.2: type = converted %int.make_type_signed.loc11_11, %.loc11_11.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc11_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc11_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11_19: init type = call constants.%Int(%int_32.loc11_19) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_19.1: type = value_of_initializer %int.make_type_signed.loc11_19 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_19.2: type = converted %int.make_type_signed.loc11_19, %.loc11_19.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc11_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 @@ -88,13 +82,13 @@ fn Main() { // CHECK:STDOUT: %Foo.ref: %Foo.type = name_ref Foo, file.%Foo.decl [template = constants.%Foo] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %impl.elem0.loc14_7: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc14_7: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc14_7: = bound_method %int_1, %impl.elem0.loc14_7 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc14_7: = specific_function %Convert.bound.loc14_7, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc14_7: init %i32 = call %Convert.specific_fn.loc14_7(%int_1) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc14_7.1: %i32 = value_of_initializer %int.convert_checked.loc14_7 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc14_7.2: %i32 = converted %int_1, %.loc14_7.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc14_10: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc14_10: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc14_10: = bound_method %int_2, %impl.elem0.loc14_10 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc14_10: = specific_function %Convert.bound.loc14_10, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc14_10: init %i32 = call %Convert.specific_fn.loc14_10(%int_2) [template = constants.%int_2.2] diff --git a/toolchain/check/testdata/function/call/params_two_comma.carbon b/toolchain/check/testdata/function/call/params_two_comma.carbon index 127ceea12377e..0f5fa8a494658 100644 --- a/toolchain/check/testdata/function/call/params_two_comma.carbon +++ b/toolchain/check/testdata/function/call/params_two_comma.carbon @@ -19,10 +19,8 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %Foo.type: type = fn_type @Foo [template] // CHECK:STDOUT: %Foo: %Foo.type = struct_value () [template] // CHECK:STDOUT: %Main.type: type = fn_type @Main [template] @@ -30,13 +28,13 @@ fn Main() { // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] // CHECK:STDOUT: } @@ -44,7 +42,7 @@ fn Main() { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -64,13 +62,9 @@ fn Main() { // CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc11_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11_11: init type = call constants.%Int(%int_32.loc11_11) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %int.make_type_signed.loc11_11 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_11.2: type = converted %int.make_type_signed.loc11_11, %.loc11_11.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc11_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc11_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11_19: init type = call constants.%Int(%int_32.loc11_19) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_19.1: type = value_of_initializer %int.make_type_signed.loc11_19 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_19.2: type = converted %int.make_type_signed.loc11_19, %.loc11_19.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc11_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 @@ -89,13 +83,13 @@ fn Main() { // CHECK:STDOUT: %Foo.ref.loc14: %Foo.type = name_ref Foo, file.%Foo.decl [template = constants.%Foo] // CHECK:STDOUT: %int_1.loc14: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_2.loc14: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %impl.elem0.loc14_7: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc14_7: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc14_7: = bound_method %int_1.loc14, %impl.elem0.loc14_7 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc14_7: = specific_function %Convert.bound.loc14_7, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc14_7: init %i32 = call %Convert.specific_fn.loc14_7(%int_1.loc14) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc14_7.1: %i32 = value_of_initializer %int.convert_checked.loc14_7 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc14_7.2: %i32 = converted %int_1.loc14, %.loc14_7.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc14_10: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc14_10: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc14_10: = bound_method %int_2.loc14, %impl.elem0.loc14_10 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc14_10: = specific_function %Convert.bound.loc14_10, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc14_10: init %i32 = call %Convert.specific_fn.loc14_10(%int_2.loc14) [template = constants.%int_2.2] @@ -105,13 +99,13 @@ fn Main() { // CHECK:STDOUT: %Foo.ref.loc15: %Foo.type = name_ref Foo, file.%Foo.decl [template = constants.%Foo] // CHECK:STDOUT: %int_1.loc15: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_2.loc15: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %impl.elem0.loc15_7: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc15_7: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc15_7: = bound_method %int_1.loc15, %impl.elem0.loc15_7 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc15_7: = specific_function %Convert.bound.loc15_7, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc15_7: init %i32 = call %Convert.specific_fn.loc15_7(%int_1.loc15) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc15_7.1: %i32 = value_of_initializer %int.convert_checked.loc15_7 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc15_7.2: %i32 = converted %int_1.loc15, %.loc15_7.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc15_10: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc15_10: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc15_10: = bound_method %int_2.loc15, %impl.elem0.loc15_10 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc15_10: = specific_function %Convert.bound.loc15_10, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc15_10: init %i32 = call %Convert.specific_fn.loc15_10(%int_2.loc15) [template = constants.%int_2.2] diff --git a/toolchain/check/testdata/function/call/prefer_unqualified_lookup.carbon b/toolchain/check/testdata/function/call/prefer_unqualified_lookup.carbon index c686caf50b0c8..1dd935b8a51f5 100644 --- a/toolchain/check/testdata/function/call/prefer_unqualified_lookup.carbon +++ b/toolchain/check/testdata/function/call/prefer_unqualified_lookup.carbon @@ -34,21 +34,19 @@ fn Class(F:! type).Inner.G() -> i32 { return F(); } // CHECK:STDOUT: %Inner.1: type = class_type @Inner [template] // CHECK:STDOUT: %Inner.2: type = class_type @Inner, @Inner(%F.1) [symbolic] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %F.type: type = fn_type @F, @Inner(%F.1) [symbolic] // CHECK:STDOUT: %F.2: %F.type = struct_value () [symbolic] // CHECK:STDOUT: %G.type: type = fn_type @G, @Inner(%F.1) [symbolic] // CHECK:STDOUT: %G: %G.type = struct_value () [symbolic] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] -// CHECK:STDOUT: %complete_type.1: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %complete_type.2: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] // CHECK:STDOUT: %F.specific_fn: = specific_function %F.2, @F(%F.1) [symbolic] @@ -57,7 +55,7 @@ fn Class(F:! type).Inner.G() -> i32 { return F(); } // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -83,9 +81,7 @@ fn Class(F:! type).Inner.G() -> i32 { return F(); } // CHECK:STDOUT: %F.param: type = value_param runtime_param // CHECK:STDOUT: %F.loc13_10: type = bind_symbolic_name F, 0, %F.param [symbolic = constants.%F.1] // CHECK:STDOUT: %int_32.loc13: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc13: init type = call constants.%Int(%int_32.loc13) [template = constants.%i32] -// CHECK:STDOUT: %.loc13_33.1: type = value_of_initializer %int.make_type_signed.loc13 [template = constants.%i32] -// CHECK:STDOUT: %.loc13_33.2: type = converted %int.make_type_signed.loc13, %.loc13_33.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc13: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %return.param.loc13: ref %i32 = out_param runtime_param0 // CHECK:STDOUT: %return.loc13: ref %i32 = return_slot %return.param.loc13 // CHECK:STDOUT: } @@ -99,7 +95,7 @@ fn Class(F:! type).Inner.G() -> i32 { return F(); } // CHECK:STDOUT: // CHECK:STDOUT: class { // CHECK:STDOUT: %Inner.decl: type = class_decl @Inner [template = constants.%Inner.1] {} {} -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.2] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class @@ -122,9 +118,7 @@ fn Class(F:! type).Inner.G() -> i32 { return F(); } // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc8_15.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc8_15.2: type = converted %int.make_type_signed, %.loc8_15.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } @@ -133,13 +127,11 @@ fn Class(F:! type).Inner.G() -> i32 { return F(); } // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc9: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc9: init type = call constants.%Int(%int_32.loc9) [template = constants.%i32] -// CHECK:STDOUT: %.loc9_15.1: type = value_of_initializer %int.make_type_signed.loc9 [template = constants.%i32] -// CHECK:STDOUT: %.loc9_15.2: type = converted %int.make_type_signed.loc9, %.loc9_15.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc9: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %return.param.loc9: ref %i32 = out_param runtime_param0 // CHECK:STDOUT: %return.loc9: ref %i32 = return_slot %return.param.loc9 // CHECK:STDOUT: } -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.2] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Inner.2 @@ -155,7 +147,7 @@ fn Class(F:! type).Inner.G() -> i32 { return F(); } // CHECK:STDOUT: fn() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.2] diff --git a/toolchain/check/testdata/function/declaration/fail_param_in_type.carbon b/toolchain/check/testdata/function/declaration/fail_param_in_type.carbon index 5232e66673b29..66ef9c451f9e3 100644 --- a/toolchain/check/testdata/function/declaration/fail_param_in_type.carbon +++ b/toolchain/check/testdata/function/declaration/fail_param_in_type.carbon @@ -17,16 +17,14 @@ fn F(n: i32, a: [i32; n]*); // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -45,14 +43,10 @@ fn F(n: i32, a: [i32; n]*); // CHECK:STDOUT: %a.param_patt: = value_param_pattern %a.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc14_9: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc14_9: init type = call constants.%Int(%int_32.loc14_9) [template = constants.%i32] -// CHECK:STDOUT: %.loc14_9.1: type = value_of_initializer %int.make_type_signed.loc14_9 [template = constants.%i32] -// CHECK:STDOUT: %.loc14_9.2: type = converted %int.make_type_signed.loc14_9, %.loc14_9.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc14_9: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc14_18: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc14_18: init type = call constants.%Int(%int_32.loc14_18) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc14_18: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %n.ref: %i32 = name_ref n, %n -// CHECK:STDOUT: %.loc14_18.1: type = value_of_initializer %int.make_type_signed.loc14_18 [template = constants.%i32] -// CHECK:STDOUT: %.loc14_18.2: type = converted %int.make_type_signed.loc14_18, %.loc14_18.1 [template = constants.%i32] // CHECK:STDOUT: %ptr: type = ptr_type [template = ] // CHECK:STDOUT: %n.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %n: %i32 = bind_name n, %n.param diff --git a/toolchain/check/testdata/function/declaration/fail_param_redecl.carbon b/toolchain/check/testdata/function/declaration/fail_param_redecl.carbon index 87078bbe8cb1f..cf6745263b400 100644 --- a/toolchain/check/testdata/function/declaration/fail_param_redecl.carbon +++ b/toolchain/check/testdata/function/declaration/fail_param_redecl.carbon @@ -20,16 +20,14 @@ fn F(n: i32, n: i32); // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -48,13 +46,9 @@ fn F(n: i32, n: i32); // CHECK:STDOUT: %n.param_patt.loc17_15: %i32 = value_param_pattern %n.patt.loc17_14, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc17_9: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc17_9: init type = call constants.%Int(%int_32.loc17_9) [template = constants.%i32] -// CHECK:STDOUT: %.loc17_9.1: type = value_of_initializer %int.make_type_signed.loc17_9 [template = constants.%i32] -// CHECK:STDOUT: %.loc17_9.2: type = converted %int.make_type_signed.loc17_9, %.loc17_9.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc17_9: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc17_17: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc17_17: init type = call constants.%Int(%int_32.loc17_17) [template = constants.%i32] -// CHECK:STDOUT: %.loc17_17.1: type = value_of_initializer %int.make_type_signed.loc17_17 [template = constants.%i32] -// CHECK:STDOUT: %.loc17_17.2: type = converted %int.make_type_signed.loc17_17, %.loc17_17.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc17_17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %n.param.loc17_7: %i32 = value_param runtime_param0 // CHECK:STDOUT: %n.loc17_6: %i32 = bind_name n, %n.param.loc17_7 // CHECK:STDOUT: %n.param.loc17_15: %i32 = value_param runtime_param1 diff --git a/toolchain/check/testdata/function/declaration/import.carbon b/toolchain/check/testdata/function/declaration/import.carbon index 2f39bd04b4b72..9791eb8c8d7a2 100644 --- a/toolchain/check/testdata/function/declaration/import.carbon +++ b/toolchain/check/testdata/function/declaration/import.carbon @@ -261,9 +261,7 @@ import library "extern_api"; // CHECK:STDOUT: %A.type: type = fn_type @A [template] // CHECK:STDOUT: %A: %A.type = struct_value () [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %B.type: type = fn_type @B [template] // CHECK:STDOUT: %B: %B.type = struct_value () [template] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (type) [template] @@ -279,7 +277,7 @@ import library "extern_api"; // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -303,13 +301,9 @@ import library "extern_api"; // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc5_9: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc5_9: init type = call constants.%Int(%int_32.loc5_9) [template = constants.%i32] -// CHECK:STDOUT: %.loc5_9.1: type = value_of_initializer %int.make_type_signed.loc5_9 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_9.2: type = converted %int.make_type_signed.loc5_9, %.loc5_9.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc5_9: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc5_17: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc5_17: init type = call constants.%Int(%int_32.loc5_17) [template = constants.%i32] -// CHECK:STDOUT: %.loc5_17.1: type = value_of_initializer %int.make_type_signed.loc5_17 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_17.2: type = converted %int.make_type_signed.loc5_17, %.loc5_17.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc5_17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 @@ -322,15 +316,11 @@ import library "extern_api"; // CHECK:STDOUT: %return.param_patt: %struct_type.c = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc6_10: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc6_10: init type = call constants.%Int(%int_32.loc6_10) [template = constants.%i32] -// CHECK:STDOUT: %.loc6_14.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc6_10) -// CHECK:STDOUT: %.loc6_14.2: type = value_of_initializer %int.make_type_signed.loc6_10 [template = constants.%i32] -// CHECK:STDOUT: %.loc6_14.3: type = converted %int.make_type_signed.loc6_10, %.loc6_14.2 [template = constants.%i32] -// CHECK:STDOUT: %.loc6_14.4: type = converted %.loc6_14.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] +// CHECK:STDOUT: %i32.loc6_10: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc6_14.1: %tuple.type.1 = tuple_literal (%i32.loc6_10) +// CHECK:STDOUT: %.loc6_14.2: type = converted %.loc6_14.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %int_32.loc6_25: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc6_25: init type = call constants.%Int(%int_32.loc6_25) [template = constants.%i32] -// CHECK:STDOUT: %.loc6_25.1: type = value_of_initializer %int.make_type_signed.loc6_25 [template = constants.%i32] -// CHECK:STDOUT: %.loc6_25.2: type = converted %int.make_type_signed.loc6_25, %.loc6_25.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc6_25: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %struct_type.c: type = struct_type {.c: %i32} [template = constants.%struct_type.c] // CHECK:STDOUT: %c.param: %tuple.type.2 = value_param runtime_param0 // CHECK:STDOUT: %c: %tuple.type.2 = bind_name c, %c.param @@ -360,9 +350,7 @@ import library "extern_api"; // CHECK:STDOUT: %A.type: type = fn_type @A [template] // CHECK:STDOUT: %A: %A.type = struct_value () [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %B.type: type = fn_type @B [template] // CHECK:STDOUT: %B: %B.type = struct_value () [template] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (type) [template] @@ -378,7 +366,7 @@ import library "extern_api"; // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -402,13 +390,9 @@ import library "extern_api"; // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc5_44: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc5_44: init type = call constants.%Int(%int_32.loc5_44) [template = constants.%i32] -// CHECK:STDOUT: %.loc5_44.1: type = value_of_initializer %int.make_type_signed.loc5_44 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_44.2: type = converted %int.make_type_signed.loc5_44, %.loc5_44.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc5_44: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc5_52: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc5_52: init type = call constants.%Int(%int_32.loc5_52) [template = constants.%i32] -// CHECK:STDOUT: %.loc5_52.1: type = value_of_initializer %int.make_type_signed.loc5_52 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_52.2: type = converted %int.make_type_signed.loc5_52, %.loc5_52.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc5_52: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 @@ -421,15 +405,11 @@ import library "extern_api"; // CHECK:STDOUT: %return.param_patt: %struct_type.c = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc6_45: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc6_45: init type = call constants.%Int(%int_32.loc6_45) [template = constants.%i32] -// CHECK:STDOUT: %.loc6_49.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc6_45) -// CHECK:STDOUT: %.loc6_49.2: type = value_of_initializer %int.make_type_signed.loc6_45 [template = constants.%i32] -// CHECK:STDOUT: %.loc6_49.3: type = converted %int.make_type_signed.loc6_45, %.loc6_49.2 [template = constants.%i32] -// CHECK:STDOUT: %.loc6_49.4: type = converted %.loc6_49.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] +// CHECK:STDOUT: %i32.loc6_45: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc6_49.1: %tuple.type.1 = tuple_literal (%i32.loc6_45) +// CHECK:STDOUT: %.loc6_49.2: type = converted %.loc6_49.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %int_32.loc6_60: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc6_60: init type = call constants.%Int(%int_32.loc6_60) [template = constants.%i32] -// CHECK:STDOUT: %.loc6_60.1: type = value_of_initializer %int.make_type_signed.loc6_60 [template = constants.%i32] -// CHECK:STDOUT: %.loc6_60.2: type = converted %int.make_type_signed.loc6_60, %.loc6_60.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc6_60: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %struct_type.c: type = struct_type {.c: %i32} [template = constants.%struct_type.c] // CHECK:STDOUT: %c.param: %tuple.type.2 = value_param runtime_param0 // CHECK:STDOUT: %c: %tuple.type.2 = bind_name c, %c.param @@ -460,17 +440,15 @@ import library "extern_api"; // CHECK:STDOUT: %A.type: type = fn_type @A [template] // CHECK:STDOUT: %A: %A.type = struct_value () [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %B.type: type = fn_type @B [template] // CHECK:STDOUT: %B: %B.type = struct_value () [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] // CHECK:STDOUT: %struct_type.c: type = struct_type {.c: %i32} [template] @@ -497,7 +475,7 @@ import library "extern_api"; // CHECK:STDOUT: %import_ref.6: %E.type = import_ref Main//api, E, loaded [template = constants.%E] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.7 -// CHECK:STDOUT: .ImplicitAs = %import_ref.8 +// CHECK:STDOUT: .ImplicitAs = %import_ref.11 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -524,15 +502,11 @@ import library "extern_api"; // CHECK:STDOUT: %a.var: ref %empty_tuple.type = var a // CHECK:STDOUT: %a: ref %empty_tuple.type = bind_name a, %a.var // CHECK:STDOUT: %int_32.loc7: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc7: init type = call constants.%Int(%int_32.loc7) [template = constants.%i32] -// CHECK:STDOUT: %.loc7_8.1: type = value_of_initializer %int.make_type_signed.loc7 [template = constants.%i32] -// CHECK:STDOUT: %.loc7_8.2: type = converted %int.make_type_signed.loc7, %.loc7_8.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc7: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %b.var: ref %i32 = var b // CHECK:STDOUT: %b: ref %i32 = bind_name b, %b.var // CHECK:STDOUT: %int_32.loc8: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc8: init type = call constants.%Int(%int_32.loc8) [template = constants.%i32] -// CHECK:STDOUT: %.loc8_13.1: type = value_of_initializer %int.make_type_signed.loc8 [template = constants.%i32] -// CHECK:STDOUT: %.loc8_13.2: type = converted %int.make_type_signed.loc8, %.loc8_13.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc8: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %struct_type.c: type = struct_type {.c: %i32} [template = constants.%struct_type.c] // CHECK:STDOUT: %c.var: ref %struct_type.c = var c // CHECK:STDOUT: %c: ref %struct_type.c = bind_name c, %c.var @@ -563,7 +537,7 @@ import library "extern_api"; // CHECK:STDOUT: assign file.%a.var, %A.call // CHECK:STDOUT: %B.ref: %B.type = name_ref B, imports.%import_ref.2 [template = constants.%B] // CHECK:STDOUT: %int_1.loc7: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc7: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc7: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc7: = bound_method %int_1.loc7, %impl.elem0.loc7 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn.loc7: = specific_function %Convert.bound.loc7, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc7: init %i32 = call %Convert.specific_fn.loc7(%int_1.loc7) [template = constants.%int_1.2] @@ -574,7 +548,7 @@ import library "extern_api"; // CHECK:STDOUT: %C.ref: %C.type = name_ref C, imports.%import_ref.3 [template = constants.%C] // CHECK:STDOUT: %int_1.loc8: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %.loc8_25.1: %tuple.type.2 = tuple_literal (%int_1.loc8) -// CHECK:STDOUT: %impl.elem0.loc8: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc8: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc8: = bound_method %int_1.loc8, %impl.elem0.loc8 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn.loc8: = specific_function %Convert.bound.loc8, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc8: init %i32 = call %Convert.specific_fn.loc8(%int_1.loc8) [template = constants.%int_1.2] @@ -601,9 +575,7 @@ import library "extern_api"; // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template] // CHECK:STDOUT: %A: %A.type = struct_value () [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %B.type: type = fn_type @B [template] // CHECK:STDOUT: %B: %B.type = struct_value () [template] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (type) [template] @@ -617,10 +589,10 @@ import library "extern_api"; // CHECK:STDOUT: %E: %E.type = struct_value () [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] // CHECK:STDOUT: %tuple.type.3: type = tuple_type (Core.IntLiteral) [template] @@ -634,7 +606,7 @@ import library "extern_api"; // CHECK:STDOUT: } // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.7 -// CHECK:STDOUT: .ImplicitAs = %import_ref.8 +// CHECK:STDOUT: .ImplicitAs = %import_ref.11 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -659,13 +631,9 @@ import library "extern_api"; // CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} {} // CHECK:STDOUT: %B.decl: %B.type = fn_decl @B [template = constants.%B] {} { // CHECK:STDOUT: %int_32.loc23_16: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc23_16: init type = call constants.%Int(%int_32.loc23_16) [template = constants.%i32] -// CHECK:STDOUT: %.loc23_16.1: type = value_of_initializer %int.make_type_signed.loc23_16 [template = constants.%i32] -// CHECK:STDOUT: %.loc23_16.2: type = converted %int.make_type_signed.loc23_16, %.loc23_16.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc23_16: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc23_24: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc23_24: init type = call constants.%Int(%int_32.loc23_24) [template = constants.%i32] -// CHECK:STDOUT: %.loc23_24.1: type = value_of_initializer %int.make_type_signed.loc23_24 [template = constants.%i32] -// CHECK:STDOUT: %.loc23_24.2: type = converted %int.make_type_signed.loc23_24, %.loc23_24.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc23_24: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 @@ -673,15 +641,11 @@ import library "extern_api"; // CHECK:STDOUT: } // CHECK:STDOUT: %C.decl: %C.type = fn_decl @C [template = constants.%C] {} { // CHECK:STDOUT: %int_32.loc32_17: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc32_17: init type = call constants.%Int(%int_32.loc32_17) [template = constants.%i32] -// CHECK:STDOUT: %.loc32_21.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc32_17) -// CHECK:STDOUT: %.loc32_21.2: type = value_of_initializer %int.make_type_signed.loc32_17 [template = constants.%i32] -// CHECK:STDOUT: %.loc32_21.3: type = converted %int.make_type_signed.loc32_17, %.loc32_21.2 [template = constants.%i32] -// CHECK:STDOUT: %.loc32_21.4: type = converted %.loc32_21.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] +// CHECK:STDOUT: %i32.loc32_17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc32_21.1: %tuple.type.1 = tuple_literal (%i32.loc32_17) +// CHECK:STDOUT: %.loc32_21.2: type = converted %.loc32_21.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %int_32.loc32_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc32_32: init type = call constants.%Int(%int_32.loc32_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc32_32.1: type = value_of_initializer %int.make_type_signed.loc32_32 [template = constants.%i32] -// CHECK:STDOUT: %.loc32_32.2: type = converted %int.make_type_signed.loc32_32, %.loc32_32.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc32_32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %struct_type.c: type = struct_type {.c: %i32} [template = constants.%struct_type.c] // CHECK:STDOUT: %c.param: %tuple.type.2 = value_param runtime_param0 // CHECK:STDOUT: %c: %tuple.type.2 = bind_name c, %c.param @@ -695,15 +659,11 @@ import library "extern_api"; // CHECK:STDOUT: %a.var: ref %empty_tuple.type = var a // CHECK:STDOUT: %a: ref %empty_tuple.type = bind_name a, %a.var // CHECK:STDOUT: %int_32.loc53: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc53: init type = call constants.%Int(%int_32.loc53) [template = constants.%i32] -// CHECK:STDOUT: %.loc53_8.1: type = value_of_initializer %int.make_type_signed.loc53 [template = constants.%i32] -// CHECK:STDOUT: %.loc53_8.2: type = converted %int.make_type_signed.loc53, %.loc53_8.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc53: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %b.var: ref %i32 = var b // CHECK:STDOUT: %b: ref %i32 = bind_name b, %b.var // CHECK:STDOUT: %int_32.loc54: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc54: init type = call constants.%Int(%int_32.loc54) [template = constants.%i32] -// CHECK:STDOUT: %.loc54_13.1: type = value_of_initializer %int.make_type_signed.loc54 [template = constants.%i32] -// CHECK:STDOUT: %.loc54_13.2: type = converted %int.make_type_signed.loc54, %.loc54_13.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc54: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %struct_type.c: type = struct_type {.c: %i32} [template = constants.%struct_type.c] // CHECK:STDOUT: %c.var: ref %struct_type.c = var c // CHECK:STDOUT: %c: ref %struct_type.c = bind_name c, %c.var @@ -734,7 +694,7 @@ import library "extern_api"; // CHECK:STDOUT: assign file.%a.var, %A.call // CHECK:STDOUT: %B.ref: %B.type = name_ref B, file.%B.decl [template = constants.%B] // CHECK:STDOUT: %int_1.loc53: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc53: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc53: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc53: = bound_method %int_1.loc53, %impl.elem0.loc53 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn.loc53: = specific_function %Convert.bound.loc53, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc53: init %i32 = call %Convert.specific_fn.loc53(%int_1.loc53) [template = constants.%int_1.2] @@ -745,7 +705,7 @@ import library "extern_api"; // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %int_1.loc54: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %.loc54_25.1: %tuple.type.3 = tuple_literal (%int_1.loc54) -// CHECK:STDOUT: %impl.elem0.loc54: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc54: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc54: = bound_method %int_1.loc54, %impl.elem0.loc54 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn.loc54: = specific_function %Convert.bound.loc54, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc54: init %i32 = call %Convert.specific_fn.loc54(%int_1.loc54) [template = constants.%int_1.2] @@ -772,9 +732,7 @@ import library "extern_api"; // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template] // CHECK:STDOUT: %A: %A.type = struct_value () [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %B.type: type = fn_type @B [template] // CHECK:STDOUT: %B: %B.type = struct_value () [template] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (type) [template] @@ -788,10 +746,10 @@ import library "extern_api"; // CHECK:STDOUT: %E: %E.type = struct_value () [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] // CHECK:STDOUT: %tuple.type.3: type = tuple_type (Core.IntLiteral) [template] @@ -805,7 +763,7 @@ import library "extern_api"; // CHECK:STDOUT: } // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.7 -// CHECK:STDOUT: .ImplicitAs = %import_ref.8 +// CHECK:STDOUT: .ImplicitAs = %import_ref.11 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -830,13 +788,9 @@ import library "extern_api"; // CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} {} // CHECK:STDOUT: %B.decl: %B.type = fn_decl @B [template = constants.%B] {} { // CHECK:STDOUT: %int_32.loc7_16: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc7_16: init type = call constants.%Int(%int_32.loc7_16) [template = constants.%i32] -// CHECK:STDOUT: %.loc7_16.1: type = value_of_initializer %int.make_type_signed.loc7_16 [template = constants.%i32] -// CHECK:STDOUT: %.loc7_16.2: type = converted %int.make_type_signed.loc7_16, %.loc7_16.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc7_16: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc7_24: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc7_24: init type = call constants.%Int(%int_32.loc7_24) [template = constants.%i32] -// CHECK:STDOUT: %.loc7_24.1: type = value_of_initializer %int.make_type_signed.loc7_24 [template = constants.%i32] -// CHECK:STDOUT: %.loc7_24.2: type = converted %int.make_type_signed.loc7_24, %.loc7_24.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc7_24: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 @@ -844,15 +798,11 @@ import library "extern_api"; // CHECK:STDOUT: } // CHECK:STDOUT: %C.decl: %C.type = fn_decl @C [template = constants.%C] {} { // CHECK:STDOUT: %int_32.loc8_17: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc8_17: init type = call constants.%Int(%int_32.loc8_17) [template = constants.%i32] -// CHECK:STDOUT: %.loc8_21.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc8_17) -// CHECK:STDOUT: %.loc8_21.2: type = value_of_initializer %int.make_type_signed.loc8_17 [template = constants.%i32] -// CHECK:STDOUT: %.loc8_21.3: type = converted %int.make_type_signed.loc8_17, %.loc8_21.2 [template = constants.%i32] -// CHECK:STDOUT: %.loc8_21.4: type = converted %.loc8_21.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] +// CHECK:STDOUT: %i32.loc8_17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc8_21.1: %tuple.type.1 = tuple_literal (%i32.loc8_17) +// CHECK:STDOUT: %.loc8_21.2: type = converted %.loc8_21.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %int_32.loc8_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc8_32: init type = call constants.%Int(%int_32.loc8_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc8_32.1: type = value_of_initializer %int.make_type_signed.loc8_32 [template = constants.%i32] -// CHECK:STDOUT: %.loc8_32.2: type = converted %int.make_type_signed.loc8_32, %.loc8_32.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc8_32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %struct_type.c: type = struct_type {.c: %i32} [template = constants.%struct_type.c] // CHECK:STDOUT: %c.param: %tuple.type.2 = value_param runtime_param0 // CHECK:STDOUT: %c: %tuple.type.2 = bind_name c, %c.param @@ -866,15 +816,11 @@ import library "extern_api"; // CHECK:STDOUT: %a.var: ref %empty_tuple.type = var a // CHECK:STDOUT: %a: ref %empty_tuple.type = bind_name a, %a.var // CHECK:STDOUT: %int_32.loc13: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc13: init type = call constants.%Int(%int_32.loc13) [template = constants.%i32] -// CHECK:STDOUT: %.loc13_8.1: type = value_of_initializer %int.make_type_signed.loc13 [template = constants.%i32] -// CHECK:STDOUT: %.loc13_8.2: type = converted %int.make_type_signed.loc13, %.loc13_8.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc13: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %b.var: ref %i32 = var b // CHECK:STDOUT: %b: ref %i32 = bind_name b, %b.var // CHECK:STDOUT: %int_32.loc14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc14: init type = call constants.%Int(%int_32.loc14) [template = constants.%i32] -// CHECK:STDOUT: %.loc14_13.1: type = value_of_initializer %int.make_type_signed.loc14 [template = constants.%i32] -// CHECK:STDOUT: %.loc14_13.2: type = converted %int.make_type_signed.loc14, %.loc14_13.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %struct_type.c: type = struct_type {.c: %i32} [template = constants.%struct_type.c] // CHECK:STDOUT: %c.var: ref %struct_type.c = var c // CHECK:STDOUT: %c: ref %struct_type.c = bind_name c, %c.var @@ -905,7 +851,7 @@ import library "extern_api"; // CHECK:STDOUT: assign file.%a.var, %A.call // CHECK:STDOUT: %B.ref: %B.type = name_ref B, file.%B.decl [template = constants.%B] // CHECK:STDOUT: %int_1.loc13: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc13: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc13: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc13: = bound_method %int_1.loc13, %impl.elem0.loc13 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn.loc13: = specific_function %Convert.bound.loc13, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc13: init %i32 = call %Convert.specific_fn.loc13(%int_1.loc13) [template = constants.%int_1.2] @@ -916,7 +862,7 @@ import library "extern_api"; // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %int_1.loc14: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %.loc14_25.1: %tuple.type.3 = tuple_literal (%int_1.loc14) -// CHECK:STDOUT: %impl.elem0.loc14: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc14: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc14: = bound_method %int_1.loc14, %impl.elem0.loc14 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn.loc14: = specific_function %Convert.bound.loc14, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc14: init %i32 = call %Convert.specific_fn.loc14(%int_1.loc14) [template = constants.%int_1.2] @@ -943,17 +889,15 @@ import library "extern_api"; // CHECK:STDOUT: %A.type: type = fn_type @A [template] // CHECK:STDOUT: %A: %A.type = struct_value () [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %B.type: type = fn_type @B [template] // CHECK:STDOUT: %B: %B.type = struct_value () [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] // CHECK:STDOUT: %struct_type.c: type = struct_type {.c: %i32} [template] @@ -980,7 +924,7 @@ import library "extern_api"; // CHECK:STDOUT: %import_ref.6: %E.type = import_ref Main//api, E, loaded [template = constants.%E] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.12 -// CHECK:STDOUT: .ImplicitAs = %import_ref.13 +// CHECK:STDOUT: .ImplicitAs = %import_ref.16 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -1007,15 +951,11 @@ import library "extern_api"; // CHECK:STDOUT: %a.var: ref %empty_tuple.type = var a // CHECK:STDOUT: %a: ref %empty_tuple.type = bind_name a, %a.var // CHECK:STDOUT: %int_32.loc53: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc53: init type = call constants.%Int(%int_32.loc53) [template = constants.%i32] -// CHECK:STDOUT: %.loc53_8.1: type = value_of_initializer %int.make_type_signed.loc53 [template = constants.%i32] -// CHECK:STDOUT: %.loc53_8.2: type = converted %int.make_type_signed.loc53, %.loc53_8.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc53: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %b.var: ref %i32 = var b // CHECK:STDOUT: %b: ref %i32 = bind_name b, %b.var // CHECK:STDOUT: %int_32.loc54: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc54: init type = call constants.%Int(%int_32.loc54) [template = constants.%i32] -// CHECK:STDOUT: %.loc54_13.1: type = value_of_initializer %int.make_type_signed.loc54 [template = constants.%i32] -// CHECK:STDOUT: %.loc54_13.2: type = converted %int.make_type_signed.loc54, %.loc54_13.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc54: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %struct_type.c: type = struct_type {.c: %i32} [template = constants.%struct_type.c] // CHECK:STDOUT: %c.var: ref %struct_type.c = var c // CHECK:STDOUT: %c: ref %struct_type.c = bind_name c, %c.var @@ -1046,7 +986,7 @@ import library "extern_api"; // CHECK:STDOUT: assign file.%a.var, %A.call // CHECK:STDOUT: %B.ref: %B.type = name_ref B, imports.%import_ref.2 [template = constants.%B] // CHECK:STDOUT: %int_1.loc53: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc53: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc53: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc53: = bound_method %int_1.loc53, %impl.elem0.loc53 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn.loc53: = specific_function %Convert.bound.loc53, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc53: init %i32 = call %Convert.specific_fn.loc53(%int_1.loc53) [template = constants.%int_1.2] @@ -1057,7 +997,7 @@ import library "extern_api"; // CHECK:STDOUT: %C.ref: %C.type = name_ref C, imports.%import_ref.3 [template = constants.%C] // CHECK:STDOUT: %int_1.loc54: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %.loc54_25.1: %tuple.type.2 = tuple_literal (%int_1.loc54) -// CHECK:STDOUT: %impl.elem0.loc54: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc54: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc54: = bound_method %int_1.loc54, %impl.elem0.loc54 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn.loc54: = specific_function %Convert.bound.loc54, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc54: init %i32 = call %Convert.specific_fn.loc54(%int_1.loc54) [template = constants.%int_1.2] @@ -1084,17 +1024,15 @@ import library "extern_api"; // CHECK:STDOUT: %A.type: type = fn_type @A [template] // CHECK:STDOUT: %A: %A.type = struct_value () [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %B.type: type = fn_type @B [template] // CHECK:STDOUT: %B: %B.type = struct_value () [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] // CHECK:STDOUT: %struct_type.c: type = struct_type {.c: %i32} [template] @@ -1121,7 +1059,7 @@ import library "extern_api"; // CHECK:STDOUT: %import_ref.6: %E.type = import_ref Main//extern_api, E, loaded [template = constants.%E] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.12 -// CHECK:STDOUT: .ImplicitAs = %import_ref.13 +// CHECK:STDOUT: .ImplicitAs = %import_ref.16 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -1148,15 +1086,11 @@ import library "extern_api"; // CHECK:STDOUT: %a.var: ref %empty_tuple.type = var a // CHECK:STDOUT: %a: ref %empty_tuple.type = bind_name a, %a.var // CHECK:STDOUT: %int_32.loc52: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc52: init type = call constants.%Int(%int_32.loc52) [template = constants.%i32] -// CHECK:STDOUT: %.loc52_8.1: type = value_of_initializer %int.make_type_signed.loc52 [template = constants.%i32] -// CHECK:STDOUT: %.loc52_8.2: type = converted %int.make_type_signed.loc52, %.loc52_8.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc52: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %b.var: ref %i32 = var b // CHECK:STDOUT: %b: ref %i32 = bind_name b, %b.var // CHECK:STDOUT: %int_32.loc53: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc53: init type = call constants.%Int(%int_32.loc53) [template = constants.%i32] -// CHECK:STDOUT: %.loc53_13.1: type = value_of_initializer %int.make_type_signed.loc53 [template = constants.%i32] -// CHECK:STDOUT: %.loc53_13.2: type = converted %int.make_type_signed.loc53, %.loc53_13.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc53: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %struct_type.c: type = struct_type {.c: %i32} [template = constants.%struct_type.c] // CHECK:STDOUT: %c.var: ref %struct_type.c = var c // CHECK:STDOUT: %c: ref %struct_type.c = bind_name c, %c.var @@ -1187,7 +1121,7 @@ import library "extern_api"; // CHECK:STDOUT: assign file.%a.var, %A.call // CHECK:STDOUT: %B.ref: %B.type = name_ref B, imports.%import_ref.2 [template = constants.%B] // CHECK:STDOUT: %int_1.loc52: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc52: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc52: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc52: = bound_method %int_1.loc52, %impl.elem0.loc52 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn.loc52: = specific_function %Convert.bound.loc52, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc52: init %i32 = call %Convert.specific_fn.loc52(%int_1.loc52) [template = constants.%int_1.2] @@ -1198,7 +1132,7 @@ import library "extern_api"; // CHECK:STDOUT: %C.ref: %C.type = name_ref C, imports.%import_ref.3 [template = constants.%C] // CHECK:STDOUT: %int_1.loc53: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %.loc53_25.1: %tuple.type.2 = tuple_literal (%int_1.loc53) -// CHECK:STDOUT: %impl.elem0.loc53: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc53: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc53: = bound_method %int_1.loc53, %impl.elem0.loc53 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn.loc53: = specific_function %Convert.bound.loc53, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc53: init %i32 = call %Convert.specific_fn.loc53(%int_1.loc53) [template = constants.%int_1.2] diff --git a/toolchain/check/testdata/function/declaration/param_same_name.carbon b/toolchain/check/testdata/function/declaration/param_same_name.carbon index c1fafa83e0b69..af2abab9c144a 100644 --- a/toolchain/check/testdata/function/declaration/param_same_name.carbon +++ b/toolchain/check/testdata/function/declaration/param_same_name.carbon @@ -16,9 +16,7 @@ fn G(a: i32); // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] @@ -27,7 +25,7 @@ fn G(a: i32); // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -45,9 +43,7 @@ fn G(a: i32); // CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_9.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc11_9.2: type = converted %int.make_type_signed, %.loc11_9.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: } @@ -56,9 +52,7 @@ fn G(a: i32); // CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc13_9.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc13_9.2: type = converted %int.make_type_signed, %.loc13_9.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/function/definition/import.carbon b/toolchain/check/testdata/function/definition/import.carbon index 3476692458617..5350eb2e06a00 100644 --- a/toolchain/check/testdata/function/definition/import.carbon +++ b/toolchain/check/testdata/function/definition/import.carbon @@ -115,9 +115,7 @@ fn D() {} // CHECK:STDOUT: %A.type: type = fn_type @A [template] // CHECK:STDOUT: %A: %A.type = struct_value () [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %B.type: type = fn_type @B [template] // CHECK:STDOUT: %B: %B.type = struct_value () [template] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (type) [template] @@ -132,7 +130,7 @@ fn D() {} // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -155,13 +153,9 @@ fn D() {} // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc5_9: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc5_9: init type = call constants.%Int(%int_32.loc5_9) [template = constants.%i32] -// CHECK:STDOUT: %.loc5_9.1: type = value_of_initializer %int.make_type_signed.loc5_9 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_9.2: type = converted %int.make_type_signed.loc5_9, %.loc5_9.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc5_9: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc5_17: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc5_17: init type = call constants.%Int(%int_32.loc5_17) [template = constants.%i32] -// CHECK:STDOUT: %.loc5_17.1: type = value_of_initializer %int.make_type_signed.loc5_17 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_17.2: type = converted %int.make_type_signed.loc5_17, %.loc5_17.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc5_17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 @@ -174,15 +168,11 @@ fn D() {} // CHECK:STDOUT: %return.param_patt: %struct_type.c = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc6_10: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc6_10: init type = call constants.%Int(%int_32.loc6_10) [template = constants.%i32] -// CHECK:STDOUT: %.loc6_14.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc6_10) -// CHECK:STDOUT: %.loc6_14.2: type = value_of_initializer %int.make_type_signed.loc6_10 [template = constants.%i32] -// CHECK:STDOUT: %.loc6_14.3: type = converted %int.make_type_signed.loc6_10, %.loc6_14.2 [template = constants.%i32] -// CHECK:STDOUT: %.loc6_14.4: type = converted %.loc6_14.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] +// CHECK:STDOUT: %i32.loc6_10: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc6_14.1: %tuple.type.1 = tuple_literal (%i32.loc6_10) +// CHECK:STDOUT: %.loc6_14.2: type = converted %.loc6_14.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %int_32.loc6_25: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc6_25: init type = call constants.%Int(%int_32.loc6_25) [template = constants.%i32] -// CHECK:STDOUT: %.loc6_25.1: type = value_of_initializer %int.make_type_signed.loc6_25 [template = constants.%i32] -// CHECK:STDOUT: %.loc6_25.2: type = converted %int.make_type_signed.loc6_25, %.loc6_25.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc6_25: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %struct_type.c: type = struct_type {.c: %i32} [template = constants.%struct_type.c] // CHECK:STDOUT: %c.param: %tuple.type.2 = value_param runtime_param0 // CHECK:STDOUT: %c: %tuple.type.2 = bind_name c, %c.param @@ -248,17 +238,15 @@ fn D() {} // CHECK:STDOUT: %A.type: type = fn_type @A [template] // CHECK:STDOUT: %A: %A.type = struct_value () [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %B.type: type = fn_type @B [template] // CHECK:STDOUT: %B: %B.type = struct_value () [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] // CHECK:STDOUT: %struct_type.c: type = struct_type {.c: %i32} [template] @@ -276,7 +264,7 @@ fn D() {} // CHECK:STDOUT: %import_ref.4 = import_ref Main//fns, D, unloaded // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.5 -// CHECK:STDOUT: .ImplicitAs = %import_ref.6 +// CHECK:STDOUT: .ImplicitAs = %import_ref.9 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -300,15 +288,11 @@ fn D() {} // CHECK:STDOUT: %a.var: ref %empty_tuple.type = var a // CHECK:STDOUT: %a: ref %empty_tuple.type = bind_name a, %a.var // CHECK:STDOUT: %int_32.loc7: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc7: init type = call constants.%Int(%int_32.loc7) [template = constants.%i32] -// CHECK:STDOUT: %.loc7_8.1: type = value_of_initializer %int.make_type_signed.loc7 [template = constants.%i32] -// CHECK:STDOUT: %.loc7_8.2: type = converted %int.make_type_signed.loc7, %.loc7_8.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc7: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %b.var: ref %i32 = var b // CHECK:STDOUT: %b: ref %i32 = bind_name b, %b.var // CHECK:STDOUT: %int_32.loc8: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc8: init type = call constants.%Int(%int_32.loc8) [template = constants.%i32] -// CHECK:STDOUT: %.loc8_13.1: type = value_of_initializer %int.make_type_signed.loc8 [template = constants.%i32] -// CHECK:STDOUT: %.loc8_13.2: type = converted %int.make_type_signed.loc8, %.loc8_13.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc8: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %struct_type.c: type = struct_type {.c: %i32} [template = constants.%struct_type.c] // CHECK:STDOUT: %c.var: ref %struct_type.c = var c // CHECK:STDOUT: %c: ref %struct_type.c = bind_name c, %c.var @@ -327,7 +311,7 @@ fn D() {} // CHECK:STDOUT: assign file.%a.var, %A.call // CHECK:STDOUT: %B.ref: %B.type = name_ref B, imports.%import_ref.2 [template = constants.%B] // CHECK:STDOUT: %int_1.loc7: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc7: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc7: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc7: = bound_method %int_1.loc7, %impl.elem0.loc7 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn.loc7: = specific_function %Convert.bound.loc7, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc7: init %i32 = call %Convert.specific_fn.loc7(%int_1.loc7) [template = constants.%int_1.2] @@ -338,7 +322,7 @@ fn D() {} // CHECK:STDOUT: %C.ref: %C.type = name_ref C, imports.%import_ref.3 [template = constants.%C] // CHECK:STDOUT: %int_1.loc8: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %.loc8_25.1: %tuple.type.2 = tuple_literal (%int_1.loc8) -// CHECK:STDOUT: %impl.elem0.loc8: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc8: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc8: = bound_method %int_1.loc8, %impl.elem0.loc8 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn.loc8: = specific_function %Convert.bound.loc8, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc8: init %i32 = call %Convert.specific_fn.loc8(%int_1.loc8) [template = constants.%int_1.2] @@ -357,9 +341,7 @@ fn D() {} // CHECK:STDOUT: %A.type: type = fn_type @A [template] // CHECK:STDOUT: %A: %A.type = struct_value () [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %B.type: type = fn_type @B [template] // CHECK:STDOUT: %B: %B.type = struct_value () [template] // CHECK:STDOUT: } @@ -387,13 +369,9 @@ fn D() {} // CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} {} // CHECK:STDOUT: %B.decl: %B.type = fn_decl @B [template = constants.%B] {} { // CHECK:STDOUT: %int_32.loc23_9: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc23_9: init type = call constants.%Int(%int_32.loc23_9) [template = constants.%i32] -// CHECK:STDOUT: %.loc23_9.1: type = value_of_initializer %int.make_type_signed.loc23_9 [template = constants.%i32] -// CHECK:STDOUT: %.loc23_9.2: type = converted %int.make_type_signed.loc23_9, %.loc23_9.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc23_9: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc23_17: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc23_17: init type = call constants.%Int(%int_32.loc23_17) [template = constants.%i32] -// CHECK:STDOUT: %.loc23_17.1: type = value_of_initializer %int.make_type_signed.loc23_17 [template = constants.%i32] -// CHECK:STDOUT: %.loc23_17.2: type = converted %int.make_type_signed.loc23_17, %.loc23_17.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc23_17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 diff --git a/toolchain/check/testdata/function/definition/params_one.carbon b/toolchain/check/testdata/function/definition/params_one.carbon index a75e1f4a6a654..f2ad74d26383e 100644 --- a/toolchain/check/testdata/function/definition/params_one.carbon +++ b/toolchain/check/testdata/function/definition/params_one.carbon @@ -14,16 +14,14 @@ fn Foo(a: i32) {} // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %Foo.type: type = fn_type @Foo [template] // CHECK:STDOUT: %Foo: %Foo.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -40,9 +38,7 @@ fn Foo(a: i32) {} // CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc11_11.2: type = converted %int.make_type_signed, %.loc11_11.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/function/definition/params_one_comma.carbon b/toolchain/check/testdata/function/definition/params_one_comma.carbon index 6aec7f6a5a615..c1ba454b53ea2 100644 --- a/toolchain/check/testdata/function/definition/params_one_comma.carbon +++ b/toolchain/check/testdata/function/definition/params_one_comma.carbon @@ -14,16 +14,14 @@ fn Foo(a: i32,) {} // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %Foo.type: type = fn_type @Foo [template] // CHECK:STDOUT: %Foo: %Foo.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -40,9 +38,7 @@ fn Foo(a: i32,) {} // CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc11_11.2: type = converted %int.make_type_signed, %.loc11_11.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/function/definition/params_two.carbon b/toolchain/check/testdata/function/definition/params_two.carbon index bf7b88526fa33..932197a02f20d 100644 --- a/toolchain/check/testdata/function/definition/params_two.carbon +++ b/toolchain/check/testdata/function/definition/params_two.carbon @@ -14,16 +14,14 @@ fn Foo(a: i32, b: i32) {} // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %Foo.type: type = fn_type @Foo [template] // CHECK:STDOUT: %Foo: %Foo.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -42,13 +40,9 @@ fn Foo(a: i32, b: i32) {} // CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc11_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11_11: init type = call constants.%Int(%int_32.loc11_11) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %int.make_type_signed.loc11_11 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_11.2: type = converted %int.make_type_signed.loc11_11, %.loc11_11.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc11_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc11_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11_19: init type = call constants.%Int(%int_32.loc11_19) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_19.1: type = value_of_initializer %int.make_type_signed.loc11_19 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_19.2: type = converted %int.make_type_signed.loc11_19, %.loc11_19.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc11_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 diff --git a/toolchain/check/testdata/function/definition/params_two_comma.carbon b/toolchain/check/testdata/function/definition/params_two_comma.carbon index 25fd363f98e6b..1ccccf8ca6e8f 100644 --- a/toolchain/check/testdata/function/definition/params_two_comma.carbon +++ b/toolchain/check/testdata/function/definition/params_two_comma.carbon @@ -14,16 +14,14 @@ fn Foo(a: i32, b: i32,) {} // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %Foo.type: type = fn_type @Foo [template] // CHECK:STDOUT: %Foo: %Foo.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -42,13 +40,9 @@ fn Foo(a: i32, b: i32,) {} // CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc11_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11_11: init type = call constants.%Int(%int_32.loc11_11) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %int.make_type_signed.loc11_11 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_11.2: type = converted %int.make_type_signed.loc11_11, %.loc11_11.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc11_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc11_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11_19: init type = call constants.%Int(%int_32.loc11_19) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_19.1: type = value_of_initializer %int.make_type_signed.loc11_19 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_19.2: type = converted %int.make_type_signed.loc11_19, %.loc11_19.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc11_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 diff --git a/toolchain/check/testdata/function/generic/deduce.carbon b/toolchain/check/testdata/function/generic/deduce.carbon index a93133a675c43..207249f53ef06 100644 --- a/toolchain/check/testdata/function/generic/deduce.carbon +++ b/toolchain/check/testdata/function/generic/deduce.carbon @@ -201,9 +201,7 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: %require_complete.1: = require_complete_type %ptr.1 [symbolic] // CHECK:STDOUT: %ExplicitGenericParam.specific_fn.1: = specific_function %ExplicitGenericParam, @ExplicitGenericParam(%T) [symbolic] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %ptr.2: type = ptr_type %i32 [template] // CHECK:STDOUT: %CallExplicitGenericParam.type: type = fn_type @CallExplicitGenericParam [template] // CHECK:STDOUT: %CallExplicitGenericParam: %CallExplicitGenericParam.type = struct_value () [template] @@ -212,14 +210,14 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: %ptr.3: type = ptr_type %struct_type.a [symbolic] // CHECK:STDOUT: %CallExplicitGenericParamWithGenericArg.type: type = fn_type @CallExplicitGenericParamWithGenericArg [template] // CHECK:STDOUT: %CallExplicitGenericParamWithGenericArg: %CallExplicitGenericParamWithGenericArg.type = struct_value () [template] -// CHECK:STDOUT: %require_complete.2: = require_complete_type %ptr.3 [symbolic] +// CHECK:STDOUT: %require_complete.3: = require_complete_type %ptr.3 [symbolic] // CHECK:STDOUT: %ExplicitGenericParam.specific_fn.3: = specific_function %ExplicitGenericParam, @ExplicitGenericParam(%struct_type.a) [symbolic] -// CHECK:STDOUT: %complete_type: = complete_type_witness %ptr.2 [template] +// CHECK:STDOUT: %complete_type.2: = complete_type_witness %ptr.2 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -251,9 +249,7 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: %return.param_patt: %ptr.2 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc6: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc6: init type = call constants.%Int(%int_32.loc6) [template = constants.%i32] -// CHECK:STDOUT: %.loc6_37.1: type = value_of_initializer %int.make_type_signed.loc6 [template = constants.%i32] -// CHECK:STDOUT: %.loc6_37.2: type = converted %int.make_type_signed.loc6, %.loc6_37.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc6: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %ptr: type = ptr_type %i32 [template = constants.%ptr.2] // CHECK:STDOUT: %return.param: ref %ptr.2 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %ptr.2 = return_slot %return.param @@ -299,9 +295,7 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %ExplicitGenericParam.ref: %ExplicitGenericParam.type = name_ref ExplicitGenericParam, file.%ExplicitGenericParam.decl [template = constants.%ExplicitGenericParam] // CHECK:STDOUT: %int_32.loc7: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc7: init type = call constants.%Int(%int_32.loc7) [template = constants.%i32] -// CHECK:STDOUT: %.loc7_34.1: type = value_of_initializer %int.make_type_signed.loc7 [template = constants.%i32] -// CHECK:STDOUT: %.loc7_34.2: type = converted %int.make_type_signed.loc7, %.loc7_34.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc7: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %ExplicitGenericParam.specific_fn: = specific_function %ExplicitGenericParam.ref, @ExplicitGenericParam(constants.%i32) [template = constants.%ExplicitGenericParam.specific_fn.2] // CHECK:STDOUT: %ExplicitGenericParam.call: init %ptr.2 = call %ExplicitGenericParam.specific_fn() // CHECK:STDOUT: %.loc7_35.1: %ptr.2 = value_of_initializer %ExplicitGenericParam.call @@ -316,7 +310,7 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: %ptr.loc10_63.2: type = ptr_type @CallExplicitGenericParamWithGenericArg.%struct_type.a.loc10_62.2 (%struct_type.a) [symbolic = %ptr.loc10_63.2 (constants.%ptr.3)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete: = require_complete_type @CallExplicitGenericParamWithGenericArg.%ptr.loc10_63.2 (%ptr.3) [symbolic = %require_complete (constants.%require_complete.2)] +// CHECK:STDOUT: %require_complete: = require_complete_type @CallExplicitGenericParamWithGenericArg.%ptr.loc10_63.2 (%ptr.3) [symbolic = %require_complete (constants.%require_complete.3)] // CHECK:STDOUT: %ExplicitGenericParam.specific_fn.loc11_10.2: = specific_function constants.%ExplicitGenericParam, @ExplicitGenericParam(%struct_type.a.loc10_62.2) [symbolic = %ExplicitGenericParam.specific_fn.loc11_10.2 (constants.%ExplicitGenericParam.specific_fn.3)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%T.param_patt: type) -> @CallExplicitGenericParamWithGenericArg.%ptr.loc10_63.2 (%ptr.3) { @@ -354,7 +348,7 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: %ptr.loc4_39.2 => constants.%ptr.2 // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete => constants.%complete_type +// CHECK:STDOUT: %require_complete => constants.%complete_type.2 // CHECK:STDOUT: %ExplicitGenericParam.specific_fn.loc4_50.2 => constants.%ExplicitGenericParam.specific_fn.2 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -371,7 +365,7 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: %ptr.loc4_39.2 => constants.%ptr.3 // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete => constants.%require_complete.2 +// CHECK:STDOUT: %require_complete => constants.%require_complete.3 // CHECK:STDOUT: %ExplicitGenericParam.specific_fn.loc4_50.2 => constants.%ExplicitGenericParam.specific_fn.3 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -670,20 +664,19 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: %require_complete.2: = require_complete_type %T [symbolic] // CHECK:STDOUT: %ImplicitGenericParam.specific_fn.1: = specific_function %ImplicitGenericParam, @ImplicitGenericParam(%T) [symbolic] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %ptr.2: type = ptr_type %i32 [template] // CHECK:STDOUT: %CallImplicitGenericParam.type: type = fn_type @CallImplicitGenericParam [template] // CHECK:STDOUT: %CallImplicitGenericParam: %CallImplicitGenericParam.type = struct_value () [template] +// CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %complete_type.2: = complete_type_witness %i32.builtin [template] // CHECK:STDOUT: %ImplicitGenericParam.specific_fn.2: = specific_function %ImplicitGenericParam, @ImplicitGenericParam(%i32) [template] -// CHECK:STDOUT: %complete_type.1: = complete_type_witness %ptr.2 [template] -// CHECK:STDOUT: %complete_type.2: = complete_type_witness %i32 [template] +// CHECK:STDOUT: %complete_type.3: = complete_type_witness %ptr.2 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -721,13 +714,9 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: %return.param_patt: %ptr.2 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc6_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc6_32: init type = call constants.%Int(%int_32.loc6_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc6_32.1: type = value_of_initializer %int.make_type_signed.loc6_32 [template = constants.%i32] -// CHECK:STDOUT: %.loc6_32.2: type = converted %int.make_type_signed.loc6_32, %.loc6_32.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc6_32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc6_40: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc6_40: init type = call constants.%Int(%int_32.loc6_40) [template = constants.%i32] -// CHECK:STDOUT: %.loc6_43.1: type = value_of_initializer %int.make_type_signed.loc6_40 [template = constants.%i32] -// CHECK:STDOUT: %.loc6_43.2: type = converted %int.make_type_signed.loc6_40, %.loc6_43.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc6_40: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %ptr: type = ptr_type %i32 [template = constants.%ptr.2] // CHECK:STDOUT: %n.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %n: %i32 = bind_name n, %n.param @@ -792,7 +781,7 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: %ptr.loc4_45.2 => constants.%ptr.2 // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete.loc4_41 => constants.%complete_type.1 +// CHECK:STDOUT: %require_complete.loc4_41 => constants.%complete_type.3 // CHECK:STDOUT: %require_complete.loc4_36 => constants.%complete_type.2 // CHECK:STDOUT: %ImplicitGenericParam.specific_fn.loc4_56.2 => constants.%ImplicitGenericParam.specific_fn.2 // CHECK:STDOUT: } @@ -803,15 +792,13 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (type, type) [template] // CHECK:STDOUT: %tuple.type.2: type = tuple_type (%T, %i32) [symbolic] // CHECK:STDOUT: %TupleParam.type: type = fn_type @TupleParam [template] // CHECK:STDOUT: %TupleParam: %TupleParam.type = struct_value () [template] -// CHECK:STDOUT: %require_complete.1: = require_complete_type %tuple.type.2 [symbolic] +// CHECK:STDOUT: %require_complete.2: = require_complete_type %tuple.type.2 [symbolic] // CHECK:STDOUT: %CallTupleParam.type: type = fn_type @CallTupleParam [template] // CHECK:STDOUT: %CallTupleParam: %CallTupleParam.type = struct_value () [template] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template] @@ -820,20 +807,20 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: %tuple.type.4: type = tuple_type (Core.IntLiteral, %i32) [template] // CHECK:STDOUT: %TupleParam.specific_fn: = specific_function %TupleParam, @TupleParam(Core.IntLiteral) [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_2.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound: = bound_method %int_2.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] // CHECK:STDOUT: %tuple: %tuple.type.4 = tuple_value (%int_1, %int_2.2) [template] -// CHECK:STDOUT: %complete_type.3: = complete_type_witness %tuple.type.4 [template] +// CHECK:STDOUT: %complete_type.4: = complete_type_witness %tuple.type.4 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -854,11 +841,9 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: } { // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc4_15.1 [symbolic = %T.loc4_15.2 (constants.%T)] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc4_35.1: %tuple.type.1 = tuple_literal (%T.ref, %int.make_type_signed) -// CHECK:STDOUT: %.loc4_35.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc4_35.3: type = converted %int.make_type_signed, %.loc4_35.2 [template = constants.%i32] -// CHECK:STDOUT: %.loc4_35.4: type = converted %.loc4_35.1, constants.%tuple.type.2 [symbolic = %tuple.type (constants.%tuple.type.2)] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc4_35.1: %tuple.type.1 = tuple_literal (%T.ref, %i32) +// CHECK:STDOUT: %.loc4_35.2: type = converted %.loc4_35.1, constants.%tuple.type.2 [symbolic = %tuple.type (constants.%tuple.type.2)] // CHECK:STDOUT: %T.param: type = value_param runtime_param // CHECK:STDOUT: %T.loc4_15.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc4_15.2 (constants.%T)] // CHECK:STDOUT: %x.param: @TupleParam.%tuple.type (%tuple.type.2) = value_param runtime_param0 @@ -873,7 +858,7 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: %tuple.type: type = tuple_type (@TupleParam.%T.loc4_15.2 (%T), %i32) [symbolic = %tuple.type (constants.%tuple.type.2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete: = require_complete_type @TupleParam.%tuple.type (%tuple.type.2) [symbolic = %require_complete (constants.%require_complete.1)] +// CHECK:STDOUT: %require_complete: = require_complete_type @TupleParam.%tuple.type (%tuple.type.2) [symbolic = %require_complete (constants.%require_complete.2)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%T.param_patt: type](%x.param_patt: @TupleParam.%tuple.type (%tuple.type.2)) { // CHECK:STDOUT: !entry: @@ -888,7 +873,7 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %.loc7_19.1: %tuple.type.3 = tuple_literal (%int_1, %int_2) // CHECK:STDOUT: %TupleParam.specific_fn: = specific_function %TupleParam.ref, @TupleParam(Core.IntLiteral) [template = constants.%TupleParam.specific_fn] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_2, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_2) [template = constants.%int_2.2] @@ -912,7 +897,7 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: %tuple.type => constants.%tuple.type.4 // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete => constants.%complete_type.3 +// CHECK:STDOUT: %require_complete => constants.%complete_type.4 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- deduce_nested_struct.carbon @@ -921,14 +906,12 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %struct_type.a.b.1: type = struct_type {.a: %T, .b: %i32} [symbolic] // CHECK:STDOUT: %StructParam.type: type = fn_type @StructParam [template] // CHECK:STDOUT: %StructParam: %StructParam.type = struct_value () [template] -// CHECK:STDOUT: %require_complete.1: = require_complete_type %struct_type.a.b.1 [symbolic] +// CHECK:STDOUT: %require_complete.2: = require_complete_type %struct_type.a.b.1 [symbolic] // CHECK:STDOUT: %CallStructParam.type: type = fn_type @CallStructParam [template] // CHECK:STDOUT: %CallStructParam: %CallStructParam.type = struct_value () [template] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template] @@ -937,20 +920,20 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: %struct_type.a.b.3: type = struct_type {.a: Core.IntLiteral, .b: %i32} [template] // CHECK:STDOUT: %StructParam.specific_fn: = specific_function %StructParam, @StructParam(Core.IntLiteral) [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_2.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound: = bound_method %int_2.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] // CHECK:STDOUT: %struct: %struct_type.a.b.3 = struct_value (%int_1, %int_2.2) [template] -// CHECK:STDOUT: %complete_type.3: = complete_type_witness %struct_type.a.b.3 [template] +// CHECK:STDOUT: %complete_type.4: = complete_type_witness %struct_type.a.b.3 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -971,9 +954,7 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: } { // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc4_16.1 [symbolic = %T.loc4_16.2 (constants.%T)] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc4_41.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc4_41.2: type = converted %int.make_type_signed, %.loc4_41.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %struct_type.a.b.loc4_44.1: type = struct_type {.a: %T, .b: %i32} [symbolic = %struct_type.a.b.loc4_44.2 (constants.%struct_type.a.b.1)] // CHECK:STDOUT: %T.param: type = value_param runtime_param // CHECK:STDOUT: %T.loc4_16.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc4_16.2 (constants.%T)] @@ -989,7 +970,7 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: %struct_type.a.b.loc4_44.2: type = struct_type {.a: @StructParam.%T.loc4_16.2 (%T), .b: %i32} [symbolic = %struct_type.a.b.loc4_44.2 (constants.%struct_type.a.b.1)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete: = require_complete_type @StructParam.%struct_type.a.b.loc4_44.2 (%struct_type.a.b.1) [symbolic = %require_complete (constants.%require_complete.1)] +// CHECK:STDOUT: %require_complete: = require_complete_type @StructParam.%struct_type.a.b.loc4_44.2 (%struct_type.a.b.1) [symbolic = %require_complete (constants.%require_complete.2)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%T.param_patt: type](%x.param_patt: @StructParam.%struct_type.a.b.loc4_44.2 (%struct_type.a.b.1)) { // CHECK:STDOUT: !entry: @@ -1004,7 +985,7 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %.loc7_30.1: %struct_type.a.b.2 = struct_literal (%int_1, %int_2) // CHECK:STDOUT: %StructParam.specific_fn: = specific_function %StructParam.ref, @StructParam(Core.IntLiteral) [template = constants.%StructParam.specific_fn] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_2, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_2) [template = constants.%int_2.2] @@ -1028,7 +1009,7 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: %struct_type.a.b.loc4_44.2 => constants.%struct_type.a.b.3 // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete => constants.%complete_type.3 +// CHECK:STDOUT: %require_complete => constants.%complete_type.4 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_deduce_bigger_struct.carbon @@ -1037,13 +1018,11 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %struct_type.c.d.e: type = struct_type {.c: %T, .d: %i32, .e: %i32} [symbolic] // CHECK:STDOUT: %BigStructParam.type: type = fn_type @BigStructParam [template] // CHECK:STDOUT: %BigStructParam: %BigStructParam.type = struct_value () [template] -// CHECK:STDOUT: %require_complete: = require_complete_type %struct_type.c.d.e [symbolic] +// CHECK:STDOUT: %require_complete.2: = require_complete_type %struct_type.c.d.e [symbolic] // CHECK:STDOUT: %CallBigStructParam.type: type = fn_type @CallBigStructParam [template] // CHECK:STDOUT: %CallBigStructParam: %CallBigStructParam.type = struct_value () [template] // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template] @@ -1053,7 +1032,7 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -1074,13 +1053,9 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: } { // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc4_19.1 [symbolic = %T.loc4_19.2 (constants.%T)] // CHECK:STDOUT: %int_32.loc4_44: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc4_44: init type = call constants.%Int(%int_32.loc4_44) [template = constants.%i32] -// CHECK:STDOUT: %.loc4_44.1: type = value_of_initializer %int.make_type_signed.loc4_44 [template = constants.%i32] -// CHECK:STDOUT: %.loc4_44.2: type = converted %int.make_type_signed.loc4_44, %.loc4_44.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc4_44: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc4_53: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc4_53: init type = call constants.%Int(%int_32.loc4_53) [template = constants.%i32] -// CHECK:STDOUT: %.loc4_53.1: type = value_of_initializer %int.make_type_signed.loc4_53 [template = constants.%i32] -// CHECK:STDOUT: %.loc4_53.2: type = converted %int.make_type_signed.loc4_53, %.loc4_53.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc4_53: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %struct_type.c.d.e.loc4_56.1: type = struct_type {.c: %T, .d: %i32, .e: %i32} [symbolic = %struct_type.c.d.e.loc4_56.2 (constants.%struct_type.c.d.e)] // CHECK:STDOUT: %T.param: type = value_param runtime_param // CHECK:STDOUT: %T.loc4_19.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc4_19.2 (constants.%T)] @@ -1096,7 +1071,7 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: %struct_type.c.d.e.loc4_56.2: type = struct_type {.c: @BigStructParam.%T.loc4_19.2 (%T), .d: %i32, .e: %i32} [symbolic = %struct_type.c.d.e.loc4_56.2 (constants.%struct_type.c.d.e)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete: = require_complete_type @BigStructParam.%struct_type.c.d.e.loc4_56.2 (%struct_type.c.d.e) [symbolic = %require_complete (constants.%require_complete)] +// CHECK:STDOUT: %require_complete: = require_complete_type @BigStructParam.%struct_type.c.d.e.loc4_56.2 (%struct_type.c.d.e) [symbolic = %require_complete (constants.%require_complete.2)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%T.param_patt: type](%x.param_patt: @BigStructParam.%struct_type.c.d.e.loc4_56.2 (%struct_type.c.d.e)) { // CHECK:STDOUT: !entry: @@ -1125,13 +1100,11 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %struct_type.f.g: type = struct_type {.f: %T, .g: %i32} [symbolic] // CHECK:STDOUT: %SmallStructParam.type: type = fn_type @SmallStructParam [template] // CHECK:STDOUT: %SmallStructParam: %SmallStructParam.type = struct_value () [template] -// CHECK:STDOUT: %require_complete: = require_complete_type %struct_type.f.g [symbolic] +// CHECK:STDOUT: %require_complete.2: = require_complete_type %struct_type.f.g [symbolic] // CHECK:STDOUT: %CallSmallStructParam.type: type = fn_type @CallSmallStructParam [template] // CHECK:STDOUT: %CallSmallStructParam: %CallSmallStructParam.type = struct_value () [template] // CHECK:STDOUT: %int_5: Core.IntLiteral = int_value 5 [template] @@ -1142,7 +1115,7 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -1163,9 +1136,7 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: } { // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc4_21.1 [symbolic = %T.loc4_21.2 (constants.%T)] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc4_46.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc4_46.2: type = converted %int.make_type_signed, %.loc4_46.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %struct_type.f.g.loc4_49.1: type = struct_type {.f: %T, .g: %i32} [symbolic = %struct_type.f.g.loc4_49.2 (constants.%struct_type.f.g)] // CHECK:STDOUT: %T.param: type = value_param runtime_param // CHECK:STDOUT: %T.loc4_21.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc4_21.2 (constants.%T)] @@ -1181,7 +1152,7 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: %struct_type.f.g.loc4_49.2: type = struct_type {.f: @SmallStructParam.%T.loc4_21.2 (%T), .g: %i32} [symbolic = %struct_type.f.g.loc4_49.2 (constants.%struct_type.f.g)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete: = require_complete_type @SmallStructParam.%struct_type.f.g.loc4_49.2 (%struct_type.f.g) [symbolic = %require_complete (constants.%require_complete)] +// CHECK:STDOUT: %require_complete: = require_complete_type @SmallStructParam.%struct_type.f.g.loc4_49.2 (%struct_type.f.g) [symbolic = %require_complete (constants.%require_complete.2)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%T.param_patt: type](%x.param_patt: @SmallStructParam.%struct_type.f.g.loc4_49.2 (%struct_type.f.g)) { // CHECK:STDOUT: !entry: @@ -1211,13 +1182,11 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %struct_type.i.different: type = struct_type {.i: %T, .different: %i32} [symbolic] // CHECK:STDOUT: %WrongNameStructParam.type: type = fn_type @WrongNameStructParam [template] // CHECK:STDOUT: %WrongNameStructParam: %WrongNameStructParam.type = struct_value () [template] -// CHECK:STDOUT: %require_complete: = require_complete_type %struct_type.i.different [symbolic] +// CHECK:STDOUT: %require_complete.2: = require_complete_type %struct_type.i.different [symbolic] // CHECK:STDOUT: %CallWrongNameStructParam.type: type = fn_type @CallWrongNameStructParam [template] // CHECK:STDOUT: %CallWrongNameStructParam: %CallWrongNameStructParam.type = struct_value () [template] // CHECK:STDOUT: %int_8: Core.IntLiteral = int_value 8 [template] @@ -1227,7 +1196,7 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -1248,9 +1217,7 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: } { // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc4_25.1 [symbolic = %T.loc4_25.2 (constants.%T)] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc4_58.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc4_58.2: type = converted %int.make_type_signed, %.loc4_58.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %struct_type.i.different.loc4_61.1: type = struct_type {.i: %T, .different: %i32} [symbolic = %struct_type.i.different.loc4_61.2 (constants.%struct_type.i.different)] // CHECK:STDOUT: %T.param: type = value_param runtime_param // CHECK:STDOUT: %T.loc4_25.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc4_25.2 (constants.%T)] @@ -1266,7 +1233,7 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: %struct_type.i.different.loc4_61.2: type = struct_type {.i: @WrongNameStructParam.%T.loc4_25.2 (%T), .different: %i32} [symbolic = %struct_type.i.different.loc4_61.2 (constants.%struct_type.i.different)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete: = require_complete_type @WrongNameStructParam.%struct_type.i.different.loc4_61.2 (%struct_type.i.different) [symbolic = %require_complete (constants.%require_complete)] +// CHECK:STDOUT: %require_complete: = require_complete_type @WrongNameStructParam.%struct_type.i.different.loc4_61.2 (%struct_type.i.different) [symbolic = %require_complete (constants.%require_complete.2)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%T.param_patt: type](%x.param_patt: @WrongNameStructParam.%struct_type.i.different.loc4_61.2 (%struct_type.i.different)) { // CHECK:STDOUT: !entry: @@ -1295,13 +1262,11 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %struct_type.first.second: type = struct_type {.first: %T, .second: %i32} [symbolic] // CHECK:STDOUT: %WrongOrderStructParam.type: type = fn_type @WrongOrderStructParam [template] // CHECK:STDOUT: %WrongOrderStructParam: %WrongOrderStructParam.type = struct_value () [template] -// CHECK:STDOUT: %require_complete: = require_complete_type %struct_type.first.second [symbolic] +// CHECK:STDOUT: %require_complete.2: = require_complete_type %struct_type.first.second [symbolic] // CHECK:STDOUT: %CallWrongOrderStructParam.type: type = fn_type @CallWrongOrderStructParam [template] // CHECK:STDOUT: %CallWrongOrderStructParam: %CallWrongOrderStructParam.type = struct_value () [template] // CHECK:STDOUT: %int_11: Core.IntLiteral = int_value 11 [template] @@ -1311,7 +1276,7 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -1332,9 +1297,7 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: } { // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc4_26.1 [symbolic = %T.loc4_26.2 (constants.%T)] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc4_60.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc4_60.2: type = converted %int.make_type_signed, %.loc4_60.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %struct_type.first.second.loc4_63.1: type = struct_type {.first: %T, .second: %i32} [symbolic = %struct_type.first.second.loc4_63.2 (constants.%struct_type.first.second)] // CHECK:STDOUT: %T.param: type = value_param runtime_param // CHECK:STDOUT: %T.loc4_26.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc4_26.2 (constants.%T)] @@ -1350,7 +1313,7 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: %struct_type.first.second.loc4_63.2: type = struct_type {.first: @WrongOrderStructParam.%T.loc4_26.2 (%T), .second: %i32} [symbolic = %struct_type.first.second.loc4_63.2 (constants.%struct_type.first.second)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete: = require_complete_type @WrongOrderStructParam.%struct_type.first.second.loc4_63.2 (%struct_type.first.second) [symbolic = %require_complete (constants.%require_complete)] +// CHECK:STDOUT: %require_complete: = require_complete_type @WrongOrderStructParam.%struct_type.first.second.loc4_63.2 (%struct_type.first.second) [symbolic = %require_complete (constants.%require_complete.2)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%T.param_patt: type](%x.param_patt: @WrongOrderStructParam.%struct_type.first.second.loc4_63.2 (%struct_type.first.second)) { // CHECK:STDOUT: !entry: diff --git a/toolchain/check/testdata/function/generic/fail_todo_param_in_type.carbon b/toolchain/check/testdata/function/generic/fail_todo_param_in_type.carbon index 1742887fb232a..a3440d58d5038 100644 --- a/toolchain/check/testdata/function/generic/fail_todo_param_in_type.carbon +++ b/toolchain/check/testdata/function/generic/fail_todo_param_in_type.carbon @@ -17,18 +17,16 @@ fn F(N:! i32, a: [i32; N]*); // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] -// CHECK:STDOUT: %N.1: %i32 = bind_symbolic_name N, 0 [symbolic] -// CHECK:STDOUT: %N.patt.1: %i32 = symbolic_binding_pattern N, 0 [symbolic] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] +// CHECK:STDOUT: %N.2: %i32 = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %N.patt.2: %i32 = symbolic_binding_pattern N, 0 [symbolic] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.type.13: type = fn_type @Convert.4, @impl.3(%int_32) [template] -// CHECK:STDOUT: %Convert.13: %Convert.type.13 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.13) [template] -// CHECK:STDOUT: %Convert.bound: = bound_method %N.1, %Convert.13 [symbolic] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.4(%int_32) [symbolic] -// CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %Convert.specific_fn(%N.1) [symbolic] +// CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.3, @impl.2(%int_32) [template] +// CHECK:STDOUT: %Convert.9: %Convert.type.9 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.9) [template] +// CHECK:STDOUT: %Convert.bound: = bound_method %N.2, %Convert.9 [symbolic] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.3(%int_32) [symbolic] +// CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %Convert.specific_fn(%N.2) [symbolic] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: } @@ -36,7 +34,7 @@ fn F(N:! i32, a: [i32; N]*); // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -49,48 +47,44 @@ fn F(N:! i32, a: [i32; N]*); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %N.patt.loc14_6.1: %i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc14_6.2 (constants.%N.patt.1)] -// CHECK:STDOUT: %N.param_patt: %i32 = value_param_pattern %N.patt.loc14_6.1, runtime_param [symbolic = %N.patt.loc14_6.2 (constants.%N.patt.1)] +// CHECK:STDOUT: %N.patt.loc14_6.1: %i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc14_6.2 (constants.%N.patt.2)] +// CHECK:STDOUT: %N.param_patt: %i32 = value_param_pattern %N.patt.loc14_6.1, runtime_param [symbolic = %N.patt.loc14_6.2 (constants.%N.patt.2)] // CHECK:STDOUT: %a.patt: = binding_pattern a // CHECK:STDOUT: %a.param_patt: = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc14_10: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc14_10: init type = call constants.%Int(%int_32.loc14_10) [template = constants.%i32] -// CHECK:STDOUT: %.loc14_10.1: type = value_of_initializer %int.make_type_signed.loc14_10 [template = constants.%i32] -// CHECK:STDOUT: %.loc14_10.2: type = converted %int.make_type_signed.loc14_10, %.loc14_10.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc14_10: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc14_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc14_19: init type = call constants.%Int(%int_32.loc14_19) [template = constants.%i32] -// CHECK:STDOUT: %N.ref: %i32 = name_ref N, %N.loc14_6.1 [symbolic = %N.loc14_6.2 (constants.%N.1)] -// CHECK:STDOUT: %.loc14_19.1: type = value_of_initializer %int.make_type_signed.loc14_19 [template = constants.%i32] -// CHECK:STDOUT: %.loc14_19.2: type = converted %int.make_type_signed.loc14_19, %.loc14_19.1 [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.13] +// CHECK:STDOUT: %i32.loc14_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %N.ref: %i32 = name_ref N, %N.loc14_6.1 [symbolic = %N.loc14_6.2 (constants.%N.2)] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.9] // CHECK:STDOUT: %Convert.bound.loc14_24.1: = bound_method %N.ref, %impl.elem0 [symbolic = %Convert.bound.loc14_24.2 (constants.%Convert.bound)] -// CHECK:STDOUT: %Convert.specific_fn.loc14_24.1: = specific_function %Convert.bound.loc14_24.1, @Convert.4(constants.%int_32) [symbolic = %Convert.specific_fn.loc14_24.2 (constants.%Convert.specific_fn)] +// CHECK:STDOUT: %Convert.specific_fn.loc14_24.1: = specific_function %Convert.bound.loc14_24.1, @Convert.3(constants.%int_32) [symbolic = %Convert.specific_fn.loc14_24.2 (constants.%Convert.specific_fn)] // CHECK:STDOUT: %int.convert_checked.loc14_24.1: init Core.IntLiteral = call %Convert.specific_fn.loc14_24.1(%N.ref) [symbolic = %int.convert_checked.loc14_24.2 (constants.%int.convert_checked)] // CHECK:STDOUT: %.loc14_24.1: Core.IntLiteral = value_of_initializer %int.convert_checked.loc14_24.1 [symbolic = %int.convert_checked.loc14_24.2 (constants.%int.convert_checked)] // CHECK:STDOUT: %.loc14_24.2: Core.IntLiteral = converted %N.ref, %.loc14_24.1 [symbolic = %int.convert_checked.loc14_24.2 (constants.%int.convert_checked)] // CHECK:STDOUT: %array_type: type = array_type %.loc14_24.2, %i32 [template = ] // CHECK:STDOUT: %ptr: type = ptr_type [template = ] // CHECK:STDOUT: %N.param: %i32 = value_param runtime_param -// CHECK:STDOUT: %N.loc14_6.1: %i32 = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc14_6.2 (constants.%N.1)] +// CHECK:STDOUT: %N.loc14_6.1: %i32 = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc14_6.2 (constants.%N.2)] // CHECK:STDOUT: %a.param: = value_param runtime_param0 // CHECK:STDOUT: %a: = bind_name a, %a.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @F(%N.loc14_6.1: %i32) { -// CHECK:STDOUT: %N.loc14_6.2: %i32 = bind_symbolic_name N, 0 [symbolic = %N.loc14_6.2 (constants.%N.1)] -// CHECK:STDOUT: %N.patt.loc14_6.2: %i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc14_6.2 (constants.%N.patt.1)] -// CHECK:STDOUT: %Convert.bound.loc14_24.2: = bound_method %N.loc14_6.2, constants.%Convert.13 [symbolic = %Convert.bound.loc14_24.2 (constants.%Convert.bound)] -// CHECK:STDOUT: %Convert.specific_fn.loc14_24.2: = specific_function %Convert.bound.loc14_24.2, @Convert.4(constants.%int_32) [symbolic = %Convert.specific_fn.loc14_24.2 (constants.%Convert.specific_fn)] +// CHECK:STDOUT: %N.loc14_6.2: %i32 = bind_symbolic_name N, 0 [symbolic = %N.loc14_6.2 (constants.%N.2)] +// CHECK:STDOUT: %N.patt.loc14_6.2: %i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc14_6.2 (constants.%N.patt.2)] +// CHECK:STDOUT: %Convert.bound.loc14_24.2: = bound_method %N.loc14_6.2, constants.%Convert.9 [symbolic = %Convert.bound.loc14_24.2 (constants.%Convert.bound)] +// CHECK:STDOUT: %Convert.specific_fn.loc14_24.2: = specific_function %Convert.bound.loc14_24.2, @Convert.3(constants.%int_32) [symbolic = %Convert.specific_fn.loc14_24.2 (constants.%Convert.specific_fn)] // CHECK:STDOUT: %int.convert_checked.loc14_24.2: init Core.IntLiteral = call %Convert.specific_fn.loc14_24.2(%N.loc14_6.2) [symbolic = %int.convert_checked.loc14_24.2 (constants.%int.convert_checked)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%N.param_patt: %i32, %a.param_patt: ); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @F(constants.%N.1) { -// CHECK:STDOUT: %N.loc14_6.2 => constants.%N.1 -// CHECK:STDOUT: %N.patt.loc14_6.2 => constants.%N.1 +// CHECK:STDOUT: specific @F(constants.%N.2) { +// CHECK:STDOUT: %N.loc14_6.2 => constants.%N.2 +// CHECK:STDOUT: %N.patt.loc14_6.2 => constants.%N.2 // CHECK:STDOUT: %Convert.bound.loc14_24.2 => constants.%Convert.bound // CHECK:STDOUT: %Convert.specific_fn.loc14_24.2 => constants.%Convert.specific_fn // CHECK:STDOUT: %int.convert_checked.loc14_24.2 => constants.%int.convert_checked diff --git a/toolchain/check/testdata/function/generic/resolve_used.carbon b/toolchain/check/testdata/function/generic/resolve_used.carbon index b8ecc92ee0b71..aab5b05e7e2a6 100644 --- a/toolchain/check/testdata/function/generic/resolve_used.carbon +++ b/toolchain/check/testdata/function/generic/resolve_used.carbon @@ -17,7 +17,10 @@ fn ErrorIfNIsZero(N:! Core.IntLiteral()) { // ensuring we produce an error when doing so. Notionally this error is // produced as a result of instantiating the `Core.Int` template, although // that's not how we currently model `Core.Int`. - // CHECK:STDERR: fail_todo_call_monomorphization_error.carbon:[[@LINE+3]]:10: error: integer type width of 0 is not positive [IntWidthNotPositive] + // CHECK:STDERR: fail_todo_call_monomorphization_error.carbon:[[@LINE+6]]:10: error: integer type width of 0 is not positive [IntWidthNotPositive] + // CHECK:STDERR: var v: Core.Int(N); + // CHECK:STDERR: ^~~~~~~~~~~ + // CHECK:STDERR: fail_todo_call_monomorphization_error.carbon:[[@LINE+3]]:10: note: in `i0` used here [ResolvingSpecificHere] // CHECK:STDERR: var v: Core.Int(N); // CHECK:STDERR: ^~~~~~~~~~~ var v: Core.Int(N); @@ -40,14 +43,16 @@ fn CallNegative() { // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic] // CHECK:STDOUT: %ErrorIfNIsZero.type: type = fn_type @ErrorIfNIsZero [template] // CHECK:STDOUT: %ErrorIfNIsZero: %ErrorIfNIsZero.type = struct_value () [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic] -// CHECK:STDOUT: %require_complete: = require_complete_type %iN [symbolic] +// CHECK:STDOUT: %Int.type: type = generic_class_type @Int [template] +// CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [template] +// CHECK:STDOUT: %Int: type = class_type @Int, @Int(%N) [symbolic] +// CHECK:STDOUT: %require_complete.2: = require_complete_type %Int [symbolic] // CHECK:STDOUT: %CallNegative.type: type = fn_type @CallNegative [template] // CHECK:STDOUT: %CallNegative: %CallNegative.type = struct_value () [template] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %ErrorIfNIsZero.specific_fn: = specific_function %ErrorIfNIsZero, @ErrorIfNIsZero(%int_0) [template] +// CHECK:STDOUT: %i0: type = class_type @Int, @Int(%int_0) [template] +// CHECK:STDOUT: %complete_type.2: = complete_type_witness [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -57,8 +62,8 @@ fn CallNegative() { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: %IntLiteral.type = import_ref Core//prelude/types, IntLiteral, loaded [template = constants.%IntLiteral] -// CHECK:STDOUT: %import_ref.2: %Int.type = import_ref Core//prelude/types, Int, loaded [template = constants.%Int] +// CHECK:STDOUT: %import_ref.1: %IntLiteral.type = import_ref Core//prelude/types/int_literal, IntLiteral, loaded [template = constants.%IntLiteral] +// CHECK:STDOUT: %import_ref.2: %Int.type = import_ref Core//prelude/types/int, Int, loaded [template = constants.%Int.generic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -88,19 +93,17 @@ fn CallNegative() { // CHECK:STDOUT: %N.patt.loc4_19.2: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc4_19.2 (constants.%N.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %iN: type = int_type signed, %N.loc4_19.2 [symbolic = %iN (constants.%iN)] -// CHECK:STDOUT: %require_complete: = require_complete_type @ErrorIfNIsZero.%iN (%iN) [symbolic = %require_complete (constants.%require_complete)] +// CHECK:STDOUT: %Int.loc15_20.2: type = class_type @Int, @Int(%N.loc4_19.2) [symbolic = %Int.loc15_20.2 (constants.%Int)] +// CHECK:STDOUT: %require_complete: = require_complete_type @ErrorIfNIsZero.%Int.loc15_20.2 (%Int) [symbolic = %require_complete (constants.%require_complete.2)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%N.param_patt: Core.IntLiteral) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Core.ref.loc12: = name_ref Core, imports.%Core [template = imports.%Core] -// CHECK:STDOUT: %Int.ref: %Int.type = name_ref Int, imports.%import_ref.2 [template = constants.%Int] +// CHECK:STDOUT: %Core.ref.loc15: = name_ref Core, imports.%Core [template = imports.%Core] +// CHECK:STDOUT: %Int.ref: %Int.type = name_ref Int, imports.%import_ref.2 [template = constants.%Int.generic] // CHECK:STDOUT: %N.ref: Core.IntLiteral = name_ref N, %N.loc4_19.1 [symbolic = %N.loc4_19.2 (constants.%N)] -// CHECK:STDOUT: %int.make_type_signed: init type = call %Int.ref(%N.ref) [symbolic = %iN (constants.%iN)] -// CHECK:STDOUT: %.loc12_20.1: type = value_of_initializer %int.make_type_signed [symbolic = %iN (constants.%iN)] -// CHECK:STDOUT: %.loc12_20.2: type = converted %int.make_type_signed, %.loc12_20.1 [symbolic = %iN (constants.%iN)] -// CHECK:STDOUT: %v.var: ref @ErrorIfNIsZero.%iN (%iN) = var v -// CHECK:STDOUT: %v: ref @ErrorIfNIsZero.%iN (%iN) = bind_name v, %v.var +// CHECK:STDOUT: %Int.loc15_20.1: type = class_type @Int, @Int(constants.%N) [symbolic = %Int.loc15_20.2 (constants.%Int)] +// CHECK:STDOUT: %v.var: ref @ErrorIfNIsZero.%Int.loc15_20.2 (%Int) = var v +// CHECK:STDOUT: %v: ref @ErrorIfNIsZero.%Int.loc15_20.2 (%Int) = bind_name v, %v.var // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -124,7 +127,7 @@ fn CallNegative() { // CHECK:STDOUT: %N.patt.loc4_19.2 => constants.%int_0 // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %iN => -// CHECK:STDOUT: %require_complete => +// CHECK:STDOUT: %Int.loc15_20.2 => constants.%i0 +// CHECK:STDOUT: %require_complete => constants.%complete_type.2 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/generic/return_slot.carbon b/toolchain/check/testdata/function/generic/return_slot.carbon index ec26c1c08568c..742caa3307c5d 100644 --- a/toolchain/check/testdata/function/generic/return_slot.carbon +++ b/toolchain/check/testdata/function/generic/return_slot.carbon @@ -33,18 +33,18 @@ fn G() { // CHECK:STDOUT: %Make.1: %Make.type.1 = struct_value () [symbolic] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] // CHECK:STDOUT: %complete_type.1: = complete_type_witness %empty_struct_type [template] -// CHECK:STDOUT: %require_complete: = require_complete_type %T [symbolic] +// CHECK:STDOUT: %require_complete.1: = require_complete_type %T [symbolic] // CHECK:STDOUT: %Make.specific_fn.1: = specific_function %Make.1, @Make(%T) [symbolic] // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %int_100: Core.IntLiteral = int_value 100 [template] // CHECK:STDOUT: %array_type: type = array_type %int_100, %i32 [template] +// CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %complete_type.3: = complete_type_witness %i32.builtin [template] // CHECK:STDOUT: %C.elem: type = unbound_element_type %C, %array_type [template] // CHECK:STDOUT: %struct_type.arr.1: type = struct_type {.arr: %array_type} [template] -// CHECK:STDOUT: %complete_type.2: = complete_type_witness %struct_type.arr.1 [template] +// CHECK:STDOUT: %complete_type.4: = complete_type_witness %struct_type.arr.1 [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] // CHECK:STDOUT: %Wrap.2: type = class_type @Wrap, @Wrap(%i32) [template] @@ -59,13 +59,12 @@ fn G() { // CHECK:STDOUT: %Make.type.4: type = fn_type @Make, @Wrap(%C) [template] // CHECK:STDOUT: %Make.4: %Make.type.4 = struct_value () [template] // CHECK:STDOUT: %Make.specific_fn.4: = specific_function %Make.4, @Make(%C) [template] -// CHECK:STDOUT: %complete_type.3: = complete_type_witness %i32 [template] -// CHECK:STDOUT: %complete_type.4: = complete_type_witness %empty_tuple.type [template] +// CHECK:STDOUT: %complete_type.5: = complete_type_witness %empty_tuple.type [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -118,17 +117,15 @@ fn G() { // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_100: Core.IntLiteral = int_value 100 [template = constants.%int_100] -// CHECK:STDOUT: %.loc15_21.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc15_21.2: type = converted %int.make_type_signed, %.loc15_21.1 [template = constants.%i32] // CHECK:STDOUT: %array_type: type = array_type %int_100, %i32 [template = constants.%array_type] -// CHECK:STDOUT: %.loc15_18: %C.elem = field_decl arr, element0 [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.arr.1 [template = constants.%complete_type.2] +// CHECK:STDOUT: %.loc15: %C.elem = field_decl arr, element0 [template] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.arr.1 [template = constants.%complete_type.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C -// CHECK:STDOUT: .arr = %.loc15_18 +// CHECK:STDOUT: .arr = %.loc15 // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } // CHECK:STDOUT: @@ -136,7 +133,7 @@ fn G() { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete: = require_complete_type @Make.%T (%T) [symbolic = %require_complete (constants.%require_complete)] +// CHECK:STDOUT: %require_complete: = require_complete_type @Make.%T (%T) [symbolic = %require_complete (constants.%require_complete.1)] // CHECK:STDOUT: %Make.type: type = fn_type @Make, @Wrap(%T) [symbolic = %Make.type (constants.%Make.type.1)] // CHECK:STDOUT: %Make: @Make.%Make.type (%Make.type.1) = struct_value () [symbolic = %Make (constants.%Make.1)] // CHECK:STDOUT: %Make.specific_fn.loc12_27.2: = specific_function %Make, @Make(%T) [symbolic = %Make.specific_fn.loc12_27.2 (constants.%Make.specific_fn.1)] @@ -156,19 +153,15 @@ fn G() { // CHECK:STDOUT: fn @G() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_32.loc18_10: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc18_10: init type = call constants.%Int(%int_32.loc18_10) [template = constants.%i32] -// CHECK:STDOUT: %.loc18_10.1: type = value_of_initializer %int.make_type_signed.loc18_10 [template = constants.%i32] -// CHECK:STDOUT: %.loc18_10.2: type = converted %int.make_type_signed.loc18_10, %.loc18_10.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc18_10: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.var: ref %i32 = var a // CHECK:STDOUT: %a: ref %i32 = bind_name a, %a.var // CHECK:STDOUT: %Wrap.ref.loc18: %Wrap.type = name_ref Wrap, file.%Wrap.decl [template = constants.%Wrap.generic] // CHECK:STDOUT: %int_32.loc18_21: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc18_21: init type = call constants.%Int(%int_32.loc18_21) [template = constants.%i32] -// CHECK:STDOUT: %.loc18_24.1: type = value_of_initializer %int.make_type_signed.loc18_21 [template = constants.%i32] -// CHECK:STDOUT: %.loc18_24.2: type = converted %int.make_type_signed.loc18_21, %.loc18_24.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc18_21: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %Wrap.loc18: type = class_type @Wrap, @Wrap(constants.%i32) [template = constants.%Wrap.2] -// CHECK:STDOUT: %.loc18_25: %Make.type.2 = specific_constant @Wrap.%Make.decl, @Wrap(constants.%i32) [template = constants.%Make.2] -// CHECK:STDOUT: %Make.ref.loc18: %Make.type.2 = name_ref Make, %.loc18_25 [template = constants.%Make.2] +// CHECK:STDOUT: %.loc18: %Make.type.2 = specific_constant @Wrap.%Make.decl, @Wrap(constants.%i32) [template = constants.%Make.2] +// CHECK:STDOUT: %Make.ref.loc18: %Make.type.2 = name_ref Make, %.loc18 [template = constants.%Make.2] // CHECK:STDOUT: %Make.specific_fn.loc18: = specific_function %Make.ref.loc18, @Make(constants.%i32) [template = constants.%Make.specific_fn.2] // CHECK:STDOUT: %Make.call.loc18: init %i32 = call %Make.specific_fn.loc18() // CHECK:STDOUT: assign %a.var, %Make.call.loc18 @@ -213,7 +206,7 @@ fn G() { // CHECK:STDOUT: %T => constants.%T // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete => constants.%require_complete +// CHECK:STDOUT: %require_complete => constants.%require_complete.1 // CHECK:STDOUT: %Make.type => constants.%Make.type.1 // CHECK:STDOUT: %Make => constants.%Make.1 // CHECK:STDOUT: %Make.specific_fn.loc12_27.2 => constants.%Make.specific_fn.1 @@ -265,7 +258,7 @@ fn G() { // CHECK:STDOUT: %T => constants.%empty_tuple.type // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete => constants.%complete_type.4 +// CHECK:STDOUT: %require_complete => constants.%complete_type.5 // CHECK:STDOUT: %Make.type => constants.%Make.type.3 // CHECK:STDOUT: %Make => constants.%Make.3 // CHECK:STDOUT: %Make.specific_fn.loc12_27.2 => constants.%Make.specific_fn.3 @@ -284,7 +277,7 @@ fn G() { // CHECK:STDOUT: %T => constants.%C // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete => constants.%complete_type.2 +// CHECK:STDOUT: %require_complete => constants.%complete_type.4 // CHECK:STDOUT: %Make.type => constants.%Make.type.4 // CHECK:STDOUT: %Make => constants.%Make.4 // CHECK:STDOUT: %Make.specific_fn.loc12_27.2 => constants.%Make.specific_fn.4 diff --git a/toolchain/check/testdata/function/generic/undefined.carbon b/toolchain/check/testdata/function/generic/undefined.carbon index 304a8bf829dc6..c12f288184544 100644 --- a/toolchain/check/testdata/function/generic/undefined.carbon +++ b/toolchain/check/testdata/function/generic/undefined.carbon @@ -59,27 +59,26 @@ fn CallUndefined() -> i32 { // CHECK:STDOUT: %Defined: %Defined.type = struct_value () [template] // CHECK:STDOUT: %require_complete.1: = require_complete_type %T [symbolic] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %CallDefined.type: type = fn_type @CallDefined [template] // CHECK:STDOUT: %CallDefined: %CallDefined.type = struct_value () [template] +// CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %complete_type.2: = complete_type_witness %i32.builtin [template] // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @As(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.7, @impl.5(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.14 [template] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.7(%int_32) [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.5, @impl.3(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.10 [template] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.5(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] // CHECK:STDOUT: %Defined.specific_fn: = specific_function %Defined, @Defined(%i32) [template] -// CHECK:STDOUT: %complete_type.2: = complete_type_witness %i32 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .As = %import_ref.2 +// CHECK:STDOUT: .As = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -114,9 +113,7 @@ fn CallUndefined() -> i32 { // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc8: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc8: init type = call constants.%Int(%int_32.loc8) [template = constants.%i32] -// CHECK:STDOUT: %.loc8_21.1: type = value_of_initializer %int.make_type_signed.loc8 [template = constants.%i32] -// CHECK:STDOUT: %.loc8_21.2: type = converted %int.make_type_signed.loc8, %.loc8_21.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc8: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } @@ -141,12 +138,10 @@ fn CallUndefined() -> i32 { // CHECK:STDOUT: %Defined.ref: %Defined.type = name_ref Defined, file.%Defined.decl [template = constants.%Defined] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %int_32.loc9: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc9: init type = call constants.%Int(%int_32.loc9) [template = constants.%i32] -// CHECK:STDOUT: %.loc9_23.1: type = value_of_initializer %int.make_type_signed.loc9 [template = constants.%i32] -// CHECK:STDOUT: %.loc9_23.2: type = converted %int.make_type_signed.loc9, %.loc9_23.1 [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %i32.loc9: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.7(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.5(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.2] // CHECK:STDOUT: %.loc9_20.1: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_0.2] // CHECK:STDOUT: %.loc9_20.2: %i32 = converted %int_0, %.loc9_20.1 [template = constants.%int_0.2] @@ -178,28 +173,27 @@ fn CallUndefined() -> i32 { // CHECK:STDOUT: %Defined.type: type = fn_type @Defined [template] // CHECK:STDOUT: %Defined: %Defined.type = struct_value () [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %CallDefined.type: type = fn_type @CallDefined [template] // CHECK:STDOUT: %CallDefined: %CallDefined.type = struct_value () [template] +// CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %complete_type.2: = complete_type_witness %i32.builtin [template] // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @As(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.7, @impl.5(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.14 [template] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.7(%int_32) [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.5, @impl.3(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.10 [template] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.5(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] // CHECK:STDOUT: %Defined.specific_fn: = specific_function %Defined, @Defined(%i32) [template] -// CHECK:STDOUT: %require_complete.7: = require_complete_type %T [symbolic] -// CHECK:STDOUT: %complete_type.2: = complete_type_witness %i32 [template] +// CHECK:STDOUT: %require_complete.5: = require_complete_type %T [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .As = %import_ref.2 +// CHECK:STDOUT: .As = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -234,9 +228,7 @@ fn CallUndefined() -> i32 { // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc6: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc6: init type = call constants.%Int(%int_32.loc6) [template = constants.%i32] -// CHECK:STDOUT: %.loc6_21.1: type = value_of_initializer %int.make_type_signed.loc6 [template = constants.%i32] -// CHECK:STDOUT: %.loc6_21.2: type = converted %int.make_type_signed.loc6, %.loc6_21.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc6: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } @@ -264,7 +256,7 @@ fn CallUndefined() -> i32 { // CHECK:STDOUT: %T.patt.loc4: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4 (constants.%T.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete: = require_complete_type @Defined.%T.loc4_12.2 (%T) [symbolic = %require_complete (constants.%require_complete.7)] +// CHECK:STDOUT: %require_complete: = require_complete_type @Defined.%T.loc4_12.2 (%T) [symbolic = %require_complete (constants.%require_complete.5)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%T.param_patt: type](%x.param_patt: %T) -> %T { // CHECK:STDOUT: !entry: @@ -278,12 +270,10 @@ fn CallUndefined() -> i32 { // CHECK:STDOUT: %Defined.ref: %Defined.type = name_ref Defined, file.%Defined.decl.loc4 [template = constants.%Defined] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %int_32.loc7: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc7: init type = call constants.%Int(%int_32.loc7) [template = constants.%i32] -// CHECK:STDOUT: %.loc7_23.1: type = value_of_initializer %int.make_type_signed.loc7 [template = constants.%i32] -// CHECK:STDOUT: %.loc7_23.2: type = converted %int.make_type_signed.loc7, %.loc7_23.1 [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %i32.loc7: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.7(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.5(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.2] // CHECK:STDOUT: %.loc7_20.1: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_0.2] // CHECK:STDOUT: %.loc7_20.2: %i32 = converted %int_0, %.loc7_20.1 [template = constants.%int_0.2] @@ -315,18 +305,16 @@ fn CallUndefined() -> i32 { // CHECK:STDOUT: %Undefined.type: type = fn_type @Undefined [template] // CHECK:STDOUT: %Undefined: %Undefined.type = struct_value () [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %CallUndefined.type: type = fn_type @CallUndefined [template] // CHECK:STDOUT: %CallUndefined: %CallUndefined.type = struct_value () [template] // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @As(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.7, @impl.5(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.14 [template] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.7(%int_32) [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.5, @impl.3(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.10 [template] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.5(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] // CHECK:STDOUT: %Undefined.specific_fn: = specific_function %Undefined, @Undefined(%i32) [template] // CHECK:STDOUT: } @@ -334,7 +322,7 @@ fn CallUndefined() -> i32 { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .As = %import_ref.2 +// CHECK:STDOUT: .As = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -369,9 +357,7 @@ fn CallUndefined() -> i32 { // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc6: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc6: init type = call constants.%Int(%int_32.loc6) [template = constants.%i32] -// CHECK:STDOUT: %.loc6_23.1: type = value_of_initializer %int.make_type_signed.loc6 [template = constants.%i32] -// CHECK:STDOUT: %.loc6_23.2: type = converted %int.make_type_signed.loc6, %.loc6_23.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc6: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } @@ -389,12 +375,10 @@ fn CallUndefined() -> i32 { // CHECK:STDOUT: %Undefined.ref: %Undefined.type = name_ref Undefined, file.%Undefined.decl [template = constants.%Undefined] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %int_32.loc13: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc13: init type = call constants.%Int(%int_32.loc13) [template = constants.%i32] -// CHECK:STDOUT: %.loc13_25.1: type = value_of_initializer %int.make_type_signed.loc13 [template = constants.%i32] -// CHECK:STDOUT: %.loc13_25.2: type = converted %int.make_type_signed.loc13, %.loc13_25.1 [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %i32.loc13: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.7(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.5(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.2] // CHECK:STDOUT: %.loc13_22.1: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_0.2] // CHECK:STDOUT: %.loc13_22.2: %i32 = converted %int_0, %.loc13_22.1 [template = constants.%int_0.2] diff --git a/toolchain/check/testdata/global/decl.carbon b/toolchain/check/testdata/global/decl.carbon index bf132c4ba1302..369c6c3d27d07 100644 --- a/toolchain/check/testdata/global/decl.carbon +++ b/toolchain/check/testdata/global/decl.carbon @@ -13,14 +13,12 @@ var a: i32; // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -33,9 +31,7 @@ var a: i32; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc10_8.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc10_8.2: type = converted %int.make_type_signed, %.loc10_8.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.var: ref %i32 = var a // CHECK:STDOUT: %a: ref %i32 = bind_name a, %a.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/global/simple_init.carbon b/toolchain/check/testdata/global/simple_init.carbon index 6e80bf31bdf51..93bc6830c620b 100644 --- a/toolchain/check/testdata/global/simple_init.carbon +++ b/toolchain/check/testdata/global/simple_init.carbon @@ -13,15 +13,13 @@ var a: i32 = 0; // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] // CHECK:STDOUT: } @@ -29,7 +27,7 @@ var a: i32 = 0; // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -42,9 +40,7 @@ var a: i32 = 0; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc10_8.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc10_8.2: type = converted %int.make_type_signed, %.loc10_8.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.var: ref %i32 = var a // CHECK:STDOUT: %a: ref %i32 = bind_name a, %a.var // CHECK:STDOUT: } @@ -52,7 +48,7 @@ var a: i32 = 0; // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.2] diff --git a/toolchain/check/testdata/global/simple_with_fun.carbon b/toolchain/check/testdata/global/simple_with_fun.carbon index 1d3c00e08bdcf..68312197b44eb 100644 --- a/toolchain/check/testdata/global/simple_with_fun.carbon +++ b/toolchain/check/testdata/global/simple_with_fun.carbon @@ -18,17 +18,15 @@ var a: i32 = test_a(); // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %test_a.type: type = fn_type @test_a [template] // CHECK:STDOUT: %test_a: %test_a.type = struct_value () [template] // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] // CHECK:STDOUT: } @@ -36,7 +34,7 @@ var a: i32 = test_a(); // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -54,16 +52,12 @@ var a: i32 = test_a(); // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_16.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc11_16.2: type = converted %int.make_type_signed, %.loc11_16.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc15_8.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc15_8.2: type = converted %int.make_type_signed, %.loc15_8.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.var: ref %i32 = var a // CHECK:STDOUT: %a: ref %i32 = bind_name a, %a.var // CHECK:STDOUT: } @@ -71,7 +65,7 @@ var a: i32 = test_a(); // CHECK:STDOUT: fn @test_a() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.2] diff --git a/toolchain/check/testdata/if/fail_reachable_fallthrough.carbon b/toolchain/check/testdata/if/fail_reachable_fallthrough.carbon index 469b2a595dc8e..cd548bd17d3fd 100644 --- a/toolchain/check/testdata/if/fail_reachable_fallthrough.carbon +++ b/toolchain/check/testdata/if/fail_reachable_fallthrough.carbon @@ -45,23 +45,21 @@ fn If3(b: bool) -> i32 { // CHECK:STDOUT: %Bool.type: type = fn_type @Bool [template] // CHECK:STDOUT: %Bool: %Bool.type = struct_value () [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %If1.type: type = fn_type @If1 [template] // CHECK:STDOUT: %If1: %If1.type = struct_value () [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] // CHECK:STDOUT: %If2.type: type = fn_type @If2 [template] // CHECK:STDOUT: %If2: %If2.type = struct_value () [template] // CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] // CHECK:STDOUT: %If3.type: type = fn_type @If3 [template] @@ -72,7 +70,7 @@ fn If3(b: bool) -> i32 { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Bool = %import_ref.1 // CHECK:STDOUT: .Int = %import_ref.2 -// CHECK:STDOUT: .ImplicitAs = %import_ref.3 +// CHECK:STDOUT: .ImplicitAs = %import_ref.6 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -96,9 +94,7 @@ fn If3(b: bool) -> i32 { // CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc11_11.2: type = converted %bool.make_type, %.loc11_11.1 [template = bool] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_20.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc11_20.2: type = converted %int.make_type_signed, %.loc11_20.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %b.param: bool = value_param runtime_param0 // CHECK:STDOUT: %b: bool = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 @@ -114,9 +110,7 @@ fn If3(b: bool) -> i32 { // CHECK:STDOUT: %.loc22_11.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc22_11.2: type = converted %bool.make_type, %.loc22_11.1 [template = bool] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc22_20.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc22_20.2: type = converted %int.make_type_signed, %.loc22_20.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %b.param: bool = value_param runtime_param0 // CHECK:STDOUT: %b: bool = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 @@ -132,9 +126,7 @@ fn If3(b: bool) -> i32 { // CHECK:STDOUT: %.loc33_11.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc33_11.2: type = converted %bool.make_type, %.loc33_11.1 [template = bool] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc33_20.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc33_20.2: type = converted %int.make_type_signed, %.loc33_20.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %b.param: bool = value_param runtime_param0 // CHECK:STDOUT: %b: bool = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 @@ -149,7 +141,7 @@ fn If3(b: bool) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: !if.then: // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1, %impl.elem0 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_1) [template = constants.%int_1.2] @@ -173,7 +165,7 @@ fn If3(b: bool) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: !if.else: // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_2, %impl.elem0 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_2) [template = constants.%int_2.2] @@ -191,7 +183,7 @@ fn If3(b: bool) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: !if.then: // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1, %impl.elem0 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_1) [template = constants.%int_1.2] diff --git a/toolchain/check/testdata/if/fail_scope.carbon b/toolchain/check/testdata/if/fail_scope.carbon index 1c9d0ceaa6d8f..47051fee04a34 100644 --- a/toolchain/check/testdata/if/fail_scope.carbon +++ b/toolchain/check/testdata/if/fail_scope.carbon @@ -25,17 +25,15 @@ fn VarScope(b: bool) -> i32 { // CHECK:STDOUT: %Bool.type: type = fn_type @Bool [template] // CHECK:STDOUT: %Bool: %Bool.type = struct_value () [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %VarScope.type: type = fn_type @VarScope [template] // CHECK:STDOUT: %VarScope: %VarScope.type = struct_value () [template] // CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_2.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound: = bound_method %int_2.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] // CHECK:STDOUT: } @@ -44,7 +42,7 @@ fn VarScope(b: bool) -> i32 { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Bool = %import_ref.1 // CHECK:STDOUT: .Int = %import_ref.2 -// CHECK:STDOUT: .ImplicitAs = %import_ref.3 +// CHECK:STDOUT: .ImplicitAs = %import_ref.6 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -66,9 +64,7 @@ fn VarScope(b: bool) -> i32 { // CHECK:STDOUT: %.loc11_16.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc11_16.2: type = converted %bool.make_type, %.loc11_16.1 [template = bool] // CHECK:STDOUT: %int_32.loc11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11: init type = call constants.%Int(%int_32.loc11) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_25.1: type = value_of_initializer %int.make_type_signed.loc11 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_25.2: type = converted %int.make_type_signed.loc11, %.loc11_25.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %b.param: bool = value_param runtime_param0 // CHECK:STDOUT: %b: bool = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 @@ -83,18 +79,16 @@ fn VarScope(b: bool) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: !if.then: // CHECK:STDOUT: %int_32.loc13: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc13: init type = call constants.%Int(%int_32.loc13) [template = constants.%i32] -// CHECK:STDOUT: %.loc13_12.1: type = value_of_initializer %int.make_type_signed.loc13 [template = constants.%i32] -// CHECK:STDOUT: %.loc13_12.2: type = converted %int.make_type_signed.loc13, %.loc13_12.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc13: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %n.var: ref %i32 = var n // CHECK:STDOUT: %n: ref %i32 = bind_name n, %n.var // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_2, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_2) [template = constants.%int_2.2] -// CHECK:STDOUT: %.loc13_19: init %i32 = converted %int_2, %int.convert_checked [template = constants.%int_2.2] -// CHECK:STDOUT: assign %n.var, %.loc13_19 +// CHECK:STDOUT: %.loc13: init %i32 = converted %int_2, %int.convert_checked [template = constants.%int_2.2] +// CHECK:STDOUT: assign %n.var, %.loc13 // CHECK:STDOUT: %n.ref.loc14: ref %i32 = name_ref n, %n // CHECK:STDOUT: %.loc14: %i32 = bind_value %n.ref.loc14 // CHECK:STDOUT: return %.loc14 diff --git a/toolchain/check/testdata/if/unreachable_fallthrough.carbon b/toolchain/check/testdata/if/unreachable_fallthrough.carbon index 0a400763e9a55..ccc7ec314d76b 100644 --- a/toolchain/check/testdata/if/unreachable_fallthrough.carbon +++ b/toolchain/check/testdata/if/unreachable_fallthrough.carbon @@ -23,21 +23,19 @@ fn If(b: bool) -> i32 { // CHECK:STDOUT: %Bool.type: type = fn_type @Bool [template] // CHECK:STDOUT: %Bool: %Bool.type = struct_value () [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %If.type: type = fn_type @If [template] // CHECK:STDOUT: %If: %If.type = struct_value () [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] // CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] // CHECK:STDOUT: } @@ -46,7 +44,7 @@ fn If(b: bool) -> i32 { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Bool = %import_ref.1 // CHECK:STDOUT: .Int = %import_ref.2 -// CHECK:STDOUT: .ImplicitAs = %import_ref.3 +// CHECK:STDOUT: .ImplicitAs = %import_ref.6 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -68,9 +66,7 @@ fn If(b: bool) -> i32 { // CHECK:STDOUT: %.loc11_10.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc11_10.2: type = converted %bool.make_type, %.loc11_10.1 [template = bool] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_19.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc11_19.2: type = converted %int.make_type_signed, %.loc11_19.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %b.param: bool = value_param runtime_param0 // CHECK:STDOUT: %b: bool = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 @@ -85,7 +81,7 @@ fn If(b: bool) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: !if.then: // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc13: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc13: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc13: = bound_method %int_1, %impl.elem0.loc13 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc13: = specific_function %Convert.bound.loc13, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc13: init %i32 = call %Convert.specific_fn.loc13(%int_1) [template = constants.%int_1.2] @@ -95,7 +91,7 @@ fn If(b: bool) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: !if.else: // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %impl.elem0.loc15: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc15: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc15: = bound_method %int_2, %impl.elem0.loc15 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc15: = specific_function %Convert.bound.loc15, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc15: init %i32 = call %Convert.specific_fn.loc15(%int_2) [template = constants.%int_2.2] diff --git a/toolchain/check/testdata/if_expr/basic.carbon b/toolchain/check/testdata/if_expr/basic.carbon index 9651880486a3c..c7d9e86e2c3af 100644 --- a/toolchain/check/testdata/if_expr/basic.carbon +++ b/toolchain/check/testdata/if_expr/basic.carbon @@ -19,9 +19,7 @@ fn F(b: bool, n: i32, m: i32) -> i32 { // CHECK:STDOUT: %Bool.type: type = fn_type @Bool [template] // CHECK:STDOUT: %Bool: %Bool.type = struct_value () [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template] @@ -29,10 +27,10 @@ fn F(b: bool, n: i32, m: i32) -> i32 { // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %tuple.type: type = tuple_type (Core.IntLiteral) [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] // CHECK:STDOUT: %array: %array_type = tuple_value (%int_0.2) [template] @@ -42,7 +40,7 @@ fn F(b: bool, n: i32, m: i32) -> i32 { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Bool = %import_ref.1 // CHECK:STDOUT: .Int = %import_ref.2 -// CHECK:STDOUT: .ImplicitAs = %import_ref.3 +// CHECK:STDOUT: .ImplicitAs = %import_ref.6 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -68,17 +66,11 @@ fn F(b: bool, n: i32, m: i32) -> i32 { // CHECK:STDOUT: %.loc11_9.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc11_9.2: type = converted %bool.make_type, %.loc11_9.1 [template = bool] // CHECK:STDOUT: %int_32.loc11_18: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11_18: init type = call constants.%Int(%int_32.loc11_18) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_18.1: type = value_of_initializer %int.make_type_signed.loc11_18 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_18.2: type = converted %int.make_type_signed.loc11_18, %.loc11_18.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc11_18: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc11_26: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11_26: init type = call constants.%Int(%int_32.loc11_26) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_26.1: type = value_of_initializer %int.make_type_signed.loc11_26 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_26.2: type = converted %int.make_type_signed.loc11_26, %.loc11_26.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc11_26: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc11_34: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11_34: init type = call constants.%Int(%int_32.loc11_34) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_34.1: type = value_of_initializer %int.make_type_signed.loc11_34 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_34.2: type = converted %int.make_type_signed.loc11_34, %.loc11_34.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc11_34: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %b.param: bool = value_param runtime_param0 // CHECK:STDOUT: %b: bool = bind_name b, %b.param // CHECK:STDOUT: %n.param: %i32 = value_param runtime_param1 @@ -93,16 +85,14 @@ fn F(b: bool, n: i32, m: i32) -> i32 { // CHECK:STDOUT: fn @F(%b.param_patt: bool, %n.param_patt: %i32, %m.param_patt: %i32) -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_32.loc12: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc12: init type = call constants.%Int(%int_32.loc12) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc12: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1] -// CHECK:STDOUT: %.loc12_11.1: type = value_of_initializer %int.make_type_signed.loc12 [template = constants.%i32] -// CHECK:STDOUT: %.loc12_11.2: type = converted %int.make_type_signed.loc12, %.loc12_11.1 [template = constants.%i32] // CHECK:STDOUT: %array_type: type = array_type %int_1, %i32 [template = constants.%array_type] // CHECK:STDOUT: %x.var: ref %array_type = var x // CHECK:STDOUT: %x: ref %array_type = bind_name x, %x.var // CHECK:STDOUT: %int_0.loc12_22: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %.loc12_24.1: %tuple.type = tuple_literal (%int_0.loc12_22) -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.loc12_22, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_0.loc12_22) [template = constants.%int_0.2] @@ -120,23 +110,19 @@ fn F(b: bool, n: i32, m: i32) -> i32 { // CHECK:STDOUT: %x.ref.loc13_20: ref %array_type = name_ref x, %x // CHECK:STDOUT: %m.ref: %i32 = name_ref m, %m // CHECK:STDOUT: %int_32.loc13_23: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc13_23: init type = call constants.%Int(%int_32.loc13_23) [template = constants.%i32] -// CHECK:STDOUT: %.loc13_23.1: type = value_of_initializer %int.make_type_signed.loc13_23 [template = constants.%i32] -// CHECK:STDOUT: %.loc13_23.2: type = converted %int.make_type_signed.loc13_23, %.loc13_23.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc13_23.3: ref %i32 = array_index %x.ref.loc13_20, %m.ref -// CHECK:STDOUT: %.loc13_23.4: %i32 = bind_value %.loc13_23.3 -// CHECK:STDOUT: br !if.expr.result(%.loc13_23.4) +// CHECK:STDOUT: %i32.loc13_23: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc13_23.1: ref %i32 = array_index %x.ref.loc13_20, %m.ref +// CHECK:STDOUT: %.loc13_23.2: %i32 = bind_value %.loc13_23.1 +// CHECK:STDOUT: br !if.expr.result(%.loc13_23.2) // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.else: // CHECK:STDOUT: %x.ref.loc13_30: ref %array_type = name_ref x, %x // CHECK:STDOUT: %n.ref: %i32 = name_ref n, %n // CHECK:STDOUT: %int_32.loc13_33: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc13_33: init type = call constants.%Int(%int_32.loc13_33) [template = constants.%i32] -// CHECK:STDOUT: %.loc13_33.1: type = value_of_initializer %int.make_type_signed.loc13_33 [template = constants.%i32] -// CHECK:STDOUT: %.loc13_33.2: type = converted %int.make_type_signed.loc13_33, %.loc13_33.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc13_33.3: ref %i32 = array_index %x.ref.loc13_30, %n.ref -// CHECK:STDOUT: %.loc13_33.4: %i32 = bind_value %.loc13_33.3 -// CHECK:STDOUT: br !if.expr.result(%.loc13_33.4) +// CHECK:STDOUT: %i32.loc13_33: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc13_33.1: ref %i32 = array_index %x.ref.loc13_30, %n.ref +// CHECK:STDOUT: %.loc13_33.2: %i32 = bind_value %.loc13_33.1 +// CHECK:STDOUT: br !if.expr.result(%.loc13_33.2) // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.result: // CHECK:STDOUT: %.loc13_10: %i32 = block_arg !if.expr.result diff --git a/toolchain/check/testdata/if_expr/constant_condition.carbon b/toolchain/check/testdata/if_expr/constant_condition.carbon index bf544fbb551ea..6c642c3dfcbb5 100644 --- a/toolchain/check/testdata/if_expr/constant_condition.carbon +++ b/toolchain/check/testdata/if_expr/constant_condition.carbon @@ -35,23 +35,21 @@ fn PartiallyConstant(t: type) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %A.type: type = fn_type @A [template] // CHECK:STDOUT: %A: %A.type = struct_value () [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] // CHECK:STDOUT: %B.type: type = fn_type @B [template] // CHECK:STDOUT: %B: %B.type = struct_value () [template] // CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] @@ -70,7 +68,7 @@ fn PartiallyConstant(t: type) -> i32 { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -92,9 +90,7 @@ fn PartiallyConstant(t: type) -> i32 { // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc11_11.2: type = converted %int.make_type_signed, %.loc11_11.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } @@ -103,9 +99,7 @@ fn PartiallyConstant(t: type) -> i32 { // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc12_11.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc12_11.2: type = converted %int.make_type_signed, %.loc12_11.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } @@ -114,9 +108,7 @@ fn PartiallyConstant(t: type) -> i32 { // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc14_11.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc14_11.2: type = converted %int.make_type_signed, %.loc14_11.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } @@ -125,9 +117,7 @@ fn PartiallyConstant(t: type) -> i32 { // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc18_11.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc18_11.2: type = converted %int.make_type_signed, %.loc18_11.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } @@ -136,9 +126,7 @@ fn PartiallyConstant(t: type) -> i32 { // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc22: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc22: init type = call constants.%Int(%int_32.loc22) [template = constants.%i32] -// CHECK:STDOUT: %.loc22_18.1: type = value_of_initializer %int.make_type_signed.loc22 [template = constants.%i32] -// CHECK:STDOUT: %.loc22_18.2: type = converted %int.make_type_signed.loc22, %.loc22_18.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } @@ -149,9 +137,7 @@ fn PartiallyConstant(t: type) -> i32 { // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc28: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc28: init type = call constants.%Int(%int_32.loc28) [template = constants.%i32] -// CHECK:STDOUT: %.loc28_34.1: type = value_of_initializer %int.make_type_signed.loc28 [template = constants.%i32] -// CHECK:STDOUT: %.loc28_34.2: type = converted %int.make_type_signed.loc28, %.loc28_34.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc28: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %t.param: type = value_param runtime_param0 // CHECK:STDOUT: %t: type = bind_name t, %t.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 @@ -162,7 +148,7 @@ fn PartiallyConstant(t: type) -> i32 { // CHECK:STDOUT: fn @A() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1, %impl.elem0 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_1) [template = constants.%int_1.2] @@ -174,7 +160,7 @@ fn PartiallyConstant(t: type) -> i32 { // CHECK:STDOUT: fn @B() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_2, %impl.elem0 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_2) [template = constants.%int_2.2] @@ -238,16 +224,12 @@ fn PartiallyConstant(t: type) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then.loc23: // CHECK:STDOUT: %int_32.loc23_23: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc23_23: init type = call constants.%Int(%int_32.loc23_23) [template = constants.%i32] -// CHECK:STDOUT: %.loc23_23.1: type = value_of_initializer %int.make_type_signed.loc23_23 [template = constants.%i32] -// CHECK:STDOUT: %.loc23_23.2: type = converted %int.make_type_signed.loc23_23, %.loc23_23.1 [template = constants.%i32] -// CHECK:STDOUT: br !if.expr.result.loc23(%.loc23_23.2) +// CHECK:STDOUT: %i32.loc23_23: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: br !if.expr.result.loc23(%i32.loc23_23) // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.else.loc23: // CHECK:STDOUT: %int_32.loc23_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc23_32: init type = call constants.%Int(%int_32.loc23_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc23_35.1: type = value_of_initializer %int.make_type_signed.loc23_32 [template = constants.%i32] -// CHECK:STDOUT: %.loc23_35.2: type = converted %int.make_type_signed.loc23_32, %.loc23_35.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc23_32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %ptr.loc23: type = ptr_type %i32 [template = constants.%ptr] // CHECK:STDOUT: br !if.expr.result.loc23(%ptr.loc23) // CHECK:STDOUT: @@ -256,7 +238,7 @@ fn PartiallyConstant(t: type) -> i32 { // CHECK:STDOUT: %v.var: ref %i32 = var v // CHECK:STDOUT: %v: ref %i32 = bind_name v, %v.var // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1, %impl.elem0 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_1) [template = constants.%int_1.2] @@ -267,21 +249,17 @@ fn PartiallyConstant(t: type) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then.loc24: // CHECK:STDOUT: %int_32.loc24_24: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc24_24: init type = call constants.%Int(%int_32.loc24_24) [template = constants.%i32] -// CHECK:STDOUT: %.loc24_24.1: type = value_of_initializer %int.make_type_signed.loc24_24 [template = constants.%i32] -// CHECK:STDOUT: %.loc24_24.2: type = converted %int.make_type_signed.loc24_24, %.loc24_24.1 [template = constants.%i32] -// CHECK:STDOUT: br !if.expr.result.loc24(%.loc24_24.2) +// CHECK:STDOUT: %i32.loc24_24: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: br !if.expr.result.loc24(%i32.loc24_24) // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.else.loc24: // CHECK:STDOUT: %int_32.loc24_33: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc24_33: init type = call constants.%Int(%int_32.loc24_33) [template = constants.%i32] -// CHECK:STDOUT: %.loc24_36.1: type = value_of_initializer %int.make_type_signed.loc24_33 [template = constants.%i32] -// CHECK:STDOUT: %.loc24_36.2: type = converted %int.make_type_signed.loc24_33, %.loc24_36.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc24_33: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %ptr.loc24: type = ptr_type %i32 [template = constants.%ptr] // CHECK:STDOUT: br !if.expr.result.loc24(%ptr.loc24) // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.result.loc24: -// CHECK:STDOUT: %.loc24_10: type = block_arg !if.expr.result.loc24 [template = constants.%ptr] +// CHECK:STDOUT: %.loc24: type = block_arg !if.expr.result.loc24 [template = constants.%ptr] // CHECK:STDOUT: %w.var: ref %ptr = var w // CHECK:STDOUT: %w: ref %ptr = bind_name w, %w.var // CHECK:STDOUT: %v.ref: ref %i32 = name_ref v, %v @@ -301,10 +279,8 @@ fn PartiallyConstant(t: type) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then.loc29: // CHECK:STDOUT: %int_32.loc29: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc29: init type = call constants.%Int(%int_32.loc29) [template = constants.%i32] -// CHECK:STDOUT: %.loc29_23.1: type = value_of_initializer %int.make_type_signed.loc29 [template = constants.%i32] -// CHECK:STDOUT: %.loc29_23.2: type = converted %int.make_type_signed.loc29, %.loc29_23.1 [template = constants.%i32] -// CHECK:STDOUT: br !if.expr.result.loc29(%.loc29_23.2) +// CHECK:STDOUT: %i32.loc29: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: br !if.expr.result.loc29(%i32.loc29) // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.else.loc29: // CHECK:STDOUT: %t.ref.loc29: type = name_ref t, %t @@ -315,7 +291,7 @@ fn PartiallyConstant(t: type) -> i32 { // CHECK:STDOUT: %v.var: ref %i32 = var v // CHECK:STDOUT: %v: ref %i32 = bind_name v, %v.var // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1, %impl.elem0 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_1) [template = constants.%int_1.2] @@ -330,14 +306,12 @@ fn PartiallyConstant(t: type) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.else.loc30: // CHECK:STDOUT: %int_32.loc30: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc30: init type = call constants.%Int(%int_32.loc30) [template = constants.%i32] -// CHECK:STDOUT: %.loc30_34.1: type = value_of_initializer %int.make_type_signed.loc30 [template = constants.%i32] -// CHECK:STDOUT: %.loc30_34.2: type = converted %int.make_type_signed.loc30, %.loc30_34.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc30: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %ptr: type = ptr_type %i32 [template = constants.%ptr] // CHECK:STDOUT: br !if.expr.result.loc30(%ptr) // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.result.loc30: -// CHECK:STDOUT: %.loc30_10: type = block_arg !if.expr.result.loc30 [template = constants.%ptr] +// CHECK:STDOUT: %.loc30: type = block_arg !if.expr.result.loc30 [template = constants.%ptr] // CHECK:STDOUT: %w.var: ref %ptr = var w // CHECK:STDOUT: %w: ref %ptr = bind_name w, %w.var // CHECK:STDOUT: %v.ref: ref %i32 = name_ref v, %v diff --git a/toolchain/check/testdata/if_expr/control_flow.carbon b/toolchain/check/testdata/if_expr/control_flow.carbon index e7d6500bc3a3b..1e4814a629020 100644 --- a/toolchain/check/testdata/if_expr/control_flow.carbon +++ b/toolchain/check/testdata/if_expr/control_flow.carbon @@ -19,23 +19,21 @@ fn F(b: bool) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %A.type: type = fn_type @A [template] // CHECK:STDOUT: %A: %A.type = struct_value () [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] // CHECK:STDOUT: %B.type: type = fn_type @B [template] // CHECK:STDOUT: %B: %B.type = struct_value () [template] // CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] // CHECK:STDOUT: %Bool.type: type = fn_type @Bool [template] @@ -47,8 +45,8 @@ fn F(b: bool) -> i32 { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 -// CHECK:STDOUT: .Bool = %import_ref.38 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 +// CHECK:STDOUT: .Bool = %import_ref.193 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -67,9 +65,7 @@ fn F(b: bool) -> i32 { // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc11_11.2: type = converted %int.make_type_signed, %.loc11_11.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } @@ -78,9 +74,7 @@ fn F(b: bool) -> i32 { // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc12_11.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc12_11.2: type = converted %int.make_type_signed, %.loc12_11.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } @@ -94,9 +88,7 @@ fn F(b: bool) -> i32 { // CHECK:STDOUT: %.loc14_9.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc14_9.2: type = converted %bool.make_type, %.loc14_9.1 [template = bool] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc14_18.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc14_18.2: type = converted %int.make_type_signed, %.loc14_18.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %b.param: bool = value_param runtime_param0 // CHECK:STDOUT: %b: bool = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 @@ -107,7 +99,7 @@ fn F(b: bool) -> i32 { // CHECK:STDOUT: fn @A() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1, %impl.elem0 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_1) [template = constants.%int_1.2] @@ -119,7 +111,7 @@ fn F(b: bool) -> i32 { // CHECK:STDOUT: fn @B() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_2, %impl.elem0 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_2) [template = constants.%int_2.2] diff --git a/toolchain/check/testdata/if_expr/fail_not_in_function.carbon b/toolchain/check/testdata/if_expr/fail_not_in_function.carbon index f9286638026d1..8c4c3bc09c90e 100644 --- a/toolchain/check/testdata/if_expr/fail_not_in_function.carbon +++ b/toolchain/check/testdata/if_expr/fail_not_in_function.carbon @@ -41,9 +41,7 @@ class C { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %true: bool = bool_literal true [template] // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: } @@ -51,8 +49,8 @@ class C { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 -// CHECK:STDOUT: .Float = %import_ref.38 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 +// CHECK:STDOUT: .Float = %import_ref.193 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -61,14 +59,12 @@ class C { // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = imports.%Core -// CHECK:STDOUT: .x = .inst30.loc23_5 +// CHECK:STDOUT: .x = .inst43.loc23_5 // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc23_8.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc23_8.2: type = converted %int.make_type_signed, %.loc23_8.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: @@ -78,8 +74,8 @@ class C { // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C -// CHECK:STDOUT: .n = .inst387.loc37_8 -// CHECK:STDOUT: complete_type_witness = .inst389.loc38_1 +// CHECK:STDOUT: .n = .inst559.loc37_8 +// CHECK:STDOUT: complete_type_witness = .inst561.loc38_1 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { diff --git a/toolchain/check/testdata/if_expr/fail_partial_constant.carbon b/toolchain/check/testdata/if_expr/fail_partial_constant.carbon index a4ad6f02e4589..55c7e99d6b345 100644 --- a/toolchain/check/testdata/if_expr/fail_partial_constant.carbon +++ b/toolchain/check/testdata/if_expr/fail_partial_constant.carbon @@ -47,9 +47,7 @@ fn ChosenBranchIsNonConstant(t: type) { // CHECK:STDOUT: %ConditionIsNonConstant.type: type = fn_type @ConditionIsNonConstant [template] // CHECK:STDOUT: %ConditionIsNonConstant: %ConditionIsNonConstant.type = struct_value () [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -87,20 +85,16 @@ fn ChosenBranchIsNonConstant(t: type) { // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then: // CHECK:STDOUT: %int_32.loc12_20: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc12_20: init type = call constants.%Int(%int_32.loc12_20) [template = constants.%i32] -// CHECK:STDOUT: %.loc12_20.1: type = value_of_initializer %int.make_type_signed.loc12_20 [template = constants.%i32] -// CHECK:STDOUT: %.loc12_20.2: type = converted %int.make_type_signed.loc12_20, %.loc12_20.1 [template = constants.%i32] -// CHECK:STDOUT: br !if.expr.result(%.loc12_20.2) +// CHECK:STDOUT: %i32.loc12_20: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: br !if.expr.result(%i32.loc12_20) // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.else: // CHECK:STDOUT: %int_32.loc12_29: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc12_29: init type = call constants.%Int(%int_32.loc12_29) [template = constants.%i32] -// CHECK:STDOUT: %.loc12_24.1: type = value_of_initializer %int.make_type_signed.loc12_29 [template = constants.%i32] -// CHECK:STDOUT: %.loc12_24.2: type = converted %int.make_type_signed.loc12_29, %.loc12_24.1 [template = constants.%i32] -// CHECK:STDOUT: br !if.expr.result(%.loc12_24.2) +// CHECK:STDOUT: %i32.loc12_29: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: br !if.expr.result(%i32.loc12_29) // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.result: -// CHECK:STDOUT: %.loc12_10: type = block_arg !if.expr.result +// CHECK:STDOUT: %.loc12: type = block_arg !if.expr.result // CHECK:STDOUT: %v.var: ref = var v // CHECK:STDOUT: %v: ref = bind_name v, %v.var // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1] @@ -115,16 +109,14 @@ fn ChosenBranchIsNonConstant(t: type) { // CHECK:STDOUT: %ChosenBranchIsNonConstant: %ChosenBranchIsNonConstant.type = struct_value () [template] // CHECK:STDOUT: %true: bool = bool_literal true [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %false: bool = bool_literal false [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -156,13 +148,11 @@ fn ChosenBranchIsNonConstant(t: type) { // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.else.loc9: // CHECK:STDOUT: %int_32.loc9: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc9: init type = call constants.%Int(%int_32.loc9) [template = constants.%i32] -// CHECK:STDOUT: %.loc9_25.1: type = value_of_initializer %int.make_type_signed.loc9 [template = constants.%i32] -// CHECK:STDOUT: %.loc9_25.2: type = converted %int.make_type_signed.loc9, %.loc9_25.1 [template = constants.%i32] -// CHECK:STDOUT: br !if.expr.result.loc9(%.loc9_25.2) +// CHECK:STDOUT: %i32.loc9: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: br !if.expr.result.loc9(%i32.loc9) // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.result.loc9: -// CHECK:STDOUT: %.loc9_10: type = block_arg !if.expr.result.loc9 +// CHECK:STDOUT: %.loc9: type = block_arg !if.expr.result.loc9 // CHECK:STDOUT: %v.var: ref = var v // CHECK:STDOUT: %v: ref = bind_name v, %v.var // CHECK:STDOUT: %int_1.loc9: Core.IntLiteral = int_value 1 [template = constants.%int_1] @@ -172,17 +162,15 @@ fn ChosenBranchIsNonConstant(t: type) { // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then.loc13: // CHECK:STDOUT: %int_32.loc13: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc13: init type = call constants.%Int(%int_32.loc13) [template = constants.%i32] -// CHECK:STDOUT: %.loc13_24.1: type = value_of_initializer %int.make_type_signed.loc13 [template = constants.%i32] -// CHECK:STDOUT: %.loc13_24.2: type = converted %int.make_type_signed.loc13, %.loc13_24.1 [template = constants.%i32] -// CHECK:STDOUT: br !if.expr.result.loc13(%.loc13_24.2) +// CHECK:STDOUT: %i32.loc13: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: br !if.expr.result.loc13(%i32.loc13) // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.else.loc13: // CHECK:STDOUT: %t.ref.loc13: type = name_ref t, %t // CHECK:STDOUT: br !if.expr.result.loc13(%t.ref.loc13) // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.result.loc13: -// CHECK:STDOUT: %.loc13_10: type = block_arg !if.expr.result.loc13 +// CHECK:STDOUT: %.loc13: type = block_arg !if.expr.result.loc13 // CHECK:STDOUT: %w.var: ref = var w // CHECK:STDOUT: %w: ref = bind_name w, %w.var // CHECK:STDOUT: %int_1.loc13: Core.IntLiteral = int_value 1 [template = constants.%int_1] diff --git a/toolchain/check/testdata/if_expr/nested.carbon b/toolchain/check/testdata/if_expr/nested.carbon index 025a9e8f18139..c8d5e8fe113ff 100644 --- a/toolchain/check/testdata/if_expr/nested.carbon +++ b/toolchain/check/testdata/if_expr/nested.carbon @@ -18,29 +18,27 @@ fn F(a: bool, b: bool, c: bool) -> i32 { // CHECK:STDOUT: %Bool.type: type = fn_type @Bool [template] // CHECK:STDOUT: %Bool: %Bool.type = struct_value () [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] // CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] // CHECK:STDOUT: %int_3.1: Core.IntLiteral = int_value 3 [template] -// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_3.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_3.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_3.2: %i32 = int_value 3 [template] // CHECK:STDOUT: %int_4.1: Core.IntLiteral = int_value 4 [template] -// CHECK:STDOUT: %Convert.bound.4: = bound_method %int_4.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.4: = bound_method %int_4.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.4: = specific_function %Convert.bound.4, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_4.2: %i32 = int_value 4 [template] // CHECK:STDOUT: } @@ -49,7 +47,7 @@ fn F(a: bool, b: bool, c: bool) -> i32 { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Bool = %import_ref.1 // CHECK:STDOUT: .Int = %import_ref.2 -// CHECK:STDOUT: .ImplicitAs = %import_ref.3 +// CHECK:STDOUT: .ImplicitAs = %import_ref.6 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -81,9 +79,7 @@ fn F(a: bool, b: bool, c: bool) -> i32 { // CHECK:STDOUT: %.loc11_27.1: type = value_of_initializer %bool.make_type.loc11_27 [template = bool] // CHECK:STDOUT: %.loc11_27.2: type = converted %bool.make_type.loc11_27, %.loc11_27.1 [template = bool] // CHECK:STDOUT: %int_32.loc11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11: init type = call constants.%Int(%int_32.loc11) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_36.1: type = value_of_initializer %int.make_type_signed.loc11 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_36.2: type = converted %int.make_type_signed.loc11, %.loc11_36.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: bool = value_param runtime_param0 // CHECK:STDOUT: %a: bool = bind_name a, %a.param // CHECK:STDOUT: %b.param: bool = value_param runtime_param1 @@ -107,20 +103,18 @@ fn F(a: bool, b: bool, c: bool) -> i32 { // CHECK:STDOUT: !if.expr.then.loc12_20: // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_32.loc12_25: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc12_25: init type = call constants.%Int(%int_32.loc12_25) [template = constants.%i32] -// CHECK:STDOUT: %.loc12_25.1: type = value_of_initializer %int.make_type_signed.loc12_25 [template = constants.%i32] -// CHECK:STDOUT: %.loc12_25.2: type = converted %int.make_type_signed.loc12_25, %.loc12_25.1 [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc12_25: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %i32.loc12_25: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %impl.elem0.loc12_25: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc12_25: = bound_method %int_1, %impl.elem0.loc12_25 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc12_25: = specific_function %Convert.bound.loc12_25, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc12_25: init %i32 = call %Convert.specific_fn.loc12_25(%int_1) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc12_25.3: %i32 = value_of_initializer %int.convert_checked.loc12_25 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc12_25.4: %i32 = converted %int_1, %.loc12_25.3 [template = constants.%int_1.2] -// CHECK:STDOUT: br !if.expr.result.loc12_20(%.loc12_25.4) +// CHECK:STDOUT: %.loc12_25.1: %i32 = value_of_initializer %int.convert_checked.loc12_25 [template = constants.%int_1.2] +// CHECK:STDOUT: %.loc12_25.2: %i32 = converted %int_1, %.loc12_25.1 [template = constants.%int_1.2] +// CHECK:STDOUT: br !if.expr.result.loc12_20(%.loc12_25.2) // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.else.loc12_20: // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %impl.elem0.loc12_32: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc12_32: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc12_32: = bound_method %int_2, %impl.elem0.loc12_32 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc12_32: = specific_function %Convert.bound.loc12_32, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc12_32: init %i32 = call %Convert.specific_fn.loc12_32(%int_2) [template = constants.%int_2.2] @@ -139,20 +133,18 @@ fn F(a: bool, b: bool, c: bool) -> i32 { // CHECK:STDOUT: !if.expr.then.loc12_44: // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] // CHECK:STDOUT: %int_32.loc12_49: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc12_49: init type = call constants.%Int(%int_32.loc12_49) [template = constants.%i32] -// CHECK:STDOUT: %.loc12_49.1: type = value_of_initializer %int.make_type_signed.loc12_49 [template = constants.%i32] -// CHECK:STDOUT: %.loc12_49.2: type = converted %int.make_type_signed.loc12_49, %.loc12_49.1 [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc12_49: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %i32.loc12_49: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %impl.elem0.loc12_49: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc12_49: = bound_method %int_3, %impl.elem0.loc12_49 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc12_49: = specific_function %Convert.bound.loc12_49, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc12_49: init %i32 = call %Convert.specific_fn.loc12_49(%int_3) [template = constants.%int_3.2] -// CHECK:STDOUT: %.loc12_49.3: %i32 = value_of_initializer %int.convert_checked.loc12_49 [template = constants.%int_3.2] -// CHECK:STDOUT: %.loc12_49.4: %i32 = converted %int_3, %.loc12_49.3 [template = constants.%int_3.2] -// CHECK:STDOUT: br !if.expr.result.loc12_44(%.loc12_49.4) +// CHECK:STDOUT: %.loc12_49.1: %i32 = value_of_initializer %int.convert_checked.loc12_49 [template = constants.%int_3.2] +// CHECK:STDOUT: %.loc12_49.2: %i32 = converted %int_3, %.loc12_49.1 [template = constants.%int_3.2] +// CHECK:STDOUT: br !if.expr.result.loc12_44(%.loc12_49.2) // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.else.loc12_44: // CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [template = constants.%int_4.1] -// CHECK:STDOUT: %impl.elem0.loc12_56: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc12_56: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc12_56: = bound_method %int_4, %impl.elem0.loc12_56 [template = constants.%Convert.bound.4] // CHECK:STDOUT: %Convert.specific_fn.loc12_56: = specific_function %Convert.bound.loc12_56, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.4] // CHECK:STDOUT: %int.convert_checked.loc12_56: init %i32 = call %Convert.specific_fn.loc12_56(%int_4) [template = constants.%int_4.2] diff --git a/toolchain/check/testdata/if_expr/struct.carbon b/toolchain/check/testdata/if_expr/struct.carbon index fee0c4d19a68b..55583e3ee9558 100644 --- a/toolchain/check/testdata/if_expr/struct.carbon +++ b/toolchain/check/testdata/if_expr/struct.carbon @@ -19,10 +19,8 @@ fn F(cond: bool) { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %struct_type.a.b.1: type = struct_type {.a: %i32, .b: %i32} [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] @@ -34,13 +32,13 @@ fn F(cond: bool) { // CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %struct_type.a.b.2: type = struct_type {.a: Core.IntLiteral, .b: Core.IntLiteral} [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] // CHECK:STDOUT: %struct: %struct_type.a.b.1 = struct_value (%int_1.2, %int_2.2) [template] @@ -49,8 +47,8 @@ fn F(cond: bool) { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .Bool = %import_ref.2 -// CHECK:STDOUT: .ImplicitAs = %import_ref.3 +// CHECK:STDOUT: .Bool = %import_ref.5 +// CHECK:STDOUT: .ImplicitAs = %import_ref.6 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -68,13 +66,9 @@ fn F(cond: bool) { // CHECK:STDOUT: %s.param_patt: %struct_type.a.b.1 = value_param_pattern %s.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc11_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11_14: init type = call constants.%Int(%int_32.loc11_14) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_14.1: type = value_of_initializer %int.make_type_signed.loc11_14 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_14.2: type = converted %int.make_type_signed.loc11_14, %.loc11_14.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc11_14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc11_23: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11_23: init type = call constants.%Int(%int_32.loc11_23) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_23.1: type = value_of_initializer %int.make_type_signed.loc11_23 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_23.2: type = converted %int.make_type_signed.loc11_23, %.loc11_23.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc11_23: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %struct_type.a.b: type = struct_type {.a: %i32, .b: %i32} [template = constants.%struct_type.a.b.1] // CHECK:STDOUT: %s.param: %struct_type.a.b.1 = value_param runtime_param0 // CHECK:STDOUT: %s: %struct_type.a.b.1 = bind_name s, %s.param @@ -96,27 +90,23 @@ fn F(cond: bool) { // CHECK:STDOUT: fn @F(%cond.param_patt: bool) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_32.loc14_15: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc14_15: init type = call constants.%Int(%int_32.loc14_15) [template = constants.%i32] -// CHECK:STDOUT: %.loc14_15.1: type = value_of_initializer %int.make_type_signed.loc14_15 [template = constants.%i32] -// CHECK:STDOUT: %.loc14_15.2: type = converted %int.make_type_signed.loc14_15, %.loc14_15.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc14_15: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc14_24: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc14_24: init type = call constants.%Int(%int_32.loc14_24) [template = constants.%i32] -// CHECK:STDOUT: %.loc14_24.1: type = value_of_initializer %int.make_type_signed.loc14_24 [template = constants.%i32] -// CHECK:STDOUT: %.loc14_24.2: type = converted %int.make_type_signed.loc14_24, %.loc14_24.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc14_24: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %struct_type.a.b: type = struct_type {.a: %i32, .b: %i32} [template = constants.%struct_type.a.b.1] // CHECK:STDOUT: %a.var: ref %struct_type.a.b.1 = var a // CHECK:STDOUT: %a: ref %struct_type.a.b.1 = bind_name a, %a.var // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %.loc14_46.1: %struct_type.a.b.2 = struct_literal (%int_1, %int_2) -// CHECK:STDOUT: %impl.elem0.loc14_46.1: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc14_46.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc14_46.1: = bound_method %int_1, %impl.elem0.loc14_46.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc14_46.1: = specific_function %Convert.bound.loc14_46.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc14_46.1: init %i32 = call %Convert.specific_fn.loc14_46.1(%int_1) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc14_46.2: init %i32 = converted %int_1, %int.convert_checked.loc14_46.1 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc14_46.3: ref %i32 = struct_access %a.var, element0 // CHECK:STDOUT: %.loc14_46.4: init %i32 = initialize_from %.loc14_46.2 to %.loc14_46.3 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc14_46.2: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc14_46.2: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc14_46.2: = bound_method %int_2, %impl.elem0.loc14_46.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc14_46.2: = specific_function %Convert.bound.loc14_46.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc14_46.2: init %i32 = call %Convert.specific_fn.loc14_46.2(%int_2) [template = constants.%int_2.2] diff --git a/toolchain/check/testdata/impl/compound.carbon b/toolchain/check/testdata/impl/compound.carbon index 99273abeec6ba..4f6fa015cb592 100644 --- a/toolchain/check/testdata/impl/compound.carbon +++ b/toolchain/check/testdata/impl/compound.carbon @@ -38,27 +38,25 @@ fn InstanceCallIndirect(p: i32*) { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %Simple.type: type = facet_type <@Simple> [template] -// CHECK:STDOUT: %Self: %Simple.type = bind_symbolic_name Self, 0 [symbolic] +// CHECK:STDOUT: %Self.1: %Simple.type = bind_symbolic_name Self, 0 [symbolic] // CHECK:STDOUT: %F.type.1: type = fn_type @F.1 [template] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template] // CHECK:STDOUT: %F.1: %F.type.1 = struct_value () [template] // CHECK:STDOUT: %F.assoc_type: type = assoc_entity_type %Simple.type, %F.type.1 [template] -// CHECK:STDOUT: %assoc0: %F.assoc_type = assoc_entity element0, @Simple.%F.decl [template] -// CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic] +// CHECK:STDOUT: %assoc0.1: %F.assoc_type = assoc_entity element0, @Simple.%F.decl [template] +// CHECK:STDOUT: %Self.as_type.1: type = facet_access_type %Self.1 [symbolic] // CHECK:STDOUT: %G.type.1: type = fn_type @G.1 [template] // CHECK:STDOUT: %G.1: %G.type.1 = struct_value () [template] // CHECK:STDOUT: %G.assoc_type: type = assoc_entity_type %Simple.type, %G.type.1 [template] // CHECK:STDOUT: %assoc1: %G.assoc_type = assoc_entity element1, @Simple.%G.decl [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %F.type.2: type = fn_type @F.2 [template] // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [template] // CHECK:STDOUT: %G.type.2: type = fn_type @G.2 [template] // CHECK:STDOUT: %G.2: %G.type.2 = struct_value () [template] // CHECK:STDOUT: %Simple.facet: %Simple.type = facet_value %i32, %i32 [template] -// CHECK:STDOUT: %interface: = interface_witness (%F.2, %G.2) [template] +// CHECK:STDOUT: %interface.1: = interface_witness (%F.2, %G.2) [template] // CHECK:STDOUT: %NonInstanceCall.type: type = fn_type @NonInstanceCall [template] // CHECK:STDOUT: %NonInstanceCall: %NonInstanceCall.type = struct_value () [template] // CHECK:STDOUT: %InstanceCall.type: type = fn_type @InstanceCall [template] @@ -72,7 +70,7 @@ fn InstanceCallIndirect(p: i32*) { // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -89,11 +87,9 @@ fn InstanceCallIndirect(p: i32*) { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Simple.decl: type = interface_decl @Simple [template = constants.%Simple.type] {} {} -// CHECK:STDOUT: impl_decl @impl [template] {} { +// CHECK:STDOUT: impl_decl @impl.1 [template] {} { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc16_6.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc16_6.2: type = converted %int.make_type_signed, %.loc16_6.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %Simple.ref: type = name_ref Simple, file.%Simple.decl [template = constants.%Simple.type] // CHECK:STDOUT: } // CHECK:STDOUT: %NonInstanceCall.decl: %NonInstanceCall.type = fn_decl @NonInstanceCall [template = constants.%NonInstanceCall] { @@ -101,9 +97,7 @@ fn InstanceCallIndirect(p: i32*) { // CHECK:STDOUT: %n.param_patt: %i32 = value_param_pattern %n.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc21_23.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc21_23.2: type = converted %int.make_type_signed, %.loc21_23.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %n.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %n: %i32 = bind_name n, %n.param // CHECK:STDOUT: } @@ -112,9 +106,7 @@ fn InstanceCallIndirect(p: i32*) { // CHECK:STDOUT: %n.param_patt: %i32 = value_param_pattern %n.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc25_20.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc25_20.2: type = converted %int.make_type_signed, %.loc25_20.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %n.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %n: %i32 = bind_name n, %n.param // CHECK:STDOUT: } @@ -123,9 +115,7 @@ fn InstanceCallIndirect(p: i32*) { // CHECK:STDOUT: %p.param_patt: %ptr = value_param_pattern %p.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc29_34.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc29_34.2: type = converted %int.make_type_signed, %.loc29_34.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %ptr: type = ptr_type %i32 [template = constants.%ptr] // CHECK:STDOUT: %p.param: %ptr = value_param runtime_param0 // CHECK:STDOUT: %p: %ptr = bind_name p, %p.param @@ -135,9 +125,7 @@ fn InstanceCallIndirect(p: i32*) { // CHECK:STDOUT: %p.param_patt: %ptr = value_param_pattern %p.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc33_31.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc33_31.2: type = converted %int.make_type_signed, %.loc33_31.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %ptr: type = ptr_type %i32 [template = constants.%ptr] // CHECK:STDOUT: %p.param: %ptr = value_param runtime_param0 // CHECK:STDOUT: %p: %ptr = bind_name p, %p.param @@ -145,18 +133,18 @@ fn InstanceCallIndirect(p: i32*) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @Simple { -// CHECK:STDOUT: %Self: %Simple.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self] +// CHECK:STDOUT: %Self: %Simple.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.1] // CHECK:STDOUT: %F.decl: %F.type.1 = fn_decl @F.1 [template = constants.%F.1] {} {} -// CHECK:STDOUT: %assoc0: %F.assoc_type = assoc_entity element0, %F.decl [template = constants.%assoc0] +// CHECK:STDOUT: %assoc0: %F.assoc_type = assoc_entity element0, %F.decl [template = constants.%assoc0.1] // CHECK:STDOUT: %G.decl: %G.type.1 = fn_decl @G.1 [template = constants.%G.1] { -// CHECK:STDOUT: %self.patt: @G.1.%Self.as_type.loc13_14.1 (%Self.as_type) = binding_pattern self -// CHECK:STDOUT: %self.param_patt: @G.1.%Self.as_type.loc13_14.1 (%Self.as_type) = value_param_pattern %self.patt, runtime_param0 +// CHECK:STDOUT: %self.patt: @G.1.%Self.as_type.loc13_14.1 (%Self.as_type.1) = binding_pattern self +// CHECK:STDOUT: %self.param_patt: @G.1.%Self.as_type.loc13_14.1 (%Self.as_type.1) = value_param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref: %Simple.type = name_ref Self, @Simple.%Self [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %Self.as_type.loc13_14.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc13_14.1 (constants.%Self.as_type)] -// CHECK:STDOUT: %.loc13: type = converted %Self.ref, %Self.as_type.loc13_14.2 [symbolic = %Self.as_type.loc13_14.1 (constants.%Self.as_type)] -// CHECK:STDOUT: %self.param: @G.1.%Self.as_type.loc13_14.1 (%Self.as_type) = value_param runtime_param0 -// CHECK:STDOUT: %self: @G.1.%Self.as_type.loc13_14.1 (%Self.as_type) = bind_name self, %self.param +// CHECK:STDOUT: %Self.ref: %Simple.type = name_ref Self, @Simple.%Self [symbolic = %Self (constants.%Self.1)] +// CHECK:STDOUT: %Self.as_type.loc13_14.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc13_14.1 (constants.%Self.as_type.1)] +// CHECK:STDOUT: %.loc13: type = converted %Self.ref, %Self.as_type.loc13_14.2 [symbolic = %Self.as_type.loc13_14.1 (constants.%Self.as_type.1)] +// CHECK:STDOUT: %self.param: @G.1.%Self.as_type.loc13_14.1 (%Self.as_type.1) = value_param runtime_param0 +// CHECK:STDOUT: %self: @G.1.%Self.as_type.loc13_14.1 (%Self.as_type.1) = bind_name self, %self.param // CHECK:STDOUT: } // CHECK:STDOUT: %assoc1: %G.assoc_type = assoc_entity element1, %G.decl [template = constants.%assoc1] // CHECK:STDOUT: @@ -167,20 +155,18 @@ fn InstanceCallIndirect(p: i32*) { // CHECK:STDOUT: witness = (%F.decl, %G.decl) // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl: %.loc16_6.2 as %Simple.ref { +// CHECK:STDOUT: impl @impl.1: %i32 as %Simple.ref { // CHECK:STDOUT: %F.decl: %F.type.2 = fn_decl @F.2 [template = constants.%F.2] {} {} // CHECK:STDOUT: %G.decl: %G.type.2 = fn_decl @G.2 [template = constants.%G.2] { // CHECK:STDOUT: %self.patt: %i32 = binding_pattern self // CHECK:STDOUT: %self.param_patt: %i32 = value_param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc18_14.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc18_14.2: type = converted %int.make_type_signed, %.loc18_14.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %self.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %self: %i32 = bind_name self, %self.param // CHECK:STDOUT: } -// CHECK:STDOUT: %interface: = interface_witness (%F.decl, %G.decl) [template = constants.%interface] +// CHECK:STDOUT: %interface: = interface_witness (%F.decl, %G.decl) [template = constants.%interface.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %F.decl @@ -194,10 +180,10 @@ fn InstanceCallIndirect(p: i32*) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @G.1(@Simple.%Self: %Simple.type) { -// CHECK:STDOUT: %Self: %Simple.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %Self.as_type.loc13_14.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc13_14.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %Self: %Simple.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.1)] +// CHECK:STDOUT: %Self.as_type.loc13_14.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc13_14.1 (constants.%Self.as_type.1)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: @G.1.%Self.as_type.loc13_14.1 (%Self.as_type)](); +// CHECK:STDOUT: fn[%self.param_patt: @G.1.%Self.as_type.loc13_14.1 (%Self.as_type.1)](); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F.2(); @@ -208,8 +194,8 @@ fn InstanceCallIndirect(p: i32*) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %n.ref: %i32 = name_ref n, %n // CHECK:STDOUT: %Simple.ref: type = name_ref Simple, file.%Simple.decl [template = constants.%Simple.type] -// CHECK:STDOUT: %F.ref: %F.assoc_type = name_ref F, @Simple.%assoc0 [template = constants.%assoc0] -// CHECK:STDOUT: %impl.elem0: %F.type.1 = interface_witness_access constants.%interface, element0 [template = constants.%F.2] +// CHECK:STDOUT: %F.ref: %F.assoc_type = name_ref F, @Simple.%assoc0 [template = constants.%assoc0.1] +// CHECK:STDOUT: %impl.elem0: %F.type.1 = interface_witness_access constants.%interface.1, element0 [template = constants.%F.2] // CHECK:STDOUT: %F.call: init %empty_tuple.type = call %impl.elem0() // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -219,7 +205,7 @@ fn InstanceCallIndirect(p: i32*) { // CHECK:STDOUT: %n.ref: %i32 = name_ref n, %n // CHECK:STDOUT: %Simple.ref: type = name_ref Simple, file.%Simple.decl [template = constants.%Simple.type] // CHECK:STDOUT: %G.ref: %G.assoc_type = name_ref G, @Simple.%assoc1 [template = constants.%assoc1] -// CHECK:STDOUT: %impl.elem1: %G.type.1 = interface_witness_access constants.%interface, element1 [template = constants.%G.2] +// CHECK:STDOUT: %impl.elem1: %G.type.1 = interface_witness_access constants.%interface.1, element1 [template = constants.%G.2] // CHECK:STDOUT: %G.bound: = bound_method %n.ref, %impl.elem1 // CHECK:STDOUT: %G.call: init %empty_tuple.type = call %G.bound(%n.ref) // CHECK:STDOUT: return @@ -229,9 +215,9 @@ fn InstanceCallIndirect(p: i32*) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %p.ref: %ptr = name_ref p, %p // CHECK:STDOUT: %Simple.ref: type = name_ref Simple, file.%Simple.decl [template = constants.%Simple.type] -// CHECK:STDOUT: %F.ref: %F.assoc_type = name_ref F, @Simple.%assoc0 [template = constants.%assoc0] +// CHECK:STDOUT: %F.ref: %F.assoc_type = name_ref F, @Simple.%assoc0 [template = constants.%assoc0.1] // CHECK:STDOUT: %.loc30: ref %i32 = deref %p.ref -// CHECK:STDOUT: %impl.elem0: %F.type.1 = interface_witness_access constants.%interface, element0 [template = constants.%F.2] +// CHECK:STDOUT: %impl.elem0: %F.type.1 = interface_witness_access constants.%interface.1, element0 [template = constants.%F.2] // CHECK:STDOUT: %F.call: init %empty_tuple.type = call %impl.elem0() // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -242,18 +228,18 @@ fn InstanceCallIndirect(p: i32*) { // CHECK:STDOUT: %Simple.ref: type = name_ref Simple, file.%Simple.decl [template = constants.%Simple.type] // CHECK:STDOUT: %G.ref: %G.assoc_type = name_ref G, @Simple.%assoc1 [template = constants.%assoc1] // CHECK:STDOUT: %.loc34_4.1: ref %i32 = deref %p.ref -// CHECK:STDOUT: %impl.elem1: %G.type.1 = interface_witness_access constants.%interface, element1 [template = constants.%G.2] +// CHECK:STDOUT: %impl.elem1: %G.type.1 = interface_witness_access constants.%interface.1, element1 [template = constants.%G.2] // CHECK:STDOUT: %G.bound: = bound_method %.loc34_4.1, %impl.elem1 // CHECK:STDOUT: %.loc34_4.2: %i32 = bind_value %.loc34_4.1 // CHECK:STDOUT: %G.call: init %empty_tuple.type = call %G.bound(%.loc34_4.2) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @F.1(constants.%Self) {} +// CHECK:STDOUT: specific @F.1(constants.%Self.1) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @G.1(constants.%Self) { -// CHECK:STDOUT: %Self => constants.%Self -// CHECK:STDOUT: %Self.as_type.loc13_14.1 => constants.%Self.as_type +// CHECK:STDOUT: specific @G.1(constants.%Self.1) { +// CHECK:STDOUT: %Self => constants.%Self.1 +// CHECK:STDOUT: %Self.as_type.loc13_14.1 => constants.%Self.as_type.1 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F.1(constants.%Simple.facet) {} diff --git a/toolchain/check/testdata/impl/declaration.carbon b/toolchain/check/testdata/impl/declaration.carbon index 74eef971916a3..5447e66bcbf00 100644 --- a/toolchain/check/testdata/impl/declaration.carbon +++ b/toolchain/check/testdata/impl/declaration.carbon @@ -18,14 +18,12 @@ impl i32 as I; // CHECK:STDOUT: %I.type: type = facet_type <@I> [template] // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -40,9 +38,7 @@ impl i32 as I; // CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%I.type] {} {} // CHECK:STDOUT: impl_decl @impl [template] {} { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc13_6.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc13_6.2: type = converted %int.make_type_signed, %.loc13_6.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%I.type] // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -55,5 +51,5 @@ impl i32 as I; // CHECK:STDOUT: witness = () // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl: %.loc13_6.2 as %I.ref; +// CHECK:STDOUT: impl @impl: %i32 as %I.ref; // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/empty.carbon b/toolchain/check/testdata/impl/empty.carbon index 41161997c5b6c..320a541133182 100644 --- a/toolchain/check/testdata/impl/empty.carbon +++ b/toolchain/check/testdata/impl/empty.carbon @@ -20,15 +20,13 @@ impl i32 as Empty { // CHECK:STDOUT: %Empty.type: type = facet_type <@Empty> [template] // CHECK:STDOUT: %Self: %Empty.type = bind_symbolic_name Self, 0 [symbolic] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %interface: = interface_witness () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -43,9 +41,7 @@ impl i32 as Empty { // CHECK:STDOUT: %Empty.decl: type = interface_decl @Empty [template = constants.%Empty.type] {} {} // CHECK:STDOUT: impl_decl @impl [template] {} { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc14_6.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc14_6.2: type = converted %int.make_type_signed, %.loc14_6.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %Empty.ref: type = name_ref Empty, file.%Empty.decl [template = constants.%Empty.type] // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -58,7 +54,7 @@ impl i32 as Empty { // CHECK:STDOUT: witness = () // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl: %.loc14_6.2 as %Empty.ref { +// CHECK:STDOUT: impl @impl: %i32 as %Empty.ref { // CHECK:STDOUT: %interface: = interface_witness () [template = constants.%interface] // CHECK:STDOUT: // CHECK:STDOUT: !members: diff --git a/toolchain/check/testdata/impl/extend_impl_generic.carbon b/toolchain/check/testdata/impl/extend_impl_generic.carbon index 121ab9fe35c0d..93af6ffbb2779 100644 --- a/toolchain/check/testdata/impl/extend_impl_generic.carbon +++ b/toolchain/check/testdata/impl/extend_impl_generic.carbon @@ -62,12 +62,10 @@ class X(U:! type) { // CHECK:STDOUT: %assoc0.1: %F.assoc_type.1 = assoc_entity element0, @HasF.%F.decl [symbolic] // CHECK:STDOUT: %Param: type = class_type @Param [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %Param.elem: type = unbound_element_type %Param, %i32 [template] // CHECK:STDOUT: %struct_type.x.1: type = struct_type {.x: %i32} [template] -// CHECK:STDOUT: %complete_type.1: = complete_type_witness %struct_type.x.1 [template] +// CHECK:STDOUT: %complete_type.3: = complete_type_witness %struct_type.x.1 [template] // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %HasF.type.3: type = facet_type <@HasF, @HasF(%Param)> [template] // CHECK:STDOUT: %F.type.2: type = fn_type @F.1, @HasF(%Param) [template] @@ -79,14 +77,14 @@ class X(U:! type) { // CHECK:STDOUT: %HasF.facet: %HasF.type.2 = facet_value %C, %C [symbolic] // CHECK:STDOUT: %interface.1: = interface_witness (%F.3) [template] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] -// CHECK:STDOUT: %complete_type.2: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %complete_type.4: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %struct_type.x.2: type = struct_type {.x: Core.IntLiteral} [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.2(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.10: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_2.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.2(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.6: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound: = bound_method %int_2.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] // CHECK:STDOUT: %Param.val: %Param = struct_value (%int_2.2) [template] @@ -97,7 +95,7 @@ class X(U:! type) { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -180,15 +178,13 @@ class X(U:! type) { // CHECK:STDOUT: // CHECK:STDOUT: class @Param { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc9_10.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc9_10.2: type = converted %int.make_type_signed, %.loc9_10.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc9_8: %Param.elem = field_decl x, element0 [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.x.1 [template = constants.%complete_type.1] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc9: %Param.elem = field_decl x, element0 [template] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.x.1 [template = constants.%complete_type.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Param -// CHECK:STDOUT: .x = %.loc9_8 +// CHECK:STDOUT: .x = %.loc9 // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } // CHECK:STDOUT: @@ -199,7 +195,7 @@ class X(U:! type) { // CHECK:STDOUT: %Param.ref: type = name_ref Param, file.%Param.decl [template = constants.%Param] // CHECK:STDOUT: %HasF.type: type = facet_type <@HasF, @HasF(constants.%Param)> [template = constants.%HasF.type.3] // CHECK:STDOUT: } -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.2] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C @@ -217,7 +213,7 @@ class X(U:! type) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %.loc15_21.1: %struct_type.x.2 = struct_literal (%int_2) -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.10, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.6, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_2, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_2) [template = constants.%int_2.2] @@ -232,9 +228,7 @@ class X(U:! type) { // CHECK:STDOUT: fn @G(%c.param_patt: %C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_32.loc21: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc21: init type = call constants.%Int(%int_32.loc21) [template = constants.%i32] -// CHECK:STDOUT: %.loc21_10.1: type = value_of_initializer %int.make_type_signed.loc21 [template = constants.%i32] -// CHECK:STDOUT: %.loc21_10.2: type = converted %int.make_type_signed.loc21, %.loc21_10.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc21: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %C.ref.loc21: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %.loc21_17: %F.assoc_type.2 = specific_constant @HasF.%assoc0.loc5_14.1, @HasF(constants.%Param) [template = constants.%assoc0.2] // CHECK:STDOUT: %F.ref.loc21: %F.assoc_type.2 = name_ref F, %.loc21_17 [template = constants.%assoc0.2] @@ -242,14 +236,12 @@ class X(U:! type) { // CHECK:STDOUT: %.loc21_20.1: ref %Param = temporary_storage // CHECK:STDOUT: %F.call.loc21: init %Param = call %impl.elem0.loc21() to %.loc21_20.1 // CHECK:STDOUT: %.loc21_20.2: ref %Param = temporary %.loc21_20.1, %F.call.loc21 -// CHECK:STDOUT: %x.ref.loc21: %Param.elem = name_ref x, @Param.%.loc9_8 [template = @Param.%.loc9_8] +// CHECK:STDOUT: %x.ref.loc21: %Param.elem = name_ref x, @Param.%.loc9 [template = @Param.%.loc9] // CHECK:STDOUT: %.loc21_21.1: ref %i32 = class_element_access %.loc21_20.2, element0 // CHECK:STDOUT: %.loc21_21.2: %i32 = bind_value %.loc21_21.1 // CHECK:STDOUT: %a: %i32 = bind_name a, %.loc21_21.2 // CHECK:STDOUT: %int_32.loc22: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc22: init type = call constants.%Int(%int_32.loc22) [template = constants.%i32] -// CHECK:STDOUT: %.loc22_10.1: type = value_of_initializer %int.make_type_signed.loc22 [template = constants.%i32] -// CHECK:STDOUT: %.loc22_10.2: type = converted %int.make_type_signed.loc22, %.loc22_10.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %b.var: ref %i32 = var b // CHECK:STDOUT: %b: ref %i32 = bind_name b, %b.var // CHECK:STDOUT: %c.ref: %C = name_ref c, %c @@ -259,7 +251,7 @@ class X(U:! type) { // CHECK:STDOUT: %.loc22_20.1: ref %Param = temporary_storage // CHECK:STDOUT: %F.call.loc22: init %Param = call %impl.elem0.loc22() to %.loc22_20.1 // CHECK:STDOUT: %.loc22_20.2: ref %Param = temporary %.loc22_20.1, %F.call.loc22 -// CHECK:STDOUT: %x.ref.loc22: %Param.elem = name_ref x, @Param.%.loc9_8 [template = @Param.%.loc9_8] +// CHECK:STDOUT: %x.ref.loc22: %Param.elem = name_ref x, @Param.%.loc9 [template = @Param.%.loc9] // CHECK:STDOUT: %.loc22_21.1: ref %i32 = class_element_access %.loc22_20.2, element0 // CHECK:STDOUT: %.loc22_21.2: %i32 = bind_value %.loc22_21.1 // CHECK:STDOUT: assign %b.var, %.loc22_21.2 diff --git a/toolchain/check/testdata/impl/fail_call_invalid.carbon b/toolchain/check/testdata/impl/fail_call_invalid.carbon index 8cea59c234464..c145cada11d07 100644 --- a/toolchain/check/testdata/impl/fail_call_invalid.carbon +++ b/toolchain/check/testdata/impl/fail_call_invalid.carbon @@ -27,16 +27,14 @@ fn InstanceCall(n: i32) { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %Simple.type: type = facet_type <@Simple> [template] -// CHECK:STDOUT: %Self: %Simple.type = bind_symbolic_name Self, 0 [symbolic] -// CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic] +// CHECK:STDOUT: %Self.1: %Simple.type = bind_symbolic_name Self, 0 [symbolic] +// CHECK:STDOUT: %Self.as_type.1: type = facet_access_type %Self.1 [symbolic] // CHECK:STDOUT: %G.type.1: type = fn_type @G.1 [template] // CHECK:STDOUT: %G.1: %G.type.1 = struct_value () [template] // CHECK:STDOUT: %G.assoc_type: type = assoc_entity_type %Simple.type, %G.type.1 [template] -// CHECK:STDOUT: %assoc0: %G.assoc_type = assoc_entity element0, @Simple.%G.decl [template] +// CHECK:STDOUT: %assoc0.1: %G.assoc_type = assoc_entity element0, @Simple.%G.decl [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %G.type.2: type = fn_type @G.2 [template] // CHECK:STDOUT: %G.2: %G.type.2 = struct_value () [template] // CHECK:STDOUT: %Simple.facet: %Simple.type = facet_value %i32, %i32 [template] @@ -46,7 +44,7 @@ fn InstanceCall(n: i32) { // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -60,11 +58,9 @@ fn InstanceCall(n: i32) { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Simple.decl: type = interface_decl @Simple [template = constants.%Simple.type] {} {} -// CHECK:STDOUT: impl_decl @impl [template] {} { +// CHECK:STDOUT: impl_decl @impl.1 [template] {} { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc15_6.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc15_6.2: type = converted %int.make_type_signed, %.loc15_6.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %Simple.ref: type = name_ref Simple, file.%Simple.decl [template = constants.%Simple.type] // CHECK:STDOUT: } // CHECK:STDOUT: %InstanceCall.decl: %InstanceCall.type = fn_decl @InstanceCall [template = constants.%InstanceCall] { @@ -72,27 +68,25 @@ fn InstanceCall(n: i32) { // CHECK:STDOUT: %n.param_patt: %i32 = value_param_pattern %n.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc22_20.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc22_20.2: type = converted %int.make_type_signed, %.loc22_20.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %n.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %n: %i32 = bind_name n, %n.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @Simple { -// CHECK:STDOUT: %Self: %Simple.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self] +// CHECK:STDOUT: %Self: %Simple.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.1] // CHECK:STDOUT: %G.decl: %G.type.1 = fn_decl @G.1 [template = constants.%G.1] { -// CHECK:STDOUT: %self.patt: @G.1.%Self.as_type.loc12_14.1 (%Self.as_type) = binding_pattern self -// CHECK:STDOUT: %self.param_patt: @G.1.%Self.as_type.loc12_14.1 (%Self.as_type) = value_param_pattern %self.patt, runtime_param0 +// CHECK:STDOUT: %self.patt: @G.1.%Self.as_type.loc12_14.1 (%Self.as_type.1) = binding_pattern self +// CHECK:STDOUT: %self.param_patt: @G.1.%Self.as_type.loc12_14.1 (%Self.as_type.1) = value_param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref: %Simple.type = name_ref Self, @Simple.%Self [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %Self.as_type.loc12_14.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc12_14.1 (constants.%Self.as_type)] -// CHECK:STDOUT: %.loc12: type = converted %Self.ref, %Self.as_type.loc12_14.2 [symbolic = %Self.as_type.loc12_14.1 (constants.%Self.as_type)] -// CHECK:STDOUT: %self.param: @G.1.%Self.as_type.loc12_14.1 (%Self.as_type) = value_param runtime_param0 -// CHECK:STDOUT: %self: @G.1.%Self.as_type.loc12_14.1 (%Self.as_type) = bind_name self, %self.param +// CHECK:STDOUT: %Self.ref: %Simple.type = name_ref Self, @Simple.%Self [symbolic = %Self (constants.%Self.1)] +// CHECK:STDOUT: %Self.as_type.loc12_14.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc12_14.1 (constants.%Self.as_type.1)] +// CHECK:STDOUT: %.loc12: type = converted %Self.ref, %Self.as_type.loc12_14.2 [symbolic = %Self.as_type.loc12_14.1 (constants.%Self.as_type.1)] +// CHECK:STDOUT: %self.param: @G.1.%Self.as_type.loc12_14.1 (%Self.as_type.1) = value_param runtime_param0 +// CHECK:STDOUT: %self: @G.1.%Self.as_type.loc12_14.1 (%Self.as_type.1) = bind_name self, %self.param // CHECK:STDOUT: } -// CHECK:STDOUT: %assoc0: %G.assoc_type = assoc_entity element0, %G.decl [template = constants.%assoc0] +// CHECK:STDOUT: %assoc0: %G.assoc_type = assoc_entity element0, %G.decl [template = constants.%assoc0.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = %Self @@ -100,7 +94,7 @@ fn InstanceCall(n: i32) { // CHECK:STDOUT: witness = (%G.decl) // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl: %.loc15_6.2 as %Simple.ref { +// CHECK:STDOUT: impl @impl.1: %i32 as %Simple.ref { // CHECK:STDOUT: %G.decl: %G.type.2 = fn_decl @G.2 [template = constants.%G.2] { // CHECK:STDOUT: %self.patt: = binding_pattern self // CHECK:STDOUT: %self.param_patt: = value_param_pattern %self.patt, runtime_param0 @@ -117,10 +111,10 @@ fn InstanceCall(n: i32) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @G.1(@Simple.%Self: %Simple.type) { -// CHECK:STDOUT: %Self: %Simple.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %Self.as_type.loc12_14.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc12_14.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %Self: %Simple.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.1)] +// CHECK:STDOUT: %Self.as_type.loc12_14.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc12_14.1 (constants.%Self.as_type.1)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: @G.1.%Self.as_type.loc12_14.1 (%Self.as_type)](); +// CHECK:STDOUT: fn[%self.param_patt: @G.1.%Self.as_type.loc12_14.1 (%Self.as_type.1)](); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @G.2[%self.param_patt: ](); @@ -129,15 +123,15 @@ fn InstanceCall(n: i32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %n.ref: %i32 = name_ref n, %n // CHECK:STDOUT: %Simple.ref: type = name_ref Simple, file.%Simple.decl [template = constants.%Simple.type] -// CHECK:STDOUT: %G.ref: %G.assoc_type = name_ref G, @Simple.%assoc0 [template = constants.%assoc0] +// CHECK:STDOUT: %G.ref: %G.assoc_type = name_ref G, @Simple.%assoc0 [template = constants.%assoc0.1] // CHECK:STDOUT: %impl.elem0: %G.type.1 = interface_witness_access , element0 [template = ] // CHECK:STDOUT: %G.bound: = bound_method %n.ref, %impl.elem0 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @G.1(constants.%Self) { -// CHECK:STDOUT: %Self => constants.%Self -// CHECK:STDOUT: %Self.as_type.loc12_14.1 => constants.%Self.as_type +// CHECK:STDOUT: specific @G.1(constants.%Self.1) { +// CHECK:STDOUT: %Self => constants.%Self.1 +// CHECK:STDOUT: %Self.as_type.loc12_14.1 => constants.%Self.as_type.1 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @G.1(constants.%Simple.facet) { diff --git a/toolchain/check/testdata/impl/fail_extend_impl_scope.carbon b/toolchain/check/testdata/impl/fail_extend_impl_scope.carbon index a8b085e0931e2..49164232a411d 100644 --- a/toolchain/check/testdata/impl/fail_extend_impl_scope.carbon +++ b/toolchain/check/testdata/impl/fail_extend_impl_scope.carbon @@ -21,15 +21,13 @@ extend impl i32 as I {} // CHECK:STDOUT: %I.type: type = facet_type <@I> [template] // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %interface: = interface_witness () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -44,9 +42,7 @@ extend impl i32 as I {} // CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%I.type] {} {} // CHECK:STDOUT: impl_decl @impl [template] {} { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc16_13.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc16_13.2: type = converted %int.make_type_signed, %.loc16_13.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%I.type] // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -59,7 +55,7 @@ extend impl i32 as I {} // CHECK:STDOUT: witness = () // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl: %.loc16_13.2 as %I.ref { +// CHECK:STDOUT: impl @impl: %i32 as %I.ref { // CHECK:STDOUT: %interface: = interface_witness () [template = constants.%interface] // CHECK:STDOUT: // CHECK:STDOUT: !members: diff --git a/toolchain/check/testdata/impl/fail_extend_impl_type_as.carbon b/toolchain/check/testdata/impl/fail_extend_impl_type_as.carbon index 482e58d07fff2..d91519cdd77fe 100644 --- a/toolchain/check/testdata/impl/fail_extend_impl_type_as.carbon +++ b/toolchain/check/testdata/impl/fail_extend_impl_type_as.carbon @@ -46,19 +46,17 @@ class E { // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic] // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %interface: = interface_witness () [template] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %complete_type.2: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %D: type = class_type @D [template] // CHECK:STDOUT: %E: type = class_type @E [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -87,7 +85,7 @@ class E { // CHECK:STDOUT: witness = () // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.1: %.loc18_15.2 as %I.ref { +// CHECK:STDOUT: impl @impl.1: %i32 as %I.ref { // CHECK:STDOUT: %interface: = interface_witness () [template = constants.%interface] // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -106,12 +104,10 @@ class E { // CHECK:STDOUT: class @C { // CHECK:STDOUT: impl_decl @impl.1 [template] {} { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc18_15.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc18_15.2: type = converted %int.make_type_signed, %.loc18_15.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%I.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.2] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C @@ -124,7 +120,7 @@ class E { // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [template = constants.%D] // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%I.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.2] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%D @@ -137,7 +133,7 @@ class E { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%E [template = constants.%E] // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%I.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.2] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%E diff --git a/toolchain/check/testdata/impl/fail_extend_non_interface.carbon b/toolchain/check/testdata/impl/fail_extend_non_interface.carbon index 6267201553d56..0fce8555f4062 100644 --- a/toolchain/check/testdata/impl/fail_extend_non_interface.carbon +++ b/toolchain/check/testdata/impl/fail_extend_non_interface.carbon @@ -20,16 +20,14 @@ class C { // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %complete_type.2: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -44,17 +42,15 @@ class C { // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl: %Self.ref as @C.%.loc15_18.2; +// CHECK:STDOUT: impl @impl: %Self.ref as %i32; // CHECK:STDOUT: // CHECK:STDOUT: class @C { -// CHECK:STDOUT: %.loc15_18.1: type = value_of_initializer @impl.%int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc15_18.2: type = converted @impl.%int.make_type_signed, %.loc15_18.1 [template = constants.%i32] // CHECK:STDOUT: impl_decl @impl [template] {} { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C [template = constants.%C] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: } -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.2] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C diff --git a/toolchain/check/testdata/impl/fail_impl_bad_assoc_fn.carbon b/toolchain/check/testdata/impl/fail_impl_bad_assoc_fn.carbon index af6d29d9c9dfc..642aa9c32ebab 100644 --- a/toolchain/check/testdata/impl/fail_impl_bad_assoc_fn.carbon +++ b/toolchain/check/testdata/impl/fail_impl_bad_assoc_fn.carbon @@ -224,7 +224,7 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %assoc0.1: %F.assoc_type.1 = assoc_entity element0, @I.%F.decl [template] // CHECK:STDOUT: %NoF: type = class_type @NoF [template] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %complete_type.1: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %FNotFunction: type = class_type @FNotFunction [template] // CHECK:STDOUT: %F.2: type = class_type @F.16 [template] // CHECK:STDOUT: %PossiblyF.type: type = fn_type @PossiblyF [template] @@ -283,9 +283,7 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self.3 [symbolic] // CHECK:STDOUT: %ptr.1: type = ptr_type %Self.as_type [symbolic] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %struct_type.x.y.1: type = struct_type {.x: %Self.as_type, .y: %i32} [symbolic] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (type, type) [template] // CHECK:STDOUT: %tuple.type.2: type = tuple_type (%ptr.1, %struct_type.x.y.1) [symbolic] @@ -430,9 +428,7 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %Self.as_type.loc188_24: type = facet_access_type %Self.ref.loc188_24 [symbolic = %Self.as_type.loc188_16.1 (constants.%Self.as_type)] // CHECK:STDOUT: %.loc188_24: type = converted %Self.ref.loc188_24, %Self.as_type.loc188_24 [symbolic = %Self.as_type.loc188_16.1 (constants.%Self.as_type)] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc188_34.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc188_34.2: type = converted %int.make_type_signed, %.loc188_34.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %struct_type.x.y.loc188_37.2: type = struct_type {.x: %Self.as_type, .y: %i32} [symbolic = %struct_type.x.y.loc188_37.1 (constants.%struct_type.x.y.1)] // CHECK:STDOUT: %.loc188_38.1: %tuple.type.1 = tuple_literal (%ptr.loc188_16.2, %struct_type.x.y.loc188_37.2) // CHECK:STDOUT: %.loc188_38.2: type = converted %.loc188_38.1, constants.%tuple.type.2 [symbolic = %tuple.type (constants.%tuple.type.2)] @@ -739,13 +735,9 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %SelfNestedBadParam.ref.loc200_14: type = name_ref SelfNestedBadParam, file.%SelfNestedBadParam.decl [template = constants.%SelfNestedBadParam] // CHECK:STDOUT: %ptr: type = ptr_type %SelfNestedBadParam [template = constants.%ptr.2] // CHECK:STDOUT: %int_32.loc200_40: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc200_40: init type = call constants.%Int(%int_32.loc200_40) [template = constants.%i32] -// CHECK:STDOUT: %.loc200_40.1: type = value_of_initializer %int.make_type_signed.loc200_40 [template = constants.%i32] -// CHECK:STDOUT: %.loc200_40.2: type = converted %int.make_type_signed.loc200_40, %.loc200_40.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc200_40: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc200_49: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc200_49: init type = call constants.%Int(%int_32.loc200_49) [template = constants.%i32] -// CHECK:STDOUT: %.loc200_49.1: type = value_of_initializer %int.make_type_signed.loc200_49 [template = constants.%i32] -// CHECK:STDOUT: %.loc200_49.2: type = converted %int.make_type_signed.loc200_49, %.loc200_49.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc200_49: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %struct_type.x.y: type = struct_type {.x: %i32, .y: %i32} [template = constants.%struct_type.x.y.2] // CHECK:STDOUT: %.loc200_53.1: %tuple.type.1 = tuple_literal (%ptr, %struct_type.x.y) // CHECK:STDOUT: %.loc200_53.2: type = converted %.loc200_53.1, constants.%tuple.type.3 [template = constants.%tuple.type.3] @@ -775,9 +767,7 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %ptr: type = ptr_type %SelfNestedBadReturnType [template = constants.%ptr.3] // CHECK:STDOUT: %SelfNestedBadReturnType.ref.loc212_45: type = name_ref SelfNestedBadReturnType, file.%SelfNestedBadReturnType.decl [template = constants.%SelfNestedBadReturnType] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc212_74.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc212_74.2: type = converted %int.make_type_signed, %.loc212_74.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %struct_type.x.y: type = struct_type {.x: %SelfNestedBadReturnType, .y: %i32} [template = constants.%struct_type.x.y.4] // CHECK:STDOUT: %.loc212_78.1: %tuple.type.1 = tuple_literal (%ptr, %struct_type.x.y) // CHECK:STDOUT: %.loc212_78.2: type = converted %.loc212_78.1, constants.%tuple.type.5 [template = constants.%tuple.type.5] @@ -801,7 +791,7 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%NoF [template = constants.%NoF] // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%I.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%NoF @@ -813,7 +803,7 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%FNotFunction [template = constants.%FNotFunction] // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%I.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%FNotFunction @@ -827,7 +817,7 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%FAlias [template = constants.%FAlias] // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%I.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%FAlias @@ -839,7 +829,7 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%FExtraParam [template = constants.%FExtraParam] // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%I.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%FExtraParam @@ -851,7 +841,7 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%FExtraImplicitParam [template = constants.%FExtraImplicitParam] // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%I.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%FExtraImplicitParam @@ -863,7 +853,7 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%FExtraReturnType [template = constants.%FExtraReturnType] // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%I.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%FExtraReturnType @@ -875,7 +865,7 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%FMissingParam [template = constants.%FMissingParam] // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [template = constants.%J.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%FMissingParam @@ -887,7 +877,7 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%FMissingImplicitParam [template = constants.%FMissingImplicitParam] // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [template = constants.%J.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%FMissingImplicitParam @@ -899,7 +889,7 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%FMissingReturnType [template = constants.%FMissingReturnType] // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [template = constants.%J.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%FMissingReturnType @@ -911,7 +901,7 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%FDifferentParamType [template = constants.%FDifferentParamType] // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [template = constants.%J.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%FDifferentParamType @@ -923,7 +913,7 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%FDifferentImplicitParamType [template = constants.%FDifferentImplicitParamType] // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [template = constants.%J.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%FDifferentImplicitParamType @@ -935,7 +925,7 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%FDifferentReturnType [template = constants.%FDifferentReturnType] // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [template = constants.%J.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%FDifferentReturnType @@ -947,7 +937,7 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%FDifferentParamName [template = constants.%FDifferentParamName] // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [template = constants.%J.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%FDifferentParamName @@ -959,7 +949,7 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%SelfNestedBadParam [template = constants.%SelfNestedBadParam] // CHECK:STDOUT: %SelfNested.ref: type = name_ref SelfNested, file.%SelfNested.decl [template = constants.%SelfNested.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%SelfNestedBadParam @@ -971,7 +961,7 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%SelfNestedBadReturnType [template = constants.%SelfNestedBadReturnType] // CHECK:STDOUT: %SelfNested.ref: type = name_ref SelfNested, file.%SelfNested.decl [template = constants.%SelfNested.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%SelfNestedBadReturnType diff --git a/toolchain/check/testdata/impl/fail_impl_bad_interface.carbon b/toolchain/check/testdata/impl/fail_impl_bad_interface.carbon index da50bddc369bd..ccdd469256dff 100644 --- a/toolchain/check/testdata/impl/fail_impl_bad_interface.carbon +++ b/toolchain/check/testdata/impl/fail_impl_bad_interface.carbon @@ -47,16 +47,14 @@ impl f64 as type where .Self impls type {} // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %false: bool = bool_literal false [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -67,17 +65,15 @@ impl f64 as type where .Self impls type {} // CHECK:STDOUT: .Core = imports.%Core // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %.loc11: type = converted @impl.9.%false, [template = ] -// CHECK:STDOUT: impl_decl @impl.9 [template] {} { +// CHECK:STDOUT: %.loc11: type = converted @impl.%false, [template = ] +// CHECK:STDOUT: impl_decl @impl [template] {} { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_6.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc11_6.2: type = converted %int.make_type_signed, %.loc11_6.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %false: bool = bool_literal false [template = constants.%false] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.9: %.loc11_6.2 as { +// CHECK:STDOUT: impl @impl: %i32 as { // CHECK:STDOUT: !members: // CHECK:STDOUT: witness = // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/impl/fail_redefinition.carbon b/toolchain/check/testdata/impl/fail_redefinition.carbon index 31465dd4c68d2..3de08eae5367c 100644 --- a/toolchain/check/testdata/impl/fail_redefinition.carbon +++ b/toolchain/check/testdata/impl/fail_redefinition.carbon @@ -26,14 +26,12 @@ impl i32 as I {} // CHECK:STDOUT: %I.type: type = facet_type <@I> [template] // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -48,16 +46,12 @@ impl i32 as I {} // CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%I.type] {} {} // CHECK:STDOUT: impl_decl @impl [template] {} { // CHECK:STDOUT: %int_32.loc13: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc13: init type = call constants.%Int(%int_32.loc13) [template = constants.%i32] -// CHECK:STDOUT: %.loc13_6.1: type = value_of_initializer %int.make_type_signed.loc13 [template = constants.%i32] -// CHECK:STDOUT: %.loc13_6.2: type = converted %int.make_type_signed.loc13, %.loc13_6.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc13: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %I.ref.loc13: type = name_ref I, file.%I.decl [template = constants.%I.type] // CHECK:STDOUT: } // CHECK:STDOUT: impl_decl @impl [template] {} { // CHECK:STDOUT: %int_32.loc21: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc21: init type = call constants.%Int(%int_32.loc21) [template = constants.%i32] -// CHECK:STDOUT: %.loc21_6.1: type = value_of_initializer %int.make_type_signed.loc21 [template = constants.%i32] -// CHECK:STDOUT: %.loc21_6.2: type = converted %int.make_type_signed.loc21, %.loc21_6.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc21: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %I.ref.loc21: type = name_ref I, file.%I.decl [template = constants.%I.type] // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -70,8 +64,8 @@ impl i32 as I {} // CHECK:STDOUT: witness = () // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl: %.loc13_6.2 as %I.ref.loc13 { +// CHECK:STDOUT: impl @impl: %i32.loc13 as %I.ref.loc13 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = .inst36.loc13_15 +// CHECK:STDOUT: witness = .inst47.loc13_15 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/fail_self_type_mismatch.carbon b/toolchain/check/testdata/impl/fail_self_type_mismatch.carbon index becddd56aede7..1a72c72aea832 100644 --- a/toolchain/check/testdata/impl/fail_self_type_mismatch.carbon +++ b/toolchain/check/testdata/impl/fail_self_type_mismatch.carbon @@ -35,7 +35,7 @@ impl i32 as I { // CHECK:STDOUT: %C.generic: %C.type = struct_value () [template] // CHECK:STDOUT: %C.1: type = class_type @C, @C(%T, %X) [symbolic] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %complete_type.1: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %I.type: type = facet_type <@I> [template] // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic] // CHECK:STDOUT: %C.2: type = class_type @C, @C(%I.type, %Self) [symbolic] @@ -44,9 +44,7 @@ impl i32 as I { // CHECK:STDOUT: %F.assoc_type: type = assoc_entity_type %I.type, %F.type.1 [template] // CHECK:STDOUT: %assoc0: %F.assoc_type = assoc_entity element0, @I.%F.decl [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %C.3: type = class_type @C, @C(type, %i32) [template] // CHECK:STDOUT: %F.type.2: type = fn_type @F.2 [template] // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [template] @@ -56,7 +54,7 @@ impl i32 as I { // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -84,9 +82,7 @@ impl i32 as I { // CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%I.type] {} {} // CHECK:STDOUT: impl_decl @impl [template] {} { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc17_6.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc17_6.2: type = converted %int.make_type_signed, %.loc17_6.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%I.type] // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -111,14 +107,14 @@ impl i32 as I { // CHECK:STDOUT: witness = (%F.decl) // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl: %.loc17_6.2 as %I.ref { +// CHECK:STDOUT: impl @impl: %i32 as %I.ref { // CHECK:STDOUT: %F.decl: %F.type.2 = fn_decl @F.2 [template = constants.%F.2] { // CHECK:STDOUT: %c.patt: %C.3 = binding_pattern c // CHECK:STDOUT: %c.param_patt: %C.3 = value_param_pattern %c.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [template = constants.%C.generic] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %C: type = class_type @C, @C(type, constants.%i32) [template = constants.%C.3] // CHECK:STDOUT: %c.param: %C.3 = value_param runtime_param0 // CHECK:STDOUT: %c: %C.3 = bind_name c, %c.param @@ -139,7 +135,7 @@ impl i32 as I { // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: class { -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C.1 diff --git a/toolchain/check/testdata/impl/lookup/fail_todo_undefined_impl.carbon b/toolchain/check/testdata/impl/lookup/fail_todo_undefined_impl.carbon index 9c7bb2a8cc202..156aec97460f6 100644 --- a/toolchain/check/testdata/impl/lookup/fail_todo_undefined_impl.carbon +++ b/toolchain/check/testdata/impl/lookup/fail_todo_undefined_impl.carbon @@ -39,11 +39,9 @@ impl C as I { // CHECK:STDOUT: %assoc0: %F.assoc_type = assoc_entity element0, @I.%F.decl [template] // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %complete_type.1: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %F.type.2: type = fn_type @F.2 [template] // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [template] // CHECK:STDOUT: %F.type.3: type = fn_type @F.3 [template] @@ -54,7 +52,7 @@ impl C as I { // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -75,9 +73,7 @@ impl C as I { // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc19_11.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc19_11.2: type = converted %int.make_type_signed, %.loc19_11.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } @@ -114,7 +110,7 @@ impl C as I { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C [template = constants.%C] // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%I.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C diff --git a/toolchain/check/testdata/impl/lookup/instance_method.carbon b/toolchain/check/testdata/impl/lookup/instance_method.carbon index 9f02d677e9956..0bcaab9d74225 100644 --- a/toolchain/check/testdata/impl/lookup/instance_method.carbon +++ b/toolchain/check/testdata/impl/lookup/instance_method.carbon @@ -32,9 +32,7 @@ fn F(c: C) -> i32 { // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic] // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %F.type.1: type = fn_type @F.1 [template] // CHECK:STDOUT: %F.1: %F.type.1 = struct_value () [template] // CHECK:STDOUT: %F.assoc_type: type = assoc_entity_type %I.type, %F.type.1 [template] @@ -44,14 +42,14 @@ fn F(c: C) -> i32 { // CHECK:STDOUT: %I.facet: %I.type = facet_value %C, %C [template] // CHECK:STDOUT: %interface: = interface_witness (%F.2) [template] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %complete_type.2: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %F.type.3: type = fn_type @F.3 [template] // CHECK:STDOUT: %F.3: %F.type.3 = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -76,9 +74,7 @@ fn F(c: C) -> i32 { // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl.loc11 [template = constants.%C] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc23_15.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc23_15.2: type = converted %int.make_type_signed, %.loc23_15.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %c.param: %C = value_param runtime_param0 // CHECK:STDOUT: %c: %C = bind_name c, %c.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 @@ -96,11 +92,9 @@ fn F(c: C) -> i32 { // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref: %I.type = name_ref Self, @I.%Self [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: %Self.as_type.loc14_14.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc14_14.1 (constants.%Self.as_type)] -// CHECK:STDOUT: %.loc14_14: type = converted %Self.ref, %Self.as_type.loc14_14.2 [symbolic = %Self.as_type.loc14_14.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %.loc14: type = converted %Self.ref, %Self.as_type.loc14_14.2 [symbolic = %Self.as_type.loc14_14.1 (constants.%Self.as_type)] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc14_25.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc14_25.2: type = converted %int.make_type_signed, %.loc14_25.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %self.param: @F.1.%Self.as_type.loc14_14.1 (%Self.as_type) = value_param runtime_param0 // CHECK:STDOUT: %self: @F.1.%Self.as_type.loc14_14.1 (%Self.as_type) = bind_name self, %self.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 @@ -123,9 +117,7 @@ fn F(c: C) -> i32 { // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C [template = constants.%C] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc19_27.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc19_27.2: type = converted %int.make_type_signed, %.loc19_27.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %self.param: %C = value_param runtime_param0 // CHECK:STDOUT: %self: %C = bind_name self, %self.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 @@ -143,7 +135,7 @@ fn F(c: C) -> i32 { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C [template = constants.%C] // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%I.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.2] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C diff --git a/toolchain/check/testdata/impl/redeclaration.carbon b/toolchain/check/testdata/impl/redeclaration.carbon index aef05939bd1e5..1c21ddb968604 100644 --- a/toolchain/check/testdata/impl/redeclaration.carbon +++ b/toolchain/check/testdata/impl/redeclaration.carbon @@ -24,18 +24,16 @@ impl i32 as I {} // CHECK:STDOUT: %I.type: type = facet_type <@I> [template] // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %X: type = class_type @X [template] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %complete_type.2: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %interface: = interface_witness () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -51,17 +49,13 @@ impl i32 as I {} // CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%I.type] {} {} // CHECK:STDOUT: impl_decl @impl.1 [template] {} { // CHECK:STDOUT: %int_32.loc13: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc13: init type = call constants.%Int(%int_32.loc13) [template = constants.%i32] -// CHECK:STDOUT: %.loc13_6.1: type = value_of_initializer %int.make_type_signed.loc13 [template = constants.%i32] -// CHECK:STDOUT: %.loc13_6.2: type = converted %int.make_type_signed.loc13, %.loc13_6.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc13: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %I.ref.loc13: type = name_ref I, file.%I.decl [template = constants.%I.type] // CHECK:STDOUT: } // CHECK:STDOUT: %X.decl: type = class_decl @X [template = constants.%X] {} {} // CHECK:STDOUT: impl_decl @impl.2 [template] {} { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc19_6.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc19_6.2: type = converted %int.make_type_signed, %.loc19_6.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%I.type] // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -74,9 +68,9 @@ impl i32 as I {} // CHECK:STDOUT: witness = () // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.1: %.loc13_6.2 as %I.ref.loc13; +// CHECK:STDOUT: impl @impl.1: %i32.loc13 as %I.ref.loc13; // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.2: %.loc19_6.2 as %I.ref { +// CHECK:STDOUT: impl @impl.2: %i32 as %I.ref { // CHECK:STDOUT: %interface: = interface_witness () [template = constants.%interface] // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -86,12 +80,10 @@ impl i32 as I {} // CHECK:STDOUT: class @X { // CHECK:STDOUT: impl_decl @impl.1 [template] {} { // CHECK:STDOUT: %int_32.loc16: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc16: init type = call constants.%Int(%int_32.loc16) [template = constants.%i32] -// CHECK:STDOUT: %.loc16_8.1: type = value_of_initializer %int.make_type_signed.loc16 [template = constants.%i32] -// CHECK:STDOUT: %.loc16_8.2: type = converted %int.make_type_signed.loc16, %.loc16_8.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc16: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %I.ref.loc16: type = name_ref I, file.%I.decl [template = constants.%I.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.2] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%X diff --git a/toolchain/check/testdata/index/array_element_access.carbon b/toolchain/check/testdata/index/array_element_access.carbon index 9f6f29da36eff..b712a43989a52 100644 --- a/toolchain/check/testdata/index/array_element_access.carbon +++ b/toolchain/check/testdata/index/array_element_access.carbon @@ -17,9 +17,7 @@ var d: i32 = a[b]; // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %array_type: type = array_type %int_2, %i32 [template] // CHECK:STDOUT: %int_12.1: Core.IntLiteral = int_value 12 [template] @@ -27,21 +25,21 @@ var d: i32 = a[b]; // CHECK:STDOUT: %tuple.type: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [template] // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_12.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_12.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_12.2: %i32 = int_value 12 [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_24.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_24.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_24.2: %i32 = int_value 24 [template] // CHECK:STDOUT: %array: %array_type = tuple_value (%int_12.2, %int_24.2) [template] -// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] -// CHECK:STDOUT: %Convert.bound.4: = bound_method %int_0.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.4: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.4: = specific_function %Convert.bound.4, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] // CHECK:STDOUT: } @@ -49,7 +47,7 @@ var d: i32 = a[b]; // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -65,29 +63,21 @@ var d: i32 = a[b]; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int_32.loc11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11: init type = call constants.%Int(%int_32.loc11) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2] -// CHECK:STDOUT: %.loc11_9.1: type = value_of_initializer %int.make_type_signed.loc11 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_9.2: type = converted %int.make_type_signed.loc11, %.loc11_9.1 [template = constants.%i32] // CHECK:STDOUT: %array_type: type = array_type %int_2, %i32 [template = constants.%array_type] // CHECK:STDOUT: %a.var: ref %array_type = var a // CHECK:STDOUT: %a: ref %array_type = bind_name a, %a.var // CHECK:STDOUT: %int_32.loc12: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc12: init type = call constants.%Int(%int_32.loc12) [template = constants.%i32] -// CHECK:STDOUT: %.loc12_8.1: type = value_of_initializer %int.make_type_signed.loc12 [template = constants.%i32] -// CHECK:STDOUT: %.loc12_8.2: type = converted %int.make_type_signed.loc12, %.loc12_8.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc12: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %b.var: ref %i32 = var b // CHECK:STDOUT: %b: ref %i32 = bind_name b, %b.var // CHECK:STDOUT: %int_32.loc13: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc13: init type = call constants.%Int(%int_32.loc13) [template = constants.%i32] -// CHECK:STDOUT: %.loc13_8.1: type = value_of_initializer %int.make_type_signed.loc13 [template = constants.%i32] -// CHECK:STDOUT: %.loc13_8.2: type = converted %int.make_type_signed.loc13, %.loc13_8.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc13: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %c.var: ref %i32 = var c // CHECK:STDOUT: %c: ref %i32 = bind_name c, %c.var // CHECK:STDOUT: %int_32.loc14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc14: init type = call constants.%Int(%int_32.loc14) [template = constants.%i32] -// CHECK:STDOUT: %.loc14_8.1: type = value_of_initializer %int.make_type_signed.loc14 [template = constants.%i32] -// CHECK:STDOUT: %.loc14_8.2: type = converted %int.make_type_signed.loc14, %.loc14_8.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %d.var: ref %i32 = var d // CHECK:STDOUT: %d: ref %i32 = bind_name d, %d.var // CHECK:STDOUT: } @@ -97,7 +87,7 @@ var d: i32 = a[b]; // CHECK:STDOUT: %int_12: Core.IntLiteral = int_value 12 [template = constants.%int_12.1] // CHECK:STDOUT: %int_24: Core.IntLiteral = int_value 24 [template = constants.%int_24.1] // CHECK:STDOUT: %.loc11_26.1: %tuple.type = tuple_literal (%int_12, %int_24) -// CHECK:STDOUT: %impl.elem0.loc11_26.1: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc11_26.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_26.1: = bound_method %int_12, %impl.elem0.loc11_26.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc11_26.1: = specific_function %Convert.bound.loc11_26.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc11_26.1: init %i32 = call %Convert.specific_fn.loc11_26.1(%int_12) [template = constants.%int_12.2] @@ -105,7 +95,7 @@ var d: i32 = a[b]; // CHECK:STDOUT: %int_0.loc11: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %.loc11_26.3: ref %i32 = array_index file.%a.var, %int_0.loc11 // CHECK:STDOUT: %.loc11_26.4: init %i32 = initialize_from %.loc11_26.2 to %.loc11_26.3 [template = constants.%int_12.2] -// CHECK:STDOUT: %impl.elem0.loc11_26.2: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc11_26.2: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_26.2: = bound_method %int_24, %impl.elem0.loc11_26.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc11_26.2: = specific_function %Convert.bound.loc11_26.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc11_26.2: init %i32 = call %Convert.specific_fn.loc11_26.2(%int_24) [template = constants.%int_24.2] @@ -117,7 +107,7 @@ var d: i32 = a[b]; // CHECK:STDOUT: %.loc11_27: init %array_type = converted %.loc11_26.1, %.loc11_26.8 [template = constants.%array] // CHECK:STDOUT: assign file.%a.var, %.loc11_27 // CHECK:STDOUT: %int_1.loc12: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc12: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc12: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc12: = bound_method %int_1.loc12, %impl.elem0.loc12 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc12: = specific_function %Convert.bound.loc12, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc12: init %i32 = call %Convert.specific_fn.loc12(%int_1.loc12) [template = constants.%int_1.2] @@ -126,28 +116,24 @@ var d: i32 = a[b]; // CHECK:STDOUT: %a.ref.loc13: ref %array_type = name_ref a, file.%a // CHECK:STDOUT: %int_0.loc13: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %int_32.loc13: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc13: init type = call constants.%Int(%int_32.loc13) [template = constants.%i32] -// CHECK:STDOUT: %.loc13_17.1: type = value_of_initializer %int.make_type_signed.loc13 [template = constants.%i32] -// CHECK:STDOUT: %.loc13_17.2: type = converted %int.make_type_signed.loc13, %.loc13_17.1 [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc13: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %i32.loc13: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %impl.elem0.loc13: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc13: = bound_method %int_0.loc13, %impl.elem0.loc13 [template = constants.%Convert.bound.4] // CHECK:STDOUT: %Convert.specific_fn.loc13: = specific_function %Convert.bound.loc13, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.4] // CHECK:STDOUT: %int.convert_checked.loc13: init %i32 = call %Convert.specific_fn.loc13(%int_0.loc13) [template = constants.%int_0.2] // CHECK:STDOUT: %.loc13_16.1: %i32 = value_of_initializer %int.convert_checked.loc13 [template = constants.%int_0.2] // CHECK:STDOUT: %.loc13_16.2: %i32 = converted %int_0.loc13, %.loc13_16.1 [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc13_17.3: ref %i32 = array_index %a.ref.loc13, %.loc13_16.2 -// CHECK:STDOUT: %.loc13_17.4: %i32 = bind_value %.loc13_17.3 -// CHECK:STDOUT: assign file.%c.var, %.loc13_17.4 +// CHECK:STDOUT: %.loc13_17.1: ref %i32 = array_index %a.ref.loc13, %.loc13_16.2 +// CHECK:STDOUT: %.loc13_17.2: %i32 = bind_value %.loc13_17.1 +// CHECK:STDOUT: assign file.%c.var, %.loc13_17.2 // CHECK:STDOUT: %a.ref.loc14: ref %array_type = name_ref a, file.%a // CHECK:STDOUT: %b.ref: ref %i32 = name_ref b, file.%b // CHECK:STDOUT: %int_32.loc14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc14: init type = call constants.%Int(%int_32.loc14) [template = constants.%i32] -// CHECK:STDOUT: %.loc14_17.1: type = value_of_initializer %int.make_type_signed.loc14 [template = constants.%i32] -// CHECK:STDOUT: %.loc14_17.2: type = converted %int.make_type_signed.loc14, %.loc14_17.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc14_16: %i32 = bind_value %b.ref -// CHECK:STDOUT: %.loc14_17.3: ref %i32 = array_index %a.ref.loc14, %.loc14_16 -// CHECK:STDOUT: %.loc14_17.4: %i32 = bind_value %.loc14_17.3 -// CHECK:STDOUT: assign file.%d.var, %.loc14_17.4 +// CHECK:STDOUT: %.loc14_17.1: ref %i32 = array_index %a.ref.loc14, %.loc14_16 +// CHECK:STDOUT: %.loc14_17.2: %i32 = bind_value %.loc14_17.1 +// CHECK:STDOUT: assign file.%d.var, %.loc14_17.2 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/index/expr_category.carbon b/toolchain/check/testdata/index/expr_category.carbon index 655f932d31f40..c3cf079c78ac1 100644 --- a/toolchain/check/testdata/index/expr_category.carbon +++ b/toolchain/check/testdata/index/expr_category.carbon @@ -32,9 +32,7 @@ fn ValueBinding(b: [i32; 3]) { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %int_3.1: Core.IntLiteral = int_value 3 [template] // CHECK:STDOUT: %array_type: type = array_type %int_3.1, %i32 [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] @@ -46,25 +44,25 @@ fn ValueBinding(b: [i32; 3]) { // CHECK:STDOUT: %tuple.type: type = tuple_type (Core.IntLiteral, Core.IntLiteral, Core.IntLiteral) [template] // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] -// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_3.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_3.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_3.2: %i32 = int_value 3 [template] // CHECK:STDOUT: %array: %array_type = tuple_value (%int_1.2, %int_2.2, %int_3.2) [template] // CHECK:STDOUT: %ptr.2: type = ptr_type %i32 [template] -// CHECK:STDOUT: %Convert.bound.4: = bound_method %int_0.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.4: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.4: = specific_function %Convert.bound.4, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] // CHECK:STDOUT: %int_4.1: Core.IntLiteral = int_value 4 [template] -// CHECK:STDOUT: %Convert.bound.5: = bound_method %int_4.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.5: = bound_method %int_4.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.5: = specific_function %Convert.bound.5, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_4.2: %i32 = int_value 4 [template] // CHECK:STDOUT: %ValueBinding.type: type = fn_type @ValueBinding [template] @@ -74,7 +72,7 @@ fn ValueBinding(b: [i32; 3]) { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -93,10 +91,8 @@ fn ValueBinding(b: [i32; 3]) { // CHECK:STDOUT: %return.param_patt: %array_type = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] -// CHECK:STDOUT: %.loc11_12.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc11_12.2: type = converted %int.make_type_signed, %.loc11_12.1 [template = constants.%i32] // CHECK:STDOUT: %array_type: type = array_type %int_3, %i32 [template = constants.%array_type] // CHECK:STDOUT: %return.param: ref %array_type = out_param runtime_param0 // CHECK:STDOUT: %return: ref %array_type = return_slot %return.param @@ -106,10 +102,8 @@ fn ValueBinding(b: [i32; 3]) { // CHECK:STDOUT: %b.param_patt: %array_type = value_param_pattern %b.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc13: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc13: init type = call constants.%Int(%int_32.loc13) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc13: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_3.loc13: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] -// CHECK:STDOUT: %.loc13_10.1: type = value_of_initializer %int.make_type_signed.loc13 [template = constants.%i32] -// CHECK:STDOUT: %.loc13_10.2: type = converted %int.make_type_signed.loc13, %.loc13_10.1 [template = constants.%i32] // CHECK:STDOUT: %array_type.loc13: type = array_type %int_3.loc13, %i32 [template = constants.%array_type] // CHECK:STDOUT: %b.param: %array_type = value_param runtime_param0 // CHECK:STDOUT: %b: %array_type = bind_name b, %b.param @@ -119,10 +113,8 @@ fn ValueBinding(b: [i32; 3]) { // CHECK:STDOUT: %b.param_patt: %array_type = value_param_pattern %b.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc21: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc21: init type = call constants.%Int(%int_32.loc21) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc21: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_3.loc21: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] -// CHECK:STDOUT: %.loc21_21.1: type = value_of_initializer %int.make_type_signed.loc21 [template = constants.%i32] -// CHECK:STDOUT: %.loc21_21.2: type = converted %int.make_type_signed.loc21, %.loc21_21.1 [template = constants.%i32] // CHECK:STDOUT: %array_type.loc21: type = array_type %int_3.loc21, %i32 [template = constants.%array_type] // CHECK:STDOUT: %b.param: %array_type = value_param runtime_param0 // CHECK:STDOUT: %b: %array_type = bind_name b, %b.param @@ -134,10 +126,8 @@ fn ValueBinding(b: [i32; 3]) { // CHECK:STDOUT: fn @G(%b.param_patt: %array_type) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_32.loc14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc14: init type = call constants.%Int(%int_32.loc14) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_3.loc14_16: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] -// CHECK:STDOUT: %.loc14_11.1: type = value_of_initializer %int.make_type_signed.loc14 [template = constants.%i32] -// CHECK:STDOUT: %.loc14_11.2: type = converted %int.make_type_signed.loc14, %.loc14_11.1 [template = constants.%i32] // CHECK:STDOUT: %array_type.loc14: type = array_type %int_3.loc14_16, %i32 [template = constants.%array_type] // CHECK:STDOUT: %a.var: ref %array_type = var a // CHECK:STDOUT: %a: ref %array_type = bind_name a, %a.var @@ -145,7 +135,7 @@ fn ValueBinding(b: [i32; 3]) { // CHECK:STDOUT: %int_2.loc14_25: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %int_3.loc14_28: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] // CHECK:STDOUT: %.loc14_29.1: %tuple.type = tuple_literal (%int_1.loc14_22, %int_2.loc14_25, %int_3.loc14_28) -// CHECK:STDOUT: %impl.elem0.loc14_29.1: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc14_29.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc14_29.1: = bound_method %int_1.loc14_22, %impl.elem0.loc14_29.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc14_29.1: = specific_function %Convert.bound.loc14_29.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc14_29.1: init %i32 = call %Convert.specific_fn.loc14_29.1(%int_1.loc14_22) [template = constants.%int_1.2] @@ -153,7 +143,7 @@ fn ValueBinding(b: [i32; 3]) { // CHECK:STDOUT: %int_0.loc14: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %.loc14_29.3: ref %i32 = array_index %a.var, %int_0.loc14 // CHECK:STDOUT: %.loc14_29.4: init %i32 = initialize_from %.loc14_29.2 to %.loc14_29.3 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc14_29.2: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc14_29.2: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc14_29.2: = bound_method %int_2.loc14_25, %impl.elem0.loc14_29.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc14_29.2: = specific_function %Convert.bound.loc14_29.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc14_29.2: init %i32 = call %Convert.specific_fn.loc14_29.2(%int_2.loc14_25) [template = constants.%int_2.2] @@ -161,7 +151,7 @@ fn ValueBinding(b: [i32; 3]) { // CHECK:STDOUT: %int_1.loc14_29: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %.loc14_29.6: ref %i32 = array_index %a.var, %int_1.loc14_29 // CHECK:STDOUT: %.loc14_29.7: init %i32 = initialize_from %.loc14_29.5 to %.loc14_29.6 [template = constants.%int_2.2] -// CHECK:STDOUT: %impl.elem0.loc14_29.3: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc14_29.3: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc14_29.3: = bound_method %int_3.loc14_28, %impl.elem0.loc14_29.3 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc14_29.3: = specific_function %Convert.bound.loc14_29.3, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc14_29.3: init %i32 = call %Convert.specific_fn.loc14_29.3(%int_3.loc14_28) [template = constants.%int_3.2] @@ -173,57 +163,49 @@ fn ValueBinding(b: [i32; 3]) { // CHECK:STDOUT: %.loc14_30: init %array_type = converted %.loc14_29.1, %.loc14_29.11 [template = constants.%array] // CHECK:STDOUT: assign %a.var, %.loc14_30 // CHECK:STDOUT: %int_32.loc17_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc17_11: init type = call constants.%Int(%int_32.loc17_11) [template = constants.%i32] -// CHECK:STDOUT: %.loc17_14.1: type = value_of_initializer %int.make_type_signed.loc17_11 [template = constants.%i32] -// CHECK:STDOUT: %.loc17_14.2: type = converted %int.make_type_signed.loc17_11, %.loc17_14.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc17_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %ptr: type = ptr_type %i32 [template = constants.%ptr.2] // CHECK:STDOUT: %pa.var: ref %ptr.2 = var pa // CHECK:STDOUT: %pa: ref %ptr.2 = bind_name pa, %pa.var // CHECK:STDOUT: %a.ref.loc17: ref %array_type = name_ref a, %a // CHECK:STDOUT: %int_0.loc17: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %int_32.loc17_22: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc17_22: init type = call constants.%Int(%int_32.loc17_22) [template = constants.%i32] -// CHECK:STDOUT: %.loc17_22.1: type = value_of_initializer %int.make_type_signed.loc17_22 [template = constants.%i32] -// CHECK:STDOUT: %.loc17_22.2: type = converted %int.make_type_signed.loc17_22, %.loc17_22.1 [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc17: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %i32.loc17_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %impl.elem0.loc17: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc17: = bound_method %int_0.loc17, %impl.elem0.loc17 [template = constants.%Convert.bound.4] // CHECK:STDOUT: %Convert.specific_fn.loc17: = specific_function %Convert.bound.loc17, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.4] // CHECK:STDOUT: %int.convert_checked.loc17: init %i32 = call %Convert.specific_fn.loc17(%int_0.loc17) [template = constants.%int_0.2] // CHECK:STDOUT: %.loc17_21.1: %i32 = value_of_initializer %int.convert_checked.loc17 [template = constants.%int_0.2] // CHECK:STDOUT: %.loc17_21.2: %i32 = converted %int_0.loc17, %.loc17_21.1 [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc17_22.3: ref %i32 = array_index %a.ref.loc17, %.loc17_21.2 -// CHECK:STDOUT: %addr: %ptr.2 = addr_of %.loc17_22.3 +// CHECK:STDOUT: %.loc17_22: ref %i32 = array_index %a.ref.loc17, %.loc17_21.2 +// CHECK:STDOUT: %addr: %ptr.2 = addr_of %.loc17_22 // CHECK:STDOUT: assign %pa.var, %addr // CHECK:STDOUT: %a.ref.loc18: ref %array_type = name_ref a, %a // CHECK:STDOUT: %int_0.loc18: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %int_32.loc18: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc18: init type = call constants.%Int(%int_32.loc18) [template = constants.%i32] -// CHECK:STDOUT: %.loc18_6.1: type = value_of_initializer %int.make_type_signed.loc18 [template = constants.%i32] -// CHECK:STDOUT: %.loc18_6.2: type = converted %int.make_type_signed.loc18, %.loc18_6.1 [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc18_5: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %i32.loc18: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %impl.elem0.loc18_5: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc18_5: = bound_method %int_0.loc18, %impl.elem0.loc18_5 [template = constants.%Convert.bound.4] // CHECK:STDOUT: %Convert.specific_fn.loc18_5: = specific_function %Convert.bound.loc18_5, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.4] // CHECK:STDOUT: %int.convert_checked.loc18_5: init %i32 = call %Convert.specific_fn.loc18_5(%int_0.loc18) [template = constants.%int_0.2] // CHECK:STDOUT: %.loc18_5.1: %i32 = value_of_initializer %int.convert_checked.loc18_5 [template = constants.%int_0.2] // CHECK:STDOUT: %.loc18_5.2: %i32 = converted %int_0.loc18, %.loc18_5.1 [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc18_6.3: ref %i32 = array_index %a.ref.loc18, %.loc18_5.2 +// CHECK:STDOUT: %.loc18_6: ref %i32 = array_index %a.ref.loc18, %.loc18_5.2 // CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [template = constants.%int_4.1] -// CHECK:STDOUT: %impl.elem0.loc18_8: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc18_8: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc18_8: = bound_method %int_4, %impl.elem0.loc18_8 [template = constants.%Convert.bound.5] // CHECK:STDOUT: %Convert.specific_fn.loc18_8: = specific_function %Convert.bound.loc18_8, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.5] // CHECK:STDOUT: %int.convert_checked.loc18_8: init %i32 = call %Convert.specific_fn.loc18_8(%int_4) [template = constants.%int_4.2] // CHECK:STDOUT: %.loc18_8: init %i32 = converted %int_4, %int.convert_checked.loc18_8 [template = constants.%int_4.2] -// CHECK:STDOUT: assign %.loc18_6.3, %.loc18_8 +// CHECK:STDOUT: assign %.loc18_6, %.loc18_8 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @ValueBinding(%b.param_patt: %array_type) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_32.loc22: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc22: init type = call constants.%Int(%int_32.loc22) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_3.loc22_16: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] -// CHECK:STDOUT: %.loc22_11.1: type = value_of_initializer %int.make_type_signed.loc22 [template = constants.%i32] -// CHECK:STDOUT: %.loc22_11.2: type = converted %int.make_type_signed.loc22, %.loc22_11.1 [template = constants.%i32] // CHECK:STDOUT: %array_type.loc22: type = array_type %int_3.loc22_16, %i32 [template = constants.%array_type] // CHECK:STDOUT: %a.var: ref %array_type = var a // CHECK:STDOUT: %a: ref %array_type = bind_name a, %a.var @@ -231,7 +213,7 @@ fn ValueBinding(b: [i32; 3]) { // CHECK:STDOUT: %int_2.loc22_25: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %int_3.loc22_28: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] // CHECK:STDOUT: %.loc22_29.1: %tuple.type = tuple_literal (%int_1.loc22_22, %int_2.loc22_25, %int_3.loc22_28) -// CHECK:STDOUT: %impl.elem0.loc22_29.1: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc22_29.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc22_29.1: = bound_method %int_1.loc22_22, %impl.elem0.loc22_29.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc22_29.1: = specific_function %Convert.bound.loc22_29.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc22_29.1: init %i32 = call %Convert.specific_fn.loc22_29.1(%int_1.loc22_22) [template = constants.%int_1.2] @@ -239,7 +221,7 @@ fn ValueBinding(b: [i32; 3]) { // CHECK:STDOUT: %int_0.loc22: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %.loc22_29.3: ref %i32 = array_index %a.var, %int_0.loc22 // CHECK:STDOUT: %.loc22_29.4: init %i32 = initialize_from %.loc22_29.2 to %.loc22_29.3 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc22_29.2: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc22_29.2: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc22_29.2: = bound_method %int_2.loc22_25, %impl.elem0.loc22_29.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc22_29.2: = specific_function %Convert.bound.loc22_29.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc22_29.2: init %i32 = call %Convert.specific_fn.loc22_29.2(%int_2.loc22_25) [template = constants.%int_2.2] @@ -247,7 +229,7 @@ fn ValueBinding(b: [i32; 3]) { // CHECK:STDOUT: %int_1.loc22_29: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %.loc22_29.6: ref %i32 = array_index %a.var, %int_1.loc22_29 // CHECK:STDOUT: %.loc22_29.7: init %i32 = initialize_from %.loc22_29.5 to %.loc22_29.6 [template = constants.%int_2.2] -// CHECK:STDOUT: %impl.elem0.loc22_29.3: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc22_29.3: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc22_29.3: = bound_method %int_3.loc22_28, %impl.elem0.loc22_29.3 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc22_29.3: = specific_function %Convert.bound.loc22_29.3, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc22_29.3: init %i32 = call %Convert.specific_fn.loc22_29.3(%int_3.loc22_28) [template = constants.%int_3.2] @@ -261,48 +243,42 @@ fn ValueBinding(b: [i32; 3]) { // CHECK:STDOUT: %a.ref: ref %array_type = name_ref a, %a // CHECK:STDOUT: %int_0.loc26: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %int_32.loc26: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc26: init type = call constants.%Int(%int_32.loc26) [template = constants.%i32] -// CHECK:STDOUT: %.loc26_6.1: type = value_of_initializer %int.make_type_signed.loc26 [template = constants.%i32] -// CHECK:STDOUT: %.loc26_6.2: type = converted %int.make_type_signed.loc26, %.loc26_6.1 [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc26: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %i32.loc26: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %impl.elem0.loc26: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc26: = bound_method %int_0.loc26, %impl.elem0.loc26 [template = constants.%Convert.bound.4] // CHECK:STDOUT: %Convert.specific_fn.loc26: = specific_function %Convert.bound.loc26, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.4] // CHECK:STDOUT: %int.convert_checked.loc26: init %i32 = call %Convert.specific_fn.loc26(%int_0.loc26) [template = constants.%int_0.2] // CHECK:STDOUT: %.loc26_5.1: %i32 = value_of_initializer %int.convert_checked.loc26 [template = constants.%int_0.2] // CHECK:STDOUT: %.loc26_5.2: %i32 = converted %int_0.loc26, %.loc26_5.1 [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc26_6.3: ref %i32 = array_index %a.ref, %.loc26_5.2 +// CHECK:STDOUT: %.loc26_6: ref %i32 = array_index %a.ref, %.loc26_5.2 // CHECK:STDOUT: %b.ref: %array_type = name_ref b, %b // CHECK:STDOUT: %int_0.loc27: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %int_32.loc27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc27: init type = call constants.%Int(%int_32.loc27) [template = constants.%i32] -// CHECK:STDOUT: %.loc27_6.1: type = value_of_initializer %int.make_type_signed.loc27 [template = constants.%i32] -// CHECK:STDOUT: %.loc27_6.2: type = converted %int.make_type_signed.loc27, %.loc27_6.1 [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc27: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %i32.loc27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %impl.elem0.loc27: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc27: = bound_method %int_0.loc27, %impl.elem0.loc27 [template = constants.%Convert.bound.4] // CHECK:STDOUT: %Convert.specific_fn.loc27: = specific_function %Convert.bound.loc27, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.4] // CHECK:STDOUT: %int.convert_checked.loc27: init %i32 = call %Convert.specific_fn.loc27(%int_0.loc27) [template = constants.%int_0.2] // CHECK:STDOUT: %.loc27_5.1: %i32 = value_of_initializer %int.convert_checked.loc27 [template = constants.%int_0.2] // CHECK:STDOUT: %.loc27_5.2: %i32 = converted %int_0.loc27, %.loc27_5.1 [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc27_6.3: ref %array_type = value_as_ref %b.ref -// CHECK:STDOUT: %.loc27_6.4: ref %i32 = array_index %.loc27_6.3, %.loc27_5.2 -// CHECK:STDOUT: %.loc27_6.5: %i32 = bind_value %.loc27_6.4 +// CHECK:STDOUT: %.loc27_6.1: ref %array_type = value_as_ref %b.ref +// CHECK:STDOUT: %.loc27_6.2: ref %i32 = array_index %.loc27_6.1, %.loc27_5.2 +// CHECK:STDOUT: %.loc27_6.3: %i32 = bind_value %.loc27_6.2 // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [template = constants.%F] // CHECK:STDOUT: %.loc28_5.1: ref %array_type = temporary_storage // CHECK:STDOUT: %F.call: init %array_type = call %F.ref() to %.loc28_5.1 // CHECK:STDOUT: %int_0.loc28: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %.loc28_5.2: ref %array_type = temporary %.loc28_5.1, %F.call // CHECK:STDOUT: %int_32.loc28: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc28: init type = call constants.%Int(%int_32.loc28) [template = constants.%i32] -// CHECK:STDOUT: %.loc28_8.1: type = value_of_initializer %int.make_type_signed.loc28 [template = constants.%i32] -// CHECK:STDOUT: %.loc28_8.2: type = converted %int.make_type_signed.loc28, %.loc28_8.1 [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc28: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %i32.loc28: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %impl.elem0.loc28: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc28: = bound_method %int_0.loc28, %impl.elem0.loc28 [template = constants.%Convert.bound.4] // CHECK:STDOUT: %Convert.specific_fn.loc28: = specific_function %Convert.bound.loc28, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.4] // CHECK:STDOUT: %int.convert_checked.loc28: init %i32 = call %Convert.specific_fn.loc28(%int_0.loc28) [template = constants.%int_0.2] // CHECK:STDOUT: %.loc28_7.1: %i32 = value_of_initializer %int.convert_checked.loc28 [template = constants.%int_0.2] // CHECK:STDOUT: %.loc28_7.2: %i32 = converted %int_0.loc28, %.loc28_7.1 [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc28_8.3: ref %i32 = array_index %.loc28_5.2, %.loc28_7.2 -// CHECK:STDOUT: %.loc28_8.4: %i32 = bind_value %.loc28_8.3 +// CHECK:STDOUT: %.loc28_8.1: ref %i32 = array_index %.loc28_5.2, %.loc28_7.2 +// CHECK:STDOUT: %.loc28_8.2: %i32 = bind_value %.loc28_8.1 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/index/fail_array_large_index.carbon b/toolchain/check/testdata/index/fail_array_large_index.carbon index 49988c9bb324b..a59163be8ae49 100644 --- a/toolchain/check/testdata/index/fail_array_large_index.carbon +++ b/toolchain/check/testdata/index/fail_array_large_index.carbon @@ -25,27 +25,25 @@ var c: i32 = a[0x7FFF_FFFF]; // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %array_type: type = array_type %int_1.1, %i32 [template] // CHECK:STDOUT: %int_12.1: Core.IntLiteral = int_value 12 [template] // CHECK:STDOUT: %tuple.type: type = tuple_type (Core.IntLiteral) [template] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_12.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_12.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_12.2: %i32 = int_value 12 [template] // CHECK:STDOUT: %array: %array_type = tuple_value (%int_12.2) [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] // CHECK:STDOUT: %int_2147483647.1: Core.IntLiteral = int_value 2147483647 [template] -// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_2147483647.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_2147483647.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2147483647.2: %i32 = int_value 2147483647 [template] // CHECK:STDOUT: } @@ -53,7 +51,7 @@ var c: i32 = a[0x7FFF_FFFF]; // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -68,23 +66,17 @@ var c: i32 = a[0x7FFF_FFFF]; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int_32.loc11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11: init type = call constants.%Int(%int_32.loc11) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %.loc11_9.1: type = value_of_initializer %int.make_type_signed.loc11 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_9.2: type = converted %int.make_type_signed.loc11, %.loc11_9.1 [template = constants.%i32] // CHECK:STDOUT: %array_type: type = array_type %int_1, %i32 [template = constants.%array_type] // CHECK:STDOUT: %a.var: ref %array_type = var a // CHECK:STDOUT: %a: ref %array_type = bind_name a, %a.var // CHECK:STDOUT: %int_32.loc17: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc17: init type = call constants.%Int(%int_32.loc17) [template = constants.%i32] -// CHECK:STDOUT: %.loc17_8.1: type = value_of_initializer %int.make_type_signed.loc17 [template = constants.%i32] -// CHECK:STDOUT: %.loc17_8.2: type = converted %int.make_type_signed.loc17, %.loc17_8.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %b.var: ref %i32 = var b // CHECK:STDOUT: %b: ref %i32 = bind_name b, %b.var // CHECK:STDOUT: %int_32.loc22: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc22: init type = call constants.%Int(%int_32.loc22) [template = constants.%i32] -// CHECK:STDOUT: %.loc22_8.1: type = value_of_initializer %int.make_type_signed.loc22 [template = constants.%i32] -// CHECK:STDOUT: %.loc22_8.2: type = converted %int.make_type_signed.loc22, %.loc22_8.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %c.var: ref %i32 = var c // CHECK:STDOUT: %c: ref %i32 = bind_name c, %c.var // CHECK:STDOUT: } @@ -93,7 +85,7 @@ var c: i32 = a[0x7FFF_FFFF]; // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_12: Core.IntLiteral = int_value 12 [template = constants.%int_12.1] // CHECK:STDOUT: %.loc11_23.1: %tuple.type = tuple_literal (%int_12) -// CHECK:STDOUT: %impl.elem0.loc11: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc11: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11: = bound_method %int_12, %impl.elem0.loc11 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc11: = specific_function %Convert.bound.loc11, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc11: init %i32 = call %Convert.specific_fn.loc11(%int_12) [template = constants.%int_12.2] @@ -107,33 +99,29 @@ var c: i32 = a[0x7FFF_FFFF]; // CHECK:STDOUT: %a.ref.loc17: ref %array_type = name_ref a, file.%a // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_32.loc17: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc17: init type = call constants.%Int(%int_32.loc17) [template = constants.%i32] -// CHECK:STDOUT: %.loc17_17.1: type = value_of_initializer %int.make_type_signed.loc17 [template = constants.%i32] -// CHECK:STDOUT: %.loc17_17.2: type = converted %int.make_type_signed.loc17, %.loc17_17.1 [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc17: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %i32.loc17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %impl.elem0.loc17: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc17: = bound_method %int_1, %impl.elem0.loc17 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc17: = specific_function %Convert.bound.loc17, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc17: init %i32 = call %Convert.specific_fn.loc17(%int_1) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc17_16.1: %i32 = value_of_initializer %int.convert_checked.loc17 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc17_16.2: %i32 = converted %int_1, %.loc17_16.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc17_17.3: ref %i32 = array_index %a.ref.loc17, %.loc17_16.2 [template = ] -// CHECK:STDOUT: %.loc17_17.4: %i32 = bind_value %.loc17_17.3 -// CHECK:STDOUT: assign file.%b.var, %.loc17_17.4 +// CHECK:STDOUT: %.loc17_17.1: ref %i32 = array_index %a.ref.loc17, %.loc17_16.2 [template = ] +// CHECK:STDOUT: %.loc17_17.2: %i32 = bind_value %.loc17_17.1 +// CHECK:STDOUT: assign file.%b.var, %.loc17_17.2 // CHECK:STDOUT: %a.ref.loc22: ref %array_type = name_ref a, file.%a // CHECK:STDOUT: %int_2147483647: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] // CHECK:STDOUT: %int_32.loc22: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc22: init type = call constants.%Int(%int_32.loc22) [template = constants.%i32] -// CHECK:STDOUT: %.loc22_27.1: type = value_of_initializer %int.make_type_signed.loc22 [template = constants.%i32] -// CHECK:STDOUT: %.loc22_27.2: type = converted %int.make_type_signed.loc22, %.loc22_27.1 [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc22: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %i32.loc22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %impl.elem0.loc22: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc22: = bound_method %int_2147483647, %impl.elem0.loc22 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc22: = specific_function %Convert.bound.loc22, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc22: init %i32 = call %Convert.specific_fn.loc22(%int_2147483647) [template = constants.%int_2147483647.2] // CHECK:STDOUT: %.loc22_16.1: %i32 = value_of_initializer %int.convert_checked.loc22 [template = constants.%int_2147483647.2] // CHECK:STDOUT: %.loc22_16.2: %i32 = converted %int_2147483647, %.loc22_16.1 [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %.loc22_27.3: ref %i32 = array_index %a.ref.loc22, %.loc22_16.2 [template = ] -// CHECK:STDOUT: %.loc22_27.4: %i32 = bind_value %.loc22_27.3 -// CHECK:STDOUT: assign file.%c.var, %.loc22_27.4 +// CHECK:STDOUT: %.loc22_27.1: ref %i32 = array_index %a.ref.loc22, %.loc22_16.2 [template = ] +// CHECK:STDOUT: %.loc22_27.2: %i32 = bind_value %.loc22_27.1 +// CHECK:STDOUT: assign file.%c.var, %.loc22_27.2 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/index/fail_array_non_int_indexing.carbon b/toolchain/check/testdata/index/fail_array_non_int_indexing.carbon index b38d5cb614917..d344adf94016f 100644 --- a/toolchain/check/testdata/index/fail_array_non_int_indexing.carbon +++ b/toolchain/check/testdata/index/fail_array_non_int_indexing.carbon @@ -21,19 +21,17 @@ var b: i32 = a[2.6]; // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %array_type: type = array_type %int_1, %i32 [template] // CHECK:STDOUT: %int_12.1: Core.IntLiteral = int_value 12 [template] // CHECK:STDOUT: %tuple.type: type = tuple_type (Core.IntLiteral) [template] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_12.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound: = bound_method %int_12.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_12.2: %i32 = int_value 12 [template] // CHECK:STDOUT: %array: %array_type = tuple_value (%int_12.2) [template] @@ -43,7 +41,7 @@ var b: i32 = a[2.6]; // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -57,17 +55,13 @@ var b: i32 = a[2.6]; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int_32.loc11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11: init type = call constants.%Int(%int_32.loc11) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1] -// CHECK:STDOUT: %.loc11_9.1: type = value_of_initializer %int.make_type_signed.loc11 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_9.2: type = converted %int.make_type_signed.loc11, %.loc11_9.1 [template = constants.%i32] // CHECK:STDOUT: %array_type: type = array_type %int_1, %i32 [template = constants.%array_type] // CHECK:STDOUT: %a.var: ref %array_type = var a // CHECK:STDOUT: %a: ref %array_type = bind_name a, %a.var // CHECK:STDOUT: %int_32.loc18: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc18: init type = call constants.%Int(%int_32.loc18) [template = constants.%i32] -// CHECK:STDOUT: %.loc18_8.1: type = value_of_initializer %int.make_type_signed.loc18 [template = constants.%i32] -// CHECK:STDOUT: %.loc18_8.2: type = converted %int.make_type_signed.loc18, %.loc18_8.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc18: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %b.var: ref %i32 = var b // CHECK:STDOUT: %b: ref %i32 = bind_name b, %b.var // CHECK:STDOUT: } @@ -76,7 +70,7 @@ var b: i32 = a[2.6]; // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_12: Core.IntLiteral = int_value 12 [template = constants.%int_12.1] // CHECK:STDOUT: %.loc11_23.1: %tuple.type = tuple_literal (%int_12) -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_12, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_12) [template = constants.%int_12.2] @@ -90,13 +84,11 @@ var b: i32 = a[2.6]; // CHECK:STDOUT: %a.ref: ref %array_type = name_ref a, file.%a // CHECK:STDOUT: %float: f64 = float_literal 2.6000000000000001 [template = constants.%float] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc18_19.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc18_19.2: type = converted %int.make_type_signed, %.loc18_19.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc18_16: %i32 = converted %float, [template = ] -// CHECK:STDOUT: %.loc18_19.3: ref %i32 = array_index %a.ref, [template = ] -// CHECK:STDOUT: %.loc18_19.4: %i32 = bind_value %.loc18_19.3 -// CHECK:STDOUT: assign file.%b.var, %.loc18_19.4 +// CHECK:STDOUT: %.loc18_19.1: ref %i32 = array_index %a.ref, [template = ] +// CHECK:STDOUT: %.loc18_19.2: %i32 = bind_value %.loc18_19.1 +// CHECK:STDOUT: assign file.%b.var, %.loc18_19.2 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/index/fail_array_out_of_bound_access.carbon b/toolchain/check/testdata/index/fail_array_out_of_bound_access.carbon index 902df62dee1d4..3d8a305a46158 100644 --- a/toolchain/check/testdata/index/fail_array_out_of_bound_access.carbon +++ b/toolchain/check/testdata/index/fail_array_out_of_bound_access.carbon @@ -18,23 +18,21 @@ var b: i32 = a[1]; // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %array_type: type = array_type %int_1.1, %i32 [template] // CHECK:STDOUT: %int_12.1: Core.IntLiteral = int_value 12 [template] // CHECK:STDOUT: %tuple.type: type = tuple_type (Core.IntLiteral) [template] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_12.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_12.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_12.2: %i32 = int_value 12 [template] // CHECK:STDOUT: %array: %array_type = tuple_value (%int_12.2) [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] // CHECK:STDOUT: } @@ -42,7 +40,7 @@ var b: i32 = a[1]; // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -56,17 +54,13 @@ var b: i32 = a[1]; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int_32.loc11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11: init type = call constants.%Int(%int_32.loc11) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %.loc11_9.1: type = value_of_initializer %int.make_type_signed.loc11 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_9.2: type = converted %int.make_type_signed.loc11, %.loc11_9.1 [template = constants.%i32] // CHECK:STDOUT: %array_type: type = array_type %int_1, %i32 [template = constants.%array_type] // CHECK:STDOUT: %a.var: ref %array_type = var a // CHECK:STDOUT: %a: ref %array_type = bind_name a, %a.var // CHECK:STDOUT: %int_32.loc15: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc15: init type = call constants.%Int(%int_32.loc15) [template = constants.%i32] -// CHECK:STDOUT: %.loc15_8.1: type = value_of_initializer %int.make_type_signed.loc15 [template = constants.%i32] -// CHECK:STDOUT: %.loc15_8.2: type = converted %int.make_type_signed.loc15, %.loc15_8.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc15: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %b.var: ref %i32 = var b // CHECK:STDOUT: %b: ref %i32 = bind_name b, %b.var // CHECK:STDOUT: } @@ -75,7 +69,7 @@ var b: i32 = a[1]; // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_12: Core.IntLiteral = int_value 12 [template = constants.%int_12.1] // CHECK:STDOUT: %.loc11_23.1: %tuple.type = tuple_literal (%int_12) -// CHECK:STDOUT: %impl.elem0.loc11: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc11: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11: = bound_method %int_12, %impl.elem0.loc11 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc11: = specific_function %Convert.bound.loc11, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc11: init %i32 = call %Convert.specific_fn.loc11(%int_12) [template = constants.%int_12.2] @@ -89,18 +83,16 @@ var b: i32 = a[1]; // CHECK:STDOUT: %a.ref: ref %array_type = name_ref a, file.%a // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc15_17.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc15_17.2: type = converted %int.make_type_signed, %.loc15_17.1 [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc15: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %impl.elem0.loc15: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc15: = bound_method %int_1, %impl.elem0.loc15 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc15: = specific_function %Convert.bound.loc15, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc15: init %i32 = call %Convert.specific_fn.loc15(%int_1) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc15_16.1: %i32 = value_of_initializer %int.convert_checked.loc15 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc15_16.2: %i32 = converted %int_1, %.loc15_16.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc15_17.3: ref %i32 = array_index %a.ref, %.loc15_16.2 [template = ] -// CHECK:STDOUT: %.loc15_17.4: %i32 = bind_value %.loc15_17.3 -// CHECK:STDOUT: assign file.%b.var, %.loc15_17.4 +// CHECK:STDOUT: %.loc15_17.1: ref %i32 = array_index %a.ref, %.loc15_16.2 [template = ] +// CHECK:STDOUT: %.loc15_17.2: %i32 = bind_value %.loc15_17.1 +// CHECK:STDOUT: assign file.%b.var, %.loc15_17.2 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/index/fail_expr_category.carbon b/toolchain/check/testdata/index/fail_expr_category.carbon index b3e2986691dcf..7f0f1835a0b96 100644 --- a/toolchain/check/testdata/index/fail_expr_category.carbon +++ b/toolchain/check/testdata/index/fail_expr_category.carbon @@ -40,9 +40,7 @@ fn G(b: [i32; 3]) { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template] // CHECK:STDOUT: %array_type: type = array_type %int_3, %i32 [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] @@ -52,14 +50,14 @@ fn G(b: [i32; 3]) { // CHECK:STDOUT: %ptr.2: type = ptr_type %i32 [template] // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_0.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] // CHECK:STDOUT: %int_4.1: Core.IntLiteral = int_value 4 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_4.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_4.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_4.2: %i32 = int_value 4 [template] // CHECK:STDOUT: } @@ -67,7 +65,7 @@ fn G(b: [i32; 3]) { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -85,10 +83,8 @@ fn G(b: [i32; 3]) { // CHECK:STDOUT: %return.param_patt: %array_type = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3] -// CHECK:STDOUT: %.loc11_12.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc11_12.2: type = converted %int.make_type_signed, %.loc11_12.1 [template = constants.%i32] // CHECK:STDOUT: %array_type: type = array_type %int_3, %i32 [template = constants.%array_type] // CHECK:STDOUT: %return.param: ref %array_type = out_param runtime_param0 // CHECK:STDOUT: %return: ref %array_type = return_slot %return.param @@ -98,10 +94,8 @@ fn G(b: [i32; 3]) { // CHECK:STDOUT: %b.param_patt: %array_type = value_param_pattern %b.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc13: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc13: init type = call constants.%Int(%int_32.loc13) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc13: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3] -// CHECK:STDOUT: %.loc13_10.1: type = value_of_initializer %int.make_type_signed.loc13 [template = constants.%i32] -// CHECK:STDOUT: %.loc13_10.2: type = converted %int.make_type_signed.loc13, %.loc13_10.1 [template = constants.%i32] // CHECK:STDOUT: %array_type: type = array_type %int_3, %i32 [template = constants.%array_type] // CHECK:STDOUT: %b.param: %array_type = value_param runtime_param0 // CHECK:STDOUT: %b: %array_type = bind_name b, %b.param @@ -113,55 +107,47 @@ fn G(b: [i32; 3]) { // CHECK:STDOUT: fn @G(%b.param_patt: %array_type) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_32.loc19_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc19_11: init type = call constants.%Int(%int_32.loc19_11) [template = constants.%i32] -// CHECK:STDOUT: %.loc19_14.1: type = value_of_initializer %int.make_type_signed.loc19_11 [template = constants.%i32] -// CHECK:STDOUT: %.loc19_14.2: type = converted %int.make_type_signed.loc19_11, %.loc19_14.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc19_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %ptr.loc19: type = ptr_type %i32 [template = constants.%ptr.2] // CHECK:STDOUT: %pb.var: ref %ptr.2 = var pb // CHECK:STDOUT: %pb: ref %ptr.2 = bind_name pb, %pb.var // CHECK:STDOUT: %b.ref.loc19: %array_type = name_ref b, %b // CHECK:STDOUT: %int_0.loc19: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %int_32.loc19_22: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc19_22: init type = call constants.%Int(%int_32.loc19_22) [template = constants.%i32] -// CHECK:STDOUT: %.loc19_22.1: type = value_of_initializer %int.make_type_signed.loc19_22 [template = constants.%i32] -// CHECK:STDOUT: %.loc19_22.2: type = converted %int.make_type_signed.loc19_22, %.loc19_22.1 [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc19: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %i32.loc19_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %impl.elem0.loc19: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc19: = bound_method %int_0.loc19, %impl.elem0.loc19 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc19: = specific_function %Convert.bound.loc19, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc19: init %i32 = call %Convert.specific_fn.loc19(%int_0.loc19) [template = constants.%int_0.2] // CHECK:STDOUT: %.loc19_21.1: %i32 = value_of_initializer %int.convert_checked.loc19 [template = constants.%int_0.2] // CHECK:STDOUT: %.loc19_21.2: %i32 = converted %int_0.loc19, %.loc19_21.1 [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc19_22.3: ref %array_type = value_as_ref %b.ref.loc19 -// CHECK:STDOUT: %.loc19_22.4: ref %i32 = array_index %.loc19_22.3, %.loc19_21.2 -// CHECK:STDOUT: %.loc19_22.5: %i32 = bind_value %.loc19_22.4 +// CHECK:STDOUT: %.loc19_22.1: ref %array_type = value_as_ref %b.ref.loc19 +// CHECK:STDOUT: %.loc19_22.2: ref %i32 = array_index %.loc19_22.1, %.loc19_21.2 +// CHECK:STDOUT: %.loc19_22.3: %i32 = bind_value %.loc19_22.2 // CHECK:STDOUT: %addr.loc19: %ptr.2 = addr_of [template = ] // CHECK:STDOUT: assign %pb.var, %addr.loc19 // CHECK:STDOUT: %b.ref.loc24: %array_type = name_ref b, %b // CHECK:STDOUT: %int_0.loc24: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %int_32.loc24: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc24: init type = call constants.%Int(%int_32.loc24) [template = constants.%i32] -// CHECK:STDOUT: %.loc24_6.1: type = value_of_initializer %int.make_type_signed.loc24 [template = constants.%i32] -// CHECK:STDOUT: %.loc24_6.2: type = converted %int.make_type_signed.loc24, %.loc24_6.1 [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc24_5: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %i32.loc24: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %impl.elem0.loc24_5: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc24_5: = bound_method %int_0.loc24, %impl.elem0.loc24_5 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc24_5: = specific_function %Convert.bound.loc24_5, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc24_5: init %i32 = call %Convert.specific_fn.loc24_5(%int_0.loc24) [template = constants.%int_0.2] // CHECK:STDOUT: %.loc24_5.1: %i32 = value_of_initializer %int.convert_checked.loc24_5 [template = constants.%int_0.2] // CHECK:STDOUT: %.loc24_5.2: %i32 = converted %int_0.loc24, %.loc24_5.1 [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc24_6.3: ref %array_type = value_as_ref %b.ref.loc24 -// CHECK:STDOUT: %.loc24_6.4: ref %i32 = array_index %.loc24_6.3, %.loc24_5.2 -// CHECK:STDOUT: %.loc24_6.5: %i32 = bind_value %.loc24_6.4 +// CHECK:STDOUT: %.loc24_6.1: ref %array_type = value_as_ref %b.ref.loc24 +// CHECK:STDOUT: %.loc24_6.2: ref %i32 = array_index %.loc24_6.1, %.loc24_5.2 +// CHECK:STDOUT: %.loc24_6.3: %i32 = bind_value %.loc24_6.2 // CHECK:STDOUT: %int_4.loc24: Core.IntLiteral = int_value 4 [template = constants.%int_4.1] -// CHECK:STDOUT: %impl.elem0.loc24_8: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc24_8: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc24_8: = bound_method %int_4.loc24, %impl.elem0.loc24_8 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc24_8: = specific_function %Convert.bound.loc24_8, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc24_8: init %i32 = call %Convert.specific_fn.loc24_8(%int_4.loc24) [template = constants.%int_4.2] // CHECK:STDOUT: %.loc24_8: init %i32 = converted %int_4.loc24, %int.convert_checked.loc24_8 [template = constants.%int_4.2] -// CHECK:STDOUT: assign %.loc24_6.5, %.loc24_8 +// CHECK:STDOUT: assign %.loc24_6.3, %.loc24_8 // CHECK:STDOUT: %int_32.loc32_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc32_11: init type = call constants.%Int(%int_32.loc32_11) [template = constants.%i32] -// CHECK:STDOUT: %.loc32_14.1: type = value_of_initializer %int.make_type_signed.loc32_11 [template = constants.%i32] -// CHECK:STDOUT: %.loc32_14.2: type = converted %int.make_type_signed.loc32_11, %.loc32_14.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc32_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %ptr.loc32: type = ptr_type %i32 [template = constants.%ptr.2] // CHECK:STDOUT: %pf.var: ref %ptr.2 = var pf // CHECK:STDOUT: %pf: ref %ptr.2 = bind_name pf, %pf.var @@ -171,17 +157,15 @@ fn G(b: [i32; 3]) { // CHECK:STDOUT: %int_0.loc32: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %.loc32_21.2: ref %array_type = temporary %.loc32_21.1, %F.call.loc32 // CHECK:STDOUT: %int_32.loc32_24: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc32_24: init type = call constants.%Int(%int_32.loc32_24) [template = constants.%i32] -// CHECK:STDOUT: %.loc32_24.1: type = value_of_initializer %int.make_type_signed.loc32_24 [template = constants.%i32] -// CHECK:STDOUT: %.loc32_24.2: type = converted %int.make_type_signed.loc32_24, %.loc32_24.1 [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc32: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %i32.loc32_24: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %impl.elem0.loc32: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc32: = bound_method %int_0.loc32, %impl.elem0.loc32 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc32: = specific_function %Convert.bound.loc32, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc32: init %i32 = call %Convert.specific_fn.loc32(%int_0.loc32) [template = constants.%int_0.2] // CHECK:STDOUT: %.loc32_23.1: %i32 = value_of_initializer %int.convert_checked.loc32 [template = constants.%int_0.2] // CHECK:STDOUT: %.loc32_23.2: %i32 = converted %int_0.loc32, %.loc32_23.1 [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc32_24.3: ref %i32 = array_index %.loc32_21.2, %.loc32_23.2 -// CHECK:STDOUT: %.loc32_24.4: %i32 = bind_value %.loc32_24.3 +// CHECK:STDOUT: %.loc32_24.1: ref %i32 = array_index %.loc32_21.2, %.loc32_23.2 +// CHECK:STDOUT: %.loc32_24.2: %i32 = bind_value %.loc32_24.1 // CHECK:STDOUT: %addr.loc32: %ptr.2 = addr_of [template = ] // CHECK:STDOUT: assign %pf.var, %addr.loc32 // CHECK:STDOUT: %F.ref.loc36: %F.type = name_ref F, file.%F.decl [template = constants.%F] @@ -190,24 +174,22 @@ fn G(b: [i32; 3]) { // CHECK:STDOUT: %int_0.loc36: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %.loc36_5.2: ref %array_type = temporary %.loc36_5.1, %F.call.loc36 // CHECK:STDOUT: %int_32.loc36: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc36: init type = call constants.%Int(%int_32.loc36) [template = constants.%i32] -// CHECK:STDOUT: %.loc36_8.1: type = value_of_initializer %int.make_type_signed.loc36 [template = constants.%i32] -// CHECK:STDOUT: %.loc36_8.2: type = converted %int.make_type_signed.loc36, %.loc36_8.1 [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc36_7: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %i32.loc36: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %impl.elem0.loc36_7: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc36_7: = bound_method %int_0.loc36, %impl.elem0.loc36_7 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc36_7: = specific_function %Convert.bound.loc36_7, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc36_7: init %i32 = call %Convert.specific_fn.loc36_7(%int_0.loc36) [template = constants.%int_0.2] // CHECK:STDOUT: %.loc36_7.1: %i32 = value_of_initializer %int.convert_checked.loc36_7 [template = constants.%int_0.2] // CHECK:STDOUT: %.loc36_7.2: %i32 = converted %int_0.loc36, %.loc36_7.1 [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc36_8.3: ref %i32 = array_index %.loc36_5.2, %.loc36_7.2 -// CHECK:STDOUT: %.loc36_8.4: %i32 = bind_value %.loc36_8.3 +// CHECK:STDOUT: %.loc36_8.1: ref %i32 = array_index %.loc36_5.2, %.loc36_7.2 +// CHECK:STDOUT: %.loc36_8.2: %i32 = bind_value %.loc36_8.1 // CHECK:STDOUT: %int_4.loc36: Core.IntLiteral = int_value 4 [template = constants.%int_4.1] -// CHECK:STDOUT: %impl.elem0.loc36_10: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc36_10: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc36_10: = bound_method %int_4.loc36, %impl.elem0.loc36_10 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc36_10: = specific_function %Convert.bound.loc36_10, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc36_10: init %i32 = call %Convert.specific_fn.loc36_10(%int_4.loc36) [template = constants.%int_4.2] // CHECK:STDOUT: %.loc36_10: init %i32 = converted %int_4.loc36, %int.convert_checked.loc36_10 [template = constants.%int_4.2] -// CHECK:STDOUT: assign %.loc36_8.4, %.loc36_10 +// CHECK:STDOUT: assign %.loc36_8.2, %.loc36_10 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/index/fail_invalid_base.carbon b/toolchain/check/testdata/index/fail_invalid_base.carbon index a2ba3659c3427..0685759d715ad 100644 --- a/toolchain/check/testdata/index/fail_invalid_base.carbon +++ b/toolchain/check/testdata/index/fail_invalid_base.carbon @@ -37,9 +37,7 @@ var d: i32 = {.a: i32, .b: i32}[0]; // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] @@ -53,7 +51,7 @@ var d: i32 = {.a: i32, .b: i32}[0]; // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .IndexWith = %import_ref.2 +// CHECK:STDOUT: .IndexWith = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -72,28 +70,20 @@ var d: i32 = {.a: i32, .b: i32}[0]; // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %N: = namespace [template] {} // CHECK:STDOUT: %int_32.loc16: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc16: init type = call constants.%Int(%int_32.loc16) [template = constants.%i32] -// CHECK:STDOUT: %.loc16_8.1: type = value_of_initializer %int.make_type_signed.loc16 [template = constants.%i32] -// CHECK:STDOUT: %.loc16_8.2: type = converted %int.make_type_signed.loc16, %.loc16_8.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc16: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.var: ref %i32 = var a // CHECK:STDOUT: %a: ref %i32 = bind_name a, %a.var // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {} // CHECK:STDOUT: %int_32.loc23: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc23: init type = call constants.%Int(%int_32.loc23) [template = constants.%i32] -// CHECK:STDOUT: %.loc23_8.1: type = value_of_initializer %int.make_type_signed.loc23 [template = constants.%i32] -// CHECK:STDOUT: %.loc23_8.2: type = converted %int.make_type_signed.loc23, %.loc23_8.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc23: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %b.var: ref %i32 = var b // CHECK:STDOUT: %b: ref %i32 = bind_name b, %b.var // CHECK:STDOUT: %int_32.loc29: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc29: init type = call constants.%Int(%int_32.loc29) [template = constants.%i32] -// CHECK:STDOUT: %.loc29_8.1: type = value_of_initializer %int.make_type_signed.loc29 [template = constants.%i32] -// CHECK:STDOUT: %.loc29_8.2: type = converted %int.make_type_signed.loc29, %.loc29_8.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc29: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %c.var: ref %i32 = var c // CHECK:STDOUT: %c: ref %i32 = bind_name c, %c.var // CHECK:STDOUT: %int_32.loc34: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc34: init type = call constants.%Int(%int_32.loc34) [template = constants.%i32] -// CHECK:STDOUT: %.loc34_8.1: type = value_of_initializer %int.make_type_signed.loc34 [template = constants.%i32] -// CHECK:STDOUT: %.loc34_8.2: type = converted %int.make_type_signed.loc34, %.loc34_8.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc34: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %d.var: ref %i32 = var d // CHECK:STDOUT: %d: ref %i32 = bind_name d, %d.var // CHECK:STDOUT: } @@ -116,13 +106,9 @@ var d: i32 = {.a: i32, .b: i32}[0]; // CHECK:STDOUT: %.loc29_29.2: %struct_type.a.b.1 = converted %.loc29_29.1, %struct [template = constants.%struct] // CHECK:STDOUT: assign file.%c.var, // CHECK:STDOUT: %int_32.loc34_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc34_19: init type = call constants.%Int(%int_32.loc34_19) [template = constants.%i32] -// CHECK:STDOUT: %.loc34_19.1: type = value_of_initializer %int.make_type_signed.loc34_19 [template = constants.%i32] -// CHECK:STDOUT: %.loc34_19.2: type = converted %int.make_type_signed.loc34_19, %.loc34_19.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc34_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc34_28: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc34_28: init type = call constants.%Int(%int_32.loc34_28) [template = constants.%i32] -// CHECK:STDOUT: %.loc34_28.1: type = value_of_initializer %int.make_type_signed.loc34_28 [template = constants.%i32] -// CHECK:STDOUT: %.loc34_28.2: type = converted %int.make_type_signed.loc34_28, %.loc34_28.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc34_28: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %struct_type.a.b: type = struct_type {.a: %i32, .b: %i32} [template = constants.%struct_type.a.b.2] // CHECK:STDOUT: %int_0.loc34: Core.IntLiteral = int_value 0 [template = constants.%int_0] // CHECK:STDOUT: assign file.%d.var, diff --git a/toolchain/check/testdata/index/fail_name_not_found.carbon b/toolchain/check/testdata/index/fail_name_not_found.carbon index 21d205f16921f..e369f788f3258 100644 --- a/toolchain/check/testdata/index/fail_name_not_found.carbon +++ b/toolchain/check/testdata/index/fail_name_not_found.carbon @@ -21,15 +21,13 @@ fn Main() { // CHECK:STDOUT: %Main.type: type = fn_type @Main [template] // CHECK:STDOUT: %Main: %Main.type = struct_value () [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -47,9 +45,7 @@ fn Main() { // CHECK:STDOUT: fn @Main() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc15_10.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc15_10.2: type = converted %int.make_type_signed, %.loc15_10.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %b.var: ref %i32 = var b // CHECK:STDOUT: %b: ref %i32 = bind_name b, %b.var // CHECK:STDOUT: %a.ref: = name_ref a, [template = ] diff --git a/toolchain/check/testdata/index/fail_negative_indexing.carbon b/toolchain/check/testdata/index/fail_negative_indexing.carbon index c62619df16cd0..922b45ac905f3 100644 --- a/toolchain/check/testdata/index/fail_negative_indexing.carbon +++ b/toolchain/check/testdata/index/fail_negative_indexing.carbon @@ -19,19 +19,17 @@ var d: i32 = c[-10]; // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %array_type: type = array_type %int_2, %i32 [template] // CHECK:STDOUT: %int_42.1: Core.IntLiteral = int_value 42 [template] // CHECK:STDOUT: %tuple.type: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [template] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_42.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound: = bound_method %int_42.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_42.2: %i32 = int_value 42 [template] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template] @@ -42,8 +40,8 @@ var d: i32 = c[-10]; // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 -// CHECK:STDOUT: .Negate = %import_ref.38 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 +// CHECK:STDOUT: .Negate = %import_ref.193 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -57,17 +55,13 @@ var d: i32 = c[-10]; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int_32.loc11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11: init type = call constants.%Int(%int_32.loc11) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2] -// CHECK:STDOUT: %.loc11_9.1: type = value_of_initializer %int.make_type_signed.loc11 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_9.2: type = converted %int.make_type_signed.loc11, %.loc11_9.1 [template = constants.%i32] // CHECK:STDOUT: %array_type: type = array_type %int_2, %i32 [template = constants.%array_type] // CHECK:STDOUT: %c.var: ref %array_type = var c // CHECK:STDOUT: %c: ref %array_type = bind_name c, %c.var // CHECK:STDOUT: %int_32.loc15: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc15: init type = call constants.%Int(%int_32.loc15) [template = constants.%i32] -// CHECK:STDOUT: %.loc15_8.1: type = value_of_initializer %int.make_type_signed.loc15 [template = constants.%i32] -// CHECK:STDOUT: %.loc15_8.2: type = converted %int.make_type_signed.loc15, %.loc15_8.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc15: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %d.var: ref %i32 = var d // CHECK:STDOUT: %d: ref %i32 = bind_name d, %d.var // CHECK:STDOUT: } @@ -77,7 +71,7 @@ var d: i32 = c[-10]; // CHECK:STDOUT: %int_42.loc11_20: Core.IntLiteral = int_value 42 [template = constants.%int_42.1] // CHECK:STDOUT: %int_42.loc11_24: Core.IntLiteral = int_value 42 [template = constants.%int_42.1] // CHECK:STDOUT: %.loc11_26.1: %tuple.type = tuple_literal (%int_42.loc11_20, %int_42.loc11_24) -// CHECK:STDOUT: %impl.elem0.loc11_26.1: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc11_26.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_26.1: = bound_method %int_42.loc11_20, %impl.elem0.loc11_26.1 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn.loc11_26.1: = specific_function %Convert.bound.loc11_26.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc11_26.1: init %i32 = call %Convert.specific_fn.loc11_26.1(%int_42.loc11_20) [template = constants.%int_42.2] @@ -85,7 +79,7 @@ var d: i32 = c[-10]; // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0] // CHECK:STDOUT: %.loc11_26.3: ref %i32 = array_index file.%c.var, %int_0 // CHECK:STDOUT: %.loc11_26.4: init %i32 = initialize_from %.loc11_26.2 to %.loc11_26.3 [template = constants.%int_42.2] -// CHECK:STDOUT: %impl.elem0.loc11_26.2: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc11_26.2: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_26.2: = bound_method %int_42.loc11_24, %impl.elem0.loc11_26.2 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn.loc11_26.2: = specific_function %Convert.bound.loc11_26.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc11_26.2: init %i32 = call %Convert.specific_fn.loc11_26.2(%int_42.loc11_24) [template = constants.%int_42.2] @@ -99,12 +93,10 @@ var d: i32 = c[-10]; // CHECK:STDOUT: %c.ref: ref %array_type = name_ref c, file.%c // CHECK:STDOUT: %int_10: Core.IntLiteral = int_value 10 [template = constants.%int_10] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc15_19.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc15_19.2: type = converted %int.make_type_signed, %.loc15_19.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc15_19.3: ref %i32 = array_index %c.ref, [template = ] -// CHECK:STDOUT: %.loc15_19.4: %i32 = bind_value %.loc15_19.3 -// CHECK:STDOUT: assign file.%d.var, %.loc15_19.4 +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc15_19.1: ref %i32 = array_index %c.ref, [template = ] +// CHECK:STDOUT: %.loc15_19.2: %i32 = bind_value %.loc15_19.1 +// CHECK:STDOUT: assign file.%d.var, %.loc15_19.2 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interface/assoc_const.carbon b/toolchain/check/testdata/interface/assoc_const.carbon index da4a83c36ca01..e8eb8e1a97131 100644 --- a/toolchain/check/testdata/interface/assoc_const.carbon +++ b/toolchain/check/testdata/interface/assoc_const.carbon @@ -21,16 +21,14 @@ interface I { // CHECK:STDOUT: %assoc_type.1: type = assoc_entity_type %I.type, type [template] // CHECK:STDOUT: %assoc0: %assoc_type.1 = assoc_entity element0, @I.%T [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %assoc_type.2: type = assoc_entity_type %I.type, %i32 [template] // CHECK:STDOUT: %assoc1: %assoc_type.2 = assoc_entity element1, @I.%N [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -50,9 +48,7 @@ interface I { // CHECK:STDOUT: %T: type = assoc_const_decl T [template] // CHECK:STDOUT: %assoc0: %assoc_type.1 = assoc_entity element0, %T [template = constants.%assoc0] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc13_11.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc13_11.2: type = converted %int.make_type_signed, %.loc13_11.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %N: %i32 = assoc_const_decl N [template] // CHECK:STDOUT: %assoc1: %assoc_type.2 = assoc_entity element1, %N [template = constants.%assoc1] // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interface/fail_assoc_const_bad_default.carbon b/toolchain/check/testdata/interface/fail_assoc_const_bad_default.carbon index 6ceef63cff67a..82feeadd1faaa 100644 --- a/toolchain/check/testdata/interface/fail_assoc_const_bad_default.carbon +++ b/toolchain/check/testdata/interface/fail_assoc_const_bad_default.carbon @@ -25,7 +25,7 @@ interface I { // CHECK:STDOUT: %Self.1: %I.type = bind_symbolic_name Self, 0 [symbolic] // CHECK:STDOUT: %int_42: Core.IntLiteral = int_value 42 [template] // CHECK:STDOUT: %assoc_type: type = assoc_entity_type %I.type, type [template] -// CHECK:STDOUT: %assoc0.7: %assoc_type = assoc_entity element0, @I.%T [template] +// CHECK:STDOUT: %assoc0.4: %assoc_type = assoc_entity element0, @I.%T [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -50,7 +50,7 @@ interface I { // CHECK:STDOUT: %int_42: Core.IntLiteral = int_value 42 [template = constants.%int_42] // CHECK:STDOUT: %.loc18: type = converted %int_42, [template = ] // CHECK:STDOUT: %T: type = assoc_const_decl T [template] -// CHECK:STDOUT: %assoc0: %assoc_type = assoc_entity element0, %T [template = constants.%assoc0.7] +// CHECK:STDOUT: %assoc0: %assoc_type = assoc_entity element0, %T [template = constants.%assoc0.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = %Self diff --git a/toolchain/check/testdata/interface/fail_todo_assoc_const_default.carbon b/toolchain/check/testdata/interface/fail_todo_assoc_const_default.carbon index 0a0e15b5f2416..9abea6fba37b8 100644 --- a/toolchain/check/testdata/interface/fail_todo_assoc_const_default.carbon +++ b/toolchain/check/testdata/interface/fail_todo_assoc_const_default.carbon @@ -26,19 +26,17 @@ interface I { // CHECK:STDOUT: %I.type: type = facet_type <@I> [template] // CHECK:STDOUT: %Self.1: %I.type = bind_symbolic_name Self, 0 [symbolic] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (type, type) [template] // CHECK:STDOUT: %tuple.type.2: type = tuple_type (%i32, %i32) [template] // CHECK:STDOUT: %assoc_type.1: type = assoc_entity_type %I.type, type [template] // CHECK:STDOUT: %assoc0.1: %assoc_type.1 = assoc_entity element0, @I.%T [template] // CHECK:STDOUT: %int_42.1: Core.IntLiteral = int_value 42 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_42.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound: = bound_method %int_42.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_42.2: %i32 = int_value 42 [template] // CHECK:STDOUT: %assoc_type.2: type = assoc_entity_type %I.type, %i32 [template] @@ -48,7 +46,7 @@ interface I { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -66,23 +64,17 @@ interface I { // CHECK:STDOUT: interface @I { // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.1] // CHECK:STDOUT: %int_32.loc16_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc16_27: init type = call constants.%Int(%int_32.loc16_27) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc16_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc16_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc16_32: init type = call constants.%Int(%int_32.loc16_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc16_35: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc16_27, %int.make_type_signed.loc16_32) -// CHECK:STDOUT: %.loc16_36.1: type = value_of_initializer %int.make_type_signed.loc16_27 [template = constants.%i32] -// CHECK:STDOUT: %.loc16_36.2: type = converted %int.make_type_signed.loc16_27, %.loc16_36.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc16_36.3: type = value_of_initializer %int.make_type_signed.loc16_32 [template = constants.%i32] -// CHECK:STDOUT: %.loc16_36.4: type = converted %int.make_type_signed.loc16_32, %.loc16_36.3 [template = constants.%i32] -// CHECK:STDOUT: %.loc16_36.5: type = converted %.loc16_35, constants.%tuple.type.2 [template = constants.%tuple.type.2] +// CHECK:STDOUT: %i32.loc16_32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc16_35: %tuple.type.1 = tuple_literal (%i32.loc16_27, %i32.loc16_32) +// CHECK:STDOUT: %.loc16_36: type = converted %.loc16_35, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %T: type = assoc_const_decl T [template] // CHECK:STDOUT: %assoc0: %assoc_type.1 = assoc_entity element0, %T [template = constants.%assoc0.1] // CHECK:STDOUT: %int_32.loc20: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc20: init type = call constants.%Int(%int_32.loc20) [template = constants.%i32] -// CHECK:STDOUT: %.loc20_19.1: type = value_of_initializer %int.make_type_signed.loc20 [template = constants.%i32] -// CHECK:STDOUT: %.loc20_19.2: type = converted %int.make_type_signed.loc20, %.loc20_19.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc20: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_42: Core.IntLiteral = int_value 42 [template = constants.%int_42.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_42, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_42) [template = constants.%int_42.2] diff --git a/toolchain/check/testdata/interface/fail_todo_define_default_fn_inline.carbon b/toolchain/check/testdata/interface/fail_todo_define_default_fn_inline.carbon index 5d2c9cfa52ddc..bbaea5efdae1e 100644 --- a/toolchain/check/testdata/interface/fail_todo_define_default_fn_inline.carbon +++ b/toolchain/check/testdata/interface/fail_todo_define_default_fn_inline.carbon @@ -31,9 +31,7 @@ interface Interface { // CHECK:STDOUT: %F.assoc_type: type = assoc_entity_type %Interface.type, %F.type [template] // CHECK:STDOUT: %assoc0: %F.assoc_type = assoc_entity element0, @Interface.%F.decl [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] // CHECK:STDOUT: %G.assoc_type: type = assoc_entity_type %Interface.type, %G.type [template] @@ -42,7 +40,7 @@ interface Interface { // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -70,17 +68,11 @@ interface Interface { // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc21_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc21_19: init type = call constants.%Int(%int_32.loc21_19) [template = constants.%i32] -// CHECK:STDOUT: %.loc21_19.1: type = value_of_initializer %int.make_type_signed.loc21_19 [template = constants.%i32] -// CHECK:STDOUT: %.loc21_19.2: type = converted %int.make_type_signed.loc21_19, %.loc21_19.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc21_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc21_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc21_27: init type = call constants.%Int(%int_32.loc21_27) [template = constants.%i32] -// CHECK:STDOUT: %.loc21_27.1: type = value_of_initializer %int.make_type_signed.loc21_27 [template = constants.%i32] -// CHECK:STDOUT: %.loc21_27.2: type = converted %int.make_type_signed.loc21_27, %.loc21_27.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc21_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc21_35: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc21_35: init type = call constants.%Int(%int_32.loc21_35) [template = constants.%i32] -// CHECK:STDOUT: %.loc21_35.1: type = value_of_initializer %int.make_type_signed.loc21_35 [template = constants.%i32] -// CHECK:STDOUT: %.loc21_35.2: type = converted %int.make_type_signed.loc21_35, %.loc21_35.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc21_35: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 diff --git a/toolchain/check/testdata/interface/fail_todo_define_default_fn_out_of_line.carbon b/toolchain/check/testdata/interface/fail_todo_define_default_fn_out_of_line.carbon index ce4ac90f3eabc..3a9d42ceb4467 100644 --- a/toolchain/check/testdata/interface/fail_todo_define_default_fn_out_of_line.carbon +++ b/toolchain/check/testdata/interface/fail_todo_define_default_fn_out_of_line.carbon @@ -73,9 +73,7 @@ fn Interface.C.F[self: Self](U:! type, u: U) -> U { return u; } // CHECK:STDOUT: %F.assoc_type: type = assoc_entity_type %Interface.type, %F.type [template] // CHECK:STDOUT: %assoc0: %F.assoc_type = assoc_entity element0, @Interface.%F.decl [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] // CHECK:STDOUT: %G.assoc_type: type = assoc_entity_type %Interface.type, %G.type [template] @@ -88,7 +86,7 @@ fn Interface.C.F[self: Self](U:! type, u: U) -> U { return u; } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -111,17 +109,11 @@ fn Interface.C.F[self: Self](U:! type, u: U) -> U { return u; } // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc31_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc31_19: init type = call constants.%Int(%int_32.loc31_19) [template = constants.%i32] -// CHECK:STDOUT: %.loc31_19.1: type = value_of_initializer %int.make_type_signed.loc31_19 [template = constants.%i32] -// CHECK:STDOUT: %.loc31_19.2: type = converted %int.make_type_signed.loc31_19, %.loc31_19.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc31_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc31_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc31_27: init type = call constants.%Int(%int_32.loc31_27) [template = constants.%i32] -// CHECK:STDOUT: %.loc31_27.1: type = value_of_initializer %int.make_type_signed.loc31_27 [template = constants.%i32] -// CHECK:STDOUT: %.loc31_27.2: type = converted %int.make_type_signed.loc31_27, %.loc31_27.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc31_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc31_35: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc31_35: init type = call constants.%Int(%int_32.loc31_35) [template = constants.%i32] -// CHECK:STDOUT: %.loc31_35.1: type = value_of_initializer %int.make_type_signed.loc31_35 [template = constants.%i32] -// CHECK:STDOUT: %.loc31_35.2: type = converted %int.make_type_signed.loc31_35, %.loc31_35.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc31_35: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 @@ -144,17 +136,11 @@ fn Interface.C.F[self: Self](U:! type, u: U) -> U { return u; } // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc13_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc13_19: init type = call constants.%Int(%int_32.loc13_19) [template = constants.%i32] -// CHECK:STDOUT: %.loc13_19.1: type = value_of_initializer %int.make_type_signed.loc13_19 [template = constants.%i32] -// CHECK:STDOUT: %.loc13_19.2: type = converted %int.make_type_signed.loc13_19, %.loc13_19.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc13_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc13_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc13_27: init type = call constants.%Int(%int_32.loc13_27) [template = constants.%i32] -// CHECK:STDOUT: %.loc13_27.1: type = value_of_initializer %int.make_type_signed.loc13_27 [template = constants.%i32] -// CHECK:STDOUT: %.loc13_27.2: type = converted %int.make_type_signed.loc13_27, %.loc13_27.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc13_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc13_35: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc13_35: init type = call constants.%Int(%int_32.loc13_35) [template = constants.%i32] -// CHECK:STDOUT: %.loc13_35.1: type = value_of_initializer %int.make_type_signed.loc13_35 [template = constants.%i32] -// CHECK:STDOUT: %.loc13_35.2: type = converted %int.make_type_signed.loc13_35, %.loc13_35.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc13_35: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 diff --git a/toolchain/check/testdata/interface/member_lookup.carbon b/toolchain/check/testdata/interface/member_lookup.carbon index 582c0db0f692a..97dbba59b830d 100644 --- a/toolchain/check/testdata/interface/member_lookup.carbon +++ b/toolchain/check/testdata/interface/member_lookup.carbon @@ -67,15 +67,14 @@ fn AccessMissingConcrete(I:! Interface(i32)) -> i32 { // CHECK:STDOUT: %I.as_wit.1: = facet_access_witness %I.1 [symbolic] // CHECK:STDOUT: %impl.elem0.1: %T = interface_witness_access %I.as_wit.1, element0 [symbolic] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %Interface.type.3: type = facet_type <@Interface, @Interface(%i32)> [template] // CHECK:STDOUT: %I.2: %Interface.type.3 = bind_symbolic_name I, 0 [symbolic] // CHECK:STDOUT: %I.patt.2: %Interface.type.3 = symbolic_binding_pattern I, 0 [symbolic] // CHECK:STDOUT: %AccessConcrete.type: type = fn_type @AccessConcrete [template] // CHECK:STDOUT: %AccessConcrete: %AccessConcrete.type = struct_value () [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %i32 [template] +// CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %complete_type.2: = complete_type_witness %i32.builtin [template] // CHECK:STDOUT: %assoc_type.2: type = assoc_entity_type %Interface.type.3, %i32 [template] // CHECK:STDOUT: %assoc0.2: %assoc_type.2 = assoc_entity element0, @Interface.%X [template] // CHECK:STDOUT: %I.as_wit.2: = facet_access_witness %I.2 [symbolic] @@ -84,7 +83,7 @@ fn AccessMissingConcrete(I:! Interface(i32)) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -132,14 +131,10 @@ fn AccessMissingConcrete(I:! Interface(i32)) -> i32 { // CHECK:STDOUT: } { // CHECK:STDOUT: %Interface.ref: %Interface.type.1 = name_ref Interface, file.%Interface.decl [template = constants.%Interface.generic] // CHECK:STDOUT: %int_32.loc12_33: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc12_33: init type = call constants.%Int(%int_32.loc12_33) [template = constants.%i32] -// CHECK:STDOUT: %.loc12_36.1: type = value_of_initializer %int.make_type_signed.loc12_33 [template = constants.%i32] -// CHECK:STDOUT: %.loc12_36.2: type = converted %int.make_type_signed.loc12_33, %.loc12_36.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc12_33: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %Interface.type: type = facet_type <@Interface, @Interface(constants.%i32)> [template = constants.%Interface.type.3] // CHECK:STDOUT: %int_32.loc12_42: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc12_42: init type = call constants.%Int(%int_32.loc12_42) [template = constants.%i32] -// CHECK:STDOUT: %.loc12_42.1: type = value_of_initializer %int.make_type_signed.loc12_42 [template = constants.%i32] -// CHECK:STDOUT: %.loc12_42.2: type = converted %int.make_type_signed.loc12_42, %.loc12_42.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc12_42: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %I.param: %Interface.type.3 = value_param runtime_param // CHECK:STDOUT: %I.loc12_19.1: %Interface.type.3 = bind_symbolic_name I, 0, %I.param [symbolic = %I.loc12_19.2 (constants.%I.2)] // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 @@ -253,7 +248,7 @@ fn AccessMissingConcrete(I:! Interface(i32)) -> i32 { // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Interface.type => constants.%Interface.type.3 // CHECK:STDOUT: %Self.2 => constants.%Self -// CHECK:STDOUT: %require_complete => constants.%complete_type +// CHECK:STDOUT: %require_complete => constants.%complete_type.2 // CHECK:STDOUT: %assoc_type => constants.%assoc_type.2 // CHECK:STDOUT: %assoc0.loc5_12.2 => constants.%assoc0.2 // CHECK:STDOUT: } @@ -281,22 +276,21 @@ fn AccessMissingConcrete(I:! Interface(i32)) -> i32 { // CHECK:STDOUT: %AccessMissingGeneric: %AccessMissingGeneric.type = struct_value () [template] // CHECK:STDOUT: %require_complete.2: = require_complete_type %Interface.type.2 [symbolic] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %Interface.type.3: type = facet_type <@Interface, @Interface(%i32)> [template] // CHECK:STDOUT: %I.2: %Interface.type.3 = bind_symbolic_name I, 0 [symbolic] // CHECK:STDOUT: %I.patt.2: %Interface.type.3 = symbolic_binding_pattern I, 0 [symbolic] // CHECK:STDOUT: %AccessMissingConcrete.type: type = fn_type @AccessMissingConcrete [template] // CHECK:STDOUT: %AccessMissingConcrete: %AccessMissingConcrete.type = struct_value () [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %i32 [template] +// CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %complete_type.2: = complete_type_witness %i32.builtin [template] // CHECK:STDOUT: %assoc_type.2: type = assoc_entity_type %Interface.type.3, %i32 [template] // CHECK:STDOUT: %assoc0.2: %assoc_type.2 = assoc_entity element0, @Interface.%X [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -344,14 +338,10 @@ fn AccessMissingConcrete(I:! Interface(i32)) -> i32 { // CHECK:STDOUT: } { // CHECK:STDOUT: %Interface.ref: %Interface.type.1 = name_ref Interface, file.%Interface.decl [template = constants.%Interface.generic] // CHECK:STDOUT: %int_32.loc16_40: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc16_40: init type = call constants.%Int(%int_32.loc16_40) [template = constants.%i32] -// CHECK:STDOUT: %.loc16_43.1: type = value_of_initializer %int.make_type_signed.loc16_40 [template = constants.%i32] -// CHECK:STDOUT: %.loc16_43.2: type = converted %int.make_type_signed.loc16_40, %.loc16_43.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc16_40: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %Interface.type: type = facet_type <@Interface, @Interface(constants.%i32)> [template = constants.%Interface.type.3] // CHECK:STDOUT: %int_32.loc16_49: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc16_49: init type = call constants.%Int(%int_32.loc16_49) [template = constants.%i32] -// CHECK:STDOUT: %.loc16_49.1: type = value_of_initializer %int.make_type_signed.loc16_49 [template = constants.%i32] -// CHECK:STDOUT: %.loc16_49.2: type = converted %int.make_type_signed.loc16_49, %.loc16_49.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc16_49: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %I.param: %Interface.type.3 = value_param runtime_param // CHECK:STDOUT: %I.loc16_26.1: %Interface.type.3 = bind_symbolic_name I, 0, %I.param [symbolic = %I.loc16_26.2 (constants.%I.2)] // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 @@ -452,7 +442,7 @@ fn AccessMissingConcrete(I:! Interface(i32)) -> i32 { // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Interface.type => constants.%Interface.type.3 // CHECK:STDOUT: %Self.2 => constants.%Self -// CHECK:STDOUT: %require_complete => constants.%complete_type +// CHECK:STDOUT: %require_complete => constants.%complete_type.2 // CHECK:STDOUT: %assoc_type => constants.%assoc_type.2 // CHECK:STDOUT: %assoc0.loc5_12.2 => constants.%assoc0.2 // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/interface/todo_define_not_default.carbon b/toolchain/check/testdata/interface/todo_define_not_default.carbon index 97c8f2c913b7b..52ab8e46fd307 100644 --- a/toolchain/check/testdata/interface/todo_define_not_default.carbon +++ b/toolchain/check/testdata/interface/todo_define_not_default.carbon @@ -29,9 +29,7 @@ interface I { // CHECK:STDOUT: %F.assoc_type: type = assoc_entity_type %I.type, %F.type [template] // CHECK:STDOUT: %assoc0.1: %F.assoc_type = assoc_entity element0, @I.%F.decl [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] // CHECK:STDOUT: %G.assoc_type: type = assoc_entity_type %I.type, %G.type [template] @@ -42,10 +40,10 @@ interface I { // CHECK:STDOUT: %assoc2: %assoc_type.1 = assoc_entity element2, @I.%T [template] // CHECK:STDOUT: %int_42.1: Core.IntLiteral = int_value 42 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_42.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound: = bound_method %int_42.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_42.2: %i32 = int_value 42 [template] // CHECK:STDOUT: %assoc_type.2: type = assoc_entity_type %I.type, %i32 [template] @@ -55,7 +53,7 @@ interface I { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -83,17 +81,11 @@ interface I { // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc14_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc14_11: init type = call constants.%Int(%int_32.loc14_11) [template = constants.%i32] -// CHECK:STDOUT: %.loc14_11.1: type = value_of_initializer %int.make_type_signed.loc14_11 [template = constants.%i32] -// CHECK:STDOUT: %.loc14_11.2: type = converted %int.make_type_signed.loc14_11, %.loc14_11.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc14_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc14_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc14_19: init type = call constants.%Int(%int_32.loc14_19) [template = constants.%i32] -// CHECK:STDOUT: %.loc14_19.1: type = value_of_initializer %int.make_type_signed.loc14_19 [template = constants.%i32] -// CHECK:STDOUT: %.loc14_19.2: type = converted %int.make_type_signed.loc14_19, %.loc14_19.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc14_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc14_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc14_27: init type = call constants.%Int(%int_32.loc14_27) [template = constants.%i32] -// CHECK:STDOUT: %.loc14_27.1: type = value_of_initializer %int.make_type_signed.loc14_27 [template = constants.%i32] -// CHECK:STDOUT: %.loc14_27.2: type = converted %int.make_type_signed.loc14_27, %.loc14_27.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc14_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 @@ -103,23 +95,17 @@ interface I { // CHECK:STDOUT: } // CHECK:STDOUT: %assoc1: %G.assoc_type = assoc_entity element1, %G.decl [template = constants.%assoc1] // CHECK:STDOUT: %int_32.loc18_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc18_19: init type = call constants.%Int(%int_32.loc18_19) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc18_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc18_24: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc18_24: init type = call constants.%Int(%int_32.loc18_24) [template = constants.%i32] -// CHECK:STDOUT: %.loc18_27: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc18_19, %int.make_type_signed.loc18_24) -// CHECK:STDOUT: %.loc18_28.1: type = value_of_initializer %int.make_type_signed.loc18_19 [template = constants.%i32] -// CHECK:STDOUT: %.loc18_28.2: type = converted %int.make_type_signed.loc18_19, %.loc18_28.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc18_28.3: type = value_of_initializer %int.make_type_signed.loc18_24 [template = constants.%i32] -// CHECK:STDOUT: %.loc18_28.4: type = converted %int.make_type_signed.loc18_24, %.loc18_28.3 [template = constants.%i32] -// CHECK:STDOUT: %.loc18_28.5: type = converted %.loc18_27, constants.%tuple.type.2 [template = constants.%tuple.type.2] +// CHECK:STDOUT: %i32.loc18_24: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc18_27: %tuple.type.1 = tuple_literal (%i32.loc18_19, %i32.loc18_24) +// CHECK:STDOUT: %.loc18_28: type = converted %.loc18_27, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %T: type = assoc_const_decl T [template] // CHECK:STDOUT: %assoc2: %assoc_type.1 = assoc_entity element2, %T [template = constants.%assoc2] // CHECK:STDOUT: %int_32.loc19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc19: init type = call constants.%Int(%int_32.loc19) [template = constants.%i32] -// CHECK:STDOUT: %.loc19_11.1: type = value_of_initializer %int.make_type_signed.loc19 [template = constants.%i32] -// CHECK:STDOUT: %.loc19_11.2: type = converted %int.make_type_signed.loc19, %.loc19_11.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_42: Core.IntLiteral = int_value 42 [template = constants.%int_42.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_42, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_42) [template = constants.%int_42.2] diff --git a/toolchain/check/testdata/ir/duplicate_name_same_line.carbon b/toolchain/check/testdata/ir/duplicate_name_same_line.carbon index 19df3cd53b8ee..b36f50311d37b 100644 --- a/toolchain/check/testdata/ir/duplicate_name_same_line.carbon +++ b/toolchain/check/testdata/ir/duplicate_name_same_line.carbon @@ -17,19 +17,17 @@ fn A() { if (true) { var n: i32 = 1; } if (true) { var n: i32 = 2; } } // CHECK:STDOUT: %A: %A.type = struct_value () [template] // CHECK:STDOUT: %true: bool = bool_literal true [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] // CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] // CHECK:STDOUT: } @@ -37,7 +35,7 @@ fn A() { if (true) { var n: i32 = 1; } if (true) { var n: i32 = 2; } } // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -59,13 +57,11 @@ fn A() { if (true) { var n: i32 = 1; } if (true) { var n: i32 = 2; } } // CHECK:STDOUT: // CHECK:STDOUT: !if.then.loc11_18: // CHECK:STDOUT: %int_32.loc11_29: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11_29: init type = call constants.%Int(%int_32.loc11_29) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_29.1: type = value_of_initializer %int.make_type_signed.loc11_29 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_29.2: type = converted %int.make_type_signed.loc11_29, %.loc11_29.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc11_29: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %n.var.loc11_26: ref %i32 = var n // CHECK:STDOUT: %n.loc11_26: ref %i32 = bind_name n, %n.var.loc11_26 // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc11_36: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc11_36: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_36: = bound_method %int_1, %impl.elem0.loc11_36 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc11_36: = specific_function %Convert.bound.loc11_36, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc11_36: init %i32 = call %Convert.specific_fn.loc11_36(%int_1) [template = constants.%int_1.2] @@ -79,13 +75,11 @@ fn A() { if (true) { var n: i32 = 1; } if (true) { var n: i32 = 2; } } // CHECK:STDOUT: // CHECK:STDOUT: !if.then.loc11_48: // CHECK:STDOUT: %int_32.loc11_59: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11_59: init type = call constants.%Int(%int_32.loc11_59) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_59.1: type = value_of_initializer %int.make_type_signed.loc11_59 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_59.2: type = converted %int.make_type_signed.loc11_59, %.loc11_59.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc11_59: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %n.var.loc11_56: ref %i32 = var n // CHECK:STDOUT: %n.loc11_56: ref %i32 = bind_name n, %n.var.loc11_56 // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %impl.elem0.loc11_66: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc11_66: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_66: = bound_method %int_2, %impl.elem0.loc11_66 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc11_66: = specific_function %Convert.bound.loc11_66, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc11_66: init %i32 = call %Convert.specific_fn.loc11_66(%int_2) [template = constants.%int_2.2] diff --git a/toolchain/check/testdata/let/compile_time_bindings.carbon b/toolchain/check/testdata/let/compile_time_bindings.carbon index 65c530e99cc3a..ce3a4607ca2d0 100644 --- a/toolchain/check/testdata/let/compile_time_bindings.carbon +++ b/toolchain/check/testdata/let/compile_time_bindings.carbon @@ -536,17 +536,15 @@ impl i32 as Empty { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] // CHECK:STDOUT: %Zero: %i32 = bind_symbolic_name Zero, 0 [symbolic] @@ -555,7 +553,7 @@ impl i32 as Empty { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -572,9 +570,7 @@ impl i32 as Empty { // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc4: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc4: init type = call constants.%Int(%int_32.loc4) [template = constants.%i32] -// CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_signed.loc4 [template = constants.%i32] -// CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_signed.loc4, %.loc4_11.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc4: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } @@ -583,11 +579,9 @@ impl i32 as Empty { // CHECK:STDOUT: fn @F() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_32.loc5: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc5: init type = call constants.%Int(%int_32.loc5) [template = constants.%i32] -// CHECK:STDOUT: %.loc5_14.1: type = value_of_initializer %int.make_type_signed.loc5 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_14.2: type = converted %int.make_type_signed.loc5, %.loc5_14.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc5: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.2] @@ -602,23 +596,21 @@ impl i32 as Empty { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %true: bool = bool_literal true [template] // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_0.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] // CHECK:STDOUT: %Zero: %i32 = bind_symbolic_name Zero, 0 [symbolic] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] // CHECK:STDOUT: } @@ -626,7 +618,7 @@ impl i32 as Empty { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -643,9 +635,7 @@ impl i32 as Empty { // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc4: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc4: init type = call constants.%Int(%int_32.loc4) [template = constants.%i32] -// CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_signed.loc4 [template = constants.%i32] -// CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_signed.loc4, %.loc4_11.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc4: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } @@ -658,11 +648,9 @@ impl i32 as Empty { // CHECK:STDOUT: // CHECK:STDOUT: !if.then: // CHECK:STDOUT: %int_32.loc6: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc6: init type = call constants.%Int(%int_32.loc6) [template = constants.%i32] -// CHECK:STDOUT: %.loc6_16.1: type = value_of_initializer %int.make_type_signed.loc6 [template = constants.%i32] -// CHECK:STDOUT: %.loc6_16.2: type = converted %int.make_type_signed.loc6, %.loc6_16.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc6: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0.loc6: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc6: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc6: = bound_method %int_0, %impl.elem0.loc6 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc6: = specific_function %Convert.bound.loc6, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc6: init %i32 = call %Convert.specific_fn.loc6(%int_0) [template = constants.%int_0.2] @@ -674,7 +662,7 @@ impl i32 as Empty { // CHECK:STDOUT: // CHECK:STDOUT: !if.else: // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc9: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc9: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc9: = bound_method %int_1, %impl.elem0.loc9 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc9: = specific_function %Convert.bound.loc9, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc9: init %i32 = call %Convert.specific_fn.loc9(%int_1) [template = constants.%int_1.2] @@ -689,9 +677,7 @@ impl i32 as Empty { // CHECK:STDOUT: %I.type: type = facet_type <@I> [template] // CHECK:STDOUT: %Self.1: %I.type = bind_symbolic_name Self, 0 [symbolic] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %assoc_type: type = assoc_entity_type %I.type, type [template] // CHECK:STDOUT: %assoc0.1: %assoc_type = assoc_entity element0, @I.%T [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] @@ -703,7 +689,7 @@ impl i32 as Empty { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -721,9 +707,7 @@ impl i32 as Empty { // CHECK:STDOUT: interface @I { // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.1] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc5_21.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc5_21.2: type = converted %int.make_type_signed, %.loc5_21.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %T: type = assoc_const_decl T [template] // CHECK:STDOUT: %assoc0: %assoc_type = assoc_entity element0, %T [template = constants.%assoc0.1] // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { @@ -756,18 +740,16 @@ impl i32 as Empty { // CHECK:STDOUT: constants { // CHECK:STDOUT: %I: type = class_type @I [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %complete_type.2: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -784,10 +766,8 @@ impl i32 as Empty { // CHECK:STDOUT: // CHECK:STDOUT: class @I { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc9_21.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc9_21.2: type = converted %int.make_type_signed, %.loc9_21.1 [template = constants.%i32] -// CHECK:STDOUT: %T: type = bind_name T, %.loc9_21.2 +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %T: type = bind_name T, %i32 // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %return.patt: = return_slot_pattern // CHECK:STDOUT: %return.param_patt: = out_param_pattern %return.patt, runtime_param0 @@ -796,7 +776,7 @@ impl i32 as Empty { // CHECK:STDOUT: %return.param: ref = out_param runtime_param0 // CHECK:STDOUT: %return: ref = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.2] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%I @@ -811,16 +791,14 @@ impl i32 as Empty { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -848,10 +826,8 @@ impl i32 as Empty { // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc8_19.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc8_19.2: type = converted %int.make_type_signed, %.loc8_19.1 [template = constants.%i32] -// CHECK:STDOUT: %T: type = bind_name T, %.loc8_19.2 +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %T: type = bind_name T, %i32 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -861,24 +837,22 @@ impl i32 as Empty { // CHECK:STDOUT: %Empty.type: type = facet_type <@Empty> [template] // CHECK:STDOUT: %Self.1: %Empty.type = bind_symbolic_name Self, 0 [symbolic] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.2(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.2(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] -// CHECK:STDOUT: %interface.10: = interface_witness () [template] +// CHECK:STDOUT: %interface.6: = interface_witness () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -893,9 +867,7 @@ impl i32 as Empty { // CHECK:STDOUT: %Empty.decl: type = interface_decl @Empty [template = constants.%Empty.type] {} {} // CHECK:STDOUT: impl_decl @impl.1 [template] {} { // CHECK:STDOUT: %int_32.loc6: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc6: init type = call constants.%Int(%int_32.loc6) [template = constants.%i32] -// CHECK:STDOUT: %.loc6_6.1: type = value_of_initializer %int.make_type_signed.loc6 [template = constants.%i32] -// CHECK:STDOUT: %.loc6_6.2: type = converted %int.make_type_signed.loc6, %.loc6_6.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc6: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %Empty.ref: type = name_ref Empty, file.%Empty.decl [template = constants.%Empty.type] // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -908,20 +880,18 @@ impl i32 as Empty { // CHECK:STDOUT: witness = () // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.1: %.loc6_6.2 as %Empty.ref { +// CHECK:STDOUT: impl @impl.1: %i32.loc6 as %Empty.ref { // CHECK:STDOUT: %int_32.loc10: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc10: init type = call constants.%Int(%int_32.loc10) [template = constants.%i32] -// CHECK:STDOUT: %.loc10_14.1: type = value_of_initializer %int.make_type_signed.loc10 [template = constants.%i32] -// CHECK:STDOUT: %.loc10_14.2: type = converted %int.make_type_signed.loc10, %.loc10_14.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc10: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.2] // CHECK:STDOUT: %.loc10_21.1: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_0.2] // CHECK:STDOUT: %.loc10_21.2: %i32 = converted %int_0, %.loc10_21.1 [template = constants.%int_0.2] // CHECK:STDOUT: %Zero: %i32 = bind_name Zero, %.loc10_21.2 -// CHECK:STDOUT: %interface: = interface_witness () [template = constants.%interface.10] +// CHECK:STDOUT: %interface: = interface_witness () [template = constants.%interface.6] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Zero = %Zero diff --git a/toolchain/check/testdata/let/convert.carbon b/toolchain/check/testdata/let/convert.carbon index 204a672125d8a..e37b5772c5029 100644 --- a/toolchain/check/testdata/let/convert.carbon +++ b/toolchain/check/testdata/let/convert.carbon @@ -19,9 +19,7 @@ fn F() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (type, type, type) [template] @@ -31,16 +29,16 @@ fn F() -> i32 { // CHECK:STDOUT: %int_3.1: Core.IntLiteral = int_value 3 [template] // CHECK:STDOUT: %tuple.type.3: type = tuple_type (Core.IntLiteral, Core.IntLiteral, Core.IntLiteral) [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] -// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_3.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_3.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_3.2: %i32 = int_value 3 [template] // CHECK:STDOUT: %tuple: %tuple.type.2 = tuple_value (%int_1.2, %int_2.2, %int_3.2) [template] @@ -49,7 +47,7 @@ fn F() -> i32 { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -66,9 +64,7 @@ fn F() -> i32 { // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11: init type = call constants.%Int(%int_32.loc11) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %int.make_type_signed.loc11 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_11.2: type = converted %int.make_type_signed.loc11, %.loc11_11.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } @@ -77,40 +73,34 @@ fn F() -> i32 { // CHECK:STDOUT: fn @F() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_32.loc12_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc12_11: init type = call constants.%Int(%int_32.loc12_11) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc12_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc12_16: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc12_16: init type = call constants.%Int(%int_32.loc12_16) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc12_16: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc12_21: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc12_21: init type = call constants.%Int(%int_32.loc12_21) [template = constants.%i32] -// CHECK:STDOUT: %.loc12_24.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc12_11, %int.make_type_signed.loc12_16, %int.make_type_signed.loc12_21) -// CHECK:STDOUT: %.loc12_24.2: type = value_of_initializer %int.make_type_signed.loc12_11 [template = constants.%i32] -// CHECK:STDOUT: %.loc12_24.3: type = converted %int.make_type_signed.loc12_11, %.loc12_24.2 [template = constants.%i32] -// CHECK:STDOUT: %.loc12_24.4: type = value_of_initializer %int.make_type_signed.loc12_16 [template = constants.%i32] -// CHECK:STDOUT: %.loc12_24.5: type = converted %int.make_type_signed.loc12_16, %.loc12_24.4 [template = constants.%i32] -// CHECK:STDOUT: %.loc12_24.6: type = value_of_initializer %int.make_type_signed.loc12_21 [template = constants.%i32] -// CHECK:STDOUT: %.loc12_24.7: type = converted %int.make_type_signed.loc12_21, %.loc12_24.6 [template = constants.%i32] -// CHECK:STDOUT: %.loc12_24.8: type = converted %.loc12_24.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] +// CHECK:STDOUT: %i32.loc12_21: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc12_24.1: %tuple.type.1 = tuple_literal (%i32.loc12_11, %i32.loc12_16, %i32.loc12_21) +// CHECK:STDOUT: %.loc12_24.2: type = converted %.loc12_24.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %v.var: ref %tuple.type.2 = var v // CHECK:STDOUT: %v: ref %tuple.type.2 = bind_name v, %v.var // CHECK:STDOUT: %int_1.loc12: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] // CHECK:STDOUT: %.loc12_36.1: %tuple.type.3 = tuple_literal (%int_1.loc12, %int_2, %int_3) -// CHECK:STDOUT: %impl.elem0.loc12_36.1: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc12_36.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc12_36.1: = bound_method %int_1.loc12, %impl.elem0.loc12_36.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc12_36.1: = specific_function %Convert.bound.loc12_36.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc12_36.1: init %i32 = call %Convert.specific_fn.loc12_36.1(%int_1.loc12) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc12_36.2: init %i32 = converted %int_1.loc12, %int.convert_checked.loc12_36.1 [template = constants.%int_1.2] // CHECK:STDOUT: %tuple.elem0.loc12: ref %i32 = tuple_access %v.var, element0 // CHECK:STDOUT: %.loc12_36.3: init %i32 = initialize_from %.loc12_36.2 to %tuple.elem0.loc12 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc12_36.2: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc12_36.2: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc12_36.2: = bound_method %int_2, %impl.elem0.loc12_36.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc12_36.2: = specific_function %Convert.bound.loc12_36.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc12_36.2: init %i32 = call %Convert.specific_fn.loc12_36.2(%int_2) [template = constants.%int_2.2] // CHECK:STDOUT: %.loc12_36.4: init %i32 = converted %int_2, %int.convert_checked.loc12_36.2 [template = constants.%int_2.2] // CHECK:STDOUT: %tuple.elem1.loc12: ref %i32 = tuple_access %v.var, element1 // CHECK:STDOUT: %.loc12_36.5: init %i32 = initialize_from %.loc12_36.4 to %tuple.elem1.loc12 [template = constants.%int_2.2] -// CHECK:STDOUT: %impl.elem0.loc12_36.3: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc12_36.3: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc12_36.3: = bound_method %int_3, %impl.elem0.loc12_36.3 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc12_36.3: = specific_function %Convert.bound.loc12_36.3, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc12_36.3: init %i32 = call %Convert.specific_fn.loc12_36.3(%int_3) [template = constants.%int_3.2] @@ -121,19 +111,13 @@ fn F() -> i32 { // CHECK:STDOUT: %.loc12_37: init %tuple.type.2 = converted %.loc12_36.1, %.loc12_36.8 [template = constants.%tuple] // CHECK:STDOUT: assign %v.var, %.loc12_37 // CHECK:STDOUT: %int_32.loc14_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc14_11: init type = call constants.%Int(%int_32.loc14_11) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc14_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc14_16: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc14_16: init type = call constants.%Int(%int_32.loc14_16) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc14_16: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc14_21: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc14_21: init type = call constants.%Int(%int_32.loc14_21) [template = constants.%i32] -// CHECK:STDOUT: %.loc14_24.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc14_11, %int.make_type_signed.loc14_16, %int.make_type_signed.loc14_21) -// CHECK:STDOUT: %.loc14_24.2: type = value_of_initializer %int.make_type_signed.loc14_11 [template = constants.%i32] -// CHECK:STDOUT: %.loc14_24.3: type = converted %int.make_type_signed.loc14_11, %.loc14_24.2 [template = constants.%i32] -// CHECK:STDOUT: %.loc14_24.4: type = value_of_initializer %int.make_type_signed.loc14_16 [template = constants.%i32] -// CHECK:STDOUT: %.loc14_24.5: type = converted %int.make_type_signed.loc14_16, %.loc14_24.4 [template = constants.%i32] -// CHECK:STDOUT: %.loc14_24.6: type = value_of_initializer %int.make_type_signed.loc14_21 [template = constants.%i32] -// CHECK:STDOUT: %.loc14_24.7: type = converted %int.make_type_signed.loc14_21, %.loc14_24.6 [template = constants.%i32] -// CHECK:STDOUT: %.loc14_24.8: type = converted %.loc14_24.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] +// CHECK:STDOUT: %i32.loc14_21: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc14_24.1: %tuple.type.1 = tuple_literal (%i32.loc14_11, %i32.loc14_16, %i32.loc14_21) +// CHECK:STDOUT: %.loc14_24.2: type = converted %.loc14_24.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %v.ref: ref %tuple.type.2 = name_ref v, %v // CHECK:STDOUT: %tuple.elem0.loc14: ref %i32 = tuple_access %v.ref, element0 // CHECK:STDOUT: %.loc14_28.1: %i32 = bind_value %tuple.elem0.loc14 diff --git a/toolchain/check/testdata/let/fail_duplicate_decl.carbon b/toolchain/check/testdata/let/fail_duplicate_decl.carbon index 9da615b4f0561..358e9ed7ee307 100644 --- a/toolchain/check/testdata/let/fail_duplicate_decl.carbon +++ b/toolchain/check/testdata/let/fail_duplicate_decl.carbon @@ -25,19 +25,17 @@ fn F() { // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] // CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] // CHECK:STDOUT: } @@ -45,7 +43,7 @@ fn F() { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -63,11 +61,9 @@ fn F() { // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_32.loc12: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc12: init type = call constants.%Int(%int_32.loc12) [template = constants.%i32] -// CHECK:STDOUT: %.loc12_10.1: type = value_of_initializer %int.make_type_signed.loc12 [template = constants.%i32] -// CHECK:STDOUT: %.loc12_10.2: type = converted %int.make_type_signed.loc12, %.loc12_10.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc12: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc12: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc12: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc12: = bound_method %int_1, %impl.elem0.loc12 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc12: = specific_function %Convert.bound.loc12, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc12: init %i32 = call %Convert.specific_fn.loc12(%int_1) [template = constants.%int_1.2] @@ -75,11 +71,9 @@ fn F() { // CHECK:STDOUT: %.loc12_17.2: %i32 = converted %int_1, %.loc12_17.1 [template = constants.%int_1.2] // CHECK:STDOUT: %a.loc12: %i32 = bind_name a, %.loc12_17.2 // CHECK:STDOUT: %int_32.loc19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc19: init type = call constants.%Int(%int_32.loc19) [template = constants.%i32] -// CHECK:STDOUT: %.loc19_10.1: type = value_of_initializer %int.make_type_signed.loc19 [template = constants.%i32] -// CHECK:STDOUT: %.loc19_10.2: type = converted %int.make_type_signed.loc19, %.loc19_10.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %impl.elem0.loc19: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc19: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc19: = bound_method %int_2, %impl.elem0.loc19 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc19: = specific_function %Convert.bound.loc19, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc19: init %i32 = call %Convert.specific_fn.loc19(%int_2) [template = constants.%int_2.2] diff --git a/toolchain/check/testdata/let/fail_generic.carbon b/toolchain/check/testdata/let/fail_generic.carbon index 15f6673b9f638..f4929b1f3531f 100644 --- a/toolchain/check/testdata/let/fail_generic.carbon +++ b/toolchain/check/testdata/let/fail_generic.carbon @@ -32,9 +32,7 @@ fn F(a: i32) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] @@ -44,7 +42,7 @@ fn F(a: i32) -> i32 { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -63,13 +61,9 @@ fn F(a: i32) -> i32 { // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc12_9: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc12_9: init type = call constants.%Int(%int_32.loc12_9) [template = constants.%i32] -// CHECK:STDOUT: %.loc12_9.1: type = value_of_initializer %int.make_type_signed.loc12_9 [template = constants.%i32] -// CHECK:STDOUT: %.loc12_9.2: type = converted %int.make_type_signed.loc12_9, %.loc12_9.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc12_9: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc12_17: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc12_17: init type = call constants.%Int(%int_32.loc12_17) [template = constants.%i32] -// CHECK:STDOUT: %.loc12_17.1: type = value_of_initializer %int.make_type_signed.loc12_17 [template = constants.%i32] -// CHECK:STDOUT: %.loc12_17.2: type = converted %int.make_type_signed.loc12_17, %.loc12_17.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc12_17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 @@ -80,10 +74,8 @@ fn F(a: i32) -> i32 { // CHECK:STDOUT: fn @F(%a.param_patt: %i32) -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_32.loc13: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc13: init type = call constants.%Int(%int_32.loc13) [template = constants.%i32] -// CHECK:STDOUT: %.loc13_21.1: type = value_of_initializer %int.make_type_signed.loc13 [template = constants.%i32] -// CHECK:STDOUT: %.loc13_21.2: type = converted %int.make_type_signed.loc13, %.loc13_21.1 [template = constants.%i32] -// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0, %.loc13_21.2 [symbolic = constants.%T] +// CHECK:STDOUT: %i32.loc13: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0, %i32.loc13 [symbolic = constants.%T] // CHECK:STDOUT: %T.ref: type = name_ref T, %T [symbolic = constants.%T] // CHECK:STDOUT: %int_5: Core.IntLiteral = int_value 5 [template = constants.%int_5] // CHECK:STDOUT: %.loc21: %T = converted %int_5, [template = ] diff --git a/toolchain/check/testdata/let/fail_generic_import.carbon b/toolchain/check/testdata/let/fail_generic_import.carbon index 48966f1972ad3..4fb47a0440981 100644 --- a/toolchain/check/testdata/let/fail_generic_import.carbon +++ b/toolchain/check/testdata/let/fail_generic_import.carbon @@ -32,14 +32,12 @@ let a: T = 0; // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -56,10 +54,8 @@ let a: T = 0; // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc8_19.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc8_19.2: type = converted %int.make_type_signed, %.loc8_19.1 [template = constants.%i32] -// CHECK:STDOUT: %T: type = bind_name T, %.loc8_19.2 +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %T: type = bind_name T, %i32 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/let/fail_missing_value.carbon b/toolchain/check/testdata/let/fail_missing_value.carbon index d8d71ba5d5546..c66ed6d5179f4 100644 --- a/toolchain/check/testdata/let/fail_missing_value.carbon +++ b/toolchain/check/testdata/let/fail_missing_value.carbon @@ -25,16 +25,14 @@ fn F() { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -48,9 +46,7 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc15_8.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc15_8.2: type = converted %int.make_type_signed, %.loc15_8.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %n: %i32 = bind_name n, // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {} // CHECK:STDOUT: } @@ -58,9 +54,7 @@ fn F() { // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc21_10.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc21_10.2: type = converted %int.make_type_signed, %.loc21_10.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %n: %i32 = bind_name n, // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/let/fail_modifiers.carbon b/toolchain/check/testdata/let/fail_modifiers.carbon index b897207a54e39..0d6c751f4d8bc 100644 --- a/toolchain/check/testdata/let/fail_modifiers.carbon +++ b/toolchain/check/testdata/let/fail_modifiers.carbon @@ -87,15 +87,13 @@ protected protected let i: i32 = 1; // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] // CHECK:STDOUT: } @@ -103,7 +101,7 @@ protected protected let i: i32 = 1; // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -123,43 +121,27 @@ protected protected let i: i32 = 1; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int_32.loc15: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc15: init type = call constants.%Int(%int_32.loc15) [template = constants.%i32] -// CHECK:STDOUT: %.loc15_18.1: type = value_of_initializer %int.make_type_signed.loc15 [template = constants.%i32] -// CHECK:STDOUT: %.loc15_18.2: type = converted %int.make_type_signed.loc15, %.loc15_18.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc15: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc21: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc21: init type = call constants.%Int(%int_32.loc21) [template = constants.%i32] -// CHECK:STDOUT: %.loc21_16.1: type = value_of_initializer %int.make_type_signed.loc21 [template = constants.%i32] -// CHECK:STDOUT: %.loc21_16.2: type = converted %int.make_type_signed.loc21, %.loc21_16.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc21: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc27: init type = call constants.%Int(%int_32.loc27) [template = constants.%i32] -// CHECK:STDOUT: %.loc27_14.1: type = value_of_initializer %int.make_type_signed.loc27 [template = constants.%i32] -// CHECK:STDOUT: %.loc27_14.2: type = converted %int.make_type_signed.loc27, %.loc27_14.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc33: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc33: init type = call constants.%Int(%int_32.loc33) [template = constants.%i32] -// CHECK:STDOUT: %.loc33_16.1: type = value_of_initializer %int.make_type_signed.loc33 [template = constants.%i32] -// CHECK:STDOUT: %.loc33_16.2: type = converted %int.make_type_signed.loc33, %.loc33_16.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc33: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc46: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc46: init type = call constants.%Int(%int_32.loc46) [template = constants.%i32] -// CHECK:STDOUT: %.loc46_22.1: type = value_of_initializer %int.make_type_signed.loc46 [template = constants.%i32] -// CHECK:STDOUT: %.loc46_22.2: type = converted %int.make_type_signed.loc46, %.loc46_22.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc46: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc59: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc59: init type = call constants.%Int(%int_32.loc59) [template = constants.%i32] -// CHECK:STDOUT: %.loc59_24.1: type = value_of_initializer %int.make_type_signed.loc59 [template = constants.%i32] -// CHECK:STDOUT: %.loc59_24.2: type = converted %int.make_type_signed.loc59, %.loc59_24.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc59: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc72: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc72: init type = call constants.%Int(%int_32.loc72) [template = constants.%i32] -// CHECK:STDOUT: %.loc72_26.1: type = value_of_initializer %int.make_type_signed.loc72 [template = constants.%i32] -// CHECK:STDOUT: %.loc72_26.2: type = converted %int.make_type_signed.loc72, %.loc72_26.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc72: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc84: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc84: init type = call constants.%Int(%int_32.loc84) [template = constants.%i32] -// CHECK:STDOUT: %.loc84_28.1: type = value_of_initializer %int.make_type_signed.loc84 [template = constants.%i32] -// CHECK:STDOUT: %.loc84_28.2: type = converted %int.make_type_signed.loc84, %.loc84_28.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc84: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_1.loc15: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc15: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc15: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc15: = bound_method %int_1.loc15, %impl.elem0.loc15 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn.loc15: = specific_function %Convert.bound.loc15, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc15: init %i32 = call %Convert.specific_fn.loc15(%int_1.loc15) [template = constants.%int_1.2] @@ -167,7 +149,7 @@ protected protected let i: i32 = 1; // CHECK:STDOUT: %.loc15_25.2: %i32 = converted %int_1.loc15, %.loc15_25.1 [template = constants.%int_1.2] // CHECK:STDOUT: %b: %i32 = bind_name b, %.loc15_25.2 // CHECK:STDOUT: %int_1.loc21: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc21: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc21: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc21: = bound_method %int_1.loc21, %impl.elem0.loc21 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn.loc21: = specific_function %Convert.bound.loc21, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc21: init %i32 = call %Convert.specific_fn.loc21(%int_1.loc21) [template = constants.%int_1.2] @@ -175,7 +157,7 @@ protected protected let i: i32 = 1; // CHECK:STDOUT: %.loc21_23.2: %i32 = converted %int_1.loc21, %.loc21_23.1 [template = constants.%int_1.2] // CHECK:STDOUT: %c: %i32 = bind_name c, %.loc21_23.2 // CHECK:STDOUT: %int_1.loc27: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc27: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc27: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc27: = bound_method %int_1.loc27, %impl.elem0.loc27 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn.loc27: = specific_function %Convert.bound.loc27, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc27: init %i32 = call %Convert.specific_fn.loc27(%int_1.loc27) [template = constants.%int_1.2] @@ -183,7 +165,7 @@ protected protected let i: i32 = 1; // CHECK:STDOUT: %.loc27_21.2: %i32 = converted %int_1.loc27, %.loc27_21.1 [template = constants.%int_1.2] // CHECK:STDOUT: %d: %i32 = bind_name d, %.loc27_21.2 // CHECK:STDOUT: %int_1.loc33: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc33: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc33: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc33: = bound_method %int_1.loc33, %impl.elem0.loc33 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn.loc33: = specific_function %Convert.bound.loc33, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc33: init %i32 = call %Convert.specific_fn.loc33(%int_1.loc33) [template = constants.%int_1.2] @@ -191,7 +173,7 @@ protected protected let i: i32 = 1; // CHECK:STDOUT: %.loc33_23.2: %i32 = converted %int_1.loc33, %.loc33_23.1 [template = constants.%int_1.2] // CHECK:STDOUT: %e: %i32 = bind_name e, %.loc33_23.2 // CHECK:STDOUT: %int_1.loc46: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc46: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc46: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc46: = bound_method %int_1.loc46, %impl.elem0.loc46 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn.loc46: = specific_function %Convert.bound.loc46, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc46: init %i32 = call %Convert.specific_fn.loc46(%int_1.loc46) [template = constants.%int_1.2] @@ -199,7 +181,7 @@ protected protected let i: i32 = 1; // CHECK:STDOUT: %.loc46_29.2: %i32 = converted %int_1.loc46, %.loc46_29.1 [template = constants.%int_1.2] // CHECK:STDOUT: %f: %i32 = bind_name f, %.loc46_29.2 // CHECK:STDOUT: %int_1.loc59: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc59: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc59: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc59: = bound_method %int_1.loc59, %impl.elem0.loc59 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn.loc59: = specific_function %Convert.bound.loc59, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc59: init %i32 = call %Convert.specific_fn.loc59(%int_1.loc59) [template = constants.%int_1.2] @@ -207,7 +189,7 @@ protected protected let i: i32 = 1; // CHECK:STDOUT: %.loc59_31.2: %i32 = converted %int_1.loc59, %.loc59_31.1 [template = constants.%int_1.2] // CHECK:STDOUT: %g: %i32 = bind_name g, %.loc59_31.2 // CHECK:STDOUT: %int_1.loc72: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc72: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc72: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc72: = bound_method %int_1.loc72, %impl.elem0.loc72 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn.loc72: = specific_function %Convert.bound.loc72, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc72: init %i32 = call %Convert.specific_fn.loc72(%int_1.loc72) [template = constants.%int_1.2] @@ -215,7 +197,7 @@ protected protected let i: i32 = 1; // CHECK:STDOUT: %.loc72_33.2: %i32 = converted %int_1.loc72, %.loc72_33.1 [template = constants.%int_1.2] // CHECK:STDOUT: %h: %i32 = bind_name h, %.loc72_33.2 // CHECK:STDOUT: %int_1.loc84: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc84: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc84: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc84: = bound_method %int_1.loc84, %impl.elem0.loc84 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn.loc84: = specific_function %Convert.bound.loc84, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc84: init %i32 = call %Convert.specific_fn.loc84(%int_1.loc84) [template = constants.%int_1.2] diff --git a/toolchain/check/testdata/let/fail_use_in_init.carbon b/toolchain/check/testdata/let/fail_use_in_init.carbon index 9621da627dc5f..0d3624683580f 100644 --- a/toolchain/check/testdata/let/fail_use_in_init.carbon +++ b/toolchain/check/testdata/let/fail_use_in_init.carbon @@ -21,14 +21,12 @@ fn F() { // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -46,9 +44,7 @@ fn F() { // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc15_10.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc15_10.2: type = converted %int.make_type_signed, %.loc15_10.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.ref: = name_ref a, [template = ] // CHECK:STDOUT: %a: %i32 = bind_name a, // CHECK:STDOUT: return diff --git a/toolchain/check/testdata/let/generic.carbon b/toolchain/check/testdata/let/generic.carbon index 1e558014d70d1..630faff440d1d 100644 --- a/toolchain/check/testdata/let/generic.carbon +++ b/toolchain/check/testdata/let/generic.carbon @@ -20,16 +20,14 @@ fn F() { // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] // CHECK:STDOUT: %ptr: type = ptr_type %T [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -47,10 +45,8 @@ fn F() { // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc12_21.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc12_21.2: type = converted %int.make_type_signed, %.loc12_21.1 [template = constants.%i32] -// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0, %.loc12_21.2 [symbolic = constants.%T] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0, %i32 [symbolic = constants.%T] // CHECK:STDOUT: %T.ref.loc13: type = name_ref T, %T [symbolic = constants.%T] // CHECK:STDOUT: %ptr: type = ptr_type %T [symbolic = constants.%ptr] // CHECK:STDOUT: %p.var: ref %ptr = var p diff --git a/toolchain/check/testdata/let/generic_import.carbon b/toolchain/check/testdata/let/generic_import.carbon index 838c6909ffd89..158f872225808 100644 --- a/toolchain/check/testdata/let/generic_import.carbon +++ b/toolchain/check/testdata/let/generic_import.carbon @@ -36,14 +36,12 @@ var b: T = *a; // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -60,10 +58,8 @@ var b: T = *a; // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc8_19.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc8_19.2: type = converted %int.make_type_signed, %.loc8_19.1 [template = constants.%i32] -// CHECK:STDOUT: %T: type = bind_name T, %.loc8_19.2 +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %T: type = bind_name T, %i32 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/let/global.carbon b/toolchain/check/testdata/let/global.carbon index 52b1622af770e..8dc64d81de618 100644 --- a/toolchain/check/testdata/let/global.carbon +++ b/toolchain/check/testdata/let/global.carbon @@ -16,15 +16,13 @@ fn F() -> i32 { return n; } // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] @@ -34,7 +32,7 @@ fn F() -> i32 { return n; } // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -48,17 +46,13 @@ fn F() -> i32 { return n; } // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_8.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc11_8.2: type = converted %int.make_type_signed, %.loc11_8.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc13_11.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc13_11.2: type = converted %int.make_type_signed, %.loc13_11.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } @@ -73,7 +67,7 @@ fn F() -> i32 { return n; } // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_1) [template = constants.%int_1.2] diff --git a/toolchain/check/testdata/let/local.carbon b/toolchain/check/testdata/let/local.carbon index 72ef42b3daf56..f223b422a9f9c 100644 --- a/toolchain/check/testdata/let/local.carbon +++ b/toolchain/check/testdata/let/local.carbon @@ -17,16 +17,14 @@ fn F(a: i32) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -45,13 +43,9 @@ fn F(a: i32) -> i32 { // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc11_9: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11_9: init type = call constants.%Int(%int_32.loc11_9) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_9.1: type = value_of_initializer %int.make_type_signed.loc11_9 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_9.2: type = converted %int.make_type_signed.loc11_9, %.loc11_9.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc11_9: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc11_17: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11_17: init type = call constants.%Int(%int_32.loc11_17) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_17.1: type = value_of_initializer %int.make_type_signed.loc11_17 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_17.2: type = converted %int.make_type_signed.loc11_17, %.loc11_17.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc11_17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 @@ -62,9 +56,7 @@ fn F(a: i32) -> i32 { // CHECK:STDOUT: fn @F(%a.param_patt: %i32) -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_32.loc12: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc12: init type = call constants.%Int(%int_32.loc12) [template = constants.%i32] -// CHECK:STDOUT: %.loc12_10.1: type = value_of_initializer %int.make_type_signed.loc12 [template = constants.%i32] -// CHECK:STDOUT: %.loc12_10.2: type = converted %int.make_type_signed.loc12, %.loc12_10.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc12: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.ref: %i32 = name_ref a, %a // CHECK:STDOUT: %b: %i32 = bind_name b, %a.ref // CHECK:STDOUT: %b.ref: %i32 = name_ref b, %b diff --git a/toolchain/check/testdata/let/shadowed_decl.carbon b/toolchain/check/testdata/let/shadowed_decl.carbon index ef8d27a4b693b..79352f85fef71 100644 --- a/toolchain/check/testdata/let/shadowed_decl.carbon +++ b/toolchain/check/testdata/let/shadowed_decl.carbon @@ -18,17 +18,15 @@ fn F(a: i32) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] // CHECK:STDOUT: } @@ -36,7 +34,7 @@ fn F(a: i32) -> i32 { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -55,13 +53,9 @@ fn F(a: i32) -> i32 { // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc11_9: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11_9: init type = call constants.%Int(%int_32.loc11_9) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_9.1: type = value_of_initializer %int.make_type_signed.loc11_9 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_9.2: type = converted %int.make_type_signed.loc11_9, %.loc11_9.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc11_9: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc11_17: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11_17: init type = call constants.%Int(%int_32.loc11_17) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_17.1: type = value_of_initializer %int.make_type_signed.loc11_17 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_17.2: type = converted %int.make_type_signed.loc11_17, %.loc11_17.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc11_17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %a.loc11: %i32 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 @@ -72,11 +66,9 @@ fn F(a: i32) -> i32 { // CHECK:STDOUT: fn @F(%a.param_patt: %i32) -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_32.loc12: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc12: init type = call constants.%Int(%int_32.loc12) [template = constants.%i32] -// CHECK:STDOUT: %.loc12_10.1: type = value_of_initializer %int.make_type_signed.loc12 [template = constants.%i32] -// CHECK:STDOUT: %.loc12_10.2: type = converted %int.make_type_signed.loc12, %.loc12_10.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc12: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_1) [template = constants.%int_1.2] diff --git a/toolchain/check/testdata/namespace/add_to_import.carbon b/toolchain/check/testdata/namespace/add_to_import.carbon index cf9853baa893b..de1aa87e438ca 100644 --- a/toolchain/check/testdata/namespace/add_to_import.carbon +++ b/toolchain/check/testdata/namespace/add_to_import.carbon @@ -44,17 +44,15 @@ var a: i32 = NS.A(); // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %A.type: type = fn_type @A [template] // CHECK:STDOUT: %A: %A.type = struct_value () [template] // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] // CHECK:STDOUT: } @@ -66,7 +64,7 @@ var a: i32 = NS.A(); // CHECK:STDOUT: } // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.2 -// CHECK:STDOUT: .ImplicitAs = %import_ref.3 +// CHECK:STDOUT: .ImplicitAs = %import_ref.6 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -86,16 +84,12 @@ var a: i32 = NS.A(); // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc4_14.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc4_14.2: type = converted %int.make_type_signed, %.loc4_14.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc6_8.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc6_8.2: type = converted %int.make_type_signed, %.loc6_8.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.var: ref %i32 = var a // CHECK:STDOUT: %a: ref %i32 = bind_name a, %a.var // CHECK:STDOUT: } @@ -103,7 +97,7 @@ var a: i32 = NS.A(); // CHECK:STDOUT: fn @A() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.2] diff --git a/toolchain/check/testdata/namespace/alias.carbon b/toolchain/check/testdata/namespace/alias.carbon index 8a45f378e1ca0..a4d4b3871c8a9 100644 --- a/toolchain/check/testdata/namespace/alias.carbon +++ b/toolchain/check/testdata/namespace/alias.carbon @@ -24,17 +24,15 @@ fn D() -> i32 { return C(); } // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %A.type: type = fn_type @A [template] // CHECK:STDOUT: %A: %A.type = struct_value () [template] // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] // CHECK:STDOUT: %B.type: type = fn_type @B [template] @@ -46,7 +44,7 @@ fn D() -> i32 { return C(); } // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -72,9 +70,7 @@ fn D() -> i32 { return C(); } // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc15_14.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc15_14.2: type = converted %int.make_type_signed, %.loc15_14.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } @@ -83,9 +79,7 @@ fn D() -> i32 { return C(); } // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc17_11.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc17_11.2: type = converted %int.make_type_signed, %.loc17_11.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } @@ -97,9 +91,7 @@ fn D() -> i32 { return C(); } // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc21_11.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc21_11.2: type = converted %int.make_type_signed, %.loc21_11.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } @@ -108,7 +100,7 @@ fn D() -> i32 { return C(); } // CHECK:STDOUT: fn @A() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.2] diff --git a/toolchain/check/testdata/namespace/fail_decl_in_alias.carbon b/toolchain/check/testdata/namespace/fail_decl_in_alias.carbon index 792b21c69d610..cd75ed6c4d980 100644 --- a/toolchain/check/testdata/namespace/fail_decl_in_alias.carbon +++ b/toolchain/check/testdata/namespace/fail_decl_in_alias.carbon @@ -25,17 +25,15 @@ fn ns.A() -> i32 { return 0; } // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %.type: type = fn_type @.1 [template] // CHECK:STDOUT: %.1: %.type = struct_value () [template] // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] // CHECK:STDOUT: } @@ -43,7 +41,7 @@ fn ns.A() -> i32 { return 0; } // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -64,9 +62,7 @@ fn ns.A() -> i32 { return 0; } // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc22_14.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc22_14.2: type = converted %int.make_type_signed, %.loc22_14.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } @@ -75,7 +71,7 @@ fn ns.A() -> i32 { return 0; } // CHECK:STDOUT: fn @.1() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.2] diff --git a/toolchain/check/testdata/namespace/fail_params.carbon b/toolchain/check/testdata/namespace/fail_params.carbon index 5bb7936c98443..f3e28d07db729 100644 --- a/toolchain/check/testdata/namespace/fail_params.carbon +++ b/toolchain/check/testdata/namespace/fail_params.carbon @@ -44,9 +44,7 @@ fn D(T:! type).F() {} // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %.type: type = fn_type @.1 [template] @@ -55,7 +53,7 @@ fn D(T:! type).F() {} // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -75,9 +73,7 @@ fn D(T:! type).F() {} // CHECK:STDOUT: } // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {} // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc24_16.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc24_16.2: type = converted %int.make_type_signed, %.loc24_16.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %n.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %n: %i32 = bind_name n, %n.param // CHECK:STDOUT: %B: = namespace [template] {} diff --git a/toolchain/check/testdata/namespace/shadow.carbon b/toolchain/check/testdata/namespace/shadow.carbon index ad6f48dfacec4..cfdbc63cb028e 100644 --- a/toolchain/check/testdata/namespace/shadow.carbon +++ b/toolchain/check/testdata/namespace/shadow.carbon @@ -36,18 +36,16 @@ fn N.M.B() -> i32 { // CHECK:STDOUT: %A.type.2: type = fn_type @A.2 [template] // CHECK:STDOUT: %A.2: %A.type.2 = struct_value () [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %B.type: type = fn_type @B [template] // CHECK:STDOUT: %B: %B.type = struct_value () [template] // CHECK:STDOUT: %true: bool = bool_literal true [template] // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] // CHECK:STDOUT: } @@ -55,7 +53,7 @@ fn N.M.B() -> i32 { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -82,9 +80,7 @@ fn N.M.B() -> i32 { // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc18: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc18: init type = call constants.%Int(%int_32.loc18) [template = constants.%i32] -// CHECK:STDOUT: %.loc18_15.1: type = value_of_initializer %int.make_type_signed.loc18 [template = constants.%i32] -// CHECK:STDOUT: %.loc18_15.2: type = converted %int.make_type_signed.loc18, %.loc18_15.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc18: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } @@ -103,25 +99,23 @@ fn N.M.B() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: !if.then: // CHECK:STDOUT: %int_32.loc22: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc22: init type = call constants.%Int(%int_32.loc22) [template = constants.%i32] -// CHECK:STDOUT: %.loc22_12.1: type = value_of_initializer %int.make_type_signed.loc22 [template = constants.%i32] -// CHECK:STDOUT: %.loc22_12.2: type = converted %int.make_type_signed.loc22, %.loc22_12.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %A.var: ref %i32 = var A // CHECK:STDOUT: %A: ref %i32 = bind_name A, %A.var // CHECK:STDOUT: %int_0.loc22: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0.loc22: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc22: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc22: = bound_method %int_0.loc22, %impl.elem0.loc22 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn.loc22: = specific_function %Convert.bound.loc22, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc22: init %i32 = call %Convert.specific_fn.loc22(%int_0.loc22) [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc22_19: init %i32 = converted %int_0.loc22, %int.convert_checked.loc22 [template = constants.%int_0.2] -// CHECK:STDOUT: assign %A.var, %.loc22_19 +// CHECK:STDOUT: %.loc22: init %i32 = converted %int_0.loc22, %int.convert_checked.loc22 [template = constants.%int_0.2] +// CHECK:STDOUT: assign %A.var, %.loc22 // CHECK:STDOUT: %A.ref.loc25: ref %i32 = name_ref A, %A // CHECK:STDOUT: %.loc25: %i32 = bind_value %A.ref.loc25 // CHECK:STDOUT: return %.loc25 // CHECK:STDOUT: // CHECK:STDOUT: !if.else: // CHECK:STDOUT: %int_0.loc27: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0.loc27: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc27: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc27: = bound_method %int_0.loc27, %impl.elem0.loc27 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn.loc27: = specific_function %Convert.bound.loc27, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc27: init %i32 = call %Convert.specific_fn.loc27(%int_0.loc27) [template = constants.%int_0.2] diff --git a/toolchain/check/testdata/operators/builtin/assignment.carbon b/toolchain/check/testdata/operators/builtin/assignment.carbon index 1d46afbf9268f..f2c05f5327193 100644 --- a/toolchain/check/testdata/operators/builtin/assignment.carbon +++ b/toolchain/check/testdata/operators/builtin/assignment.carbon @@ -32,19 +32,17 @@ fn Main() { // CHECK:STDOUT: %Main.type: type = fn_type @Main [template] // CHECK:STDOUT: %Main: %Main.type = struct_value () [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %int_12.1: Core.IntLiteral = int_value 12 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_12.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_12.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_12.2: %i32 = int_value 12 [template] // CHECK:STDOUT: %int_9.1: Core.IntLiteral = int_value 9 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_9.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_9.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_9.2: %i32 = int_value 9 [template] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (type, type) [template] @@ -52,20 +50,20 @@ fn Main() { // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %tuple.type.3: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] -// CHECK:STDOUT: %Convert.bound.4: = bound_method %int_2.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.4: = bound_method %int_2.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.4: = specific_function %Convert.bound.4, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] // CHECK:STDOUT: %tuple: %tuple.type.2 = tuple_value (%int_1.2, %int_2.2) [template] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %int_3.1: Core.IntLiteral = int_value 3 [template] -// CHECK:STDOUT: %Convert.bound.5: = bound_method %int_3.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.5: = bound_method %int_3.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.5: = specific_function %Convert.bound.5, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_3.2: %i32 = int_value 3 [template] // CHECK:STDOUT: %int_4.1: Core.IntLiteral = int_value 4 [template] -// CHECK:STDOUT: %Convert.bound.6: = bound_method %int_4.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.6: = bound_method %int_4.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.6: = specific_function %Convert.bound.6, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_4.2: %i32 = int_value 4 [template] // CHECK:STDOUT: %struct_type.a.b.1: type = struct_type {.a: %i32, .b: %i32} [template] @@ -73,12 +71,12 @@ fn Main() { // CHECK:STDOUT: %struct: %struct_type.a.b.1 = struct_value (%int_1.2, %int_2.2) [template] // CHECK:STDOUT: %ptr.3: type = ptr_type %i32 [template] // CHECK:STDOUT: %int_5.1: Core.IntLiteral = int_value 5 [template] -// CHECK:STDOUT: %Convert.bound.7: = bound_method %int_5.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.7: = bound_method %int_5.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.7: = specific_function %Convert.bound.7, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_5.2: %i32 = int_value 5 [template] // CHECK:STDOUT: %true: bool = bool_literal true [template] // CHECK:STDOUT: %int_10.1: Core.IntLiteral = int_value 10 [template] -// CHECK:STDOUT: %Convert.bound.8: = bound_method %int_10.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.8: = bound_method %int_10.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.8: = specific_function %Convert.bound.8, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_10.2: %i32 = int_value 10 [template] // CHECK:STDOUT: } @@ -86,7 +84,7 @@ fn Main() { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -104,49 +102,43 @@ fn Main() { // CHECK:STDOUT: fn @Main() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_32.loc12: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc12: init type = call constants.%Int(%int_32.loc12) [template = constants.%i32] -// CHECK:STDOUT: %.loc12_10.1: type = value_of_initializer %int.make_type_signed.loc12 [template = constants.%i32] -// CHECK:STDOUT: %.loc12_10.2: type = converted %int.make_type_signed.loc12, %.loc12_10.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc12: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.var: ref %i32 = var a // CHECK:STDOUT: %a: ref %i32 = bind_name a, %a.var // CHECK:STDOUT: %int_12: Core.IntLiteral = int_value 12 [template = constants.%int_12.1] -// CHECK:STDOUT: %impl.elem0.loc12: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc12: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc12: = bound_method %int_12, %impl.elem0.loc12 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc12: = specific_function %Convert.bound.loc12, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc12: init %i32 = call %Convert.specific_fn.loc12(%int_12) [template = constants.%int_12.2] -// CHECK:STDOUT: %.loc12_18: init %i32 = converted %int_12, %int.convert_checked.loc12 [template = constants.%int_12.2] -// CHECK:STDOUT: assign %a.var, %.loc12_18 +// CHECK:STDOUT: %.loc12: init %i32 = converted %int_12, %int.convert_checked.loc12 [template = constants.%int_12.2] +// CHECK:STDOUT: assign %a.var, %.loc12 // CHECK:STDOUT: %a.ref.loc13: ref %i32 = name_ref a, %a // CHECK:STDOUT: %int_9: Core.IntLiteral = int_value 9 [template = constants.%int_9.1] -// CHECK:STDOUT: %impl.elem0.loc13: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc13: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc13: = bound_method %int_9, %impl.elem0.loc13 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc13: = specific_function %Convert.bound.loc13, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc13: init %i32 = call %Convert.specific_fn.loc13(%int_9) [template = constants.%int_9.2] // CHECK:STDOUT: %.loc13: init %i32 = converted %int_9, %int.convert_checked.loc13 [template = constants.%int_9.2] // CHECK:STDOUT: assign %a.ref.loc13, %.loc13 // CHECK:STDOUT: %int_32.loc15_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc15_11: init type = call constants.%Int(%int_32.loc15_11) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc15_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc15_16: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc15_16: init type = call constants.%Int(%int_32.loc15_16) [template = constants.%i32] -// CHECK:STDOUT: %.loc15_19.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc15_11, %int.make_type_signed.loc15_16) -// CHECK:STDOUT: %.loc15_19.2: type = value_of_initializer %int.make_type_signed.loc15_11 [template = constants.%i32] -// CHECK:STDOUT: %.loc15_19.3: type = converted %int.make_type_signed.loc15_11, %.loc15_19.2 [template = constants.%i32] -// CHECK:STDOUT: %.loc15_19.4: type = value_of_initializer %int.make_type_signed.loc15_16 [template = constants.%i32] -// CHECK:STDOUT: %.loc15_19.5: type = converted %int.make_type_signed.loc15_16, %.loc15_19.4 [template = constants.%i32] -// CHECK:STDOUT: %.loc15_19.6: type = converted %.loc15_19.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] +// CHECK:STDOUT: %i32.loc15_16: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc15_19.1: %tuple.type.1 = tuple_literal (%i32.loc15_11, %i32.loc15_16) +// CHECK:STDOUT: %.loc15_19.2: type = converted %.loc15_19.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %b.var: ref %tuple.type.2 = var b // CHECK:STDOUT: %b: ref %tuple.type.2 = bind_name b, %b.var // CHECK:STDOUT: %int_1.loc15: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_2.loc15: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %.loc15_28.1: %tuple.type.3 = tuple_literal (%int_1.loc15, %int_2.loc15) -// CHECK:STDOUT: %impl.elem0.loc15_28.1: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc15_28.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc15_28.1: = bound_method %int_1.loc15, %impl.elem0.loc15_28.1 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc15_28.1: = specific_function %Convert.bound.loc15_28.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc15_28.1: init %i32 = call %Convert.specific_fn.loc15_28.1(%int_1.loc15) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc15_28.2: init %i32 = converted %int_1.loc15, %int.convert_checked.loc15_28.1 [template = constants.%int_1.2] // CHECK:STDOUT: %tuple.elem0.loc15: ref %i32 = tuple_access %b.var, element0 // CHECK:STDOUT: %.loc15_28.3: init %i32 = initialize_from %.loc15_28.2 to %tuple.elem0.loc15 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc15_28.2: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc15_28.2: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc15_28.2: = bound_method %int_2.loc15, %impl.elem0.loc15_28.2 [template = constants.%Convert.bound.4] // CHECK:STDOUT: %Convert.specific_fn.loc15_28.2: = specific_function %Convert.bound.loc15_28.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.4] // CHECK:STDOUT: %int.convert_checked.loc15_28.2: init %i32 = call %Convert.specific_fn.loc15_28.2(%int_2.loc15) [template = constants.%int_2.2] @@ -160,7 +152,7 @@ fn Main() { // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0] // CHECK:STDOUT: %tuple.elem0.loc16: ref %i32 = tuple_access %b.ref.loc16, element0 // CHECK:STDOUT: %int_3.loc16: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] -// CHECK:STDOUT: %impl.elem0.loc16: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc16: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc16: = bound_method %int_3.loc16, %impl.elem0.loc16 [template = constants.%Convert.bound.5] // CHECK:STDOUT: %Convert.specific_fn.loc16: = specific_function %Convert.bound.loc16, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.5] // CHECK:STDOUT: %int.convert_checked.loc16: init %i32 = call %Convert.specific_fn.loc16(%int_3.loc16) [template = constants.%int_3.2] @@ -170,34 +162,30 @@ fn Main() { // CHECK:STDOUT: %int_1.loc17: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %tuple.elem1.loc17: ref %i32 = tuple_access %b.ref.loc17, element1 // CHECK:STDOUT: %int_4.loc17: Core.IntLiteral = int_value 4 [template = constants.%int_4.1] -// CHECK:STDOUT: %impl.elem0.loc17: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc17: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc17: = bound_method %int_4.loc17, %impl.elem0.loc17 [template = constants.%Convert.bound.6] // CHECK:STDOUT: %Convert.specific_fn.loc17: = specific_function %Convert.bound.loc17, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.6] // CHECK:STDOUT: %int.convert_checked.loc17: init %i32 = call %Convert.specific_fn.loc17(%int_4.loc17) [template = constants.%int_4.2] // CHECK:STDOUT: %.loc17: init %i32 = converted %int_4.loc17, %int.convert_checked.loc17 [template = constants.%int_4.2] // CHECK:STDOUT: assign %tuple.elem1.loc17, %.loc17 // CHECK:STDOUT: %int_32.loc19_15: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc19_15: init type = call constants.%Int(%int_32.loc19_15) [template = constants.%i32] -// CHECK:STDOUT: %.loc19_15.1: type = value_of_initializer %int.make_type_signed.loc19_15 [template = constants.%i32] -// CHECK:STDOUT: %.loc19_15.2: type = converted %int.make_type_signed.loc19_15, %.loc19_15.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc19_15: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc19_24: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc19_24: init type = call constants.%Int(%int_32.loc19_24) [template = constants.%i32] -// CHECK:STDOUT: %.loc19_24.1: type = value_of_initializer %int.make_type_signed.loc19_24 [template = constants.%i32] -// CHECK:STDOUT: %.loc19_24.2: type = converted %int.make_type_signed.loc19_24, %.loc19_24.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc19_24: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %struct_type.a.b: type = struct_type {.a: %i32, .b: %i32} [template = constants.%struct_type.a.b.1] // CHECK:STDOUT: %c.var: ref %struct_type.a.b.1 = var c // CHECK:STDOUT: %c: ref %struct_type.a.b.1 = bind_name c, %c.var // CHECK:STDOUT: %int_1.loc19: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_2.loc19: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %.loc19_46.1: %struct_type.a.b.2 = struct_literal (%int_1.loc19, %int_2.loc19) -// CHECK:STDOUT: %impl.elem0.loc19_46.1: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc19_46.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc19_46.1: = bound_method %int_1.loc19, %impl.elem0.loc19_46.1 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc19_46.1: = specific_function %Convert.bound.loc19_46.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc19_46.1: init %i32 = call %Convert.specific_fn.loc19_46.1(%int_1.loc19) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc19_46.2: init %i32 = converted %int_1.loc19, %int.convert_checked.loc19_46.1 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc19_46.3: ref %i32 = struct_access %c.var, element0 // CHECK:STDOUT: %.loc19_46.4: init %i32 = initialize_from %.loc19_46.2 to %.loc19_46.3 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc19_46.2: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc19_46.2: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc19_46.2: = bound_method %int_2.loc19, %impl.elem0.loc19_46.2 [template = constants.%Convert.bound.4] // CHECK:STDOUT: %Convert.specific_fn.loc19_46.2: = specific_function %Convert.bound.loc19_46.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.4] // CHECK:STDOUT: %int.convert_checked.loc19_46.2: init %i32 = call %Convert.specific_fn.loc19_46.2(%int_2.loc19) [template = constants.%int_2.2] @@ -210,7 +198,7 @@ fn Main() { // CHECK:STDOUT: %c.ref.loc20: ref %struct_type.a.b.1 = name_ref c, %c // CHECK:STDOUT: %.loc20_4: ref %i32 = struct_access %c.ref.loc20, element0 // CHECK:STDOUT: %int_3.loc20: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] -// CHECK:STDOUT: %impl.elem0.loc20: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc20: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc20: = bound_method %int_3.loc20, %impl.elem0.loc20 [template = constants.%Convert.bound.5] // CHECK:STDOUT: %Convert.specific_fn.loc20: = specific_function %Convert.bound.loc20, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.5] // CHECK:STDOUT: %int.convert_checked.loc20: init %i32 = call %Convert.specific_fn.loc20(%int_3.loc20) [template = constants.%int_3.2] @@ -219,16 +207,14 @@ fn Main() { // CHECK:STDOUT: %c.ref.loc21: ref %struct_type.a.b.1 = name_ref c, %c // CHECK:STDOUT: %.loc21_4: ref %i32 = struct_access %c.ref.loc21, element1 // CHECK:STDOUT: %int_4.loc21: Core.IntLiteral = int_value 4 [template = constants.%int_4.1] -// CHECK:STDOUT: %impl.elem0.loc21: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc21: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc21: = bound_method %int_4.loc21, %impl.elem0.loc21 [template = constants.%Convert.bound.6] // CHECK:STDOUT: %Convert.specific_fn.loc21: = specific_function %Convert.bound.loc21, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.6] // CHECK:STDOUT: %int.convert_checked.loc21: init %i32 = call %Convert.specific_fn.loc21(%int_4.loc21) [template = constants.%int_4.2] // CHECK:STDOUT: %.loc21_7: init %i32 = converted %int_4.loc21, %int.convert_checked.loc21 [template = constants.%int_4.2] // CHECK:STDOUT: assign %.loc21_4, %.loc21_7 // CHECK:STDOUT: %int_32.loc23: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc23: init type = call constants.%Int(%int_32.loc23) [template = constants.%i32] -// CHECK:STDOUT: %.loc23_13.1: type = value_of_initializer %int.make_type_signed.loc23 [template = constants.%i32] -// CHECK:STDOUT: %.loc23_13.2: type = converted %int.make_type_signed.loc23, %.loc23_13.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc23: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %ptr: type = ptr_type %i32 [template = constants.%ptr.3] // CHECK:STDOUT: %p.var: ref %ptr.3 = var p // CHECK:STDOUT: %p: ref %ptr.3 = bind_name p, %p.var @@ -239,7 +225,7 @@ fn Main() { // CHECK:STDOUT: %.loc24_4: %ptr.3 = bind_value %p.ref.loc24 // CHECK:STDOUT: %.loc24_3: ref %i32 = deref %.loc24_4 // CHECK:STDOUT: %int_5: Core.IntLiteral = int_value 5 [template = constants.%int_5.1] -// CHECK:STDOUT: %impl.elem0.loc24: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc24: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc24: = bound_method %int_5, %impl.elem0.loc24 [template = constants.%Convert.bound.7] // CHECK:STDOUT: %Convert.specific_fn.loc24: = specific_function %Convert.bound.loc24, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.7] // CHECK:STDOUT: %int.convert_checked.loc24: init %i32 = call %Convert.specific_fn.loc24(%int_5) [template = constants.%int_5.2] @@ -262,7 +248,7 @@ fn Main() { // CHECK:STDOUT: %.loc26_5: %ptr.3 = block_arg !if.expr.result // CHECK:STDOUT: %.loc26_3: ref %i32 = deref %.loc26_5 // CHECK:STDOUT: %int_10: Core.IntLiteral = int_value 10 [template = constants.%int_10.1] -// CHECK:STDOUT: %impl.elem0.loc26: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc26: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc26: = bound_method %int_10, %impl.elem0.loc26 [template = constants.%Convert.bound.8] // CHECK:STDOUT: %Convert.specific_fn.loc26: = specific_function %Convert.bound.loc26, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.8] // CHECK:STDOUT: %int.convert_checked.loc26: init %i32 = call %Convert.specific_fn.loc26(%int_10) [template = constants.%int_10.2] diff --git a/toolchain/check/testdata/operators/builtin/fail_and_or_not_in_function.carbon b/toolchain/check/testdata/operators/builtin/fail_and_or_not_in_function.carbon index ae935e0852f8a..f04d66dcdb0d6 100644 --- a/toolchain/check/testdata/operators/builtin/fail_and_or_not_in_function.carbon +++ b/toolchain/check/testdata/operators/builtin/fail_and_or_not_in_function.carbon @@ -45,9 +45,7 @@ var or_: F(true or true); // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [template] // CHECK:STDOUT: %Float.type: type = fn_type @Float [template] // CHECK:STDOUT: %Float: %Float.type = struct_value () [template] @@ -58,8 +56,8 @@ var or_: F(true or true); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { -// CHECK:STDOUT: %.loc42_17: bool = block_arg [template = constants.%true] -// CHECK:STDOUT: %F.call: init type = call .inst85.loc42_10(%.loc42_17) +// CHECK:STDOUT: %.loc42_17: bool = block_arg [template = constants.%true] +// CHECK:STDOUT: %F.call: init type = call .inst96.loc42_10(%.loc42_17) // CHECK:STDOUT: %.loc42_24.1: type = value_of_initializer %F.call // CHECK:STDOUT: %.loc42_24.2: type = converted %F.call, %.loc42_24.1 // CHECK:STDOUT: %or_.var: ref = var or_ @@ -73,10 +71,8 @@ var or_: F(true or true); // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then: // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc13_20.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc13_20.2: type = converted %int.make_type_signed, %.loc13_20.1 [template = constants.%i32] -// CHECK:STDOUT: br !if.expr.result(%.loc13_20.2) +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: br !if.expr.result(%i32) // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.else: // CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [template = constants.%int_64] diff --git a/toolchain/check/testdata/operators/builtin/fail_assignment_to_non_assignable.carbon b/toolchain/check/testdata/operators/builtin/fail_assignment_to_non_assignable.carbon index 3227454354cc4..19720122b217c 100644 --- a/toolchain/check/testdata/operators/builtin/fail_assignment_to_non_assignable.carbon +++ b/toolchain/check/testdata/operators/builtin/fail_assignment_to_non_assignable.carbon @@ -60,9 +60,7 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %Main.type: type = fn_type @Main [template] @@ -70,10 +68,10 @@ fn Main() { // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [template] @@ -82,11 +80,11 @@ fn Main() { // CHECK:STDOUT: %tuple.1: %tuple.type.1 = tuple_value (%int_3.1, %int_4) [template] // CHECK:STDOUT: %tuple.2: %tuple.type.1 = tuple_value (%int_1.1, %int_2.1) [template] // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_0.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] // CHECK:STDOUT: %tuple.type.2: type = tuple_type (%i32, %i32) [template] -// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_2.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_2.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] // CHECK:STDOUT: %tuple.3: %tuple.type.2 = tuple_value (%int_1.2, %int_2.2) [template] @@ -95,11 +93,11 @@ fn Main() { // CHECK:STDOUT: %struct.1: %struct_type.x.y = struct_value (%int_3.1, %int_4) [template] // CHECK:STDOUT: %struct.2: %struct_type.x.y = struct_value (%int_1.1, %int_2.1) [template] // CHECK:STDOUT: %true: bool = bool_literal true [template] -// CHECK:STDOUT: %Convert.bound.4: = bound_method %int_3.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.4: = bound_method %int_3.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.4: = specific_function %Convert.bound.4, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_3.2: %i32 = int_value 3 [template] // CHECK:STDOUT: %int_10.1: Core.IntLiteral = int_value 10 [template] -// CHECK:STDOUT: %Convert.bound.5: = bound_method %int_10.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.5: = bound_method %int_10.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.5: = specific_function %Convert.bound.5, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_10.2: %i32 = int_value 10 [template] // CHECK:STDOUT: } @@ -107,7 +105,7 @@ fn Main() { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -125,9 +123,7 @@ fn Main() { // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc11_11.2: type = converted %int.make_type_signed, %.loc11_11.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } @@ -144,7 +140,7 @@ fn Main() { // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [template = constants.%F] // CHECK:STDOUT: %F.call: init %i32 = call %F.ref() // CHECK:STDOUT: %int_1.loc23: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc23: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc23: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc23: = bound_method %int_1.loc23, %impl.elem0.loc23 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc23: = specific_function %Convert.bound.loc23, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc23: init %i32 = call %Convert.specific_fn.loc23(%int_1.loc23) [template = constants.%int_1.2] @@ -166,32 +162,30 @@ fn Main() { // CHECK:STDOUT: %tuple.loc28: %tuple.type.1 = tuple_value (%int_1.loc28, %int_2.loc28) [template = constants.%tuple.2] // CHECK:STDOUT: %.loc28_8.2: %tuple.type.1 = converted %.loc28_8.1, %tuple.loc28 [template = constants.%tuple.2] // CHECK:STDOUT: %int_32.loc29: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc29: init type = call constants.%Int(%int_32.loc29) [template = constants.%i32] -// CHECK:STDOUT: %.loc29_10.1: type = value_of_initializer %int.make_type_signed.loc29 [template = constants.%i32] -// CHECK:STDOUT: %.loc29_10.2: type = converted %int.make_type_signed.loc29, %.loc29_10.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc29: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %n.var: ref %i32 = var n // CHECK:STDOUT: %n: ref %i32 = bind_name n, %n.var // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0.loc29: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc29: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc29: = bound_method %int_0, %impl.elem0.loc29 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc29: = specific_function %Convert.bound.loc29, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc29: init %i32 = call %Convert.specific_fn.loc29(%int_0) [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc29_17: init %i32 = converted %int_0, %int.convert_checked.loc29 [template = constants.%int_0.2] -// CHECK:STDOUT: assign %n.var, %.loc29_17 +// CHECK:STDOUT: %.loc29: init %i32 = converted %int_0, %int.convert_checked.loc29 [template = constants.%int_0.2] +// CHECK:STDOUT: assign %n.var, %.loc29 // CHECK:STDOUT: %n.ref.loc34_4: ref %i32 = name_ref n, %n // CHECK:STDOUT: %n.ref.loc34_7: ref %i32 = name_ref n, %n // CHECK:STDOUT: %.loc34_8.1: %tuple.type.2 = tuple_literal (%n.ref.loc34_4, %n.ref.loc34_7) // CHECK:STDOUT: %int_1.loc34: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_2.loc34: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %.loc34_17.1: %tuple.type.1 = tuple_literal (%int_1.loc34, %int_2.loc34) -// CHECK:STDOUT: %impl.elem0.loc34_17.1: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc34_17.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc34_17.1: = bound_method %int_1.loc34, %impl.elem0.loc34_17.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc34_17.1: = specific_function %Convert.bound.loc34_17.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc34_17.1: init %i32 = call %Convert.specific_fn.loc34_17.1(%int_1.loc34) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc34_17.2: init %i32 = converted %int_1.loc34, %int.convert_checked.loc34_17.1 [template = constants.%int_1.2] // CHECK:STDOUT: %tuple.elem0.loc34: %i32 = tuple_access %.loc34_8.1, element0 // CHECK:STDOUT: %.loc34_17.3: init %i32 = initialize_from %.loc34_17.2 to %tuple.elem0.loc34 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc34_17.2: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc34_17.2: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc34_17.2: = bound_method %int_2.loc34, %impl.elem0.loc34_17.2 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc34_17.2: = specific_function %Convert.bound.loc34_17.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc34_17.2: init %i32 = call %Convert.specific_fn.loc34_17.2(%int_2.loc34) [template = constants.%int_2.2] @@ -206,13 +200,11 @@ fn Main() { // CHECK:STDOUT: %tuple.loc34: %tuple.type.2 = tuple_value (%.loc34_4, %.loc34_7) // CHECK:STDOUT: %.loc34_8.2: %tuple.type.2 = converted %.loc34_8.1, %tuple.loc34 // CHECK:STDOUT: %int_32.loc39_3: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc39_3: init type = call constants.%Int(%int_32.loc39_3) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc39_3: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc39_9: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc39_9: init type = call constants.%Int(%int_32.loc39_9) [template = constants.%i32] -// CHECK:STDOUT: %.loc39_12.1: type = value_of_initializer %int.make_type_signed.loc39_9 [template = constants.%i32] -// CHECK:STDOUT: %.loc39_12.2: type = converted %int.make_type_signed.loc39_9, %.loc39_12.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc39_9: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %ptr: type = ptr_type %i32 [template = constants.%ptr.3] -// CHECK:STDOUT: assign %int.make_type_signed.loc39_3, %ptr +// CHECK:STDOUT: assign %i32.loc39_3, %ptr // CHECK:STDOUT: %int_1.loc44: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_2.loc44: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %.loc44_18.1: %struct_type.x.y = struct_literal (%int_1.loc44, %int_2.loc44) @@ -234,20 +226,18 @@ fn Main() { // CHECK:STDOUT: !if.expr.then.loc49: // CHECK:STDOUT: %int_1.loc49: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_32.loc49: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc49: init type = call constants.%Int(%int_32.loc49) [template = constants.%i32] -// CHECK:STDOUT: %.loc49_12.1: type = value_of_initializer %int.make_type_signed.loc49 [template = constants.%i32] -// CHECK:STDOUT: %.loc49_12.2: type = converted %int.make_type_signed.loc49, %.loc49_12.1 [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc49_12: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %i32.loc49: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %impl.elem0.loc49_12: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc49_12: = bound_method %int_1.loc49, %impl.elem0.loc49_12 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc49_12: = specific_function %Convert.bound.loc49_12, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc49_12: init %i32 = call %Convert.specific_fn.loc49_12(%int_1.loc49) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc49_12.3: %i32 = value_of_initializer %int.convert_checked.loc49_12 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc49_12.4: %i32 = converted %int_1.loc49, %.loc49_12.3 [template = constants.%int_1.2] -// CHECK:STDOUT: br !if.expr.result.loc49(%.loc49_12.4) +// CHECK:STDOUT: %.loc49_12.1: %i32 = value_of_initializer %int.convert_checked.loc49_12 [template = constants.%int_1.2] +// CHECK:STDOUT: %.loc49_12.2: %i32 = converted %int_1.loc49, %.loc49_12.1 [template = constants.%int_1.2] +// CHECK:STDOUT: br !if.expr.result.loc49(%.loc49_12.2) // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.else.loc49: // CHECK:STDOUT: %int_2.loc49: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %impl.elem0.loc49_19: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc49_19: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc49_19: = bound_method %int_2.loc49, %impl.elem0.loc49_19 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc49_19: = specific_function %Convert.bound.loc49_19, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc49_19: init %i32 = call %Convert.specific_fn.loc49_19(%int_2.loc49) [template = constants.%int_2.2] @@ -258,16 +248,14 @@ fn Main() { // CHECK:STDOUT: !if.expr.result.loc49: // CHECK:STDOUT: %.loc49_4: %i32 = block_arg !if.expr.result.loc49 [template = constants.%int_1.2] // CHECK:STDOUT: %int_3.loc49: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] -// CHECK:STDOUT: %impl.elem0.loc49_27: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc49_27: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc49_27: = bound_method %int_3.loc49, %impl.elem0.loc49_27 [template = constants.%Convert.bound.4] // CHECK:STDOUT: %Convert.specific_fn.loc49_27: = specific_function %Convert.bound.loc49_27, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.4] // CHECK:STDOUT: %int.convert_checked.loc49_27: init %i32 = call %Convert.specific_fn.loc49_27(%int_3.loc49) [template = constants.%int_3.2] // CHECK:STDOUT: %.loc49_27: init %i32 = converted %int_3.loc49, %int.convert_checked.loc49_27 [template = constants.%int_3.2] // CHECK:STDOUT: assign %.loc49_4, %.loc49_27 // CHECK:STDOUT: %int_32.loc52: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc52: init type = call constants.%Int(%int_32.loc52) [template = constants.%i32] -// CHECK:STDOUT: %.loc52_10.1: type = value_of_initializer %int.make_type_signed.loc52 [template = constants.%i32] -// CHECK:STDOUT: %.loc52_10.2: type = converted %int.make_type_signed.loc52, %.loc52_10.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc52: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.var: ref %i32 = var a // CHECK:STDOUT: %a: ref %i32 = bind_name a, %a.var // CHECK:STDOUT: %true.loc56: bool = bool_literal true [template = constants.%true] @@ -286,7 +274,7 @@ fn Main() { // CHECK:STDOUT: !if.expr.result.loc56: // CHECK:STDOUT: %.loc56_4: %i32 = block_arg !if.expr.result.loc56 // CHECK:STDOUT: %int_10: Core.IntLiteral = int_value 10 [template = constants.%int_10.1] -// CHECK:STDOUT: %impl.elem0.loc56: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc56: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc56: = bound_method %int_10, %impl.elem0.loc56 [template = constants.%Convert.bound.5] // CHECK:STDOUT: %Convert.specific_fn.loc56: = specific_function %Convert.bound.loc56, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.5] // CHECK:STDOUT: %int.convert_checked.loc56: init %i32 = call %Convert.specific_fn.loc56(%int_10) [template = constants.%int_10.2] diff --git a/toolchain/check/testdata/operators/builtin/fail_redundant_compound_access.carbon b/toolchain/check/testdata/operators/builtin/fail_redundant_compound_access.carbon index 66a2ba6133b25..0e3d3719ed03e 100644 --- a/toolchain/check/testdata/operators/builtin/fail_redundant_compound_access.carbon +++ b/toolchain/check/testdata/operators/builtin/fail_redundant_compound_access.carbon @@ -27,23 +27,21 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_0.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] // CHECK:STDOUT: %Main.type: type = fn_type @Main [template] // CHECK:STDOUT: %Main: %Main.type = struct_value () [template] // CHECK:STDOUT: %int_3.1: Core.IntLiteral = int_value 3 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_3.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_3.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_3.2: %i32 = int_value 3 [template] // CHECK:STDOUT: } @@ -51,7 +49,7 @@ fn Main() { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -69,9 +67,7 @@ fn Main() { // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc11_11.2: type = converted %int.make_type_signed, %.loc11_11.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } @@ -81,7 +77,7 @@ fn Main() { // CHECK:STDOUT: fn @F() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.2] @@ -93,18 +89,16 @@ fn Main() { // CHECK:STDOUT: fn @Main() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc14_10.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc14_10.2: type = converted %int.make_type_signed, %.loc14_10.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.var: ref %i32 = var a // CHECK:STDOUT: %a: ref %i32 = bind_name a, %a.var // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_3, %impl.elem0 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_3) [template = constants.%int_3.2] -// CHECK:STDOUT: %.loc14_17: init %i32 = converted %int_3, %int.convert_checked [template = constants.%int_3.2] -// CHECK:STDOUT: assign %a.var, %.loc14_17 +// CHECK:STDOUT: %.loc14: init %i32 = converted %int_3, %int.convert_checked [template = constants.%int_3.2] +// CHECK:STDOUT: assign %a.var, %.loc14 // CHECK:STDOUT: %a.ref.loc19_3: ref %i32 = name_ref a, %a // CHECK:STDOUT: %a.ref.loc19_7: ref %i32 = name_ref a, %a // CHECK:STDOUT: %a.ref.loc19_10: ref %i32 = name_ref a, %a diff --git a/toolchain/check/testdata/operators/builtin/fail_type_mismatch_assignment.carbon b/toolchain/check/testdata/operators/builtin/fail_type_mismatch_assignment.carbon index 84ff5fcc8835f..2e3fecb0fe406 100644 --- a/toolchain/check/testdata/operators/builtin/fail_type_mismatch_assignment.carbon +++ b/toolchain/check/testdata/operators/builtin/fail_type_mismatch_assignment.carbon @@ -25,15 +25,13 @@ fn Main() { // CHECK:STDOUT: %Main.type: type = fn_type @Main [template] // CHECK:STDOUT: %Main: %Main.type = struct_value () [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %int_3.1: Core.IntLiteral = int_value 3 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_3.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound: = bound_method %int_3.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_3.2: %i32 = int_value 3 [template] // CHECK:STDOUT: %float: f64 = float_literal 5.6000000000000005 [template] @@ -42,7 +40,7 @@ fn Main() { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -60,18 +58,16 @@ fn Main() { // CHECK:STDOUT: fn @Main() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc12_10.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc12_10.2: type = converted %int.make_type_signed, %.loc12_10.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.var: ref %i32 = var a // CHECK:STDOUT: %a: ref %i32 = bind_name a, %a.var // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_3, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_3) [template = constants.%int_3.2] -// CHECK:STDOUT: %.loc12_17: init %i32 = converted %int_3, %int.convert_checked [template = constants.%int_3.2] -// CHECK:STDOUT: assign %a.var, %.loc12_17 +// CHECK:STDOUT: %.loc12: init %i32 = converted %int_3, %int.convert_checked [template = constants.%int_3.2] +// CHECK:STDOUT: assign %a.var, %.loc12 // CHECK:STDOUT: %a.ref: ref %i32 = name_ref a, %a // CHECK:STDOUT: %float: f64 = float_literal 5.6000000000000005 [template = constants.%float] // CHECK:STDOUT: %.loc19: %i32 = converted %float, [template = ] diff --git a/toolchain/check/testdata/operators/builtin/fail_type_mismatch_once.carbon b/toolchain/check/testdata/operators/builtin/fail_type_mismatch_once.carbon index cffdd1230ffa9..ca3606c738a3e 100644 --- a/toolchain/check/testdata/operators/builtin/fail_type_mismatch_once.carbon +++ b/toolchain/check/testdata/operators/builtin/fail_type_mismatch_once.carbon @@ -25,9 +25,7 @@ fn Main() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %Main.type: type = fn_type @Main [template] // CHECK:STDOUT: %Main: %Main.type = struct_value () [template] // CHECK:STDOUT: %int_12: Core.IntLiteral = int_value 12 [template] @@ -37,7 +35,7 @@ fn Main() -> i32 { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .Add = %import_ref.2 +// CHECK:STDOUT: .Add = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -54,9 +52,7 @@ fn Main() -> i32 { // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_14.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc11_14.2: type = converted %int.make_type_signed, %.loc11_14.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/operators/builtin/fail_unimplemented_op.carbon b/toolchain/check/testdata/operators/builtin/fail_unimplemented_op.carbon index 365bb892370ab..b67d0fa9bf4c1 100644 --- a/toolchain/check/testdata/operators/builtin/fail_unimplemented_op.carbon +++ b/toolchain/check/testdata/operators/builtin/fail_unimplemented_op.carbon @@ -19,9 +19,7 @@ fn Main() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %Main.type: type = fn_type @Main [template] // CHECK:STDOUT: %Main: %Main.type = struct_value () [template] // CHECK:STDOUT: %int_12: Core.IntLiteral = int_value 12 [template] @@ -31,7 +29,7 @@ fn Main() -> i32 { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .Add = %import_ref.2 +// CHECK:STDOUT: .Add = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -48,9 +46,7 @@ fn Main() -> i32 { // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_14.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc11_14.2: type = converted %int.make_type_signed, %.loc11_14.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/operators/overloaded/eq.carbon b/toolchain/check/testdata/operators/overloaded/eq.carbon index 14cfe5079c7a7..8b3ce73429e5e 100644 --- a/toolchain/check/testdata/operators/overloaded/eq.carbon +++ b/toolchain/check/testdata/operators/overloaded/eq.carbon @@ -366,7 +366,7 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: %NotEqual.type.1: type = fn_type @NotEqual.1 [template] // CHECK:STDOUT: %NotEqual.1: %NotEqual.type.1 = struct_value () [template] // CHECK:STDOUT: %Equal.type.2: type = fn_type @Equal.2 [template] -// CHECK:STDOUT: %interface.1: = interface_witness (%Equal.1, %NotEqual.1) [template] +// CHECK:STDOUT: %interface: = interface_witness (%Equal.1, %NotEqual.1) [template] // CHECK:STDOUT: %TestRhsBad.type: type = fn_type @TestRhsBad [template] // CHECK:STDOUT: %TestRhsBad: %TestRhsBad.type = struct_value () [template] // CHECK:STDOUT: %TestLhsBad.type: type = fn_type @TestLhsBad [template] @@ -395,7 +395,7 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: %D.decl: type = class_decl @D [template = constants.%D] {} {} -// CHECK:STDOUT: impl_decl @impl.1 [template] {} { +// CHECK:STDOUT: impl_decl @impl [template] {} { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %Eq.ref: type = name_ref Eq, imports.%import_ref.1 [template = constants.%Eq.type] @@ -442,7 +442,7 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.1: %C.ref as %Eq.ref { +// CHECK:STDOUT: impl @impl: %C.ref as %Eq.ref { // CHECK:STDOUT: %Equal.decl: %Equal.type.1 = fn_decl @Equal.1 [template = constants.%Equal.1] { // CHECK:STDOUT: %self.patt: %C = binding_pattern self // CHECK:STDOUT: %self.param_patt: %C = value_param_pattern %self.patt, runtime_param0 @@ -483,7 +483,7 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %interface: = interface_witness (%Equal.decl, %NotEqual.decl) [template = constants.%interface.1] +// CHECK:STDOUT: %interface: = interface_witness (%Equal.decl, %NotEqual.decl) [template = constants.%interface] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Equal = %Equal.decl @@ -515,7 +515,7 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %C = name_ref a, %a // CHECK:STDOUT: %b.ref: %D = name_ref b, %b -// CHECK:STDOUT: %impl.elem0: %Equal.type.2 = interface_witness_access constants.%interface.1, element0 [template = constants.%Equal.1] +// CHECK:STDOUT: %impl.elem0: %Equal.type.2 = interface_witness_access constants.%interface, element0 [template = constants.%Equal.1] // CHECK:STDOUT: %Equal.bound: = bound_method %a.ref, %impl.elem0 // CHECK:STDOUT: %.loc23_15: %C = converted %b.ref, [template = ] // CHECK:STDOUT: %Equal.call: init bool = call %Equal.bound(%a.ref, ) diff --git a/toolchain/check/testdata/operators/overloaded/implicit_as.carbon b/toolchain/check/testdata/operators/overloaded/implicit_as.carbon index d1e1428fd6703..14e525fa679d4 100644 --- a/toolchain/check/testdata/operators/overloaded/implicit_as.carbon +++ b/toolchain/check/testdata/operators/overloaded/implicit_as.carbon @@ -36,13 +36,13 @@ fn Test() { // CHECK:STDOUT: constants { // CHECK:STDOUT: %X: type = class_type @X [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] +// CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %complete_type.2: = complete_type_witness %i32.builtin [template] // CHECK:STDOUT: %X.elem: type = unbound_element_type %X, %i32 [template] // CHECK:STDOUT: %struct_type.n: type = struct_type {.n: %i32} [template] -// CHECK:STDOUT: %complete_type.1: = complete_type_witness %struct_type.n [template] +// CHECK:STDOUT: %complete_type.3: = complete_type_witness %struct_type.n [template] // CHECK:STDOUT: %ImplicitAs.type.1: type = generic_interface_type @ImplicitAs [template] // CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.1 = struct_value () [template] // CHECK:STDOUT: %ImplicitAs.type.3: type = facet_type <@ImplicitAs, @ImplicitAs(%X)> [template] @@ -63,23 +63,22 @@ fn Test() { // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %Source.type: type = fn_type @Source [template] // CHECK:STDOUT: %Source: %Source.type = struct_value () [template] -// CHECK:STDOUT: %require_complete.1: = require_complete_type %T [symbolic] +// CHECK:STDOUT: %require_complete.2: = require_complete_type %T [symbolic] // CHECK:STDOUT: %Source.specific_fn.1: = specific_function %Source, @Source(%T) [symbolic] // CHECK:STDOUT: %Test.type: type = fn_type @Test [template] // CHECK:STDOUT: %Test: %Test.type = struct_value () [template] // CHECK:STDOUT: %Source.specific_fn.2: = specific_function %Source, @Source(%X) [template] // CHECK:STDOUT: %Source.specific_fn.3: = specific_function %Source, @Source(%i32) [template] -// CHECK:STDOUT: %complete_type.2: = complete_type_witness %i32 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, ImplicitAs, loaded [template = constants.%ImplicitAs.generic] +// CHECK:STDOUT: %import_ref.5: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, ImplicitAs, loaded [template = constants.%ImplicitAs.generic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -95,22 +94,18 @@ fn Test() { // CHECK:STDOUT: %X.decl: type = class_decl @X [template = constants.%X] {} {} // CHECK:STDOUT: impl_decl @impl.1 [template] {} { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc15_6.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc15_6.2: type = converted %int.make_type_signed, %.loc15_6.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] -// CHECK:STDOUT: %ImplicitAs.ref: %ImplicitAs.type.1 = name_ref ImplicitAs, imports.%import_ref.2 [template = constants.%ImplicitAs.generic] +// CHECK:STDOUT: %ImplicitAs.ref: %ImplicitAs.type.1 = name_ref ImplicitAs, imports.%import_ref.5 [template = constants.%ImplicitAs.generic] // CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [template = constants.%X] // CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(constants.%X)> [template = constants.%ImplicitAs.type.3] // CHECK:STDOUT: } // CHECK:STDOUT: impl_decl @impl.2 [template] {} { // CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [template = constants.%X] // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] -// CHECK:STDOUT: %ImplicitAs.ref: %ImplicitAs.type.1 = name_ref ImplicitAs, imports.%import_ref.2 [template = constants.%ImplicitAs.generic] +// CHECK:STDOUT: %ImplicitAs.ref: %ImplicitAs.type.1 = name_ref ImplicitAs, imports.%import_ref.5 [template = constants.%ImplicitAs.generic] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc19_30.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc19_30.2: type = converted %int.make_type_signed, %.loc19_30.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(constants.%i32)> [template = constants.%ImplicitAs.type.4] // CHECK:STDOUT: } // CHECK:STDOUT: %Sink_i32.decl: %Sink_i32.type = fn_decl @Sink_i32 [template = constants.%Sink_i32] { @@ -118,9 +113,7 @@ fn Test() { // CHECK:STDOUT: %n.param_patt: %i32 = value_param_pattern %n.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc25_16.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc25_16.2: type = converted %int.make_type_signed, %.loc25_16.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %n.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %n: %i32 = bind_name n, %n.param // CHECK:STDOUT: } @@ -147,7 +140,7 @@ fn Test() { // CHECK:STDOUT: %Test.decl: %Test.type = fn_decl @Test [template = constants.%Test] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.1: %.loc15_6.2 as %ImplicitAs.type { +// CHECK:STDOUT: impl @impl.1: %i32 as %ImplicitAs.type { // CHECK:STDOUT: %Convert.decl: %Convert.type.2 = fn_decl @Convert.2 [template = constants.%Convert.2] { // CHECK:STDOUT: %self.patt: %i32 = binding_pattern self // CHECK:STDOUT: %self.param_patt: %i32 = value_param_pattern %self.patt, runtime_param0 @@ -155,9 +148,7 @@ fn Test() { // CHECK:STDOUT: %return.param_patt: %X = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc16_20.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc16_20.2: type = converted %int.make_type_signed, %.loc16_20.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [template = constants.%X] // CHECK:STDOUT: %self.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %self: %i32 = bind_name self, %self.param @@ -180,9 +171,7 @@ fn Test() { // CHECK:STDOUT: } { // CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [template = constants.%X] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc20_28.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc20_28.2: type = converted %int.make_type_signed, %.loc20_28.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %self.param: %X = value_param runtime_param0 // CHECK:STDOUT: %self: %X = bind_name self, %self.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 @@ -197,15 +186,13 @@ fn Test() { // CHECK:STDOUT: // CHECK:STDOUT: class @X { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc12_10.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc12_10.2: type = converted %int.make_type_signed, %.loc12_10.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc12_8: %X.elem = field_decl n, element0 [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.n [template = constants.%complete_type.1] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc12: %X.elem = field_decl n, element0 [template] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.n [template = constants.%complete_type.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%X -// CHECK:STDOUT: .n = %.loc12_8 +// CHECK:STDOUT: .n = %.loc12 // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } // CHECK:STDOUT: @@ -223,7 +210,7 @@ fn Test() { // CHECK:STDOUT: fn @Convert.3[%self.param_patt: %X]() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %self.ref: %X = name_ref self, %self -// CHECK:STDOUT: %n.ref: %X.elem = name_ref n, @X.%.loc12_8 [template = @X.%.loc12_8] +// CHECK:STDOUT: %n.ref: %X.elem = name_ref n, @X.%.loc12 [template = @X.%.loc12] // CHECK:STDOUT: %.loc20_45.1: ref %i32 = class_element_access %self.ref, element0 // CHECK:STDOUT: %.loc20_45.2: %i32 = bind_value %.loc20_45.1 // CHECK:STDOUT: return %.loc20_45.2 @@ -238,7 +225,7 @@ fn Test() { // CHECK:STDOUT: %T.patt.loc27_11.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc27_11.2 (constants.%T.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete: = require_complete_type @Source.%T.loc27_11.2 (%T) [symbolic = %require_complete (constants.%require_complete.1)] +// CHECK:STDOUT: %require_complete: = require_complete_type @Source.%T.loc27_11.2 (%T) [symbolic = %require_complete (constants.%require_complete.2)] // CHECK:STDOUT: %Source.specific_fn.loc27_35.2: = specific_function constants.%Source, @Source(%T.loc27_11.2) [symbolic = %Source.specific_fn.loc27_35.2 (constants.%Source.specific_fn.1)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%T.param_patt: type) -> @Source.%T.loc27_11.2 (%T) { @@ -272,21 +259,19 @@ fn Test() { // CHECK:STDOUT: %Sink_X.ref: %Sink_X.type = name_ref Sink_X, file.%Sink_X.decl [template = constants.%Sink_X] // CHECK:STDOUT: %Source.ref.loc31: %Source.type = name_ref Source, file.%Source.decl [template = constants.%Source] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc31_20.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc31_20.2: type = converted %int.make_type_signed, %.loc31_20.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %Source.specific_fn.loc31: = specific_function %Source.ref.loc31, @Source(constants.%i32) [template = constants.%Source.specific_fn.3] // CHECK:STDOUT: %Source.call.loc31: init %i32 = call %Source.specific_fn.loc31() // CHECK:STDOUT: %impl.elem0.loc31: %Convert.type.3 = interface_witness_access constants.%interface.1, element0 [template = constants.%Convert.2] // CHECK:STDOUT: %Convert.bound.loc31: = bound_method %Source.call.loc31, %impl.elem0.loc31 -// CHECK:STDOUT: %.loc31_20.3: ref %X = temporary_storage -// CHECK:STDOUT: %.loc31_20.4: %i32 = value_of_initializer %Source.call.loc31 -// CHECK:STDOUT: %.loc31_20.5: %i32 = converted %Source.call.loc31, %.loc31_20.4 -// CHECK:STDOUT: %Convert.call.loc31: init %X = call %Convert.bound.loc31(%.loc31_20.5) to %.loc31_20.3 -// CHECK:STDOUT: %.loc31_20.6: init %X = converted %Source.call.loc31, %Convert.call.loc31 -// CHECK:STDOUT: %.loc31_20.7: ref %X = temporary %.loc31_20.3, %.loc31_20.6 -// CHECK:STDOUT: %.loc31_20.8: %X = bind_value %.loc31_20.7 -// CHECK:STDOUT: %Sink_X.call: init %empty_tuple.type = call %Sink_X.ref(%.loc31_20.8) +// CHECK:STDOUT: %.loc31_20.1: ref %X = temporary_storage +// CHECK:STDOUT: %.loc31_20.2: %i32 = value_of_initializer %Source.call.loc31 +// CHECK:STDOUT: %.loc31_20.3: %i32 = converted %Source.call.loc31, %.loc31_20.2 +// CHECK:STDOUT: %Convert.call.loc31: init %X = call %Convert.bound.loc31(%.loc31_20.3) to %.loc31_20.1 +// CHECK:STDOUT: %.loc31_20.4: init %X = converted %Source.call.loc31, %Convert.call.loc31 +// CHECK:STDOUT: %.loc31_20.5: ref %X = temporary %.loc31_20.1, %.loc31_20.4 +// CHECK:STDOUT: %.loc31_20.6: %X = bind_value %.loc31_20.5 +// CHECK:STDOUT: %Sink_X.call: init %empty_tuple.type = call %Sink_X.ref(%.loc31_20.6) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -295,7 +280,7 @@ fn Test() { // CHECK:STDOUT: %T.patt.loc27_11.2 => constants.%T // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete => constants.%require_complete.1 +// CHECK:STDOUT: %require_complete => constants.%require_complete.2 // CHECK:STDOUT: %Source.specific_fn.loc27_35.2 => constants.%Source.specific_fn.1 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -309,7 +294,7 @@ fn Test() { // CHECK:STDOUT: %T.patt.loc27_11.2 => constants.%X // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete => constants.%complete_type.1 +// CHECK:STDOUT: %require_complete => constants.%complete_type.3 // CHECK:STDOUT: %Source.specific_fn.loc27_35.2 => constants.%Source.specific_fn.2 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/operators/overloaded/index.carbon b/toolchain/check/testdata/operators/overloaded/index.carbon index 1bf1bcfde2c0c..55f0e87a0dd22 100644 --- a/toolchain/check/testdata/operators/overloaded/index.carbon +++ b/toolchain/check/testdata/operators/overloaded/index.carbon @@ -222,9 +222,7 @@ let x: i32 = c[0]; // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (type, type) [template] // CHECK:STDOUT: %tuple.type.2: type = tuple_type (%i32, %i32) [template] // CHECK:STDOUT: %IndexWith.type.1: type = generic_interface_type @IndexWith [template] @@ -239,17 +237,17 @@ let x: i32 = c[0]; // CHECK:STDOUT: %int_5.1: Core.IntLiteral = int_value 5 [template] // CHECK:STDOUT: %tuple.type.3: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.2(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.10: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.2(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.6: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_5.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_5.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_5.2: %i32 = int_value 5 [template] // CHECK:STDOUT: %tuple: %tuple.type.2 = tuple_value (%int_1.2, %int_5.2) [template] -// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_0.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] // CHECK:STDOUT: } @@ -257,12 +255,12 @@ let x: i32 = c[0]; // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .IndexWith = %import_ref.2 -// CHECK:STDOUT: .ImplicitAs = %import_ref.7 +// CHECK:STDOUT: .IndexWith = %import_ref.5 +// CHECK:STDOUT: .ImplicitAs = %import_ref.10 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.2: %IndexWith.type.1 = import_ref Core//prelude/operators/index, IndexWith, loaded [template = constants.%IndexWith.generic] +// CHECK:STDOUT: %import_ref.5: %IndexWith.type.1 = import_ref Core//prelude/operators/index, IndexWith, loaded [template = constants.%IndexWith.generic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -274,44 +272,30 @@ let x: i32 = c[0]; // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: impl_decl @impl.1 [template] {} { // CHECK:STDOUT: %int_32.loc4_7: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc4_7: init type = call constants.%Int(%int_32.loc4_7) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc4_7: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc4_12: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc4_12: init type = call constants.%Int(%int_32.loc4_12) [template = constants.%i32] -// CHECK:STDOUT: %.loc4_15.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc4_7, %int.make_type_signed.loc4_12) -// CHECK:STDOUT: %.loc4_15.2: type = value_of_initializer %int.make_type_signed.loc4_7 [template = constants.%i32] -// CHECK:STDOUT: %.loc4_15.3: type = converted %int.make_type_signed.loc4_7, %.loc4_15.2 [template = constants.%i32] -// CHECK:STDOUT: %.loc4_15.4: type = value_of_initializer %int.make_type_signed.loc4_12 [template = constants.%i32] -// CHECK:STDOUT: %.loc4_15.5: type = converted %int.make_type_signed.loc4_12, %.loc4_15.4 [template = constants.%i32] -// CHECK:STDOUT: %.loc4_15.6: type = converted %.loc4_15.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] +// CHECK:STDOUT: %i32.loc4_12: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc4_15.1: %tuple.type.1 = tuple_literal (%i32.loc4_7, %i32.loc4_12) +// CHECK:STDOUT: %.loc4_15.2: type = converted %.loc4_15.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] -// CHECK:STDOUT: %IndexWith.ref: %IndexWith.type.1 = name_ref IndexWith, imports.%import_ref.2 [template = constants.%IndexWith.generic] +// CHECK:STDOUT: %IndexWith.ref: %IndexWith.type.1 = name_ref IndexWith, imports.%import_ref.5 [template = constants.%IndexWith.generic] // CHECK:STDOUT: %int_32.loc4_35: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc4_35: init type = call constants.%Int(%int_32.loc4_35) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc4_35: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc4_40: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc4_40: init type = call constants.%Int(%int_32.loc4_40) [template = constants.%i32] -// CHECK:STDOUT: %.loc4_43.1: type = value_of_initializer %int.make_type_signed.loc4_35 [template = constants.%i32] -// CHECK:STDOUT: %.loc4_43.2: type = converted %int.make_type_signed.loc4_35, %.loc4_43.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc4_43.3: type = value_of_initializer %int.make_type_signed.loc4_40 [template = constants.%i32] -// CHECK:STDOUT: %.loc4_43.4: type = converted %int.make_type_signed.loc4_40, %.loc4_43.3 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc4_40: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %IndexWith.type: type = facet_type <@IndexWith, @IndexWith(constants.%i32, constants.%i32)> [template = constants.%IndexWith.type.3] // CHECK:STDOUT: } // CHECK:STDOUT: %int_32.loc10_9: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc10_9: init type = call constants.%Int(%int_32.loc10_9) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc10_9: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc10_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc10_14: init type = call constants.%Int(%int_32.loc10_14) [template = constants.%i32] -// CHECK:STDOUT: %.loc10_17.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc10_9, %int.make_type_signed.loc10_14) -// CHECK:STDOUT: %.loc10_17.2: type = value_of_initializer %int.make_type_signed.loc10_9 [template = constants.%i32] -// CHECK:STDOUT: %.loc10_17.3: type = converted %int.make_type_signed.loc10_9, %.loc10_17.2 [template = constants.%i32] -// CHECK:STDOUT: %.loc10_17.4: type = value_of_initializer %int.make_type_signed.loc10_14 [template = constants.%i32] -// CHECK:STDOUT: %.loc10_17.5: type = converted %int.make_type_signed.loc10_14, %.loc10_17.4 [template = constants.%i32] -// CHECK:STDOUT: %.loc10_17.6: type = converted %.loc10_17.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] +// CHECK:STDOUT: %i32.loc10_14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc10_17.1: %tuple.type.1 = tuple_literal (%i32.loc10_9, %i32.loc10_14) +// CHECK:STDOUT: %.loc10_17.2: type = converted %.loc10_17.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %int_32.loc11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11: init type = call constants.%Int(%int_32.loc11) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_8.1: type = value_of_initializer %int.make_type_signed.loc11 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_8.2: type = converted %int.make_type_signed.loc11, %.loc11_8.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.1: %.loc4_15.6 as %IndexWith.type { +// CHECK:STDOUT: impl @impl.1: %.loc4_15.2 as %IndexWith.type { // CHECK:STDOUT: %At.decl: %At.type.2 = fn_decl @At.2 [template = constants.%At.2] { // CHECK:STDOUT: %self.patt: %tuple.type.2 = binding_pattern self // CHECK:STDOUT: %self.param_patt: %tuple.type.2 = value_param_pattern %self.patt, runtime_param0 @@ -320,15 +304,11 @@ let x: i32 = c[0]; // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref: type = name_ref Self, @impl.1.%.loc4_15.6 [template = constants.%tuple.type.2] +// CHECK:STDOUT: %Self.ref: type = name_ref Self, @impl.1.%.loc4_15.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %int_32.loc5_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc5_32: init type = call constants.%Int(%int_32.loc5_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc5_32.1: type = value_of_initializer %int.make_type_signed.loc5_32 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_32.2: type = converted %int.make_type_signed.loc5_32, %.loc5_32.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc5_32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc5_40: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc5_40: init type = call constants.%Int(%int_32.loc5_40) [template = constants.%i32] -// CHECK:STDOUT: %.loc5_40.1: type = value_of_initializer %int.make_type_signed.loc5_40 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_40.2: type = converted %int.make_type_signed.loc5_40, %.loc5_40.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc5_40: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %self.param: %tuple.type.2 = value_param runtime_param0 // CHECK:STDOUT: %self: %tuple.type.2 = bind_name self, %self.param // CHECK:STDOUT: %subscript.param: %i32 = value_param runtime_param1 @@ -356,13 +336,13 @@ let x: i32 = c[0]; // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_5: Core.IntLiteral = int_value 5 [template = constants.%int_5.1] // CHECK:STDOUT: %.loc10_26.1: %tuple.type.3 = tuple_literal (%int_1, %int_5) -// CHECK:STDOUT: %impl.elem0.loc10_26.1: %Convert.type.2 = interface_witness_access constants.%interface.10, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc10_26.1: %Convert.type.2 = interface_witness_access constants.%interface.6, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc10_26.1: = bound_method %int_1, %impl.elem0.loc10_26.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc10_26.1: = specific_function %Convert.bound.loc10_26.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc10_26.1: init %i32 = call %Convert.specific_fn.loc10_26.1(%int_1) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc10_26.2: %i32 = value_of_initializer %int.convert_checked.loc10_26.1 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc10_26.3: %i32 = converted %int_1, %.loc10_26.2 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc10_26.2: %Convert.type.2 = interface_witness_access constants.%interface.10, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc10_26.2: %Convert.type.2 = interface_witness_access constants.%interface.6, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc10_26.2: = bound_method %int_5, %impl.elem0.loc10_26.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc10_26.2: = specific_function %Convert.bound.loc10_26.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc10_26.2: init %i32 = call %Convert.specific_fn.loc10_26.2(%int_5) [template = constants.%int_5.2] @@ -373,7 +353,7 @@ let x: i32 = c[0]; // CHECK:STDOUT: %s: %tuple.type.2 = bind_name s, %.loc10_27 // CHECK:STDOUT: %s.ref: %tuple.type.2 = name_ref s, %s // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0.loc11_17.1: %Convert.type.2 = interface_witness_access constants.%interface.10, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc11_17.1: %Convert.type.2 = interface_witness_access constants.%interface.6, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11: = bound_method %int_0, %impl.elem0.loc11_17.1 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc11: = specific_function %Convert.bound.loc11, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc11: init %i32 = call %Convert.specific_fn.loc11(%int_0) [template = constants.%int_0.2] @@ -402,7 +382,7 @@ let x: i32 = c[0]; // CHECK:STDOUT: %At.type.2: type = fn_type @At.2 [template] // CHECK:STDOUT: %At.2: %At.type.2 = struct_value () [template] // CHECK:STDOUT: %At.type.3: type = fn_type @At.1, @IndexWith(%SubscriptType.1, %ElementType.1) [template] -// CHECK:STDOUT: %interface.1: = interface_witness (%At.2) [template] +// CHECK:STDOUT: %interface: = interface_witness (%At.2) [template] // CHECK:STDOUT: %ElementType.val: %ElementType.1 = struct_value () [template] // CHECK:STDOUT: %C.val: %C = struct_value () [template] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template] @@ -431,7 +411,7 @@ let x: i32 = c[0]; // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: %ElementType.decl: type = class_decl @ElementType [template = constants.%ElementType.1] {} {} // CHECK:STDOUT: %SubscriptType.decl: type = class_decl @SubscriptType [template = constants.%SubscriptType.1] {} {} -// CHECK:STDOUT: impl_decl @impl.1 [template] {} { +// CHECK:STDOUT: impl_decl @impl [template] {} { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %IndexWith.ref: %IndexWith.type.1 = name_ref IndexWith, imports.%import_ref.1 [template = constants.%IndexWith.generic] @@ -443,7 +423,7 @@ let x: i32 = c[0]; // CHECK:STDOUT: %ElementType.ref: type = name_ref ElementType, %ElementType.decl [template = constants.%ElementType.1] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.1: %C.ref as %IndexWith.type { +// CHECK:STDOUT: impl @impl: %C.ref as %IndexWith.type { // CHECK:STDOUT: %At.decl: %At.type.2 = fn_decl @At.2 [template = constants.%At.2] { // CHECK:STDOUT: %self.patt: %C = binding_pattern self // CHECK:STDOUT: %self.param_patt: %C = value_param_pattern %self.patt, runtime_param0 @@ -452,7 +432,7 @@ let x: i32 = c[0]; // CHECK:STDOUT: %return.patt: %ElementType.1 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %ElementType.1 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref: type = name_ref Self, @impl.1.%C.ref [template = constants.%C] +// CHECK:STDOUT: %Self.ref: type = name_ref Self, @impl.%C.ref [template = constants.%C] // CHECK:STDOUT: %SubscriptType.ref: type = name_ref SubscriptType, file.%SubscriptType.decl [template = constants.%SubscriptType.1] // CHECK:STDOUT: %ElementType.ref: type = name_ref ElementType, file.%ElementType.decl [template = constants.%ElementType.1] // CHECK:STDOUT: %self.param: %C = value_param runtime_param0 @@ -462,7 +442,7 @@ let x: i32 = c[0]; // CHECK:STDOUT: %return.param: ref %ElementType.1 = out_param runtime_param2 // CHECK:STDOUT: %return: ref %ElementType.1 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %interface: = interface_witness (%At.decl) [template = constants.%interface.1] +// CHECK:STDOUT: %interface: = interface_witness (%At.decl) [template = constants.%interface] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .At = %At.decl @@ -513,7 +493,7 @@ let x: i32 = c[0]; // CHECK:STDOUT: %c.ref: %C = name_ref c, %c // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0] // CHECK:STDOUT: %.loc22_25.1: %SubscriptType.1 = converted %int_0, [template = ] -// CHECK:STDOUT: %impl.elem0: %At.type.3 = interface_witness_access constants.%interface.1, element0 [template = constants.%At.2] +// CHECK:STDOUT: %impl.elem0: %At.type.3 = interface_witness_access constants.%interface, element0 [template = constants.%At.2] // CHECK:STDOUT: %At.bound: = bound_method %c.ref, %impl.elem0 // CHECK:STDOUT: %.loc22_25.2: ref %ElementType.1 = temporary_storage // CHECK:STDOUT: %At.call: init %ElementType.1 = call %At.bound(%c.ref, ) to %.loc22_25.2 @@ -528,19 +508,17 @@ let x: i32 = c[0]; // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %complete_type.1: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %C.val: %C = struct_value () [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .IndexWith = %import_ref.2 +// CHECK:STDOUT: .IndexWith = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -557,13 +535,11 @@ let x: i32 = c[0]; // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: %C.ref: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc10_8.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc10_8.2: type = converted %int.make_type_signed, %.loc10_8.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C diff --git a/toolchain/check/testdata/package_expr/fail_not_found.carbon b/toolchain/check/testdata/package_expr/fail_not_found.carbon index b2cf119489408..19ce199b5f414 100644 --- a/toolchain/check/testdata/package_expr/fail_not_found.carbon +++ b/toolchain/check/testdata/package_expr/fail_not_found.carbon @@ -21,14 +21,12 @@ fn Main() { // CHECK:STDOUT: %Main.type: type = fn_type @Main [template] // CHECK:STDOUT: %Main: %Main.type = struct_value () [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -46,9 +44,7 @@ fn Main() { // CHECK:STDOUT: fn @Main() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc15_10.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc15_10.2: type = converted %int.make_type_signed, %.loc15_10.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %y.var: ref %i32 = var y // CHECK:STDOUT: %y: ref %i32 = bind_name y, %y.var // CHECK:STDOUT: %package.ref: = name_ref package, package [template = package] diff --git a/toolchain/check/testdata/package_expr/syntax.carbon b/toolchain/check/testdata/package_expr/syntax.carbon index 5479472f294c0..9db92b049de9c 100644 --- a/toolchain/check/testdata/package_expr/syntax.carbon +++ b/toolchain/check/testdata/package_expr/syntax.carbon @@ -45,15 +45,13 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] // CHECK:STDOUT: } @@ -61,7 +59,7 @@ fn Main() { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -75,15 +73,11 @@ fn Main() { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int_32.loc4: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc4: init type = call constants.%Int(%int_32.loc4) [template = constants.%i32] -// CHECK:STDOUT: %.loc4_8.1: type = value_of_initializer %int.make_type_signed.loc4 [template = constants.%i32] -// CHECK:STDOUT: %.loc4_8.2: type = converted %int.make_type_signed.loc4, %.loc4_8.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc4: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %x.var: ref %i32 = var x // CHECK:STDOUT: %x: ref %i32 = bind_name x, %x.var // CHECK:STDOUT: %int_32.loc5: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc5: init type = call constants.%Int(%int_32.loc5) [template = constants.%i32] -// CHECK:STDOUT: %.loc5_8.1: type = value_of_initializer %int.make_type_signed.loc5 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_8.2: type = converted %int.make_type_signed.loc5, %.loc5_8.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc5: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %y.var: ref %i32 = var y // CHECK:STDOUT: %y: ref %i32 = bind_name y, %y.var // CHECK:STDOUT: } @@ -91,7 +85,7 @@ fn Main() { // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.2] @@ -108,21 +102,19 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_0.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] // CHECK:STDOUT: %Main.type: type = fn_type @Main [template] // CHECK:STDOUT: %Main: %Main.type = struct_value () [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] // CHECK:STDOUT: } @@ -130,7 +122,7 @@ fn Main() { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -144,9 +136,7 @@ fn Main() { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc4_8.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc4_8.2: type = converted %int.make_type_signed, %.loc4_8.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %x.var: ref %i32 = var x // CHECK:STDOUT: %x: ref %i32 = bind_name x, %x.var // CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} {} @@ -155,35 +145,31 @@ fn Main() { // CHECK:STDOUT: fn @Main() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_32.loc7: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc7: init type = call constants.%Int(%int_32.loc7) [template = constants.%i32] -// CHECK:STDOUT: %.loc7_10.1: type = value_of_initializer %int.make_type_signed.loc7 [template = constants.%i32] -// CHECK:STDOUT: %.loc7_10.2: type = converted %int.make_type_signed.loc7, %.loc7_10.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc7: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %x.var: ref %i32 = var x // CHECK:STDOUT: %x: ref %i32 = bind_name x, %x.var // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1, %impl.elem0 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_1) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc7_17: init %i32 = converted %int_1, %int.convert_checked [template = constants.%int_1.2] -// CHECK:STDOUT: assign %x.var, %.loc7_17 +// CHECK:STDOUT: %.loc7: init %i32 = converted %int_1, %int.convert_checked [template = constants.%int_1.2] +// CHECK:STDOUT: assign %x.var, %.loc7 // CHECK:STDOUT: %int_32.loc9: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc9: init type = call constants.%Int(%int_32.loc9) [template = constants.%i32] -// CHECK:STDOUT: %.loc9_10.1: type = value_of_initializer %int.make_type_signed.loc9 [template = constants.%i32] -// CHECK:STDOUT: %.loc9_10.2: type = converted %int.make_type_signed.loc9, %.loc9_10.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc9: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %y.var: ref %i32 = var y // CHECK:STDOUT: %y: ref %i32 = bind_name y, %y.var // CHECK:STDOUT: %package.ref: = name_ref package, package [template = package] // CHECK:STDOUT: %x.ref: ref %i32 = name_ref x, file.%x -// CHECK:STDOUT: %.loc9_23: %i32 = bind_value %x.ref -// CHECK:STDOUT: assign %y.var, %.loc9_23 +// CHECK:STDOUT: %.loc9: %i32 = bind_value %x.ref +// CHECK:STDOUT: assign %y.var, %.loc9 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.2] diff --git a/toolchain/check/testdata/packages/fail_conflict_no_namespaces.carbon b/toolchain/check/testdata/packages/fail_conflict_no_namespaces.carbon index b6f7faedfeb7b..6a905185ff06c 100644 --- a/toolchain/check/testdata/packages/fail_conflict_no_namespaces.carbon +++ b/toolchain/check/testdata/packages/fail_conflict_no_namespaces.carbon @@ -64,14 +64,12 @@ import library "var"; // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -84,9 +82,7 @@ import library "var"; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc4_10.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc4_10.2: type = converted %int.make_type_signed, %.loc4_10.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %Foo.var: ref %i32 = var Foo // CHECK:STDOUT: %Foo: ref %i32 = bind_name Foo, %Foo.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/packages/fail_import_type_error.carbon b/toolchain/check/testdata/packages/fail_import_type_error.carbon index 2e131050d8dfd..430e758ca9b18 100644 --- a/toolchain/check/testdata/packages/fail_import_type_error.carbon +++ b/toolchain/check/testdata/packages/fail_import_type_error.carbon @@ -82,9 +82,7 @@ var d: i32 = d_ref; // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -115,27 +113,19 @@ var d: i32 = d_ref; // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int_32.loc6: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc6: init type = call constants.%Int(%int_32.loc6) [template = constants.%i32] -// CHECK:STDOUT: %.loc6_8.1: type = value_of_initializer %int.make_type_signed.loc6 [template = constants.%i32] -// CHECK:STDOUT: %.loc6_8.2: type = converted %int.make_type_signed.loc6, %.loc6_8.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc6: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.var: ref %i32 = var a // CHECK:STDOUT: %a: ref %i32 = bind_name a, %a.var // CHECK:STDOUT: %int_32.loc7: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc7: init type = call constants.%Int(%int_32.loc7) [template = constants.%i32] -// CHECK:STDOUT: %.loc7_8.1: type = value_of_initializer %int.make_type_signed.loc7 [template = constants.%i32] -// CHECK:STDOUT: %.loc7_8.2: type = converted %int.make_type_signed.loc7, %.loc7_8.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc7: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %b.var: ref %i32 = var b // CHECK:STDOUT: %b: ref %i32 = bind_name b, %b.var // CHECK:STDOUT: %int_32.loc8: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc8: init type = call constants.%Int(%int_32.loc8) [template = constants.%i32] -// CHECK:STDOUT: %.loc8_8.1: type = value_of_initializer %int.make_type_signed.loc8 [template = constants.%i32] -// CHECK:STDOUT: %.loc8_8.2: type = converted %int.make_type_signed.loc8, %.loc8_8.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc8: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %c.var: ref %i32 = var c // CHECK:STDOUT: %c: ref %i32 = bind_name c, %c.var // CHECK:STDOUT: %int_32.loc9: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc9: init type = call constants.%Int(%int_32.loc9) [template = constants.%i32] -// CHECK:STDOUT: %.loc9_8.1: type = value_of_initializer %int.make_type_signed.loc9 [template = constants.%i32] -// CHECK:STDOUT: %.loc9_8.2: type = converted %int.make_type_signed.loc9, %.loc9_8.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc9: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %d.var: ref %i32 = var d // CHECK:STDOUT: %d: ref %i32 = bind_name d, %d.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/packages/implicit_imports_prelude.carbon b/toolchain/check/testdata/packages/implicit_imports_prelude.carbon index 2e68450e2d831..27424c5b306ae 100644 --- a/toolchain/check/testdata/packages/implicit_imports_prelude.carbon +++ b/toolchain/check/testdata/packages/implicit_imports_prelude.carbon @@ -26,15 +26,13 @@ var b: i32 = a; // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] // CHECK:STDOUT: } @@ -42,7 +40,7 @@ var b: i32 = a; // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -55,9 +53,7 @@ var b: i32 = a; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc4_8.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc4_8.2: type = converted %int.make_type_signed, %.loc4_8.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.var: ref %i32 = var a // CHECK:STDOUT: %a: ref %i32 = bind_name a, %a.var // CHECK:STDOUT: } @@ -65,7 +61,7 @@ var b: i32 = a; // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.2] @@ -78,15 +74,13 @@ var b: i32 = a; // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: ref %i32 = import_ref Main//lib, a, loaded // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref.36 +// CHECK:STDOUT: .Int = %import_ref.191 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -102,9 +96,7 @@ var b: i32 = a; // CHECK:STDOUT: %default.import.loc2_6.2 = import // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc4_8.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc4_8.2: type = converted %int.make_type_signed, %.loc4_8.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %b.var: ref %i32 = var b // CHECK:STDOUT: %b: ref %i32 = bind_name b, %b.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/pointer/address_of_deref.carbon b/toolchain/check/testdata/pointer/address_of_deref.carbon index 4b79a45450d01..e8236d23694d7 100644 --- a/toolchain/check/testdata/pointer/address_of_deref.carbon +++ b/toolchain/check/testdata/pointer/address_of_deref.carbon @@ -17,17 +17,15 @@ fn F() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] // CHECK:STDOUT: %ptr: type = ptr_type %i32 [template] @@ -36,7 +34,7 @@ fn F() -> i32 { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -53,9 +51,7 @@ fn F() -> i32 { // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11: init type = call constants.%Int(%int_32.loc11) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %int.make_type_signed.loc11 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_11.2: type = converted %int.make_type_signed.loc11, %.loc11_11.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } @@ -64,18 +60,16 @@ fn F() -> i32 { // CHECK:STDOUT: fn @F() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_32.loc12: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc12: init type = call constants.%Int(%int_32.loc12) [template = constants.%i32] -// CHECK:STDOUT: %.loc12_10.1: type = value_of_initializer %int.make_type_signed.loc12 [template = constants.%i32] -// CHECK:STDOUT: %.loc12_10.2: type = converted %int.make_type_signed.loc12, %.loc12_10.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc12: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %n.var: ref %i32 = var n // CHECK:STDOUT: %n: ref %i32 = bind_name n, %n.var // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc12_17: init %i32 = converted %int_0, %int.convert_checked [template = constants.%int_0.2] -// CHECK:STDOUT: assign %n.var, %.loc12_17 +// CHECK:STDOUT: %.loc12: init %i32 = converted %int_0, %int.convert_checked [template = constants.%int_0.2] +// CHECK:STDOUT: assign %n.var, %.loc12 // CHECK:STDOUT: %n.ref: ref %i32 = name_ref n, %n // CHECK:STDOUT: %addr.loc13_13: %ptr = addr_of %n.ref // CHECK:STDOUT: %.loc13_12: ref %i32 = deref %addr.loc13_13 diff --git a/toolchain/check/testdata/pointer/address_of_lvalue.carbon b/toolchain/check/testdata/pointer/address_of_lvalue.carbon index 054f4afb91551..1938ea3be1404 100644 --- a/toolchain/check/testdata/pointer/address_of_lvalue.carbon +++ b/toolchain/check/testdata/pointer/address_of_lvalue.carbon @@ -26,22 +26,20 @@ fn F() { // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %struct_type.a.b.1: type = struct_type {.a: %i32, .b: %i32} [template] // CHECK:STDOUT: %ptr.1: type = ptr_type %struct_type.a.b.1 [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %struct_type.a.b.2: type = struct_type {.a: Core.IntLiteral, .b: Core.IntLiteral} [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] // CHECK:STDOUT: %struct: %struct_type.a.b.1 = struct_value (%int_1.2, %int_2.2) [template] @@ -56,7 +54,7 @@ fn F() { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -74,27 +72,23 @@ fn F() { // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_32.loc12_15: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc12_15: init type = call constants.%Int(%int_32.loc12_15) [template = constants.%i32] -// CHECK:STDOUT: %.loc12_15.1: type = value_of_initializer %int.make_type_signed.loc12_15 [template = constants.%i32] -// CHECK:STDOUT: %.loc12_15.2: type = converted %int.make_type_signed.loc12_15, %.loc12_15.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc12_15: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc12_24: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc12_24: init type = call constants.%Int(%int_32.loc12_24) [template = constants.%i32] -// CHECK:STDOUT: %.loc12_24.1: type = value_of_initializer %int.make_type_signed.loc12_24 [template = constants.%i32] -// CHECK:STDOUT: %.loc12_24.2: type = converted %int.make_type_signed.loc12_24, %.loc12_24.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc12_24: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %struct_type.a.b.loc12: type = struct_type {.a: %i32, .b: %i32} [template = constants.%struct_type.a.b.1] // CHECK:STDOUT: %s.var: ref %struct_type.a.b.1 = var s // CHECK:STDOUT: %s: ref %struct_type.a.b.1 = bind_name s, %s.var // CHECK:STDOUT: %int_1.loc12: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_2.loc12: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %.loc12_46.1: %struct_type.a.b.2 = struct_literal (%int_1.loc12, %int_2.loc12) -// CHECK:STDOUT: %impl.elem0.loc12_46.1: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc12_46.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc12_46.1: = bound_method %int_1.loc12, %impl.elem0.loc12_46.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc12_46.1: = specific_function %Convert.bound.loc12_46.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc12_46.1: init %i32 = call %Convert.specific_fn.loc12_46.1(%int_1.loc12) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc12_46.2: init %i32 = converted %int_1.loc12, %int.convert_checked.loc12_46.1 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc12_46.3: ref %i32 = struct_access %s.var, element0 // CHECK:STDOUT: %.loc12_46.4: init %i32 = initialize_from %.loc12_46.2 to %.loc12_46.3 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc12_46.2: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc12_46.2: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc12_46.2: = bound_method %int_2.loc12, %impl.elem0.loc12_46.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc12_46.2: = specific_function %Convert.bound.loc12_46.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc12_46.2: init %i32 = call %Convert.specific_fn.loc12_46.2(%int_2.loc12) [template = constants.%int_2.2] @@ -105,13 +99,9 @@ fn F() { // CHECK:STDOUT: %.loc12_47: init %struct_type.a.b.1 = converted %.loc12_46.1, %.loc12_46.8 [template = constants.%struct] // CHECK:STDOUT: assign %s.var, %.loc12_47 // CHECK:STDOUT: %int_32.loc14_15: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc14_15: init type = call constants.%Int(%int_32.loc14_15) [template = constants.%i32] -// CHECK:STDOUT: %.loc14_15.1: type = value_of_initializer %int.make_type_signed.loc14_15 [template = constants.%i32] -// CHECK:STDOUT: %.loc14_15.2: type = converted %int.make_type_signed.loc14_15, %.loc14_15.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc14_15: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc14_24: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc14_24: init type = call constants.%Int(%int_32.loc14_24) [template = constants.%i32] -// CHECK:STDOUT: %.loc14_24.1: type = value_of_initializer %int.make_type_signed.loc14_24 [template = constants.%i32] -// CHECK:STDOUT: %.loc14_24.2: type = converted %int.make_type_signed.loc14_24, %.loc14_24.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc14_24: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %struct_type.a.b.loc14: type = struct_type {.a: %i32, .b: %i32} [template = constants.%struct_type.a.b.1] // CHECK:STDOUT: %ptr.loc14: type = ptr_type %struct_type.a.b.1 [template = constants.%ptr.1] // CHECK:STDOUT: %p.var: ref %ptr.1 = var p @@ -120,50 +110,42 @@ fn F() { // CHECK:STDOUT: %addr.loc14: %ptr.1 = addr_of %s.ref.loc14 // CHECK:STDOUT: assign %p.var, %addr.loc14 // CHECK:STDOUT: %int_32.loc15: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc15: init type = call constants.%Int(%int_32.loc15) [template = constants.%i32] -// CHECK:STDOUT: %.loc15_13.1: type = value_of_initializer %int.make_type_signed.loc15 [template = constants.%i32] -// CHECK:STDOUT: %.loc15_13.2: type = converted %int.make_type_signed.loc15, %.loc15_13.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc15: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %ptr.loc15: type = ptr_type %i32 [template = constants.%ptr.2] // CHECK:STDOUT: %q.var: ref %ptr.2 = var q // CHECK:STDOUT: %q: ref %ptr.2 = bind_name q, %q.var // CHECK:STDOUT: %s.ref.loc15: ref %struct_type.a.b.1 = name_ref s, %s -// CHECK:STDOUT: %.loc15_19: ref %i32 = struct_access %s.ref.loc15, element0 -// CHECK:STDOUT: %addr.loc15: %ptr.2 = addr_of %.loc15_19 +// CHECK:STDOUT: %.loc15: ref %i32 = struct_access %s.ref.loc15, element0 +// CHECK:STDOUT: %addr.loc15: %ptr.2 = addr_of %.loc15 // CHECK:STDOUT: assign %q.var, %addr.loc15 // CHECK:STDOUT: %int_32.loc16: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc16: init type = call constants.%Int(%int_32.loc16) [template = constants.%i32] -// CHECK:STDOUT: %.loc16_13.1: type = value_of_initializer %int.make_type_signed.loc16 [template = constants.%i32] -// CHECK:STDOUT: %.loc16_13.2: type = converted %int.make_type_signed.loc16, %.loc16_13.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc16: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %ptr.loc16: type = ptr_type %i32 [template = constants.%ptr.2] // CHECK:STDOUT: %r.var: ref %ptr.2 = var r // CHECK:STDOUT: %r: ref %ptr.2 = bind_name r, %r.var // CHECK:STDOUT: %s.ref.loc16: ref %struct_type.a.b.1 = name_ref s, %s -// CHECK:STDOUT: %.loc16_19: ref %i32 = struct_access %s.ref.loc16, element1 -// CHECK:STDOUT: %addr.loc16: %ptr.2 = addr_of %.loc16_19 +// CHECK:STDOUT: %.loc16: ref %i32 = struct_access %s.ref.loc16, element1 +// CHECK:STDOUT: %addr.loc16: %ptr.2 = addr_of %.loc16 // CHECK:STDOUT: assign %r.var, %addr.loc16 // CHECK:STDOUT: %int_32.loc18_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc18_11: init type = call constants.%Int(%int_32.loc18_11) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc18_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc18_16: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc18_16: init type = call constants.%Int(%int_32.loc18_16) [template = constants.%i32] -// CHECK:STDOUT: %.loc18_19.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc18_11, %int.make_type_signed.loc18_16) -// CHECK:STDOUT: %.loc18_19.2: type = value_of_initializer %int.make_type_signed.loc18_11 [template = constants.%i32] -// CHECK:STDOUT: %.loc18_19.3: type = converted %int.make_type_signed.loc18_11, %.loc18_19.2 [template = constants.%i32] -// CHECK:STDOUT: %.loc18_19.4: type = value_of_initializer %int.make_type_signed.loc18_16 [template = constants.%i32] -// CHECK:STDOUT: %.loc18_19.5: type = converted %int.make_type_signed.loc18_16, %.loc18_19.4 [template = constants.%i32] -// CHECK:STDOUT: %.loc18_19.6: type = converted %.loc18_19.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] +// CHECK:STDOUT: %i32.loc18_16: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc18_19.1: %tuple.type.1 = tuple_literal (%i32.loc18_11, %i32.loc18_16) +// CHECK:STDOUT: %.loc18_19.2: type = converted %.loc18_19.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %t.var: ref %tuple.type.2 = var t // CHECK:STDOUT: %t: ref %tuple.type.2 = bind_name t, %t.var // CHECK:STDOUT: %int_1.loc18: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_2.loc18: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %.loc18_28.1: %tuple.type.3 = tuple_literal (%int_1.loc18, %int_2.loc18) -// CHECK:STDOUT: %impl.elem0.loc18_28.1: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc18_28.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc18_28.1: = bound_method %int_1.loc18, %impl.elem0.loc18_28.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc18_28.1: = specific_function %Convert.bound.loc18_28.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc18_28.1: init %i32 = call %Convert.specific_fn.loc18_28.1(%int_1.loc18) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc18_28.2: init %i32 = converted %int_1.loc18, %int.convert_checked.loc18_28.1 [template = constants.%int_1.2] // CHECK:STDOUT: %tuple.elem0.loc18: ref %i32 = tuple_access %t.var, element0 // CHECK:STDOUT: %.loc18_28.3: init %i32 = initialize_from %.loc18_28.2 to %tuple.elem0.loc18 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc18_28.2: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc18_28.2: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc18_28.2: = bound_method %int_2.loc18, %impl.elem0.loc18_28.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc18_28.2: = specific_function %Convert.bound.loc18_28.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc18_28.2: init %i32 = call %Convert.specific_fn.loc18_28.2(%int_2.loc18) [template = constants.%int_2.2] @@ -174,9 +156,7 @@ fn F() { // CHECK:STDOUT: %.loc18_29: init %tuple.type.2 = converted %.loc18_28.1, %.loc18_28.6 [template = constants.%tuple] // CHECK:STDOUT: assign %t.var, %.loc18_29 // CHECK:STDOUT: %int_32.loc19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc19: init type = call constants.%Int(%int_32.loc19) [template = constants.%i32] -// CHECK:STDOUT: %.loc19_14.1: type = value_of_initializer %int.make_type_signed.loc19 [template = constants.%i32] -// CHECK:STDOUT: %.loc19_14.2: type = converted %int.make_type_signed.loc19, %.loc19_14.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %ptr.loc19: type = ptr_type %i32 [template = constants.%ptr.2] // CHECK:STDOUT: %t0.var: ref %ptr.2 = var t0 // CHECK:STDOUT: %t0: ref %ptr.2 = bind_name t0, %t0.var @@ -186,9 +166,7 @@ fn F() { // CHECK:STDOUT: %addr.loc19: %ptr.2 = addr_of %tuple.elem0.loc19 // CHECK:STDOUT: assign %t0.var, %addr.loc19 // CHECK:STDOUT: %int_32.loc20: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc20: init type = call constants.%Int(%int_32.loc20) [template = constants.%i32] -// CHECK:STDOUT: %.loc20_14.1: type = value_of_initializer %int.make_type_signed.loc20 [template = constants.%i32] -// CHECK:STDOUT: %.loc20_14.2: type = converted %int.make_type_signed.loc20, %.loc20_14.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc20: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %ptr.loc20: type = ptr_type %i32 [template = constants.%ptr.2] // CHECK:STDOUT: %t1.var: ref %ptr.2 = var t1 // CHECK:STDOUT: %t1: ref %ptr.2 = bind_name t1, %t1.var diff --git a/toolchain/check/testdata/pointer/basic.carbon b/toolchain/check/testdata/pointer/basic.carbon index 3b335ca50ed5f..d7995fe7d9fe2 100644 --- a/toolchain/check/testdata/pointer/basic.carbon +++ b/toolchain/check/testdata/pointer/basic.carbon @@ -19,17 +19,15 @@ fn F() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] // CHECK:STDOUT: %ptr: type = ptr_type %i32 [template] @@ -38,7 +36,7 @@ fn F() -> i32 { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -55,9 +53,7 @@ fn F() -> i32 { // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11: init type = call constants.%Int(%int_32.loc11) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %int.make_type_signed.loc11 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_11.2: type = converted %int.make_type_signed.loc11, %.loc11_11.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } @@ -66,22 +62,18 @@ fn F() -> i32 { // CHECK:STDOUT: fn @F() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_32.loc12: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc12: init type = call constants.%Int(%int_32.loc12) [template = constants.%i32] -// CHECK:STDOUT: %.loc12_10.1: type = value_of_initializer %int.make_type_signed.loc12 [template = constants.%i32] -// CHECK:STDOUT: %.loc12_10.2: type = converted %int.make_type_signed.loc12, %.loc12_10.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc12: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %n.var: ref %i32 = var n // CHECK:STDOUT: %n: ref %i32 = bind_name n, %n.var // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc12_17: init %i32 = converted %int_0, %int.convert_checked [template = constants.%int_0.2] -// CHECK:STDOUT: assign %n.var, %.loc12_17 +// CHECK:STDOUT: %.loc12: init %i32 = converted %int_0, %int.convert_checked [template = constants.%int_0.2] +// CHECK:STDOUT: assign %n.var, %.loc12 // CHECK:STDOUT: %int_32.loc13: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc13: init type = call constants.%Int(%int_32.loc13) [template = constants.%i32] -// CHECK:STDOUT: %.loc13_13.1: type = value_of_initializer %int.make_type_signed.loc13 [template = constants.%i32] -// CHECK:STDOUT: %.loc13_13.2: type = converted %int.make_type_signed.loc13, %.loc13_13.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc13: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %ptr: type = ptr_type %i32 [template = constants.%ptr] // CHECK:STDOUT: %p.var: ref %ptr = var p // CHECK:STDOUT: %p: ref %ptr = bind_name p, %p.var diff --git a/toolchain/check/testdata/pointer/fail_address_of_value.carbon b/toolchain/check/testdata/pointer/fail_address_of_value.carbon index cba40d66099f8..2748d4f5e2389 100644 --- a/toolchain/check/testdata/pointer/fail_address_of_value.carbon +++ b/toolchain/check/testdata/pointer/fail_address_of_value.carbon @@ -103,9 +103,7 @@ fn AddressOfParam(param: i32) { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] // CHECK:STDOUT: %struct_type.a.1: type = struct_type {.a: %i32} [template] @@ -148,7 +146,7 @@ fn AddressOfParam(param: i32) { // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -172,9 +170,7 @@ fn AddressOfParam(param: i32) { // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc11_11.2: type = converted %int.make_type_signed, %.loc11_11.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } @@ -183,9 +179,7 @@ fn AddressOfParam(param: i32) { // CHECK:STDOUT: %return.param_patt: %struct_type.a.1 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc13_16.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc13_16.2: type = converted %int.make_type_signed, %.loc13_16.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %struct_type.a: type = struct_type {.a: %i32} [template = constants.%struct_type.a.1] // CHECK:STDOUT: %return.param: ref %struct_type.a.1 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %struct_type.a.1 = return_slot %return.param @@ -200,9 +194,7 @@ fn AddressOfParam(param: i32) { // CHECK:STDOUT: %param.param_patt: %i32 = value_param_pattern %param.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc95: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc95: init type = call constants.%Int(%int_32.loc95) [template = constants.%i32] -// CHECK:STDOUT: %.loc95_26.1: type = value_of_initializer %int.make_type_signed.loc95 [template = constants.%i32] -// CHECK:STDOUT: %.loc95_26.2: type = converted %int.make_type_signed.loc95, %.loc95_26.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc95: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %param.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %param: %i32 = bind_name param, %param.param // CHECK:STDOUT: } @@ -268,12 +260,10 @@ fn AddressOfParam(param: i32) { // CHECK:STDOUT: fn @AddressOfType() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_32.loc79: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc79: init type = call constants.%Int(%int_32.loc79) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc79: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %addr.loc79: %ptr.8 = addr_of [template = ] // CHECK:STDOUT: %int_32.loc84: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc84: init type = call constants.%Int(%int_32.loc84) [template = constants.%i32] -// CHECK:STDOUT: %.loc84_5.1: type = value_of_initializer %int.make_type_signed.loc84 [template = constants.%i32] -// CHECK:STDOUT: %.loc84_5.2: type = converted %int.make_type_signed.loc84, %.loc84_5.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc84: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %const: type = const_type %i32 [template = constants.%const] // CHECK:STDOUT: %ptr: type = ptr_type %const [template = constants.%ptr.9] // CHECK:STDOUT: %addr.loc84: %ptr.8 = addr_of [template = ] @@ -296,9 +286,7 @@ fn AddressOfParam(param: i32) { // CHECK:STDOUT: fn @AddressOfParam(%param.param_patt: %i32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_32.loc99: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc99: init type = call constants.%Int(%int_32.loc99) [template = constants.%i32] -// CHECK:STDOUT: %.loc99_22.1: type = value_of_initializer %int.make_type_signed.loc99 [template = constants.%i32] -// CHECK:STDOUT: %.loc99_22.2: type = converted %int.make_type_signed.loc99, %.loc99_22.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc99: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %ptr: type = ptr_type %i32 [template = constants.%ptr.7] // CHECK:STDOUT: %param_addr.var: ref %ptr.7 = var param_addr // CHECK:STDOUT: %param_addr: ref %ptr.7 = bind_name param_addr, %param_addr.var diff --git a/toolchain/check/testdata/pointer/fail_deref_error.carbon b/toolchain/check/testdata/pointer/fail_deref_error.carbon index 7be583666fbd9..a396b0f7dad54 100644 --- a/toolchain/check/testdata/pointer/fail_deref_error.carbon +++ b/toolchain/check/testdata/pointer/fail_deref_error.carbon @@ -22,14 +22,12 @@ let n2: i32 = undeclared->foo; // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -43,13 +41,9 @@ let n2: i32 = undeclared->foo; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int_32.loc15: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc15: init type = call constants.%Int(%int_32.loc15) [template = constants.%i32] -// CHECK:STDOUT: %.loc15_8.1: type = value_of_initializer %int.make_type_signed.loc15 [template = constants.%i32] -// CHECK:STDOUT: %.loc15_8.2: type = converted %int.make_type_signed.loc15, %.loc15_8.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc15: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc19: init type = call constants.%Int(%int_32.loc19) [template = constants.%i32] -// CHECK:STDOUT: %.loc19_9.1: type = value_of_initializer %int.make_type_signed.loc19 [template = constants.%i32] -// CHECK:STDOUT: %.loc19_9.2: type = converted %int.make_type_signed.loc19, %.loc19_9.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { diff --git a/toolchain/check/testdata/pointer/fail_deref_not_pointer.carbon b/toolchain/check/testdata/pointer/fail_deref_not_pointer.carbon index bd0176ec74272..59e46091f0294 100644 --- a/toolchain/check/testdata/pointer/fail_deref_not_pointer.carbon +++ b/toolchain/check/testdata/pointer/fail_deref_not_pointer.carbon @@ -44,10 +44,8 @@ fn Deref(n: i32) { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %Deref.type: type = fn_type @Deref [template] // CHECK:STDOUT: %Deref: %Deref.type = struct_value () [template] // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [template] @@ -57,7 +55,7 @@ fn Deref(n: i32) { // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -74,9 +72,7 @@ fn Deref(n: i32) { // CHECK:STDOUT: %n.param_patt: %i32 = value_param_pattern %n.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_13.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc11_13.2: type = converted %int.make_type_signed, %.loc11_13.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %n.param: %i32 = value_param runtime_param0 // CHECK:STDOUT: %n: %i32 = bind_name n, %n.param // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/pointer/fail_deref_type.carbon b/toolchain/check/testdata/pointer/fail_deref_type.carbon index d41a0e589e49d..949b3b0639d9e 100644 --- a/toolchain/check/testdata/pointer/fail_deref_type.carbon +++ b/toolchain/check/testdata/pointer/fail_deref_type.carbon @@ -25,14 +25,12 @@ var p2: i32->foo; // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -46,17 +44,13 @@ var p2: i32->foo; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int_32.loc18: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc18: init type = call constants.%Int(%int_32.loc18) [template = constants.%i32] -// CHECK:STDOUT: %.loc18_9.1: type = value_of_initializer %int.make_type_signed.loc18 [template = constants.%i32] -// CHECK:STDOUT: %.loc18_9.2: type = converted %int.make_type_signed.loc18, %.loc18_9.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc18_8: ref = deref %.loc18_9.2 +// CHECK:STDOUT: %i32.loc18: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc18: ref = deref %i32.loc18 // CHECK:STDOUT: %p.var: ref = var p // CHECK:STDOUT: %p: ref = bind_name p, %p.var // CHECK:STDOUT: %int_32.loc22: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc22: init type = call constants.%Int(%int_32.loc22) [template = constants.%i32] -// CHECK:STDOUT: %.loc22_9.1: type = value_of_initializer %int.make_type_signed.loc22 [template = constants.%i32] -// CHECK:STDOUT: %.loc22_9.2: type = converted %int.make_type_signed.loc22, %.loc22_9.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc22_12: ref = deref %.loc22_9.2 +// CHECK:STDOUT: %i32.loc22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc22: ref = deref %i32.loc22 // CHECK:STDOUT: %foo.ref: = name_ref foo, [template = ] // CHECK:STDOUT: %p2.var: ref = var p2 // CHECK:STDOUT: %p2: ref = bind_name p2, %p2.var diff --git a/toolchain/check/testdata/pointer/import.carbon b/toolchain/check/testdata/pointer/import.carbon index b8b62dffa9a5d..3018624adfec4 100644 --- a/toolchain/check/testdata/pointer/import.carbon +++ b/toolchain/check/testdata/pointer/import.carbon @@ -25,15 +25,13 @@ var a: i32* = a_ref; // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] // CHECK:STDOUT: %ptr: type = ptr_type %i32 [template] @@ -42,7 +40,7 @@ var a: i32* = a_ref; // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -56,15 +54,11 @@ var a: i32* = a_ref; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int_32.loc4: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc4: init type = call constants.%Int(%int_32.loc4) [template = constants.%i32] -// CHECK:STDOUT: %.loc4_13.1: type = value_of_initializer %int.make_type_signed.loc4 [template = constants.%i32] -// CHECK:STDOUT: %.loc4_13.2: type = converted %int.make_type_signed.loc4, %.loc4_13.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc4: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a_orig.var: ref %i32 = var a_orig // CHECK:STDOUT: %a_orig: ref %i32 = bind_name a_orig, %a_orig.var // CHECK:STDOUT: %int_32.loc5: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc5: init type = call constants.%Int(%int_32.loc5) [template = constants.%i32] -// CHECK:STDOUT: %.loc5_15.1: type = value_of_initializer %int.make_type_signed.loc5 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_15.2: type = converted %int.make_type_signed.loc5, %.loc5_15.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc5: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %ptr: type = ptr_type %i32 [template = constants.%ptr] // CHECK:STDOUT: %a_ref.var: ref %ptr = var a_ref // CHECK:STDOUT: %a_ref: ref %ptr = bind_name a_ref, %a_ref.var @@ -73,7 +67,7 @@ var a: i32* = a_ref; // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.2] @@ -89,9 +83,7 @@ var a: i32* = a_ref; // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %ptr: type = ptr_type %i32 [template] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -99,7 +91,7 @@ var a: i32* = a_ref; // CHECK:STDOUT: %import_ref.1 = import_ref Implicit//default, a_orig, unloaded // CHECK:STDOUT: %import_ref.2: ref %ptr = import_ref Implicit//default, a_ref, loaded // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref.37 +// CHECK:STDOUT: .Int = %import_ref.192 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -116,9 +108,7 @@ var a: i32* = a_ref; // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_signed, %.loc4_11.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %ptr: type = ptr_type %i32 [template = constants.%ptr] // CHECK:STDOUT: %a.var: ref %ptr = var a // CHECK:STDOUT: %a: ref %ptr = bind_name a, %a.var diff --git a/toolchain/check/testdata/pointer/nested_const.carbon b/toolchain/check/testdata/pointer/nested_const.carbon index fef8757375fe0..81a95ce749b08 100644 --- a/toolchain/check/testdata/pointer/nested_const.carbon +++ b/toolchain/check/testdata/pointer/nested_const.carbon @@ -17,9 +17,7 @@ fn F(p: const (const (const i32*)*)) -> const i32 { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %const.1: type = const_type %i32 [template] // CHECK:STDOUT: %ptr.1: type = ptr_type %const.1 [template] // CHECK:STDOUT: %const.2: type = const_type %ptr.1 [template] @@ -31,7 +29,7 @@ fn F(p: const (const (const i32*)*)) -> const i32 { // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -50,18 +48,14 @@ fn F(p: const (const (const i32*)*)) -> const i32 { // CHECK:STDOUT: %return.param_patt: %const.1 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc12_29: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc12_29: init type = call constants.%Int(%int_32.loc12_29) [template = constants.%i32] -// CHECK:STDOUT: %.loc12_23.1: type = value_of_initializer %int.make_type_signed.loc12_29 [template = constants.%i32] -// CHECK:STDOUT: %.loc12_23.2: type = converted %int.make_type_signed.loc12_29, %.loc12_23.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc12_29: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %const.loc12_23: type = const_type %i32 [template = constants.%const.1] // CHECK:STDOUT: %ptr.loc12_32: type = ptr_type %const.1 [template = constants.%ptr.1] // CHECK:STDOUT: %const.loc12_16: type = const_type %ptr.1 [template = constants.%const.2] // CHECK:STDOUT: %ptr.loc12_34: type = ptr_type %const.2 [template = constants.%ptr.2] // CHECK:STDOUT: %const.loc12_9: type = const_type %ptr.2 [template = constants.%const.3] // CHECK:STDOUT: %int_32.loc12_47: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc12_47: init type = call constants.%Int(%int_32.loc12_47) [template = constants.%i32] -// CHECK:STDOUT: %.loc12_41.1: type = value_of_initializer %int.make_type_signed.loc12_47 [template = constants.%i32] -// CHECK:STDOUT: %.loc12_41.2: type = converted %int.make_type_signed.loc12_47, %.loc12_41.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc12_47: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %const.loc12_41: type = const_type %i32 [template = constants.%const.1] // CHECK:STDOUT: %p.param: %const.3 = value_param runtime_param0 // CHECK:STDOUT: %p: %const.3 = bind_name p, %p.param diff --git a/toolchain/check/testdata/pointer/types.carbon b/toolchain/check/testdata/pointer/types.carbon index 08ad8c63581c1..8700887e6d7a7 100644 --- a/toolchain/check/testdata/pointer/types.carbon +++ b/toolchain/check/testdata/pointer/types.carbon @@ -20,9 +20,7 @@ fn ConstPtr(p: const i32*) -> (const i32)* { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %ptr.1: type = ptr_type %i32 [template] // CHECK:STDOUT: %Ptr.type: type = fn_type @Ptr [template] // CHECK:STDOUT: %Ptr: %Ptr.type = struct_value () [template] @@ -34,7 +32,7 @@ fn ConstPtr(p: const i32*) -> (const i32)* { // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -54,14 +52,10 @@ fn ConstPtr(p: const i32*) -> (const i32)* { // CHECK:STDOUT: %return.param_patt: %ptr.1 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc11_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11_11: init type = call constants.%Int(%int_32.loc11_11) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_14.1: type = value_of_initializer %int.make_type_signed.loc11_11 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_14.2: type = converted %int.make_type_signed.loc11_11, %.loc11_14.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc11_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %ptr.loc11_14: type = ptr_type %i32 [template = constants.%ptr.1] // CHECK:STDOUT: %int_32.loc11_20: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11_20: init type = call constants.%Int(%int_32.loc11_20) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_23.1: type = value_of_initializer %int.make_type_signed.loc11_20 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_23.2: type = converted %int.make_type_signed.loc11_20, %.loc11_23.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc11_20: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %ptr.loc11_23: type = ptr_type %i32 [template = constants.%ptr.1] // CHECK:STDOUT: %p.param: %ptr.1 = value_param runtime_param0 // CHECK:STDOUT: %p: %ptr.1 = bind_name p, %p.param @@ -75,15 +69,11 @@ fn ConstPtr(p: const i32*) -> (const i32)* { // CHECK:STDOUT: %return.param_patt: %ptr.2 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc15_22: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc15_22: init type = call constants.%Int(%int_32.loc15_22) [template = constants.%i32] -// CHECK:STDOUT: %.loc15_16.1: type = value_of_initializer %int.make_type_signed.loc15_22 [template = constants.%i32] -// CHECK:STDOUT: %.loc15_16.2: type = converted %int.make_type_signed.loc15_22, %.loc15_16.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc15_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %const.loc15_16: type = const_type %i32 [template = constants.%const] // CHECK:STDOUT: %ptr.loc15_25: type = ptr_type %const [template = constants.%ptr.2] // CHECK:STDOUT: %int_32.loc15_38: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc15_38: init type = call constants.%Int(%int_32.loc15_38) [template = constants.%i32] -// CHECK:STDOUT: %.loc15_32.1: type = value_of_initializer %int.make_type_signed.loc15_38 [template = constants.%i32] -// CHECK:STDOUT: %.loc15_32.2: type = converted %int.make_type_signed.loc15_38, %.loc15_32.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc15_38: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %const.loc15_32: type = const_type %i32 [template = constants.%const] // CHECK:STDOUT: %ptr.loc15_42: type = ptr_type %const [template = constants.%ptr.2] // CHECK:STDOUT: %p.param: %ptr.2 = value_param runtime_param0 diff --git a/toolchain/check/testdata/return/code_after_return.carbon b/toolchain/check/testdata/return/code_after_return.carbon index f29dd0d4697f3..c169dce60d076 100644 --- a/toolchain/check/testdata/return/code_after_return.carbon +++ b/toolchain/check/testdata/return/code_after_return.carbon @@ -23,7 +23,7 @@ fn Main() { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/return/code_after_return_value.carbon b/toolchain/check/testdata/return/code_after_return_value.carbon index e095125ac9a94..3f9d17e362790 100644 --- a/toolchain/check/testdata/return/code_after_return_value.carbon +++ b/toolchain/check/testdata/return/code_after_return_value.carbon @@ -26,17 +26,15 @@ fn F(b: bool) -> i32 { // CHECK:STDOUT: %Bool.type: type = fn_type @Bool [template] // CHECK:STDOUT: %Bool: %Bool.type = struct_value () [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_0.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] // CHECK:STDOUT: } @@ -45,7 +43,7 @@ fn F(b: bool) -> i32 { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Bool = %import_ref.1 // CHECK:STDOUT: .Int = %import_ref.2 -// CHECK:STDOUT: .ImplicitAs = %import_ref.3 +// CHECK:STDOUT: .ImplicitAs = %import_ref.6 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -67,9 +65,7 @@ fn F(b: bool) -> i32 { // CHECK:STDOUT: %.loc11_9.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc11_9.2: type = converted %bool.make_type, %.loc11_9.1 [template = bool] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_18.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc11_18.2: type = converted %int.make_type_signed, %.loc11_18.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %b.param: bool = value_param runtime_param0 // CHECK:STDOUT: %b: bool = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 @@ -80,7 +76,7 @@ fn F(b: bool) -> i32 { // CHECK:STDOUT: fn @F(%b.param_patt: bool) -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.2] diff --git a/toolchain/check/testdata/return/fail_call_in_type.carbon b/toolchain/check/testdata/return/fail_call_in_type.carbon index 0adc0030b71f1..abc736d566293 100644 --- a/toolchain/check/testdata/return/fail_call_in_type.carbon +++ b/toolchain/check/testdata/return/fail_call_in_type.carbon @@ -22,9 +22,7 @@ fn Six() -> ReturnType() { return 6; } // CHECK:STDOUT: %ReturnType.type: type = fn_type @ReturnType [template] // CHECK:STDOUT: %ReturnType: %ReturnType.type = struct_value () [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %Six.type: type = fn_type @Six [template] // CHECK:STDOUT: %Six: %Six.type = struct_value () [template] // CHECK:STDOUT: %int_6: Core.IntLiteral = int_value 6 [template] @@ -32,7 +30,7 @@ fn Six() -> ReturnType() { return 6; } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -68,10 +66,8 @@ fn Six() -> ReturnType() { return 6; } // CHECK:STDOUT: fn @ReturnType() -> type { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc13_37.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc13_37.2: type = converted %int.make_type_signed, %.loc13_37.1 [template = constants.%i32] -// CHECK:STDOUT: return %.loc13_37.2 +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: return %i32 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Six() -> { diff --git a/toolchain/check/testdata/return/fail_missing_return.carbon b/toolchain/check/testdata/return/fail_missing_return.carbon index e19b524283dd4..83552186e35bd 100644 --- a/toolchain/check/testdata/return/fail_missing_return.carbon +++ b/toolchain/check/testdata/return/fail_missing_return.carbon @@ -18,16 +18,14 @@ fn Main() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %Main.type: type = fn_type @Main [template] // CHECK:STDOUT: %Main: %Main.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -44,9 +42,7 @@ fn Main() -> i32 { // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_14.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc11_14.2: type = converted %int.make_type_signed, %.loc11_14.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/return/fail_return_var_no_returned_var.carbon b/toolchain/check/testdata/return/fail_return_var_no_returned_var.carbon index e8142a37904ae..ec099bb066e7d 100644 --- a/toolchain/check/testdata/return/fail_return_var_no_returned_var.carbon +++ b/toolchain/check/testdata/return/fail_return_var_no_returned_var.carbon @@ -19,16 +19,14 @@ fn Procedure() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %Procedure.type: type = fn_type @Procedure [template] // CHECK:STDOUT: %Procedure: %Procedure.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -45,9 +43,7 @@ fn Procedure() -> i32 { // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_19.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc11_19.2: type = converted %int.make_type_signed, %.loc11_19.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/return/fail_return_with_returned_var.carbon b/toolchain/check/testdata/return/fail_return_with_returned_var.carbon index 8ebaa8fb53ecb..facaa2f2f069f 100644 --- a/toolchain/check/testdata/return/fail_return_with_returned_var.carbon +++ b/toolchain/check/testdata/return/fail_return_with_returned_var.carbon @@ -36,32 +36,30 @@ fn G() -> C { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_0.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %C.elem: type = unbound_element_type %C, %i32 [template] // CHECK:STDOUT: %struct_type.a.b.1: type = struct_type {.a: %i32, .b: %i32} [template] -// CHECK:STDOUT: %complete_type.3: = complete_type_witness %struct_type.a.b.1 [template] +// CHECK:STDOUT: %complete_type.4: = complete_type_witness %struct_type.a.b.1 [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] // CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %struct_type.a.b.2: type = struct_type {.a: Core.IntLiteral, .b: Core.IntLiteral} [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] -// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_2.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_2.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] // CHECK:STDOUT: %C.val: %C = struct_value (%int_1.2, %int_2.2) [template] @@ -70,7 +68,7 @@ fn G() -> C { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -89,9 +87,7 @@ fn G() -> C { // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11: init type = call constants.%Int(%int_32.loc11) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %int.make_type_signed.loc11 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_11.2: type = converted %int.make_type_signed.loc11, %.loc11_11.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } @@ -108,16 +104,12 @@ fn G() -> C { // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: %int_32.loc23_18: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc23_18: init type = call constants.%Int(%int_32.loc23_18) [template = constants.%i32] -// CHECK:STDOUT: %.loc23_18.1: type = value_of_initializer %int.make_type_signed.loc23_18 [template = constants.%i32] -// CHECK:STDOUT: %.loc23_18.2: type = converted %int.make_type_signed.loc23_18, %.loc23_18.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc23_18: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc23_16: %C.elem = field_decl a, element0 [template] // CHECK:STDOUT: %int_32.loc23_30: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc23_30: init type = call constants.%Int(%int_32.loc23_30) [template = constants.%i32] -// CHECK:STDOUT: %.loc23_30.1: type = value_of_initializer %int.make_type_signed.loc23_30 [template = constants.%i32] -// CHECK:STDOUT: %.loc23_30.2: type = converted %int.make_type_signed.loc23_30, %.loc23_30.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc23_30: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc23_28: %C.elem = field_decl b, element1 [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a.b.1 [template = constants.%complete_type.3] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a.b.1 [template = constants.%complete_type.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C @@ -129,18 +121,16 @@ fn G() -> C { // CHECK:STDOUT: fn @F() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_32.loc12: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc12: init type = call constants.%Int(%int_32.loc12) [template = constants.%i32] -// CHECK:STDOUT: %.loc12_19.1: type = value_of_initializer %int.make_type_signed.loc12 [template = constants.%i32] -// CHECK:STDOUT: %.loc12_19.2: type = converted %int.make_type_signed.loc12, %.loc12_19.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc12: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %v.var: ref %i32 = var v // CHECK:STDOUT: %v: ref %i32 = bind_name v, %v.var // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc12_26: init %i32 = converted %int_0, %int.convert_checked [template = constants.%int_0.2] -// CHECK:STDOUT: assign %v.var, %.loc12_26 +// CHECK:STDOUT: %.loc12: init %i32 = converted %int_0, %int.convert_checked [template = constants.%int_0.2] +// CHECK:STDOUT: assign %v.var, %.loc12 // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -152,14 +142,14 @@ fn G() -> C { // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %.loc25_38.1: %struct_type.a.b.2 = struct_literal (%int_1, %int_2) -// CHECK:STDOUT: %impl.elem0.loc25_38.1: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc25_38.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc25_38.1: = bound_method %int_1, %impl.elem0.loc25_38.1 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc25_38.1: = specific_function %Convert.bound.loc25_38.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc25_38.1: init %i32 = call %Convert.specific_fn.loc25_38.1(%int_1) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc25_38.2: init %i32 = converted %int_1, %int.convert_checked.loc25_38.1 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc25_38.3: ref %i32 = class_element_access %return, element0 // CHECK:STDOUT: %.loc25_38.4: init %i32 = initialize_from %.loc25_38.2 to %.loc25_38.3 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc25_38.2: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc25_38.2: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc25_38.2: = bound_method %int_2, %impl.elem0.loc25_38.2 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc25_38.2: = specific_function %Convert.bound.loc25_38.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc25_38.2: init %i32 = call %Convert.specific_fn.loc25_38.2(%int_2) [template = constants.%int_2.2] diff --git a/toolchain/check/testdata/return/fail_returned_var_shadow.carbon b/toolchain/check/testdata/return/fail_returned_var_shadow.carbon index c4b0ea130c3ac..e28c88a735185 100644 --- a/toolchain/check/testdata/return/fail_returned_var_shadow.carbon +++ b/toolchain/check/testdata/return/fail_returned_var_shadow.carbon @@ -43,22 +43,20 @@ fn DifferentScopes() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %SameScope.type: type = fn_type @SameScope [template] // CHECK:STDOUT: %SameScope: %SameScope.type = struct_value () [template] // CHECK:STDOUT: %true: bool = bool_literal true [template] // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_0.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] // CHECK:STDOUT: %DifferentScopes.type: type = fn_type @DifferentScopes [template] @@ -68,7 +66,7 @@ fn DifferentScopes() -> i32 { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -86,9 +84,7 @@ fn DifferentScopes() -> i32 { // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11: init type = call constants.%Int(%int_32.loc11) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_19.1: type = value_of_initializer %int.make_type_signed.loc11 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_19.2: type = converted %int.make_type_signed.loc11, %.loc11_19.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } @@ -97,9 +93,7 @@ fn DifferentScopes() -> i32 { // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc26: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc26: init type = call constants.%Int(%int_32.loc26) [template = constants.%i32] -// CHECK:STDOUT: %.loc26_25.1: type = value_of_initializer %int.make_type_signed.loc26 [template = constants.%i32] -// CHECK:STDOUT: %.loc26_25.2: type = converted %int.make_type_signed.loc26, %.loc26_25.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc26: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } @@ -112,36 +106,32 @@ fn DifferentScopes() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: !if.then: // CHECK:STDOUT: %int_32.loc13: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc13: init type = call constants.%Int(%int_32.loc13) [template = constants.%i32] -// CHECK:STDOUT: %.loc13_21.1: type = value_of_initializer %int.make_type_signed.loc13 [template = constants.%i32] -// CHECK:STDOUT: %.loc13_21.2: type = converted %int.make_type_signed.loc13, %.loc13_21.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc13: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %v.var: ref %i32 = var v // CHECK:STDOUT: %v: ref %i32 = bind_name v, %v.var // CHECK:STDOUT: %int_0.loc13: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0.loc13: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc13: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc13: = bound_method %int_0.loc13, %impl.elem0.loc13 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc13: = specific_function %Convert.bound.loc13, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc13: init %i32 = call %Convert.specific_fn.loc13(%int_0.loc13) [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc13_28: init %i32 = converted %int_0.loc13, %int.convert_checked.loc13 [template = constants.%int_0.2] -// CHECK:STDOUT: assign %v.var, %.loc13_28 +// CHECK:STDOUT: %.loc13: init %i32 = converted %int_0.loc13, %int.convert_checked.loc13 [template = constants.%int_0.2] +// CHECK:STDOUT: assign %v.var, %.loc13 // CHECK:STDOUT: %int_32.loc21: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc21: init type = call constants.%Int(%int_32.loc21) [template = constants.%i32] -// CHECK:STDOUT: %.loc21_21.1: type = value_of_initializer %int.make_type_signed.loc21 [template = constants.%i32] -// CHECK:STDOUT: %.loc21_21.2: type = converted %int.make_type_signed.loc21, %.loc21_21.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc21: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %w.var: ref %i32 = var w // CHECK:STDOUT: %w: ref %i32 = bind_name w, %w.var // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc21: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc21: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc21: = bound_method %int_1, %impl.elem0.loc21 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc21: = specific_function %Convert.bound.loc21, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc21: init %i32 = call %Convert.specific_fn.loc21(%int_1) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc21_28: init %i32 = converted %int_1, %int.convert_checked.loc21 [template = constants.%int_1.2] -// CHECK:STDOUT: assign %w.var, %.loc21_28 +// CHECK:STDOUT: %.loc21: init %i32 = converted %int_1, %int.convert_checked.loc21 [template = constants.%int_1.2] +// CHECK:STDOUT: assign %w.var, %.loc21 // CHECK:STDOUT: br !if.else // CHECK:STDOUT: // CHECK:STDOUT: !if.else: // CHECK:STDOUT: %int_0.loc23: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0.loc23: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc23: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc23: = bound_method %int_0.loc23, %impl.elem0.loc23 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc23: = specific_function %Convert.bound.loc23, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc23: init %i32 = call %Convert.specific_fn.loc23(%int_0.loc23) [template = constants.%int_0.2] @@ -157,35 +147,31 @@ fn DifferentScopes() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: !if.then.loc27: // CHECK:STDOUT: %int_32.loc28: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc28: init type = call constants.%Int(%int_32.loc28) [template = constants.%i32] -// CHECK:STDOUT: %.loc28_21.1: type = value_of_initializer %int.make_type_signed.loc28 [template = constants.%i32] -// CHECK:STDOUT: %.loc28_21.2: type = converted %int.make_type_signed.loc28, %.loc28_21.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc28: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %v.var: ref %i32 = var v // CHECK:STDOUT: %v: ref %i32 = bind_name v, %v.var // CHECK:STDOUT: %int_0.loc28: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0.loc28: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc28: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc28: = bound_method %int_0.loc28, %impl.elem0.loc28 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc28: = specific_function %Convert.bound.loc28, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc28: init %i32 = call %Convert.specific_fn.loc28(%int_0.loc28) [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc28_28: init %i32 = converted %int_0.loc28, %int.convert_checked.loc28 [template = constants.%int_0.2] -// CHECK:STDOUT: assign %v.var, %.loc28_28 +// CHECK:STDOUT: %.loc28: init %i32 = converted %int_0.loc28, %int.convert_checked.loc28 [template = constants.%int_0.2] +// CHECK:STDOUT: assign %v.var, %.loc28 // CHECK:STDOUT: %true.loc29: bool = bool_literal true [template = constants.%true] // CHECK:STDOUT: if %true.loc29 br !if.then.loc29 else br !if.else.loc29 // CHECK:STDOUT: // CHECK:STDOUT: !if.then.loc29: // CHECK:STDOUT: %int_32.loc36: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc36: init type = call constants.%Int(%int_32.loc36) [template = constants.%i32] -// CHECK:STDOUT: %.loc36_23.1: type = value_of_initializer %int.make_type_signed.loc36 [template = constants.%i32] -// CHECK:STDOUT: %.loc36_23.2: type = converted %int.make_type_signed.loc36, %.loc36_23.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc36: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %w.var: ref %i32 = var w // CHECK:STDOUT: %w: ref %i32 = bind_name w, %w.var // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc36: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc36: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc36: = bound_method %int_1, %impl.elem0.loc36 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc36: = specific_function %Convert.bound.loc36, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc36: init %i32 = call %Convert.specific_fn.loc36(%int_1) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc36_30: init %i32 = converted %int_1, %int.convert_checked.loc36 [template = constants.%int_1.2] -// CHECK:STDOUT: assign %w.var, %.loc36_30 +// CHECK:STDOUT: %.loc36: init %i32 = converted %int_1, %int.convert_checked.loc36 [template = constants.%int_1.2] +// CHECK:STDOUT: assign %w.var, %.loc36 // CHECK:STDOUT: br !if.else.loc29 // CHECK:STDOUT: // CHECK:STDOUT: !if.else.loc29: @@ -193,7 +179,7 @@ fn DifferentScopes() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: !if.else.loc27: // CHECK:STDOUT: %int_0.loc39: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0.loc39: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc39: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc39: = bound_method %int_0.loc39, %impl.elem0.loc39 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc39: = specific_function %Convert.bound.loc39, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc39: init %i32 = call %Convert.specific_fn.loc39(%int_0.loc39) [template = constants.%int_0.2] diff --git a/toolchain/check/testdata/return/fail_returned_var_type.carbon b/toolchain/check/testdata/return/fail_returned_var_type.carbon index e85b320b72d79..90c2af009b35c 100644 --- a/toolchain/check/testdata/return/fail_returned_var_type.carbon +++ b/toolchain/check/testdata/return/fail_returned_var_type.carbon @@ -23,9 +23,7 @@ fn Mismatch() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %Mismatch.type: type = fn_type @Mismatch [template] // CHECK:STDOUT: %Mismatch: %Mismatch.type = struct_value () [template] // CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [template] @@ -37,7 +35,7 @@ fn Mismatch() -> i32 { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .Float = %import_ref.2 +// CHECK:STDOUT: .Float = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -54,9 +52,7 @@ fn Mismatch() -> i32 { // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_18.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc11_18.2: type = converted %int.make_type_signed, %.loc11_18.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/return/fail_type_mismatch.carbon b/toolchain/check/testdata/return/fail_type_mismatch.carbon index 912ed3a02c73c..18290c361ebbb 100644 --- a/toolchain/check/testdata/return/fail_type_mismatch.carbon +++ b/toolchain/check/testdata/return/fail_type_mismatch.carbon @@ -22,9 +22,7 @@ fn Main() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %Main.type: type = fn_type @Main [template] // CHECK:STDOUT: %Main: %Main.type = struct_value () [template] // CHECK:STDOUT: %float: f64 = float_literal 1 [template] @@ -33,7 +31,7 @@ fn Main() -> i32 { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -50,9 +48,7 @@ fn Main() -> i32 { // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_14.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc11_14.2: type = converted %int.make_type_signed, %.loc11_14.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/return/fail_value_missing.carbon b/toolchain/check/testdata/return/fail_value_missing.carbon index 96bef5e24bfe7..8ef3a7fdd502b 100644 --- a/toolchain/check/testdata/return/fail_value_missing.carbon +++ b/toolchain/check/testdata/return/fail_value_missing.carbon @@ -22,16 +22,14 @@ fn Main() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %Main.type: type = fn_type @Main [template] // CHECK:STDOUT: %Main: %Main.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -48,9 +46,7 @@ fn Main() -> i32 { // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_14.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc11_14.2: type = converted %int.make_type_signed, %.loc11_14.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/return/fail_var_in_type.carbon b/toolchain/check/testdata/return/fail_var_in_type.carbon index 537ad558d3f67..f3017ae0bf27f 100644 --- a/toolchain/check/testdata/return/fail_var_in_type.carbon +++ b/toolchain/check/testdata/return/fail_var_in_type.carbon @@ -18,9 +18,7 @@ fn Six() -> x { return 6; } // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %Six.type: type = fn_type @Six [template] // CHECK:STDOUT: %Six: %Six.type = struct_value () [template] // CHECK:STDOUT: %int_6: Core.IntLiteral = int_value 6 [template] @@ -28,7 +26,7 @@ fn Six() -> x { return 6; } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -63,8 +61,8 @@ fn Six() -> x { return 6; } // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: assign file.%x.var, %int.make_type_signed +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: assign file.%x.var, %i32 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/return/no_prelude/import_convert_function.carbon b/toolchain/check/testdata/return/no_prelude/import_convert_function.carbon index a58b729c28841..f8e8459d61f64 100644 --- a/toolchain/check/testdata/return/no_prelude/import_convert_function.carbon +++ b/toolchain/check/testdata/return/no_prelude/import_convert_function.carbon @@ -81,11 +81,11 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %Convert.assoc_type.1: type = assoc_entity_type %ImplicitAs.type.2, %Convert.type.1 [symbolic] // CHECK:STDOUT: %assoc0.1: %Convert.assoc_type.1 = assoc_entity element0, @ImplicitAs.%Convert.decl [symbolic] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] -// CHECK:STDOUT: %ImplicitAs.type.3: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] +// CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %ImplicitAs.type.3: type = facet_type <@ImplicitAs, @ImplicitAs(%i32.builtin)> [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.2 [template] // CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [template] -// CHECK:STDOUT: %Convert.type.3: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.3: type = fn_type @Convert.1, @ImplicitAs(%i32.builtin) [template] // CHECK:STDOUT: %Convert.3: %Convert.type.3 = struct_value () [template] // CHECK:STDOUT: %Convert.assoc_type.2: type = assoc_entity_type %ImplicitAs.type.3, %Convert.type.3 [template] // CHECK:STDOUT: %assoc0.2: %Convert.assoc_type.2 = assoc_entity element0, @ImplicitAs.%Convert.decl [template] @@ -135,10 +135,10 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %.loc12_17.2: type = converted %int_literal.make_type, %.loc12_17.1 [template = Core.IntLiteral] // CHECK:STDOUT: %ImplicitAs.ref: %ImplicitAs.type.1 = name_ref ImplicitAs, file.%ImplicitAs.decl [template = constants.%ImplicitAs.generic] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc12_36.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc12_36.2: type = converted %int.make_type_signed, %.loc12_36.1 [template = constants.%i32] -// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(constants.%i32)> [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32.builtin] +// CHECK:STDOUT: %.loc12_36.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32.builtin] +// CHECK:STDOUT: %.loc12_36.2: type = converted %int.make_type_signed, %.loc12_36.1 [template = constants.%i32.builtin] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(constants.%i32.builtin)> [template = constants.%ImplicitAs.type.3] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -185,18 +185,18 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %Convert.decl: %Convert.type.2 = fn_decl @Convert.2 [template = constants.%Convert.2] { // CHECK:STDOUT: %self.patt: Core.IntLiteral = binding_pattern self // CHECK:STDOUT: %self.param_patt: Core.IntLiteral = value_param_pattern %self.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32.builtin = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32.builtin = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref: type = name_ref Self, @impl.%.loc12_17.2 [template = Core.IntLiteral] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc13_31.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc13_31.2: type = converted %int.make_type_signed, %.loc13_31.1 [template = constants.%i32] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32.builtin] +// CHECK:STDOUT: %.loc13_31.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32.builtin] +// CHECK:STDOUT: %.loc13_31.2: type = converted %int.make_type_signed, %.loc13_31.1 [template = constants.%i32.builtin] // CHECK:STDOUT: %self.param: Core.IntLiteral = value_param runtime_param0 // CHECK:STDOUT: %self: Core.IntLiteral = bind_name self, %self.param -// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param +// CHECK:STDOUT: %return.param: ref %i32.builtin = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32.builtin = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %interface: = interface_witness (%Convert.decl) [template = constants.%interface] // CHECK:STDOUT: @@ -218,7 +218,7 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: fn[%self.param_patt: @Convert.1.%Self.as_type.loc9_20.1 (%Self.as_type)]() -> @Convert.1.%T (%T); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Convert.2[%self.param_patt: Core.IntLiteral]() -> %i32 = "int.convert_checked"; +// CHECK:STDOUT: fn @Convert.2[%self.param_patt: Core.IntLiteral]() -> %i32.builtin = "int.convert_checked"; // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(constants.%T) { // CHECK:STDOUT: %T.loc8_22.2 => constants.%T @@ -242,9 +242,9 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %T.patt.loc8_22.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @ImplicitAs(constants.%i32) { -// CHECK:STDOUT: %T.loc8_22.2 => constants.%i32 -// CHECK:STDOUT: %T.patt.loc8_22.2 => constants.%i32 +// CHECK:STDOUT: specific @ImplicitAs(constants.%i32.builtin) { +// CHECK:STDOUT: %T.loc8_22.2 => constants.%i32.builtin +// CHECK:STDOUT: %T.patt.loc8_22.2 => constants.%i32.builtin // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 @@ -255,8 +255,8 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %assoc0.loc9_32.2 => constants.%assoc0.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Convert.1(constants.%i32, constants.%ImplicitAs.facet) { -// CHECK:STDOUT: %T => constants.%i32 +// CHECK:STDOUT: specific @Convert.1(constants.%i32.builtin, constants.%ImplicitAs.facet) { +// CHECK:STDOUT: %T => constants.%i32.builtin // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 // CHECK:STDOUT: %Self => constants.%ImplicitAs.facet // CHECK:STDOUT: %Self.as_type.loc9_20.1 => Core.IntLiteral @@ -268,17 +268,17 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] // CHECK:STDOUT: %Int.type: type = fn_type @Int [template] // CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] -// CHECK:STDOUT: %N: %i32 = bind_symbolic_name N, 0 [symbolic] -// CHECK:STDOUT: %N.patt: %i32 = symbolic_binding_pattern N, 0 [symbolic] +// CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %N: %i32.builtin = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %N.patt: %i32.builtin = symbolic_binding_pattern N, 0 [symbolic] // CHECK:STDOUT: %C.type: type = generic_class_type @C [template] // CHECK:STDOUT: %C.generic: %C.type = struct_value () [template] // CHECK:STDOUT: %C.1: type = class_type @C, @C(%N) [symbolic] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] // CHECK:STDOUT: %complete_type.1: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %D: type = class_type @D [template] -// CHECK:STDOUT: %D.elem: type = unbound_element_type %D, %i32 [template] -// CHECK:STDOUT: %struct_type.n.m.1: type = struct_type {.n: %i32, .m: %i32} [template] +// CHECK:STDOUT: %D.elem: type = unbound_element_type %D, %i32.builtin [template] +// CHECK:STDOUT: %struct_type.n.m.1: type = struct_type {.n: %i32.builtin, .m: %i32.builtin} [template] // CHECK:STDOUT: %complete_type.2: = complete_type_witness %struct_type.n.m.1 [template] // CHECK:STDOUT: %Make.type: type = fn_type @Make [template] // CHECK:STDOUT: %Make: %Make.type = struct_value () [template] @@ -295,8 +295,8 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic] // CHECK:STDOUT: %Convert.assoc_type.1: type = assoc_entity_type %ImplicitAs.type.2, %Convert.type.1 [symbolic] // CHECK:STDOUT: %assoc0.1: %Convert.assoc_type.1 = assoc_entity element0, imports.%import_ref.6 [symbolic] -// CHECK:STDOUT: %ImplicitAs.type.3: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %ImplicitAs.type.3: type = facet_type <@ImplicitAs, @ImplicitAs(%i32.builtin)> [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32.builtin) [template] // CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [template] // CHECK:STDOUT: %Convert.assoc_type.2: type = assoc_entity_type %ImplicitAs.type.3, %Convert.type.2 [template] // CHECK:STDOUT: %assoc0.2: %Convert.assoc_type.2 = assoc_entity element0, imports.%import_ref.6 [template] @@ -305,7 +305,7 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %Convert.3: %Convert.type.3 = struct_value () [template] // CHECK:STDOUT: %interface.1: = interface_witness (%Convert.3) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_0.1, %Convert.3 [template] -// CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] +// CHECK:STDOUT: %int_0.2: %i32.builtin = int_value 0 [template] // CHECK:STDOUT: %D.val: %D = struct_value (%int_0.2, %int_0.2) [template] // CHECK:STDOUT: %C.2: type = class_type @C, @C(%int_0.2) [template] // CHECK:STDOUT: %ImplicitAs.type.4: type = facet_type <@ImplicitAs, @ImplicitAs(%D)> [template] @@ -319,7 +319,7 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %interface.2: = interface_witness (%Convert.4) [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %Convert.bound.2: = bound_method %int_1.1, %Convert.3 [template] -// CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] +// CHECK:STDOUT: %int_1.2: %i32.builtin = int_value 1 [template] // CHECK:STDOUT: %C.3: type = class_type @C, @C(%int_1.2) [template] // CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.4 [template] // CHECK:STDOUT: %Convert.6: %Convert.type.6 = struct_value () [template] @@ -327,7 +327,7 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %interface.3: = interface_witness (%Convert.6) [template] // CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %Convert.bound.3: = bound_method %int_2.1, %Convert.3 [template] -// CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] +// CHECK:STDOUT: %int_2.2: %i32.builtin = int_value 2 [template] // CHECK:STDOUT: %C.4: type = class_type @C, @C(%int_2.2) [template] // CHECK:STDOUT: %Convert.type.7: type = fn_type @Convert.5 [template] // CHECK:STDOUT: %Convert.7: %Convert.type.7 = struct_value () [template] @@ -335,7 +335,7 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %interface.4: = interface_witness (%Convert.7) [template] // CHECK:STDOUT: %int_3.1: Core.IntLiteral = int_value 3 [template] // CHECK:STDOUT: %Convert.bound.4: = bound_method %int_3.1, %Convert.3 [template] -// CHECK:STDOUT: %int_3.2: %i32 = int_value 3 [template] +// CHECK:STDOUT: %int_3.2: %i32.builtin = int_value 3 [template] // CHECK:STDOUT: %C.5: type = class_type @C, @C(%int_3.2) [template] // CHECK:STDOUT: %Convert.type.8: type = fn_type @Convert.6 [template] // CHECK:STDOUT: %Convert.8: %Convert.type.8 = struct_value () [template] @@ -343,7 +343,7 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %interface.5: = interface_witness (%Convert.8) [template] // CHECK:STDOUT: %int_4.1: Core.IntLiteral = int_value 4 [template] // CHECK:STDOUT: %Convert.bound.5: = bound_method %int_4.1, %Convert.3 [template] -// CHECK:STDOUT: %int_4.2: %i32 = int_value 4 [template] +// CHECK:STDOUT: %int_4.2: %i32.builtin = int_value 4 [template] // CHECK:STDOUT: %C.6: type = class_type @C, @C(%int_4.2) [template] // CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.7 [template] // CHECK:STDOUT: %Convert.9: %Convert.type.9 = struct_value () [template] @@ -351,7 +351,7 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %interface.6: = interface_witness (%Convert.9) [template] // CHECK:STDOUT: %int_5.1: Core.IntLiteral = int_value 5 [template] // CHECK:STDOUT: %Convert.bound.6: = bound_method %int_5.1, %Convert.3 [template] -// CHECK:STDOUT: %int_5.2: %i32 = int_value 5 [template] +// CHECK:STDOUT: %int_5.2: %i32.builtin = int_value 5 [template] // CHECK:STDOUT: %C.7: type = class_type @C, @C(%int_5.2) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.8 [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] @@ -359,7 +359,7 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %interface.7: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %int_6.1: Core.IntLiteral = int_value 6 [template] // CHECK:STDOUT: %Convert.bound.7: = bound_method %int_6.1, %Convert.3 [template] -// CHECK:STDOUT: %int_6.2: %i32 = int_value 6 [template] +// CHECK:STDOUT: %int_6.2: %i32.builtin = int_value 6 [template] // CHECK:STDOUT: %C.8: type = class_type @C, @C(%int_6.2) [template] // CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.9 [template] // CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [template] @@ -367,7 +367,7 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %interface.8: = interface_witness (%Convert.11) [template] // CHECK:STDOUT: %int_7.1: Core.IntLiteral = int_value 7 [template] // CHECK:STDOUT: %Convert.bound.8: = bound_method %int_7.1, %Convert.3 [template] -// CHECK:STDOUT: %int_7.2: %i32 = int_value 7 [template] +// CHECK:STDOUT: %int_7.2: %i32.builtin = int_value 7 [template] // CHECK:STDOUT: %C.9: type = class_type @C, @C(%int_7.2) [template] // CHECK:STDOUT: %Convert.type.12: type = fn_type @Convert.10 [template] // CHECK:STDOUT: %Convert.12: %Convert.type.12 = struct_value () [template] @@ -400,15 +400,15 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %C.decl: %C.type = class_decl @C [template = constants.%C.generic] { -// CHECK:STDOUT: %N.patt.loc6_9.1: %i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc6_9.2 (constants.%N.patt)] -// CHECK:STDOUT: %N.param_patt: %i32 = value_param_pattern %N.patt.loc6_9.1, runtime_param [symbolic = %N.patt.loc6_9.2 (constants.%N.patt)] +// CHECK:STDOUT: %N.patt.loc6_9.1: %i32.builtin = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc6_9.2 (constants.%N.patt)] +// CHECK:STDOUT: %N.param_patt: %i32.builtin = value_param_pattern %N.patt.loc6_9.1, runtime_param [symbolic = %N.patt.loc6_9.2 (constants.%N.patt)] // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc6_13.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc6_13.2: type = converted %int.make_type_signed, %.loc6_13.1 [template = constants.%i32] -// CHECK:STDOUT: %N.param: %i32 = value_param runtime_param -// CHECK:STDOUT: %N.loc6_9.1: %i32 = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc6_9.2 (constants.%N)] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32.builtin] +// CHECK:STDOUT: %.loc6_13.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32.builtin] +// CHECK:STDOUT: %.loc6_13.2: type = converted %int.make_type_signed, %.loc6_13.1 [template = constants.%i32.builtin] +// CHECK:STDOUT: %N.param: %i32.builtin = value_param runtime_param +// CHECK:STDOUT: %N.loc6_9.1: %i32.builtin = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc6_9.2 (constants.%N)] // CHECK:STDOUT: } // CHECK:STDOUT: %D.decl: type = class_decl @D [template = constants.%D] {} {} // CHECK:STDOUT: %Make.decl: %Make.type = fn_decl @Make [template = constants.%Make] { @@ -424,9 +424,9 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.1, element0 [template = constants.%Convert.3] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.bound(%int_0) [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc10_9.1: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc10_9.2: %i32 = converted %int_0, %.loc10_9.1 [template = constants.%int_0.2] +// CHECK:STDOUT: %int.convert_checked: init %i32.builtin = call %Convert.bound(%int_0) [template = constants.%int_0.2] +// CHECK:STDOUT: %.loc10_9.1: %i32.builtin = value_of_initializer %int.convert_checked [template = constants.%int_0.2] +// CHECK:STDOUT: %.loc10_9.2: %i32.builtin = converted %int_0, %.loc10_9.1 [template = constants.%int_0.2] // CHECK:STDOUT: %C: type = class_type @C, @C(constants.%int_0.2) [template = constants.%C.2] // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %ImplicitAs.ref: %ImplicitAs.type.1 = name_ref ImplicitAs, imports.%import_ref.2 [template = constants.%ImplicitAs.generic] @@ -438,9 +438,9 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.1, element0 [template = constants.%Convert.3] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1, %impl.elem0 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.bound(%int_1) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc11_9.1: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc11_9.2: %i32 = converted %int_1, %.loc11_9.1 [template = constants.%int_1.2] +// CHECK:STDOUT: %int.convert_checked: init %i32.builtin = call %Convert.bound(%int_1) [template = constants.%int_1.2] +// CHECK:STDOUT: %.loc11_9.1: %i32.builtin = value_of_initializer %int.convert_checked [template = constants.%int_1.2] +// CHECK:STDOUT: %.loc11_9.2: %i32.builtin = converted %int_1, %.loc11_9.1 [template = constants.%int_1.2] // CHECK:STDOUT: %C: type = class_type @C, @C(constants.%int_1.2) [template = constants.%C.3] // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %ImplicitAs.ref: %ImplicitAs.type.1 = name_ref ImplicitAs, imports.%import_ref.2 [template = constants.%ImplicitAs.generic] @@ -452,9 +452,9 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.1, element0 [template = constants.%Convert.3] // CHECK:STDOUT: %Convert.bound: = bound_method %int_2, %impl.elem0 [template = constants.%Convert.bound.3] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.bound(%int_2) [template = constants.%int_2.2] -// CHECK:STDOUT: %.loc12_9.1: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_2.2] -// CHECK:STDOUT: %.loc12_9.2: %i32 = converted %int_2, %.loc12_9.1 [template = constants.%int_2.2] +// CHECK:STDOUT: %int.convert_checked: init %i32.builtin = call %Convert.bound(%int_2) [template = constants.%int_2.2] +// CHECK:STDOUT: %.loc12_9.1: %i32.builtin = value_of_initializer %int.convert_checked [template = constants.%int_2.2] +// CHECK:STDOUT: %.loc12_9.2: %i32.builtin = converted %int_2, %.loc12_9.1 [template = constants.%int_2.2] // CHECK:STDOUT: %C: type = class_type @C, @C(constants.%int_2.2) [template = constants.%C.4] // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %ImplicitAs.ref: %ImplicitAs.type.1 = name_ref ImplicitAs, imports.%import_ref.2 [template = constants.%ImplicitAs.generic] @@ -466,9 +466,9 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] // CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.1, element0 [template = constants.%Convert.3] // CHECK:STDOUT: %Convert.bound: = bound_method %int_3, %impl.elem0 [template = constants.%Convert.bound.4] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.bound(%int_3) [template = constants.%int_3.2] -// CHECK:STDOUT: %.loc13_9.1: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_3.2] -// CHECK:STDOUT: %.loc13_9.2: %i32 = converted %int_3, %.loc13_9.1 [template = constants.%int_3.2] +// CHECK:STDOUT: %int.convert_checked: init %i32.builtin = call %Convert.bound(%int_3) [template = constants.%int_3.2] +// CHECK:STDOUT: %.loc13_9.1: %i32.builtin = value_of_initializer %int.convert_checked [template = constants.%int_3.2] +// CHECK:STDOUT: %.loc13_9.2: %i32.builtin = converted %int_3, %.loc13_9.1 [template = constants.%int_3.2] // CHECK:STDOUT: %C: type = class_type @C, @C(constants.%int_3.2) [template = constants.%C.5] // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %ImplicitAs.ref: %ImplicitAs.type.1 = name_ref ImplicitAs, imports.%import_ref.2 [template = constants.%ImplicitAs.generic] @@ -480,9 +480,9 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [template = constants.%int_4.1] // CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.1, element0 [template = constants.%Convert.3] // CHECK:STDOUT: %Convert.bound: = bound_method %int_4, %impl.elem0 [template = constants.%Convert.bound.5] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.bound(%int_4) [template = constants.%int_4.2] -// CHECK:STDOUT: %.loc14_9.1: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_4.2] -// CHECK:STDOUT: %.loc14_9.2: %i32 = converted %int_4, %.loc14_9.1 [template = constants.%int_4.2] +// CHECK:STDOUT: %int.convert_checked: init %i32.builtin = call %Convert.bound(%int_4) [template = constants.%int_4.2] +// CHECK:STDOUT: %.loc14_9.1: %i32.builtin = value_of_initializer %int.convert_checked [template = constants.%int_4.2] +// CHECK:STDOUT: %.loc14_9.2: %i32.builtin = converted %int_4, %.loc14_9.1 [template = constants.%int_4.2] // CHECK:STDOUT: %C: type = class_type @C, @C(constants.%int_4.2) [template = constants.%C.6] // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %ImplicitAs.ref: %ImplicitAs.type.1 = name_ref ImplicitAs, imports.%import_ref.2 [template = constants.%ImplicitAs.generic] @@ -494,9 +494,9 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %int_5: Core.IntLiteral = int_value 5 [template = constants.%int_5.1] // CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.1, element0 [template = constants.%Convert.3] // CHECK:STDOUT: %Convert.bound: = bound_method %int_5, %impl.elem0 [template = constants.%Convert.bound.6] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.bound(%int_5) [template = constants.%int_5.2] -// CHECK:STDOUT: %.loc15_9.1: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_5.2] -// CHECK:STDOUT: %.loc15_9.2: %i32 = converted %int_5, %.loc15_9.1 [template = constants.%int_5.2] +// CHECK:STDOUT: %int.convert_checked: init %i32.builtin = call %Convert.bound(%int_5) [template = constants.%int_5.2] +// CHECK:STDOUT: %.loc15_9.1: %i32.builtin = value_of_initializer %int.convert_checked [template = constants.%int_5.2] +// CHECK:STDOUT: %.loc15_9.2: %i32.builtin = converted %int_5, %.loc15_9.1 [template = constants.%int_5.2] // CHECK:STDOUT: %C: type = class_type @C, @C(constants.%int_5.2) [template = constants.%C.7] // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %ImplicitAs.ref: %ImplicitAs.type.1 = name_ref ImplicitAs, imports.%import_ref.2 [template = constants.%ImplicitAs.generic] @@ -508,9 +508,9 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %int_6: Core.IntLiteral = int_value 6 [template = constants.%int_6.1] // CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.1, element0 [template = constants.%Convert.3] // CHECK:STDOUT: %Convert.bound: = bound_method %int_6, %impl.elem0 [template = constants.%Convert.bound.7] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.bound(%int_6) [template = constants.%int_6.2] -// CHECK:STDOUT: %.loc16_9.1: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_6.2] -// CHECK:STDOUT: %.loc16_9.2: %i32 = converted %int_6, %.loc16_9.1 [template = constants.%int_6.2] +// CHECK:STDOUT: %int.convert_checked: init %i32.builtin = call %Convert.bound(%int_6) [template = constants.%int_6.2] +// CHECK:STDOUT: %.loc16_9.1: %i32.builtin = value_of_initializer %int.convert_checked [template = constants.%int_6.2] +// CHECK:STDOUT: %.loc16_9.2: %i32.builtin = converted %int_6, %.loc16_9.1 [template = constants.%int_6.2] // CHECK:STDOUT: %C: type = class_type @C, @C(constants.%int_6.2) [template = constants.%C.8] // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %ImplicitAs.ref: %ImplicitAs.type.1 = name_ref ImplicitAs, imports.%import_ref.2 [template = constants.%ImplicitAs.generic] @@ -522,9 +522,9 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %int_7: Core.IntLiteral = int_value 7 [template = constants.%int_7.1] // CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.1, element0 [template = constants.%Convert.3] // CHECK:STDOUT: %Convert.bound: = bound_method %int_7, %impl.elem0 [template = constants.%Convert.bound.8] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.bound(%int_7) [template = constants.%int_7.2] -// CHECK:STDOUT: %.loc17_9.1: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_7.2] -// CHECK:STDOUT: %.loc17_9.2: %i32 = converted %int_7, %.loc17_9.1 [template = constants.%int_7.2] +// CHECK:STDOUT: %int.convert_checked: init %i32.builtin = call %Convert.bound(%int_7) [template = constants.%int_7.2] +// CHECK:STDOUT: %.loc17_9.1: %i32.builtin = value_of_initializer %int.convert_checked [template = constants.%int_7.2] +// CHECK:STDOUT: %.loc17_9.2: %i32.builtin = converted %int_7, %.loc17_9.1 [template = constants.%int_7.2] // CHECK:STDOUT: %C: type = class_type @C, @C(constants.%int_7.2) [template = constants.%C.9] // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %ImplicitAs.ref: %ImplicitAs.type.1 = name_ref ImplicitAs, imports.%import_ref.2 [template = constants.%ImplicitAs.generic] @@ -726,9 +726,9 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: witness = %interface // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @C(%N.loc6_9.1: %i32) { -// CHECK:STDOUT: %N.loc6_9.2: %i32 = bind_symbolic_name N, 0 [symbolic = %N.loc6_9.2 (constants.%N)] -// CHECK:STDOUT: %N.patt.loc6_9.2: %i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc6_9.2 (constants.%N.patt)] +// CHECK:STDOUT: generic class @C(%N.loc6_9.1: %i32.builtin) { +// CHECK:STDOUT: %N.loc6_9.2: %i32.builtin = bind_symbolic_name N, 0 [symbolic = %N.loc6_9.2 (constants.%N)] +// CHECK:STDOUT: %N.patt.loc6_9.2: %i32.builtin = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc6_9.2 (constants.%N.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: @@ -743,14 +743,14 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: // CHECK:STDOUT: class @D { // CHECK:STDOUT: %int_32.loc7_18: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc7_18: init type = call constants.%Int(%int_32.loc7_18) [template = constants.%i32] -// CHECK:STDOUT: %.loc7_18.1: type = value_of_initializer %int.make_type_signed.loc7_18 [template = constants.%i32] -// CHECK:STDOUT: %.loc7_18.2: type = converted %int.make_type_signed.loc7_18, %.loc7_18.1 [template = constants.%i32] +// CHECK:STDOUT: %int.make_type_signed.loc7_18: init type = call constants.%Int(%int_32.loc7_18) [template = constants.%i32.builtin] +// CHECK:STDOUT: %.loc7_18.1: type = value_of_initializer %int.make_type_signed.loc7_18 [template = constants.%i32.builtin] +// CHECK:STDOUT: %.loc7_18.2: type = converted %int.make_type_signed.loc7_18, %.loc7_18.1 [template = constants.%i32.builtin] // CHECK:STDOUT: %.loc7_16: %D.elem = field_decl n, element0 [template] // CHECK:STDOUT: %int_32.loc7_30: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc7_30: init type = call constants.%Int(%int_32.loc7_30) [template = constants.%i32] -// CHECK:STDOUT: %.loc7_30.1: type = value_of_initializer %int.make_type_signed.loc7_30 [template = constants.%i32] -// CHECK:STDOUT: %.loc7_30.2: type = converted %int.make_type_signed.loc7_30, %.loc7_30.1 [template = constants.%i32] +// CHECK:STDOUT: %int.make_type_signed.loc7_30: init type = call constants.%Int(%int_32.loc7_30) [template = constants.%i32.builtin] +// CHECK:STDOUT: %.loc7_30.1: type = value_of_initializer %int.make_type_signed.loc7_30 [template = constants.%i32.builtin] +// CHECK:STDOUT: %.loc7_30.2: type = converted %int.make_type_signed.loc7_30, %.loc7_30.1 [template = constants.%i32.builtin] // CHECK:STDOUT: %.loc7_28: %D.elem = field_decl m, element1 [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.n.m.1 [template = constants.%complete_type.2] // CHECK:STDOUT: @@ -770,16 +770,16 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %.loc8_40.1: %struct_type.n.m.2 = struct_literal (%int_0.loc8_31, %int_0.loc8_39) // CHECK:STDOUT: %impl.elem0.loc8_40.1: %Convert.type.2 = interface_witness_access constants.%interface.1, element0 [template = constants.%Convert.3] // CHECK:STDOUT: %Convert.bound.loc8_40.1: = bound_method %int_0.loc8_31, %impl.elem0.loc8_40.1 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %int.convert_checked.loc8_40.1: init %i32 = call %Convert.bound.loc8_40.1(%int_0.loc8_31) [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc8_40.2: init %i32 = converted %int_0.loc8_31, %int.convert_checked.loc8_40.1 [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc8_40.3: ref %i32 = class_element_access %return, element0 -// CHECK:STDOUT: %.loc8_40.4: init %i32 = initialize_from %.loc8_40.2 to %.loc8_40.3 [template = constants.%int_0.2] +// CHECK:STDOUT: %int.convert_checked.loc8_40.1: init %i32.builtin = call %Convert.bound.loc8_40.1(%int_0.loc8_31) [template = constants.%int_0.2] +// CHECK:STDOUT: %.loc8_40.2: init %i32.builtin = converted %int_0.loc8_31, %int.convert_checked.loc8_40.1 [template = constants.%int_0.2] +// CHECK:STDOUT: %.loc8_40.3: ref %i32.builtin = class_element_access %return, element0 +// CHECK:STDOUT: %.loc8_40.4: init %i32.builtin = initialize_from %.loc8_40.2 to %.loc8_40.3 [template = constants.%int_0.2] // CHECK:STDOUT: %impl.elem0.loc8_40.2: %Convert.type.2 = interface_witness_access constants.%interface.1, element0 [template = constants.%Convert.3] // CHECK:STDOUT: %Convert.bound.loc8_40.2: = bound_method %int_0.loc8_39, %impl.elem0.loc8_40.2 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %int.convert_checked.loc8_40.2: init %i32 = call %Convert.bound.loc8_40.2(%int_0.loc8_39) [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc8_40.5: init %i32 = converted %int_0.loc8_39, %int.convert_checked.loc8_40.2 [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc8_40.6: ref %i32 = class_element_access %return, element1 -// CHECK:STDOUT: %.loc8_40.7: init %i32 = initialize_from %.loc8_40.5 to %.loc8_40.6 [template = constants.%int_0.2] +// CHECK:STDOUT: %int.convert_checked.loc8_40.2: init %i32.builtin = call %Convert.bound.loc8_40.2(%int_0.loc8_39) [template = constants.%int_0.2] +// CHECK:STDOUT: %.loc8_40.5: init %i32.builtin = converted %int_0.loc8_39, %int.convert_checked.loc8_40.2 [template = constants.%int_0.2] +// CHECK:STDOUT: %.loc8_40.6: ref %i32.builtin = class_element_access %return, element1 +// CHECK:STDOUT: %.loc8_40.7: init %i32.builtin = initialize_from %.loc8_40.5 to %.loc8_40.6 [template = constants.%int_0.2] // CHECK:STDOUT: %.loc8_40.8: init %D = class_init (%.loc8_40.4, %.loc8_40.7), %return [template = constants.%D.val] // CHECK:STDOUT: %.loc8_41: init %D = converted %.loc8_40.1, %.loc8_40.8 [template = constants.%D.val] // CHECK:STDOUT: return %.loc8_41 to %return @@ -794,7 +794,7 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: fn[%self.param_patt: @Convert.1.%Self.as_type (%Self.as_type)]() -> @Convert.1.%T (%T); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Convert.2[%self.param_patt: Core.IntLiteral]() -> %i32 = "int.convert_checked" [from "core.carbon"]; +// CHECK:STDOUT: fn @Convert.2[%self.param_patt: Core.IntLiteral]() -> %i32.builtin = "int.convert_checked" [from "core.carbon"]; // CHECK:STDOUT: // CHECK:STDOUT: fn @Convert.3[%self.param_patt: %C.2]() -> %return.param_patt: %D { // CHECK:STDOUT: !entry: @@ -887,9 +887,9 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %Self.as_type => constants.%Self.as_type // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @ImplicitAs(constants.%i32) { -// CHECK:STDOUT: %T => constants.%i32 -// CHECK:STDOUT: %T.patt => constants.%i32 +// CHECK:STDOUT: specific @ImplicitAs(constants.%i32.builtin) { +// CHECK:STDOUT: %T => constants.%i32.builtin +// CHECK:STDOUT: %T.patt => constants.%i32.builtin // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 @@ -1031,9 +1031,9 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] // CHECK:STDOUT: %Int.type: type = fn_type @Int [template] // CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [template] // CHECK:STDOUT: %D: type = class_type @D [template] -// CHECK:STDOUT: %struct_type.n.m: type = struct_type {.n: %i32, .m: %i32} [template] +// CHECK:STDOUT: %struct_type.n.m: type = struct_type {.n: %i32.builtin, .m: %i32.builtin} [template] // CHECK:STDOUT: %complete_type.1: = complete_type_witness %struct_type.n.m [template] // CHECK:STDOUT: %F0.type: type = fn_type @F0 [template] // CHECK:STDOUT: %F0: %F0.type = struct_value () [template] @@ -1042,8 +1042,8 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %C.type: type = generic_class_type @C [template] // CHECK:STDOUT: %C.generic: %C.type = struct_value () [template] // CHECK:STDOUT: %complete_type.2: = complete_type_witness %empty_struct_type [template] -// CHECK:STDOUT: %N: %i32 = bind_symbolic_name N, 0 [symbolic] -// CHECK:STDOUT: %N.patt: %i32 = symbolic_binding_pattern N, 0 [symbolic] +// CHECK:STDOUT: %N: %i32.builtin = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %N.patt: %i32.builtin = symbolic_binding_pattern N, 0 [symbolic] // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] // CHECK:STDOUT: %ImplicitAs.type.2: type = facet_type <@ImplicitAs, @ImplicitAs(%T)> [symbolic] @@ -1054,8 +1054,8 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic] // CHECK:STDOUT: %Convert.assoc_type.1: type = assoc_entity_type %ImplicitAs.type.2, %Convert.type.1 [symbolic] // CHECK:STDOUT: %assoc0.1: %Convert.assoc_type.1 = assoc_entity element0, imports.%import_ref.14 [symbolic] -// CHECK:STDOUT: %ImplicitAs.type.3: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %ImplicitAs.type.3: type = facet_type <@ImplicitAs, @ImplicitAs(%i32.builtin)> [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32.builtin) [template] // CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [template] // CHECK:STDOUT: %Convert.assoc_type.2: type = assoc_entity_type %ImplicitAs.type.3, %Convert.type.2 [template] // CHECK:STDOUT: %assoc0.2: %Convert.assoc_type.2 = assoc_entity element0, imports.%import_ref.14 [template] @@ -1064,7 +1064,7 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %Convert.3: %Convert.type.3 = struct_value () [template] // CHECK:STDOUT: %interface.1: = interface_witness (%Convert.3) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_0.1, %Convert.3 [template] -// CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] +// CHECK:STDOUT: %int_0.2: %i32.builtin = int_value 0 [template] // CHECK:STDOUT: %C.2: type = class_type @C, @C(%int_0.2) [template] // CHECK:STDOUT: %C.val.1: %C.2 = struct_value () [template] // CHECK:STDOUT: %ImplicitAs.type.4: type = facet_type <@ImplicitAs, @ImplicitAs(%D)> [template] @@ -1072,19 +1072,19 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %Convert.4: %Convert.type.4 = struct_value () [template] // CHECK:STDOUT: %Convert.assoc_type.3: type = assoc_entity_type %ImplicitAs.type.4, %Convert.type.4 [template] // CHECK:STDOUT: %assoc0.4: %Convert.assoc_type.3 = assoc_entity element0, imports.%import_ref.14 [template] -// CHECK:STDOUT: %int_1.1: %i32 = int_value 1 [template] +// CHECK:STDOUT: %int_1.1: %i32.builtin = int_value 1 [template] // CHECK:STDOUT: %C.3: type = class_type @C, @C(%int_1.1) [template] -// CHECK:STDOUT: %int_2.1: %i32 = int_value 2 [template] +// CHECK:STDOUT: %int_2.1: %i32.builtin = int_value 2 [template] // CHECK:STDOUT: %C.4: type = class_type @C, @C(%int_2.1) [template] -// CHECK:STDOUT: %int_3.1: %i32 = int_value 3 [template] +// CHECK:STDOUT: %int_3.1: %i32.builtin = int_value 3 [template] // CHECK:STDOUT: %C.5: type = class_type @C, @C(%int_3.1) [template] -// CHECK:STDOUT: %int_4.1: %i32 = int_value 4 [template] +// CHECK:STDOUT: %int_4.1: %i32.builtin = int_value 4 [template] // CHECK:STDOUT: %C.6: type = class_type @C, @C(%int_4.1) [template] -// CHECK:STDOUT: %int_5.1: %i32 = int_value 5 [template] +// CHECK:STDOUT: %int_5.1: %i32.builtin = int_value 5 [template] // CHECK:STDOUT: %C.7: type = class_type @C, @C(%int_5.1) [template] -// CHECK:STDOUT: %int_6.1: %i32 = int_value 6 [template] +// CHECK:STDOUT: %int_6.1: %i32.builtin = int_value 6 [template] // CHECK:STDOUT: %C.8: type = class_type @C, @C(%int_6.1) [template] -// CHECK:STDOUT: %int_7.1: %i32 = int_value 7 [template] +// CHECK:STDOUT: %int_7.1: %i32.builtin = int_value 7 [template] // CHECK:STDOUT: %C.9: type = class_type @C, @C(%int_7.1) [template] // CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.3 [template] // CHECK:STDOUT: %Convert.5: %Convert.type.5 = struct_value () [template] @@ -1198,19 +1198,19 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %P.import = import P // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %F0.decl: %F0.type = fn_decl @F0 [template = constants.%F0] { -// CHECK:STDOUT: %n.patt: %i32 = binding_pattern n -// CHECK:STDOUT: %n.param_patt: %i32 = value_param_pattern %n.patt, runtime_param0 +// CHECK:STDOUT: %n.patt: %i32.builtin = binding_pattern n +// CHECK:STDOUT: %n.param_patt: %i32.builtin = value_param_pattern %n.patt, runtime_param0 // CHECK:STDOUT: %return.patt: %D = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %D = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc7_10.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc7_10.2: type = converted %int.make_type_signed, %.loc7_10.1 [template = constants.%i32] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32.builtin] +// CHECK:STDOUT: %.loc7_10.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32.builtin] +// CHECK:STDOUT: %.loc7_10.2: type = converted %int.make_type_signed, %.loc7_10.1 [template = constants.%i32.builtin] // CHECK:STDOUT: %P.ref.loc7: = name_ref P, imports.%P [template = imports.%P] // CHECK:STDOUT: %D.ref: type = name_ref D, imports.%import_ref.2 [template = constants.%D] -// CHECK:STDOUT: %n.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %n: %i32 = bind_name n, %n.param +// CHECK:STDOUT: %n.param: %i32.builtin = value_param runtime_param0 +// CHECK:STDOUT: %n: %i32.builtin = bind_name n, %n.param // CHECK:STDOUT: %return.param: ref %D = out_param runtime_param1 // CHECK:STDOUT: %return: ref %D = return_slot %return.param // CHECK:STDOUT: } @@ -1289,9 +1289,9 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: complete_type_witness = imports.%import_ref.3 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @C(constants.%N: %i32) [from "library.carbon"] { -// CHECK:STDOUT: %N: %i32 = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %N.patt: %i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: generic class @C(constants.%N: %i32.builtin) [from "library.carbon"] { +// CHECK:STDOUT: %N: %i32.builtin = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: %i32.builtin = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: @@ -1304,7 +1304,7 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: // CHECK:STDOUT: fn @Int(%N.param_patt: Core.IntLiteral) -> type = "int.make_type_signed" [from "core.carbon"]; // CHECK:STDOUT: -// CHECK:STDOUT: fn @F0(%n.param_patt: %i32) -> %return.param_patt: %D { +// CHECK:STDOUT: fn @F0(%n.param_patt: %i32.builtin) -> %return.param_patt: %D { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %false.loc8: bool = bool_literal false [template = constants.%false] // CHECK:STDOUT: if %false.loc8 br !if.then.loc8 else br !if.else.loc8 @@ -1316,9 +1316,9 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %impl.elem0.loc8_34: %Convert.type.2 = interface_witness_access constants.%interface.1, element0 [template = constants.%Convert.3] // CHECK:STDOUT: %Convert.bound.loc8_34: = bound_method %int_0, %impl.elem0.loc8_34 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %int.convert_checked.loc8: init %i32 = call %Convert.bound.loc8_34(%int_0) [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc8_34.1: %i32 = value_of_initializer %int.convert_checked.loc8 [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc8_34.2: %i32 = converted %int_0, %.loc8_34.1 [template = constants.%int_0.2] +// CHECK:STDOUT: %int.convert_checked.loc8: init %i32.builtin = call %Convert.bound.loc8_34(%int_0) [template = constants.%int_0.2] +// CHECK:STDOUT: %.loc8_34.1: %i32.builtin = value_of_initializer %int.convert_checked.loc8 [template = constants.%int_0.2] +// CHECK:STDOUT: %.loc8_34.2: %i32.builtin = converted %int_0, %.loc8_34.1 [template = constants.%int_0.2] // CHECK:STDOUT: %C.loc8: type = class_type @C, @C(constants.%int_0.2) [template = constants.%C.2] // CHECK:STDOUT: %.loc8_24.2: ref %C.2 = temporary_storage // CHECK:STDOUT: %.loc8_24.3: init %C.2 = class_init (), %.loc8_24.2 [template = constants.%C.val.1] @@ -1343,9 +1343,9 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.2] // CHECK:STDOUT: %impl.elem0.loc9_34: %Convert.type.2 = interface_witness_access constants.%interface.1, element0 [template = constants.%Convert.3] // CHECK:STDOUT: %Convert.bound.loc9_34: = bound_method %int_1, %impl.elem0.loc9_34 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %int.convert_checked.loc9: init %i32 = call %Convert.bound.loc9_34(%int_1) [template = constants.%int_1.1] -// CHECK:STDOUT: %.loc9_34.1: %i32 = value_of_initializer %int.convert_checked.loc9 [template = constants.%int_1.1] -// CHECK:STDOUT: %.loc9_34.2: %i32 = converted %int_1, %.loc9_34.1 [template = constants.%int_1.1] +// CHECK:STDOUT: %int.convert_checked.loc9: init %i32.builtin = call %Convert.bound.loc9_34(%int_1) [template = constants.%int_1.1] +// CHECK:STDOUT: %.loc9_34.1: %i32.builtin = value_of_initializer %int.convert_checked.loc9 [template = constants.%int_1.1] +// CHECK:STDOUT: %.loc9_34.2: %i32.builtin = converted %int_1, %.loc9_34.1 [template = constants.%int_1.1] // CHECK:STDOUT: %C.loc9: type = class_type @C, @C(constants.%int_1.1) [template = constants.%C.3] // CHECK:STDOUT: %.loc9_24.2: ref %C.3 = temporary_storage // CHECK:STDOUT: %.loc9_24.3: init %C.3 = class_init (), %.loc9_24.2 [template = constants.%C.val.2] @@ -1370,9 +1370,9 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.2] // CHECK:STDOUT: %impl.elem0.loc10_34: %Convert.type.2 = interface_witness_access constants.%interface.1, element0 [template = constants.%Convert.3] // CHECK:STDOUT: %Convert.bound.loc10_34: = bound_method %int_2, %impl.elem0.loc10_34 [template = constants.%Convert.bound.3] -// CHECK:STDOUT: %int.convert_checked.loc10: init %i32 = call %Convert.bound.loc10_34(%int_2) [template = constants.%int_2.1] -// CHECK:STDOUT: %.loc10_34.1: %i32 = value_of_initializer %int.convert_checked.loc10 [template = constants.%int_2.1] -// CHECK:STDOUT: %.loc10_34.2: %i32 = converted %int_2, %.loc10_34.1 [template = constants.%int_2.1] +// CHECK:STDOUT: %int.convert_checked.loc10: init %i32.builtin = call %Convert.bound.loc10_34(%int_2) [template = constants.%int_2.1] +// CHECK:STDOUT: %.loc10_34.1: %i32.builtin = value_of_initializer %int.convert_checked.loc10 [template = constants.%int_2.1] +// CHECK:STDOUT: %.loc10_34.2: %i32.builtin = converted %int_2, %.loc10_34.1 [template = constants.%int_2.1] // CHECK:STDOUT: %C.loc10: type = class_type @C, @C(constants.%int_2.1) [template = constants.%C.4] // CHECK:STDOUT: %.loc10_24.2: ref %C.4 = temporary_storage // CHECK:STDOUT: %.loc10_24.3: init %C.4 = class_init (), %.loc10_24.2 [template = constants.%C.val.3] @@ -1397,9 +1397,9 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3.2] // CHECK:STDOUT: %impl.elem0.loc11_34: %Convert.type.2 = interface_witness_access constants.%interface.1, element0 [template = constants.%Convert.3] // CHECK:STDOUT: %Convert.bound.loc11_34: = bound_method %int_3, %impl.elem0.loc11_34 [template = constants.%Convert.bound.4] -// CHECK:STDOUT: %int.convert_checked.loc11: init %i32 = call %Convert.bound.loc11_34(%int_3) [template = constants.%int_3.1] -// CHECK:STDOUT: %.loc11_34.1: %i32 = value_of_initializer %int.convert_checked.loc11 [template = constants.%int_3.1] -// CHECK:STDOUT: %.loc11_34.2: %i32 = converted %int_3, %.loc11_34.1 [template = constants.%int_3.1] +// CHECK:STDOUT: %int.convert_checked.loc11: init %i32.builtin = call %Convert.bound.loc11_34(%int_3) [template = constants.%int_3.1] +// CHECK:STDOUT: %.loc11_34.1: %i32.builtin = value_of_initializer %int.convert_checked.loc11 [template = constants.%int_3.1] +// CHECK:STDOUT: %.loc11_34.2: %i32.builtin = converted %int_3, %.loc11_34.1 [template = constants.%int_3.1] // CHECK:STDOUT: %C.loc11: type = class_type @C, @C(constants.%int_3.1) [template = constants.%C.5] // CHECK:STDOUT: %.loc11_24.2: ref %C.5 = temporary_storage // CHECK:STDOUT: %.loc11_24.3: init %C.5 = class_init (), %.loc11_24.2 [template = constants.%C.val.4] @@ -1424,9 +1424,9 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [template = constants.%int_4.2] // CHECK:STDOUT: %impl.elem0.loc12_34: %Convert.type.2 = interface_witness_access constants.%interface.1, element0 [template = constants.%Convert.3] // CHECK:STDOUT: %Convert.bound.loc12_34: = bound_method %int_4, %impl.elem0.loc12_34 [template = constants.%Convert.bound.5] -// CHECK:STDOUT: %int.convert_checked.loc12: init %i32 = call %Convert.bound.loc12_34(%int_4) [template = constants.%int_4.1] -// CHECK:STDOUT: %.loc12_34.1: %i32 = value_of_initializer %int.convert_checked.loc12 [template = constants.%int_4.1] -// CHECK:STDOUT: %.loc12_34.2: %i32 = converted %int_4, %.loc12_34.1 [template = constants.%int_4.1] +// CHECK:STDOUT: %int.convert_checked.loc12: init %i32.builtin = call %Convert.bound.loc12_34(%int_4) [template = constants.%int_4.1] +// CHECK:STDOUT: %.loc12_34.1: %i32.builtin = value_of_initializer %int.convert_checked.loc12 [template = constants.%int_4.1] +// CHECK:STDOUT: %.loc12_34.2: %i32.builtin = converted %int_4, %.loc12_34.1 [template = constants.%int_4.1] // CHECK:STDOUT: %C.loc12: type = class_type @C, @C(constants.%int_4.1) [template = constants.%C.6] // CHECK:STDOUT: %.loc12_24.2: ref %C.6 = temporary_storage // CHECK:STDOUT: %.loc12_24.3: init %C.6 = class_init (), %.loc12_24.2 [template = constants.%C.val.5] @@ -1451,9 +1451,9 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %int_5: Core.IntLiteral = int_value 5 [template = constants.%int_5.2] // CHECK:STDOUT: %impl.elem0.loc13_34: %Convert.type.2 = interface_witness_access constants.%interface.1, element0 [template = constants.%Convert.3] // CHECK:STDOUT: %Convert.bound.loc13_34: = bound_method %int_5, %impl.elem0.loc13_34 [template = constants.%Convert.bound.6] -// CHECK:STDOUT: %int.convert_checked.loc13: init %i32 = call %Convert.bound.loc13_34(%int_5) [template = constants.%int_5.1] -// CHECK:STDOUT: %.loc13_34.1: %i32 = value_of_initializer %int.convert_checked.loc13 [template = constants.%int_5.1] -// CHECK:STDOUT: %.loc13_34.2: %i32 = converted %int_5, %.loc13_34.1 [template = constants.%int_5.1] +// CHECK:STDOUT: %int.convert_checked.loc13: init %i32.builtin = call %Convert.bound.loc13_34(%int_5) [template = constants.%int_5.1] +// CHECK:STDOUT: %.loc13_34.1: %i32.builtin = value_of_initializer %int.convert_checked.loc13 [template = constants.%int_5.1] +// CHECK:STDOUT: %.loc13_34.2: %i32.builtin = converted %int_5, %.loc13_34.1 [template = constants.%int_5.1] // CHECK:STDOUT: %C.loc13: type = class_type @C, @C(constants.%int_5.1) [template = constants.%C.7] // CHECK:STDOUT: %.loc13_24.2: ref %C.7 = temporary_storage // CHECK:STDOUT: %.loc13_24.3: init %C.7 = class_init (), %.loc13_24.2 [template = constants.%C.val.6] @@ -1478,9 +1478,9 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %int_6: Core.IntLiteral = int_value 6 [template = constants.%int_6.2] // CHECK:STDOUT: %impl.elem0.loc14_34: %Convert.type.2 = interface_witness_access constants.%interface.1, element0 [template = constants.%Convert.3] // CHECK:STDOUT: %Convert.bound.loc14_34: = bound_method %int_6, %impl.elem0.loc14_34 [template = constants.%Convert.bound.7] -// CHECK:STDOUT: %int.convert_checked.loc14: init %i32 = call %Convert.bound.loc14_34(%int_6) [template = constants.%int_6.1] -// CHECK:STDOUT: %.loc14_34.1: %i32 = value_of_initializer %int.convert_checked.loc14 [template = constants.%int_6.1] -// CHECK:STDOUT: %.loc14_34.2: %i32 = converted %int_6, %.loc14_34.1 [template = constants.%int_6.1] +// CHECK:STDOUT: %int.convert_checked.loc14: init %i32.builtin = call %Convert.bound.loc14_34(%int_6) [template = constants.%int_6.1] +// CHECK:STDOUT: %.loc14_34.1: %i32.builtin = value_of_initializer %int.convert_checked.loc14 [template = constants.%int_6.1] +// CHECK:STDOUT: %.loc14_34.2: %i32.builtin = converted %int_6, %.loc14_34.1 [template = constants.%int_6.1] // CHECK:STDOUT: %C.loc14: type = class_type @C, @C(constants.%int_6.1) [template = constants.%C.8] // CHECK:STDOUT: %.loc14_24.2: ref %C.8 = temporary_storage // CHECK:STDOUT: %.loc14_24.3: init %C.8 = class_init (), %.loc14_24.2 [template = constants.%C.val.7] @@ -1505,9 +1505,9 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %int_7: Core.IntLiteral = int_value 7 [template = constants.%int_7.2] // CHECK:STDOUT: %impl.elem0.loc15_34: %Convert.type.2 = interface_witness_access constants.%interface.1, element0 [template = constants.%Convert.3] // CHECK:STDOUT: %Convert.bound.loc15_34: = bound_method %int_7, %impl.elem0.loc15_34 [template = constants.%Convert.bound.8] -// CHECK:STDOUT: %int.convert_checked.loc15: init %i32 = call %Convert.bound.loc15_34(%int_7) [template = constants.%int_7.1] -// CHECK:STDOUT: %.loc15_34.1: %i32 = value_of_initializer %int.convert_checked.loc15 [template = constants.%int_7.1] -// CHECK:STDOUT: %.loc15_34.2: %i32 = converted %int_7, %.loc15_34.1 [template = constants.%int_7.1] +// CHECK:STDOUT: %int.convert_checked.loc15: init %i32.builtin = call %Convert.bound.loc15_34(%int_7) [template = constants.%int_7.1] +// CHECK:STDOUT: %.loc15_34.1: %i32.builtin = value_of_initializer %int.convert_checked.loc15 [template = constants.%int_7.1] +// CHECK:STDOUT: %.loc15_34.2: %i32.builtin = converted %int_7, %.loc15_34.1 [template = constants.%int_7.1] // CHECK:STDOUT: %C.loc15: type = class_type @C, @C(constants.%int_7.1) [template = constants.%C.9] // CHECK:STDOUT: %.loc15_24.2: ref %C.9 = temporary_storage // CHECK:STDOUT: %.loc15_24.3: init %C.9 = class_init (), %.loc15_24.2 [template = constants.%C.val.8] @@ -1538,7 +1538,7 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: fn[%self.param_patt: @Convert.1.%Self.as_type (%Self.as_type)]() -> @Convert.1.%T (%T); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Convert.2[%self.param_patt: Core.IntLiteral]() -> %i32 = "int.convert_checked" [from "core.carbon"]; +// CHECK:STDOUT: fn @Convert.2[%self.param_patt: Core.IntLiteral]() -> %i32.builtin = "int.convert_checked" [from "core.carbon"]; // CHECK:STDOUT: // CHECK:STDOUT: fn @Convert.3[%self.param_patt: %C.2]() -> %D [from "library.carbon"]; // CHECK:STDOUT: @@ -1585,9 +1585,9 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %Self.as_type => constants.%Self.as_type // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @ImplicitAs(constants.%i32) { -// CHECK:STDOUT: %T => constants.%i32 -// CHECK:STDOUT: %T.patt => constants.%i32 +// CHECK:STDOUT: specific @ImplicitAs(constants.%i32.builtin) { +// CHECK:STDOUT: %T => constants.%i32.builtin +// CHECK:STDOUT: %T.patt => constants.%i32.builtin // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3 diff --git a/toolchain/check/testdata/return/returned_var.carbon b/toolchain/check/testdata/return/returned_var.carbon index f59d3fe2a4ef0..6e0bae13ebf15 100644 --- a/toolchain/check/testdata/return/returned_var.carbon +++ b/toolchain/check/testdata/return/returned_var.carbon @@ -28,32 +28,30 @@ fn G() -> i32 { // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %C.elem: type = unbound_element_type %C, %i32 [template] // CHECK:STDOUT: %struct_type.a.b.1: type = struct_type {.a: %i32, .b: %i32} [template] -// CHECK:STDOUT: %complete_type.1: = complete_type_witness %struct_type.a.b.1 [template] +// CHECK:STDOUT: %complete_type.3: = complete_type_witness %struct_type.a.b.1 [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %struct_type.a.b.2: type = struct_type {.a: Core.IntLiteral, .b: Core.IntLiteral} [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] // CHECK:STDOUT: %C.val: %C = struct_value (%int_1.2, %int_2.2) [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] -// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_0.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] // CHECK:STDOUT: } @@ -61,7 +59,7 @@ fn G() -> i32 { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -89,9 +87,7 @@ fn G() -> i32 { // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc21: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc21: init type = call constants.%Int(%int_32.loc21) [template = constants.%i32] -// CHECK:STDOUT: %.loc21_11.1: type = value_of_initializer %int.make_type_signed.loc21 [template = constants.%i32] -// CHECK:STDOUT: %.loc21_11.2: type = converted %int.make_type_signed.loc21, %.loc21_11.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc21: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } @@ -99,21 +95,17 @@ fn G() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: %int_32.loc12: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc12: init type = call constants.%Int(%int_32.loc12) [template = constants.%i32] -// CHECK:STDOUT: %.loc12_10.1: type = value_of_initializer %int.make_type_signed.loc12 [template = constants.%i32] -// CHECK:STDOUT: %.loc12_10.2: type = converted %int.make_type_signed.loc12, %.loc12_10.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc12_8: %C.elem = field_decl a, element0 [template] +// CHECK:STDOUT: %i32.loc12: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc12: %C.elem = field_decl a, element0 [template] // CHECK:STDOUT: %int_32.loc13: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc13: init type = call constants.%Int(%int_32.loc13) [template = constants.%i32] -// CHECK:STDOUT: %.loc13_10.1: type = value_of_initializer %int.make_type_signed.loc13 [template = constants.%i32] -// CHECK:STDOUT: %.loc13_10.2: type = converted %int.make_type_signed.loc13, %.loc13_10.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc13_8: %C.elem = field_decl b, element1 [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a.b.1 [template = constants.%complete_type.1] +// CHECK:STDOUT: %i32.loc13: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc13: %C.elem = field_decl b, element1 [template] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a.b.1 [template = constants.%complete_type.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C -// CHECK:STDOUT: .a = %.loc12_8 -// CHECK:STDOUT: .b = %.loc13_8 +// CHECK:STDOUT: .a = %.loc12 +// CHECK:STDOUT: .b = %.loc13 // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } // CHECK:STDOUT: @@ -124,14 +116,14 @@ fn G() -> i32 { // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %.loc17_43.1: %struct_type.a.b.2 = struct_literal (%int_1, %int_2) -// CHECK:STDOUT: %impl.elem0.loc17_43.1: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc17_43.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc17_43.1: = bound_method %int_1, %impl.elem0.loc17_43.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc17_43.1: = specific_function %Convert.bound.loc17_43.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc17_43.1: init %i32 = call %Convert.specific_fn.loc17_43.1(%int_1) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc17_43.2: init %i32 = converted %int_1, %int.convert_checked.loc17_43.1 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc17_43.3: ref %i32 = class_element_access %return, element0 // CHECK:STDOUT: %.loc17_43.4: init %i32 = initialize_from %.loc17_43.2 to %.loc17_43.3 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc17_43.2: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc17_43.2: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc17_43.2: = bound_method %int_2, %impl.elem0.loc17_43.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc17_43.2: = specific_function %Convert.bound.loc17_43.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc17_43.2: init %i32 = call %Convert.specific_fn.loc17_43.2(%int_2) [template = constants.%int_2.2] @@ -147,13 +139,11 @@ fn G() -> i32 { // CHECK:STDOUT: fn @G() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_32.loc22: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc22: init type = call constants.%Int(%int_32.loc22) [template = constants.%i32] -// CHECK:STDOUT: %.loc22_24.1: type = value_of_initializer %int.make_type_signed.loc22 [template = constants.%i32] -// CHECK:STDOUT: %.loc22_24.2: type = converted %int.make_type_signed.loc22, %.loc22_24.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %result.var: ref %i32 = var result // CHECK:STDOUT: %result: ref %i32 = bind_name result, %result.var // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.2] diff --git a/toolchain/check/testdata/return/returned_var_scope.carbon b/toolchain/check/testdata/return/returned_var_scope.carbon index 15a216fde2353..6776faa597e0d 100644 --- a/toolchain/check/testdata/return/returned_var_scope.carbon +++ b/toolchain/check/testdata/return/returned_var_scope.carbon @@ -31,22 +31,20 @@ fn EnclosingButAfter(b: bool) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %UnrelatedScopes.type: type = fn_type @UnrelatedScopes [template] // CHECK:STDOUT: %UnrelatedScopes: %UnrelatedScopes.type = struct_value () [template] // CHECK:STDOUT: %true: bool = bool_literal true [template] // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_0.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] // CHECK:STDOUT: %Bool.type: type = fn_type @Bool [template] @@ -58,8 +56,8 @@ fn EnclosingButAfter(b: bool) -> i32 { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 -// CHECK:STDOUT: .Bool = %import_ref.38 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 +// CHECK:STDOUT: .Bool = %import_ref.193 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -77,9 +75,7 @@ fn EnclosingButAfter(b: bool) -> i32 { // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11: init type = call constants.%Int(%int_32.loc11) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_25.1: type = value_of_initializer %int.make_type_signed.loc11 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_25.2: type = converted %int.make_type_signed.loc11, %.loc11_25.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } @@ -93,9 +89,7 @@ fn EnclosingButAfter(b: bool) -> i32 { // CHECK:STDOUT: %.loc21_25.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc21_25.2: type = converted %bool.make_type, %.loc21_25.1 [template = bool] // CHECK:STDOUT: %int_32.loc21: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc21: init type = call constants.%Int(%int_32.loc21) [template = constants.%i32] -// CHECK:STDOUT: %.loc21_34.1: type = value_of_initializer %int.make_type_signed.loc21 [template = constants.%i32] -// CHECK:STDOUT: %.loc21_34.2: type = converted %int.make_type_signed.loc21, %.loc21_34.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc21: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %b.param: bool = value_param runtime_param0 // CHECK:STDOUT: %b: bool = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 @@ -110,18 +104,16 @@ fn EnclosingButAfter(b: bool) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: !if.then.loc12: // CHECK:STDOUT: %int_32.loc13: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc13: init type = call constants.%Int(%int_32.loc13) [template = constants.%i32] -// CHECK:STDOUT: %.loc13_21.1: type = value_of_initializer %int.make_type_signed.loc13 [template = constants.%i32] -// CHECK:STDOUT: %.loc13_21.2: type = converted %int.make_type_signed.loc13, %.loc13_21.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc13: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %v.var: ref %i32 = var v // CHECK:STDOUT: %v: ref %i32 = bind_name v, %v.var // CHECK:STDOUT: %int_0.loc13: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0.loc13: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc13: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc13: = bound_method %int_0.loc13, %impl.elem0.loc13 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc13: = specific_function %Convert.bound.loc13, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc13: init %i32 = call %Convert.specific_fn.loc13(%int_0.loc13) [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc13_28: init %i32 = converted %int_0.loc13, %int.convert_checked.loc13 [template = constants.%int_0.2] -// CHECK:STDOUT: assign %v.var, %.loc13_28 +// CHECK:STDOUT: %.loc13: init %i32 = converted %int_0.loc13, %int.convert_checked.loc13 [template = constants.%int_0.2] +// CHECK:STDOUT: assign %v.var, %.loc13 // CHECK:STDOUT: br !if.else.loc12 // CHECK:STDOUT: // CHECK:STDOUT: !if.else.loc12: @@ -130,23 +122,21 @@ fn EnclosingButAfter(b: bool) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: !if.then.loc15: // CHECK:STDOUT: %int_32.loc16: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc16: init type = call constants.%Int(%int_32.loc16) [template = constants.%i32] -// CHECK:STDOUT: %.loc16_21.1: type = value_of_initializer %int.make_type_signed.loc16 [template = constants.%i32] -// CHECK:STDOUT: %.loc16_21.2: type = converted %int.make_type_signed.loc16, %.loc16_21.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc16: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %w.var: ref %i32 = var w // CHECK:STDOUT: %w: ref %i32 = bind_name w, %w.var // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc16: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc16: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc16: = bound_method %int_1, %impl.elem0.loc16 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc16: = specific_function %Convert.bound.loc16, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc16: init %i32 = call %Convert.specific_fn.loc16(%int_1) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc16_28: init %i32 = converted %int_1, %int.convert_checked.loc16 [template = constants.%int_1.2] -// CHECK:STDOUT: assign %w.var, %.loc16_28 +// CHECK:STDOUT: %.loc16: init %i32 = converted %int_1, %int.convert_checked.loc16 [template = constants.%int_1.2] +// CHECK:STDOUT: assign %w.var, %.loc16 // CHECK:STDOUT: br !if.else.loc15 // CHECK:STDOUT: // CHECK:STDOUT: !if.else.loc15: // CHECK:STDOUT: %int_0.loc18: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0.loc18: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc18: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc18: = bound_method %int_0.loc18, %impl.elem0.loc18 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc18: = specific_function %Convert.bound.loc18, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc18: init %i32 = call %Convert.specific_fn.loc18(%int_0.loc18) [template = constants.%int_0.2] @@ -162,13 +152,11 @@ fn EnclosingButAfter(b: bool) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: !if.then: // CHECK:STDOUT: %int_32.loc23: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc23: init type = call constants.%Int(%int_32.loc23) [template = constants.%i32] -// CHECK:STDOUT: %.loc23_21.1: type = value_of_initializer %int.make_type_signed.loc23 [template = constants.%i32] -// CHECK:STDOUT: %.loc23_21.2: type = converted %int.make_type_signed.loc23, %.loc23_21.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc23: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %v.var: ref %i32 = var v // CHECK:STDOUT: %v: ref %i32 = bind_name v, %v.var // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0.loc23: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc23: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc23: = bound_method %int_0, %impl.elem0.loc23 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc23: = specific_function %Convert.bound.loc23, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc23: init %i32 = call %Convert.specific_fn.loc23(%int_0) [template = constants.%int_0.2] @@ -179,13 +167,11 @@ fn EnclosingButAfter(b: bool) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: !if.else: // CHECK:STDOUT: %int_32.loc26: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc26: init type = call constants.%Int(%int_32.loc26) [template = constants.%i32] -// CHECK:STDOUT: %.loc26_19.1: type = value_of_initializer %int.make_type_signed.loc26 [template = constants.%i32] -// CHECK:STDOUT: %.loc26_19.2: type = converted %int.make_type_signed.loc26, %.loc26_19.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc26: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %w.var: ref %i32 = var w // CHECK:STDOUT: %w: ref %i32 = bind_name w, %w.var // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc26: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc26: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc26: = bound_method %int_1, %impl.elem0.loc26 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc26: = specific_function %Convert.bound.loc26, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc26: init %i32 = call %Convert.specific_fn.loc26(%int_1) [template = constants.%int_1.2] diff --git a/toolchain/check/testdata/return/struct.carbon b/toolchain/check/testdata/return/struct.carbon index 43a1eb9d589fa..758b0bdcb19be 100644 --- a/toolchain/check/testdata/return/struct.carbon +++ b/toolchain/check/testdata/return/struct.carbon @@ -16,19 +16,17 @@ fn Main() -> {.a: i32} { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %struct_type.a.1: type = struct_type {.a: %i32} [template] // CHECK:STDOUT: %Main.type: type = fn_type @Main [template] // CHECK:STDOUT: %Main: %Main.type = struct_value () [template] // CHECK:STDOUT: %int_3.1: Core.IntLiteral = int_value 3 [template] // CHECK:STDOUT: %struct_type.a.2: type = struct_type {.a: Core.IntLiteral} [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_3.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound: = bound_method %int_3.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_3.2: %i32 = int_value 3 [template] // CHECK:STDOUT: %struct: %struct_type.a.1 = struct_value (%int_3.2) [template] @@ -37,7 +35,7 @@ fn Main() -> {.a: i32} { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -54,9 +52,7 @@ fn Main() -> {.a: i32} { // CHECK:STDOUT: %return.param_patt: %struct_type.a.1 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_19.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc11_19.2: type = converted %int.make_type_signed, %.loc11_19.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %struct_type.a: type = struct_type {.a: %i32} [template = constants.%struct_type.a.1] // CHECK:STDOUT: %return.param: ref %struct_type.a.1 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %struct_type.a.1 = return_slot %return.param @@ -67,7 +63,7 @@ fn Main() -> {.a: i32} { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] // CHECK:STDOUT: %.loc12_17.1: %struct_type.a.2 = struct_literal (%int_3) -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_3, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_3) [template = constants.%int_3.2] diff --git a/toolchain/check/testdata/return/tuple.carbon b/toolchain/check/testdata/return/tuple.carbon index 6c79d3698b344..bf416164d9e23 100644 --- a/toolchain/check/testdata/return/tuple.carbon +++ b/toolchain/check/testdata/return/tuple.carbon @@ -17,9 +17,7 @@ fn Main() -> (i32, i32) { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (type, type) [template] // CHECK:STDOUT: %tuple.type.2: type = tuple_type (%i32, %i32) [template] // CHECK:STDOUT: %Main.type: type = fn_type @Main [template] @@ -28,13 +26,13 @@ fn Main() -> (i32, i32) { // CHECK:STDOUT: %int_35.1: Core.IntLiteral = int_value 35 [template] // CHECK:STDOUT: %tuple.type.3: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_15.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_15.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_15.2: %i32 = int_value 15 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_35.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_35.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_35.2: %i32 = int_value 35 [template] // CHECK:STDOUT: %tuple: %tuple.type.2 = tuple_value (%int_15.2, %int_35.2) [template] @@ -43,7 +41,7 @@ fn Main() -> (i32, i32) { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -60,15 +58,11 @@ fn Main() -> (i32, i32) { // CHECK:STDOUT: %return.param_patt: %tuple.type.2 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc12_15: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc12_15: init type = call constants.%Int(%int_32.loc12_15) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc12_15: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc12_20: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc12_20: init type = call constants.%Int(%int_32.loc12_20) [template = constants.%i32] -// CHECK:STDOUT: %.loc12_23.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc12_15, %int.make_type_signed.loc12_20) -// CHECK:STDOUT: %.loc12_23.2: type = value_of_initializer %int.make_type_signed.loc12_15 [template = constants.%i32] -// CHECK:STDOUT: %.loc12_23.3: type = converted %int.make_type_signed.loc12_15, %.loc12_23.2 [template = constants.%i32] -// CHECK:STDOUT: %.loc12_23.4: type = value_of_initializer %int.make_type_signed.loc12_20 [template = constants.%i32] -// CHECK:STDOUT: %.loc12_23.5: type = converted %int.make_type_signed.loc12_20, %.loc12_23.4 [template = constants.%i32] -// CHECK:STDOUT: %.loc12_23.6: type = converted %.loc12_23.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] +// CHECK:STDOUT: %i32.loc12_20: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc12_23.1: %tuple.type.1 = tuple_literal (%i32.loc12_15, %i32.loc12_20) +// CHECK:STDOUT: %.loc12_23.2: type = converted %.loc12_23.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %return.param: ref %tuple.type.2 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %tuple.type.2 = return_slot %return.param // CHECK:STDOUT: } @@ -79,14 +73,14 @@ fn Main() -> (i32, i32) { // CHECK:STDOUT: %int_15: Core.IntLiteral = int_value 15 [template = constants.%int_15.1] // CHECK:STDOUT: %int_35: Core.IntLiteral = int_value 35 [template = constants.%int_35.1] // CHECK:STDOUT: %.loc13_17.1: %tuple.type.3 = tuple_literal (%int_15, %int_35) -// CHECK:STDOUT: %impl.elem0.loc13_17.1: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc13_17.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc13_17.1: = bound_method %int_15, %impl.elem0.loc13_17.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc13_17.1: = specific_function %Convert.bound.loc13_17.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc13_17.1: init %i32 = call %Convert.specific_fn.loc13_17.1(%int_15) [template = constants.%int_15.2] // CHECK:STDOUT: %.loc13_17.2: init %i32 = converted %int_15, %int.convert_checked.loc13_17.1 [template = constants.%int_15.2] // CHECK:STDOUT: %tuple.elem0: ref %i32 = tuple_access %return, element0 // CHECK:STDOUT: %.loc13_17.3: init %i32 = initialize_from %.loc13_17.2 to %tuple.elem0 [template = constants.%int_15.2] -// CHECK:STDOUT: %impl.elem0.loc13_17.2: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc13_17.2: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc13_17.2: = bound_method %int_35, %impl.elem0.loc13_17.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc13_17.2: = specific_function %Convert.bound.loc13_17.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc13_17.2: init %i32 = call %Convert.specific_fn.loc13_17.2(%int_35) [template = constants.%int_35.2] diff --git a/toolchain/check/testdata/return/value.carbon b/toolchain/check/testdata/return/value.carbon index 6c710b0cb44fa..2855077b5b4dc 100644 --- a/toolchain/check/testdata/return/value.carbon +++ b/toolchain/check/testdata/return/value.carbon @@ -16,17 +16,15 @@ fn Main() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %Main.type: type = fn_type @Main [template] // CHECK:STDOUT: %Main: %Main.type = struct_value () [template] // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] // CHECK:STDOUT: } @@ -34,7 +32,7 @@ fn Main() -> i32 { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -51,9 +49,7 @@ fn Main() -> i32 { // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_14.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc11_14.2: type = converted %int.make_type_signed, %.loc11_14.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } @@ -62,7 +58,7 @@ fn Main() -> i32 { // CHECK:STDOUT: fn @Main() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.2] diff --git a/toolchain/check/testdata/struct/fail_assign_empty.carbon b/toolchain/check/testdata/struct/fail_assign_empty.carbon index 7891a8e5dcba5..9182423b385f6 100644 --- a/toolchain/check/testdata/struct/fail_assign_empty.carbon +++ b/toolchain/check/testdata/struct/fail_assign_empty.carbon @@ -17,16 +17,14 @@ var x: {.a: i32} = {}; // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %struct_type.a: type = struct_type {.a: %i32} [template] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -39,9 +37,7 @@ var x: {.a: i32} = {}; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc14_13.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc14_13.2: type = converted %int.make_type_signed, %.loc14_13.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %struct_type.a: type = struct_type {.a: %i32} [template = constants.%struct_type.a] // CHECK:STDOUT: %x.var: ref %struct_type.a = var x // CHECK:STDOUT: %x: ref %struct_type.a = bind_name x, %x.var diff --git a/toolchain/check/testdata/struct/fail_duplicate_name.carbon b/toolchain/check/testdata/struct/fail_duplicate_name.carbon index a7f9e922151d8..82e44977a043f 100644 --- a/toolchain/check/testdata/struct/fail_duplicate_name.carbon +++ b/toolchain/check/testdata/struct/fail_duplicate_name.carbon @@ -56,9 +56,7 @@ var y: {.b: i32, .c: i32} = {.b = 3, .b = 4}; // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template] @@ -72,7 +70,7 @@ var y: {.b: i32, .c: i32} = {.b = 3, .b = 4}; // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -93,55 +91,33 @@ var y: {.b: i32, .c: i32} = {.b = 3, .b = 4}; // CHECK:STDOUT: %return.param_patt: = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc18_16: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc18_16: init type = call constants.%Int(%int_32.loc18_16) [template = constants.%i32] -// CHECK:STDOUT: %.loc18_16.1: type = value_of_initializer %int.make_type_signed.loc18_16 [template = constants.%i32] -// CHECK:STDOUT: %.loc18_16.2: type = converted %int.make_type_signed.loc18_16, %.loc18_16.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc18_16: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc18_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc18_27: init type = call constants.%Int(%int_32.loc18_27) [template = constants.%i32] -// CHECK:STDOUT: %.loc18_27.1: type = value_of_initializer %int.make_type_signed.loc18_27 [template = constants.%i32] -// CHECK:STDOUT: %.loc18_27.2: type = converted %int.make_type_signed.loc18_27, %.loc18_27.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc18_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc18_36: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc18_36: init type = call constants.%Int(%int_32.loc18_36) [template = constants.%i32] -// CHECK:STDOUT: %.loc18_36.1: type = value_of_initializer %int.make_type_signed.loc18_36 [template = constants.%i32] -// CHECK:STDOUT: %.loc18_36.2: type = converted %int.make_type_signed.loc18_36, %.loc18_36.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc18_36: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc18_47: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc18_47: init type = call constants.%Int(%int_32.loc18_47) [template = constants.%i32] -// CHECK:STDOUT: %.loc18_47.1: type = value_of_initializer %int.make_type_signed.loc18_47 [template = constants.%i32] -// CHECK:STDOUT: %.loc18_47.2: type = converted %int.make_type_signed.loc18_47, %.loc18_47.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc18_47: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc18_56: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc18_56: init type = call constants.%Int(%int_32.loc18_56) [template = constants.%i32] -// CHECK:STDOUT: %.loc18_56.1: type = value_of_initializer %int.make_type_signed.loc18_56 [template = constants.%i32] -// CHECK:STDOUT: %.loc18_56.2: type = converted %int.make_type_signed.loc18_56, %.loc18_56.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc18_56: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %return.param: ref = out_param runtime_param0 // CHECK:STDOUT: %return: ref = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %int_32.loc27_13: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc27_13: init type = call constants.%Int(%int_32.loc27_13) [template = constants.%i32] -// CHECK:STDOUT: %.loc27_13.1: type = value_of_initializer %int.make_type_signed.loc27_13 [template = constants.%i32] -// CHECK:STDOUT: %.loc27_13.2: type = converted %int.make_type_signed.loc27_13, %.loc27_13.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc27_13: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc27_22: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc27_22: init type = call constants.%Int(%int_32.loc27_22) [template = constants.%i32] -// CHECK:STDOUT: %.loc27_22.1: type = value_of_initializer %int.make_type_signed.loc27_22 [template = constants.%i32] -// CHECK:STDOUT: %.loc27_22.2: type = converted %int.make_type_signed.loc27_22, %.loc27_22.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc27_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc36: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc36: init type = call constants.%Int(%int_32.loc36) [template = constants.%i32] -// CHECK:STDOUT: %.loc36_8.1: type = value_of_initializer %int.make_type_signed.loc36 [template = constants.%i32] -// CHECK:STDOUT: %.loc36_8.2: type = converted %int.make_type_signed.loc36, %.loc36_8.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc36: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc45: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc45: init type = call constants.%Int(%int_32.loc45) [template = constants.%i32] -// CHECK:STDOUT: %.loc45_13.1: type = value_of_initializer %int.make_type_signed.loc45 [template = constants.%i32] -// CHECK:STDOUT: %.loc45_13.2: type = converted %int.make_type_signed.loc45, %.loc45_13.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc45: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %struct_type.a: type = struct_type {.a: %i32} [template = constants.%struct_type.a.2] // CHECK:STDOUT: %x.var: ref %struct_type.a.2 = var x // CHECK:STDOUT: %x: ref %struct_type.a.2 = bind_name x, %x.var // CHECK:STDOUT: %int_32.loc53_13: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc53_13: init type = call constants.%Int(%int_32.loc53_13) [template = constants.%i32] -// CHECK:STDOUT: %.loc53_13.1: type = value_of_initializer %int.make_type_signed.loc53_13 [template = constants.%i32] -// CHECK:STDOUT: %.loc53_13.2: type = converted %int.make_type_signed.loc53_13, %.loc53_13.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc53_13: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc53_22: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc53_22: init type = call constants.%Int(%int_32.loc53_22) [template = constants.%i32] -// CHECK:STDOUT: %.loc53_22.1: type = value_of_initializer %int.make_type_signed.loc53_22 [template = constants.%i32] -// CHECK:STDOUT: %.loc53_22.2: type = converted %int.make_type_signed.loc53_22, %.loc53_22.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc53_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %struct_type.b.c: type = struct_type {.b: %i32, .c: %i32} [template = constants.%struct_type.b.c] // CHECK:STDOUT: %y.var: ref %struct_type.b.c = var y // CHECK:STDOUT: %y: ref %struct_type.b.c = bind_name y, %y.var diff --git a/toolchain/check/testdata/struct/fail_field_name_mismatch.carbon b/toolchain/check/testdata/struct/fail_field_name_mismatch.carbon index b1514797c7493..8a1e0bca575bc 100644 --- a/toolchain/check/testdata/struct/fail_field_name_mismatch.carbon +++ b/toolchain/check/testdata/struct/fail_field_name_mismatch.carbon @@ -23,9 +23,7 @@ var y: {.b: i32} = x; // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %struct_type.a: type = struct_type {.a: %i32} [template] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %struct_type.b.1: type = struct_type {.b: Core.IntLiteral} [template] @@ -34,7 +32,7 @@ var y: {.b: i32} = x; // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -48,16 +46,12 @@ var y: {.b: i32} = x; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int_32.loc15: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc15: init type = call constants.%Int(%int_32.loc15) [template = constants.%i32] -// CHECK:STDOUT: %.loc15_13.1: type = value_of_initializer %int.make_type_signed.loc15 [template = constants.%i32] -// CHECK:STDOUT: %.loc15_13.2: type = converted %int.make_type_signed.loc15, %.loc15_13.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc15: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %struct_type.a: type = struct_type {.a: %i32} [template = constants.%struct_type.a] // CHECK:STDOUT: %x.var: ref %struct_type.a = var x // CHECK:STDOUT: %x: ref %struct_type.a = bind_name x, %x.var // CHECK:STDOUT: %int_32.loc20: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc20: init type = call constants.%Int(%int_32.loc20) [template = constants.%i32] -// CHECK:STDOUT: %.loc20_13.1: type = value_of_initializer %int.make_type_signed.loc20 [template = constants.%i32] -// CHECK:STDOUT: %.loc20_13.2: type = converted %int.make_type_signed.loc20, %.loc20_13.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc20: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %struct_type.b: type = struct_type {.b: %i32} [template = constants.%struct_type.b.2] // CHECK:STDOUT: %y.var: ref %struct_type.b.2 = var y // CHECK:STDOUT: %y: ref %struct_type.b.2 = bind_name y, %y.var diff --git a/toolchain/check/testdata/struct/fail_field_type_mismatch.carbon b/toolchain/check/testdata/struct/fail_field_type_mismatch.carbon index 5bf94c50209b4..a364098401432 100644 --- a/toolchain/check/testdata/struct/fail_field_type_mismatch.carbon +++ b/toolchain/check/testdata/struct/fail_field_type_mismatch.carbon @@ -17,9 +17,7 @@ var x: {.a: i32} = {.b = 1.0}; // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %struct_type.a: type = struct_type {.a: %i32} [template] // CHECK:STDOUT: %float: f64 = float_literal 1 [template] // CHECK:STDOUT: %struct_type.b: type = struct_type {.b: f64} [template] @@ -27,7 +25,7 @@ var x: {.a: i32} = {.b = 1.0}; // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -40,9 +38,7 @@ var x: {.a: i32} = {.b = 1.0}; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc14_13.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc14_13.2: type = converted %int.make_type_signed, %.loc14_13.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %struct_type.a: type = struct_type {.a: %i32} [template = constants.%struct_type.a] // CHECK:STDOUT: %x.var: ref %struct_type.a = var x // CHECK:STDOUT: %x: ref %struct_type.a = bind_name x, %x.var diff --git a/toolchain/check/testdata/struct/fail_member_access_type.carbon b/toolchain/check/testdata/struct/fail_member_access_type.carbon index 3f2dbeadae0b2..2bce5ec8c957b 100644 --- a/toolchain/check/testdata/struct/fail_member_access_type.carbon +++ b/toolchain/check/testdata/struct/fail_member_access_type.carbon @@ -24,9 +24,7 @@ var y: i32 = x.b; // CHECK:STDOUT: %float: f64 = float_literal 4 [template] // CHECK:STDOUT: %struct: %struct_type.a = struct_value (%float) [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -53,9 +51,7 @@ var y: i32 = x.b; // CHECK:STDOUT: %x.var: ref %struct_type.a = var x // CHECK:STDOUT: %x: ref %struct_type.a = bind_name x, %x.var // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc15_8.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc15_8.2: type = converted %int.make_type_signed, %.loc15_8.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %y.var: ref %i32 = var y // CHECK:STDOUT: %y: ref %i32 = bind_name y, %y.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/struct/fail_non_member_access.carbon b/toolchain/check/testdata/struct/fail_non_member_access.carbon index a0e8586c850ef..bf87dd513d7cd 100644 --- a/toolchain/check/testdata/struct/fail_non_member_access.carbon +++ b/toolchain/check/testdata/struct/fail_non_member_access.carbon @@ -18,17 +18,15 @@ var y: i32 = x.b; // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %struct_type.a.1: type = struct_type {.a: %i32} [template] // CHECK:STDOUT: %int_4.1: Core.IntLiteral = int_value 4 [template] // CHECK:STDOUT: %struct_type.a.2: type = struct_type {.a: Core.IntLiteral} [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_4.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound: = bound_method %int_4.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_4.2: %i32 = int_value 4 [template] // CHECK:STDOUT: %struct: %struct_type.a.1 = struct_value (%int_4.2) [template] @@ -37,7 +35,7 @@ var y: i32 = x.b; // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -51,16 +49,12 @@ var y: i32 = x.b; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int_32.loc11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11: init type = call constants.%Int(%int_32.loc11) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_13.1: type = value_of_initializer %int.make_type_signed.loc11 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_13.2: type = converted %int.make_type_signed.loc11, %.loc11_13.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %struct_type.a: type = struct_type {.a: %i32} [template = constants.%struct_type.a.1] // CHECK:STDOUT: %x.var: ref %struct_type.a.1 = var x // CHECK:STDOUT: %x: ref %struct_type.a.1 = bind_name x, %x.var // CHECK:STDOUT: %int_32.loc15: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc15: init type = call constants.%Int(%int_32.loc15) [template = constants.%i32] -// CHECK:STDOUT: %.loc15_8.1: type = value_of_initializer %int.make_type_signed.loc15 [template = constants.%i32] -// CHECK:STDOUT: %.loc15_8.2: type = converted %int.make_type_signed.loc15, %.loc15_8.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc15: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %y.var: ref %i32 = var y // CHECK:STDOUT: %y: ref %i32 = bind_name y, %y.var // CHECK:STDOUT: } @@ -69,7 +63,7 @@ var y: i32 = x.b; // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [template = constants.%int_4.1] // CHECK:STDOUT: %.loc11_27.1: %struct_type.a.2 = struct_literal (%int_4) -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_4, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_4) [template = constants.%int_4.2] diff --git a/toolchain/check/testdata/struct/fail_too_few_values.carbon b/toolchain/check/testdata/struct/fail_too_few_values.carbon index e938cc36956d6..41a1724505b87 100644 --- a/toolchain/check/testdata/struct/fail_too_few_values.carbon +++ b/toolchain/check/testdata/struct/fail_too_few_values.carbon @@ -17,9 +17,7 @@ var x: {.a: i32, .b: i32} = {.a = 1}; // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %struct_type.a.b: type = struct_type {.a: %i32, .b: %i32} [template] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %struct_type.a: type = struct_type {.a: Core.IntLiteral} [template] @@ -27,7 +25,7 @@ var x: {.a: i32, .b: i32} = {.a = 1}; // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -40,13 +38,9 @@ var x: {.a: i32, .b: i32} = {.a = 1}; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int_32.loc14_13: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc14_13: init type = call constants.%Int(%int_32.loc14_13) [template = constants.%i32] -// CHECK:STDOUT: %.loc14_13.1: type = value_of_initializer %int.make_type_signed.loc14_13 [template = constants.%i32] -// CHECK:STDOUT: %.loc14_13.2: type = converted %int.make_type_signed.loc14_13, %.loc14_13.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc14_13: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc14_22: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc14_22: init type = call constants.%Int(%int_32.loc14_22) [template = constants.%i32] -// CHECK:STDOUT: %.loc14_22.1: type = value_of_initializer %int.make_type_signed.loc14_22 [template = constants.%i32] -// CHECK:STDOUT: %.loc14_22.2: type = converted %int.make_type_signed.loc14_22, %.loc14_22.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc14_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %struct_type.a.b: type = struct_type {.a: %i32, .b: %i32} [template = constants.%struct_type.a.b] // CHECK:STDOUT: %x.var: ref %struct_type.a.b = var x // CHECK:STDOUT: %x: ref %struct_type.a.b = bind_name x, %x.var diff --git a/toolchain/check/testdata/struct/fail_type_assign.carbon b/toolchain/check/testdata/struct/fail_type_assign.carbon index 104603681e2dc..fc8191ec155d7 100644 --- a/toolchain/check/testdata/struct/fail_type_assign.carbon +++ b/toolchain/check/testdata/struct/fail_type_assign.carbon @@ -20,16 +20,14 @@ var x: {.a: i32} = {.a: i32}; // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %struct_type.a: type = struct_type {.a: %i32} [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -42,9 +40,7 @@ var x: {.a: i32} = {.a: i32}; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc17_13.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc17_13.2: type = converted %int.make_type_signed, %.loc17_13.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %struct_type.a: type = struct_type {.a: %i32} [template = constants.%struct_type.a] // CHECK:STDOUT: %x.var: ref %struct_type.a = var x // CHECK:STDOUT: %x: ref %struct_type.a = bind_name x, %x.var @@ -53,11 +49,9 @@ var x: {.a: i32} = {.a: i32}; // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc17_25.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc17_25.2: type = converted %int.make_type_signed, %.loc17_25.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %struct_type.a: type = struct_type {.a: %i32} [template = constants.%struct_type.a] -// CHECK:STDOUT: %.loc17_29: %struct_type.a = converted %struct_type.a, [template = ] +// CHECK:STDOUT: %.loc17: %struct_type.a = converted %struct_type.a, [template = ] // CHECK:STDOUT: assign file.%x.var, // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/struct/import.carbon b/toolchain/check/testdata/struct/import.carbon index 8a3eb2418143f..66bd8fddb6908 100644 --- a/toolchain/check/testdata/struct/import.carbon +++ b/toolchain/check/testdata/struct/import.carbon @@ -43,10 +43,10 @@ var c_bad: C({.c = 1, .d = 2}) = F(); // --- fail_bad_value.impl.carbon impl package Implicit; -// CHECK:STDERR: fail_bad_value.impl.carbon:[[@LINE+6]]:1: error: cannot implicitly convert from `C()` to `C()` [ImplicitAsConversionFailure] +// CHECK:STDERR: fail_bad_value.impl.carbon:[[@LINE+6]]:1: error: cannot implicitly convert from `C()` to `C()` [ImplicitAsConversionFailure] // CHECK:STDERR: var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_bad_value.impl.carbon:[[@LINE+3]]:1: note: type `C()` does not implement interface `Core.ImplicitAs(C())` [MissingImplInMemberAccessNote] +// CHECK:STDERR: fail_bad_value.impl.carbon:[[@LINE+3]]:1: note: type `C()` does not implement interface `Core.ImplicitAs(C())` [MissingImplInMemberAccessNote] // CHECK:STDERR: var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ var c_bad: C({.a = 3, .b = 4}) = F(); @@ -55,17 +55,15 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %struct_type.a.1: type = struct_type {.a: %i32} [template] // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %struct_type.a.2: type = struct_type {.a: Core.IntLiteral} [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_0.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] // CHECK:STDOUT: %struct.1: %struct_type.a.1 = struct_value (%int_0.2) [template] @@ -86,14 +84,14 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %C.generic: %C.type = struct_value () [template] // CHECK:STDOUT: %C.1: type = class_type @C, @C(%S) [symbolic] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] -// CHECK:STDOUT: %complete_type.3: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %complete_type.4: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %struct_type.a.b.2: type = struct_type {.a: Core.IntLiteral, .b: Core.IntLiteral} [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] -// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_2.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_2.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] // CHECK:STDOUT: %struct.4: %struct_type.a.b.1 = struct_value (%int_1.2, %int_2.2) [template] @@ -105,7 +103,7 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -121,27 +119,19 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int_32.loc4: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc4: init type = call constants.%Int(%int_32.loc4) [template = constants.%i32] -// CHECK:STDOUT: %.loc4_17.1: type = value_of_initializer %int.make_type_signed.loc4 [template = constants.%i32] -// CHECK:STDOUT: %.loc4_17.2: type = converted %int.make_type_signed.loc4, %.loc4_17.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc4: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %struct_type.a: type = struct_type {.a: %i32} [template = constants.%struct_type.a.1] // CHECK:STDOUT: %a_ref.var: ref %struct_type.a.1 = var a_ref // CHECK:STDOUT: %a_ref: ref %struct_type.a.1 = bind_name a_ref, %a_ref.var // CHECK:STDOUT: %int_32.loc5_22: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc5_22: init type = call constants.%Int(%int_32.loc5_22) [template = constants.%i32] -// CHECK:STDOUT: %.loc5_22.1: type = value_of_initializer %int.make_type_signed.loc5_22 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_22.2: type = converted %int.make_type_signed.loc5_22, %.loc5_22.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc5_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc5_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc5_32: init type = call constants.%Int(%int_32.loc5_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc5_36.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc5_32) -// CHECK:STDOUT: %.loc5_36.2: type = value_of_initializer %int.make_type_signed.loc5_32 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_36.3: type = converted %int.make_type_signed.loc5_32, %.loc5_36.2 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_36.4: type = converted %.loc5_36.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] +// CHECK:STDOUT: %i32.loc5_32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc5_36.1: %tuple.type.1 = tuple_literal (%i32.loc5_32) +// CHECK:STDOUT: %.loc5_36.2: type = converted %.loc5_36.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %struct_type.b.c: type = struct_type {.b: %i32, .c: %tuple.type.2} [template = constants.%struct_type.b.c.1] // CHECK:STDOUT: %int_32.loc5_44: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc5_44: init type = call constants.%Int(%int_32.loc5_44) [template = constants.%i32] -// CHECK:STDOUT: %.loc5_44.1: type = value_of_initializer %int.make_type_signed.loc5_44 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_44.2: type = converted %int.make_type_signed.loc5_44, %.loc5_44.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc5_44: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %struct_type.a.d: type = struct_type {.a: %struct_type.b.c.1, .d: %i32} [template = constants.%struct_type.a.d.1] // CHECK:STDOUT: %b_ref.var: ref %struct_type.a.d.1 = var b_ref // CHECK:STDOUT: %b_ref: ref %struct_type.a.d.1 = bind_name b_ref, %b_ref.var @@ -150,13 +140,9 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %S.param_patt: %struct_type.a.b.1 = value_param_pattern %S.patt.loc8_9.1, runtime_param [symbolic = %S.patt.loc8_9.2 (constants.%S.patt)] // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc8_18: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc8_18: init type = call constants.%Int(%int_32.loc8_18) [template = constants.%i32] -// CHECK:STDOUT: %.loc8_18.1: type = value_of_initializer %int.make_type_signed.loc8_18 [template = constants.%i32] -// CHECK:STDOUT: %.loc8_18.2: type = converted %int.make_type_signed.loc8_18, %.loc8_18.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc8_18: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc8_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc8_27: init type = call constants.%Int(%int_32.loc8_27) [template = constants.%i32] -// CHECK:STDOUT: %.loc8_27.1: type = value_of_initializer %int.make_type_signed.loc8_27 [template = constants.%i32] -// CHECK:STDOUT: %.loc8_27.2: type = converted %int.make_type_signed.loc8_27, %.loc8_27.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc8_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %struct_type.a.b: type = struct_type {.a: %i32, .b: %i32} [template = constants.%struct_type.a.b.1] // CHECK:STDOUT: %S.param: %struct_type.a.b.1 = value_param runtime_param // CHECK:STDOUT: %S.loc8_9.1: %struct_type.a.b.1 = bind_symbolic_name S, 0, %S.param [symbolic = %S.loc8_9.2 (constants.%S)] @@ -169,13 +155,13 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %.loc9_28.1: %struct_type.a.b.2 = struct_literal (%int_1, %int_2) -// CHECK:STDOUT: %impl.elem0.loc9_28.1: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc9_28.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc9_28.1: = bound_method %int_1, %impl.elem0.loc9_28.1 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc9_28.1: = specific_function %Convert.bound.loc9_28.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc9_28.1: init %i32 = call %Convert.specific_fn.loc9_28.1(%int_1) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc9_28.2: %i32 = value_of_initializer %int.convert_checked.loc9_28.1 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc9_28.3: %i32 = converted %int_1, %.loc9_28.2 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc9_28.2: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc9_28.2: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc9_28.2: = bound_method %int_2, %impl.elem0.loc9_28.2 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc9_28.2: = specific_function %Convert.bound.loc9_28.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc9_28.2: init %i32 = call %Convert.specific_fn.loc9_28.2(%int_2) [template = constants.%int_2.2] @@ -196,7 +182,7 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: class { -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.3] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C.1 @@ -210,7 +196,7 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_0.loc4: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %.loc4_31.1: %struct_type.a.2 = struct_literal (%int_0.loc4) -// CHECK:STDOUT: %impl.elem0.loc4: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc4: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc4: = bound_method %int_0.loc4, %impl.elem0.loc4 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc4: = specific_function %Convert.bound.loc4, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc4: init %i32 = call %Convert.specific_fn.loc4(%int_0.loc4) [template = constants.%int_0.2] @@ -224,7 +210,7 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %.loc6_29.1: %struct_type.b.c.2 = struct_literal (%int_0.loc6_17, %.loc6_28.1) // CHECK:STDOUT: %int_0.loc6_37: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %.loc6_38.1: %struct_type.a.d.3 = struct_literal (%.loc6_29.1, %int_0.loc6_37) -// CHECK:STDOUT: %impl.elem0.loc6_29: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc6_29: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc6_29: = bound_method %int_0.loc6_17, %impl.elem0.loc6_29 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc6_29: = specific_function %Convert.bound.loc6_29, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc6_29: init %i32 = call %Convert.specific_fn.loc6_29(%int_0.loc6_17) [template = constants.%int_0.2] @@ -232,7 +218,7 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %.loc6_38.2: ref %struct_type.b.c.1 = struct_access file.%b_ref.var, element0 // CHECK:STDOUT: %.loc6_29.3: ref %i32 = struct_access %.loc6_38.2, element0 // CHECK:STDOUT: %.loc6_29.4: init %i32 = initialize_from %.loc6_29.2 to %.loc6_29.3 [template = constants.%int_0.2] -// CHECK:STDOUT: %impl.elem0.loc6_28: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc6_28: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc6_28: = bound_method %int_0.loc6_26, %impl.elem0.loc6_28 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc6_28: = specific_function %Convert.bound.loc6_28, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc6_28: init %i32 = call %Convert.specific_fn.loc6_28(%int_0.loc6_26) [template = constants.%int_0.2] @@ -243,7 +229,7 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %.loc6_29.7: init %tuple.type.2 = initialize_from %.loc6_29.6 to %.loc6_29.5 [template = constants.%tuple] // CHECK:STDOUT: %.loc6_29.8: init %struct_type.b.c.1 = struct_init (%.loc6_29.4, %.loc6_29.7) to %.loc6_38.2 [template = constants.%struct.2] // CHECK:STDOUT: %.loc6_38.3: init %struct_type.b.c.1 = converted %.loc6_29.1, %.loc6_29.8 [template = constants.%struct.2] -// CHECK:STDOUT: %impl.elem0.loc6_38: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc6_38: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc6_38: = bound_method %int_0.loc6_37, %impl.elem0.loc6_38 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc6_38: = specific_function %Convert.bound.loc6_38, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc6_38: init %i32 = call %Convert.specific_fn.loc6_38(%int_0.loc6_37) [template = constants.%int_0.2] @@ -270,9 +256,7 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %struct_type.a: type = struct_type {.a: %i32} [template] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (type) [template] // CHECK:STDOUT: %tuple.type.2: type = tuple_type (%i32) [template] @@ -281,21 +265,21 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %C.type: type = generic_class_type @C [template] // CHECK:STDOUT: %C.generic: %C.type = struct_value () [template] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] -// CHECK:STDOUT: %complete_type.1: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %complete_type.3: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %struct_type.a.b.1: type = struct_type {.a: %i32, .b: %i32} [template] // CHECK:STDOUT: %S: %struct_type.a.b.1 = bind_symbolic_name S, 0 [symbolic] // CHECK:STDOUT: %S.patt: %struct_type.a.b.1 = symbolic_binding_pattern S, 0 [symbolic] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %struct_type.a.b.2: type = struct_type {.a: Core.IntLiteral, .b: Core.IntLiteral} [template] -// CHECK:STDOUT: %Convert.type.13: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] // CHECK:STDOUT: %struct: %struct_type.a.b.1 = struct_value (%int_1.2, %int_2.2) [template] @@ -310,13 +294,13 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %import_ref.3: %C.type = import_ref Implicit//default, C, loaded [template = constants.%C.generic] // CHECK:STDOUT: %import_ref.4: %F.type = import_ref Implicit//default, F, loaded [template = constants.%F] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref.39 -// CHECK:STDOUT: .ImplicitAs = %import_ref.42 +// CHECK:STDOUT: .Int = %import_ref.194 +// CHECK:STDOUT: .ImplicitAs = %import_ref.197 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.40: = import_ref Implicit//default, loc8_34, loaded [template = constants.%complete_type.1] -// CHECK:STDOUT: %import_ref.41 = import_ref Implicit//default, inst436 [no loc], unloaded +// CHECK:STDOUT: %import_ref.195: = import_ref Implicit//default, loc8_34, loaded [template = constants.%complete_type.3] +// CHECK:STDOUT: %import_ref.196 = import_ref Implicit//default, inst602 [no loc], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -334,27 +318,19 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int_32.loc4: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc4: init type = call constants.%Int(%int_32.loc4) [template = constants.%i32] -// CHECK:STDOUT: %.loc4_13.1: type = value_of_initializer %int.make_type_signed.loc4 [template = constants.%i32] -// CHECK:STDOUT: %.loc4_13.2: type = converted %int.make_type_signed.loc4, %.loc4_13.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc4: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %struct_type.a: type = struct_type {.a: %i32} [template = constants.%struct_type.a] // CHECK:STDOUT: %a.var: ref %struct_type.a = var a // CHECK:STDOUT: %a: ref %struct_type.a = bind_name a, %a.var // CHECK:STDOUT: %int_32.loc5_18: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc5_18: init type = call constants.%Int(%int_32.loc5_18) [template = constants.%i32] -// CHECK:STDOUT: %.loc5_18.1: type = value_of_initializer %int.make_type_signed.loc5_18 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_18.2: type = converted %int.make_type_signed.loc5_18, %.loc5_18.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc5_18: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc5_28: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc5_28: init type = call constants.%Int(%int_32.loc5_28) [template = constants.%i32] -// CHECK:STDOUT: %.loc5_32.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc5_28) -// CHECK:STDOUT: %.loc5_32.2: type = value_of_initializer %int.make_type_signed.loc5_28 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_32.3: type = converted %int.make_type_signed.loc5_28, %.loc5_32.2 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_32.4: type = converted %.loc5_32.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] +// CHECK:STDOUT: %i32.loc5_28: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc5_32.1: %tuple.type.1 = tuple_literal (%i32.loc5_28) +// CHECK:STDOUT: %.loc5_32.2: type = converted %.loc5_32.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %struct_type.b.c: type = struct_type {.b: %i32, .c: %tuple.type.2} [template = constants.%struct_type.b.c] // CHECK:STDOUT: %int_32.loc5_40: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc5_40: init type = call constants.%Int(%int_32.loc5_40) [template = constants.%i32] -// CHECK:STDOUT: %.loc5_40.1: type = value_of_initializer %int.make_type_signed.loc5_40 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_40.2: type = converted %int.make_type_signed.loc5_40, %.loc5_40.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc5_40: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %struct_type.a.d: type = struct_type {.a: %struct_type.b.c, .d: %i32} [template = constants.%struct_type.a.d.1] // CHECK:STDOUT: %b.var: ref %struct_type.a.d.1 = var b // CHECK:STDOUT: %b: ref %struct_type.a.d.1 = bind_name b, %b.var @@ -362,13 +338,13 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %.loc6_25.1: %struct_type.a.b.2 = struct_literal (%int_1, %int_2) -// CHECK:STDOUT: %impl.elem0.loc6_25.1: %Convert.type.13 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc6_25.1: %Convert.type.9 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc6_25.1: = bound_method %int_1, %impl.elem0.loc6_25.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc6_25.1: = specific_function %Convert.bound.loc6_25.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc6_25.1: init %i32 = call %Convert.specific_fn.loc6_25.1(%int_1) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc6_25.2: %i32 = value_of_initializer %int.convert_checked.loc6_25.1 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc6_25.3: %i32 = converted %int_1, %.loc6_25.2 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc6_25.2: %Convert.type.13 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc6_25.2: %Convert.type.9 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc6_25.2: = bound_method %int_2, %impl.elem0.loc6_25.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc6_25.2: = specific_function %Convert.bound.loc6_25.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc6_25.2: init %i32 = call %Convert.specific_fn.loc6_25.2(%int_2) [template = constants.%int_2.2] @@ -389,8 +365,8 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: // CHECK:STDOUT: class { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.41 -// CHECK:STDOUT: complete_type_witness = imports.%import_ref.40 +// CHECK:STDOUT: .Self = imports.%import_ref.196 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.195 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -449,12 +425,12 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: --- fail_bad_type.impl.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %C.type: type = generic_class_type @C [template] // CHECK:STDOUT: %C.generic: %C.type = struct_value () [template] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %complete_type.3: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %struct_type.a.b: type = struct_type {.a: %i32, .b: %i32} [template] // CHECK:STDOUT: %S: %struct_type.a.b = bind_symbolic_name S, 0 [symbolic] // CHECK:STDOUT: %S.patt: %struct_type.a.b = symbolic_binding_pattern S, 0 [symbolic] @@ -478,8 +454,8 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.39: = import_ref Implicit//default, loc8_34, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.40 = import_ref Implicit//default, inst436 [no loc], unloaded +// CHECK:STDOUT: %import_ref.194: = import_ref Implicit//default, loc8_34, loaded [template = constants.%complete_type.3] +// CHECK:STDOUT: %import_ref.195 = import_ref Implicit//default, inst602 [no loc], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -510,8 +486,8 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: // CHECK:STDOUT: class { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.40 -// CHECK:STDOUT: complete_type_witness = imports.%import_ref.39 +// CHECK:STDOUT: .Self = imports.%import_ref.195 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.194 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -541,26 +517,26 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: --- fail_bad_value.impl.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %C.type: type = generic_class_type @C [template] // CHECK:STDOUT: %C.generic: %C.type = struct_value () [template] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] -// CHECK:STDOUT: %complete_type.1: = complete_type_witness %empty_struct_type [template] -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %complete_type.3: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %struct_type.a.b.1: type = struct_type {.a: %i32, .b: %i32} [template] // CHECK:STDOUT: %S: %struct_type.a.b.1 = bind_symbolic_name S, 0 [symbolic] // CHECK:STDOUT: %S.patt: %struct_type.a.b.1 = symbolic_binding_pattern S, 0 [symbolic] // CHECK:STDOUT: %int_3.1: Core.IntLiteral = int_value 3 [template] // CHECK:STDOUT: %int_4.1: Core.IntLiteral = int_value 4 [template] // CHECK:STDOUT: %struct_type.a.b.2: type = struct_type {.a: Core.IntLiteral, .b: Core.IntLiteral} [template] -// CHECK:STDOUT: %Convert.type.13: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_3.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_3.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_3.2: %i32 = int_value 3 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_4.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_4.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_4.2: %i32 = int_value 4 [template] // CHECK:STDOUT: %struct.1: %struct_type.a.b.1 = struct_value (%int_3.2, %int_4.2) [template] @@ -579,12 +555,12 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %import_ref.3: %C.type = import_ref Implicit//default, C, loaded [template = constants.%C.generic] // CHECK:STDOUT: %import_ref.4: %F.type = import_ref Implicit//default, F, loaded [template = constants.%F] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .ImplicitAs = %import_ref.41 +// CHECK:STDOUT: .ImplicitAs = %import_ref.196 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.39: = import_ref Implicit//default, loc8_34, loaded [template = constants.%complete_type.1] -// CHECK:STDOUT: %import_ref.40 = import_ref Implicit//default, inst436 [no loc], unloaded +// CHECK:STDOUT: %import_ref.194: = import_ref Implicit//default, loc8_34, loaded [template = constants.%complete_type.3] +// CHECK:STDOUT: %import_ref.195 = import_ref Implicit//default, inst602 [no loc], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -603,13 +579,13 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] // CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [template = constants.%int_4.1] // CHECK:STDOUT: %.loc9_29.1: %struct_type.a.b.2 = struct_literal (%int_3, %int_4) -// CHECK:STDOUT: %impl.elem0.loc9_29.1: %Convert.type.13 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc9_29.1: %Convert.type.9 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc9_29.1: = bound_method %int_3, %impl.elem0.loc9_29.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc9_29.1: = specific_function %Convert.bound.loc9_29.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc9_29.1: init %i32 = call %Convert.specific_fn.loc9_29.1(%int_3) [template = constants.%int_3.2] // CHECK:STDOUT: %.loc9_29.2: %i32 = value_of_initializer %int.convert_checked.loc9_29.1 [template = constants.%int_3.2] // CHECK:STDOUT: %.loc9_29.3: %i32 = converted %int_3, %.loc9_29.2 [template = constants.%int_3.2] -// CHECK:STDOUT: %impl.elem0.loc9_29.2: %Convert.type.13 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc9_29.2: %Convert.type.9 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc9_29.2: = bound_method %int_4, %impl.elem0.loc9_29.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc9_29.2: = specific_function %Convert.bound.loc9_29.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc9_29.2: init %i32 = call %Convert.specific_fn.loc9_29.2(%int_4) [template = constants.%int_4.2] @@ -630,8 +606,8 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: // CHECK:STDOUT: class { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.40 -// CHECK:STDOUT: complete_type_witness = imports.%import_ref.39 +// CHECK:STDOUT: .Self = imports.%import_ref.195 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.194 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/struct/literal_member_access.carbon b/toolchain/check/testdata/struct/literal_member_access.carbon index 8cc5390738fad..7c6d0131c236c 100644 --- a/toolchain/check/testdata/struct/literal_member_access.carbon +++ b/toolchain/check/testdata/struct/literal_member_access.carbon @@ -18,9 +18,7 @@ fn F() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %struct_type.x.y.z: type = struct_type {.x: %i32, .y: %i32, .z: %i32} [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] @@ -33,7 +31,7 @@ fn F() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -51,17 +49,11 @@ fn F() -> i32 { // CHECK:STDOUT: %return.param_patt: %struct_type.x.y.z = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc11_16: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11_16: init type = call constants.%Int(%int_32.loc11_16) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_16.1: type = value_of_initializer %int.make_type_signed.loc11_16 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_16.2: type = converted %int.make_type_signed.loc11_16, %.loc11_16.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc11_16: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc11_25: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11_25: init type = call constants.%Int(%int_32.loc11_25) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_25.1: type = value_of_initializer %int.make_type_signed.loc11_25 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_25.2: type = converted %int.make_type_signed.loc11_25, %.loc11_25.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc11_25: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc11_34: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11_34: init type = call constants.%Int(%int_32.loc11_34) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_34.1: type = value_of_initializer %int.make_type_signed.loc11_34 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_34.2: type = converted %int.make_type_signed.loc11_34, %.loc11_34.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc11_34: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %struct_type.x.y.z: type = struct_type {.x: %i32, .y: %i32, .z: %i32} [template = constants.%struct_type.x.y.z] // CHECK:STDOUT: %return.param: ref %struct_type.x.y.z = out_param runtime_param0 // CHECK:STDOUT: %return: ref %struct_type.x.y.z = return_slot %return.param @@ -71,9 +63,7 @@ fn F() -> i32 { // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc13_11.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc13_11.2: type = converted %int.make_type_signed, %.loc13_11.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/struct/member_access.carbon b/toolchain/check/testdata/struct/member_access.carbon index 95d5fbd27a632..22065dfc41a56 100644 --- a/toolchain/check/testdata/struct/member_access.carbon +++ b/toolchain/check/testdata/struct/member_access.carbon @@ -19,18 +19,16 @@ var z: i32 = y; // CHECK:STDOUT: %Float.type: type = fn_type @Float [template] // CHECK:STDOUT: %Float: %Float.type = struct_value () [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %struct_type.a.b.1: type = struct_type {.a: f64, .b: %i32} [template] // CHECK:STDOUT: %float: f64 = float_literal 0 [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %struct_type.a.b.2: type = struct_type {.a: f64, .b: Core.IntLiteral} [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] // CHECK:STDOUT: %struct: %struct_type.a.b.1 = struct_value (%float, %int_1.2) [template] @@ -40,7 +38,7 @@ var z: i32 = y; // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Float = %import_ref.1 // CHECK:STDOUT: .Int = %import_ref.2 -// CHECK:STDOUT: .ImplicitAs = %import_ref.3 +// CHECK:STDOUT: .ImplicitAs = %import_ref.6 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -59,22 +57,16 @@ var z: i32 = y; // CHECK:STDOUT: %.loc11_13.1: type = value_of_initializer %float.make_type [template = f64] // CHECK:STDOUT: %.loc11_13.2: type = converted %float.make_type, %.loc11_13.1 [template = f64] // CHECK:STDOUT: %int_32.loc11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11: init type = call constants.%Int(%int_32.loc11) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_22.1: type = value_of_initializer %int.make_type_signed.loc11 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_22.2: type = converted %int.make_type_signed.loc11, %.loc11_22.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %struct_type.a.b: type = struct_type {.a: f64, .b: %i32} [template = constants.%struct_type.a.b.1] // CHECK:STDOUT: %x.var: ref %struct_type.a.b.1 = var x // CHECK:STDOUT: %x: ref %struct_type.a.b.1 = bind_name x, %x.var // CHECK:STDOUT: %int_32.loc12: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc12: init type = call constants.%Int(%int_32.loc12) [template = constants.%i32] -// CHECK:STDOUT: %.loc12_8.1: type = value_of_initializer %int.make_type_signed.loc12 [template = constants.%i32] -// CHECK:STDOUT: %.loc12_8.2: type = converted %int.make_type_signed.loc12, %.loc12_8.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc12: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %y.var: ref %i32 = var y // CHECK:STDOUT: %y: ref %i32 = bind_name y, %y.var // CHECK:STDOUT: %int_32.loc13: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc13: init type = call constants.%Int(%int_32.loc13) [template = constants.%i32] -// CHECK:STDOUT: %.loc13_8.1: type = value_of_initializer %int.make_type_signed.loc13 [template = constants.%i32] -// CHECK:STDOUT: %.loc13_8.2: type = converted %int.make_type_signed.loc13, %.loc13_8.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc13: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %z.var: ref %i32 = var z // CHECK:STDOUT: %z: ref %i32 = bind_name z, %z.var // CHECK:STDOUT: } @@ -86,7 +78,7 @@ var z: i32 = y; // CHECK:STDOUT: %.loc11_46.1: %struct_type.a.b.2 = struct_literal (%float, %int_1) // CHECK:STDOUT: %.loc11_46.2: ref f64 = struct_access file.%x.var, element0 // CHECK:STDOUT: %.loc11_46.3: init f64 = initialize_from %float to %.loc11_46.2 [template = constants.%float] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_1) [template = constants.%int_1.2] diff --git a/toolchain/check/testdata/struct/nested_struct_in_place.carbon b/toolchain/check/testdata/struct/nested_struct_in_place.carbon index fe65e2d2cad96..87ae9e4f1f64e 100644 --- a/toolchain/check/testdata/struct/nested_struct_in_place.carbon +++ b/toolchain/check/testdata/struct/nested_struct_in_place.carbon @@ -18,9 +18,7 @@ fn G() { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (type, type, type) [template] // CHECK:STDOUT: %tuple.type.2: type = tuple_type (%i32, %i32, %i32) [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] @@ -32,7 +30,7 @@ fn G() { // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -50,19 +48,13 @@ fn G() { // CHECK:STDOUT: %return.param_patt: %tuple.type.2 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc11_12: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11_12: init type = call constants.%Int(%int_32.loc11_12) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc11_12: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc11_17: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11_17: init type = call constants.%Int(%int_32.loc11_17) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc11_17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc11_22: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11_22: init type = call constants.%Int(%int_32.loc11_22) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_25.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc11_12, %int.make_type_signed.loc11_17, %int.make_type_signed.loc11_22) -// CHECK:STDOUT: %.loc11_25.2: type = value_of_initializer %int.make_type_signed.loc11_12 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_25.3: type = converted %int.make_type_signed.loc11_12, %.loc11_25.2 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_25.4: type = value_of_initializer %int.make_type_signed.loc11_17 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_25.5: type = converted %int.make_type_signed.loc11_17, %.loc11_25.4 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_25.6: type = value_of_initializer %int.make_type_signed.loc11_22 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_25.7: type = converted %int.make_type_signed.loc11_22, %.loc11_25.6 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_25.8: type = converted %.loc11_25.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] +// CHECK:STDOUT: %i32.loc11_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_25.1: %tuple.type.1 = tuple_literal (%i32.loc11_12, %i32.loc11_17, %i32.loc11_22) +// CHECK:STDOUT: %.loc11_25.2: type = converted %.loc11_25.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %return.param: ref %tuple.type.2 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %tuple.type.2 = return_slot %return.param // CHECK:STDOUT: } @@ -74,33 +66,21 @@ fn G() { // CHECK:STDOUT: fn @G() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_32.loc14_16: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc14_16: init type = call constants.%Int(%int_32.loc14_16) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc14_16: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc14_21: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc14_21: init type = call constants.%Int(%int_32.loc14_21) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc14_21: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc14_26: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc14_26: init type = call constants.%Int(%int_32.loc14_26) [template = constants.%i32] -// CHECK:STDOUT: %.loc14_29.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc14_16, %int.make_type_signed.loc14_21, %int.make_type_signed.loc14_26) -// CHECK:STDOUT: %.loc14_29.2: type = value_of_initializer %int.make_type_signed.loc14_16 [template = constants.%i32] -// CHECK:STDOUT: %.loc14_29.3: type = converted %int.make_type_signed.loc14_16, %.loc14_29.2 [template = constants.%i32] -// CHECK:STDOUT: %.loc14_29.4: type = value_of_initializer %int.make_type_signed.loc14_21 [template = constants.%i32] -// CHECK:STDOUT: %.loc14_29.5: type = converted %int.make_type_signed.loc14_21, %.loc14_29.4 [template = constants.%i32] -// CHECK:STDOUT: %.loc14_29.6: type = value_of_initializer %int.make_type_signed.loc14_26 [template = constants.%i32] -// CHECK:STDOUT: %.loc14_29.7: type = converted %int.make_type_signed.loc14_26, %.loc14_29.6 [template = constants.%i32] -// CHECK:STDOUT: %.loc14_29.8: type = converted %.loc14_29.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] +// CHECK:STDOUT: %i32.loc14_26: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc14_29.1: %tuple.type.1 = tuple_literal (%i32.loc14_16, %i32.loc14_21, %i32.loc14_26) +// CHECK:STDOUT: %.loc14_29.2: type = converted %.loc14_29.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %int_32.loc14_37: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc14_37: init type = call constants.%Int(%int_32.loc14_37) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc14_37: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc14_42: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc14_42: init type = call constants.%Int(%int_32.loc14_42) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc14_42: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc14_47: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc14_47: init type = call constants.%Int(%int_32.loc14_47) [template = constants.%i32] -// CHECK:STDOUT: %.loc14_50.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc14_37, %int.make_type_signed.loc14_42, %int.make_type_signed.loc14_47) -// CHECK:STDOUT: %.loc14_50.2: type = value_of_initializer %int.make_type_signed.loc14_37 [template = constants.%i32] -// CHECK:STDOUT: %.loc14_50.3: type = converted %int.make_type_signed.loc14_37, %.loc14_50.2 [template = constants.%i32] -// CHECK:STDOUT: %.loc14_50.4: type = value_of_initializer %int.make_type_signed.loc14_42 [template = constants.%i32] -// CHECK:STDOUT: %.loc14_50.5: type = converted %int.make_type_signed.loc14_42, %.loc14_50.4 [template = constants.%i32] -// CHECK:STDOUT: %.loc14_50.6: type = value_of_initializer %int.make_type_signed.loc14_47 [template = constants.%i32] -// CHECK:STDOUT: %.loc14_50.7: type = converted %int.make_type_signed.loc14_47, %.loc14_50.6 [template = constants.%i32] -// CHECK:STDOUT: %.loc14_50.8: type = converted %.loc14_50.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] +// CHECK:STDOUT: %i32.loc14_47: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc14_50.1: %tuple.type.1 = tuple_literal (%i32.loc14_37, %i32.loc14_42, %i32.loc14_47) +// CHECK:STDOUT: %.loc14_50.2: type = converted %.loc14_50.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %struct_type.a.b: type = struct_type {.a: %tuple.type.2, .b: %tuple.type.2} [template = constants.%struct_type.a.b.1] // CHECK:STDOUT: %v.var: ref %struct_type.a.b.1 = var v // CHECK:STDOUT: %v: ref %struct_type.a.b.1 = bind_name v, %v.var diff --git a/toolchain/check/testdata/struct/one_entry.carbon b/toolchain/check/testdata/struct/one_entry.carbon index e915f92d40e03..03503357507e1 100644 --- a/toolchain/check/testdata/struct/one_entry.carbon +++ b/toolchain/check/testdata/struct/one_entry.carbon @@ -15,17 +15,15 @@ var y: {.a: i32} = x; // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %struct_type.a.1: type = struct_type {.a: %i32} [template] // CHECK:STDOUT: %int_4.1: Core.IntLiteral = int_value 4 [template] // CHECK:STDOUT: %struct_type.a.2: type = struct_type {.a: Core.IntLiteral} [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_4.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound: = bound_method %int_4.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_4.2: %i32 = int_value 4 [template] // CHECK:STDOUT: %struct: %struct_type.a.1 = struct_value (%int_4.2) [template] @@ -34,7 +32,7 @@ var y: {.a: i32} = x; // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -48,16 +46,12 @@ var y: {.a: i32} = x; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int_32.loc11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11: init type = call constants.%Int(%int_32.loc11) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_13.1: type = value_of_initializer %int.make_type_signed.loc11 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_13.2: type = converted %int.make_type_signed.loc11, %.loc11_13.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %struct_type.a.loc11: type = struct_type {.a: %i32} [template = constants.%struct_type.a.1] // CHECK:STDOUT: %x.var: ref %struct_type.a.1 = var x // CHECK:STDOUT: %x: ref %struct_type.a.1 = bind_name x, %x.var // CHECK:STDOUT: %int_32.loc12: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc12: init type = call constants.%Int(%int_32.loc12) [template = constants.%i32] -// CHECK:STDOUT: %.loc12_13.1: type = value_of_initializer %int.make_type_signed.loc12 [template = constants.%i32] -// CHECK:STDOUT: %.loc12_13.2: type = converted %int.make_type_signed.loc12, %.loc12_13.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc12: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %struct_type.a.loc12: type = struct_type {.a: %i32} [template = constants.%struct_type.a.1] // CHECK:STDOUT: %y.var: ref %struct_type.a.1 = var y // CHECK:STDOUT: %y: ref %struct_type.a.1 = bind_name y, %y.var @@ -67,7 +61,7 @@ var y: {.a: i32} = x; // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [template = constants.%int_4.1] // CHECK:STDOUT: %.loc11_27.1: %struct_type.a.2 = struct_literal (%int_4) -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_4, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_4) [template = constants.%int_4.2] diff --git a/toolchain/check/testdata/struct/reorder_fields.carbon b/toolchain/check/testdata/struct/reorder_fields.carbon index d94ffc6f2e3ad..cb790a47f455d 100644 --- a/toolchain/check/testdata/struct/reorder_fields.carbon +++ b/toolchain/check/testdata/struct/reorder_fields.carbon @@ -21,9 +21,7 @@ fn F() -> {.a: i32, .b: f64} { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %MakeI32.type: type = fn_type @MakeI32 [template] // CHECK:STDOUT: %MakeI32: %MakeI32.type = struct_value () [template] // CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [template] @@ -40,7 +38,7 @@ fn F() -> {.a: i32, .b: f64} { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .Float = %import_ref.2 +// CHECK:STDOUT: .Float = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -59,9 +57,7 @@ fn F() -> {.a: i32, .b: f64} { // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_17.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc11_17.2: type = converted %int.make_type_signed, %.loc11_17.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } @@ -81,9 +77,7 @@ fn F() -> {.a: i32, .b: f64} { // CHECK:STDOUT: %return.param_patt: %struct_type.a.b = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc14: init type = call constants.%Int(%int_32.loc14) [template = constants.%i32] -// CHECK:STDOUT: %.loc14_16.1: type = value_of_initializer %int.make_type_signed.loc14 [template = constants.%i32] -// CHECK:STDOUT: %.loc14_16.2: type = converted %int.make_type_signed.loc14, %.loc14_16.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_64.loc14: Core.IntLiteral = int_value 64 [template = constants.%int_64] // CHECK:STDOUT: %float.make_type.loc14: init type = call constants.%Float(%int_64.loc14) [template = f64] // CHECK:STDOUT: %.loc14_25.1: type = value_of_initializer %float.make_type.loc14 [template = f64] @@ -101,9 +95,7 @@ fn F() -> {.a: i32, .b: f64} { // CHECK:STDOUT: fn @F() -> %return.param_patt: %struct_type.a.b { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_32.loc15: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc15: init type = call constants.%Int(%int_32.loc15) [template = constants.%i32] -// CHECK:STDOUT: %.loc15_15.1: type = value_of_initializer %int.make_type_signed.loc15 [template = constants.%i32] -// CHECK:STDOUT: %.loc15_15.2: type = converted %int.make_type_signed.loc15, %.loc15_15.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc15: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_64.loc15: Core.IntLiteral = int_value 64 [template = constants.%int_64] // CHECK:STDOUT: %float.make_type.loc15: init type = call constants.%Float(%int_64.loc15) [template = f64] // CHECK:STDOUT: %.loc15_24.1: type = value_of_initializer %float.make_type.loc15 [template = f64] @@ -126,9 +118,7 @@ fn F() -> {.a: i32, .b: f64} { // CHECK:STDOUT: %.loc16_15.1: type = value_of_initializer %float.make_type.loc16 [template = f64] // CHECK:STDOUT: %.loc16_15.2: type = converted %float.make_type.loc16, %.loc16_15.1 [template = f64] // CHECK:STDOUT: %int_32.loc16: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc16: init type = call constants.%Int(%int_32.loc16) [template = constants.%i32] -// CHECK:STDOUT: %.loc16_24.1: type = value_of_initializer %int.make_type_signed.loc16 [template = constants.%i32] -// CHECK:STDOUT: %.loc16_24.2: type = converted %int.make_type_signed.loc16, %.loc16_24.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc16: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %struct_type.b.a: type = struct_type {.b: f64, .a: %i32} [template = constants.%struct_type.b.a] // CHECK:STDOUT: %x.ref: %struct_type.a.b = name_ref x, %x // CHECK:STDOUT: %.loc16_31.1: f64 = struct_access %x.ref, element1 diff --git a/toolchain/check/testdata/struct/tuple_as_element.carbon b/toolchain/check/testdata/struct/tuple_as_element.carbon index bf45c70b1d30a..d70c4f22c747b 100644 --- a/toolchain/check/testdata/struct/tuple_as_element.carbon +++ b/toolchain/check/testdata/struct/tuple_as_element.carbon @@ -15,9 +15,7 @@ var y: {.a: i32, .b: (i32,)} = x; // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (type) [template] // CHECK:STDOUT: %tuple.type.2: type = tuple_type (%i32) [template] // CHECK:STDOUT: %struct_type.a.b.1: type = struct_type {.a: %i32, .b: %tuple.type.2} [template] @@ -26,13 +24,13 @@ var y: {.a: i32, .b: (i32,)} = x; // CHECK:STDOUT: %tuple.type.3: type = tuple_type (Core.IntLiteral) [template] // CHECK:STDOUT: %struct_type.a.b.2: type = struct_type {.a: Core.IntLiteral, .b: %tuple.type.3} [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] // CHECK:STDOUT: %tuple: %tuple.type.2 = tuple_value (%int_2.2) [template] @@ -42,7 +40,7 @@ var y: {.a: i32, .b: (i32,)} = x; // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -56,28 +54,20 @@ var y: {.a: i32, .b: (i32,)} = x; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int_32.loc11_13: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11_13: init type = call constants.%Int(%int_32.loc11_13) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_13.1: type = value_of_initializer %int.make_type_signed.loc11_13 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_13.2: type = converted %int.make_type_signed.loc11_13, %.loc11_13.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc11_13: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc11_23: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11_23: init type = call constants.%Int(%int_32.loc11_23) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_27.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc11_23) -// CHECK:STDOUT: %.loc11_27.2: type = value_of_initializer %int.make_type_signed.loc11_23 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_27.3: type = converted %int.make_type_signed.loc11_23, %.loc11_27.2 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_27.4: type = converted %.loc11_27.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] +// CHECK:STDOUT: %i32.loc11_23: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_27.1: %tuple.type.1 = tuple_literal (%i32.loc11_23) +// CHECK:STDOUT: %.loc11_27.2: type = converted %.loc11_27.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %struct_type.a.b.loc11: type = struct_type {.a: %i32, .b: %tuple.type.2} [template = constants.%struct_type.a.b.1] // CHECK:STDOUT: %x.var: ref %struct_type.a.b.1 = var x // CHECK:STDOUT: %x: ref %struct_type.a.b.1 = bind_name x, %x.var // CHECK:STDOUT: %int_32.loc12_13: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc12_13: init type = call constants.%Int(%int_32.loc12_13) [template = constants.%i32] -// CHECK:STDOUT: %.loc12_13.1: type = value_of_initializer %int.make_type_signed.loc12_13 [template = constants.%i32] -// CHECK:STDOUT: %.loc12_13.2: type = converted %int.make_type_signed.loc12_13, %.loc12_13.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc12_13: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc12_23: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc12_23: init type = call constants.%Int(%int_32.loc12_23) [template = constants.%i32] -// CHECK:STDOUT: %.loc12_27.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc12_23) -// CHECK:STDOUT: %.loc12_27.2: type = value_of_initializer %int.make_type_signed.loc12_23 [template = constants.%i32] -// CHECK:STDOUT: %.loc12_27.3: type = converted %int.make_type_signed.loc12_23, %.loc12_27.2 [template = constants.%i32] -// CHECK:STDOUT: %.loc12_27.4: type = converted %.loc12_27.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] +// CHECK:STDOUT: %i32.loc12_23: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc12_27.1: %tuple.type.1 = tuple_literal (%i32.loc12_23) +// CHECK:STDOUT: %.loc12_27.2: type = converted %.loc12_27.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %struct_type.a.b.loc12: type = struct_type {.a: %i32, .b: %tuple.type.2} [template = constants.%struct_type.a.b.1] // CHECK:STDOUT: %y.var: ref %struct_type.a.b.1 = var y // CHECK:STDOUT: %y: ref %struct_type.a.b.1 = bind_name y, %y.var @@ -89,14 +79,14 @@ var y: {.a: i32, .b: (i32,)} = x; // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %.loc11_49.1: %tuple.type.3 = tuple_literal (%int_2) // CHECK:STDOUT: %.loc11_50.1: %struct_type.a.b.2 = struct_literal (%int_1, %.loc11_49.1) -// CHECK:STDOUT: %impl.elem0.loc11_50: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc11_50: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_50: = bound_method %int_1, %impl.elem0.loc11_50 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc11_50: = specific_function %Convert.bound.loc11_50, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc11_50: init %i32 = call %Convert.specific_fn.loc11_50(%int_1) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc11_50.2: init %i32 = converted %int_1, %int.convert_checked.loc11_50 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc11_50.3: ref %i32 = struct_access file.%x.var, element0 // CHECK:STDOUT: %.loc11_50.4: init %i32 = initialize_from %.loc11_50.2 to %.loc11_50.3 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc11_49: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc11_49: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_49: = bound_method %int_2, %impl.elem0.loc11_49 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc11_49: = specific_function %Convert.bound.loc11_49, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc11_49: init %i32 = call %Convert.specific_fn.loc11_49(%int_2) [template = constants.%int_2.2] diff --git a/toolchain/check/testdata/struct/two_entries.carbon b/toolchain/check/testdata/struct/two_entries.carbon index 6d571d62b38a2..5fd7c423ccd5d 100644 --- a/toolchain/check/testdata/struct/two_entries.carbon +++ b/toolchain/check/testdata/struct/two_entries.carbon @@ -18,21 +18,19 @@ var y: {.a: i32, .b: i32} = x; // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %struct_type.a.b.1: type = struct_type {.a: %i32, .b: %i32} [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %struct_type.a.b.2: type = struct_type {.a: Core.IntLiteral, .b: Core.IntLiteral} [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] // CHECK:STDOUT: %struct: %struct_type.a.b.1 = struct_value (%int_1.2, %int_2.2) [template] @@ -41,7 +39,7 @@ var y: {.a: i32, .b: i32} = x; // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -57,42 +55,26 @@ var y: {.a: i32, .b: i32} = x; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int_32.loc11_13: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11_13: init type = call constants.%Int(%int_32.loc11_13) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_13.1: type = value_of_initializer %int.make_type_signed.loc11_13 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_13.2: type = converted %int.make_type_signed.loc11_13, %.loc11_13.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc11_13: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc11_22: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11_22: init type = call constants.%Int(%int_32.loc11_22) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_22.1: type = value_of_initializer %int.make_type_signed.loc11_22 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_22.2: type = converted %int.make_type_signed.loc11_22, %.loc11_22.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc11_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %struct_type.a.b.loc11: type = struct_type {.a: %i32, .b: %i32} [template = constants.%struct_type.a.b.1] // CHECK:STDOUT: %int_32.loc12_13: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc12_13: init type = call constants.%Int(%int_32.loc12_13) [template = constants.%i32] -// CHECK:STDOUT: %.loc12_13.1: type = value_of_initializer %int.make_type_signed.loc12_13 [template = constants.%i32] -// CHECK:STDOUT: %.loc12_13.2: type = converted %int.make_type_signed.loc12_13, %.loc12_13.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc12_13: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc12_22: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc12_22: init type = call constants.%Int(%int_32.loc12_22) [template = constants.%i32] -// CHECK:STDOUT: %.loc12_22.1: type = value_of_initializer %int.make_type_signed.loc12_22 [template = constants.%i32] -// CHECK:STDOUT: %.loc12_22.2: type = converted %int.make_type_signed.loc12_22, %.loc12_22.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc12_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %struct_type.a.b.loc12: type = struct_type {.a: %i32, .b: %i32} [template = constants.%struct_type.a.b.1] // CHECK:STDOUT: %int_32.loc14_13: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc14_13: init type = call constants.%Int(%int_32.loc14_13) [template = constants.%i32] -// CHECK:STDOUT: %.loc14_13.1: type = value_of_initializer %int.make_type_signed.loc14_13 [template = constants.%i32] -// CHECK:STDOUT: %.loc14_13.2: type = converted %int.make_type_signed.loc14_13, %.loc14_13.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc14_13: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc14_22: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc14_22: init type = call constants.%Int(%int_32.loc14_22) [template = constants.%i32] -// CHECK:STDOUT: %.loc14_22.1: type = value_of_initializer %int.make_type_signed.loc14_22 [template = constants.%i32] -// CHECK:STDOUT: %.loc14_22.2: type = converted %int.make_type_signed.loc14_22, %.loc14_22.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc14_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %struct_type.a.b.loc14: type = struct_type {.a: %i32, .b: %i32} [template = constants.%struct_type.a.b.1] // CHECK:STDOUT: %x.var: ref %struct_type.a.b.1 = var x // CHECK:STDOUT: %x: ref %struct_type.a.b.1 = bind_name x, %x.var // CHECK:STDOUT: %int_32.loc15_13: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc15_13: init type = call constants.%Int(%int_32.loc15_13) [template = constants.%i32] -// CHECK:STDOUT: %.loc15_13.1: type = value_of_initializer %int.make_type_signed.loc15_13 [template = constants.%i32] -// CHECK:STDOUT: %.loc15_13.2: type = converted %int.make_type_signed.loc15_13, %.loc15_13.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc15_13: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc15_22: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc15_22: init type = call constants.%Int(%int_32.loc15_22) [template = constants.%i32] -// CHECK:STDOUT: %.loc15_22.1: type = value_of_initializer %int.make_type_signed.loc15_22 [template = constants.%i32] -// CHECK:STDOUT: %.loc15_22.2: type = converted %int.make_type_signed.loc15_22, %.loc15_22.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc15_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %struct_type.a.b.loc15: type = struct_type {.a: %i32, .b: %i32} [template = constants.%struct_type.a.b.1] // CHECK:STDOUT: %y.var: ref %struct_type.a.b.1 = var y // CHECK:STDOUT: %y: ref %struct_type.a.b.1 = bind_name y, %y.var @@ -103,13 +85,13 @@ var y: {.a: i32, .b: i32} = x; // CHECK:STDOUT: %int_1.loc11: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_2.loc11: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %.loc11_44.1: %struct_type.a.b.2 = struct_literal (%int_1.loc11, %int_2.loc11) -// CHECK:STDOUT: %impl.elem0.loc11_44.1: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc11_44.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_44.1: = bound_method %int_1.loc11, %impl.elem0.loc11_44.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc11_44.1: = specific_function %Convert.bound.loc11_44.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc11_44.1: init %i32 = call %Convert.specific_fn.loc11_44.1(%int_1.loc11) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc11_44.2: %i32 = value_of_initializer %int.convert_checked.loc11_44.1 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc11_44.3: %i32 = converted %int_1.loc11, %.loc11_44.2 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc11_44.2: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc11_44.2: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_44.2: = bound_method %int_2.loc11, %impl.elem0.loc11_44.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc11_44.2: = specific_function %Convert.bound.loc11_44.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc11_44.2: init %i32 = call %Convert.specific_fn.loc11_44.2(%int_2.loc11) [template = constants.%int_2.2] @@ -123,14 +105,14 @@ var y: {.a: i32, .b: i32} = x; // CHECK:STDOUT: %int_1.loc14: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_2.loc14: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %.loc14_44.1: %struct_type.a.b.2 = struct_literal (%int_1.loc14, %int_2.loc14) -// CHECK:STDOUT: %impl.elem0.loc14_44.1: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc14_44.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc14_44.1: = bound_method %int_1.loc14, %impl.elem0.loc14_44.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc14_44.1: = specific_function %Convert.bound.loc14_44.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc14_44.1: init %i32 = call %Convert.specific_fn.loc14_44.1(%int_1.loc14) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc14_44.2: init %i32 = converted %int_1.loc14, %int.convert_checked.loc14_44.1 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc14_44.3: ref %i32 = struct_access file.%x.var, element0 // CHECK:STDOUT: %.loc14_44.4: init %i32 = initialize_from %.loc14_44.2 to %.loc14_44.3 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc14_44.2: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc14_44.2: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc14_44.2: = bound_method %int_2.loc14, %impl.elem0.loc14_44.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc14_44.2: = specific_function %Convert.bound.loc14_44.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc14_44.2: init %i32 = call %Convert.specific_fn.loc14_44.2(%int_2.loc14) [template = constants.%int_2.2] diff --git a/toolchain/check/testdata/tuple/access/element_access.carbon b/toolchain/check/testdata/tuple/access/element_access.carbon index 44dc9a6c6286e..98cac2e6fdf27 100644 --- a/toolchain/check/testdata/tuple/access/element_access.carbon +++ b/toolchain/check/testdata/tuple/access/element_access.carbon @@ -16,18 +16,16 @@ var c: i32 = b.0; // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (type) [template] // CHECK:STDOUT: %tuple.type.2: type = tuple_type (%i32) [template] // CHECK:STDOUT: %int_12.1: Core.IntLiteral = int_value 12 [template] // CHECK:STDOUT: %tuple.type.3: type = tuple_type (Core.IntLiteral) [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_12.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound: = bound_method %int_12.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_12.2: %i32 = int_value 12 [template] // CHECK:STDOUT: %tuple: %tuple.type.2 = tuple_value (%int_12.2) [template] @@ -37,7 +35,7 @@ var c: i32 = b.0; // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -52,25 +50,19 @@ var c: i32 = b.0; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int_32.loc11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11: init type = call constants.%Int(%int_32.loc11) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_13.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc11) -// CHECK:STDOUT: %.loc11_13.2: type = value_of_initializer %int.make_type_signed.loc11 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_13.3: type = converted %int.make_type_signed.loc11, %.loc11_13.2 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_13.4: type = converted %.loc11_13.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] +// CHECK:STDOUT: %i32.loc11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_13.1: %tuple.type.1 = tuple_literal (%i32.loc11) +// CHECK:STDOUT: %.loc11_13.2: type = converted %.loc11_13.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %a.var: ref %tuple.type.2 = var a // CHECK:STDOUT: %a: ref %tuple.type.2 = bind_name a, %a.var // CHECK:STDOUT: %int_32.loc12: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc12: init type = call constants.%Int(%int_32.loc12) [template = constants.%i32] -// CHECK:STDOUT: %.loc12_13.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc12) -// CHECK:STDOUT: %.loc12_13.2: type = value_of_initializer %int.make_type_signed.loc12 [template = constants.%i32] -// CHECK:STDOUT: %.loc12_13.3: type = converted %int.make_type_signed.loc12, %.loc12_13.2 [template = constants.%i32] -// CHECK:STDOUT: %.loc12_13.4: type = converted %.loc12_13.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] +// CHECK:STDOUT: %i32.loc12: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc12_13.1: %tuple.type.1 = tuple_literal (%i32.loc12) +// CHECK:STDOUT: %.loc12_13.2: type = converted %.loc12_13.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %b.var: ref %tuple.type.2 = var b // CHECK:STDOUT: %b: ref %tuple.type.2 = bind_name b, %b.var // CHECK:STDOUT: %int_32.loc13: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc13: init type = call constants.%Int(%int_32.loc13) [template = constants.%i32] -// CHECK:STDOUT: %.loc13_8.1: type = value_of_initializer %int.make_type_signed.loc13 [template = constants.%i32] -// CHECK:STDOUT: %.loc13_8.2: type = converted %int.make_type_signed.loc13, %.loc13_8.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc13: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %c.var: ref %i32 = var c // CHECK:STDOUT: %c: ref %i32 = bind_name c, %c.var // CHECK:STDOUT: } @@ -79,7 +71,7 @@ var c: i32 = b.0; // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_12: Core.IntLiteral = int_value 12 [template = constants.%int_12.1] // CHECK:STDOUT: %.loc11_21.1: %tuple.type.3 = tuple_literal (%int_12) -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_12, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_12) [template = constants.%int_12.2] diff --git a/toolchain/check/testdata/tuple/access/fail_access_error.carbon b/toolchain/check/testdata/tuple/access/fail_access_error.carbon index 7bc714937c5b9..c8a6cbf34d4e6 100644 --- a/toolchain/check/testdata/tuple/access/fail_access_error.carbon +++ b/toolchain/check/testdata/tuple/access/fail_access_error.carbon @@ -18,22 +18,20 @@ var b: i32 = a.(oops); // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (type, type) [template] // CHECK:STDOUT: %tuple.type.2: type = tuple_type (%i32, %i32) [template] // CHECK:STDOUT: %int_12.1: Core.IntLiteral = int_value 12 [template] // CHECK:STDOUT: %int_6.1: Core.IntLiteral = int_value 6 [template] // CHECK:STDOUT: %tuple.type.3: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_12.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_12.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_12.2: %i32 = int_value 12 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_6.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_6.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_6.2: %i32 = int_value 6 [template] // CHECK:STDOUT: %tuple: %tuple.type.2 = tuple_value (%int_12.2, %int_6.2) [template] @@ -42,7 +40,7 @@ var b: i32 = a.(oops); // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -56,21 +54,15 @@ var b: i32 = a.(oops); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int_32.loc11_9: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11_9: init type = call constants.%Int(%int_32.loc11_9) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc11_9: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc11_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11_14: init type = call constants.%Int(%int_32.loc11_14) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_17.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc11_9, %int.make_type_signed.loc11_14) -// CHECK:STDOUT: %.loc11_17.2: type = value_of_initializer %int.make_type_signed.loc11_9 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_17.3: type = converted %int.make_type_signed.loc11_9, %.loc11_17.2 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_17.4: type = value_of_initializer %int.make_type_signed.loc11_14 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_17.5: type = converted %int.make_type_signed.loc11_14, %.loc11_17.4 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_17.6: type = converted %.loc11_17.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] +// CHECK:STDOUT: %i32.loc11_14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_17.1: %tuple.type.1 = tuple_literal (%i32.loc11_9, %i32.loc11_14) +// CHECK:STDOUT: %.loc11_17.2: type = converted %.loc11_17.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %a.var: ref %tuple.type.2 = var a // CHECK:STDOUT: %a: ref %tuple.type.2 = bind_name a, %a.var // CHECK:STDOUT: %int_32.loc15: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc15: init type = call constants.%Int(%int_32.loc15) [template = constants.%i32] -// CHECK:STDOUT: %.loc15_8.1: type = value_of_initializer %int.make_type_signed.loc15 [template = constants.%i32] -// CHECK:STDOUT: %.loc15_8.2: type = converted %int.make_type_signed.loc15, %.loc15_8.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc15: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %b.var: ref %i32 = var b // CHECK:STDOUT: %b: ref %i32 = bind_name b, %b.var // CHECK:STDOUT: } @@ -80,14 +72,14 @@ var b: i32 = a.(oops); // CHECK:STDOUT: %int_12: Core.IntLiteral = int_value 12 [template = constants.%int_12.1] // CHECK:STDOUT: %int_6: Core.IntLiteral = int_value 6 [template = constants.%int_6.1] // CHECK:STDOUT: %.loc11_27.1: %tuple.type.3 = tuple_literal (%int_12, %int_6) -// CHECK:STDOUT: %impl.elem0.loc11_27.1: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc11_27.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_27.1: = bound_method %int_12, %impl.elem0.loc11_27.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc11_27.1: = specific_function %Convert.bound.loc11_27.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc11_27.1: init %i32 = call %Convert.specific_fn.loc11_27.1(%int_12) [template = constants.%int_12.2] // CHECK:STDOUT: %.loc11_27.2: init %i32 = converted %int_12, %int.convert_checked.loc11_27.1 [template = constants.%int_12.2] // CHECK:STDOUT: %tuple.elem0: ref %i32 = tuple_access file.%a.var, element0 // CHECK:STDOUT: %.loc11_27.3: init %i32 = initialize_from %.loc11_27.2 to %tuple.elem0 [template = constants.%int_12.2] -// CHECK:STDOUT: %impl.elem0.loc11_27.2: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc11_27.2: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_27.2: = bound_method %int_6, %impl.elem0.loc11_27.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc11_27.2: = specific_function %Convert.bound.loc11_27.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc11_27.2: init %i32 = call %Convert.specific_fn.loc11_27.2(%int_6) [template = constants.%int_6.2] diff --git a/toolchain/check/testdata/tuple/access/fail_large_index.carbon b/toolchain/check/testdata/tuple/access/fail_large_index.carbon index 85afe12ff72d5..8f2ca20ac6093 100644 --- a/toolchain/check/testdata/tuple/access/fail_large_index.carbon +++ b/toolchain/check/testdata/tuple/access/fail_large_index.carbon @@ -24,18 +24,16 @@ var d: i32 = b.(0x7FFF_FFFF); // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (type) [template] // CHECK:STDOUT: %tuple.type.2: type = tuple_type (%i32) [template] // CHECK:STDOUT: %int_12.1: Core.IntLiteral = int_value 12 [template] // CHECK:STDOUT: %tuple.type.3: type = tuple_type (Core.IntLiteral) [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_12.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound: = bound_method %int_12.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_12.2: %i32 = int_value 12 [template] // CHECK:STDOUT: %tuple: %tuple.type.2 = tuple_value (%int_12.2) [template] @@ -46,7 +44,7 @@ var d: i32 = b.(0x7FFF_FFFF); // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -62,31 +60,23 @@ var d: i32 = b.(0x7FFF_FFFF); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int_32.loc11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11: init type = call constants.%Int(%int_32.loc11) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_13.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc11) -// CHECK:STDOUT: %.loc11_13.2: type = value_of_initializer %int.make_type_signed.loc11 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_13.3: type = converted %int.make_type_signed.loc11, %.loc11_13.2 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_13.4: type = converted %.loc11_13.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] +// CHECK:STDOUT: %i32.loc11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_13.1: %tuple.type.1 = tuple_literal (%i32.loc11) +// CHECK:STDOUT: %.loc11_13.2: type = converted %.loc11_13.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %a.var: ref %tuple.type.2 = var a // CHECK:STDOUT: %a: ref %tuple.type.2 = bind_name a, %a.var // CHECK:STDOUT: %int_32.loc12: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc12: init type = call constants.%Int(%int_32.loc12) [template = constants.%i32] -// CHECK:STDOUT: %.loc12_13.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc12) -// CHECK:STDOUT: %.loc12_13.2: type = value_of_initializer %int.make_type_signed.loc12 [template = constants.%i32] -// CHECK:STDOUT: %.loc12_13.3: type = converted %int.make_type_signed.loc12, %.loc12_13.2 [template = constants.%i32] -// CHECK:STDOUT: %.loc12_13.4: type = converted %.loc12_13.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] +// CHECK:STDOUT: %i32.loc12: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc12_13.1: %tuple.type.1 = tuple_literal (%i32.loc12) +// CHECK:STDOUT: %.loc12_13.2: type = converted %.loc12_13.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %b.var: ref %tuple.type.2 = var b // CHECK:STDOUT: %b: ref %tuple.type.2 = bind_name b, %b.var // CHECK:STDOUT: %int_32.loc17: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc17: init type = call constants.%Int(%int_32.loc17) [template = constants.%i32] -// CHECK:STDOUT: %.loc17_8.1: type = value_of_initializer %int.make_type_signed.loc17 [template = constants.%i32] -// CHECK:STDOUT: %.loc17_8.2: type = converted %int.make_type_signed.loc17, %.loc17_8.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %c.var: ref %i32 = var c // CHECK:STDOUT: %c: ref %i32 = bind_name c, %c.var // CHECK:STDOUT: %int_32.loc21: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc21: init type = call constants.%Int(%int_32.loc21) [template = constants.%i32] -// CHECK:STDOUT: %.loc21_8.1: type = value_of_initializer %int.make_type_signed.loc21 [template = constants.%i32] -// CHECK:STDOUT: %.loc21_8.2: type = converted %int.make_type_signed.loc21, %.loc21_8.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc21: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %d.var: ref %i32 = var d // CHECK:STDOUT: %d: ref %i32 = bind_name d, %d.var // CHECK:STDOUT: } @@ -95,7 +85,7 @@ var d: i32 = b.(0x7FFF_FFFF); // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_12: Core.IntLiteral = int_value 12 [template = constants.%int_12.1] // CHECK:STDOUT: %.loc11_21.1: %tuple.type.3 = tuple_literal (%int_12) -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_12, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_12) [template = constants.%int_12.2] diff --git a/toolchain/check/testdata/tuple/access/fail_negative_indexing.carbon b/toolchain/check/testdata/tuple/access/fail_negative_indexing.carbon index 634fc9e1f20f6..2d6290bd08508 100644 --- a/toolchain/check/testdata/tuple/access/fail_negative_indexing.carbon +++ b/toolchain/check/testdata/tuple/access/fail_negative_indexing.carbon @@ -18,22 +18,20 @@ var b: i32 = a.(-10); // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (type, type) [template] // CHECK:STDOUT: %tuple.type.2: type = tuple_type (%i32, %i32) [template] // CHECK:STDOUT: %int_12.1: Core.IntLiteral = int_value 12 [template] // CHECK:STDOUT: %int_6.1: Core.IntLiteral = int_value 6 [template] // CHECK:STDOUT: %tuple.type.3: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_12.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_12.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_12.2: %i32 = int_value 12 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_6.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_6.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_6.2: %i32 = int_value 6 [template] // CHECK:STDOUT: %tuple: %tuple.type.2 = tuple_value (%int_12.2, %int_6.2) [template] @@ -43,8 +41,8 @@ var b: i32 = a.(-10); // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 -// CHECK:STDOUT: .Negate = %import_ref.38 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 +// CHECK:STDOUT: .Negate = %import_ref.193 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -58,21 +56,15 @@ var b: i32 = a.(-10); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int_32.loc11_9: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11_9: init type = call constants.%Int(%int_32.loc11_9) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc11_9: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc11_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11_14: init type = call constants.%Int(%int_32.loc11_14) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_17.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc11_9, %int.make_type_signed.loc11_14) -// CHECK:STDOUT: %.loc11_17.2: type = value_of_initializer %int.make_type_signed.loc11_9 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_17.3: type = converted %int.make_type_signed.loc11_9, %.loc11_17.2 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_17.4: type = value_of_initializer %int.make_type_signed.loc11_14 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_17.5: type = converted %int.make_type_signed.loc11_14, %.loc11_17.4 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_17.6: type = converted %.loc11_17.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] +// CHECK:STDOUT: %i32.loc11_14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_17.1: %tuple.type.1 = tuple_literal (%i32.loc11_9, %i32.loc11_14) +// CHECK:STDOUT: %.loc11_17.2: type = converted %.loc11_17.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %a.var: ref %tuple.type.2 = var a // CHECK:STDOUT: %a: ref %tuple.type.2 = bind_name a, %a.var // CHECK:STDOUT: %int_32.loc15: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc15: init type = call constants.%Int(%int_32.loc15) [template = constants.%i32] -// CHECK:STDOUT: %.loc15_8.1: type = value_of_initializer %int.make_type_signed.loc15 [template = constants.%i32] -// CHECK:STDOUT: %.loc15_8.2: type = converted %int.make_type_signed.loc15, %.loc15_8.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc15: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %b.var: ref %i32 = var b // CHECK:STDOUT: %b: ref %i32 = bind_name b, %b.var // CHECK:STDOUT: } @@ -82,14 +74,14 @@ var b: i32 = a.(-10); // CHECK:STDOUT: %int_12: Core.IntLiteral = int_value 12 [template = constants.%int_12.1] // CHECK:STDOUT: %int_6: Core.IntLiteral = int_value 6 [template = constants.%int_6.1] // CHECK:STDOUT: %.loc11_27.1: %tuple.type.3 = tuple_literal (%int_12, %int_6) -// CHECK:STDOUT: %impl.elem0.loc11_27.1: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc11_27.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_27.1: = bound_method %int_12, %impl.elem0.loc11_27.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc11_27.1: = specific_function %Convert.bound.loc11_27.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc11_27.1: init %i32 = call %Convert.specific_fn.loc11_27.1(%int_12) [template = constants.%int_12.2] // CHECK:STDOUT: %.loc11_27.2: init %i32 = converted %int_12, %int.convert_checked.loc11_27.1 [template = constants.%int_12.2] // CHECK:STDOUT: %tuple.elem0: ref %i32 = tuple_access file.%a.var, element0 // CHECK:STDOUT: %.loc11_27.3: init %i32 = initialize_from %.loc11_27.2 to %tuple.elem0 [template = constants.%int_12.2] -// CHECK:STDOUT: %impl.elem0.loc11_27.2: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc11_27.2: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_27.2: = bound_method %int_6, %impl.elem0.loc11_27.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc11_27.2: = specific_function %Convert.bound.loc11_27.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc11_27.2: init %i32 = call %Convert.specific_fn.loc11_27.2(%int_6) [template = constants.%int_6.2] diff --git a/toolchain/check/testdata/tuple/access/fail_non_deterministic_type.carbon b/toolchain/check/testdata/tuple/access/fail_non_deterministic_type.carbon index f5e0598528e9e..c58c71b7d95e2 100644 --- a/toolchain/check/testdata/tuple/access/fail_non_deterministic_type.carbon +++ b/toolchain/check/testdata/tuple/access/fail_non_deterministic_type.carbon @@ -19,27 +19,25 @@ var c: i32 = a.(b); // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (type, type) [template] // CHECK:STDOUT: %tuple.type.2: type = tuple_type (%i32, %i32) [template] // CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %int_3.1: Core.IntLiteral = int_value 3 [template] // CHECK:STDOUT: %tuple.type.3: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_2.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_2.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_3.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_3.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_3.2: %i32 = int_value 3 [template] // CHECK:STDOUT: %tuple: %tuple.type.2 = tuple_value (%int_2.2, %int_3.2) [template] // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] -// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_0.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] // CHECK:STDOUT: } @@ -47,7 +45,7 @@ var c: i32 = a.(b); // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -62,27 +60,19 @@ var c: i32 = a.(b); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int_32.loc11_9: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11_9: init type = call constants.%Int(%int_32.loc11_9) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc11_9: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc11_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11_14: init type = call constants.%Int(%int_32.loc11_14) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_17.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc11_9, %int.make_type_signed.loc11_14) -// CHECK:STDOUT: %.loc11_17.2: type = value_of_initializer %int.make_type_signed.loc11_9 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_17.3: type = converted %int.make_type_signed.loc11_9, %.loc11_17.2 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_17.4: type = value_of_initializer %int.make_type_signed.loc11_14 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_17.5: type = converted %int.make_type_signed.loc11_14, %.loc11_17.4 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_17.6: type = converted %.loc11_17.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] +// CHECK:STDOUT: %i32.loc11_14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_17.1: %tuple.type.1 = tuple_literal (%i32.loc11_9, %i32.loc11_14) +// CHECK:STDOUT: %.loc11_17.2: type = converted %.loc11_17.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %a.var: ref %tuple.type.2 = var a // CHECK:STDOUT: %a: ref %tuple.type.2 = bind_name a, %a.var // CHECK:STDOUT: %int_32.loc12: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc12: init type = call constants.%Int(%int_32.loc12) [template = constants.%i32] -// CHECK:STDOUT: %.loc12_8.1: type = value_of_initializer %int.make_type_signed.loc12 [template = constants.%i32] -// CHECK:STDOUT: %.loc12_8.2: type = converted %int.make_type_signed.loc12, %.loc12_8.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc12: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %b.var: ref %i32 = var b // CHECK:STDOUT: %b: ref %i32 = bind_name b, %b.var // CHECK:STDOUT: %int_32.loc16: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc16: init type = call constants.%Int(%int_32.loc16) [template = constants.%i32] -// CHECK:STDOUT: %.loc16_8.1: type = value_of_initializer %int.make_type_signed.loc16 [template = constants.%i32] -// CHECK:STDOUT: %.loc16_8.2: type = converted %int.make_type_signed.loc16, %.loc16_8.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc16: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %c.var: ref %i32 = var c // CHECK:STDOUT: %c: ref %i32 = bind_name c, %c.var // CHECK:STDOUT: } @@ -92,14 +82,14 @@ var c: i32 = a.(b); // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] // CHECK:STDOUT: %.loc11_26.1: %tuple.type.3 = tuple_literal (%int_2, %int_3) -// CHECK:STDOUT: %impl.elem0.loc11_26.1: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc11_26.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_26.1: = bound_method %int_2, %impl.elem0.loc11_26.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc11_26.1: = specific_function %Convert.bound.loc11_26.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc11_26.1: init %i32 = call %Convert.specific_fn.loc11_26.1(%int_2) [template = constants.%int_2.2] // CHECK:STDOUT: %.loc11_26.2: init %i32 = converted %int_2, %int.convert_checked.loc11_26.1 [template = constants.%int_2.2] // CHECK:STDOUT: %tuple.elem0: ref %i32 = tuple_access file.%a.var, element0 // CHECK:STDOUT: %.loc11_26.3: init %i32 = initialize_from %.loc11_26.2 to %tuple.elem0 [template = constants.%int_2.2] -// CHECK:STDOUT: %impl.elem0.loc11_26.2: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc11_26.2: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_26.2: = bound_method %int_3, %impl.elem0.loc11_26.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc11_26.2: = specific_function %Convert.bound.loc11_26.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc11_26.2: init %i32 = call %Convert.specific_fn.loc11_26.2(%int_3) [template = constants.%int_3.2] @@ -110,7 +100,7 @@ var c: i32 = a.(b); // CHECK:STDOUT: %.loc11_27: init %tuple.type.2 = converted %.loc11_26.1, %.loc11_26.6 [template = constants.%tuple] // CHECK:STDOUT: assign file.%a.var, %.loc11_27 // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0.loc12: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc12: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc12: = bound_method %int_0, %impl.elem0.loc12 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc12: = specific_function %Convert.bound.loc12, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc12: init %i32 = call %Convert.specific_fn.loc12(%int_0) [template = constants.%int_0.2] diff --git a/toolchain/check/testdata/tuple/access/fail_non_int_indexing.carbon b/toolchain/check/testdata/tuple/access/fail_non_int_indexing.carbon index 2b41b07cc0569..d93c84e75b25a 100644 --- a/toolchain/check/testdata/tuple/access/fail_non_int_indexing.carbon +++ b/toolchain/check/testdata/tuple/access/fail_non_int_indexing.carbon @@ -21,22 +21,20 @@ var b: i32 = a.(2.6); // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (type, type) [template] // CHECK:STDOUT: %tuple.type.2: type = tuple_type (%i32, %i32) [template] // CHECK:STDOUT: %int_12.1: Core.IntLiteral = int_value 12 [template] // CHECK:STDOUT: %int_6.1: Core.IntLiteral = int_value 6 [template] // CHECK:STDOUT: %tuple.type.3: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_12.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_12.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_12.2: %i32 = int_value 12 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_6.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_6.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_6.2: %i32 = int_value 6 [template] // CHECK:STDOUT: %tuple: %tuple.type.2 = tuple_value (%int_12.2, %int_6.2) [template] @@ -46,7 +44,7 @@ var b: i32 = a.(2.6); // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -60,21 +58,15 @@ var b: i32 = a.(2.6); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int_32.loc11_9: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11_9: init type = call constants.%Int(%int_32.loc11_9) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc11_9: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc11_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11_14: init type = call constants.%Int(%int_32.loc11_14) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_17.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc11_9, %int.make_type_signed.loc11_14) -// CHECK:STDOUT: %.loc11_17.2: type = value_of_initializer %int.make_type_signed.loc11_9 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_17.3: type = converted %int.make_type_signed.loc11_9, %.loc11_17.2 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_17.4: type = value_of_initializer %int.make_type_signed.loc11_14 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_17.5: type = converted %int.make_type_signed.loc11_14, %.loc11_17.4 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_17.6: type = converted %.loc11_17.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] +// CHECK:STDOUT: %i32.loc11_14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_17.1: %tuple.type.1 = tuple_literal (%i32.loc11_9, %i32.loc11_14) +// CHECK:STDOUT: %.loc11_17.2: type = converted %.loc11_17.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %a.var: ref %tuple.type.2 = var a // CHECK:STDOUT: %a: ref %tuple.type.2 = bind_name a, %a.var // CHECK:STDOUT: %int_32.loc18: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc18: init type = call constants.%Int(%int_32.loc18) [template = constants.%i32] -// CHECK:STDOUT: %.loc18_8.1: type = value_of_initializer %int.make_type_signed.loc18 [template = constants.%i32] -// CHECK:STDOUT: %.loc18_8.2: type = converted %int.make_type_signed.loc18, %.loc18_8.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc18: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %b.var: ref %i32 = var b // CHECK:STDOUT: %b: ref %i32 = bind_name b, %b.var // CHECK:STDOUT: } @@ -84,14 +76,14 @@ var b: i32 = a.(2.6); // CHECK:STDOUT: %int_12: Core.IntLiteral = int_value 12 [template = constants.%int_12.1] // CHECK:STDOUT: %int_6: Core.IntLiteral = int_value 6 [template = constants.%int_6.1] // CHECK:STDOUT: %.loc11_27.1: %tuple.type.3 = tuple_literal (%int_12, %int_6) -// CHECK:STDOUT: %impl.elem0.loc11_27.1: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc11_27.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_27.1: = bound_method %int_12, %impl.elem0.loc11_27.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc11_27.1: = specific_function %Convert.bound.loc11_27.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc11_27.1: init %i32 = call %Convert.specific_fn.loc11_27.1(%int_12) [template = constants.%int_12.2] // CHECK:STDOUT: %.loc11_27.2: init %i32 = converted %int_12, %int.convert_checked.loc11_27.1 [template = constants.%int_12.2] // CHECK:STDOUT: %tuple.elem0: ref %i32 = tuple_access file.%a.var, element0 // CHECK:STDOUT: %.loc11_27.3: init %i32 = initialize_from %.loc11_27.2 to %tuple.elem0 [template = constants.%int_12.2] -// CHECK:STDOUT: %impl.elem0.loc11_27.2: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc11_27.2: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_27.2: = bound_method %int_6, %impl.elem0.loc11_27.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc11_27.2: = specific_function %Convert.bound.loc11_27.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc11_27.2: init %i32 = call %Convert.specific_fn.loc11_27.2(%int_6) [template = constants.%int_6.2] diff --git a/toolchain/check/testdata/tuple/access/fail_non_tuple_access.carbon b/toolchain/check/testdata/tuple/access/fail_non_tuple_access.carbon index 7be990376482c..9ea058c14ccd7 100644 --- a/toolchain/check/testdata/tuple/access/fail_non_tuple_access.carbon +++ b/toolchain/check/testdata/tuple/access/fail_non_tuple_access.carbon @@ -30,18 +30,16 @@ fn Main() { // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %array_type: type = array_type %int_2, %i32 [template] // CHECK:STDOUT: %int_5.1: Core.IntLiteral = int_value 5 [template] // CHECK:STDOUT: %tuple.type: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_5.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound: = bound_method %int_5.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_5.2: %i32 = int_value 5 [template] // CHECK:STDOUT: %array: %array_type = tuple_value (%int_5.2, %int_5.2) [template] @@ -51,7 +49,7 @@ fn Main() { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .IndexWith = %import_ref.1 // CHECK:STDOUT: .Int = %import_ref.6 -// CHECK:STDOUT: .ImplicitAs = %import_ref.7 +// CHECK:STDOUT: .ImplicitAs = %import_ref.10 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -71,17 +69,15 @@ fn Main() { // CHECK:STDOUT: %int_0.loc16: Core.IntLiteral = int_value 0 [template = constants.%int_0] // CHECK:STDOUT: %int_1.loc16: Core.IntLiteral = int_value 1 [template = constants.%int_1] // CHECK:STDOUT: %int_32.loc18: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc18: init type = call constants.%Int(%int_32.loc18) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc18: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2] -// CHECK:STDOUT: %.loc18_19.1: type = value_of_initializer %int.make_type_signed.loc18 [template = constants.%i32] -// CHECK:STDOUT: %.loc18_19.2: type = converted %int.make_type_signed.loc18, %.loc18_19.1 [template = constants.%i32] // CHECK:STDOUT: %array_type: type = array_type %int_2, %i32 [template = constants.%array_type] // CHECK:STDOUT: %non_tuple.var: ref %array_type = var non_tuple // CHECK:STDOUT: %non_tuple: ref %array_type = bind_name non_tuple, %non_tuple.var // CHECK:STDOUT: %int_5.loc18_30: Core.IntLiteral = int_value 5 [template = constants.%int_5.1] // CHECK:STDOUT: %int_5.loc18_33: Core.IntLiteral = int_value 5 [template = constants.%int_5.1] // CHECK:STDOUT: %.loc18_34.1: %tuple.type = tuple_literal (%int_5.loc18_30, %int_5.loc18_33) -// CHECK:STDOUT: %impl.elem0.loc18_34.1: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc18_34.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc18_34.1: = bound_method %int_5.loc18_30, %impl.elem0.loc18_34.1 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn.loc18_34.1: = specific_function %Convert.bound.loc18_34.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc18_34.1: init %i32 = call %Convert.specific_fn.loc18_34.1(%int_5.loc18_30) [template = constants.%int_5.2] @@ -89,7 +85,7 @@ fn Main() { // CHECK:STDOUT: %int_0.loc18: Core.IntLiteral = int_value 0 [template = constants.%int_0] // CHECK:STDOUT: %.loc18_34.3: ref %i32 = array_index %non_tuple.var, %int_0.loc18 // CHECK:STDOUT: %.loc18_34.4: init %i32 = initialize_from %.loc18_34.2 to %.loc18_34.3 [template = constants.%int_5.2] -// CHECK:STDOUT: %impl.elem0.loc18_34.2: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc18_34.2: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc18_34.2: = bound_method %int_5.loc18_33, %impl.elem0.loc18_34.2 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn.loc18_34.2: = specific_function %Convert.bound.loc18_34.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc18_34.2: init %i32 = call %Convert.specific_fn.loc18_34.2(%int_5.loc18_33) [template = constants.%int_5.2] @@ -101,9 +97,7 @@ fn Main() { // CHECK:STDOUT: %.loc18_35: init %array_type = converted %.loc18_34.1, %.loc18_34.8 [template = constants.%array] // CHECK:STDOUT: assign %non_tuple.var, %.loc18_35 // CHECK:STDOUT: %int_32.loc22: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc22: init type = call constants.%Int(%int_32.loc22) [template = constants.%i32] -// CHECK:STDOUT: %.loc22_14.1: type = value_of_initializer %int.make_type_signed.loc22 [template = constants.%i32] -// CHECK:STDOUT: %.loc22_14.2: type = converted %int.make_type_signed.loc22, %.loc22_14.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %first.var: ref %i32 = var first // CHECK:STDOUT: %first: ref %i32 = bind_name first, %first.var // CHECK:STDOUT: %non_tuple.ref: ref %array_type = name_ref non_tuple, %non_tuple diff --git a/toolchain/check/testdata/tuple/access/fail_out_of_bound_access.carbon b/toolchain/check/testdata/tuple/access/fail_out_of_bound_access.carbon index f17a1a2175185..4e42dbddd9391 100644 --- a/toolchain/check/testdata/tuple/access/fail_out_of_bound_access.carbon +++ b/toolchain/check/testdata/tuple/access/fail_out_of_bound_access.carbon @@ -18,22 +18,20 @@ var b: i32 = a.2; // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (type, type) [template] // CHECK:STDOUT: %tuple.type.2: type = tuple_type (%i32, %i32) [template] // CHECK:STDOUT: %int_12.1: Core.IntLiteral = int_value 12 [template] // CHECK:STDOUT: %int_6.1: Core.IntLiteral = int_value 6 [template] // CHECK:STDOUT: %tuple.type.3: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_12.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_12.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_12.2: %i32 = int_value 12 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_6.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_6.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_6.2: %i32 = int_value 6 [template] // CHECK:STDOUT: %tuple: %tuple.type.2 = tuple_value (%int_12.2, %int_6.2) [template] @@ -43,7 +41,7 @@ var b: i32 = a.2; // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -57,21 +55,15 @@ var b: i32 = a.2; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int_32.loc11_9: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11_9: init type = call constants.%Int(%int_32.loc11_9) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc11_9: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc11_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11_14: init type = call constants.%Int(%int_32.loc11_14) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_17.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc11_9, %int.make_type_signed.loc11_14) -// CHECK:STDOUT: %.loc11_17.2: type = value_of_initializer %int.make_type_signed.loc11_9 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_17.3: type = converted %int.make_type_signed.loc11_9, %.loc11_17.2 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_17.4: type = value_of_initializer %int.make_type_signed.loc11_14 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_17.5: type = converted %int.make_type_signed.loc11_14, %.loc11_17.4 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_17.6: type = converted %.loc11_17.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] +// CHECK:STDOUT: %i32.loc11_14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_17.1: %tuple.type.1 = tuple_literal (%i32.loc11_9, %i32.loc11_14) +// CHECK:STDOUT: %.loc11_17.2: type = converted %.loc11_17.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %a.var: ref %tuple.type.2 = var a // CHECK:STDOUT: %a: ref %tuple.type.2 = bind_name a, %a.var // CHECK:STDOUT: %int_32.loc15: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc15: init type = call constants.%Int(%int_32.loc15) [template = constants.%i32] -// CHECK:STDOUT: %.loc15_8.1: type = value_of_initializer %int.make_type_signed.loc15 [template = constants.%i32] -// CHECK:STDOUT: %.loc15_8.2: type = converted %int.make_type_signed.loc15, %.loc15_8.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc15: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %b.var: ref %i32 = var b // CHECK:STDOUT: %b: ref %i32 = bind_name b, %b.var // CHECK:STDOUT: } @@ -81,14 +73,14 @@ var b: i32 = a.2; // CHECK:STDOUT: %int_12: Core.IntLiteral = int_value 12 [template = constants.%int_12.1] // CHECK:STDOUT: %int_6: Core.IntLiteral = int_value 6 [template = constants.%int_6.1] // CHECK:STDOUT: %.loc11_27.1: %tuple.type.3 = tuple_literal (%int_12, %int_6) -// CHECK:STDOUT: %impl.elem0.loc11_27.1: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc11_27.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_27.1: = bound_method %int_12, %impl.elem0.loc11_27.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc11_27.1: = specific_function %Convert.bound.loc11_27.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc11_27.1: init %i32 = call %Convert.specific_fn.loc11_27.1(%int_12) [template = constants.%int_12.2] // CHECK:STDOUT: %.loc11_27.2: init %i32 = converted %int_12, %int.convert_checked.loc11_27.1 [template = constants.%int_12.2] // CHECK:STDOUT: %tuple.elem0: ref %i32 = tuple_access file.%a.var, element0 // CHECK:STDOUT: %.loc11_27.3: init %i32 = initialize_from %.loc11_27.2 to %tuple.elem0 [template = constants.%int_12.2] -// CHECK:STDOUT: %impl.elem0.loc11_27.2: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc11_27.2: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_27.2: = bound_method %int_6, %impl.elem0.loc11_27.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc11_27.2: = specific_function %Convert.bound.loc11_27.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc11_27.2: init %i32 = call %Convert.specific_fn.loc11_27.2(%int_6) [template = constants.%int_6.2] diff --git a/toolchain/check/testdata/tuple/access/fail_out_of_bound_not_literal.carbon b/toolchain/check/testdata/tuple/access/fail_out_of_bound_not_literal.carbon index 556bb27f69a88..6e1d4d68c4d1f 100644 --- a/toolchain/check/testdata/tuple/access/fail_out_of_bound_not_literal.carbon +++ b/toolchain/check/testdata/tuple/access/fail_out_of_bound_not_literal.carbon @@ -18,22 +18,20 @@ var b: i32 = a.({.index = 2}.index); // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (type, type) [template] // CHECK:STDOUT: %tuple.type.2: type = tuple_type (%i32, %i32) [template] // CHECK:STDOUT: %int_12.1: Core.IntLiteral = int_value 12 [template] // CHECK:STDOUT: %int_34.1: Core.IntLiteral = int_value 34 [template] // CHECK:STDOUT: %tuple.type.3: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_12.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_12.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_12.2: %i32 = int_value 12 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_34.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_34.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_34.2: %i32 = int_value 34 [template] // CHECK:STDOUT: %tuple: %tuple.type.2 = tuple_value (%int_12.2, %int_34.2) [template] @@ -45,7 +43,7 @@ var b: i32 = a.({.index = 2}.index); // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -59,21 +57,15 @@ var b: i32 = a.({.index = 2}.index); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int_32.loc11_9: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11_9: init type = call constants.%Int(%int_32.loc11_9) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc11_9: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc11_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11_14: init type = call constants.%Int(%int_32.loc11_14) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_17.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc11_9, %int.make_type_signed.loc11_14) -// CHECK:STDOUT: %.loc11_17.2: type = value_of_initializer %int.make_type_signed.loc11_9 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_17.3: type = converted %int.make_type_signed.loc11_9, %.loc11_17.2 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_17.4: type = value_of_initializer %int.make_type_signed.loc11_14 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_17.5: type = converted %int.make_type_signed.loc11_14, %.loc11_17.4 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_17.6: type = converted %.loc11_17.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] +// CHECK:STDOUT: %i32.loc11_14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_17.1: %tuple.type.1 = tuple_literal (%i32.loc11_9, %i32.loc11_14) +// CHECK:STDOUT: %.loc11_17.2: type = converted %.loc11_17.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %a.var: ref %tuple.type.2 = var a // CHECK:STDOUT: %a: ref %tuple.type.2 = bind_name a, %a.var // CHECK:STDOUT: %int_32.loc15: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc15: init type = call constants.%Int(%int_32.loc15) [template = constants.%i32] -// CHECK:STDOUT: %.loc15_8.1: type = value_of_initializer %int.make_type_signed.loc15 [template = constants.%i32] -// CHECK:STDOUT: %.loc15_8.2: type = converted %int.make_type_signed.loc15, %.loc15_8.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc15: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %b.var: ref %i32 = var b // CHECK:STDOUT: %b: ref %i32 = bind_name b, %b.var // CHECK:STDOUT: } @@ -83,14 +75,14 @@ var b: i32 = a.({.index = 2}.index); // CHECK:STDOUT: %int_12: Core.IntLiteral = int_value 12 [template = constants.%int_12.1] // CHECK:STDOUT: %int_34: Core.IntLiteral = int_value 34 [template = constants.%int_34.1] // CHECK:STDOUT: %.loc11_28.1: %tuple.type.3 = tuple_literal (%int_12, %int_34) -// CHECK:STDOUT: %impl.elem0.loc11_28.1: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc11_28.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_28.1: = bound_method %int_12, %impl.elem0.loc11_28.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc11_28.1: = specific_function %Convert.bound.loc11_28.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc11_28.1: init %i32 = call %Convert.specific_fn.loc11_28.1(%int_12) [template = constants.%int_12.2] // CHECK:STDOUT: %.loc11_28.2: init %i32 = converted %int_12, %int.convert_checked.loc11_28.1 [template = constants.%int_12.2] // CHECK:STDOUT: %tuple.elem0: ref %i32 = tuple_access file.%a.var, element0 // CHECK:STDOUT: %.loc11_28.3: init %i32 = initialize_from %.loc11_28.2 to %tuple.elem0 [template = constants.%int_12.2] -// CHECK:STDOUT: %impl.elem0.loc11_28.2: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc11_28.2: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_28.2: = bound_method %int_34, %impl.elem0.loc11_28.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc11_28.2: = specific_function %Convert.bound.loc11_28.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc11_28.2: init %i32 = call %Convert.specific_fn.loc11_28.2(%int_34) [template = constants.%int_34.2] diff --git a/toolchain/check/testdata/tuple/access/index_not_literal.carbon b/toolchain/check/testdata/tuple/access/index_not_literal.carbon index b3ae52b3e521f..6e45793f2a6c3 100644 --- a/toolchain/check/testdata/tuple/access/index_not_literal.carbon +++ b/toolchain/check/testdata/tuple/access/index_not_literal.carbon @@ -19,20 +19,18 @@ var d: i32 = a.({.index = 1 as i32}.index); // CHECK:STDOUT: %Bool.type: type = fn_type @Bool [template] // CHECK:STDOUT: %Bool: %Bool.type = struct_value () [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (type, type) [template] // CHECK:STDOUT: %tuple.type.2: type = tuple_type (bool, %i32) [template] // CHECK:STDOUT: %true: bool = bool_literal true [template] // CHECK:STDOUT: %int_34.1: Core.IntLiteral = int_value 34 [template] // CHECK:STDOUT: %tuple.type.3: type = tuple_type (bool, Core.IntLiteral) [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_34.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_34.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_34.2: %i32 = int_value 34 [template] // CHECK:STDOUT: %tuple: %tuple.type.2 = tuple_value (%true, %int_34.2) [template] @@ -40,33 +38,33 @@ var d: i32 = a.({.index = 1 as i32}.index); // CHECK:STDOUT: %struct_type.index.1: type = struct_type {.index: Core.IntLiteral} [template] // CHECK:STDOUT: %struct.1: %struct_type.index.1 = struct_value (%int_1.1) [template] // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] -// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.6, @As(%i32) [template] -// CHECK:STDOUT: %Convert.type.16: type = fn_type @Convert.7, @impl.5(%int_32) [template] -// CHECK:STDOUT: %Convert.16: %Convert.type.16 = struct_value () [template] -// CHECK:STDOUT: %interface.10: = interface_witness (%Convert.16) [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_0.1, %Convert.16 [template] -// CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.7(%int_32) [template] +// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.4, @As(%i32) [template] +// CHECK:STDOUT: %Convert.type.12: type = fn_type @Convert.5, @impl.3(%int_32) [template] +// CHECK:STDOUT: %Convert.12: %Convert.type.12 = struct_value () [template] +// CHECK:STDOUT: %interface.6: = interface_witness (%Convert.12) [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_0.1, %Convert.12 [template] +// CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.5(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] -// CHECK:STDOUT: %Convert.type.17: type = fn_type @Convert.4, @impl.3(%int_32) [template] -// CHECK:STDOUT: %Convert.17: %Convert.type.17 = struct_value () [template] -// CHECK:STDOUT: %interface.11: = interface_witness (%Convert.17) [template] -// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_0.2, %Convert.17 [template] -// CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.4(%int_32) [template] -// CHECK:STDOUT: %Convert.bound.4: = bound_method %int_1.1, %Convert.16 [template] -// CHECK:STDOUT: %Convert.specific_fn.4: = specific_function %Convert.bound.4, @Convert.7(%int_32) [template] +// CHECK:STDOUT: %Convert.type.13: type = fn_type @Convert.3, @impl.2(%int_32) [template] +// CHECK:STDOUT: %Convert.13: %Convert.type.13 = struct_value () [template] +// CHECK:STDOUT: %interface.7: = interface_witness (%Convert.13) [template] +// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_0.2, %Convert.13 [template] +// CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.3(%int_32) [template] +// CHECK:STDOUT: %Convert.bound.4: = bound_method %int_1.1, %Convert.12 [template] +// CHECK:STDOUT: %Convert.specific_fn.4: = specific_function %Convert.bound.4, @Convert.5(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] // CHECK:STDOUT: %struct_type.index.2: type = struct_type {.index: %i32} [template] // CHECK:STDOUT: %struct.2: %struct_type.index.2 = struct_value (%int_1.2) [template] -// CHECK:STDOUT: %Convert.bound.5: = bound_method %int_1.2, %Convert.17 [template] -// CHECK:STDOUT: %Convert.specific_fn.5: = specific_function %Convert.bound.5, @Convert.4(%int_32) [template] +// CHECK:STDOUT: %Convert.bound.5: = bound_method %int_1.2, %Convert.13 [template] +// CHECK:STDOUT: %Convert.specific_fn.5: = specific_function %Convert.bound.5, @Convert.3(%int_32) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Bool = %import_ref.1 // CHECK:STDOUT: .Int = %import_ref.2 -// CHECK:STDOUT: .ImplicitAs = %import_ref.3 -// CHECK:STDOUT: .As = %import_ref.39 +// CHECK:STDOUT: .ImplicitAs = %import_ref.6 +// CHECK:STDOUT: .As = %import_ref.194 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -83,19 +81,15 @@ var d: i32 = a.({.index = 1 as i32}.index); // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %bool.make_type.loc11: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %int_32.loc11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11: init type = call constants.%Int(%int_32.loc11) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_18.1: %tuple.type.1 = tuple_literal (%bool.make_type.loc11, %int.make_type_signed.loc11) +// CHECK:STDOUT: %i32.loc11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_18.1: %tuple.type.1 = tuple_literal (%bool.make_type.loc11, %i32.loc11) // CHECK:STDOUT: %.loc11_18.2: type = value_of_initializer %bool.make_type.loc11 [template = bool] // CHECK:STDOUT: %.loc11_18.3: type = converted %bool.make_type.loc11, %.loc11_18.2 [template = bool] -// CHECK:STDOUT: %.loc11_18.4: type = value_of_initializer %int.make_type_signed.loc11 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_18.5: type = converted %int.make_type_signed.loc11, %.loc11_18.4 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_18.6: type = converted %.loc11_18.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] +// CHECK:STDOUT: %.loc11_18.4: type = converted %.loc11_18.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %a.var: ref %tuple.type.2 = var a // CHECK:STDOUT: %a: ref %tuple.type.2 = bind_name a, %a.var // CHECK:STDOUT: %int_32.loc12: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc12: init type = call constants.%Int(%int_32.loc12) [template = constants.%i32] -// CHECK:STDOUT: %.loc12_8.1: type = value_of_initializer %int.make_type_signed.loc12 [template = constants.%i32] -// CHECK:STDOUT: %.loc12_8.2: type = converted %int.make_type_signed.loc12, %.loc12_8.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc12: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %b.var: ref %i32 = var b // CHECK:STDOUT: %b: ref %i32 = bind_name b, %b.var // CHECK:STDOUT: %bool.make_type.loc13: init type = call constants.%Bool() [template = bool] @@ -104,9 +98,7 @@ var d: i32 = a.({.index = 1 as i32}.index); // CHECK:STDOUT: %c.var: ref bool = var c // CHECK:STDOUT: %c: ref bool = bind_name c, %c.var // CHECK:STDOUT: %int_32.loc14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc14: init type = call constants.%Int(%int_32.loc14) [template = constants.%i32] -// CHECK:STDOUT: %.loc14_8.1: type = value_of_initializer %int.make_type_signed.loc14 [template = constants.%i32] -// CHECK:STDOUT: %.loc14_8.2: type = converted %int.make_type_signed.loc14, %.loc14_8.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %d.var: ref %i32 = var d // CHECK:STDOUT: %d: ref %i32 = bind_name d, %d.var // CHECK:STDOUT: } @@ -118,7 +110,7 @@ var d: i32 = a.({.index = 1 as i32}.index); // CHECK:STDOUT: %.loc11_31.1: %tuple.type.3 = tuple_literal (%true, %int_34) // CHECK:STDOUT: %tuple.elem0.loc11: ref bool = tuple_access file.%a.var, element0 // CHECK:STDOUT: %.loc11_31.2: init bool = initialize_from %true to %tuple.elem0.loc11 [template = constants.%true] -// CHECK:STDOUT: %impl.elem0.loc11: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc11: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11: = bound_method %int_34, %impl.elem0.loc11 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc11: = specific_function %Convert.bound.loc11, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc11: init %i32 = call %Convert.specific_fn.loc11(%int_34) [template = constants.%int_34.2] @@ -140,18 +132,16 @@ var d: i32 = a.({.index = 1 as i32}.index); // CHECK:STDOUT: %a.ref.loc13: ref %tuple.type.2 = name_ref a, file.%a // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %int_32.loc13: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc13: init type = call constants.%Int(%int_32.loc13) [template = constants.%i32] -// CHECK:STDOUT: %.loc13_23.1: type = value_of_initializer %int.make_type_signed.loc13 [template = constants.%i32] -// CHECK:STDOUT: %.loc13_23.2: type = converted %int.make_type_signed.loc13, %.loc13_23.1 [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc13_20.1: %Convert.type.15 = interface_witness_access constants.%interface.10, element0 [template = constants.%Convert.16] +// CHECK:STDOUT: %i32.loc13: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %impl.elem0.loc13_20.1: %Convert.type.11 = interface_witness_access constants.%interface.6, element0 [template = constants.%Convert.12] // CHECK:STDOUT: %Convert.bound.loc13_20.1: = bound_method %int_0, %impl.elem0.loc13_20.1 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc13_20.1: = specific_function %Convert.bound.loc13_20.1, @Convert.7(constants.%int_32) [template = constants.%Convert.specific_fn.2] +// CHECK:STDOUT: %Convert.specific_fn.loc13_20.1: = specific_function %Convert.bound.loc13_20.1, @Convert.5(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc13_20.1: init %i32 = call %Convert.specific_fn.loc13_20.1(%int_0) [template = constants.%int_0.2] // CHECK:STDOUT: %.loc13_20.1: %i32 = value_of_initializer %int.convert_checked.loc13_20.1 [template = constants.%int_0.2] // CHECK:STDOUT: %.loc13_20.2: %i32 = converted %int_0, %.loc13_20.1 [template = constants.%int_0.2] -// CHECK:STDOUT: %impl.elem0.loc13_20.2: %Convert.type.6 = interface_witness_access constants.%interface.11, element0 [template = constants.%Convert.17] +// CHECK:STDOUT: %impl.elem0.loc13_20.2: %Convert.type.5 = interface_witness_access constants.%interface.7, element0 [template = constants.%Convert.13] // CHECK:STDOUT: %Convert.bound.loc13_20.2: = bound_method %.loc13_20.2, %impl.elem0.loc13_20.2 [template = constants.%Convert.bound.3] -// CHECK:STDOUT: %Convert.specific_fn.loc13_20.2: = specific_function %Convert.bound.loc13_20.2, @Convert.4(constants.%int_32) [template = constants.%Convert.specific_fn.3] +// CHECK:STDOUT: %Convert.specific_fn.loc13_20.2: = specific_function %Convert.bound.loc13_20.2, @Convert.3(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc13_20.2: init Core.IntLiteral = call %Convert.specific_fn.loc13_20.2(%.loc13_20.2) [template = constants.%int_0.1] // CHECK:STDOUT: %.loc13_20.3: Core.IntLiteral = value_of_initializer %int.convert_checked.loc13_20.2 [template = constants.%int_0.1] // CHECK:STDOUT: %.loc13_20.4: Core.IntLiteral = converted %.loc13_20.2, %.loc13_20.3 [template = constants.%int_0.1] @@ -161,12 +151,10 @@ var d: i32 = a.({.index = 1 as i32}.index); // CHECK:STDOUT: %a.ref.loc14: ref %tuple.type.2 = name_ref a, file.%a // CHECK:STDOUT: %int_1.loc14: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_32.loc14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc14: init type = call constants.%Int(%int_32.loc14) [template = constants.%i32] -// CHECK:STDOUT: %.loc14_32.1: type = value_of_initializer %int.make_type_signed.loc14 [template = constants.%i32] -// CHECK:STDOUT: %.loc14_32.2: type = converted %int.make_type_signed.loc14, %.loc14_32.1 [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc14_29: %Convert.type.15 = interface_witness_access constants.%interface.10, element0 [template = constants.%Convert.16] +// CHECK:STDOUT: %i32.loc14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %impl.elem0.loc14_29: %Convert.type.11 = interface_witness_access constants.%interface.6, element0 [template = constants.%Convert.12] // CHECK:STDOUT: %Convert.bound.loc14_29: = bound_method %int_1.loc14, %impl.elem0.loc14_29 [template = constants.%Convert.bound.4] -// CHECK:STDOUT: %Convert.specific_fn.loc14_29: = specific_function %Convert.bound.loc14_29, @Convert.7(constants.%int_32) [template = constants.%Convert.specific_fn.4] +// CHECK:STDOUT: %Convert.specific_fn.loc14_29: = specific_function %Convert.bound.loc14_29, @Convert.5(constants.%int_32) [template = constants.%Convert.specific_fn.4] // CHECK:STDOUT: %int.convert_checked.loc14_29: init %i32 = call %Convert.specific_fn.loc14_29(%int_1.loc14) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc14_29.1: %i32 = value_of_initializer %int.convert_checked.loc14_29 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc14_29.2: %i32 = converted %int_1.loc14, %.loc14_29.1 [template = constants.%int_1.2] @@ -174,9 +162,9 @@ var d: i32 = a.({.index = 1 as i32}.index); // CHECK:STDOUT: %struct.loc14: %struct_type.index.2 = struct_value (%.loc14_29.2) [template = constants.%struct.2] // CHECK:STDOUT: %.loc14_35.2: %struct_type.index.2 = converted %.loc14_35.1, %struct.loc14 [template = constants.%struct.2] // CHECK:STDOUT: %.loc14_36.1: %i32 = struct_access %.loc14_35.2, element0 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc14_36: %Convert.type.6 = interface_witness_access constants.%interface.11, element0 [template = constants.%Convert.17] +// CHECK:STDOUT: %impl.elem0.loc14_36: %Convert.type.5 = interface_witness_access constants.%interface.7, element0 [template = constants.%Convert.13] // CHECK:STDOUT: %Convert.bound.loc14_36: = bound_method %.loc14_36.1, %impl.elem0.loc14_36 [template = constants.%Convert.bound.5] -// CHECK:STDOUT: %Convert.specific_fn.loc14_36: = specific_function %Convert.bound.loc14_36, @Convert.4(constants.%int_32) [template = constants.%Convert.specific_fn.5] +// CHECK:STDOUT: %Convert.specific_fn.loc14_36: = specific_function %Convert.bound.loc14_36, @Convert.3(constants.%int_32) [template = constants.%Convert.specific_fn.5] // CHECK:STDOUT: %int.convert_checked.loc14_36: init Core.IntLiteral = call %Convert.specific_fn.loc14_36(%.loc14_36.1) [template = constants.%int_1.1] // CHECK:STDOUT: %.loc14_36.2: Core.IntLiteral = value_of_initializer %int.convert_checked.loc14_36 [template = constants.%int_1.1] // CHECK:STDOUT: %.loc14_36.3: Core.IntLiteral = converted %.loc14_36.1, %.loc14_36.2 [template = constants.%int_1.1] diff --git a/toolchain/check/testdata/tuple/access/return_value_access.carbon b/toolchain/check/testdata/tuple/access/return_value_access.carbon index 0e09e23267bce..eeacb6305b0b5 100644 --- a/toolchain/check/testdata/tuple/access/return_value_access.carbon +++ b/toolchain/check/testdata/tuple/access/return_value_access.carbon @@ -18,9 +18,7 @@ fn Run() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (type) [template] // CHECK:STDOUT: %tuple.type.2: type = tuple_type (%i32) [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] @@ -28,10 +26,10 @@ fn Run() -> i32 { // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %tuple.type.3: type = tuple_type (Core.IntLiteral) [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] // CHECK:STDOUT: %tuple: %tuple.type.2 = tuple_value (%int_0.2) [template] @@ -42,7 +40,7 @@ fn Run() -> i32 { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -60,11 +58,9 @@ fn Run() -> i32 { // CHECK:STDOUT: %return.param_patt: %tuple.type.2 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_16.1: %tuple.type.1 = tuple_literal (%int.make_type_signed) -// CHECK:STDOUT: %.loc11_16.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc11_16.3: type = converted %int.make_type_signed, %.loc11_16.2 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_16.4: type = converted %.loc11_16.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_16.1: %tuple.type.1 = tuple_literal (%i32) +// CHECK:STDOUT: %.loc11_16.2: type = converted %.loc11_16.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %return.param: ref %tuple.type.2 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %tuple.type.2 = return_slot %return.param // CHECK:STDOUT: } @@ -73,23 +69,19 @@ fn Run() -> i32 { // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc13_13.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc13_13.2: type = converted %int.make_type_signed, %.loc13_13.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc13_17.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc13_17.2: type = converted %int.make_type_signed, %.loc13_17.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F() -> %tuple.type.2 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %.loc11_30.1: %tuple.type.3 = tuple_literal (%int_0) -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.2] diff --git a/toolchain/check/testdata/tuple/fail_assign_nested.carbon b/toolchain/check/testdata/tuple/fail_assign_nested.carbon index 2e6a766d03900..cb2450977b116 100644 --- a/toolchain/check/testdata/tuple/fail_assign_nested.carbon +++ b/toolchain/check/testdata/tuple/fail_assign_nested.carbon @@ -17,9 +17,7 @@ var x: ((i32, i32), (i32, i32)) = ((1, 2, 3), (4, 5, 6)); // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (type, type) [template] // CHECK:STDOUT: %tuple.type.2: type = tuple_type (%tuple.type.1, %tuple.type.1) [template] // CHECK:STDOUT: %tuple.type.3: type = tuple_type (%i32, %i32) [template] @@ -36,7 +34,7 @@ var x: ((i32, i32), (i32, i32)) = ((1, 2, 3), (4, 5, 6)); // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -49,27 +47,19 @@ var x: ((i32, i32), (i32, i32)) = ((1, 2, 3), (4, 5, 6)); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int_32.loc14_10: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc14_10: init type = call constants.%Int(%int_32.loc14_10) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc14_10: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc14_15: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc14_15: init type = call constants.%Int(%int_32.loc14_15) [template = constants.%i32] -// CHECK:STDOUT: %.loc14_18: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc14_10, %int.make_type_signed.loc14_15) +// CHECK:STDOUT: %i32.loc14_15: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc14_18: %tuple.type.1 = tuple_literal (%i32.loc14_10, %i32.loc14_15) // CHECK:STDOUT: %int_32.loc14_22: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc14_22: init type = call constants.%Int(%int_32.loc14_22) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc14_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc14_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc14_27: init type = call constants.%Int(%int_32.loc14_27) [template = constants.%i32] -// CHECK:STDOUT: %.loc14_30: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc14_22, %int.make_type_signed.loc14_27) +// CHECK:STDOUT: %i32.loc14_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc14_30: %tuple.type.1 = tuple_literal (%i32.loc14_22, %i32.loc14_27) // CHECK:STDOUT: %.loc14_31.1: %tuple.type.2 = tuple_literal (%.loc14_18, %.loc14_30) -// CHECK:STDOUT: %.loc14_31.2: type = value_of_initializer %int.make_type_signed.loc14_10 [template = constants.%i32] -// CHECK:STDOUT: %.loc14_31.3: type = converted %int.make_type_signed.loc14_10, %.loc14_31.2 [template = constants.%i32] -// CHECK:STDOUT: %.loc14_31.4: type = value_of_initializer %int.make_type_signed.loc14_15 [template = constants.%i32] -// CHECK:STDOUT: %.loc14_31.5: type = converted %int.make_type_signed.loc14_15, %.loc14_31.4 [template = constants.%i32] -// CHECK:STDOUT: %.loc14_31.6: type = converted %.loc14_18, constants.%tuple.type.3 [template = constants.%tuple.type.3] -// CHECK:STDOUT: %.loc14_31.7: type = value_of_initializer %int.make_type_signed.loc14_22 [template = constants.%i32] -// CHECK:STDOUT: %.loc14_31.8: type = converted %int.make_type_signed.loc14_22, %.loc14_31.7 [template = constants.%i32] -// CHECK:STDOUT: %.loc14_31.9: type = value_of_initializer %int.make_type_signed.loc14_27 [template = constants.%i32] -// CHECK:STDOUT: %.loc14_31.10: type = converted %int.make_type_signed.loc14_27, %.loc14_31.9 [template = constants.%i32] -// CHECK:STDOUT: %.loc14_31.11: type = converted %.loc14_30, constants.%tuple.type.3 [template = constants.%tuple.type.3] -// CHECK:STDOUT: %.loc14_31.12: type = converted %.loc14_31.1, constants.%tuple.type.4 [template = constants.%tuple.type.4] +// CHECK:STDOUT: %.loc14_31.2: type = converted %.loc14_18, constants.%tuple.type.3 [template = constants.%tuple.type.3] +// CHECK:STDOUT: %.loc14_31.3: type = converted %.loc14_30, constants.%tuple.type.3 [template = constants.%tuple.type.3] +// CHECK:STDOUT: %.loc14_31.4: type = converted %.loc14_31.1, constants.%tuple.type.4 [template = constants.%tuple.type.4] // CHECK:STDOUT: %x.var: ref %tuple.type.4 = var x // CHECK:STDOUT: %x: ref %tuple.type.4 = bind_name x, %x.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/tuple/fail_element_type_mismatch.carbon b/toolchain/check/testdata/tuple/fail_element_type_mismatch.carbon index d211e442a27ed..e90255e4e7138 100644 --- a/toolchain/check/testdata/tuple/fail_element_type_mismatch.carbon +++ b/toolchain/check/testdata/tuple/fail_element_type_mismatch.carbon @@ -20,19 +20,17 @@ var x: (i32, i32) = (2, 65.89); // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (type, type) [template] // CHECK:STDOUT: %tuple.type.2: type = tuple_type (%i32, %i32) [template] // CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %float: f64 = float_literal 65.890000000000001 [template] // CHECK:STDOUT: %tuple.type.3: type = tuple_type (Core.IntLiteral, f64) [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_2.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound: = bound_method %int_2.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] // CHECK:STDOUT: } @@ -40,7 +38,7 @@ var x: (i32, i32) = (2, 65.89); // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -53,15 +51,11 @@ var x: (i32, i32) = (2, 65.89); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int_32.loc17_9: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc17_9: init type = call constants.%Int(%int_32.loc17_9) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc17_9: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc17_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc17_14: init type = call constants.%Int(%int_32.loc17_14) [template = constants.%i32] -// CHECK:STDOUT: %.loc17_17.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc17_9, %int.make_type_signed.loc17_14) -// CHECK:STDOUT: %.loc17_17.2: type = value_of_initializer %int.make_type_signed.loc17_9 [template = constants.%i32] -// CHECK:STDOUT: %.loc17_17.3: type = converted %int.make_type_signed.loc17_9, %.loc17_17.2 [template = constants.%i32] -// CHECK:STDOUT: %.loc17_17.4: type = value_of_initializer %int.make_type_signed.loc17_14 [template = constants.%i32] -// CHECK:STDOUT: %.loc17_17.5: type = converted %int.make_type_signed.loc17_14, %.loc17_17.4 [template = constants.%i32] -// CHECK:STDOUT: %.loc17_17.6: type = converted %.loc17_17.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] +// CHECK:STDOUT: %i32.loc17_14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc17_17.1: %tuple.type.1 = tuple_literal (%i32.loc17_9, %i32.loc17_14) +// CHECK:STDOUT: %.loc17_17.2: type = converted %.loc17_17.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %x.var: ref %tuple.type.2 = var x // CHECK:STDOUT: %x: ref %tuple.type.2 = bind_name x, %x.var // CHECK:STDOUT: } @@ -71,7 +65,7 @@ var x: (i32, i32) = (2, 65.89); // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %float: f64 = float_literal 65.890000000000001 [template = constants.%float] // CHECK:STDOUT: %.loc17_30.1: %tuple.type.3 = tuple_literal (%int_2, %float) -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_2, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_2) [template = constants.%int_2.2] diff --git a/toolchain/check/testdata/tuple/fail_nested_incomplete.carbon b/toolchain/check/testdata/tuple/fail_nested_incomplete.carbon index bdff955232693..4db900e89f700 100644 --- a/toolchain/check/testdata/tuple/fail_nested_incomplete.carbon +++ b/toolchain/check/testdata/tuple/fail_nested_incomplete.carbon @@ -25,9 +25,7 @@ var p: Incomplete* = &t[1]; // CHECK:STDOUT: constants { // CHECK:STDOUT: %Incomplete: type = class_type @Incomplete [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (type, type) [template] // CHECK:STDOUT: %tuple.type.2: type = tuple_type (%i32, %Incomplete) [template] // CHECK:STDOUT: %ptr: type = ptr_type %Incomplete [template] @@ -36,7 +34,7 @@ var p: Incomplete* = &t[1]; // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -52,12 +50,10 @@ var p: Incomplete* = &t[1]; // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Incomplete.decl: type = class_decl @Incomplete [template = constants.%Incomplete] {} {} // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %Incomplete.ref.loc19: type = name_ref Incomplete, %Incomplete.decl [template = constants.%Incomplete] -// CHECK:STDOUT: %.loc19_24.1: %tuple.type.1 = tuple_literal (%int.make_type_signed, %Incomplete.ref.loc19) -// CHECK:STDOUT: %.loc19_24.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc19_24.3: type = converted %int.make_type_signed, %.loc19_24.2 [template = constants.%i32] -// CHECK:STDOUT: %.loc19_24.4: type = converted %.loc19_24.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] +// CHECK:STDOUT: %.loc19_24.1: %tuple.type.1 = tuple_literal (%i32, %Incomplete.ref.loc19) +// CHECK:STDOUT: %.loc19_24.2: type = converted %.loc19_24.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %t.var: ref = var t // CHECK:STDOUT: %t: ref = bind_name t, %t.var // CHECK:STDOUT: %Incomplete.ref.loc21: type = name_ref Incomplete, %Incomplete.decl [template = constants.%Incomplete] diff --git a/toolchain/check/testdata/tuple/fail_too_few_element.carbon b/toolchain/check/testdata/tuple/fail_too_few_element.carbon index b512d2be37d9e..386963a35ada7 100644 --- a/toolchain/check/testdata/tuple/fail_too_few_element.carbon +++ b/toolchain/check/testdata/tuple/fail_too_few_element.carbon @@ -17,9 +17,7 @@ var x: (i32, i32) = (2, ); // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (type, type) [template] // CHECK:STDOUT: %tuple.type.2: type = tuple_type (%i32, %i32) [template] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template] @@ -28,7 +26,7 @@ var x: (i32, i32) = (2, ); // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -41,15 +39,11 @@ var x: (i32, i32) = (2, ); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int_32.loc14_9: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc14_9: init type = call constants.%Int(%int_32.loc14_9) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc14_9: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc14_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc14_14: init type = call constants.%Int(%int_32.loc14_14) [template = constants.%i32] -// CHECK:STDOUT: %.loc14_17.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc14_9, %int.make_type_signed.loc14_14) -// CHECK:STDOUT: %.loc14_17.2: type = value_of_initializer %int.make_type_signed.loc14_9 [template = constants.%i32] -// CHECK:STDOUT: %.loc14_17.3: type = converted %int.make_type_signed.loc14_9, %.loc14_17.2 [template = constants.%i32] -// CHECK:STDOUT: %.loc14_17.4: type = value_of_initializer %int.make_type_signed.loc14_14 [template = constants.%i32] -// CHECK:STDOUT: %.loc14_17.5: type = converted %int.make_type_signed.loc14_14, %.loc14_17.4 [template = constants.%i32] -// CHECK:STDOUT: %.loc14_17.6: type = converted %.loc14_17.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] +// CHECK:STDOUT: %i32.loc14_14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc14_17.1: %tuple.type.1 = tuple_literal (%i32.loc14_9, %i32.loc14_14) +// CHECK:STDOUT: %.loc14_17.2: type = converted %.loc14_17.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %x.var: ref %tuple.type.2 = var x // CHECK:STDOUT: %x: ref %tuple.type.2 = bind_name x, %x.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/tuple/fail_type_assign.carbon b/toolchain/check/testdata/tuple/fail_type_assign.carbon index 34ba3ef294c86..b35fd146b08e3 100644 --- a/toolchain/check/testdata/tuple/fail_type_assign.carbon +++ b/toolchain/check/testdata/tuple/fail_type_assign.carbon @@ -20,9 +20,7 @@ var x: (i32, ) = (i32, ); // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (type) [template] // CHECK:STDOUT: %tuple.type.2: type = tuple_type (%i32) [template] // CHECK:STDOUT: } @@ -30,7 +28,7 @@ var x: (i32, ) = (i32, ); // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -43,11 +41,9 @@ var x: (i32, ) = (i32, ); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc17_14.1: %tuple.type.1 = tuple_literal (%int.make_type_signed) -// CHECK:STDOUT: %.loc17_14.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc17_14.3: type = converted %int.make_type_signed, %.loc17_14.2 [template = constants.%i32] -// CHECK:STDOUT: %.loc17_14.4: type = converted %.loc17_14.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc17_14.1: %tuple.type.1 = tuple_literal (%i32) +// CHECK:STDOUT: %.loc17_14.2: type = converted %.loc17_14.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %x.var: ref %tuple.type.2 = var x // CHECK:STDOUT: %x: ref %tuple.type.2 = bind_name x, %x.var // CHECK:STDOUT: } @@ -55,9 +51,9 @@ var x: (i32, ) = (i32, ); // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc17_24.1: %tuple.type.1 = tuple_literal (%int.make_type_signed) -// CHECK:STDOUT: %.loc17_24.2: %i32 = converted %int.make_type_signed, [template = ] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc17_24.1: %tuple.type.1 = tuple_literal (%i32) +// CHECK:STDOUT: %.loc17_24.2: %i32 = converted %i32, [template = ] // CHECK:STDOUT: assign file.%x.var, // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/tuple/import.carbon b/toolchain/check/testdata/tuple/import.carbon index 3b9242177e5da..32a90df4b979f 100644 --- a/toolchain/check/testdata/tuple/import.carbon +++ b/toolchain/check/testdata/tuple/import.carbon @@ -57,18 +57,16 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (type) [template] // CHECK:STDOUT: %tuple.type.2: type = tuple_type (%i32) [template] // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %tuple.type.3: type = tuple_type (Core.IntLiteral) [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_0.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] // CHECK:STDOUT: %tuple.1: %tuple.type.2 = tuple_value (%int_0.2) [template] @@ -84,14 +82,14 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %int_3.1: Core.IntLiteral = int_value 3 [template] // CHECK:STDOUT: %tuple.type.12: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [template] // CHECK:STDOUT: %tuple.type.13: type = tuple_type (%tuple.type.11, %tuple.type.12) [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] // CHECK:STDOUT: %tuple.2: %tuple.type.7 = tuple_value (%tuple.1, %int_1.2) [template] -// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_2.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_2.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] -// CHECK:STDOUT: %Convert.bound.4: = bound_method %int_3.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.4: = bound_method %int_3.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.4: = specific_function %Convert.bound.4, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_3.2: %i32 = int_value 3 [template] // CHECK:STDOUT: %tuple.3: %tuple.type.8 = tuple_value (%int_2.2, %int_3.2) [template] @@ -102,7 +100,7 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %C.generic: %C.type = struct_value () [template] // CHECK:STDOUT: %C.1: type = class_type @C, @C(%X) [symbolic] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] -// CHECK:STDOUT: %complete_type.3: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %complete_type.4: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %tuple.5: %tuple.type.8 = tuple_value (%int_1.2, %int_2.2) [template] // CHECK:STDOUT: %C.2: type = class_type @C, @C(%tuple.5) [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] @@ -112,7 +110,7 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -128,37 +126,27 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int_32.loc4: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc4: init type = call constants.%Int(%int_32.loc4) [template = constants.%i32] -// CHECK:STDOUT: %.loc4_17.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc4) -// CHECK:STDOUT: %.loc4_17.2: type = value_of_initializer %int.make_type_signed.loc4 [template = constants.%i32] -// CHECK:STDOUT: %.loc4_17.3: type = converted %int.make_type_signed.loc4, %.loc4_17.2 [template = constants.%i32] -// CHECK:STDOUT: %.loc4_17.4: type = converted %.loc4_17.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] +// CHECK:STDOUT: %i32.loc4: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc4_17.1: %tuple.type.1 = tuple_literal (%i32.loc4) +// CHECK:STDOUT: %.loc4_17.2: type = converted %.loc4_17.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %a_ref.var: ref %tuple.type.2 = var a_ref // CHECK:STDOUT: %a_ref: ref %tuple.type.2 = bind_name a_ref, %a_ref.var // CHECK:STDOUT: %int_32.loc5_15: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc5_15: init type = call constants.%Int(%int_32.loc5_15) [template = constants.%i32] -// CHECK:STDOUT: %.loc5_19: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc5_15) +// CHECK:STDOUT: %i32.loc5_15: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc5_19: %tuple.type.1 = tuple_literal (%i32.loc5_15) // CHECK:STDOUT: %int_32.loc5_22: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc5_22: init type = call constants.%Int(%int_32.loc5_22) [template = constants.%i32] -// CHECK:STDOUT: %.loc5_25: %tuple.type.4 = tuple_literal (%.loc5_19, %int.make_type_signed.loc5_22) +// CHECK:STDOUT: %i32.loc5_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc5_25: %tuple.type.4 = tuple_literal (%.loc5_19, %i32.loc5_22) // CHECK:STDOUT: %int_32.loc5_29: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc5_29: init type = call constants.%Int(%int_32.loc5_29) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc5_29: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc5_34: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc5_34: init type = call constants.%Int(%int_32.loc5_34) [template = constants.%i32] -// CHECK:STDOUT: %.loc5_37: %tuple.type.5 = tuple_literal (%int.make_type_signed.loc5_29, %int.make_type_signed.loc5_34) +// CHECK:STDOUT: %i32.loc5_34: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc5_37: %tuple.type.5 = tuple_literal (%i32.loc5_29, %i32.loc5_34) // CHECK:STDOUT: %.loc5_38.1: %tuple.type.6 = tuple_literal (%.loc5_25, %.loc5_37) -// CHECK:STDOUT: %.loc5_38.2: type = value_of_initializer %int.make_type_signed.loc5_15 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_38.3: type = converted %int.make_type_signed.loc5_15, %.loc5_38.2 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_38.4: type = converted %.loc5_19, constants.%tuple.type.2 [template = constants.%tuple.type.2] -// CHECK:STDOUT: %.loc5_38.5: type = value_of_initializer %int.make_type_signed.loc5_22 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_38.6: type = converted %int.make_type_signed.loc5_22, %.loc5_38.5 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_38.7: type = converted %.loc5_25, constants.%tuple.type.7 [template = constants.%tuple.type.7] -// CHECK:STDOUT: %.loc5_38.8: type = value_of_initializer %int.make_type_signed.loc5_29 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_38.9: type = converted %int.make_type_signed.loc5_29, %.loc5_38.8 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_38.10: type = value_of_initializer %int.make_type_signed.loc5_34 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_38.11: type = converted %int.make_type_signed.loc5_34, %.loc5_38.10 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_38.12: type = converted %.loc5_37, constants.%tuple.type.8 [template = constants.%tuple.type.8] -// CHECK:STDOUT: %.loc5_38.13: type = converted %.loc5_38.1, constants.%tuple.type.9 [template = constants.%tuple.type.9] +// CHECK:STDOUT: %.loc5_38.2: type = converted %.loc5_19, constants.%tuple.type.2 [template = constants.%tuple.type.2] +// CHECK:STDOUT: %.loc5_38.3: type = converted %.loc5_25, constants.%tuple.type.7 [template = constants.%tuple.type.7] +// CHECK:STDOUT: %.loc5_38.4: type = converted %.loc5_37, constants.%tuple.type.8 [template = constants.%tuple.type.8] +// CHECK:STDOUT: %.loc5_38.5: type = converted %.loc5_38.1, constants.%tuple.type.9 [template = constants.%tuple.type.9] // CHECK:STDOUT: %b_ref.var: ref %tuple.type.9 = var b_ref // CHECK:STDOUT: %b_ref: ref %tuple.type.9 = bind_name b_ref, %b_ref.var // CHECK:STDOUT: %C.decl: %C.type = class_decl @C [template = constants.%C.generic] { @@ -166,15 +154,11 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %X.param_patt: %tuple.type.8 = value_param_pattern %X.patt.loc7_9.1, runtime_param [symbolic = %X.patt.loc7_9.2 (constants.%X.patt)] // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc7_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc7_14: init type = call constants.%Int(%int_32.loc7_14) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc7_14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc7_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc7_19: init type = call constants.%Int(%int_32.loc7_19) [template = constants.%i32] -// CHECK:STDOUT: %.loc7_22.1: %tuple.type.5 = tuple_literal (%int.make_type_signed.loc7_14, %int.make_type_signed.loc7_19) -// CHECK:STDOUT: %.loc7_22.2: type = value_of_initializer %int.make_type_signed.loc7_14 [template = constants.%i32] -// CHECK:STDOUT: %.loc7_22.3: type = converted %int.make_type_signed.loc7_14, %.loc7_22.2 [template = constants.%i32] -// CHECK:STDOUT: %.loc7_22.4: type = value_of_initializer %int.make_type_signed.loc7_19 [template = constants.%i32] -// CHECK:STDOUT: %.loc7_22.5: type = converted %int.make_type_signed.loc7_19, %.loc7_22.4 [template = constants.%i32] -// CHECK:STDOUT: %.loc7_22.6: type = converted %.loc7_22.1, constants.%tuple.type.8 [template = constants.%tuple.type.8] +// CHECK:STDOUT: %i32.loc7_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc7_22.1: %tuple.type.5 = tuple_literal (%i32.loc7_14, %i32.loc7_19) +// CHECK:STDOUT: %.loc7_22.2: type = converted %.loc7_22.1, constants.%tuple.type.8 [template = constants.%tuple.type.8] // CHECK:STDOUT: %X.param: %tuple.type.8 = value_param runtime_param // CHECK:STDOUT: %X.loc7_9.1: %tuple.type.8 = bind_symbolic_name X, 0, %X.param [symbolic = %X.loc7_9.2 (constants.%X)] // CHECK:STDOUT: } @@ -186,13 +170,13 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %.loc9_18.1: %tuple.type.12 = tuple_literal (%int_1, %int_2) -// CHECK:STDOUT: %impl.elem0.loc9_18.1: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc9_18.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc9_18.1: = bound_method %int_1, %impl.elem0.loc9_18.1 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc9_18.1: = specific_function %Convert.bound.loc9_18.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc9_18.1: init %i32 = call %Convert.specific_fn.loc9_18.1(%int_1) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc9_18.2: %i32 = value_of_initializer %int.convert_checked.loc9_18.1 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc9_18.3: %i32 = converted %int_1, %.loc9_18.2 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc9_18.2: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc9_18.2: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc9_18.2: = bound_method %int_2, %impl.elem0.loc9_18.2 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc9_18.2: = specific_function %Convert.bound.loc9_18.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc9_18.2: init %i32 = call %Convert.specific_fn.loc9_18.2(%int_2) [template = constants.%int_2.2] @@ -213,7 +197,7 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: class { -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.3] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C.1 @@ -227,7 +211,7 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_0.loc4: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %.loc4_24.1: %tuple.type.3 = tuple_literal (%int_0.loc4) -// CHECK:STDOUT: %impl.elem0.loc4: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc4: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc4: = bound_method %int_0.loc4, %impl.elem0.loc4 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc4: = specific_function %Convert.bound.loc4, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc4: init %i32 = call %Convert.specific_fn.loc4(%int_0.loc4) [template = constants.%int_0.2] @@ -243,7 +227,7 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] // CHECK:STDOUT: %.loc5_59.1: %tuple.type.12 = tuple_literal (%int_2, %int_3) // CHECK:STDOUT: %.loc5_60.1: %tuple.type.13 = tuple_literal (%.loc5_51.1, %.loc5_59.1) -// CHECK:STDOUT: %impl.elem0.loc5_47: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc5_47: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc5_47: = bound_method %int_0.loc5, %impl.elem0.loc5_47 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc5_47: = specific_function %Convert.bound.loc5_47, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc5_47: init %i32 = call %Convert.specific_fn.loc5_47(%int_0.loc5) [template = constants.%int_0.2] @@ -253,7 +237,7 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %.loc5_47.3: init %tuple.type.2 = tuple_init (%.loc5_47.2) to %tuple.elem0.loc5_51 [template = constants.%tuple.1] // CHECK:STDOUT: %.loc5_51.2: init %tuple.type.2 = converted %.loc5_47.1, %.loc5_47.3 [template = constants.%tuple.1] // CHECK:STDOUT: %.loc5_51.3: init %tuple.type.2 = initialize_from %.loc5_51.2 to %tuple.elem0.loc5_51 [template = constants.%tuple.1] -// CHECK:STDOUT: %impl.elem0.loc5_51: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc5_51: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc5_51: = bound_method %int_1, %impl.elem0.loc5_51 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc5_51: = specific_function %Convert.bound.loc5_51, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc5_51: init %i32 = call %Convert.specific_fn.loc5_51(%int_1) [template = constants.%int_1.2] @@ -262,7 +246,7 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %.loc5_51.5: init %i32 = initialize_from %.loc5_51.4 to %tuple.elem1.loc5_51 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc5_51.6: init %tuple.type.7 = tuple_init (%.loc5_51.3, %.loc5_51.5) to %tuple.elem0.loc5_60 [template = constants.%tuple.2] // CHECK:STDOUT: %.loc5_60.2: init %tuple.type.7 = converted %.loc5_51.1, %.loc5_51.6 [template = constants.%tuple.2] -// CHECK:STDOUT: %impl.elem0.loc5_59.1: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc5_59.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc5_59.1: = bound_method %int_2, %impl.elem0.loc5_59.1 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc5_59.1: = specific_function %Convert.bound.loc5_59.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc5_59.1: init %i32 = call %Convert.specific_fn.loc5_59.1(%int_2) [template = constants.%int_2.2] @@ -270,7 +254,7 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %tuple.elem1.loc5_60: ref %tuple.type.8 = tuple_access file.%b_ref.var, element1 // CHECK:STDOUT: %tuple.elem0.loc5_59: ref %i32 = tuple_access %tuple.elem1.loc5_60, element0 // CHECK:STDOUT: %.loc5_59.3: init %i32 = initialize_from %.loc5_59.2 to %tuple.elem0.loc5_59 [template = constants.%int_2.2] -// CHECK:STDOUT: %impl.elem0.loc5_59.2: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc5_59.2: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc5_59.2: = bound_method %int_3, %impl.elem0.loc5_59.2 [template = constants.%Convert.bound.4] // CHECK:STDOUT: %Convert.specific_fn.loc5_59.2: = specific_function %Convert.bound.loc5_59.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.4] // CHECK:STDOUT: %int.convert_checked.loc5_59.2: init %i32 = call %Convert.specific_fn.loc5_59.2(%int_3) [template = constants.%int_3.2] @@ -299,9 +283,7 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (type) [template] // CHECK:STDOUT: %tuple.type.2: type = tuple_type (%i32) [template] // CHECK:STDOUT: %tuple.type.3: type = tuple_type (%tuple.type.1, type) [template] @@ -313,20 +295,20 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %C.type: type = generic_class_type @C [template] // CHECK:STDOUT: %C.generic: %C.type = struct_value () [template] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] -// CHECK:STDOUT: %complete_type.1: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %complete_type.3: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %X: %tuple.type.7 = bind_symbolic_name X, 0 [symbolic] // CHECK:STDOUT: %X.patt: %tuple.type.7 = symbolic_binding_pattern X, 0 [symbolic] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %tuple.type.10: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.type.13: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] // CHECK:STDOUT: %tuple: %tuple.type.7 = tuple_value (%int_1.2, %int_2.2) [template] @@ -341,13 +323,13 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %import_ref.3: %C.type = import_ref Implicit//default, C, loaded [template = constants.%C.generic] // CHECK:STDOUT: %import_ref.4: %F.type = import_ref Implicit//default, F, loaded [template = constants.%F] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref.39 -// CHECK:STDOUT: .ImplicitAs = %import_ref.42 +// CHECK:STDOUT: .Int = %import_ref.194 +// CHECK:STDOUT: .ImplicitAs = %import_ref.197 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.40: = import_ref Implicit//default, loc7_26, loaded [template = constants.%complete_type.1] -// CHECK:STDOUT: %import_ref.41 = import_ref Implicit//default, inst473 [no loc], unloaded +// CHECK:STDOUT: %import_ref.195: = import_ref Implicit//default, loc7_26, loaded [template = constants.%complete_type.3] +// CHECK:STDOUT: %import_ref.196 = import_ref Implicit//default, inst637 [no loc], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -365,50 +347,40 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int_32.loc4: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc4: init type = call constants.%Int(%int_32.loc4) [template = constants.%i32] -// CHECK:STDOUT: %.loc4_13.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc4) -// CHECK:STDOUT: %.loc4_13.2: type = value_of_initializer %int.make_type_signed.loc4 [template = constants.%i32] -// CHECK:STDOUT: %.loc4_13.3: type = converted %int.make_type_signed.loc4, %.loc4_13.2 [template = constants.%i32] -// CHECK:STDOUT: %.loc4_13.4: type = converted %.loc4_13.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] +// CHECK:STDOUT: %i32.loc4: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc4_13.1: %tuple.type.1 = tuple_literal (%i32.loc4) +// CHECK:STDOUT: %.loc4_13.2: type = converted %.loc4_13.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %a.var: ref %tuple.type.2 = var a // CHECK:STDOUT: %a: ref %tuple.type.2 = bind_name a, %a.var // CHECK:STDOUT: %int_32.loc5_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc5_11: init type = call constants.%Int(%int_32.loc5_11) [template = constants.%i32] -// CHECK:STDOUT: %.loc5_15: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc5_11) +// CHECK:STDOUT: %i32.loc5_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc5_15: %tuple.type.1 = tuple_literal (%i32.loc5_11) // CHECK:STDOUT: %int_32.loc5_18: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc5_18: init type = call constants.%Int(%int_32.loc5_18) [template = constants.%i32] -// CHECK:STDOUT: %.loc5_21: %tuple.type.3 = tuple_literal (%.loc5_15, %int.make_type_signed.loc5_18) +// CHECK:STDOUT: %i32.loc5_18: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc5_21: %tuple.type.3 = tuple_literal (%.loc5_15, %i32.loc5_18) // CHECK:STDOUT: %int_32.loc5_25: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc5_25: init type = call constants.%Int(%int_32.loc5_25) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc5_25: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc5_30: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc5_30: init type = call constants.%Int(%int_32.loc5_30) [template = constants.%i32] -// CHECK:STDOUT: %.loc5_33: %tuple.type.4 = tuple_literal (%int.make_type_signed.loc5_25, %int.make_type_signed.loc5_30) +// CHECK:STDOUT: %i32.loc5_30: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc5_33: %tuple.type.4 = tuple_literal (%i32.loc5_25, %i32.loc5_30) // CHECK:STDOUT: %.loc5_34.1: %tuple.type.5 = tuple_literal (%.loc5_21, %.loc5_33) -// CHECK:STDOUT: %.loc5_34.2: type = value_of_initializer %int.make_type_signed.loc5_11 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_34.3: type = converted %int.make_type_signed.loc5_11, %.loc5_34.2 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_34.4: type = converted %.loc5_15, constants.%tuple.type.2 [template = constants.%tuple.type.2] -// CHECK:STDOUT: %.loc5_34.5: type = value_of_initializer %int.make_type_signed.loc5_18 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_34.6: type = converted %int.make_type_signed.loc5_18, %.loc5_34.5 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_34.7: type = converted %.loc5_21, constants.%tuple.type.6 [template = constants.%tuple.type.6] -// CHECK:STDOUT: %.loc5_34.8: type = value_of_initializer %int.make_type_signed.loc5_25 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_34.9: type = converted %int.make_type_signed.loc5_25, %.loc5_34.8 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_34.10: type = value_of_initializer %int.make_type_signed.loc5_30 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_34.11: type = converted %int.make_type_signed.loc5_30, %.loc5_34.10 [template = constants.%i32] -// CHECK:STDOUT: %.loc5_34.12: type = converted %.loc5_33, constants.%tuple.type.7 [template = constants.%tuple.type.7] -// CHECK:STDOUT: %.loc5_34.13: type = converted %.loc5_34.1, constants.%tuple.type.8 [template = constants.%tuple.type.8] +// CHECK:STDOUT: %.loc5_34.2: type = converted %.loc5_15, constants.%tuple.type.2 [template = constants.%tuple.type.2] +// CHECK:STDOUT: %.loc5_34.3: type = converted %.loc5_21, constants.%tuple.type.6 [template = constants.%tuple.type.6] +// CHECK:STDOUT: %.loc5_34.4: type = converted %.loc5_33, constants.%tuple.type.7 [template = constants.%tuple.type.7] +// CHECK:STDOUT: %.loc5_34.5: type = converted %.loc5_34.1, constants.%tuple.type.8 [template = constants.%tuple.type.8] // CHECK:STDOUT: %b.var: ref %tuple.type.8 = var b // CHECK:STDOUT: %b: ref %tuple.type.8 = bind_name b, %b.var // CHECK:STDOUT: %C.ref: %C.type = name_ref C, imports.%import_ref.3 [template = constants.%C.generic] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %.loc6_15.1: %tuple.type.10 = tuple_literal (%int_1, %int_2) -// CHECK:STDOUT: %impl.elem0.loc6_15.1: %Convert.type.13 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc6_15.1: %Convert.type.9 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc6_15.1: = bound_method %int_1, %impl.elem0.loc6_15.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc6_15.1: = specific_function %Convert.bound.loc6_15.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc6_15.1: init %i32 = call %Convert.specific_fn.loc6_15.1(%int_1) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc6_15.2: %i32 = value_of_initializer %int.convert_checked.loc6_15.1 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc6_15.3: %i32 = converted %int_1, %.loc6_15.2 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc6_15.2: %Convert.type.13 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc6_15.2: %Convert.type.9 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc6_15.2: = bound_method %int_2, %impl.elem0.loc6_15.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc6_15.2: = specific_function %Convert.bound.loc6_15.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc6_15.2: init %i32 = call %Convert.specific_fn.loc6_15.2(%int_2) [template = constants.%int_2.2] @@ -429,8 +401,8 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: // CHECK:STDOUT: class { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.41 -// CHECK:STDOUT: complete_type_witness = imports.%import_ref.40 +// CHECK:STDOUT: .Self = imports.%import_ref.196 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.195 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -497,12 +469,12 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: --- fail_bad_type.impl.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %C.type: type = generic_class_type @C [template] // CHECK:STDOUT: %C.generic: %C.type = struct_value () [template] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %complete_type.3: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (%i32, %i32) [template] // CHECK:STDOUT: %X: %tuple.type.1 = bind_symbolic_name X, 0 [symbolic] // CHECK:STDOUT: %X.patt: %tuple.type.1 = symbolic_binding_pattern X, 0 [symbolic] @@ -527,8 +499,8 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.39: = import_ref Implicit//default, loc7_26, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.40 = import_ref Implicit//default, inst473 [no loc], unloaded +// CHECK:STDOUT: %import_ref.194: = import_ref Implicit//default, loc7_26, loaded [template = constants.%complete_type.3] +// CHECK:STDOUT: %import_ref.195 = import_ref Implicit//default, inst637 [no loc], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -560,8 +532,8 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: // CHECK:STDOUT: class { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.40 -// CHECK:STDOUT: complete_type_witness = imports.%import_ref.39 +// CHECK:STDOUT: .Self = imports.%import_ref.195 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.194 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -591,26 +563,26 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: --- fail_bad_value.impl.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %C.type: type = generic_class_type @C [template] // CHECK:STDOUT: %C.generic: %C.type = struct_value () [template] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] -// CHECK:STDOUT: %complete_type.1: = complete_type_witness %empty_struct_type [template] -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %complete_type.3: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (%i32, %i32) [template] // CHECK:STDOUT: %X: %tuple.type.1 = bind_symbolic_name X, 0 [symbolic] // CHECK:STDOUT: %X.patt: %tuple.type.1 = symbolic_binding_pattern X, 0 [symbolic] // CHECK:STDOUT: %int_3.1: Core.IntLiteral = int_value 3 [template] // CHECK:STDOUT: %int_4.1: Core.IntLiteral = int_value 4 [template] // CHECK:STDOUT: %tuple.type.2: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.type.13: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_3.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_3.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_3.2: %i32 = int_value 3 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_4.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_4.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_4.2: %i32 = int_value 4 [template] // CHECK:STDOUT: %tuple.1: %tuple.type.1 = tuple_value (%int_3.2, %int_4.2) [template] @@ -629,12 +601,12 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %import_ref.3: %C.type = import_ref Implicit//default, C, loaded [template = constants.%C.generic] // CHECK:STDOUT: %import_ref.4: %F.type = import_ref Implicit//default, F, loaded [template = constants.%F] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .ImplicitAs = %import_ref.41 +// CHECK:STDOUT: .ImplicitAs = %import_ref.196 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.39: = import_ref Implicit//default, loc7_26, loaded [template = constants.%complete_type.1] -// CHECK:STDOUT: %import_ref.40 = import_ref Implicit//default, inst473 [no loc], unloaded +// CHECK:STDOUT: %import_ref.194: = import_ref Implicit//default, loc7_26, loaded [template = constants.%complete_type.3] +// CHECK:STDOUT: %import_ref.195 = import_ref Implicit//default, inst637 [no loc], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -653,13 +625,13 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] // CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [template = constants.%int_4.1] // CHECK:STDOUT: %.loc10_19.1: %tuple.type.2 = tuple_literal (%int_3, %int_4) -// CHECK:STDOUT: %impl.elem0.loc10_19.1: %Convert.type.13 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc10_19.1: %Convert.type.9 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc10_19.1: = bound_method %int_3, %impl.elem0.loc10_19.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc10_19.1: = specific_function %Convert.bound.loc10_19.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc10_19.1: init %i32 = call %Convert.specific_fn.loc10_19.1(%int_3) [template = constants.%int_3.2] // CHECK:STDOUT: %.loc10_19.2: %i32 = value_of_initializer %int.convert_checked.loc10_19.1 [template = constants.%int_3.2] // CHECK:STDOUT: %.loc10_19.3: %i32 = converted %int_3, %.loc10_19.2 [template = constants.%int_3.2] -// CHECK:STDOUT: %impl.elem0.loc10_19.2: %Convert.type.13 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc10_19.2: %Convert.type.9 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc10_19.2: = bound_method %int_4, %impl.elem0.loc10_19.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc10_19.2: = specific_function %Convert.bound.loc10_19.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc10_19.2: init %i32 = call %Convert.specific_fn.loc10_19.2(%int_4) [template = constants.%int_4.2] @@ -680,8 +652,8 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: // CHECK:STDOUT: class { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.40 -// CHECK:STDOUT: complete_type_witness = imports.%import_ref.39 +// CHECK:STDOUT: .Self = imports.%import_ref.195 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.194 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/tuple/nested_tuple.carbon b/toolchain/check/testdata/tuple/nested_tuple.carbon index 171527e50217a..1ead3759c074c 100644 --- a/toolchain/check/testdata/tuple/nested_tuple.carbon +++ b/toolchain/check/testdata/tuple/nested_tuple.carbon @@ -14,9 +14,7 @@ var x: ((i32, i32), i32) = ((12, 76), 6); // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (type, type) [template] // CHECK:STDOUT: %tuple.type.2: type = tuple_type (%tuple.type.1, type) [template] // CHECK:STDOUT: %tuple.type.3: type = tuple_type (%i32, %i32) [template] @@ -27,17 +25,17 @@ var x: ((i32, i32), i32) = ((12, 76), 6); // CHECK:STDOUT: %int_6.1: Core.IntLiteral = int_value 6 [template] // CHECK:STDOUT: %tuple.type.7: type = tuple_type (%tuple.type.6, Core.IntLiteral) [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_12.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_12.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_12.2: %i32 = int_value 12 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_76.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_76.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_76.2: %i32 = int_value 76 [template] // CHECK:STDOUT: %tuple.1: %tuple.type.3 = tuple_value (%int_12.2, %int_76.2) [template] -// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_6.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_6.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_6.2: %i32 = int_value 6 [template] // CHECK:STDOUT: %tuple.2: %tuple.type.4 = tuple_value (%tuple.1, %int_6.2) [template] @@ -46,7 +44,7 @@ var x: ((i32, i32), i32) = ((12, 76), 6); // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -59,21 +57,15 @@ var x: ((i32, i32), i32) = ((12, 76), 6); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int_32.loc11_10: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11_10: init type = call constants.%Int(%int_32.loc11_10) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc11_10: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc11_15: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11_15: init type = call constants.%Int(%int_32.loc11_15) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_18: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc11_10, %int.make_type_signed.loc11_15) +// CHECK:STDOUT: %i32.loc11_15: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_18: %tuple.type.1 = tuple_literal (%i32.loc11_10, %i32.loc11_15) // CHECK:STDOUT: %int_32.loc11_21: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11_21: init type = call constants.%Int(%int_32.loc11_21) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_24.1: %tuple.type.2 = tuple_literal (%.loc11_18, %int.make_type_signed.loc11_21) -// CHECK:STDOUT: %.loc11_24.2: type = value_of_initializer %int.make_type_signed.loc11_10 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_24.3: type = converted %int.make_type_signed.loc11_10, %.loc11_24.2 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_24.4: type = value_of_initializer %int.make_type_signed.loc11_15 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_24.5: type = converted %int.make_type_signed.loc11_15, %.loc11_24.4 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_24.6: type = converted %.loc11_18, constants.%tuple.type.3 [template = constants.%tuple.type.3] -// CHECK:STDOUT: %.loc11_24.7: type = value_of_initializer %int.make_type_signed.loc11_21 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_24.8: type = converted %int.make_type_signed.loc11_21, %.loc11_24.7 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_24.9: type = converted %.loc11_24.1, constants.%tuple.type.4 [template = constants.%tuple.type.4] +// CHECK:STDOUT: %i32.loc11_21: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_24.1: %tuple.type.2 = tuple_literal (%.loc11_18, %i32.loc11_21) +// CHECK:STDOUT: %.loc11_24.2: type = converted %.loc11_18, constants.%tuple.type.3 [template = constants.%tuple.type.3] +// CHECK:STDOUT: %.loc11_24.3: type = converted %.loc11_24.1, constants.%tuple.type.4 [template = constants.%tuple.type.4] // CHECK:STDOUT: %x.var: ref %tuple.type.4 = var x // CHECK:STDOUT: %x: ref %tuple.type.4 = bind_name x, %x.var // CHECK:STDOUT: } @@ -85,7 +77,7 @@ var x: ((i32, i32), i32) = ((12, 76), 6); // CHECK:STDOUT: %.loc11_36.1: %tuple.type.6 = tuple_literal (%int_12, %int_76) // CHECK:STDOUT: %int_6: Core.IntLiteral = int_value 6 [template = constants.%int_6.1] // CHECK:STDOUT: %.loc11_40.1: %tuple.type.7 = tuple_literal (%.loc11_36.1, %int_6) -// CHECK:STDOUT: %impl.elem0.loc11_36.1: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc11_36.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_36.1: = bound_method %int_12, %impl.elem0.loc11_36.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc11_36.1: = specific_function %Convert.bound.loc11_36.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc11_36.1: init %i32 = call %Convert.specific_fn.loc11_36.1(%int_12) [template = constants.%int_12.2] @@ -93,7 +85,7 @@ var x: ((i32, i32), i32) = ((12, 76), 6); // CHECK:STDOUT: %tuple.elem0.loc11_40: ref %tuple.type.3 = tuple_access file.%x.var, element0 // CHECK:STDOUT: %tuple.elem0.loc11_36: ref %i32 = tuple_access %tuple.elem0.loc11_40, element0 // CHECK:STDOUT: %.loc11_36.3: init %i32 = initialize_from %.loc11_36.2 to %tuple.elem0.loc11_36 [template = constants.%int_12.2] -// CHECK:STDOUT: %impl.elem0.loc11_36.2: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc11_36.2: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_36.2: = bound_method %int_76, %impl.elem0.loc11_36.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc11_36.2: = specific_function %Convert.bound.loc11_36.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc11_36.2: init %i32 = call %Convert.specific_fn.loc11_36.2(%int_76) [template = constants.%int_76.2] @@ -102,7 +94,7 @@ var x: ((i32, i32), i32) = ((12, 76), 6); // CHECK:STDOUT: %.loc11_36.5: init %i32 = initialize_from %.loc11_36.4 to %tuple.elem1.loc11_36 [template = constants.%int_76.2] // CHECK:STDOUT: %.loc11_36.6: init %tuple.type.3 = tuple_init (%.loc11_36.3, %.loc11_36.5) to %tuple.elem0.loc11_40 [template = constants.%tuple.1] // CHECK:STDOUT: %.loc11_40.2: init %tuple.type.3 = converted %.loc11_36.1, %.loc11_36.6 [template = constants.%tuple.1] -// CHECK:STDOUT: %impl.elem0.loc11_40: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc11_40: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_40: = bound_method %int_6, %impl.elem0.loc11_40 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc11_40: = specific_function %Convert.bound.loc11_40, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc11_40: init %i32 = call %Convert.specific_fn.loc11_40(%int_6) [template = constants.%int_6.2] diff --git a/toolchain/check/testdata/tuple/nested_tuple_in_place.carbon b/toolchain/check/testdata/tuple/nested_tuple_in_place.carbon index 1fae1ef7835b7..3b9604201bf26 100644 --- a/toolchain/check/testdata/tuple/nested_tuple_in_place.carbon +++ b/toolchain/check/testdata/tuple/nested_tuple_in_place.carbon @@ -22,9 +22,7 @@ fn H() { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (type, type, type) [template] // CHECK:STDOUT: %tuple.type.2: type = tuple_type (%i32, %i32, %i32) [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] @@ -41,13 +39,13 @@ fn H() { // CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %tuple.type.9: type = tuple_type (Core.IntLiteral, %tuple.type.2, Core.IntLiteral) [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] // CHECK:STDOUT: } @@ -55,7 +53,7 @@ fn H() { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -74,19 +72,13 @@ fn H() { // CHECK:STDOUT: %return.param_patt: %tuple.type.2 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32.loc11_12: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11_12: init type = call constants.%Int(%int_32.loc11_12) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc11_12: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc11_17: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11_17: init type = call constants.%Int(%int_32.loc11_17) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc11_17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc11_22: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11_22: init type = call constants.%Int(%int_32.loc11_22) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_25.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc11_12, %int.make_type_signed.loc11_17, %int.make_type_signed.loc11_22) -// CHECK:STDOUT: %.loc11_25.2: type = value_of_initializer %int.make_type_signed.loc11_12 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_25.3: type = converted %int.make_type_signed.loc11_12, %.loc11_25.2 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_25.4: type = value_of_initializer %int.make_type_signed.loc11_17 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_25.5: type = converted %int.make_type_signed.loc11_17, %.loc11_25.4 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_25.6: type = value_of_initializer %int.make_type_signed.loc11_22 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_25.7: type = converted %int.make_type_signed.loc11_22, %.loc11_25.6 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_25.8: type = converted %.loc11_25.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] +// CHECK:STDOUT: %i32.loc11_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_25.1: %tuple.type.1 = tuple_literal (%i32.loc11_12, %i32.loc11_17, %i32.loc11_22) +// CHECK:STDOUT: %.loc11_25.2: type = converted %.loc11_25.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %return.param: ref %tuple.type.2 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %tuple.type.2 = return_slot %return.param // CHECK:STDOUT: } @@ -99,35 +91,23 @@ fn H() { // CHECK:STDOUT: fn @G() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_32.loc14_12: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc14_12: init type = call constants.%Int(%int_32.loc14_12) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc14_12: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc14_17: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc14_17: init type = call constants.%Int(%int_32.loc14_17) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc14_17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc14_22: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc14_22: init type = call constants.%Int(%int_32.loc14_22) [template = constants.%i32] -// CHECK:STDOUT: %.loc14_25: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc14_12, %int.make_type_signed.loc14_17, %int.make_type_signed.loc14_22) +// CHECK:STDOUT: %i32.loc14_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc14_25: %tuple.type.1 = tuple_literal (%i32.loc14_12, %i32.loc14_17, %i32.loc14_22) // CHECK:STDOUT: %int_32.loc14_29: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc14_29: init type = call constants.%Int(%int_32.loc14_29) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc14_29: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc14_34: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc14_34: init type = call constants.%Int(%int_32.loc14_34) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc14_34: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc14_39: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc14_39: init type = call constants.%Int(%int_32.loc14_39) [template = constants.%i32] -// CHECK:STDOUT: %.loc14_42: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc14_29, %int.make_type_signed.loc14_34, %int.make_type_signed.loc14_39) +// CHECK:STDOUT: %i32.loc14_39: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc14_42: %tuple.type.1 = tuple_literal (%i32.loc14_29, %i32.loc14_34, %i32.loc14_39) // CHECK:STDOUT: %.loc14_43.1: %tuple.type.3 = tuple_literal (%.loc14_25, %.loc14_42) -// CHECK:STDOUT: %.loc14_43.2: type = value_of_initializer %int.make_type_signed.loc14_12 [template = constants.%i32] -// CHECK:STDOUT: %.loc14_43.3: type = converted %int.make_type_signed.loc14_12, %.loc14_43.2 [template = constants.%i32] -// CHECK:STDOUT: %.loc14_43.4: type = value_of_initializer %int.make_type_signed.loc14_17 [template = constants.%i32] -// CHECK:STDOUT: %.loc14_43.5: type = converted %int.make_type_signed.loc14_17, %.loc14_43.4 [template = constants.%i32] -// CHECK:STDOUT: %.loc14_43.6: type = value_of_initializer %int.make_type_signed.loc14_22 [template = constants.%i32] -// CHECK:STDOUT: %.loc14_43.7: type = converted %int.make_type_signed.loc14_22, %.loc14_43.6 [template = constants.%i32] -// CHECK:STDOUT: %.loc14_43.8: type = converted %.loc14_25, constants.%tuple.type.2 [template = constants.%tuple.type.2] -// CHECK:STDOUT: %.loc14_43.9: type = value_of_initializer %int.make_type_signed.loc14_29 [template = constants.%i32] -// CHECK:STDOUT: %.loc14_43.10: type = converted %int.make_type_signed.loc14_29, %.loc14_43.9 [template = constants.%i32] -// CHECK:STDOUT: %.loc14_43.11: type = value_of_initializer %int.make_type_signed.loc14_34 [template = constants.%i32] -// CHECK:STDOUT: %.loc14_43.12: type = converted %int.make_type_signed.loc14_34, %.loc14_43.11 [template = constants.%i32] -// CHECK:STDOUT: %.loc14_43.13: type = value_of_initializer %int.make_type_signed.loc14_39 [template = constants.%i32] -// CHECK:STDOUT: %.loc14_43.14: type = converted %int.make_type_signed.loc14_39, %.loc14_43.13 [template = constants.%i32] -// CHECK:STDOUT: %.loc14_43.15: type = converted %.loc14_42, constants.%tuple.type.2 [template = constants.%tuple.type.2] -// CHECK:STDOUT: %.loc14_43.16: type = converted %.loc14_43.1, constants.%tuple.type.4 [template = constants.%tuple.type.4] +// CHECK:STDOUT: %.loc14_43.2: type = converted %.loc14_25, constants.%tuple.type.2 [template = constants.%tuple.type.2] +// CHECK:STDOUT: %.loc14_43.3: type = converted %.loc14_42, constants.%tuple.type.2 [template = constants.%tuple.type.2] +// CHECK:STDOUT: %.loc14_43.4: type = converted %.loc14_43.1, constants.%tuple.type.4 [template = constants.%tuple.type.4] // CHECK:STDOUT: %v.var: ref %tuple.type.4 = var v // CHECK:STDOUT: %v: ref %tuple.type.4 = bind_name v, %v.var // CHECK:STDOUT: %F.ref.loc14_48: %F.type = name_ref F, file.%F.decl [template = constants.%F] @@ -146,29 +126,19 @@ fn H() { // CHECK:STDOUT: fn @H() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_32.loc18_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc18_11: init type = call constants.%Int(%int_32.loc18_11) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc18_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc18_17: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc18_17: init type = call constants.%Int(%int_32.loc18_17) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc18_17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc18_22: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc18_22: init type = call constants.%Int(%int_32.loc18_22) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc18_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc18_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc18_27: init type = call constants.%Int(%int_32.loc18_27) [template = constants.%i32] -// CHECK:STDOUT: %.loc18_30: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc18_17, %int.make_type_signed.loc18_22, %int.make_type_signed.loc18_27) +// CHECK:STDOUT: %i32.loc18_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc18_30: %tuple.type.1 = tuple_literal (%i32.loc18_17, %i32.loc18_22, %i32.loc18_27) // CHECK:STDOUT: %int_32.loc18_33: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc18_33: init type = call constants.%Int(%int_32.loc18_33) [template = constants.%i32] -// CHECK:STDOUT: %.loc18_36.1: %tuple.type.6 = tuple_literal (%int.make_type_signed.loc18_11, %.loc18_30, %int.make_type_signed.loc18_33) -// CHECK:STDOUT: %.loc18_36.2: type = value_of_initializer %int.make_type_signed.loc18_11 [template = constants.%i32] -// CHECK:STDOUT: %.loc18_36.3: type = converted %int.make_type_signed.loc18_11, %.loc18_36.2 [template = constants.%i32] -// CHECK:STDOUT: %.loc18_36.4: type = value_of_initializer %int.make_type_signed.loc18_17 [template = constants.%i32] -// CHECK:STDOUT: %.loc18_36.5: type = converted %int.make_type_signed.loc18_17, %.loc18_36.4 [template = constants.%i32] -// CHECK:STDOUT: %.loc18_36.6: type = value_of_initializer %int.make_type_signed.loc18_22 [template = constants.%i32] -// CHECK:STDOUT: %.loc18_36.7: type = converted %int.make_type_signed.loc18_22, %.loc18_36.6 [template = constants.%i32] -// CHECK:STDOUT: %.loc18_36.8: type = value_of_initializer %int.make_type_signed.loc18_27 [template = constants.%i32] -// CHECK:STDOUT: %.loc18_36.9: type = converted %int.make_type_signed.loc18_27, %.loc18_36.8 [template = constants.%i32] -// CHECK:STDOUT: %.loc18_36.10: type = converted %.loc18_30, constants.%tuple.type.2 [template = constants.%tuple.type.2] -// CHECK:STDOUT: %.loc18_36.11: type = value_of_initializer %int.make_type_signed.loc18_33 [template = constants.%i32] -// CHECK:STDOUT: %.loc18_36.12: type = converted %int.make_type_signed.loc18_33, %.loc18_36.11 [template = constants.%i32] -// CHECK:STDOUT: %.loc18_36.13: type = converted %.loc18_36.1, constants.%tuple.type.7 [template = constants.%tuple.type.7] +// CHECK:STDOUT: %i32.loc18_33: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc18_36.1: %tuple.type.6 = tuple_literal (%i32.loc18_11, %.loc18_30, %i32.loc18_33) +// CHECK:STDOUT: %.loc18_36.2: type = converted %.loc18_30, constants.%tuple.type.2 [template = constants.%tuple.type.2] +// CHECK:STDOUT: %.loc18_36.3: type = converted %.loc18_36.1, constants.%tuple.type.7 [template = constants.%tuple.type.7] // CHECK:STDOUT: %v.var: ref %tuple.type.7 = var v // CHECK:STDOUT: %v: ref %tuple.type.7 = bind_name v, %v.var // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] @@ -177,14 +147,14 @@ fn H() { // CHECK:STDOUT: %F.call: init %tuple.type.2 = call %F.ref() to %tuple.elem1 // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %.loc18_50.1: %tuple.type.9 = tuple_literal (%int_1, %F.call, %int_2) -// CHECK:STDOUT: %impl.elem0.loc18_50.1: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc18_50.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc18_50.1: = bound_method %int_1, %impl.elem0.loc18_50.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc18_50.1: = specific_function %Convert.bound.loc18_50.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc18_50.1: init %i32 = call %Convert.specific_fn.loc18_50.1(%int_1) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc18_50.2: init %i32 = converted %int_1, %int.convert_checked.loc18_50.1 [template = constants.%int_1.2] // CHECK:STDOUT: %tuple.elem0: ref %i32 = tuple_access %v.var, element0 // CHECK:STDOUT: %.loc18_50.3: init %i32 = initialize_from %.loc18_50.2 to %tuple.elem0 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc18_50.2: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc18_50.2: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc18_50.2: = bound_method %int_2, %impl.elem0.loc18_50.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc18_50.2: = specific_function %Convert.bound.loc18_50.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc18_50.2: init %i32 = call %Convert.specific_fn.loc18_50.2(%int_2) [template = constants.%int_2.2] diff --git a/toolchain/check/testdata/tuple/one_element.carbon b/toolchain/check/testdata/tuple/one_element.carbon index 46e962d71c4d9..01be2b758d361 100644 --- a/toolchain/check/testdata/tuple/one_element.carbon +++ b/toolchain/check/testdata/tuple/one_element.carbon @@ -15,18 +15,16 @@ var y: (i32,) = x; // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (type) [template] // CHECK:STDOUT: %tuple.type.2: type = tuple_type (%i32) [template] // CHECK:STDOUT: %int_4.1: Core.IntLiteral = int_value 4 [template] // CHECK:STDOUT: %tuple.type.3: type = tuple_type (Core.IntLiteral) [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_4.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound: = bound_method %int_4.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_4.2: %i32 = int_value 4 [template] // CHECK:STDOUT: %tuple: %tuple.type.2 = tuple_value (%int_4.2) [template] @@ -35,7 +33,7 @@ var y: (i32,) = x; // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -49,19 +47,15 @@ var y: (i32,) = x; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int_32.loc11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11: init type = call constants.%Int(%int_32.loc11) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_13.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc11) -// CHECK:STDOUT: %.loc11_13.2: type = value_of_initializer %int.make_type_signed.loc11 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_13.3: type = converted %int.make_type_signed.loc11, %.loc11_13.2 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_13.4: type = converted %.loc11_13.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] +// CHECK:STDOUT: %i32.loc11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_13.1: %tuple.type.1 = tuple_literal (%i32.loc11) +// CHECK:STDOUT: %.loc11_13.2: type = converted %.loc11_13.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %x.var: ref %tuple.type.2 = var x // CHECK:STDOUT: %x: ref %tuple.type.2 = bind_name x, %x.var // CHECK:STDOUT: %int_32.loc12: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc12: init type = call constants.%Int(%int_32.loc12) [template = constants.%i32] -// CHECK:STDOUT: %.loc12_13.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc12) -// CHECK:STDOUT: %.loc12_13.2: type = value_of_initializer %int.make_type_signed.loc12 [template = constants.%i32] -// CHECK:STDOUT: %.loc12_13.3: type = converted %int.make_type_signed.loc12, %.loc12_13.2 [template = constants.%i32] -// CHECK:STDOUT: %.loc12_13.4: type = converted %.loc12_13.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] +// CHECK:STDOUT: %i32.loc12: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc12_13.1: %tuple.type.1 = tuple_literal (%i32.loc12) +// CHECK:STDOUT: %.loc12_13.2: type = converted %.loc12_13.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %y.var: ref %tuple.type.2 = var y // CHECK:STDOUT: %y: ref %tuple.type.2 = bind_name y, %y.var // CHECK:STDOUT: } @@ -70,7 +64,7 @@ var y: (i32,) = x; // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [template = constants.%int_4.1] // CHECK:STDOUT: %.loc11_20.1: %tuple.type.3 = tuple_literal (%int_4) -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_4, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_4) [template = constants.%int_4.2] diff --git a/toolchain/check/testdata/tuple/two_elements.carbon b/toolchain/check/testdata/tuple/two_elements.carbon index 6f25825be6abe..b2f6abf8d50c1 100644 --- a/toolchain/check/testdata/tuple/two_elements.carbon +++ b/toolchain/check/testdata/tuple/two_elements.carbon @@ -18,22 +18,20 @@ var y: (i32, i32) = x; // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %tuple.type.1: type = tuple_type (type, type) [template] // CHECK:STDOUT: %tuple.type.2: type = tuple_type (%i32, %i32) [template] // CHECK:STDOUT: %int_4.1: Core.IntLiteral = int_value 4 [template] // CHECK:STDOUT: %int_102.1: Core.IntLiteral = int_value 102 [template] // CHECK:STDOUT: %tuple.type.3: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.9: = interface_witness (%Convert.14) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_4.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_4.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_4.2: %i32 = int_value 4 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_102.1, %Convert.14 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_102.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_102.2: %i32 = int_value 102 [template] // CHECK:STDOUT: %tuple: %tuple.type.2 = tuple_value (%int_4.2, %int_102.2) [template] @@ -42,7 +40,7 @@ var y: (i32, i32) = x; // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -58,47 +56,31 @@ var y: (i32, i32) = x; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int_32.loc11_9: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11_9: init type = call constants.%Int(%int_32.loc11_9) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc11_9: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc11_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11_14: init type = call constants.%Int(%int_32.loc11_14) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_17.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc11_9, %int.make_type_signed.loc11_14) -// CHECK:STDOUT: %.loc11_17.2: type = value_of_initializer %int.make_type_signed.loc11_9 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_17.3: type = converted %int.make_type_signed.loc11_9, %.loc11_17.2 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_17.4: type = value_of_initializer %int.make_type_signed.loc11_14 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_17.5: type = converted %int.make_type_signed.loc11_14, %.loc11_17.4 [template = constants.%i32] -// CHECK:STDOUT: %.loc11_17.6: type = converted %.loc11_17.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] +// CHECK:STDOUT: %i32.loc11_14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc11_17.1: %tuple.type.1 = tuple_literal (%i32.loc11_9, %i32.loc11_14) +// CHECK:STDOUT: %.loc11_17.2: type = converted %.loc11_17.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %int_32.loc12_9: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc12_9: init type = call constants.%Int(%int_32.loc12_9) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc12_9: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc12_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc12_14: init type = call constants.%Int(%int_32.loc12_14) [template = constants.%i32] -// CHECK:STDOUT: %.loc12_17.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc12_9, %int.make_type_signed.loc12_14) -// CHECK:STDOUT: %.loc12_17.2: type = value_of_initializer %int.make_type_signed.loc12_9 [template = constants.%i32] -// CHECK:STDOUT: %.loc12_17.3: type = converted %int.make_type_signed.loc12_9, %.loc12_17.2 [template = constants.%i32] -// CHECK:STDOUT: %.loc12_17.4: type = value_of_initializer %int.make_type_signed.loc12_14 [template = constants.%i32] -// CHECK:STDOUT: %.loc12_17.5: type = converted %int.make_type_signed.loc12_14, %.loc12_17.4 [template = constants.%i32] -// CHECK:STDOUT: %.loc12_17.6: type = converted %.loc12_17.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] +// CHECK:STDOUT: %i32.loc12_14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc12_17.1: %tuple.type.1 = tuple_literal (%i32.loc12_9, %i32.loc12_14) +// CHECK:STDOUT: %.loc12_17.2: type = converted %.loc12_17.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %int_32.loc14_9: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc14_9: init type = call constants.%Int(%int_32.loc14_9) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc14_9: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc14_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc14_14: init type = call constants.%Int(%int_32.loc14_14) [template = constants.%i32] -// CHECK:STDOUT: %.loc14_17.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc14_9, %int.make_type_signed.loc14_14) -// CHECK:STDOUT: %.loc14_17.2: type = value_of_initializer %int.make_type_signed.loc14_9 [template = constants.%i32] -// CHECK:STDOUT: %.loc14_17.3: type = converted %int.make_type_signed.loc14_9, %.loc14_17.2 [template = constants.%i32] -// CHECK:STDOUT: %.loc14_17.4: type = value_of_initializer %int.make_type_signed.loc14_14 [template = constants.%i32] -// CHECK:STDOUT: %.loc14_17.5: type = converted %int.make_type_signed.loc14_14, %.loc14_17.4 [template = constants.%i32] -// CHECK:STDOUT: %.loc14_17.6: type = converted %.loc14_17.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] +// CHECK:STDOUT: %i32.loc14_14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc14_17.1: %tuple.type.1 = tuple_literal (%i32.loc14_9, %i32.loc14_14) +// CHECK:STDOUT: %.loc14_17.2: type = converted %.loc14_17.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %x.var: ref %tuple.type.2 = var x // CHECK:STDOUT: %x: ref %tuple.type.2 = bind_name x, %x.var // CHECK:STDOUT: %int_32.loc15_9: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc15_9: init type = call constants.%Int(%int_32.loc15_9) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc15_9: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc15_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc15_14: init type = call constants.%Int(%int_32.loc15_14) [template = constants.%i32] -// CHECK:STDOUT: %.loc15_17.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc15_9, %int.make_type_signed.loc15_14) -// CHECK:STDOUT: %.loc15_17.2: type = value_of_initializer %int.make_type_signed.loc15_9 [template = constants.%i32] -// CHECK:STDOUT: %.loc15_17.3: type = converted %int.make_type_signed.loc15_9, %.loc15_17.2 [template = constants.%i32] -// CHECK:STDOUT: %.loc15_17.4: type = value_of_initializer %int.make_type_signed.loc15_14 [template = constants.%i32] -// CHECK:STDOUT: %.loc15_17.5: type = converted %int.make_type_signed.loc15_14, %.loc15_17.4 [template = constants.%i32] -// CHECK:STDOUT: %.loc15_17.6: type = converted %.loc15_17.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] +// CHECK:STDOUT: %i32.loc15_14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc15_17.1: %tuple.type.1 = tuple_literal (%i32.loc15_9, %i32.loc15_14) +// CHECK:STDOUT: %.loc15_17.2: type = converted %.loc15_17.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %y.var: ref %tuple.type.2 = var y // CHECK:STDOUT: %y: ref %tuple.type.2 = bind_name y, %y.var // CHECK:STDOUT: } @@ -108,13 +90,13 @@ var y: (i32, i32) = x; // CHECK:STDOUT: %int_4.loc11: Core.IntLiteral = int_value 4 [template = constants.%int_4.1] // CHECK:STDOUT: %int_102.loc11: Core.IntLiteral = int_value 102 [template = constants.%int_102.1] // CHECK:STDOUT: %.loc11_28.1: %tuple.type.3 = tuple_literal (%int_4.loc11, %int_102.loc11) -// CHECK:STDOUT: %impl.elem0.loc11_28.1: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc11_28.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_28.1: = bound_method %int_4.loc11, %impl.elem0.loc11_28.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc11_28.1: = specific_function %Convert.bound.loc11_28.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc11_28.1: init %i32 = call %Convert.specific_fn.loc11_28.1(%int_4.loc11) [template = constants.%int_4.2] // CHECK:STDOUT: %.loc11_28.2: %i32 = value_of_initializer %int.convert_checked.loc11_28.1 [template = constants.%int_4.2] // CHECK:STDOUT: %.loc11_28.3: %i32 = converted %int_4.loc11, %.loc11_28.2 [template = constants.%int_4.2] -// CHECK:STDOUT: %impl.elem0.loc11_28.2: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc11_28.2: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_28.2: = bound_method %int_102.loc11, %impl.elem0.loc11_28.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc11_28.2: = specific_function %Convert.bound.loc11_28.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc11_28.2: init %i32 = call %Convert.specific_fn.loc11_28.2(%int_102.loc11) [template = constants.%int_102.2] @@ -128,14 +110,14 @@ var y: (i32, i32) = x; // CHECK:STDOUT: %int_4.loc14: Core.IntLiteral = int_value 4 [template = constants.%int_4.1] // CHECK:STDOUT: %int_102.loc14: Core.IntLiteral = int_value 102 [template = constants.%int_102.1] // CHECK:STDOUT: %.loc14_28.1: %tuple.type.3 = tuple_literal (%int_4.loc14, %int_102.loc14) -// CHECK:STDOUT: %impl.elem0.loc14_28.1: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc14_28.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc14_28.1: = bound_method %int_4.loc14, %impl.elem0.loc14_28.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc14_28.1: = specific_function %Convert.bound.loc14_28.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc14_28.1: init %i32 = call %Convert.specific_fn.loc14_28.1(%int_4.loc14) [template = constants.%int_4.2] // CHECK:STDOUT: %.loc14_28.2: init %i32 = converted %int_4.loc14, %int.convert_checked.loc14_28.1 [template = constants.%int_4.2] // CHECK:STDOUT: %tuple.elem0.loc14: ref %i32 = tuple_access file.%x.var, element0 // CHECK:STDOUT: %.loc14_28.3: init %i32 = initialize_from %.loc14_28.2 to %tuple.elem0.loc14 [template = constants.%int_4.2] -// CHECK:STDOUT: %impl.elem0.loc14_28.2: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14] +// CHECK:STDOUT: %impl.elem0.loc14_28.2: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc14_28.2: = bound_method %int_102.loc14, %impl.elem0.loc14_28.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc14_28.2: = specific_function %Convert.bound.loc14_28.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc14_28.2: init %i32 = call %Convert.specific_fn.loc14_28.2(%int_102.loc14) [template = constants.%int_102.2] diff --git a/toolchain/check/testdata/where_expr/constraints.carbon b/toolchain/check/testdata/where_expr/constraints.carbon index da847fe511118..0fa5cd0d04c0b 100644 --- a/toolchain/check/testdata/where_expr/constraints.carbon +++ b/toolchain/check/testdata/where_expr/constraints.carbon @@ -496,9 +496,7 @@ fn NotEmptyStruct() { // CHECK:STDOUT: constants { // CHECK:STDOUT: %.Self: type = bind_symbolic_name .Self [symbolic] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %type_where: type = facet_type [template] // CHECK:STDOUT: %U: %type_where = bind_symbolic_name U, 0 [symbolic] // CHECK:STDOUT: %U.patt: %type_where = symbolic_binding_pattern U, 0 [symbolic] @@ -508,7 +506,7 @@ fn NotEmptyStruct() { // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -527,10 +525,8 @@ fn NotEmptyStruct() { // CHECK:STDOUT: %.Self: type = bind_symbolic_name .Self [symbolic = constants.%.Self] // CHECK:STDOUT: %.Self.ref: type = name_ref .Self, %.Self [symbolic = constants.%.Self] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc8_51.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc8_51.2: type = converted %int.make_type_signed, %.loc8_51.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc8_33: type = where_expr %.Self [template = constants.%type_where] { +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc8: type = where_expr %.Self [template = constants.%type_where] { // CHECK:STDOUT: requirement_impls %.Self.ref, // CHECK:STDOUT: } // CHECK:STDOUT: %U.param: %type_where = value_param runtime_param @@ -557,7 +553,7 @@ fn NotEmptyStruct() { // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %J.type: type = facet_type <@J> [template] -// CHECK:STDOUT: %interface.1: = interface_witness () [template] +// CHECK:STDOUT: %interface: = interface_witness () [template] // CHECK:STDOUT: %DoesNotImplI.type: type = fn_type @DoesNotImplI [template] // CHECK:STDOUT: %DoesNotImplI: %DoesNotImplI.type = struct_value () [template] // CHECK:STDOUT: %Impls.type: type = fn_type @Impls [template] @@ -604,7 +600,7 @@ fn NotEmptyStruct() { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} -// CHECK:STDOUT: impl_decl @impl.1 [template] {} { +// CHECK:STDOUT: impl_decl @impl [template] {} { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %J.ref: type = name_ref J, imports.%import_ref.1 [template = constants.%J.type] // CHECK:STDOUT: } @@ -632,8 +628,8 @@ fn NotEmptyStruct() { // CHECK:STDOUT: witness = () // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.1: %C.ref as %J.ref { -// CHECK:STDOUT: %interface: = interface_witness () [template = constants.%interface.1] +// CHECK:STDOUT: impl @impl: %C.ref as %J.ref { +// CHECK:STDOUT: %interface: = interface_witness () [template = constants.%interface] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: witness = %interface diff --git a/toolchain/check/testdata/where_expr/dot_self_index.carbon b/toolchain/check/testdata/where_expr/dot_self_index.carbon index def337b0be967..6d0df2b0a7361 100644 --- a/toolchain/check/testdata/where_expr/dot_self_index.carbon +++ b/toolchain/check/testdata/where_expr/dot_self_index.carbon @@ -50,9 +50,7 @@ fn G(U: Empty(i32) where .A = i32*) { // CHECK:STDOUT: %H: %H.type = struct_value () [template] // CHECK:STDOUT: %require_complete.2: = require_complete_type %Empty_where.type.1 [symbolic] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %Empty.type.4: type = facet_type <@Empty, @Empty(%i32)> [template] // CHECK:STDOUT: %.Self.2: %Empty.type.4 = bind_symbolic_name .Self [symbolic] // CHECK:STDOUT: %assoc_type.3: type = assoc_entity_type %Empty.type.4, type [template] @@ -65,15 +63,15 @@ fn G(U: Empty(i32) where .A = i32*) { // CHECK:STDOUT: %G: %G.type = struct_value () [template] // CHECK:STDOUT: %Bool.type: type = fn_type @Bool [template] // CHECK:STDOUT: %Bool: %Bool.type = struct_value () [template] -// CHECK:STDOUT: %complete_type.1: = complete_type_witness %Empty.type.4 [template] +// CHECK:STDOUT: %complete_type.2: = complete_type_witness %Empty.type.4 [template] // CHECK:STDOUT: %H.specific_fn: = specific_function %H, @H(%i32, bool) [template] -// CHECK:STDOUT: %complete_type.2: = complete_type_witness %Empty_where.type.2 [template] +// CHECK:STDOUT: %complete_type.3: = complete_type_witness %Empty_where.type.2 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .Bool = %import_ref.2 +// CHECK:STDOUT: .Bool = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -129,9 +127,7 @@ fn G(U: Empty(i32) where .A = i32*) { // CHECK:STDOUT: } { // CHECK:STDOUT: %Empty.ref: %Empty.type.1 = name_ref Empty, file.%Empty.decl [template = constants.%Empty.generic] // CHECK:STDOUT: %int_32.loc20_15: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc20_15: init type = call constants.%Int(%int_32.loc20_15) [template = constants.%i32] -// CHECK:STDOUT: %.loc20_18.1: type = value_of_initializer %int.make_type_signed.loc20_15 [template = constants.%i32] -// CHECK:STDOUT: %.loc20_18.2: type = converted %int.make_type_signed.loc20_15, %.loc20_18.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc20_15: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %Empty.type: type = facet_type <@Empty, @Empty(constants.%i32)> [template = constants.%Empty.type.4] // CHECK:STDOUT: %.Self: %Empty.type.4 = bind_symbolic_name .Self [symbolic = constants.%.Self.2] // CHECK:STDOUT: %.Self.ref: %Empty.type.4 = name_ref .Self, %.Self [symbolic = constants.%.Self.2] @@ -140,9 +136,7 @@ fn G(U: Empty(i32) where .A = i32*) { // CHECK:STDOUT: %.Self.as_wit: = facet_access_witness %.Self.ref [symbolic = constants.%.Self.as_wit.2] // CHECK:STDOUT: %impl.elem0: type = interface_witness_access %.Self.as_wit, element0 [symbolic = constants.%impl.elem0.2] // CHECK:STDOUT: %int_32.loc20_31: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc20_31: init type = call constants.%Int(%int_32.loc20_31) [template = constants.%i32] -// CHECK:STDOUT: %.loc20_34.1: type = value_of_initializer %int.make_type_signed.loc20_31 [template = constants.%i32] -// CHECK:STDOUT: %.loc20_34.2: type = converted %int.make_type_signed.loc20_31, %.loc20_34.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc20_31: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %ptr: type = ptr_type %i32 [template = constants.%ptr.2] // CHECK:STDOUT: %.loc20_20: type = where_expr %.Self [template = constants.%Empty_where.type.2] { // CHECK:STDOUT: requirement_rewrite %impl.elem0, %ptr @@ -202,13 +196,11 @@ fn G(U: Empty(i32) where .A = i32*) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %H.ref: %H.type = name_ref H, file.%H.decl [template = constants.%H] // CHECK:STDOUT: %int_32.loc21: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc21: init type = call constants.%Int(%int_32.loc21) [template = constants.%i32] +// CHECK:STDOUT: %i32.loc21: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %U.ref: %Empty_where.type.2 = name_ref U, %U // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc21_17.1: type = value_of_initializer %int.make_type_signed.loc21 [template = constants.%i32] -// CHECK:STDOUT: %.loc21_17.2: type = converted %int.make_type_signed.loc21, %.loc21_17.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc21_17.3: type = value_of_initializer %bool.make_type [template = bool] -// CHECK:STDOUT: %.loc21_17.4: type = converted %bool.make_type, %.loc21_17.3 [template = bool] +// CHECK:STDOUT: %.loc21_17.1: type = value_of_initializer %bool.make_type [template = bool] +// CHECK:STDOUT: %.loc21_17.2: type = converted %bool.make_type, %.loc21_17.1 [template = bool] // CHECK:STDOUT: %H.specific_fn: = specific_function %H.ref, @H(constants.%i32, bool) [template = constants.%H.specific_fn] // CHECK:STDOUT: %H.call: init %empty_tuple.type = call %H.specific_fn(%U.ref) // CHECK:STDOUT: return @@ -272,7 +264,7 @@ fn G(U: Empty(i32) where .A = i32*) { // CHECK:STDOUT: %T.patt.loc18_6.2 => constants.%i32 // CHECK:STDOUT: %Empty.type.loc18_26.2 => constants.%Empty.type.4 // CHECK:STDOUT: %.Self.2 => constants.%.Self.2 -// CHECK:STDOUT: %require_complete.loc18_34 => constants.%complete_type.1 +// CHECK:STDOUT: %require_complete.loc18_34 => constants.%complete_type.2 // CHECK:STDOUT: %assoc_type => constants.%assoc_type.3 // CHECK:STDOUT: %assoc0 => constants.%assoc0.3 // CHECK:STDOUT: %.Self.as_wit.loc18_34.2 => constants.%.Self.as_wit.2 @@ -283,6 +275,6 @@ fn G(U: Empty(i32) where .A = i32*) { // CHECK:STDOUT: %V.patt.loc18_43.2 => bool // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete.loc18_17 => constants.%complete_type.2 +// CHECK:STDOUT: %require_complete.loc18_17 => constants.%complete_type.3 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/where_expr/equal_rewrite.carbon b/toolchain/check/testdata/where_expr/equal_rewrite.carbon index 6725d2a6c34cc..ade4924665956 100644 --- a/toolchain/check/testdata/where_expr/equal_rewrite.carbon +++ b/toolchain/check/testdata/where_expr/equal_rewrite.carbon @@ -404,9 +404,7 @@ let K: (E where .F = .Self.G) = bool; // CHECK:STDOUT: %.Self.as_wit: = facet_access_witness %.Self [symbolic] // CHECK:STDOUT: %impl.elem0: type = interface_witness_access %.Self.as_wit, element0 [symbolic] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %E_where.type: type = facet_type <@E where %impl.elem0 = %i32> [template] // CHECK:STDOUT: %G: %E_where.type = bind_symbolic_name G, 0 [symbolic] // CHECK:STDOUT: %G.patt: %E_where.type = symbolic_binding_pattern G, 0 [symbolic] @@ -427,7 +425,7 @@ let K: (E where .F = .Self.G) = bool; // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -454,11 +452,9 @@ let K: (E where .F = .Self.G) = bool; // CHECK:STDOUT: %.Self.as_wit: = facet_access_witness %.Self.ref [symbolic = constants.%.Self.as_wit] // CHECK:STDOUT: %impl.elem0: type = interface_witness_access %.Self.as_wit, element0 [symbolic = constants.%impl.elem0] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc8_32.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc8_32.2: type = converted %int.make_type_signed, %.loc8_32.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc8_21: type = where_expr %.Self [template = constants.%E_where.type] { -// CHECK:STDOUT: requirement_rewrite %impl.elem0, %.loc8_32.2 +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc8: type = where_expr %.Self [template = constants.%E_where.type] { +// CHECK:STDOUT: requirement_rewrite %impl.elem0, %i32 // CHECK:STDOUT: } // CHECK:STDOUT: %G.param: %E_where.type = value_param runtime_param // CHECK:STDOUT: %G.loc8_15.1: %E_where.type = bind_symbolic_name G, 0, %G.param [symbolic = %G.loc8_15.2 (constants.%G)] @@ -474,20 +470,16 @@ let K: (E where .F = .Self.G) = bool; // CHECK:STDOUT: %.Self.as_wit.loc10_32: = facet_access_witness %.Self.ref.loc10_32 [symbolic = constants.%.Self.as_wit] // CHECK:STDOUT: %impl.elem0.loc10_32: type = interface_witness_access %.Self.as_wit.loc10_32, element0 [symbolic = constants.%impl.elem0] // CHECK:STDOUT: %int_32.loc10_37: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc10_37: init type = call constants.%Int(%int_32.loc10_37) [template = constants.%i32] -// CHECK:STDOUT: %.loc10_37.1: type = value_of_initializer %int.make_type_signed.loc10_37 [template = constants.%i32] -// CHECK:STDOUT: %.loc10_37.2: type = converted %int.make_type_signed.loc10_37, %.loc10_37.1 [template = constants.%i32] +// CHECK:STDOUT: %i32.loc10_37: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.Self.ref.loc10_45: %E.type = name_ref .Self, %.Self [symbolic = constants.%.Self] // CHECK:STDOUT: %F.ref.loc10_45: %assoc_type = name_ref F, @E.%assoc0 [template = constants.%assoc0] // CHECK:STDOUT: %.Self.as_wit.loc10_45: = facet_access_witness %.Self.ref.loc10_45 [symbolic = constants.%.Self.as_wit] // CHECK:STDOUT: %impl.elem0.loc10_45: type = interface_witness_access %.Self.as_wit.loc10_45, element0 [symbolic = constants.%impl.elem0] // CHECK:STDOUT: %int_32.loc10_50: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc10_50: init type = call constants.%Int(%int_32.loc10_50) [template = constants.%i32] -// CHECK:STDOUT: %.loc10_50.1: type = value_of_initializer %int.make_type_signed.loc10_50 [template = constants.%i32] -// CHECK:STDOUT: %.loc10_50.2: type = converted %int.make_type_signed.loc10_50, %.loc10_50.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc10_26: type = where_expr %.Self [template = constants.%E_where.type] { -// CHECK:STDOUT: requirement_rewrite %impl.elem0.loc10_32, %.loc10_37.2 -// CHECK:STDOUT: requirement_rewrite %impl.elem0.loc10_45, %.loc10_50.2 +// CHECK:STDOUT: %i32.loc10_50: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc10: type = where_expr %.Self [template = constants.%E_where.type] { +// CHECK:STDOUT: requirement_rewrite %impl.elem0.loc10_32, %i32.loc10_37 +// CHECK:STDOUT: requirement_rewrite %impl.elem0.loc10_45, %i32.loc10_50 // CHECK:STDOUT: } // CHECK:STDOUT: %H.param: %E_where.type = value_param runtime_param // CHECK:STDOUT: %H.loc10_20.1: %E_where.type = bind_symbolic_name H, 0, %H.param [symbolic = %H.loc10_20.2 (constants.%H)] @@ -503,11 +495,9 @@ let K: (E where .F = .Self.G) = bool; // CHECK:STDOUT: %.Self.as_wit: = facet_access_witness %.Self.ref [symbolic = constants.%.Self.as_wit] // CHECK:STDOUT: %impl.elem0: type = interface_witness_access %.Self.as_wit, element0 [symbolic = constants.%impl.elem0] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc14_37.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc14_37.2: type = converted %int.make_type_signed, %.loc14_37.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc14_26: type = where_expr %.Self [template = constants.%E_where.type] { -// CHECK:STDOUT: requirement_rewrite %impl.elem0, %.loc14_37.2 +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc14: type = where_expr %.Self [template = constants.%E_where.type] { +// CHECK:STDOUT: requirement_rewrite %impl.elem0, %i32 // CHECK:STDOUT: } // CHECK:STDOUT: %I.param: %E_where.type = value_param runtime_param // CHECK:STDOUT: %I.loc14_20.1: %E_where.type = bind_symbolic_name I, 0, %I.param [symbolic = %I.loc14_20.2 (constants.%I)] @@ -790,9 +780,7 @@ let K: (E where .F = .Self.G) = bool; // CHECK:STDOUT: %.Self.as_wit: = facet_access_witness %.Self [symbolic] // CHECK:STDOUT: %impl.elem0: type = interface_witness_access %.Self.as_wit, element0 [symbolic] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %O_where.type.1: type = facet_type <@O where %impl.elem0 = %i32> [template] // CHECK:STDOUT: %Q: %O_where.type.1 = bind_symbolic_name Q, 0 [symbolic] // CHECK:STDOUT: %Q.patt: %O_where.type.1 = symbolic_binding_pattern Q, 0 [symbolic] @@ -810,8 +798,8 @@ let K: (E where .F = .Self.G) = bool; // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .Bool = %import_ref.2 -// CHECK:STDOUT: .ImplicitAs = %import_ref.3 +// CHECK:STDOUT: .Bool = %import_ref.5 +// CHECK:STDOUT: .ImplicitAs = %import_ref.6 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -837,11 +825,9 @@ let K: (E where .F = .Self.G) = bool; // CHECK:STDOUT: %.Self.as_wit: = facet_access_witness %.Self.ref [symbolic = constants.%.Self.as_wit] // CHECK:STDOUT: %impl.elem0: type = interface_witness_access %.Self.as_wit, element0 [symbolic = constants.%impl.elem0] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc8_33.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc8_33.2: type = converted %int.make_type_signed, %.loc8_33.1 [template = constants.%i32] -// CHECK:STDOUT: %.loc8_22: type = where_expr %.Self [template = constants.%O_where.type.1] { -// CHECK:STDOUT: requirement_rewrite %impl.elem0, %.loc8_33.2 +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc8: type = where_expr %.Self [template = constants.%O_where.type.1] { +// CHECK:STDOUT: requirement_rewrite %impl.elem0, %i32 // CHECK:STDOUT: } // CHECK:STDOUT: %Q.param: %O_where.type.1 = value_param runtime_param // CHECK:STDOUT: %Q.loc8_16.1: %O_where.type.1 = bind_symbolic_name Q, 0, %Q.param [symbolic = %Q.loc8_16.2 (constants.%Q)] @@ -1078,9 +1064,7 @@ let K: (E where .F = .Self.G) = bool; // CHECK:STDOUT: %D: %A_where.type.2 = bind_symbolic_name D, 0 [symbolic] // CHECK:STDOUT: %D.patt: %A_where.type.2 = symbolic_binding_pattern D, 0 [symbolic] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -1091,18 +1075,18 @@ let K: (E where .F = .Self.G) = bool; // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Bool = %import_ref.8 // CHECK:STDOUT: .ImplicitAs = %import_ref.9 -// CHECK:STDOUT: .Int = %import_ref.50 +// CHECK:STDOUT: .Int = %import_ref.20 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.5 = import_ref Main//equal_constraint, inst17 [no loc], unloaded // CHECK:STDOUT: %import_ref.6 = import_ref Main//equal_constraint, loc5_15, unloaded // CHECK:STDOUT: %import_ref.7 = import_ref Main//equal_constraint, P, unloaded -// CHECK:STDOUT: %import_ref.45 = import_ref Main//nested_rewrites, inst17 [no loc], unloaded -// CHECK:STDOUT: %import_ref.46 = import_ref Main//nested_rewrites, loc5_15, unloaded -// CHECK:STDOUT: %import_ref.47 = import_ref Main//nested_rewrites, loc6_15, unloaded -// CHECK:STDOUT: %import_ref.48 = import_ref Main//nested_rewrites, B, unloaded -// CHECK:STDOUT: %import_ref.49 = import_ref Main//nested_rewrites, C, unloaded +// CHECK:STDOUT: %import_ref.15 = import_ref Main//nested_rewrites, inst17 [no loc], unloaded +// CHECK:STDOUT: %import_ref.16 = import_ref Main//nested_rewrites, loc5_15, unloaded +// CHECK:STDOUT: %import_ref.17 = import_ref Main//nested_rewrites, loc6_15, unloaded +// CHECK:STDOUT: %import_ref.18 = import_ref Main//nested_rewrites, B, unloaded +// CHECK:STDOUT: %import_ref.19 = import_ref Main//nested_rewrites, C, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -1128,10 +1112,10 @@ let K: (E where .F = .Self.G) = bool; // CHECK:STDOUT: // CHECK:STDOUT: interface @A [from "nested_rewrites.carbon"] { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.45 -// CHECK:STDOUT: .B = imports.%import_ref.46 -// CHECK:STDOUT: .C = imports.%import_ref.47 -// CHECK:STDOUT: witness = (imports.%import_ref.48, imports.%import_ref.49) +// CHECK:STDOUT: .Self = imports.%import_ref.15 +// CHECK:STDOUT: .B = imports.%import_ref.16 +// CHECK:STDOUT: .C = imports.%import_ref.17 +// CHECK:STDOUT: witness = (imports.%import_ref.18, imports.%import_ref.19) // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Calls() { @@ -1141,8 +1125,8 @@ let K: (E where .F = .Self.G) = bool; // CHECK:STDOUT: %.loc19: %N_where.type = converted %bool.make_type, [template = ] // CHECK:STDOUT: %NestedRewrite.ref: %NestedRewrite.type = name_ref NestedRewrite, imports.%import_ref.4 [template = constants.%NestedRewrite] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc32: %A_where.type.2 = converted %int.make_type_signed, [template = ] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc32: %A_where.type.2 = converted %i32, [template = ] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1251,7 +1235,7 @@ let K: (E where .F = .Self.G) = bool; // CHECK:STDOUT: %D: type = class_type @D [template] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] -// CHECK:STDOUT: %interface.1: = interface_witness () [template] +// CHECK:STDOUT: %interface: = interface_witness () [template] // CHECK:STDOUT: %.Self: type = bind_symbolic_name .Self [symbolic] // CHECK:STDOUT: %type_where: type = facet_type [template] // CHECK:STDOUT: } @@ -1274,7 +1258,7 @@ let K: (E where .F = .Self.G) = bool; // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %A.decl: type = interface_decl @A [template = constants.%A.type] {} {} // CHECK:STDOUT: %D.decl: type = class_decl @D [template = constants.%D] {} {} -// CHECK:STDOUT: impl_decl @impl.1 [template] {} { +// CHECK:STDOUT: impl_decl @impl [template] {} { // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [template = constants.%D] // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%A.type] // CHECK:STDOUT: } @@ -1294,8 +1278,8 @@ let K: (E where .F = .Self.G) = bool; // CHECK:STDOUT: witness = () // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.1: %D.ref as %A.ref { -// CHECK:STDOUT: %interface: = interface_witness () [template = constants.%interface.1] +// CHECK:STDOUT: impl @impl: %D.ref as %A.ref { +// CHECK:STDOUT: %interface: = interface_witness () [template = constants.%interface] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: witness = %interface @@ -1342,9 +1326,7 @@ let K: (E where .F = .Self.G) = bool; // CHECK:STDOUT: %.Self.as_wit.2: = facet_access_witness %.Self.2 [symbolic] // CHECK:STDOUT: %impl.elem1.2: type = interface_witness_access %.Self.as_wit.2, element1 [symbolic] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %E_where.type.3: type = facet_type <@E where %impl.elem1.2 = %i32 and %impl.elem0 = %empty_struct_type> [template] // CHECK:STDOUT: %E_where.type.4: type = facet_type <@E where %impl.elem0 = %impl.elem1.1> [template] // CHECK:STDOUT: } @@ -1354,7 +1336,7 @@ let K: (E where .F = .Self.G) = bool; // CHECK:STDOUT: .Bool = %import_ref.1 // CHECK:STDOUT: .Float = %import_ref.2 // CHECK:STDOUT: .ImplicitAs = %import_ref.3 -// CHECK:STDOUT: .Int = %import_ref.39 +// CHECK:STDOUT: .Int = %import_ref.9 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -1406,11 +1388,9 @@ let K: (E where .F = .Self.G) = bool; // CHECK:STDOUT: %.Self.as_wit.loc27_33: = facet_access_witness %.Self.ref.loc27_33 [symbolic = constants.%.Self.as_wit.2] // CHECK:STDOUT: %impl.elem1.loc27: type = interface_witness_access %.Self.as_wit.loc27_33, element1 [symbolic = constants.%impl.elem1.2] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc27_38.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc27_38.2: type = converted %int.make_type_signed, %.loc27_38.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc27_27: type = where_expr %.Self.3 [template = constants.%E_where.type.3] { -// CHECK:STDOUT: requirement_rewrite %impl.elem1.loc27, %.loc27_38.2 +// CHECK:STDOUT: requirement_rewrite %impl.elem1.loc27, %i32 // CHECK:STDOUT: } // CHECK:STDOUT: %E.ref.loc35: type = name_ref E, %E.decl [template = constants.%E.type] // CHECK:STDOUT: %.Self.4: %E.type = bind_symbolic_name .Self [symbolic = constants.%.Self.1] diff --git a/toolchain/check/testdata/where_expr/fail_not_facet.carbon b/toolchain/check/testdata/where_expr/fail_not_facet.carbon index 559a46b79a3f4..d9ea24d531b07 100644 --- a/toolchain/check/testdata/where_expr/fail_not_facet.carbon +++ b/toolchain/check/testdata/where_expr/fail_not_facet.carbon @@ -41,9 +41,7 @@ var v: e where .x = 3; // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %Bool.type: type = fn_type @Bool [template] // CHECK:STDOUT: %Bool: %Bool.type = struct_value () [template] // CHECK:STDOUT: %T.patt: = symbolic_binding_pattern T, 0 [symbolic] @@ -54,7 +52,7 @@ var v: e where .x = 3; // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .Bool = %import_ref.2 +// CHECK:STDOUT: .Bool = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -71,13 +69,11 @@ var v: e where .x = 3; // CHECK:STDOUT: %T.param_patt: = value_param_pattern %T.patt.loc8_6.1, runtime_param [symbolic = %T.patt.loc8_6.2 (constants.%T.patt)] // CHECK:STDOUT: } { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc8_10.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32] -// CHECK:STDOUT: %.loc8_10.2: type = converted %int.make_type_signed, %.loc8_10.1 [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.Self: = bind_symbolic_name .Self [template = ] // CHECK:STDOUT: %.Self.ref: = name_ref .Self, %.Self [template = ] // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc8_14: type = where_expr %.Self [template = ] { +// CHECK:STDOUT: %.loc8: type = where_expr %.Self [template = ] { // CHECK:STDOUT: requirement_equivalent %.Self.ref, %bool.make_type // CHECK:STDOUT: } // CHECK:STDOUT: %T.param: = value_param runtime_param diff --git a/toolchain/check/testdata/where_expr/non_generic.carbon b/toolchain/check/testdata/where_expr/non_generic.carbon index a6ac250b226d9..b60be9a0466f7 100644 --- a/toolchain/check/testdata/where_expr/non_generic.carbon +++ b/toolchain/check/testdata/where_expr/non_generic.carbon @@ -24,9 +24,7 @@ fn NotGenericF(U: I where .T == i32) {} // CHECK:STDOUT: %.Self.as_wit: = facet_access_witness %.Self [symbolic] // CHECK:STDOUT: %impl.elem0: type = interface_witness_access %.Self.as_wit, element0 [symbolic] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %I_where.type: type = facet_type <@I where TODO> [template] // CHECK:STDOUT: %NotGenericF.type: type = fn_type @NotGenericF [template] // CHECK:STDOUT: %NotGenericF: %NotGenericF.type = struct_value () [template] @@ -34,7 +32,7 @@ fn NotGenericF(U: I where .T == i32) {} // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -59,9 +57,9 @@ fn NotGenericF(U: I where .T == i32) {} // CHECK:STDOUT: %.Self.as_wit: = facet_access_witness %.Self.ref [symbolic = constants.%.Self.as_wit] // CHECK:STDOUT: %impl.elem0: type = interface_witness_access %.Self.as_wit, element0 [symbolic = constants.%impl.elem0] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc14: type = where_expr %.Self [template = constants.%I_where.type] { -// CHECK:STDOUT: requirement_equivalent %impl.elem0, %int.make_type_signed +// CHECK:STDOUT: requirement_equivalent %impl.elem0, %i32 // CHECK:STDOUT: } // CHECK:STDOUT: %U.param: %I_where.type = value_param runtime_param0 // CHECK:STDOUT: %U: %I_where.type = bind_name U, %U.param diff --git a/toolchain/diagnostics/diagnostic_emitter.h b/toolchain/diagnostics/diagnostic_emitter.h index 761a9e68f2b63..8c5342e387586 100644 --- a/toolchain/diagnostics/diagnostic_emitter.h +++ b/toolchain/diagnostics/diagnostic_emitter.h @@ -79,7 +79,7 @@ class DiagnosticEmitter { if (!emitter_) { return; } - for (auto annotate_fn : emitter_->annotate_fns_) { + for (auto annotate_fn : llvm::reverse(emitter_->annotate_fns_)) { annotate_fn(*this); } emitter_->consumer_->HandleDiagnostic(std::move(diagnostic_)); diff --git a/toolchain/lower/testdata/array/field.carbon b/toolchain/lower/testdata/array/field.carbon index 38d0b61979a5c..0f14bb476d0a1 100644 --- a/toolchain/lower/testdata/array/field.carbon +++ b/toolchain/lower/testdata/array/field.carbon @@ -42,20 +42,20 @@ class A { // CHECK:STDOUT: define i32 @_CAccess.A.Main(ptr %self) !dbg !10 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.loc19_16.1.v = getelementptr inbounds nuw { [2 x i32] }, ptr %self, i32 0, i32 0, !dbg !11 -// CHECK:STDOUT: %.loc19_20.4.array.index = getelementptr inbounds [2 x i32], ptr %.loc19_16.1.v, i32 0, i32 0, !dbg !11 -// CHECK:STDOUT: %.loc19_20.5 = load i32, ptr %.loc19_20.4.array.index, align 4, !dbg !11 -// CHECK:STDOUT: ret i32 %.loc19_20.5, !dbg !12 +// CHECK:STDOUT: %.loc19_20.2.array.index = getelementptr inbounds [2 x i32], ptr %.loc19_16.1.v, i32 0, i32 0, !dbg !11 +// CHECK:STDOUT: %.loc19_20.3 = load i32, ptr %.loc19_20.2.array.index, align 4, !dbg !11 +// CHECK:STDOUT: ret i32 %.loc19_20.3, !dbg !12 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: define i32 @_CUse.A.Main(ptr %self) !dbg !13 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.loc23_9.2.v = getelementptr inbounds nuw { [2 x i32] }, ptr %self, i32 0, i32 0, !dbg !14 -// CHECK:STDOUT: %.loc23_14.3.array.index = getelementptr inbounds [2 x i32], ptr %.loc23_9.2.v, i32 0, i32 0, !dbg !14 -// CHECK:STDOUT: store i32 1, ptr %.loc23_14.3.array.index, align 4, !dbg !14 +// CHECK:STDOUT: %.loc23_14.array.index = getelementptr inbounds [2 x i32], ptr %.loc23_9.2.v, i32 0, i32 0, !dbg !14 +// CHECK:STDOUT: store i32 1, ptr %.loc23_14.array.index, align 4, !dbg !14 // CHECK:STDOUT: %.loc24_16.2.v = getelementptr inbounds nuw { [2 x i32] }, ptr %self, i32 0, i32 0, !dbg !15 -// CHECK:STDOUT: %.loc24_21.3.array.index = getelementptr inbounds [2 x i32], ptr %.loc24_16.2.v, i32 0, i32 1, !dbg !15 -// CHECK:STDOUT: %.loc24_21.4 = load i32, ptr %.loc24_21.3.array.index, align 4, !dbg !15 -// CHECK:STDOUT: ret i32 %.loc24_21.4, !dbg !16 +// CHECK:STDOUT: %.loc24_21.1.array.index = getelementptr inbounds [2 x i32], ptr %.loc24_16.2.v, i32 0, i32 1, !dbg !15 +// CHECK:STDOUT: %.loc24_21.2 = load i32, ptr %.loc24_21.1.array.index, align 4, !dbg !15 +// CHECK:STDOUT: ret i32 %.loc24_21.2, !dbg !16 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) diff --git a/toolchain/lower/testdata/array/function_param.carbon b/toolchain/lower/testdata/array/function_param.carbon index 4b48d31463c96..01f4c72ffe7bc 100644 --- a/toolchain/lower/testdata/array/function_param.carbon +++ b/toolchain/lower/testdata/array/function_param.carbon @@ -23,9 +23,9 @@ fn G() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: define i32 @_CF.Main(ptr %arr, i32 %i) !dbg !4 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc12_15.4.array.index = getelementptr inbounds [3 x i32], ptr %arr, i32 0, i32 %i, !dbg !7 -// CHECK:STDOUT: %.loc12_15.5 = load i32, ptr %.loc12_15.4.array.index, align 4, !dbg !7 -// CHECK:STDOUT: ret i32 %.loc12_15.5, !dbg !8 +// CHECK:STDOUT: %.loc12_15.2.array.index = getelementptr inbounds [3 x i32], ptr %arr, i32 0, i32 %i, !dbg !7 +// CHECK:STDOUT: %.loc12_15.3 = load i32, ptr %.loc12_15.2.array.index, align 4, !dbg !7 +// CHECK:STDOUT: ret i32 %.loc12_15.3, !dbg !8 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: define i32 @_CG.Main() !dbg !9 { diff --git a/toolchain/lower/testdata/function/generic/call.carbon b/toolchain/lower/testdata/function/generic/call.carbon index e8fbe35e42615..cd9db70a609d0 100644 --- a/toolchain/lower/testdata/function/generic/call.carbon +++ b/toolchain/lower/testdata/function/generic/call.carbon @@ -41,24 +41,24 @@ fn G() { // CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %d.var, ptr align 1 @D.val.loc19_16, i64 0, i1 false), !dbg !10 // CHECK:STDOUT: %n.var = alloca i32, align 4, !dbg !11 // CHECK:STDOUT: store i32 0, ptr %n.var, align 4, !dbg !12 -// CHECK:STDOUT: call void @_CF.Main.46(ptr %c.var), !dbg !13 -// CHECK:STDOUT: call void @_CF.Main.47(ptr %d.var), !dbg !14 +// CHECK:STDOUT: call void @_CF.Main.40(ptr %c.var), !dbg !13 +// CHECK:STDOUT: call void @_CF.Main.41(ptr %d.var), !dbg !14 // CHECK:STDOUT: %.loc24 = load i32, ptr %n.var, align 4, !dbg !15 -// CHECK:STDOUT: call void @_CF.Main.48(i32 %.loc24), !dbg !16 -// CHECK:STDOUT: call void @_CF.Main.49(%type zeroinitializer), !dbg !17 +// CHECK:STDOUT: call void @_CF.Main.42(i32 %.loc24), !dbg !16 +// CHECK:STDOUT: call void @_CF.Main.43(%type zeroinitializer), !dbg !17 // CHECK:STDOUT: ret void, !dbg !18 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) // CHECK:STDOUT: declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 // CHECK:STDOUT: -// CHECK:STDOUT: declare void @_CF.Main.46(ptr) +// CHECK:STDOUT: declare void @_CF.Main.40(ptr) // CHECK:STDOUT: -// CHECK:STDOUT: declare void @_CF.Main.47(ptr) +// CHECK:STDOUT: declare void @_CF.Main.41(ptr) // CHECK:STDOUT: -// CHECK:STDOUT: declare void @_CF.Main.48(i32) +// CHECK:STDOUT: declare void @_CF.Main.42(i32) // CHECK:STDOUT: -// CHECK:STDOUT: declare void @_CF.Main.49(%type) +// CHECK:STDOUT: declare void @_CF.Main.43(%type) // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives // CHECK:STDOUT: uselistorder ptr @llvm.memcpy.p0.p0.i64, { 1, 0 } diff --git a/toolchain/lower/testdata/function/generic/call_method.carbon b/toolchain/lower/testdata/function/generic/call_method.carbon index 5bd2c70938ec0..74fd79f9ef038 100644 --- a/toolchain/lower/testdata/function/generic/call_method.carbon +++ b/toolchain/lower/testdata/function/generic/call_method.carbon @@ -32,14 +32,14 @@ fn CallF() -> i32 { // CHECK:STDOUT: %n.var = alloca i32, align 4, !dbg !9 // CHECK:STDOUT: store i32 0, ptr %n.var, align 4, !dbg !10 // CHECK:STDOUT: %.loc20_14 = load i32, ptr %n.var, align 4, !dbg !11 -// CHECK:STDOUT: %F.call = call i32 @_CF.C.Main.46(ptr %c.var, i32 %.loc20_14), !dbg !12 +// CHECK:STDOUT: %F.call = call i32 @_CF.C.Main.40(ptr %c.var, i32 %.loc20_14), !dbg !12 // CHECK:STDOUT: ret i32 %F.call, !dbg !13 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) // CHECK:STDOUT: declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 // CHECK:STDOUT: -// CHECK:STDOUT: declare i32 @_CF.C.Main.46(ptr, i32) +// CHECK:STDOUT: declare i32 @_CF.C.Main.40(ptr, i32) // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/index/array_element_access.carbon b/toolchain/lower/testdata/index/array_element_access.carbon index 3ea9f3996256c..e1c7ae7c38c45 100644 --- a/toolchain/lower/testdata/index/array_element_access.carbon +++ b/toolchain/lower/testdata/index/array_element_access.carbon @@ -57,15 +57,15 @@ fn Run() { // CHECK:STDOUT: store i32 1, ptr %b.var, align 4, !dbg !16 // CHECK:STDOUT: %c.var = alloca i32, align 4, !dbg !17 // CHECK:STDOUT: %.loc17_18 = load i32, ptr %b.var, align 4, !dbg !18 -// CHECK:STDOUT: %.loc17_19.3.array.index = getelementptr inbounds [2 x i32], ptr %a.var, i32 0, i32 %.loc17_18, !dbg !19 -// CHECK:STDOUT: %.loc17_19.4 = load i32, ptr %.loc17_19.3.array.index, align 4, !dbg !19 -// CHECK:STDOUT: store i32 %.loc17_19.4, ptr %c.var, align 4, !dbg !20 +// CHECK:STDOUT: %.loc17_19.1.array.index = getelementptr inbounds [2 x i32], ptr %a.var, i32 0, i32 %.loc17_18, !dbg !19 +// CHECK:STDOUT: %.loc17_19.2 = load i32, ptr %.loc17_19.1.array.index, align 4, !dbg !19 +// CHECK:STDOUT: store i32 %.loc17_19.2, ptr %c.var, align 4, !dbg !20 // CHECK:STDOUT: %d.var = alloca i32, align 4, !dbg !21 // CHECK:STDOUT: %.loc18_18.1.temp = alloca [2 x i32], align 4, !dbg !22 // CHECK:STDOUT: call void @_CB.Main(ptr %.loc18_18.1.temp), !dbg !22 -// CHECK:STDOUT: %.loc18_21.3.array.index = getelementptr inbounds [2 x i32], ptr %.loc18_18.1.temp, i32 0, i32 1, !dbg !22 -// CHECK:STDOUT: %.loc18_21.4 = load i32, ptr %.loc18_21.3.array.index, align 4, !dbg !22 -// CHECK:STDOUT: store i32 %.loc18_21.4, ptr %d.var, align 4, !dbg !23 +// CHECK:STDOUT: %.loc18_21.1.array.index = getelementptr inbounds [2 x i32], ptr %.loc18_18.1.temp, i32 0, i32 1, !dbg !22 +// CHECK:STDOUT: %.loc18_21.2 = load i32, ptr %.loc18_21.1.array.index, align 4, !dbg !22 +// CHECK:STDOUT: store i32 %.loc18_21.2, ptr %d.var, align 4, !dbg !23 // CHECK:STDOUT: ret void, !dbg !24 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/struct/member_access.carbon b/toolchain/lower/testdata/struct/member_access.carbon index 3c8d395253279..4a476f38ee8b7 100644 --- a/toolchain/lower/testdata/struct/member_access.carbon +++ b/toolchain/lower/testdata/struct/member_access.carbon @@ -31,8 +31,8 @@ fn Run() -> i32 { // CHECK:STDOUT: %.loc13_17.2 = load i32, ptr %.loc13_17.1.b, align 4, !dbg !11 // CHECK:STDOUT: store i32 %.loc13_17.2, ptr %y.var, align 4, !dbg !12 // CHECK:STDOUT: %z.var = alloca i32, align 4, !dbg !13 -// CHECK:STDOUT: %.loc14_16 = load i32, ptr %y.var, align 4, !dbg !14 -// CHECK:STDOUT: store i32 %.loc14_16, ptr %z.var, align 4, !dbg !15 +// CHECK:STDOUT: %.loc14 = load i32, ptr %y.var, align 4, !dbg !14 +// CHECK:STDOUT: store i32 %.loc14, ptr %z.var, align 4, !dbg !15 // CHECK:STDOUT: ret i32 0, !dbg !16 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/tuple/access/element_access.carbon b/toolchain/lower/testdata/tuple/access/element_access.carbon index 14d1f05226578..e8258eab2f313 100644 --- a/toolchain/lower/testdata/tuple/access/element_access.carbon +++ b/toolchain/lower/testdata/tuple/access/element_access.carbon @@ -29,12 +29,12 @@ fn Run() -> i32 { // CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %a.var, ptr align 4 @tuple.loc12_37, i64 12, i1 false), !dbg !9 // CHECK:STDOUT: %b.var = alloca i32, align 4, !dbg !10 // CHECK:STDOUT: %tuple.elem0.loc13.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %a.var, i32 0, i32 0, !dbg !11 -// CHECK:STDOUT: %.loc13_17 = load i32, ptr %tuple.elem0.loc13.tuple.elem, align 4, !dbg !11 -// CHECK:STDOUT: store i32 %.loc13_17, ptr %b.var, align 4, !dbg !12 +// CHECK:STDOUT: %.loc13 = load i32, ptr %tuple.elem0.loc13.tuple.elem, align 4, !dbg !11 +// CHECK:STDOUT: store i32 %.loc13, ptr %b.var, align 4, !dbg !12 // CHECK:STDOUT: %c.var = alloca i32, align 4, !dbg !13 // CHECK:STDOUT: %tuple.elem2.loc14.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %a.var, i32 0, i32 2, !dbg !14 -// CHECK:STDOUT: %.loc14_17 = load i32, ptr %tuple.elem2.loc14.tuple.elem, align 4, !dbg !14 -// CHECK:STDOUT: store i32 %.loc14_17, ptr %c.var, align 4, !dbg !15 +// CHECK:STDOUT: %.loc14 = load i32, ptr %tuple.elem2.loc14.tuple.elem, align 4, !dbg !14 +// CHECK:STDOUT: store i32 %.loc14, ptr %c.var, align 4, !dbg !15 // CHECK:STDOUT: ret i32 0, !dbg !16 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/sem_ir/file.cpp b/toolchain/sem_ir/file.cpp index 336938417e828..3a750eace4a06 100644 --- a/toolchain/sem_ir/file.cpp +++ b/toolchain/sem_ir/file.cpp @@ -32,7 +32,6 @@ File::File(const Parse::Tree* parse_tree, CheckIRId check_ir_id, filename_(std::move(filename)), impls_(*this), type_blocks_(allocator_), - name_scopes_(&insts_), constant_values_(ConstantId::NotConstant), inst_blocks_(allocator_), constants_(this) { diff --git a/toolchain/sem_ir/file.h b/toolchain/sem_ir/file.h index c624a705e8e6a..9aaf1b163bb99 100644 --- a/toolchain/sem_ir/file.h +++ b/toolchain/sem_ir/file.h @@ -248,7 +248,7 @@ class File : public Printable { InstStore insts_; // Storage for name scopes. - NameScopeStore name_scopes_; + NameScopeStore name_scopes_ = NameScopeStore(this); // Constant values for instructions. ConstantValueStore constant_values_; diff --git a/toolchain/sem_ir/inst_namer.cpp b/toolchain/sem_ir/inst_namer.cpp index 454da12adfb93..a33e2b57add1e 100644 --- a/toolchain/sem_ir/inst_namer.cpp +++ b/toolchain/sem_ir/inst_namer.cpp @@ -13,6 +13,7 @@ #include "toolchain/sem_ir/function.h" #include "toolchain/sem_ir/ids.h" #include "toolchain/sem_ir/inst_kind.h" +#include "toolchain/sem_ir/type_info.h" #include "toolchain/sem_ir/typed_insts.h" namespace Carbon::SemIR { @@ -388,7 +389,8 @@ auto InstNamer::CollectNamesInBlock(ScopeId scope_id, (sem_ir_->names().GetIRBaseName(name_id).str() + suffix).str()); }; auto add_int_or_float_type_name = [&](char type_literal_prefix, - SemIR::InstId bit_width_id) { + SemIR::InstId bit_width_id, + llvm::StringRef suffix = "") { std::string name; llvm::raw_string_ostream out(name); out << type_literal_prefix; @@ -397,6 +399,7 @@ auto InstNamer::CollectNamesInBlock(ScopeId scope_id, } else { out << "N"; } + out << suffix; add_inst_name(std::move(name)); }; auto facet_access_name_id = [&](InstId facet_value_inst_id) -> NameId { @@ -510,6 +513,11 @@ auto InstNamer::CollectNamesInBlock(ScopeId scope_id, continue; } case CARBON_KIND(ClassType inst): { + if (auto literal_info = NumericTypeLiteralInfo::ForType(*sem_ir_, inst); + literal_info.is_valid()) { + add_inst_name(literal_info.GetLiteralAsString(*sem_ir_)); + break; + } add_inst_name_id(sem_ir_->classes().Get(inst.class_id).name_id); continue; } @@ -658,7 +666,7 @@ auto InstNamer::CollectNamesInBlock(ScopeId scope_id, } case CARBON_KIND(IntType inst): { add_int_or_float_type_name(inst.int_kind == IntKind::Signed ? 'i' : 'u', - inst.bit_width_id); + inst.bit_width_id, ".builtin"); continue; } case CARBON_KIND(IntValue inst): { diff --git a/toolchain/sem_ir/name_scope.cpp b/toolchain/sem_ir/name_scope.cpp index d87e9d2e96626..bd064afc9fcbd 100644 --- a/toolchain/sem_ir/name_scope.cpp +++ b/toolchain/sem_ir/name_scope.cpp @@ -4,6 +4,8 @@ #include "toolchain/sem_ir/name_scope.h" +#include "toolchain/sem_ir/file.h" + namespace Carbon::SemIR { auto NameScope::Print(llvm::raw_ostream& out) const -> void { @@ -51,4 +53,25 @@ auto NameScope::LookupOrAdd(SemIR::NameId name_id, InstId inst_id, return {true, EntryId(names_.size() - 1)}; } +auto NameScopeStore::GetInstIfValid(NameScopeId scope_id) const + -> std::pair> { + if (!scope_id.is_valid()) { + return {InstId::Invalid, std::nullopt}; + } + auto inst_id = Get(scope_id).inst_id(); + if (!inst_id.is_valid()) { + return {InstId::Invalid, std::nullopt}; + } + return {inst_id, file_->insts().Get(inst_id)}; +} + +auto NameScopeStore::IsCorePackage(NameScopeId scope_id) const -> bool { + if (!IsPackage(scope_id)) { + return false; + } + auto scope_name = + file_->names().GetAsStringIfIdentifier(Get(scope_id).name_id()); + return scope_name == "Core"; +} + } // namespace Carbon::SemIR diff --git a/toolchain/sem_ir/name_scope.h b/toolchain/sem_ir/name_scope.h index e7b38278220bb..c9fa8b1f5208a 100644 --- a/toolchain/sem_ir/name_scope.h +++ b/toolchain/sem_ir/name_scope.h @@ -163,7 +163,7 @@ class NameScope : public Printable { // Provides a ValueStore wrapper for an API specific to name scopes. class NameScopeStore { public: - explicit NameScopeStore(InstStore* insts) : insts_(insts) {} + explicit NameScopeStore(const File* file) : file_(file) {} // Adds a name scope, returning an ID to reference it. auto Add(InstId inst_id, NameId name_id, NameScopeId parent_scope_id) @@ -191,17 +191,21 @@ class NameScopeStore { // Returns the instruction owning the requested name scope, or Invalid with // nullopt if the scope is either invalid or has no associated instruction. auto GetInstIfValid(NameScopeId scope_id) const - -> std::pair> { + -> std::pair>; + + // Returns whether the provided scope ID is for a package scope. + auto IsPackage(NameScopeId scope_id) const -> bool { if (!scope_id.is_valid()) { - return {InstId::Invalid, std::nullopt}; - } - auto inst_id = Get(scope_id).inst_id(); - if (!inst_id.is_valid()) { - return {InstId::Invalid, std::nullopt}; + return false; } - return {inst_id, insts_->Get(inst_id)}; + // A package is either the current package or an imported package. + return scope_id == SemIR::NameScopeId::Package || + Get(scope_id).is_imported_package(); } + // Returns whether the provided scope ID is for the Core package. + auto IsCorePackage(NameScopeId scope_id) const -> bool; + auto OutputYaml() const -> Yaml::OutputMapping { return values_.OutputYaml(); } @@ -213,7 +217,7 @@ class NameScopeStore { } private: - InstStore* insts_; + const File* file_; ValueStore values_; }; diff --git a/toolchain/sem_ir/stringify_type.cpp b/toolchain/sem_ir/stringify_type.cpp index 659ee92a968ea..392080b74ae3c 100644 --- a/toolchain/sem_ir/stringify_type.cpp +++ b/toolchain/sem_ir/stringify_type.cpp @@ -7,6 +7,7 @@ #include "toolchain/base/kind_switch.h" #include "toolchain/sem_ir/entity_with_params_base.h" #include "toolchain/sem_ir/ids.h" +#include "toolchain/sem_ir/type_info.h" namespace Carbon::SemIR { @@ -203,6 +204,11 @@ auto StringifyTypeExpr(const SemIR::File& sem_ir, InstId outer_inst_id) } case CARBON_KIND(ClassType inst): { const auto& class_info = sem_ir.classes().Get(inst.class_id); + if (auto literal_info = NumericTypeLiteralInfo::ForType(sem_ir, inst); + literal_info.is_valid()) { + literal_info.PrintLiteral(sem_ir, out); + break; + } step_stack.PushEntityName(class_info, inst.specific_id); break; } @@ -321,12 +327,14 @@ auto StringifyTypeExpr(const SemIR::File& sem_ir, InstId outer_inst_id) break; } case CARBON_KIND(IntType inst): { + out << ""); if (auto width_value = sem_ir.insts().TryGetAs(inst.bit_width_id)) { out << (inst.int_kind.is_signed() ? "i" : "u"); sem_ir.ints().Get(width_value->int_id).print(out, /*isSigned=*/false); } else { - out << (inst.int_kind.is_signed() ? "Core.Int(" : "Core.UInt("); + out << (inst.int_kind.is_signed() ? "Int(" : "UInt("); step_stack.PushString(")"); step_stack.PushInstId(inst.bit_width_id); } diff --git a/toolchain/sem_ir/type_info.cpp b/toolchain/sem_ir/type_info.cpp index 5a2f9b933a5c3..6143fc6879471 100644 --- a/toolchain/sem_ir/type_info.cpp +++ b/toolchain/sem_ir/type_info.cpp @@ -67,4 +67,64 @@ auto InitRepr::ForType(const File& file, TypeId type_id) -> InitRepr { } } +auto NumericTypeLiteralInfo::ForType(const File& file, ClassType class_type) + -> NumericTypeLiteralInfo { + // Quickly rule out any class that's not a specific. + if (!class_type.specific_id.is_valid()) { + return NumericTypeLiteralInfo::Invalid; + } + + // The class must be declared in the `Core` package. + const auto& class_info = file.classes().Get(class_type.class_id); + if (!class_info.scope_id.is_valid() || + !file.name_scopes().IsCorePackage( + file.name_scopes().Get(class_info.scope_id).parent_scope_id())) { + return NumericTypeLiteralInfo::Invalid; + } + + // The class's name must be the name corresponding to a type literal. + auto name_ident = file.names().GetAsStringIfIdentifier(class_info.name_id); + if (!name_ident) { + return NumericTypeLiteralInfo::Invalid; + } + Kind kind = llvm::StringSwitch(*name_ident) + .Case("Int", Int) + .Case("UInt", UInt) + .Case("Float", Float) + .Default(None); + if (kind == None) { + return NumericTypeLiteralInfo::Invalid; + } + + // There must be exactly one argument. + const auto& specific = file.specifics().Get(class_type.specific_id); + auto args = file.inst_blocks().Get(specific.args_id); + if (args.size() != 1) { + return NumericTypeLiteralInfo::Invalid; + } + + // And the argument must be an integer value. + auto width_arg = file.insts().TryGetAs(args[0]); + if (!width_arg) { + return NumericTypeLiteralInfo::Invalid; + } + return {.kind = kind, .bit_width_id = width_arg->int_id}; +} + +auto NumericTypeLiteralInfo::PrintLiteral(const File& file, + llvm::raw_ostream& out) const + -> void { + CARBON_CHECK(is_valid()); + out << static_cast(kind); + file.ints().Get(bit_width_id).print(out, /*isSigned=*/false); +} + +auto NumericTypeLiteralInfo::GetLiteralAsString(const File& file) const + -> std::string { + std::string result; + llvm::raw_string_ostream out(result); + PrintLiteral(file, out); + return result; +} + } // namespace Carbon::SemIR diff --git a/toolchain/sem_ir/type_info.h b/toolchain/sem_ir/type_info.h index e184ad177d2b7..d957bd5d91761 100644 --- a/toolchain/sem_ir/type_info.h +++ b/toolchain/sem_ir/type_info.h @@ -147,6 +147,42 @@ struct ReturnTypeInfo { InitRepr init_repr; }; +// Information about the numeric type literal that corresponds to a type. +struct NumericTypeLiteralInfo { + // The kind of a numeric type literal, as determined by the letter that + // prefixes the bit width. + enum Kind : char { + None = 0, + Int = 'i', + UInt = 'u', + Float = 'f', + }; + + static const NumericTypeLiteralInfo Invalid; + + // Returns the numeric type literal that would evaluate to this class type, if + // any. + static auto ForType(const File& file, ClassType class_type) + -> NumericTypeLiteralInfo; + + // Prints the numeric type literal that corresponds to this type. + auto PrintLiteral(const File& file, llvm::raw_ostream& out) const -> void; + + // Gets a string containing the literal. + auto GetLiteralAsString(const File& file) const -> std::string; + + // Returns whether this is a valid numeric type literal. + auto is_valid() const -> bool { return kind != None; } + + // The kind of this type literal. + Kind kind; + // The bit width of this type literal. + IntId bit_width_id; +}; + +inline constexpr NumericTypeLiteralInfo NumericTypeLiteralInfo::Invalid = { + .kind = None, .bit_width_id = IntId::Invalid}; + } // namespace Carbon::SemIR #endif // CARBON_TOOLCHAIN_SEM_IR_TYPE_INFO_H_ diff --git a/toolchain/sem_ir/typed_insts.h b/toolchain/sem_ir/typed_insts.h index b2cdaca8f21a6..2b421c85f3708 100644 --- a/toolchain/sem_ir/typed_insts.h +++ b/toolchain/sem_ir/typed_insts.h @@ -914,7 +914,9 @@ struct IntLiteralType { TypeId type_id; }; -// An integer type. +// A primitive integer type whose representation and operations are defined by +// the toolchain. The `Core.Int` and `Core.UInt` classes are defined as adapters +// for this type. struct IntType { static constexpr auto Kind = InstKind::IntType.Define( {.ir_name = "int_type", From 76055de0635087d793df45059731ae4027c4696f Mon Sep 17 00:00:00 2001 From: Jon Ross-Perkins Date: Mon, 16 Dec 2024 15:59:06 -0800 Subject: [PATCH 34/68] Shuffle around yaml formatting in .clang-tidy (#4690) I was looking at this again, considering how best to add new checks, and realized we could just change the format and probably get better deltas in the future. This change should just be formatting, with no functional impact. --- .clang-tidy | 214 ++++++++++++++++++++++++++-------------------------- 1 file changed, 109 insertions(+), 105 deletions(-) diff --git a/.clang-tidy b/.clang-tidy index 92a7b199da445..fec217e3af72d 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -8,110 +8,114 @@ UseColor: true # This is necessary for `--config=clang-tidy` to catch errors. WarningsAsErrors: '*' -# We turn on all `bugprone`, `google`, `modernize`, `performance`, and -# `readability` by default. A few `misc` are selectively enabled, and a few -# other checks are selectively disabled. -# -# Checks with nuanced reasons for disabling are: -# -# - `bugprone-branch-clone` warns when we have multiple empty cases in switches, -# which we do for comment reasons. -# - `bugprone-easily-swappable-parameters` frequently warns on multiple -# parameters of the same type. -# - `bugprone-exception-escape` finds issues like out-of-memory in main(). We -# don't use exceptions, so it's unlikely to find real issues. -# - `bugprone-macro-parentheses` has false positives in places such as using an -# argument to declare a name, which cannot have parentheses. For our limited -# use of macros, this is a common conflict. -# - `bugprone-narrowing-conversions` conflicts with integer type C++ style. -# - `google-readability-todo` suggests usernames on TODOs, which we don't want. -# - `bugprone-switch-missing-default-case` has false positives for -# `enum_base.h`. Clang's built-in switch warnings cover most of our risk of -# bugs here. -# - `bugprone-unchecked-optional-access` in clang-tidy 16 has false positives on -# code like: -# while (auto name_ref = insts().Get(inst_id).TryAs()) { -# inst_id = name_ref->value_id; -# ^ unchecked access to optional value -# } -# - `google-readability-function-size` overlaps with -# `readability-function-size`. -# - `modernize-avoid-c-arrays` suggests `std::array`, which we could migrate to, -# but conflicts with the status quo. -# - `modernize-use-designated-initializers` fires on creation of SemIR typed -# insts, for which we do not currently want to use designated initialization. -# - `modernize-use-nodiscard` is disabled because it only fixes const methods, -# not non-const, which yields distracting results on accessors. -# - `performance-unnecessary-value-param` duplicates `modernize-pass-by-value`. -# - `readability-enum-initial-value` warns on enums which use the -# `LastValue = Value` pattern if all the other discriminants aren't given an -# explicit value. -# - `readability-function-cognitive-complexity` warns too frequently. -# - `readability-magic-numbers` warns in reasonably documented situations. -# - `readability-redundant-member-init` warns on `= {}` which is also used to -# indicate which fields do not need to be explicitly initialized in aggregate -# initialization. -# - `readability-suspicious-call-argument` warns when callers use similar names -# as different parameters. -# -# Checks that are essentially style choices we don't apply are: -# -# - `modernize-return-braced-init-list` -# - `modernize-use-default-member-init` -# - `modernize-use-emplace` -# - `readability-convert-member-functions-to-static` -# - `readability-else-after-return` -# - `readability-identifier-length` -# - `readability-implicit-bool-conversion` -# - `readability-make-member-function-const` -# - `readability-static-definition-in-anonymous-namespace` -# - `readability-use-anyofallof` Checks: - -*, bugprone-*, -bugprone-branch-clone, -bugprone-easily-swappable-parameters, - -bugprone-exception-escape, -bugprone-macro-parentheses, - -bugprone-narrowing-conversions, -bugprone-switch-missing-default-case, - -bugprone-unchecked-optional-access, google-*, - -google-readability-function-size, -google-readability-todo, - misc-definitions-in-headers, misc-misplaced-const, misc-redundant-expression, - misc-static-assert, misc-unconventional-assign-operator, - misc-uniqueptr-reset-release, misc-unused-*, modernize-*, - -modernize-avoid-c-arrays, -modernize-return-braced-init-list, - -modernize-use-default-member-init, -modernize-use-designated-initializers, - -modernize-use-emplace, -modernize-use-nodiscard, performance-*, - -performance-unnecessary-value-param, readability-*, - -readability-convert-member-functions-to-static, - -readability-else-after-return, -readability-enum-initial-value, - -readability-function-cognitive-complexity, -readability-identifier-length, - -readability-implicit-bool-conversion, -readability-magic-numbers, - -readability-make-member-function-const, -readability-redundant-member-init, - -readability-static-definition-in-anonymous-namespace, - -readability-suspicious-call-argument, -readability-use-anyofallof + # We turn on all of a few categories by default. + - '-*' + - 'bugprone-*' + - 'google-*' + - 'modernize-*' + - 'performance-*' + - 'readability-*' + + # `misc` is selectively enabled because we want a minority of them. + - 'misc-definitions-in-headers' + - 'misc-misplaced-const' + - 'misc-redundant-expression' + - 'misc-static-assert' + - 'misc-unconventional-assign-operator' + - 'misc-uniqueptr-reset-release' + - 'misc-unused-*' + + # Disabled due to the implied style choices. + - '-modernize-return-braced-init-list' + - '-modernize-use-default-member-init' + - '-modernize-use-emplace' + - '-readability-convert-member-functions-to-static' + - '-readability-else-after-return' + - '-readability-identifier-length' + - '-readability-implicit-bool-conversion' + - '-readability-make-member-function-const' + - '-readability-static-definition-in-anonymous-namespace' + - '-readability-use-anyofallof' + + # Warns when we have multiple empty cases in switches, which we do for comment + # reasons. + - '-bugprone-branch-clone' + # Frequently warns on multiple parameters of the same type. + - '-bugprone-easily-swappable-parameters' + # Finds issues like out-of-memory in main(). We don't use exceptions, so it's + # unlikely to find real issues. + - '-bugprone-exception-escape' + # Has false positives in places such as using an argument to declare a name, + # which cannot have parentheses. For our limited use of macros, this is a + # common conflict. + - '-bugprone-macro-parentheses' + # Conflicts with integer type C++ style. + - '-bugprone-narrowing-conversions' + # Has false positives for `enum_base.h`. Clang's built-in switch warnings + # cover most of our risk of bugs here. + - '-bugprone-switch-missing-default-case' + # In clang-tidy 16, has false positives on code like: + # while (auto name_ref = insts().Get(inst_id).TryAs()) { + # inst_id = name_ref->value_id; + # ^ unchecked access to optional value + # } + - '-bugprone-unchecked-optional-access' + # Overlaps with `readability-function-size`. + - '-google-readability-function-size' + # Suggests usernames on TODOs, which we don't want. + - '-google-readability-todo' + # Suggests `std::array`, which we could migrate to, but conflicts with the + # status quo. + - '-modernize-avoid-c-arrays' + # Warns on creation of SemIR typed insts, for which we do not currently want + # to use designated initialization. + - '-modernize-use-designated-initializers' + # Only fixes const methods, not non-const, which yields distracting results on + # accessors. + - '-modernize-use-nodiscard' + # Duplicates `modernize-pass-by-value`. + - '-performance-unnecessary-value-param' + # Warns on enums which use the `LastValue = Value` pattern if all the other + # discriminants aren't given an explicit value. + - '-readability-enum-initial-value' + # Warns too frequently. + - '-readability-function-cognitive-complexity' + # Warns in reasonably documented situations. + - '-readability-magic-numbers' + # Warns on `= {}` which is also used to indicate which fields do not need to + # be explicitly initialized in aggregate initialization. + - '-readability-redundant-member-init' + # Warns when callers use similar names as different parameters. + - '-readability-suspicious-call-argument' CheckOptions: - - { key: readability-identifier-naming.ClassCase, value: CamelCase } - - { key: readability-identifier-naming.ClassConstantCase, value: CamelCase } - - { - key: readability-identifier-naming.ConstexprVariableCase, - value: CamelCase, - } - - { key: readability-identifier-naming.NamespaceCase, value: CamelCase } - - { key: readability-identifier-naming.StructCase, value: CamelCase } - - { - key: readability-identifier-naming.TemplateParameterCase, - value: CamelCase, - } - - { key: readability-identifier-naming.TypeAliasCase, value: CamelCase } - - { key: readability-identifier-naming.TypedefCase, value: CamelCase } - - { key: readability-identifier-naming.UnionCase, value: CamelCase } - - { key: readability-identifier-naming.VariableCase, value: lower_case } - - { key: readability-identifier-naming.ParameterCase, value: lower_case } - - { key: readability-identifier-naming.ClassMemberCase, value: lower_case } - - { - key: readability-identifier-naming.MethodIgnoredRegexp, - value: '^classof$', - } - - { - # This erroneously fires in C++20 mode with LLVM 16 clang-tidy, due to: - # https://github.com/llvm/llvm-project/issues/46097 - key: readability-identifier-naming.TemplateParameterIgnoredRegexp, - value: '^expr-type$', - } + - key: readability-identifier-naming.ClassCase + value: CamelCase + - key: readability-identifier-naming.ClassConstantCase + value: CamelCase + - key: readability-identifier-naming.ConstexprVariableCase + value: CamelCase + - key: readability-identifier-naming.NamespaceCase + value: CamelCase + - key: readability-identifier-naming.StructCase + value: CamelCase + - key: readability-identifier-naming.TemplateParameterCase + value: CamelCase + - key: readability-identifier-naming.TypeAliasCase + value: CamelCase + - key: readability-identifier-naming.TypedefCase + value: CamelCase + - key: readability-identifier-naming.UnionCase + value: CamelCase + - key: readability-identifier-naming.ClassMemberCase + value: lower_case + - key: readability-identifier-naming.ParameterCase + value: lower_case + - key: readability-identifier-naming.VariableCase + value: lower_case + - key: readability-identifier-naming.MethodIgnoredRegexp + value: '^classof$' + # This erroneously fires in C++20 mode with LLVM 16 clang-tidy, due to: + # https://github.com/llvm/llvm-project/issues/46097 + - key: readability-identifier-naming.TemplateParameterIgnoredRegexp + value: '^expr-type$' From b25117b508c1143497f96eb859345040867c8a60 Mon Sep 17 00:00:00 2001 From: josh11b <15258583+josh11b@users.noreply.github.com> Date: Mon, 16 Dec 2024 16:39:48 -0800 Subject: [PATCH 35/68] Do not resolve the declaration when forming a specific for use in an eval block (#4692) When substituting into a generic in order to form a generic eval block, we form `SpecificId`s to track the list of arguments that should eventually be used to form a specific referenced by the eval block. Values within that specific are not needed and won't ever be used, so it's safe to skip forming them in the first place. Co-authored-by: Josh L --- toolchain/check/subst.cpp | 10 +--- .../testdata/class/fail_generic_method.carbon | 10 +--- .../check/testdata/class/generic/adapt.carbon | 25 ++------ .../class/generic/base_is_generic.carbon | 58 ++++-------------- .../check/testdata/class/generic/basic.carbon | 15 +---- .../check/testdata/class/generic/call.carbon | 40 +++---------- .../generic/complete_in_conversion.carbon | 5 +- .../check/testdata/class/generic/field.carbon | 15 +---- .../testdata/class/generic/import.carbon | 25 ++------ .../check/testdata/class/generic/init.carbon | 15 +---- .../class/generic/member_access.carbon | 35 +++-------- .../class/generic/member_inline.carbon | 20 ++----- .../class/generic/member_lookup.carbon | 60 ++++--------------- .../class/generic/member_out_of_line.carbon | 42 +++---------- .../class/generic/method_deduce.carbon | 29 ++------- .../check/testdata/class/generic/self.carbon | 30 ++-------- .../testdata/class/generic/stringify.carbon | 5 +- .../testdata/class/generic_method.carbon | 10 +--- .../class/no_prelude/generic_vs_params.carbon | 5 +- .../check/testdata/deduce/generic_type.carbon | 55 +++-------------- toolchain/check/testdata/deduce/tuple.carbon | 13 +--- .../testdata/deduce/type_operator.carbon | 26 ++------ .../no_prelude/call_from_operator.carbon | 40 +++---------- .../testdata/function/generic/deduce.carbon | 36 ++--------- .../function/generic/no_prelude/call.carbon | 20 ++----- .../generic/no_prelude/import_specific.carbon | 10 +--- .../function/generic/redeclare.carbon | 6 +- .../function/generic/return_slot.carbon | 14 +---- .../testdata/generic/complete_type.carbon | 5 +- .../testdata/impl/extend_impl_generic.carbon | 46 +++----------- .../impl/fail_extend_impl_forall.carbon | 16 +---- .../impl/fail_self_type_mismatch.carbon | 7 +-- .../check/testdata/impl/impl_forall.carbon | 5 +- .../check/testdata/impl/lookup/generic.carbon | 60 ++++--------------- .../impl/lookup/no_prelude/impl_forall.carbon | 54 ++++------------- .../impl/lookup/no_prelude/import.carbon | 10 +--- .../lookup/no_prelude/specific_args.carbon | 25 ++------ .../impl/no_prelude/import_generic.carbon | 45 +++----------- .../impl/no_prelude/import_use_generic.carbon | 22 ++----- .../impl/no_prelude/interface_args.carbon | 30 ++-------- .../testdata/interface/member_lookup.carbon | 20 ++----- .../no_prelude/assoc_const_in_generic.carbon | 10 +--- .../fail_generic_redeclaration.carbon | 10 +--- .../fail_todo_generic_default_fn.carbon | 15 +---- .../interface/no_prelude/generic.carbon | 20 ++----- .../no_prelude/generic_import.carbon | 10 +--- .../no_prelude/generic_vs_params.carbon | 15 +---- .../no_prelude/syntactic_merge.carbon | 60 ++++--------------- .../operators/overloaded/implicit_as.carbon | 5 +- .../overloaded/no_prelude/index.carbon | 10 +--- .../no_prelude/import_convert_function.carbon | 30 ++-------- .../testdata/where_expr/dot_self_index.carbon | 10 +--- .../testdata/where_expr/equal_rewrite.carbon | 15 +---- 53 files changed, 238 insertions(+), 991 deletions(-) diff --git a/toolchain/check/subst.cpp b/toolchain/check/subst.cpp index 5e96504885031..70766ce9eec72 100644 --- a/toolchain/check/subst.cpp +++ b/toolchain/check/subst.cpp @@ -187,14 +187,10 @@ static auto PopOperand(Context& context, Worklist& worklist, SemIR::IdKind kind, return arg; } auto& specific = context.specifics().Get(specific_id); - auto args_id = + auto args_id = SemIR::InstBlockId( PopOperand(context, worklist, SemIR::IdKind::For, - specific.args_id.index); - // TODO: Provide a location here. - SemIRLoc loc = SemIR::InstId::Invalid; - return MakeSpecific(context, loc, specific.generic_id, - SemIR::InstBlockId(args_id)) - .index; + specific.args_id.index)); + return context.specifics().GetOrAdd(specific.generic_id, args_id).index; } case SemIR::IdKind::For: { const auto& old_facet_type_info = diff --git a/toolchain/check/testdata/class/fail_generic_method.carbon b/toolchain/check/testdata/class/fail_generic_method.carbon index 159e1833d04dd..a29eab64d3a95 100644 --- a/toolchain/check/testdata/class/fail_generic_method.carbon +++ b/toolchain/check/testdata/class/fail_generic_method.carbon @@ -157,20 +157,14 @@ fn Class(N:! i32).F[self: Self](n: T) {} // CHECK:STDOUT: %T.patt.loc11_13.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Class(@F.%T) { -// CHECK:STDOUT: %T.loc11_13.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc11_13.2 => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @Class(@F.%T) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%T) { // CHECK:STDOUT: %T => constants.%T // CHECK:STDOUT: %Class => constants.%Class // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Class(%T.loc11_13.2) { -// CHECK:STDOUT: %T.loc11_13.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc11_13.2 => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @Class(%T.loc11_13.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @.1(constants.%N.2) { // CHECK:STDOUT: %N.loc32_10.2 => constants.%N.2 diff --git a/toolchain/check/testdata/class/generic/adapt.carbon b/toolchain/check/testdata/class/generic/adapt.carbon index ea77155603697..fbd77d1ae7675 100644 --- a/toolchain/check/testdata/class/generic/adapt.carbon +++ b/toolchain/check/testdata/class/generic/adapt.carbon @@ -241,10 +241,7 @@ fn ImportedConvertLocal(a: Adapter(C)) -> i32 { // CHECK:STDOUT: %T.patt.loc4_9.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @C(%T.loc4_9.2) { -// CHECK:STDOUT: %T.loc4_9.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc4_9.2 => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @C(%T.loc4_9.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @C(constants.%i32) { // CHECK:STDOUT: %T.loc4_9.2 => constants.%i32 @@ -382,10 +379,7 @@ fn ImportedConvertLocal(a: Adapter(C)) -> i32 { // CHECK:STDOUT: %complete_type => constants.%complete_type.3 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @C(%T) { -// CHECK:STDOUT: %T => constants.%T -// CHECK:STDOUT: %T.patt => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @C(%T) {} // CHECK:STDOUT: // CHECK:STDOUT: --- fail_todo_extend_adapt_specific_type.carbon // CHECK:STDOUT: @@ -504,10 +498,7 @@ fn ImportedConvertLocal(a: Adapter(C)) -> i32 { // CHECK:STDOUT: %T.patt.loc4_9.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @C(%T.loc4_9.2) { -// CHECK:STDOUT: %T.loc4_9.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc4_9.2 => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @C(%T.loc4_9.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @C(constants.%i32) { // CHECK:STDOUT: %T.loc4_9.2 => constants.%i32 @@ -611,10 +602,7 @@ fn ImportedConvertLocal(a: Adapter(C)) -> i32 { // CHECK:STDOUT: %T.patt.loc7_9.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @C(%T.loc7_9.2) { -// CHECK:STDOUT: %T.loc7_9.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc7_9.2 => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @C(%T.loc7_9.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @C(constants.%i32) { // CHECK:STDOUT: %T.loc7_9.2 => constants.%i32 @@ -745,10 +733,7 @@ fn ImportedConvertLocal(a: Adapter(C)) -> i32 { // CHECK:STDOUT: %complete_type => constants.%complete_type.3 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @C(%T) { -// CHECK:STDOUT: %T => constants.%T -// CHECK:STDOUT: %T.patt => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @C(%T) {} // CHECK:STDOUT: // CHECK:STDOUT: --- adapt_generic_type.carbon // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/generic/base_is_generic.carbon b/toolchain/check/testdata/class/generic/base_is_generic.carbon index 42d0a42729e50..e73a3bf47288d 100644 --- a/toolchain/check/testdata/class/generic/base_is_generic.carbon +++ b/toolchain/check/testdata/class/generic/base_is_generic.carbon @@ -223,10 +223,7 @@ fn H() { // CHECK:STDOUT: %T.patt.loc4_17.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Base(%T.loc4_17.2) { -// CHECK:STDOUT: %T.loc4_17.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc4_17.2 => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @Base(%T.loc4_17.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @Base(constants.%Param) { // CHECK:STDOUT: %T.loc4_17.2 => constants.%Param @@ -380,10 +377,7 @@ fn H() { // CHECK:STDOUT: %complete_type => constants.%complete_type.5 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Base(%T) { -// CHECK:STDOUT: %T => constants.%T -// CHECK:STDOUT: %T.patt => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @Base(%T) {} // CHECK:STDOUT: // CHECK:STDOUT: --- fail_todo_extend_symbolic_base.carbon // CHECK:STDOUT: @@ -673,19 +667,11 @@ fn H() { // CHECK:STDOUT: %G.specific_fn.loc5_24.2 => constants.%G.specific_fn.1 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @X(%U.loc4_14.2) { -// CHECK:STDOUT: %U.loc4_14.2 => constants.%U -// CHECK:STDOUT: %U.patt.loc4_14.2 => constants.%U -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @X(%U.loc4_14.2) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @X(@G.%U) { -// CHECK:STDOUT: %U.loc4_14.2 => constants.%U -// CHECK:STDOUT: %U.patt.loc4_14.2 => constants.%U -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @X(@G.%U) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @G(%U) { -// CHECK:STDOUT: %U => constants.%U -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @G(%U) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @C(constants.%T) { // CHECK:STDOUT: %T.loc8_9.2 => constants.%T @@ -701,15 +687,9 @@ fn H() { // CHECK:STDOUT: %G => constants.%G.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @X(@C.%T.loc8_9.2) { -// CHECK:STDOUT: %U.loc4_14.2 => constants.%T -// CHECK:STDOUT: %U.patt.loc4_14.2 => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @X(@C.%T.loc8_9.2) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @C(%T.loc8_9.2) { -// CHECK:STDOUT: %T.loc8_9.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc8_9.2 => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @C(%T.loc8_9.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @C(constants.%i32) { // CHECK:STDOUT: %T.loc8_9.2 => constants.%i32 @@ -903,20 +883,11 @@ fn H() { // CHECK:STDOUT: %T.patt => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @X(%U) { -// CHECK:STDOUT: %U => constants.%U -// CHECK:STDOUT: %U.patt => constants.%U -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @X(%U) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @X(@C.%T) { -// CHECK:STDOUT: %U => constants.%T -// CHECK:STDOUT: %U.patt => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @X(@C.%T) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @C(%T) { -// CHECK:STDOUT: %T => constants.%T -// CHECK:STDOUT: %T.patt => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @C(%T) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @G(constants.%U) { // CHECK:STDOUT: %U => constants.%U @@ -928,14 +899,9 @@ fn H() { // CHECK:STDOUT: %G.specific_fn => constants.%G.specific_fn.1 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @X(@G.%U) { -// CHECK:STDOUT: %U => constants.%U -// CHECK:STDOUT: %U.patt => constants.%U -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @X(@G.%U) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @G(%U) { -// CHECK:STDOUT: %U => constants.%U -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @G(%U) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @C(constants.%i32) { // CHECK:STDOUT: %T => constants.%i32 diff --git a/toolchain/check/testdata/class/generic/basic.carbon b/toolchain/check/testdata/class/generic/basic.carbon index c93191c8781e9..8f57ad7b575e6 100644 --- a/toolchain/check/testdata/class/generic/basic.carbon +++ b/toolchain/check/testdata/class/generic/basic.carbon @@ -203,10 +203,7 @@ class Declaration(T:! type); // CHECK:STDOUT: %complete_type.loc22_1.2 => constants.%complete_type // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Class(@GetAddr.%T) { -// CHECK:STDOUT: %T.loc11_13.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc11_13.2 => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @Class(@GetAddr.%T) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @GetAddr(constants.%T) { // CHECK:STDOUT: %T => constants.%T @@ -215,20 +212,14 @@ class Declaration(T:! type); // CHECK:STDOUT: %ptr.loc12_38.1 => constants.%ptr.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Class(@GetValue.%T) { -// CHECK:STDOUT: %T.loc11_13.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc11_13.2 => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @Class(@GetValue.%T) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @GetValue(constants.%T) { // CHECK:STDOUT: %T => constants.%T // CHECK:STDOUT: %Class => constants.%Class // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Class(%T.loc11_13.2) { -// CHECK:STDOUT: %T.loc11_13.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc11_13.2 => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @Class(%T.loc11_13.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @Declaration(constants.%T) { // CHECK:STDOUT: %T.loc24_19.2 => constants.%T diff --git a/toolchain/check/testdata/class/generic/call.carbon b/toolchain/check/testdata/class/generic/call.carbon index 066cbe25b9e85..377985bd09b08 100644 --- a/toolchain/check/testdata/class/generic/call.carbon +++ b/toolchain/check/testdata/class/generic/call.carbon @@ -717,10 +717,7 @@ class Outer(T:! type) { // CHECK:STDOUT: %D => constants.%D.1 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Outer(@A.%T) { -// CHECK:STDOUT: %T.loc2_13.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc2_13.2 => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @Outer(@A.%T) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @A(constants.%T, constants.%U) { // CHECK:STDOUT: %T => constants.%T @@ -736,10 +733,7 @@ class Outer(T:! type) { // CHECK:STDOUT: %Inner.generic => constants.%Inner.generic.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Outer(@B.%U) { -// CHECK:STDOUT: %T.loc2_13.2 => constants.%U -// CHECK:STDOUT: %T.patt.loc2_13.2 => constants.%U -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @Outer(@B.%U) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @B(constants.%T, constants.%U) { // CHECK:STDOUT: %U => constants.%U @@ -762,15 +756,9 @@ class Outer(T:! type) { // CHECK:STDOUT: %D => constants.%D.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Outer(@C.%T) { -// CHECK:STDOUT: %T.loc2_13.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc2_13.2 => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @Outer(@C.%T) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @Inner(@C.%T, @C.%T) { -// CHECK:STDOUT: %U.loc3_15.2 => constants.%T -// CHECK:STDOUT: %U.patt.loc3_15.2 => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @Inner(@C.%T, @C.%T) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @C(constants.%T, constants.%U) { // CHECK:STDOUT: %T => constants.%T @@ -779,15 +767,9 @@ class Outer(T:! type) { // CHECK:STDOUT: %Inner.loc10_22.1 => constants.%Inner.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Outer(@D.%T) { -// CHECK:STDOUT: %T.loc2_13.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc2_13.2 => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @Outer(@D.%T) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @Inner(@D.%T, @D.%U) { -// CHECK:STDOUT: %U.loc3_15.2 => constants.%U -// CHECK:STDOUT: %U.patt.loc3_15.2 => constants.%U -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @Inner(@D.%T, @D.%U) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @D(constants.%T, constants.%U) { // CHECK:STDOUT: %T => constants.%T @@ -797,13 +779,7 @@ class Outer(T:! type) { // CHECK:STDOUT: %Inner.loc13_22.1 => constants.%Inner.1 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Inner(%T, %U.loc3_15.2) { -// CHECK:STDOUT: %U.loc3_15.2 => constants.%U -// CHECK:STDOUT: %U.patt.loc3_15.2 => constants.%U -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @Inner(%T, %U.loc3_15.2) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @Outer(%T.loc2_13.2) { -// CHECK:STDOUT: %T.loc2_13.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc2_13.2 => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @Outer(%T.loc2_13.2) {} // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/generic/complete_in_conversion.carbon b/toolchain/check/testdata/class/generic/complete_in_conversion.carbon index 87243bb9824d1..25f7c6f0cf00e 100644 --- a/toolchain/check/testdata/class/generic/complete_in_conversion.carbon +++ b/toolchain/check/testdata/class/generic/complete_in_conversion.carbon @@ -213,10 +213,7 @@ fn F(a: A(0)*) { // CHECK:STDOUT: %N.patt.loc6_9.2 => constants.%N.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @A(%N.loc6_9.2) { -// CHECK:STDOUT: %N.loc6_9.2 => constants.%N.2 -// CHECK:STDOUT: %N.patt.loc6_9.2 => constants.%N.2 -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @A(%N.loc6_9.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @A(constants.%int_0.2) { // CHECK:STDOUT: %N.loc6_9.2 => constants.%int_0.2 diff --git a/toolchain/check/testdata/class/generic/field.carbon b/toolchain/check/testdata/class/generic/field.carbon index d5dbf7c26a876..8bf84d3bab364 100644 --- a/toolchain/check/testdata/class/generic/field.carbon +++ b/toolchain/check/testdata/class/generic/field.carbon @@ -226,10 +226,7 @@ fn H(U:! type, c: Class(U)) -> U { // CHECK:STDOUT: %complete_type.loc13_1.2 => constants.%complete_type.1 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Class(%T.loc11_13.2) { -// CHECK:STDOUT: %T.loc11_13.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc11_13.2 => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @Class(%T.loc11_13.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(constants.%i32) { // CHECK:STDOUT: %T.loc11_13.2 => constants.%i32 @@ -243,10 +240,7 @@ fn H(U:! type, c: Class(U)) -> U { // CHECK:STDOUT: %complete_type.loc13_1.2 => constants.%complete_type.4 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Class(@G.%T.loc19_6.2) { -// CHECK:STDOUT: %T.loc11_13.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc11_13.2 => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @Class(@G.%T.loc19_6.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @G(constants.%T) { // CHECK:STDOUT: %T.loc19_6.2 => constants.%T @@ -266,10 +260,7 @@ fn H(U:! type, c: Class(U)) -> U { // CHECK:STDOUT: %complete_type.loc13_1.2 => constants.%complete_type.5 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Class(@H.%U.loc23_6.2) { -// CHECK:STDOUT: %T.loc11_13.2 => constants.%U -// CHECK:STDOUT: %T.patt.loc11_13.2 => constants.%U -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @Class(@H.%U.loc23_6.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @H(constants.%U) { // CHECK:STDOUT: %U.loc23_6.2 => constants.%U diff --git a/toolchain/check/testdata/class/generic/import.carbon b/toolchain/check/testdata/class/generic/import.carbon index c174a35d87bd8..42a27cb9d555c 100644 --- a/toolchain/check/testdata/class/generic/import.carbon +++ b/toolchain/check/testdata/class/generic/import.carbon @@ -234,10 +234,7 @@ class Class(U:! type) { // CHECK:STDOUT: // CHECK:STDOUT: specific @F.1(constants.%T) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @CompleteClass(%T.loc6_21.2) { -// CHECK:STDOUT: %T.loc6_21.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc6_21.2 => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @CompleteClass(%T.loc6_21.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @CompleteClass(constants.%i32) { // CHECK:STDOUT: %T.loc6_21.2 => constants.%i32 @@ -397,10 +394,7 @@ class Class(U:! type) { // CHECK:STDOUT: %T.patt.1 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Class(%T.1) { -// CHECK:STDOUT: %T.1 => constants.%T -// CHECK:STDOUT: %T.patt.1 => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @Class(%T.1) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @CompleteClass(constants.%T) { // CHECK:STDOUT: %T => constants.%T @@ -413,10 +407,7 @@ class Class(U:! type) { // CHECK:STDOUT: %F => constants.%F.1 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @CompleteClass(%T) { -// CHECK:STDOUT: %T => constants.%T -// CHECK:STDOUT: %T.patt => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @CompleteClass(%T) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @F.1(constants.%T) {} // CHECK:STDOUT: @@ -584,10 +575,7 @@ class Class(U:! type) { // CHECK:STDOUT: %F => constants.%F.1 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @CompleteClass(%T) { -// CHECK:STDOUT: %T => constants.%T -// CHECK:STDOUT: %T.patt => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @CompleteClass(%T) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @F.1(constants.%T) {} // CHECK:STDOUT: @@ -720,10 +708,7 @@ class Class(U:! type) { // CHECK:STDOUT: %F => constants.%F.1 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @CompleteClass(%T) { -// CHECK:STDOUT: %T => constants.%T -// CHECK:STDOUT: %T.patt => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @CompleteClass(%T) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @F.1(constants.%T) {} // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/generic/init.carbon b/toolchain/check/testdata/class/generic/init.carbon index 4867fa4d679ff..bbe942e6c1289 100644 --- a/toolchain/check/testdata/class/generic/init.carbon +++ b/toolchain/check/testdata/class/generic/init.carbon @@ -216,20 +216,14 @@ fn InitFromAdaptedSpecific(x: i32) -> i32 { // CHECK:STDOUT: %complete_type.loc6_1.2 => constants.%complete_type.1 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Class(%T.loc4_13.2) { -// CHECK:STDOUT: %T.loc4_13.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc4_13.2 => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @Class(%T.loc4_13.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @InitFromStructGeneric(constants.%T) { // CHECK:STDOUT: %T.loc8_26.2 => constants.%T // CHECK:STDOUT: %T.patt.loc8_26.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Class(@InitFromStructGeneric.%T.loc8_26.2) { -// CHECK:STDOUT: %T.loc4_13.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc4_13.2 => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @Class(@InitFromStructGeneric.%T.loc8_26.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(constants.%i32) { // CHECK:STDOUT: %T.loc4_13.2 => constants.%i32 @@ -396,10 +390,7 @@ fn InitFromAdaptedSpecific(x: i32) -> i32 { // CHECK:STDOUT: %T.patt.loc8_27.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Adapt(@InitFromAdaptedGeneric.%T.loc8_27.2) { -// CHECK:STDOUT: %T.loc4_13.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc4_13.2 => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @Adapt(@InitFromAdaptedGeneric.%T.loc8_27.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @Adapt(constants.%i32) { // CHECK:STDOUT: %T.loc4_13.2 => constants.%i32 diff --git a/toolchain/check/testdata/class/generic/member_access.carbon b/toolchain/check/testdata/class/generic/member_access.carbon index de070de3df3bc..b723c18aab9fa 100644 --- a/toolchain/check/testdata/class/generic/member_access.carbon +++ b/toolchain/check/testdata/class/generic/member_access.carbon @@ -328,20 +328,14 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: %complete_type.loc8_1.2 => constants.%complete_type.1 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Class(@Get.%T) { -// CHECK:STDOUT: %T.loc2_13.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc2_13.2 => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @Class(@Get.%T) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @Get(constants.%T) { // CHECK:STDOUT: %T => constants.%T // CHECK:STDOUT: %Class => constants.%Class.1 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Class(@GetAddr.%T) { -// CHECK:STDOUT: %T.loc2_13.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc2_13.2 => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @Class(@GetAddr.%T) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @GetAddr(constants.%T) { // CHECK:STDOUT: %T => constants.%T @@ -350,10 +344,7 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: %ptr.loc7_38.1 => constants.%ptr.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Class(%T.loc2_13.2) { -// CHECK:STDOUT: %T.loc2_13.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc2_13.2 => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @Class(%T.loc2_13.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(constants.%i32) { // CHECK:STDOUT: %T.loc2_13.2 => constants.%i32 @@ -535,10 +526,7 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: %Make => constants.%Make // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Class(@Make.%T) { -// CHECK:STDOUT: %T.loc4_13.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc4_13.2 => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @Class(@Make.%T) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @Make(constants.%T) { // CHECK:STDOUT: %T => constants.%T @@ -549,15 +537,9 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: %Class.val => constants.%Class.val // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Class(%T.loc4_13.2) { -// CHECK:STDOUT: %T.loc4_13.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc4_13.2 => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @Class(%T.loc4_13.2) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @Class(@StaticMemberFunctionCall.%T.loc8_29.2) { -// CHECK:STDOUT: %T.loc4_13.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc4_13.2 => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @Class(@StaticMemberFunctionCall.%T.loc8_29.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @StaticMemberFunctionCall(constants.%T) { // CHECK:STDOUT: %T.loc8_29.2 => constants.%T @@ -565,8 +547,5 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: %Class.loc8_49.2 => constants.%Class // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Make(@StaticMemberFunctionCall.%T.loc8_29.2) { -// CHECK:STDOUT: %T => constants.%T -// CHECK:STDOUT: %Class.loc5_23.1 => constants.%Class -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @Make(@StaticMemberFunctionCall.%T.loc8_29.2) {} // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/generic/member_inline.carbon b/toolchain/check/testdata/class/generic/member_inline.carbon index 53b910784fe49..daa2d24f0400e 100644 --- a/toolchain/check/testdata/class/generic/member_inline.carbon +++ b/toolchain/check/testdata/class/generic/member_inline.carbon @@ -187,20 +187,14 @@ class C(T:! type) { // CHECK:STDOUT: %T => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Class(@G.%T) { -// CHECK:STDOUT: %T.loc4_13.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc4_13.2 => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @Class(@G.%T) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @G(constants.%T) { // CHECK:STDOUT: %T => constants.%T // CHECK:STDOUT: %Class => constants.%Class // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Class(%T.loc4_13.2) { -// CHECK:STDOUT: %T.loc4_13.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc4_13.2 => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @Class(%T.loc4_13.2) {} // CHECK:STDOUT: // CHECK:STDOUT: --- fail_member_inline.carbon // CHECK:STDOUT: @@ -291,13 +285,7 @@ class C(T:! type) { // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%T) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @C(%T.loc4_9.2) { -// CHECK:STDOUT: %T.loc4_9.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc4_9.2 => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @C(%T.loc4_9.2) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @C(@F.%T) { -// CHECK:STDOUT: %T.loc4_9.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc4_9.2 => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @C(@F.%T) {} // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/generic/member_lookup.carbon b/toolchain/check/testdata/class/generic/member_lookup.carbon index 1b5eb73d30272..4fdc4a9547084 100644 --- a/toolchain/check/testdata/class/generic/member_lookup.carbon +++ b/toolchain/check/testdata/class/generic/member_lookup.carbon @@ -322,10 +322,7 @@ fn AccessMissingConcrete(x: Derived(i32)) -> i32 { // CHECK:STDOUT: %complete_type.loc6_1.2 => constants.%complete_type.1 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Base(%T.loc4_17.2) { -// CHECK:STDOUT: %T.loc4_17.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc4_17.2 => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @Base(%T.loc4_17.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @Derived(constants.%T) { // CHECK:STDOUT: %T.loc8_15.2 => constants.%T @@ -342,20 +339,11 @@ fn AccessMissingConcrete(x: Derived(i32)) -> i32 { // CHECK:STDOUT: %complete_type.loc11_1.2 => constants.%complete_type.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Base(@Derived.%T.loc8_15.2) { -// CHECK:STDOUT: %T.loc4_17.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc4_17.2 => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @Base(@Derived.%T.loc8_15.2) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @Derived(%T.loc8_15.2) { -// CHECK:STDOUT: %T.loc8_15.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc8_15.2 => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @Derived(%T.loc8_15.2) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @Derived(@AccessDerived.%T.loc13_18.2) { -// CHECK:STDOUT: %T.loc8_15.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc8_15.2 => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @Derived(@AccessDerived.%T.loc13_18.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @AccessDerived(constants.%T) { // CHECK:STDOUT: %T.loc13_18.2 => constants.%T @@ -363,10 +351,7 @@ fn AccessMissingConcrete(x: Derived(i32)) -> i32 { // CHECK:STDOUT: %Derived.loc13_40.2 => constants.%Derived.1 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Derived(@AccessBase.%T.loc17_15.2) { -// CHECK:STDOUT: %T.loc8_15.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc8_15.2 => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @Derived(@AccessBase.%T.loc17_15.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @AccessBase(constants.%T) { // CHECK:STDOUT: %T.loc17_15.2 => constants.%T @@ -374,10 +359,7 @@ fn AccessMissingConcrete(x: Derived(i32)) -> i32 { // CHECK:STDOUT: %Derived.loc17_37.2 => constants.%Derived.1 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Base(@AccessBase.%T.loc17_15.2) { -// CHECK:STDOUT: %T.loc4_17.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc4_17.2 => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @Base(@AccessBase.%T.loc17_15.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @Derived(constants.%i32) { // CHECK:STDOUT: %T.loc8_15.2 => constants.%i32 @@ -645,10 +627,7 @@ fn AccessMissingConcrete(x: Derived(i32)) -> i32 { // CHECK:STDOUT: %complete_type.loc6_1.2 => constants.%complete_type.1 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Base(%T.loc4_17.2) { -// CHECK:STDOUT: %T.loc4_17.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc4_17.2 => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @Base(%T.loc4_17.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @Derived(constants.%T) { // CHECK:STDOUT: %T.loc8_15.2 => constants.%T @@ -665,20 +644,11 @@ fn AccessMissingConcrete(x: Derived(i32)) -> i32 { // CHECK:STDOUT: %complete_type.loc11_1.2 => constants.%complete_type.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Base(@Derived.%T.loc8_15.2) { -// CHECK:STDOUT: %T.loc4_17.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc4_17.2 => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @Base(@Derived.%T.loc8_15.2) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @Derived(%T.loc8_15.2) { -// CHECK:STDOUT: %T.loc8_15.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc8_15.2 => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @Derived(%T.loc8_15.2) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @Base(@AccessMissingBase.%T.loc13_22.2) { -// CHECK:STDOUT: %T.loc4_17.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc4_17.2 => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @Base(@AccessMissingBase.%T.loc13_22.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @AccessMissingBase(constants.%T) { // CHECK:STDOUT: %T.loc13_22.2 => constants.%T @@ -686,10 +656,7 @@ fn AccessMissingConcrete(x: Derived(i32)) -> i32 { // CHECK:STDOUT: %Base.loc13_41.2 => constants.%Base.1 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Derived(@AccessMissingDerived.%T.loc21_25.2) { -// CHECK:STDOUT: %T.loc8_15.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc8_15.2 => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @Derived(@AccessMissingDerived.%T.loc21_25.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @AccessMissingDerived(constants.%T) { // CHECK:STDOUT: %T.loc21_25.2 => constants.%T @@ -697,10 +664,7 @@ fn AccessMissingConcrete(x: Derived(i32)) -> i32 { // CHECK:STDOUT: %Derived.loc21_47.2 => constants.%Derived.1 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Base(@AccessMissingDerived.%T.loc21_25.2) { -// CHECK:STDOUT: %T.loc4_17.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc4_17.2 => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @Base(@AccessMissingDerived.%T.loc21_25.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @Derived(constants.%i32) { // CHECK:STDOUT: %T.loc8_15.2 => constants.%i32 diff --git a/toolchain/check/testdata/class/generic/member_out_of_line.carbon b/toolchain/check/testdata/class/generic/member_out_of_line.carbon index f85a1169457a6..a0b5b04009059 100644 --- a/toolchain/check/testdata/class/generic/member_out_of_line.carbon +++ b/toolchain/check/testdata/class/generic/member_out_of_line.carbon @@ -285,20 +285,14 @@ fn Generic(T:! ()).WrongType() {} // CHECK:STDOUT: %T.loc5 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Class(@G.%T.loc6) { -// CHECK:STDOUT: %T.loc4_13.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc4_13.2 => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @Class(@G.%T.loc6) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @G(constants.%T) { // CHECK:STDOUT: %T.loc6 => constants.%T // CHECK:STDOUT: %Class => constants.%Class // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Class(%T.loc4_13.2) { -// CHECK:STDOUT: %T.loc4_13.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc4_13.2 => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @Class(%T.loc4_13.2) {} // CHECK:STDOUT: // CHECK:STDOUT: --- nested.carbon // CHECK:STDOUT: @@ -455,11 +449,7 @@ fn Generic(T:! ()).WrongType() {} // CHECK:STDOUT: %F => constants.%F // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @B(@F.%T.loc6, @F.%N.loc6) { -// CHECK:STDOUT: %T => constants.%T -// CHECK:STDOUT: %N.loc5_11.2 => constants.%N -// CHECK:STDOUT: %N.patt.loc5_11.2 => constants.%N -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @B(@F.%T.loc6, @F.%N.loc6) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%T, constants.%N) { // CHECK:STDOUT: %T.loc6 => constants.%T @@ -467,16 +457,9 @@ fn Generic(T:! ()).WrongType() {} // CHECK:STDOUT: %B => constants.%B // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @B(%T, %N.loc5_11.2) { -// CHECK:STDOUT: %T => constants.%T -// CHECK:STDOUT: %N.loc5_11.2 => constants.%N -// CHECK:STDOUT: %N.patt.loc5_11.2 => constants.%N -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @B(%T, %N.loc5_11.2) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @A(%T.loc4_9.2) { -// CHECK:STDOUT: %T.loc4_9.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc4_9.2 => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @A(%T.loc4_9.2) {} // CHECK:STDOUT: // CHECK:STDOUT: --- fail_mismatched_not_generic_vs_generic.carbon // CHECK:STDOUT: @@ -616,10 +599,7 @@ fn Generic(T:! ()).WrongType() {} // CHECK:STDOUT: // CHECK:STDOUT: specific @TooFew(constants.%T) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @Generic(%T.loc4_15.2) { -// CHECK:STDOUT: %T.loc4_15.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc4_15.2 => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @Generic(%T.loc4_15.2) {} // CHECK:STDOUT: // CHECK:STDOUT: --- fail_mismatched_too_many_args.carbon // CHECK:STDOUT: @@ -712,10 +692,7 @@ fn Generic(T:! ()).WrongType() {} // CHECK:STDOUT: // CHECK:STDOUT: specific @TooMany(constants.%T) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @Generic(%T.loc4_15.2) { -// CHECK:STDOUT: %T.loc4_15.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc4_15.2 => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @Generic(%T.loc4_15.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @.1(constants.%T, constants.%U) { // CHECK:STDOUT: %T.loc15_12.2 => constants.%T @@ -814,10 +791,7 @@ fn Generic(T:! ()).WrongType() {} // CHECK:STDOUT: // CHECK:STDOUT: specific @WrongType(constants.%T.1) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @Generic(%T.loc4_15.2) { -// CHECK:STDOUT: %T.loc4_15.2 => constants.%T.1 -// CHECK:STDOUT: %T.patt.loc4_15.2 => constants.%T.1 -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @Generic(%T.loc4_15.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @.1(constants.%T.2) { // CHECK:STDOUT: %T.loc14_12.2 => constants.%T.2 diff --git a/toolchain/check/testdata/class/generic/method_deduce.carbon b/toolchain/check/testdata/class/generic/method_deduce.carbon index d87b35d058f8f..dcf0429e1f2d9 100644 --- a/toolchain/check/testdata/class/generic/method_deduce.carbon +++ b/toolchain/check/testdata/class/generic/method_deduce.carbon @@ -347,34 +347,15 @@ fn CallGenericMethodWithNonDeducedParam(c: Class(A)) -> (A, B) { // CHECK:STDOUT: %require_complete.loc16_69 => constants.%require_complete.3 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Class(%T.loc14_13.2) { -// CHECK:STDOUT: %T.loc14_13.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc14_13.2 => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @Class(%T.loc14_13.2) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @Class(@Get.%T) { -// CHECK:STDOUT: %T.loc14_13.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc14_13.2 => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @Class(@Get.%T) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @Get(%T, %U.loc15_10.1) { -// CHECK:STDOUT: %U.loc15_10.1 => constants.%U -// CHECK:STDOUT: %U.patt.loc15_10.1 => constants.%U -// CHECK:STDOUT: %T => constants.%T -// CHECK:STDOUT: %tuple.type => constants.%tuple.type.2 -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @Get(%T, %U.loc15_10.1) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @Class(@GetNoDeduce.%T) { -// CHECK:STDOUT: %T.loc14_13.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc14_13.2 => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @Class(@GetNoDeduce.%T) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @GetNoDeduce(%T, %U.loc16_24.1) { -// CHECK:STDOUT: %T => constants.%T -// CHECK:STDOUT: %U.loc16_24.1 => constants.%U -// CHECK:STDOUT: %U.patt.loc16_24.1 => constants.%U -// CHECK:STDOUT: %tuple.type => constants.%tuple.type.2 -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @GetNoDeduce(%T, %U.loc16_24.1) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(constants.%A) { // CHECK:STDOUT: %T.loc14_13.2 => constants.%A diff --git a/toolchain/check/testdata/class/generic/self.carbon b/toolchain/check/testdata/class/generic/self.carbon index b6e2f746f75e5..3e80296538cb5 100644 --- a/toolchain/check/testdata/class/generic/self.carbon +++ b/toolchain/check/testdata/class/generic/self.carbon @@ -193,10 +193,7 @@ class Class(T:! type) { // CHECK:STDOUT: %F => constants.%F // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Class(@MakeSelf.%T) { -// CHECK:STDOUT: %T.loc11_13.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc11_13.2 => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @Class(@MakeSelf.%T) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @MakeSelf(constants.%T) { // CHECK:STDOUT: %T => constants.%T @@ -207,10 +204,7 @@ class Class(T:! type) { // CHECK:STDOUT: %Class.val => constants.%Class.val // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Class(@MakeClass.%T) { -// CHECK:STDOUT: %T.loc11_13.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc11_13.2 => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @Class(@MakeClass.%T) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @MakeClass(constants.%T) { // CHECK:STDOUT: %T => constants.%T @@ -223,23 +217,11 @@ class Class(T:! type) { // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%T) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @Class(%T.loc11_13.2) { -// CHECK:STDOUT: %T.loc11_13.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc11_13.2 => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @Class(%T.loc11_13.2) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @Class(@F.%T) { -// CHECK:STDOUT: %T.loc11_13.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc11_13.2 => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @Class(@F.%T) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @MakeSelf(@F.%T) { -// CHECK:STDOUT: %T => constants.%T -// CHECK:STDOUT: %Class => constants.%Class -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @MakeSelf(@F.%T) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @MakeClass(@F.%T) { -// CHECK:STDOUT: %T => constants.%T -// CHECK:STDOUT: %Class.loc15_28.1 => constants.%Class -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @MakeClass(@F.%T) {} // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/generic/stringify.carbon b/toolchain/check/testdata/class/generic/stringify.carbon index b3626e94639f9..da19b282e9d79 100644 --- a/toolchain/check/testdata/class/generic/stringify.carbon +++ b/toolchain/check/testdata/class/generic/stringify.carbon @@ -254,10 +254,7 @@ var v: C(123) = (); // CHECK:STDOUT: %U.patt.loc5_15.2 => constants.%U // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Outer(%T.loc4_13.2) { -// CHECK:STDOUT: %T.loc4_13.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc4_13.2 => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @Outer(%T.loc4_13.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @Outer(constants.%ptr.1) { // CHECK:STDOUT: %T.loc4_13.2 => constants.%ptr.1 diff --git a/toolchain/check/testdata/class/generic_method.carbon b/toolchain/check/testdata/class/generic_method.carbon index a35b6529fe358..18b894325615d 100644 --- a/toolchain/check/testdata/class/generic_method.carbon +++ b/toolchain/check/testdata/class/generic_method.carbon @@ -138,18 +138,12 @@ fn Class(T:! type).F[self: Self](n: T) {} // CHECK:STDOUT: %complete_type.loc14_1.2 => constants.%complete_type // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Class(@F.%T.loc13) { -// CHECK:STDOUT: %T.loc11_13.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc11_13.2 => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @Class(@F.%T.loc13) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%T) { // CHECK:STDOUT: %T.loc13 => constants.%T // CHECK:STDOUT: %Class => constants.%Class // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Class(%T.loc11_13.2) { -// CHECK:STDOUT: %T.loc11_13.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc11_13.2 => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @Class(%T.loc11_13.2) {} // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/no_prelude/generic_vs_params.carbon b/toolchain/check/testdata/class/no_prelude/generic_vs_params.carbon index 50bad07d19691..6cd023473a0d7 100644 --- a/toolchain/check/testdata/class/no_prelude/generic_vs_params.carbon +++ b/toolchain/check/testdata/class/no_prelude/generic_vs_params.carbon @@ -284,10 +284,7 @@ fn F(T:! type) { // CHECK:STDOUT: %U.patt.loc10_26.2 => constants.%U // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @C(%T.loc8_9.2) { -// CHECK:STDOUT: %T.loc8_9.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc8_9.2 => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @C(%T.loc8_9.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @GenericAndParams.1(constants.%X) { // CHECK:STDOUT: %T.loc6_24.2 => constants.%X diff --git a/toolchain/check/testdata/deduce/generic_type.carbon b/toolchain/check/testdata/deduce/generic_type.carbon index 12e4bd39d9d35..922bfd13ba060 100644 --- a/toolchain/check/testdata/deduce/generic_type.carbon +++ b/toolchain/check/testdata/deduce/generic_type.carbon @@ -209,10 +209,7 @@ fn G() -> i32 { // CHECK:STDOUT: !definition: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @C(@F.%T.loc7_6.2) { -// CHECK:STDOUT: %T.loc4_9.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc4_9.2 => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @C(@F.%T.loc7_6.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%T) { // CHECK:STDOUT: %T.loc7_6.2 => constants.%T @@ -225,11 +222,7 @@ fn G() -> i32 { // CHECK:STDOUT: %F.specific_fn.loc7_39.2 => constants.%F.specific_fn.1 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @F(%T.loc7_6.2) { -// CHECK:STDOUT: %T.loc7_6.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc7_6.2 => constants.%T -// CHECK:STDOUT: %C.loc7_22.2 => constants.%C.1 -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @F(%T.loc7_6.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @C(constants.%D) { // CHECK:STDOUT: %T.loc4_9.2 => constants.%D @@ -390,10 +383,7 @@ fn G() -> i32 { // CHECK:STDOUT: !definition: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @I(@F.%T.loc7_6.2) { -// CHECK:STDOUT: %T.loc4_9.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc4_9.2 => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @I(@F.%T.loc7_6.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%T) { // CHECK:STDOUT: %T.loc7_6.2 => constants.%T @@ -405,11 +395,7 @@ fn G() -> i32 { // CHECK:STDOUT: %F.specific_fn.loc7_39.2 => constants.%F.specific_fn.1 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @F(%T.loc7_6.2) { -// CHECK:STDOUT: %T.loc7_6.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc7_6.2 => constants.%T -// CHECK:STDOUT: %I.loc7_22.2 => constants.%I.1 -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @F(%T.loc7_6.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @I(constants.%C) { // CHECK:STDOUT: %T.loc4_9.2 => constants.%C @@ -669,20 +655,11 @@ fn G() -> i32 { // CHECK:STDOUT: !definition: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Outer(%T.loc4_13.2) { -// CHECK:STDOUT: %T.loc4_13.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc4_13.2 => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @Outer(%T.loc4_13.2) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @Outer(@F.%T.loc13_6.2) { -// CHECK:STDOUT: %T.loc4_13.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc4_13.2 => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @Outer(@F.%T.loc13_6.2) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @Inner(@F.%T.loc13_6.2, @F.%U.loc13_16.2) { -// CHECK:STDOUT: %U.loc5_15.2 => constants.%U -// CHECK:STDOUT: %U.patt.loc5_15.2 => constants.%U -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @Inner(@F.%T.loc13_6.2, @F.%U.loc13_16.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%T, constants.%U) { // CHECK:STDOUT: %T.loc13_6.2 => constants.%T @@ -704,18 +681,7 @@ fn G() -> i32 { // CHECK:STDOUT: %require_complete.loc13_70.2 => constants.%require_complete.5 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @F(%T.loc13_6.2, %U.loc13_16.2) { -// CHECK:STDOUT: %T.loc13_6.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc13_6.2 => constants.%T -// CHECK:STDOUT: %U.loc13_16.2 => constants.%U -// CHECK:STDOUT: %U.patt.loc13_16.2 => constants.%U -// CHECK:STDOUT: %Outer.loc13_36.2 => constants.%Outer.1 -// CHECK:STDOUT: %require_complete.loc13_37 => constants.%require_complete.1 -// CHECK:STDOUT: %Inner.type => constants.%Inner.type.1 -// CHECK:STDOUT: %Inner.generic => constants.%Inner.generic.1 -// CHECK:STDOUT: %Inner.loc13_45.2 => constants.%Inner.1 -// CHECK:STDOUT: %tuple.type => constants.%tuple.type.2 -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @F(%T.loc13_6.2, %U.loc13_16.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @Outer(constants.%C) { // CHECK:STDOUT: %T.loc4_13.2 => constants.%C @@ -904,10 +870,7 @@ fn G() -> i32 { // CHECK:STDOUT: !definition: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @WithNontype(@F.%N.loc6_6.2) { -// CHECK:STDOUT: %N.loc4_19.2 => constants.%N.2 -// CHECK:STDOUT: %N.patt.loc4_19.2 => constants.%N.2 -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @WithNontype(@F.%N.loc6_6.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%N.2) { // CHECK:STDOUT: %N.loc6_6.2 => constants.%N.2 diff --git a/toolchain/check/testdata/deduce/tuple.carbon b/toolchain/check/testdata/deduce/tuple.carbon index 223a9ccd4dcff..18c5f9933aa73 100644 --- a/toolchain/check/testdata/deduce/tuple.carbon +++ b/toolchain/check/testdata/deduce/tuple.carbon @@ -200,13 +200,7 @@ fn G(pair: (C, D)) -> D { // CHECK:STDOUT: %F.specific_fn.loc7_54.2 => constants.%F.specific_fn.1 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @F(%T.loc7_6.2, %U.loc7_16.2) { -// CHECK:STDOUT: %T.loc7_6.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc7_6.2 => constants.%T -// CHECK:STDOUT: %U.loc7_16.2 => constants.%U -// CHECK:STDOUT: %U.patt.loc7_16.2 => constants.%U -// CHECK:STDOUT: %tuple.type => constants.%tuple.type.2 -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @F(%T.loc7_6.2, %U.loc7_16.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%C, constants.%D) { // CHECK:STDOUT: %T.loc7_6.2 => constants.%C @@ -416,10 +410,7 @@ fn G(pair: (C, D)) -> D { // CHECK:STDOUT: !definition: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @HasPair(@F.%tuple.loc6_40.2) { -// CHECK:STDOUT: %Pair.loc4_15.2 => constants.%tuple.1 -// CHECK:STDOUT: %Pair.patt.loc4_15.2 => constants.%tuple.1 -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @HasPair(@F.%tuple.loc6_40.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%A, constants.%B) { // CHECK:STDOUT: %A.loc6_6.2 => constants.%A diff --git a/toolchain/check/testdata/deduce/type_operator.carbon b/toolchain/check/testdata/deduce/type_operator.carbon index d7cccd9beef08..7031f55c2a540 100644 --- a/toolchain/check/testdata/deduce/type_operator.carbon +++ b/toolchain/check/testdata/deduce/type_operator.carbon @@ -184,11 +184,7 @@ fn G(p: C*) -> const C { // CHECK:STDOUT: %F.specific_fn.loc6_37.2 => constants.%F.specific_fn.1 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @F(%T.loc6_6.2) { -// CHECK:STDOUT: %T.loc6_6.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc6_6.2 => constants.%T -// CHECK:STDOUT: %ptr.loc6_20.2 => constants.%ptr.1 -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @F(%T.loc6_6.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%C) { // CHECK:STDOUT: %T.loc6_6.2 => constants.%C @@ -329,12 +325,7 @@ fn G(p: C*) -> const C { // CHECK:STDOUT: %F.specific_fn.loc6_43.2 => constants.%F.specific_fn.1 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @F(%T.loc6_6.2) { -// CHECK:STDOUT: %T.loc6_6.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc6_6.2 => constants.%T -// CHECK:STDOUT: %const.loc6_19.2 => constants.%const.1 -// CHECK:STDOUT: %ptr.loc6_26.2 => constants.%ptr.1 -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @F(%T.loc6_6.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%C) { // CHECK:STDOUT: %T.loc6_6.2 => constants.%C @@ -473,11 +464,7 @@ fn G(p: C*) -> const C { // CHECK:STDOUT: %F.specific_fn.loc6_37.2 => constants.%F.specific_fn.1 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @F(%T.loc6_6.2) { -// CHECK:STDOUT: %T.loc6_6.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc6_6.2 => constants.%T -// CHECK:STDOUT: %ptr.loc6_20.2 => constants.%ptr.1 -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @F(%T.loc6_6.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%const) { // CHECK:STDOUT: %T.loc6_6.2 => constants.%const @@ -613,10 +600,5 @@ fn G(p: C*) -> const C { // CHECK:STDOUT: %F.specific_fn.loc6_43.2 => constants.%F.specific_fn // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @F(%T.loc6_6.2) { -// CHECK:STDOUT: %T.loc6_6.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc6_6.2 => constants.%T -// CHECK:STDOUT: %const.loc6_19.2 => constants.%const.1 -// CHECK:STDOUT: %ptr.loc6_26.2 => constants.%ptr.1 -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @F(%T.loc6_6.2) {} // CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/builtin/no_prelude/call_from_operator.carbon b/toolchain/check/testdata/function/builtin/no_prelude/call_from_operator.carbon index 6175929c41512..90ad12a5290d7 100644 --- a/toolchain/check/testdata/function/builtin/no_prelude/call_from_operator.carbon +++ b/toolchain/check/testdata/function/builtin/no_prelude/call_from_operator.carbon @@ -465,10 +465,7 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: %T.patt.loc11_14.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @As(@Convert.1.%T) { -// CHECK:STDOUT: %T.loc11_14.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc11_14.2 => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @As(@Convert.1.%T) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert.1(constants.%T, constants.%Self.2) { // CHECK:STDOUT: %T => constants.%T @@ -477,20 +474,14 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: %Self.as_type.loc12_20.1 => constants.%Self.as_type.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @As(%T.loc11_14.2) { -// CHECK:STDOUT: %T.loc11_14.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc11_14.2 => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @As(%T.loc11_14.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(constants.%T) { // CHECK:STDOUT: %T.loc15_22.2 => constants.%T // CHECK:STDOUT: %T.patt.loc15_22.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @ImplicitAs(@Convert.2.%T) { -// CHECK:STDOUT: %T.loc15_22.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc15_22.2 => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @ImplicitAs(@Convert.2.%T) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert.2(constants.%T, constants.%Self.3) { // CHECK:STDOUT: %T => constants.%T @@ -499,10 +490,7 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: %Self.as_type.loc16_20.1 => constants.%Self.as_type.3 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @ImplicitAs(%T.loc15_22.2) { -// CHECK:STDOUT: %T.loc15_22.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc15_22.2 => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @ImplicitAs(%T.loc15_22.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @Op.1(constants.%Add.facet) { // CHECK:STDOUT: %Self => constants.%Add.facet @@ -887,15 +875,9 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: %T.patt => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @As(%T) { -// CHECK:STDOUT: %T => constants.%T -// CHECK:STDOUT: %T.patt => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @As(%T) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @As(@Convert.1.%T) { -// CHECK:STDOUT: %T => constants.%T -// CHECK:STDOUT: %T.patt => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @As(@Convert.1.%T) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert.1(constants.%T, constants.%Self.1) { // CHECK:STDOUT: %T => constants.%T @@ -935,15 +917,9 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: %assoc0 => constants.%assoc0.5 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @ImplicitAs(%T) { -// CHECK:STDOUT: %T => constants.%T -// CHECK:STDOUT: %T.patt => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @ImplicitAs(%T) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @ImplicitAs(@Convert.2.%T) { -// CHECK:STDOUT: %T => constants.%T -// CHECK:STDOUT: %T.patt => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @ImplicitAs(@Convert.2.%T) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert.2(constants.%T, constants.%Self.3) { // CHECK:STDOUT: %T => constants.%T diff --git a/toolchain/check/testdata/function/generic/deduce.carbon b/toolchain/check/testdata/function/generic/deduce.carbon index 207249f53ef06..45a24a1376e62 100644 --- a/toolchain/check/testdata/function/generic/deduce.carbon +++ b/toolchain/check/testdata/function/generic/deduce.carbon @@ -336,11 +336,7 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: %ExplicitGenericParam.specific_fn.loc4_50.2 => constants.%ExplicitGenericParam.specific_fn.1 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @ExplicitGenericParam(%T.loc4_25.2) { -// CHECK:STDOUT: %T.loc4_25.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc4_25.2 => constants.%T -// CHECK:STDOUT: %ptr.loc4_39.2 => constants.%ptr.1 -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @ExplicitGenericParam(%T.loc4_25.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @ExplicitGenericParam(constants.%i32) { // CHECK:STDOUT: %T.loc4_25.2 => constants.%i32 @@ -369,11 +365,7 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: %ExplicitGenericParam.specific_fn.loc4_50.2 => constants.%ExplicitGenericParam.specific_fn.3 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @ExplicitGenericParam(@CallExplicitGenericParamWithGenericArg.%struct_type.a.loc10_62.2) { -// CHECK:STDOUT: %T.loc4_25.2 => constants.%struct_type.a -// CHECK:STDOUT: %T.patt.loc4_25.2 => constants.%struct_type.a -// CHECK:STDOUT: %ptr.loc4_39.2 => constants.%ptr.3 -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @ExplicitGenericParam(@CallExplicitGenericParamWithGenericArg.%struct_type.a.loc10_62.2) {} // CHECK:STDOUT: // CHECK:STDOUT: --- fail_deduce_explicit_non_constant.carbon // CHECK:STDOUT: @@ -492,22 +484,14 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: %ExplicitGenericParam.specific_fn.loc4_50.2 => constants.%ExplicitGenericParam.specific_fn // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @ExplicitGenericParam(%T.loc4_25.2) { -// CHECK:STDOUT: %T.loc4_25.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc4_25.2 => constants.%T -// CHECK:STDOUT: %ptr.loc4_39.2 => constants.%ptr -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @ExplicitGenericParam(%T.loc4_25.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @CallExplicitGenericParamConst(constants.%T) { // CHECK:STDOUT: %T.loc6_34.2 => constants.%T // CHECK:STDOUT: %T.patt.loc6_34.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @ExplicitGenericParam(@CallExplicitGenericParamConst.%T.loc6_34.2) { -// CHECK:STDOUT: %T.loc4_25.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc4_25.2 => constants.%T -// CHECK:STDOUT: %ptr.loc4_39.2 => constants.%ptr -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @ExplicitGenericParam(@CallExplicitGenericParamConst.%T.loc6_34.2) {} // CHECK:STDOUT: // CHECK:STDOUT: --- explicit_vs_deduced.carbon // CHECK:STDOUT: @@ -635,11 +619,7 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: %ExplicitAndAlsoDeduced.specific_fn.loc7_10.2 => constants.%ExplicitAndAlsoDeduced.specific_fn.1 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @ExplicitAndAlsoDeduced(%T.loc6_27.2) { -// CHECK:STDOUT: %T.loc6_27.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc6_27.2 => constants.%T -// CHECK:STDOUT: %ptr.loc6_47.2 => constants.%ptr.1 -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @ExplicitAndAlsoDeduced(%T.loc6_27.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @ExplicitAndAlsoDeduced(constants.%A) { // CHECK:STDOUT: %T.loc6_27.2 => constants.%A @@ -769,11 +749,7 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: %ImplicitGenericParam.specific_fn.loc4_56.2 => constants.%ImplicitGenericParam.specific_fn.1 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @ImplicitGenericParam(%T.loc4_25.2) { -// CHECK:STDOUT: %T.loc4_25.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc4_25.2 => constants.%T -// CHECK:STDOUT: %ptr.loc4_45.2 => constants.%ptr.1 -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @ImplicitGenericParam(%T.loc4_25.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitGenericParam(constants.%i32) { // CHECK:STDOUT: %T.loc4_25.2 => constants.%i32 diff --git a/toolchain/check/testdata/function/generic/no_prelude/call.carbon b/toolchain/check/testdata/function/generic/no_prelude/call.carbon index c758b59a9445a..a3ba689dbe612 100644 --- a/toolchain/check/testdata/function/generic/no_prelude/call.carbon +++ b/toolchain/check/testdata/function/generic/no_prelude/call.carbon @@ -243,10 +243,7 @@ fn CallSpecific(x: C) -> C { // CHECK:STDOUT: %T.patt.loc8_16.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Function(@CallGeneric.%T.loc8_16.2) { -// CHECK:STDOUT: %T.loc4_13.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc4_13.2 => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @Function(@CallGeneric.%T.loc8_16.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @CallGenericPtr(constants.%T) { // CHECK:STDOUT: %T.loc12_19.2 => constants.%T @@ -262,10 +259,7 @@ fn CallSpecific(x: C) -> C { // CHECK:STDOUT: %require_complete => constants.%require_complete.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Function(@CallGenericPtr.%ptr.loc12_33.2) { -// CHECK:STDOUT: %T.loc4_13.2 => constants.%ptr.1 -// CHECK:STDOUT: %T.patt.loc4_13.2 => constants.%ptr.1 -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @Function(@CallGenericPtr.%ptr.loc12_33.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @Function(constants.%C) { // CHECK:STDOUT: %T.loc4_13.2 => constants.%C @@ -462,10 +456,7 @@ fn CallSpecific(x: C) -> C { // CHECK:STDOUT: %T.patt.loc8_16.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Function(@CallGeneric.%T.loc8_16.2) { -// CHECK:STDOUT: %T.loc4_13.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc4_13.2 => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @Function(@CallGeneric.%T.loc8_16.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @CallGenericPtr(constants.%T) { // CHECK:STDOUT: %T.loc12_19.2 => constants.%T @@ -481,10 +472,7 @@ fn CallSpecific(x: C) -> C { // CHECK:STDOUT: %require_complete => constants.%require_complete.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Function(@CallGenericPtr.%ptr.loc12_33.2) { -// CHECK:STDOUT: %T.loc4_13.2 => constants.%ptr.1 -// CHECK:STDOUT: %T.patt.loc4_13.2 => constants.%ptr.1 -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @Function(@CallGenericPtr.%ptr.loc12_33.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @Function(constants.%C) { // CHECK:STDOUT: %T.loc4_13.2 => constants.%C diff --git a/toolchain/check/testdata/function/generic/no_prelude/import_specific.carbon b/toolchain/check/testdata/function/generic/no_prelude/import_specific.carbon index 573359709b463..6b1caf3f8fc86 100644 --- a/toolchain/check/testdata/function/generic/no_prelude/import_specific.carbon +++ b/toolchain/check/testdata/function/generic/no_prelude/import_specific.carbon @@ -109,10 +109,7 @@ fn H() { // CHECK:STDOUT: %T.patt.loc7_6.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @F(@G.%T.loc7_6.2) { -// CHECK:STDOUT: %T.loc4_6.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc4_6.2 => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @F(@G.%T.loc7_6.2) {} // CHECK:STDOUT: // CHECK:STDOUT: --- user.carbon // CHECK:STDOUT: @@ -210,10 +207,7 @@ fn H() { // CHECK:STDOUT: %T.patt => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @F(@G.%T) { -// CHECK:STDOUT: %T => constants.%T -// CHECK:STDOUT: %T.patt => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @F(@G.%T) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @G(constants.%C) { // CHECK:STDOUT: %T => constants.%C diff --git a/toolchain/check/testdata/function/generic/redeclare.carbon b/toolchain/check/testdata/function/generic/redeclare.carbon index d235370022fb9..9390ce6effbd0 100644 --- a/toolchain/check/testdata/function/generic/redeclare.carbon +++ b/toolchain/check/testdata/function/generic/redeclare.carbon @@ -173,11 +173,7 @@ fn F(U:! type, T:! type) -> U* { // CHECK:STDOUT: %F.specific_fn.loc7_10.2 => constants.%F.specific_fn // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @F(%T.loc4_6.2) { -// CHECK:STDOUT: %T.loc4_6.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc4 => constants.%T -// CHECK:STDOUT: %ptr.loc4_20.2 => constants.%ptr -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @F(%T.loc4_6.2) {} // CHECK:STDOUT: // CHECK:STDOUT: --- fail_different_return_type.carbon // CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/generic/return_slot.carbon b/toolchain/check/testdata/function/generic/return_slot.carbon index 742caa3307c5d..6c895df05c84f 100644 --- a/toolchain/check/testdata/function/generic/return_slot.carbon +++ b/toolchain/check/testdata/function/generic/return_slot.carbon @@ -212,19 +212,11 @@ fn G() { // CHECK:STDOUT: %Make.specific_fn.loc12_27.2 => constants.%Make.specific_fn.1 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Wrap(%T.loc11_12.2) { -// CHECK:STDOUT: %T.loc11_12.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc11_12.2 => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @Wrap(%T.loc11_12.2) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @Wrap(@Make.%T) { -// CHECK:STDOUT: %T.loc11_12.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc11_12.2 => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @Wrap(@Make.%T) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @Make(%T) { -// CHECK:STDOUT: %T => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @Make(%T) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @Wrap(constants.%i32) { // CHECK:STDOUT: %T.loc11_12.2 => constants.%i32 diff --git a/toolchain/check/testdata/generic/complete_type.carbon b/toolchain/check/testdata/generic/complete_type.carbon index b4b8da4eb211c..ffd0369675186 100644 --- a/toolchain/check/testdata/generic/complete_type.carbon +++ b/toolchain/check/testdata/generic/complete_type.carbon @@ -175,10 +175,7 @@ fn G() { F(B); } // CHECK:STDOUT: %T.patt.loc6_9.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @A(%T.loc6_9.2) { -// CHECK:STDOUT: %T.loc6_9.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc6_9.2 => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @A(%T.loc6_9.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @A(constants.%B) { // CHECK:STDOUT: %T.loc6_9.2 => constants.%B diff --git a/toolchain/check/testdata/impl/extend_impl_generic.carbon b/toolchain/check/testdata/impl/extend_impl_generic.carbon index 93af6ffbb2779..a51b6d2a9e6e0 100644 --- a/toolchain/check/testdata/impl/extend_impl_generic.carbon +++ b/toolchain/check/testdata/impl/extend_impl_generic.carbon @@ -267,10 +267,7 @@ class X(U:! type) { // CHECK:STDOUT: %T => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @HasF(%T.loc4_16.2) { -// CHECK:STDOUT: %T.loc4_16.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc4_16.2 => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @HasF(%T.loc4_16.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @HasF(constants.%Param) { // CHECK:STDOUT: %T.loc4_16.2 => constants.%Param @@ -482,10 +479,7 @@ class X(U:! type) { // CHECK:STDOUT: %T.patt.loc4_13.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @I(@F.1.%T) { -// CHECK:STDOUT: %T.loc4_13.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc4_13.2 => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @I(@F.1.%T) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @F.1(constants.%T, constants.%Self) { // CHECK:STDOUT: %T => constants.%T @@ -494,10 +488,7 @@ class X(U:! type) { // CHECK:STDOUT: %Self.as_type.loc5_14.1 => constants.%Self.as_type // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @I(%T.loc4_13.2) { -// CHECK:STDOUT: %T.loc4_13.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc4_13.2 => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @I(%T.loc4_13.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @X(constants.%U) { // CHECK:STDOUT: %U.loc8_9.2 => constants.%U @@ -521,15 +512,9 @@ class X(U:! type) { // CHECK:STDOUT: %assoc0.loc5_25.2 => constants.%assoc0.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @X(@impl.%U) { -// CHECK:STDOUT: %U.loc8_9.2 => constants.%U -// CHECK:STDOUT: %U.patt.loc8_9.2 => constants.%U -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @X(@impl.%U) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @I(@impl.%U) { -// CHECK:STDOUT: %T.loc4_13.2 => constants.%U -// CHECK:STDOUT: %T.patt.loc4_13.2 => constants.%U -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @I(@impl.%U) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @impl(constants.%U) { // CHECK:STDOUT: %U => constants.%U @@ -543,15 +528,9 @@ class X(U:! type) { // CHECK:STDOUT: %interface.loc9_23.2 => constants.%interface // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @X(@F.2.%U) { -// CHECK:STDOUT: %U.loc8_9.2 => constants.%U -// CHECK:STDOUT: %U.patt.loc8_9.2 => constants.%U -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @X(@F.2.%U) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @I(@F.2.%U) { -// CHECK:STDOUT: %T.loc4_13.2 => constants.%U -// CHECK:STDOUT: %T.patt.loc4_13.2 => constants.%U -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @I(@F.2.%U) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @F.2(constants.%U) { // CHECK:STDOUT: %U => constants.%U @@ -567,14 +546,7 @@ class X(U:! type) { // CHECK:STDOUT: %Self.as_type.loc5_14.1 => constants.%X // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl(%U) { -// CHECK:STDOUT: %U => constants.%U -// CHECK:STDOUT: %X => constants.%X -// CHECK:STDOUT: %I.type.loc9_21.2 => constants.%I.type.3 -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @impl(%U) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @I(@X.%U.loc8_9.2) { -// CHECK:STDOUT: %T.loc4_13.2 => constants.%U -// CHECK:STDOUT: %T.patt.loc4_13.2 => constants.%U -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @I(@X.%U.loc8_9.2) {} // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/fail_extend_impl_forall.carbon b/toolchain/check/testdata/impl/fail_extend_impl_forall.carbon index 6b8b2a052db49..3834a64ceba6d 100644 --- a/toolchain/check/testdata/impl/fail_extend_impl_forall.carbon +++ b/toolchain/check/testdata/impl/fail_extend_impl_forall.carbon @@ -184,15 +184,9 @@ class C { // CHECK:STDOUT: %T => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @GenericInterface(%T.loc11_28.2) { -// CHECK:STDOUT: %T.loc11_28.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc11_28.2 => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @GenericInterface(%T.loc11_28.2) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @GenericInterface(@impl.%T.loc19_23.2) { -// CHECK:STDOUT: %T.loc11_28.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc11_28.2 => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @GenericInterface(@impl.%T.loc19_23.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @impl(constants.%T) { // CHECK:STDOUT: %T.loc19_23.2 => constants.%T @@ -214,9 +208,5 @@ class C { // CHECK:STDOUT: %T => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl(%T.loc19_23.2) { -// CHECK:STDOUT: %T.loc19_23.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc19_23.2 => constants.%T -// CHECK:STDOUT: %GenericInterface.type.loc19_54.2 => constants.%GenericInterface.type.2 -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @impl(%T.loc19_23.2) {} // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/fail_self_type_mismatch.carbon b/toolchain/check/testdata/impl/fail_self_type_mismatch.carbon index 1a72c72aea832..ea967547bed1a 100644 --- a/toolchain/check/testdata/impl/fail_self_type_mismatch.carbon +++ b/toolchain/check/testdata/impl/fail_self_type_mismatch.carbon @@ -166,12 +166,7 @@ impl i32 as I { // CHECK:STDOUT: %X.patt.loc11_19.2 => constants.%Self // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @C(constants.%I.type, @F.1.%Self) { -// CHECK:STDOUT: %T.loc11_9.2 => constants.%I.type -// CHECK:STDOUT: %T.patt.loc11_9.2 => constants.%I.type -// CHECK:STDOUT: %X.loc11_19.2 => constants.%Self -// CHECK:STDOUT: %X.patt.loc11_19.2 => constants.%Self -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @C(constants.%I.type, @F.1.%Self) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @F.1(constants.%Self) { // CHECK:STDOUT: %Self => constants.%Self diff --git a/toolchain/check/testdata/impl/impl_forall.carbon b/toolchain/check/testdata/impl/impl_forall.carbon index 5dcd4322390e5..4b6f232d837e0 100644 --- a/toolchain/check/testdata/impl/impl_forall.carbon +++ b/toolchain/check/testdata/impl/impl_forall.carbon @@ -118,8 +118,5 @@ impl forall [T:! type] T as Simple { // CHECK:STDOUT: // CHECK:STDOUT: specific @F.1(constants.%Simple.facet) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl(%T.loc15_14.2) { -// CHECK:STDOUT: %T.loc15_14.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc15_14.2 => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @impl(%T.loc15_14.2) {} // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/lookup/generic.carbon b/toolchain/check/testdata/impl/lookup/generic.carbon index 4707564039712..782a372382d64 100644 --- a/toolchain/check/testdata/impl/lookup/generic.carbon +++ b/toolchain/check/testdata/impl/lookup/generic.carbon @@ -252,10 +252,7 @@ fn G(x: A) { // CHECK:STDOUT: // CHECK:STDOUT: specific @F.1(constants.%HasF.facet) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl(%T.loc8_14.2) { -// CHECK:STDOUT: %T.loc8_14.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc8_14.2 => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @impl(%T.loc8_14.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @impl(constants.%empty_struct_type) { // CHECK:STDOUT: %T.loc8_14.2 => constants.%empty_struct_type @@ -457,10 +454,7 @@ fn G(x: A) { // CHECK:STDOUT: %Self.as_type.loc5_14.1 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl(%T.loc8_14.2) { -// CHECK:STDOUT: %T.loc8_14.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc8_14.2 => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @impl(%T.loc8_14.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @impl(constants.%empty_struct_type) { // CHECK:STDOUT: %T.loc8_14.2 => constants.%empty_struct_type @@ -634,10 +628,7 @@ fn G(x: A) { // CHECK:STDOUT: %T.patt.loc8_9.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @C(@impl.%T.loc10_14.2) { -// CHECK:STDOUT: %T.loc8_9.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc8_9.2 => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @C(@impl.%T.loc10_14.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @impl(constants.%T) { // CHECK:STDOUT: %T.loc10_14.2 => constants.%T @@ -654,11 +645,7 @@ fn G(x: A) { // CHECK:STDOUT: // CHECK:STDOUT: specific @F.1(constants.%HasF.facet) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl(%T.loc10_14.2) { -// CHECK:STDOUT: %T.loc10_14.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc10_14.2 => constants.%T -// CHECK:STDOUT: %C.loc10_27.2 => constants.%C.1 -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @impl(%T.loc10_14.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @C(constants.%empty_struct_type) { // CHECK:STDOUT: %T.loc8_9.2 => constants.%empty_struct_type @@ -849,15 +836,9 @@ fn G(x: A) { // CHECK:STDOUT: // CHECK:STDOUT: specific @F.1(constants.%T, constants.%Self) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @HasF(%T.loc4_16.2) { -// CHECK:STDOUT: %T.loc4_16.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc4_16.2 => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @HasF(%T.loc4_16.2) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @HasF(@impl.%T.loc8_14.2) { -// CHECK:STDOUT: %T.loc4_16.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc4_16.2 => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @HasF(@impl.%T.loc8_14.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @impl(constants.%T) { // CHECK:STDOUT: %T.loc8_14.2 => constants.%T @@ -875,11 +856,7 @@ fn G(x: A) { // CHECK:STDOUT: // CHECK:STDOUT: specific @F.1(constants.%T, constants.%HasF.facet) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl(%T.loc8_14.2) { -// CHECK:STDOUT: %T.loc8_14.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc8_14.2 => constants.%T -// CHECK:STDOUT: %HasF.type.loc8_36.2 => constants.%HasF.type.2 -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @impl(%T.loc8_14.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @HasF(constants.%empty_struct_type) { // CHECK:STDOUT: %T.loc4_16.2 => constants.%empty_struct_type @@ -1043,12 +1020,7 @@ fn G(x: A) { // CHECK:STDOUT: // CHECK:STDOUT: specific @F.1(constants.%HasF.facet) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl(%T.loc9_14.2, %U.loc9_24.2) { -// CHECK:STDOUT: %T.loc9_14.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc9_14.2 => constants.%T -// CHECK:STDOUT: %U.loc9_24.2 => constants.%U -// CHECK:STDOUT: %U.patt.loc9_24.2 => constants.%U -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @impl(%T.loc9_14.2, %U.loc9_24.2) {} // CHECK:STDOUT: // CHECK:STDOUT: --- fail_inconsistent_deduction.carbon // CHECK:STDOUT: @@ -1228,15 +1200,9 @@ fn G(x: A) { // CHECK:STDOUT: // CHECK:STDOUT: specific @F.1(constants.%T, constants.%Self) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @HasF(%T.loc4_16.2) { -// CHECK:STDOUT: %T.loc4_16.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc4_16.2 => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @HasF(%T.loc4_16.2) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @HasF(@impl.%T.loc8_14.2) { -// CHECK:STDOUT: %T.loc4_16.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc4_16.2 => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @HasF(@impl.%T.loc8_14.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @impl(constants.%T) { // CHECK:STDOUT: %T.loc8_14.2 => constants.%T @@ -1254,11 +1220,7 @@ fn G(x: A) { // CHECK:STDOUT: // CHECK:STDOUT: specific @F.1(constants.%T, constants.%HasF.facet) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl(%T.loc8_14.2) { -// CHECK:STDOUT: %T.loc8_14.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc8_14.2 => constants.%T -// CHECK:STDOUT: %HasF.type.loc8_35.2 => constants.%HasF.type.2 -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @impl(%T.loc8_14.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @HasF(constants.%B) { // CHECK:STDOUT: %T.loc4_16.2 => constants.%B diff --git a/toolchain/check/testdata/impl/lookup/no_prelude/impl_forall.carbon b/toolchain/check/testdata/impl/lookup/no_prelude/impl_forall.carbon index 72351de2c7dc9..19e684cceacdc 100644 --- a/toolchain/check/testdata/impl/lookup/no_prelude/impl_forall.carbon +++ b/toolchain/check/testdata/impl/lookup/no_prelude/impl_forall.carbon @@ -367,20 +367,14 @@ fn TestSpecific(a: A({})) -> {} { // CHECK:STDOUT: %T.patt.loc2_9.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @A(%T.loc2_9.2) { -// CHECK:STDOUT: %T.loc2_9.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc2_9.2 => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @A(%T.loc2_9.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @I(constants.%U) { // CHECK:STDOUT: %U.loc6_13.2 => constants.%U // CHECK:STDOUT: %U.patt.loc6_13.2 => constants.%U // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @I(@F.1.%U) { -// CHECK:STDOUT: %U.loc6_13.2 => constants.%U -// CHECK:STDOUT: %U.patt.loc6_13.2 => constants.%U -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @I(@F.1.%U) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @F.1(constants.%U, constants.%Self) { // CHECK:STDOUT: %U => constants.%U @@ -389,10 +383,7 @@ fn TestSpecific(a: A({})) -> {} { // CHECK:STDOUT: %Self.as_type.loc7_14.1 => constants.%Self.as_type // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @I(%U.loc6_13.2) { -// CHECK:STDOUT: %U.loc6_13.2 => constants.%U -// CHECK:STDOUT: %U.patt.loc6_13.2 => constants.%U -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @I(%U.loc6_13.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @A(constants.%V) { // CHECK:STDOUT: %T.loc2_9.2 => constants.%V @@ -419,15 +410,9 @@ fn TestSpecific(a: A({})) -> {} { // CHECK:STDOUT: %assoc0.loc7_26.2 => constants.%assoc0.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @A(@impl.%V.loc10_14.2) { -// CHECK:STDOUT: %T.loc2_9.2 => constants.%V -// CHECK:STDOUT: %T.patt.loc2_9.2 => constants.%V -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @A(@impl.%V.loc10_14.2) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @I(@impl.%V.loc10_14.2) { -// CHECK:STDOUT: %U.loc6_13.2 => constants.%V -// CHECK:STDOUT: %U.patt.loc6_13.2 => constants.%V -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @I(@impl.%V.loc10_14.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @impl(constants.%V) { // CHECK:STDOUT: %V.loc10_14.2 => constants.%V @@ -442,10 +427,7 @@ fn TestSpecific(a: A({})) -> {} { // CHECK:STDOUT: %interface.loc10_37.2 => constants.%interface.1 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @A(@F.2.%V) { -// CHECK:STDOUT: %T.loc2_9.2 => constants.%V -// CHECK:STDOUT: %T.patt.loc2_9.2 => constants.%V -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @A(@F.2.%V) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @F.2(constants.%V) { // CHECK:STDOUT: %V => constants.%V @@ -459,12 +441,7 @@ fn TestSpecific(a: A({})) -> {} { // CHECK:STDOUT: %Self.as_type.loc7_14.1 => constants.%A.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl(%V.loc10_14.2) { -// CHECK:STDOUT: %V.loc10_14.2 => constants.%V -// CHECK:STDOUT: %V.patt.loc10_14.2 => constants.%V -// CHECK:STDOUT: %A.loc10_27.2 => constants.%A.2 -// CHECK:STDOUT: %I.type.loc10_35.2 => constants.%I.type.3 -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @impl(%V.loc10_14.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @A(constants.%W) { // CHECK:STDOUT: %T.loc2_9.2 => constants.%W @@ -478,10 +455,7 @@ fn TestSpecific(a: A({})) -> {} { // CHECK:STDOUT: %complete_type.loc4_1.2 => constants.%complete_type.3 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @A(@TestGeneric.%W.loc16_16.2) { -// CHECK:STDOUT: %T.loc2_9.2 => constants.%W -// CHECK:STDOUT: %T.patt.loc2_9.2 => constants.%W -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @A(@TestGeneric.%W.loc16_16.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @TestGeneric(constants.%W) { // CHECK:STDOUT: %W.loc16_16.2 => constants.%W @@ -525,17 +499,9 @@ fn TestSpecific(a: A({})) -> {} { // CHECK:STDOUT: %A.elem => constants.%A.elem.3 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @I(@TestGeneric.%W.loc16_16.2) { -// CHECK:STDOUT: %U.loc6_13.2 => constants.%W -// CHECK:STDOUT: %U.patt.loc6_13.2 => constants.%W -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @I(@TestGeneric.%W.loc16_16.2) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl(@TestGeneric.%W.loc16_16.2) { -// CHECK:STDOUT: %V.loc10_14.2 => constants.%W -// CHECK:STDOUT: %V.patt.loc10_14.2 => constants.%W -// CHECK:STDOUT: %A.loc10_27.2 => constants.%A.3 -// CHECK:STDOUT: %I.type.loc10_35.2 => constants.%I.type.4 -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @impl(@TestGeneric.%W.loc16_16.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @A(constants.%empty_struct_type) { // CHECK:STDOUT: %T.loc2_9.2 => constants.%empty_struct_type diff --git a/toolchain/check/testdata/impl/lookup/no_prelude/import.carbon b/toolchain/check/testdata/impl/lookup/no_prelude/import.carbon index 2a5267c67d6be..2c734473f7afa 100644 --- a/toolchain/check/testdata/impl/lookup/no_prelude/import.carbon +++ b/toolchain/check/testdata/impl/lookup/no_prelude/import.carbon @@ -1307,10 +1307,7 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %U.patt.loc6_28.2 => constants.%U // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @GenericInterface(%U.loc6_28.2) { -// CHECK:STDOUT: %U.loc6_28.2 => constants.%U -// CHECK:STDOUT: %U.patt.loc6_28.2 => constants.%U -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @GenericInterface(%U.loc6_28.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @AnyParam(constants.%T, constants.%X) { // CHECK:STDOUT: %T => constants.%T @@ -1483,10 +1480,7 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %U.patt => constants.%U // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @GenericInterface(%U) { -// CHECK:STDOUT: %U => constants.%U -// CHECK:STDOUT: %U.patt => constants.%U -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @GenericInterface(%U) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @AnyParam(constants.%GenericInterface.type.1, constants.%GenericInterface.generic) { // CHECK:STDOUT: %T => constants.%GenericInterface.type.1 diff --git a/toolchain/check/testdata/impl/lookup/no_prelude/specific_args.carbon b/toolchain/check/testdata/impl/lookup/no_prelude/specific_args.carbon index fb8a1a4c5536f..14c7875c7ca99 100644 --- a/toolchain/check/testdata/impl/lookup/no_prelude/specific_args.carbon +++ b/toolchain/check/testdata/impl/lookup/no_prelude/specific_args.carbon @@ -154,10 +154,7 @@ fn H(c: C(InClassArgs)) { c.(I(X).F)(); } // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%T, constants.%Self) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @I(%T.loc4_13.2) { -// CHECK:STDOUT: %T.loc4_13.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc4_13.2 => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @I(%T.loc4_13.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @C(constants.%T) { // CHECK:STDOUT: %T.loc5_9.2 => constants.%T @@ -279,10 +276,7 @@ fn H(c: C(InClassArgs)) { c.(I(X).F)(); } // CHECK:STDOUT: %T.patt => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @I(%T) { -// CHECK:STDOUT: %T => constants.%T -// CHECK:STDOUT: %T.patt => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @I(%T) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @F.1(constants.%T, constants.%Self) {} // CHECK:STDOUT: @@ -431,10 +425,7 @@ fn H(c: C(InClassArgs)) { c.(I(X).F)(); } // CHECK:STDOUT: %T.patt => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @I(%T) { -// CHECK:STDOUT: %T => constants.%T -// CHECK:STDOUT: %T.patt => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @I(%T) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @F.1(constants.%T, constants.%Self) {} // CHECK:STDOUT: @@ -596,10 +587,7 @@ fn H(c: C(InClassArgs)) { c.(I(X).F)(); } // CHECK:STDOUT: %T.patt => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @I(%T) { -// CHECK:STDOUT: %T => constants.%T -// CHECK:STDOUT: %T.patt => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @I(%T) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @F.1(constants.%T, constants.%Self) {} // CHECK:STDOUT: @@ -780,10 +768,7 @@ fn H(c: C(InClassArgs)) { c.(I(X).F)(); } // CHECK:STDOUT: %T.patt => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @I(%T) { -// CHECK:STDOUT: %T => constants.%T -// CHECK:STDOUT: %T.patt => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @I(%T) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @F.1(constants.%T, constants.%Self) {} // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/no_prelude/import_generic.carbon b/toolchain/check/testdata/impl/no_prelude/import_generic.carbon index 4e8566a2dd1e8..0c29458fc32aa 100644 --- a/toolchain/check/testdata/impl/no_prelude/import_generic.carbon +++ b/toolchain/check/testdata/impl/no_prelude/import_generic.carbon @@ -148,15 +148,9 @@ impl forall [T:! type] C as I(T*) {} // CHECK:STDOUT: %T.patt.loc5_13.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @I(%T.loc5_13.2) { -// CHECK:STDOUT: %T.loc5_13.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc5_13.2 => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @I(%T.loc5_13.2) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @I(@impl.1.%T.loc7_14.2) { -// CHECK:STDOUT: %T.loc5_13.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc5_13.2 => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @I(@impl.1.%T.loc7_14.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @impl.1(constants.%T) { // CHECK:STDOUT: %T.loc7_14.2 => constants.%T @@ -173,10 +167,7 @@ impl forall [T:! type] C as I(T*) {} // CHECK:STDOUT: %Self.2 => constants.%Self // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @I(@impl.2.%ptr.loc8_32.2) { -// CHECK:STDOUT: %T.loc5_13.2 => constants.%ptr -// CHECK:STDOUT: %T.patt.loc5_13.2 => constants.%ptr -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @I(@impl.2.%ptr.loc8_32.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @impl.2(constants.%T) { // CHECK:STDOUT: %T.loc8_14.2 => constants.%T @@ -295,15 +286,9 @@ impl forall [T:! type] C as I(T*) {} // CHECK:STDOUT: %Self => constants.%Self // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @I(%T) { -// CHECK:STDOUT: %T => constants.%T -// CHECK:STDOUT: %T.patt => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @I(%T) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @I(@impl.1.%T.1) { -// CHECK:STDOUT: %T => constants.%T -// CHECK:STDOUT: %T.patt => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @I(@impl.1.%T.1) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @impl.1(constants.%T) { // CHECK:STDOUT: %T.1 => constants.%T @@ -316,10 +301,7 @@ impl forall [T:! type] C as I(T*) {} // CHECK:STDOUT: %T.patt => constants.%ptr // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @I(@impl.2.%ptr) { -// CHECK:STDOUT: %T => constants.%ptr -// CHECK:STDOUT: %T.patt => constants.%ptr -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @I(@impl.2.%ptr) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @impl.2(constants.%T) { // CHECK:STDOUT: %T => constants.%T @@ -423,15 +405,9 @@ impl forall [T:! type] C as I(T*) {} // CHECK:STDOUT: %T.patt => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @I(%T) { -// CHECK:STDOUT: %T => constants.%T -// CHECK:STDOUT: %T.patt => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @I(%T) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @I(@impl.1.%T) { -// CHECK:STDOUT: %T => constants.%T -// CHECK:STDOUT: %T.patt => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @I(@impl.1.%T) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @impl.1(constants.%T) { // CHECK:STDOUT: %T => constants.%T @@ -444,10 +420,7 @@ impl forall [T:! type] C as I(T*) {} // CHECK:STDOUT: %T.patt => constants.%ptr // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @I(@impl.2.%ptr.1) { -// CHECK:STDOUT: %T => constants.%ptr -// CHECK:STDOUT: %T.patt => constants.%ptr -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @I(@impl.2.%ptr.1) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @impl.2(constants.%T) { // CHECK:STDOUT: %T.1 => constants.%T diff --git a/toolchain/check/testdata/impl/no_prelude/import_use_generic.carbon b/toolchain/check/testdata/impl/no_prelude/import_use_generic.carbon index 7381afa0c7830..66c1e6c9cff2a 100644 --- a/toolchain/check/testdata/impl/no_prelude/import_use_generic.carbon +++ b/toolchain/check/testdata/impl/no_prelude/import_use_generic.carbon @@ -154,10 +154,7 @@ fn F() -> c.(I.F)() {} // CHECK:STDOUT: // CHECK:STDOUT: specific @F.1(constants.%Self) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @C(@impl.%T.loc10_14.2) { -// CHECK:STDOUT: %T.loc4_9.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc4_9.2 => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @C(@impl.%T.loc10_14.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @impl(constants.%T) { // CHECK:STDOUT: %T.loc10_14.2 => constants.%T @@ -174,11 +171,7 @@ fn F() -> c.(I.F)() {} // CHECK:STDOUT: // CHECK:STDOUT: specific @F.1(constants.%I.facet) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl(%T.loc10_14.2) { -// CHECK:STDOUT: %T.loc10_14.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc10_14.2 => constants.%T -// CHECK:STDOUT: %C.loc10_27.2 => constants.%C -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @impl(%T.loc10_14.2) {} // CHECK:STDOUT: // CHECK:STDOUT: --- fail_use_in_fn_decl.carbon // CHECK:STDOUT: @@ -328,10 +321,7 @@ fn F() -> c.(I.F)() {} // CHECK:STDOUT: // CHECK:STDOUT: specific @F.1(constants.%Self) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @C(@impl.%T) { -// CHECK:STDOUT: %T => constants.%T -// CHECK:STDOUT: %T.patt => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @C(@impl.%T) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @impl(constants.%T) { // CHECK:STDOUT: %T => constants.%T @@ -344,11 +334,7 @@ fn F() -> c.(I.F)() {} // CHECK:STDOUT: %interface => constants.%interface.1 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl(%T) { -// CHECK:STDOUT: %T => constants.%T -// CHECK:STDOUT: %T.patt => constants.%T -// CHECK:STDOUT: %C => constants.%C.1 -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @impl(%T) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @F.2(constants.%T) {} // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/no_prelude/interface_args.carbon b/toolchain/check/testdata/impl/no_prelude/interface_args.carbon index a0b7bc3f2de92..feec609fe90a2 100644 --- a/toolchain/check/testdata/impl/no_prelude/interface_args.carbon +++ b/toolchain/check/testdata/impl/no_prelude/interface_args.carbon @@ -231,10 +231,7 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: // CHECK:STDOUT: specific @Op.1(constants.%T, constants.%Self) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @Action(%T.loc4_18.2) { -// CHECK:STDOUT: %T.loc4_18.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc4_18.2 => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @Action(%T.loc4_18.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @Action(constants.%B) { // CHECK:STDOUT: %T.loc4_18.2 => constants.%B @@ -399,10 +396,7 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: %assoc0 => constants.%assoc0.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Action(%T) { -// CHECK:STDOUT: %T => constants.%T -// CHECK:STDOUT: %T.patt => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @Action(%T) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @Op.1(constants.%T, constants.%Self) {} // CHECK:STDOUT: @@ -560,10 +554,7 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: %assoc0 => constants.%assoc0.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Action(%T) { -// CHECK:STDOUT: %T => constants.%T -// CHECK:STDOUT: %T.patt => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @Action(%T) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @Op(constants.%T, constants.%Self) {} // CHECK:STDOUT: @@ -711,10 +702,7 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: %T => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Factory(%T.loc4_19.2) { -// CHECK:STDOUT: %T.loc4_19.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc4_19.2 => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @Factory(%T.loc4_19.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @Factory(constants.%B) { // CHECK:STDOUT: %T.loc4_19.2 => constants.%B @@ -883,10 +871,7 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: %assoc0 => constants.%assoc0.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Factory(%T) { -// CHECK:STDOUT: %T => constants.%T -// CHECK:STDOUT: %T.patt => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @Factory(%T) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @Make.1(constants.%T, constants.%Self) { // CHECK:STDOUT: %T => constants.%T @@ -1050,10 +1035,7 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: %assoc0 => constants.%assoc0.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Factory(%T) { -// CHECK:STDOUT: %T => constants.%T -// CHECK:STDOUT: %T.patt => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @Factory(%T) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @Make(constants.%T, constants.%Self) { // CHECK:STDOUT: %T => constants.%T diff --git a/toolchain/check/testdata/interface/member_lookup.carbon b/toolchain/check/testdata/interface/member_lookup.carbon index 97dbba59b830d..246d8ed56a404 100644 --- a/toolchain/check/testdata/interface/member_lookup.carbon +++ b/toolchain/check/testdata/interface/member_lookup.carbon @@ -223,15 +223,9 @@ fn AccessMissingConcrete(I:! Interface(i32)) -> i32 { // CHECK:STDOUT: %assoc0.loc5_12.2 => constants.%assoc0.1 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Interface(%T.loc4_21.2) { -// CHECK:STDOUT: %T.loc4_21.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc4_21.2 => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @Interface(%T.loc4_21.2) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @Interface(@AccessGeneric.%T.loc8_18.2) { -// CHECK:STDOUT: %T.loc4_21.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc4_21.2 => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @Interface(@AccessGeneric.%T.loc8_18.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @AccessGeneric(constants.%T, constants.%I.1) { // CHECK:STDOUT: %T.loc8_18.2 => constants.%T @@ -417,15 +411,9 @@ fn AccessMissingConcrete(I:! Interface(i32)) -> i32 { // CHECK:STDOUT: %assoc0.loc5_12.2 => constants.%assoc0.1 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Interface(%T.loc4_21.2) { -// CHECK:STDOUT: %T.loc4_21.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc4_21.2 => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @Interface(%T.loc4_21.2) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @Interface(@AccessMissingGeneric.%T.loc8_25.2) { -// CHECK:STDOUT: %T.loc4_21.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc4_21.2 => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @Interface(@AccessMissingGeneric.%T.loc8_25.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @AccessMissingGeneric(constants.%T, constants.%I.1) { // CHECK:STDOUT: %T.loc8_25.2 => constants.%T diff --git a/toolchain/check/testdata/interface/no_prelude/assoc_const_in_generic.carbon b/toolchain/check/testdata/interface/no_prelude/assoc_const_in_generic.carbon index 6af8c9486a543..6b78eb87f96fe 100644 --- a/toolchain/check/testdata/interface/no_prelude/assoc_const_in_generic.carbon +++ b/toolchain/check/testdata/interface/no_prelude/assoc_const_in_generic.carbon @@ -171,20 +171,14 @@ fn H() { // CHECK:STDOUT: %U.patt.loc12_8.1 => constants.%U // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @I(%T.loc11_13.2) { -// CHECK:STDOUT: %T.loc11_13.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc11_13.2 => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @I(%T.loc11_13.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @G(constants.%T) { // CHECK:STDOUT: %T.loc15_6.2 => constants.%T // CHECK:STDOUT: %T.patt.loc15_6.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @I(@G.%T.loc15_6.2) { -// CHECK:STDOUT: %T.loc11_13.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc11_13.2 => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @I(@G.%T.loc15_6.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @G(constants.%empty_struct_type) { // CHECK:STDOUT: %T.loc15_6.2 => constants.%empty_struct_type diff --git a/toolchain/check/testdata/interface/no_prelude/fail_generic_redeclaration.carbon b/toolchain/check/testdata/interface/no_prelude/fail_generic_redeclaration.carbon index 067b3a209e26e..b18a173c487bc 100644 --- a/toolchain/check/testdata/interface/no_prelude/fail_generic_redeclaration.carbon +++ b/toolchain/check/testdata/interface/no_prelude/fail_generic_redeclaration.carbon @@ -165,10 +165,7 @@ interface DifferentParams(T:! ()) {} // CHECK:STDOUT: %T.patt.loc19_22.2 => constants.%T.1 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @.1(%T.loc19_22.2) { -// CHECK:STDOUT: %T.loc19_22.2 => constants.%T.1 -// CHECK:STDOUT: %T.patt.loc19_22.2 => constants.%T.1 -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @.1(%T.loc19_22.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @Generic(constants.%T.1) { // CHECK:STDOUT: %T.loc21_19.2 => constants.%T.1 @@ -185,8 +182,5 @@ interface DifferentParams(T:! ()) {} // CHECK:STDOUT: %T.patt.loc38_27.2 => constants.%T.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @.3(%T.loc38_27.2) { -// CHECK:STDOUT: %T.loc38_27.2 => constants.%T.2 -// CHECK:STDOUT: %T.patt.loc38_27.2 => constants.%T.2 -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @.3(%T.loc38_27.2) {} // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interface/no_prelude/fail_todo_generic_default_fn.carbon b/toolchain/check/testdata/interface/no_prelude/fail_todo_generic_default_fn.carbon index a3db7e48aec56..16658113add2d 100644 --- a/toolchain/check/testdata/interface/no_prelude/fail_todo_generic_default_fn.carbon +++ b/toolchain/check/testdata/interface/no_prelude/fail_todo_generic_default_fn.carbon @@ -155,10 +155,7 @@ fn I(T:! type).F[self: Self]() -> Self { return self; } // CHECK:STDOUT: %assoc0.loc13_29.2 => constants.%assoc0 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @I(@F.%T) { -// CHECK:STDOUT: %T.loc11_13.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc11_13.2 => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @I(@F.%T) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%T, constants.%Self) { // CHECK:STDOUT: %T => constants.%T @@ -167,15 +164,9 @@ fn I(T:! type).F[self: Self]() -> Self { return self; } // CHECK:STDOUT: %Self.as_type.loc13_14.1 => constants.%Self.as_type // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @I(%T.loc11_13.2) { -// CHECK:STDOUT: %T.loc11_13.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc11_13.2 => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @I(%T.loc11_13.2) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @I(@.1.%T.loc22_6.2) { -// CHECK:STDOUT: %T.loc11_13.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc11_13.2 => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @I(@.1.%T.loc22_6.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @.1(constants.%T, constants.%Self) { // CHECK:STDOUT: %T.loc22_6.2 => constants.%T diff --git a/toolchain/check/testdata/interface/no_prelude/generic.carbon b/toolchain/check/testdata/interface/no_prelude/generic.carbon index 6fa4afb13a528..05502498edeab 100644 --- a/toolchain/check/testdata/interface/no_prelude/generic.carbon +++ b/toolchain/check/testdata/interface/no_prelude/generic.carbon @@ -320,10 +320,7 @@ fn G(T:! Generic(B)) { // CHECK:STDOUT: %T.patt.loc4_18.2 => constants.%T.1 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Simple(%T.loc4_18.2) { -// CHECK:STDOUT: %T.loc4_18.2 => constants.%T.1 -// CHECK:STDOUT: %T.patt.loc4_18.2 => constants.%T.1 -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @Simple(%T.loc4_18.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @WithAssocFn(constants.%T.1) { // CHECK:STDOUT: %T.loc8_23.2 => constants.%T.1 @@ -332,10 +329,7 @@ fn G(T:! Generic(B)) { // CHECK:STDOUT: // CHECK:STDOUT: specific @F.1(constants.%T.1, constants.%Self.2) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @WithAssocFn(%T.loc8_23.2) { -// CHECK:STDOUT: %T.loc8_23.2 => constants.%T.1 -// CHECK:STDOUT: %T.patt.loc8_23.2 => constants.%T.1 -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @WithAssocFn(%T.loc8_23.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @Simple(constants.%C) { // CHECK:STDOUT: %T.loc4_18.2 => constants.%C @@ -380,10 +374,7 @@ fn G(T:! Generic(B)) { // CHECK:STDOUT: %T.patt.loc25_9.2 => constants.%T.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Receive(@Pass.%T.loc25_9.2) { -// CHECK:STDOUT: %T.loc24_12.2 => constants.%T.2 -// CHECK:STDOUT: %T.patt.loc24_12.2 => constants.%T.2 -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @Receive(@Pass.%T.loc25_9.2) {} // CHECK:STDOUT: // CHECK:STDOUT: --- fail_mismatched_args.carbon // CHECK:STDOUT: @@ -509,10 +500,7 @@ fn G(T:! Generic(B)) { // CHECK:STDOUT: %T.patt.loc4_19.2 => constants.%T.1 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Generic(%T.loc4_19.2) { -// CHECK:STDOUT: %T.loc4_19.2 => constants.%T.1 -// CHECK:STDOUT: %T.patt.loc4_19.2 => constants.%T.1 -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @Generic(%T.loc4_19.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @Generic(constants.%A) { // CHECK:STDOUT: %T.loc4_19.2 => constants.%A diff --git a/toolchain/check/testdata/interface/no_prelude/generic_import.carbon b/toolchain/check/testdata/interface/no_prelude/generic_import.carbon index 3cc00a6da9e8a..574abfc16a924 100644 --- a/toolchain/check/testdata/interface/no_prelude/generic_import.carbon +++ b/toolchain/check/testdata/interface/no_prelude/generic_import.carbon @@ -91,10 +91,7 @@ impl C as AddWith(C) { // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%T, constants.%Self) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @AddWith(%T.loc4_19.2) { -// CHECK:STDOUT: %T.loc4_19.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc4_19.2 => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @AddWith(%T.loc4_19.2) {} // CHECK:STDOUT: // CHECK:STDOUT: --- b.carbon // CHECK:STDOUT: @@ -198,10 +195,7 @@ impl C as AddWith(C) { // CHECK:STDOUT: %T.patt => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @AddWith(%T) { -// CHECK:STDOUT: %T => constants.%T -// CHECK:STDOUT: %T.patt => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @AddWith(%T) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @F.1(constants.%T, constants.%Self) {} // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interface/no_prelude/generic_vs_params.carbon b/toolchain/check/testdata/interface/no_prelude/generic_vs_params.carbon index a39bb89a0c75d..51603b98e1d3d 100644 --- a/toolchain/check/testdata/interface/no_prelude/generic_vs_params.carbon +++ b/toolchain/check/testdata/interface/no_prelude/generic_vs_params.carbon @@ -285,10 +285,7 @@ interface A(T: type) {} // CHECK:STDOUT: %T.patt.loc6_28.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @GenericAndParams.1(%T.loc6_28.2) { -// CHECK:STDOUT: %T.loc6_28.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc6_28.2 => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @GenericAndParams.1(%T.loc6_28.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @C(constants.%T) { // CHECK:STDOUT: %T.loc8_9.2 => constants.%T @@ -304,15 +301,9 @@ interface A(T: type) {} // CHECK:STDOUT: %U.patt.loc10_30.2 => constants.%U // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @GenericAndParams.2(%T, %U.loc10_30.2) { -// CHECK:STDOUT: %U.loc10_30.2 => constants.%U -// CHECK:STDOUT: %U.patt.loc10_30.2 => constants.%U -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @GenericAndParams.2(%T, %U.loc10_30.2) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @C(%T.loc8_9.2) { -// CHECK:STDOUT: %T.loc8_9.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc8_9.2 => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @C(%T.loc8_9.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @GenericAndParams.1(constants.%X) { // CHECK:STDOUT: %T.loc6_28.2 => constants.%X diff --git a/toolchain/check/testdata/interface/no_prelude/syntactic_merge.carbon b/toolchain/check/testdata/interface/no_prelude/syntactic_merge.carbon index 1720f5ea25200..fdb2743301576 100644 --- a/toolchain/check/testdata/interface/no_prelude/syntactic_merge.carbon +++ b/toolchain/check/testdata/interface/no_prelude/syntactic_merge.carbon @@ -294,20 +294,14 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: %a.patt.loc7_15.2 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Foo(%a.loc7_15.2) { -// CHECK:STDOUT: %a.loc7_15.2 => constants.%a -// CHECK:STDOUT: %a.patt.loc7_15.2 => constants.%a -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @Foo(%a.loc7_15.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @Bar(constants.%a) { // CHECK:STDOUT: %a.loc10_15.2 => constants.%a // CHECK:STDOUT: %a.patt.loc10_15.2 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Bar(%a.loc10_15.2) { -// CHECK:STDOUT: %a.loc10_15.2 => constants.%a -// CHECK:STDOUT: %a.patt.loc10_15.2 => constants.%a -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @Bar(%a.loc10_15.2) {} // CHECK:STDOUT: // CHECK:STDOUT: --- spacing.carbon // CHECK:STDOUT: @@ -377,10 +371,7 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: %a.patt.loc6_21.2 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Foo(%a.loc6_21.2) { -// CHECK:STDOUT: %a.loc6_21.2 => constants.%a -// CHECK:STDOUT: %a.patt.loc6_21.2 => constants.%a -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @Foo(%a.loc6_21.2) {} // CHECK:STDOUT: // CHECK:STDOUT: --- fail_parens.carbon // CHECK:STDOUT: @@ -464,10 +455,7 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: %a.patt.loc14_15.2 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @.1(%a.loc14_15.2) { -// CHECK:STDOUT: %a.loc14_15.2 => constants.%a -// CHECK:STDOUT: %a.patt.loc14_15.2 => constants.%a -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @.1(%a.loc14_15.2) {} // CHECK:STDOUT: // CHECK:STDOUT: --- todo_fail_raw_identifier.carbon // CHECK:STDOUT: @@ -537,10 +525,7 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: %a.patt.loc6_15.2 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Foo(%a.loc6_15.2) { -// CHECK:STDOUT: %a.loc6_15.2 => constants.%a -// CHECK:STDOUT: %a.patt.loc6_15.2 => constants.%a -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @Foo(%a.loc6_15.2) {} // CHECK:STDOUT: // CHECK:STDOUT: --- two_file.carbon // CHECK:STDOUT: @@ -738,10 +723,7 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: %a.patt.loc12_15.2 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @.1(%a.loc12_15.2) { -// CHECK:STDOUT: %a.loc12_15.2 => constants.%a -// CHECK:STDOUT: %a.patt.loc12_15.2 => constants.%a -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @.1(%a.loc12_15.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @Bar(constants.%a) { // CHECK:STDOUT: %a => constants.%a @@ -753,10 +735,7 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: %a.patt.loc21_15.2 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @.2(%a.loc21_15.2) { -// CHECK:STDOUT: %a.loc21_15.2 => constants.%a -// CHECK:STDOUT: %a.patt.loc21_15.2 => constants.%a -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @.2(%a.loc21_15.2) {} // CHECK:STDOUT: // CHECK:STDOUT: --- fail_name_mismatch.carbon // CHECK:STDOUT: @@ -845,10 +824,7 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: %b.patt.loc15_15.2 => constants.%b // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @.1(%b.loc15_15.2) { -// CHECK:STDOUT: %b.loc15_15.2 => constants.%b -// CHECK:STDOUT: %b.patt.loc15_15.2 => constants.%b -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @.1(%b.loc15_15.2) {} // CHECK:STDOUT: // CHECK:STDOUT: --- fail_alias.carbon // CHECK:STDOUT: @@ -935,10 +911,7 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: %a.patt.loc15_15.2 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @.1(%a.loc15_15.2) { -// CHECK:STDOUT: %a.loc15_15.2 => constants.%a -// CHECK:STDOUT: %a.patt.loc15_15.2 => constants.%a -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @.1(%a.loc15_15.2) {} // CHECK:STDOUT: // CHECK:STDOUT: --- fail_deduced_alias.carbon // CHECK:STDOUT: @@ -1025,10 +998,7 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: %a.patt.loc15_15.2 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @.1(%a.loc15_15.2) { -// CHECK:STDOUT: %a.loc15_15.2 => constants.%a -// CHECK:STDOUT: %a.patt.loc15_15.2 => constants.%a -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @.1(%a.loc15_15.2) {} // CHECK:STDOUT: // CHECK:STDOUT: --- alias_two_file.carbon // CHECK:STDOUT: @@ -1161,10 +1131,7 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: %a.patt.loc17_15.2 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @.1(%a.loc17_15.2) { -// CHECK:STDOUT: %a.loc17_15.2 => constants.%a -// CHECK:STDOUT: %a.patt.loc17_15.2 => constants.%a -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @.1(%a.loc17_15.2) {} // CHECK:STDOUT: // CHECK:STDOUT: --- fail_repeat_const.carbon // CHECK:STDOUT: @@ -1252,8 +1219,5 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: %a.patt.loc17_15.2 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @.1(%a.loc17_15.2) { -// CHECK:STDOUT: %a.loc17_15.2 => constants.%a -// CHECK:STDOUT: %a.patt.loc17_15.2 => constants.%a -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @.1(%a.loc17_15.2) {} // CHECK:STDOUT: diff --git a/toolchain/check/testdata/operators/overloaded/implicit_as.carbon b/toolchain/check/testdata/operators/overloaded/implicit_as.carbon index 14e525fa679d4..b6be4861d8b98 100644 --- a/toolchain/check/testdata/operators/overloaded/implicit_as.carbon +++ b/toolchain/check/testdata/operators/overloaded/implicit_as.carbon @@ -284,10 +284,7 @@ fn Test() { // CHECK:STDOUT: %Source.specific_fn.loc27_35.2 => constants.%Source.specific_fn.1 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Source(%T.loc27_11.2) { -// CHECK:STDOUT: %T.loc27_11.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc27_11.2 => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @Source(%T.loc27_11.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @Source(constants.%X) { // CHECK:STDOUT: %T.loc27_11.2 => constants.%X diff --git a/toolchain/check/testdata/operators/overloaded/no_prelude/index.carbon b/toolchain/check/testdata/operators/overloaded/no_prelude/index.carbon index 75d92d0471323..e97041aa4223c 100644 --- a/toolchain/check/testdata/operators/overloaded/no_prelude/index.carbon +++ b/toolchain/check/testdata/operators/overloaded/no_prelude/index.carbon @@ -278,10 +278,7 @@ fn F() { ()[()]; } // CHECK:STDOUT: %SubscriptType.patt.loc5_26.2 => constants.%SubscriptType // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @IndexWith(@At.1.%SubscriptType) { -// CHECK:STDOUT: %SubscriptType.loc5_26.2 => constants.%SubscriptType -// CHECK:STDOUT: %SubscriptType.patt.loc5_26.2 => constants.%SubscriptType -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @IndexWith(@At.1.%SubscriptType) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @At.1(constants.%SubscriptType, constants.%Self) { // CHECK:STDOUT: %SubscriptType => constants.%SubscriptType @@ -290,10 +287,7 @@ fn F() { ()[()]; } // CHECK:STDOUT: %Self.as_type.loc6_15.1 => constants.%Self.as_type // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @IndexWith(%SubscriptType.loc5_26.2) { -// CHECK:STDOUT: %SubscriptType.loc5_26.2 => constants.%SubscriptType -// CHECK:STDOUT: %SubscriptType.patt.loc5_26.2 => constants.%SubscriptType -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @IndexWith(%SubscriptType.loc5_26.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @IndexWith(constants.%empty_tuple.type) { // CHECK:STDOUT: %SubscriptType.loc5_26.2 => constants.%empty_tuple.type diff --git a/toolchain/check/testdata/return/no_prelude/import_convert_function.carbon b/toolchain/check/testdata/return/no_prelude/import_convert_function.carbon index f8e8459d61f64..b733e0aff3b48 100644 --- a/toolchain/check/testdata/return/no_prelude/import_convert_function.carbon +++ b/toolchain/check/testdata/return/no_prelude/import_convert_function.carbon @@ -225,10 +225,7 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %T.patt.loc8_22.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @ImplicitAs(@Convert.1.%T) { -// CHECK:STDOUT: %T.loc8_22.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc8_22.2 => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @ImplicitAs(@Convert.1.%T) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert.1(constants.%T, constants.%Self) { // CHECK:STDOUT: %T => constants.%T @@ -237,10 +234,7 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %Self.as_type.loc9_20.1 => constants.%Self.as_type // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @ImplicitAs(%T.loc8_22.2) { -// CHECK:STDOUT: %T.loc8_22.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc8_22.2 => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @ImplicitAs(%T.loc8_22.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(constants.%i32.builtin) { // CHECK:STDOUT: %T.loc8_22.2 => constants.%i32.builtin @@ -870,15 +864,9 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %T.patt => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @ImplicitAs(%T) { -// CHECK:STDOUT: %T => constants.%T -// CHECK:STDOUT: %T.patt => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @ImplicitAs(%T) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @ImplicitAs(@Convert.1.%T) { -// CHECK:STDOUT: %T => constants.%T -// CHECK:STDOUT: %T.patt => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @ImplicitAs(@Convert.1.%T) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert.1(constants.%T, constants.%Self) { // CHECK:STDOUT: %T => constants.%T @@ -1568,15 +1556,9 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %T.patt => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @ImplicitAs(%T) { -// CHECK:STDOUT: %T => constants.%T -// CHECK:STDOUT: %T.patt => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @ImplicitAs(%T) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @ImplicitAs(@Convert.1.%T) { -// CHECK:STDOUT: %T => constants.%T -// CHECK:STDOUT: %T.patt => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @ImplicitAs(@Convert.1.%T) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert.1(constants.%T, constants.%Self) { // CHECK:STDOUT: %T => constants.%T diff --git a/toolchain/check/testdata/where_expr/dot_self_index.carbon b/toolchain/check/testdata/where_expr/dot_self_index.carbon index 6d0df2b0a7361..a16ae3d9813ac 100644 --- a/toolchain/check/testdata/where_expr/dot_self_index.carbon +++ b/toolchain/check/testdata/where_expr/dot_self_index.carbon @@ -211,10 +211,7 @@ fn G(U: Empty(i32) where .A = i32*) { // CHECK:STDOUT: %W.patt.loc11_17.2 => constants.%W // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Empty(%W.loc11_17.2) { -// CHECK:STDOUT: %W.loc11_17.2 => constants.%W -// CHECK:STDOUT: %W.patt.loc11_17.2 => constants.%W -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @Empty(%W.loc11_17.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @Empty(constants.%T) { // CHECK:STDOUT: %W.loc11_17.2 => constants.%T @@ -227,10 +224,7 @@ fn G(U: Empty(i32) where .A = i32*) { // CHECK:STDOUT: %assoc0.loc12_15.2 => constants.%assoc0.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Empty(@H.%T.loc18_6.2) { -// CHECK:STDOUT: %W.loc11_17.2 => constants.%T -// CHECK:STDOUT: %W.patt.loc11_17.2 => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @Empty(@H.%T.loc18_6.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @H(constants.%T, constants.%V) { // CHECK:STDOUT: %T.loc18_6.2 => constants.%T diff --git a/toolchain/check/testdata/where_expr/equal_rewrite.carbon b/toolchain/check/testdata/where_expr/equal_rewrite.carbon index ade4924665956..d14074f101cf6 100644 --- a/toolchain/check/testdata/where_expr/equal_rewrite.carbon +++ b/toolchain/check/testdata/where_expr/equal_rewrite.carbon @@ -578,10 +578,7 @@ let K: (E where .F = .Self.G) = bool; // CHECK:STDOUT: !definition: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @OneRewrite(@RepeatedRewrite.%H.loc10_20.2) { -// CHECK:STDOUT: %G.loc8_15.2 => constants.%H -// CHECK:STDOUT: %G.patt.loc8_15.2 => constants.%H -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @OneRewrite(@RepeatedRewrite.%H.loc10_20.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @OneRewriteAgain(constants.%I) { // CHECK:STDOUT: %I.loc14_20.2 => constants.%I @@ -596,10 +593,7 @@ let K: (E where .F = .Self.G) = bool; // CHECK:STDOUT: %OneRewrite.specific_fn.loc11_3.2 => constants.%OneRewrite.specific_fn.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @RepeatedRewrite(@OneRewriteAgain.%I.loc14_20.2) { -// CHECK:STDOUT: %H.loc10_20.2 => constants.%I -// CHECK:STDOUT: %H.patt.loc10_20.2 => constants.%I -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @RepeatedRewrite(@OneRewriteAgain.%I.loc14_20.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @OneRewrite(constants.%I) { // CHECK:STDOUT: %G.loc8_15.2 => constants.%I @@ -764,10 +758,7 @@ let K: (E where .F = .Self.G) = bool; // CHECK:STDOUT: !definition: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Alphabetical(@Reversed.%N.loc11_13.2) { -// CHECK:STDOUT: %M.loc9_17.2 => constants.%N -// CHECK:STDOUT: %M.patt.loc9_17.2 => constants.%N -// CHECK:STDOUT: } +// CHECK:STDOUT: specific @Alphabetical(@Reversed.%N.loc11_13.2) {} // CHECK:STDOUT: // CHECK:STDOUT: --- fail_rewrites_mismatch_right.carbon // CHECK:STDOUT: From 3645143e27df415a10fad6d86a5e70ccd5d912e7 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Mon, 16 Dec 2024 16:47:51 -0800 Subject: [PATCH 36/68] Add solutions for advent of code 2024 day 1 to `examples/`. (#4673) In order to support these examples, this adds two new builtins to the toolchain: `print.char` and `read.char`, which map to the libc functions `putchar` and `getchar`. --- core/BUILD | 3 +- core/io.carbon | 19 ++++ core/prelude.carbon | 4 - examples/advent2024/BUILD | 26 +++++ examples/advent2024/README.md | 17 +++ examples/advent2024/day1_common.carbon | 21 ++++ examples/advent2024/day1_part1.carbon | 26 +++++ examples/advent2024/day1_part2.carbon | 31 +++++ examples/advent2024/io_utils.carbon | 73 ++++++++++++ examples/advent2024/sort.carbon | 43 +++++++ examples/sieve.carbon | 2 + toolchain/check/eval.cpp | 7 +- .../check/testdata/builtins/print/char.carbon | 107 ++++++++++++++++++ .../{print.carbon => print/int.carbon} | 43 +++---- .../check/testdata/builtins/read/int.carbon | 84 ++++++++++++++ toolchain/lower/handle_call.cpp | 50 ++++++-- .../lower/testdata/builtins/print.carbon | 39 ------- .../lower/testdata/builtins/print_read.carbon | 86 ++++++++++++++ toolchain/sem_ir/builtin_function_kind.cpp | 13 ++- toolchain/sem_ir/builtin_function_kind.def | 4 + 20 files changed, 619 insertions(+), 79 deletions(-) create mode 100644 core/io.carbon create mode 100644 examples/advent2024/BUILD create mode 100644 examples/advent2024/README.md create mode 100644 examples/advent2024/day1_common.carbon create mode 100644 examples/advent2024/day1_part1.carbon create mode 100644 examples/advent2024/day1_part2.carbon create mode 100644 examples/advent2024/io_utils.carbon create mode 100644 examples/advent2024/sort.carbon create mode 100644 toolchain/check/testdata/builtins/print/char.carbon rename toolchain/check/testdata/builtins/{print.carbon => print/int.carbon} (76%) create mode 100644 toolchain/check/testdata/builtins/read/int.carbon delete mode 100644 toolchain/lower/testdata/builtins/print.carbon create mode 100644 toolchain/lower/testdata/builtins/print_read.carbon diff --git a/core/BUILD b/core/BUILD index 4a1028d21de81..ad635c024239b 100644 --- a/core/BUILD +++ b/core/BUILD @@ -5,9 +5,10 @@ load("//bazel/manifest:defs.bzl", "manifest") # Raw prelude files. +# TODO: This includes all of Core, not just the prelude. filegroup( name = "prelude_files", - srcs = ["prelude.carbon"] + glob(["prelude/**/*.carbon"]), + srcs = glob(["**/*.carbon"]), visibility = ["//visibility:public"], ) diff --git a/core/io.carbon b/core/io.carbon new file mode 100644 index 0000000000000..80c1aa3acf051 --- /dev/null +++ b/core/io.carbon @@ -0,0 +1,19 @@ +// Part of the Carbon Language project, under the Apache License v2.0 with LLVM +// Exceptions. See /LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// AUTOUPDATE + +package Core library "io"; + +import library "prelude"; + +// TODO: Support printing other types. +// TODO: Consider rewriting using native support once library support exists. +fn Print(x: i32) = "print.int"; +fn PrintChar(x: i32) -> i32 = "print.char"; +fn ReadChar() -> i32 = "read.char"; + +// TODO: Change this to a global constant once they are fully supported. +// TODO: Use simply -1 once we support negate on an IntLiteral. +fn EOF() -> i32 { return -(1 as i32); } diff --git a/core/prelude.carbon b/core/prelude.carbon index 8e3969c3e0122..a6a9e2a9d7a20 100644 --- a/core/prelude.carbon +++ b/core/prelude.carbon @@ -8,7 +8,3 @@ package Core library "prelude"; export import library "prelude/operators"; export import library "prelude/types"; - -// TODO: Support printing other types. -// TODO: Consider rewriting using native support once library support exists. -fn Print(x: i32) = "print.int"; diff --git a/examples/advent2024/BUILD b/examples/advent2024/BUILD new file mode 100644 index 0000000000000..c38b1cb61929d --- /dev/null +++ b/examples/advent2024/BUILD @@ -0,0 +1,26 @@ +# Part of the Carbon Language project, under the Apache License v2.0 with LLVM +# Exceptions. See /LICENSE for license information. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +load("//bazel/carbon_rules:defs.bzl", "carbon_binary") + +utils = [ + "io_utils.carbon", + "sort.carbon", +] + +carbon_binary( + name = "day1_part1", + srcs = [ + "day1_common.carbon", + "day1_part1.carbon", + ] + utils, +) + +carbon_binary( + name = "day1_part2", + srcs = [ + "day1_common.carbon", + "day1_part2.carbon", + ] + utils, +) diff --git a/examples/advent2024/README.md b/examples/advent2024/README.md new file mode 100644 index 0000000000000..f7bdef6fbd35e --- /dev/null +++ b/examples/advent2024/README.md @@ -0,0 +1,17 @@ +# Advent of Code 2024 + + + +This directory contains sample solutions written in Carbon for +[Advent of Code 2024](https://adventofcode.com/2024/). + +The Carbon toolchain is in a very early state, so these samples frequently need +to work around missing functionality and are not reflective of expected Carbon +style and idioms. Instead, the purpose of these examples are to test the current +state of the toolchain against larger code examples than those that are present +in the toolchain's own tests, to find bugs in the toolchain, and to drive +feature development in the toolchain by presenting somewhat realistic testcases. diff --git a/examples/advent2024/day1_common.carbon b/examples/advent2024/day1_common.carbon new file mode 100644 index 0000000000000..b4c1c21295ee3 --- /dev/null +++ b/examples/advent2024/day1_common.carbon @@ -0,0 +1,21 @@ +// Part of the Carbon Language project, under the Apache License v2.0 with LLVM +// Exceptions. See /LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +library "day1_common"; + +import library "io_utils"; + +// Read a sequence of lines each containing a pair of numbers into two arrays. +// Returns the number of lines read. +fn ReadInputs(ap: [i32; 1000]*, bp: [i32; 1000]*) -> i32 { + var n: i32 = 0; + var a: i32; + var b: i32; + while (n < 1000 and ReadInt(&a) and SkipSpaces() and ReadInt(&b) and SkipNewline()) { + (*ap)[n] = a; + (*bp)[n] = b; + ++n; + } + return n; +} diff --git a/examples/advent2024/day1_part1.carbon b/examples/advent2024/day1_part1.carbon new file mode 100644 index 0000000000000..b1d1f411e8aab --- /dev/null +++ b/examples/advent2024/day1_part1.carbon @@ -0,0 +1,26 @@ +// Part of the Carbon Language project, under the Apache License v2.0 with LLVM +// Exceptions. See /LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +import Core library "io"; + +import library "day1_common"; +import library "sort"; + +fn Abs(n: i32) -> i32 { return if n < 0 then -n else n; } + +fn Run() { + var a: [i32; 1000]; + var b: [i32; 1000]; + var n: i32 = ReadInputs(&a, &b); + Quicksort(&a, 0, n); + Quicksort(&b, 0, n); + + var i: i32 = 0; + var difference: i32 = 0; + while (i < n) { + difference += Abs(a[i] - b[i]); + i += 1; + } + Core.Print(difference); +} diff --git a/examples/advent2024/day1_part2.carbon b/examples/advent2024/day1_part2.carbon new file mode 100644 index 0000000000000..c6521822a8ec3 --- /dev/null +++ b/examples/advent2024/day1_part2.carbon @@ -0,0 +1,31 @@ +// Part of the Carbon Language project, under the Apache License v2.0 with LLVM +// Exceptions. See /LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +import Core library "io"; + +import library "day1_common"; +import library "sort"; + +fn Run() { + var a: [i32; 1000]; + var b: [i32; 1000]; + var n: i32 = ReadInputs(&a, &b); + Quicksort(&a, 0, n); + Quicksort(&b, 0, n); + + var i: i32 = 0; + var j: i32 = 0; + var similarity: i32 = 0; + while (i < n and j < n) { + if (a[i] < b[j]) { + ++i; + } else { + if (a[i] == b[j]) { + similarity += b[j]; + } + ++j; + } + } + Core.Print(similarity); +} diff --git a/examples/advent2024/io_utils.carbon b/examples/advent2024/io_utils.carbon new file mode 100644 index 0000000000000..ce26cbcfe7e69 --- /dev/null +++ b/examples/advent2024/io_utils.carbon @@ -0,0 +1,73 @@ +// Part of the Carbon Language project, under the Apache License v2.0 with LLVM +// Exceptions. See /LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +library "io_utils"; + +import Core library "io"; + +// TODO: Use Core.EOF() rather than 0 as a sentinel here. +// At the moment, 0 is the only value we can initialize a global to, +// so we store the value plus 1 here. +var push_back: i32 = 0; + +fn ReadChar() -> i32 { + var next: i32 = push_back - 1; + push_back = 0; + // TODO: assert(push_back == Core.EOF()); + if (next == Core.EOF()) { + next = Core.ReadChar(); + } + return next; +} + +fn UnreadChar(c: i32) { + // TODO: assert(push_back == Core.EOF()); + push_back = c + 1; +} + +fn ReadInt(p: i32*) -> bool { + var read_any_digits: bool = false; + *p = 0; + + while (true) { + var c: i32 = ReadChar(); + if (c < 0x30 or c > 0x39) { + UnreadChar(c); + break; + } + // TODO: Check for overflow. + *p *= 10; + *p += c - 0x30; + read_any_digits = true; + } + return read_any_digits; +} + +fn SkipSpaces() -> bool { + var skipped_any_spaces: bool = false; + while (true) { + var c: i32 = ReadChar(); + if (c != 0x20) { + UnreadChar(c); + break; + } + skipped_any_spaces = true; + } + return skipped_any_spaces; +} + +fn SkipNewline() -> bool { + var c: i32 = ReadChar(); + // Optional carriage return. + if (c == 0x0D) { + c = ReadChar(); + } + // Newline. + if (c == 0x0A) { + return true; + } + // TODO: Unread the CR? + UnreadChar(c); + return false; +} diff --git a/examples/advent2024/sort.carbon b/examples/advent2024/sort.carbon new file mode 100644 index 0000000000000..c0be66c5a5da4 --- /dev/null +++ b/examples/advent2024/sort.carbon @@ -0,0 +1,43 @@ +// Part of the Carbon Language project, under the Apache License v2.0 with LLVM +// Exceptions. See /LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +library "sort"; + +// TODO: Generalize this for other container types once we implement lowering +// for generic functions. + +fn Swap(p: [i32; 1000]*, from: i32, to: i32) { + var tmp: i32 = (*p)[from]; + (*p)[from] = (*p)[to]; + (*p)[to] = tmp; +} + +fn Partition(p: [i32; 1000]*, from_in: i32, to_in: i32) -> i32 { + var pivot_index: i32 = from_in; + var pivot: i32 = (*p)[pivot_index]; + var from: i32 = from_in + 1; + var to: i32 = to_in; + while (from < to) { + if ((*p)[from] <= pivot) { + ++from; + } else if ((*p)[to - 1] > pivot) { + --to; + } else { + // Element at `from` is > pivot, and + // element at `to` is <= pivot. + Swap(p, from, to - 1); + ++from; + --to; + } + } + Swap(p, pivot_index, from - 1); + return from - 1; +} + +fn Quicksort(p: [i32; 1000]*, from: i32, to: i32) { + if (from + 1 >= to) { return; } + var pivot: i32 = Partition(p, from, to); + Quicksort(p, from, pivot); + Quicksort(p, pivot + 1, to); +} diff --git a/examples/sieve.carbon b/examples/sieve.carbon index c882d7581003b..9fddf037330b6 100644 --- a/examples/sieve.carbon +++ b/examples/sieve.carbon @@ -2,6 +2,8 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +import Core library "io"; + // Compute and return the number of primes less than 1000. class Sieve { diff --git a/toolchain/check/eval.cpp b/toolchain/check/eval.cpp index 489e34057c4f4..27dae45cc681d 100644 --- a/toolchain/check/eval.cpp +++ b/toolchain/check/eval.cpp @@ -1107,8 +1107,11 @@ static auto MakeConstantForBuiltinCall(Context& context, SemIRLoc loc, case SemIR::BuiltinFunctionKind::None: CARBON_FATAL("Not a builtin function."); - case SemIR::BuiltinFunctionKind::PrintInt: { - // Providing a constant result would allow eliding the function call. + case SemIR::BuiltinFunctionKind::PrintChar: + case SemIR::BuiltinFunctionKind::PrintInt: + case SemIR::BuiltinFunctionKind::ReadChar: { + // These are runtime-only builtins. + // TODO: Consider tracking this on the `BuiltinFunctionKind`. return SemIR::ConstantId::NotConstant; } diff --git a/toolchain/check/testdata/builtins/print/char.carbon b/toolchain/check/testdata/builtins/print/char.carbon new file mode 100644 index 0000000000000..1eb168d79e520 --- /dev/null +++ b/toolchain/check/testdata/builtins/print/char.carbon @@ -0,0 +1,107 @@ +// Part of the Carbon Language project, under the Apache License v2.0 with LLVM +// Exceptions. See /LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// AUTOUPDATE +// TIP: To test this file alone, run: +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/builtins/print/char.carbon +// TIP: To dump output, run: +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/builtins/print/char.carbon + +import Core library "io"; + +fn PrintChar(a: i32) -> i32 = "print.char"; + +fn Main() { + PrintChar(1); + Core.PrintChar(2); +} + +// CHECK:STDOUT: --- char.carbon +// CHECK:STDOUT: +// CHECK:STDOUT: constants { +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] +// CHECK:STDOUT: %PrintChar.type.1: type = fn_type @PrintChar.1 [template] +// CHECK:STDOUT: %PrintChar.1: %PrintChar.type.1 = struct_value () [template] +// CHECK:STDOUT: %Main.type: type = fn_type @Main [template] +// CHECK:STDOUT: %Main: %Main.type = struct_value () [template] +// CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] +// CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] +// CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] +// CHECK:STDOUT: %PrintChar.type.2: type = fn_type @PrintChar.2 [template] +// CHECK:STDOUT: %PrintChar.2: %PrintChar.type.2 = struct_value () [template] +// CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.10 [template] +// CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] +// CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int = %import_ref.1 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 +// CHECK:STDOUT: .PrintChar = %import_ref.193 +// CHECK:STDOUT: import Core//prelude +// CHECK:STDOUT: import Core//io +// CHECK:STDOUT: import Core//prelude/... +// CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.193: %PrintChar.type.2 = import_ref Core//io, PrintChar, loaded [template = constants.%PrintChar.2] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .PrintChar = %PrintChar.decl +// CHECK:STDOUT: .Main = %Main.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %PrintChar.decl: %PrintChar.type.1 = fn_decl @PrintChar.1 [template = constants.%PrintChar.1] { +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %int_32.loc13_17: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc13_17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %int_32.loc13_25: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc13_25: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} {} +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @PrintChar.1(%a.param_patt: %i32) -> %i32 = "print.char"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Main() { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %PrintChar.ref.loc16: %PrintChar.type.1 = name_ref PrintChar, file.%PrintChar.decl [template = constants.%PrintChar.1] +// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] +// CHECK:STDOUT: %impl.elem0.loc16: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %Convert.bound.loc16: = bound_method %int_1, %impl.elem0.loc16 [template = constants.%Convert.bound.1] +// CHECK:STDOUT: %Convert.specific_fn.loc16: = specific_function %Convert.bound.loc16, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] +// CHECK:STDOUT: %int.convert_checked.loc16: init %i32 = call %Convert.specific_fn.loc16(%int_1) [template = constants.%int_1.2] +// CHECK:STDOUT: %.loc16_13.1: %i32 = value_of_initializer %int.convert_checked.loc16 [template = constants.%int_1.2] +// CHECK:STDOUT: %.loc16_13.2: %i32 = converted %int_1, %.loc16_13.1 [template = constants.%int_1.2] +// CHECK:STDOUT: %print.char.loc16: init %i32 = call %PrintChar.ref.loc16(%.loc16_13.2) +// CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] +// CHECK:STDOUT: %PrintChar.ref.loc17: %PrintChar.type.2 = name_ref PrintChar, imports.%import_ref.193 [template = constants.%PrintChar.2] +// CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] +// CHECK:STDOUT: %impl.elem0.loc17: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %Convert.bound.loc17: = bound_method %int_2, %impl.elem0.loc17 [template = constants.%Convert.bound.2] +// CHECK:STDOUT: %Convert.specific_fn.loc17: = specific_function %Convert.bound.loc17, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] +// CHECK:STDOUT: %int.convert_checked.loc17: init %i32 = call %Convert.specific_fn.loc17(%int_2) [template = constants.%int_2.2] +// CHECK:STDOUT: %.loc17_18.1: %i32 = value_of_initializer %int.convert_checked.loc17 [template = constants.%int_2.2] +// CHECK:STDOUT: %.loc17_18.2: %i32 = converted %int_2, %.loc17_18.1 [template = constants.%int_2.2] +// CHECK:STDOUT: %print.char.loc17: init %i32 = call %PrintChar.ref.loc17(%.loc17_18.2) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/builtins/print.carbon b/toolchain/check/testdata/builtins/print/int.carbon similarity index 76% rename from toolchain/check/testdata/builtins/print.carbon rename to toolchain/check/testdata/builtins/print/int.carbon index d321a0039bb49..4b24230f45268 100644 --- a/toolchain/check/testdata/builtins/print.carbon +++ b/toolchain/check/testdata/builtins/print/int.carbon @@ -4,9 +4,11 @@ // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/builtins/print.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/builtins/print/int.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/builtins/print.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/builtins/print/int.carbon + +import Core library "io"; fn Print(a: i32) = "print.int"; @@ -16,7 +18,7 @@ fn Main() { Core.Print(2); } -// CHECK:STDOUT: --- print.carbon +// CHECK:STDOUT: --- int.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] @@ -48,9 +50,10 @@ fn Main() { // CHECK:STDOUT: .ImplicitAs = %import_ref.5 // CHECK:STDOUT: .Print = %import_ref.193 // CHECK:STDOUT: import Core//prelude +// CHECK:STDOUT: import Core//io // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.193: %Print.type.2 = import_ref Core//prelude, Print, loaded [template = constants.%Print.2] +// CHECK:STDOUT: %import_ref.193: %Print.type.2 = import_ref Core//io, Print, loaded [template = constants.%Print.2] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -76,25 +79,25 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: fn @Main() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Print.ref.loc14: %Print.type.1 = name_ref Print, file.%Print.decl [template = constants.%Print.1] +// CHECK:STDOUT: %Print.ref.loc16: %Print.type.1 = name_ref Print, file.%Print.decl [template = constants.%Print.1] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc14: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc14: = bound_method %int_1, %impl.elem0.loc14 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc14: = specific_function %Convert.bound.loc14, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc14: init %i32 = call %Convert.specific_fn.loc14(%int_1) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc14_9.1: %i32 = value_of_initializer %int.convert_checked.loc14 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc14_9.2: %i32 = converted %int_1, %.loc14_9.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %print.int.loc14: init %empty_tuple.type = call %Print.ref.loc14(%.loc14_9.2) +// CHECK:STDOUT: %impl.elem0.loc16: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %Convert.bound.loc16: = bound_method %int_1, %impl.elem0.loc16 [template = constants.%Convert.bound.1] +// CHECK:STDOUT: %Convert.specific_fn.loc16: = specific_function %Convert.bound.loc16, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] +// CHECK:STDOUT: %int.convert_checked.loc16: init %i32 = call %Convert.specific_fn.loc16(%int_1) [template = constants.%int_1.2] +// CHECK:STDOUT: %.loc16_9.1: %i32 = value_of_initializer %int.convert_checked.loc16 [template = constants.%int_1.2] +// CHECK:STDOUT: %.loc16_9.2: %i32 = converted %int_1, %.loc16_9.1 [template = constants.%int_1.2] +// CHECK:STDOUT: %print.int.loc16: init %empty_tuple.type = call %Print.ref.loc16(%.loc16_9.2) // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] -// CHECK:STDOUT: %Print.ref.loc16: %Print.type.2 = name_ref Print, imports.%import_ref.193 [template = constants.%Print.2] +// CHECK:STDOUT: %Print.ref.loc18: %Print.type.2 = name_ref Print, imports.%import_ref.193 [template = constants.%Print.2] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %impl.elem0.loc16: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc16: = bound_method %int_2, %impl.elem0.loc16 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc16: = specific_function %Convert.bound.loc16, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] -// CHECK:STDOUT: %int.convert_checked.loc16: init %i32 = call %Convert.specific_fn.loc16(%int_2) [template = constants.%int_2.2] -// CHECK:STDOUT: %.loc16_14.1: %i32 = value_of_initializer %int.convert_checked.loc16 [template = constants.%int_2.2] -// CHECK:STDOUT: %.loc16_14.2: %i32 = converted %int_2, %.loc16_14.1 [template = constants.%int_2.2] -// CHECK:STDOUT: %print.int.loc16: init %empty_tuple.type = call %Print.ref.loc16(%.loc16_14.2) +// CHECK:STDOUT: %impl.elem0.loc18: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %Convert.bound.loc18: = bound_method %int_2, %impl.elem0.loc18 [template = constants.%Convert.bound.2] +// CHECK:STDOUT: %Convert.specific_fn.loc18: = specific_function %Convert.bound.loc18, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] +// CHECK:STDOUT: %int.convert_checked.loc18: init %i32 = call %Convert.specific_fn.loc18(%int_2) [template = constants.%int_2.2] +// CHECK:STDOUT: %.loc18_14.1: %i32 = value_of_initializer %int.convert_checked.loc18 [template = constants.%int_2.2] +// CHECK:STDOUT: %.loc18_14.2: %i32 = converted %int_2, %.loc18_14.1 [template = constants.%int_2.2] +// CHECK:STDOUT: %print.int.loc18: init %empty_tuple.type = call %Print.ref.loc18(%.loc18_14.2) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/builtins/read/int.carbon b/toolchain/check/testdata/builtins/read/int.carbon new file mode 100644 index 0000000000000..29cb202acf331 --- /dev/null +++ b/toolchain/check/testdata/builtins/read/int.carbon @@ -0,0 +1,84 @@ +// Part of the Carbon Language project, under the Apache License v2.0 with LLVM +// Exceptions. See /LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// AUTOUPDATE +// TIP: To test this file alone, run: +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/builtins/read/int.carbon +// TIP: To dump output, run: +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/builtins/read/int.carbon + +import Core library "io"; + +fn ReadChar() -> i32 = "read.char"; + +fn Main() { + let n: i32 = ReadChar(); + let m: i32 = Core.ReadChar(); +} + +// CHECK:STDOUT: --- int.carbon +// CHECK:STDOUT: +// CHECK:STDOUT: constants { +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] +// CHECK:STDOUT: %ReadChar.type.1: type = fn_type @ReadChar.1 [template] +// CHECK:STDOUT: %ReadChar.1: %ReadChar.type.1 = struct_value () [template] +// CHECK:STDOUT: %Main.type: type = fn_type @Main [template] +// CHECK:STDOUT: %Main: %Main.type = struct_value () [template] +// CHECK:STDOUT: %ReadChar.type.2: type = fn_type @ReadChar.2 [template] +// CHECK:STDOUT: %ReadChar.2: %ReadChar.type.2 = struct_value () [template] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int = %import_ref.1 +// CHECK:STDOUT: .ReadChar = %import_ref.5 +// CHECK:STDOUT: import Core//prelude +// CHECK:STDOUT: import Core//io +// CHECK:STDOUT: import Core//prelude/... +// CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.5: %ReadChar.type.2 = import_ref Core//io, ReadChar, loaded [template = constants.%ReadChar.2] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .ReadChar = %ReadChar.decl +// CHECK:STDOUT: .Main = %Main.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %ReadChar.decl: %ReadChar.type.1 = fn_decl @ReadChar.1 [template = constants.%ReadChar.1] { +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} {} +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @ReadChar.1() -> %i32 = "read.char"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Main() { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %int_32.loc16: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc16: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %ReadChar.ref.loc16: %ReadChar.type.1 = name_ref ReadChar, file.%ReadChar.decl [template = constants.%ReadChar.1] +// CHECK:STDOUT: %read.char.loc16: init %i32 = call %ReadChar.ref.loc16() +// CHECK:STDOUT: %.loc16_26.1: %i32 = value_of_initializer %read.char.loc16 +// CHECK:STDOUT: %.loc16_26.2: %i32 = converted %read.char.loc16, %.loc16_26.1 +// CHECK:STDOUT: %n: %i32 = bind_name n, %.loc16_26.2 +// CHECK:STDOUT: %int_32.loc17: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] +// CHECK:STDOUT: %ReadChar.ref.loc17: %ReadChar.type.2 = name_ref ReadChar, imports.%import_ref.5 [template = constants.%ReadChar.2] +// CHECK:STDOUT: %read.char.loc17: init %i32 = call %ReadChar.ref.loc17() +// CHECK:STDOUT: %.loc17_31.1: %i32 = value_of_initializer %read.char.loc17 +// CHECK:STDOUT: %.loc17_31.2: %i32 = converted %read.char.loc17, %.loc17_31.1 +// CHECK:STDOUT: %m: %i32 = bind_name m, %.loc17_31.2 +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/lower/handle_call.cpp b/toolchain/lower/handle_call.cpp index e738becf055eb..f3af55cb769c4 100644 --- a/toolchain/lower/handle_call.cpp +++ b/toolchain/lower/handle_call.cpp @@ -76,20 +76,48 @@ static auto HandleBuiltinCall(FunctionContext& context, SemIR::InstId inst_id, case SemIR::BuiltinFunctionKind::None: CARBON_FATAL("No callee in function call."); + case SemIR::BuiltinFunctionKind::PrintChar: { + auto* i32_type = llvm::IntegerType::getInt32Ty(context.llvm_context()); + llvm::Value* arg_value = context.builder().CreateSExtOrTrunc( + context.GetValue(arg_ids[0]), i32_type); + auto putchar = context.llvm_module().getOrInsertFunction( + "putchar", i32_type, i32_type); + auto* result = context.builder().CreateCall(putchar, {arg_value}); + context.SetLocal( + inst_id, + context.builder().CreateSExtOrTrunc( + result, context.GetType( + context.sem_ir().insts().Get(inst_id).type_id()))); + return; + } + case SemIR::BuiltinFunctionKind::PrintInt: { - llvm::Type* char_type[] = {llvm::PointerType::get( - llvm::Type::getInt8Ty(context.llvm_context()), 0)}; - auto* printf_type = llvm::FunctionType::get( - llvm::IntegerType::getInt32Ty(context.llvm_context()), - llvm::ArrayRef(char_type, 1), /*isVarArg=*/true); - auto callee = + auto* i32_type = llvm::IntegerType::getInt32Ty(context.llvm_context()); + auto* ptr_type = llvm::PointerType::get(context.llvm_context(), 0); + auto* printf_type = llvm::FunctionType::get(i32_type, {ptr_type}, + /*isVarArg=*/true); + llvm::FunctionCallee printf = context.llvm_module().getOrInsertFunction("printf", printf_type); - llvm::SmallVector args = { - context.builder().CreateGlobalString("%d\n", "printf.int.format")}; - args.push_back(context.GetValue(arg_ids[0])); - context.SetLocal(inst_id, - context.builder().CreateCall(callee, args, "printf")); + llvm::Value* format_string = + context.builder().CreateGlobalString("%d\n", "printf.int.format"); + llvm::Value* arg_value = context.builder().CreateSExtOrTrunc( + context.GetValue(arg_ids[0]), i32_type); + context.SetLocal(inst_id, context.builder().CreateCall( + printf, {format_string, arg_value})); + return; + } + + case SemIR::BuiltinFunctionKind::ReadChar: { + auto* i32_type = llvm::IntegerType::getInt32Ty(context.llvm_context()); + auto getchar = + context.llvm_module().getOrInsertFunction("getchar", i32_type); + auto* result = context.builder().CreateCall(getchar, {}); + context.SetLocal( + inst_id, + context.builder().CreateSExtOrTrunc( + result, context.GetType( + context.sem_ir().insts().Get(inst_id).type_id()))); return; } diff --git a/toolchain/lower/testdata/builtins/print.carbon b/toolchain/lower/testdata/builtins/print.carbon deleted file mode 100644 index b3666bc72949a..0000000000000 --- a/toolchain/lower/testdata/builtins/print.carbon +++ /dev/null @@ -1,39 +0,0 @@ -// Part of the Carbon Language project, under the Apache License v2.0 with LLVM -// Exceptions. See /LICENSE for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -// AUTOUPDATE -// TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/lower/testdata/builtins/print.carbon -// TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/lower/testdata/builtins/print.carbon - -fn Main() { - Core.Print(1); -} - -// CHECK:STDOUT: ; ModuleID = 'print.carbon' -// CHECK:STDOUT: source_filename = "print.carbon" -// CHECK:STDOUT: -// CHECK:STDOUT: @printf.int.format = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 -// CHECK:STDOUT: -// CHECK:STDOUT: define void @_CMain.Main() !dbg !4 { -// CHECK:STDOUT: entry: -// CHECK:STDOUT: %print.int.printf = call i32 (ptr, ...) @printf(ptr @printf.int.format, i32 1), !dbg !7 -// CHECK:STDOUT: ret void, !dbg !8 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: declare i32 @printf(ptr, ...) -// CHECK:STDOUT: -// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} -// CHECK:STDOUT: !llvm.dbg.cu = !{!2} -// CHECK:STDOUT: -// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !3 = !DIFile(filename: "print.carbon", directory: "") -// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "Main", linkageName: "_CMain.Main", scope: null, file: !3, line: 11, type: !5, spFlags: DISPFlagDefinition, unit: !2) -// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) -// CHECK:STDOUT: !6 = !{} -// CHECK:STDOUT: !7 = !DILocation(line: 12, column: 3, scope: !4) -// CHECK:STDOUT: !8 = !DILocation(line: 11, column: 1, scope: !4) diff --git a/toolchain/lower/testdata/builtins/print_read.carbon b/toolchain/lower/testdata/builtins/print_read.carbon new file mode 100644 index 0000000000000..8834eea2d5190 --- /dev/null +++ b/toolchain/lower/testdata/builtins/print_read.carbon @@ -0,0 +1,86 @@ +// Part of the Carbon Language project, under the Apache License v2.0 with LLVM +// Exceptions. See /LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// AUTOUPDATE +// TIP: To test this file alone, run: +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/lower/testdata/builtins/print_read.carbon +// TIP: To dump output, run: +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/lower/testdata/builtins/print_read.carbon + +import Core library "io"; + +fn PrintChar(c: i8) -> i32 = "print.char"; +fn ReadChar() -> i32 = "read.char"; + +fn Main() { + Core.Print(1); + + let EOF: i32 = -(1 as i32); + while (ReadChar() != EOF) { + // "Hi" + if (PrintChar(0x48) != EOF) { + PrintChar(0x69); + } + } +} + +// CHECK:STDOUT: ; ModuleID = 'print_read.carbon' +// CHECK:STDOUT: source_filename = "print_read.carbon" +// CHECK:STDOUT: +// CHECK:STDOUT: @printf.int.format = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 +// CHECK:STDOUT: +// CHECK:STDOUT: define void @_CMain.Main() !dbg !4 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %print.int = call i32 (ptr, ...) @printf(ptr @printf.int.format, i32 1), !dbg !7 +// CHECK:STDOUT: br label %while.cond, !dbg !8 +// CHECK:STDOUT: +// CHECK:STDOUT: while.cond: ; preds = %if.else, %entry +// CHECK:STDOUT: %read.char = call i32 @getchar(), !dbg !9 +// CHECK:STDOUT: %int.neq.loc20 = icmp ne i32 %read.char, -1, !dbg !9 +// CHECK:STDOUT: br i1 %int.neq.loc20, label %while.body, label %while.done, !dbg !8 +// CHECK:STDOUT: +// CHECK:STDOUT: while.body: ; preds = %while.cond +// CHECK:STDOUT: %print.char.loc22 = call i32 @putchar(i32 72), !dbg !10 +// CHECK:STDOUT: %int.neq.loc22 = icmp ne i32 %print.char.loc22, -1, !dbg !10 +// CHECK:STDOUT: br i1 %int.neq.loc22, label %if.then, label %if.else, !dbg !11 +// CHECK:STDOUT: +// CHECK:STDOUT: if.then: ; preds = %while.body +// CHECK:STDOUT: %print.char.loc23 = call i32 @putchar(i32 105), !dbg !12 +// CHECK:STDOUT: br label %if.else, !dbg !13 +// CHECK:STDOUT: +// CHECK:STDOUT: if.else: ; preds = %if.then, %while.body +// CHECK:STDOUT: br label %while.cond, !dbg !14 +// CHECK:STDOUT: +// CHECK:STDOUT: while.done: ; preds = %while.cond +// CHECK:STDOUT: ret void, !dbg !15 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: declare i32 @printf(ptr, ...) +// CHECK:STDOUT: +// CHECK:STDOUT: declare i32 @getchar() +// CHECK:STDOUT: +// CHECK:STDOUT: declare i32 @putchar(i32) +// CHECK:STDOUT: +// CHECK:STDOUT: ; uselistorder directives +// CHECK:STDOUT: uselistorder ptr @putchar, { 1, 0 } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} +// CHECK:STDOUT: !llvm.dbg.cu = !{!2} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !3 = !DIFile(filename: "print_read.carbon", directory: "") +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "Main", linkageName: "_CMain.Main", scope: null, file: !3, line: 16, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) +// CHECK:STDOUT: !6 = !{} +// CHECK:STDOUT: !7 = !DILocation(line: 17, column: 3, scope: !4) +// CHECK:STDOUT: !8 = !DILocation(line: 20, column: 9, scope: !4) +// CHECK:STDOUT: !9 = !DILocation(line: 20, column: 10, scope: !4) +// CHECK:STDOUT: !10 = !DILocation(line: 22, column: 9, scope: !4) +// CHECK:STDOUT: !11 = !DILocation(line: 22, column: 8, scope: !4) +// CHECK:STDOUT: !12 = !DILocation(line: 23, column: 7, scope: !4) +// CHECK:STDOUT: !13 = !DILocation(line: 22, column: 5, scope: !4) +// CHECK:STDOUT: !14 = !DILocation(line: 20, column: 3, scope: !4) +// CHECK:STDOUT: !15 = !DILocation(line: 16, column: 1, scope: !4) diff --git a/toolchain/sem_ir/builtin_function_kind.cpp b/toolchain/sem_ir/builtin_function_kind.cpp index 2f60dc1546759..915c9cc9d6af2 100644 --- a/toolchain/sem_ir/builtin_function_kind.cpp +++ b/toolchain/sem_ir/builtin_function_kind.cpp @@ -63,7 +63,8 @@ struct BuiltinType { } }; -// Constraint that the function has no return. +// Constraint that a type is `()`, used as the return type of builtin functions +// with no return value. struct NoReturn { static auto Check(const File& sem_ir, ValidateState& /*state*/, TypeId type_id) -> bool { @@ -194,10 +195,18 @@ using FloatT = TypeParam<0, AnyFloat>; // Not a builtin function. constexpr BuiltinInfo None = {"", nullptr}; -// Prints an argument. +// Prints a single character. +constexpr BuiltinInfo PrintChar = {"print.char", + ValidateSignatureAnyInt>}; + +// Prints an integer. constexpr BuiltinInfo PrintInt = {"print.int", ValidateSignatureNoReturn>}; +// Reads a single character from stdin. +constexpr BuiltinInfo ReadChar = {"read.char", + ValidateSignatureAnyInt>}; + // Returns the `Core.IntLiteral` type. constexpr BuiltinInfo IntLiteralMakeType = {"int_literal.make_type", ValidateSignatureType>}; diff --git a/toolchain/sem_ir/builtin_function_kind.def b/toolchain/sem_ir/builtin_function_kind.def index 439ded7df8879..d74d755da45f2 100644 --- a/toolchain/sem_ir/builtin_function_kind.def +++ b/toolchain/sem_ir/builtin_function_kind.def @@ -17,7 +17,11 @@ #endif CARBON_SEM_IR_BUILTIN_FUNCTION_KIND(None) + +// Temporary builtins for primitive IO. +CARBON_SEM_IR_BUILTIN_FUNCTION_KIND(PrintChar) CARBON_SEM_IR_BUILTIN_FUNCTION_KIND(PrintInt) +CARBON_SEM_IR_BUILTIN_FUNCTION_KIND(ReadChar) // Type factories. CARBON_SEM_IR_BUILTIN_FUNCTION_KIND(IntLiteralMakeType) From c04d62a7d12333a1293b4858010e2a5ed155bd21 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Mon, 16 Dec 2024 16:55:06 -0800 Subject: [PATCH 37/68] Ensure that all allocas are created in the entry block. (#4685) Non-entry-block allocas will allocate new stack memory each time they're reached, resulting in leaking stack memory over time for allocas in a loop. Move all such allocas to the entry block instead, and use an LLVM intrinsic to mark when the lifetime of the variable actually begins. --- toolchain/lower/function_context.h | 20 ++++ toolchain/lower/handle.cpp | 38 ++++++- toolchain/lower/testdata/alias/local.carbon | 6 ++ .../testdata/array/array_in_place.carbon | 6 ++ .../testdata/array/assign_return_value.carbon | 5 + toolchain/lower/testdata/array/base.carbon | 95 +++++++++--------- .../testdata/basics/numeric_literals.carbon | 36 ++++--- .../testdata/builtins/no_prelude/types.carbon | 29 ++++-- toolchain/lower/testdata/class/adapt.carbon | 5 + toolchain/lower/testdata/class/basic.carbon | 21 ++-- toolchain/lower/testdata/class/convert.carbon | 9 +- toolchain/lower/testdata/class/field.carbon | 6 ++ toolchain/lower/testdata/class/virtual.carbon | 70 ++++++++----- .../function/call/empty_struct.carbon | 6 ++ .../testdata/function/call/empty_tuple.carbon | 6 ++ .../lower/testdata/function/call/i32.carbon | 6 ++ .../call/implicit_empty_tuple_as_arg.carbon | 6 ++ .../function/call/return_implicit.carbon | 6 ++ .../testdata/function/call/var_param.carbon | 6 ++ .../testdata/function/generic/call.carbon | 50 +++++----- .../function/generic/call_method.carbon | 32 +++--- .../index/array_element_access.carbon | 55 ++++++----- toolchain/lower/testdata/let/tuple.carbon | 99 ++++++++++--------- .../testdata/operators/assignment.carbon | 30 +++--- .../testdata/pointer/address_of_field.carbon | 9 +- .../testdata/pointer/address_of_unused.carbon | 6 ++ toolchain/lower/testdata/pointer/basic.carbon | 6 ++ .../pointer/pointer_to_pointer.carbon | 45 +++++---- .../testdata/return/return_var_byval.carbon | 6 ++ toolchain/lower/testdata/return/var.carbon | 6 ++ toolchain/lower/testdata/struct/empty.carbon | 17 +++- .../testdata/struct/member_access.carbon | 43 ++++---- .../struct/nested_struct_in_place.carbon | 6 ++ .../lower/testdata/struct/one_entry.carbon | 29 ++++-- .../lower/testdata/struct/two_entries.carbon | 39 +++++--- .../tuple/access/element_access.carbon | 45 +++++---- .../tuple/access/return_value_access.carbon | 5 + toolchain/lower/testdata/tuple/empty.carbon | 17 +++- .../tuple/nested_tuple_in_place.carbon | 6 ++ .../lower/testdata/tuple/one_entry.carbon | 29 +++--- .../lower/testdata/tuple/two_entries.carbon | 39 +++++--- .../testdata/tuple/value_formation.carbon | 89 +++++++++-------- toolchain/lower/testdata/var/local.carbon | 6 ++ toolchain/lower/testdata/var/nested.carbon | 75 ++++++++++++++ 44 files changed, 796 insertions(+), 375 deletions(-) create mode 100644 toolchain/lower/testdata/var/nested.carbon diff --git a/toolchain/lower/function_context.h b/toolchain/lower/function_context.h index 8a52b7743612b..eef1a7370cac7 100644 --- a/toolchain/lower/function_context.h +++ b/toolchain/lower/function_context.h @@ -89,6 +89,19 @@ class FunctionContext { return file_context_->GetTypeAsValue(); } + // Returns the instruction immediately after all the existing static allocas. + // This is the insert point for future static allocas. + auto GetInstructionAfterAllocas() const -> llvm::Instruction* { + return after_allocas_; + } + + // Sets the instruction after static allocas. This should be called once, + // after the first alloca is created. + auto SetInstructionAfterAllocas(llvm::Instruction* after_allocas) { + CARBON_CHECK(!after_allocas_); + after_allocas_ = after_allocas; + } + // Create a synthetic block that corresponds to no SemIR::InstBlockId. Such // a block should only ever have a single predecessor, and is used when we // need multiple `llvm::BasicBlock`s to model the linear control flow in a @@ -111,6 +124,7 @@ class FunctionContext { return file_context_->llvm_context(); } auto llvm_module() -> llvm::Module& { return file_context_->llvm_module(); } + auto llvm_function() -> llvm::Function& { return *function_; } auto builder() -> llvm::IRBuilderBase& { return builder_; } auto sem_ir() -> const SemIR::File& { return file_context_->sem_ir(); } @@ -155,8 +169,14 @@ class FunctionContext { // The IR function we're generating. llvm::Function* function_; + // Builder for creating code in this function. The insertion point is held at + // the location of the current SemIR instruction. llvm::IRBuilder builder_; + // The instruction after all allocas. This is used as the insert point for new + // allocas. + llvm::Instruction* after_allocas_ = nullptr; + llvm::DISubprogram* di_subprogram_; // The optional vlog stream. diff --git a/toolchain/lower/handle.cpp b/toolchain/lower/handle.cpp index a52ecae1af228..7ac2b72f488c3 100644 --- a/toolchain/lower/handle.cpp +++ b/toolchain/lower/handle.cpp @@ -264,9 +264,41 @@ auto HandleInst(FunctionContext& context, SemIR::InstId inst_id, auto HandleInst(FunctionContext& context, SemIR::InstId inst_id, SemIR::VarStorage inst) -> void { - context.SetLocal(inst_id, - context.builder().CreateAlloca(context.GetType(inst.type_id), - /*ArraySize=*/nullptr)); + auto* type = context.GetType(inst.type_id); + + // Position the first alloca right before the start of the executable code in + // the function. + auto saved_ip = context.builder().saveIP(); + if (auto* after_allocas = context.GetInstructionAfterAllocas()) { + context.builder().SetInsertPoint(after_allocas); + } else { + context.builder().SetInsertPointPastAllocas(&context.llvm_function()); + } + + // Create an alloca for this variable in the entry block. + auto* alloca = context.builder().CreateAlloca(type); + context.builder().restoreIP(saved_ip); + + // Create a lifetime start intrinsic here to indicate where its scope really + // begins. + auto size = context.llvm_module().getDataLayout().getTypeAllocSize(type); + context.builder().CreateLifetimeStart( + alloca, + llvm::ConstantInt::get(context.llvm_context(), llvm::APInt(64, size))); + + // If we just created the first alloca, there is now definitely at least one + // instruction after it -- there is a lifetime start instruction if nothing + // else. Use that instruction as our insert point for all future allocas. + if (!context.GetInstructionAfterAllocas()) { + auto loc = alloca->getIterator(); + ++loc; + context.SetInstructionAfterAllocas(&*loc); + } + + // TODO: Create a matching `@llvm.lifetime.end` intrinsic call when the + // variable goes out of scope. + + context.SetLocal(inst_id, alloca); } auto HandleInst(FunctionContext& context, SemIR::InstId inst_id, diff --git a/toolchain/lower/testdata/alias/local.carbon b/toolchain/lower/testdata/alias/local.carbon index 357d7d157db0b..665a745679dd9 100644 --- a/toolchain/lower/testdata/alias/local.carbon +++ b/toolchain/lower/testdata/alias/local.carbon @@ -20,11 +20,17 @@ fn F() -> i32 { // CHECK:STDOUT: define i32 @_CF.Main() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %a.var = alloca i32, align 4, !dbg !7 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(i64 4, ptr %a.var), !dbg !7 // CHECK:STDOUT: store i32 0, ptr %a.var, align 4, !dbg !8 // CHECK:STDOUT: %.loc14 = load i32, ptr %a.var, align 4, !dbg !9 // CHECK:STDOUT: ret i32 %.loc14, !dbg !10 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) +// CHECK:STDOUT: declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0 +// CHECK:STDOUT: +// CHECK:STDOUT: attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } +// CHECK:STDOUT: // CHECK:STDOUT: !llvm.module.flags = !{!0, !1} // CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/array/array_in_place.carbon b/toolchain/lower/testdata/array/array_in_place.carbon index dd443433fff17..08c3a10c7158b 100644 --- a/toolchain/lower/testdata/array/array_in_place.carbon +++ b/toolchain/lower/testdata/array/array_in_place.carbon @@ -22,6 +22,7 @@ fn G() { // CHECK:STDOUT: define void @_CG.Main() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %v.var = alloca [2 x { i32, i32, i32 }], align 8, !dbg !7 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(i64 24, ptr %v.var), !dbg !7 // CHECK:STDOUT: %.loc14_42.1.array.index = getelementptr inbounds [2 x { i32, i32, i32 }], ptr %v.var, i32 0, i64 0, !dbg !8 // CHECK:STDOUT: call void @_CF.Main(ptr %.loc14_42.1.array.index), !dbg !9 // CHECK:STDOUT: %.loc14_42.3.array.index = getelementptr inbounds [2 x { i32, i32, i32 }], ptr %v.var, i32 0, i64 1, !dbg !8 @@ -29,6 +30,11 @@ fn G() { // CHECK:STDOUT: ret void, !dbg !11 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) +// CHECK:STDOUT: declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0 +// CHECK:STDOUT: +// CHECK:STDOUT: attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } +// CHECK:STDOUT: // CHECK:STDOUT: !llvm.module.flags = !{!0, !1} // CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/array/assign_return_value.carbon b/toolchain/lower/testdata/array/assign_return_value.carbon index 3413e29af391e..d821bf737a443 100644 --- a/toolchain/lower/testdata/array/assign_return_value.carbon +++ b/toolchain/lower/testdata/array/assign_return_value.carbon @@ -30,6 +30,7 @@ fn Run() { // CHECK:STDOUT: define void @main() !dbg !9 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %t.var = alloca [2 x i32], align 4, !dbg !10 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(i64 8, ptr %t.var), !dbg !10 // CHECK:STDOUT: %.loc14_23.1.temp = alloca { i32, i32 }, align 8, !dbg !11 // CHECK:STDOUT: call void @_CF.Main(ptr %.loc14_23.1.temp), !dbg !11 // CHECK:STDOUT: %tuple.elem0.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %.loc14_23.1.temp, i32 0, i32 0, !dbg !11 @@ -46,7 +47,11 @@ fn Run() { // CHECK:STDOUT: ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) // CHECK:STDOUT: declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) +// CHECK:STDOUT: declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 +// CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } +// CHECK:STDOUT: attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: // CHECK:STDOUT: !llvm.module.flags = !{!0, !1} // CHECK:STDOUT: !llvm.dbg.cu = !{!2} diff --git a/toolchain/lower/testdata/array/base.carbon b/toolchain/lower/testdata/array/base.carbon index 6dc7a6d60c4f8..4d3ce6ed87f3e 100644 --- a/toolchain/lower/testdata/array/base.carbon +++ b/toolchain/lower/testdata/array/base.carbon @@ -27,47 +27,58 @@ fn Run() { // CHECK:STDOUT: define void @main() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %a.var = alloca [1 x i32], align 4, !dbg !7 +// CHECK:STDOUT: %b.var = alloca [2 x double], align 8, !dbg !7 +// CHECK:STDOUT: %c.var = alloca [5 x {}], align 8, !dbg !7 +// CHECK:STDOUT: %d.var = alloca { i32, i32, i32 }, align 8, !dbg !7 +// CHECK:STDOUT: %e.var = alloca [3 x i32], align 4, !dbg !7 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(i64 4, ptr %a.var), !dbg !7 // CHECK:STDOUT: %.loc12_24.3.array.index = getelementptr inbounds [1 x i32], ptr %a.var, i32 0, i64 0, !dbg !8 // CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %a.var, ptr align 4 @array.1.loc12_25, i64 4, i1 false), !dbg !9 -// CHECK:STDOUT: %b.var = alloca [2 x double], align 8, !dbg !10 -// CHECK:STDOUT: %.loc13_32.2.array.index = getelementptr inbounds [2 x double], ptr %b.var, i32 0, i64 0, !dbg !11 -// CHECK:STDOUT: %.loc13_32.4.array.index = getelementptr inbounds [2 x double], ptr %b.var, i32 0, i64 1, !dbg !11 -// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 8 %b.var, ptr align 8 @array.2.loc13_33, i64 16, i1 false), !dbg !12 -// CHECK:STDOUT: %c.var = alloca [5 x {}], align 8, !dbg !13 -// CHECK:STDOUT: %.loc14_40.2.array.index = getelementptr inbounds [5 x {}], ptr %c.var, i32 0, i64 0, !dbg !14 -// CHECK:STDOUT: %.loc14_40.4.array.index = getelementptr inbounds [5 x {}], ptr %c.var, i32 0, i64 1, !dbg !14 -// CHECK:STDOUT: %.loc14_40.6.array.index = getelementptr inbounds [5 x {}], ptr %c.var, i32 0, i64 2, !dbg !14 -// CHECK:STDOUT: %.loc14_40.8.array.index = getelementptr inbounds [5 x {}], ptr %c.var, i32 0, i64 3, !dbg !14 -// CHECK:STDOUT: %.loc14_40.10.array.index = getelementptr inbounds [5 x {}], ptr %c.var, i32 0, i64 4, !dbg !14 -// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %c.var, ptr align 1 @array.3.loc14_41, i64 0, i1 false), !dbg !15 -// CHECK:STDOUT: %d.var = alloca { i32, i32, i32 }, align 8, !dbg !16 -// CHECK:STDOUT: %tuple.elem0.loc15.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %d.var, i32 0, i32 0, !dbg !17 -// CHECK:STDOUT: %tuple.elem1.loc15.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %d.var, i32 0, i32 1, !dbg !17 -// CHECK:STDOUT: %tuple.elem2.loc15.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %d.var, i32 0, i32 2, !dbg !17 -// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %d.var, ptr align 4 @tuple.loc15_37, i64 12, i1 false), !dbg !18 -// CHECK:STDOUT: %e.var = alloca [3 x i32], align 4, !dbg !19 -// CHECK:STDOUT: %tuple.elem0.loc16.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %d.var, i32 0, i32 0, !dbg !20 -// CHECK:STDOUT: %.loc16_21.1 = load i32, ptr %tuple.elem0.loc16.tuple.elem, align 4, !dbg !20 -// CHECK:STDOUT: %.loc16_21.2.array.index = getelementptr inbounds [3 x i32], ptr %e.var, i32 0, i64 0, !dbg !20 -// CHECK:STDOUT: store i32 %.loc16_21.1, ptr %.loc16_21.2.array.index, align 4, !dbg !20 -// CHECK:STDOUT: %tuple.elem1.loc16.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %d.var, i32 0, i32 1, !dbg !20 -// CHECK:STDOUT: %.loc16_21.4 = load i32, ptr %tuple.elem1.loc16.tuple.elem, align 4, !dbg !20 -// CHECK:STDOUT: %.loc16_21.5.array.index = getelementptr inbounds [3 x i32], ptr %e.var, i32 0, i64 1, !dbg !20 -// CHECK:STDOUT: store i32 %.loc16_21.4, ptr %.loc16_21.5.array.index, align 4, !dbg !20 -// CHECK:STDOUT: %tuple.elem2.loc16.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %d.var, i32 0, i32 2, !dbg !20 -// CHECK:STDOUT: %.loc16_21.7 = load i32, ptr %tuple.elem2.loc16.tuple.elem, align 4, !dbg !20 -// CHECK:STDOUT: %.loc16_21.8.array.index = getelementptr inbounds [3 x i32], ptr %e.var, i32 0, i64 2, !dbg !20 -// CHECK:STDOUT: store i32 %.loc16_21.7, ptr %.loc16_21.8.array.index, align 4, !dbg !20 -// CHECK:STDOUT: ret void, !dbg !21 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(i64 16, ptr %b.var), !dbg !7 +// CHECK:STDOUT: %.loc13_32.2.array.index = getelementptr inbounds [2 x double], ptr %b.var, i32 0, i64 0, !dbg !10 +// CHECK:STDOUT: %.loc13_32.4.array.index = getelementptr inbounds [2 x double], ptr %b.var, i32 0, i64 1, !dbg !10 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 8 %b.var, ptr align 8 @array.2.loc13_33, i64 16, i1 false), !dbg !11 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(i64 0, ptr %c.var), !dbg !7 +// CHECK:STDOUT: %.loc14_40.2.array.index = getelementptr inbounds [5 x {}], ptr %c.var, i32 0, i64 0, !dbg !12 +// CHECK:STDOUT: %.loc14_40.4.array.index = getelementptr inbounds [5 x {}], ptr %c.var, i32 0, i64 1, !dbg !12 +// CHECK:STDOUT: %.loc14_40.6.array.index = getelementptr inbounds [5 x {}], ptr %c.var, i32 0, i64 2, !dbg !12 +// CHECK:STDOUT: %.loc14_40.8.array.index = getelementptr inbounds [5 x {}], ptr %c.var, i32 0, i64 3, !dbg !12 +// CHECK:STDOUT: %.loc14_40.10.array.index = getelementptr inbounds [5 x {}], ptr %c.var, i32 0, i64 4, !dbg !12 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %c.var, ptr align 1 @array.3.loc14_41, i64 0, i1 false), !dbg !13 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(i64 12, ptr %d.var), !dbg !7 +// CHECK:STDOUT: %tuple.elem0.loc15.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %d.var, i32 0, i32 0, !dbg !14 +// CHECK:STDOUT: %tuple.elem1.loc15.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %d.var, i32 0, i32 1, !dbg !14 +// CHECK:STDOUT: %tuple.elem2.loc15.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %d.var, i32 0, i32 2, !dbg !14 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %d.var, ptr align 4 @tuple.loc15_37, i64 12, i1 false), !dbg !15 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(i64 12, ptr %e.var), !dbg !7 +// CHECK:STDOUT: %tuple.elem0.loc16.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %d.var, i32 0, i32 0, !dbg !16 +// CHECK:STDOUT: %.loc16_21.1 = load i32, ptr %tuple.elem0.loc16.tuple.elem, align 4, !dbg !16 +// CHECK:STDOUT: %.loc16_21.2.array.index = getelementptr inbounds [3 x i32], ptr %e.var, i32 0, i64 0, !dbg !16 +// CHECK:STDOUT: store i32 %.loc16_21.1, ptr %.loc16_21.2.array.index, align 4, !dbg !16 +// CHECK:STDOUT: %tuple.elem1.loc16.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %d.var, i32 0, i32 1, !dbg !16 +// CHECK:STDOUT: %.loc16_21.4 = load i32, ptr %tuple.elem1.loc16.tuple.elem, align 4, !dbg !16 +// CHECK:STDOUT: %.loc16_21.5.array.index = getelementptr inbounds [3 x i32], ptr %e.var, i32 0, i64 1, !dbg !16 +// CHECK:STDOUT: store i32 %.loc16_21.4, ptr %.loc16_21.5.array.index, align 4, !dbg !16 +// CHECK:STDOUT: %tuple.elem2.loc16.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %d.var, i32 0, i32 2, !dbg !16 +// CHECK:STDOUT: %.loc16_21.7 = load i32, ptr %tuple.elem2.loc16.tuple.elem, align 4, !dbg !16 +// CHECK:STDOUT: %.loc16_21.8.array.index = getelementptr inbounds [3 x i32], ptr %e.var, i32 0, i64 2, !dbg !16 +// CHECK:STDOUT: store i32 %.loc16_21.7, ptr %.loc16_21.8.array.index, align 4, !dbg !16 +// CHECK:STDOUT: ret void, !dbg !17 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) +// CHECK:STDOUT: declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0 +// CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) -// CHECK:STDOUT: declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 +// CHECK:STDOUT: declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1 // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives +// CHECK:STDOUT: uselistorder i32 1, { 0, 2, 1, 3, 4, 5, 6, 7 } +// CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 4, 3, 2, 1, 0 } // CHECK:STDOUT: uselistorder ptr @llvm.memcpy.p0.p0.i64, { 3, 2, 1, 0 } // CHECK:STDOUT: -// CHECK:STDOUT: attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } +// CHECK:STDOUT: attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } +// CHECK:STDOUT: attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: // CHECK:STDOUT: !llvm.module.flags = !{!0, !1} // CHECK:STDOUT: !llvm.dbg.cu = !{!2} @@ -82,15 +93,11 @@ fn Run() { // CHECK:STDOUT: !7 = !DILocation(line: 12, column: 7, scope: !4) // CHECK:STDOUT: !8 = !DILocation(line: 12, column: 21, scope: !4) // CHECK:STDOUT: !9 = !DILocation(line: 12, column: 3, scope: !4) -// CHECK:STDOUT: !10 = !DILocation(line: 13, column: 7, scope: !4) -// CHECK:STDOUT: !11 = !DILocation(line: 13, column: 21, scope: !4) -// CHECK:STDOUT: !12 = !DILocation(line: 13, column: 3, scope: !4) -// CHECK:STDOUT: !13 = !DILocation(line: 14, column: 7, scope: !4) -// CHECK:STDOUT: !14 = !DILocation(line: 14, column: 20, scope: !4) -// CHECK:STDOUT: !15 = !DILocation(line: 14, column: 3, scope: !4) -// CHECK:STDOUT: !16 = !DILocation(line: 15, column: 7, scope: !4) -// CHECK:STDOUT: !17 = !DILocation(line: 15, column: 28, scope: !4) -// CHECK:STDOUT: !18 = !DILocation(line: 15, column: 3, scope: !4) -// CHECK:STDOUT: !19 = !DILocation(line: 16, column: 7, scope: !4) -// CHECK:STDOUT: !20 = !DILocation(line: 16, column: 21, scope: !4) -// CHECK:STDOUT: !21 = !DILocation(line: 11, column: 1, scope: !4) +// CHECK:STDOUT: !10 = !DILocation(line: 13, column: 21, scope: !4) +// CHECK:STDOUT: !11 = !DILocation(line: 13, column: 3, scope: !4) +// CHECK:STDOUT: !12 = !DILocation(line: 14, column: 20, scope: !4) +// CHECK:STDOUT: !13 = !DILocation(line: 14, column: 3, scope: !4) +// CHECK:STDOUT: !14 = !DILocation(line: 15, column: 28, scope: !4) +// CHECK:STDOUT: !15 = !DILocation(line: 15, column: 3, scope: !4) +// CHECK:STDOUT: !16 = !DILocation(line: 16, column: 21, scope: !4) +// CHECK:STDOUT: !17 = !DILocation(line: 11, column: 1, scope: !4) diff --git a/toolchain/lower/testdata/basics/numeric_literals.carbon b/toolchain/lower/testdata/basics/numeric_literals.carbon index e630627b39743..ee9d8c92778f2 100644 --- a/toolchain/lower/testdata/basics/numeric_literals.carbon +++ b/toolchain/lower/testdata/basics/numeric_literals.carbon @@ -36,29 +36,36 @@ fn F() { // CHECK:STDOUT: define void @_CF.Main() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %ints.var = alloca [4 x i32], align 4, !dbg !7 +// CHECK:STDOUT: %floats.var = alloca [6 x double], align 8, !dbg !7 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(i64 16, ptr %ints.var), !dbg !7 // CHECK:STDOUT: %.loc19_3.3.array.index = getelementptr inbounds [4 x i32], ptr %ints.var, i32 0, i64 0, !dbg !8 // CHECK:STDOUT: %.loc19_3.6.array.index = getelementptr inbounds [4 x i32], ptr %ints.var, i32 0, i64 1, !dbg !8 // CHECK:STDOUT: %.loc19_3.9.array.index = getelementptr inbounds [4 x i32], ptr %ints.var, i32 0, i64 2, !dbg !8 // CHECK:STDOUT: %.loc19_3.12.array.index = getelementptr inbounds [4 x i32], ptr %ints.var, i32 0, i64 3, !dbg !8 // CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %ints.var, ptr align 4 @array.1.loc19_4, i64 16, i1 false), !dbg !9 -// CHECK:STDOUT: %floats.var = alloca [6 x double], align 8, !dbg !10 -// CHECK:STDOUT: %.loc27_3.2.array.index = getelementptr inbounds [6 x double], ptr %floats.var, i32 0, i64 0, !dbg !11 -// CHECK:STDOUT: %.loc27_3.4.array.index = getelementptr inbounds [6 x double], ptr %floats.var, i32 0, i64 1, !dbg !11 -// CHECK:STDOUT: %.loc27_3.6.array.index = getelementptr inbounds [6 x double], ptr %floats.var, i32 0, i64 2, !dbg !11 -// CHECK:STDOUT: %.loc27_3.8.array.index = getelementptr inbounds [6 x double], ptr %floats.var, i32 0, i64 3, !dbg !11 -// CHECK:STDOUT: %.loc27_3.10.array.index = getelementptr inbounds [6 x double], ptr %floats.var, i32 0, i64 4, !dbg !11 -// CHECK:STDOUT: %.loc27_3.12.array.index = getelementptr inbounds [6 x double], ptr %floats.var, i32 0, i64 5, !dbg !11 -// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 8 %floats.var, ptr align 8 @array.2.loc27_4, i64 48, i1 false), !dbg !12 -// CHECK:STDOUT: ret void, !dbg !13 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(i64 48, ptr %floats.var), !dbg !7 +// CHECK:STDOUT: %.loc27_3.2.array.index = getelementptr inbounds [6 x double], ptr %floats.var, i32 0, i64 0, !dbg !10 +// CHECK:STDOUT: %.loc27_3.4.array.index = getelementptr inbounds [6 x double], ptr %floats.var, i32 0, i64 1, !dbg !10 +// CHECK:STDOUT: %.loc27_3.6.array.index = getelementptr inbounds [6 x double], ptr %floats.var, i32 0, i64 2, !dbg !10 +// CHECK:STDOUT: %.loc27_3.8.array.index = getelementptr inbounds [6 x double], ptr %floats.var, i32 0, i64 3, !dbg !10 +// CHECK:STDOUT: %.loc27_3.10.array.index = getelementptr inbounds [6 x double], ptr %floats.var, i32 0, i64 4, !dbg !10 +// CHECK:STDOUT: %.loc27_3.12.array.index = getelementptr inbounds [6 x double], ptr %floats.var, i32 0, i64 5, !dbg !10 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 8 %floats.var, ptr align 8 @array.2.loc27_4, i64 48, i1 false), !dbg !11 +// CHECK:STDOUT: ret void, !dbg !12 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) +// CHECK:STDOUT: declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0 +// CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) -// CHECK:STDOUT: declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 +// CHECK:STDOUT: declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1 // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives +// CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 1, 0 } // CHECK:STDOUT: uselistorder ptr @llvm.memcpy.p0.p0.i64, { 1, 0 } // CHECK:STDOUT: -// CHECK:STDOUT: attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } +// CHECK:STDOUT: attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } +// CHECK:STDOUT: attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: // CHECK:STDOUT: !llvm.module.flags = !{!0, !1} // CHECK:STDOUT: !llvm.dbg.cu = !{!2} @@ -73,7 +80,6 @@ fn F() { // CHECK:STDOUT: !7 = !DILocation(line: 14, column: 7, scope: !4) // CHECK:STDOUT: !8 = !DILocation(line: 14, column: 24, scope: !4) // CHECK:STDOUT: !9 = !DILocation(line: 14, column: 3, scope: !4) -// CHECK:STDOUT: !10 = !DILocation(line: 20, column: 7, scope: !4) -// CHECK:STDOUT: !11 = !DILocation(line: 20, column: 26, scope: !4) -// CHECK:STDOUT: !12 = !DILocation(line: 20, column: 3, scope: !4) -// CHECK:STDOUT: !13 = !DILocation(line: 11, column: 1, scope: !4) +// CHECK:STDOUT: !10 = !DILocation(line: 20, column: 26, scope: !4) +// CHECK:STDOUT: !11 = !DILocation(line: 20, column: 3, scope: !4) +// CHECK:STDOUT: !12 = !DILocation(line: 11, column: 1, scope: !4) diff --git a/toolchain/lower/testdata/builtins/no_prelude/types.carbon b/toolchain/lower/testdata/builtins/no_prelude/types.carbon index 539f67f019786..4c1f2d5f4d9c8 100644 --- a/toolchain/lower/testdata/builtins/no_prelude/types.carbon +++ b/toolchain/lower/testdata/builtins/no_prelude/types.carbon @@ -26,14 +26,25 @@ fn F() { // CHECK:STDOUT: define void @_CF.Main() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %i.var = alloca i32, align 4, !dbg !7 +// CHECK:STDOUT: %f.var = alloca double, align 8, !dbg !7 +// CHECK:STDOUT: %b.var = alloca i1, align 1, !dbg !7 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(i64 4, ptr %i.var), !dbg !7 // CHECK:STDOUT: store i32 0, ptr %i.var, align 4, !dbg !8 -// CHECK:STDOUT: %f.var = alloca double, align 8, !dbg !9 -// CHECK:STDOUT: store double 0.000000e+00, ptr %f.var, align 8, !dbg !10 -// CHECK:STDOUT: %b.var = alloca i1, align 1, !dbg !11 -// CHECK:STDOUT: store i1 false, ptr %b.var, align 1, !dbg !12 -// CHECK:STDOUT: ret void, !dbg !13 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(i64 8, ptr %f.var), !dbg !7 +// CHECK:STDOUT: store double 0.000000e+00, ptr %f.var, align 8, !dbg !9 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(i64 1, ptr %b.var), !dbg !7 +// CHECK:STDOUT: store i1 false, ptr %b.var, align 1, !dbg !10 +// CHECK:STDOUT: ret void, !dbg !11 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) +// CHECK:STDOUT: declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0 +// CHECK:STDOUT: +// CHECK:STDOUT: ; uselistorder directives +// CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 2, 1, 0 } +// CHECK:STDOUT: +// CHECK:STDOUT: attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } +// CHECK:STDOUT: // CHECK:STDOUT: !llvm.module.flags = !{!0, !1} // CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: @@ -46,8 +57,6 @@ fn F() { // CHECK:STDOUT: !6 = !{} // CHECK:STDOUT: !7 = !DILocation(line: 18, column: 7, scope: !4) // CHECK:STDOUT: !8 = !DILocation(line: 18, column: 3, scope: !4) -// CHECK:STDOUT: !9 = !DILocation(line: 19, column: 7, scope: !4) -// CHECK:STDOUT: !10 = !DILocation(line: 19, column: 3, scope: !4) -// CHECK:STDOUT: !11 = !DILocation(line: 20, column: 7, scope: !4) -// CHECK:STDOUT: !12 = !DILocation(line: 20, column: 3, scope: !4) -// CHECK:STDOUT: !13 = !DILocation(line: 17, column: 1, scope: !4) +// CHECK:STDOUT: !9 = !DILocation(line: 19, column: 3, scope: !4) +// CHECK:STDOUT: !10 = !DILocation(line: 20, column: 3, scope: !4) +// CHECK:STDOUT: !11 = !DILocation(line: 17, column: 1, scope: !4) diff --git a/toolchain/lower/testdata/class/adapt.carbon b/toolchain/lower/testdata/class/adapt.carbon index 996cfb1a043f4..14b616e3efbb8 100644 --- a/toolchain/lower/testdata/class/adapt.carbon +++ b/toolchain/lower/testdata/class/adapt.carbon @@ -80,6 +80,7 @@ fn DoStuff(a: Int) -> Int { // CHECK:STDOUT: define i32 @_CUse.Main() !dbg !15 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %pa.var = alloca { i32, i32 }, align 8, !dbg !16 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(i64 8, ptr %pa.var), !dbg !16 // CHECK:STDOUT: call void @_CMake.PairAdapter.Main(ptr %pa.var), !dbg !17 // CHECK:STDOUT: %GetB.call = call i32 @_CGetB.PairAdapter.Main(ptr %pa.var), !dbg !18 // CHECK:STDOUT: ret i32 %GetB.call, !dbg !19 @@ -88,7 +89,11 @@ fn DoStuff(a: Int) -> Int { // CHECK:STDOUT: ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) // CHECK:STDOUT: declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) +// CHECK:STDOUT: declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 +// CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } +// CHECK:STDOUT: attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: // CHECK:STDOUT: !llvm.module.flags = !{!0, !1} // CHECK:STDOUT: !llvm.dbg.cu = !{!2} diff --git a/toolchain/lower/testdata/class/basic.carbon b/toolchain/lower/testdata/class/basic.carbon index 97a1858eecb76..cbd22bcad30b2 100644 --- a/toolchain/lower/testdata/class/basic.carbon +++ b/toolchain/lower/testdata/class/basic.carbon @@ -28,11 +28,21 @@ fn Run() { // CHECK:STDOUT: define void @main() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %c.var = alloca { i32, ptr }, align 8, !dbg !7 -// CHECK:STDOUT: %d.var = alloca { i32, ptr }, align 8, !dbg !8 -// CHECK:STDOUT: call void @_CF.Main(ptr %d.var, ptr %c.var), !dbg !9 -// CHECK:STDOUT: ret void, !dbg !10 +// CHECK:STDOUT: %d.var = alloca { i32, ptr }, align 8, !dbg !7 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(i64 16, ptr %c.var), !dbg !7 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(i64 16, ptr %d.var), !dbg !7 +// CHECK:STDOUT: call void @_CF.Main(ptr %d.var, ptr %c.var), !dbg !8 +// CHECK:STDOUT: ret void, !dbg !9 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) +// CHECK:STDOUT: declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0 +// CHECK:STDOUT: +// CHECK:STDOUT: ; uselistorder directives +// CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 1, 0 } +// CHECK:STDOUT: +// CHECK:STDOUT: attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } +// CHECK:STDOUT: // CHECK:STDOUT: !llvm.module.flags = !{!0, !1} // CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: @@ -44,6 +54,5 @@ fn Run() { // CHECK:STDOUT: !5 = !DISubroutineType(types: !6) // CHECK:STDOUT: !6 = !{} // CHECK:STDOUT: !7 = !DILocation(line: 19, column: 7, scope: !4) -// CHECK:STDOUT: !8 = !DILocation(line: 20, column: 7, scope: !4) -// CHECK:STDOUT: !9 = !DILocation(line: 20, column: 14, scope: !4) -// CHECK:STDOUT: !10 = !DILocation(line: 18, column: 1, scope: !4) +// CHECK:STDOUT: !8 = !DILocation(line: 20, column: 14, scope: !4) +// CHECK:STDOUT: !9 = !DILocation(line: 18, column: 1, scope: !4) diff --git a/toolchain/lower/testdata/class/convert.carbon b/toolchain/lower/testdata/class/convert.carbon index f76d1d609e162..61d2b4046bd09 100644 --- a/toolchain/lower/testdata/class/convert.carbon +++ b/toolchain/lower/testdata/class/convert.carbon @@ -43,6 +43,7 @@ fn DoIt() { // CHECK:STDOUT: define void @_CDoIt.Main() !dbg !11 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %w.var = alloca { i32 }, align 8, !dbg !12 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(i64 4, ptr %w.var), !dbg !12 // CHECK:STDOUT: %.loc22_31.3.n = getelementptr inbounds nuw { i32 }, ptr %w.var, i32 0, i32 0, !dbg !13 // CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %w.var, ptr align 4 @IntWrapper.val.loc22_32, i64 4, i1 false), !dbg !14 // CHECK:STDOUT: %Convert.call = call i32 @"_CConvert.IntWrapper.Main:ImplicitAs.Core"(ptr %w.var), !dbg !15 @@ -50,10 +51,14 @@ fn DoIt() { // CHECK:STDOUT: ret void, !dbg !17 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) +// CHECK:STDOUT: declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0 +// CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) -// CHECK:STDOUT: declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 +// CHECK:STDOUT: declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1 // CHECK:STDOUT: -// CHECK:STDOUT: attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } +// CHECK:STDOUT: attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } +// CHECK:STDOUT: attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: // CHECK:STDOUT: !llvm.module.flags = !{!0, !1} // CHECK:STDOUT: !llvm.dbg.cu = !{!2} diff --git a/toolchain/lower/testdata/class/field.carbon b/toolchain/lower/testdata/class/field.carbon index 1eee8359db20f..741b13c64af50 100644 --- a/toolchain/lower/testdata/class/field.carbon +++ b/toolchain/lower/testdata/class/field.carbon @@ -39,6 +39,7 @@ fn Run() -> i32 { // CHECK:STDOUT: define i32 @main() !dbg !10 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %c.var = alloca { i32, ptr }, align 8, !dbg !11 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(i64 16, ptr %c.var), !dbg !11 // CHECK:STDOUT: %.loc22_4.a = getelementptr inbounds nuw { i32, ptr }, ptr %c.var, i32 0, i32 0, !dbg !12 // CHECK:STDOUT: store i32 1, ptr %.loc22_4.a, align 4, !dbg !12 // CHECK:STDOUT: %.loc23.b = getelementptr inbounds nuw { i32, ptr }, ptr %c.var, i32 0, i32 1, !dbg !13 @@ -47,6 +48,11 @@ fn Run() -> i32 { // CHECK:STDOUT: ret i32 %F.call, !dbg !15 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) +// CHECK:STDOUT: declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0 +// CHECK:STDOUT: +// CHECK:STDOUT: attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } +// CHECK:STDOUT: // CHECK:STDOUT: !llvm.module.flags = !{!0, !1} // CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/class/virtual.carbon b/toolchain/lower/testdata/class/virtual.carbon index a7b57135dd863..82e37a764c474 100644 --- a/toolchain/lower/testdata/class/virtual.carbon +++ b/toolchain/lower/testdata/class/virtual.carbon @@ -79,19 +79,30 @@ fn Fn() { // CHECK:STDOUT: define void @_CCreate.Create() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %b.var = alloca {}, align 8, !dbg !7 -// CHECK:STDOUT: %i.var = alloca { ptr, {} }, align 8, !dbg !8 -// CHECK:STDOUT: %d.var = alloca { { ptr, {} } }, align 8, !dbg !9 -// CHECK:STDOUT: ret void, !dbg !10 +// CHECK:STDOUT: %i.var = alloca { ptr, {} }, align 8, !dbg !7 +// CHECK:STDOUT: %d.var = alloca { { ptr, {} } }, align 8, !dbg !7 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(i64 0, ptr %b.var), !dbg !7 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(i64 8, ptr %i.var), !dbg !7 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(i64 8, ptr %d.var), !dbg !7 +// CHECK:STDOUT: ret void, !dbg !8 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define void @_CUse.Create(ptr %v) !dbg !11 { +// CHECK:STDOUT: define void @_CUse.Create(ptr %v) !dbg !9 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_CFn.Intermediate.Classes(), !dbg !12 -// CHECK:STDOUT: ret void, !dbg !13 +// CHECK:STDOUT: call void @_CFn.Intermediate.Classes(), !dbg !10 +// CHECK:STDOUT: ret void, !dbg !11 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @_CFn.Intermediate.Classes() // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) +// CHECK:STDOUT: declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0 +// CHECK:STDOUT: +// CHECK:STDOUT: ; uselistorder directives +// CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 2, 1, 0 } +// CHECK:STDOUT: +// CHECK:STDOUT: attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } +// CHECK:STDOUT: // CHECK:STDOUT: !llvm.module.flags = !{!0, !1} // CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: @@ -103,12 +114,10 @@ fn Fn() { // CHECK:STDOUT: !5 = !DISubroutineType(types: !6) // CHECK:STDOUT: !6 = !{} // CHECK:STDOUT: !7 = !DILocation(line: 7, column: 7, scope: !4) -// CHECK:STDOUT: !8 = !DILocation(line: 8, column: 7, scope: !4) -// CHECK:STDOUT: !9 = !DILocation(line: 9, column: 7, scope: !4) -// CHECK:STDOUT: !10 = !DILocation(line: 6, column: 1, scope: !4) -// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "Use", linkageName: "_CUse.Create", scope: null, file: !3, line: 12, type: !5, spFlags: DISPFlagDefinition, unit: !2) -// CHECK:STDOUT: !12 = !DILocation(line: 13, column: 3, scope: !11) -// CHECK:STDOUT: !13 = !DILocation(line: 12, column: 1, scope: !11) +// CHECK:STDOUT: !8 = !DILocation(line: 6, column: 1, scope: !4) +// CHECK:STDOUT: !9 = distinct !DISubprogram(name: "Use", linkageName: "_CUse.Create", scope: null, file: !3, line: 12, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !10 = !DILocation(line: 13, column: 3, scope: !9) +// CHECK:STDOUT: !11 = !DILocation(line: 12, column: 1, scope: !9) // CHECK:STDOUT: ; ModuleID = 'member_init.carbon' // CHECK:STDOUT: source_filename = "member_init.carbon" // CHECK:STDOUT: @@ -117,18 +126,28 @@ fn Fn() { // CHECK:STDOUT: define void @_CFn.MemberInit() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %i.var = alloca i32, align 4, !dbg !7 +// CHECK:STDOUT: %v.var = alloca { ptr, i32 }, align 8, !dbg !7 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(i64 4, ptr %i.var), !dbg !7 // CHECK:STDOUT: store i32 3, ptr %i.var, align 4, !dbg !8 -// CHECK:STDOUT: %v.var = alloca { ptr, i32 }, align 8, !dbg !9 -// CHECK:STDOUT: %.loc12_24.2.vptr = getelementptr inbounds nuw { ptr, i32 }, ptr %v.var, i32 0, i32 0, !dbg !10 -// CHECK:STDOUT: store ptr null, ptr %.loc12_24.2.vptr, align 8, !dbg !10 -// CHECK:STDOUT: %.loc12_23 = load i32, ptr %i.var, align 4, !dbg !11 -// CHECK:STDOUT: %.loc12_24.5.m = getelementptr inbounds nuw { ptr, i32 }, ptr %v.var, i32 0, i32 1, !dbg !10 -// CHECK:STDOUT: store i32 %.loc12_23, ptr %.loc12_24.5.m, align 4, !dbg !10 -// CHECK:STDOUT: %.loc15_4.m = getelementptr inbounds nuw { ptr, i32 }, ptr %v.var, i32 0, i32 1, !dbg !12 -// CHECK:STDOUT: store i32 5, ptr %.loc15_4.m, align 4, !dbg !12 -// CHECK:STDOUT: ret void, !dbg !13 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(i64 16, ptr %v.var), !dbg !7 +// CHECK:STDOUT: %.loc12_24.2.vptr = getelementptr inbounds nuw { ptr, i32 }, ptr %v.var, i32 0, i32 0, !dbg !9 +// CHECK:STDOUT: store ptr null, ptr %.loc12_24.2.vptr, align 8, !dbg !9 +// CHECK:STDOUT: %.loc12_23 = load i32, ptr %i.var, align 4, !dbg !10 +// CHECK:STDOUT: %.loc12_24.5.m = getelementptr inbounds nuw { ptr, i32 }, ptr %v.var, i32 0, i32 1, !dbg !9 +// CHECK:STDOUT: store i32 %.loc12_23, ptr %.loc12_24.5.m, align 4, !dbg !9 +// CHECK:STDOUT: %.loc15_4.m = getelementptr inbounds nuw { ptr, i32 }, ptr %v.var, i32 0, i32 1, !dbg !11 +// CHECK:STDOUT: store i32 5, ptr %.loc15_4.m, align 4, !dbg !11 +// CHECK:STDOUT: ret void, !dbg !12 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) +// CHECK:STDOUT: declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0 +// CHECK:STDOUT: +// CHECK:STDOUT: ; uselistorder directives +// CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 1, 0 } +// CHECK:STDOUT: +// CHECK:STDOUT: attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } +// CHECK:STDOUT: // CHECK:STDOUT: !llvm.module.flags = !{!0, !1} // CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: @@ -141,8 +160,7 @@ fn Fn() { // CHECK:STDOUT: !6 = !{} // CHECK:STDOUT: !7 = !DILocation(line: 10, column: 7, scope: !4) // CHECK:STDOUT: !8 = !DILocation(line: 10, column: 3, scope: !4) -// CHECK:STDOUT: !9 = !DILocation(line: 12, column: 7, scope: !4) -// CHECK:STDOUT: !10 = !DILocation(line: 12, column: 17, scope: !4) -// CHECK:STDOUT: !11 = !DILocation(line: 12, column: 23, scope: !4) -// CHECK:STDOUT: !12 = !DILocation(line: 15, column: 3, scope: !4) -// CHECK:STDOUT: !13 = !DILocation(line: 9, column: 1, scope: !4) +// CHECK:STDOUT: !9 = !DILocation(line: 12, column: 17, scope: !4) +// CHECK:STDOUT: !10 = !DILocation(line: 12, column: 23, scope: !4) +// CHECK:STDOUT: !11 = !DILocation(line: 15, column: 3, scope: !4) +// CHECK:STDOUT: !12 = !DILocation(line: 9, column: 1, scope: !4) diff --git a/toolchain/lower/testdata/function/call/empty_struct.carbon b/toolchain/lower/testdata/function/call/empty_struct.carbon index c320614ff2da4..99e62bb29767b 100644 --- a/toolchain/lower/testdata/function/call/empty_struct.carbon +++ b/toolchain/lower/testdata/function/call/empty_struct.carbon @@ -27,10 +27,16 @@ fn Main() { // CHECK:STDOUT: define void @_CMain.Main() !dbg !8 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %b.var = alloca {}, align 8, !dbg !9 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(i64 0, ptr %b.var), !dbg !9 // CHECK:STDOUT: call void @_CEcho.Main(), !dbg !10 // CHECK:STDOUT: ret void, !dbg !11 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) +// CHECK:STDOUT: declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0 +// CHECK:STDOUT: +// CHECK:STDOUT: attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } +// CHECK:STDOUT: // CHECK:STDOUT: !llvm.module.flags = !{!0, !1} // CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/function/call/empty_tuple.carbon b/toolchain/lower/testdata/function/call/empty_tuple.carbon index c05c94f1d634c..4775599234b29 100644 --- a/toolchain/lower/testdata/function/call/empty_tuple.carbon +++ b/toolchain/lower/testdata/function/call/empty_tuple.carbon @@ -27,10 +27,16 @@ fn Main() { // CHECK:STDOUT: define void @_CMain.Main() !dbg !8 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %b.var = alloca {}, align 8, !dbg !9 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(i64 0, ptr %b.var), !dbg !9 // CHECK:STDOUT: call void @_CEcho.Main(), !dbg !10 // CHECK:STDOUT: ret void, !dbg !11 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) +// CHECK:STDOUT: declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0 +// CHECK:STDOUT: +// CHECK:STDOUT: attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } +// CHECK:STDOUT: // CHECK:STDOUT: !llvm.module.flags = !{!0, !1} // CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/function/call/i32.carbon b/toolchain/lower/testdata/function/call/i32.carbon index 3e4a9e4914a2c..8457c43754631 100644 --- a/toolchain/lower/testdata/function/call/i32.carbon +++ b/toolchain/lower/testdata/function/call/i32.carbon @@ -27,11 +27,17 @@ fn Main() { // CHECK:STDOUT: define void @_CMain.Main() !dbg !8 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %b.var = alloca i32, align 4, !dbg !9 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(i64 4, ptr %b.var), !dbg !9 // CHECK:STDOUT: %Echo.call = call i32 @_CEcho.Main(i32 1), !dbg !10 // CHECK:STDOUT: store i32 %Echo.call, ptr %b.var, align 4, !dbg !11 // CHECK:STDOUT: ret void, !dbg !12 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) +// CHECK:STDOUT: declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0 +// CHECK:STDOUT: +// CHECK:STDOUT: attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } +// CHECK:STDOUT: // CHECK:STDOUT: !llvm.module.flags = !{!0, !1} // CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/function/call/implicit_empty_tuple_as_arg.carbon b/toolchain/lower/testdata/function/call/implicit_empty_tuple_as_arg.carbon index 2f0e16773a8c1..18f7ed1931a0f 100644 --- a/toolchain/lower/testdata/function/call/implicit_empty_tuple_as_arg.carbon +++ b/toolchain/lower/testdata/function/call/implicit_empty_tuple_as_arg.carbon @@ -33,12 +33,18 @@ fn Main() { // CHECK:STDOUT: define void @_CMain.Main() !dbg !10 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %x.var = alloca {}, align 8, !dbg !11 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(i64 0, ptr %x.var), !dbg !11 // CHECK:STDOUT: call void @_CFoo.Main(), !dbg !12 // CHECK:STDOUT: %.loc17_23.1.temp = alloca {}, align 8, !dbg !12 // CHECK:STDOUT: call void @_CBar.Main(), !dbg !13 // CHECK:STDOUT: ret void, !dbg !14 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) +// CHECK:STDOUT: declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0 +// CHECK:STDOUT: +// CHECK:STDOUT: attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } +// CHECK:STDOUT: // CHECK:STDOUT: !llvm.module.flags = !{!0, !1} // CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/function/call/return_implicit.carbon b/toolchain/lower/testdata/function/call/return_implicit.carbon index a1e3c1a511260..2fba16122b3d8 100644 --- a/toolchain/lower/testdata/function/call/return_implicit.carbon +++ b/toolchain/lower/testdata/function/call/return_implicit.carbon @@ -27,10 +27,16 @@ fn Main() { // CHECK:STDOUT: define void @_CMain.Main() !dbg !8 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %b.var = alloca {}, align 8, !dbg !9 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(i64 0, ptr %b.var), !dbg !9 // CHECK:STDOUT: call void @_CMakeImplicitEmptyTuple.Main(), !dbg !10 // CHECK:STDOUT: ret void, !dbg !11 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) +// CHECK:STDOUT: declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0 +// CHECK:STDOUT: +// CHECK:STDOUT: attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } +// CHECK:STDOUT: // CHECK:STDOUT: !llvm.module.flags = !{!0, !1} // CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/function/call/var_param.carbon b/toolchain/lower/testdata/function/call/var_param.carbon index 0ebccd348889d..1790ca4befc34 100644 --- a/toolchain/lower/testdata/function/call/var_param.carbon +++ b/toolchain/lower/testdata/function/call/var_param.carbon @@ -26,12 +26,18 @@ fn Main() { // CHECK:STDOUT: define void @_CMain.Main() !dbg !8 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %a.var = alloca i32, align 4, !dbg !9 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(i64 4, ptr %a.var), !dbg !9 // CHECK:STDOUT: store i32 0, ptr %a.var, align 4, !dbg !10 // CHECK:STDOUT: %.loc15 = load i32, ptr %a.var, align 4, !dbg !11 // CHECK:STDOUT: call void @_CDoNothing.Main(i32 %.loc15), !dbg !12 // CHECK:STDOUT: ret void, !dbg !13 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) +// CHECK:STDOUT: declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0 +// CHECK:STDOUT: +// CHECK:STDOUT: attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } +// CHECK:STDOUT: // CHECK:STDOUT: !llvm.module.flags = !{!0, !1} // CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/function/generic/call.carbon b/toolchain/lower/testdata/function/generic/call.carbon index cd9db70a609d0..d6d39409ac43b 100644 --- a/toolchain/lower/testdata/function/generic/call.carbon +++ b/toolchain/lower/testdata/function/generic/call.carbon @@ -36,21 +36,27 @@ fn G() { // CHECK:STDOUT: define void @_CG.Main() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %c.var = alloca {}, align 8, !dbg !7 +// CHECK:STDOUT: %d.var = alloca {}, align 8, !dbg !7 +// CHECK:STDOUT: %n.var = alloca i32, align 4, !dbg !7 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(i64 0, ptr %c.var), !dbg !7 // CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %c.var, ptr align 1 @C.val.loc18_16, i64 0, i1 false), !dbg !8 -// CHECK:STDOUT: %d.var = alloca {}, align 8, !dbg !9 -// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %d.var, ptr align 1 @D.val.loc19_16, i64 0, i1 false), !dbg !10 -// CHECK:STDOUT: %n.var = alloca i32, align 4, !dbg !11 -// CHECK:STDOUT: store i32 0, ptr %n.var, align 4, !dbg !12 -// CHECK:STDOUT: call void @_CF.Main.40(ptr %c.var), !dbg !13 -// CHECK:STDOUT: call void @_CF.Main.41(ptr %d.var), !dbg !14 -// CHECK:STDOUT: %.loc24 = load i32, ptr %n.var, align 4, !dbg !15 -// CHECK:STDOUT: call void @_CF.Main.42(i32 %.loc24), !dbg !16 -// CHECK:STDOUT: call void @_CF.Main.43(%type zeroinitializer), !dbg !17 -// CHECK:STDOUT: ret void, !dbg !18 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(i64 0, ptr %d.var), !dbg !7 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %d.var, ptr align 1 @D.val.loc19_16, i64 0, i1 false), !dbg !9 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(i64 4, ptr %n.var), !dbg !7 +// CHECK:STDOUT: store i32 0, ptr %n.var, align 4, !dbg !10 +// CHECK:STDOUT: call void @_CF.Main.40(ptr %c.var), !dbg !11 +// CHECK:STDOUT: call void @_CF.Main.41(ptr %d.var), !dbg !12 +// CHECK:STDOUT: %.loc24 = load i32, ptr %n.var, align 4, !dbg !13 +// CHECK:STDOUT: call void @_CF.Main.42(i32 %.loc24), !dbg !14 +// CHECK:STDOUT: call void @_CF.Main.43(%type zeroinitializer), !dbg !15 +// CHECK:STDOUT: ret void, !dbg !16 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) +// CHECK:STDOUT: declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0 +// CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) -// CHECK:STDOUT: declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 +// CHECK:STDOUT: declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1 // CHECK:STDOUT: // CHECK:STDOUT: declare void @_CF.Main.40(ptr) // CHECK:STDOUT: @@ -61,9 +67,11 @@ fn G() { // CHECK:STDOUT: declare void @_CF.Main.43(%type) // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives +// CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 2, 1, 0 } // CHECK:STDOUT: uselistorder ptr @llvm.memcpy.p0.p0.i64, { 1, 0 } // CHECK:STDOUT: -// CHECK:STDOUT: attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } +// CHECK:STDOUT: attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } +// CHECK:STDOUT: attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: // CHECK:STDOUT: !llvm.module.flags = !{!0, !1} // CHECK:STDOUT: !llvm.dbg.cu = !{!2} @@ -77,13 +85,11 @@ fn G() { // CHECK:STDOUT: !6 = !{} // CHECK:STDOUT: !7 = !DILocation(line: 18, column: 7, scope: !4) // CHECK:STDOUT: !8 = !DILocation(line: 18, column: 3, scope: !4) -// CHECK:STDOUT: !9 = !DILocation(line: 19, column: 7, scope: !4) -// CHECK:STDOUT: !10 = !DILocation(line: 19, column: 3, scope: !4) -// CHECK:STDOUT: !11 = !DILocation(line: 20, column: 7, scope: !4) -// CHECK:STDOUT: !12 = !DILocation(line: 20, column: 3, scope: !4) -// CHECK:STDOUT: !13 = !DILocation(line: 22, column: 3, scope: !4) -// CHECK:STDOUT: !14 = !DILocation(line: 23, column: 3, scope: !4) -// CHECK:STDOUT: !15 = !DILocation(line: 24, column: 5, scope: !4) -// CHECK:STDOUT: !16 = !DILocation(line: 24, column: 3, scope: !4) -// CHECK:STDOUT: !17 = !DILocation(line: 25, column: 3, scope: !4) -// CHECK:STDOUT: !18 = !DILocation(line: 17, column: 1, scope: !4) +// CHECK:STDOUT: !9 = !DILocation(line: 19, column: 3, scope: !4) +// CHECK:STDOUT: !10 = !DILocation(line: 20, column: 3, scope: !4) +// CHECK:STDOUT: !11 = !DILocation(line: 22, column: 3, scope: !4) +// CHECK:STDOUT: !12 = !DILocation(line: 23, column: 3, scope: !4) +// CHECK:STDOUT: !13 = !DILocation(line: 24, column: 5, scope: !4) +// CHECK:STDOUT: !14 = !DILocation(line: 24, column: 3, scope: !4) +// CHECK:STDOUT: !15 = !DILocation(line: 25, column: 3, scope: !4) +// CHECK:STDOUT: !16 = !DILocation(line: 17, column: 1, scope: !4) diff --git a/toolchain/lower/testdata/function/generic/call_method.carbon b/toolchain/lower/testdata/function/generic/call_method.carbon index 74fd79f9ef038..f8cd4c132ecd3 100644 --- a/toolchain/lower/testdata/function/generic/call_method.carbon +++ b/toolchain/lower/testdata/function/generic/call_method.carbon @@ -28,20 +28,29 @@ fn CallF() -> i32 { // CHECK:STDOUT: define i32 @_CCallF.Main() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %c.var = alloca {}, align 8, !dbg !7 +// CHECK:STDOUT: %n.var = alloca i32, align 4, !dbg !7 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(i64 0, ptr %c.var), !dbg !7 // CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %c.var, ptr align 1 @C.val.loc18_16, i64 0, i1 false), !dbg !8 -// CHECK:STDOUT: %n.var = alloca i32, align 4, !dbg !9 -// CHECK:STDOUT: store i32 0, ptr %n.var, align 4, !dbg !10 -// CHECK:STDOUT: %.loc20_14 = load i32, ptr %n.var, align 4, !dbg !11 -// CHECK:STDOUT: %F.call = call i32 @_CF.C.Main.40(ptr %c.var, i32 %.loc20_14), !dbg !12 -// CHECK:STDOUT: ret i32 %F.call, !dbg !13 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(i64 4, ptr %n.var), !dbg !7 +// CHECK:STDOUT: store i32 0, ptr %n.var, align 4, !dbg !9 +// CHECK:STDOUT: %.loc20_14 = load i32, ptr %n.var, align 4, !dbg !10 +// CHECK:STDOUT: %F.call = call i32 @_CF.C.Main.40(ptr %c.var, i32 %.loc20_14), !dbg !11 +// CHECK:STDOUT: ret i32 %F.call, !dbg !12 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) +// CHECK:STDOUT: declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0 +// CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) -// CHECK:STDOUT: declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 +// CHECK:STDOUT: declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1 // CHECK:STDOUT: // CHECK:STDOUT: declare i32 @_CF.C.Main.40(ptr, i32) // CHECK:STDOUT: -// CHECK:STDOUT: attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } +// CHECK:STDOUT: ; uselistorder directives +// CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 1, 0 } +// CHECK:STDOUT: +// CHECK:STDOUT: attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } +// CHECK:STDOUT: attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: // CHECK:STDOUT: !llvm.module.flags = !{!0, !1} // CHECK:STDOUT: !llvm.dbg.cu = !{!2} @@ -55,8 +64,7 @@ fn CallF() -> i32 { // CHECK:STDOUT: !6 = !{} // CHECK:STDOUT: !7 = !DILocation(line: 18, column: 7, scope: !4) // CHECK:STDOUT: !8 = !DILocation(line: 18, column: 3, scope: !4) -// CHECK:STDOUT: !9 = !DILocation(line: 19, column: 7, scope: !4) -// CHECK:STDOUT: !10 = !DILocation(line: 19, column: 3, scope: !4) -// CHECK:STDOUT: !11 = !DILocation(line: 20, column: 14, scope: !4) -// CHECK:STDOUT: !12 = !DILocation(line: 20, column: 10, scope: !4) -// CHECK:STDOUT: !13 = !DILocation(line: 20, column: 3, scope: !4) +// CHECK:STDOUT: !9 = !DILocation(line: 19, column: 3, scope: !4) +// CHECK:STDOUT: !10 = !DILocation(line: 20, column: 14, scope: !4) +// CHECK:STDOUT: !11 = !DILocation(line: 20, column: 10, scope: !4) +// CHECK:STDOUT: !12 = !DILocation(line: 20, column: 3, scope: !4) diff --git a/toolchain/lower/testdata/index/array_element_access.carbon b/toolchain/lower/testdata/index/array_element_access.carbon index e1c7ae7c38c45..7f05b2a1b7efa 100644 --- a/toolchain/lower/testdata/index/array_element_access.carbon +++ b/toolchain/lower/testdata/index/array_element_access.carbon @@ -43,6 +43,10 @@ fn Run() { // CHECK:STDOUT: define void @main() !dbg !12 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %a.var = alloca [2 x i32], align 4, !dbg !13 +// CHECK:STDOUT: %b.var = alloca i32, align 4, !dbg !13 +// CHECK:STDOUT: %c.var = alloca i32, align 4, !dbg !13 +// CHECK:STDOUT: %d.var = alloca i32, align 4, !dbg !13 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(i64 8, ptr %a.var), !dbg !13 // CHECK:STDOUT: %.loc15_23.1.temp = alloca { i32, i32 }, align 8, !dbg !14 // CHECK:STDOUT: call void @_CA.Main(ptr %.loc15_23.1.temp), !dbg !14 // CHECK:STDOUT: %tuple.elem0.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %.loc15_23.1.temp, i32 0, i32 0, !dbg !14 @@ -53,29 +57,35 @@ fn Run() { // CHECK:STDOUT: %.loc15_23.6 = load i32, ptr %tuple.elem1.tuple.elem, align 4, !dbg !14 // CHECK:STDOUT: %.loc15_23.7.array.index = getelementptr inbounds [2 x i32], ptr %a.var, i32 0, i64 1, !dbg !14 // CHECK:STDOUT: store i32 %.loc15_23.6, ptr %.loc15_23.7.array.index, align 4, !dbg !14 -// CHECK:STDOUT: %b.var = alloca i32, align 4, !dbg !15 -// CHECK:STDOUT: store i32 1, ptr %b.var, align 4, !dbg !16 -// CHECK:STDOUT: %c.var = alloca i32, align 4, !dbg !17 -// CHECK:STDOUT: %.loc17_18 = load i32, ptr %b.var, align 4, !dbg !18 -// CHECK:STDOUT: %.loc17_19.1.array.index = getelementptr inbounds [2 x i32], ptr %a.var, i32 0, i32 %.loc17_18, !dbg !19 -// CHECK:STDOUT: %.loc17_19.2 = load i32, ptr %.loc17_19.1.array.index, align 4, !dbg !19 -// CHECK:STDOUT: store i32 %.loc17_19.2, ptr %c.var, align 4, !dbg !20 -// CHECK:STDOUT: %d.var = alloca i32, align 4, !dbg !21 -// CHECK:STDOUT: %.loc18_18.1.temp = alloca [2 x i32], align 4, !dbg !22 -// CHECK:STDOUT: call void @_CB.Main(ptr %.loc18_18.1.temp), !dbg !22 -// CHECK:STDOUT: %.loc18_21.1.array.index = getelementptr inbounds [2 x i32], ptr %.loc18_18.1.temp, i32 0, i32 1, !dbg !22 -// CHECK:STDOUT: %.loc18_21.2 = load i32, ptr %.loc18_21.1.array.index, align 4, !dbg !22 -// CHECK:STDOUT: store i32 %.loc18_21.2, ptr %d.var, align 4, !dbg !23 -// CHECK:STDOUT: ret void, !dbg !24 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(i64 4, ptr %b.var), !dbg !13 +// CHECK:STDOUT: store i32 1, ptr %b.var, align 4, !dbg !15 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(i64 4, ptr %c.var), !dbg !13 +// CHECK:STDOUT: %.loc17_18 = load i32, ptr %b.var, align 4, !dbg !16 +// CHECK:STDOUT: %.loc17_19.1.array.index = getelementptr inbounds [2 x i32], ptr %a.var, i32 0, i32 %.loc17_18, !dbg !17 +// CHECK:STDOUT: %.loc17_19.2 = load i32, ptr %.loc17_19.1.array.index, align 4, !dbg !17 +// CHECK:STDOUT: store i32 %.loc17_19.2, ptr %c.var, align 4, !dbg !18 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(i64 4, ptr %d.var), !dbg !13 +// CHECK:STDOUT: %.loc18_18.1.temp = alloca [2 x i32], align 4, !dbg !19 +// CHECK:STDOUT: call void @_CB.Main(ptr %.loc18_18.1.temp), !dbg !19 +// CHECK:STDOUT: %.loc18_21.1.array.index = getelementptr inbounds [2 x i32], ptr %.loc18_18.1.temp, i32 0, i32 1, !dbg !19 +// CHECK:STDOUT: %.loc18_21.2 = load i32, ptr %.loc18_21.1.array.index, align 4, !dbg !19 +// CHECK:STDOUT: store i32 %.loc18_21.2, ptr %d.var, align 4, !dbg !20 +// CHECK:STDOUT: ret void, !dbg !21 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) // CHECK:STDOUT: declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) +// CHECK:STDOUT: declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 +// CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives +// CHECK:STDOUT: uselistorder i32 1, { 0, 1, 4, 6, 7, 2, 3, 5, 8, 9, 10 } // CHECK:STDOUT: uselistorder ptr @llvm.memcpy.p0.p0.i64, { 1, 0 } +// CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 3, 2, 1, 0 } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } +// CHECK:STDOUT: attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: // CHECK:STDOUT: !llvm.module.flags = !{!0, !1} // CHECK:STDOUT: !llvm.dbg.cu = !{!2} @@ -95,13 +105,10 @@ fn Run() { // CHECK:STDOUT: !12 = distinct !DISubprogram(name: "Run", linkageName: "main", scope: null, file: !3, line: 14, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !13 = !DILocation(line: 15, column: 7, scope: !12) // CHECK:STDOUT: !14 = !DILocation(line: 15, column: 21, scope: !12) -// CHECK:STDOUT: !15 = !DILocation(line: 16, column: 7, scope: !12) -// CHECK:STDOUT: !16 = !DILocation(line: 16, column: 3, scope: !12) -// CHECK:STDOUT: !17 = !DILocation(line: 17, column: 7, scope: !12) -// CHECK:STDOUT: !18 = !DILocation(line: 17, column: 18, scope: !12) -// CHECK:STDOUT: !19 = !DILocation(line: 17, column: 16, scope: !12) -// CHECK:STDOUT: !20 = !DILocation(line: 17, column: 3, scope: !12) -// CHECK:STDOUT: !21 = !DILocation(line: 18, column: 7, scope: !12) -// CHECK:STDOUT: !22 = !DILocation(line: 18, column: 16, scope: !12) -// CHECK:STDOUT: !23 = !DILocation(line: 18, column: 3, scope: !12) -// CHECK:STDOUT: !24 = !DILocation(line: 14, column: 1, scope: !12) +// CHECK:STDOUT: !15 = !DILocation(line: 16, column: 3, scope: !12) +// CHECK:STDOUT: !16 = !DILocation(line: 17, column: 18, scope: !12) +// CHECK:STDOUT: !17 = !DILocation(line: 17, column: 16, scope: !12) +// CHECK:STDOUT: !18 = !DILocation(line: 17, column: 3, scope: !12) +// CHECK:STDOUT: !19 = !DILocation(line: 18, column: 16, scope: !12) +// CHECK:STDOUT: !20 = !DILocation(line: 18, column: 3, scope: !12) +// CHECK:STDOUT: !21 = !DILocation(line: 14, column: 1, scope: !12) diff --git a/toolchain/lower/testdata/let/tuple.carbon b/toolchain/lower/testdata/let/tuple.carbon index d3bc14c2814f2..2828aa23e0940 100644 --- a/toolchain/lower/testdata/let/tuple.carbon +++ b/toolchain/lower/testdata/let/tuple.carbon @@ -24,55 +24,63 @@ fn F() -> i32 { // CHECK:STDOUT: define i32 @_CF.Main() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %a.var = alloca { i32, i32, i32 }, align 8, !dbg !7 +// CHECK:STDOUT: %b.var = alloca { i32, i32 }, align 8, !dbg !7 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(i64 12, ptr %a.var), !dbg !7 // CHECK:STDOUT: %tuple.elem0.loc12.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %a.var, i32 0, i32 0, !dbg !8 // CHECK:STDOUT: %tuple.elem1.loc12.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %a.var, i32 0, i32 1, !dbg !8 // CHECK:STDOUT: %tuple.elem2.loc12.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %a.var, i32 0, i32 2, !dbg !8 // CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %a.var, ptr align 4 @tuple.1.loc12_37, i64 12, i1 false), !dbg !9 -// CHECK:STDOUT: %b.var = alloca { i32, i32 }, align 8, !dbg !10 -// CHECK:STDOUT: %tuple.elem0.loc13.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %b.var, i32 0, i32 0, !dbg !11 -// CHECK:STDOUT: %tuple.elem1.loc13.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %b.var, i32 0, i32 1, !dbg !11 -// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %b.var, ptr align 4 @tuple.2.loc13_29, i64 8, i1 false), !dbg !12 -// CHECK:STDOUT: %tuple.elem0.loc14_43.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %a.var, i32 0, i32 0, !dbg !13 -// CHECK:STDOUT: %.loc14_43.1 = load i32, ptr %tuple.elem0.loc14_43.tuple.elem, align 4, !dbg !13 -// CHECK:STDOUT: %tuple.elem1.loc14_43.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %a.var, i32 0, i32 1, !dbg !13 -// CHECK:STDOUT: %.loc14_43.2 = load i32, ptr %tuple.elem1.loc14_43.tuple.elem, align 4, !dbg !13 -// CHECK:STDOUT: %tuple.elem2.loc14.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %a.var, i32 0, i32 2, !dbg !13 -// CHECK:STDOUT: %.loc14_43.3 = load i32, ptr %tuple.elem2.loc14.tuple.elem, align 4, !dbg !13 -// CHECK:STDOUT: %tuple.loc14_43 = alloca { i32, i32, i32 }, align 8, !dbg !13 -// CHECK:STDOUT: %tuple.loc14_431 = getelementptr inbounds nuw { i32, i32, i32 }, ptr %tuple.loc14_43, i32 0, i32 0, !dbg !13 -// CHECK:STDOUT: store i32 %.loc14_43.1, ptr %tuple.loc14_431, align 4, !dbg !13 -// CHECK:STDOUT: %tuple.loc14_432 = getelementptr inbounds nuw { i32, i32, i32 }, ptr %tuple.loc14_43, i32 0, i32 1, !dbg !13 -// CHECK:STDOUT: store i32 %.loc14_43.2, ptr %tuple.loc14_432, align 4, !dbg !13 -// CHECK:STDOUT: %tuple.loc14_433 = getelementptr inbounds nuw { i32, i32, i32 }, ptr %tuple.loc14_43, i32 0, i32 2, !dbg !13 -// CHECK:STDOUT: store i32 %.loc14_43.3, ptr %tuple.loc14_433, align 4, !dbg !13 -// CHECK:STDOUT: %tuple.elem0.loc14_46.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %b.var, i32 0, i32 0, !dbg !14 -// CHECK:STDOUT: %.loc14_46.1 = load i32, ptr %tuple.elem0.loc14_46.tuple.elem, align 4, !dbg !14 -// CHECK:STDOUT: %tuple.elem1.loc14_46.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %b.var, i32 0, i32 1, !dbg !14 -// CHECK:STDOUT: %.loc14_46.2 = load i32, ptr %tuple.elem1.loc14_46.tuple.elem, align 4, !dbg !14 -// CHECK:STDOUT: %tuple.loc14_46 = alloca { i32, i32 }, align 8, !dbg !14 -// CHECK:STDOUT: %tuple.loc14_464 = getelementptr inbounds nuw { i32, i32 }, ptr %tuple.loc14_46, i32 0, i32 0, !dbg !14 -// CHECK:STDOUT: store i32 %.loc14_46.1, ptr %tuple.loc14_464, align 4, !dbg !14 -// CHECK:STDOUT: %tuple.loc14_465 = getelementptr inbounds nuw { i32, i32 }, ptr %tuple.loc14_46, i32 0, i32 1, !dbg !14 -// CHECK:STDOUT: store i32 %.loc14_46.2, ptr %tuple.loc14_465, align 4, !dbg !14 -// CHECK:STDOUT: %tuple.loc14_47 = alloca { ptr, ptr }, align 8, !dbg !15 -// CHECK:STDOUT: %tuple.loc14_476 = getelementptr inbounds nuw { ptr, ptr }, ptr %tuple.loc14_47, i32 0, i32 0, !dbg !15 -// CHECK:STDOUT: store ptr %tuple.loc14_43, ptr %tuple.loc14_476, align 8, !dbg !15 -// CHECK:STDOUT: %tuple.loc14_477 = getelementptr inbounds nuw { ptr, ptr }, ptr %tuple.loc14_47, i32 0, i32 1, !dbg !15 -// CHECK:STDOUT: store ptr %tuple.loc14_46, ptr %tuple.loc14_477, align 8, !dbg !15 -// CHECK:STDOUT: %tuple.elem1.loc15_11.tuple.elem = getelementptr inbounds nuw { ptr, ptr }, ptr %tuple.loc14_47, i32 0, i32 1, !dbg !16 -// CHECK:STDOUT: %tuple.elem1.loc15_11.tuple.elem.load = load ptr, ptr %tuple.elem1.loc15_11.tuple.elem, align 8, !dbg !16 -// CHECK:STDOUT: %tuple.elem1.loc15_13.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %tuple.elem1.loc15_11.tuple.elem.load, i32 0, i32 1, !dbg !16 -// CHECK:STDOUT: %tuple.elem1.loc15_13.tuple.elem.load = load i32, ptr %tuple.elem1.loc15_13.tuple.elem, align 4, !dbg !16 -// CHECK:STDOUT: ret i32 %tuple.elem1.loc15_13.tuple.elem.load, !dbg !17 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(i64 8, ptr %b.var), !dbg !7 +// CHECK:STDOUT: %tuple.elem0.loc13.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %b.var, i32 0, i32 0, !dbg !10 +// CHECK:STDOUT: %tuple.elem1.loc13.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %b.var, i32 0, i32 1, !dbg !10 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %b.var, ptr align 4 @tuple.2.loc13_29, i64 8, i1 false), !dbg !11 +// CHECK:STDOUT: %tuple.elem0.loc14_43.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %a.var, i32 0, i32 0, !dbg !12 +// CHECK:STDOUT: %.loc14_43.1 = load i32, ptr %tuple.elem0.loc14_43.tuple.elem, align 4, !dbg !12 +// CHECK:STDOUT: %tuple.elem1.loc14_43.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %a.var, i32 0, i32 1, !dbg !12 +// CHECK:STDOUT: %.loc14_43.2 = load i32, ptr %tuple.elem1.loc14_43.tuple.elem, align 4, !dbg !12 +// CHECK:STDOUT: %tuple.elem2.loc14.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %a.var, i32 0, i32 2, !dbg !12 +// CHECK:STDOUT: %.loc14_43.3 = load i32, ptr %tuple.elem2.loc14.tuple.elem, align 4, !dbg !12 +// CHECK:STDOUT: %tuple.loc14_43 = alloca { i32, i32, i32 }, align 8, !dbg !12 +// CHECK:STDOUT: %tuple.loc14_431 = getelementptr inbounds nuw { i32, i32, i32 }, ptr %tuple.loc14_43, i32 0, i32 0, !dbg !12 +// CHECK:STDOUT: store i32 %.loc14_43.1, ptr %tuple.loc14_431, align 4, !dbg !12 +// CHECK:STDOUT: %tuple.loc14_432 = getelementptr inbounds nuw { i32, i32, i32 }, ptr %tuple.loc14_43, i32 0, i32 1, !dbg !12 +// CHECK:STDOUT: store i32 %.loc14_43.2, ptr %tuple.loc14_432, align 4, !dbg !12 +// CHECK:STDOUT: %tuple.loc14_433 = getelementptr inbounds nuw { i32, i32, i32 }, ptr %tuple.loc14_43, i32 0, i32 2, !dbg !12 +// CHECK:STDOUT: store i32 %.loc14_43.3, ptr %tuple.loc14_433, align 4, !dbg !12 +// CHECK:STDOUT: %tuple.elem0.loc14_46.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %b.var, i32 0, i32 0, !dbg !13 +// CHECK:STDOUT: %.loc14_46.1 = load i32, ptr %tuple.elem0.loc14_46.tuple.elem, align 4, !dbg !13 +// CHECK:STDOUT: %tuple.elem1.loc14_46.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %b.var, i32 0, i32 1, !dbg !13 +// CHECK:STDOUT: %.loc14_46.2 = load i32, ptr %tuple.elem1.loc14_46.tuple.elem, align 4, !dbg !13 +// CHECK:STDOUT: %tuple.loc14_46 = alloca { i32, i32 }, align 8, !dbg !13 +// CHECK:STDOUT: %tuple.loc14_464 = getelementptr inbounds nuw { i32, i32 }, ptr %tuple.loc14_46, i32 0, i32 0, !dbg !13 +// CHECK:STDOUT: store i32 %.loc14_46.1, ptr %tuple.loc14_464, align 4, !dbg !13 +// CHECK:STDOUT: %tuple.loc14_465 = getelementptr inbounds nuw { i32, i32 }, ptr %tuple.loc14_46, i32 0, i32 1, !dbg !13 +// CHECK:STDOUT: store i32 %.loc14_46.2, ptr %tuple.loc14_465, align 4, !dbg !13 +// CHECK:STDOUT: %tuple.loc14_47 = alloca { ptr, ptr }, align 8, !dbg !14 +// CHECK:STDOUT: %tuple.loc14_476 = getelementptr inbounds nuw { ptr, ptr }, ptr %tuple.loc14_47, i32 0, i32 0, !dbg !14 +// CHECK:STDOUT: store ptr %tuple.loc14_43, ptr %tuple.loc14_476, align 8, !dbg !14 +// CHECK:STDOUT: %tuple.loc14_477 = getelementptr inbounds nuw { ptr, ptr }, ptr %tuple.loc14_47, i32 0, i32 1, !dbg !14 +// CHECK:STDOUT: store ptr %tuple.loc14_46, ptr %tuple.loc14_477, align 8, !dbg !14 +// CHECK:STDOUT: %tuple.elem1.loc15_11.tuple.elem = getelementptr inbounds nuw { ptr, ptr }, ptr %tuple.loc14_47, i32 0, i32 1, !dbg !15 +// CHECK:STDOUT: %tuple.elem1.loc15_11.tuple.elem.load = load ptr, ptr %tuple.elem1.loc15_11.tuple.elem, align 8, !dbg !15 +// CHECK:STDOUT: %tuple.elem1.loc15_13.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %tuple.elem1.loc15_11.tuple.elem.load, i32 0, i32 1, !dbg !15 +// CHECK:STDOUT: %tuple.elem1.loc15_13.tuple.elem.load = load i32, ptr %tuple.elem1.loc15_13.tuple.elem, align 4, !dbg !15 +// CHECK:STDOUT: ret i32 %tuple.elem1.loc15_13.tuple.elem.load, !dbg !16 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) +// CHECK:STDOUT: declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0 +// CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) -// CHECK:STDOUT: declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 +// CHECK:STDOUT: declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1 // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives +// CHECK:STDOUT: uselistorder i32 1, { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 11, 13, 14 } +// CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 1, 0 } // CHECK:STDOUT: uselistorder ptr @llvm.memcpy.p0.p0.i64, { 1, 0 } // CHECK:STDOUT: -// CHECK:STDOUT: attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } +// CHECK:STDOUT: attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } +// CHECK:STDOUT: attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: // CHECK:STDOUT: !llvm.module.flags = !{!0, !1} // CHECK:STDOUT: !llvm.dbg.cu = !{!2} @@ -87,11 +95,10 @@ fn F() -> i32 { // CHECK:STDOUT: !7 = !DILocation(line: 12, column: 7, scope: !4) // CHECK:STDOUT: !8 = !DILocation(line: 12, column: 28, scope: !4) // CHECK:STDOUT: !9 = !DILocation(line: 12, column: 3, scope: !4) -// CHECK:STDOUT: !10 = !DILocation(line: 13, column: 7, scope: !4) -// CHECK:STDOUT: !11 = !DILocation(line: 13, column: 23, scope: !4) -// CHECK:STDOUT: !12 = !DILocation(line: 13, column: 3, scope: !4) -// CHECK:STDOUT: !13 = !DILocation(line: 14, column: 43, scope: !4) -// CHECK:STDOUT: !14 = !DILocation(line: 14, column: 46, scope: !4) -// CHECK:STDOUT: !15 = !DILocation(line: 14, column: 42, scope: !4) -// CHECK:STDOUT: !16 = !DILocation(line: 15, column: 10, scope: !4) -// CHECK:STDOUT: !17 = !DILocation(line: 15, column: 3, scope: !4) +// CHECK:STDOUT: !10 = !DILocation(line: 13, column: 23, scope: !4) +// CHECK:STDOUT: !11 = !DILocation(line: 13, column: 3, scope: !4) +// CHECK:STDOUT: !12 = !DILocation(line: 14, column: 43, scope: !4) +// CHECK:STDOUT: !13 = !DILocation(line: 14, column: 46, scope: !4) +// CHECK:STDOUT: !14 = !DILocation(line: 14, column: 42, scope: !4) +// CHECK:STDOUT: !15 = !DILocation(line: 15, column: 10, scope: !4) +// CHECK:STDOUT: !16 = !DILocation(line: 15, column: 3, scope: !4) diff --git a/toolchain/lower/testdata/operators/assignment.carbon b/toolchain/lower/testdata/operators/assignment.carbon index 9bf90cd976df2..c2939c1443187 100644 --- a/toolchain/lower/testdata/operators/assignment.carbon +++ b/toolchain/lower/testdata/operators/assignment.carbon @@ -23,19 +23,28 @@ fn Main() { // CHECK:STDOUT: define void @_CMain.Main() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %a.var = alloca i32, align 4, !dbg !7 +// CHECK:STDOUT: %b.var = alloca { i32, i32 }, align 8, !dbg !7 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(i64 4, ptr %a.var), !dbg !7 // CHECK:STDOUT: store i32 12, ptr %a.var, align 4, !dbg !8 // CHECK:STDOUT: store i32 9, ptr %a.var, align 4, !dbg !9 -// CHECK:STDOUT: %b.var = alloca { i32, i32 }, align 8, !dbg !10 -// CHECK:STDOUT: %tuple.elem0.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %b.var, i32 0, i32 0, !dbg !11 -// CHECK:STDOUT: %tuple.elem1.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %b.var, i32 0, i32 1, !dbg !11 -// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %b.var, ptr align 4 @tuple.loc15_5, i64 8, i1 false), !dbg !12 -// CHECK:STDOUT: ret void, !dbg !13 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(i64 8, ptr %b.var), !dbg !7 +// CHECK:STDOUT: %tuple.elem0.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %b.var, i32 0, i32 0, !dbg !10 +// CHECK:STDOUT: %tuple.elem1.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %b.var, i32 0, i32 1, !dbg !10 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %b.var, ptr align 4 @tuple.loc15_5, i64 8, i1 false), !dbg !11 +// CHECK:STDOUT: ret void, !dbg !12 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) +// CHECK:STDOUT: declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0 +// CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) -// CHECK:STDOUT: declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 +// CHECK:STDOUT: declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1 +// CHECK:STDOUT: +// CHECK:STDOUT: ; uselistorder directives +// CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 1, 0 } // CHECK:STDOUT: -// CHECK:STDOUT: attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } +// CHECK:STDOUT: attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } +// CHECK:STDOUT: attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: // CHECK:STDOUT: !llvm.module.flags = !{!0, !1} // CHECK:STDOUT: !llvm.dbg.cu = !{!2} @@ -50,7 +59,6 @@ fn Main() { // CHECK:STDOUT: !7 = !DILocation(line: 12, column: 7, scope: !4) // CHECK:STDOUT: !8 = !DILocation(line: 12, column: 3, scope: !4) // CHECK:STDOUT: !9 = !DILocation(line: 13, column: 3, scope: !4) -// CHECK:STDOUT: !10 = !DILocation(line: 14, column: 7, scope: !4) -// CHECK:STDOUT: !11 = !DILocation(line: 15, column: 7, scope: !4) -// CHECK:STDOUT: !12 = !DILocation(line: 15, column: 3, scope: !4) -// CHECK:STDOUT: !13 = !DILocation(line: 11, column: 1, scope: !4) +// CHECK:STDOUT: !10 = !DILocation(line: 15, column: 7, scope: !4) +// CHECK:STDOUT: !11 = !DILocation(line: 15, column: 3, scope: !4) +// CHECK:STDOUT: !12 = !DILocation(line: 11, column: 1, scope: !4) diff --git a/toolchain/lower/testdata/pointer/address_of_field.carbon b/toolchain/lower/testdata/pointer/address_of_field.carbon index 9603bb98412e9..9867c7bb6319b 100644 --- a/toolchain/lower/testdata/pointer/address_of_field.carbon +++ b/toolchain/lower/testdata/pointer/address_of_field.carbon @@ -25,6 +25,7 @@ fn F() { // CHECK:STDOUT: define void @_CF.Main() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %s.var = alloca { i32, i32 }, align 8, !dbg !7 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(i64 8, ptr %s.var), !dbg !7 // CHECK:STDOUT: %.loc14_46.3.a = getelementptr inbounds nuw { i32, i32 }, ptr %s.var, i32 0, i32 0, !dbg !8 // CHECK:STDOUT: %.loc14_46.6.b = getelementptr inbounds nuw { i32, i32 }, ptr %s.var, i32 0, i32 1, !dbg !8 // CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %s.var, ptr align 4 @struct.loc14_47, i64 8, i1 false), !dbg !9 @@ -33,10 +34,14 @@ fn F() { // CHECK:STDOUT: ret void, !dbg !12 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) +// CHECK:STDOUT: declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0 +// CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) -// CHECK:STDOUT: declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 +// CHECK:STDOUT: declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1 // CHECK:STDOUT: -// CHECK:STDOUT: attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } +// CHECK:STDOUT: attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } +// CHECK:STDOUT: attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: // CHECK:STDOUT: !llvm.module.flags = !{!0, !1} // CHECK:STDOUT: !llvm.dbg.cu = !{!2} diff --git a/toolchain/lower/testdata/pointer/address_of_unused.carbon b/toolchain/lower/testdata/pointer/address_of_unused.carbon index 0b0f94d4fee0b..11ac24b16adc1 100644 --- a/toolchain/lower/testdata/pointer/address_of_unused.carbon +++ b/toolchain/lower/testdata/pointer/address_of_unused.carbon @@ -19,10 +19,16 @@ fn F() { // CHECK:STDOUT: define void @_CF.Main() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %n.var = alloca i32, align 4, !dbg !7 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(i64 4, ptr %n.var), !dbg !7 // CHECK:STDOUT: store i32 0, ptr %n.var, align 4, !dbg !8 // CHECK:STDOUT: ret void, !dbg !9 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) +// CHECK:STDOUT: declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0 +// CHECK:STDOUT: +// CHECK:STDOUT: attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } +// CHECK:STDOUT: // CHECK:STDOUT: !llvm.module.flags = !{!0, !1} // CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/pointer/basic.carbon b/toolchain/lower/testdata/pointer/basic.carbon index 3b3aade1fd607..e4b4048ace4af 100644 --- a/toolchain/lower/testdata/pointer/basic.carbon +++ b/toolchain/lower/testdata/pointer/basic.carbon @@ -29,11 +29,17 @@ fn F() -> i32 { // CHECK:STDOUT: define i32 @_CF.Main() !dbg !9 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %n.var = alloca i32, align 4, !dbg !10 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(i64 4, ptr %n.var), !dbg !10 // CHECK:STDOUT: store i32 0, ptr %n.var, align 4, !dbg !11 // CHECK:STDOUT: %G.call = call i32 @_CG.Main(ptr %n.var), !dbg !12 // CHECK:STDOUT: ret i32 %G.call, !dbg !13 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) +// CHECK:STDOUT: declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0 +// CHECK:STDOUT: +// CHECK:STDOUT: attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } +// CHECK:STDOUT: // CHECK:STDOUT: !llvm.module.flags = !{!0, !1} // CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/pointer/pointer_to_pointer.carbon b/toolchain/lower/testdata/pointer/pointer_to_pointer.carbon index e68f2c18f7c7e..436b6775b4ce7 100644 --- a/toolchain/lower/testdata/pointer/pointer_to_pointer.carbon +++ b/toolchain/lower/testdata/pointer/pointer_to_pointer.carbon @@ -21,18 +21,29 @@ fn F(p: i32**) -> i32 { // CHECK:STDOUT: define i32 @_CF.Main(ptr %p) !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %a.var = alloca ptr, align 8, !dbg !7 +// CHECK:STDOUT: %b.var = alloca ptr, align 8, !dbg !7 +// CHECK:STDOUT: %c.var = alloca ptr, align 8, !dbg !7 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(i64 8, ptr %a.var), !dbg !7 // CHECK:STDOUT: store ptr %p, ptr %a.var, align 8, !dbg !8 -// CHECK:STDOUT: %b.var = alloca ptr, align 8, !dbg !9 -// CHECK:STDOUT: %.loc13_17.2 = load ptr, ptr %p, align 8, !dbg !10 -// CHECK:STDOUT: store ptr %.loc13_17.2, ptr %b.var, align 8, !dbg !11 -// CHECK:STDOUT: %c.var = alloca ptr, align 8, !dbg !12 -// CHECK:STDOUT: store ptr %b.var, ptr %c.var, align 8, !dbg !13 -// CHECK:STDOUT: %.loc15_12 = load ptr, ptr %c.var, align 8, !dbg !14 -// CHECK:STDOUT: %.loc15_11.2 = load ptr, ptr %.loc15_12, align 8, !dbg !15 -// CHECK:STDOUT: %.loc15_10.2 = load i32, ptr %.loc15_11.2, align 4, !dbg !16 -// CHECK:STDOUT: ret i32 %.loc15_10.2, !dbg !17 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(i64 8, ptr %b.var), !dbg !7 +// CHECK:STDOUT: %.loc13_17.2 = load ptr, ptr %p, align 8, !dbg !9 +// CHECK:STDOUT: store ptr %.loc13_17.2, ptr %b.var, align 8, !dbg !10 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(i64 8, ptr %c.var), !dbg !7 +// CHECK:STDOUT: store ptr %b.var, ptr %c.var, align 8, !dbg !11 +// CHECK:STDOUT: %.loc15_12 = load ptr, ptr %c.var, align 8, !dbg !12 +// CHECK:STDOUT: %.loc15_11.2 = load ptr, ptr %.loc15_12, align 8, !dbg !13 +// CHECK:STDOUT: %.loc15_10.2 = load i32, ptr %.loc15_11.2, align 4, !dbg !14 +// CHECK:STDOUT: ret i32 %.loc15_10.2, !dbg !15 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) +// CHECK:STDOUT: declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0 +// CHECK:STDOUT: +// CHECK:STDOUT: ; uselistorder directives +// CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 2, 1, 0 } +// CHECK:STDOUT: +// CHECK:STDOUT: attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } +// CHECK:STDOUT: // CHECK:STDOUT: !llvm.module.flags = !{!0, !1} // CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: @@ -45,12 +56,10 @@ fn F(p: i32**) -> i32 { // CHECK:STDOUT: !6 = !{} // CHECK:STDOUT: !7 = !DILocation(line: 12, column: 7, scope: !4) // CHECK:STDOUT: !8 = !DILocation(line: 12, column: 3, scope: !4) -// CHECK:STDOUT: !9 = !DILocation(line: 13, column: 7, scope: !4) -// CHECK:STDOUT: !10 = !DILocation(line: 13, column: 17, scope: !4) -// CHECK:STDOUT: !11 = !DILocation(line: 13, column: 3, scope: !4) -// CHECK:STDOUT: !12 = !DILocation(line: 14, column: 7, scope: !4) -// CHECK:STDOUT: !13 = !DILocation(line: 14, column: 3, scope: !4) -// CHECK:STDOUT: !14 = !DILocation(line: 15, column: 12, scope: !4) -// CHECK:STDOUT: !15 = !DILocation(line: 15, column: 11, scope: !4) -// CHECK:STDOUT: !16 = !DILocation(line: 15, column: 10, scope: !4) -// CHECK:STDOUT: !17 = !DILocation(line: 15, column: 3, scope: !4) +// CHECK:STDOUT: !9 = !DILocation(line: 13, column: 17, scope: !4) +// CHECK:STDOUT: !10 = !DILocation(line: 13, column: 3, scope: !4) +// CHECK:STDOUT: !11 = !DILocation(line: 14, column: 3, scope: !4) +// CHECK:STDOUT: !12 = !DILocation(line: 15, column: 12, scope: !4) +// CHECK:STDOUT: !13 = !DILocation(line: 15, column: 11, scope: !4) +// CHECK:STDOUT: !14 = !DILocation(line: 15, column: 10, scope: !4) +// CHECK:STDOUT: !15 = !DILocation(line: 15, column: 3, scope: !4) diff --git a/toolchain/lower/testdata/return/return_var_byval.carbon b/toolchain/lower/testdata/return/return_var_byval.carbon index 55c420829238c..f869897c2e9b8 100644 --- a/toolchain/lower/testdata/return/return_var_byval.carbon +++ b/toolchain/lower/testdata/return/return_var_byval.carbon @@ -19,11 +19,17 @@ fn Main() -> i32 { // CHECK:STDOUT: define i32 @_CMain.Main() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %x.var = alloca i32, align 4, !dbg !7 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(i64 4, ptr %x.var), !dbg !7 // CHECK:STDOUT: store i32 0, ptr %x.var, align 4, !dbg !8 // CHECK:STDOUT: %.loc12_16 = load i32, ptr %x.var, align 4, !dbg !7 // CHECK:STDOUT: ret i32 %.loc12_16, !dbg !9 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) +// CHECK:STDOUT: declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0 +// CHECK:STDOUT: +// CHECK:STDOUT: attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } +// CHECK:STDOUT: // CHECK:STDOUT: !llvm.module.flags = !{!0, !1} // CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/return/var.carbon b/toolchain/lower/testdata/return/var.carbon index 271544d634efc..5b420fa421c64 100644 --- a/toolchain/lower/testdata/return/var.carbon +++ b/toolchain/lower/testdata/return/var.carbon @@ -19,11 +19,17 @@ fn Main() -> i32 { // CHECK:STDOUT: define i32 @_CMain.Main() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %x.var = alloca i32, align 4, !dbg !7 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(i64 4, ptr %x.var), !dbg !7 // CHECK:STDOUT: store i32 0, ptr %x.var, align 4, !dbg !8 // CHECK:STDOUT: %.loc13 = load i32, ptr %x.var, align 4, !dbg !9 // CHECK:STDOUT: ret i32 %.loc13, !dbg !10 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) +// CHECK:STDOUT: declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0 +// CHECK:STDOUT: +// CHECK:STDOUT: attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } +// CHECK:STDOUT: // CHECK:STDOUT: !llvm.module.flags = !{!0, !1} // CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/struct/empty.carbon b/toolchain/lower/testdata/struct/empty.carbon index 3cc6457fc6c03..0f158717de216 100644 --- a/toolchain/lower/testdata/struct/empty.carbon +++ b/toolchain/lower/testdata/struct/empty.carbon @@ -20,10 +20,20 @@ fn Run() -> i32 { // CHECK:STDOUT: define i32 @main() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %x.var = alloca {}, align 8, !dbg !7 -// CHECK:STDOUT: %y.var = alloca {}, align 8, !dbg !8 -// CHECK:STDOUT: ret i32 0, !dbg !9 +// CHECK:STDOUT: %y.var = alloca {}, align 8, !dbg !7 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(i64 0, ptr %x.var), !dbg !7 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(i64 0, ptr %y.var), !dbg !7 +// CHECK:STDOUT: ret i32 0, !dbg !8 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) +// CHECK:STDOUT: declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0 +// CHECK:STDOUT: +// CHECK:STDOUT: ; uselistorder directives +// CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 1, 0 } +// CHECK:STDOUT: +// CHECK:STDOUT: attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } +// CHECK:STDOUT: // CHECK:STDOUT: !llvm.module.flags = !{!0, !1} // CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: @@ -35,5 +45,4 @@ fn Run() -> i32 { // CHECK:STDOUT: !5 = !DISubroutineType(types: !6) // CHECK:STDOUT: !6 = !{} // CHECK:STDOUT: !7 = !DILocation(line: 12, column: 7, scope: !4) -// CHECK:STDOUT: !8 = !DILocation(line: 13, column: 7, scope: !4) -// CHECK:STDOUT: !9 = !DILocation(line: 14, column: 3, scope: !4) +// CHECK:STDOUT: !8 = !DILocation(line: 14, column: 3, scope: !4) diff --git a/toolchain/lower/testdata/struct/member_access.carbon b/toolchain/lower/testdata/struct/member_access.carbon index 4a476f38ee8b7..d5e6b9bdc7dd6 100644 --- a/toolchain/lower/testdata/struct/member_access.carbon +++ b/toolchain/lower/testdata/struct/member_access.carbon @@ -23,23 +23,34 @@ fn Run() -> i32 { // CHECK:STDOUT: define i32 @main() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %x.var = alloca { double, i32 }, align 8, !dbg !7 +// CHECK:STDOUT: %y.var = alloca i32, align 4, !dbg !7 +// CHECK:STDOUT: %z.var = alloca i32, align 4, !dbg !7 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(i64 16, ptr %x.var), !dbg !7 // CHECK:STDOUT: %.loc12_48.2.a = getelementptr inbounds nuw { double, i32 }, ptr %x.var, i32 0, i32 0, !dbg !8 // CHECK:STDOUT: %.loc12_48.5.b = getelementptr inbounds nuw { double, i32 }, ptr %x.var, i32 0, i32 1, !dbg !8 // CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 8 %x.var, ptr align 8 @struct.loc12_49, i64 16, i1 false), !dbg !9 -// CHECK:STDOUT: %y.var = alloca i32, align 4, !dbg !10 -// CHECK:STDOUT: %.loc13_17.1.b = getelementptr inbounds nuw { double, i32 }, ptr %x.var, i32 0, i32 1, !dbg !11 -// CHECK:STDOUT: %.loc13_17.2 = load i32, ptr %.loc13_17.1.b, align 4, !dbg !11 -// CHECK:STDOUT: store i32 %.loc13_17.2, ptr %y.var, align 4, !dbg !12 -// CHECK:STDOUT: %z.var = alloca i32, align 4, !dbg !13 -// CHECK:STDOUT: %.loc14 = load i32, ptr %y.var, align 4, !dbg !14 -// CHECK:STDOUT: store i32 %.loc14, ptr %z.var, align 4, !dbg !15 -// CHECK:STDOUT: ret i32 0, !dbg !16 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(i64 4, ptr %y.var), !dbg !7 +// CHECK:STDOUT: %.loc13_17.1.b = getelementptr inbounds nuw { double, i32 }, ptr %x.var, i32 0, i32 1, !dbg !10 +// CHECK:STDOUT: %.loc13_17.2 = load i32, ptr %.loc13_17.1.b, align 4, !dbg !10 +// CHECK:STDOUT: store i32 %.loc13_17.2, ptr %y.var, align 4, !dbg !11 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(i64 4, ptr %z.var), !dbg !7 +// CHECK:STDOUT: %.loc14 = load i32, ptr %y.var, align 4, !dbg !12 +// CHECK:STDOUT: store i32 %.loc14, ptr %z.var, align 4, !dbg !13 +// CHECK:STDOUT: ret i32 0, !dbg !14 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) +// CHECK:STDOUT: declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0 +// CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) -// CHECK:STDOUT: declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 +// CHECK:STDOUT: declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1 +// CHECK:STDOUT: +// CHECK:STDOUT: ; uselistorder directives +// CHECK:STDOUT: uselistorder i32 1, { 1, 3, 0, 2, 4, 5 } +// CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 2, 1, 0 } // CHECK:STDOUT: -// CHECK:STDOUT: attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } +// CHECK:STDOUT: attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } +// CHECK:STDOUT: attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: // CHECK:STDOUT: !llvm.module.flags = !{!0, !1} // CHECK:STDOUT: !llvm.dbg.cu = !{!2} @@ -54,10 +65,8 @@ fn Run() -> i32 { // CHECK:STDOUT: !7 = !DILocation(line: 12, column: 7, scope: !4) // CHECK:STDOUT: !8 = !DILocation(line: 12, column: 31, scope: !4) // CHECK:STDOUT: !9 = !DILocation(line: 12, column: 3, scope: !4) -// CHECK:STDOUT: !10 = !DILocation(line: 13, column: 7, scope: !4) -// CHECK:STDOUT: !11 = !DILocation(line: 13, column: 16, scope: !4) -// CHECK:STDOUT: !12 = !DILocation(line: 13, column: 3, scope: !4) -// CHECK:STDOUT: !13 = !DILocation(line: 14, column: 7, scope: !4) -// CHECK:STDOUT: !14 = !DILocation(line: 14, column: 16, scope: !4) -// CHECK:STDOUT: !15 = !DILocation(line: 14, column: 3, scope: !4) -// CHECK:STDOUT: !16 = !DILocation(line: 15, column: 3, scope: !4) +// CHECK:STDOUT: !10 = !DILocation(line: 13, column: 16, scope: !4) +// CHECK:STDOUT: !11 = !DILocation(line: 13, column: 3, scope: !4) +// CHECK:STDOUT: !12 = !DILocation(line: 14, column: 16, scope: !4) +// CHECK:STDOUT: !13 = !DILocation(line: 14, column: 3, scope: !4) +// CHECK:STDOUT: !14 = !DILocation(line: 15, column: 3, scope: !4) diff --git a/toolchain/lower/testdata/struct/nested_struct_in_place.carbon b/toolchain/lower/testdata/struct/nested_struct_in_place.carbon index b110ded86f14b..3221d60ec4100 100644 --- a/toolchain/lower/testdata/struct/nested_struct_in_place.carbon +++ b/toolchain/lower/testdata/struct/nested_struct_in_place.carbon @@ -22,6 +22,7 @@ fn G() { // CHECK:STDOUT: define void @_CG.Main() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %v.var = alloca { { i32, i32, i32 }, { i32, i32, i32 } }, align 8, !dbg !7 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(i64 24, ptr %v.var), !dbg !7 // CHECK:STDOUT: %.loc14_74.1.a = getelementptr inbounds nuw { { i32, i32, i32 }, { i32, i32, i32 } }, ptr %v.var, i32 0, i32 0, !dbg !8 // CHECK:STDOUT: call void @_CF.Main(ptr %.loc14_74.1.a), !dbg !9 // CHECK:STDOUT: %.loc14_74.2.b = getelementptr inbounds nuw { { i32, i32, i32 }, { i32, i32, i32 } }, ptr %v.var, i32 0, i32 1, !dbg !8 @@ -29,6 +30,11 @@ fn G() { // CHECK:STDOUT: ret void, !dbg !11 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) +// CHECK:STDOUT: declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0 +// CHECK:STDOUT: +// CHECK:STDOUT: attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } +// CHECK:STDOUT: // CHECK:STDOUT: !llvm.module.flags = !{!0, !1} // CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/struct/one_entry.carbon b/toolchain/lower/testdata/struct/one_entry.carbon index b55ed350498c4..f9c6251eedfab 100644 --- a/toolchain/lower/testdata/struct/one_entry.carbon +++ b/toolchain/lower/testdata/struct/one_entry.carbon @@ -20,15 +20,25 @@ fn Run() -> i32 { // CHECK:STDOUT: define i32 @main() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %x.var = alloca { i32 }, align 8, !dbg !7 +// CHECK:STDOUT: %y.var = alloca { i32 }, align 8, !dbg !7 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(i64 4, ptr %x.var), !dbg !7 // CHECK:STDOUT: store { i32 } { i32 4 }, ptr %x.var, align 4, !dbg !8 -// CHECK:STDOUT: %y.var = alloca { i32 }, align 8, !dbg !9 -// CHECK:STDOUT: %.loc13_22.1.a = getelementptr inbounds nuw { i32 }, ptr %x.var, i32 0, i32 0, !dbg !10 -// CHECK:STDOUT: %.loc13_22.2 = load i32, ptr %.loc13_22.1.a, align 4, !dbg !10 -// CHECK:STDOUT: %.loc13_22.3.struct.init = insertvalue { i32 } poison, i32 %.loc13_22.2, 0, !dbg !10 -// CHECK:STDOUT: store { i32 } %.loc13_22.3.struct.init, ptr %y.var, align 4, !dbg !11 -// CHECK:STDOUT: ret i32 0, !dbg !12 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(i64 4, ptr %y.var), !dbg !7 +// CHECK:STDOUT: %.loc13_22.1.a = getelementptr inbounds nuw { i32 }, ptr %x.var, i32 0, i32 0, !dbg !9 +// CHECK:STDOUT: %.loc13_22.2 = load i32, ptr %.loc13_22.1.a, align 4, !dbg !9 +// CHECK:STDOUT: %.loc13_22.3.struct.init = insertvalue { i32 } poison, i32 %.loc13_22.2, 0, !dbg !9 +// CHECK:STDOUT: store { i32 } %.loc13_22.3.struct.init, ptr %y.var, align 4, !dbg !10 +// CHECK:STDOUT: ret i32 0, !dbg !11 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) +// CHECK:STDOUT: declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0 +// CHECK:STDOUT: +// CHECK:STDOUT: ; uselistorder directives +// CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 1, 0 } +// CHECK:STDOUT: +// CHECK:STDOUT: attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } +// CHECK:STDOUT: // CHECK:STDOUT: !llvm.module.flags = !{!0, !1} // CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: @@ -41,7 +51,6 @@ fn Run() -> i32 { // CHECK:STDOUT: !6 = !{} // CHECK:STDOUT: !7 = !DILocation(line: 12, column: 7, scope: !4) // CHECK:STDOUT: !8 = !DILocation(line: 12, column: 3, scope: !4) -// CHECK:STDOUT: !9 = !DILocation(line: 13, column: 7, scope: !4) -// CHECK:STDOUT: !10 = !DILocation(line: 13, column: 22, scope: !4) -// CHECK:STDOUT: !11 = !DILocation(line: 13, column: 3, scope: !4) -// CHECK:STDOUT: !12 = !DILocation(line: 14, column: 3, scope: !4) +// CHECK:STDOUT: !9 = !DILocation(line: 13, column: 22, scope: !4) +// CHECK:STDOUT: !10 = !DILocation(line: 13, column: 3, scope: !4) +// CHECK:STDOUT: !11 = !DILocation(line: 14, column: 3, scope: !4) diff --git a/toolchain/lower/testdata/struct/two_entries.carbon b/toolchain/lower/testdata/struct/two_entries.carbon index 7a0e4b48aa85f..7de730c091529 100644 --- a/toolchain/lower/testdata/struct/two_entries.carbon +++ b/toolchain/lower/testdata/struct/two_entries.carbon @@ -22,25 +22,35 @@ fn Run() -> i32 { // CHECK:STDOUT: define i32 @main() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %x.var = alloca { i32, i32 }, align 8, !dbg !7 +// CHECK:STDOUT: %y.var = alloca { i32, i32 }, align 8, !dbg !7 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(i64 8, ptr %x.var), !dbg !7 // CHECK:STDOUT: %.loc12_46.3.a = getelementptr inbounds nuw { i32, i32 }, ptr %x.var, i32 0, i32 0, !dbg !8 // CHECK:STDOUT: %.loc12_46.6.b = getelementptr inbounds nuw { i32, i32 }, ptr %x.var, i32 0, i32 1, !dbg !8 // CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %x.var, ptr align 4 @struct.loc12_47, i64 8, i1 false), !dbg !9 -// CHECK:STDOUT: %y.var = alloca { i32, i32 }, align 8, !dbg !10 -// CHECK:STDOUT: %.loc13_31.1.a = getelementptr inbounds nuw { i32, i32 }, ptr %x.var, i32 0, i32 0, !dbg !11 -// CHECK:STDOUT: %.loc13_31.2 = load i32, ptr %.loc13_31.1.a, align 4, !dbg !11 -// CHECK:STDOUT: %.loc13_31.3.a = getelementptr inbounds nuw { i32, i32 }, ptr %y.var, i32 0, i32 0, !dbg !11 -// CHECK:STDOUT: store i32 %.loc13_31.2, ptr %.loc13_31.3.a, align 4, !dbg !11 -// CHECK:STDOUT: %.loc13_31.5.b = getelementptr inbounds nuw { i32, i32 }, ptr %x.var, i32 0, i32 1, !dbg !11 -// CHECK:STDOUT: %.loc13_31.6 = load i32, ptr %.loc13_31.5.b, align 4, !dbg !11 -// CHECK:STDOUT: %.loc13_31.7.b = getelementptr inbounds nuw { i32, i32 }, ptr %y.var, i32 0, i32 1, !dbg !11 -// CHECK:STDOUT: store i32 %.loc13_31.6, ptr %.loc13_31.7.b, align 4, !dbg !11 -// CHECK:STDOUT: ret i32 0, !dbg !12 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(i64 8, ptr %y.var), !dbg !7 +// CHECK:STDOUT: %.loc13_31.1.a = getelementptr inbounds nuw { i32, i32 }, ptr %x.var, i32 0, i32 0, !dbg !10 +// CHECK:STDOUT: %.loc13_31.2 = load i32, ptr %.loc13_31.1.a, align 4, !dbg !10 +// CHECK:STDOUT: %.loc13_31.3.a = getelementptr inbounds nuw { i32, i32 }, ptr %y.var, i32 0, i32 0, !dbg !10 +// CHECK:STDOUT: store i32 %.loc13_31.2, ptr %.loc13_31.3.a, align 4, !dbg !10 +// CHECK:STDOUT: %.loc13_31.5.b = getelementptr inbounds nuw { i32, i32 }, ptr %x.var, i32 0, i32 1, !dbg !10 +// CHECK:STDOUT: %.loc13_31.6 = load i32, ptr %.loc13_31.5.b, align 4, !dbg !10 +// CHECK:STDOUT: %.loc13_31.7.b = getelementptr inbounds nuw { i32, i32 }, ptr %y.var, i32 0, i32 1, !dbg !10 +// CHECK:STDOUT: store i32 %.loc13_31.6, ptr %.loc13_31.7.b, align 4, !dbg !10 +// CHECK:STDOUT: ret i32 0, !dbg !11 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) +// CHECK:STDOUT: declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0 +// CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) -// CHECK:STDOUT: declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 +// CHECK:STDOUT: declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1 +// CHECK:STDOUT: +// CHECK:STDOUT: ; uselistorder directives +// CHECK:STDOUT: uselistorder i32 1, { 0, 1, 3, 2, 4, 5 } +// CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 1, 0 } // CHECK:STDOUT: -// CHECK:STDOUT: attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } +// CHECK:STDOUT: attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } +// CHECK:STDOUT: attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: // CHECK:STDOUT: !llvm.module.flags = !{!0, !1} // CHECK:STDOUT: !llvm.dbg.cu = !{!2} @@ -55,6 +65,5 @@ fn Run() -> i32 { // CHECK:STDOUT: !7 = !DILocation(line: 12, column: 7, scope: !4) // CHECK:STDOUT: !8 = !DILocation(line: 12, column: 31, scope: !4) // CHECK:STDOUT: !9 = !DILocation(line: 12, column: 3, scope: !4) -// CHECK:STDOUT: !10 = !DILocation(line: 13, column: 7, scope: !4) -// CHECK:STDOUT: !11 = !DILocation(line: 13, column: 31, scope: !4) -// CHECK:STDOUT: !12 = !DILocation(line: 14, column: 3, scope: !4) +// CHECK:STDOUT: !10 = !DILocation(line: 13, column: 31, scope: !4) +// CHECK:STDOUT: !11 = !DILocation(line: 14, column: 3, scope: !4) diff --git a/toolchain/lower/testdata/tuple/access/element_access.carbon b/toolchain/lower/testdata/tuple/access/element_access.carbon index e8258eab2f313..0abbe868e86b0 100644 --- a/toolchain/lower/testdata/tuple/access/element_access.carbon +++ b/toolchain/lower/testdata/tuple/access/element_access.carbon @@ -23,25 +23,36 @@ fn Run() -> i32 { // CHECK:STDOUT: define i32 @main() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %a.var = alloca { i32, i32, i32 }, align 8, !dbg !7 +// CHECK:STDOUT: %b.var = alloca i32, align 4, !dbg !7 +// CHECK:STDOUT: %c.var = alloca i32, align 4, !dbg !7 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(i64 12, ptr %a.var), !dbg !7 // CHECK:STDOUT: %tuple.elem0.loc12.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %a.var, i32 0, i32 0, !dbg !8 // CHECK:STDOUT: %tuple.elem1.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %a.var, i32 0, i32 1, !dbg !8 // CHECK:STDOUT: %tuple.elem2.loc12.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %a.var, i32 0, i32 2, !dbg !8 // CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %a.var, ptr align 4 @tuple.loc12_37, i64 12, i1 false), !dbg !9 -// CHECK:STDOUT: %b.var = alloca i32, align 4, !dbg !10 -// CHECK:STDOUT: %tuple.elem0.loc13.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %a.var, i32 0, i32 0, !dbg !11 -// CHECK:STDOUT: %.loc13 = load i32, ptr %tuple.elem0.loc13.tuple.elem, align 4, !dbg !11 -// CHECK:STDOUT: store i32 %.loc13, ptr %b.var, align 4, !dbg !12 -// CHECK:STDOUT: %c.var = alloca i32, align 4, !dbg !13 -// CHECK:STDOUT: %tuple.elem2.loc14.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %a.var, i32 0, i32 2, !dbg !14 -// CHECK:STDOUT: %.loc14 = load i32, ptr %tuple.elem2.loc14.tuple.elem, align 4, !dbg !14 -// CHECK:STDOUT: store i32 %.loc14, ptr %c.var, align 4, !dbg !15 -// CHECK:STDOUT: ret i32 0, !dbg !16 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(i64 4, ptr %b.var), !dbg !7 +// CHECK:STDOUT: %tuple.elem0.loc13.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %a.var, i32 0, i32 0, !dbg !10 +// CHECK:STDOUT: %.loc13 = load i32, ptr %tuple.elem0.loc13.tuple.elem, align 4, !dbg !10 +// CHECK:STDOUT: store i32 %.loc13, ptr %b.var, align 4, !dbg !11 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(i64 4, ptr %c.var), !dbg !7 +// CHECK:STDOUT: %tuple.elem2.loc14.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %a.var, i32 0, i32 2, !dbg !12 +// CHECK:STDOUT: %.loc14 = load i32, ptr %tuple.elem2.loc14.tuple.elem, align 4, !dbg !12 +// CHECK:STDOUT: store i32 %.loc14, ptr %c.var, align 4, !dbg !13 +// CHECK:STDOUT: ret i32 0, !dbg !14 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) +// CHECK:STDOUT: declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0 +// CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) -// CHECK:STDOUT: declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 +// CHECK:STDOUT: declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1 +// CHECK:STDOUT: +// CHECK:STDOUT: ; uselistorder directives +// CHECK:STDOUT: uselistorder i32 1, { 2, 0, 1, 3, 4 } +// CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 2, 1, 0 } // CHECK:STDOUT: -// CHECK:STDOUT: attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } +// CHECK:STDOUT: attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } +// CHECK:STDOUT: attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: // CHECK:STDOUT: !llvm.module.flags = !{!0, !1} // CHECK:STDOUT: !llvm.dbg.cu = !{!2} @@ -56,10 +67,8 @@ fn Run() -> i32 { // CHECK:STDOUT: !7 = !DILocation(line: 12, column: 7, scope: !4) // CHECK:STDOUT: !8 = !DILocation(line: 12, column: 28, scope: !4) // CHECK:STDOUT: !9 = !DILocation(line: 12, column: 3, scope: !4) -// CHECK:STDOUT: !10 = !DILocation(line: 13, column: 7, scope: !4) -// CHECK:STDOUT: !11 = !DILocation(line: 13, column: 16, scope: !4) -// CHECK:STDOUT: !12 = !DILocation(line: 13, column: 3, scope: !4) -// CHECK:STDOUT: !13 = !DILocation(line: 14, column: 7, scope: !4) -// CHECK:STDOUT: !14 = !DILocation(line: 14, column: 16, scope: !4) -// CHECK:STDOUT: !15 = !DILocation(line: 14, column: 3, scope: !4) -// CHECK:STDOUT: !16 = !DILocation(line: 15, column: 3, scope: !4) +// CHECK:STDOUT: !10 = !DILocation(line: 13, column: 16, scope: !4) +// CHECK:STDOUT: !11 = !DILocation(line: 13, column: 3, scope: !4) +// CHECK:STDOUT: !12 = !DILocation(line: 14, column: 16, scope: !4) +// CHECK:STDOUT: !13 = !DILocation(line: 14, column: 3, scope: !4) +// CHECK:STDOUT: !14 = !DILocation(line: 15, column: 3, scope: !4) diff --git a/toolchain/lower/testdata/tuple/access/return_value_access.carbon b/toolchain/lower/testdata/tuple/access/return_value_access.carbon index a3fece7f8240f..c2b1f7851204e 100644 --- a/toolchain/lower/testdata/tuple/access/return_value_access.carbon +++ b/toolchain/lower/testdata/tuple/access/return_value_access.carbon @@ -30,6 +30,7 @@ fn Run() { // CHECK:STDOUT: define void @main() !dbg !9 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %t.var = alloca i32, align 4, !dbg !10 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(i64 4, ptr %t.var), !dbg !10 // CHECK:STDOUT: %.loc14_18.1.temp = alloca { i32, i32 }, align 8, !dbg !11 // CHECK:STDOUT: call void @_CF.Main(ptr %.loc14_18.1.temp), !dbg !11 // CHECK:STDOUT: %tuple.elem1.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %.loc14_18.1.temp, i32 0, i32 1, !dbg !11 @@ -41,7 +42,11 @@ fn Run() { // CHECK:STDOUT: ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) // CHECK:STDOUT: declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) +// CHECK:STDOUT: declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 +// CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } +// CHECK:STDOUT: attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: // CHECK:STDOUT: !llvm.module.flags = !{!0, !1} // CHECK:STDOUT: !llvm.dbg.cu = !{!2} diff --git a/toolchain/lower/testdata/tuple/empty.carbon b/toolchain/lower/testdata/tuple/empty.carbon index 8a2ddfb3a3239..c534e23191064 100644 --- a/toolchain/lower/testdata/tuple/empty.carbon +++ b/toolchain/lower/testdata/tuple/empty.carbon @@ -20,10 +20,20 @@ fn Run() -> i32 { // CHECK:STDOUT: define i32 @main() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %x.var = alloca {}, align 8, !dbg !7 -// CHECK:STDOUT: %y.var = alloca {}, align 8, !dbg !8 -// CHECK:STDOUT: ret i32 0, !dbg !9 +// CHECK:STDOUT: %y.var = alloca {}, align 8, !dbg !7 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(i64 0, ptr %x.var), !dbg !7 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(i64 0, ptr %y.var), !dbg !7 +// CHECK:STDOUT: ret i32 0, !dbg !8 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) +// CHECK:STDOUT: declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0 +// CHECK:STDOUT: +// CHECK:STDOUT: ; uselistorder directives +// CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 1, 0 } +// CHECK:STDOUT: +// CHECK:STDOUT: attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } +// CHECK:STDOUT: // CHECK:STDOUT: !llvm.module.flags = !{!0, !1} // CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: @@ -35,5 +45,4 @@ fn Run() -> i32 { // CHECK:STDOUT: !5 = !DISubroutineType(types: !6) // CHECK:STDOUT: !6 = !{} // CHECK:STDOUT: !7 = !DILocation(line: 12, column: 7, scope: !4) -// CHECK:STDOUT: !8 = !DILocation(line: 13, column: 7, scope: !4) -// CHECK:STDOUT: !9 = !DILocation(line: 14, column: 3, scope: !4) +// CHECK:STDOUT: !8 = !DILocation(line: 14, column: 3, scope: !4) diff --git a/toolchain/lower/testdata/tuple/nested_tuple_in_place.carbon b/toolchain/lower/testdata/tuple/nested_tuple_in_place.carbon index 2f51438d5571c..421aeafca671a 100644 --- a/toolchain/lower/testdata/tuple/nested_tuple_in_place.carbon +++ b/toolchain/lower/testdata/tuple/nested_tuple_in_place.carbon @@ -22,6 +22,7 @@ fn G() { // CHECK:STDOUT: define void @_CG.Main() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %v.var = alloca { { i32, i32, i32 }, { i32, i32, i32 } }, align 8, !dbg !7 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(i64 24, ptr %v.var), !dbg !7 // CHECK:STDOUT: %tuple.elem0.tuple.elem = getelementptr inbounds nuw { { i32, i32, i32 }, { i32, i32, i32 } }, ptr %v.var, i32 0, i32 0, !dbg !8 // CHECK:STDOUT: call void @_CF.Main(ptr %tuple.elem0.tuple.elem), !dbg !9 // CHECK:STDOUT: %tuple.elem1.tuple.elem = getelementptr inbounds nuw { { i32, i32, i32 }, { i32, i32, i32 } }, ptr %v.var, i32 0, i32 1, !dbg !8 @@ -29,6 +30,11 @@ fn G() { // CHECK:STDOUT: ret void, !dbg !11 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) +// CHECK:STDOUT: declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0 +// CHECK:STDOUT: +// CHECK:STDOUT: attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } +// CHECK:STDOUT: // CHECK:STDOUT: !llvm.module.flags = !{!0, !1} // CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/tuple/one_entry.carbon b/toolchain/lower/testdata/tuple/one_entry.carbon index 48bfa2b06b995..1bf5b1b525cce 100644 --- a/toolchain/lower/testdata/tuple/one_entry.carbon +++ b/toolchain/lower/testdata/tuple/one_entry.carbon @@ -20,17 +20,25 @@ fn Run() -> i32 { // CHECK:STDOUT: define i32 @main() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %x.var = alloca { i32 }, align 8, !dbg !7 +// CHECK:STDOUT: %y.var = alloca { i32 }, align 8, !dbg !7 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(i64 4, ptr %x.var), !dbg !7 // CHECK:STDOUT: store { i32 } { i32 1 }, ptr %x.var, align 4, !dbg !8 -// CHECK:STDOUT: %y.var = alloca { i32 }, align 8, !dbg !9 -// CHECK:STDOUT: %tuple.elem0.tuple.elem = getelementptr inbounds nuw { i32 }, ptr %x.var, i32 0, i32 0, !dbg !10 -// CHECK:STDOUT: %.loc13_20.1 = load i32, ptr %tuple.elem0.tuple.elem, align 4, !dbg !10 -// CHECK:STDOUT: %.loc13_20.2.tuple.init = insertvalue { i32 } poison, i32 %.loc13_20.1, 0, !dbg !10 -// CHECK:STDOUT: store { i32 } %.loc13_20.2.tuple.init, ptr %y.var, align 4, !dbg !11 -// CHECK:STDOUT: ret i32 0, !dbg !12 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(i64 4, ptr %y.var), !dbg !7 +// CHECK:STDOUT: %tuple.elem0.tuple.elem = getelementptr inbounds nuw { i32 }, ptr %x.var, i32 0, i32 0, !dbg !9 +// CHECK:STDOUT: %.loc13_20.1 = load i32, ptr %tuple.elem0.tuple.elem, align 4, !dbg !9 +// CHECK:STDOUT: %.loc13_20.2.tuple.init = insertvalue { i32 } poison, i32 %.loc13_20.1, 0, !dbg !9 +// CHECK:STDOUT: store { i32 } %.loc13_20.2.tuple.init, ptr %y.var, align 4, !dbg !10 +// CHECK:STDOUT: ret i32 0, !dbg !11 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) +// CHECK:STDOUT: declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0 +// CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives -// CHECK:STDOUT: uselistorder i32 1, { 0, 2, 1 } +// CHECK:STDOUT: uselistorder i32 1, { 2, 0, 1 } +// CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 1, 0 } +// CHECK:STDOUT: +// CHECK:STDOUT: attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: // CHECK:STDOUT: !llvm.module.flags = !{!0, !1} // CHECK:STDOUT: !llvm.dbg.cu = !{!2} @@ -44,7 +52,6 @@ fn Run() -> i32 { // CHECK:STDOUT: !6 = !{} // CHECK:STDOUT: !7 = !DILocation(line: 12, column: 7, scope: !4) // CHECK:STDOUT: !8 = !DILocation(line: 12, column: 3, scope: !4) -// CHECK:STDOUT: !9 = !DILocation(line: 13, column: 7, scope: !4) -// CHECK:STDOUT: !10 = !DILocation(line: 13, column: 20, scope: !4) -// CHECK:STDOUT: !11 = !DILocation(line: 13, column: 3, scope: !4) -// CHECK:STDOUT: !12 = !DILocation(line: 14, column: 3, scope: !4) +// CHECK:STDOUT: !9 = !DILocation(line: 13, column: 20, scope: !4) +// CHECK:STDOUT: !10 = !DILocation(line: 13, column: 3, scope: !4) +// CHECK:STDOUT: !11 = !DILocation(line: 14, column: 3, scope: !4) diff --git a/toolchain/lower/testdata/tuple/two_entries.carbon b/toolchain/lower/testdata/tuple/two_entries.carbon index bd6597f81b377..d600d4855d3e8 100644 --- a/toolchain/lower/testdata/tuple/two_entries.carbon +++ b/toolchain/lower/testdata/tuple/two_entries.carbon @@ -22,25 +22,35 @@ fn Run() -> i32 { // CHECK:STDOUT: define i32 @main() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %x.var = alloca { i32, i32 }, align 8, !dbg !7 +// CHECK:STDOUT: %y.var = alloca { i32, i32 }, align 8, !dbg !7 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(i64 8, ptr %x.var), !dbg !7 // CHECK:STDOUT: %tuple.elem0.loc12.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %x.var, i32 0, i32 0, !dbg !8 // CHECK:STDOUT: %tuple.elem1.loc12.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %x.var, i32 0, i32 1, !dbg !8 // CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %x.var, ptr align 4 @tuple.loc12_30, i64 8, i1 false), !dbg !9 -// CHECK:STDOUT: %y.var = alloca { i32, i32 }, align 8, !dbg !10 -// CHECK:STDOUT: %tuple.elem0.loc13_23.1.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %x.var, i32 0, i32 0, !dbg !11 -// CHECK:STDOUT: %.loc13_23.1 = load i32, ptr %tuple.elem0.loc13_23.1.tuple.elem, align 4, !dbg !11 -// CHECK:STDOUT: %tuple.elem0.loc13_23.2.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %y.var, i32 0, i32 0, !dbg !11 -// CHECK:STDOUT: store i32 %.loc13_23.1, ptr %tuple.elem0.loc13_23.2.tuple.elem, align 4, !dbg !11 -// CHECK:STDOUT: %tuple.elem1.loc13_23.1.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %x.var, i32 0, i32 1, !dbg !11 -// CHECK:STDOUT: %.loc13_23.3 = load i32, ptr %tuple.elem1.loc13_23.1.tuple.elem, align 4, !dbg !11 -// CHECK:STDOUT: %tuple.elem1.loc13_23.2.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %y.var, i32 0, i32 1, !dbg !11 -// CHECK:STDOUT: store i32 %.loc13_23.3, ptr %tuple.elem1.loc13_23.2.tuple.elem, align 4, !dbg !11 -// CHECK:STDOUT: ret i32 0, !dbg !12 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(i64 8, ptr %y.var), !dbg !7 +// CHECK:STDOUT: %tuple.elem0.loc13_23.1.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %x.var, i32 0, i32 0, !dbg !10 +// CHECK:STDOUT: %.loc13_23.1 = load i32, ptr %tuple.elem0.loc13_23.1.tuple.elem, align 4, !dbg !10 +// CHECK:STDOUT: %tuple.elem0.loc13_23.2.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %y.var, i32 0, i32 0, !dbg !10 +// CHECK:STDOUT: store i32 %.loc13_23.1, ptr %tuple.elem0.loc13_23.2.tuple.elem, align 4, !dbg !10 +// CHECK:STDOUT: %tuple.elem1.loc13_23.1.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %x.var, i32 0, i32 1, !dbg !10 +// CHECK:STDOUT: %.loc13_23.3 = load i32, ptr %tuple.elem1.loc13_23.1.tuple.elem, align 4, !dbg !10 +// CHECK:STDOUT: %tuple.elem1.loc13_23.2.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %y.var, i32 0, i32 1, !dbg !10 +// CHECK:STDOUT: store i32 %.loc13_23.3, ptr %tuple.elem1.loc13_23.2.tuple.elem, align 4, !dbg !10 +// CHECK:STDOUT: ret i32 0, !dbg !11 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) +// CHECK:STDOUT: declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0 +// CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) -// CHECK:STDOUT: declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 +// CHECK:STDOUT: declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1 +// CHECK:STDOUT: +// CHECK:STDOUT: ; uselistorder directives +// CHECK:STDOUT: uselistorder i32 1, { 0, 1, 3, 2, 4 } +// CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 1, 0 } // CHECK:STDOUT: -// CHECK:STDOUT: attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } +// CHECK:STDOUT: attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } +// CHECK:STDOUT: attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: // CHECK:STDOUT: !llvm.module.flags = !{!0, !1} // CHECK:STDOUT: !llvm.dbg.cu = !{!2} @@ -55,6 +65,5 @@ fn Run() -> i32 { // CHECK:STDOUT: !7 = !DILocation(line: 12, column: 7, scope: !4) // CHECK:STDOUT: !8 = !DILocation(line: 12, column: 23, scope: !4) // CHECK:STDOUT: !9 = !DILocation(line: 12, column: 3, scope: !4) -// CHECK:STDOUT: !10 = !DILocation(line: 13, column: 7, scope: !4) -// CHECK:STDOUT: !11 = !DILocation(line: 13, column: 23, scope: !4) -// CHECK:STDOUT: !12 = !DILocation(line: 14, column: 3, scope: !4) +// CHECK:STDOUT: !10 = !DILocation(line: 13, column: 23, scope: !4) +// CHECK:STDOUT: !11 = !DILocation(line: 14, column: 3, scope: !4) diff --git a/toolchain/lower/testdata/tuple/value_formation.carbon b/toolchain/lower/testdata/tuple/value_formation.carbon index bf6cc885e54c6..1779b75737122 100644 --- a/toolchain/lower/testdata/tuple/value_formation.carbon +++ b/toolchain/lower/testdata/tuple/value_formation.carbon @@ -24,42 +24,52 @@ fn F() { // CHECK:STDOUT: define void @_CF.Main() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %a.var = alloca { i32, i32, i32 }, align 8, !dbg !7 -// CHECK:STDOUT: %b.var = alloca { i32, i32, i32 }, align 8, !dbg !8 -// CHECK:STDOUT: %tuple.elem0.loc16_6.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %a.var, i32 0, i32 0, !dbg !9 -// CHECK:STDOUT: %.loc16_6.1 = load i32, ptr %tuple.elem0.loc16_6.tuple.elem, align 4, !dbg !9 -// CHECK:STDOUT: %tuple.elem1.loc16_6.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %a.var, i32 0, i32 1, !dbg !9 -// CHECK:STDOUT: %.loc16_6.2 = load i32, ptr %tuple.elem1.loc16_6.tuple.elem, align 4, !dbg !9 -// CHECK:STDOUT: %tuple.elem2.loc16_6.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %a.var, i32 0, i32 2, !dbg !9 -// CHECK:STDOUT: %.loc16_6.3 = load i32, ptr %tuple.elem2.loc16_6.tuple.elem, align 4, !dbg !9 -// CHECK:STDOUT: %tuple.loc16_6 = alloca { i32, i32, i32 }, align 8, !dbg !9 -// CHECK:STDOUT: %tuple.loc16_61 = getelementptr inbounds nuw { i32, i32, i32 }, ptr %tuple.loc16_6, i32 0, i32 0, !dbg !9 -// CHECK:STDOUT: store i32 %.loc16_6.1, ptr %tuple.loc16_61, align 4, !dbg !9 -// CHECK:STDOUT: %tuple.loc16_62 = getelementptr inbounds nuw { i32, i32, i32 }, ptr %tuple.loc16_6, i32 0, i32 1, !dbg !9 -// CHECK:STDOUT: store i32 %.loc16_6.2, ptr %tuple.loc16_62, align 4, !dbg !9 -// CHECK:STDOUT: %tuple.loc16_63 = getelementptr inbounds nuw { i32, i32, i32 }, ptr %tuple.loc16_6, i32 0, i32 2, !dbg !9 -// CHECK:STDOUT: store i32 %.loc16_6.3, ptr %tuple.loc16_63, align 4, !dbg !9 -// CHECK:STDOUT: %tuple.elem0.loc16_9.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %b.var, i32 0, i32 0, !dbg !10 -// CHECK:STDOUT: %.loc16_9.1 = load i32, ptr %tuple.elem0.loc16_9.tuple.elem, align 4, !dbg !10 -// CHECK:STDOUT: %tuple.elem1.loc16_9.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %b.var, i32 0, i32 1, !dbg !10 -// CHECK:STDOUT: %.loc16_9.2 = load i32, ptr %tuple.elem1.loc16_9.tuple.elem, align 4, !dbg !10 -// CHECK:STDOUT: %tuple.elem2.loc16_9.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %b.var, i32 0, i32 2, !dbg !10 -// CHECK:STDOUT: %.loc16_9.3 = load i32, ptr %tuple.elem2.loc16_9.tuple.elem, align 4, !dbg !10 -// CHECK:STDOUT: %tuple.loc16_9 = alloca { i32, i32, i32 }, align 8, !dbg !10 -// CHECK:STDOUT: %tuple.loc16_94 = getelementptr inbounds nuw { i32, i32, i32 }, ptr %tuple.loc16_9, i32 0, i32 0, !dbg !10 -// CHECK:STDOUT: store i32 %.loc16_9.1, ptr %tuple.loc16_94, align 4, !dbg !10 -// CHECK:STDOUT: %tuple.loc16_95 = getelementptr inbounds nuw { i32, i32, i32 }, ptr %tuple.loc16_9, i32 0, i32 1, !dbg !10 -// CHECK:STDOUT: store i32 %.loc16_9.2, ptr %tuple.loc16_95, align 4, !dbg !10 -// CHECK:STDOUT: %tuple.loc16_96 = getelementptr inbounds nuw { i32, i32, i32 }, ptr %tuple.loc16_9, i32 0, i32 2, !dbg !10 -// CHECK:STDOUT: store i32 %.loc16_9.3, ptr %tuple.loc16_96, align 4, !dbg !10 -// CHECK:STDOUT: %tuple.loc16_10 = alloca { ptr, ptr }, align 8, !dbg !11 -// CHECK:STDOUT: %tuple.loc16_107 = getelementptr inbounds nuw { ptr, ptr }, ptr %tuple.loc16_10, i32 0, i32 0, !dbg !11 -// CHECK:STDOUT: store ptr %tuple.loc16_6, ptr %tuple.loc16_107, align 8, !dbg !11 -// CHECK:STDOUT: %tuple.loc16_108 = getelementptr inbounds nuw { ptr, ptr }, ptr %tuple.loc16_10, i32 0, i32 1, !dbg !11 -// CHECK:STDOUT: store ptr %tuple.loc16_9, ptr %tuple.loc16_108, align 8, !dbg !11 -// CHECK:STDOUT: call void @_CG.Main(ptr %tuple.loc16_10), !dbg !12 -// CHECK:STDOUT: ret void, !dbg !13 +// CHECK:STDOUT: %b.var = alloca { i32, i32, i32 }, align 8, !dbg !7 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(i64 12, ptr %a.var), !dbg !7 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(i64 12, ptr %b.var), !dbg !7 +// CHECK:STDOUT: %tuple.elem0.loc16_6.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %a.var, i32 0, i32 0, !dbg !8 +// CHECK:STDOUT: %.loc16_6.1 = load i32, ptr %tuple.elem0.loc16_6.tuple.elem, align 4, !dbg !8 +// CHECK:STDOUT: %tuple.elem1.loc16_6.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %a.var, i32 0, i32 1, !dbg !8 +// CHECK:STDOUT: %.loc16_6.2 = load i32, ptr %tuple.elem1.loc16_6.tuple.elem, align 4, !dbg !8 +// CHECK:STDOUT: %tuple.elem2.loc16_6.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %a.var, i32 0, i32 2, !dbg !8 +// CHECK:STDOUT: %.loc16_6.3 = load i32, ptr %tuple.elem2.loc16_6.tuple.elem, align 4, !dbg !8 +// CHECK:STDOUT: %tuple.loc16_6 = alloca { i32, i32, i32 }, align 8, !dbg !8 +// CHECK:STDOUT: %tuple.loc16_61 = getelementptr inbounds nuw { i32, i32, i32 }, ptr %tuple.loc16_6, i32 0, i32 0, !dbg !8 +// CHECK:STDOUT: store i32 %.loc16_6.1, ptr %tuple.loc16_61, align 4, !dbg !8 +// CHECK:STDOUT: %tuple.loc16_62 = getelementptr inbounds nuw { i32, i32, i32 }, ptr %tuple.loc16_6, i32 0, i32 1, !dbg !8 +// CHECK:STDOUT: store i32 %.loc16_6.2, ptr %tuple.loc16_62, align 4, !dbg !8 +// CHECK:STDOUT: %tuple.loc16_63 = getelementptr inbounds nuw { i32, i32, i32 }, ptr %tuple.loc16_6, i32 0, i32 2, !dbg !8 +// CHECK:STDOUT: store i32 %.loc16_6.3, ptr %tuple.loc16_63, align 4, !dbg !8 +// CHECK:STDOUT: %tuple.elem0.loc16_9.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %b.var, i32 0, i32 0, !dbg !9 +// CHECK:STDOUT: %.loc16_9.1 = load i32, ptr %tuple.elem0.loc16_9.tuple.elem, align 4, !dbg !9 +// CHECK:STDOUT: %tuple.elem1.loc16_9.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %b.var, i32 0, i32 1, !dbg !9 +// CHECK:STDOUT: %.loc16_9.2 = load i32, ptr %tuple.elem1.loc16_9.tuple.elem, align 4, !dbg !9 +// CHECK:STDOUT: %tuple.elem2.loc16_9.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %b.var, i32 0, i32 2, !dbg !9 +// CHECK:STDOUT: %.loc16_9.3 = load i32, ptr %tuple.elem2.loc16_9.tuple.elem, align 4, !dbg !9 +// CHECK:STDOUT: %tuple.loc16_9 = alloca { i32, i32, i32 }, align 8, !dbg !9 +// CHECK:STDOUT: %tuple.loc16_94 = getelementptr inbounds nuw { i32, i32, i32 }, ptr %tuple.loc16_9, i32 0, i32 0, !dbg !9 +// CHECK:STDOUT: store i32 %.loc16_9.1, ptr %tuple.loc16_94, align 4, !dbg !9 +// CHECK:STDOUT: %tuple.loc16_95 = getelementptr inbounds nuw { i32, i32, i32 }, ptr %tuple.loc16_9, i32 0, i32 1, !dbg !9 +// CHECK:STDOUT: store i32 %.loc16_9.2, ptr %tuple.loc16_95, align 4, !dbg !9 +// CHECK:STDOUT: %tuple.loc16_96 = getelementptr inbounds nuw { i32, i32, i32 }, ptr %tuple.loc16_9, i32 0, i32 2, !dbg !9 +// CHECK:STDOUT: store i32 %.loc16_9.3, ptr %tuple.loc16_96, align 4, !dbg !9 +// CHECK:STDOUT: %tuple.loc16_10 = alloca { ptr, ptr }, align 8, !dbg !10 +// CHECK:STDOUT: %tuple.loc16_107 = getelementptr inbounds nuw { ptr, ptr }, ptr %tuple.loc16_10, i32 0, i32 0, !dbg !10 +// CHECK:STDOUT: store ptr %tuple.loc16_6, ptr %tuple.loc16_107, align 8, !dbg !10 +// CHECK:STDOUT: %tuple.loc16_108 = getelementptr inbounds nuw { ptr, ptr }, ptr %tuple.loc16_10, i32 0, i32 1, !dbg !10 +// CHECK:STDOUT: store ptr %tuple.loc16_9, ptr %tuple.loc16_108, align 8, !dbg !10 +// CHECK:STDOUT: call void @_CG.Main(ptr %tuple.loc16_10), !dbg !11 +// CHECK:STDOUT: ret void, !dbg !12 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) +// CHECK:STDOUT: declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0 +// CHECK:STDOUT: +// CHECK:STDOUT: ; uselistorder directives +// CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 1, 0 } +// CHECK:STDOUT: +// CHECK:STDOUT: attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } +// CHECK:STDOUT: // CHECK:STDOUT: !llvm.module.flags = !{!0, !1} // CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: @@ -71,9 +81,8 @@ fn F() { // CHECK:STDOUT: !5 = !DISubroutineType(types: !6) // CHECK:STDOUT: !6 = !{} // CHECK:STDOUT: !7 = !DILocation(line: 14, column: 7, scope: !4) -// CHECK:STDOUT: !8 = !DILocation(line: 15, column: 7, scope: !4) -// CHECK:STDOUT: !9 = !DILocation(line: 16, column: 6, scope: !4) -// CHECK:STDOUT: !10 = !DILocation(line: 16, column: 9, scope: !4) -// CHECK:STDOUT: !11 = !DILocation(line: 16, column: 5, scope: !4) -// CHECK:STDOUT: !12 = !DILocation(line: 16, column: 3, scope: !4) -// CHECK:STDOUT: !13 = !DILocation(line: 13, column: 1, scope: !4) +// CHECK:STDOUT: !8 = !DILocation(line: 16, column: 6, scope: !4) +// CHECK:STDOUT: !9 = !DILocation(line: 16, column: 9, scope: !4) +// CHECK:STDOUT: !10 = !DILocation(line: 16, column: 5, scope: !4) +// CHECK:STDOUT: !11 = !DILocation(line: 16, column: 3, scope: !4) +// CHECK:STDOUT: !12 = !DILocation(line: 13, column: 1, scope: !4) diff --git a/toolchain/lower/testdata/var/local.carbon b/toolchain/lower/testdata/var/local.carbon index 6ceb441c60fce..a8396960bdff7 100644 --- a/toolchain/lower/testdata/var/local.carbon +++ b/toolchain/lower/testdata/var/local.carbon @@ -19,11 +19,17 @@ fn Run() -> i32 { // CHECK:STDOUT: define i32 @main() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %x.var = alloca i32, align 4, !dbg !7 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(i64 4, ptr %x.var), !dbg !7 // CHECK:STDOUT: store i32 1, ptr %x.var, align 4, !dbg !8 // CHECK:STDOUT: %.loc13 = load i32, ptr %x.var, align 4, !dbg !9 // CHECK:STDOUT: ret i32 %.loc13, !dbg !10 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) +// CHECK:STDOUT: declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0 +// CHECK:STDOUT: +// CHECK:STDOUT: attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } +// CHECK:STDOUT: // CHECK:STDOUT: !llvm.module.flags = !{!0, !1} // CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/var/nested.carbon b/toolchain/lower/testdata/var/nested.carbon new file mode 100644 index 0000000000000..38d5778089d45 --- /dev/null +++ b/toolchain/lower/testdata/var/nested.carbon @@ -0,0 +1,75 @@ +// Part of the Carbon Language project, under the Apache License v2.0 with LLVM +// Exceptions. See /LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// AUTOUPDATE +// TIP: To test this file alone, run: +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/lower/testdata/var/nested.carbon +// TIP: To dump output, run: +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/lower/testdata/var/nested.carbon + +fn Run() -> i32 { + var a: i32 = 1; + while (true) { + var b: i32 = a; + a = b; + } + return a; +} + +// CHECK:STDOUT: ; ModuleID = 'nested.carbon' +// CHECK:STDOUT: source_filename = "nested.carbon" +// CHECK:STDOUT: +// CHECK:STDOUT: define i32 @main() !dbg !4 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %a.var = alloca i32, align 4, !dbg !7 +// CHECK:STDOUT: %b.var = alloca i32, align 4, !dbg !7 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(i64 4, ptr %a.var), !dbg !7 +// CHECK:STDOUT: store i32 1, ptr %a.var, align 4, !dbg !8 +// CHECK:STDOUT: br label %while.cond, !dbg !9 +// CHECK:STDOUT: +// CHECK:STDOUT: while.cond: ; preds = %while.body, %entry +// CHECK:STDOUT: br i1 true, label %while.body, label %while.done, !dbg !9 +// CHECK:STDOUT: +// CHECK:STDOUT: while.body: ; preds = %while.cond +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(i64 4, ptr %b.var), !dbg !7 +// CHECK:STDOUT: %.loc14 = load i32, ptr %a.var, align 4, !dbg !10 +// CHECK:STDOUT: store i32 %.loc14, ptr %b.var, align 4, !dbg !11 +// CHECK:STDOUT: %.loc15 = load i32, ptr %b.var, align 4, !dbg !12 +// CHECK:STDOUT: store i32 %.loc15, ptr %a.var, align 4, !dbg !13 +// CHECK:STDOUT: br label %while.cond, !dbg !14 +// CHECK:STDOUT: +// CHECK:STDOUT: while.done: ; preds = %while.cond +// CHECK:STDOUT: %.loc17 = load i32, ptr %a.var, align 4, !dbg !15 +// CHECK:STDOUT: ret i32 %.loc17, !dbg !16 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) +// CHECK:STDOUT: declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0 +// CHECK:STDOUT: +// CHECK:STDOUT: ; uselistorder directives +// CHECK:STDOUT: uselistorder i32 1, { 1, 0, 2 } +// CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 1, 0 } +// CHECK:STDOUT: +// CHECK:STDOUT: attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} +// CHECK:STDOUT: !llvm.dbg.cu = !{!2} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !3 = !DIFile(filename: "nested.carbon", directory: "") +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "Run", linkageName: "main", scope: null, file: !3, line: 11, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) +// CHECK:STDOUT: !6 = !{} +// CHECK:STDOUT: !7 = !DILocation(line: 12, column: 7, scope: !4) +// CHECK:STDOUT: !8 = !DILocation(line: 12, column: 3, scope: !4) +// CHECK:STDOUT: !9 = !DILocation(line: 13, column: 9, scope: !4) +// CHECK:STDOUT: !10 = !DILocation(line: 14, column: 18, scope: !4) +// CHECK:STDOUT: !11 = !DILocation(line: 14, column: 5, scope: !4) +// CHECK:STDOUT: !12 = !DILocation(line: 15, column: 9, scope: !4) +// CHECK:STDOUT: !13 = !DILocation(line: 15, column: 5, scope: !4) +// CHECK:STDOUT: !14 = !DILocation(line: 13, column: 3, scope: !4) +// CHECK:STDOUT: !15 = !DILocation(line: 17, column: 10, scope: !4) +// CHECK:STDOUT: !16 = !DILocation(line: 17, column: 3, scope: !4) From 08f24551ec63d31b5488f5db65a4ee5ee5f7903e Mon Sep 17 00:00:00 2001 From: Jon Ross-Perkins Date: Mon, 16 Dec 2024 16:58:54 -0800 Subject: [PATCH 38/68] Add bit packing to NodeImpl (#4651) Just a small packing optimization. We currently have 222 `NodeKinds`, so this reduces us to just 30ish more we can add without needing to pack more. However, if we did, there would be a couple options for bringing the count down by reusing `NodeKinds` and disambiguating based on the token kind (the 29 infix operators as an example). Or we could just undo this. I'm expecting this to yield a small improvement. I'll see if I can get better numbers since my machine's not really reliable, but here are some basic values. Also suggesting to draw the use of `::RawEnumType` for `TokenKind`, since bit packing appears to work without it. Hoping the `static_assert` is easier for people to understand the size of the field. With the change: ``` ---------------------------------------------------------------------------------------------------------------------------- Benchmark Time CPU Iterations Bytes Lines Tokens ---------------------------------------------------------------------------------------------------------------------------- BM_CompileAPIFileDenseDecls/256 50399 ns 50359 ns 14336 104.588M/s 3.87217M/s 21.8629M/s BM_CompileAPIFileDenseDecls/1024 237823 ns 237629 ns 3072 136.721M/s 4.11986M/s 24.2058M/s BM_CompileAPIFileDenseDecls/4096 997645 ns 996771 ns 768 142.343M/s 4.04105M/s 23.9363M/s BM_CompileAPIFileDenseDecls/16384 4020308 ns 4018319 ns 192 152.041M/s 4.05966M/s 24.0874M/s BM_CompileAPIFileDenseDecls/65536 16691390 ns 16683058 ns 48 151.317M/s 3.92374M/s 23.2936M/s BM_CompileAPIFileDenseDecls/262144 75265735 ns 75233476 ns 8 135.842M/s 3.48421M/s 20.6862M/s ``` Without the change: ``` ---------------------------------------------------------------------------------------------------------------------------- Benchmark Time CPU Iterations Bytes Lines Tokens ---------------------------------------------------------------------------------------------------------------------------- BM_CompileAPIFileDenseDecls/256 51515 ns 51480 ns 13312 102.312M/s 3.78789M/s 21.387M/s BM_CompileAPIFileDenseDecls/1024 241040 ns 240900 ns 3072 134.865M/s 4.06392M/s 23.8771M/s BM_CompileAPIFileDenseDecls/4096 985593 ns 984657 ns 768 144.094M/s 4.09077M/s 24.2308M/s BM_CompileAPIFileDenseDecls/16384 4109327 ns 4105496 ns 192 148.813M/s 3.97345M/s 23.576M/s BM_CompileAPIFileDenseDecls/65536 17459655 ns 17446006 ns 48 144.7M/s 3.75215M/s 22.275M/s BM_CompileAPIFileDenseDecls/262144 80802815 ns 80737489 ns 8 126.581M/s 3.24668M/s 19.276M/s ``` --------- Co-authored-by: Chandler Carruth --- toolchain/lex/lex.cpp | 5 ++-- toolchain/lex/token_index.h | 6 +++++ toolchain/lex/tokenized_buffer.h | 16 +++++------- toolchain/lex/tokenized_buffer_test.cpp | 6 ++--- toolchain/parse/context.cpp | 4 +-- toolchain/parse/context.h | 3 +-- toolchain/parse/tree.cpp | 2 +- toolchain/parse/tree.h | 34 +++++++++++++++++-------- 8 files changed, 44 insertions(+), 32 deletions(-) diff --git a/toolchain/lex/lex.cpp b/toolchain/lex/lex.cpp index 8cfbb3c2eea4e..390619fdab787 100644 --- a/toolchain/lex/lex.cpp +++ b/toolchain/lex/lex.cpp @@ -1396,13 +1396,12 @@ auto Lexer::Finalize() -> void { // many identifiers to fit an `IdentifierId` into a `token_payload_`, and // likewise for `IntId` and so on. If we start adding any of those IDs prior // to lexing, we may need to also limit the number of those IDs here. - if (buffer_.token_infos_.size() > TokenizedBuffer::MaxTokens) { + if (buffer_.token_infos_.size() > TokenIndex::Max) { CARBON_DIAGNOSTIC(TooManyTokens, Error, "too many tokens in source file; try splitting into " "multiple source files"); // Subtract one to leave room for the `FileEnd` token. - token_emitter_.Emit(TokenIndex(TokenizedBuffer::MaxTokens - 1), - TooManyTokens); + token_emitter_.Emit(TokenIndex(TokenIndex::Max - 1), TooManyTokens); // TODO: Convert tokens after the token limit to error tokens to avoid // misinterpretation by consumers of the tokenized buffer. } diff --git a/toolchain/lex/token_index.h b/toolchain/lex/token_index.h index e6e20ebd5eb2a..259e01906ab0a 100644 --- a/toolchain/lex/token_index.h +++ b/toolchain/lex/token_index.h @@ -24,6 +24,12 @@ namespace Carbon::Lex { // // All other APIs to query a `TokenIndex` are on the `TokenizedBuffer`. struct TokenIndex : public IndexBase { + // The number of bits which must be allotted for `TokenIndex`. + static constexpr int Bits = 23; + // The maximum number of tokens that can be stored, including the FileStart + // and FileEnd tokens. + static constexpr int Max = 1 << Bits; + static constexpr llvm::StringLiteral Label = "token"; static const TokenIndex Invalid; // Comments aren't tokenized, so this is the first token after FileStart. diff --git a/toolchain/lex/tokenized_buffer.h b/toolchain/lex/tokenized_buffer.h index 748e65f51e810..0a9f5b542aae9 100644 --- a/toolchain/lex/tokenized_buffer.h +++ b/toolchain/lex/tokenized_buffer.h @@ -85,10 +85,6 @@ class TokenDiagnosticConverter : public DiagnosticConverter { // `HasError` returning true. class TokenizedBuffer : public Printable { public: - // The maximum number of tokens that can be stored in the buffer, including - // the FileStart and FileEnd tokens. - static constexpr int MaxTokens = 1 << 23; - // A comment, which can be a block of lines. // // This is the API version of `CommentData`. @@ -281,7 +277,7 @@ class TokenizedBuffer : public Printable { class TokenInfo { public: // The kind for this token. - auto kind() const -> TokenKind { return TokenKind::Make(kind_); } + auto kind() const -> TokenKind { return kind_; } // Whether this token is preceded by whitespace. We only store the preceding // state, and look at the next token to check for trailing whitespace. @@ -364,6 +360,7 @@ class TokenizedBuffer : public Printable { // Make sure we have enough payload bits to represent token-associated IDs. static_assert(PayloadBits >= IntId::TokenIdBits); + static_assert(PayloadBits >= TokenIndex::Bits); // Constructor for a TokenKind that carries no payload, or where the payload // will be set later. @@ -397,13 +394,12 @@ class TokenizedBuffer : public Printable { // Payload values are typically ID types for which we create at most one per // token, so we ensure that `token_payload_` is large enough to fit any // token index. Stores to this field may overflow, but we produce an error - // in `Lexer::Finalize` if the file has more than `MaxTokens` tokens, so - // this value never overflows if lexing succeeds. - TokenKind::RawEnumType kind_ : sizeof(TokenKind) * 8; + // in `Lexer::Finalize` if the file has more than `TokenIndex::Max` tokens, + // so this value never overflows if lexing succeeds. + TokenKind kind_; + static_assert(sizeof(kind_) == 1, "TokenKind must pack to 8 bits"); bool has_leading_space_ : 1; unsigned token_payload_ : PayloadBits; - static_assert(MaxTokens <= 1 << PayloadBits, - "Not enough payload bits to store a token index"); // Separate storage for the byte offset, this is hot while lexing but then // generally cold. diff --git a/toolchain/lex/tokenized_buffer_test.cpp b/toolchain/lex/tokenized_buffer_test.cpp index 68be49380afbc..ad8265a2b6fa9 100644 --- a/toolchain/lex/tokenized_buffer_test.cpp +++ b/toolchain/lex/tokenized_buffer_test.cpp @@ -1160,9 +1160,9 @@ TEST_F(LexerTest, DiagnosticFileTooLarge) { input += "{}\n"; } EXPECT_CALL(consumer, - HandleDiagnostic(IsSingleDiagnostic( - DiagnosticKind::TooManyTokens, DiagnosticLevel::Error, - TokenizedBuffer::MaxTokens / 2, 1, _))); + HandleDiagnostic(IsSingleDiagnostic(DiagnosticKind::TooManyTokens, + DiagnosticLevel::Error, + TokenIndex::Max / 2, 1, _))); compile_helper_.GetTokenizedBuffer(input, &consumer); } diff --git a/toolchain/parse/context.cpp b/toolchain/parse/context.cpp index fd0b6384cb2a3..92fa9cea184ef 100644 --- a/toolchain/parse/context.cpp +++ b/toolchain/parse/context.cpp @@ -45,8 +45,8 @@ auto Context::ReplacePlaceholderNode(int32_t position, NodeKind kind, CARBON_CHECK(position >= 0 && position < tree_->size(), "position: {0} size: {1}", position, tree_->size()); auto* node_impl = &tree_->node_impls_[position]; - CARBON_CHECK(node_impl->kind == NodeKind::Placeholder); - *node_impl = {.kind = kind, .has_error = has_error, .token = token}; + CARBON_CHECK(node_impl->kind() == NodeKind::Placeholder); + *node_impl = Tree::NodeImpl(kind, has_error, token); } auto Context::ConsumeAndAddOpenParen(Lex::TokenIndex default_token, diff --git a/toolchain/parse/context.h b/toolchain/parse/context.h index edd9a071fe878..2d238b4ce2b91 100644 --- a/toolchain/parse/context.h +++ b/toolchain/parse/context.h @@ -107,8 +107,7 @@ class Context { kind != NodeKind::InvalidParseStart && kind != NodeKind::InvalidParseSubtree), "{0} nodes must always have an error", kind); - tree_->node_impls_.push_back( - {.kind = kind, .has_error = has_error, .token = token}); + tree_->node_impls_.push_back(Tree::NodeImpl(kind, has_error, token)); } // Adds an invalid parse node. diff --git a/toolchain/parse/tree.cpp b/toolchain/parse/tree.cpp index 7747d01e83d4a..acc031db76385 100644 --- a/toolchain/parse/tree.cpp +++ b/toolchain/parse/tree.cpp @@ -23,7 +23,7 @@ auto Tree::postorder() const -> llvm::iterator_range { auto Tree::node_token(NodeId n) const -> Lex::TokenIndex { CARBON_CHECK(n.is_valid()); - return node_impls_[n.index].token; + return node_impls_[n.index].token(); } auto Tree::Print(llvm::raw_ostream& output) const -> void { diff --git a/toolchain/parse/tree.h b/toolchain/parse/tree.h index 7cbdb25e3afa9..f3b73b111c230 100644 --- a/toolchain/parse/tree.h +++ b/toolchain/parse/tree.h @@ -120,13 +120,13 @@ class Tree : public Printable { // full expected structure of the grammar. auto node_has_error(NodeId n) const -> bool { CARBON_DCHECK(n.is_valid()); - return node_impls_[n.index].has_error; + return node_impls_[n.index].has_error(); } // Returns the kind of the given parse tree node. auto node_kind(NodeId n) const -> NodeKind { CARBON_DCHECK(n.is_valid()); - return node_impls_[n.index].kind; + return node_impls_[n.index].kind(); } // Returns the token the given parse tree node models. @@ -201,12 +201,24 @@ class Tree : public Printable { // The in-memory representation of data used for a particular node in the // tree. - struct NodeImpl { - // The kind of this node. Note that this is only a single byte. - NodeKind kind; + class NodeImpl { + public: + explicit NodeImpl(NodeKind kind, bool has_error, Lex::TokenIndex token) + : kind_(kind), has_error_(has_error), token_index_(token.index) { + CARBON_DCHECK(token.index >= 0, "Unexpected token for node: {0}", token); + } - // We have 3 bytes of padding here that we can pack flags or other compact - // data into. + auto kind() const -> NodeKind { return kind_; } + auto set_kind(NodeKind kind) -> void { kind_ = kind; } + auto has_error() const -> bool { return has_error_; } + auto token() const -> Lex::TokenIndex { + return Lex::TokenIndex(token_index_); + } + + private: + // The kind of this node. Note that this is only a single byte. + NodeKind kind_; + static_assert(sizeof(kind_) == 1, "TokenKind must pack to 8 bits"); // Whether this node is or contains a parse error. // @@ -221,20 +233,20 @@ class Tree : public Printable { // optional (and will depend on the particular parse implementation // strategy). The goal is that you can rely on grammar-based structural // invariants *until* you encounter a node with this set. - bool has_error; + bool has_error_ : 1; // The token root of this node. - Lex::TokenIndex token; + unsigned token_index_ : Lex::TokenIndex::Bits; }; - static_assert(sizeof(NodeImpl) == 8, + static_assert(sizeof(NodeImpl) == 4, "Unexpected size of node implementation!"); // Sets the kind of a node. This is intended to allow putting the tree into a // state where verification can fail, in order to make the failure path of // `Verify` testable. auto SetNodeKindForTesting(NodeId node_id, NodeKind kind) -> void { - node_impls_[node_id.index].kind = kind; + node_impls_[node_id.index].set_kind(kind); } // Depth-first postorder sequence of node implementation data. From c832d523beb0f98a6a33e82f62927300ec7f85af Mon Sep 17 00:00:00 2001 From: Jon Ross-Perkins Date: Mon, 16 Dec 2024 17:25:53 -0800 Subject: [PATCH 39/68] Update files and clang-tidy config to pass with clang-tidy-20 (#4691) Disables three new warnings because they lean more towards style conflicts than fixes. I've brought these up on #style. Other than that, mostly fixing basic issues, and things that clang-tidy-20 seems to fire where clang-tiday-16 didn't. One particular curious case is `llvm::StringLiteral::data()` uses, which are flagged as not strictly null-terminated; I'm switching to `const char*` in those spots which matches `llvm::formatv`'s format argument, but feels worse. I'm removing `run_clang_tidy.py` here because I'm observing it give fewer warnings than `bazel build --config=clang-tidy -k //toolchain/...`. The latter matches how we enforce in GitHub actions (and also caches results, and suppresses output for files that have no issues), so I'm dropping the bespoke script. --- .clang-tidy | 3 + common/hashing.h | 1 + common/indirect_value_test.cpp | 1 + ...raw_hashtable_metadata_group_benchmark.cpp | 1 + scripts/run_clang_tidy.py | 61 ------------------- testing/base/source_gen.h | 2 +- testing/file_test/autoupdate.h | 4 +- testing/file_test/file_test_base.cpp | 6 +- testing/file_test/line.h | 4 +- toolchain/check/param_and_arg_refs_stack.h | 2 +- toolchain/check/pattern_match.cpp | 2 +- toolchain/driver/compile_benchmark.cpp | 2 +- toolchain/language_server/server.cpp | 6 +- toolchain/lex/lex.cpp | 1 + toolchain/lex/tokenized_buffer_benchmark.cpp | 2 + toolchain/lex/tokenized_buffer_test.cpp | 8 ++- toolchain/parse/extract.cpp | 8 ++- toolchain/parse/handle_import_and_package.cpp | 4 +- toolchain/sem_ir/function.h | 2 +- toolchain/sem_ir/name_scope.h | 2 +- toolchain/sem_ir/singleton_insts.h | 12 ++-- toolchain/testing/coverage_helper.h | 8 ++- toolchain/testing/file_test.cpp | 2 +- 23 files changed, 51 insertions(+), 93 deletions(-) delete mode 100755 scripts/run_clang_tidy.py diff --git a/.clang-tidy b/.clang-tidy index fec217e3af72d..58eac2144fbf9 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -29,12 +29,15 @@ Checks: # Disabled due to the implied style choices. - '-modernize-return-braced-init-list' - '-modernize-use-default-member-init' + - '-modernize-use-integer-sign-comparison' - '-modernize-use-emplace' + - '-readability-avoid-nested-conditional-operator' - '-readability-convert-member-functions-to-static' - '-readability-else-after-return' - '-readability-identifier-length' - '-readability-implicit-bool-conversion' - '-readability-make-member-function-const' + - '-readability-math-missing-parentheses' - '-readability-static-definition-in-anonymous-namespace' - '-readability-use-anyofallof' diff --git a/common/hashing.h b/common/hashing.h index ed4808147b45f..c101a68e651c3 100644 --- a/common/hashing.h +++ b/common/hashing.h @@ -591,6 +591,7 @@ inline auto MapToRawDataType(const T& value) -> const T& { // This overload should never be selected for `std::nullptr_t`, so // static_assert to get some better compiler error messages. static_assert(!std::same_as); + // NOLINTNEXTLINE(bugprone-return-const-ref-from-parameter) return value; } inline auto MapToRawDataType(std::nullptr_t /*value*/) -> const void* { diff --git a/common/indirect_value_test.cpp b/common/indirect_value_test.cpp index d9a538b8d4d48..e48121fa7db60 100644 --- a/common/indirect_value_test.cpp +++ b/common/indirect_value_test.cpp @@ -85,6 +85,7 @@ TEST(IndirectValueTest, MutableArrow) { TEST(IndirectValueTest, CopyConstruct) { IndirectValue v1; + // NOLINTNEXTLINE(performance-unnecessary-copy-initialization) auto v2 = v1; EXPECT_EQ(v1->state, "default constructed"); EXPECT_EQ(v2->state, "copy constructed"); diff --git a/common/raw_hashtable_metadata_group_benchmark.cpp b/common/raw_hashtable_metadata_group_benchmark.cpp index b1fa2326dd5fc..c51a6eb359c41 100644 --- a/common/raw_hashtable_metadata_group_benchmark.cpp +++ b/common/raw_hashtable_metadata_group_benchmark.cpp @@ -189,6 +189,7 @@ const auto bench_metadata = BuildBenchMetadata(); // group. template static void BM_LoadMatch(benchmark::State& s) { + // NOLINTNEXTLINE(google-readability-casting): Same as on `bench_metadata`. BenchMetadata bm = bench_metadata[0]; // We want to make the index used by the next iteration of the benchmark have diff --git a/scripts/run_clang_tidy.py b/scripts/run_clang_tidy.py deleted file mode 100755 index e4e1d0bce8d4c..0000000000000 --- a/scripts/run_clang_tidy.py +++ /dev/null @@ -1,61 +0,0 @@ -#!/usr/bin/env python3 - -"""Runs clang-tidy over all Carbon files.""" - -__copyright__ = """ -Part of the Carbon Language project, under the Apache License v2.0 with LLVM -Exceptions. See /LICENSE for license information. -SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -""" - -import argparse -import os -import re -import subprocess - -from pathlib import Path - - -def main() -> None: - parser = argparse.ArgumentParser(__doc__) - # Copied from run-clang-tidy.py for forwarding. - parser.add_argument("-fix", action="store_true", help="Apply fix-its") - # Local flags. - parser.add_argument("files", nargs="*", help="Files to fix") - parsed_args = parser.parse_args() - - # If files are passed in, resolve them; otherwise, add a path filter. - if parsed_args.files: - files = [str(Path(f).resolve()) for f in parsed_args.files] - else: - files = ["^(?!.*/(bazel-|third_party)).*$"] - - # Set the repo root as the working directory. - os.chdir(Path(__file__).parents[1]) - # Ensure create_compdb has been run. - subprocess.check_call(["./scripts/create_compdb.py"]) - - # Use the run-clang-tidy version that should be with the rest of the clang - # toolchain. This exposes us to version skew with user-installed clang - # versions, but avoids version skew between the script and clang-tidy - # itself. - with Path( - "./external/_main~clang_toolchain_extension~bazel_cc_toolchain/" - "clang_detected_variables.bzl" - ).open() as f: - clang_vars = f.read() - clang_bindir_match = re.search(r"clang_bindir = \"(.*)\"", clang_vars) - assert clang_bindir_match is not None, clang_vars - - args = [str(Path(clang_bindir_match[1]).joinpath("run-clang-tidy"))] - - # Forward flags. - if parsed_args.fix: - args.append("-fix") - - # Run clang-tidy from clang-tools-extra. - exit(subprocess.call(args + files)) - - -if __name__ == "__main__": - main() diff --git a/testing/base/source_gen.h b/testing/base/source_gen.h index 6b1ef07072ca4..ccd48693ff169 100644 --- a/testing/base/source_gen.h +++ b/testing/base/source_gen.h @@ -54,7 +54,7 @@ namespace Carbon::Testing { // identifiers that should be generalized. class SourceGen { public: - enum class Language { + enum class Language : uint8_t { Carbon, Cpp, }; diff --git a/testing/file_test/autoupdate.h b/testing/file_test/autoupdate.h index cc206e48739a5..6b20581f58e0a 100644 --- a/testing/file_test/autoupdate.h +++ b/testing/file_test/autoupdate.h @@ -105,7 +105,9 @@ class FileTestAutoupdater { }; // A CHECK line which is integrated into autoupdate output. - class CheckLine : public FileTestLineBase { + // + // `final` because we use pointer arithmetic on this type. + class CheckLine final : public FileTestLineBase { public: // RE2 is passed by a pointer because it doesn't support std::optional. explicit CheckLine(FileAndLineNumber file_and_line_number, std::string line) diff --git a/testing/file_test/file_test_base.cpp b/testing/file_test/file_test_base.cpp index c32ec573d899a..ef34bd1c7cbe2 100644 --- a/testing/file_test/file_test_base.cpp +++ b/testing/file_test/file_test_base.cpp @@ -99,7 +99,7 @@ static auto CompareFailPrefix(llvm::StringRef filename, bool success) -> void { } // Modes for GetBazelCommand. -enum class BazelMode { +enum class BazelMode : uint8_t { Autoupdate, Dump, Test, @@ -1081,9 +1081,9 @@ static auto Main(int argc, char** argv) -> int { llvm::errs() << "\nDone!\n"; return EXIT_SUCCESS; } else { - for (llvm::StringRef test_name : tests) { + for (const std::string& test_name : tests) { testing::RegisterTest( - test_factory.name, test_name.data(), nullptr, test_name.data(), + test_factory.name, test_name.c_str(), nullptr, test_name.c_str(), __FILE__, __LINE__, [&test_factory, &exe_path, test_name = test_name]() { return test_factory.factory_fn(exe_path, nullptr, test_name); diff --git a/testing/file_test/line.h b/testing/file_test/line.h index 6ceb45c25b80d..33c78127433e0 100644 --- a/testing/file_test/line.h +++ b/testing/file_test/line.h @@ -31,7 +31,9 @@ class FileTestLineBase : public Printable { }; // A line in the original file test. -class FileTestLine : public FileTestLineBase { +// +// `final` because we use pointer arithmetic on this type. +class FileTestLine final : public FileTestLineBase { public: explicit FileTestLine(int file_number, int line_number, llvm::StringRef line) : FileTestLineBase(file_number, line_number), line_(line) {} diff --git a/toolchain/check/param_and_arg_refs_stack.h b/toolchain/check/param_and_arg_refs_stack.h index 44b28e931d41f..41f631482af82 100644 --- a/toolchain/check/param_and_arg_refs_stack.h +++ b/toolchain/check/param_and_arg_refs_stack.h @@ -73,7 +73,7 @@ class ParamAndArgRefsStack { // Prints the stack for a stack dump. auto PrintForStackDump(int indent, llvm::raw_ostream& output) const -> void { - return stack_.PrintForStackDump(indent, output); + stack_.PrintForStackDump(indent, output); } private: diff --git a/toolchain/check/pattern_match.cpp b/toolchain/check/pattern_match.cpp index b9afe7348bb3e..b2b1943a488b2 100644 --- a/toolchain/check/pattern_match.cpp +++ b/toolchain/check/pattern_match.cpp @@ -35,7 +35,7 @@ static auto GetPrettyName(Context& context, ParamPattern param_pattern) namespace { // Selects between the different kinds of pattern matching. -enum class MatchKind { +enum class MatchKind : uint8_t { // Caller pattern matching occurs on the caller side of a function call, and // is responsible for matching the argument expression against the portion // of the pattern above the ParamPattern insts. diff --git a/toolchain/driver/compile_benchmark.cpp b/toolchain/driver/compile_benchmark.cpp index f31ea9c367902..703ff6b73d347 100644 --- a/toolchain/driver/compile_benchmark.cpp +++ b/toolchain/driver/compile_benchmark.cpp @@ -54,7 +54,7 @@ class CompileBenchmark { }; // An enumerator used to select compilation phases to benchmark. -enum class Phase { +enum class Phase : uint8_t { Lex, Parse, Check, diff --git a/toolchain/language_server/server.cpp b/toolchain/language_server/server.cpp index 7847f317e407d..b2553992c2266 100644 --- a/toolchain/language_server/server.cpp +++ b/toolchain/language_server/server.cpp @@ -30,13 +30,13 @@ Server::Server(std::FILE* input_stream, llvm::raw_ostream& output_stream) auto Server::Run() -> ErrorOr { llvm::Error err = transport_->loop(*this); - if (err.success()) { - return Success(); - } else { + if (err) { std::string str; llvm::raw_string_ostream out(str); out << err; return Error(str); + } else { + return Success(); } } diff --git a/toolchain/lex/lex.cpp b/toolchain/lex/lex.cpp index 390619fdab787..e1877ad992a70 100644 --- a/toolchain/lex/lex.cpp +++ b/toolchain/lex/lex.cpp @@ -660,6 +660,7 @@ static auto DispatchNext(Lexer& lexer, llvm::StringRef source_text, // that because this is a must-tail return, this cannot fail to tail-call // and will not grow the stack. This is in essence a loop with dynamic // tail dispatch to the next stage of the loop. + // NOLINTNEXTLINE(readability-avoid-return-with-void-value): For musttail. [[clang::musttail]] return DispatchTable[static_cast( source_text[position])](lexer, source_text, position); } diff --git a/toolchain/lex/tokenized_buffer_benchmark.cpp b/toolchain/lex/tokenized_buffer_benchmark.cpp index 5c91ab4e20456..129a54b060cd3 100644 --- a/toolchain/lex/tokenized_buffer_benchmark.cpp +++ b/toolchain/lex/tokenized_buffer_benchmark.cpp @@ -610,6 +610,7 @@ template auto BasicDispatch(ssize_t& index, const char* text, char* buffer) -> void { *buffer = text[index]; ++index; + // NOLINTNEXTLINE(readability-avoid-return-with-void-value): For musttail. [[clang::musttail]] return Table[static_cast(text[index])]( index, text, buffer); } @@ -620,6 +621,7 @@ auto SpecializedDispatch(ssize_t& index, const char* text, char* buffer) CARBON_CHECK(C == text[index]); *buffer = C; ++index; + // NOLINTNEXTLINE(readability-avoid-return-with-void-value): For musttail. [[clang::musttail]] return Table[static_cast(text[index])]( index, text, buffer); } diff --git a/toolchain/lex/tokenized_buffer_test.cpp b/toolchain/lex/tokenized_buffer_test.cpp index ad8265a2b6fa9..fb642bd240136 100644 --- a/toolchain/lex/tokenized_buffer_test.cpp +++ b/toolchain/lex/tokenized_buffer_test.cpp @@ -1215,14 +1215,16 @@ TEST_F(LexerTest, IndentedComments) { std::string simd_source = source + "\"Add a bunch of padding so that SIMD logic shouldn't hit EOF\""; - auto& simd_buffer = compile_helper_.GetTokenizedBuffer(source); + auto& simd_buffer = compile_helper_.GetTokenizedBuffer(simd_source); ASSERT_FALSE(simd_buffer.has_errors()); EXPECT_THAT(simd_buffer.comments_size(), Eq(1)); } } TEST_F(LexerTest, MultipleComments) { - constexpr llvm::StringLiteral Format = R"( + // TODO: Switch format to `llvm::StringLiteral` if + // `llvm::StringLiteral::c_str` is added. + constexpr char Format[] = R"( {0} {1} @@ -1252,7 +1254,7 @@ x "//\n" "// Valid\n", "// This uses a high indent, which stops SIMD.\n", "//\n"}; - std::string source = llvm::formatv(Format.data(), Comments[0], Comments[1], + std::string source = llvm::formatv(Format, Comments[0], Comments[1], Comments[2], Comments[3], Comments[4]) .str(); diff --git a/toolchain/parse/extract.cpp b/toolchain/parse/extract.cpp index ae4b87d0161dd..686dd2cd1bc6f 100644 --- a/toolchain/parse/extract.cpp +++ b/toolchain/parse/extract.cpp @@ -76,11 +76,13 @@ class NodeExtractor { std::tuple* /*type*/) -> std::optional; // Split out trace logic. The noinline saves a few seconds on compilation. + // TODO: Switch format to `llvm::StringLiteral` if + // `llvm::StringLiteral::c_str` is added. template - [[clang::noinline]] auto MaybeTrace(llvm::StringLiteral format, - ArgT... args) const -> void { + [[clang::noinline]] auto MaybeTrace(const char* format, ArgT... args) const + -> void { if (trace_) { - *trace_ << llvm::formatv(format.data(), args...); + *trace_ << llvm::formatv(format, args...); } } diff --git a/toolchain/parse/handle_import_and_package.cpp b/toolchain/parse/handle_import_and_package.cpp index f926ca6d1443e..a0e26e97ac7d1 100644 --- a/toolchain/parse/handle_import_and_package.cpp +++ b/toolchain/parse/handle_import_and_package.cpp @@ -15,8 +15,8 @@ namespace Carbon::Parse { // Provides common error exiting logic that skips to the semi, if present. static auto OnParseError(Context& context, Context::StateStackEntry state, NodeKind declaration) -> void { - return context.AddNode(declaration, context.SkipPastLikelyEnd(state.token), - /*has_error=*/true); + context.AddNode(declaration, context.SkipPastLikelyEnd(state.token), + /*has_error=*/true); } // Determines whether the specified modifier appears within the introducer of diff --git a/toolchain/sem_ir/function.h b/toolchain/sem_ir/function.h index 46eec6cc20a10..12c8e519d5e98 100644 --- a/toolchain/sem_ir/function.h +++ b/toolchain/sem_ir/function.h @@ -15,7 +15,7 @@ namespace Carbon::SemIR { // Function-specific fields. struct FunctionFields { // Kinds of virtual modifiers that can apply to functions. - enum class VirtualModifier { None, Virtual, Abstract, Impl }; + enum class VirtualModifier : uint8_t { None, Virtual, Abstract, Impl }; // The following members always have values, and do not change throughout the // lifetime of the function. diff --git a/toolchain/sem_ir/name_scope.h b/toolchain/sem_ir/name_scope.h index c9fa8b1f5208a..0de02513db5aa 100644 --- a/toolchain/sem_ir/name_scope.h +++ b/toolchain/sem_ir/name_scope.h @@ -107,7 +107,7 @@ class NameScope : public Printable { auto AddImportIRScope( const std::pair& import_ir_scope) -> void { - return import_ir_scopes_.push_back(import_ir_scope); + import_ir_scopes_.push_back(import_ir_scope); } private: diff --git a/toolchain/sem_ir/singleton_insts.h b/toolchain/sem_ir/singleton_insts.h index 38693bd8a7baf..88af633a273fb 100644 --- a/toolchain/sem_ir/singleton_insts.h +++ b/toolchain/sem_ir/singleton_insts.h @@ -28,16 +28,16 @@ static constexpr std::array SingletonInstKinds = { }; // Returns true if the InstKind is a singleton. -inline constexpr auto IsSingletonInstKind(InstKind kind) -> bool; +constexpr auto IsSingletonInstKind(InstKind kind) -> bool; // Provides the InstId for singleton instructions. These are exposed as // `InstT::SingletonInstId` in `typed_insts.h`. template requires(IsSingletonInstKind(InstKind::Make(Kind))) -inline constexpr auto MakeSingletonInstId() -> InstId; +constexpr auto MakeSingletonInstId() -> InstId; // Returns true if the InstId corresponds to a singleton inst. -inline constexpr auto IsSingletonInstId(InstId id) -> bool { +constexpr auto IsSingletonInstId(InstId id) -> bool { return id.index >= 0 && id.index < static_cast(SingletonInstKinds.size()); } @@ -47,7 +47,7 @@ inline constexpr auto IsSingletonInstId(InstId id) -> bool { namespace Internal { // Returns the index for a singleton instruction, or -1 if it's not a singleton. -inline constexpr auto GetSingletonInstIndex(InstKind kind) -> int32_t { +constexpr auto GetSingletonInstIndex(InstKind kind) -> int32_t { for (int32_t i = 0; i < static_cast(SingletonInstKinds.size()); ++i) { if (SingletonInstKinds[i] == kind) { @@ -59,13 +59,13 @@ inline constexpr auto GetSingletonInstIndex(InstKind kind) -> int32_t { } // namespace Internal -inline constexpr auto IsSingletonInstKind(InstKind kind) -> bool { +constexpr auto IsSingletonInstKind(InstKind kind) -> bool { return Internal::GetSingletonInstIndex(kind) >= 0; } template requires(IsSingletonInstKind(InstKind::Make(Kind))) -inline constexpr auto MakeSingletonInstId() -> InstId { +constexpr auto MakeSingletonInstId() -> InstId { auto index = Internal::GetSingletonInstIndex(InstKind::Make(Kind)); return InstId(index); } diff --git a/toolchain/testing/coverage_helper.h b/toolchain/testing/coverage_helper.h index 135ddb72f7345..cca5bc6ef3101 100644 --- a/toolchain/testing/coverage_helper.h +++ b/toolchain/testing/coverage_helper.h @@ -21,15 +21,17 @@ namespace Carbon::Testing { // // should_be_covered should return false when a kind is either untestable or not // yet tested. +// +// TODO: Switch `kind_pattern` to `llvm::StringLiteral` if +// `llvm::StringLiteral::c_str` is added. template auto TestKindCoverage(const std::string& manifest_path, - llvm::StringLiteral kind_pattern, - llvm::ArrayRef kinds, + const char* kind_pattern, llvm::ArrayRef kinds, llvm::ArrayRef untested_kinds) { std::ifstream manifest_in(manifest_path.c_str()); ASSERT_TRUE(manifest_in.good()); - RE2 kind_re(kind_pattern.data()); + RE2 kind_re(kind_pattern); ASSERT_TRUE(kind_re.ok()) << kind_re.error(); Set covered_kinds; diff --git a/toolchain/testing/file_test.cpp b/toolchain/testing/file_test.cpp index 1983beeaa2245..eae4d78165ae8 100644 --- a/toolchain/testing/file_test.cpp +++ b/toolchain/testing/file_test.cpp @@ -130,7 +130,7 @@ class ToolchainFileTest : public FileTestBase { R"((FileEnd.*column: |FileStart.*line: )( *\d+))"); RE2::Replace(&check_line, file_token_re, R"(\1{{ *\\d+}})"); } else { - return FileTestBase::DoExtraCheckReplacements(check_line); + FileTestBase::DoExtraCheckReplacements(check_line); } } From 62f7345bb7c780bc9a68199e8f19dac1cb52da34 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Tue, 17 Dec 2024 00:26:18 -0800 Subject: [PATCH 40/68] Import support for `Call` and `BoundMethod`. (#4695) --- toolchain/check/import_ref.cpp | 41 + .../no_prelude/import_builtin_call.carbon | 1163 +++++++++++++++++ 2 files changed, 1204 insertions(+) create mode 100644 toolchain/check/testdata/impl/no_prelude/import_builtin_call.carbon diff --git a/toolchain/check/import_ref.cpp b/toolchain/check/import_ref.cpp index fbc0cf0dcdf17..a4d51fd8d4c75 100644 --- a/toolchain/check/import_ref.cpp +++ b/toolchain/check/import_ref.cpp @@ -1429,6 +1429,41 @@ static auto TryResolveTypedInst(ImportRefResolver& resolver, .entity_name_id = entity_name_id}); } +static auto TryResolveTypedInst(ImportRefResolver& resolver, + SemIR::BoundMethod inst) -> ResolveResult { + CARBON_CHECK(resolver.import_types().GetInstId(inst.type_id) == + SemIR::BoundMethodType::SingletonInstId); + auto object_id = GetLocalConstantInstId(resolver, inst.object_id); + auto function_id = GetLocalConstantInstId(resolver, inst.function_id); + + if (resolver.HasNewWork()) { + return ResolveResult::Retry(); + } + + return ResolveAs( + resolver, {.type_id = resolver.local_context().GetSingletonType( + SemIR::BoundMethodType::SingletonInstId), + .object_id = object_id, + .function_id = function_id}); +} + +static auto TryResolveTypedInst(ImportRefResolver& resolver, SemIR::Call inst) + -> ResolveResult { + auto type_id = GetLocalConstantId(resolver, inst.type_id); + auto callee_id = GetLocalConstantInstId(resolver, inst.callee_id); + auto args = GetLocalInstBlockContents(resolver, inst.args_id); + + if (resolver.HasNewWork()) { + return ResolveResult::Retry(); + } + + return ResolveAs( + resolver, + {.type_id = resolver.local_context().GetTypeIdForTypeConstant(type_id), + .callee_id = callee_id, + .args_id = GetLocalCanonicalInstBlockId(resolver, inst.args_id, args)}); +} + // Makes an incomplete class. This is necessary even with classes with a // complete declaration, because things such as `Self` may refer back to the // type. @@ -2525,6 +2560,12 @@ static auto TryResolveInstCanonical(ImportRefResolver& resolver, case CARBON_KIND(SemIR::BindSymbolicName inst): { return TryResolveTypedInst(resolver, inst); } + case CARBON_KIND(SemIR::BoundMethod inst): { + return TryResolveTypedInst(resolver, inst); + } + case CARBON_KIND(SemIR::Call inst): { + return TryResolveTypedInst(resolver, inst); + } case CARBON_KIND(SemIR::ClassDecl inst): { return TryResolveTypedInst(resolver, inst, const_id); } diff --git a/toolchain/check/testdata/impl/no_prelude/import_builtin_call.carbon b/toolchain/check/testdata/impl/no_prelude/import_builtin_call.carbon new file mode 100644 index 0000000000000..a657a7ac3a743 --- /dev/null +++ b/toolchain/check/testdata/impl/no_prelude/import_builtin_call.carbon @@ -0,0 +1,1163 @@ +// Part of the Carbon Language project, under the Apache License v2.0 with LLVM +// Exceptions. See /LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// AUTOUPDATE +// TIP: To test this file alone, run: +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/impl/no_prelude/import_builtin_call.carbon +// TIP: To dump output, run: +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/impl/no_prelude/import_builtin_call.carbon + +// --- generic_impl.carbon + +library "[[@TEST_NAME]]"; + +interface Add { + fn Op[self: Self](other: Self) -> Self; +} + +fn IntLiteral() -> type = "int_literal.make_type"; +fn Int(n: IntLiteral()) -> type = "int.make_type_signed"; + +class MyInt(N:! IntLiteral()) { + adapt Int(N); +} + +impl forall [N:! IntLiteral()] MyInt(N) as Add { + fn Op[self: Self](other: Self) -> Self = "int.sadd"; +} + +fn Double[N:! IntLiteral()](x: MyInt(N)) -> MyInt(N) { + return x.(Add.Op)(x); +} + +// --- use_generic_impl.carbon + +library "[[@TEST_NAME]]"; + +import library "generic_impl"; + +// TODO: The call below crashes if this one is not present because the generics +// get imported in a bad order. +fn LocalDouble(x: MyInt(64)) -> MyInt(64) { + return x.(Add.Op)(x); +} + +fn CallImportedDouble(n: MyInt(64)) -> MyInt(64) { + return Double(n); +} + +// --- convert_symbolic.carbon + +library "[[@TEST_NAME]]"; + +fn IntLiteral() -> type = "int_literal.make_type"; +fn Int(n: IntLiteral()) -> type = "int.make_type_signed"; +fn ToLiteral(n: Int(32)) -> IntLiteral() = "int.convert_checked"; +fn FromLiteral(n: IntLiteral()) -> Int(32) = "int.convert_checked"; + +fn Make(N:! Int(32)) -> Int(ToLiteral(N)) { return Make(N); } + +class OtherInt { + adapt Int(32); + fn ToLiteral[self: Self]() -> IntLiteral(); +}; + +fn OtherInt.ToLiteral[self: Self]() -> IntLiteral() = "int.convert_checked"; + +fn MakeFromClass(N:! OtherInt) -> Int(N.ToLiteral()) { return MakeFromClass(N); } + +// --- use_convert_symbolic.carbon + +library "[[@TEST_NAME]]"; + +import library "convert_symbolic"; + +var m: Int(64) = Make(FromLiteral(64)); +var n: Int(64) = MakeFromClass(FromLiteral(64) as OtherInt); + +// CHECK:STDOUT: --- generic_impl.carbon +// CHECK:STDOUT: +// CHECK:STDOUT: constants { +// CHECK:STDOUT: %Add.type: type = facet_type <@Add> [template] +// CHECK:STDOUT: %Self: %Add.type = bind_symbolic_name Self, 0 [symbolic] +// CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic] +// CHECK:STDOUT: %Op.type.1: type = fn_type @Op.1 [template] +// CHECK:STDOUT: %Op.1: %Op.type.1 = struct_value () [template] +// CHECK:STDOUT: %Op.assoc_type: type = assoc_entity_type %Add.type, %Op.type.1 [template] +// CHECK:STDOUT: %assoc0: %Op.assoc_type = assoc_entity element0, @Add.%Op.decl [template] +// CHECK:STDOUT: %IntLiteral.type: type = fn_type @IntLiteral [template] +// CHECK:STDOUT: %IntLiteral: %IntLiteral.type = struct_value () [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic] +// CHECK:STDOUT: %MyInt.type: type = generic_class_type @MyInt [template] +// CHECK:STDOUT: %MyInt.generic: %MyInt.type = struct_value () [template] +// CHECK:STDOUT: %MyInt: type = class_type @MyInt, @MyInt(%N) [symbolic] +// CHECK:STDOUT: %iN.builtin: type = int_type signed, %N [symbolic] +// CHECK:STDOUT: %require_complete.1: = require_complete_type %iN.builtin [symbolic] +// CHECK:STDOUT: %complete_type: = complete_type_witness %iN.builtin [symbolic] +// CHECK:STDOUT: %Op.type.2: type = fn_type @Op.2, @impl(%N) [symbolic] +// CHECK:STDOUT: %Op.2: %Op.type.2 = struct_value () [symbolic] +// CHECK:STDOUT: %require_complete.2: = require_complete_type %MyInt [symbolic] +// CHECK:STDOUT: %Add.facet: %Add.type = facet_value %MyInt, %MyInt [symbolic] +// CHECK:STDOUT: %interface: = interface_witness (%Op.2) [symbolic] +// CHECK:STDOUT: %Double.type: type = fn_type @Double [template] +// CHECK:STDOUT: %Double: %Double.type = struct_value () [template] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Add = %Add.decl +// CHECK:STDOUT: .IntLiteral = %IntLiteral.decl +// CHECK:STDOUT: .Int = %Int.decl +// CHECK:STDOUT: .MyInt = %MyInt.decl +// CHECK:STDOUT: .Double = %Double.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Add.decl: type = interface_decl @Add [template = constants.%Add.type] {} {} +// CHECK:STDOUT: %IntLiteral.decl: %IntLiteral.type = fn_decl @IntLiteral [template = constants.%IntLiteral] { +// CHECK:STDOUT: %return.patt: type = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: type = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %return.param: ref type = out_param runtime_param0 +// CHECK:STDOUT: %return: ref type = return_slot %return.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Int.decl: %Int.type = fn_decl @Int [template = constants.%Int] { +// CHECK:STDOUT: %n.patt: Core.IntLiteral = binding_pattern n +// CHECK:STDOUT: %n.param_patt: Core.IntLiteral = value_param_pattern %n.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: type = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: type = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [template = constants.%IntLiteral] +// CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral] +// CHECK:STDOUT: %.loc9_22.1: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral] +// CHECK:STDOUT: %.loc9_22.2: type = converted %int_literal.make_type, %.loc9_22.1 [template = Core.IntLiteral] +// CHECK:STDOUT: %n.param: Core.IntLiteral = value_param runtime_param0 +// CHECK:STDOUT: %n: Core.IntLiteral = bind_name n, %n.param +// CHECK:STDOUT: %return.param: ref type = out_param runtime_param1 +// CHECK:STDOUT: %return: ref type = return_slot %return.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %MyInt.decl: %MyInt.type = class_decl @MyInt [template = constants.%MyInt.generic] { +// CHECK:STDOUT: %N.patt.loc11_13.1: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc11_13.2 (constants.%N.patt)] +// CHECK:STDOUT: %N.param_patt: Core.IntLiteral = value_param_pattern %N.patt.loc11_13.1, runtime_param [symbolic = %N.patt.loc11_13.2 (constants.%N.patt)] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [template = constants.%IntLiteral] +// CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral] +// CHECK:STDOUT: %.loc11_28.1: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral] +// CHECK:STDOUT: %.loc11_28.2: type = converted %int_literal.make_type, %.loc11_28.1 [template = Core.IntLiteral] +// CHECK:STDOUT: %N.param: Core.IntLiteral = value_param runtime_param +// CHECK:STDOUT: %N.loc11_13.1: Core.IntLiteral = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc11_13.2 (constants.%N)] +// CHECK:STDOUT: } +// CHECK:STDOUT: impl_decl @impl [template] { +// CHECK:STDOUT: %N.patt.loc15_14.1: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc15_14.2 (constants.%N.patt)] +// CHECK:STDOUT: %N.param_patt: Core.IntLiteral = value_param_pattern %N.patt.loc15_14.1, runtime_param [symbolic = %N.patt.loc15_14.2 (constants.%N.patt)] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [template = constants.%IntLiteral] +// CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral] +// CHECK:STDOUT: %.loc15_29.1: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral] +// CHECK:STDOUT: %.loc15_29.2: type = converted %int_literal.make_type, %.loc15_29.1 [template = Core.IntLiteral] +// CHECK:STDOUT: %MyInt.ref: %MyInt.type = name_ref MyInt, file.%MyInt.decl [template = constants.%MyInt.generic] +// CHECK:STDOUT: %N.ref: Core.IntLiteral = name_ref N, %N.loc15_14.1 [symbolic = %N.loc15_14.2 (constants.%N)] +// CHECK:STDOUT: %MyInt.loc15_39.1: type = class_type @MyInt, @MyInt(constants.%N) [symbolic = %MyInt.loc15_39.2 (constants.%MyInt)] +// CHECK:STDOUT: %Add.ref: type = name_ref Add, file.%Add.decl [template = constants.%Add.type] +// CHECK:STDOUT: %N.param: Core.IntLiteral = value_param runtime_param +// CHECK:STDOUT: %N.loc15_14.1: Core.IntLiteral = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc15_14.2 (constants.%N)] +// CHECK:STDOUT: } +// CHECK:STDOUT: %Double.decl: %Double.type = fn_decl @Double [template = constants.%Double] { +// CHECK:STDOUT: %N.patt.loc19_11.1: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc19_11.2 (constants.%N.patt)] +// CHECK:STDOUT: %N.param_patt: Core.IntLiteral = value_param_pattern %N.patt.loc19_11.1, runtime_param [symbolic = %N.patt.loc19_11.2 (constants.%N.patt)] +// CHECK:STDOUT: %x.patt: @Double.%MyInt.loc19_39.2 (%MyInt) = binding_pattern x +// CHECK:STDOUT: %x.param_patt: @Double.%MyInt.loc19_39.2 (%MyInt) = value_param_pattern %x.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: @Double.%MyInt.loc19_39.2 (%MyInt) = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: @Double.%MyInt.loc19_39.2 (%MyInt) = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [template = constants.%IntLiteral] +// CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral] +// CHECK:STDOUT: %.loc19_26.1: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral] +// CHECK:STDOUT: %.loc19_26.2: type = converted %int_literal.make_type, %.loc19_26.1 [template = Core.IntLiteral] +// CHECK:STDOUT: %MyInt.ref.loc19_32: %MyInt.type = name_ref MyInt, file.%MyInt.decl [template = constants.%MyInt.generic] +// CHECK:STDOUT: %N.ref.loc19_38: Core.IntLiteral = name_ref N, %N.loc19_11.1 [symbolic = %N.loc19_11.2 (constants.%N)] +// CHECK:STDOUT: %MyInt.loc19_39.1: type = class_type @MyInt, @MyInt(constants.%N) [symbolic = %MyInt.loc19_39.2 (constants.%MyInt)] +// CHECK:STDOUT: %MyInt.ref.loc19_45: %MyInt.type = name_ref MyInt, file.%MyInt.decl [template = constants.%MyInt.generic] +// CHECK:STDOUT: %N.ref.loc19_51: Core.IntLiteral = name_ref N, %N.loc19_11.1 [symbolic = %N.loc19_11.2 (constants.%N)] +// CHECK:STDOUT: %MyInt.loc19_52: type = class_type @MyInt, @MyInt(constants.%N) [symbolic = %MyInt.loc19_39.2 (constants.%MyInt)] +// CHECK:STDOUT: %N.param: Core.IntLiteral = value_param runtime_param +// CHECK:STDOUT: %N.loc19_11.1: Core.IntLiteral = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc19_11.2 (constants.%N)] +// CHECK:STDOUT: %x.param: @Double.%MyInt.loc19_39.2 (%MyInt) = value_param runtime_param0 +// CHECK:STDOUT: %x: @Double.%MyInt.loc19_39.2 (%MyInt) = bind_name x, %x.param +// CHECK:STDOUT: %return.param: ref @Double.%MyInt.loc19_39.2 (%MyInt) = out_param runtime_param1 +// CHECK:STDOUT: %return: ref @Double.%MyInt.loc19_39.2 (%MyInt) = return_slot %return.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: interface @Add { +// CHECK:STDOUT: %Self: %Add.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self] +// CHECK:STDOUT: %Op.decl: %Op.type.1 = fn_decl @Op.1 [template = constants.%Op.1] { +// CHECK:STDOUT: %self.patt: @Op.1.%Self.as_type.loc5_15.1 (%Self.as_type) = binding_pattern self +// CHECK:STDOUT: %self.param_patt: @Op.1.%Self.as_type.loc5_15.1 (%Self.as_type) = value_param_pattern %self.patt, runtime_param0 +// CHECK:STDOUT: %other.patt: @Op.1.%Self.as_type.loc5_15.1 (%Self.as_type) = binding_pattern other +// CHECK:STDOUT: %other.param_patt: @Op.1.%Self.as_type.loc5_15.1 (%Self.as_type) = value_param_pattern %other.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: @Op.1.%Self.as_type.loc5_15.1 (%Self.as_type) = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: @Op.1.%Self.as_type.loc5_15.1 (%Self.as_type) = out_param_pattern %return.patt, runtime_param2 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %Self.ref.loc5_15: %Add.type = name_ref Self, @Add.%Self [symbolic = %Self (constants.%Self)] +// CHECK:STDOUT: %Self.as_type.loc5_15.2: type = facet_access_type %Self.ref.loc5_15 [symbolic = %Self.as_type.loc5_15.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %.loc5_15: type = converted %Self.ref.loc5_15, %Self.as_type.loc5_15.2 [symbolic = %Self.as_type.loc5_15.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %Self.ref.loc5_28: %Add.type = name_ref Self, @Add.%Self [symbolic = %Self (constants.%Self)] +// CHECK:STDOUT: %Self.as_type.loc5_28: type = facet_access_type %Self.ref.loc5_28 [symbolic = %Self.as_type.loc5_15.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %.loc5_28: type = converted %Self.ref.loc5_28, %Self.as_type.loc5_28 [symbolic = %Self.as_type.loc5_15.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %Self.ref.loc5_37: %Add.type = name_ref Self, @Add.%Self [symbolic = %Self (constants.%Self)] +// CHECK:STDOUT: %Self.as_type.loc5_37: type = facet_access_type %Self.ref.loc5_37 [symbolic = %Self.as_type.loc5_15.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %.loc5_37: type = converted %Self.ref.loc5_37, %Self.as_type.loc5_37 [symbolic = %Self.as_type.loc5_15.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %self.param: @Op.1.%Self.as_type.loc5_15.1 (%Self.as_type) = value_param runtime_param0 +// CHECK:STDOUT: %self: @Op.1.%Self.as_type.loc5_15.1 (%Self.as_type) = bind_name self, %self.param +// CHECK:STDOUT: %other.param: @Op.1.%Self.as_type.loc5_15.1 (%Self.as_type) = value_param runtime_param1 +// CHECK:STDOUT: %other: @Op.1.%Self.as_type.loc5_15.1 (%Self.as_type) = bind_name other, %other.param +// CHECK:STDOUT: %return.param: ref @Op.1.%Self.as_type.loc5_15.1 (%Self.as_type) = out_param runtime_param2 +// CHECK:STDOUT: %return: ref @Op.1.%Self.as_type.loc5_15.1 (%Self.as_type) = return_slot %return.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %assoc0: %Op.assoc_type = assoc_entity element0, %Op.decl [template = constants.%assoc0] +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = %Self +// CHECK:STDOUT: .Op = %assoc0 +// CHECK:STDOUT: witness = (%Op.decl) +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl(%N.loc15_14.1: Core.IntLiteral) { +// CHECK:STDOUT: %N.loc15_14.2: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N.loc15_14.2 (constants.%N)] +// CHECK:STDOUT: %N.patt.loc15_14.2: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc15_14.2 (constants.%N.patt)] +// CHECK:STDOUT: %MyInt.loc15_39.2: type = class_type @MyInt, @MyInt(%N.loc15_14.2) [symbolic = %MyInt.loc15_39.2 (constants.%MyInt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Op.type: type = fn_type @Op.2, @impl(%N.loc15_14.2) [symbolic = %Op.type (constants.%Op.type.2)] +// CHECK:STDOUT: %Op: @impl.%Op.type (%Op.type.2) = struct_value () [symbolic = %Op (constants.%Op.2)] +// CHECK:STDOUT: %require_complete: = require_complete_type @impl.%MyInt.loc15_39.2 (%MyInt) [symbolic = %require_complete (constants.%require_complete.2)] +// CHECK:STDOUT: %interface.loc15_48.2: = interface_witness (%Op) [symbolic = %interface.loc15_48.2 (constants.%interface)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: %MyInt.loc15_39.1 as %Add.ref { +// CHECK:STDOUT: %Op.decl: @impl.%Op.type (%Op.type.2) = fn_decl @Op.2 [symbolic = @impl.%Op (constants.%Op.2)] { +// CHECK:STDOUT: %self.patt: @Op.2.%MyInt (%MyInt) = binding_pattern self +// CHECK:STDOUT: %self.param_patt: @Op.2.%MyInt (%MyInt) = value_param_pattern %self.patt, runtime_param0 +// CHECK:STDOUT: %other.patt: @Op.2.%MyInt (%MyInt) = binding_pattern other +// CHECK:STDOUT: %other.param_patt: @Op.2.%MyInt (%MyInt) = value_param_pattern %other.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: @Op.2.%MyInt (%MyInt) = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: @Op.2.%MyInt (%MyInt) = out_param_pattern %return.patt, runtime_param2 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %Self.ref.loc16_15: type = name_ref Self, @impl.%MyInt.loc15_39.1 [symbolic = %MyInt (constants.%MyInt)] +// CHECK:STDOUT: %Self.ref.loc16_28: type = name_ref Self, @impl.%MyInt.loc15_39.1 [symbolic = %MyInt (constants.%MyInt)] +// CHECK:STDOUT: %Self.ref.loc16_37: type = name_ref Self, @impl.%MyInt.loc15_39.1 [symbolic = %MyInt (constants.%MyInt)] +// CHECK:STDOUT: %self.param: @Op.2.%MyInt (%MyInt) = value_param runtime_param0 +// CHECK:STDOUT: %self: @Op.2.%MyInt (%MyInt) = bind_name self, %self.param +// CHECK:STDOUT: %other.param: @Op.2.%MyInt (%MyInt) = value_param runtime_param1 +// CHECK:STDOUT: %other: @Op.2.%MyInt (%MyInt) = bind_name other, %other.param +// CHECK:STDOUT: %return.param: ref @Op.2.%MyInt (%MyInt) = out_param runtime_param2 +// CHECK:STDOUT: %return: ref @Op.2.%MyInt (%MyInt) = return_slot %return.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %interface.loc15_48.1: = interface_witness (%Op.decl) [symbolic = %interface.loc15_48.2 (constants.%interface)] +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Op = %Op.decl +// CHECK:STDOUT: witness = %interface.loc15_48.1 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic class @MyInt(%N.loc11_13.1: Core.IntLiteral) { +// CHECK:STDOUT: %N.loc11_13.2: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N.loc11_13.2 (constants.%N)] +// CHECK:STDOUT: %N.patt.loc11_13.2: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc11_13.2 (constants.%N.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %iN.builtin: type = int_type signed, %N.loc11_13.2 [symbolic = %iN.builtin (constants.%iN.builtin)] +// CHECK:STDOUT: %require_complete: = require_complete_type @MyInt.%iN.builtin (%iN.builtin) [symbolic = %require_complete (constants.%require_complete.1)] +// CHECK:STDOUT: %complete_type.loc13_1.2: = complete_type_witness @MyInt.%iN.builtin (%iN.builtin) [symbolic = %complete_type.loc13_1.2 (constants.%complete_type)] +// CHECK:STDOUT: +// CHECK:STDOUT: class { +// CHECK:STDOUT: %Int.ref: %Int.type = name_ref Int, file.%Int.decl [template = constants.%Int] +// CHECK:STDOUT: %N.ref: Core.IntLiteral = name_ref N, %N.loc11_13.1 [symbolic = %N.loc11_13.2 (constants.%N)] +// CHECK:STDOUT: %int.make_type_signed: init type = call %Int.ref(%N.ref) [symbolic = %iN.builtin (constants.%iN.builtin)] +// CHECK:STDOUT: %.loc12_15.1: type = value_of_initializer %int.make_type_signed [symbolic = %iN.builtin (constants.%iN.builtin)] +// CHECK:STDOUT: %.loc12_15.2: type = converted %int.make_type_signed, %.loc12_15.1 [symbolic = %iN.builtin (constants.%iN.builtin)] +// CHECK:STDOUT: adapt_decl %.loc12_15.2 [template] +// CHECK:STDOUT: %complete_type.loc13_1.1: = complete_type_witness %iN.builtin [symbolic = %complete_type.loc13_1.2 (constants.%complete_type)] +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = constants.%MyInt +// CHECK:STDOUT: complete_type_witness = %complete_type.loc13_1.1 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Op.1(@Add.%Self: %Add.type) { +// CHECK:STDOUT: %Self: %Add.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self)] +// CHECK:STDOUT: %Self.as_type.loc5_15.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc5_15.1 (constants.%Self.as_type)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Op.1.%Self.as_type.loc5_15.1 (%Self.as_type)](%other.param_patt: @Op.1.%Self.as_type.loc5_15.1 (%Self.as_type)) -> @Op.1.%Self.as_type.loc5_15.1 (%Self.as_type); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @IntLiteral() -> type = "int_literal.make_type"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Int(%n.param_patt: Core.IntLiteral) -> type = "int.make_type_signed"; +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Op.2(@impl.%N.loc15_14.1: Core.IntLiteral) { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %MyInt: type = class_type @MyInt, @MyInt(%N) [symbolic = %MyInt (constants.%MyInt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Op.2.%MyInt (%MyInt)](%other.param_patt: @Op.2.%MyInt (%MyInt)) -> @Op.2.%MyInt (%MyInt) = "int.sadd"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Double(%N.loc19_11.1: Core.IntLiteral) { +// CHECK:STDOUT: %N.loc19_11.2: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N.loc19_11.2 (constants.%N)] +// CHECK:STDOUT: %N.patt.loc19_11.2: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc19_11.2 (constants.%N.patt)] +// CHECK:STDOUT: %MyInt.loc19_39.2: type = class_type @MyInt, @MyInt(%N.loc19_11.2) [symbolic = %MyInt.loc19_39.2 (constants.%MyInt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete: = require_complete_type @Double.%MyInt.loc19_39.2 (%MyInt) [symbolic = %require_complete (constants.%require_complete.2)] +// CHECK:STDOUT: %Op.type: type = fn_type @Op.2, @impl(%N.loc19_11.2) [symbolic = %Op.type (constants.%Op.type.2)] +// CHECK:STDOUT: %Op: @Double.%Op.type (%Op.type.2) = struct_value () [symbolic = %Op (constants.%Op.2)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%N.param_patt: Core.IntLiteral](%x.param_patt: @Double.%MyInt.loc19_39.2 (%MyInt)) -> @Double.%MyInt.loc19_39.2 (%MyInt) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %x.ref.loc20_10: @Double.%MyInt.loc19_39.2 (%MyInt) = name_ref x, %x +// CHECK:STDOUT: %Add.ref: type = name_ref Add, file.%Add.decl [template = constants.%Add.type] +// CHECK:STDOUT: %Op.ref: %Op.assoc_type = name_ref Op, @Add.%assoc0 [template = constants.%assoc0] +// CHECK:STDOUT: %impl.elem0: %Op.type.1 = interface_witness_access constants.%interface, element0 [symbolic = %Op (constants.%Op.2)] +// CHECK:STDOUT: %Op.bound: = bound_method %x.ref.loc20_10, %impl.elem0 +// CHECK:STDOUT: %x.ref.loc20_21: @Double.%MyInt.loc19_39.2 (%MyInt) = name_ref x, %x +// CHECK:STDOUT: %Op.specific_fn: = specific_function %Op.bound, @Op.2(constants.%N) +// CHECK:STDOUT: %int.sadd: init @Double.%MyInt.loc19_39.2 (%MyInt) = call %Op.specific_fn(%x.ref.loc20_10, %x.ref.loc20_21) +// CHECK:STDOUT: %.loc20_23.1: @Double.%MyInt.loc19_39.2 (%MyInt) = value_of_initializer %int.sadd +// CHECK:STDOUT: %.loc20_23.2: @Double.%MyInt.loc19_39.2 (%MyInt) = converted %int.sadd, %.loc20_23.1 +// CHECK:STDOUT: return %.loc20_23.2 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Op.1(constants.%Self) { +// CHECK:STDOUT: %Self => constants.%Self +// CHECK:STDOUT: %Self.as_type.loc5_15.1 => constants.%Self.as_type +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @MyInt(constants.%N) { +// CHECK:STDOUT: %N.loc11_13.2 => constants.%N +// CHECK:STDOUT: %N.patt.loc11_13.2 => constants.%N +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %iN.builtin => constants.%iN.builtin +// CHECK:STDOUT: %require_complete => constants.%require_complete.1 +// CHECK:STDOUT: %complete_type.loc13_1.2 => constants.%complete_type +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @MyInt(@impl.%N.loc15_14.2) {} +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl(constants.%N) { +// CHECK:STDOUT: %N.loc15_14.2 => constants.%N +// CHECK:STDOUT: %N.patt.loc15_14.2 => constants.%N +// CHECK:STDOUT: %MyInt.loc15_39.2 => constants.%MyInt +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Op.type => constants.%Op.type.2 +// CHECK:STDOUT: %Op => constants.%Op.2 +// CHECK:STDOUT: %require_complete => constants.%require_complete.2 +// CHECK:STDOUT: %interface.loc15_48.2 => constants.%interface +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @MyInt(@Op.2.%N) {} +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Op.2(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %MyInt => constants.%MyInt +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Op.1(constants.%Add.facet) { +// CHECK:STDOUT: %Self => constants.%Add.facet +// CHECK:STDOUT: %Self.as_type.loc5_15.1 => constants.%MyInt +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl(%N.loc15_14.2) {} +// CHECK:STDOUT: +// CHECK:STDOUT: specific @MyInt(@Double.%N.loc19_11.2) {} +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Double(constants.%N) { +// CHECK:STDOUT: %N.loc19_11.2 => constants.%N +// CHECK:STDOUT: %N.patt.loc19_11.2 => constants.%N +// CHECK:STDOUT: %MyInt.loc19_39.2 => constants.%MyInt +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl(@Double.%N.loc19_11.2) {} +// CHECK:STDOUT: +// CHECK:STDOUT: --- use_generic_impl.carbon +// CHECK:STDOUT: +// CHECK:STDOUT: constants { +// CHECK:STDOUT: %MyInt.type: type = generic_class_type @MyInt [template] +// CHECK:STDOUT: %MyInt.generic: %MyInt.type = struct_value () [template] +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %iN.builtin: type = int_type signed, %N [symbolic] +// CHECK:STDOUT: %complete_type.1: = complete_type_witness %iN.builtin [symbolic] +// CHECK:STDOUT: %MyInt.1: type = class_type @MyInt, @MyInt(%N) [symbolic] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic] +// CHECK:STDOUT: %require_complete.1: = require_complete_type %iN.builtin [symbolic] +// CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [template] +// CHECK:STDOUT: %MyInt.2: type = class_type @MyInt, @MyInt(%int_64) [template] +// CHECK:STDOUT: %LocalDouble.type: type = fn_type @LocalDouble [template] +// CHECK:STDOUT: %LocalDouble: %LocalDouble.type = struct_value () [template] +// CHECK:STDOUT: %i64.builtin: type = int_type signed, %int_64 [template] +// CHECK:STDOUT: %complete_type.2: = complete_type_witness %i64.builtin [template] +// CHECK:STDOUT: %Add.type: type = facet_type <@Add> [template] +// CHECK:STDOUT: %Self: %Add.type = bind_symbolic_name Self, 0 [symbolic] +// CHECK:STDOUT: %Op.type.1: type = fn_type @Op.1 [template] +// CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic] +// CHECK:STDOUT: %Op.assoc_type: type = assoc_entity_type %Add.type, %Op.type.1 [template] +// CHECK:STDOUT: %assoc0: %Op.assoc_type = assoc_entity element0, imports.%import_ref.12 [template] +// CHECK:STDOUT: %Op.type.2: type = fn_type @Op.2, @impl(%N) [symbolic] +// CHECK:STDOUT: %Op.2: %Op.type.2 = struct_value () [symbolic] +// CHECK:STDOUT: %require_complete.2: = require_complete_type %MyInt.1 [symbolic] +// CHECK:STDOUT: %interface.1: = interface_witness (%Op.2) [symbolic] +// CHECK:STDOUT: %Op.type.3: type = fn_type @Op.2, @impl(%int_64) [template] +// CHECK:STDOUT: %Op.3: %Op.type.3 = struct_value () [template] +// CHECK:STDOUT: %interface.2: = interface_witness (%Op.3) [template] +// CHECK:STDOUT: %CallImportedDouble.type: type = fn_type @CallImportedDouble [template] +// CHECK:STDOUT: %CallImportedDouble: %CallImportedDouble.type = struct_value () [template] +// CHECK:STDOUT: %Double.type: type = fn_type @Double [template] +// CHECK:STDOUT: %Double: %Double.type = struct_value () [template] +// CHECK:STDOUT: %Double.specific_fn: = specific_function %Double, @Double(%int_64) [template] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: type = import_ref Main//generic_impl, Add, loaded [template = constants.%Add.type] +// CHECK:STDOUT: %import_ref.2 = import_ref Main//generic_impl, IntLiteral, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref Main//generic_impl, Int, unloaded +// CHECK:STDOUT: %import_ref.4: %MyInt.type = import_ref Main//generic_impl, MyInt, loaded [template = constants.%MyInt.generic] +// CHECK:STDOUT: %import_ref.5: %Double.type = import_ref Main//generic_impl, Double, loaded [template = constants.%Double] +// CHECK:STDOUT: %import_ref.7: = import_ref Main//generic_impl, loc13_1, loaded [symbolic = @MyInt.%complete_type (constants.%complete_type.1)] +// CHECK:STDOUT: %import_ref.8 = import_ref Main//generic_impl, inst85 [no loc], unloaded +// CHECK:STDOUT: %import_ref.9 = import_ref Main//generic_impl, inst15 [no loc], unloaded +// CHECK:STDOUT: %import_ref.10: %Op.assoc_type = import_ref Main//generic_impl, loc5_41, loaded [template = constants.%assoc0] +// CHECK:STDOUT: %import_ref.11 = import_ref Main//generic_impl, Op, unloaded +// CHECK:STDOUT: %import_ref.13: type = import_ref Main//generic_impl, loc15_39, loaded [symbolic = @impl.%MyInt (constants.%MyInt.1)] +// CHECK:STDOUT: %import_ref.14: type = import_ref Main//generic_impl, loc15_44, loaded [template = constants.%Add.type] +// CHECK:STDOUT: %import_ref.15: = import_ref Main//generic_impl, loc15_48, loaded [symbolic = @impl.%interface (constants.%interface.1)] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Add = imports.%import_ref.1 +// CHECK:STDOUT: .IntLiteral = imports.%import_ref.2 +// CHECK:STDOUT: .Int = imports.%import_ref.3 +// CHECK:STDOUT: .MyInt = imports.%import_ref.4 +// CHECK:STDOUT: .Double = imports.%import_ref.5 +// CHECK:STDOUT: .LocalDouble = %LocalDouble.decl +// CHECK:STDOUT: .CallImportedDouble = %CallImportedDouble.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: %LocalDouble.decl: %LocalDouble.type = fn_decl @LocalDouble [template = constants.%LocalDouble] { +// CHECK:STDOUT: %x.patt: %MyInt.2 = binding_pattern x +// CHECK:STDOUT: %x.param_patt: %MyInt.2 = value_param_pattern %x.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %MyInt.2 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %MyInt.2 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %MyInt.ref.loc8_19: %MyInt.type = name_ref MyInt, imports.%import_ref.4 [template = constants.%MyInt.generic] +// CHECK:STDOUT: %int_64.loc8_25: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %MyInt.loc8_27: type = class_type @MyInt, @MyInt(constants.%int_64) [template = constants.%MyInt.2] +// CHECK:STDOUT: %MyInt.ref.loc8_33: %MyInt.type = name_ref MyInt, imports.%import_ref.4 [template = constants.%MyInt.generic] +// CHECK:STDOUT: %int_64.loc8_39: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %MyInt.loc8_41: type = class_type @MyInt, @MyInt(constants.%int_64) [template = constants.%MyInt.2] +// CHECK:STDOUT: %x.param: %MyInt.2 = value_param runtime_param0 +// CHECK:STDOUT: %x: %MyInt.2 = bind_name x, %x.param +// CHECK:STDOUT: %return.param: ref %MyInt.2 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %MyInt.2 = return_slot %return.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %CallImportedDouble.decl: %CallImportedDouble.type = fn_decl @CallImportedDouble [template = constants.%CallImportedDouble] { +// CHECK:STDOUT: %n.patt: %MyInt.2 = binding_pattern n +// CHECK:STDOUT: %n.param_patt: %MyInt.2 = value_param_pattern %n.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %MyInt.2 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %MyInt.2 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %MyInt.ref.loc12_26: %MyInt.type = name_ref MyInt, imports.%import_ref.4 [template = constants.%MyInt.generic] +// CHECK:STDOUT: %int_64.loc12_32: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %MyInt.loc12_34: type = class_type @MyInt, @MyInt(constants.%int_64) [template = constants.%MyInt.2] +// CHECK:STDOUT: %MyInt.ref.loc12_40: %MyInt.type = name_ref MyInt, imports.%import_ref.4 [template = constants.%MyInt.generic] +// CHECK:STDOUT: %int_64.loc12_46: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %MyInt.loc12_48: type = class_type @MyInt, @MyInt(constants.%int_64) [template = constants.%MyInt.2] +// CHECK:STDOUT: %n.param: %MyInt.2 = value_param runtime_param0 +// CHECK:STDOUT: %n: %MyInt.2 = bind_name n, %n.param +// CHECK:STDOUT: %return.param: ref %MyInt.2 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %MyInt.2 = return_slot %return.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: interface @Add [from "generic_impl.carbon"] { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = imports.%import_ref.9 +// CHECK:STDOUT: .Op = imports.%import_ref.10 +// CHECK:STDOUT: witness = (imports.%import_ref.11) +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl(constants.%N: Core.IntLiteral) [from "generic_impl.carbon"] { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %MyInt: type = class_type @MyInt, @MyInt(%N) [symbolic = %MyInt (constants.%MyInt.1)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Op.type: type = fn_type @Op.2, @impl(%N) [symbolic = %Op.type (constants.%Op.type.2)] +// CHECK:STDOUT: %Op: @impl.%Op.type (%Op.type.2) = struct_value () [symbolic = %Op (constants.%Op.2)] +// CHECK:STDOUT: %require_complete: = require_complete_type @impl.%MyInt (%MyInt.1) [symbolic = %require_complete (constants.%require_complete.2)] +// CHECK:STDOUT: %interface: = interface_witness (%Op) [symbolic = %interface (constants.%interface.1)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: imports.%import_ref.13 as imports.%import_ref.14 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = imports.%import_ref.15 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic class @MyInt(constants.%N: Core.IntLiteral) [from "generic_impl.carbon"] { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %iN.builtin: type = int_type signed, %N [symbolic = %iN.builtin (constants.%iN.builtin)] +// CHECK:STDOUT: %require_complete: = require_complete_type @MyInt.%iN.builtin (%iN.builtin) [symbolic = %require_complete (constants.%require_complete.1)] +// CHECK:STDOUT: %complete_type: = complete_type_witness @MyInt.%iN.builtin (%iN.builtin) [symbolic = %complete_type (constants.%complete_type.1)] +// CHECK:STDOUT: +// CHECK:STDOUT: class { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = imports.%import_ref.8 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.7 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @LocalDouble(%x.param_patt: %MyInt.2) -> %MyInt.2 { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %x.ref.loc9_10: %MyInt.2 = name_ref x, %x +// CHECK:STDOUT: %Add.ref: type = name_ref Add, imports.%import_ref.1 [template = constants.%Add.type] +// CHECK:STDOUT: %Op.ref: %Op.assoc_type = name_ref Op, imports.%import_ref.10 [template = constants.%assoc0] +// CHECK:STDOUT: %impl.elem0: %Op.type.1 = interface_witness_access constants.%interface.2, element0 [template = constants.%Op.3] +// CHECK:STDOUT: %Op.bound: = bound_method %x.ref.loc9_10, %impl.elem0 +// CHECK:STDOUT: %x.ref.loc9_21: %MyInt.2 = name_ref x, %x +// CHECK:STDOUT: %Op.specific_fn: = specific_function %Op.bound, @Op.2(constants.%int_64) +// CHECK:STDOUT: %int.sadd: init %MyInt.2 = call %Op.specific_fn(%x.ref.loc9_10, %x.ref.loc9_21) +// CHECK:STDOUT: %.loc9_23.1: %MyInt.2 = value_of_initializer %int.sadd +// CHECK:STDOUT: %.loc9_23.2: %MyInt.2 = converted %int.sadd, %.loc9_23.1 +// CHECK:STDOUT: return %.loc9_23.2 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Op.1(constants.%Self: %Add.type) [from "generic_impl.carbon"] { +// CHECK:STDOUT: %Self: %Add.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self)] +// CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic = %Self.as_type (constants.%Self.as_type)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Op.1.%Self.as_type (%Self.as_type)](%other.param_patt: @Op.1.%Self.as_type (%Self.as_type)) -> @Op.1.%Self.as_type (%Self.as_type); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Op.2(constants.%N: Core.IntLiteral) [from "generic_impl.carbon"] { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %MyInt: type = class_type @MyInt, @MyInt(%N) [symbolic = %MyInt (constants.%MyInt.1)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Op.2.%MyInt (%MyInt.1)](%other.param_patt: @Op.2.%MyInt (%MyInt.1)) -> @Op.2.%MyInt (%MyInt.1) = "int.sadd"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @CallImportedDouble(%n.param_patt: %MyInt.2) -> %MyInt.2 { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Double.ref: %Double.type = name_ref Double, imports.%import_ref.5 [template = constants.%Double] +// CHECK:STDOUT: %n.ref: %MyInt.2 = name_ref n, %n +// CHECK:STDOUT: %Double.specific_fn: = specific_function %Double.ref, @Double(constants.%int_64) [template = constants.%Double.specific_fn] +// CHECK:STDOUT: %Double.call: init %MyInt.2 = call %Double.specific_fn(%n.ref) +// CHECK:STDOUT: %.loc13_19.1: %MyInt.2 = value_of_initializer %Double.call +// CHECK:STDOUT: %.loc13_19.2: %MyInt.2 = converted %Double.call, %.loc13_19.1 +// CHECK:STDOUT: return %.loc13_19.2 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Double(constants.%N: Core.IntLiteral) [from "generic_impl.carbon"] { +// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] +// CHECK:STDOUT: %MyInt: type = class_type @MyInt, @MyInt(%N) [symbolic = %MyInt (constants.%MyInt.1)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete: = require_complete_type @Double.%MyInt (%MyInt.1) [symbolic = %require_complete (constants.%require_complete.2)] +// CHECK:STDOUT: %Op.type: type = fn_type @Op.2, @impl(%N) [symbolic = %Op.type (constants.%Op.type.2)] +// CHECK:STDOUT: %Op: @Double.%Op.type (%Op.type.2) = struct_value () [symbolic = %Op (constants.%Op.2)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%N.param_patt: Core.IntLiteral](%x.param_patt: @Double.%MyInt (%MyInt.1)) -> @Double.%MyInt (%MyInt.1); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @MyInt(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %iN.builtin => constants.%iN.builtin +// CHECK:STDOUT: %require_complete => constants.%require_complete.1 +// CHECK:STDOUT: %complete_type => constants.%complete_type.1 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @MyInt(constants.%int_64) { +// CHECK:STDOUT: %N => constants.%int_64 +// CHECK:STDOUT: %N.patt => constants.%int_64 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %iN.builtin => constants.%i64.builtin +// CHECK:STDOUT: %require_complete => constants.%complete_type.2 +// CHECK:STDOUT: %complete_type => constants.%complete_type.2 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Op.1(constants.%Self) { +// CHECK:STDOUT: %Self => constants.%Self +// CHECK:STDOUT: %Self.as_type => constants.%Self.as_type +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @MyInt(@impl.%N) {} +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %MyInt => constants.%MyInt.1 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Op.type => constants.%Op.type.2 +// CHECK:STDOUT: %Op => constants.%Op.2 +// CHECK:STDOUT: %require_complete => constants.%require_complete.2 +// CHECK:STDOUT: %interface => constants.%interface.1 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl(%N) {} +// CHECK:STDOUT: +// CHECK:STDOUT: specific @MyInt(@Op.2.%N) {} +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Op.2(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %MyInt => constants.%MyInt.1 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl(constants.%int_64) { +// CHECK:STDOUT: %N => constants.%int_64 +// CHECK:STDOUT: %N.patt => constants.%int_64 +// CHECK:STDOUT: %MyInt => constants.%MyInt.2 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Op.type => constants.%Op.type.3 +// CHECK:STDOUT: %Op => constants.%Op.3 +// CHECK:STDOUT: %require_complete => constants.%complete_type.2 +// CHECK:STDOUT: %interface => constants.%interface.2 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Op.2(constants.%int_64) { +// CHECK:STDOUT: %N => constants.%int_64 +// CHECK:STDOUT: %MyInt => constants.%MyInt.2 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @MyInt(@Double.%N) {} +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Double(constants.%N) { +// CHECK:STDOUT: %N => constants.%N +// CHECK:STDOUT: %N.patt => constants.%N +// CHECK:STDOUT: %MyInt => constants.%MyInt.1 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl(@Double.%N) {} +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Double(constants.%int_64) { +// CHECK:STDOUT: %N => constants.%int_64 +// CHECK:STDOUT: %N.patt => constants.%int_64 +// CHECK:STDOUT: %MyInt => constants.%MyInt.2 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete => constants.%complete_type.2 +// CHECK:STDOUT: %Op.type => constants.%Op.type.3 +// CHECK:STDOUT: %Op => constants.%Op.3 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: --- convert_symbolic.carbon +// CHECK:STDOUT: +// CHECK:STDOUT: constants { +// CHECK:STDOUT: %IntLiteral.type: type = fn_type @IntLiteral [template] +// CHECK:STDOUT: %IntLiteral: %IntLiteral.type = struct_value () [template] +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %ToLiteral.type.1: type = fn_type @ToLiteral.1 [template] +// CHECK:STDOUT: %ToLiteral.1: %ToLiteral.type.1 = struct_value () [template] +// CHECK:STDOUT: %FromLiteral.type: type = fn_type @FromLiteral [template] +// CHECK:STDOUT: %FromLiteral: %FromLiteral.type = struct_value () [template] +// CHECK:STDOUT: %N.1: %i32.builtin = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %N.patt.1: %i32.builtin = symbolic_binding_pattern N, 0 [symbolic] +// CHECK:STDOUT: %int.convert_checked.1: init Core.IntLiteral = call %ToLiteral.1(%N.1) [symbolic] +// CHECK:STDOUT: %iN.builtin.1: type = int_type signed, %int.convert_checked.1 [symbolic] +// CHECK:STDOUT: %Make.type: type = fn_type @Make [template] +// CHECK:STDOUT: %Make: %Make.type = struct_value () [template] +// CHECK:STDOUT: %require_complete.1: = require_complete_type %iN.builtin.1 [symbolic] +// CHECK:STDOUT: %Make.specific_fn: = specific_function %Make, @Make(%N.1) [symbolic] +// CHECK:STDOUT: %OtherInt: type = class_type @OtherInt [template] +// CHECK:STDOUT: %ToLiteral.type.2: type = fn_type @ToLiteral.2 [template] +// CHECK:STDOUT: %ToLiteral.2: %ToLiteral.type.2 = struct_value () [template] +// CHECK:STDOUT: %complete_type: = complete_type_witness %i32.builtin [template] +// CHECK:STDOUT: %N.2: %OtherInt = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %N.patt.2: %OtherInt = symbolic_binding_pattern N, 0 [symbolic] +// CHECK:STDOUT: %ToLiteral.bound: = bound_method %N.2, %ToLiteral.2 [symbolic] +// CHECK:STDOUT: %int.convert_checked.2: init Core.IntLiteral = call %ToLiteral.bound(%N.2) [symbolic] +// CHECK:STDOUT: %iN.builtin.2: type = int_type signed, %int.convert_checked.2 [symbolic] +// CHECK:STDOUT: %MakeFromClass.type: type = fn_type @MakeFromClass [template] +// CHECK:STDOUT: %MakeFromClass: %MakeFromClass.type = struct_value () [template] +// CHECK:STDOUT: %require_complete.2: = require_complete_type %iN.builtin.2 [symbolic] +// CHECK:STDOUT: %MakeFromClass.specific_fn: = specific_function %MakeFromClass, @MakeFromClass(%N.2) [symbolic] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .IntLiteral = %IntLiteral.decl +// CHECK:STDOUT: .Int = %Int.decl +// CHECK:STDOUT: .ToLiteral = %ToLiteral.decl.loc6 +// CHECK:STDOUT: .FromLiteral = %FromLiteral.decl +// CHECK:STDOUT: .Make = %Make.decl +// CHECK:STDOUT: .OtherInt = %OtherInt.decl +// CHECK:STDOUT: .MakeFromClass = %MakeFromClass.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %IntLiteral.decl: %IntLiteral.type = fn_decl @IntLiteral [template = constants.%IntLiteral] { +// CHECK:STDOUT: %return.patt: type = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: type = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %return.param: ref type = out_param runtime_param0 +// CHECK:STDOUT: %return: ref type = return_slot %return.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Int.decl: %Int.type = fn_decl @Int [template = constants.%Int] { +// CHECK:STDOUT: %n.patt: Core.IntLiteral = binding_pattern n +// CHECK:STDOUT: %n.param_patt: Core.IntLiteral = value_param_pattern %n.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: type = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: type = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [template = constants.%IntLiteral] +// CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral] +// CHECK:STDOUT: %.loc5_22.1: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral] +// CHECK:STDOUT: %.loc5_22.2: type = converted %int_literal.make_type, %.loc5_22.1 [template = Core.IntLiteral] +// CHECK:STDOUT: %n.param: Core.IntLiteral = value_param runtime_param0 +// CHECK:STDOUT: %n: Core.IntLiteral = bind_name n, %n.param +// CHECK:STDOUT: %return.param: ref type = out_param runtime_param1 +// CHECK:STDOUT: %return: ref type = return_slot %return.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %ToLiteral.decl.loc6: %ToLiteral.type.1 = fn_decl @ToLiteral.1 [template = constants.%ToLiteral.1] { +// CHECK:STDOUT: %n.patt: %i32.builtin = binding_pattern n +// CHECK:STDOUT: %n.param_patt: %i32.builtin = value_param_pattern %n.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: Core.IntLiteral = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: Core.IntLiteral = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %Int.ref: %Int.type = name_ref Int, file.%Int.decl [template = constants.%Int] +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %int.make_type_signed: init type = call %Int.ref(%int_32) [template = constants.%i32.builtin] +// CHECK:STDOUT: %.loc6_23.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32.builtin] +// CHECK:STDOUT: %.loc6_23.2: type = converted %int.make_type_signed, %.loc6_23.1 [template = constants.%i32.builtin] +// CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [template = constants.%IntLiteral] +// CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral] +// CHECK:STDOUT: %.loc6_40.1: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral] +// CHECK:STDOUT: %.loc6_40.2: type = converted %int_literal.make_type, %.loc6_40.1 [template = Core.IntLiteral] +// CHECK:STDOUT: %n.param: %i32.builtin = value_param runtime_param0 +// CHECK:STDOUT: %n: %i32.builtin = bind_name n, %n.param +// CHECK:STDOUT: %return.param: ref Core.IntLiteral = out_param runtime_param1 +// CHECK:STDOUT: %return: ref Core.IntLiteral = return_slot %return.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %FromLiteral.decl: %FromLiteral.type = fn_decl @FromLiteral [template = constants.%FromLiteral] { +// CHECK:STDOUT: %n.patt: Core.IntLiteral = binding_pattern n +// CHECK:STDOUT: %n.param_patt: Core.IntLiteral = value_param_pattern %n.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %i32.builtin = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32.builtin = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [template = constants.%IntLiteral] +// CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral] +// CHECK:STDOUT: %.loc7_30.1: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral] +// CHECK:STDOUT: %.loc7_30.2: type = converted %int_literal.make_type, %.loc7_30.1 [template = Core.IntLiteral] +// CHECK:STDOUT: %Int.ref: %Int.type = name_ref Int, file.%Int.decl [template = constants.%Int] +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %int.make_type_signed: init type = call %Int.ref(%int_32) [template = constants.%i32.builtin] +// CHECK:STDOUT: %.loc7_42.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32.builtin] +// CHECK:STDOUT: %.loc7_42.2: type = converted %int.make_type_signed, %.loc7_42.1 [template = constants.%i32.builtin] +// CHECK:STDOUT: %n.param: Core.IntLiteral = value_param runtime_param0 +// CHECK:STDOUT: %n: Core.IntLiteral = bind_name n, %n.param +// CHECK:STDOUT: %return.param: ref %i32.builtin = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %i32.builtin = return_slot %return.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Make.decl: %Make.type = fn_decl @Make [template = constants.%Make] { +// CHECK:STDOUT: %N.patt.loc9_9.1: %i32.builtin = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc9_9.2 (constants.%N.patt.1)] +// CHECK:STDOUT: %N.param_patt: %i32.builtin = value_param_pattern %N.patt.loc9_9.1, runtime_param [symbolic = %N.patt.loc9_9.2 (constants.%N.patt.1)] +// CHECK:STDOUT: %return.patt: @Make.%iN.builtin (%iN.builtin.1) = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: @Make.%iN.builtin (%iN.builtin.1) = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %Int.ref.loc9_13: %Int.type = name_ref Int, file.%Int.decl [template = constants.%Int] +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %int.make_type_signed.loc9_19: init type = call %Int.ref.loc9_13(%int_32) [template = constants.%i32.builtin] +// CHECK:STDOUT: %.loc9_19.1: type = value_of_initializer %int.make_type_signed.loc9_19 [template = constants.%i32.builtin] +// CHECK:STDOUT: %.loc9_19.2: type = converted %int.make_type_signed.loc9_19, %.loc9_19.1 [template = constants.%i32.builtin] +// CHECK:STDOUT: %Int.ref.loc9_25: %Int.type = name_ref Int, file.%Int.decl [template = constants.%Int] +// CHECK:STDOUT: %ToLiteral.ref: %ToLiteral.type.1 = name_ref ToLiteral, file.%ToLiteral.decl.loc6 [template = constants.%ToLiteral.1] +// CHECK:STDOUT: %N.ref.loc9_39: %i32.builtin = name_ref N, %N.loc9_9.1 [symbolic = %N.loc9_9.2 (constants.%N.1)] +// CHECK:STDOUT: %int.convert_checked.loc9_40.1: init Core.IntLiteral = call %ToLiteral.ref(%N.ref.loc9_39) [symbolic = %int.convert_checked.loc9_40.2 (constants.%int.convert_checked.1)] +// CHECK:STDOUT: %.loc9_40.1: Core.IntLiteral = value_of_initializer %int.convert_checked.loc9_40.1 [symbolic = %int.convert_checked.loc9_40.2 (constants.%int.convert_checked.1)] +// CHECK:STDOUT: %.loc9_40.2: Core.IntLiteral = converted %int.convert_checked.loc9_40.1, %.loc9_40.1 [symbolic = %int.convert_checked.loc9_40.2 (constants.%int.convert_checked.1)] +// CHECK:STDOUT: %int.make_type_signed.loc9_41: init type = call %Int.ref.loc9_25(%.loc9_40.2) [symbolic = %iN.builtin (constants.%iN.builtin.1)] +// CHECK:STDOUT: %.loc9_41.1: type = value_of_initializer %int.make_type_signed.loc9_41 [symbolic = %iN.builtin (constants.%iN.builtin.1)] +// CHECK:STDOUT: %.loc9_41.2: type = converted %int.make_type_signed.loc9_41, %.loc9_41.1 [symbolic = %iN.builtin (constants.%iN.builtin.1)] +// CHECK:STDOUT: %N.param: %i32.builtin = value_param runtime_param +// CHECK:STDOUT: %N.loc9_9.1: %i32.builtin = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc9_9.2 (constants.%N.1)] +// CHECK:STDOUT: %return.param: ref @Make.%iN.builtin (%iN.builtin.1) = out_param runtime_param0 +// CHECK:STDOUT: %return: ref @Make.%iN.builtin (%iN.builtin.1) = return_slot %return.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %OtherInt.decl: type = class_decl @OtherInt [template = constants.%OtherInt] {} {} +// CHECK:STDOUT: %ToLiteral.decl.loc16: %ToLiteral.type.2 = fn_decl @ToLiteral.2 [template = constants.%ToLiteral.2] { +// CHECK:STDOUT: %self.patt: %OtherInt = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %OtherInt = value_param_pattern %self.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: Core.IntLiteral = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: Core.IntLiteral = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %Self.ref.loc16: type = name_ref Self, constants.%OtherInt [template = constants.%OtherInt] +// CHECK:STDOUT: %IntLiteral.ref.loc16: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [template = constants.%IntLiteral] +// CHECK:STDOUT: %int_literal.make_type.loc16: init type = call %IntLiteral.ref.loc16() [template = Core.IntLiteral] +// CHECK:STDOUT: %.loc16_51.1: type = value_of_initializer %int_literal.make_type.loc16 [template = Core.IntLiteral] +// CHECK:STDOUT: %.loc16_51.2: type = converted %int_literal.make_type.loc16, %.loc16_51.1 [template = Core.IntLiteral] +// CHECK:STDOUT: %self.param.loc16: %OtherInt = value_param runtime_param0 +// CHECK:STDOUT: %self.loc16: %OtherInt = bind_name self, %self.param.loc16 +// CHECK:STDOUT: %return.param.loc16: ref Core.IntLiteral = out_param runtime_param1 +// CHECK:STDOUT: %return.loc16: ref Core.IntLiteral = return_slot %return.param.loc16 +// CHECK:STDOUT: } +// CHECK:STDOUT: %MakeFromClass.decl: %MakeFromClass.type = fn_decl @MakeFromClass [template = constants.%MakeFromClass] { +// CHECK:STDOUT: %N.patt.loc18_18.1: %OtherInt = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc18_18.2 (constants.%N.patt.2)] +// CHECK:STDOUT: %N.param_patt: %OtherInt = value_param_pattern %N.patt.loc18_18.1, runtime_param [symbolic = %N.patt.loc18_18.2 (constants.%N.patt.2)] +// CHECK:STDOUT: %return.patt: @MakeFromClass.%iN.builtin (%iN.builtin.2) = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: @MakeFromClass.%iN.builtin (%iN.builtin.2) = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %OtherInt.ref: type = name_ref OtherInt, file.%OtherInt.decl [template = constants.%OtherInt] +// CHECK:STDOUT: %Int.ref: %Int.type = name_ref Int, file.%Int.decl [template = constants.%Int] +// CHECK:STDOUT: %N.ref.loc18_39: %OtherInt = name_ref N, %N.loc18_18.1 [symbolic = %N.loc18_18.2 (constants.%N.2)] +// CHECK:STDOUT: %ToLiteral.ref: %ToLiteral.type.2 = name_ref ToLiteral, @OtherInt.%ToLiteral.decl [template = constants.%ToLiteral.2] +// CHECK:STDOUT: %ToLiteral.bound.loc18_40.1: = bound_method %N.ref.loc18_39, %ToLiteral.ref [symbolic = %ToLiteral.bound.loc18_40.2 (constants.%ToLiteral.bound)] +// CHECK:STDOUT: %int.convert_checked.loc18_51.1: init Core.IntLiteral = call %ToLiteral.bound.loc18_40.1(%N.ref.loc18_39) [symbolic = %int.convert_checked.loc18_51.2 (constants.%int.convert_checked.2)] +// CHECK:STDOUT: %.loc18_51.1: Core.IntLiteral = value_of_initializer %int.convert_checked.loc18_51.1 [symbolic = %int.convert_checked.loc18_51.2 (constants.%int.convert_checked.2)] +// CHECK:STDOUT: %.loc18_51.2: Core.IntLiteral = converted %int.convert_checked.loc18_51.1, %.loc18_51.1 [symbolic = %int.convert_checked.loc18_51.2 (constants.%int.convert_checked.2)] +// CHECK:STDOUT: %int.make_type_signed: init type = call %Int.ref(%.loc18_51.2) [symbolic = %iN.builtin (constants.%iN.builtin.2)] +// CHECK:STDOUT: %.loc18_52.1: type = value_of_initializer %int.make_type_signed [symbolic = %iN.builtin (constants.%iN.builtin.2)] +// CHECK:STDOUT: %.loc18_52.2: type = converted %int.make_type_signed, %.loc18_52.1 [symbolic = %iN.builtin (constants.%iN.builtin.2)] +// CHECK:STDOUT: %N.param: %OtherInt = value_param runtime_param +// CHECK:STDOUT: %N.loc18_18.1: %OtherInt = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc18_18.2 (constants.%N.2)] +// CHECK:STDOUT: %return.param: ref @MakeFromClass.%iN.builtin (%iN.builtin.2) = out_param runtime_param0 +// CHECK:STDOUT: %return: ref @MakeFromClass.%iN.builtin (%iN.builtin.2) = return_slot %return.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: class @OtherInt { +// CHECK:STDOUT: %Int.ref: %Int.type = name_ref Int, file.%Int.decl [template = constants.%Int] +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %int.make_type_signed: init type = call %Int.ref(%int_32) [template = constants.%i32.builtin] +// CHECK:STDOUT: %.loc12_16.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32.builtin] +// CHECK:STDOUT: %.loc12_16.2: type = converted %int.make_type_signed, %.loc12_16.1 [template = constants.%i32.builtin] +// CHECK:STDOUT: adapt_decl %.loc12_16.2 [template] +// CHECK:STDOUT: %ToLiteral.decl: %ToLiteral.type.2 = fn_decl @ToLiteral.2 [template = constants.%ToLiteral.2] { +// CHECK:STDOUT: %self.patt: %OtherInt = binding_pattern self +// CHECK:STDOUT: %self.param_patt: %OtherInt = value_param_pattern %self.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: Core.IntLiteral = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: Core.IntLiteral = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %Self.ref.loc13: type = name_ref Self, constants.%OtherInt [template = constants.%OtherInt] +// CHECK:STDOUT: %IntLiteral.ref.loc13: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [template = constants.%IntLiteral] +// CHECK:STDOUT: %int_literal.make_type.loc13: init type = call %IntLiteral.ref.loc13() [template = Core.IntLiteral] +// CHECK:STDOUT: %.loc13_44.1: type = value_of_initializer %int_literal.make_type.loc13 [template = Core.IntLiteral] +// CHECK:STDOUT: %.loc13_44.2: type = converted %int_literal.make_type.loc13, %.loc13_44.1 [template = Core.IntLiteral] +// CHECK:STDOUT: %self.param.loc13: %OtherInt = value_param runtime_param0 +// CHECK:STDOUT: %self.loc13: %OtherInt = bind_name self, %self.param.loc13 +// CHECK:STDOUT: %return.param.loc13: ref Core.IntLiteral = out_param runtime_param1 +// CHECK:STDOUT: %return.loc13: ref Core.IntLiteral = return_slot %return.param.loc13 +// CHECK:STDOUT: } +// CHECK:STDOUT: %complete_type: = complete_type_witness %i32.builtin [template = constants.%complete_type] +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = constants.%OtherInt +// CHECK:STDOUT: .ToLiteral = %ToLiteral.decl +// CHECK:STDOUT: complete_type_witness = %complete_type +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @IntLiteral() -> type = "int_literal.make_type"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Int(%n.param_patt: Core.IntLiteral) -> type = "int.make_type_signed"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @ToLiteral.1(%n.param_patt: %i32.builtin) -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @FromLiteral(%n.param_patt: Core.IntLiteral) -> %i32.builtin = "int.convert_checked"; +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Make(%N.loc9_9.1: %i32.builtin) { +// CHECK:STDOUT: %N.loc9_9.2: %i32.builtin = bind_symbolic_name N, 0 [symbolic = %N.loc9_9.2 (constants.%N.1)] +// CHECK:STDOUT: %N.patt.loc9_9.2: %i32.builtin = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc9_9.2 (constants.%N.patt.1)] +// CHECK:STDOUT: %int.convert_checked.loc9_40.2: init Core.IntLiteral = call constants.%ToLiteral.1(%N.loc9_9.2) [symbolic = %int.convert_checked.loc9_40.2 (constants.%int.convert_checked.1)] +// CHECK:STDOUT: %iN.builtin: type = int_type signed, %int.convert_checked.loc9_40.2 [symbolic = %iN.builtin (constants.%iN.builtin.1)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete: = require_complete_type @Make.%iN.builtin (%iN.builtin.1) [symbolic = %require_complete (constants.%require_complete.1)] +// CHECK:STDOUT: %Make.specific_fn.loc9_52.2: = specific_function constants.%Make, @Make(%N.loc9_9.2) [symbolic = %Make.specific_fn.loc9_52.2 (constants.%Make.specific_fn)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn(%N.param_patt: %i32.builtin) -> @Make.%iN.builtin (%iN.builtin.1) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Make.ref: %Make.type = name_ref Make, file.%Make.decl [template = constants.%Make] +// CHECK:STDOUT: %N.ref.loc9_57: %i32.builtin = name_ref N, %N.loc9_9.1 [symbolic = %N.loc9_9.2 (constants.%N.1)] +// CHECK:STDOUT: %Make.specific_fn.loc9_52.1: = specific_function %Make.ref, @Make(constants.%N.1) [symbolic = %Make.specific_fn.loc9_52.2 (constants.%Make.specific_fn)] +// CHECK:STDOUT: %Make.call: init @Make.%iN.builtin (%iN.builtin.1) = call %Make.specific_fn.loc9_52.1() +// CHECK:STDOUT: %.loc9_59.1: @Make.%iN.builtin (%iN.builtin.1) = value_of_initializer %Make.call +// CHECK:STDOUT: %.loc9_59.2: @Make.%iN.builtin (%iN.builtin.1) = converted %Make.call, %.loc9_59.1 +// CHECK:STDOUT: return %.loc9_59.2 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @ToLiteral.2[%self.param_patt: %OtherInt]() -> Core.IntLiteral = "int.convert_checked"; +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @MakeFromClass(%N.loc18_18.1: %OtherInt) { +// CHECK:STDOUT: %N.loc18_18.2: %OtherInt = bind_symbolic_name N, 0 [symbolic = %N.loc18_18.2 (constants.%N.2)] +// CHECK:STDOUT: %N.patt.loc18_18.2: %OtherInt = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc18_18.2 (constants.%N.patt.2)] +// CHECK:STDOUT: %ToLiteral.bound.loc18_40.2: = bound_method %N.loc18_18.2, constants.%ToLiteral.2 [symbolic = %ToLiteral.bound.loc18_40.2 (constants.%ToLiteral.bound)] +// CHECK:STDOUT: %int.convert_checked.loc18_51.2: init Core.IntLiteral = call %ToLiteral.bound.loc18_40.2(%N.loc18_18.2) [symbolic = %int.convert_checked.loc18_51.2 (constants.%int.convert_checked.2)] +// CHECK:STDOUT: %iN.builtin: type = int_type signed, %int.convert_checked.loc18_51.2 [symbolic = %iN.builtin (constants.%iN.builtin.2)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete: = require_complete_type @MakeFromClass.%iN.builtin (%iN.builtin.2) [symbolic = %require_complete (constants.%require_complete.2)] +// CHECK:STDOUT: %MakeFromClass.specific_fn.loc18_63.2: = specific_function constants.%MakeFromClass, @MakeFromClass(%N.loc18_18.2) [symbolic = %MakeFromClass.specific_fn.loc18_63.2 (constants.%MakeFromClass.specific_fn)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn(%N.param_patt: %OtherInt) -> @MakeFromClass.%iN.builtin (%iN.builtin.2) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %MakeFromClass.ref: %MakeFromClass.type = name_ref MakeFromClass, file.%MakeFromClass.decl [template = constants.%MakeFromClass] +// CHECK:STDOUT: %N.ref.loc18_77: %OtherInt = name_ref N, %N.loc18_18.1 [symbolic = %N.loc18_18.2 (constants.%N.2)] +// CHECK:STDOUT: %MakeFromClass.specific_fn.loc18_63.1: = specific_function %MakeFromClass.ref, @MakeFromClass(constants.%N.2) [symbolic = %MakeFromClass.specific_fn.loc18_63.2 (constants.%MakeFromClass.specific_fn)] +// CHECK:STDOUT: %MakeFromClass.call: init @MakeFromClass.%iN.builtin (%iN.builtin.2) = call %MakeFromClass.specific_fn.loc18_63.1() +// CHECK:STDOUT: %.loc18_79.1: @MakeFromClass.%iN.builtin (%iN.builtin.2) = value_of_initializer %MakeFromClass.call +// CHECK:STDOUT: %.loc18_79.2: @MakeFromClass.%iN.builtin (%iN.builtin.2) = converted %MakeFromClass.call, %.loc18_79.1 +// CHECK:STDOUT: return %.loc18_79.2 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Make(constants.%N.1) { +// CHECK:STDOUT: %N.loc9_9.2 => constants.%N.1 +// CHECK:STDOUT: %N.patt.loc9_9.2 => constants.%N.1 +// CHECK:STDOUT: %int.convert_checked.loc9_40.2 => constants.%int.convert_checked.1 +// CHECK:STDOUT: %iN.builtin => constants.%iN.builtin.1 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete => constants.%require_complete.1 +// CHECK:STDOUT: %Make.specific_fn.loc9_52.2 => constants.%Make.specific_fn +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Make(%N.loc9_9.2) {} +// CHECK:STDOUT: +// CHECK:STDOUT: specific @MakeFromClass(constants.%N.2) { +// CHECK:STDOUT: %N.loc18_18.2 => constants.%N.2 +// CHECK:STDOUT: %N.patt.loc18_18.2 => constants.%N.2 +// CHECK:STDOUT: %ToLiteral.bound.loc18_40.2 => constants.%ToLiteral.bound +// CHECK:STDOUT: %int.convert_checked.loc18_51.2 => constants.%int.convert_checked.2 +// CHECK:STDOUT: %iN.builtin => constants.%iN.builtin.2 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete => constants.%require_complete.2 +// CHECK:STDOUT: %MakeFromClass.specific_fn.loc18_63.2 => constants.%MakeFromClass.specific_fn +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @MakeFromClass(%N.loc18_18.2) {} +// CHECK:STDOUT: +// CHECK:STDOUT: --- use_convert_symbolic.carbon +// CHECK:STDOUT: +// CHECK:STDOUT: constants { +// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] +// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] +// CHECK:STDOUT: %int_64.1: Core.IntLiteral = int_value 64 [template] +// CHECK:STDOUT: %i64.builtin: type = int_type signed, %int_64.1 [template] +// CHECK:STDOUT: %Make.type: type = fn_type @Make [template] +// CHECK:STDOUT: %Make: %Make.type = struct_value () [template] +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [template] +// CHECK:STDOUT: %N.1: %i32.builtin = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %N.patt.1: %i32.builtin = symbolic_binding_pattern N, 0 [symbolic] +// CHECK:STDOUT: %ToLiteral.type.1: type = fn_type @ToLiteral.1 [template] +// CHECK:STDOUT: %ToLiteral.1: %ToLiteral.type.1 = struct_value () [template] +// CHECK:STDOUT: %int.convert_checked.1: init Core.IntLiteral = call %ToLiteral.1(%N.1) [symbolic] +// CHECK:STDOUT: %iN.builtin.1: type = int_type signed, %int.convert_checked.1 [symbolic] +// CHECK:STDOUT: %require_complete.1: = require_complete_type %iN.builtin.1 [symbolic] +// CHECK:STDOUT: %Make.specific_fn.1: = specific_function %Make, @Make(%N.1) [symbolic] +// CHECK:STDOUT: %FromLiteral.type: type = fn_type @FromLiteral [template] +// CHECK:STDOUT: %FromLiteral: %FromLiteral.type = struct_value () [template] +// CHECK:STDOUT: %int_64.2: %i32.builtin = int_value 64 [template] +// CHECK:STDOUT: %Make.specific_fn.2: = specific_function %Make, @Make(%int_64.2) [template] +// CHECK:STDOUT: %MakeFromClass.type: type = fn_type @MakeFromClass [template] +// CHECK:STDOUT: %MakeFromClass: %MakeFromClass.type = struct_value () [template] +// CHECK:STDOUT: %OtherInt: type = class_type @OtherInt [template] +// CHECK:STDOUT: %complete_type.1: = complete_type_witness %i32.builtin [template] +// CHECK:STDOUT: %N.2: %OtherInt = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %N.patt.2: %OtherInt = symbolic_binding_pattern N, 0 [symbolic] +// CHECK:STDOUT: %ToLiteral.type.2: type = fn_type @ToLiteral.2 [template] +// CHECK:STDOUT: %ToLiteral.2: %ToLiteral.type.2 = struct_value () [template] +// CHECK:STDOUT: %ToLiteral.bound.1: = bound_method %N.2, %ToLiteral.2 [symbolic] +// CHECK:STDOUT: %int.convert_checked.2: init Core.IntLiteral = call %ToLiteral.bound.1(%N.2) [symbolic] +// CHECK:STDOUT: %iN.builtin.2: type = int_type signed, %int.convert_checked.2 [symbolic] +// CHECK:STDOUT: %require_complete.2: = require_complete_type %iN.builtin.2 [symbolic] +// CHECK:STDOUT: %MakeFromClass.specific_fn.1: = specific_function %MakeFromClass, @MakeFromClass(%N.2) [symbolic] +// CHECK:STDOUT: %ToLiteral.bound.2: = bound_method %int_64.2, %ToLiteral.2 [template] +// CHECK:STDOUT: %MakeFromClass.specific_fn.2: = specific_function %MakeFromClass, @MakeFromClass(%int_64.2) [template] +// CHECK:STDOUT: %complete_type.2: = complete_type_witness %i64.builtin [template] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1 = import_ref Main//convert_symbolic, IntLiteral, unloaded +// CHECK:STDOUT: %import_ref.2: %Int.type = import_ref Main//convert_symbolic, Int, loaded [template = constants.%Int] +// CHECK:STDOUT: %import_ref.3 = import_ref Main//convert_symbolic, ToLiteral, unloaded +// CHECK:STDOUT: %import_ref.4: %FromLiteral.type = import_ref Main//convert_symbolic, FromLiteral, loaded [template = constants.%FromLiteral] +// CHECK:STDOUT: %import_ref.5: %Make.type = import_ref Main//convert_symbolic, Make, loaded [template = constants.%Make] +// CHECK:STDOUT: %import_ref.6: type = import_ref Main//convert_symbolic, OtherInt, loaded [template = constants.%OtherInt] +// CHECK:STDOUT: %import_ref.7: %MakeFromClass.type = import_ref Main//convert_symbolic, MakeFromClass, loaded [template = constants.%MakeFromClass] +// CHECK:STDOUT: %import_ref.9: = import_ref Main//convert_symbolic, loc14_1, loaded [template = constants.%complete_type.1] +// CHECK:STDOUT: %import_ref.10 = import_ref Main//convert_symbolic, inst125 [no loc], unloaded +// CHECK:STDOUT: %import_ref.11 = import_ref Main//convert_symbolic, loc13_45, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .IntLiteral = imports.%import_ref.1 +// CHECK:STDOUT: .Int = imports.%import_ref.2 +// CHECK:STDOUT: .ToLiteral = imports.%import_ref.3 +// CHECK:STDOUT: .FromLiteral = imports.%import_ref.4 +// CHECK:STDOUT: .Make = imports.%import_ref.5 +// CHECK:STDOUT: .OtherInt = imports.%import_ref.6 +// CHECK:STDOUT: .MakeFromClass = imports.%import_ref.7 +// CHECK:STDOUT: .m = %m +// CHECK:STDOUT: .n = %n +// CHECK:STDOUT: } +// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: %Int.ref.loc6: %Int.type = name_ref Int, imports.%import_ref.2 [template = constants.%Int] +// CHECK:STDOUT: %int_64.loc6: Core.IntLiteral = int_value 64 [template = constants.%int_64.1] +// CHECK:STDOUT: %int.make_type_signed.loc6: init type = call %Int.ref.loc6(%int_64.loc6) [template = constants.%i64.builtin] +// CHECK:STDOUT: %.loc6_14.1: type = value_of_initializer %int.make_type_signed.loc6 [template = constants.%i64.builtin] +// CHECK:STDOUT: %.loc6_14.2: type = converted %int.make_type_signed.loc6, %.loc6_14.1 [template = constants.%i64.builtin] +// CHECK:STDOUT: %m.var: ref %i64.builtin = var m +// CHECK:STDOUT: %m: ref %i64.builtin = bind_name m, %m.var +// CHECK:STDOUT: %Int.ref.loc7: %Int.type = name_ref Int, imports.%import_ref.2 [template = constants.%Int] +// CHECK:STDOUT: %int_64.loc7: Core.IntLiteral = int_value 64 [template = constants.%int_64.1] +// CHECK:STDOUT: %int.make_type_signed.loc7: init type = call %Int.ref.loc7(%int_64.loc7) [template = constants.%i64.builtin] +// CHECK:STDOUT: %.loc7_14.1: type = value_of_initializer %int.make_type_signed.loc7 [template = constants.%i64.builtin] +// CHECK:STDOUT: %.loc7_14.2: type = converted %int.make_type_signed.loc7, %.loc7_14.1 [template = constants.%i64.builtin] +// CHECK:STDOUT: %n.var: ref %i64.builtin = var n +// CHECK:STDOUT: %n: ref %i64.builtin = bind_name n, %n.var +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: class @OtherInt [from "convert_symbolic.carbon"] { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = imports.%import_ref.10 +// CHECK:STDOUT: .ToLiteral = imports.%import_ref.11 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Int(%n.param_patt: Core.IntLiteral) -> type = "int.make_type_signed" [from "convert_symbolic.carbon"]; +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Make(constants.%N.1: %i32.builtin) [from "convert_symbolic.carbon"] { +// CHECK:STDOUT: %N: %i32.builtin = bind_symbolic_name N, 0 [symbolic = %N (constants.%N.1)] +// CHECK:STDOUT: %N.patt: %i32.builtin = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt.1)] +// CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call constants.%ToLiteral.1(%N) [symbolic = %int.convert_checked (constants.%int.convert_checked.1)] +// CHECK:STDOUT: %iN.builtin: type = int_type signed, %int.convert_checked [symbolic = %iN.builtin (constants.%iN.builtin.1)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete: = require_complete_type @Make.%iN.builtin (%iN.builtin.1) [symbolic = %require_complete (constants.%require_complete.1)] +// CHECK:STDOUT: %Make.specific_fn: = specific_function constants.%Make, @Make(%N) [symbolic = %Make.specific_fn (constants.%Make.specific_fn.1)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn(%N.param_patt: %i32.builtin) -> @Make.%iN.builtin (%iN.builtin.1); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @ToLiteral.1(%n.param_patt: %i32.builtin) -> Core.IntLiteral = "int.convert_checked" [from "convert_symbolic.carbon"]; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @FromLiteral(%n.param_patt: Core.IntLiteral) -> %i32.builtin = "int.convert_checked" [from "convert_symbolic.carbon"]; +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @MakeFromClass(constants.%N.2: %OtherInt) [from "convert_symbolic.carbon"] { +// CHECK:STDOUT: %N: %OtherInt = bind_symbolic_name N, 0 [symbolic = %N (constants.%N.2)] +// CHECK:STDOUT: %N.patt: %OtherInt = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt.2)] +// CHECK:STDOUT: %ToLiteral.bound: = bound_method %N, constants.%ToLiteral.2 [symbolic = %ToLiteral.bound (constants.%ToLiteral.bound.1)] +// CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %ToLiteral.bound(%N) [symbolic = %int.convert_checked (constants.%int.convert_checked.2)] +// CHECK:STDOUT: %iN.builtin: type = int_type signed, %int.convert_checked [symbolic = %iN.builtin (constants.%iN.builtin.2)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete: = require_complete_type @MakeFromClass.%iN.builtin (%iN.builtin.2) [symbolic = %require_complete (constants.%require_complete.2)] +// CHECK:STDOUT: %MakeFromClass.specific_fn: = specific_function constants.%MakeFromClass, @MakeFromClass(%N) [symbolic = %MakeFromClass.specific_fn (constants.%MakeFromClass.specific_fn.1)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn(%N.param_patt: %OtherInt) -> @MakeFromClass.%iN.builtin (%iN.builtin.2); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @ToLiteral.2[%self.param_patt: %OtherInt]() -> Core.IntLiteral = "int.convert_checked" [from "convert_symbolic.carbon"]; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @__global_init() { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Make.ref: %Make.type = name_ref Make, imports.%import_ref.5 [template = constants.%Make] +// CHECK:STDOUT: %FromLiteral.ref.loc6: %FromLiteral.type = name_ref FromLiteral, imports.%import_ref.4 [template = constants.%FromLiteral] +// CHECK:STDOUT: %int_64.loc6: Core.IntLiteral = int_value 64 [template = constants.%int_64.1] +// CHECK:STDOUT: %int.convert_checked.loc6: init %i32.builtin = call %FromLiteral.ref.loc6(%int_64.loc6) [template = constants.%int_64.2] +// CHECK:STDOUT: %.loc6_38.1: %i32.builtin = value_of_initializer %int.convert_checked.loc6 [template = constants.%int_64.2] +// CHECK:STDOUT: %.loc6_38.2: %i32.builtin = converted %int.convert_checked.loc6, %.loc6_38.1 [template = constants.%int_64.2] +// CHECK:STDOUT: %Make.specific_fn: = specific_function %Make.ref, @Make(constants.%int_64.2) [template = constants.%Make.specific_fn.2] +// CHECK:STDOUT: %Make.call: init %i64.builtin = call %Make.specific_fn() +// CHECK:STDOUT: assign file.%m.var, %Make.call +// CHECK:STDOUT: %MakeFromClass.ref: %MakeFromClass.type = name_ref MakeFromClass, imports.%import_ref.7 [template = constants.%MakeFromClass] +// CHECK:STDOUT: %FromLiteral.ref.loc7: %FromLiteral.type = name_ref FromLiteral, imports.%import_ref.4 [template = constants.%FromLiteral] +// CHECK:STDOUT: %int_64.loc7: Core.IntLiteral = int_value 64 [template = constants.%int_64.1] +// CHECK:STDOUT: %int.convert_checked.loc7: init %i32.builtin = call %FromLiteral.ref.loc7(%int_64.loc7) [template = constants.%int_64.2] +// CHECK:STDOUT: %OtherInt.ref: type = name_ref OtherInt, imports.%import_ref.6 [template = constants.%OtherInt] +// CHECK:STDOUT: %.loc7_48.1: init %OtherInt = as_compatible %int.convert_checked.loc7 [template = constants.%int_64.2] +// CHECK:STDOUT: %.loc7_48.2: init %OtherInt = converted %int.convert_checked.loc7, %.loc7_48.1 [template = constants.%int_64.2] +// CHECK:STDOUT: %.loc7_59.1: %OtherInt = value_of_initializer %.loc7_48.2 [template = constants.%int_64.2] +// CHECK:STDOUT: %.loc7_59.2: %OtherInt = converted %.loc7_48.2, %.loc7_59.1 [template = constants.%int_64.2] +// CHECK:STDOUT: %MakeFromClass.specific_fn: = specific_function %MakeFromClass.ref, @MakeFromClass(constants.%int_64.2) [template = constants.%MakeFromClass.specific_fn.2] +// CHECK:STDOUT: %MakeFromClass.call: init %i64.builtin = call %MakeFromClass.specific_fn() +// CHECK:STDOUT: assign file.%n.var, %MakeFromClass.call +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Make(constants.%N.1) { +// CHECK:STDOUT: %N => constants.%N.1 +// CHECK:STDOUT: %N.patt => constants.%N.1 +// CHECK:STDOUT: %int.convert_checked => constants.%int.convert_checked.1 +// CHECK:STDOUT: %iN.builtin => constants.%iN.builtin.1 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete => constants.%require_complete.1 +// CHECK:STDOUT: %Make.specific_fn => constants.%Make.specific_fn.1 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Make(%N) {} +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Make(constants.%int_64.2) { +// CHECK:STDOUT: %N => constants.%int_64.2 +// CHECK:STDOUT: %N.patt => constants.%int_64.2 +// CHECK:STDOUT: %int.convert_checked => constants.%int_64.1 +// CHECK:STDOUT: %iN.builtin => constants.%i64.builtin +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete => constants.%complete_type.2 +// CHECK:STDOUT: %Make.specific_fn => constants.%Make.specific_fn.2 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @MakeFromClass(constants.%N.2) { +// CHECK:STDOUT: %N => constants.%N.2 +// CHECK:STDOUT: %N.patt => constants.%N.2 +// CHECK:STDOUT: %ToLiteral.bound => constants.%ToLiteral.bound.1 +// CHECK:STDOUT: %int.convert_checked => constants.%int.convert_checked.2 +// CHECK:STDOUT: %iN.builtin => constants.%iN.builtin.2 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete => constants.%require_complete.2 +// CHECK:STDOUT: %MakeFromClass.specific_fn => constants.%MakeFromClass.specific_fn.1 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @MakeFromClass(%N) {} +// CHECK:STDOUT: +// CHECK:STDOUT: specific @MakeFromClass(constants.%int_64.2) { +// CHECK:STDOUT: %N => constants.%int_64.2 +// CHECK:STDOUT: %N.patt => constants.%int_64.2 +// CHECK:STDOUT: %ToLiteral.bound => constants.%ToLiteral.bound.2 +// CHECK:STDOUT: %int.convert_checked => constants.%int_64.1 +// CHECK:STDOUT: %iN.builtin => constants.%i64.builtin +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete => constants.%complete_type.2 +// CHECK:STDOUT: %MakeFromClass.specific_fn => constants.%MakeFromClass.specific_fn.2 +// CHECK:STDOUT: } +// CHECK:STDOUT: From c99c9c41cff74f9ea1a479b0f19d7fe97ab390bb Mon Sep 17 00:00:00 2001 From: Boaz Brickner Date: Tue, 17 Dec 2024 17:37:31 +0100 Subject: [PATCH 41/68] Do not load prelude files to the test file system in no-prelude tests (#4697) These tests do not import prelude so the files do not need to exist, and only make the tests more complex, as they include extra unnecessary inputs. --- toolchain/testing/file_test.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/toolchain/testing/file_test.cpp b/toolchain/testing/file_test.cpp index eae4d78165ae8..60279793483f1 100644 --- a/toolchain/testing/file_test.cpp +++ b/toolchain/testing/file_test.cpp @@ -38,8 +38,10 @@ class ToolchainFileTest : public FileTestBase { llvm::raw_pwrite_stream& stdout, llvm::raw_pwrite_stream& stderr) -> ErrorOr override { CARBON_ASSIGN_OR_RETURN(auto prelude, installation_.ReadPreludeManifest()); - for (const auto& file : prelude) { - CARBON_RETURN_IF_ERROR(AddFile(*fs, file)); + if (!is_no_prelude()) { + for (const auto& file : prelude) { + CARBON_RETURN_IF_ERROR(AddFile(*fs, file)); + } } Driver driver(fs, &installation_, stdout, stderr); @@ -83,8 +85,7 @@ class ToolchainFileTest : public FileTestBase { // For `lex` and `parse`, we don't need to import the prelude; exclude it to // focus errors. In other phases we only do this for explicit "no_prelude" // tests. - if (component_ == "lex" || component_ == "parse" || - test_name().find("/no_prelude/") != llvm::StringRef::npos) { + if (component_ == "lex" || component_ == "parse" || is_no_prelude()) { args.push_back("--no-prelude-import"); } @@ -161,6 +162,10 @@ class ToolchainFileTest : public FileTestBase { return test_name; } + auto is_no_prelude() const -> bool { + return test_name().find("/no_prelude/") != llvm::StringRef::npos; + } + const llvm::StringRef component_; const InstallPaths installation_; }; From 557c9b022a9aa9545b0bb891dd13af519b5e2c48 Mon Sep 17 00:00:00 2001 From: Geoff Romer Date: Tue, 17 Dec 2024 11:15:27 -0800 Subject: [PATCH 42/68] Remove `CHECK` from `GetCurrentReturnSlot` (#4688) `GetCurrentReturnSlot` is sometimes called when there is no return slot while checking incorrect Carbon code. This change also updates `fail_returned_var_no_return_type.carbon` to cover one such case. --- toolchain/check/return.cpp | 2 +- .../fail_returned_var_no_return_type.carbon | 69 +++++++++++++++++-- 2 files changed, 64 insertions(+), 7 deletions(-) diff --git a/toolchain/check/return.cpp b/toolchain/check/return.cpp index e115acb4f03d1..f40c22ee7e9b1 100644 --- a/toolchain/check/return.cpp +++ b/toolchain/check/return.cpp @@ -28,7 +28,6 @@ static auto GetCurrentReturnSlot(Context& context) -> SemIR::InstId { auto return_slot_id = context.scope_stack() .LookupInLexicalScopes(SemIR::NameId::ReturnSlot) .first; - CARBON_CHECK(return_slot_id.is_valid()); return return_slot_id; } @@ -176,6 +175,7 @@ auto BuildReturnWithExpr(Context& context, Parse::ReturnStatementId node_id, expr_id = SemIR::ErrorInst::SingletonInstId; } else if (return_info.has_return_slot()) { return_slot_id = GetCurrentReturnSlot(context); + CARBON_CHECK(return_slot_id.is_valid()); // Note that this can import a function and invalidate `function`. expr_id = Initialize(context, node_id, return_slot_id, expr_id); } else { diff --git a/toolchain/check/testdata/return/fail_returned_var_no_return_type.carbon b/toolchain/check/testdata/return/fail_returned_var_no_return_type.carbon index 97a3ad3814978..67376a18bbc87 100644 --- a/toolchain/check/testdata/return/fail_returned_var_no_return_type.carbon +++ b/toolchain/check/testdata/return/fail_returned_var_no_return_type.carbon @@ -8,18 +8,38 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/return/fail_returned_var_no_return_type.carbon +// --- fail_procedure_with_returned_var.carbon + +library "[[@TEST_NAME]]"; + fn Procedure() { - // CHECK:STDERR: fail_returned_var_no_return_type.carbon:[[@LINE+6]]:3: error: cannot declare a `returned var` in this function [ReturnedVarWithNoReturnType] + // CHECK:STDERR: fail_procedure_with_returned_var.carbon:[[@LINE+7]]:3: error: cannot declare a `returned var` in this function [ReturnedVarWithNoReturnType] // CHECK:STDERR: returned var v: () = (); // CHECK:STDERR: ^~~~~~~~ - // CHECK:STDERR: fail_returned_var_no_return_type.carbon:[[@LINE-4]]:1: note: there was no return type provided [ReturnTypeOmittedNote] + // CHECK:STDERR: fail_procedure_with_returned_var.carbon:[[@LINE-4]]:1: note: there was no return type provided [ReturnTypeOmittedNote] // CHECK:STDERR: fn Procedure() { // CHECK:STDERR: ^~~~~~~~~~~~~~~~ + // CHECK:STDERR: returned var v: () = (); return; } -// CHECK:STDOUT: --- fail_returned_var_no_return_type.carbon +// --- fail_forgot_return_type.carbon + +library "[[@TEST_NAME]]"; + +fn ForgotReturnType() { + // CHECK:STDERR: fail_forgot_return_type.carbon:[[@LINE+6]]:3: error: cannot declare a `returned var` in this function [ReturnedVarWithNoReturnType] + // CHECK:STDERR: returned var v: () = (); + // CHECK:STDERR: ^~~~~~~~ + // CHECK:STDERR: fail_forgot_return_type.carbon:[[@LINE-4]]:1: note: there was no return type provided [ReturnTypeOmittedNote] + // CHECK:STDERR: fn ForgotReturnType() { + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~ + returned var v: () = (); + return var; +} + +// CHECK:STDOUT: --- fail_procedure_with_returned_var.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %Procedure.type: type = fn_type @Procedure [template] @@ -45,11 +65,48 @@ fn Procedure() { // CHECK:STDOUT: // CHECK:STDOUT: fn @Procedure() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc18_20.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc18_20.2: type = converted %.loc18_20.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] +// CHECK:STDOUT: %.loc12_20.1: %empty_tuple.type = tuple_literal () +// CHECK:STDOUT: %.loc12_20.2: type = converted %.loc12_20.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %v: %empty_tuple.type = bind_name v, -// CHECK:STDOUT: %.loc18_25: %empty_tuple.type = tuple_literal () +// CHECK:STDOUT: %.loc12_25: %empty_tuple.type = tuple_literal () // CHECK:STDOUT: assign , // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: --- fail_forgot_return_type.carbon +// CHECK:STDOUT: +// CHECK:STDOUT: constants { +// CHECK:STDOUT: %ForgotReturnType.type: type = fn_type @ForgotReturnType [template] +// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template] +// CHECK:STDOUT: %ForgotReturnType: %ForgotReturnType.type = struct_value () [template] +// CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [template] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: import Core//prelude +// CHECK:STDOUT: import Core//prelude/... +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .ForgotReturnType = %ForgotReturnType.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %ForgotReturnType.decl: %ForgotReturnType.type = fn_decl @ForgotReturnType [template = constants.%ForgotReturnType] {} {} +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @ForgotReturnType() { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %.loc11_20.1: %empty_tuple.type = tuple_literal () +// CHECK:STDOUT: %.loc11_20.2: type = converted %.loc11_20.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] +// CHECK:STDOUT: %v: %empty_tuple.type = bind_name v, +// CHECK:STDOUT: %.loc11_25: %empty_tuple.type = tuple_literal () +// CHECK:STDOUT: assign , +// CHECK:STDOUT: %tuple: %empty_tuple.type = tuple_value () [template = constants.%empty_tuple] +// CHECK:STDOUT: %.loc11_16: %empty_tuple.type = converted %v, %tuple [template = constants.%empty_tuple] +// CHECK:STDOUT: return %.loc11_16 +// CHECK:STDOUT: } +// CHECK:STDOUT: From 6b3307c5205f1bfd0731bdb89692baef092783ba Mon Sep 17 00:00:00 2001 From: josh11b <15258583+josh11b@users.noreply.github.com> Date: Tue, 17 Dec 2024 11:19:52 -0800 Subject: [PATCH 43/68] Support `StructValue` in `StringifyTypeExpr` (#4696) Co-authored-by: Josh L Co-authored-by: Richard Smith --- .../testdata/class/generic/stringify.carbon | 200 +++++++++++++++++- toolchain/check/testdata/struct/import.carbon | 4 +- toolchain/sem_ir/stringify_type.cpp | 28 ++- 3 files changed, 223 insertions(+), 9 deletions(-) diff --git a/toolchain/check/testdata/class/generic/stringify.carbon b/toolchain/check/testdata/class/generic/stringify.carbon index da19b282e9d79..8c4a9b0f34541 100644 --- a/toolchain/check/testdata/class/generic/stringify.carbon +++ b/toolchain/check/testdata/class/generic/stringify.carbon @@ -52,14 +52,41 @@ library "[[@TEST_NAME]]"; class C(N:! i32) {} -// CHECK:STDERR: fail_int_value.carbon:[[@LINE+6]]:1: error: cannot implicitly convert from `()` to `C(123)` [ImplicitAsConversionFailure] +// CHECK:STDERR: fail_int_value.carbon:[[@LINE+7]]:1: error: cannot implicitly convert from `()` to `C(123)` [ImplicitAsConversionFailure] // CHECK:STDERR: var v: C(123) = (); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_int_value.carbon:[[@LINE+3]]:1: note: type `()` does not implement interface `Core.ImplicitAs(C(123))` [MissingImplInMemberAccessNote] +// CHECK:STDERR: fail_int_value.carbon:[[@LINE+4]]:1: note: type `()` does not implement interface `Core.ImplicitAs(C(123))` [MissingImplInMemberAccessNote] // CHECK:STDERR: var v: C(123) = (); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: var v: C(123) = (); +// --- fail_class_param.carbon + +library "[[@TEST_NAME]]"; + +class D { + var a: i32; + var b: i32; +} + +class E(F:! D) {} + +// CHECK:STDERR: fail_class_param.carbon:[[@LINE+13]]:8: error: argument for generic parameter is not a compile-time constant [CompTimeArgumentNotConstant] +// 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+6]]:36: error: argument for generic parameter is not a compile-time constant [CompTimeArgumentNotConstant] +// 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: ^ +var g: E({.a = 1, .b = 2}) = {} as E({.a = 3, .b = 4} as D); + // CHECK:STDOUT: --- fail_empty_params.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -327,8 +354,8 @@ var v: C(123) = (); // CHECK:STDOUT: %Convert.bound: = bound_method %int_123, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_123) [template = constants.%int_123.2] -// CHECK:STDOUT: %.loc12_13.1: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_123.2] -// CHECK:STDOUT: %.loc12_13.2: %i32 = converted %int_123, %.loc12_13.1 [template = constants.%int_123.2] +// CHECK:STDOUT: %.loc13_13.1: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_123.2] +// CHECK:STDOUT: %.loc13_13.2: %i32 = converted %int_123, %.loc13_13.1 [template = constants.%int_123.2] // CHECK:STDOUT: %C: type = class_type @C, @C(constants.%int_123.2) [template = constants.%C.2] // CHECK:STDOUT: %v.var: ref %C.2 = var v // CHECK:STDOUT: %v: ref %C.2 = bind_name v, %v.var @@ -351,8 +378,8 @@ var v: C(123) = (); // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc12_18: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc12_19: %C.2 = converted %.loc12_18, [template = ] +// CHECK:STDOUT: %.loc13_18: %empty_tuple.type = tuple_literal () +// CHECK:STDOUT: %.loc13_19: %C.2 = converted %.loc13_18, [template = ] // CHECK:STDOUT: assign file.%v.var, // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -369,3 +396,164 @@ var v: C(123) = (); // CHECK:STDOUT: !definition: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: --- fail_class_param.carbon +// CHECK:STDOUT: +// CHECK:STDOUT: constants { +// CHECK:STDOUT: %D: type = class_type @D [template] +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] +// CHECK:STDOUT: %D.elem: type = unbound_element_type %D, %i32 [template] +// CHECK:STDOUT: %struct_type.a.b.1: type = struct_type {.a: %i32, .b: %i32} [template] +// CHECK:STDOUT: %complete_type.3: = complete_type_witness %struct_type.a.b.1 [template] +// CHECK:STDOUT: %F: %D = bind_symbolic_name F, 0 [symbolic] +// CHECK:STDOUT: %F.patt: %D = symbolic_binding_pattern F, 0 [symbolic] +// CHECK:STDOUT: %E.type: type = generic_class_type @E [template] +// CHECK:STDOUT: %E.generic: %E.type = struct_value () [template] +// CHECK:STDOUT: %E: type = class_type @E, @E(%F) [symbolic] +// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] +// CHECK:STDOUT: %complete_type.4: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] +// CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] +// CHECK:STDOUT: %struct_type.a.b.2: type = struct_type {.a: Core.IntLiteral, .b: Core.IntLiteral} [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] +// CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] +// CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] +// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.10 [template] +// CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] +// CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] +// CHECK:STDOUT: %D.val.1: %D = struct_value (%int_1.2, %int_2.2) [template] +// CHECK:STDOUT: %int_3.1: Core.IntLiteral = int_value 3 [template] +// CHECK:STDOUT: %int_4.1: Core.IntLiteral = int_value 4 [template] +// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_3.1, %Convert.10 [template] +// CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.2(%int_32) [template] +// CHECK:STDOUT: %int_3.2: %i32 = int_value 3 [template] +// CHECK:STDOUT: %Convert.bound.4: = bound_method %int_4.1, %Convert.10 [template] +// CHECK:STDOUT: %Convert.specific_fn.4: = specific_function %Convert.bound.4, @Convert.2(%int_32) [template] +// CHECK:STDOUT: %int_4.2: %i32 = int_value 4 [template] +// CHECK:STDOUT: %D.val.2: %D = struct_value (%int_3.2, %int_4.2) [template] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int = %import_ref.1 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 +// CHECK:STDOUT: import Core//prelude +// CHECK:STDOUT: import Core//prelude/... +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .D = %D.decl +// CHECK:STDOUT: .E = %E.decl +// CHECK:STDOUT: .g = %g +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %D.decl: type = class_decl @D [template = constants.%D] {} {} +// CHECK:STDOUT: %E.decl: %E.type = class_decl @E [template = constants.%E.generic] { +// CHECK:STDOUT: %F.patt.loc9_9.1: %D = symbolic_binding_pattern F, 0 [symbolic = %F.patt.loc9_9.2 (constants.%F.patt)] +// CHECK:STDOUT: %F.param_patt: %D = value_param_pattern %F.patt.loc9_9.1, runtime_param [symbolic = %F.patt.loc9_9.2 (constants.%F.patt)] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [template = constants.%D] +// CHECK:STDOUT: %F.param: %D = value_param runtime_param +// CHECK:STDOUT: %F.loc9_9.1: %D = bind_symbolic_name F, 0, %F.param [symbolic = %F.loc9_9.2 (constants.%F)] +// CHECK:STDOUT: } +// CHECK:STDOUT: %E.ref: %E.type = name_ref E, %E.decl [template = constants.%E.generic] +// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] +// CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] +// CHECK:STDOUT: %.loc24_25.1: %struct_type.a.b.2 = struct_literal (%int_1, %int_2) +// CHECK:STDOUT: %impl.elem0.loc24_25.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %Convert.bound.loc24_25.1: = bound_method %int_1, %impl.elem0.loc24_25.1 [template = constants.%Convert.bound.1] +// CHECK:STDOUT: %Convert.specific_fn.loc24_25.1: = specific_function %Convert.bound.loc24_25.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] +// CHECK:STDOUT: %int.convert_checked.loc24_25.1: init %i32 = call %Convert.specific_fn.loc24_25.1(%int_1) [template = constants.%int_1.2] +// CHECK:STDOUT: %.loc24_25.2: init %i32 = converted %int_1, %int.convert_checked.loc24_25.1 [template = constants.%int_1.2] +// CHECK:STDOUT: %.loc24_25.3: ref %D = temporary_storage +// CHECK:STDOUT: %.loc24_25.4: ref %i32 = class_element_access %.loc24_25.3, element0 +// CHECK:STDOUT: %.loc24_25.5: init %i32 = initialize_from %.loc24_25.2 to %.loc24_25.4 [template = constants.%int_1.2] +// CHECK:STDOUT: %impl.elem0.loc24_25.2: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %Convert.bound.loc24_25.2: = bound_method %int_2, %impl.elem0.loc24_25.2 [template = constants.%Convert.bound.2] +// CHECK:STDOUT: %Convert.specific_fn.loc24_25.2: = specific_function %Convert.bound.loc24_25.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] +// CHECK:STDOUT: %int.convert_checked.loc24_25.2: init %i32 = call %Convert.specific_fn.loc24_25.2(%int_2) [template = constants.%int_2.2] +// CHECK:STDOUT: %.loc24_25.6: init %i32 = converted %int_2, %int.convert_checked.loc24_25.2 [template = constants.%int_2.2] +// CHECK:STDOUT: %.loc24_25.7: ref %i32 = class_element_access %.loc24_25.3, element1 +// CHECK:STDOUT: %.loc24_25.8: init %i32 = initialize_from %.loc24_25.6 to %.loc24_25.7 [template = constants.%int_2.2] +// CHECK:STDOUT: %.loc24_25.9: init %D = class_init (%.loc24_25.5, %.loc24_25.8), %.loc24_25.3 [template = constants.%D.val.1] +// CHECK:STDOUT: %.loc24_25.10: ref %D = temporary %.loc24_25.3, %.loc24_25.9 +// CHECK:STDOUT: %.loc24_26.1: ref %D = converted %.loc24_25.1, %.loc24_25.10 +// CHECK:STDOUT: %.loc24_26.2: %D = bind_value %.loc24_26.1 +// CHECK:STDOUT: %g.var: ref = var g +// CHECK:STDOUT: %g: ref = bind_name g, %g.var +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: class @D { +// CHECK:STDOUT: %int_32.loc5: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc5: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc5: %D.elem = field_decl a, element0 [template] +// CHECK:STDOUT: %int_32.loc6: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc6: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc6: %D.elem = field_decl b, element1 [template] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a.b.1 [template = constants.%complete_type.3] +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = constants.%D +// CHECK:STDOUT: .a = %.loc5 +// CHECK:STDOUT: .b = %.loc6 +// CHECK:STDOUT: complete_type_witness = %complete_type +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic class @E(%F.loc9_9.1: %D) { +// CHECK:STDOUT: %F.loc9_9.2: %D = bind_symbolic_name F, 0 [symbolic = %F.loc9_9.2 (constants.%F)] +// CHECK:STDOUT: %F.patt.loc9_9.2: %D = symbolic_binding_pattern F, 0 [symbolic = %F.patt.loc9_9.2 (constants.%F.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: class { +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.4] +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = constants.%E +// CHECK:STDOUT: complete_type_witness = %complete_type +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @__global_init() { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %.loc24_31: %empty_struct_type = struct_literal () +// CHECK:STDOUT: %E.ref: %E.type = name_ref E, file.%E.decl [template = constants.%E.generic] +// CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] +// CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [template = constants.%int_4.1] +// CHECK:STDOUT: %.loc24_53.1: %struct_type.a.b.2 = struct_literal (%int_3, %int_4) +// CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [template = constants.%D] +// CHECK:STDOUT: %impl.elem0.loc24_53.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %Convert.bound.loc24_53.1: = bound_method %int_3, %impl.elem0.loc24_53.1 [template = constants.%Convert.bound.3] +// CHECK:STDOUT: %Convert.specific_fn.loc24_53.1: = specific_function %Convert.bound.loc24_53.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] +// CHECK:STDOUT: %int.convert_checked.loc24_53.1: init %i32 = call %Convert.specific_fn.loc24_53.1(%int_3) [template = constants.%int_3.2] +// CHECK:STDOUT: %.loc24_53.2: init %i32 = converted %int_3, %int.convert_checked.loc24_53.1 [template = constants.%int_3.2] +// CHECK:STDOUT: %.loc24_53.3: ref %D = temporary_storage +// CHECK:STDOUT: %.loc24_53.4: ref %i32 = class_element_access %.loc24_53.3, element0 +// CHECK:STDOUT: %.loc24_53.5: init %i32 = initialize_from %.loc24_53.2 to %.loc24_53.4 [template = constants.%int_3.2] +// CHECK:STDOUT: %impl.elem0.loc24_53.2: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %Convert.bound.loc24_53.2: = bound_method %int_4, %impl.elem0.loc24_53.2 [template = constants.%Convert.bound.4] +// CHECK:STDOUT: %Convert.specific_fn.loc24_53.2: = specific_function %Convert.bound.loc24_53.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.4] +// CHECK:STDOUT: %int.convert_checked.loc24_53.2: init %i32 = call %Convert.specific_fn.loc24_53.2(%int_4) [template = constants.%int_4.2] +// CHECK:STDOUT: %.loc24_53.6: init %i32 = converted %int_4, %int.convert_checked.loc24_53.2 [template = constants.%int_4.2] +// CHECK:STDOUT: %.loc24_53.7: ref %i32 = class_element_access %.loc24_53.3, element1 +// CHECK:STDOUT: %.loc24_53.8: init %i32 = initialize_from %.loc24_53.6 to %.loc24_53.7 [template = constants.%int_4.2] +// CHECK:STDOUT: %.loc24_53.9: init %D = class_init (%.loc24_53.5, %.loc24_53.8), %.loc24_53.3 [template = constants.%D.val.2] +// CHECK:STDOUT: %.loc24_53.10: ref %D = temporary %.loc24_53.3, %.loc24_53.9 +// CHECK:STDOUT: %.loc24_55.1: ref %D = converted %.loc24_53.1, %.loc24_53.10 +// CHECK:STDOUT: %.loc24_55.2: %D = bind_value %.loc24_55.1 +// CHECK:STDOUT: assign file.%g.var, +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @E(constants.%F) { +// CHECK:STDOUT: %F.loc9_9.2 => constants.%F +// CHECK:STDOUT: %F.patt.loc9_9.2 => constants.%F +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/struct/import.carbon b/toolchain/check/testdata/struct/import.carbon index 66bd8fddb6908..b0a4fbae02488 100644 --- a/toolchain/check/testdata/struct/import.carbon +++ b/toolchain/check/testdata/struct/import.carbon @@ -43,10 +43,10 @@ var c_bad: C({.c = 1, .d = 2}) = F(); // --- fail_bad_value.impl.carbon impl package Implicit; -// CHECK:STDERR: fail_bad_value.impl.carbon:[[@LINE+6]]:1: error: cannot implicitly convert from `C()` to `C()` [ImplicitAsConversionFailure] +// CHECK:STDERR: fail_bad_value.impl.carbon:[[@LINE+6]]:1: error: cannot implicitly convert from `C({.a = 1, .b = 2})` to `C({.a = 3, .b = 4})` [ImplicitAsConversionFailure] // CHECK:STDERR: var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_bad_value.impl.carbon:[[@LINE+3]]:1: note: type `C()` does not implement interface `Core.ImplicitAs(C())` [MissingImplInMemberAccessNote] +// CHECK:STDERR: fail_bad_value.impl.carbon:[[@LINE+3]]:1: note: type `C({.a = 1, .b = 2})` does not implement interface `Core.ImplicitAs(C({.a = 3, .b = 4}))` [MissingImplInMemberAccessNote] // CHECK:STDERR: var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ var c_bad: C({.a = 3, .b = 4}) = F(); diff --git a/toolchain/sem_ir/stringify_type.cpp b/toolchain/sem_ir/stringify_type.cpp index 392080b74ae3c..641913af72ff6 100644 --- a/toolchain/sem_ir/stringify_type.cpp +++ b/toolchain/sem_ir/stringify_type.cpp @@ -441,6 +441,33 @@ auto StringifyTypeExpr(const SemIR::File& sem_ir, InstId outer_inst_id) } break; } + case CARBON_KIND(StructValue inst): { + auto field_values = sem_ir.inst_blocks().Get(inst.elements_id); + if (field_values.empty()) { + out << "{}"; + break; + } + auto struct_type = sem_ir.types().GetAs( + sem_ir.types().GetObjectRepr(inst.type_id)); + auto fields = sem_ir.struct_type_fields().Get(struct_type.fields_id); + if (fields.size() != field_values.size()) { + out << "{}"; + break; + } + out << "{"; + step_stack.PushString("}"); + for (auto index : llvm::reverse(llvm::seq(fields.size()))) { + SemIR::InstId value_inst_id = field_values[index]; + step_stack.PushInstId(value_inst_id); + step_stack.PushString(" = "); + step_stack.PushNameId(fields[index].name_id); + step_stack.PushString("."); + if (index > 0) { + step_stack.PushString(", "); + } + } + break; + } case CARBON_KIND(TupleType inst): { auto refs = sem_ir.type_blocks().Get(inst.elements_id); if (refs.empty()) { @@ -544,7 +571,6 @@ auto StringifyTypeExpr(const SemIR::File& sem_ir, InstId outer_inst_id) case StructAccess::Kind: case StructInit::Kind: case StructLiteral::Kind: - case StructValue::Kind: case SymbolicBindingPattern::Kind: case Temporary::Kind: case TemporaryStorage::Kind: From 9c8773da1b50618bde4981bb8e311670b6d0c7fc Mon Sep 17 00:00:00 2001 From: Boaz Brickner Date: Tue, 17 Dec 2024 22:08:26 +0100 Subject: [PATCH 44/68] Basic name poisoning support (#4654) https://github.com/carbon-language/carbon-lang/issues/4622 When using an unqualified name, disallow declaring that name in all scopes that would make it ambiguous in retrospect. Doesn't include support for poisoning in `impl library` (see new test for that with TODO). Implemented by introduce `InstId::PoisonedName` and entries with it to `NameScope`. --------- Co-authored-by: Dana Jansens Co-authored-by: Richard Smith Co-authored-by: Geoff Romer Co-authored-by: Jon Ross-Perkins Co-authored-by: josh11b Co-authored-by: josh11b <15258583+josh11b@users.noreply.github.com> Co-authored-by: Chandler Carruth Co-authored-by: Carbon Infra Bot --- toolchain/check/context.cpp | 30 +- toolchain/check/context.h | 3 + toolchain/check/decl_name_stack.cpp | 29 +- toolchain/check/decl_name_stack.h | 8 +- toolchain/check/handle_alias.cpp | 2 +- toolchain/check/handle_class.cpp | 8 +- toolchain/check/handle_function.cpp | 5 + toolchain/check/handle_interface.cpp | 9 +- toolchain/check/handle_let_and_var.cpp | 12 +- toolchain/check/handle_namespace.cpp | 11 +- toolchain/check/import.cpp | 4 + toolchain/check/import_ref.cpp | 6 + .../no_prelude/name_poisoning.carbon | 871 ++++++++++++++++-- toolchain/diagnostics/diagnostic_kind.def | 2 + toolchain/sem_ir/formatter.cpp | 4 + toolchain/sem_ir/ids.cpp | 2 + toolchain/sem_ir/ids.h | 7 + toolchain/sem_ir/name_scope.cpp | 17 + toolchain/sem_ir/name_scope.h | 21 +- toolchain/sem_ir/name_scope_test.cpp | 37 + 20 files changed, 997 insertions(+), 91 deletions(-) diff --git a/toolchain/check/context.cpp b/toolchain/check/context.cpp index 40199304e6ce0..03d70ad8df1d0 100644 --- a/toolchain/check/context.cpp +++ b/toolchain/check/context.cpp @@ -222,6 +222,18 @@ auto Context::DiagnoseDuplicateName(SemIRLoc dup_def, SemIRLoc prev_def) .Emit(); } +auto Context::DiagnosePoisonedName(SemIRLoc loc) -> void { + // TODO: Improve the diagnostic to replace NodeId::Invalid with the location + // where the name was poisoned. See discussion in + // https://github.com/carbon-language/carbon-lang/pull/4654#discussion_r1876607172 + CARBON_DIAGNOSTIC(NameUseBeforeDecl, Error, + "name used before it was declared"); + CARBON_DIAGNOSTIC(NameUseBeforeDeclNote, Note, "declared here"); + emitter_->Build(SemIR::LocId::Invalid, NameUseBeforeDecl) + .Note(loc, NameUseBeforeDeclNote) + .Emit(); +} + auto Context::DiagnoseNameNotFound(SemIRLoc loc, SemIR::NameId name_id) -> void { CARBON_DIAGNOSTIC(NameNotFound, Error, "name `{0}` not found", SemIR::NameId); @@ -354,6 +366,8 @@ auto Context::LookupUnqualifiedName(Parse::NodeId node_id, scope_stack().LookupInLexicalScopes(name_id); // Walk the non-lexical scopes and perform lookups into each of them. + // Collect scopes to poison this name when it's found. + llvm::SmallVector scopes_to_poison; for (auto [index, lookup_scope_id, specific_id] : llvm::reverse(non_lexical_scopes)) { if (auto non_lexical_result = @@ -361,8 +375,17 @@ auto Context::LookupUnqualifiedName(Parse::NodeId node_id, LookupScope{.name_scope_id = lookup_scope_id, .specific_id = specific_id}, /*required=*/false); - non_lexical_result.inst_id.is_valid()) { - return non_lexical_result; + !non_lexical_result.inst_id.is_poisoned()) { + if (non_lexical_result.inst_id.is_valid()) { + // Poison the scopes for this name. + for (const auto [scope_id, specific_id] : scopes_to_poison) { + name_scopes().Get(scope_id).AddPoison(name_id); + } + + return non_lexical_result; + } + scopes_to_poison.push_back( + {.name_scope_id = lookup_scope_id, .specific_id = specific_id}); } } @@ -616,7 +639,8 @@ auto Context::LookupQualifiedName(SemIR::LocId loc_id, SemIR::NameId name_id, result.specific_id = specific_id; } - if (required && !result.inst_id.is_valid()) { + if (required && + (!result.inst_id.is_valid() || result.inst_id.is_poisoned())) { if (!has_error) { if (prohibited_accesses.empty()) { DiagnoseMemberNameNotFound(loc_id, name_id, lookup_scopes); diff --git a/toolchain/check/context.h b/toolchain/check/context.h index f884db6dfe33e..7f24d004eca95 100644 --- a/toolchain/check/context.h +++ b/toolchain/check/context.h @@ -246,6 +246,9 @@ class Context { // Prints a diagnostic for a duplicate name. auto DiagnoseDuplicateName(SemIRLoc dup_def, SemIRLoc prev_def) -> void; + // Prints a diagnostic for a poisoned name. + auto DiagnosePoisonedName(SemIRLoc loc) -> void; + // Prints a diagnostic for a missing name. auto DiagnoseNameNotFound(SemIRLoc loc, SemIR::NameId name_id) -> void; diff --git a/toolchain/check/decl_name_stack.cpp b/toolchain/check/decl_name_stack.cpp index ae98f100ebfc0..ca0407c84fa71 100644 --- a/toolchain/check/decl_name_stack.cpp +++ b/toolchain/check/decl_name_stack.cpp @@ -33,6 +33,9 @@ auto DeclNameStack::NameContext::prev_inst_id() -> SemIR::InstId { case NameContext::State::Unresolved: return SemIR::InstId::Invalid; + case NameContext::State::Poisoned: + return SemIR::InstId::PoisonedName; + case NameContext::State::Finished: CARBON_FATAL("Finished state should only be used internally"); } @@ -167,12 +170,15 @@ auto DeclNameStack::AddName(NameContext name_context, SemIR::InstId target_id, } } -auto DeclNameStack::AddNameOrDiagnoseDuplicate(NameContext name_context, - SemIR::InstId target_id, - SemIR::AccessKind access_kind) - -> void { +auto DeclNameStack::AddNameOrDiagnose(NameContext name_context, + SemIR::InstId target_id, + SemIR::AccessKind access_kind) -> void { if (auto id = name_context.prev_inst_id(); id.is_valid()) { - context_->DiagnoseDuplicateName(target_id, id); + if (id.is_poisoned()) { + context_->DiagnosePoisonedName(target_id); + } else { + context_->DiagnoseDuplicateName(target_id, id); + } } else { AddName(name_context, target_id, access_kind); } @@ -260,6 +266,9 @@ auto DeclNameStack::ApplyAndLookupName(NameContext& name_context, // Invalid indicates an unresolved name. Store it and return. name_context.unresolved_name_id = name_id; name_context.state = NameContext::State::Unresolved; + } else if (resolved_inst_id.is_poisoned()) { + name_context.unresolved_name_id = name_id; + name_context.state = NameContext::State::Poisoned; } else { // Store the resolved instruction and continue for the target scope // update. @@ -277,8 +286,14 @@ static auto CheckQualifierIsResolved( CARBON_FATAL("No qualifier to resolve"); case DeclNameStack::NameContext::State::Resolved: + if (name_context.resolved_inst_id.is_poisoned()) { + context.DiagnoseNameNotFound(name_context.loc_id, + name_context.unresolved_name_id); + return false; + } return true; + case DeclNameStack::NameContext::State::Poisoned: case DeclNameStack::NameContext::State::Unresolved: // Because more qualifiers were found, we diagnose that the earlier // qualifier failed to resolve. @@ -367,6 +382,10 @@ auto DeclNameStack::ResolveAsScope(const NameContext& name_context, return InvalidResult; } + if (name_context.resolved_inst_id.is_poisoned()) { + return InvalidResult; + } + auto new_params = DeclParams( name.name_loc_id, name.first_param_node_id, name.last_param_node_id, name.implicit_param_patterns_id, name.param_patterns_id); diff --git a/toolchain/check/decl_name_stack.h b/toolchain/check/decl_name_stack.h index a7c0209fb4b4a..d985e90fde478 100644 --- a/toolchain/check/decl_name_stack.h +++ b/toolchain/check/decl_name_stack.h @@ -78,6 +78,9 @@ class DeclNameStack { // An identifier didn't resolve. Unresolved, + // An identifier was poisoned in this scope. + Poisoned, + // The name has already been finished. This is not set in the name // returned by `FinishName`, but is used internally to track that // `FinishName` has already been called. @@ -231,9 +234,8 @@ class DeclNameStack { SemIR::AccessKind access_kind) -> void; // Adds a name to name lookup. Prints a diagnostic for name conflicts. - auto AddNameOrDiagnoseDuplicate(NameContext name_context, - SemIR::InstId target_id, - SemIR::AccessKind access_kind) -> void; + auto AddNameOrDiagnose(NameContext name_context, SemIR::InstId target_id, + SemIR::AccessKind access_kind) -> void; // Adds a name to name lookup, or returns the existing instruction if this // name has already been declared in this scope. diff --git a/toolchain/check/handle_alias.cpp b/toolchain/check/handle_alias.cpp index 6d15f388422ba..237c5dcce9bed 100644 --- a/toolchain/check/handle_alias.cpp +++ b/toolchain/check/handle_alias.cpp @@ -71,7 +71,7 @@ auto HandleParseNode(Context& context, Parse::AliasId /*node_id*/) -> bool { // Add the name of the binding to the current scope. context.decl_name_stack().PopScope(); - context.decl_name_stack().AddNameOrDiagnoseDuplicate( + context.decl_name_stack().AddNameOrDiagnose( name_context, alias_id, introducer.modifier_set.GetAccessKind()); return true; } diff --git a/toolchain/check/handle_class.cpp b/toolchain/check/handle_class.cpp index c613374896969..3d54e62bbbba2 100644 --- a/toolchain/check/handle_class.cpp +++ b/toolchain/check/handle_class.cpp @@ -113,6 +113,12 @@ static auto MergeOrAddName(Context& context, Parse::AnyClassDeclId node_id, return; } + if (prev_id.is_poisoned()) { + // This is a declaration of a poisoned name. + context.DiagnosePoisonedName(class_decl_id); + return; + } + auto prev_class_id = SemIR::ClassId::Invalid; auto prev_import_ir_id = SemIR::ImportIRId::Invalid; auto prev = context.insts().Get(prev_id); @@ -546,7 +552,7 @@ auto HandleParseNode(Context& context, Parse::BaseDeclId node_id) -> bool { } // Bind the name `base` in the class to the base field. - context.decl_name_stack().AddNameOrDiagnoseDuplicate( + context.decl_name_stack().AddNameOrDiagnose( context.decl_name_stack().MakeUnqualifiedName(node_id, SemIR::NameId::Base), class_info.base_id, introducer.modifier_set.GetAccessKind()); diff --git a/toolchain/check/handle_function.cpp b/toolchain/check/handle_function.cpp index 18677edf52713..92083bd7e5f66 100644 --- a/toolchain/check/handle_function.cpp +++ b/toolchain/check/handle_function.cpp @@ -123,6 +123,11 @@ static auto TryMergeRedecl(Context& context, Parse::AnyFunctionDeclId node_id, return; } + if (prev_id.is_poisoned()) { + context.DiagnosePoisonedName(function_info.latest_decl_id()); + return; + } + auto prev_function_id = SemIR::FunctionId::Invalid; auto prev_import_ir_id = SemIR::ImportIRId::Invalid; CARBON_KIND_SWITCH(context.insts().Get(prev_id)) { diff --git a/toolchain/check/handle_interface.cpp b/toolchain/check/handle_interface.cpp index a981d728f09d7..ce310929e4443 100644 --- a/toolchain/check/handle_interface.cpp +++ b/toolchain/check/handle_interface.cpp @@ -66,8 +66,13 @@ static auto BuildInterfaceDecl(Context& context, auto existing_id = context.decl_name_stack().LookupOrAddName( name_context, interface_decl_id, introducer.modifier_set.GetAccessKind()); if (existing_id.is_valid()) { - if (auto existing_interface_decl = - context.insts().Get(existing_id).TryAs()) { + if (existing_id.is_poisoned()) { + // This is a declaration of a poisoned name. + context.DiagnosePoisonedName(interface_decl_id); + } else if (auto existing_interface_decl = + context.insts() + .Get(existing_id) + .TryAs()) { auto existing_interface = context.interfaces().Get(existing_interface_decl->interface_id); if (CheckRedeclParamsMatch( diff --git a/toolchain/check/handle_let_and_var.cpp b/toolchain/check/handle_let_and_var.cpp index 5967111812c6e..ec21542e5ea21 100644 --- a/toolchain/check/handle_let_and_var.cpp +++ b/toolchain/check/handle_let_and_var.cpp @@ -94,8 +94,8 @@ static auto BuildAssociatedConstantDecl(Context& context, auto assoc_id = BuildAssociatedEntity(context, interface_id, decl_id); auto name_context = context.decl_name_stack().MakeUnqualifiedName(pattern.loc_id, name_id); - context.decl_name_stack().AddNameOrDiagnoseDuplicate(name_context, assoc_id, - access_kind); + context.decl_name_stack().AddNameOrDiagnose(name_context, assoc_id, + access_kind); } // Adds name bindings. Returns the resulting ID for the references. @@ -109,16 +109,16 @@ static auto HandleNameBinding(Context& context, SemIR::InstId pattern_id, auto name_context = context.decl_name_stack().MakeUnqualifiedName( context.insts().GetLocId(pattern_id), context.entity_names().Get(bind_name->entity_name_id).name_id); - context.decl_name_stack().AddNameOrDiagnoseDuplicate( - name_context, pattern_id, access_kind); + context.decl_name_stack().AddNameOrDiagnose(name_context, pattern_id, + access_kind); return bind_name->value_id; } else if (auto field_decl = context.insts().TryGetAs(pattern_id)) { // Introduce the field name into the class. auto name_context = context.decl_name_stack().MakeUnqualifiedName( context.insts().GetLocId(pattern_id), field_decl->name_id); - context.decl_name_stack().AddNameOrDiagnoseDuplicate( - name_context, pattern_id, access_kind); + context.decl_name_stack().AddNameOrDiagnose(name_context, pattern_id, + access_kind); return pattern_id; } else { // TODO: Handle other kinds of pattern. diff --git a/toolchain/check/handle_namespace.cpp b/toolchain/check/handle_namespace.cpp index f4b6e4b22b4f4..e4f027440466d 100644 --- a/toolchain/check/handle_namespace.cpp +++ b/toolchain/check/handle_namespace.cpp @@ -43,10 +43,13 @@ auto HandleParseNode(Context& context, Parse::NamespaceId node_id) -> bool { auto existing_inst_id = context.decl_name_stack().LookupOrAddName( name_context, namespace_id, SemIR::AccessKind::Public); if (existing_inst_id.is_valid()) { - // If there's a name conflict with a namespace, "merge" by using the - // previous declaration. Otherwise, diagnose the issue. - if (auto existing = - context.insts().TryGetAs(existing_inst_id)) { + if (existing_inst_id.is_poisoned()) { + context.DiagnosePoisonedName(namespace_id); + } else if (auto existing = context.insts().TryGetAs( + existing_inst_id)) { + // If there's a name conflict with a namespace, "merge" by using the + // previous declaration. Otherwise, diagnose the issue. + // Point at the other namespace. namespace_inst.name_scope_id = existing->name_scope_id; diff --git a/toolchain/check/import.cpp b/toolchain/check/import.cpp index debb25096df6b..ac05a052bc1a3 100644 --- a/toolchain/check/import.cpp +++ b/toolchain/check/import.cpp @@ -110,6 +110,7 @@ static auto AddNamespace(Context& context, SemIR::TypeId namespace_type_id, SemIR::InstId::Invalid, SemIR::AccessKind::Public); if (!inserted) { auto prev_inst_id = parent_scope->GetEntry(entry_id).inst_id; + CARBON_CHECK(!prev_inst_id.is_poisoned()); if (auto namespace_inst = context.insts().TryGetAs(prev_inst_id)) { if (diagnose_duplicate_namespace) { @@ -333,6 +334,9 @@ static auto ImportScopeFromApiFile(Context& context, auto& impl_scope = context.name_scopes().Get(impl_scope_id); for (const auto& api_entry : api_scope.entries()) { + if (api_entry.inst_id.is_poisoned()) { + continue; + } auto impl_name_id = CopyNameFromImportIR(context, api_sem_ir, api_entry.name_id); if (auto ns = diff --git a/toolchain/check/import_ref.cpp b/toolchain/check/import_ref.cpp index a4d51fd8d4c75..26b0b9576b69b 100644 --- a/toolchain/check/import_ref.cpp +++ b/toolchain/check/import_ref.cpp @@ -1194,6 +1194,9 @@ static auto AddNameScopeImportRefs(ImportContext& context, const SemIR::NameScope& import_scope, SemIR::NameScope& new_scope) -> void { for (auto entry : import_scope.entries()) { + if (entry.inst_id.is_poisoned()) { + continue; + } auto ref_id = AddImportRef(context, entry.inst_id); new_scope.AddRequired({.name_id = GetLocalNameId(context, entry.name_id), .inst_id = ref_id, @@ -2907,6 +2910,9 @@ static auto GetInstForLoad(Context& context, } auto LoadImportRef(Context& context, SemIR::InstId inst_id) -> void { + if (inst_id.is_poisoned()) { + return; + } auto inst = context.insts().TryGetAs(inst_id); if (!inst) { return; diff --git a/toolchain/check/testdata/function/declaration/no_prelude/name_poisoning.carbon b/toolchain/check/testdata/function/declaration/no_prelude/name_poisoning.carbon index 2fe30b9760353..2fa916936f275 100644 --- a/toolchain/check/testdata/function/declaration/no_prelude/name_poisoning.carbon +++ b/toolchain/check/testdata/function/declaration/no_prelude/name_poisoning.carbon @@ -12,52 +12,253 @@ library "[[@TEST_NAME]]"; -namespace N; class C {}; // Both N.F1 and N.F2 use N.C and not C. +namespace N; class N.C {} fn N.F1(x: C); fn N.F2(x: C) { N.F1(x); } -// --- poison_without_usage.carbon +// --- poison.carbon library "[[@TEST_NAME]]"; +class C {}; + namespace N; +// Here we use C and poison N.C. +fn N.F1(x: C); + +// --- fail_poison_class_without_usage.carbon +// CHECK:STDERR: fail_poison_class_without_usage.carbon: error: name used before it was declared [NameUseBeforeDecl] + +library "[[@TEST_NAME]]"; + class C {}; +namespace N; // Here we use C and poison N.C. fn N.F1(x: C); -// TODO: Should fail here since C was poisoned for namespace N when it was used -// in N context without qualification. +// Should fail here since C was poisoned for namespace N when it was used in N +// context without qualification. +// CHECK:STDERR: fail_poison_class_without_usage.carbon:[[@LINE+4]]:1: note: declared here [NameUseBeforeDeclNote] +// CHECK:STDERR: class N.C {} +// CHECK:STDERR: ^~~~~~~~~~~ +// CHECK:STDERR: class N.C {} -// --- fail_poison_with_usage.carbon +// --- fail_poison_interface_without_usage.carbon +// CHECK:STDERR: fail_poison_interface_without_usage.carbon: error: name used before it was declared [NameUseBeforeDecl] + +library "[[@TEST_NAME]]"; + +interface I {}; + +namespace N; +// Here we use I and poison N.I. +fn N.F1(x: I); + +// Should fail here since I was poisoned for namespace N when it was used in N +// context without qualification. +// CHECK:STDERR: fail_poison_interface_without_usage.carbon:[[@LINE+4]]:1: note: declared here [NameUseBeforeDeclNote] +// CHECK:STDERR: interface N.I {} +// CHECK:STDERR: ^~~~~~~~~~~~~~~ +// CHECK:STDERR: +interface N.I {} + +// --- fail_poison_namespace_without_usage.carbon +// CHECK:STDERR: fail_poison_namespace_without_usage.carbon: error: name used before it was declared [NameUseBeforeDecl] library "[[@TEST_NAME]]"; +class C {}; + namespace N; +// Here we use C and poison N.C. +fn N.F1(x: C); + +// Should fail here since C was poisoned for namespace N when it was used in N +// context without qualification. +// CHECK:STDERR: fail_poison_namespace_without_usage.carbon:[[@LINE+4]]:1: note: declared here [NameUseBeforeDeclNote] +// CHECK:STDERR: namespace N.C; +// CHECK:STDERR: ^~~~~~~~~~~~~~ +// CHECK:STDERR: +namespace N.C; + +// --- fail_poison_member_without_usage.carbon +// CHECK:STDERR: fail_poison_member_without_usage.carbon: error: name used before it was declared [NameUseBeforeDecl] + +library "[[@TEST_NAME]]"; + +class C1 {}; + +class D { + // Here we use C1 and poison D.C1. + fn F1(x: C1); + + class C2 {}; + // Should fail here since C1 was poisoned for namespace class D when it was + // used in D context without qualification. + // CHECK:STDERR: fail_poison_member_without_usage.carbon:[[@LINE+4]]:7: note: declared here [NameUseBeforeDeclNote] + // CHECK:STDERR: var C1: C2; + // CHECK:STDERR: ^~~~~~ + // CHECK:STDERR: + var C1: C2; +} + +// --- fail_poison_function_without_usage.carbon +// CHECK:STDERR: fail_poison_function_without_usage.carbon: error: name used before it was declared [NameUseBeforeDecl] + +library "[[@TEST_NAME]]"; + +class C {}; + +namespace N; +// Here we use C and poison N.C. +fn N.F1(x: C); + +// Should fail here since C was poisoned for namespace N when it was used in N +// context without qualification. +// CHECK:STDERR: fail_poison_function_without_usage.carbon:[[@LINE+4]]:1: note: declared here [NameUseBeforeDeclNote] +// CHECK:STDERR: fn N.C(); +// CHECK:STDERR: ^~~~~~~~~ +// CHECK:STDERR: +fn N.C(); + +// --- fail_use_undefined_poisoned_name.carbon + +library "[[@TEST_NAME]]"; + +class C {}; + +namespace N; +// Here we use C and poison N.C. +fn N.F1() -> C; + +// Try to use N.C which was never defined and poisoned. +// CHECK:STDERR: fail_use_undefined_poisoned_name.carbon:[[@LINE+4]]:14: error: member name `C` not found in `N` [MemberNameNotFoundInScope] +// CHECK:STDERR: fn N.F2() -> N.C; +// CHECK:STDERR: ^~~ +// CHECK:STDERR: +fn N.F2() -> N.C; + +// --- fail_poison_with_usage.carbon +// CHECK:STDERR: fail_poison_with_usage.carbon: error: name used before it was declared [NameUseBeforeDecl] + +library "[[@TEST_NAME]]"; + class C {}; +namespace N; // Here we use C and poison N.C. fn N.F1(x: C); -// TODO: Should fail here since C was poisoned for namespace N when it was used -// in N context without qualification. +// Should fail here since C was poisoned for namespace N when it was used in N +// context without qualification. +// CHECK:STDERR: fail_poison_with_usage.carbon:[[@LINE+4]]:1: note: declared here [NameUseBeforeDeclNote] +// CHECK:STDERR: class N.C {} +// CHECK:STDERR: ^~~~~~~~~~~ +// CHECK:STDERR: class N.C {} -// TODO: Should not fail here since both N.F2() and N.F1() input is the class C -// and not class N.C. -// CHECK:STDERR: fail_poison_with_usage.carbon:[[@LINE+6]]:22: error: `Core.ImplicitAs` implicitly referenced here, but package `Core` not found [CoreNotFound] -// CHECK:STDERR: fn N.F2(x: C) { N.F1(x); } -// CHECK:STDERR: ^ -// CHECK:STDERR: fail_poison_with_usage.carbon:[[@LINE-11]]:9: note: initializing function parameter [InCallToFunctionParam] -// CHECK:STDERR: fn N.F1(x: C); -// CHECK:STDERR: ^~~~ +// Should not fail here since both N.F2() and N.F1() input is the class C and +// not class N.C. fn N.F2(x: C) { N.F1(x); } +// --- fail_poison_multiple_scopes.carbon +// CHECK:STDERR: fail_poison_multiple_scopes.carbon: error: name used before it was declared [NameUseBeforeDecl] + +library "[[@TEST_NAME]]"; + +class C {}; + +namespace N1; +namespace N1.N2; +namespace N1.N2.N3; +class N1.N2.N3.D1 { + interface D2 { + class D3 { + // Here we use C and poison: + // * N1.C + // * N1.N2.C + // * N1.N2.N3.C + // * N1.N2.N3.D1.C + // * N1.N2.N3.D1.D2.C + // * N1.N2.N3.D1.D2.D3.C + fn F(x: C); + + // CHECK:STDERR: fail_poison_multiple_scopes.carbon:[[@LINE+5]]:7: note: declared here [NameUseBeforeDeclNote] + // CHECK:STDERR: class C {} + // CHECK:STDERR: ^~~~~~~~~ + // CHECK:STDERR: + // CHECK:STDERR: fail_poison_multiple_scopes.carbon: error: name used before it was declared [NameUseBeforeDecl] + class C {} + } + // CHECK:STDERR: fail_poison_multiple_scopes.carbon:[[@LINE+5]]:5: note: declared here [NameUseBeforeDeclNote] + // CHECK:STDERR: class C {} + // CHECK:STDERR: ^~~~~~~~~ + // CHECK:STDERR: + // CHECK:STDERR: fail_poison_multiple_scopes.carbon: error: name used before it was declared [NameUseBeforeDecl] + class C {} + } + // CHECK:STDERR: fail_poison_multiple_scopes.carbon:[[@LINE+5]]:3: note: declared here [NameUseBeforeDeclNote] + // CHECK:STDERR: class C {} + // CHECK:STDERR: ^~~~~~~~~ + // CHECK:STDERR: + // CHECK:STDERR: fail_poison_multiple_scopes.carbon: error: name used before it was declared [NameUseBeforeDecl] + class C {} +} + +// CHECK:STDERR: fail_poison_multiple_scopes.carbon:[[@LINE+5]]:1: note: declared here [NameUseBeforeDeclNote] +// CHECK:STDERR: class N1.C {} +// CHECK:STDERR: ^~~~~~~~~~~~ +// CHECK:STDERR: +// CHECK:STDERR: fail_poison_multiple_scopes.carbon: error: name used before it was declared [NameUseBeforeDecl] +class N1.C {} + +// CHECK:STDERR: fail_poison_multiple_scopes.carbon:[[@LINE+5]]:1: note: declared here [NameUseBeforeDeclNote] +// CHECK:STDERR: interface N1.N2.C {} +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: +// CHECK:STDERR: fail_poison_multiple_scopes.carbon: error: name used before it was declared [NameUseBeforeDecl] +interface N1.N2.C {} + +// CHECK:STDERR: fail_poison_multiple_scopes.carbon:[[@LINE+4]]:1: note: declared here [NameUseBeforeDeclNote] +// CHECK:STDERR: class N1.N2.N3.C {} +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: +class N1.N2.N3.C {} + +// --- fail_alias.carbon +// CHECK:STDERR: fail_alias.carbon: error: name used before it was declared [NameUseBeforeDecl] + +library "[[@TEST_NAME]]"; + +class C {} + +namespace N; +// CHECK:STDERR: fail_alias.carbon:[[@LINE+3]]:9: note: declared here [NameUseBeforeDeclNote] +// CHECK:STDERR: alias N.C = C; +// CHECK:STDERR: ^ +alias N.C = C; + +// --- ignored_poison_in_import.carbon + +library "[[@TEST_NAME]]"; +import library "poison"; + +// This doesn't fail. +class N.C {} + +// --- poison.impl.carbon + +impl library "[[@TEST_NAME]]"; + +// TODO: This should fail since N.C was poisoned in the api. +class N.C {} + // CHECK:STDOUT: --- no_poison.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -74,15 +275,15 @@ fn N.F2(x: C) { N.F1(x); } // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .C = %C.decl.loc4 // CHECK:STDOUT: .N = %N -// CHECK:STDOUT: .C = %C.decl.loc5 // CHECK:STDOUT: } +// CHECK:STDOUT: %C.decl.loc4: type = class_decl @C.1 [template = constants.%C.1] {} {} // CHECK:STDOUT: %N: = namespace [template] { // CHECK:STDOUT: .C = %C.decl.loc8 // CHECK:STDOUT: .F1 = %F1.decl // CHECK:STDOUT: .F2 = %F2.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %C.decl.loc5: type = class_decl @C.1 [template = constants.%C.1] {} {} // CHECK:STDOUT: %C.decl.loc8: type = class_decl @C.2 [template = constants.%C.2] {} {} // CHECK:STDOUT: %F1.decl: %F1.type = fn_decl @F1 [template = constants.%F1] { // CHECK:STDOUT: %x.patt: %C.2 = binding_pattern x @@ -129,125 +330,677 @@ fn N.F2(x: C) { N.F1(x); } // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: --- poison_without_usage.carbon +// CHECK:STDOUT: --- poison.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %C.1: type = class_type @C.1 [template] +// CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %F1.type: type = fn_type @F1 [template] // CHECK:STDOUT: %F1: %F1.type = struct_value () [template] -// CHECK:STDOUT: %C.2: type = class_type @C.2 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: .N = %N -// CHECK:STDOUT: .C = %C.decl.loc5 // CHECK:STDOUT: } +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: %N: = namespace [template] { // CHECK:STDOUT: .F1 = %F1.decl -// CHECK:STDOUT: .C = %C.decl.loc12 // CHECK:STDOUT: } -// CHECK:STDOUT: %C.decl.loc5: type = class_decl @C.1 [template = constants.%C.1] {} {} // CHECK:STDOUT: %F1.decl: %F1.type = fn_decl @F1 [template = constants.%F1] { -// CHECK:STDOUT: %x.patt: %C.1 = binding_pattern x -// CHECK:STDOUT: %x.param_patt: %C.1 = value_param_pattern %x.patt, runtime_param0 +// CHECK:STDOUT: %x.patt: %C = binding_pattern x +// CHECK:STDOUT: %x.param_patt: %C = value_param_pattern %x.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl.loc5 [template = constants.%C.1] -// CHECK:STDOUT: %x.param: %C.1 = value_param runtime_param0 -// CHECK:STDOUT: %x: %C.1 = bind_name x, %x.param +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %x.param: %C = value_param runtime_param0 +// CHECK:STDOUT: %x: %C = bind_name x, %x.param // CHECK:STDOUT: } -// CHECK:STDOUT: %C.decl.loc12: type = class_decl @C.2 [template = constants.%C.2] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: class @C.1 { +// CHECK:STDOUT: class @C { // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] // CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = constants.%C.1 +// CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: class @C.2 { +// CHECK:STDOUT: fn @F1(%x.param_patt: %C); +// CHECK:STDOUT: +// CHECK:STDOUT: --- fail_poison_class_without_usage.carbon +// CHECK:STDOUT: +// CHECK:STDOUT: constants { +// CHECK:STDOUT: %C: type = class_type @C [template] +// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %F1.type: type = fn_type @F1 [template] +// CHECK:STDOUT: %F1: %F1.type = struct_value () [template] +// CHECK:STDOUT: %.1: type = class_type @.1 [template] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .C = %C.decl +// CHECK:STDOUT: .N = %N +// CHECK:STDOUT: } +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} +// CHECK:STDOUT: %N: = namespace [template] { +// CHECK:STDOUT: .F1 = %F1.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %F1.decl: %F1.type = fn_decl @F1 [template = constants.%F1] { +// CHECK:STDOUT: %x.patt: %C = binding_pattern x +// CHECK:STDOUT: %x.param_patt: %C = value_param_pattern %x.patt, runtime_param0 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %x.param: %C = value_param runtime_param0 +// CHECK:STDOUT: %x: %C = bind_name x, %x.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %.decl: type = class_decl @.1 [template = constants.%.1] {} {} +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: class @C { // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] // CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = constants.%C.2 +// CHECK:STDOUT: .Self = constants.%C +// CHECK:STDOUT: complete_type_witness = %complete_type +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: class @.1 { +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = constants.%.1 +// CHECK:STDOUT: complete_type_witness = %complete_type +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @F1(%x.param_patt: %C); +// CHECK:STDOUT: +// CHECK:STDOUT: --- fail_poison_interface_without_usage.carbon +// CHECK:STDOUT: +// CHECK:STDOUT: constants { +// CHECK:STDOUT: %I.type: type = facet_type <@I> [template] +// CHECK:STDOUT: %Self.1: %I.type = bind_symbolic_name Self, 0 [symbolic] +// CHECK:STDOUT: %F1.type: type = fn_type @F1 [template] +// CHECK:STDOUT: %F1: %F1.type = struct_value () [template] +// CHECK:STDOUT: %.type: type = facet_type <@.1> [template] +// CHECK:STDOUT: %Self.2: %.type = bind_symbolic_name Self, 0 [symbolic] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .I = %I.decl +// CHECK:STDOUT: .N = %N +// CHECK:STDOUT: } +// CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%I.type] {} {} +// CHECK:STDOUT: %N: = namespace [template] { +// CHECK:STDOUT: .F1 = %F1.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %F1.decl: %F1.type = fn_decl @F1 [template = constants.%F1] { +// CHECK:STDOUT: %x.patt: %I.type = binding_pattern x +// CHECK:STDOUT: %x.param_patt: %I.type = value_param_pattern %x.patt, runtime_param0 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%I.type] +// CHECK:STDOUT: %x.param: %I.type = value_param runtime_param0 +// CHECK:STDOUT: %x: %I.type = bind_name x, %x.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %.decl: type = interface_decl @.1 [template = constants.%.type] {} {} +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: interface @I { +// CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.1] +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = %Self +// CHECK:STDOUT: witness = () +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: interface @.1 { +// CHECK:STDOUT: %Self: %.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.2] +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = %Self +// CHECK:STDOUT: witness = () +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @F1(%x.param_patt: %I.type); +// CHECK:STDOUT: +// CHECK:STDOUT: --- fail_poison_namespace_without_usage.carbon +// CHECK:STDOUT: +// CHECK:STDOUT: constants { +// CHECK:STDOUT: %C: type = class_type @C [template] +// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %F1.type: type = fn_type @F1 [template] +// CHECK:STDOUT: %F1: %F1.type = struct_value () [template] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .C = %C.decl +// CHECK:STDOUT: .N = %N +// CHECK:STDOUT: } +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} +// CHECK:STDOUT: %N: = namespace [template] { +// CHECK:STDOUT: .F1 = %F1.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %F1.decl: %F1.type = fn_decl @F1 [template = constants.%F1] { +// CHECK:STDOUT: %x.patt: %C = binding_pattern x +// CHECK:STDOUT: %x.param_patt: %C = value_param_pattern %x.patt, runtime_param0 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %x.param: %C = value_param runtime_param0 +// CHECK:STDOUT: %x: %C = bind_name x, %x.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %.loc17: = namespace [template] {} +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: class @C { +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = constants.%C +// CHECK:STDOUT: complete_type_witness = %complete_type +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @F1(%x.param_patt: %C); +// CHECK:STDOUT: +// CHECK:STDOUT: --- fail_poison_member_without_usage.carbon +// CHECK:STDOUT: +// CHECK:STDOUT: constants { +// CHECK:STDOUT: %C1: type = class_type @C1 [template] +// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] +// CHECK:STDOUT: %complete_type.1: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %D: type = class_type @D [template] +// CHECK:STDOUT: %F1.type: type = fn_type @F1 [template] +// CHECK:STDOUT: %F1: %F1.type = struct_value () [template] +// CHECK:STDOUT: %C2: type = class_type @C2 [template] +// CHECK:STDOUT: %D.elem: type = unbound_element_type %D, %C2 [template] +// CHECK:STDOUT: %struct_type.C1: type = struct_type {.C1: %C2} [template] +// CHECK:STDOUT: %complete_type.2: = complete_type_witness %struct_type.C1 [template] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .C1 = %C1.decl +// CHECK:STDOUT: .D = %D.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %C1.decl: type = class_decl @C1 [template = constants.%C1] {} {} +// CHECK:STDOUT: %D.decl: type = class_decl @D [template = constants.%D] {} {} +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: class @C1 { +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = constants.%C1 +// CHECK:STDOUT: complete_type_witness = %complete_type +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: class @D { +// CHECK:STDOUT: %F1.decl: %F1.type = fn_decl @F1 [template = constants.%F1] { +// CHECK:STDOUT: %x.patt: %C1 = binding_pattern x +// CHECK:STDOUT: %x.param_patt: %C1 = value_param_pattern %x.patt, runtime_param0 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %C1.ref: type = name_ref C1, file.%C1.decl [template = constants.%C1] +// CHECK:STDOUT: %x.param: %C1 = value_param runtime_param0 +// CHECK:STDOUT: %x: %C1 = bind_name x, %x.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %C2.decl: type = class_decl @C2 [template = constants.%C2] {} {} +// CHECK:STDOUT: %C2.ref: type = name_ref C2, %C2.decl [template = constants.%C2] +// CHECK:STDOUT: %.loc18: %D.elem = field_decl C1, element0 [template] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.C1 [template = constants.%complete_type.2] +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = constants.%D +// CHECK:STDOUT: .F1 = %F1.decl +// CHECK:STDOUT: .C2 = %C2.decl +// CHECK:STDOUT: complete_type_witness = %complete_type +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: class @C2 { +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = constants.%C2 +// CHECK:STDOUT: complete_type_witness = %complete_type +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @F1(%x.param_patt: %C1); +// CHECK:STDOUT: +// CHECK:STDOUT: --- fail_poison_function_without_usage.carbon +// CHECK:STDOUT: +// CHECK:STDOUT: constants { +// CHECK:STDOUT: %C: type = class_type @C [template] +// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %F1.type: type = fn_type @F1 [template] +// CHECK:STDOUT: %F1: %F1.type = struct_value () [template] +// CHECK:STDOUT: %.type: type = fn_type @.1 [template] +// CHECK:STDOUT: %.1: %.type = struct_value () [template] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .C = %C.decl +// CHECK:STDOUT: .N = %N +// CHECK:STDOUT: } +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} +// CHECK:STDOUT: %N: = namespace [template] { +// CHECK:STDOUT: .F1 = %F1.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %F1.decl: %F1.type = fn_decl @F1 [template = constants.%F1] { +// CHECK:STDOUT: %x.patt: %C = binding_pattern x +// CHECK:STDOUT: %x.param_patt: %C = value_param_pattern %x.patt, runtime_param0 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %x.param: %C = value_param runtime_param0 +// CHECK:STDOUT: %x: %C = bind_name x, %x.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.1] {} {} +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: class @C { +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = constants.%C +// CHECK:STDOUT: complete_type_witness = %complete_type +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @F1(%x.param_patt: %C); +// CHECK:STDOUT: +// CHECK:STDOUT: fn @.1(); +// CHECK:STDOUT: +// CHECK:STDOUT: --- fail_use_undefined_poisoned_name.carbon +// CHECK:STDOUT: +// CHECK:STDOUT: constants { +// CHECK:STDOUT: %C: type = class_type @C [template] +// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %F1.type: type = fn_type @F1 [template] +// CHECK:STDOUT: %F1: %F1.type = struct_value () [template] +// CHECK:STDOUT: %F2.type: type = fn_type @F2 [template] +// CHECK:STDOUT: %F2: %F2.type = struct_value () [template] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .C = %C.decl +// CHECK:STDOUT: .N = %N +// CHECK:STDOUT: } +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} +// CHECK:STDOUT: %N: = namespace [template] { +// CHECK:STDOUT: .F1 = %F1.decl +// CHECK:STDOUT: .F2 = %F2.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %F1.decl: %F1.type = fn_decl @F1 [template = constants.%F1] { +// CHECK:STDOUT: %return.patt: %C = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %C = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %return.param: ref %C = out_param runtime_param0 +// CHECK:STDOUT: %return: ref %C = return_slot %return.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %F2.decl: %F2.type = fn_decl @F2 [template = constants.%F2] { +// CHECK:STDOUT: %return.patt: = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %N.ref: = name_ref N, file.%N [template = file.%N] +// CHECK:STDOUT: %C.ref: = name_ref C, [template = ] +// CHECK:STDOUT: %return.param: ref = out_param runtime_param0 +// CHECK:STDOUT: %return: ref = return_slot %return.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: class @C { +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F1(%x.param_patt: %C.1); +// CHECK:STDOUT: fn @F1() -> %C; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @F2() -> ; // CHECK:STDOUT: // CHECK:STDOUT: --- fail_poison_with_usage.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %C.1: type = class_type @C.1 [template] +// CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %F1.type: type = fn_type @F1 [template] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template] // CHECK:STDOUT: %F1: %F1.type = struct_value () [template] -// CHECK:STDOUT: %C.2: type = class_type @C.2 [template] +// CHECK:STDOUT: %.1: type = class_type @.1 [template] // CHECK:STDOUT: %F2.type: type = fn_type @F2 [template] // CHECK:STDOUT: %F2: %F2.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: .N = %N -// CHECK:STDOUT: .C = %C.decl.loc5 // CHECK:STDOUT: } +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: %N: = namespace [template] { // CHECK:STDOUT: .F1 = %F1.decl -// CHECK:STDOUT: .C = %C.decl.loc12 // CHECK:STDOUT: .F2 = %F2.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %C.decl.loc5: type = class_decl @C.1 [template = constants.%C.1] {} {} // CHECK:STDOUT: %F1.decl: %F1.type = fn_decl @F1 [template = constants.%F1] { -// CHECK:STDOUT: %x.patt: %C.1 = binding_pattern x -// CHECK:STDOUT: %x.param_patt: %C.1 = value_param_pattern %x.patt, runtime_param0 +// CHECK:STDOUT: %x.patt: %C = binding_pattern x +// CHECK:STDOUT: %x.param_patt: %C = value_param_pattern %x.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl.loc5 [template = constants.%C.1] -// CHECK:STDOUT: %x.param: %C.1 = value_param runtime_param0 -// CHECK:STDOUT: %x: %C.1 = bind_name x, %x.param +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %x.param: %C = value_param runtime_param0 +// CHECK:STDOUT: %x: %C = bind_name x, %x.param // CHECK:STDOUT: } -// CHECK:STDOUT: %C.decl.loc12: type = class_decl @C.2 [template = constants.%C.2] {} {} +// CHECK:STDOUT: %.decl: type = class_decl @.1 [template = constants.%.1] {} {} // CHECK:STDOUT: %F2.decl: %F2.type = fn_decl @F2 [template = constants.%F2] { -// CHECK:STDOUT: %x.patt: %C.2 = binding_pattern x -// CHECK:STDOUT: %x.param_patt: %C.2 = value_param_pattern %x.patt, runtime_param0 +// CHECK:STDOUT: %x.patt: %C = binding_pattern x +// CHECK:STDOUT: %x.param_patt: %C = value_param_pattern %x.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl.loc12 [template = constants.%C.2] -// CHECK:STDOUT: %x.param: %C.2 = value_param runtime_param0 -// CHECK:STDOUT: %x: %C.2 = bind_name x, %x.param +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %x.param: %C = value_param runtime_param0 +// CHECK:STDOUT: %x: %C = bind_name x, %x.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: class @C.1 { +// CHECK:STDOUT: class @C { // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] // CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = constants.%C.1 +// CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: class @C.2 { +// CHECK:STDOUT: class @.1 { // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] // CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = constants.%C.2 +// CHECK:STDOUT: .Self = constants.%.1 // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F1(%x.param_patt: %C.1); +// CHECK:STDOUT: fn @F1(%x.param_patt: %C); // CHECK:STDOUT: -// CHECK:STDOUT: fn @F2(%x.param_patt: %C.2) { +// CHECK:STDOUT: fn @F2(%x.param_patt: %C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %N.ref: = name_ref N, file.%N [template = file.%N] // CHECK:STDOUT: %F1.ref: %F1.type = name_ref F1, file.%F1.decl [template = constants.%F1] -// CHECK:STDOUT: %x.ref: %C.2 = name_ref x, %x -// CHECK:STDOUT: %.loc22: %C.1 = converted %x.ref, [template = ] -// CHECK:STDOUT: %F1.call: init %empty_tuple.type = call %F1.ref() +// CHECK:STDOUT: %x.ref: %C = name_ref x, %x +// CHECK:STDOUT: %F1.call: init %empty_tuple.type = call %F1.ref(%x.ref) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: --- fail_poison_multiple_scopes.carbon +// CHECK:STDOUT: +// CHECK:STDOUT: constants { +// CHECK:STDOUT: %C: type = class_type @C [template] +// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %D1: type = class_type @D1 [template] +// CHECK:STDOUT: %D2.type: type = facet_type <@D2> [template] +// CHECK:STDOUT: %Self.1: %D2.type = bind_symbolic_name Self, 0 [symbolic] +// CHECK:STDOUT: %D3.1: type = class_type @D3 [template] +// CHECK:STDOUT: %D3.2: type = class_type @D3, @D3(%Self.1) [symbolic] +// CHECK:STDOUT: %F.type: type = fn_type @F, @D3(%Self.1) [symbolic] +// CHECK:STDOUT: %F: %F.type = struct_value () [symbolic] +// CHECK:STDOUT: %.1: type = class_type @.1 [template] +// CHECK:STDOUT: %.2: type = class_type @.1, @.1(%Self.1) [symbolic] +// CHECK:STDOUT: %.3: type = class_type @.2 [template] +// CHECK:STDOUT: %.4: type = class_type @.2, @.2(%Self.1) [symbolic] +// CHECK:STDOUT: %.5: type = class_type @.3 [template] +// CHECK:STDOUT: %.6: type = class_type @.4 [template] +// CHECK:STDOUT: %.type: type = facet_type <@.6> [template] +// CHECK:STDOUT: %Self.2: %.type = bind_symbolic_name Self, 0 [symbolic] +// CHECK:STDOUT: %.7: type = class_type @.5 [template] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .C = %C.decl +// CHECK:STDOUT: .N1 = %N1 +// CHECK:STDOUT: } +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} +// CHECK:STDOUT: %N1: = namespace [template] { +// CHECK:STDOUT: .N2 = %N2 +// CHECK:STDOUT: } +// CHECK:STDOUT: %N2: = namespace [template] { +// CHECK:STDOUT: .N3 = %N3 +// CHECK:STDOUT: } +// CHECK:STDOUT: %N3: = namespace [template] { +// CHECK:STDOUT: .D1 = %D1.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %D1.decl: type = class_decl @D1 [template = constants.%D1] {} {} +// CHECK:STDOUT: %.decl.loc49: type = class_decl @.4 [template = constants.%.6] {} {} +// CHECK:STDOUT: %.decl.loc56: type = interface_decl @.6 [template = constants.%.type] {} {} +// CHECK:STDOUT: %.decl.loc62: type = class_decl @.5 [template = constants.%.7] {} {} +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: interface @D2 { +// CHECK:STDOUT: %Self: %D2.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.1] +// CHECK:STDOUT: %D3.decl: type = class_decl @D3 [template = constants.%D3.1] {} {} +// CHECK:STDOUT: %.decl: type = class_decl @.2 [template = constants.%.3] {} {} +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = %Self +// CHECK:STDOUT: .D3 = %D3.decl +// CHECK:STDOUT: witness = () +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: interface @.6 { +// CHECK:STDOUT: %Self: %.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.2] +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = %Self +// CHECK:STDOUT: witness = () +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: class @C { +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = constants.%C +// CHECK:STDOUT: complete_type_witness = %complete_type +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: class @D1 { +// CHECK:STDOUT: %D2.decl: type = interface_decl @D2 [template = constants.%D2.type] {} {} +// CHECK:STDOUT: %.decl: type = class_decl @.3 [template = constants.%.5] {} {} +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = constants.%D1 +// CHECK:STDOUT: .D2 = %D2.decl +// CHECK:STDOUT: complete_type_witness = %complete_type +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic class @D3(@D2.%Self: %D2.type) { +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Self: %D2.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.1)] +// CHECK:STDOUT: %F.type: type = fn_type @F, @D3(%Self) [symbolic = %F.type (constants.%F.type)] +// CHECK:STDOUT: %F: @D3.%F.type (%F.type) = struct_value () [symbolic = %F (constants.%F)] +// CHECK:STDOUT: +// CHECK:STDOUT: class { +// CHECK:STDOUT: %F.decl: @D3.%F.type (%F.type) = fn_decl @F [symbolic = @D3.%F (constants.%F)] { +// CHECK:STDOUT: %x.patt: %C = binding_pattern x +// CHECK:STDOUT: %x.param_patt: %C = value_param_pattern %x.patt, runtime_param0 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %x.param: %C = value_param runtime_param0 +// CHECK:STDOUT: %x: %C = bind_name x, %x.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %.decl: type = class_decl @.1 [template = constants.%.1] {} {} +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = constants.%D3.2 +// CHECK:STDOUT: .F = %F.decl +// CHECK:STDOUT: complete_type_witness = %complete_type +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic class @.1(@D2.%Self: %D2.type) { +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: class { +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = constants.%.2 +// CHECK:STDOUT: complete_type_witness = %complete_type +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic class @.2(@D2.%Self: %D2.type) { +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: class { +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = constants.%.4 +// CHECK:STDOUT: complete_type_witness = %complete_type +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: class @.3 { +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = constants.%.5 +// CHECK:STDOUT: complete_type_witness = %complete_type +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: class @.4 { +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = constants.%.6 +// CHECK:STDOUT: complete_type_witness = %complete_type +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: class @.5 { +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = constants.%.7 +// CHECK:STDOUT: complete_type_witness = %complete_type +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @F(@D2.%Self: %D2.type) { +// CHECK:STDOUT: +// CHECK:STDOUT: fn(%x.param_patt: %C); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @D3(constants.%Self.1) {} +// CHECK:STDOUT: +// CHECK:STDOUT: specific @F(constants.%Self.1) {} +// CHECK:STDOUT: +// CHECK:STDOUT: specific @.1(constants.%Self.1) {} +// CHECK:STDOUT: +// CHECK:STDOUT: specific @D3(%Self) {} +// CHECK:STDOUT: +// CHECK:STDOUT: specific @.2(constants.%Self.1) {} +// CHECK:STDOUT: +// CHECK:STDOUT: --- fail_alias.carbon +// CHECK:STDOUT: +// CHECK:STDOUT: constants { +// CHECK:STDOUT: %C: type = class_type @C [template] +// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .C = %C.decl +// CHECK:STDOUT: .N = %N +// CHECK:STDOUT: } +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} +// CHECK:STDOUT: %N: = namespace [template] {} +// CHECK:STDOUT: %C.ref: type = name_ref C, %C.decl [template = constants.%C] +// CHECK:STDOUT: %.loc11: type = bind_alias , %C.decl [template = constants.%C] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: class @C { +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = constants.%C +// CHECK:STDOUT: complete_type_witness = %complete_type +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: --- ignored_poison_in_import.carbon +// CHECK:STDOUT: +// CHECK:STDOUT: constants { +// CHECK:STDOUT: %C: type = class_type @C [template] +// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1 = import_ref Main//poison, C, unloaded +// CHECK:STDOUT: %import_ref.2: = import_ref Main//poison, N, loaded +// CHECK:STDOUT: %N: = namespace %import_ref.2, [template] { +// CHECK:STDOUT: .F1 = %import_ref.3 +// CHECK:STDOUT: .C = file.%C.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .C = imports.%import_ref.1 +// CHECK:STDOUT: .N = imports.%N +// CHECK:STDOUT: } +// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: class @C { +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = constants.%C +// CHECK:STDOUT: complete_type_witness = %complete_type +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: --- poison.impl.carbon +// CHECK:STDOUT: +// CHECK:STDOUT: constants { +// CHECK:STDOUT: %C: type = class_type @C [template] +// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1 = import_ref Main//poison, C, unloaded +// CHECK:STDOUT: %import_ref.2: = import_ref Main//poison, N, loaded +// CHECK:STDOUT: %N: = namespace %import_ref.2, [template] { +// CHECK:STDOUT: .F1 = %import_ref.3 +// CHECK:STDOUT: .C = file.%C.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .C = imports.%import_ref.1 +// CHECK:STDOUT: .N = imports.%N +// CHECK:STDOUT: } +// CHECK:STDOUT: %default.import.loc2_6.1 = import +// CHECK:STDOUT: %default.import.loc2_6.2 = import +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: class @C { +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = constants.%C +// CHECK:STDOUT: complete_type_witness = %complete_type +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/diagnostics/diagnostic_kind.def b/toolchain/diagnostics/diagnostic_kind.def index ceb0df8691386..bd7eb61b566d3 100644 --- a/toolchain/diagnostics/diagnostic_kind.def +++ b/toolchain/diagnostics/diagnostic_kind.def @@ -318,6 +318,8 @@ CARBON_DIAGNOSTIC_KIND(RealMantissaTooLargeForI64) CARBON_DIAGNOSTIC_KIND(RealExponentTooLargeForI64) CARBON_DIAGNOSTIC_KIND(NameDeclDuplicate) CARBON_DIAGNOSTIC_KIND(NameDeclPrevious) +CARBON_DIAGNOSTIC_KIND(NameUseBeforeDecl) +CARBON_DIAGNOSTIC_KIND(NameUseBeforeDeclNote) CARBON_DIAGNOSTIC_KIND(RepeatedConst) CARBON_DIAGNOSTIC_KIND(IncompleteTypeInAdaptDecl) CARBON_DIAGNOSTIC_KIND(IncompleteTypeInBaseDecl) diff --git a/toolchain/sem_ir/formatter.cpp b/toolchain/sem_ir/formatter.cpp index 79cd833ea3183..6ee487912caf0 100644 --- a/toolchain/sem_ir/formatter.cpp +++ b/toolchain/sem_ir/formatter.cpp @@ -626,6 +626,10 @@ class FormatterImpl { } for (auto [name_id, inst_id, access_kind] : scope.entries()) { + if (inst_id.is_poisoned()) { + // TODO: Add poisoned names. + continue; + } Indent(); out_ << "."; FormatName(name_id); diff --git a/toolchain/sem_ir/ids.cpp b/toolchain/sem_ir/ids.cpp index b32b403a2a8a7..696d7cdf280c7 100644 --- a/toolchain/sem_ir/ids.cpp +++ b/toolchain/sem_ir/ids.cpp @@ -12,6 +12,8 @@ namespace Carbon::SemIR { auto InstId::Print(llvm::raw_ostream& out) const -> void { if (IsSingletonInstId(*this)) { out << Label << "(" << SingletonInstKinds[index] << ")"; + } else if (is_poisoned()) { + out << ""; } else { IdBase::Print(out); } diff --git a/toolchain/sem_ir/ids.h b/toolchain/sem_ir/ids.h index 4fb961c5e2cf5..8d98d70978967 100644 --- a/toolchain/sem_ir/ids.h +++ b/toolchain/sem_ir/ids.h @@ -39,12 +39,19 @@ struct InstId : public IdBase { // An explicitly invalid ID. static const InstId Invalid; + // Represents that the name in this scope was poisoned by using it without + // qualifications. + static const InstId PoisonedName; + using IdBase::IdBase; + constexpr auto is_poisoned() const -> bool { return *this == PoisonedName; } + auto Print(llvm::raw_ostream& out) const -> void; }; constexpr InstId InstId::Invalid = InstId(InvalidIndex); +constexpr InstId InstId::PoisonedName = InstId(InvalidIndex - 1); // An ID of an instruction that is referenced absolutely by another instruction. // This should only be used as the type of a field within a typed instruction diff --git a/toolchain/sem_ir/name_scope.cpp b/toolchain/sem_ir/name_scope.cpp index bd064afc9fcbd..811aa72d7f9ff 100644 --- a/toolchain/sem_ir/name_scope.cpp +++ b/toolchain/sem_ir/name_scope.cpp @@ -22,6 +22,9 @@ auto NameScope::Print(llvm::raw_ostream& out) const -> void { out << ", names: {"; llvm::ListSeparator sep; for (auto entry : names_) { + if (entry.inst_id.is_poisoned()) { + continue; + } out << sep << entry.name_id << ": " << entry.inst_id; } out << "}"; @@ -30,6 +33,9 @@ auto NameScope::Print(llvm::raw_ostream& out) const -> void { } auto NameScope::AddRequired(Entry name_entry) -> void { + CARBON_CHECK(!name_entry.inst_id.is_poisoned(), + "Cannot add a poisoned name: {0}. Use AddPoison()", + name_entry.name_id); auto add_name = [&] { EntryId index(names_.size()); names_.push_back(name_entry); @@ -43,6 +49,8 @@ auto NameScope::AddRequired(Entry name_entry) -> void { auto NameScope::LookupOrAdd(SemIR::NameId name_id, InstId inst_id, AccessKind access_kind) -> std::pair { + CARBON_CHECK(!inst_id.is_poisoned(), + "Cannot add a poisoned name: {0}. Use AddPoison()", name_id); auto insert_result = name_map_.Insert(name_id, EntryId(names_.size())); if (!insert_result.is_inserted()) { return {false, EntryId(insert_result.value())}; @@ -53,6 +61,15 @@ auto NameScope::LookupOrAdd(SemIR::NameId name_id, InstId inst_id, return {true, EntryId(names_.size() - 1)}; } +auto NameScope::AddPoison(NameId name_id) -> void { + auto insert_result = name_map_.Insert(name_id, EntryId(names_.size())); + CARBON_CHECK(insert_result.is_inserted(), + "Trying to poison an existing name: {0}", name_id); + names_.push_back({.name_id = name_id, + .inst_id = InstId::PoisonedName, + .access_kind = AccessKind::Public}); +} + auto NameScopeStore::GetInstIfValid(NameScopeId scope_id) const -> std::pair> { if (!scope_id.is_valid()) { diff --git a/toolchain/sem_ir/name_scope.h b/toolchain/sem_ir/name_scope.h index 0de02513db5aa..860666183e6d2 100644 --- a/toolchain/sem_ir/name_scope.h +++ b/toolchain/sem_ir/name_scope.h @@ -42,6 +42,7 @@ class NameScope : public Printable { auto entries() const -> llvm::ArrayRef { return names_; } // Get a specific Name entry based on an EntryId that return from a lookup. + // // The Entry could become invalidated if the scope object is invalidated or if // a name is added. auto GetEntry(EntryId entry_id) const -> const Entry& { @@ -50,7 +51,7 @@ class NameScope : public Printable { auto GetEntry(EntryId entry_id) -> Entry& { return names_[entry_id.index]; } // Searches for the given name and returns an EntryId if found or nullopt if - // not. + // not. The returned entry may be poisoned. auto Lookup(NameId name_id) const -> std::optional { auto lookup = name_map_.Lookup(name_id); if (!lookup) { @@ -59,15 +60,20 @@ class NameScope : public Printable { return lookup.value(); } - // Adds a new name known to not exist. + // Adds a new name known to not exist. Must not be poisoned. auto AddRequired(Entry name_entry) -> void; - // If the given name already exists, return true and an EntryId. - // If not, adds the name using inst_id and access_kind and returns false and - // an EntryId. + // If the given name already exists, return true with the EntryId; the entry + // might be poisoned. Otherwise, adds the name using inst_id and access_kind + // and returns false with the new EntryId. + // + // This cannot be used to add poisoned entries; use AddPoison instead. auto LookupOrAdd(SemIR::NameId name_id, InstId inst_id, AccessKind access_kind) -> std::pair; + // Adds a new poisoned name. + auto AddPoison(NameId name_id) -> void; + auto extended_scopes() const -> llvm::ArrayRef { return extended_scopes_; } @@ -111,7 +117,8 @@ class NameScope : public Printable { } private: - // Names in the scope. + // Names in the scope, including poisoned names. + // // Entries could become invalidated if the scope object is invalidated or if a // name is added. // @@ -172,7 +179,7 @@ class NameScopeStore { } // Adds a name that is required to exist in a name scope, such as `Self`. - // These must never conflict. + // The name must never conflict. inst_id must not be poisoned. auto AddRequiredName(NameScopeId scope_id, NameId name_id, InstId inst_id) -> void { Get(scope_id).AddRequired({.name_id = name_id, diff --git a/toolchain/sem_ir/name_scope_test.cpp b/toolchain/sem_ir/name_scope_test.cpp index fa6068d80b27b..1b246d9673037 100644 --- a/toolchain/sem_ir/name_scope_test.cpp +++ b/toolchain/sem_ir/name_scope_test.cpp @@ -146,6 +146,43 @@ TEST(NameScope, LookupOrAdd) { } } +TEST(NameScope, Poison) { + int id = 0; + + InstId scope_inst_id(++id); + NameId scope_name_id(++id); + NameScopeId parent_scope_id(++id); + NameScope name_scope(scope_inst_id, scope_name_id, parent_scope_id); + + NameId poison1(++id); + name_scope.AddPoison(poison1); + EXPECT_THAT(name_scope.entries(), + ElementsAre(NameScopeEntryEquals( + NameScope::Entry({.name_id = poison1, + .inst_id = InstId::PoisonedName, + .access_kind = AccessKind::Public})))); + + NameId poison2(++id); + name_scope.AddPoison(poison2); + EXPECT_THAT(name_scope.entries(), + ElementsAre(NameScopeEntryEquals(NameScope::Entry( + {.name_id = poison1, + .inst_id = InstId::PoisonedName, + .access_kind = AccessKind::Public})), + NameScopeEntryEquals(NameScope::Entry( + {.name_id = poison2, + .inst_id = InstId::PoisonedName, + .access_kind = AccessKind::Public})))); + + auto lookup = name_scope.Lookup(poison1); + ASSERT_NE(lookup, std::nullopt); + EXPECT_THAT(name_scope.GetEntry(*lookup), + NameScopeEntryEquals( + NameScope::Entry({.name_id = poison1, + .inst_id = InstId::PoisonedName, + .access_kind = AccessKind::Public}))); +} + TEST(NameScope, ExtendedScopes) { int id = 0; From 3f9a06aee38820dc8015b79a500896c6ada5032c Mon Sep 17 00:00:00 2001 From: Jon Ross-Perkins Date: Tue, 17 Dec 2024 13:20:37 -0800 Subject: [PATCH 45/68] Look at flipping clang-tidy's misc-* to enable-by-default (#4699) I was wondering, instead of treating `misc` differently and enabling specific checks, maybe we can flip that since we actually seem okay with most of the checks? The main check I'm enabling, with significant edits here, is `misc-no-recursion`. But maybe this is helpful to enable, even with the necessary NOLINTs, since we want to avoid recursion in the toolchain? This PR shows some example fixes in subst.cpp (which are more stylistic, since the code shouldn't actually have recursed due to its structure; I think we could remove the warning on TryResolveInst the same way). Some also just don't seem worth fixing, like those in tests files (I didn't see a way to exclude files in .clang-tidy, so instead I'm using NOLINTBEGIN). But I think we might actually want to fix inst_namer, and there's enough in convert that I didn't look closely. Also, I made some protected -> private style fixes based on `misc-non-private-member-variables-in-classes` (this is also how I noticed `class Real` versus `struct Real`). With node_stack, it looks like the `protected` wasn't even used. [Per style](https://google.github.io/styleguide/cppguide.html#Access_Control), data members should be private outside tests. But since we can't trivially exclude `protected` members in tests, I'm turning it off -- I don't view it as offering enough benefit on the whole. migrate_cpp issues are preexisting (I believe we just aren't monitoring it), but changes there make `bazel build --config=clang-tidy -k //...` work cleanly. --------- Co-authored-by: Richard Smith --- .clang-tidy | 18 +++--- common/command_line.cpp | 36 ++++++----- common/command_line.h | 21 ++++--- migrate_cpp/cpp_refactoring/fn_inserter.cpp | 1 + migrate_cpp/cpp_refactoring/for_range.cpp | 1 + migrate_cpp/cpp_refactoring/var_decl.cpp | 2 +- migrate_cpp/rewriter.cpp | 2 + testing/fuzzing/proto_to_carbon.cpp | 5 ++ toolchain/base/value_ids.h | 3 +- toolchain/check/convert.cpp | 6 ++ toolchain/check/import_ref.cpp | 24 +++++-- toolchain/check/subst.cpp | 69 ++++++++++++--------- toolchain/sem_ir/formatter.cpp | 7 +++ toolchain/sem_ir/inst_namer.cpp | 4 ++ toolchain/testing/yaml_test_helpers.cpp | 2 + 15 files changed, 128 insertions(+), 73 deletions(-) diff --git a/.clang-tidy b/.clang-tidy index 58eac2144fbf9..eaf3b92c0d9b2 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -13,20 +13,15 @@ Checks: - '-*' - 'bugprone-*' - 'google-*' + - 'misc-*' - 'modernize-*' - 'performance-*' - 'readability-*' - # `misc` is selectively enabled because we want a minority of them. - - 'misc-definitions-in-headers' - - 'misc-misplaced-const' - - 'misc-redundant-expression' - - 'misc-static-assert' - - 'misc-unconventional-assign-operator' - - 'misc-uniqueptr-reset-release' - - 'misc-unused-*' - # Disabled due to the implied style choices. + - '-misc-const-correctness' + - '-misc-include-cleaner' + - '-misc-use-anonymous-namespace' - '-modernize-return-braced-init-list' - '-modernize-use-default-member-init' - '-modernize-use-integer-sign-comparison' @@ -68,6 +63,11 @@ Checks: - '-google-readability-function-size' # Suggests usernames on TODOs, which we don't want. - '-google-readability-todo' + # Even with `IgnoreClassesWithAllMemberVariablesBeingPublic` to allow structs, + # we use `protected` members in too many tests. + - '-misc-non-private-member-variables-in-classes' + # Overlaps with `-Wno-missing-prototypes`. + - '-misc-use-internal-linkage' # Suggests `std::array`, which we could migrate to, but conflicts with the # status quo. - '-modernize-avoid-c-arrays' diff --git a/common/command_line.cpp b/common/command_line.cpp index 95134bed0aa1d..59a893731787b 100644 --- a/common/command_line.cpp +++ b/common/command_line.cpp @@ -10,6 +10,10 @@ #include "llvm/ADT/PointerIntPair.h" #include "llvm/Support/FormatVariadic.h" +// Recursion is used for subcommands. This should be okay since recursion is +// limited by command line architecture. +// NOLINTBEGIN(misc-no-recursion) + namespace Carbon::CommandLine { auto operator<<(llvm::raw_ostream& output, ParseResult result) @@ -1311,41 +1315,41 @@ void ArgBuilder::HelpHidden(bool is_help_hidden) { ArgBuilder::ArgBuilder(Arg* arg) : arg_(arg) {} void FlagBuilder::Default(bool flag_value) { - arg_->has_default = true; - arg_->default_flag = flag_value; + arg()->has_default = true; + arg()->default_flag = flag_value; } -void FlagBuilder::Set(bool* flag) { arg_->flag_storage = flag; } +void FlagBuilder::Set(bool* flag) { arg()->flag_storage = flag; } void IntegerArgBuilder::Default(int integer_value) { - arg_->has_default = true; - arg_->default_integer = integer_value; + arg()->has_default = true; + arg()->default_integer = integer_value; } void IntegerArgBuilder::Set(int* integer) { - arg_->is_append = false; - arg_->integer_storage = integer; + arg()->is_append = false; + arg()->integer_storage = integer; } void IntegerArgBuilder::Append(llvm::SmallVectorImpl* sequence) { - arg_->is_append = true; - arg_->integer_sequence = sequence; + arg()->is_append = true; + arg()->integer_sequence = sequence; } void StringArgBuilder::Default(llvm::StringRef string_value) { - arg_->has_default = true; - arg_->default_string = string_value; + arg()->has_default = true; + arg()->default_string = string_value; } void StringArgBuilder::Set(llvm::StringRef* string) { - arg_->is_append = false; - arg_->string_storage = string; + arg()->is_append = false; + arg()->string_storage = string; } void StringArgBuilder::Append( llvm::SmallVectorImpl* sequence) { - arg_->is_append = true; - arg_->string_sequence = sequence; + arg()->is_append = true; + arg()->string_sequence = sequence; } static auto IsValidName(llvm::StringRef name) -> bool { @@ -1525,3 +1529,5 @@ auto Parse(llvm::ArrayRef unparsed_args, } } // namespace Carbon::CommandLine + +// NOLINTEND(misc-no-recursion) diff --git a/common/command_line.h b/common/command_line.h index 2656675f5454c..62303b339b10f 100644 --- a/common/command_line.h +++ b/common/command_line.h @@ -307,10 +307,13 @@ class ArgBuilder { void MetaAction(T action); protected: - friend CommandBuilder; + friend class CommandBuilder; // `arg` must not be null. explicit ArgBuilder(Arg* arg); + auto arg() -> Arg* { return arg_; } + + private: Arg* arg_; }; @@ -756,7 +759,7 @@ auto OneOfArgBuilder::OneOfValue(llvm::StringRef str, T value) template void OneOfArgBuilder::SetOneOf(const OneOfValueT (&values)[N], T* result) { static_assert(N > 0, "Must include at least one value."); - arg_->is_append = false; + arg()->is_append = false; OneOfImpl( values, [result](T value) { *result = value; }, std::make_index_sequence{}); @@ -766,7 +769,7 @@ template void OneOfArgBuilder::AppendOneOf(const OneOfValueT (&values)[N], llvm::SmallVectorImpl* sequence) { static_assert(N > 0, "Must include at least one value."); - arg_->is_append = true; + arg()->is_append = true; OneOfImpl( values, [sequence](T value) { sequence->push_back(value); }, std::make_index_sequence{}); @@ -792,12 +795,12 @@ void OneOfArgBuilder::OneOfImpl(const OneOfValueT (&input_values)[N], // Directly copy the value strings into a heap-allocated array in the // argument. - new (&arg_->value_strings) + new (&arg()->value_strings) llvm::OwningArrayRef(value_strings); // And build a type-erased action that maps a specific value string to a value // by index. - new (&arg_->value_action) Arg::ValueActionT( + new (&arg()->value_action) Arg::ValueActionT( [values, match](const Arg& arg, llvm::StringRef value_string) -> bool { for (int i : llvm::seq(0, N)) { if (value_string == arg.value_strings[i]) { @@ -810,11 +813,11 @@ void OneOfArgBuilder::OneOfImpl(const OneOfValueT (&input_values)[N], // Fold over all the input values to see if there is a default. if ((input_values[Indices].is_default || ...)) { - CARBON_CHECK(!arg_->is_append, "Can't append default."); + CARBON_CHECK(!arg()->is_append, "Can't append default."); CARBON_CHECK((input_values[Indices].is_default + ... + 0) == 1, "Cannot default more than one value."); - arg_->has_default = true; + arg()->has_default = true; // First build a lambda that configures the default using an index. We'll // call this below, this lambda isn't the one that is stored. @@ -822,12 +825,12 @@ void OneOfArgBuilder::OneOfImpl(const OneOfValueT (&input_values)[N], // Now that we have the desired default index, build a lambda and store it // as the default action. This lambda is stored and so it captures the // necessary information explicitly and by value. - new (&arg_->default_action) + new (&arg()->default_action) Arg::DefaultActionT([value = default_value.value, match](const Arg& /*arg*/) { match(value); }); // Also store the index itself for use when printing help. - arg_->default_value_index = index; + arg()->default_value_index = index; }; // Now we fold across the inputs and in the one case that is the default, we diff --git a/migrate_cpp/cpp_refactoring/fn_inserter.cpp b/migrate_cpp/cpp_refactoring/fn_inserter.cpp index 76558b649a8a6..f370ffce160eb 100644 --- a/migrate_cpp/cpp_refactoring/fn_inserter.cpp +++ b/migrate_cpp/cpp_refactoring/fn_inserter.cpp @@ -6,6 +6,7 @@ #include "clang/ASTMatchers/ASTMatchers.h" +// NOLINTNEXTLINE(readability-identifier-naming) namespace cam = ::clang::ast_matchers; namespace Carbon { diff --git a/migrate_cpp/cpp_refactoring/for_range.cpp b/migrate_cpp/cpp_refactoring/for_range.cpp index 371b7dc21c420..eef4946fa0fe9 100644 --- a/migrate_cpp/cpp_refactoring/for_range.cpp +++ b/migrate_cpp/cpp_refactoring/for_range.cpp @@ -6,6 +6,7 @@ #include "clang/ASTMatchers/ASTMatchers.h" +// NOLINTNEXTLINE(readability-identifier-naming) namespace cam = ::clang::ast_matchers; namespace Carbon { diff --git a/migrate_cpp/cpp_refactoring/var_decl.cpp b/migrate_cpp/cpp_refactoring/var_decl.cpp index 2f9fe9ad6be05..7e586c618ba35 100644 --- a/migrate_cpp/cpp_refactoring/var_decl.cpp +++ b/migrate_cpp/cpp_refactoring/var_decl.cpp @@ -7,6 +7,7 @@ #include "clang/ASTMatchers/ASTMatchers.h" #include "llvm/Support/FormatVariadic.h" +// NOLINTNEXTLINE(readability-identifier-naming) namespace cam = ::clang::ast_matchers; namespace Carbon { @@ -36,7 +37,6 @@ auto VarDecl::GetTypeStr(const clang::VarDecl& decl) -> std::string { auto type_loc = decl.getTypeSourceInfo()->getTypeLoc(); std::vector> segments; while (!type_loc.isNull()) { - std::string text; auto qualifiers = type_loc.getType().getLocalQualifiers(); std::string qual_str; if (!qualifiers.empty()) { diff --git a/migrate_cpp/rewriter.cpp b/migrate_cpp/rewriter.cpp index 55636b74a57e8..35f0e7c6b2279 100644 --- a/migrate_cpp/rewriter.cpp +++ b/migrate_cpp/rewriter.cpp @@ -297,6 +297,7 @@ auto RewriteBuilder::VisitUnaryOperator(clang::UnaryOperator* expr) -> bool { return true; } +// NOLINTNEXTLINE(misc-no-recursion): Recursion may be okay for migration. auto RewriteBuilder::TraverseFunctionDecl(clang::FunctionDecl* decl) -> bool { clang::TypeLoc return_type_loc = decl->getFunctionTypeLoc().getReturnLoc(); if (!TraverseTypeLoc(return_type_loc)) { @@ -345,6 +346,7 @@ auto RewriteBuilder::TraverseFunctionDecl(clang::FunctionDecl* decl) -> bool { return true; } +// NOLINTNEXTLINE(misc-no-recursion): Recursion may be okay for migration. auto RewriteBuilder::TraverseVarDecl(clang::VarDecl* decl) -> bool { clang::TypeLoc loc = decl->getTypeSourceInfo()->getTypeLoc(); if (!TraverseTypeLoc(loc)) { diff --git a/testing/fuzzing/proto_to_carbon.cpp b/testing/fuzzing/proto_to_carbon.cpp index a9cb40ebc00bb..6fef9ad804aa7 100644 --- a/testing/fuzzing/proto_to_carbon.cpp +++ b/testing/fuzzing/proto_to_carbon.cpp @@ -12,6 +12,9 @@ #include "llvm/Support/raw_ostream.h" #include "testing/fuzzing/carbon.pb.h" +// This is a test file, so the recursion is okay. +// NOLINTBEGIN(misc-no-recursion) + namespace Carbon { static auto ExpressionToCarbon(const Fuzzing::Expression& expression, @@ -1023,3 +1026,5 @@ auto ParseCarbonTextProto(const std::string& contents) } } // namespace Carbon + +// NOLINTEND(misc-no-recursion) diff --git a/toolchain/base/value_ids.h b/toolchain/base/value_ids.h index 465e8db652579..fc4ee04be61ba 100644 --- a/toolchain/base/value_ids.h +++ b/toolchain/base/value_ids.h @@ -21,8 +21,7 @@ namespace Carbon { // // These values are not canonicalized, because we don't expect them to repeat // and don't use them in SemIR values. -class Real : public Printable { - public: +struct Real : public Printable { auto Print(llvm::raw_ostream& output_stream) const -> void { mantissa.print(output_stream, /*isSigned=*/false); output_stream << "*" << (is_decimal ? "10" : "2") << "^" << exponent; diff --git a/toolchain/check/convert.cpp b/toolchain/check/convert.cpp index 507548c3bccbc..9e57ebde42ccc 100644 --- a/toolchain/check/convert.cpp +++ b/toolchain/check/convert.cpp @@ -22,6 +22,10 @@ #include "toolchain/sem_ir/inst.h" #include "toolchain/sem_ir/typed_insts.h" +// TODO: This contains a lot of recursion. Consider removing it in order to +// prevent accidents. +// NOLINTBEGIN(misc-no-recursion) + namespace Carbon::Check { // Given an initializing expression, find its return slot argument. Returns @@ -1245,3 +1249,5 @@ auto ExprAsType(Context& context, SemIR::LocId loc_id, SemIR::InstId value_id) } } // namespace Carbon::Check + +// NOLINTEND(misc-no-recursion) diff --git a/toolchain/check/import_ref.cpp b/toolchain/check/import_ref.cpp index 26b0b9576b69b..fe8a1a1655ff9 100644 --- a/toolchain/check/import_ref.cpp +++ b/toolchain/check/import_ref.cpp @@ -342,6 +342,14 @@ class ImportContext { } protected: + auto pending_generics() -> llvm::SmallVector& { + return pending_generics_; + } + auto pending_specifics() -> llvm::SmallVector& { + return pending_specifics_; + } + + private: Context& context_; SemIR::ImportIRId import_ir_id_; const SemIR::File& import_ir_; @@ -2526,6 +2534,10 @@ static auto TryResolveTypedInst(ImportRefResolver& resolver, // Invalid if more has been added to the stack. This is the same as // TryResolveInst, except that it may resolve symbolic constants as canonical // constants instead of as constants associated with a particular generic. +// +// TODO: Consider refactoring the body to a helper in order to eliminate +// recursion. +// NOLINTNEXTLINE(misc-no-recursion) static auto TryResolveInstCanonical(ImportRefResolver& resolver, SemIR::InstId inst_id, SemIR::ConstantId const_id) @@ -2850,7 +2862,7 @@ static auto FinishPendingSpecific(ImportRefResolver& resolver, auto ImportRefResolver::PerformPendingWork() -> void { // Note that the individual Finish steps can add new pending work, so keep // going until we have no more work to do. - while (!pending_generics_.empty() || !pending_specifics_.empty()) { + while (!pending_generics().empty() || !pending_specifics().empty()) { // Process generics in the order that we added them because a later // generic might refer to an earlier one, and the calls to // RebuildGenericEvalBlock assume that the reachable SemIR is in a valid @@ -2858,13 +2870,13 @@ auto ImportRefResolver::PerformPendingWork() -> void { // TODO: Import the generic eval block rather than calling // RebuildGenericEvalBlock to rebuild it so that order doesn't matter. // NOLINTNEXTLINE(modernize-loop-convert) - for (size_t i = 0; i != pending_generics_.size(); ++i) { - FinishPendingGeneric(*this, pending_generics_[i]); + for (size_t i = 0; i != pending_generics().size(); ++i) { + FinishPendingGeneric(*this, pending_generics()[i]); } - pending_generics_.clear(); + pending_generics().clear(); - while (!pending_specifics_.empty()) { - FinishPendingSpecific(*this, pending_specifics_.pop_back_val()); + while (!pending_specifics().empty()) { + FinishPendingSpecific(*this, pending_specifics().pop_back_val()); } } } diff --git a/toolchain/check/subst.cpp b/toolchain/check/subst.cpp index 70766ce9eec72..965d1b77837d6 100644 --- a/toolchain/check/subst.cpp +++ b/toolchain/check/subst.cpp @@ -61,6 +61,19 @@ class Worklist { // Pushes the specified operand onto the worklist. static auto PushOperand(Context& context, Worklist& worklist, SemIR::IdKind kind, int32_t arg) -> void { + auto push_block = [&](SemIR::InstBlockId block_id) { + for (auto inst_id : + context.inst_blocks().Get(SemIR::InstBlockId(block_id))) { + worklist.Push(inst_id); + } + }; + + auto push_specific = [&](SemIR::SpecificId specific_id) { + if (specific_id.is_valid()) { + push_block(context.specifics().Get(specific_id).args_id); + } + }; + switch (kind) { case SemIR::IdKind::For: if (SemIR::InstId inst_id(arg); inst_id.is_valid()) { @@ -73,9 +86,7 @@ static auto PushOperand(Context& context, Worklist& worklist, } break; case SemIR::IdKind::For: - for (auto inst_id : context.inst_blocks().Get(SemIR::InstBlockId(arg))) { - worklist.Push(inst_id); - } + push_block(SemIR::InstBlockId(arg)); break; case SemIR::IdKind::For: { for (auto field : @@ -90,18 +101,13 @@ static auto PushOperand(Context& context, Worklist& worklist, } break; case SemIR::IdKind::For: - if (auto specific_id = static_cast(arg); - specific_id.is_valid()) { - PushOperand(context, worklist, SemIR::IdKind::For, - context.specifics().Get(specific_id).args_id.index); - } + push_specific(SemIR::SpecificId(arg)); break; case SemIR::IdKind::For: { const auto& facet_type_info = context.facet_types().Get(SemIR::FacetTypeId(arg)); for (auto interface : facet_type_info.impls_constraints) { - PushOperand(context, worklist, SemIR::IdKind::For, - interface.specific_id.index); + push_specific(interface.specific_id); } for (auto rewrite : facet_type_info.rewrite_constraints) { auto lhs_inst_id = @@ -134,6 +140,25 @@ static auto ExpandOperands(Context& context, Worklist& worklist, // Pops the specified operand from the worklist and returns it. static auto PopOperand(Context& context, Worklist& worklist, SemIR::IdKind kind, int32_t arg) -> int32_t { + auto pop_block_id = [&](SemIR::InstBlockId old_inst_block_id) { + auto size = context.inst_blocks().Get(old_inst_block_id).size(); + SemIR::CopyOnWriteInstBlock new_inst_block(context.sem_ir(), + old_inst_block_id); + for (auto i : llvm::reverse(llvm::seq(size))) { + new_inst_block.Set(i, worklist.Pop()); + } + return new_inst_block.GetCanonical(); + }; + + auto pop_specific = [&](SemIR::SpecificId specific_id) { + if (!specific_id.is_valid()) { + return specific_id; + } + auto& specific = context.specifics().Get(specific_id); + auto args_id = pop_block_id(specific.args_id); + return context.specifics().GetOrAdd(specific.generic_id, args_id); + }; + switch (kind) { case SemIR::IdKind::For: { SemIR::InstId inst_id(arg); @@ -150,14 +175,7 @@ static auto PopOperand(Context& context, Worklist& worklist, SemIR::IdKind kind, return context.GetTypeIdForTypeInst(worklist.Pop()).index; } case SemIR::IdKind::For: { - SemIR::InstBlockId old_inst_block_id(arg); - auto size = context.inst_blocks().Get(old_inst_block_id).size(); - SemIR::CopyOnWriteInstBlock new_inst_block(context.sem_ir(), - old_inst_block_id); - for (auto i : llvm::reverse(llvm::seq(size))) { - new_inst_block.Set(i, worklist.Pop()); - } - return new_inst_block.GetCanonical().index; + return pop_block_id(SemIR::InstBlockId(arg)).index; } case SemIR::IdKind::For: { SemIR::StructTypeFieldsId old_fields_id(arg); @@ -182,15 +200,7 @@ static auto PopOperand(Context& context, Worklist& worklist, SemIR::IdKind kind, return new_type_block.GetCanonical().index; } case SemIR::IdKind::For: { - SemIR::SpecificId specific_id(arg); - if (!specific_id.is_valid()) { - return arg; - } - auto& specific = context.specifics().Get(specific_id); - auto args_id = SemIR::InstBlockId( - PopOperand(context, worklist, SemIR::IdKind::For, - specific.args_id.index)); - return context.specifics().GetOrAdd(specific.generic_id, args_id).index; + return pop_specific(SemIR::SpecificId(arg)).index; } case SemIR::IdKind::For: { const auto& old_facet_type_info = @@ -206,11 +216,8 @@ static auto PopOperand(Context& context, Worklist& worklist, SemIR::IdKind kind, } for (auto i : llvm::reverse( llvm::seq(old_facet_type_info.impls_constraints.size()))) { - auto specific_id = PopOperand( - context, worklist, SemIR::IdKind::For, - old_facet_type_info.impls_constraints[i].specific_id.index); new_facet_type_info.impls_constraints[i].specific_id = - SemIR::SpecificId(specific_id); + pop_specific(old_facet_type_info.impls_constraints[i].specific_id); } new_facet_type_info.Canonicalize(); return context.facet_types().Add(new_facet_type_info).index; diff --git a/toolchain/sem_ir/formatter.cpp b/toolchain/sem_ir/formatter.cpp index 6ee487912caf0..48e136932bc0e 100644 --- a/toolchain/sem_ir/formatter.cpp +++ b/toolchain/sem_ir/formatter.cpp @@ -20,6 +20,11 @@ #include "toolchain/sem_ir/name_scope.h" #include "toolchain/sem_ir/typed_insts.h" +// TODO: Consider addressing recursion here, although it's not critical because +// the formatter isn't required to work on arbitrary code. Still, it may help +// in the future to debug complex code. +// NOLINTBEGIN(misc-no-recursion) + namespace Carbon::SemIR { // Formatter for printing textual Semantics IR. @@ -1383,3 +1388,5 @@ auto Formatter::Print(llvm::raw_ostream& out) -> void { } } // namespace Carbon::SemIR + +// NOLINTEND(misc-no-recursion) diff --git a/toolchain/sem_ir/inst_namer.cpp b/toolchain/sem_ir/inst_namer.cpp index a33e2b57add1e..b7a0f81c5b887 100644 --- a/toolchain/sem_ir/inst_namer.cpp +++ b/toolchain/sem_ir/inst_namer.cpp @@ -355,6 +355,9 @@ auto InstNamer::AddBlockLabel(ScopeId scope_id, SemIR::LocId loc_id, AddBlockLabel(scope_id, branch.target_id, name.str(), loc_id); } +// TODO: Consider addressing recursion here. It may be important because +// InstNamer is used for debug info. +// NOLINTNEXTLINE(misc-no-recursion) auto InstNamer::CollectNamesInBlock(ScopeId scope_id, InstBlockId block_id) -> void { if (block_id.is_valid()) { @@ -362,6 +365,7 @@ auto InstNamer::CollectNamesInBlock(ScopeId scope_id, InstBlockId block_id) } } +// NOLINTNEXTLINE(misc-no-recursion): See above TODO. auto InstNamer::CollectNamesInBlock(ScopeId scope_id, llvm::ArrayRef block) -> void { Scope& scope = GetScopeInfo(scope_id); diff --git a/toolchain/testing/yaml_test_helpers.cpp b/toolchain/testing/yaml_test_helpers.cpp index 4eff3f2a19e2c..8bb9b877395cb 100644 --- a/toolchain/testing/yaml_test_helpers.cpp +++ b/toolchain/testing/yaml_test_helpers.cpp @@ -9,6 +9,8 @@ namespace Carbon::Testing::Yaml { +// This is for tests, so we should be okay with the recursion here. +// NOLINTNEXTLINE(misc-no-recursion) static auto Parse(llvm::yaml::Node* node) -> Value { CARBON_CHECK(node != nullptr); From 2eb1c7c3724f398b1baa93192970b4818e962602 Mon Sep 17 00:00:00 2001 From: Jon Ross-Perkins Date: Tue, 17 Dec 2024 14:55:43 -0800 Subject: [PATCH 46/68] Document StepStack (#4687) Also add underscores to member names, and make `PushSpecificId` private since it's not used outside `PushEntityName` --------- Co-authored-by: Geoff Romer --- toolchain/sem_ir/stringify_type.cpp | 77 ++++++++++++++++++----------- 1 file changed, 49 insertions(+), 28 deletions(-) diff --git a/toolchain/sem_ir/stringify_type.cpp b/toolchain/sem_ir/stringify_type.cpp index 641913af72ff6..ad34223995f29 100644 --- a/toolchain/sem_ir/stringify_type.cpp +++ b/toolchain/sem_ir/stringify_type.cpp @@ -27,17 +27,22 @@ static auto GetTypePrecedence(InstKind kind) -> int { } namespace { +// Contains the stack of steps for `StringifyTypeExpr`. class StepStack { public: - enum Kind : uint8_t { - Inst, - FixedString, - ArrayBound, - Name, - }; + // An individual step in the stack, which stringifies some component of a type + // name. struct Step { // The kind of step to perform. + enum Kind : uint8_t { + Inst, + FixedString, + ArrayBound, + Name, + }; + Kind kind; + union { // The instruction to print, when kind is Inst. InstId inst_id; @@ -50,27 +55,32 @@ class StepStack { }; }; + // Starts a new stack, which always contains the first instruction to + // stringify. explicit StepStack(const SemIR::File* file, InstId outer_inst_id) - : sem_ir(file) { - steps.push_back({.kind = Inst, .inst_id = outer_inst_id}); + : sem_ir_(file) { + PushInstId(outer_inst_id); } + // These push basic entries onto the stack. auto PushInstId(InstId inst_id) -> void { - steps.push_back({.kind = Inst, .inst_id = inst_id}); + steps_.push_back({.kind = Step::Inst, .inst_id = inst_id}); } auto PushString(const char* string) -> void { - steps.push_back({.kind = FixedString, .fixed_string = string}); + steps_.push_back({.kind = Step::FixedString, .fixed_string = string}); } auto PushArrayBound(InstId bound_id) -> void { - steps.push_back({.kind = ArrayBound, .bound_id = bound_id}); + steps_.push_back({.kind = Step::ArrayBound, .bound_id = bound_id}); } auto PushNameId(NameId name_id) -> void { - steps.push_back({.kind = Name, .name_id = name_id}); + steps_.push_back({.kind = Step::Name, .name_id = name_id}); } + + // Pushes all components of a qualified name (`A.B.C`) onto the stack. auto PushQualifiedName(NameScopeId name_scope_id, NameId name_id) -> void { PushNameId(name_id); while (name_scope_id.is_valid() && name_scope_id != NameScopeId::Package) { - const auto& name_scope = sem_ir->name_scopes().Get(name_scope_id); + const auto& name_scope = sem_ir_->name_scopes().Get(name_scope_id); // TODO: Decide how to print unnamed scopes. if (name_scope.name_id().is_valid()) { PushString("."); @@ -81,24 +91,38 @@ class StepStack { name_scope_id = name_scope.parent_scope_id(); } } + + // Pushes a specific's entity name onto the stack, such as `A.B(T)`. auto PushEntityName(const EntityWithParamsBase& entity, SpecificId specific_id) -> void { PushSpecificId(entity, specific_id); PushQualifiedName(entity.parent_scope_id, entity.name_id); } + + // Pushes a entity name onto the stack, such as `A.B`. auto PushEntityName(EntityNameId entity_name_id) -> void { - const auto& entity_name = sem_ir->entity_names().Get(entity_name_id); + const auto& entity_name = sem_ir_->entity_names().Get(entity_name_id); PushQualifiedName(entity_name.parent_scope_id, entity_name.name_id); } + + // Pushes an instruction by its TypeId. auto PushTypeId(TypeId type_id) -> void { - PushInstId(sem_ir->types().GetInstId(type_id)); + PushInstId(sem_ir_->types().GetInstId(type_id)); } + + auto empty() const -> bool { return steps_.empty(); } + auto Pop() -> Step { return steps_.pop_back_val(); } + + private: + // Handles the generic portion of a specific entity name, such as `(T)` in + // `A.B(T)`. auto PushSpecificId(const EntityWithParamsBase& entity, SpecificId specific_id) -> void { if (!entity.param_patterns_id.is_valid()) { return; } - int num_params = sem_ir->inst_blocks().Get(entity.param_patterns_id).size(); + int num_params = + sem_ir_->inst_blocks().Get(entity.param_patterns_id).size(); if (!num_params) { PushString("()"); return; @@ -109,9 +133,9 @@ class StepStack { // case? return; } - const auto& specific = sem_ir->specifics().Get(specific_id); + const auto& specific = sem_ir_->specifics().Get(specific_id); auto args = - sem_ir->inst_blocks().Get(specific.args_id).take_back(num_params); + sem_ir_->inst_blocks().Get(specific.args_id).take_back(num_params); bool last = true; for (auto arg : llvm::reverse(args)) { PushString(last ? ")" : ", "); @@ -121,12 +145,9 @@ class StepStack { PushString("("); } - auto empty() const -> bool { return steps.empty(); } - auto Pop() -> Step { return steps.pop_back_val(); } - - private: - const SemIR::File* sem_ir; - llvm::SmallVector steps; + const SemIR::File* sem_ir_; + // Remaining steps to take. + llvm::SmallVector steps_; }; } // namespace @@ -143,16 +164,16 @@ auto StringifyTypeExpr(const SemIR::File& sem_ir, InstId outer_inst_id) auto step = step_stack.Pop(); switch (step.kind) { - case StepStack::FixedString: + case StepStack::Step::FixedString: out << step.fixed_string; continue; - case StepStack::ArrayBound: + case StepStack::Step::ArrayBound: out << sem_ir.GetArrayBoundValue(step.bound_id); continue; - case StepStack::Name: + case StepStack::Step::Name: out << sem_ir.names().GetFormatted(step.name_id); continue; - case StepStack::Inst: + case StepStack::Step::Inst: if (!step.inst_id.is_valid()) { out << ""; continue; From b69f97d1f304b242b84c9f962fb5ad2d4883fdca Mon Sep 17 00:00:00 2001 From: Nirmal Patel Date: Tue, 17 Dec 2024 18:38:17 -0500 Subject: [PATCH 47/68] Fix Devcontainer build errors (#4647) Devcontainer Dockerfile has been updated to use Ubuntu 24.04 as the base. Now devcontainer builds without errors. Tested with Podman on Linux and Docker Desktop on Windows. To avoid re-downloading and re-compiling whenever the container is deleted, a named volume is mounted at /home/ubuntu/.cache. Closes #4065 --- .devcontainer/devcontainer.json | 16 +++++++++++++++- docker/README.md | 12 ++++++------ docker/{ubuntu2204 => ubuntu2404}/Dockerfile | 4 ++-- .../base/Dockerfile | 19 ++++++++++++------- .../github/Dockerfile | 4 ++-- 5 files changed, 37 insertions(+), 18 deletions(-) rename docker/{ubuntu2204 => ubuntu2404}/Dockerfile (81%) rename docker/{ubuntu2204 => ubuntu2404}/base/Dockerfile (73%) rename docker/{ubuntu2204 => ubuntu2404}/github/Dockerfile (82%) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 5dbfdc133c81f..527b50c5f4ac8 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -5,8 +5,22 @@ { "name": "carbon-lang", "build": { - "dockerfile": "../docker/ubuntu2204/base/Dockerfile" + "dockerfile": "../docker/ubuntu2404/base/Dockerfile" }, + "mounts": [ + { + "source": "carbon-cache", + "target": "/home/ubuntu/.cache", + "type": "volume" + } + ], + "containerUser": "ubuntu", + "remoteUser": "ubuntu", + // When using devcontainer with podman, you may see /workspace being owned + // by root. To work around this, uncomment the following lines + // "runArgs": [ + // "--userns=keep-id" + // ], "customizations": { "vscode": { "extensions": [ diff --git a/docker/README.md b/docker/README.md index 5c558694bd6ea..c32692db12606 100644 --- a/docker/README.md +++ b/docker/README.md @@ -15,31 +15,31 @@ ubuntu:22.04 Building the base image is required. ``` -docker build -t carbon-ubuntu2204-base ./ubuntu2204/base +docker build -t carbon-ubuntu2404-base ./ubuntu2404/base ``` Build image using git repository ```bash -docker build -t carbon-ubuntu2204 ./ubuntu2204/github +docker build -t carbon-ubuntu2404 ./ubuntu2404/github ``` Build image using copy instruction ```bash -docker build -f ./ubuntu2204/Dockerfile -t carbon-ubuntu2204 .. +docker build -f ./ubuntu2404/Dockerfile -t carbon-ubuntu2404 .. ``` Run image ```bash -docker run carbon-ubuntu2204 +docker run carbon-ubuntu2404 ``` Run image using specific file ```bash -docker run carbon-ubuntu2204 bazel run //explorer -- ./explorer/testdata/print/format_only.carbon +docker run carbon-ubuntu2404 bazel run //explorer -- ./explorer/testdata/print/format_only.carbon ``` ### Using a mounted volume @@ -51,5 +51,5 @@ cd .. ``` ```bash -docker run -w "/carbon-lang" -v "${PWD}:/carbon-lang" "carbon-ubuntu2204-base" bazel run "//explorer" -- "./explorer/testdata/print/format_only.carbon" +docker run -w "/carbon-lang" -v "${PWD}:/carbon-lang" "carbon-ubuntu2404-base" bazel run "//explorer" -- "./explorer/testdata/print/format_only.carbon" ``` diff --git a/docker/ubuntu2204/Dockerfile b/docker/ubuntu2404/Dockerfile similarity index 81% rename from docker/ubuntu2204/Dockerfile rename to docker/ubuntu2404/Dockerfile index 5463f03b0fd46..0e05572dceaf2 100644 --- a/docker/ubuntu2204/Dockerfile +++ b/docker/ubuntu2404/Dockerfile @@ -2,7 +2,7 @@ # Exceptions. See /LICENSE for license information. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -FROM carbon-ubuntu2204-base as carbon-ubuntu2204-build +FROM carbon-ubuntu2404-base as carbon-ubuntu2404-build COPY . /carbon-lang WORKDIR /carbon-lang @@ -10,6 +10,6 @@ WORKDIR /carbon-lang # Build RUN bazel build //explorer -FROM carbon-ubuntu2204-build +FROM carbon-ubuntu2404-build CMD ["bazel", "run", "//explorer", "--", "./explorer/testdata/print/format_only.carbon"] diff --git a/docker/ubuntu2204/base/Dockerfile b/docker/ubuntu2404/base/Dockerfile similarity index 73% rename from docker/ubuntu2204/base/Dockerfile rename to docker/ubuntu2404/base/Dockerfile index 1693d233640e8..f62eb1109544c 100644 --- a/docker/ubuntu2204/base/Dockerfile +++ b/docker/ubuntu2404/base/Dockerfile @@ -2,7 +2,7 @@ # Exceptions. See /LICENSE for license information. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -FROM ubuntu:22.04 as carbon-ubuntu2204-base +FROM ubuntu:24.04 as carbon-ubuntu2404-base # Install apt tools: # git: Used by VS Code. @@ -16,9 +16,11 @@ RUN apt-get update && \ gnupg \ golang \ python3-pip \ - python3.9 \ + python3 \ software-properties-common \ - wget + wget \ + nodejs \ + npm ENV PATH="/root/go/bin:${PATH}" @@ -32,13 +34,16 @@ RUN go install github.com/bazelbuild/buildtools/buildifier@5.1.0 # Install LLVM from apt.llvm.org. RUN wget https://apt.llvm.org/llvm.sh RUN chmod +x llvm.sh -RUN ./llvm.sh 15 all +RUN ./llvm.sh 18 all RUN rm llvm.sh # Add the lib dir to the PATH. This helps Bazel find clang and VS Code find # clangd, without version suffixes. -ENV PATH="/usr/lib/llvm-15/bin:${PATH}" +ENV PATH="/usr/lib/llvm-18/bin:${PATH}" # Update pip and install black and pre-commit. -RUN pip3 install -U pip -RUN pip3 install black pre-commit +RUN pip3 install black pre-commit --break-system-packages + +# Create .cache directory with proper ownership. We will mount a named volume +# at this location to allow caching of bazel build files. +RUN mkdir /home/ubuntu/.cache && chown -R ubuntu:ubuntu /home/ubuntu/.cache diff --git a/docker/ubuntu2204/github/Dockerfile b/docker/ubuntu2404/github/Dockerfile similarity index 82% rename from docker/ubuntu2204/github/Dockerfile rename to docker/ubuntu2404/github/Dockerfile index 3df83a09bdc8d..84f937305f00c 100644 --- a/docker/ubuntu2204/github/Dockerfile +++ b/docker/ubuntu2404/github/Dockerfile @@ -2,7 +2,7 @@ # Exceptions. See /LICENSE for license information. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -FROM carbon-ubuntu2204-base as carbon-ubuntu2204-github-build +FROM carbon-ubuntu2404-base as carbon-ubuntu2404-github-build # Clone git repository RUN git clone https://github.com/carbon-language/carbon-lang @@ -15,6 +15,6 @@ RUN pre-commit install # Build RUN bazel build //explorer -FROM carbon-ubuntu2204-github-build +FROM carbon-ubuntu2404-github-build CMD ["bazel", "run", "//explorer", "--", "./explorer/testdata/print/format_only.carbon"] From 4d0a6db49bdd7eb1c13e20f1614e45b9e2abed0d Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Tue, 17 Dec 2024 16:19:12 -0800 Subject: [PATCH 48/68] Abort checking when encountering an invalid parse node (#4700) Short term solution/block for #4689 --- toolchain/check/check_unit.cpp | 5 ++ toolchain/check/handle_name.cpp | 10 ++-- toolchain/check/handle_noop.cpp | 17 +++--- .../testdata/basics/type_literals.carbon | 4 +- .../class/fail_base_as_declared_name.carbon | 2 +- .../testdata/class/fail_base_misplaced.carbon | 2 +- .../class/fail_self_type_member.carbon | 2 +- .../class/fail_todo_local_class.carbon | 2 +- .../no_prelude/extern_library.carbon | 18 ++----- .../fail_pattern_in_signature.carbon | 2 +- .../no_prelude/fail_todo_no_params.carbon | 16 +----- .../packages/no_prelude/export_import.carbon | 54 +++---------------- .../testdata/struct/fail_keyword_name.carbon | 2 +- .../basics/fail_before_lowering.carbon | 2 +- 14 files changed, 40 insertions(+), 98 deletions(-) diff --git a/toolchain/check/check_unit.cpp b/toolchain/check/check_unit.cpp index 54a5e5f9e8d76..87a6b830a5795 100644 --- a/toolchain/check/check_unit.cpp +++ b/toolchain/check/check_unit.cpp @@ -346,6 +346,11 @@ auto CheckUnit::ProcessNodeIds() -> bool { node_id = *maybe_node_id; auto parse_kind = context_.parse_tree().node_kind(node_id); + if (context_.parse_tree().node_has_error(node_id)) { + context_.TODO(node_id, "handle invalid parse trees in `check`"); + return false; + } + bool result; switch (parse_kind) { #define CARBON_PARSE_NODE_KIND(Name) \ diff --git a/toolchain/check/handle_name.cpp b/toolchain/check/handle_name.cpp index 7e17619501f23..81880fe14df69 100644 --- a/toolchain/check/handle_name.cpp +++ b/toolchain/check/handle_name.cpp @@ -127,9 +127,8 @@ auto HandleParseNode(Context& context, Parse::IdentifierNameId node_id) -> bool { // The parent is responsible for binding the name. auto name_id = GetIdentifierAsName(context, node_id); - if (!name_id) { - return context.TODO(node_id, "Error recovery from keyword name."); - } + CARBON_CHECK(name_id, + "Unreachable until we support checking error parse nodes"); context.node_stack().Push(node_id, *name_id); return true; } @@ -137,9 +136,8 @@ auto HandleParseNode(Context& context, Parse::IdentifierNameId node_id) auto HandleParseNode(Context& context, Parse::IdentifierNameExprId node_id) -> bool { auto name_id = GetIdentifierAsName(context, node_id); - if (!name_id) { - return context.TODO(node_id, "Error recovery from keyword name."); - } + CARBON_CHECK(name_id, + "Unreachable until we support checking error parse nodes"); context.node_stack().Push(node_id, HandleNameAsExpr(context, node_id, *name_id)); return true; diff --git a/toolchain/check/handle_noop.cpp b/toolchain/check/handle_noop.cpp index 251db60e7ab2f..b71f7b1d567de 100644 --- a/toolchain/check/handle_noop.cpp +++ b/toolchain/check/handle_noop.cpp @@ -13,18 +13,19 @@ auto HandleParseNode(Context& /*context*/, Parse::EmptyDeclId /*node_id*/) return true; } -auto HandleParseNode(Context& context, Parse::InvalidParseId node_id) -> bool { - return context.TODO(node_id, "HandleInvalidParse"); +auto HandleParseNode(Context& /*context*/, Parse::InvalidParseId /*node_id*/) + -> bool { + CARBON_FATAL("Unreachable until we support checking error parse nodes"); } -auto HandleParseNode(Context& context, Parse::InvalidParseStartId node_id) - -> bool { - return context.TODO(node_id, "HandleInvalidParseStart"); +auto HandleParseNode(Context& /*context*/, + Parse::InvalidParseStartId /*node_id*/) -> bool { + CARBON_FATAL("Unreachable until we support checking error parse nodes"); } -auto HandleParseNode(Context& context, Parse::InvalidParseSubtreeId node_id) - -> bool { - return context.TODO(node_id, "HandleInvalidParseSubtree"); +auto HandleParseNode(Context& /*context*/, + Parse::InvalidParseSubtreeId /*node_id*/) -> bool { + CARBON_FATAL("Unreachable until we support checking error parse nodes"); } auto HandleParseNode(Context& /*context*/, Parse::PlaceholderId /*node_id*/) diff --git a/toolchain/check/testdata/basics/type_literals.carbon b/toolchain/check/testdata/basics/type_literals.carbon index 2fec59c203ab4..00aaf3a58c843 100644 --- a/toolchain/check/testdata/basics/type_literals.carbon +++ b/toolchain/check/testdata/basics/type_literals.carbon @@ -42,7 +42,7 @@ var test_i15: i15; // CHECK:STDERR: var test_i1000000000: i1000000000; // TODO: This diagnostic is not very good. -// CHECK:STDERR: fail_iN_bad_width.carbon:[[@LINE+8]]:33: error: semantics TODO: `HandleInvalidParse` [SemanticsTodo] +// CHECK:STDERR: fail_iN_bad_width.carbon:[[@LINE+8]]:33: error: semantics TODO: `handle invalid parse trees in `check`` [SemanticsTodo] // CHECK:STDERR: var test_i10000000000000000000: i10000000000000000000; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -86,7 +86,7 @@ var test_u15: u15; // CHECK:STDERR: var test_u1000000000: u1000000000; // TODO: This diagnostic is not very good. -// CHECK:STDERR: fail_uN_bad_width.carbon:[[@LINE+8]]:33: error: semantics TODO: `HandleInvalidParse` [SemanticsTodo] +// CHECK:STDERR: fail_uN_bad_width.carbon:[[@LINE+8]]:33: error: semantics TODO: `handle invalid parse trees in `check`` [SemanticsTodo] // CHECK:STDERR: var test_u10000000000000000000: u10000000000000000000; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: diff --git a/toolchain/check/testdata/class/fail_base_as_declared_name.carbon b/toolchain/check/testdata/class/fail_base_as_declared_name.carbon index 301cce52e191c..59dc0914996c4 100644 --- a/toolchain/check/testdata/class/fail_base_as_declared_name.carbon +++ b/toolchain/check/testdata/class/fail_base_as_declared_name.carbon @@ -14,7 +14,7 @@ namespace N; // CHECK:STDERR: fn N.base() {} // CHECK:STDERR: ^~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_base_as_declared_name.carbon:[[@LINE+3]]:6: error: semantics TODO: `HandleInvalidParse` [SemanticsTodo] +// CHECK:STDERR: fail_base_as_declared_name.carbon:[[@LINE+3]]:6: error: semantics TODO: `handle invalid parse trees in `check`` [SemanticsTodo] // CHECK:STDERR: fn N.base() {} // CHECK:STDERR: ^~~~ fn N.base() {} diff --git a/toolchain/check/testdata/class/fail_base_misplaced.carbon b/toolchain/check/testdata/class/fail_base_misplaced.carbon index 36a735093ba22..fbd0ce4c4fae9 100644 --- a/toolchain/check/testdata/class/fail_base_misplaced.carbon +++ b/toolchain/check/testdata/class/fail_base_misplaced.carbon @@ -21,7 +21,7 @@ fn F() { // CHECK:STDERR: extend base: B; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: - // CHECK:STDERR: fail_base_misplaced.carbon:[[@LINE+3]]:3: error: semantics TODO: `HandleInvalidParse` [SemanticsTodo] + // CHECK:STDERR: fail_base_misplaced.carbon:[[@LINE+3]]:3: error: semantics TODO: `handle invalid parse trees in `check`` [SemanticsTodo] // CHECK:STDERR: extend base: B; // CHECK:STDERR: ^~~~~~ extend base: B; diff --git a/toolchain/check/testdata/class/fail_self_type_member.carbon b/toolchain/check/testdata/class/fail_self_type_member.carbon index 37d8e67936930..ce7510e8cf3fc 100644 --- a/toolchain/check/testdata/class/fail_self_type_member.carbon +++ b/toolchain/check/testdata/class/fail_self_type_member.carbon @@ -18,7 +18,7 @@ fn F() -> bool { // CHECK:STDERR: var c2: Class.Self = c1; // CHECK:STDERR: ^~~~ // CHECK:STDERR: - // CHECK:STDERR: fail_self_type_member.carbon:[[@LINE+3]]:17: error: semantics TODO: `Error recovery from keyword name.` [SemanticsTodo] + // CHECK:STDERR: fail_self_type_member.carbon:[[@LINE+3]]:17: error: semantics TODO: `handle invalid parse trees in `check`` [SemanticsTodo] // CHECK:STDERR: var c2: Class.Self = c1; // CHECK:STDERR: ^~~~ var c2: Class.Self = c1; diff --git a/toolchain/check/testdata/class/fail_todo_local_class.carbon b/toolchain/check/testdata/class/fail_todo_local_class.carbon index 26ef9a5d28cd1..39c8fc2aa61c9 100644 --- a/toolchain/check/testdata/class/fail_todo_local_class.carbon +++ b/toolchain/check/testdata/class/fail_todo_local_class.carbon @@ -15,7 +15,7 @@ class A { // CHECK:STDERR: class B { // CHECK:STDERR: ^~~~~ // CHECK:STDERR: - // CHECK:STDERR: fail_todo_local_class.carbon:[[@LINE+3]]:5: error: semantics TODO: `HandleInvalidParse` [SemanticsTodo] + // CHECK:STDERR: fail_todo_local_class.carbon:[[@LINE+3]]:5: error: semantics TODO: `handle invalid parse trees in `check`` [SemanticsTodo] // CHECK:STDERR: class B { // CHECK:STDERR: ^~~~~ class B { diff --git a/toolchain/check/testdata/function/declaration/no_prelude/extern_library.carbon b/toolchain/check/testdata/function/declaration/no_prelude/extern_library.carbon index e6f40a066995c..b616a7a3b381d 100644 --- a/toolchain/check/testdata/function/declaration/no_prelude/extern_library.carbon +++ b/toolchain/check/testdata/function/declaration/no_prelude/extern_library.carbon @@ -102,6 +102,10 @@ extern library "extern_library_owner" fn F(); library "[[@TEST_NAME]]"; +// CHECK:STDERR: fail_extern_library_mismatch_owner.carbon:[[@LINE+4]]:1: error: semantics TODO: `handle invalid parse trees in `check`` [SemanticsTodo] +// CHECK:STDERR: import library "extern_library_mismatch" +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: import library "extern_library_mismatch" // CHECK:STDERR: fail_extern_library_mismatch_owner.carbon:[[@LINE+4]]:1: error: `import` declarations must end with a `;` [ExpectedDeclSemi] @@ -294,19 +298,7 @@ extern library "extern_library_owner" fn F() {} // CHECK:STDOUT: // CHECK:STDOUT: --- fail_extern_library_mismatch_owner.carbon // CHECK:STDOUT: -// CHECK:STDOUT: constants { -// CHECK:STDOUT: %F.type: type = fn_type @F [template] -// CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {} -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @F(); +// CHECK:STDOUT: file {} // CHECK:STDOUT: // CHECK:STDOUT: --- fail_extern_self_library.carbon // CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/declaration/no_prelude/fail_pattern_in_signature.carbon b/toolchain/check/testdata/function/declaration/no_prelude/fail_pattern_in_signature.carbon index c3f32d0239ff8..00f1d603d4052 100644 --- a/toolchain/check/testdata/function/declaration/no_prelude/fail_pattern_in_signature.carbon +++ b/toolchain/check/testdata/function/declaration/no_prelude/fail_pattern_in_signature.carbon @@ -12,7 +12,7 @@ // CHECK:STDERR: fn F((a: {}, b: {}), c: {}); // CHECK:STDERR: ^ // CHECK:STDERR: -// CHECK:STDERR: fail_pattern_in_signature.carbon:[[@LINE+3]]:6: error: semantics TODO: `Error recovery from keyword name.` [SemanticsTodo] +// CHECK:STDERR: fail_pattern_in_signature.carbon:[[@LINE+3]]:6: error: semantics TODO: `handle invalid parse trees in `check`` [SemanticsTodo] // CHECK:STDERR: fn F((a: {}, b: {}), c: {}); // CHECK:STDERR: ^ fn F((a: {}, b: {}), c: {}); diff --git a/toolchain/check/testdata/function/declaration/no_prelude/fail_todo_no_params.carbon b/toolchain/check/testdata/function/declaration/no_prelude/fail_todo_no_params.carbon index 9161cdcec295c..9629f465b0be7 100644 --- a/toolchain/check/testdata/function/declaration/no_prelude/fail_todo_no_params.carbon +++ b/toolchain/check/testdata/function/declaration/no_prelude/fail_todo_no_params.carbon @@ -31,7 +31,7 @@ fn A { // TODO: We don't have parsing support for this yet. library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_todo_arrow_body.carbon:[[@LINE+8]]:1: error: semantics TODO: `function with positional parameters` [SemanticsTodo] +// CHECK:STDERR: fail_todo_arrow_body.carbon:[[@LINE+8]]:1: error: semantics TODO: `handle invalid parse trees in `check`` [SemanticsTodo] // CHECK:STDERR: fn A => 0; // CHECK:STDERR: ^~~~~~~~~~ // CHECK:STDERR: @@ -95,19 +95,7 @@ fn A { // CHECK:STDOUT: // CHECK:STDOUT: --- fail_todo_arrow_body.carbon // CHECK:STDOUT: -// CHECK:STDOUT: constants { -// CHECK:STDOUT: %A.type: type = fn_type @A [template] -// CHECK:STDOUT: %A: %A.type = struct_value () [template] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .A = %A.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} {} -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @A(); +// CHECK:STDOUT: file {} // CHECK:STDOUT: // CHECK:STDOUT: --- fail_invalid_file_generic_regression_test.carbon // CHECK:STDOUT: diff --git a/toolchain/check/testdata/packages/no_prelude/export_import.carbon b/toolchain/check/testdata/packages/no_prelude/export_import.carbon index b9bb77b4e5ea8..a66d289a5162f 100644 --- a/toolchain/check/testdata/packages/no_prelude/export_import.carbon +++ b/toolchain/check/testdata/packages/no_prelude/export_import.carbon @@ -72,10 +72,14 @@ var c: C = {.x = ()}; impl library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_export_in_impl.impl.carbon:[[@LINE+4]]:1: error: `export` is only allowed in API files [ExportFromImpl] +// CHECK:STDERR: fail_export_in_impl.impl.carbon:[[@LINE+8]]:1: error: `export` is only allowed in API files [ExportFromImpl] // CHECK:STDERR: export import library "base"; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: +// CHECK:STDERR: fail_export_in_impl.impl.carbon:[[@LINE+4]]:1: error: semantics TODO: `handle invalid parse trees in `check`` [SemanticsTodo] +// CHECK:STDERR: export import library "base"; +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: export import library "base"; // Note the import still occurs. @@ -317,53 +321,7 @@ var indirect_c: C = {.x = ()}; // CHECK:STDOUT: // CHECK:STDOUT: --- fail_export_in_impl.impl.carbon // CHECK:STDOUT: -// CHECK:STDOUT: constants { -// CHECK:STDOUT: %C: type = class_type @C [template] -// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template] -// CHECK:STDOUT: %struct_type.x: type = struct_type {.x: %empty_tuple.type} [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.x [template] -// CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [template] -// CHECK:STDOUT: %C.val: %C = struct_value (%empty_tuple) [template] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Main//base, C, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2: = import_ref Main//base, loc6_1, loaded [template = constants.%complete_type] -// CHECK:STDOUT: %import_ref.3 = import_ref Main//base, inst14 [no loc], unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Main//base, loc5_8, unloaded -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .C = imports.%import_ref.1 -// CHECK:STDOUT: .c = %c -// CHECK:STDOUT: } -// CHECK:STDOUT: %default.import.loc2_6.1 = import -// CHECK:STDOUT: %default.import.loc2_6.2 = import -// CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C] -// CHECK:STDOUT: %c.var: ref %C = var c -// CHECK:STDOUT: %c: ref %C = bind_name c, %c.var -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: class @C [from "base.carbon"] { -// CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.3 -// CHECK:STDOUT: .x = imports.%import_ref.4 -// CHECK:STDOUT: complete_type_witness = imports.%import_ref.2 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @__global_init() { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc11_19.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc11_20.1: %struct_type.x = struct_literal (%.loc11_19.1) -// CHECK:STDOUT: %.loc11_20.2: ref %empty_tuple.type = class_element_access file.%c.var, element0 -// CHECK:STDOUT: %.loc11_19.2: init %empty_tuple.type = tuple_init () to %.loc11_20.2 [template = constants.%empty_tuple] -// CHECK:STDOUT: %.loc11_20.3: init %empty_tuple.type = converted %.loc11_19.1, %.loc11_19.2 [template = constants.%empty_tuple] -// CHECK:STDOUT: %.loc11_20.4: init %C = class_init (%.loc11_20.3), file.%c.var [template = constants.%C.val] -// CHECK:STDOUT: %.loc11_21: init %C = converted %.loc11_20.1, %.loc11_20.4 [template = constants.%C.val] -// CHECK:STDOUT: assign file.%c.var, %.loc11_21 -// CHECK:STDOUT: return -// CHECK:STDOUT: } +// CHECK:STDOUT: file {} // CHECK:STDOUT: // CHECK:STDOUT: --- export_export.impl.carbon // CHECK:STDOUT: diff --git a/toolchain/check/testdata/struct/fail_keyword_name.carbon b/toolchain/check/testdata/struct/fail_keyword_name.carbon index 605a8b0394675..6958dfc372db4 100644 --- a/toolchain/check/testdata/struct/fail_keyword_name.carbon +++ b/toolchain/check/testdata/struct/fail_keyword_name.carbon @@ -12,7 +12,7 @@ // CHECK:STDERR: fn F() -> {.class: i32}; // CHECK:STDERR: ^~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_keyword_name.carbon:[[@LINE+4]]:13: error: semantics TODO: `Error recovery from keyword name.` [SemanticsTodo] +// CHECK:STDERR: fail_keyword_name.carbon:[[@LINE+4]]:13: error: semantics TODO: `handle invalid parse trees in `check`` [SemanticsTodo] // CHECK:STDERR: fn F() -> {.class: i32}; // CHECK:STDERR: ^~~~~ // CHECK:STDERR: diff --git a/toolchain/lower/testdata/basics/fail_before_lowering.carbon b/toolchain/lower/testdata/basics/fail_before_lowering.carbon index cf4d03be94951..c5cde99a113fd 100644 --- a/toolchain/lower/testdata/basics/fail_before_lowering.carbon +++ b/toolchain/lower/testdata/basics/fail_before_lowering.carbon @@ -13,7 +13,7 @@ // CHECK:STDERR: a; // CHECK:STDERR: ^ // CHECK:STDERR: -// CHECK:STDERR: fail_before_lowering.carbon:[[@LINE+3]]:1: error: semantics TODO: `HandleInvalidParseStart` [SemanticsTodo] +// CHECK:STDERR: fail_before_lowering.carbon:[[@LINE+3]]:1: error: semantics TODO: `handle invalid parse trees in `check`` [SemanticsTodo] // CHECK:STDERR: a; // CHECK:STDERR: ^ a; From c1590f886a07a9374345dc6e00f17f14851452f9 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Tue, 17 Dec 2024 16:47:03 -0800 Subject: [PATCH 49/68] Add equality comparison support for `bool`. (#4701) --- core/prelude/operators/comparison.carbon | 8 + toolchain/check/eval.cpp | 22 + .../check/testdata/builtins/bool/eq.carbon | 428 ++++++++++++++++++ .../check/testdata/builtins/bool/neq.carbon | 428 ++++++++++++++++++ .../testdata/operators/overloaded/eq.carbon | 10 +- .../operators/overloaded/ordered.carbon | 4 +- toolchain/lower/handle_call.cpp | 6 +- .../testdata/builtins/no_prelude/bool.carbon | 70 +++ toolchain/sem_ir/builtin_function_kind.cpp | 8 + toolchain/sem_ir/builtin_function_kind.def | 4 + 10 files changed, 980 insertions(+), 8 deletions(-) create mode 100644 toolchain/check/testdata/builtins/bool/eq.carbon create mode 100644 toolchain/check/testdata/builtins/bool/neq.carbon create mode 100644 toolchain/lower/testdata/builtins/no_prelude/bool.carbon diff --git a/core/prelude/operators/comparison.carbon b/core/prelude/operators/comparison.carbon index 03e2ea3069d24..7a76a70361f83 100644 --- a/core/prelude/operators/comparison.carbon +++ b/core/prelude/operators/comparison.carbon @@ -20,3 +20,11 @@ interface Ordered { fn Greater[self: Self](other: Self) -> bool; fn GreaterOrEquivalent[self: Self](other: Self) -> bool; } + +// Equality comparison for `bool`. +// Note that this must be provided in this library as `bool` doesn't have any +// associated libraries of its own. +impl bool as Eq { + fn Equal[self: Self](other: Self) -> bool = "bool.eq"; + fn NotEqual[self: Self](other: Self) -> bool = "bool.neq"; +} diff --git a/toolchain/check/eval.cpp b/toolchain/check/eval.cpp index 27dae45cc681d..87c680b54e324 100644 --- a/toolchain/check/eval.cpp +++ b/toolchain/check/eval.cpp @@ -1097,6 +1097,18 @@ static auto PerformBuiltinFloatComparison( return MakeBoolResult(context, bool_type_id, result); } +// Performs a builtin boolean comparison. +static auto PerformBuiltinBoolComparison( + Context& context, SemIR::BuiltinFunctionKind builtin_kind, + SemIR::InstId lhs_id, SemIR::InstId rhs_id, SemIR::TypeId bool_type_id) { + bool lhs = context.insts().GetAs(lhs_id).value.ToBool(); + bool rhs = context.insts().GetAs(rhs_id).value.ToBool(); + return MakeBoolResult(context, bool_type_id, + builtin_kind == SemIR::BuiltinFunctionKind::BoolEq + ? lhs == rhs + : lhs != rhs); +} + // Returns a constant for a call to a builtin function. static auto MakeConstantForBuiltinCall(Context& context, SemIRLoc loc, SemIR::Call call, @@ -1235,6 +1247,16 @@ static auto MakeConstantForBuiltinCall(Context& context, SemIRLoc loc, return PerformBuiltinFloatComparison(context, builtin_kind, arg_ids[0], arg_ids[1], call.type_id); } + + // Bool comparisons. + case SemIR::BuiltinFunctionKind::BoolEq: + case SemIR::BuiltinFunctionKind::BoolNeq: { + if (phase != Phase::Template) { + break; + } + return PerformBuiltinBoolComparison(context, builtin_kind, arg_ids[0], + arg_ids[1], call.type_id); + } } return SemIR::ConstantId::NotConstant; diff --git a/toolchain/check/testdata/builtins/bool/eq.carbon b/toolchain/check/testdata/builtins/bool/eq.carbon new file mode 100644 index 0000000000000..082e5ecf25335 --- /dev/null +++ b/toolchain/check/testdata/builtins/bool/eq.carbon @@ -0,0 +1,428 @@ +// Part of the Carbon Language project, under the Apache License v2.0 with LLVM +// Exceptions. See /LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// AUTOUPDATE +// TIP: To test this file alone, run: +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/builtins/bool/eq.carbon +// TIP: To dump output, run: +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/builtins/bool/eq.carbon + +// --- builtin_call.carbon + +library "[[@TEST_NAME]]"; + +fn Eq(a: bool, b: bool) -> bool = "bool.eq"; + +class C(B:! bool) {} + +fn True() -> C(true); +fn False() -> C(false); + +var a: C(Eq(true, true)) = True(); +var b: C(Eq(true, false)) = False(); +var c: C(Eq(false, true)) = False(); +var d: C(Eq(false, false)) = True(); + +// --- prelude.carbon + +library "[[@TEST_NAME]]"; + +class C(B:! bool) {} + +fn True() -> C(true); +fn False() -> C(false); + +var a: C(true == true) = True(); +var b: C(true == false) = False(); +var c: C(false == true) = False(); +var d: C(false == false) = True(); + +// CHECK:STDOUT: --- builtin_call.carbon +// CHECK:STDOUT: +// CHECK:STDOUT: constants { +// CHECK:STDOUT: %Bool.type: type = fn_type @Bool [template] +// CHECK:STDOUT: %Bool: %Bool.type = struct_value () [template] +// CHECK:STDOUT: %Eq.type: type = fn_type @Eq [template] +// CHECK:STDOUT: %Eq: %Eq.type = struct_value () [template] +// CHECK:STDOUT: %B: bool = bind_symbolic_name B, 0 [symbolic] +// CHECK:STDOUT: %B.patt: bool = symbolic_binding_pattern B, 0 [symbolic] +// CHECK:STDOUT: %C.type: type = generic_class_type @C [template] +// CHECK:STDOUT: %C.generic: %C.type = struct_value () [template] +// CHECK:STDOUT: %C.1: type = class_type @C, @C(%B) [symbolic] +// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %true: bool = bool_literal true [template] +// CHECK:STDOUT: %C.2: type = class_type @C, @C(%true) [template] +// CHECK:STDOUT: %True.type: type = fn_type @True [template] +// CHECK:STDOUT: %True: %True.type = struct_value () [template] +// CHECK:STDOUT: %false: bool = bool_literal false [template] +// CHECK:STDOUT: %C.3: type = class_type @C, @C(%false) [template] +// CHECK:STDOUT: %False.type: type = fn_type @False [template] +// CHECK:STDOUT: %False: %False.type = struct_value () [template] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Bool = %import_ref +// CHECK:STDOUT: import Core//prelude +// CHECK:STDOUT: import Core//prelude/... +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Eq = %Eq.decl +// CHECK:STDOUT: .C = %C.decl +// CHECK:STDOUT: .True = %True.decl +// CHECK:STDOUT: .False = %False.decl +// CHECK:STDOUT: .a = %a +// CHECK:STDOUT: .b = %b +// CHECK:STDOUT: .c = %c +// CHECK:STDOUT: .d = %d +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %Eq.decl: %Eq.type = fn_decl @Eq [template = constants.%Eq] { +// CHECK:STDOUT: %a.patt: bool = binding_pattern a +// CHECK:STDOUT: %a.param_patt: bool = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %b.patt: bool = binding_pattern b +// CHECK:STDOUT: %b.param_patt: bool = value_param_pattern %b.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: bool = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %bool.make_type.loc4_10: init type = call constants.%Bool() [template = bool] +// CHECK:STDOUT: %.loc4_10.1: type = value_of_initializer %bool.make_type.loc4_10 [template = bool] +// CHECK:STDOUT: %.loc4_10.2: type = converted %bool.make_type.loc4_10, %.loc4_10.1 [template = bool] +// CHECK:STDOUT: %bool.make_type.loc4_19: init type = call constants.%Bool() [template = bool] +// CHECK:STDOUT: %.loc4_19.1: type = value_of_initializer %bool.make_type.loc4_19 [template = bool] +// CHECK:STDOUT: %.loc4_19.2: type = converted %bool.make_type.loc4_19, %.loc4_19.1 [template = bool] +// CHECK:STDOUT: %bool.make_type.loc4_28: init type = call constants.%Bool() [template = bool] +// CHECK:STDOUT: %.loc4_28.1: type = value_of_initializer %bool.make_type.loc4_28 [template = bool] +// CHECK:STDOUT: %.loc4_28.2: type = converted %bool.make_type.loc4_28, %.loc4_28.1 [template = bool] +// CHECK:STDOUT: %a.param: bool = value_param runtime_param0 +// CHECK:STDOUT: %a: bool = bind_name a, %a.param +// CHECK:STDOUT: %b.param: bool = value_param runtime_param1 +// CHECK:STDOUT: %b: bool = bind_name b, %b.param +// CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 +// CHECK:STDOUT: %return: ref bool = return_slot %return.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %C.decl: %C.type = class_decl @C [template = constants.%C.generic] { +// CHECK:STDOUT: %B.patt.loc6_9.1: bool = symbolic_binding_pattern B, 0 [symbolic = %B.patt.loc6_9.2 (constants.%B.patt)] +// CHECK:STDOUT: %B.param_patt: bool = value_param_pattern %B.patt.loc6_9.1, runtime_param [symbolic = %B.patt.loc6_9.2 (constants.%B.patt)] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] +// CHECK:STDOUT: %.loc6_13.1: type = value_of_initializer %bool.make_type [template = bool] +// CHECK:STDOUT: %.loc6_13.2: type = converted %bool.make_type, %.loc6_13.1 [template = bool] +// CHECK:STDOUT: %B.param: bool = value_param runtime_param +// CHECK:STDOUT: %B.loc6_9.1: bool = bind_symbolic_name B, 0, %B.param [symbolic = %B.loc6_9.2 (constants.%B)] +// CHECK:STDOUT: } +// CHECK:STDOUT: %True.decl: %True.type = fn_decl @True [template = constants.%True] { +// CHECK:STDOUT: %return.patt: %C.2 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %C.2 = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [template = constants.%C.generic] +// CHECK:STDOUT: %true: bool = bool_literal true [template = constants.%true] +// CHECK:STDOUT: %C: type = class_type @C, @C(constants.%true) [template = constants.%C.2] +// CHECK:STDOUT: %return.param: ref %C.2 = out_param runtime_param0 +// CHECK:STDOUT: %return: ref %C.2 = return_slot %return.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %False.decl: %False.type = fn_decl @False [template = constants.%False] { +// CHECK:STDOUT: %return.patt: %C.3 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %C.3 = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [template = constants.%C.generic] +// CHECK:STDOUT: %false: bool = bool_literal false [template = constants.%false] +// CHECK:STDOUT: %C: type = class_type @C, @C(constants.%false) [template = constants.%C.3] +// CHECK:STDOUT: %return.param: ref %C.3 = out_param runtime_param0 +// CHECK:STDOUT: %return: ref %C.3 = return_slot %return.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %C.ref.loc11: %C.type = name_ref C, %C.decl [template = constants.%C.generic] +// CHECK:STDOUT: %Eq.ref.loc11: %Eq.type = name_ref Eq, %Eq.decl [template = constants.%Eq] +// CHECK:STDOUT: %true.loc11_13: bool = bool_literal true [template = constants.%true] +// CHECK:STDOUT: %true.loc11_19: bool = bool_literal true [template = constants.%true] +// CHECK:STDOUT: %bool.eq.loc11: init bool = call %Eq.ref.loc11(%true.loc11_13, %true.loc11_19) [template = constants.%true] +// CHECK:STDOUT: %.loc11_24.1: bool = value_of_initializer %bool.eq.loc11 [template = constants.%true] +// CHECK:STDOUT: %.loc11_24.2: bool = converted %bool.eq.loc11, %.loc11_24.1 [template = constants.%true] +// CHECK:STDOUT: %C.loc11: type = class_type @C, @C(constants.%true) [template = constants.%C.2] +// CHECK:STDOUT: %a.var: ref %C.2 = var a +// CHECK:STDOUT: %a: ref %C.2 = bind_name a, %a.var +// CHECK:STDOUT: %C.ref.loc12: %C.type = name_ref C, %C.decl [template = constants.%C.generic] +// CHECK:STDOUT: %Eq.ref.loc12: %Eq.type = name_ref Eq, %Eq.decl [template = constants.%Eq] +// CHECK:STDOUT: %true.loc12: bool = bool_literal true [template = constants.%true] +// CHECK:STDOUT: %false.loc12: bool = bool_literal false [template = constants.%false] +// CHECK:STDOUT: %bool.eq.loc12: init bool = call %Eq.ref.loc12(%true.loc12, %false.loc12) [template = constants.%false] +// CHECK:STDOUT: %.loc12_25.1: bool = value_of_initializer %bool.eq.loc12 [template = constants.%false] +// CHECK:STDOUT: %.loc12_25.2: bool = converted %bool.eq.loc12, %.loc12_25.1 [template = constants.%false] +// CHECK:STDOUT: %C.loc12: type = class_type @C, @C(constants.%false) [template = constants.%C.3] +// CHECK:STDOUT: %b.var: ref %C.3 = var b +// CHECK:STDOUT: %b: ref %C.3 = bind_name b, %b.var +// CHECK:STDOUT: %C.ref.loc13: %C.type = name_ref C, %C.decl [template = constants.%C.generic] +// CHECK:STDOUT: %Eq.ref.loc13: %Eq.type = name_ref Eq, %Eq.decl [template = constants.%Eq] +// CHECK:STDOUT: %false.loc13: bool = bool_literal false [template = constants.%false] +// CHECK:STDOUT: %true.loc13: bool = bool_literal true [template = constants.%true] +// CHECK:STDOUT: %bool.eq.loc13: init bool = call %Eq.ref.loc13(%false.loc13, %true.loc13) [template = constants.%false] +// CHECK:STDOUT: %.loc13_25.1: bool = value_of_initializer %bool.eq.loc13 [template = constants.%false] +// CHECK:STDOUT: %.loc13_25.2: bool = converted %bool.eq.loc13, %.loc13_25.1 [template = constants.%false] +// CHECK:STDOUT: %C.loc13: type = class_type @C, @C(constants.%false) [template = constants.%C.3] +// CHECK:STDOUT: %c.var: ref %C.3 = var c +// CHECK:STDOUT: %c: ref %C.3 = bind_name c, %c.var +// CHECK:STDOUT: %C.ref.loc14: %C.type = name_ref C, %C.decl [template = constants.%C.generic] +// CHECK:STDOUT: %Eq.ref.loc14: %Eq.type = name_ref Eq, %Eq.decl [template = constants.%Eq] +// CHECK:STDOUT: %false.loc14_13: bool = bool_literal false [template = constants.%false] +// CHECK:STDOUT: %false.loc14_20: bool = bool_literal false [template = constants.%false] +// CHECK:STDOUT: %bool.eq.loc14: init bool = call %Eq.ref.loc14(%false.loc14_13, %false.loc14_20) [template = constants.%true] +// CHECK:STDOUT: %.loc14_26.1: bool = value_of_initializer %bool.eq.loc14 [template = constants.%true] +// CHECK:STDOUT: %.loc14_26.2: bool = converted %bool.eq.loc14, %.loc14_26.1 [template = constants.%true] +// CHECK:STDOUT: %C.loc14: type = class_type @C, @C(constants.%true) [template = constants.%C.2] +// CHECK:STDOUT: %d.var: ref %C.2 = var d +// CHECK:STDOUT: %d: ref %C.2 = bind_name d, %d.var +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic class @C(%B.loc6_9.1: bool) { +// CHECK:STDOUT: %B.loc6_9.2: bool = bind_symbolic_name B, 0 [symbolic = %B.loc6_9.2 (constants.%B)] +// CHECK:STDOUT: %B.patt.loc6_9.2: bool = symbolic_binding_pattern B, 0 [symbolic = %B.patt.loc6_9.2 (constants.%B.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: class { +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = constants.%C.1 +// CHECK:STDOUT: complete_type_witness = %complete_type +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Eq(%a.param_patt: bool, %b.param_patt: bool) -> bool = "bool.eq"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @True() -> %C.2; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @False() -> %C.3; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @__global_init() { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %True.ref.loc11: %True.type = name_ref True, file.%True.decl [template = constants.%True] +// CHECK:STDOUT: %.loc11: ref %C.2 = splice_block file.%a.var {} +// CHECK:STDOUT: %True.call.loc11: init %C.2 = call %True.ref.loc11() to %.loc11 +// CHECK:STDOUT: assign file.%a.var, %True.call.loc11 +// CHECK:STDOUT: %False.ref.loc12: %False.type = name_ref False, file.%False.decl [template = constants.%False] +// CHECK:STDOUT: %.loc12: ref %C.3 = splice_block file.%b.var {} +// CHECK:STDOUT: %False.call.loc12: init %C.3 = call %False.ref.loc12() to %.loc12 +// CHECK:STDOUT: assign file.%b.var, %False.call.loc12 +// CHECK:STDOUT: %False.ref.loc13: %False.type = name_ref False, file.%False.decl [template = constants.%False] +// CHECK:STDOUT: %.loc13: ref %C.3 = splice_block file.%c.var {} +// CHECK:STDOUT: %False.call.loc13: init %C.3 = call %False.ref.loc13() to %.loc13 +// CHECK:STDOUT: assign file.%c.var, %False.call.loc13 +// CHECK:STDOUT: %True.ref.loc14: %True.type = name_ref True, file.%True.decl [template = constants.%True] +// CHECK:STDOUT: %.loc14: ref %C.2 = splice_block file.%d.var {} +// CHECK:STDOUT: %True.call.loc14: init %C.2 = call %True.ref.loc14() to %.loc14 +// CHECK:STDOUT: assign file.%d.var, %True.call.loc14 +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @C(constants.%B) { +// CHECK:STDOUT: %B.loc6_9.2 => constants.%B +// CHECK:STDOUT: %B.patt.loc6_9.2 => constants.%B +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @C(constants.%true) { +// CHECK:STDOUT: %B.loc6_9.2 => constants.%true +// CHECK:STDOUT: %B.patt.loc6_9.2 => constants.%true +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @C(constants.%false) { +// CHECK:STDOUT: %B.loc6_9.2 => constants.%false +// CHECK:STDOUT: %B.patt.loc6_9.2 => constants.%false +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: --- prelude.carbon +// CHECK:STDOUT: +// CHECK:STDOUT: constants { +// CHECK:STDOUT: %Bool.type: type = fn_type @Bool [template] +// CHECK:STDOUT: %Bool: %Bool.type = struct_value () [template] +// CHECK:STDOUT: %B: bool = bind_symbolic_name B, 0 [symbolic] +// CHECK:STDOUT: %B.patt: bool = symbolic_binding_pattern B, 0 [symbolic] +// CHECK:STDOUT: %C.type: type = generic_class_type @C [template] +// CHECK:STDOUT: %C.generic: %C.type = struct_value () [template] +// CHECK:STDOUT: %C.1: type = class_type @C, @C(%B) [symbolic] +// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %true: bool = bool_literal true [template] +// CHECK:STDOUT: %C.2: type = class_type @C, @C(%true) [template] +// CHECK:STDOUT: %True.type: type = fn_type @True [template] +// CHECK:STDOUT: %True: %True.type = struct_value () [template] +// CHECK:STDOUT: %false: bool = bool_literal false [template] +// CHECK:STDOUT: %C.3: type = class_type @C, @C(%false) [template] +// CHECK:STDOUT: %False.type: type = fn_type @False [template] +// CHECK:STDOUT: %False: %False.type = struct_value () [template] +// CHECK:STDOUT: %Equal.type.1: type = fn_type @Equal.1 [template] +// CHECK:STDOUT: %NotEqual.type: type = fn_type @NotEqual [template] +// CHECK:STDOUT: %NotEqual: %NotEqual.type = struct_value () [template] +// CHECK:STDOUT: %Equal.type.2: type = fn_type @Equal.2 [template] +// CHECK:STDOUT: %Equal.2: %Equal.type.2 = struct_value () [template] +// CHECK:STDOUT: %interface: = interface_witness (%Equal.2, %NotEqual) [template] +// CHECK:STDOUT: %Equal.bound.1: = bound_method %true, %Equal.2 [template] +// CHECK:STDOUT: %Equal.bound.2: = bound_method %false, %Equal.2 [template] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Bool = %import_ref.1 +// CHECK:STDOUT: .Eq = %import_ref.2 +// CHECK:STDOUT: import Core//prelude +// CHECK:STDOUT: import Core//prelude/... +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .C = %C.decl +// CHECK:STDOUT: .True = %True.decl +// CHECK:STDOUT: .False = %False.decl +// CHECK:STDOUT: .a = %a +// CHECK:STDOUT: .b = %b +// CHECK:STDOUT: .c = %c +// CHECK:STDOUT: .d = %d +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %C.decl: %C.type = class_decl @C [template = constants.%C.generic] { +// CHECK:STDOUT: %B.patt.loc4_9.1: bool = symbolic_binding_pattern B, 0 [symbolic = %B.patt.loc4_9.2 (constants.%B.patt)] +// CHECK:STDOUT: %B.param_patt: bool = value_param_pattern %B.patt.loc4_9.1, runtime_param [symbolic = %B.patt.loc4_9.2 (constants.%B.patt)] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] +// CHECK:STDOUT: %.loc4_13.1: type = value_of_initializer %bool.make_type [template = bool] +// CHECK:STDOUT: %.loc4_13.2: type = converted %bool.make_type, %.loc4_13.1 [template = bool] +// CHECK:STDOUT: %B.param: bool = value_param runtime_param +// CHECK:STDOUT: %B.loc4_9.1: bool = bind_symbolic_name B, 0, %B.param [symbolic = %B.loc4_9.2 (constants.%B)] +// CHECK:STDOUT: } +// CHECK:STDOUT: %True.decl: %True.type = fn_decl @True [template = constants.%True] { +// CHECK:STDOUT: %return.patt: %C.2 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %C.2 = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [template = constants.%C.generic] +// CHECK:STDOUT: %true: bool = bool_literal true [template = constants.%true] +// CHECK:STDOUT: %C: type = class_type @C, @C(constants.%true) [template = constants.%C.2] +// CHECK:STDOUT: %return.param: ref %C.2 = out_param runtime_param0 +// CHECK:STDOUT: %return: ref %C.2 = return_slot %return.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %False.decl: %False.type = fn_decl @False [template = constants.%False] { +// CHECK:STDOUT: %return.patt: %C.3 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %C.3 = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [template = constants.%C.generic] +// CHECK:STDOUT: %false: bool = bool_literal false [template = constants.%false] +// CHECK:STDOUT: %C: type = class_type @C, @C(constants.%false) [template = constants.%C.3] +// CHECK:STDOUT: %return.param: ref %C.3 = out_param runtime_param0 +// CHECK:STDOUT: %return: ref %C.3 = return_slot %return.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %C.ref.loc9: %C.type = name_ref C, %C.decl [template = constants.%C.generic] +// CHECK:STDOUT: %true.loc9_10: bool = bool_literal true [template = constants.%true] +// CHECK:STDOUT: %true.loc9_18: bool = bool_literal true [template = constants.%true] +// CHECK:STDOUT: %impl.elem0.loc9: %Equal.type.1 = interface_witness_access constants.%interface, element0 [template = constants.%Equal.2] +// CHECK:STDOUT: %Equal.bound.loc9: = bound_method %true.loc9_10, %impl.elem0.loc9 [template = constants.%Equal.bound.1] +// CHECK:STDOUT: %bool.eq.loc9: init bool = call %Equal.bound.loc9(%true.loc9_10, %true.loc9_18) [template = constants.%true] +// CHECK:STDOUT: %.loc9_22.1: bool = value_of_initializer %bool.eq.loc9 [template = constants.%true] +// CHECK:STDOUT: %.loc9_22.2: bool = converted %bool.eq.loc9, %.loc9_22.1 [template = constants.%true] +// CHECK:STDOUT: %C.loc9: type = class_type @C, @C(constants.%true) [template = constants.%C.2] +// CHECK:STDOUT: %a.var: ref %C.2 = var a +// CHECK:STDOUT: %a: ref %C.2 = bind_name a, %a.var +// CHECK:STDOUT: %C.ref.loc10: %C.type = name_ref C, %C.decl [template = constants.%C.generic] +// CHECK:STDOUT: %true.loc10: bool = bool_literal true [template = constants.%true] +// CHECK:STDOUT: %false.loc10: bool = bool_literal false [template = constants.%false] +// CHECK:STDOUT: %impl.elem0.loc10: %Equal.type.1 = interface_witness_access constants.%interface, element0 [template = constants.%Equal.2] +// CHECK:STDOUT: %Equal.bound.loc10: = bound_method %true.loc10, %impl.elem0.loc10 [template = constants.%Equal.bound.1] +// CHECK:STDOUT: %bool.eq.loc10: init bool = call %Equal.bound.loc10(%true.loc10, %false.loc10) [template = constants.%false] +// CHECK:STDOUT: %.loc10_23.1: bool = value_of_initializer %bool.eq.loc10 [template = constants.%false] +// CHECK:STDOUT: %.loc10_23.2: bool = converted %bool.eq.loc10, %.loc10_23.1 [template = constants.%false] +// CHECK:STDOUT: %C.loc10: type = class_type @C, @C(constants.%false) [template = constants.%C.3] +// CHECK:STDOUT: %b.var: ref %C.3 = var b +// CHECK:STDOUT: %b: ref %C.3 = bind_name b, %b.var +// CHECK:STDOUT: %C.ref.loc11: %C.type = name_ref C, %C.decl [template = constants.%C.generic] +// CHECK:STDOUT: %false.loc11: bool = bool_literal false [template = constants.%false] +// CHECK:STDOUT: %true.loc11: bool = bool_literal true [template = constants.%true] +// CHECK:STDOUT: %impl.elem0.loc11: %Equal.type.1 = interface_witness_access constants.%interface, element0 [template = constants.%Equal.2] +// CHECK:STDOUT: %Equal.bound.loc11: = bound_method %false.loc11, %impl.elem0.loc11 [template = constants.%Equal.bound.2] +// CHECK:STDOUT: %bool.eq.loc11: init bool = call %Equal.bound.loc11(%false.loc11, %true.loc11) [template = constants.%false] +// CHECK:STDOUT: %.loc11_23.1: bool = value_of_initializer %bool.eq.loc11 [template = constants.%false] +// CHECK:STDOUT: %.loc11_23.2: bool = converted %bool.eq.loc11, %.loc11_23.1 [template = constants.%false] +// CHECK:STDOUT: %C.loc11: type = class_type @C, @C(constants.%false) [template = constants.%C.3] +// CHECK:STDOUT: %c.var: ref %C.3 = var c +// CHECK:STDOUT: %c: ref %C.3 = bind_name c, %c.var +// CHECK:STDOUT: %C.ref.loc12: %C.type = name_ref C, %C.decl [template = constants.%C.generic] +// CHECK:STDOUT: %false.loc12_10: bool = bool_literal false [template = constants.%false] +// CHECK:STDOUT: %false.loc12_19: bool = bool_literal false [template = constants.%false] +// CHECK:STDOUT: %impl.elem0.loc12: %Equal.type.1 = interface_witness_access constants.%interface, element0 [template = constants.%Equal.2] +// CHECK:STDOUT: %Equal.bound.loc12: = bound_method %false.loc12_10, %impl.elem0.loc12 [template = constants.%Equal.bound.2] +// CHECK:STDOUT: %bool.eq.loc12: init bool = call %Equal.bound.loc12(%false.loc12_10, %false.loc12_19) [template = constants.%true] +// CHECK:STDOUT: %.loc12_24.1: bool = value_of_initializer %bool.eq.loc12 [template = constants.%true] +// CHECK:STDOUT: %.loc12_24.2: bool = converted %bool.eq.loc12, %.loc12_24.1 [template = constants.%true] +// CHECK:STDOUT: %C.loc12: type = class_type @C, @C(constants.%true) [template = constants.%C.2] +// CHECK:STDOUT: %d.var: ref %C.2 = var d +// CHECK:STDOUT: %d: ref %C.2 = bind_name d, %d.var +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic class @C(%B.loc4_9.1: bool) { +// CHECK:STDOUT: %B.loc4_9.2: bool = bind_symbolic_name B, 0 [symbolic = %B.loc4_9.2 (constants.%B)] +// CHECK:STDOUT: %B.patt.loc4_9.2: bool = symbolic_binding_pattern B, 0 [symbolic = %B.patt.loc4_9.2 (constants.%B.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: class { +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = constants.%C.1 +// CHECK:STDOUT: complete_type_witness = %complete_type +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @True() -> %C.2; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @False() -> %C.3; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @__global_init() { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %True.ref.loc9: %True.type = name_ref True, file.%True.decl [template = constants.%True] +// CHECK:STDOUT: %.loc9: ref %C.2 = splice_block file.%a.var {} +// CHECK:STDOUT: %True.call.loc9: init %C.2 = call %True.ref.loc9() to %.loc9 +// CHECK:STDOUT: assign file.%a.var, %True.call.loc9 +// CHECK:STDOUT: %False.ref.loc10: %False.type = name_ref False, file.%False.decl [template = constants.%False] +// CHECK:STDOUT: %.loc10: ref %C.3 = splice_block file.%b.var {} +// CHECK:STDOUT: %False.call.loc10: init %C.3 = call %False.ref.loc10() to %.loc10 +// CHECK:STDOUT: assign file.%b.var, %False.call.loc10 +// CHECK:STDOUT: %False.ref.loc11: %False.type = name_ref False, file.%False.decl [template = constants.%False] +// CHECK:STDOUT: %.loc11: ref %C.3 = splice_block file.%c.var {} +// CHECK:STDOUT: %False.call.loc11: init %C.3 = call %False.ref.loc11() to %.loc11 +// CHECK:STDOUT: assign file.%c.var, %False.call.loc11 +// CHECK:STDOUT: %True.ref.loc12: %True.type = name_ref True, file.%True.decl [template = constants.%True] +// CHECK:STDOUT: %.loc12: ref %C.2 = splice_block file.%d.var {} +// CHECK:STDOUT: %True.call.loc12: init %C.2 = call %True.ref.loc12() to %.loc12 +// CHECK:STDOUT: assign file.%d.var, %True.call.loc12 +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @C(constants.%B) { +// CHECK:STDOUT: %B.loc4_9.2 => constants.%B +// CHECK:STDOUT: %B.patt.loc4_9.2 => constants.%B +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @C(constants.%true) { +// CHECK:STDOUT: %B.loc4_9.2 => constants.%true +// CHECK:STDOUT: %B.patt.loc4_9.2 => constants.%true +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @C(constants.%false) { +// CHECK:STDOUT: %B.loc4_9.2 => constants.%false +// CHECK:STDOUT: %B.patt.loc4_9.2 => constants.%false +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/builtins/bool/neq.carbon b/toolchain/check/testdata/builtins/bool/neq.carbon new file mode 100644 index 0000000000000..bfa5a1df54902 --- /dev/null +++ b/toolchain/check/testdata/builtins/bool/neq.carbon @@ -0,0 +1,428 @@ +// Part of the Carbon Language project, under the Apache License v2.0 with LLVM +// Exceptions. See /LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// AUTOUPDATE +// TIP: To test this file alone, run: +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/builtins/bool/neq.carbon +// TIP: To dump output, run: +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/builtins/bool/neq.carbon + +// --- builtin_call.carbon + +library "[[@TEST_NAME]]"; + +fn Neq(a: bool, b: bool) -> bool = "bool.neq"; + +class C(B:! bool) {} + +fn True() -> C(true); +fn False() -> C(false); + +var a: C(Neq(true, true)) = False(); +var b: C(Neq(true, false)) = True(); +var c: C(Neq(false, true)) = True(); +var d: C(Neq(false, false)) = False(); + +// --- prelude.carbon + +library "[[@TEST_NAME]]"; + +class C(B:! bool) {} + +fn True() -> C(true); +fn False() -> C(false); + +var a: C(true != true) = False(); +var b: C(true != false) = True(); +var c: C(false != true) = True(); +var d: C(false != false) = False(); + +// CHECK:STDOUT: --- builtin_call.carbon +// CHECK:STDOUT: +// CHECK:STDOUT: constants { +// CHECK:STDOUT: %Bool.type: type = fn_type @Bool [template] +// CHECK:STDOUT: %Bool: %Bool.type = struct_value () [template] +// CHECK:STDOUT: %Neq.type: type = fn_type @Neq [template] +// CHECK:STDOUT: %Neq: %Neq.type = struct_value () [template] +// CHECK:STDOUT: %B: bool = bind_symbolic_name B, 0 [symbolic] +// CHECK:STDOUT: %B.patt: bool = symbolic_binding_pattern B, 0 [symbolic] +// CHECK:STDOUT: %C.type: type = generic_class_type @C [template] +// CHECK:STDOUT: %C.generic: %C.type = struct_value () [template] +// CHECK:STDOUT: %C.1: type = class_type @C, @C(%B) [symbolic] +// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %true: bool = bool_literal true [template] +// CHECK:STDOUT: %C.2: type = class_type @C, @C(%true) [template] +// CHECK:STDOUT: %True.type: type = fn_type @True [template] +// CHECK:STDOUT: %True: %True.type = struct_value () [template] +// CHECK:STDOUT: %false: bool = bool_literal false [template] +// CHECK:STDOUT: %C.3: type = class_type @C, @C(%false) [template] +// CHECK:STDOUT: %False.type: type = fn_type @False [template] +// CHECK:STDOUT: %False: %False.type = struct_value () [template] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Bool = %import_ref +// CHECK:STDOUT: import Core//prelude +// CHECK:STDOUT: import Core//prelude/... +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Neq = %Neq.decl +// CHECK:STDOUT: .C = %C.decl +// CHECK:STDOUT: .True = %True.decl +// CHECK:STDOUT: .False = %False.decl +// CHECK:STDOUT: .a = %a +// CHECK:STDOUT: .b = %b +// CHECK:STDOUT: .c = %c +// CHECK:STDOUT: .d = %d +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %Neq.decl: %Neq.type = fn_decl @Neq [template = constants.%Neq] { +// CHECK:STDOUT: %a.patt: bool = binding_pattern a +// CHECK:STDOUT: %a.param_patt: bool = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %b.patt: bool = binding_pattern b +// CHECK:STDOUT: %b.param_patt: bool = value_param_pattern %b.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: bool = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %bool.make_type.loc4_11: init type = call constants.%Bool() [template = bool] +// CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %bool.make_type.loc4_11 [template = bool] +// CHECK:STDOUT: %.loc4_11.2: type = converted %bool.make_type.loc4_11, %.loc4_11.1 [template = bool] +// CHECK:STDOUT: %bool.make_type.loc4_20: init type = call constants.%Bool() [template = bool] +// CHECK:STDOUT: %.loc4_20.1: type = value_of_initializer %bool.make_type.loc4_20 [template = bool] +// CHECK:STDOUT: %.loc4_20.2: type = converted %bool.make_type.loc4_20, %.loc4_20.1 [template = bool] +// CHECK:STDOUT: %bool.make_type.loc4_29: init type = call constants.%Bool() [template = bool] +// CHECK:STDOUT: %.loc4_29.1: type = value_of_initializer %bool.make_type.loc4_29 [template = bool] +// CHECK:STDOUT: %.loc4_29.2: type = converted %bool.make_type.loc4_29, %.loc4_29.1 [template = bool] +// CHECK:STDOUT: %a.param: bool = value_param runtime_param0 +// CHECK:STDOUT: %a: bool = bind_name a, %a.param +// CHECK:STDOUT: %b.param: bool = value_param runtime_param1 +// CHECK:STDOUT: %b: bool = bind_name b, %b.param +// CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 +// CHECK:STDOUT: %return: ref bool = return_slot %return.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %C.decl: %C.type = class_decl @C [template = constants.%C.generic] { +// CHECK:STDOUT: %B.patt.loc6_9.1: bool = symbolic_binding_pattern B, 0 [symbolic = %B.patt.loc6_9.2 (constants.%B.patt)] +// CHECK:STDOUT: %B.param_patt: bool = value_param_pattern %B.patt.loc6_9.1, runtime_param [symbolic = %B.patt.loc6_9.2 (constants.%B.patt)] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] +// CHECK:STDOUT: %.loc6_13.1: type = value_of_initializer %bool.make_type [template = bool] +// CHECK:STDOUT: %.loc6_13.2: type = converted %bool.make_type, %.loc6_13.1 [template = bool] +// CHECK:STDOUT: %B.param: bool = value_param runtime_param +// CHECK:STDOUT: %B.loc6_9.1: bool = bind_symbolic_name B, 0, %B.param [symbolic = %B.loc6_9.2 (constants.%B)] +// CHECK:STDOUT: } +// CHECK:STDOUT: %True.decl: %True.type = fn_decl @True [template = constants.%True] { +// CHECK:STDOUT: %return.patt: %C.2 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %C.2 = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [template = constants.%C.generic] +// CHECK:STDOUT: %true: bool = bool_literal true [template = constants.%true] +// CHECK:STDOUT: %C: type = class_type @C, @C(constants.%true) [template = constants.%C.2] +// CHECK:STDOUT: %return.param: ref %C.2 = out_param runtime_param0 +// CHECK:STDOUT: %return: ref %C.2 = return_slot %return.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %False.decl: %False.type = fn_decl @False [template = constants.%False] { +// CHECK:STDOUT: %return.patt: %C.3 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %C.3 = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [template = constants.%C.generic] +// CHECK:STDOUT: %false: bool = bool_literal false [template = constants.%false] +// CHECK:STDOUT: %C: type = class_type @C, @C(constants.%false) [template = constants.%C.3] +// CHECK:STDOUT: %return.param: ref %C.3 = out_param runtime_param0 +// CHECK:STDOUT: %return: ref %C.3 = return_slot %return.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %C.ref.loc11: %C.type = name_ref C, %C.decl [template = constants.%C.generic] +// CHECK:STDOUT: %Neq.ref.loc11: %Neq.type = name_ref Neq, %Neq.decl [template = constants.%Neq] +// CHECK:STDOUT: %true.loc11_14: bool = bool_literal true [template = constants.%true] +// CHECK:STDOUT: %true.loc11_20: bool = bool_literal true [template = constants.%true] +// CHECK:STDOUT: %bool.neq.loc11: init bool = call %Neq.ref.loc11(%true.loc11_14, %true.loc11_20) [template = constants.%false] +// CHECK:STDOUT: %.loc11_25.1: bool = value_of_initializer %bool.neq.loc11 [template = constants.%false] +// CHECK:STDOUT: %.loc11_25.2: bool = converted %bool.neq.loc11, %.loc11_25.1 [template = constants.%false] +// CHECK:STDOUT: %C.loc11: type = class_type @C, @C(constants.%false) [template = constants.%C.3] +// CHECK:STDOUT: %a.var: ref %C.3 = var a +// CHECK:STDOUT: %a: ref %C.3 = bind_name a, %a.var +// CHECK:STDOUT: %C.ref.loc12: %C.type = name_ref C, %C.decl [template = constants.%C.generic] +// CHECK:STDOUT: %Neq.ref.loc12: %Neq.type = name_ref Neq, %Neq.decl [template = constants.%Neq] +// CHECK:STDOUT: %true.loc12: bool = bool_literal true [template = constants.%true] +// CHECK:STDOUT: %false.loc12: bool = bool_literal false [template = constants.%false] +// CHECK:STDOUT: %bool.neq.loc12: init bool = call %Neq.ref.loc12(%true.loc12, %false.loc12) [template = constants.%true] +// CHECK:STDOUT: %.loc12_26.1: bool = value_of_initializer %bool.neq.loc12 [template = constants.%true] +// CHECK:STDOUT: %.loc12_26.2: bool = converted %bool.neq.loc12, %.loc12_26.1 [template = constants.%true] +// CHECK:STDOUT: %C.loc12: type = class_type @C, @C(constants.%true) [template = constants.%C.2] +// CHECK:STDOUT: %b.var: ref %C.2 = var b +// CHECK:STDOUT: %b: ref %C.2 = bind_name b, %b.var +// CHECK:STDOUT: %C.ref.loc13: %C.type = name_ref C, %C.decl [template = constants.%C.generic] +// CHECK:STDOUT: %Neq.ref.loc13: %Neq.type = name_ref Neq, %Neq.decl [template = constants.%Neq] +// CHECK:STDOUT: %false.loc13: bool = bool_literal false [template = constants.%false] +// CHECK:STDOUT: %true.loc13: bool = bool_literal true [template = constants.%true] +// CHECK:STDOUT: %bool.neq.loc13: init bool = call %Neq.ref.loc13(%false.loc13, %true.loc13) [template = constants.%true] +// CHECK:STDOUT: %.loc13_26.1: bool = value_of_initializer %bool.neq.loc13 [template = constants.%true] +// CHECK:STDOUT: %.loc13_26.2: bool = converted %bool.neq.loc13, %.loc13_26.1 [template = constants.%true] +// CHECK:STDOUT: %C.loc13: type = class_type @C, @C(constants.%true) [template = constants.%C.2] +// CHECK:STDOUT: %c.var: ref %C.2 = var c +// CHECK:STDOUT: %c: ref %C.2 = bind_name c, %c.var +// CHECK:STDOUT: %C.ref.loc14: %C.type = name_ref C, %C.decl [template = constants.%C.generic] +// CHECK:STDOUT: %Neq.ref.loc14: %Neq.type = name_ref Neq, %Neq.decl [template = constants.%Neq] +// CHECK:STDOUT: %false.loc14_14: bool = bool_literal false [template = constants.%false] +// CHECK:STDOUT: %false.loc14_21: bool = bool_literal false [template = constants.%false] +// CHECK:STDOUT: %bool.neq.loc14: init bool = call %Neq.ref.loc14(%false.loc14_14, %false.loc14_21) [template = constants.%false] +// CHECK:STDOUT: %.loc14_27.1: bool = value_of_initializer %bool.neq.loc14 [template = constants.%false] +// CHECK:STDOUT: %.loc14_27.2: bool = converted %bool.neq.loc14, %.loc14_27.1 [template = constants.%false] +// CHECK:STDOUT: %C.loc14: type = class_type @C, @C(constants.%false) [template = constants.%C.3] +// CHECK:STDOUT: %d.var: ref %C.3 = var d +// CHECK:STDOUT: %d: ref %C.3 = bind_name d, %d.var +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic class @C(%B.loc6_9.1: bool) { +// CHECK:STDOUT: %B.loc6_9.2: bool = bind_symbolic_name B, 0 [symbolic = %B.loc6_9.2 (constants.%B)] +// CHECK:STDOUT: %B.patt.loc6_9.2: bool = symbolic_binding_pattern B, 0 [symbolic = %B.patt.loc6_9.2 (constants.%B.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: class { +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = constants.%C.1 +// CHECK:STDOUT: complete_type_witness = %complete_type +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Neq(%a.param_patt: bool, %b.param_patt: bool) -> bool = "bool.neq"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @True() -> %C.2; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @False() -> %C.3; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @__global_init() { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %False.ref.loc11: %False.type = name_ref False, file.%False.decl [template = constants.%False] +// CHECK:STDOUT: %.loc11: ref %C.3 = splice_block file.%a.var {} +// CHECK:STDOUT: %False.call.loc11: init %C.3 = call %False.ref.loc11() to %.loc11 +// CHECK:STDOUT: assign file.%a.var, %False.call.loc11 +// CHECK:STDOUT: %True.ref.loc12: %True.type = name_ref True, file.%True.decl [template = constants.%True] +// CHECK:STDOUT: %.loc12: ref %C.2 = splice_block file.%b.var {} +// CHECK:STDOUT: %True.call.loc12: init %C.2 = call %True.ref.loc12() to %.loc12 +// CHECK:STDOUT: assign file.%b.var, %True.call.loc12 +// CHECK:STDOUT: %True.ref.loc13: %True.type = name_ref True, file.%True.decl [template = constants.%True] +// CHECK:STDOUT: %.loc13: ref %C.2 = splice_block file.%c.var {} +// CHECK:STDOUT: %True.call.loc13: init %C.2 = call %True.ref.loc13() to %.loc13 +// CHECK:STDOUT: assign file.%c.var, %True.call.loc13 +// CHECK:STDOUT: %False.ref.loc14: %False.type = name_ref False, file.%False.decl [template = constants.%False] +// CHECK:STDOUT: %.loc14: ref %C.3 = splice_block file.%d.var {} +// CHECK:STDOUT: %False.call.loc14: init %C.3 = call %False.ref.loc14() to %.loc14 +// CHECK:STDOUT: assign file.%d.var, %False.call.loc14 +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @C(constants.%B) { +// CHECK:STDOUT: %B.loc6_9.2 => constants.%B +// CHECK:STDOUT: %B.patt.loc6_9.2 => constants.%B +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @C(constants.%true) { +// CHECK:STDOUT: %B.loc6_9.2 => constants.%true +// CHECK:STDOUT: %B.patt.loc6_9.2 => constants.%true +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @C(constants.%false) { +// CHECK:STDOUT: %B.loc6_9.2 => constants.%false +// CHECK:STDOUT: %B.patt.loc6_9.2 => constants.%false +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: --- prelude.carbon +// CHECK:STDOUT: +// CHECK:STDOUT: constants { +// CHECK:STDOUT: %Bool.type: type = fn_type @Bool [template] +// CHECK:STDOUT: %Bool: %Bool.type = struct_value () [template] +// CHECK:STDOUT: %B: bool = bind_symbolic_name B, 0 [symbolic] +// CHECK:STDOUT: %B.patt: bool = symbolic_binding_pattern B, 0 [symbolic] +// CHECK:STDOUT: %C.type: type = generic_class_type @C [template] +// CHECK:STDOUT: %C.generic: %C.type = struct_value () [template] +// CHECK:STDOUT: %C.1: type = class_type @C, @C(%B) [symbolic] +// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] +// CHECK:STDOUT: %true: bool = bool_literal true [template] +// CHECK:STDOUT: %C.2: type = class_type @C, @C(%true) [template] +// CHECK:STDOUT: %True.type: type = fn_type @True [template] +// CHECK:STDOUT: %True: %True.type = struct_value () [template] +// CHECK:STDOUT: %false: bool = bool_literal false [template] +// CHECK:STDOUT: %C.3: type = class_type @C, @C(%false) [template] +// CHECK:STDOUT: %False.type: type = fn_type @False [template] +// CHECK:STDOUT: %False: %False.type = struct_value () [template] +// CHECK:STDOUT: %NotEqual.type.1: type = fn_type @NotEqual.1 [template] +// CHECK:STDOUT: %NotEqual.type.2: type = fn_type @NotEqual.2 [template] +// CHECK:STDOUT: %NotEqual.2: %NotEqual.type.2 = struct_value () [template] +// CHECK:STDOUT: %Equal.type: type = fn_type @Equal [template] +// CHECK:STDOUT: %Equal: %Equal.type = struct_value () [template] +// CHECK:STDOUT: %interface: = interface_witness (%Equal, %NotEqual.2) [template] +// CHECK:STDOUT: %NotEqual.bound.1: = bound_method %true, %NotEqual.2 [template] +// CHECK:STDOUT: %NotEqual.bound.2: = bound_method %false, %NotEqual.2 [template] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Bool = %import_ref.1 +// CHECK:STDOUT: .Eq = %import_ref.2 +// CHECK:STDOUT: import Core//prelude +// CHECK:STDOUT: import Core//prelude/... +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .C = %C.decl +// CHECK:STDOUT: .True = %True.decl +// CHECK:STDOUT: .False = %False.decl +// CHECK:STDOUT: .a = %a +// CHECK:STDOUT: .b = %b +// CHECK:STDOUT: .c = %c +// CHECK:STDOUT: .d = %d +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %C.decl: %C.type = class_decl @C [template = constants.%C.generic] { +// CHECK:STDOUT: %B.patt.loc4_9.1: bool = symbolic_binding_pattern B, 0 [symbolic = %B.patt.loc4_9.2 (constants.%B.patt)] +// CHECK:STDOUT: %B.param_patt: bool = value_param_pattern %B.patt.loc4_9.1, runtime_param [symbolic = %B.patt.loc4_9.2 (constants.%B.patt)] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] +// CHECK:STDOUT: %.loc4_13.1: type = value_of_initializer %bool.make_type [template = bool] +// CHECK:STDOUT: %.loc4_13.2: type = converted %bool.make_type, %.loc4_13.1 [template = bool] +// CHECK:STDOUT: %B.param: bool = value_param runtime_param +// CHECK:STDOUT: %B.loc4_9.1: bool = bind_symbolic_name B, 0, %B.param [symbolic = %B.loc4_9.2 (constants.%B)] +// CHECK:STDOUT: } +// CHECK:STDOUT: %True.decl: %True.type = fn_decl @True [template = constants.%True] { +// CHECK:STDOUT: %return.patt: %C.2 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %C.2 = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [template = constants.%C.generic] +// CHECK:STDOUT: %true: bool = bool_literal true [template = constants.%true] +// CHECK:STDOUT: %C: type = class_type @C, @C(constants.%true) [template = constants.%C.2] +// CHECK:STDOUT: %return.param: ref %C.2 = out_param runtime_param0 +// CHECK:STDOUT: %return: ref %C.2 = return_slot %return.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %False.decl: %False.type = fn_decl @False [template = constants.%False] { +// CHECK:STDOUT: %return.patt: %C.3 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %C.3 = out_param_pattern %return.patt, runtime_param0 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [template = constants.%C.generic] +// CHECK:STDOUT: %false: bool = bool_literal false [template = constants.%false] +// CHECK:STDOUT: %C: type = class_type @C, @C(constants.%false) [template = constants.%C.3] +// CHECK:STDOUT: %return.param: ref %C.3 = out_param runtime_param0 +// CHECK:STDOUT: %return: ref %C.3 = return_slot %return.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %C.ref.loc9: %C.type = name_ref C, %C.decl [template = constants.%C.generic] +// CHECK:STDOUT: %true.loc9_10: bool = bool_literal true [template = constants.%true] +// CHECK:STDOUT: %true.loc9_18: bool = bool_literal true [template = constants.%true] +// CHECK:STDOUT: %impl.elem1.loc9: %NotEqual.type.1 = interface_witness_access constants.%interface, element1 [template = constants.%NotEqual.2] +// CHECK:STDOUT: %NotEqual.bound.loc9: = bound_method %true.loc9_10, %impl.elem1.loc9 [template = constants.%NotEqual.bound.1] +// CHECK:STDOUT: %bool.neq.loc9: init bool = call %NotEqual.bound.loc9(%true.loc9_10, %true.loc9_18) [template = constants.%false] +// CHECK:STDOUT: %.loc9_22.1: bool = value_of_initializer %bool.neq.loc9 [template = constants.%false] +// CHECK:STDOUT: %.loc9_22.2: bool = converted %bool.neq.loc9, %.loc9_22.1 [template = constants.%false] +// CHECK:STDOUT: %C.loc9: type = class_type @C, @C(constants.%false) [template = constants.%C.3] +// CHECK:STDOUT: %a.var: ref %C.3 = var a +// CHECK:STDOUT: %a: ref %C.3 = bind_name a, %a.var +// CHECK:STDOUT: %C.ref.loc10: %C.type = name_ref C, %C.decl [template = constants.%C.generic] +// CHECK:STDOUT: %true.loc10: bool = bool_literal true [template = constants.%true] +// CHECK:STDOUT: %false.loc10: bool = bool_literal false [template = constants.%false] +// CHECK:STDOUT: %impl.elem1.loc10: %NotEqual.type.1 = interface_witness_access constants.%interface, element1 [template = constants.%NotEqual.2] +// CHECK:STDOUT: %NotEqual.bound.loc10: = bound_method %true.loc10, %impl.elem1.loc10 [template = constants.%NotEqual.bound.1] +// CHECK:STDOUT: %bool.neq.loc10: init bool = call %NotEqual.bound.loc10(%true.loc10, %false.loc10) [template = constants.%true] +// CHECK:STDOUT: %.loc10_23.1: bool = value_of_initializer %bool.neq.loc10 [template = constants.%true] +// CHECK:STDOUT: %.loc10_23.2: bool = converted %bool.neq.loc10, %.loc10_23.1 [template = constants.%true] +// CHECK:STDOUT: %C.loc10: type = class_type @C, @C(constants.%true) [template = constants.%C.2] +// CHECK:STDOUT: %b.var: ref %C.2 = var b +// CHECK:STDOUT: %b: ref %C.2 = bind_name b, %b.var +// CHECK:STDOUT: %C.ref.loc11: %C.type = name_ref C, %C.decl [template = constants.%C.generic] +// CHECK:STDOUT: %false.loc11: bool = bool_literal false [template = constants.%false] +// CHECK:STDOUT: %true.loc11: bool = bool_literal true [template = constants.%true] +// CHECK:STDOUT: %impl.elem1.loc11: %NotEqual.type.1 = interface_witness_access constants.%interface, element1 [template = constants.%NotEqual.2] +// CHECK:STDOUT: %NotEqual.bound.loc11: = bound_method %false.loc11, %impl.elem1.loc11 [template = constants.%NotEqual.bound.2] +// CHECK:STDOUT: %bool.neq.loc11: init bool = call %NotEqual.bound.loc11(%false.loc11, %true.loc11) [template = constants.%true] +// CHECK:STDOUT: %.loc11_23.1: bool = value_of_initializer %bool.neq.loc11 [template = constants.%true] +// CHECK:STDOUT: %.loc11_23.2: bool = converted %bool.neq.loc11, %.loc11_23.1 [template = constants.%true] +// CHECK:STDOUT: %C.loc11: type = class_type @C, @C(constants.%true) [template = constants.%C.2] +// CHECK:STDOUT: %c.var: ref %C.2 = var c +// CHECK:STDOUT: %c: ref %C.2 = bind_name c, %c.var +// CHECK:STDOUT: %C.ref.loc12: %C.type = name_ref C, %C.decl [template = constants.%C.generic] +// CHECK:STDOUT: %false.loc12_10: bool = bool_literal false [template = constants.%false] +// CHECK:STDOUT: %false.loc12_19: bool = bool_literal false [template = constants.%false] +// CHECK:STDOUT: %impl.elem1.loc12: %NotEqual.type.1 = interface_witness_access constants.%interface, element1 [template = constants.%NotEqual.2] +// CHECK:STDOUT: %NotEqual.bound.loc12: = bound_method %false.loc12_10, %impl.elem1.loc12 [template = constants.%NotEqual.bound.2] +// CHECK:STDOUT: %bool.neq.loc12: init bool = call %NotEqual.bound.loc12(%false.loc12_10, %false.loc12_19) [template = constants.%false] +// CHECK:STDOUT: %.loc12_24.1: bool = value_of_initializer %bool.neq.loc12 [template = constants.%false] +// CHECK:STDOUT: %.loc12_24.2: bool = converted %bool.neq.loc12, %.loc12_24.1 [template = constants.%false] +// CHECK:STDOUT: %C.loc12: type = class_type @C, @C(constants.%false) [template = constants.%C.3] +// CHECK:STDOUT: %d.var: ref %C.3 = var d +// CHECK:STDOUT: %d: ref %C.3 = bind_name d, %d.var +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic class @C(%B.loc4_9.1: bool) { +// CHECK:STDOUT: %B.loc4_9.2: bool = bind_symbolic_name B, 0 [symbolic = %B.loc4_9.2 (constants.%B)] +// CHECK:STDOUT: %B.patt.loc4_9.2: bool = symbolic_binding_pattern B, 0 [symbolic = %B.patt.loc4_9.2 (constants.%B.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: class { +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = constants.%C.1 +// CHECK:STDOUT: complete_type_witness = %complete_type +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @True() -> %C.2; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @False() -> %C.3; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @__global_init() { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %False.ref.loc9: %False.type = name_ref False, file.%False.decl [template = constants.%False] +// CHECK:STDOUT: %.loc9: ref %C.3 = splice_block file.%a.var {} +// CHECK:STDOUT: %False.call.loc9: init %C.3 = call %False.ref.loc9() to %.loc9 +// CHECK:STDOUT: assign file.%a.var, %False.call.loc9 +// CHECK:STDOUT: %True.ref.loc10: %True.type = name_ref True, file.%True.decl [template = constants.%True] +// CHECK:STDOUT: %.loc10: ref %C.2 = splice_block file.%b.var {} +// CHECK:STDOUT: %True.call.loc10: init %C.2 = call %True.ref.loc10() to %.loc10 +// CHECK:STDOUT: assign file.%b.var, %True.call.loc10 +// CHECK:STDOUT: %True.ref.loc11: %True.type = name_ref True, file.%True.decl [template = constants.%True] +// CHECK:STDOUT: %.loc11: ref %C.2 = splice_block file.%c.var {} +// CHECK:STDOUT: %True.call.loc11: init %C.2 = call %True.ref.loc11() to %.loc11 +// CHECK:STDOUT: assign file.%c.var, %True.call.loc11 +// CHECK:STDOUT: %False.ref.loc12: %False.type = name_ref False, file.%False.decl [template = constants.%False] +// CHECK:STDOUT: %.loc12: ref %C.3 = splice_block file.%d.var {} +// CHECK:STDOUT: %False.call.loc12: init %C.3 = call %False.ref.loc12() to %.loc12 +// CHECK:STDOUT: assign file.%d.var, %False.call.loc12 +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @C(constants.%B) { +// CHECK:STDOUT: %B.loc4_9.2 => constants.%B +// CHECK:STDOUT: %B.patt.loc4_9.2 => constants.%B +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @C(constants.%true) { +// CHECK:STDOUT: %B.loc4_9.2 => constants.%true +// CHECK:STDOUT: %B.patt.loc4_9.2 => constants.%true +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @C(constants.%false) { +// CHECK:STDOUT: %B.loc4_9.2 => constants.%false +// CHECK:STDOUT: %B.patt.loc4_9.2 => constants.%false +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/operators/overloaded/eq.carbon b/toolchain/check/testdata/operators/overloaded/eq.carbon index 8b3ce73429e5e..aba611ffadaef 100644 --- a/toolchain/check/testdata/operators/overloaded/eq.carbon +++ b/toolchain/check/testdata/operators/overloaded/eq.carbon @@ -123,7 +123,7 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} -// CHECK:STDOUT: impl_decl @impl [template] {} { +// CHECK:STDOUT: impl_decl @impl.1 [template] {} { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %Eq.ref: type = name_ref Eq, imports.%import_ref.1 [template = constants.%Eq.type] @@ -170,7 +170,7 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl: %C.ref as %Eq.ref { +// CHECK:STDOUT: impl @impl.1: %C.ref as %Eq.ref { // CHECK:STDOUT: %Equal.decl: %Equal.type.1 = fn_decl @Equal.1 [template = constants.%Equal.1] { // CHECK:STDOUT: %self.patt: %C = binding_pattern self // CHECK:STDOUT: %self.param_patt: %C = value_param_pattern %self.patt, runtime_param0 @@ -377,7 +377,7 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Eq = %import_ref.1 // CHECK:STDOUT: .Bool = %import_ref.7 -// CHECK:STDOUT: .ImplicitAs = %import_ref.9 +// CHECK:STDOUT: .ImplicitAs = %import_ref.12 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -395,7 +395,7 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: %D.decl: type = class_decl @D [template = constants.%D] {} {} -// CHECK:STDOUT: impl_decl @impl [template] {} { +// CHECK:STDOUT: impl_decl @impl.1 [template] {} { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %Eq.ref: type = name_ref Eq, imports.%import_ref.1 [template = constants.%Eq.type] @@ -442,7 +442,7 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl: %C.ref as %Eq.ref { +// CHECK:STDOUT: impl @impl.1: %C.ref as %Eq.ref { // CHECK:STDOUT: %Equal.decl: %Equal.type.1 = fn_decl @Equal.1 [template = constants.%Equal.1] { // CHECK:STDOUT: %self.patt: %C = binding_pattern self // CHECK:STDOUT: %self.param_patt: %C = value_param_pattern %self.patt, runtime_param0 diff --git a/toolchain/check/testdata/operators/overloaded/ordered.carbon b/toolchain/check/testdata/operators/overloaded/ordered.carbon index b65479c0edc70..25ca32ecca90a 100644 --- a/toolchain/check/testdata/operators/overloaded/ordered.carbon +++ b/toolchain/check/testdata/operators/overloaded/ordered.carbon @@ -127,7 +127,7 @@ fn TestGreaterEqual(a: D, b: D) -> bool { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} -// CHECK:STDOUT: impl_decl @impl [template] {} { +// CHECK:STDOUT: impl_decl @impl.1 [template] {} { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %Ordered.ref: type = name_ref Ordered, imports.%import_ref.1 [template = constants.%Ordered.type] @@ -214,7 +214,7 @@ fn TestGreaterEqual(a: D, b: D) -> bool { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl: %C.ref as %Ordered.ref { +// CHECK:STDOUT: impl @impl.1: %C.ref as %Ordered.ref { // CHECK:STDOUT: %Less.decl: %Less.type.1 = fn_decl @Less.1 [template = constants.%Less.1] { // CHECK:STDOUT: %self.patt: %C = binding_pattern self // CHECK:STDOUT: %self.param_patt: %C = value_param_pattern %self.patt, runtime_param0 diff --git a/toolchain/lower/handle_call.cpp b/toolchain/lower/handle_call.cpp index f3af55cb769c4..9ea2dc5e6b83d 100644 --- a/toolchain/lower/handle_call.cpp +++ b/toolchain/lower/handle_call.cpp @@ -18,8 +18,10 @@ static auto GetBuiltinICmpPredicate(SemIR::BuiltinFunctionKind builtin_kind, -> llvm::CmpInst::Predicate { switch (builtin_kind) { case SemIR::BuiltinFunctionKind::IntEq: + case SemIR::BuiltinFunctionKind::BoolEq: return llvm::CmpInst::ICMP_EQ; case SemIR::BuiltinFunctionKind::IntNeq: + case SemIR::BuiltinFunctionKind::BoolNeq: return llvm::CmpInst::ICMP_NE; case SemIR::BuiltinFunctionKind::IntLess: return is_signed ? llvm::CmpInst::ICMP_SLT : llvm::CmpInst::ICMP_ULT; @@ -263,7 +265,9 @@ static auto HandleBuiltinCall(FunctionContext& context, SemIR::InstId inst_id, case SemIR::BuiltinFunctionKind::IntLess: case SemIR::BuiltinFunctionKind::IntLessEq: case SemIR::BuiltinFunctionKind::IntGreater: - case SemIR::BuiltinFunctionKind::IntGreaterEq: { + case SemIR::BuiltinFunctionKind::IntGreaterEq: + case SemIR::BuiltinFunctionKind::BoolEq: + case SemIR::BuiltinFunctionKind::BoolNeq: { context.SetLocal( inst_id, context.builder().CreateICmp( diff --git a/toolchain/lower/testdata/builtins/no_prelude/bool.carbon b/toolchain/lower/testdata/builtins/no_prelude/bool.carbon new file mode 100644 index 0000000000000..1b8b158f9464e --- /dev/null +++ b/toolchain/lower/testdata/builtins/no_prelude/bool.carbon @@ -0,0 +1,70 @@ +// Part of the Carbon Language project, under the Apache License v2.0 with LLVM +// Exceptions. See /LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// AUTOUPDATE +// TIP: To test this file alone, run: +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/lower/testdata/builtins/no_prelude/bool.carbon +// TIP: To dump output, run: +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/lower/testdata/builtins/no_prelude/bool.carbon + +fn Bool() -> type = "bool.make_type"; + +fn Eq(a: Bool(), b: Bool()) -> Bool() = "bool.eq"; +fn TestEq(a: Bool(), b: Bool()) -> Bool() { return Eq(a, b); } + +fn Neq(a: Bool(), b: Bool()) -> Bool() = "bool.neq"; +fn TestNeq(a: Bool(), b: Bool()) -> Bool() { return Neq(a, b); } + +fn IfEq(a: Bool(), b: Bool()) -> Bool() { + if (Eq(a, b)) { return true; } + return false; +} + +// CHECK:STDOUT: ; ModuleID = 'bool.carbon' +// CHECK:STDOUT: source_filename = "bool.carbon" +// CHECK:STDOUT: +// CHECK:STDOUT: define i1 @_CTestEq.Main(i1 %a, i1 %b) !dbg !4 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %bool.eq = icmp eq i1 %a, %b, !dbg !7 +// CHECK:STDOUT: ret i1 %bool.eq, !dbg !8 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: define i1 @_CTestNeq.Main(i1 %a, i1 %b) !dbg !9 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %bool.neq = icmp ne i1 %a, %b, !dbg !10 +// CHECK:STDOUT: ret i1 %bool.neq, !dbg !11 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: define i1 @_CIfEq.Main(i1 %a, i1 %b) !dbg !12 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %bool.eq = icmp eq i1 %a, %b, !dbg !13 +// CHECK:STDOUT: br i1 %bool.eq, label %if.then, label %if.else, !dbg !14 +// CHECK:STDOUT: +// CHECK:STDOUT: if.then: ; preds = %entry +// CHECK:STDOUT: ret i1 true, !dbg !15 +// CHECK:STDOUT: +// CHECK:STDOUT: if.else: ; preds = %entry +// CHECK:STDOUT: ret i1 false, !dbg !16 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} +// CHECK:STDOUT: !llvm.dbg.cu = !{!2} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !3 = !DIFile(filename: "bool.carbon", directory: "") +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "TestEq", linkageName: "_CTestEq.Main", scope: null, file: !3, line: 14, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) +// CHECK:STDOUT: !6 = !{} +// CHECK:STDOUT: !7 = !DILocation(line: 14, column: 52, scope: !4) +// CHECK:STDOUT: !8 = !DILocation(line: 14, column: 45, scope: !4) +// CHECK:STDOUT: !9 = distinct !DISubprogram(name: "TestNeq", linkageName: "_CTestNeq.Main", scope: null, file: !3, line: 17, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !10 = !DILocation(line: 17, column: 53, scope: !9) +// CHECK:STDOUT: !11 = !DILocation(line: 17, column: 46, scope: !9) +// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "IfEq", linkageName: "_CIfEq.Main", scope: null, file: !3, line: 19, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !13 = !DILocation(line: 20, column: 7, scope: !12) +// CHECK:STDOUT: !14 = !DILocation(line: 20, column: 6, scope: !12) +// CHECK:STDOUT: !15 = !DILocation(line: 20, column: 19, scope: !12) +// CHECK:STDOUT: !16 = !DILocation(line: 21, column: 3, scope: !12) diff --git a/toolchain/sem_ir/builtin_function_kind.cpp b/toolchain/sem_ir/builtin_function_kind.cpp index 915c9cc9d6af2..3146f6c55f8f0 100644 --- a/toolchain/sem_ir/builtin_function_kind.cpp +++ b/toolchain/sem_ir/builtin_function_kind.cpp @@ -372,6 +372,14 @@ constexpr BuiltinInfo FloatGreater = { constexpr BuiltinInfo FloatGreaterEq = { "float.greater_eq", ValidateSignatureBool>}; +// "bool.eq": bool equality comparison. +constexpr BuiltinInfo BoolEq = {"bool.eq", + ValidateSignatureBool>}; + +// "bool.neq": bool non-equality comparison. +constexpr BuiltinInfo BoolNeq = {"bool.neq", + ValidateSignatureBool>}; + } // namespace BuiltinFunctionInfo CARBON_DEFINE_ENUM_CLASS_NAMES(BuiltinFunctionKind) = { diff --git a/toolchain/sem_ir/builtin_function_kind.def b/toolchain/sem_ir/builtin_function_kind.def index d74d755da45f2..0b643707cd976 100644 --- a/toolchain/sem_ir/builtin_function_kind.def +++ b/toolchain/sem_ir/builtin_function_kind.def @@ -78,4 +78,8 @@ CARBON_SEM_IR_BUILTIN_FUNCTION_KIND(FloatLessEq) CARBON_SEM_IR_BUILTIN_FUNCTION_KIND(FloatGreater) CARBON_SEM_IR_BUILTIN_FUNCTION_KIND(FloatGreaterEq) +// Bool comparison. +CARBON_SEM_IR_BUILTIN_FUNCTION_KIND(BoolEq) +CARBON_SEM_IR_BUILTIN_FUNCTION_KIND(BoolNeq) + #undef CARBON_SEM_IR_BUILTIN_FUNCTION_KIND From a651ce19614a427e8ffe8a2d8fb42be4a6de06ab Mon Sep 17 00:00:00 2001 From: Jon Ross-Perkins Date: Wed, 18 Dec 2024 09:43:47 -0800 Subject: [PATCH 50/68] Fix default for Carbon Path (#4705) The extension.ts tries to provide a default, but it's not working the way I expect. So in addition, provide it in properties, which seems to work better. --- utils/vscode/package-lock.json | 4 ++-- utils/vscode/package.json | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/utils/vscode/package-lock.json b/utils/vscode/package-lock.json index bd71f33eaeb70..f584eb2f3a9fa 100644 --- a/utils/vscode/package-lock.json +++ b/utils/vscode/package-lock.json @@ -1,12 +1,12 @@ { "name": "carbon-vscode", - "version": "0.0.3", + "version": "0.0.4", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "carbon-vscode", - "version": "0.0.3", + "version": "0.0.4", "dependencies": { "vscode-languageclient": "^9.0.1" }, diff --git a/utils/vscode/package.json b/utils/vscode/package.json index 5da8255e9d9a7..41db15032d471 100644 --- a/utils/vscode/package.json +++ b/utils/vscode/package.json @@ -1,7 +1,7 @@ { "name": "carbon-vscode", "displayName": "Carbon Language", - "version": "0.0.3", + "version": "0.0.4", "publisher": "carbon-lang", "description": "Carbon language support for Visual Studio Code.", "repository": { @@ -42,7 +42,8 @@ "properties": { "carbon.carbonPath": { "type": "string", - "description": "The path to the 'carbon' binary." + "description": "The path to the 'carbon' binary.", + "default": "./bazel-bin/toolchain/install/run_carbon" } } } From a85160087b77d7c2df1ec6e3c64b3eda43648981 Mon Sep 17 00:00:00 2001 From: Jon Ross-Perkins Date: Wed, 18 Dec 2024 09:47:38 -0800 Subject: [PATCH 51/68] Undo formatting changes for clang-tidy-16 compatibility. (#4707) --- .clang-tidy | 189 +++++++++++++++++++++++++++++----------------------- 1 file changed, 107 insertions(+), 82 deletions(-) diff --git a/.clang-tidy b/.clang-tidy index eaf3b92c0d9b2..45a3cfe0cf55e 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -8,89 +8,114 @@ UseColor: true # This is necessary for `--config=clang-tidy` to catch errors. WarningsAsErrors: '*' +# TODO: clang-tidy-16 doesn't support this format; it's retained for comments. +# Switch once we update the minimum version. +# +# # We turn on all of a few categories by default. +# - '-*' +# - 'bugprone-*' +# - 'google-*' +# - 'misc-*' +# - 'modernize-*' +# - 'performance-*' +# - 'readability-*' +# +# # Disabled due to the implied style choices. +# - '-misc-const-correctness' +# - '-misc-include-cleaner' +# - '-misc-use-anonymous-namespace' +# - '-modernize-return-braced-init-list' +# - '-modernize-use-default-member-init' +# - '-modernize-use-integer-sign-comparison' +# - '-modernize-use-emplace' +# - '-readability-avoid-nested-conditional-operator' +# - '-readability-convert-member-functions-to-static' +# - '-readability-else-after-return' +# - '-readability-identifier-length' +# - '-readability-implicit-bool-conversion' +# - '-readability-make-member-function-const' +# - '-readability-math-missing-parentheses' +# - '-readability-static-definition-in-anonymous-namespace' +# - '-readability-use-anyofallof' +# +# # Warns when we have multiple empty cases in switches, which we do for comment +# # reasons. +# - '-bugprone-branch-clone' +# # Frequently warns on multiple parameters of the same type. +# - '-bugprone-easily-swappable-parameters' +# # Finds issues like out-of-memory in main(). We don't use exceptions, so it's +# # unlikely to find real issues. +# - '-bugprone-exception-escape' +# # Has false positives in places such as using an argument to declare a name, +# # which cannot have parentheses. For our limited use of macros, this is a +# # common conflict. +# - '-bugprone-macro-parentheses' +# # Conflicts with integer type C++ style. +# - '-bugprone-narrowing-conversions' +# # Has false positives for `enum_base.h`. Clang's built-in switch warnings +# # cover most of our risk of bugs here. +# - '-bugprone-switch-missing-default-case' +# # In clang-tidy 16, has false positives on code like: +# # while (auto name_ref = insts().Get(inst_id).TryAs()) { +# # inst_id = name_ref->value_id; +# # ^ unchecked access to optional value +# # } +# - '-bugprone-unchecked-optional-access' +# # Overlaps with `readability-function-size`. +# - '-google-readability-function-size' +# # Suggests usernames on TODOs, which we don't want. +# - '-google-readability-todo' +# # Even with `IgnoreClassesWithAllMemberVariablesBeingPublic` to allow structs, +# # we use `protected` members in too many tests. +# - '-misc-non-private-member-variables-in-classes' +# # Overlaps with `-Wno-missing-prototypes`. +# - '-misc-use-internal-linkage' +# # Suggests `std::array`, which we could migrate to, but conflicts with the +# # status quo. +# - '-modernize-avoid-c-arrays' +# # Warns on creation of SemIR typed insts, for which we do not currently want +# # to use designated initialization. +# - '-modernize-use-designated-initializers' +# # Only fixes const methods, not non-const, which yields distracting results on +# # accessors. +# - '-modernize-use-nodiscard' +# # Duplicates `modernize-pass-by-value`. +# - '-performance-unnecessary-value-param' +# # Warns on enums which use the `LastValue = Value` pattern if all the other +# # discriminants aren't given an explicit value. +# - '-readability-enum-initial-value' +# # Warns too frequently. +# - '-readability-function-cognitive-complexity' +# # Warns in reasonably documented situations. +# - '-readability-magic-numbers' +# # Warns on `= {}` which is also used to indicate which fields do not need to +# # be explicitly initialized in aggregate initialization. +# - '-readability-redundant-member-init' +# # Warns when callers use similar names as different parameters. +# - '-readability-suspicious-call-argument' Checks: - # We turn on all of a few categories by default. - - '-*' - - 'bugprone-*' - - 'google-*' - - 'misc-*' - - 'modernize-*' - - 'performance-*' - - 'readability-*' - - # Disabled due to the implied style choices. - - '-misc-const-correctness' - - '-misc-include-cleaner' - - '-misc-use-anonymous-namespace' - - '-modernize-return-braced-init-list' - - '-modernize-use-default-member-init' - - '-modernize-use-integer-sign-comparison' - - '-modernize-use-emplace' - - '-readability-avoid-nested-conditional-operator' - - '-readability-convert-member-functions-to-static' - - '-readability-else-after-return' - - '-readability-identifier-length' - - '-readability-implicit-bool-conversion' - - '-readability-make-member-function-const' - - '-readability-math-missing-parentheses' - - '-readability-static-definition-in-anonymous-namespace' - - '-readability-use-anyofallof' - - # Warns when we have multiple empty cases in switches, which we do for comment - # reasons. - - '-bugprone-branch-clone' - # Frequently warns on multiple parameters of the same type. - - '-bugprone-easily-swappable-parameters' - # Finds issues like out-of-memory in main(). We don't use exceptions, so it's - # unlikely to find real issues. - - '-bugprone-exception-escape' - # Has false positives in places such as using an argument to declare a name, - # which cannot have parentheses. For our limited use of macros, this is a - # common conflict. - - '-bugprone-macro-parentheses' - # Conflicts with integer type C++ style. - - '-bugprone-narrowing-conversions' - # Has false positives for `enum_base.h`. Clang's built-in switch warnings - # cover most of our risk of bugs here. - - '-bugprone-switch-missing-default-case' - # In clang-tidy 16, has false positives on code like: - # while (auto name_ref = insts().Get(inst_id).TryAs()) { - # inst_id = name_ref->value_id; - # ^ unchecked access to optional value - # } - - '-bugprone-unchecked-optional-access' - # Overlaps with `readability-function-size`. - - '-google-readability-function-size' - # Suggests usernames on TODOs, which we don't want. - - '-google-readability-todo' - # Even with `IgnoreClassesWithAllMemberVariablesBeingPublic` to allow structs, - # we use `protected` members in too many tests. - - '-misc-non-private-member-variables-in-classes' - # Overlaps with `-Wno-missing-prototypes`. - - '-misc-use-internal-linkage' - # Suggests `std::array`, which we could migrate to, but conflicts with the - # status quo. - - '-modernize-avoid-c-arrays' - # Warns on creation of SemIR typed insts, for which we do not currently want - # to use designated initialization. - - '-modernize-use-designated-initializers' - # Only fixes const methods, not non-const, which yields distracting results on - # accessors. - - '-modernize-use-nodiscard' - # Duplicates `modernize-pass-by-value`. - - '-performance-unnecessary-value-param' - # Warns on enums which use the `LastValue = Value` pattern if all the other - # discriminants aren't given an explicit value. - - '-readability-enum-initial-value' - # Warns too frequently. - - '-readability-function-cognitive-complexity' - # Warns in reasonably documented situations. - - '-readability-magic-numbers' - # Warns on `= {}` which is also used to indicate which fields do not need to - # be explicitly initialized in aggregate initialization. - - '-readability-redundant-member-init' - # Warns when callers use similar names as different parameters. - - '-readability-suspicious-call-argument' + -*, bugprone-*, google-*, misc-*, modernize-*, performance-*, readability-*, + -misc-const-correctness, -misc-include-cleaner, -misc-use-anonymous-namespace, + -modernize-return-braced-init-list, -modernize-use-default-member-init, + -modernize-use-integer-sign-comparison, -modernize-use-emplace, + -readability-avoid-nested-conditional-operator, + -readability-convert-member-functions-to-static, + -readability-else-after-return, -readability-identifier-length, + -readability-implicit-bool-conversion, + -readability-make-member-function-const, + -readability-math-missing-parentheses, + -readability-static-definition-in-anonymous-namespace, + -readability-use-anyofallof, -bugprone-branch-clone, + -bugprone-easily-swappable-parameters, -bugprone-exception-escape, + -bugprone-macro-parentheses, -bugprone-narrowing-conversions, + -bugprone-switch-missing-default-case, -bugprone-unchecked-optional-access, + -google-readability-function-size, -google-readability-todo, + -misc-non-private-member-variables-in-classes, -misc-use-internal-linkage, + -modernize-avoid-c-arrays, -modernize-use-designated-initializers, + -modernize-use-nodiscard, -performance-unnecessary-value-param, + -readability-enum-initial-value, -readability-function-cognitive-complexity, + -readability-magic-numbers, -readability-redundant-member-init, + -readability-suspicious-call-argument CheckOptions: - key: readability-identifier-naming.ClassCase value: CamelCase From ecda309c12b507298577e6d6f48af5dae71b3926 Mon Sep 17 00:00:00 2001 From: Jon Ross-Perkins Date: Wed, 18 Dec 2024 15:58:01 -0800 Subject: [PATCH 52/68] Change Dump functions to static where appropriate. (#4712) Verified under LLDB these still appear callable; I'm expecting GDB to be the same. My concern about debugger calls to static functions was just wrong. --- toolchain/check/BUILD | 2 -- toolchain/check/dump.cpp | 6 +++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/toolchain/check/BUILD b/toolchain/check/BUILD index 213513bdbef18..884183ac7f0d2 100644 --- a/toolchain/check/BUILD +++ b/toolchain/check/BUILD @@ -95,8 +95,6 @@ cc_library( cc_library( name = "dump", srcs = ["dump.cpp"], - # Contains Dump methods without a forward declaration. - copts = ["-Wno-missing-prototypes"], deps = [ ":context", "//common:check", diff --git a/toolchain/check/dump.cpp b/toolchain/check/dump.cpp index d92306c78d518..4823890d77701 100644 --- a/toolchain/check/dump.cpp +++ b/toolchain/check/dump.cpp @@ -57,17 +57,17 @@ static auto DumpNoNewline(const Context& context, SemIR::LocId loc_id) -> void { } } -LLVM_DUMP_METHOD auto Dump(const Context& context, Lex::TokenIndex token) +LLVM_DUMP_METHOD static auto Dump(const Context& context, Lex::TokenIndex token) -> void { Parse::Dump(context.parse_tree(), token); } -LLVM_DUMP_METHOD auto Dump(const Context& context, Parse::NodeId node_id) +LLVM_DUMP_METHOD static auto Dump(const Context& context, Parse::NodeId node_id) -> void { Parse::Dump(context.parse_tree(), node_id); } -LLVM_DUMP_METHOD auto Dump(const Context& context, SemIR::LocId loc_id) +LLVM_DUMP_METHOD static auto Dump(const Context& context, SemIR::LocId loc_id) -> void { DumpNoNewline(context, loc_id); llvm::errs() << '\n'; From f67a4a5bcb5166e4fd11b1b16e1a63bf3d6f9fc9 Mon Sep 17 00:00:00 2001 From: Jon Ross-Perkins Date: Wed, 18 Dec 2024 16:31:24 -0800 Subject: [PATCH 53/68] Do a pass on vscode development instructions (#4703) --- utils/vscode/development.md | 53 ++++++++++++++++++++++++------------- 1 file changed, 34 insertions(+), 19 deletions(-) diff --git a/utils/vscode/development.md b/utils/vscode/development.md index 7c85e18204334..6ec60494b1ad7 100644 --- a/utils/vscode/development.md +++ b/utils/vscode/development.md @@ -6,31 +6,46 @@ Exceptions. See /LICENSE for license information. SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception --> -Currently only contains basic syntax highlighting. +## Tool setup -## Releases +NodeJS is required to build the extension. You will also need to install `vsce`: -This assumes NodeJS is installed, along with `vsce` (using -`npm install -g vsce`). +``` +npm install -g vsce +``` -1. `npm install && vsce publish` +## Common operations -## Local installation +- Build and install: -This assumes NodeJS is installed, along with `vsce` (using -`npm install -g vsce`). + - Locally: -1. `npm install && vsce package -o carbon.vsix && realpath carbon.vsix` - - This installs dependencies, builds the VSIX file, and prints the path - for installation. -2. Install the plugin: - - If you're using VS Code locally, run - `npm install && vsce package -o carbon.vsix && code --install-extension carbon.vsix` - - If you're using VS Code's remote mode: - 1. In vscode, open the - [command palette](https://code.visualstudio.com/docs/getstarted/userinterface#_command-palette) - and select "Extensions: Install from VSIX...". - 2. Enter the path printed by the above command. + ``` + npm install && vsce package -o carbon.vsix && code --install-extension carbon.vsix + ``` + + - From a remote SSH host using VS Code Server: + + ``` + npm install && vsce package -o carbon.vsix && ~/.vscode-server/cli/servers/Stable-*/server/bin/code-server --install-extension carbon.vsix + ``` + + - Using the UI: + + 1. `npm install && vsce package -o carbon.vsix && realpath carbon.vsix` + - This installs dependencies, builds the VSIX file, and prints the + path. + 2. Open the + [command palette](https://code.visualstudio.com/docs/getstarted/userinterface#_command-palette) + and select "Extensions: Install from VSIX...". + 3. Enter the path printed by the above command. + +- Build and publish the release using the website: + + 1. `npm install && vsce package -o carbon.vsix && realpath carbon.vsix` + 2. Go to https://marketplace.visualstudio.com/manage/publishers/carbon-lang + 3. Next to the extension name, click the "..." and select "Update". + 4. Select the `carbon.vsix` file. ## Development From cb4686bf217f946a88c814d0fa5171cf3846d34b Mon Sep 17 00:00:00 2001 From: Jon Ross-Perkins Date: Wed, 18 Dec 2024 16:31:41 -0800 Subject: [PATCH 54/68] Enable misc-non-private-member-variables-in-classes and adjust style to match (#4702) Pursuant to discussion regarding #4699, turn on `misc-non-private-member-variables-in-classes` using the `IgnoreClassesWithAllMemberVariablesBeingPublic` flag (the check treats structs as classes, so we need this for structs with all-public members). Updates the style guide notes to match, which should be pretty minor due to the scoping of test fixtures. Also fixes some underscore uses in test files on the way. Basically this is keeping the style for [class data member naming](https://google.github.io/styleguide/cppguide.html#Variable_Names) even while making them public. --- .clang-tidy | 25 ++++++++----- docs/project/cpp_style_guide.md | 5 +++ .../cpp_refactoring/matcher_test_base.h | 19 +++++----- toolchain/check/node_stack.h | 2 +- .../diagnostics/diagnostic_emitter_test.cpp | 2 +- toolchain/driver/driver_test.cpp | 2 +- toolchain/install/busybox_info_test.cpp | 2 +- toolchain/install/install_paths_test.cpp | 2 +- toolchain/lex/string_literal_test.cpp | 36 +++++++++---------- toolchain/lex/tokenized_buffer_test.cpp | 2 +- toolchain/parse/typed_nodes_test.cpp | 2 +- 11 files changed, 56 insertions(+), 43 deletions(-) diff --git a/.clang-tidy b/.clang-tidy index 45a3cfe0cf55e..f5484bfcd6c51 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -65,9 +65,6 @@ WarningsAsErrors: '*' # - '-google-readability-function-size' # # Suggests usernames on TODOs, which we don't want. # - '-google-readability-todo' -# # Even with `IgnoreClassesWithAllMemberVariablesBeingPublic` to allow structs, -# # we use `protected` members in too many tests. -# - '-misc-non-private-member-variables-in-classes' # # Overlaps with `-Wno-missing-prototypes`. # - '-misc-use-internal-linkage' # # Suggests `std::array`, which we could migrate to, but conflicts with the @@ -110,13 +107,17 @@ Checks: -bugprone-macro-parentheses, -bugprone-narrowing-conversions, -bugprone-switch-missing-default-case, -bugprone-unchecked-optional-access, -google-readability-function-size, -google-readability-todo, - -misc-non-private-member-variables-in-classes, -misc-use-internal-linkage, - -modernize-avoid-c-arrays, -modernize-use-designated-initializers, - -modernize-use-nodiscard, -performance-unnecessary-value-param, - -readability-enum-initial-value, -readability-function-cognitive-complexity, - -readability-magic-numbers, -readability-redundant-member-init, - -readability-suspicious-call-argument + -misc-use-internal-linkage, -modernize-avoid-c-arrays, + -modernize-use-designated-initializers, -modernize-use-nodiscard, + -performance-unnecessary-value-param, -readability-enum-initial-value, + -readability-function-cognitive-complexity, -readability-magic-numbers, + -readability-redundant-member-init, -readability-suspicious-call-argument CheckOptions: + # Don't warn on structs; done by ignoring when there are only public members. + - key: misc-non-private-member-variables-in-classes.IgnoreClassesWithAllMemberVariablesBeingPublic + value: true + + # CamelCase names. - key: readability-identifier-naming.ClassCase value: CamelCase - key: readability-identifier-naming.ClassConstantCase @@ -135,14 +136,20 @@ CheckOptions: value: CamelCase - key: readability-identifier-naming.UnionCase value: CamelCase + + # lower_case names. - key: readability-identifier-naming.ClassMemberCase value: lower_case - key: readability-identifier-naming.ParameterCase value: lower_case - key: readability-identifier-naming.VariableCase value: lower_case + + # TODO: This is for explorer's use of LLVM casting support, so we should be + # able to remove it once explorer is deleted. - key: readability-identifier-naming.MethodIgnoredRegexp value: '^classof$' + # This erroneously fires in C++20 mode with LLVM 16 clang-tidy, due to: # https://github.com/llvm/llvm-project/issues/46097 - key: readability-identifier-naming.TemplateParameterIgnoredRegexp diff --git a/docs/project/cpp_style_guide.md b/docs/project/cpp_style_guide.md index 1079d8d4b30dd..8409ca4379a2f 100644 --- a/docs/project/cpp_style_guide.md +++ b/docs/project/cpp_style_guide.md @@ -184,6 +184,11 @@ these. - Tests are an exception and should typically be wrapped in an anonymous namespace under the namespace of the code under test, to keep everything internal. +- For + [Access Control](https://google.github.io/styleguide/cppguide.html#Access_Control), + specifically for test fixtures in `.cpp` files, we use `public` instead of + `protected`. This is motivated by the + `misc-non-private-member-variables-in-classes` tidy check. ### Copyable and movable types diff --git a/migrate_cpp/cpp_refactoring/matcher_test_base.h b/migrate_cpp/cpp_refactoring/matcher_test_base.h index 3adaf6642241b..81c38972ec285 100644 --- a/migrate_cpp/cpp_refactoring/matcher_test_base.h +++ b/migrate_cpp/cpp_refactoring/matcher_test_base.h @@ -19,25 +19,25 @@ namespace Carbon::Testing { template class MatcherTestBase : public ::testing::Test { protected: - MatcherTestBase() : matchers(&replacements) { - matchers.Register(std::make_unique()); + MatcherTestBase() : matchers_(&replacements_) { + matchers_.Register(std::make_unique()); } // Expects that the replacements produced by running the finder result in // the specified code transformation. void ExpectReplacement(llvm::StringRef before, llvm::StringRef after) { auto factory = - clang::tooling::newFrontendActionFactory(matchers.GetFinder()); + clang::tooling::newFrontendActionFactory(matchers_.GetFinder()); constexpr char Filename[] = "test.cc"; - replacements.clear(); - replacements.insert({Filename, {}}); + replacements_.clear(); + replacements_.insert({Filename, {}}); ASSERT_TRUE(clang::tooling::runToolOnCodeWithArgs( factory->create(), before, {}, Filename, "clang-tool", std::make_shared(), clang::tooling::FileContentMappings())); - EXPECT_THAT(replacements, testing::ElementsAre(testing::Key(Filename))); + EXPECT_THAT(replacements_, testing::ElementsAre(testing::Key(Filename))); llvm::Expected actual = - clang::tooling::applyAllReplacements(before, replacements[Filename]); + clang::tooling::applyAllReplacements(before, replacements_[Filename]); // Make a specific note if the matcher didn't make any changes. std::string unchanged; @@ -57,8 +57,9 @@ class MatcherTestBase : public ::testing::Test { } } - Matcher::ReplacementMap replacements; - MatcherManager matchers; + private: + Matcher::ReplacementMap replacements_; + MatcherManager matchers_; }; } // namespace Carbon::Testing diff --git a/toolchain/check/node_stack.h b/toolchain/check/node_stack.h index 7184ecb213d5a..0de0e75b0aa53 100644 --- a/toolchain/check/node_stack.h +++ b/toolchain/check/node_stack.h @@ -339,7 +339,7 @@ class NodeStack { auto empty() const -> bool { return stack_.empty(); } auto size() const -> size_t { return stack_.size(); } - protected: + private: // An ID that can be associated with a parse node. // // Each parse node kind has a corresponding Id::Kind indicating which kind of diff --git a/toolchain/diagnostics/diagnostic_emitter_test.cpp b/toolchain/diagnostics/diagnostic_emitter_test.cpp index d6e704b77be47..043d5d708aeb4 100644 --- a/toolchain/diagnostics/diagnostic_emitter_test.cpp +++ b/toolchain/diagnostics/diagnostic_emitter_test.cpp @@ -25,7 +25,7 @@ struct FakeDiagnosticConverter : DiagnosticConverter { }; class DiagnosticEmitterTest : public ::testing::Test { - protected: + public: DiagnosticEmitterTest() : emitter_(converter_, consumer_) {} FakeDiagnosticConverter converter_; diff --git a/toolchain/driver/driver_test.cpp b/toolchain/driver/driver_test.cpp index d4aba3d65e34b..3e6fd0d77944e 100644 --- a/toolchain/driver/driver_test.cpp +++ b/toolchain/driver/driver_test.cpp @@ -40,7 +40,7 @@ static auto ReadFile(std::filesystem::path path) -> std::string { } class DriverTest : public testing::Test { - protected: + public: DriverTest() : installation_( InstallPaths::MakeForBazelRunfiles(Testing::GetExePath())), diff --git a/toolchain/install/busybox_info_test.cpp b/toolchain/install/busybox_info_test.cpp index 5299307bca20a..1d01bb7351838 100644 --- a/toolchain/install/busybox_info_test.cpp +++ b/toolchain/install/busybox_info_test.cpp @@ -18,7 +18,7 @@ namespace { using ::testing::Eq; class BusyboxInfoTest : public ::testing::Test { - protected: + public: // Set up a temp directory for the test case. explicit BusyboxInfoTest() { const char* tmpdir = std::getenv("TEST_TMPDIR"); diff --git a/toolchain/install/install_paths_test.cpp b/toolchain/install/install_paths_test.cpp index 9a633f2d76a4d..1ba4abfc6eb9b 100644 --- a/toolchain/install/install_paths_test.cpp +++ b/toolchain/install/install_paths_test.cpp @@ -33,7 +33,7 @@ using ::testing::Optional; using ::testing::StartsWith; class InstallPathsTest : public ::testing::Test { - protected: + public: InstallPathsTest() { std::string error; test_runfiles_.reset(Runfiles::Create(Testing::GetExePath().str(), &error)); diff --git a/toolchain/lex/string_literal_test.cpp b/toolchain/lex/string_literal_test.cpp index 82db0679b7f42..32819568c2380 100644 --- a/toolchain/lex/string_literal_test.cpp +++ b/toolchain/lex/string_literal_test.cpp @@ -15,8 +15,8 @@ namespace Carbon::Lex { namespace { class StringLiteralTest : public ::testing::Test { - protected: - StringLiteralTest() : error_tracker(ConsoleDiagnosticConsumer()) {} + public: + StringLiteralTest() : error_tracker_(ConsoleDiagnosticConsumer()) {} auto Lex(llvm::StringRef text) -> StringLiteral { std::optional result = StringLiteral::Lex(text); @@ -28,12 +28,12 @@ class StringLiteralTest : public ::testing::Test { auto Parse(llvm::StringRef text) -> llvm::StringRef { StringLiteral token = Lex(text); Testing::SingleTokenDiagnosticConverter converter(text); - DiagnosticEmitter emitter(converter, error_tracker); - return token.ComputeValue(allocator, emitter); + DiagnosticEmitter emitter(converter, error_tracker_); + return token.ComputeValue(allocator_, emitter); } - llvm::BumpPtrAllocator allocator; - ErrorTrackingDiagnosticConsumer error_tracker; + llvm::BumpPtrAllocator allocator_; + ErrorTrackingDiagnosticConsumer error_tracker_; }; TEST_F(StringLiteralTest, StringLiteralBounds) { @@ -207,9 +207,9 @@ TEST_F(StringLiteralTest, StringLiteralContents) { }; for (auto [test, expected] : testcases) { - error_tracker.Reset(); + error_tracker_.Reset(); auto value = Parse(test.trim()); - EXPECT_FALSE(error_tracker.seen_error()) << "`" << test << "`"; + EXPECT_FALSE(error_tracker_.seen_error()) << "`" << test << "`"; EXPECT_EQ(value, expected); } } @@ -238,9 +238,9 @@ TEST_F(StringLiteralTest, DoubleQuotedMultiLineLiteral) { }; for (auto [test, contents] : testcases) { - error_tracker.Reset(); + error_tracker_.Reset(); auto value = Parse(test.trim()); - EXPECT_TRUE(error_tracker.seen_error()) << "`" << test << "`"; + EXPECT_TRUE(error_tracker_.seen_error()) << "`" << test << "`"; EXPECT_EQ(value, contents); } } @@ -262,9 +262,9 @@ TEST_F(StringLiteralTest, StringLiteralBadIndent) { }; for (auto [test, contents] : testcases) { - error_tracker.Reset(); + error_tracker_.Reset(); auto value = Parse(test); - EXPECT_TRUE(error_tracker.seen_error()) << "`" << test << "`"; + EXPECT_TRUE(error_tracker_.seen_error()) << "`" << test << "`"; EXPECT_EQ(value, contents); } } @@ -311,28 +311,28 @@ TEST_F(StringLiteralTest, StringLiteralBadEscapeSequence) { }; for (llvm::StringLiteral test : testcases) { - error_tracker.Reset(); + error_tracker_.Reset(); Parse(test); - EXPECT_TRUE(error_tracker.seen_error()) << "`" << test << "`"; + EXPECT_TRUE(error_tracker_.seen_error()) << "`" << test << "`"; // TODO: Test value produced by error recovery. } } TEST_F(StringLiteralTest, TabInString) { auto value = Parse("\"x\ty\""); - EXPECT_TRUE(error_tracker.seen_error()); + EXPECT_TRUE(error_tracker_.seen_error()); EXPECT_EQ(value, "x\ty"); } TEST_F(StringLiteralTest, TabAtEndOfString) { auto value = Parse("\"\t\t\t\""); - EXPECT_TRUE(error_tracker.seen_error()); + EXPECT_TRUE(error_tracker_.seen_error()); EXPECT_EQ(value, "\t\t\t"); } TEST_F(StringLiteralTest, TabInBlockString) { auto value = Parse("'''\nx\ty\n'''"); - EXPECT_TRUE(error_tracker.seen_error()); + EXPECT_TRUE(error_tracker_.seen_error()); EXPECT_EQ(value, "x\ty\n"); } @@ -341,7 +341,7 @@ TEST_F(StringLiteralTest, UnicodeTooManyDigits) { text.append(10000, '9'); text.append("}"); auto value = Parse("\"\\" + text + "\""); - EXPECT_TRUE(error_tracker.seen_error()); + EXPECT_TRUE(error_tracker_.seen_error()); EXPECT_EQ(value, text); } diff --git a/toolchain/lex/tokenized_buffer_test.cpp b/toolchain/lex/tokenized_buffer_test.cpp index fb642bd240136..b842d1e979c42 100644 --- a/toolchain/lex/tokenized_buffer_test.cpp +++ b/toolchain/lex/tokenized_buffer_test.cpp @@ -37,7 +37,7 @@ using ::testing::Pair; namespace Yaml = ::Carbon::Testing::Yaml; class LexerTest : public ::testing::Test { - protected: + public: Testing::CompileHelper compile_helper_; }; diff --git a/toolchain/parse/typed_nodes_test.cpp b/toolchain/parse/typed_nodes_test.cpp index 076dbb045fb2c..48a9d68a583f3 100644 --- a/toolchain/parse/typed_nodes_test.cpp +++ b/toolchain/parse/typed_nodes_test.cpp @@ -45,7 +45,7 @@ namespace { #include "toolchain/parse/node_kind.def" class TypedNodeTest : public ::testing::Test { - protected: + public: using Peer = TypedNodesTestPeer; Testing::CompileHelper compile_helper_; From ee4746c41cde515472088076acbc3831fb47cfc9 Mon Sep 17 00:00:00 2001 From: Jon Ross-Perkins Date: Wed, 18 Dec 2024 16:32:25 -0800 Subject: [PATCH 55/68] Add documentation for running GDB and LLDB (#4710) After lots of fidgeting, LLDB seems to work. Not sure how reliable this will be though -- fission seems a little hit and miss. --- .bazelrc | 4 ++- .vscode/gdb_launch.json | 22 +++++++++++++ .vscode/lldb_launch.json | 36 +++++++++++++++++++++ docs/project/contribution_tools.md | 51 ++++++++++++++++++++++++------ 4 files changed, 103 insertions(+), 10 deletions(-) create mode 100644 .vscode/gdb_launch.json create mode 100644 .vscode/lldb_launch.json diff --git a/.bazelrc b/.bazelrc index 33a54aaa2e67b..819053a90ee3f 100644 --- a/.bazelrc +++ b/.bazelrc @@ -122,7 +122,9 @@ build:linux --define=pfm=1 # # Note: if using GDB, see documentation to get that working: # https://docs.carbon-lang.dev/docs/project/contribution_tools.html#debugging-with-gdb-instead-of-lldb -build:linux --fission=yes +# +# TODO: Bazel has a bug where it doesn't manage dwo files in the cache correctly. +# build:linux --fission=yes # Disables `actions.declare_symlink`. Done for cross-environment support. build --allow_unresolved_symlinks=false diff --git a/.vscode/gdb_launch.json b/.vscode/gdb_launch.json new file mode 100644 index 0000000000000..a50b089104516 --- /dev/null +++ b/.vscode/gdb_launch.json @@ -0,0 +1,22 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "type": "by-gdb", + "request": "launch", + "name": "file_test (gdb)", + "program": "bazel-bin/toolchain/testing/file_test", + "programArgs": "--file_tests=${relativeFile}", + "cwd": "${workspaceFolder}", + "env": { "TEST_TMPDIR": "/tmp" } + }, + { + "type": "by-gdb", + "request": "launch", + "name": "carbon compile (gdb)", + "program": "bazel-bin/toolchain/install/prefix_root/lib/carbon/carbon-busybox", + "programArgs": "compile --phase=lower --dump-sem-ir --stream-errors ${relativeFile}", + "cwd": "${workspaceFolder}" + } + ] +} diff --git a/.vscode/lldb_launch.json b/.vscode/lldb_launch.json new file mode 100644 index 0000000000000..fc0e35cd78405 --- /dev/null +++ b/.vscode/lldb_launch.json @@ -0,0 +1,36 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "type": "lldb-dap", + "request": "launch", + "name": "file_test (lldb)", + "program": "bazel-bin/toolchain/testing/file_test", + "args": ["--file_tests=${relativeFile}"], + "debuggerRoot": "${workspaceFolder}", + "initCommands": [ + "command script import external/_main~llvm_project~llvm-project/llvm/utils/lldbDataFormatters.py", + "settings set target.source-map \".\" \"${workspaceFolder}\"" + ], + "env": { "TEST_TMPDIR": "/tmp" } + }, + { + "type": "lldb-dap", + "request": "launch", + "name": "carbon compile (lldb)", + "program": "bazel-bin/toolchain/install/prefix_root/lib/carbon/carbon-busybox", + "args": [ + "compile", + "--phase=lower", + "--dump-sem-ir", + "--stream-errors", + "${relativeFile}" + ], + "debuggerRoot": "${workspaceFolder}", + "initCommands": [ + "command script import external/_main~llvm_project~llvm-project/llvm/utils/lldbDataFormatters.py", + "settings set target.source-map \".\" \"${workspaceFolder}\"" + ] + } + ] +} diff --git a/docs/project/contribution_tools.md b/docs/project/contribution_tools.md index 49fd7f9211360..68e4ec3ff0f1c 100644 --- a/docs/project/contribution_tools.md +++ b/docs/project/contribution_tools.md @@ -22,6 +22,8 @@ contributions. - [Main tools](#main-tools) - [Running pre-commit](#running-pre-commit) - [Optional tools](#optional-tools) + - [Using LLDB with VS Code](#using-lldb-with-vs-code) + - [Using GDB with VS Code](#using-gdb-with-vs-code) - [Manually building Clang and LLVM (not recommended)](#manually-building-clang-and-llvm-not-recommended) - [Troubleshooting build issues](#troubleshooting-build-issues) - [`bazel clean`](#bazel-clean) @@ -29,7 +31,6 @@ contributions. - [Asking for help](#asking-for-help) - [Troubleshooting debug issues](#troubleshooting-debug-issues) - [Debugging with GDB instead of LLDB](#debugging-with-gdb-instead-of-lldb) - - [Disabling split debug info](#disabling-split-debug-info) - [Debugging other build modes](#debugging-other-build-modes) - [Debugging on MacOS](#debugging-on-macos) @@ -239,6 +240,44 @@ considering if they fit your workflow. ``` - **NOTE**: This assumes you have `python` 3 installed on your system. +#### Using LLDB with VS Code + +The required setup for LLDB is: + +1. Install a minimum of LLVM 19 instead of LLVM 16. + - The `lldb-dap` tool was added as part of LLVM 19. +2. In the `.vscode` subdirectory, symlink `lldb_launch.json` to `launch.json`. + For example: `ln -s lldb_launch.json .vscode/launch.json` +3. Install the + [`llvm-vs-code-extensions.lldb-dap` extension](https://marketplace.visualstudio.com/items?itemName=llvm-vs-code-extensions.lldb-dap). +4. In VS Code settings, it may be necessary to set `lldb-dap.executable-path` + to the path of `lldb-dap`. + +A typical debug session looks like: + +1. `bazel build -c dbg //toolchain/testing:file_test` +2. Open a `.carbon` testdata file to debug. This must be the active file in VS + Code. +3. Go to the "Run and debug" panel in VS Code. +4. Select and run the `file_test (lldb)` configuration. + +#### Using GDB with VS Code + +The required setup for GDB is: + +1. In the `.vscode` subdirectory, symlink `gdb_launch.json` to `launch.json`. + For example: `ln -s gdb_launch.json .vscode/launch.json` +2. Install the + [`coolchyni.beyond-debug` extension](https://marketplace.visualstudio.com/items?itemName=coolchyni.beyond-debug). + +A typical debug session looks like: + +1. `bazel build -c dbg --features=-lldb_flags --features=gdb_flags //toolchain/testing:file_test` +2. Open a `.carbon` testdata file to debug. This must be the active file in VS + Code. +3. Go to the "Run and debug" panel in VS Code. +4. Select and run the `file_test (gdb)` configuration. + ### Manually building Clang and LLVM (not recommended) We primarily test against [apt.llvm.org](https://apt.llvm.org) and Homebrew @@ -247,9 +286,10 @@ comfortable with it. The essential CMake options to pass in order for this to work reliably include: ``` --DLLVM_ENABLE_PROJECTS=clang;clang-tools-extra;lld +-DLLVM_ENABLE_PROJECTS=clang;clang-tools-extra;lld;lldb -DLLVM_ENABLE_RUNTIMES=compiler-rt;libcxx;libcxxabi;libunwind -DRUNTIMES_CMAKE_ARGS=-DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=OFF;-DCMAKE_POSITION_INDEPENDENT_CODE=ON;-DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=ON;-DLIBCXX_STATICALLY_LINK_ABI_IN_SHARED_LIBRARY=OFF;-DLIBCXX_STATICALLY_LINK_ABI_IN_STATIC_LIBRARY=ON;-DLIBCXX_USE_COMPILER_RT=ON;-DLIBCXXABI_USE_COMPILER_RT=ON;-DLIBCXXABI_USE_LLVM_UNWINDER=ON +-DLLDB_ENABLE_PYTHON=ON ``` ## Troubleshooting build issues @@ -336,13 +376,6 @@ Dwarf Error: DW_FORM_strx1 found in non-DWO CU It means that the version of GDB used is too old, and does not support the DWARF v5 format. -### Disabling split debug info - -Our build uses split debug info by default on Linux to improve build and -debugger performance and reduce the size impact of debug information which can -be extremely large. If you encounter problems, you can disable it by passing -`--fission=no` to Bazel. - ### Debugging other build modes If you have an issue that only reproduces with another build mode, you can still From b54a27e9e76994bf523cd3dcbadf90127b6f9c72 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Wed, 18 Dec 2024 17:13:29 -0800 Subject: [PATCH 56/68] Fix incorrect lowering of mixed constant / non-constant aggregate initialization. (#4704) We defer lowering initialization with constant values, because the use of the constant can itself be part of a larger constant that we don't want to emit. However, when the initialization is for an element of a non-constant aggregate, we do need to initialize the constant portion. --- .../testdata/struct/partially_const.carbon | 97 +++++++++++++++++++ toolchain/lower/handle_aggregates.cpp | 29 +++++- .../lower/testdata/return/return_var.carbon | 1 + .../testdata/struct/partially_const.carbon | 40 ++++++++ 4 files changed, 165 insertions(+), 2 deletions(-) create mode 100644 toolchain/check/testdata/struct/partially_const.carbon create mode 100644 toolchain/lower/testdata/struct/partially_const.carbon diff --git a/toolchain/check/testdata/struct/partially_const.carbon b/toolchain/check/testdata/struct/partially_const.carbon new file mode 100644 index 0000000000000..b6173a93ccaf3 --- /dev/null +++ b/toolchain/check/testdata/struct/partially_const.carbon @@ -0,0 +1,97 @@ +// Part of the Carbon Language project, under the Apache License v2.0 with LLVM +// Exceptions. See /LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// AUTOUPDATE +// TIP: To test this file alone, run: +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/struct/partially_const.carbon +// TIP: To dump output, run: +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/struct/partially_const.carbon + +fn Make(n: i32) -> {.a: i32, .b: i32, .c: i32} { + return {.a = 0, .b = n, .c = 0}; +} + +// CHECK:STDOUT: --- partially_const.carbon +// CHECK:STDOUT: +// CHECK:STDOUT: constants { +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] +// CHECK:STDOUT: %struct_type.a.b.c.1: type = struct_type {.a: %i32, .b: %i32, .c: %i32} [template] +// CHECK:STDOUT: %Make.type: type = fn_type @Make [template] +// CHECK:STDOUT: %Make: %Make.type = struct_value () [template] +// CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] +// CHECK:STDOUT: %struct_type.a.b.c.2: type = struct_type {.a: Core.IntLiteral, .b: %i32, .c: Core.IntLiteral} [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] +// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] +// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] +// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.10 [template] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] +// CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int = %import_ref.1 +// CHECK:STDOUT: .ImplicitAs = %import_ref.5 +// CHECK:STDOUT: import Core//prelude +// CHECK:STDOUT: import Core//prelude/... +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Make = %Make.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %Make.decl: %Make.type = fn_decl @Make [template = constants.%Make] { +// CHECK:STDOUT: %n.patt: %i32 = binding_pattern n +// CHECK:STDOUT: %n.param_patt: %i32 = value_param_pattern %n.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: %struct_type.a.b.c.1 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %struct_type.a.b.c.1 = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %int_32.loc11_12: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc11_12: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %int_32.loc11_25: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc11_25: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %int_32.loc11_34: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc11_34: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %int_32.loc11_43: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc11_43: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %struct_type.a.b.c: type = struct_type {.a: %i32, .b: %i32, .c: %i32} [template = constants.%struct_type.a.b.c.1] +// CHECK:STDOUT: %n.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %n: %i32 = bind_name n, %n.param +// CHECK:STDOUT: %return.param: ref %struct_type.a.b.c.1 = out_param runtime_param1 +// CHECK:STDOUT: %return: ref %struct_type.a.b.c.1 = return_slot %return.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Make(%n.param_patt: %i32) -> %return.param_patt: %struct_type.a.b.c.1 { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %int_0.loc12_16: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] +// CHECK:STDOUT: %n.ref: %i32 = name_ref n, %n +// CHECK:STDOUT: %int_0.loc12_32: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] +// CHECK:STDOUT: %.loc12_33.1: %struct_type.a.b.c.2 = struct_literal (%int_0.loc12_16, %n.ref, %int_0.loc12_32) +// CHECK:STDOUT: %impl.elem0.loc12_33.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %Convert.bound.loc12_33.1: = bound_method %int_0.loc12_16, %impl.elem0.loc12_33.1 [template = constants.%Convert.bound] +// CHECK:STDOUT: %Convert.specific_fn.loc12_33.1: = specific_function %Convert.bound.loc12_33.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %int.convert_checked.loc12_33.1: init %i32 = call %Convert.specific_fn.loc12_33.1(%int_0.loc12_16) [template = constants.%int_0.2] +// CHECK:STDOUT: %.loc12_33.2: init %i32 = converted %int_0.loc12_16, %int.convert_checked.loc12_33.1 [template = constants.%int_0.2] +// CHECK:STDOUT: %.loc12_33.3: ref %i32 = struct_access %return, element0 +// CHECK:STDOUT: %.loc12_33.4: init %i32 = initialize_from %.loc12_33.2 to %.loc12_33.3 [template = constants.%int_0.2] +// CHECK:STDOUT: %.loc12_33.5: ref %i32 = struct_access %return, element1 +// CHECK:STDOUT: %.loc12_33.6: init %i32 = initialize_from %n.ref to %.loc12_33.5 +// CHECK:STDOUT: %impl.elem0.loc12_33.2: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %Convert.bound.loc12_33.2: = bound_method %int_0.loc12_32, %impl.elem0.loc12_33.2 [template = constants.%Convert.bound] +// CHECK:STDOUT: %Convert.specific_fn.loc12_33.2: = specific_function %Convert.bound.loc12_33.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %int.convert_checked.loc12_33.2: init %i32 = call %Convert.specific_fn.loc12_33.2(%int_0.loc12_32) [template = constants.%int_0.2] +// CHECK:STDOUT: %.loc12_33.7: init %i32 = converted %int_0.loc12_32, %int.convert_checked.loc12_33.2 [template = constants.%int_0.2] +// CHECK:STDOUT: %.loc12_33.8: ref %i32 = struct_access %return, element2 +// CHECK:STDOUT: %.loc12_33.9: init %i32 = initialize_from %.loc12_33.7 to %.loc12_33.8 [template = constants.%int_0.2] +// CHECK:STDOUT: %.loc12_33.10: init %struct_type.a.b.c.1 = struct_init (%.loc12_33.4, %.loc12_33.6, %.loc12_33.9) to %return +// CHECK:STDOUT: %.loc12_34: init %struct_type.a.b.c.1 = converted %.loc12_33.1, %.loc12_33.10 +// CHECK:STDOUT: return %.loc12_34 to %return +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/lower/handle_aggregates.cpp b/toolchain/lower/handle_aggregates.cpp index c74ae8eb77b57..f08da828a2e25 100644 --- a/toolchain/lower/handle_aggregates.cpp +++ b/toolchain/lower/handle_aggregates.cpp @@ -118,12 +118,37 @@ static auto EmitAggregateInitializer(FunctionContext& context, SemIR::InstBlockId refs_id, llvm::Twine name) -> llvm::Value* { auto* llvm_type = context.GetType(type_id); + auto refs = context.sem_ir().inst_blocks().Get(refs_id); switch (SemIR::InitRepr::ForType(context.sem_ir(), type_id).kind) { - case SemIR::InitRepr::None: - case SemIR::InitRepr::InPlace: + case SemIR::InitRepr::None: { // TODO: Add a helper to poison a value slot. return llvm::PoisonValue::get(llvm_type); + } + + case SemIR::InitRepr::InPlace: { + // Finish initialization of constant fields. We will have skipped this + // when emitting the initializers because they have constant values. + // + // TODO: This emits the initializers for constant fields after all + // initialization of non-constant fields. This may be observable in some + // ways such as under a debugger in a debug build. It would be preferable + // to initialize the constant portions of the aggregate first, but this + // will likely need a change to the SemIR representation. + // + // TODO: If most of the bytes of the result have known constant values, + // it'd be nice to emit a memcpy from a constant followed by the + // non-constant initialization. + for (auto [i, ref_id] : llvm::enumerate(refs)) { + if (context.sem_ir().constant_values().Get(ref_id).is_constant()) { + auto init = + context.sem_ir().insts().GetAs(ref_id); + HandleInst(context, ref_id, init); + } + } + // TODO: Add a helper to poison a value slot. + return llvm::PoisonValue::get(llvm_type); + } case SemIR::InitRepr::ByCopy: { auto refs = context.sem_ir().inst_blocks().Get(refs_id); diff --git a/toolchain/lower/testdata/return/return_var.carbon b/toolchain/lower/testdata/return/return_var.carbon index 2ad21521abbd0..d378245df7ecc 100644 --- a/toolchain/lower/testdata/return/return_var.carbon +++ b/toolchain/lower/testdata/return/return_var.carbon @@ -27,6 +27,7 @@ fn Make() -> C { // CHECK:STDOUT: %.loc18_30.3.data = getelementptr inbounds nuw { i32, ptr }, ptr %return, i32 0, i32 0, !dbg !7 // CHECK:STDOUT: %.loc18_30.5.next = getelementptr inbounds nuw { i32, ptr }, ptr %return, i32 0, i32 1, !dbg !7 // CHECK:STDOUT: store ptr %return, ptr %.loc18_30.5.next, align 8, !dbg !7 +// CHECK:STDOUT: store i32 42, ptr %.loc18_30.3.data, align 4, !dbg !7 // CHECK:STDOUT: ret void, !dbg !8 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/struct/partially_const.carbon b/toolchain/lower/testdata/struct/partially_const.carbon new file mode 100644 index 0000000000000..d6d5251bb172d --- /dev/null +++ b/toolchain/lower/testdata/struct/partially_const.carbon @@ -0,0 +1,40 @@ +// Part of the Carbon Language project, under the Apache License v2.0 with LLVM +// Exceptions. See /LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// AUTOUPDATE +// TIP: To test this file alone, run: +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/lower/testdata/struct/partially_const.carbon +// TIP: To dump output, run: +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/lower/testdata/struct/partially_const.carbon + +fn Make(n: i32) -> {.a: i32, .b: i32, .c: i32} { + return {.a = 0, .b = n, .c = 0}; +} + +// CHECK:STDOUT: ; ModuleID = 'partially_const.carbon' +// CHECK:STDOUT: source_filename = "partially_const.carbon" +// CHECK:STDOUT: +// CHECK:STDOUT: define void @_CMake.Main(ptr sret({ i32, i32, i32 }) %return, i32 %n) !dbg !4 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %.loc12_33.3.a = getelementptr inbounds nuw { i32, i32, i32 }, ptr %return, i32 0, i32 0, !dbg !7 +// CHECK:STDOUT: %.loc12_33.5.b = getelementptr inbounds nuw { i32, i32, i32 }, ptr %return, i32 0, i32 1, !dbg !7 +// CHECK:STDOUT: store i32 %n, ptr %.loc12_33.5.b, align 4, !dbg !7 +// CHECK:STDOUT: %.loc12_33.8.c = getelementptr inbounds nuw { i32, i32, i32 }, ptr %return, i32 0, i32 2, !dbg !7 +// CHECK:STDOUT: store i32 0, ptr %.loc12_33.3.a, align 4, !dbg !7 +// CHECK:STDOUT: store i32 0, ptr %.loc12_33.8.c, align 4, !dbg !7 +// CHECK:STDOUT: ret void, !dbg !8 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} +// CHECK:STDOUT: !llvm.dbg.cu = !{!2} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !3 = !DIFile(filename: "partially_const.carbon", directory: "") +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "Make", linkageName: "_CMake.Main", scope: null, file: !3, line: 11, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) +// CHECK:STDOUT: !6 = !{} +// CHECK:STDOUT: !7 = !DILocation(line: 12, column: 10, scope: !4) +// CHECK:STDOUT: !8 = !DILocation(line: 12, column: 3, scope: !4) From 0fa699641aee542d90b4c109235c7c3468ac5ddd Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Thu, 19 Dec 2024 09:18:19 -0800 Subject: [PATCH 57/68] Solution for advent of code day 2. (#4708) --- examples/advent2024/BUILD | 16 ++++ examples/advent2024/day2_common.carbon | 13 +++ examples/advent2024/day2_part1.carbon | 64 +++++++++++++ examples/advent2024/day2_part2.carbon | 124 +++++++++++++++++++++++++ examples/advent2024/io_utils.carbon | 24 ++--- 5 files changed, 229 insertions(+), 12 deletions(-) create mode 100644 examples/advent2024/day2_common.carbon create mode 100644 examples/advent2024/day2_part1.carbon create mode 100644 examples/advent2024/day2_part2.carbon diff --git a/examples/advent2024/BUILD b/examples/advent2024/BUILD index c38b1cb61929d..b1edc7021fa7a 100644 --- a/examples/advent2024/BUILD +++ b/examples/advent2024/BUILD @@ -24,3 +24,19 @@ carbon_binary( "day1_part2.carbon", ] + utils, ) + +carbon_binary( + name = "day2_part1", + srcs = [ + "day2_common.carbon", + "day2_part1.carbon", + ] + utils, +) + +carbon_binary( + name = "day2_part2", + srcs = [ + "day2_common.carbon", + "day2_part2.carbon", + ] + utils, +) diff --git a/examples/advent2024/day2_common.carbon b/examples/advent2024/day2_common.carbon new file mode 100644 index 0000000000000..89ff6d87c0eb8 --- /dev/null +++ b/examples/advent2024/day2_common.carbon @@ -0,0 +1,13 @@ +// Part of the Carbon Language project, under the Apache License v2.0 with LLVM +// Exceptions. See /LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +library "day2_common"; + +fn Abs(n: i32) -> i32 { + return if n < 0 then -n else n; +} + +fn IsSafeDelta(from: i32, to: i32) -> bool { + return from != to and Abs(from - to) <= 3; +} diff --git a/examples/advent2024/day2_part1.carbon b/examples/advent2024/day2_part1.carbon new file mode 100644 index 0000000000000..58591d25c0cb9 --- /dev/null +++ b/examples/advent2024/day2_part1.carbon @@ -0,0 +1,64 @@ +// Part of the Carbon Language project, under the Apache License v2.0 with LLVM +// Exceptions. See /LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +import Core library "io"; + +import library "day2_common"; +import library "io_utils"; + +class ReportState { + fn Make() -> ReportState { + return {.levels_so_far = 0, .previous = 0, + .increasing = false, .safe_so_far = true}; + } + + fn Add[addr self: Self*](level: i32) { + ++self->levels_so_far; + if (self->levels_so_far >= 2) { + if (not IsSafeDelta(self->previous, level)) { + // Difference is zero or too large. + self->safe_so_far = false; + } + + var is_increase: bool = level > self->previous; + if (self->levels_so_far == 2) { + self->increasing = is_increase; + } else if (is_increase != self->increasing) { + // Not monotone. + self->safe_so_far = false; + } + } + self->previous = level; + } + + var levels_so_far: i32; + var previous: i32; + var increasing: bool; + var safe_so_far: bool; +} + +fn ReadReport() -> ReportState { + returned var report: ReportState = ReportState.Make(); + var n: i32; + while (ReadInt(&n)) { + report.Add(n); + SkipSpaces(); + } + return var; +} + +fn Run() { + var safe_reports: i32 = 0; + while (true) { + var report: ReportState = ReadReport(); + if (report.levels_so_far == 0) { + break; + } + if (report.safe_so_far) { + ++safe_reports; + } + SkipNewline(); + } + Core.Print(safe_reports); +} diff --git a/examples/advent2024/day2_part2.carbon b/examples/advent2024/day2_part2.carbon new file mode 100644 index 0000000000000..bacacd37b346f --- /dev/null +++ b/examples/advent2024/day2_part2.carbon @@ -0,0 +1,124 @@ +// Part of the Carbon Language project, under the Apache License v2.0 with LLVM +// Exceptions. See /LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +import Core library "io"; + +import library "day2_common"; +import library "io_utils"; + +// A three-element sliding window of recent levels. +class Window { + fn Make() -> Window { return {.data = (0,0,0), .size = 0}; } + fn Add[addr self: Self*](n: i32) { + self->data[2] = self->data[1]; + self->data[1] = self->data[0]; + self->data[0] = n; + ++self->size; + } + + var data: [i32; 3]; + var size: i32; +} + +// Determines whether a transition from `from` to `to` is safe. +fn IsSafe(from: i32, to: i32, want_increase: bool) -> bool { + var is_increase: bool = to > from; + return IsSafeDelta(from, to) and is_increase == want_increase; +} + +class ReportState { + fn Make(increasing: bool) -> ReportState { + return {.increasing = increasing, .bad_edges = 0, + .removable_single_bad_edge = false, + .removable_double_bad_edge = false}; + } + + fn OnAdd[addr self: Self*](window: Window) { + if (window.size < 2) { + return; + } + + // We label the three most recent levels as `a b c`, with `c` the most + // recent. We might not have an `a`. + let b: i32 = window.data[1]; + let c: i32 = window.data[0]; + + // Keep a count of the unsafe edges. + let b_to_c: bool = IsSafe(window.data[1], window.data[0], self->increasing); + if (not b_to_c) { + ++self->bad_edges; + + // We have a removable single bad edge if the first edge is unsafe. + if (window.size == 2) { + self->removable_single_bad_edge = true; + } + } + + if (window.size >= 3) { + let a: i32 = window.data[2]; + if (IsSafe(a, c, self->increasing)) { + let lhs: bool = IsSafe(a, b, self->increasing); + let rhs: bool = b_to_c; + if (not lhs and not rhs) { + // If a->b and b->c are both unsafe, but a->c is safe, + // then we have a removable double bad edge. + self->removable_double_bad_edge = true; + } else if (not lhs or not rhs) { + // If a->b or b->c is unsafe but a->c is safe, then we have a + // removable single bad edge. + self->removable_single_bad_edge = true; + } + } + } + } + + fn OnFinish[addr self: Self*](window: Window) { + if (window.size >= 2 and + not IsSafe(window.data[1], window.data[0], self->increasing)) { + // We have a removable single bad edge if the last edge is unsafe. + self->removable_single_bad_edge = true; + } + } + + fn IsSafeWithRemoval[self: Self]() -> bool { + return self.bad_edges == 0 or + (self.bad_edges == 1 and self.removable_single_bad_edge) or + (self.bad_edges == 2 and self.removable_double_bad_edge); + } + + var increasing: bool; + var bad_edges: i32; + var removable_single_bad_edge: bool; + var removable_double_bad_edge: bool; +} + +fn ReadAndCheckReport() -> bool { + var window: Window = Window.Make(); + var increasing: ReportState = ReportState.Make(true); + var decreasing: ReportState = ReportState.Make(false); + var n: i32; + while (ReadInt(&n)) { + window.Add(n); + increasing.OnAdd(window); + decreasing.OnAdd(window); + SkipSpaces(); + } + increasing.OnFinish(window); + decreasing.OnFinish(window); + return window.size > 0 and + (increasing.IsSafeWithRemoval() or decreasing.IsSafeWithRemoval()); +} + +fn Run() { + var safe_reports: i32 = 0; + while (true) { + if (ReadAndCheckReport()) { + ++safe_reports; + } + if (not SkipNewline()) { + break; + } + } + Core.Print(safe_reports); +} diff --git a/examples/advent2024/io_utils.carbon b/examples/advent2024/io_utils.carbon index ce26cbcfe7e69..e8cfe371a9bed 100644 --- a/examples/advent2024/io_utils.carbon +++ b/examples/advent2024/io_utils.carbon @@ -6,24 +6,24 @@ library "io_utils"; import Core library "io"; -// TODO: Use Core.EOF() rather than 0 as a sentinel here. -// At the moment, 0 is the only value we can initialize a global to, -// so we store the value plus 1 here. -var push_back: i32 = 0; +// If non-zero, this is the most recently read character plus 2. +// The +2 is necessary to distinguish the case of no unread character +// from the case of unreading an EOF. +var unread_char: i32 = 0; fn ReadChar() -> i32 { - var next: i32 = push_back - 1; - push_back = 0; - // TODO: assert(push_back == Core.EOF()); - if (next == Core.EOF()) { - next = Core.ReadChar(); + if (unread_char != 0) { + var result: i32 = unread_char - 2; + unread_char = 0; + return result; } - return next; + + return Core.ReadChar(); } fn UnreadChar(c: i32) { - // TODO: assert(push_back == Core.EOF()); - push_back = c + 1; + // TODO: assert(unread_char == 0); + unread_char = c + 2; } fn ReadInt(p: i32*) -> bool { From a536dbd8d9ea8521489085cbafd19c4d9d58a2ed Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Thu, 19 Dec 2024 10:23:50 -0800 Subject: [PATCH 58/68] Solution for advent of code day 3. (#4713) --- examples/advent2024/BUILD | 16 +++++++++ examples/advent2024/day3_common.carbon | 45 ++++++++++++++++++++++++++ examples/advent2024/day3_part1.carbon | 24 ++++++++++++++ examples/advent2024/day3_part2.carbon | 31 ++++++++++++++++++ examples/advent2024/io_utils.carbon | 35 +++++++++++--------- 5 files changed, 135 insertions(+), 16 deletions(-) create mode 100644 examples/advent2024/day3_common.carbon create mode 100644 examples/advent2024/day3_part1.carbon create mode 100644 examples/advent2024/day3_part2.carbon diff --git a/examples/advent2024/BUILD b/examples/advent2024/BUILD index b1edc7021fa7a..6e709b9130428 100644 --- a/examples/advent2024/BUILD +++ b/examples/advent2024/BUILD @@ -40,3 +40,19 @@ carbon_binary( "day2_part2.carbon", ] + utils, ) + +carbon_binary( + name = "day3_part1", + srcs = [ + "day3_common.carbon", + "day3_part1.carbon", + ] + utils, +) + +carbon_binary( + name = "day3_part2", + srcs = [ + "day3_common.carbon", + "day3_part2.carbon", + ] + utils, +) diff --git a/examples/advent2024/day3_common.carbon b/examples/advent2024/day3_common.carbon new file mode 100644 index 0000000000000..9d54ba54137d4 --- /dev/null +++ b/examples/advent2024/day3_common.carbon @@ -0,0 +1,45 @@ +// Part of the Carbon Language project, under the Apache License v2.0 with LLVM +// Exceptions. See /LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +library "day3_common"; + +import library "io_utils"; + +// Reads "mul(a,b)", and returns (true, a, b). +// On error, stops before the first invalid character and returns (false, 0, 0). +// TODO: -> Optional((i32, i32)) +fn ReadMul() -> (bool, i32, i32) { + var a: i32; + var b: i32; + if (ConsumeChar(0x6D) and ConsumeChar(0x75) and ConsumeChar(0x6C) and + ConsumeChar(0x28) and ReadInt(&a) and ConsumeChar(0x2C) and + ReadInt(&b) and ConsumeChar(0x29)) { + return (true, a, b); + } + return (false, 0, 0); +} + +// Reads "do()" or "don't()", and returns (true, was_do). +// On error, stops before the first invalid character and returns (false, false). +fn ReadDoOrDont() -> (bool, bool) { + // "do" + if (not ConsumeChar(0x64) or not ConsumeChar(0x6F)) { + return (false, false); + } + + var do: bool = true; + // "n't" + if (ConsumeChar(0x6E)) { + if (not ConsumeChar(0x27) or not ConsumeChar(0x74)) { + return (false, false); + } + do = false; + } + + // "()" + if (not ConsumeChar(0x28) or not ConsumeChar(0x29)) { + return (false, false); + } + return (true, do); +} diff --git a/examples/advent2024/day3_part1.carbon b/examples/advent2024/day3_part1.carbon new file mode 100644 index 0000000000000..c6b9dda6188d1 --- /dev/null +++ b/examples/advent2024/day3_part1.carbon @@ -0,0 +1,24 @@ +// Part of the Carbon Language project, under the Apache License v2.0 with LLVM +// Exceptions. See /LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +import Core library "io"; + +import library "day3_common"; +import library "io_utils"; + +fn Run() { + var total: i32 = 0; + while (PeekChar() != Core.EOF()) { + if (PeekChar() == 0x6D) { + // TODO: Use `if let` when available. + let result: (bool, i32, i32) = ReadMul(); + if (result.0) { + total += result.1 * result.2; + } + } else { + ReadChar(); + } + } + Core.Print(total); +} diff --git a/examples/advent2024/day3_part2.carbon b/examples/advent2024/day3_part2.carbon new file mode 100644 index 0000000000000..fd837667d1e9a --- /dev/null +++ b/examples/advent2024/day3_part2.carbon @@ -0,0 +1,31 @@ +// Part of the Carbon Language project, under the Apache License v2.0 with LLVM +// Exceptions. See /LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +import Core library "io"; + +import library "day3_common"; +import library "io_utils"; + +fn Run() { + var total: i32 = 0; + var enabled: bool = true; + while (PeekChar() != Core.EOF()) { + if (PeekChar() == 0x6D) { + // TODO: Use `if let` when available. + let result: (bool, i32, i32) = ReadMul(); + if (result.0 and enabled) { + total += result.1 * result.2; + } + } else if (PeekChar() == 0x64) { + // TODO: Use `if let` when available. + let result: (bool, bool) = ReadDoOrDont(); + if (result.0) { + enabled = result.1; + } + } else { + ReadChar(); + } + } + Core.Print(total); +} diff --git a/examples/advent2024/io_utils.carbon b/examples/advent2024/io_utils.carbon index e8cfe371a9bed..0a84d10aa8727 100644 --- a/examples/advent2024/io_utils.carbon +++ b/examples/advent2024/io_utils.carbon @@ -44,30 +44,33 @@ fn ReadInt(p: i32*) -> bool { return read_any_digits; } +fn PeekChar() -> i32 { + var next: i32 = ReadChar(); + UnreadChar(next); + return next; +} + +fn ConsumeChar(c: i32) -> bool { + var next: i32 = ReadChar(); + if (next != c) { + UnreadChar(next); + return false; + } + return true; +} + fn SkipSpaces() -> bool { var skipped_any_spaces: bool = false; - while (true) { - var c: i32 = ReadChar(); - if (c != 0x20) { - UnreadChar(c); - break; - } + while (ConsumeChar(0x20)) { skipped_any_spaces = true; } return skipped_any_spaces; } fn SkipNewline() -> bool { - var c: i32 = ReadChar(); // Optional carriage return. - if (c == 0x0D) { - c = ReadChar(); - } + ConsumeChar(0x0D); // Newline. - if (c == 0x0A) { - return true; - } - // TODO: Unread the CR? - UnreadChar(c); - return false; + // TODO: Unread the CR if it was present? + return ConsumeChar(0x0A); } From 95c9634c6017bc89278fce65f4df9c79d1392188 Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Thu, 19 Dec 2024 10:53:21 -0800 Subject: [PATCH 59/68] Enable libc++ and LLVM pretty printers for gdb (#4715) --- .gdbinit | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gdbinit b/.gdbinit index e2db36d73962d..f6df74bf4b231 100644 --- a/.gdbinit +++ b/.gdbinit @@ -2,5 +2,6 @@ # Exceptions. See /LICENSE for license information. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -source third_party/llvm-project/libcxx/utils/gdb/libcxx/printers.py +source external/_main~llvm_project~llvm-project/llvm/utils/gdb-scripts/prettyprinters.py +source external/_main~llvm_project~llvm-project/libcxx/utils/gdb/libcxx/printers.py python register_libcxx_printer_loader() From a112cbde5cd47ee4215fb526fb7a422d0185d240 Mon Sep 17 00:00:00 2001 From: Geoff Romer Date: Thu, 19 Dec 2024 13:41:06 -0800 Subject: [PATCH 60/68] Model type expressions as regions (#4698) This is a precondition for enabling the new pattern-matching subsystem to support binding patterns that have `if` expressions in the type position. --------- Co-authored-by: Richard Smith --- toolchain/check/context.cpp | 96 +++- toolchain/check/context.h | 88 +++- toolchain/check/handle_binding_pattern.cpp | 13 +- toolchain/check/handle_function.cpp | 6 +- toolchain/check/handle_if_expr.cpp | 10 +- toolchain/check/handle_if_statement.cpp | 6 +- toolchain/check/handle_let_and_var.cpp | 1 + toolchain/check/handle_loop_statement.cpp | 6 +- toolchain/check/handle_operator.cpp | 9 +- toolchain/check/handle_pattern_list.cpp | 20 +- toolchain/check/pattern_match.cpp | 9 +- .../testdata/alias/fail_bool_value.carbon | 5 - .../testdata/alias/fail_control_flow.carbon | 8 +- .../alias/no_prelude/alias_of_alias.carbon | 1 - .../alias/no_prelude/export_name.carbon | 5 - .../fail_aliased_name_in_diag.carbon | 2 - .../no_prelude/fail_name_conflict.carbon | 2 - .../alias/no_prelude/fail_not_constant.carbon | 5 - .../testdata/alias/no_prelude/import.carbon | 16 +- .../alias/no_prelude/import_access.carbon | 4 - .../alias/no_prelude/import_order.carbon | 10 +- .../alias/no_prelude/in_namespace.carbon | 8 +- .../testdata/alias/no_prelude/local.carbon | 2 - .../testdata/array/array_in_place.carbon | 10 - .../testdata/array/array_vs_tuple.carbon | 23 +- .../testdata/array/assign_return_value.carbon | 4 - .../check/testdata/array/assign_var.carbon | 13 - toolchain/check/testdata/array/base.carbon | 17 - .../testdata/array/canonicalize_index.carbon | 83 +--- .../testdata/array/fail_bound_negative.carbon | 42 +- .../testdata/array/fail_bound_overflow.carbon | 12 - .../array/fail_incomplete_element.carbon | 7 - .../testdata/array/fail_invalid_type.carbon | 5 - .../testdata/array/fail_out_of_bound.carbon | 4 - .../fail_out_of_bound_non_literal.carbon | 6 - .../testdata/array/fail_type_mismatch.carbon | 28 -- .../testdata/array/function_param.carbon | 16 +- .../check/testdata/array/generic_empty.carbon | 17 +- toolchain/check/testdata/array/import.carbon | 6 +- .../testdata/array/index_not_literal.carbon | 6 - .../check/testdata/array/nine_elements.carbon | 4 - .../testdata/as/adapter_conversion.carbon | 23 - .../testdata/as/fail_no_conversion.carbon | 6 - .../check/testdata/as/fail_not_type.carbon | 2 - toolchain/check/testdata/as/identity.carbon | 18 +- .../check/testdata/as/no_prelude/tuple.carbon | 8 - toolchain/check/testdata/as/overloaded.carbon | 12 +- .../testdata/basics/builtin_types.carbon | 9 - .../testdata/basics/fail_bad_run_2.carbon | 6 +- .../fail_numeric_literal_overflow.carbon | 17 - .../multifile_raw_and_textual_ir.carbon | 14 +- .../basics/no_prelude/multifile_raw_ir.carbon | 14 +- .../no_prelude/raw_and_textual_ir.carbon | 160 +++---- .../basics/no_prelude/raw_identifier.carbon | 18 +- .../testdata/basics/no_prelude/raw_ir.carbon | 65 +-- .../basics/no_prelude/textual_ir.carbon | 6 +- .../testdata/basics/numeric_literals.carbon | 13 - toolchain/check/testdata/basics/parens.carbon | 4 - .../testdata/basics/type_literals.carbon | 12 - .../check/testdata/builtins/bool/eq.carbon | 108 +---- .../testdata/builtins/bool/make_type.carbon | 4 - .../check/testdata/builtins/bool/neq.carbon | 108 +---- .../check/testdata/builtins/float/add.carbon | 184 ++++---- .../check/testdata/builtins/float/div.carbon | 192 ++++---- .../check/testdata/builtins/float/eq.carbon | 64 +-- .../testdata/builtins/float/greater.carbon | 54 ++- .../testdata/builtins/float/greater_eq.carbon | 54 ++- .../check/testdata/builtins/float/less.carbon | 54 ++- .../testdata/builtins/float/less_eq.carbon | 54 ++- .../testdata/builtins/float/make_type.carbon | 53 +-- .../check/testdata/builtins/float/mul.carbon | 184 ++++---- .../testdata/builtins/float/negate.carbon | 134 +++--- .../check/testdata/builtins/float/neq.carbon | 64 +-- .../check/testdata/builtins/float/sub.carbon | 184 ++++---- .../check/testdata/builtins/int/and.carbon | 75 +--- .../testdata/builtins/int/complement.carbon | 80 +--- .../builtins/int/convert_checked.carbon | 224 ++++------ .../check/testdata/builtins/int/eq.carbon | 40 +- .../testdata/builtins/int/greater.carbon | 34 +- .../testdata/builtins/int/greater_eq.carbon | 34 +- .../testdata/builtins/int/left_shift.carbon | 109 ++--- .../check/testdata/builtins/int/less.carbon | 34 +- .../testdata/builtins/int/less_eq.carbon | 34 +- .../builtins/int/make_type_signed.carbon | 147 +++--- .../builtins/int/make_type_unsigned.carbon | 111 ++--- .../check/testdata/builtins/int/neq.carbon | 28 +- .../check/testdata/builtins/int/or.carbon | 75 +--- .../testdata/builtins/int/right_shift.carbon | 226 ++-------- .../check/testdata/builtins/int/sadd.carbon | 252 ++++------- .../check/testdata/builtins/int/sdiv.carbon | 127 ++---- .../check/testdata/builtins/int/smod.carbon | 127 ++---- .../check/testdata/builtins/int/smul.carbon | 91 +--- .../testdata/builtins/int/snegate.carbon | 192 +++----- .../check/testdata/builtins/int/ssub.carbon | 93 +--- .../check/testdata/builtins/int/uadd.carbon | 252 ++++------- .../check/testdata/builtins/int/udiv.carbon | 127 ++---- .../check/testdata/builtins/int/umod.carbon | 127 ++---- .../check/testdata/builtins/int/umul.carbon | 91 +--- .../testdata/builtins/int/unegate.carbon | 192 +++----- .../check/testdata/builtins/int/usub.carbon | 93 +--- .../check/testdata/builtins/int/xor.carbon | 75 +--- .../builtins/int_literal/make_type.carbon | 4 - .../check/testdata/builtins/print/char.carbon | 6 +- .../check/testdata/builtins/print/int.carbon | 6 +- .../check/testdata/builtins/read/int.carbon | 4 - .../testdata/class/access_modifers.carbon | 31 +- .../check/testdata/class/adapter/adapt.carbon | 6 +- .../testdata/class/adapter/adapt_copy.carbon | 29 +- .../class/adapter/extend_adapt.carbon | 38 +- .../class/adapter/fail_adapt_bad_decl.carbon | 4 +- .../adapter/fail_adapt_with_subobjects.carbon | 22 +- .../testdata/class/adapter/init_adapt.carbon | 18 - toolchain/check/testdata/class/base.carbon | 8 +- .../check/testdata/class/base_field.carbon | 16 +- .../check/testdata/class/base_method.carbon | 24 +- .../class/base_method_qualified.carbon | 24 +- .../testdata/class/base_method_shadow.carbon | 48 +- toolchain/check/testdata/class/basic.carbon | 20 +- .../class/complete_in_member_fn.carbon | 4 +- .../testdata/class/compound_field.carbon | 26 +- .../class/cross_package_import.carbon | 13 - .../testdata/class/derived_to_base.carbon | 34 +- .../check/testdata/class/fail_abstract.carbon | 22 +- .../testdata/class/fail_addr_not_self.carbon | 12 +- .../testdata/class/fail_addr_self.carbon | 18 +- .../testdata/class/fail_base_bad_type.carbon | 96 ++-- .../testdata/class/fail_base_misplaced.carbon | 4 +- .../testdata/class/fail_base_unbound.carbon | 1 - .../class/fail_compound_type_mismatch.carbon | 6 +- .../class/fail_convert_to_invalid.carbon | 1 - .../class/fail_derived_to_base.carbon | 22 +- .../testdata/class/fail_extend_cycle.carbon | 1 - .../class/fail_field_modifiers.carbon | 8 - .../testdata/class/fail_generic_method.carbon | 19 +- .../testdata/class/fail_import_misuses.carbon | 1 - .../testdata/class/fail_incomplete.carbon | 49 +- .../check/testdata/class/fail_init.carbon | 4 - .../class/fail_init_as_inplace.carbon | 13 +- .../class/fail_memaccess_category.carbon | 17 +- .../check/testdata/class/fail_method.carbon | 4 +- .../class/fail_method_modifiers.carbon | 10 +- .../class/fail_method_redefinition.carbon | 3 - .../testdata/class/fail_redefinition.carbon | 3 - .../check/testdata/class/fail_self.carbon | 9 +- .../testdata/class/fail_self_param.carbon | 5 +- .../class/fail_self_type_member.carbon | 13 +- .../class/fail_todo_local_class.carbon | 4 +- .../testdata/class/fail_unbound_field.carbon | 2 - .../testdata/class/fail_unknown_member.carbon | 4 +- .../check/testdata/class/field_access.carbon | 9 - .../class/field_access_in_value.carbon | 10 - .../testdata/class/forward_declared.carbon | 6 +- .../check/testdata/class/generic/adapt.carbon | 41 +- .../class/generic/base_is_generic.carbon | 19 +- .../check/testdata/class/generic/basic.carbon | 15 +- .../check/testdata/class/generic/call.carbon | 79 +--- .../generic/complete_in_conversion.carbon | 73 ++- .../check/testdata/class/generic/field.carbon | 27 +- .../testdata/class/generic/import.carbon | 25 +- .../check/testdata/class/generic/init.carbon | 40 +- .../class/generic/member_access.carbon | 47 +- .../class/generic/member_inline.carbon | 17 +- .../class/generic/member_lookup.carbon | 60 +-- .../class/generic/member_out_of_line.carbon | 43 +- .../class/generic/method_deduce.carbon | 18 +- .../testdata/class/generic/redeclare.carbon | 20 +- .../check/testdata/class/generic/self.carbon | 25 +- .../testdata/class/generic/stringify.carbon | 80 +--- .../testdata/class/generic_method.carbon | 17 +- toolchain/check/testdata/class/import.carbon | 19 +- .../check/testdata/class/import_base.carbon | 9 +- .../testdata/class/import_indirect.carbon | 38 +- .../testdata/class/import_member_cycle.carbon | 4 - .../testdata/class/import_struct_cyle.carbon | 6 - .../testdata/class/inheritance_access.carbon | 31 +- toolchain/check/testdata/class/init.carbon | 28 +- toolchain/check/testdata/class/init_as.carbon | 4 - .../check/testdata/class/init_nested.carbon | 6 - toolchain/check/testdata/class/method.carbon | 31 +- toolchain/check/testdata/class/nested.carbon | 27 +- .../check/testdata/class/nested_name.carbon | 12 +- .../class/no_prelude/export_name.carbon | 1 - .../class/no_prelude/generic_vs_params.carbon | 18 - .../class/no_prelude/import_access.carbon | 28 +- .../no_prelude/indirect_import_member.carbon | 10 - .../class/no_prelude/syntactic_merge.carbon | 82 ++-- .../check/testdata/class/raw_self.carbon | 46 +- .../check/testdata/class/raw_self_type.carbon | 16 +- .../check/testdata/class/redeclaration.carbon | 20 +- .../testdata/class/reorder_qualified.carbon | 12 - toolchain/check/testdata/class/scope.carbon | 4 - toolchain/check/testdata/class/self.carbon | 24 +- .../testdata/class/self_conversion.carbon | 28 +- .../check/testdata/class/self_type.carbon | 9 +- .../check/testdata/class/static_method.carbon | 1 - .../class/syntactic_merge_literal.carbon | 92 ++-- .../class/todo_access_modifiers.carbon | 4 - .../testdata/class/virtual_modifiers.carbon | 11 - toolchain/check/testdata/const/basic.carbon | 22 +- .../check/testdata/const/collapse.carbon | 12 +- .../check/testdata/const/fail_collapse.carbon | 14 +- toolchain/check/testdata/const/import.carbon | 15 - toolchain/check/testdata/deduce/array.carbon | 117 ++--- .../check/testdata/deduce/generic_type.carbon | 96 ++-- .../check/testdata/deduce/int_float.carbon | 64 +-- toolchain/check/testdata/deduce/tuple.carbon | 122 ++--- .../testdata/deduce/type_operator.carbon | 68 +-- .../check/testdata/eval/aggregate.carbon | 21 - .../check/testdata/eval/fail_aggregate.carbon | 4 - .../check/testdata/eval/fail_symbolic.carbon | 24 +- toolchain/check/testdata/eval/symbolic.carbon | 34 +- .../expr_category/in_place_tuple_init.carbon | 10 +- .../testdata/function/builtin/call.carbon | 58 +-- .../function/builtin/definition.carbon | 12 +- .../function/builtin/fail_redefined.carbon | 72 ++- .../testdata/function/builtin/method.carbon | 84 +--- .../builtin/no_prelude/adapted_type.carbon | 13 +- .../no_prelude/call_from_operator.carbon | 103 ++--- .../function/builtin/no_prelude/import.carbon | 85 ++-- .../function/call/fail_not_callable.carbon | 2 - .../function/call/fail_param_count.carbon | 18 +- .../function/call/fail_param_type.carbon | 6 +- .../call/fail_return_type_mismatch.carbon | 2 - .../check/testdata/function/call/i32.carbon | 8 +- .../function/call/more_param_ir.carbon | 17 +- .../function/call/no_prelude/alias.carbon | 2 - .../call/no_prelude/empty_struct.carbon | 6 +- .../call/no_prelude/empty_tuple.carbon | 6 +- .../fail_explicit_self_param.carbon | 6 +- .../fail_runtime_implicit_param.carbon | 5 +- .../call/no_prelude/return_implicit.carbon | 2 - .../testdata/function/call/params_one.carbon | 6 +- .../function/call/params_one_comma.carbon | 6 +- .../testdata/function/call/params_two.carbon | 12 +- .../function/call/params_two_comma.carbon | 12 +- .../declaration/fail_param_in_type.carbon | 16 +- .../declaration/fail_param_redecl.carbon | 12 +- .../function/declaration/import.carbon | 119 ++--- .../declaration/no_prelude/export_name.carbon | 2 - .../declaration/no_prelude/extern.carbon | 4 +- .../declaration/no_prelude/fail_redecl.carbon | 21 +- .../no_prelude/fail_todo_no_params.carbon | 2 - .../no_prelude/name_poisoning.carbon | 23 +- .../declaration/param_same_name.carbon | 12 +- .../function/definition/import.carbon | 29 +- .../function/definition/import_access.carbon | 18 - .../definition/no_prelude/basics.carbon | 2 +- .../fail_decl_param_mismatch.carbon | 18 +- .../definition/no_prelude/fail_redef.carbon | 3 - .../no_prelude/syntactic_merge.carbon | 58 +-- .../function/definition/params_one.carbon | 6 +- .../definition/params_one_comma.carbon | 6 +- .../function/definition/params_two.carbon | 12 +- .../definition/params_two_comma.carbon | 12 +- .../testdata/function/generic/deduce.carbon | 82 ++-- .../generic/fail_todo_param_in_type.carbon | 30 +- .../function/generic/no_prelude/call.carbon | 24 +- .../fail_type_param_mismatch.carbon | 15 +- .../no_prelude/indirect_generic_type.carbon | 8 +- .../generic/no_prelude/type_param.carbon | 15 +- .../no_prelude/type_param_scope.carbon | 3 +- .../function/generic/resolve_used.carbon | 29 +- .../function/generic/return_slot.carbon | 15 +- .../function/generic/undefined.carbon | 8 +- .../testdata/generic/complete_type.carbon | 11 +- .../check/testdata/global/class_obj.carbon | 1 - .../testdata/global/class_with_fun.carbon | 1 - toolchain/check/testdata/global/decl.carbon | 2 - .../check/testdata/global/simple_init.carbon | 2 - .../testdata/global/simple_with_fun.carbon | 2 - toolchain/check/testdata/if/else.carbon | 8 +- .../if/fail_reachable_fallthrough.carbon | 24 +- toolchain/check/testdata/if/fail_scope.carbon | 14 +- toolchain/check/testdata/if/no_else.carbon | 8 +- .../if/unreachable_fallthrough.carbon | 8 +- toolchain/check/testdata/if_expr/basic.carbon | 24 +- .../if_expr/constant_condition.carbon | 77 +--- .../testdata/if_expr/control_flow.carbon | 8 +- .../if_expr/fail_not_in_function.carbon | 64 ++- .../if_expr/fail_partial_constant.carbon | 57 +-- .../check/testdata/if_expr/nested.carbon | 24 +- .../check/testdata/if_expr/struct.carbon | 25 +- toolchain/check/testdata/impl/compound.carbon | 42 +- .../check/testdata/impl/extend_impl.carbon | 2 +- .../testdata/impl/extend_impl_generic.carbon | 28 +- .../testdata/impl/fail_call_invalid.carbon | 16 +- .../impl/fail_extend_impl_forall.carbon | 4 +- .../fail_extend_undefined_interface.carbon | 2 +- .../impl/fail_impl_bad_assoc_fn.carbon | 174 +++++--- .../impl/fail_self_type_mismatch.carbon | 20 +- toolchain/check/testdata/impl/impl_as.carbon | 1 - .../check/testdata/impl/lookup/alias.carbon | 2 +- .../lookup/fail_alias_impl_not_found.carbon | 2 +- .../check/testdata/impl/lookup/generic.carbon | 46 +- .../impl/lookup/instance_method.carbon | 12 +- .../impl/lookup/no_prelude/impl_forall.carbon | 31 +- .../impl/lookup/no_prelude/import.carbon | 51 +-- .../lookup/no_prelude/specific_args.carbon | 14 +- .../testdata/impl/multiple_extend.carbon | 10 +- .../no_prelude/generic_redeclaration.carbon | 20 +- .../no_prelude/import_builtin_call.carbon | 148 ++++--- .../impl/no_prelude/import_extend_impl.carbon | 2 +- .../impl/no_prelude/import_self.carbon | 32 +- .../impl/no_prelude/import_use_generic.carbon | 4 - .../impl/no_prelude/interface_args.carbon | 10 +- .../impl/no_prelude/self_in_signature.carbon | 86 ++-- .../index/array_element_access.carbon | 10 - .../check/testdata/index/expr_category.carbon | 55 +-- .../index/fail_array_large_index.carbon | 8 - .../index/fail_array_non_int_indexing.carbon | 6 - .../fail_array_out_of_bound_access.carbon | 6 - .../testdata/index/fail_expr_category.carbon | 24 +- .../testdata/index/fail_invalid_base.carbon | 8 - .../testdata/index/fail_name_not_found.carbon | 2 - .../index/fail_negative_indexing.carbon | 6 - .../testdata/interface/assoc_const.carbon | 2 - .../fail_todo_assoc_const_default.carbon | 2 - .../fail_todo_define_default_fn_inline.carbon | 12 +- ..._todo_define_default_fn_out_of_line.carbon | 40 +- .../testdata/interface/member_lookup.carbon | 38 +- .../interface/no_prelude/as_type.carbon | 2 +- .../no_prelude/as_type_of_type.carbon | 13 +- .../interface/no_prelude/default_fn.carbon | 1 - .../interface/no_prelude/export_name.carbon | 2 +- .../fail_assoc_const_not_constant.carbon | 2 - .../no_prelude/fail_duplicate.carbon | 8 +- .../fail_generic_redeclaration.carbon | 6 +- .../fail_lookup_in_type_type.carbon | 8 - .../no_prelude/fail_member_lookup.carbon | 7 +- .../no_prelude/fail_modifiers.carbon | 16 +- .../no_prelude/fail_todo_facet_lookup.carbon | 12 +- .../fail_todo_generic_default_fn.carbon | 20 +- .../interface/no_prelude/generic.carbon | 34 +- .../interface/no_prelude/import.carbon | 10 +- .../interface/no_prelude/import_access.carbon | 38 +- .../testdata/interface/no_prelude/self.carbon | 8 +- .../no_prelude/syntactic_merge.carbon | 58 +-- .../interface/todo_define_not_default.carbon | 14 +- .../ir/duplicate_name_same_line.carbon | 4 - .../testdata/let/compile_time_bindings.carbon | 72 +-- toolchain/check/testdata/let/convert.carbon | 21 +- .../testdata/let/fail_duplicate_decl.carbon | 4 - .../check/testdata/let/fail_generic.carbon | 7 +- .../testdata/let/fail_generic_import.carbon | 1 - .../testdata/let/fail_missing_value.carbon | 4 - .../check/testdata/let/fail_modifiers.carbon | 16 - .../testdata/let/fail_use_in_init.carbon | 2 - toolchain/check/testdata/let/generic.carbon | 3 - .../check/testdata/let/generic_import.carbon | 3 - toolchain/check/testdata/let/global.carbon | 2 - toolchain/check/testdata/let/local.carbon | 8 +- .../testdata/let/no_prelude/import.carbon | 8 - .../let/no_prelude/import_access.carbon | 8 - .../check/testdata/let/shadowed_decl.carbon | 8 +- .../testdata/namespace/add_to_import.carbon | 2 - .../testdata/namespace/fail_duplicate.carbon | 3 - .../testdata/namespace/fail_params.carbon | 8 +- .../check/testdata/namespace/imported.carbon | 8 - .../namespace/imported_indirect.carbon | 2 - .../merging_with_indirections.carbon | 10 - .../check/testdata/namespace/shadow.carbon | 6 +- .../testdata/operators/builtin/and.carbon | 137 +----- .../operators/builtin/assignment.carbon | 17 - .../fail_and_or_not_in_function.carbon | 98 +++- .../fail_and_or_partial_constant.carbon | 124 +----- .../fail_assignment_to_non_assignable.carbon | 4 - .../fail_redundant_compound_access.carbon | 2 - .../builtin/fail_type_mismatch.carbon | 5 - .../fail_type_mismatch_assignment.carbon | 2 - .../testdata/operators/builtin/or.carbon | 155 +------ .../operators/builtin/unary_op.carbon | 52 +-- .../testdata/operators/overloaded/add.carbon | 26 +- .../operators/overloaded/bit_and.carbon | 26 +- .../overloaded/bit_complement.carbon | 4 +- .../operators/overloaded/bit_or.carbon | 26 +- .../operators/overloaded/bit_xor.carbon | 26 +- .../testdata/operators/overloaded/dec.carbon | 9 +- .../testdata/operators/overloaded/div.carbon | 26 +- .../testdata/operators/overloaded/eq.carbon | 40 +- .../overloaded/fail_assign_non_ref.carbon | 24 +- .../operators/overloaded/fail_no_impl.carbon | 9 +- .../overloaded/fail_no_impl_for_arg.carbon | 21 +- .../operators/overloaded/implicit_as.carbon | 18 +- .../testdata/operators/overloaded/inc.carbon | 9 +- .../operators/overloaded/index.carbon | 32 +- .../operators/overloaded/left_shift.carbon | 26 +- .../testdata/operators/overloaded/mod.carbon | 26 +- .../testdata/operators/overloaded/mul.carbon | 26 +- .../operators/overloaded/negate.carbon | 4 +- .../overloaded/no_prelude/index.carbon | 20 +- .../operators/overloaded/ordered.carbon | 48 +- .../operators/overloaded/right_shift.carbon | 26 +- .../testdata/operators/overloaded/sub.carbon | 26 +- .../package_expr/fail_not_found.carbon | 2 - .../check/testdata/package_expr/syntax.carbon | 10 - .../fail_conflict_no_namespaces.carbon | 2 - .../packages/fail_import_type_error.carbon | 15 - .../fail_name_with_import_failure.carbon | 2 - .../packages/implicit_imports_prelude.carbon | 4 - .../testdata/packages/loaded_global.carbon | 8 - .../no_prelude/cross_package_export.carbon | 27 +- .../no_prelude/cross_package_import.carbon | 6 +- .../packages/no_prelude/export_import.carbon | 16 +- .../packages/no_prelude/export_mixed.carbon | 19 +- .../packages/no_prelude/export_name.carbon | 33 +- .../no_prelude/fail_export_name_member.carbon | 6 +- .../implicit_imports_entities.carbon | 15 - .../no_prelude/missing_prelude.carbon | 20 +- .../testdata/pointer/address_of_deref.carbon | 6 +- .../testdata/pointer/address_of_lvalue.carbon | 30 -- toolchain/check/testdata/pointer/arrow.carbon | 10 +- toolchain/check/testdata/pointer/basic.carbon | 9 +- .../pointer/fail_address_of_value.carbon | 9 +- .../testdata/pointer/fail_deref_error.carbon | 4 - .../pointer/fail_deref_not_pointer.carbon | 6 +- .../testdata/pointer/fail_deref_type.carbon | 9 - .../pointer/fail_type_mismatch.carbon | 10 +- .../check/testdata/pointer/import.carbon | 8 - .../testdata/pointer/nested_const.carbon | 16 +- toolchain/check/testdata/pointer/types.carbon | 18 +- .../return/code_after_return_value.carbon | 8 +- .../fail_return_with_returned_var.carbon | 13 +- .../fail_returned_var_no_return_type.carbon | 6 +- .../return/fail_returned_var_shadow.carbon | 16 +- .../return/fail_returned_var_type.carbon | 7 - .../no_prelude/import_convert_function.carbon | 74 ++-- .../check/testdata/return/returned_var.carbon | 13 +- .../testdata/return/returned_var_scope.carbon | 24 +- .../testdata/struct/fail_assign_empty.carbon | 3 - .../struct/fail_assign_to_empty.carbon | 2 - .../struct/fail_duplicate_name.carbon | 14 - .../struct/fail_field_name_mismatch.carbon | 6 - .../struct/fail_field_type_mismatch.carbon | 3 - .../struct/fail_member_access_type.carbon | 10 - .../struct/fail_non_member_access.carbon | 5 - .../struct/fail_too_few_values.carbon | 5 - .../testdata/struct/fail_type_assign.carbon | 3 - .../testdata/struct/fail_value_as_type.carbon | 5 - toolchain/check/testdata/struct/import.carbon | 113 +---- .../testdata/struct/member_access.carbon | 14 - .../struct/nested_struct_in_place.carbon | 17 - .../testdata/struct/no_prelude/empty.carbon | 4 - .../no_prelude/fail_assign_nested.carbon | 3 - .../no_prelude/fail_nested_incomplete.carbon | 5 - .../check/testdata/struct/one_entry.carbon | 6 - .../testdata/struct/partially_const.carbon | 6 +- .../testdata/struct/reorder_fields.carbon | 28 +- .../testdata/struct/tuple_as_element.carbon | 15 - .../check/testdata/struct/two_entries.carbon | 20 - .../tuple/access/element_access.carbon | 11 - .../tuple/access/fail_access_error.carbon | 9 - .../tuple/access/fail_large_index.carbon | 13 - .../access/fail_negative_indexing.carbon | 9 - .../access/fail_non_deterministic_type.carbon | 11 - .../tuple/access/fail_non_int_indexing.carbon | 9 - .../tuple/access/fail_non_tuple_access.carbon | 6 - .../access/fail_out_of_bound_access.carbon | 9 - .../fail_out_of_bound_not_literal.carbon | 9 - .../tuple/access/index_not_literal.carbon | 17 - .../testdata/tuple/fail_assign_nested.carbon | 16 - .../tuple/fail_element_type_mismatch.carbon | 7 - .../tuple/fail_nested_incomplete.carbon | 11 - .../tuple/fail_too_few_element.carbon | 7 - .../testdata/tuple/fail_type_assign.carbon | 4 - .../testdata/tuple/fail_value_as_type.carbon | 5 - toolchain/check/testdata/tuple/import.carbon | 136 +----- .../check/testdata/tuple/nested_tuple.carbon | 12 - .../tuple/nested_tuple_in_place.carbon | 34 -- .../testdata/tuple/no_prelude/empty.carbon | 4 - .../tuple/no_prelude/fail_assign_empty.carbon | 4 - .../no_prelude/fail_assign_to_empty.carbon | 2 - .../check/testdata/tuple/one_element.carbon | 9 - .../check/testdata/tuple/two_elements.carbon | 25 -- .../testdata/var/fail_not_copyable.carbon | 3 +- .../var/fail_storage_is_literal.carbon | 4 +- .../var/fail_todo_control_flow_init.carbon | 40 +- .../check/testdata/var/no_prelude/decl.carbon | 2 - .../var/no_prelude/decl_with_init.carbon | 2 - .../var/no_prelude/export_name.carbon | 4 - .../var/no_prelude/fail_duplicate_decl.carbon | 4 - .../var/no_prelude/fail_generic.carbon | 2 - .../no_prelude/fail_init_type_mismatch.carbon | 2 - .../var/no_prelude/fail_init_with_self.carbon | 2 - .../fail_lookup_outside_scope.carbon | 4 - .../var/no_prelude/fail_modifiers.carbon | 8 - .../no_prelude/fail_namespace_conflict.carbon | 4 - .../var/no_prelude/global_decl.carbon | 3 - .../no_prelude/global_decl_with_init.carbon | 3 - .../var/no_prelude/global_lookup.carbon | 6 - .../no_prelude/global_lookup_in_scope.carbon | 6 - .../testdata/var/no_prelude/import.carbon | 4 - .../var/no_prelude/import_access.carbon | 8 - .../testdata/var/no_prelude/lookup.carbon | 2 - .../testdata/var/no_prelude/shadowing.carbon | 6 - .../testdata/where_expr/constraints.carbon | 158 ++++--- .../testdata/where_expr/designator.carbon | 72 +-- .../testdata/where_expr/dot_self_index.carbon | 64 +-- .../testdata/where_expr/equal_rewrite.carbon | 418 ++++++++---------- .../testdata/where_expr/fail_not_facet.carbon | 43 +- .../testdata/where_expr/non_generic.carbon | 24 +- toolchain/sem_ir/file.h | 26 ++ toolchain/sem_ir/id_kind.h | 2 +- toolchain/sem_ir/ids.h | 15 + toolchain/sem_ir/yaml_test.cpp | 4 +- 504 files changed, 5699 insertions(+), 8719 deletions(-) diff --git a/toolchain/check/context.cpp b/toolchain/check/context.cpp index 03d70ad8df1d0..a0d7d9bd744e1 100644 --- a/toolchain/check/context.cpp +++ b/toolchain/check/context.cpp @@ -768,6 +768,7 @@ auto Context::AddConvergenceBlockAndPush(Parse::NodeId node_id, int num_blocks) inst_block_stack().Pop(); } inst_block_stack().Push(new_block_id); + AddToRegion(new_block_id, node_id); } auto Context::AddConvergenceBlockWithArgAndPush( @@ -787,6 +788,7 @@ auto Context::AddConvergenceBlockWithArgAndPush( inst_block_stack().Pop(); } inst_block_stack().Push(new_block_id); + AddToRegion(new_block_id, node_id); // Acquire the result value. SemIR::TypeId result_type_id = insts().Get(*block_args.begin()).type_id(); @@ -823,30 +825,90 @@ auto Context::SetBlockArgResultBeforeConstantUse(SemIR::InstId select_id, } } -auto Context::AddCurrentCodeBlockToFunction(Parse::NodeId node_id) -> void { - CARBON_CHECK(!inst_block_stack().empty(), "no current code block"); - - if (return_scope_stack().empty()) { - CARBON_CHECK(node_id.is_valid(), - "No current function, but node_id not provided"); - TODO(node_id, +auto Context::AddToRegion(SemIR::InstBlockId block_id, SemIR::LocId loc_id) + -> void { + if (region_stack_.empty()) { + TODO(loc_id, "Control flow expressions are currently only supported inside " "functions."); return; } - - if (!inst_block_stack().is_current_block_reachable()) { - // Don't include unreachable blocks in the function. + if (block_id == SemIR::InstBlockId::Unreachable) { return; } - auto function_id = - insts() - .GetAs(return_scope_stack().back().decl_id) - .function_id; - functions() - .Get(function_id) - .body_block_ids.push_back(inst_block_stack().PeekOrAdd()); + region_stack_.AppendToTop(block_id); +} + +auto Context::BeginSubpattern() -> void { + inst_block_stack().Push(); + PushRegion(inst_block_stack().PeekOrAdd()); +} + +auto Context::EndSubpatternAsExpr(SemIR::InstId result_id) + -> SemIR::ExprRegionId { + if (region_stack_.PeekArray().size() > 1) { + // End the exit block with a branch to a successor block, whose contents + // will be determined later. + AddInst(SemIR::LocIdAndInst::NoLoc( + {.target_id = inst_blocks().AddDefaultValue()})); + } else { + // This single-block region will be inserted as a SpliceBlock, so we don't + // need control flow out of it. + } + auto block_id = inst_block_stack().Pop(); + CARBON_CHECK(block_id == region_stack_.PeekArray().back()); + + // TODO: Is it possible to validate that this region is genuinely + // single-entry, single-exit? + return sem_ir().expr_regions().Add( + {.block_ids = PopRegion(), .result_id = result_id}); +} + +auto Context::EndSubpatternAsEmpty() -> void { + auto block_id = inst_block_stack().Pop(); + CARBON_CHECK(block_id == region_stack_.PeekArray().front()); + CARBON_CHECK(inst_blocks().Get(block_id).empty()); + region_stack_.PopArray(); +} + +auto Context::InsertHere(SemIR::ExprRegionId region_id) -> SemIR::InstId { + auto region = sem_ir_->expr_regions().Get(region_id); + auto loc_id = insts().GetLocId(region.result_id); + auto exit_block = inst_blocks().Get(region.block_ids.back()); + if (region.block_ids.size() == 1) { + // TODO: Is it possible to avoid leaving an "orphan" block in the IR in the + // first two cases? + if (exit_block.size() == 0) { + return region.result_id; + } + if (exit_block.size() == 1) { + inst_block_stack_.AddInstId(exit_block.front()); + return region.result_id; + } + return AddInst( + loc_id, {.type_id = insts().Get(region.result_id).type_id(), + .block_id = region.block_ids.front(), + .result_id = region.result_id}); + } + if (region_stack_.empty()) { + TODO(loc_id, + "Control flow expressions are currently only supported inside " + "functions."); + return SemIR::ErrorInst::SingletonInstId; + } + AddInst(SemIR::LocIdAndInst::NoLoc( + {.target_id = region.block_ids.front()})); + inst_block_stack_.Pop(); + // TODO: this will cumulatively cost O(MN) running time for M blocks + // at the Nth level of the stack. Figure out how to do better. + region_stack_.AppendToTop(region.block_ids); + auto resume_with_block_id = + insts().GetAs(exit_block.back()).target_id; + CARBON_CHECK(inst_blocks().GetOrEmpty(resume_with_block_id).empty()); + inst_block_stack_.Push(resume_with_block_id); + AddToRegion(resume_with_block_id, loc_id); + return region.result_id; } auto Context::is_current_position_reachable() -> bool { diff --git a/toolchain/check/context.h b/toolchain/check/context.h index 7f24d004eca95..2af3fc1efc6f4 100644 --- a/toolchain/check/context.h +++ b/toolchain/check/context.h @@ -148,6 +148,8 @@ class Context { // Adds an instruction to the current pattern block, returning the produced // ID. + // TODO: Is it possible to remove this and pattern_block_stack, now that + // we have BeginSubpattern etc. instead? auto AddPatternInst(SemIR::LocIdAndInst loc_id_and_inst) -> SemIR::InstId { auto inst_id = AddInstInNoBlock(loc_id_and_inst); pattern_block_stack_.AddInstId(inst_id); @@ -276,6 +278,27 @@ class Context { return scope_stack().GetCurrentScopeAs(sem_ir()); } + // Mark the start of a new single-entry region with the given entry block. + auto PushRegion(SemIR::InstBlockId entry_block_id) -> void { + region_stack_.PushArray(); + region_stack_.AppendToTop(entry_block_id); + } + + // Add `block_id` to the most recently pushed single-entry region. To preserve + // the single-entry property, `block_id` must not be directly reachable from + // any block outside the region. To ensure the region's blocks are in lexical + // order, this should be called when the first parse node associated with this + // block is handled, or as close as possible. + auto AddToRegion(SemIR::InstBlockId block_id, SemIR::LocId loc_id) -> void; + + // Complete creation of the most recently pushed single-entry region, and + // return a list of its blocks. + auto PopRegion() -> llvm::SmallVector { + llvm::SmallVector result(region_stack_.PeekArray()); + region_stack_.PopArray(); + return result; + } + // Adds a `Branch` instruction branching to a new instruction block, and // returns the ID of the new block. All paths to the branch target must go // through the current block, though not necessarily through this branch. @@ -297,16 +320,18 @@ class Context { // Handles recovergence of control flow. Adds branches from the top // `num_blocks` on the instruction block stack to a new block, pops the - // existing blocks, and pushes the new block onto the instruction block stack. + // existing blocks, pushes the new block onto the instruction block stack, + // and adds it to the most recently pushed region. auto AddConvergenceBlockAndPush(Parse::NodeId node_id, int num_blocks) -> void; // Handles recovergence of control flow with a result value. Adds branches // from the top few blocks on the instruction block stack to a new block, pops - // the existing blocks, and pushes the new block onto the instruction block - // stack. The number of blocks popped is the size of `block_args`, and the - // corresponding result values are the elements of `block_args`. Returns an - // instruction referring to the result value. + // the existing blocks, pushes the new block onto the instruction block + // stack, and adds it to the most recently pushed region. The number of blocks + // popped is the size of `block_args`, and the corresponding result values are + // the elements of `block_args`. Returns an instruction referring to the + // result value. auto AddConvergenceBlockWithArgAndPush( Parse::NodeId node_id, std::initializer_list block_args) -> SemIR::InstId; @@ -322,13 +347,6 @@ class Context { SemIR::InstId if_true, SemIR::InstId if_false) -> void; - // Add the current code block to the enclosing function. - // TODO: The node_id is taken for expressions, which can occur in - // non-function contexts. This should be refactored to support non-function - // contexts, and node_id removed. - auto AddCurrentCodeBlockToFunction( - Parse::NodeId node_id = Parse::NodeId::Invalid) -> void; - // Returns whether the current position in the current block is reachable. auto is_current_position_reachable() -> bool; @@ -619,12 +637,46 @@ class Context { auto global_init() -> GlobalInit& { return global_init_; } + // Marks the start of a region of insts in a pattern context that might + // represent an expression or a pattern. + auto BeginSubpattern() -> void; + + // Ends a region started by BeginSubpattern (in stack order), treating it as + // an expression with the given result, and returns the ID of the region. The + // region will not yet have any control-flow edges into or out of it. + auto EndSubpatternAsExpr(SemIR::InstId result_id) -> SemIR::ExprRegionId; + + // Ends a region started by BeginSubpattern (in stack order), asserting that + // it was empty. + auto EndSubpatternAsEmpty() -> void; + + // TODO: Add EndSubpatternAsPattern, when needed. + + // Inserts the given region into the current code block. If the region + // consists of a single block, this will be implemented as a `splice_block` + // inst. Otherwise, this will end the current block with a branch to the entry + // block of the region, and add future insts to a new block which is the + // immediate successor of the region's exit block. As a result, this cannot be + // called more than once for the same region. + auto InsertHere(SemIR::ExprRegionId region_id) -> SemIR::InstId; + auto import_ref_ids() -> llvm::SmallVector& { return import_ref_ids_; } - auto bind_name_cache() -> Map& { - return bind_name_cache_; + // Map from an AnyBindingPattern inst to precomputed parts of the + // pattern-match SemIR for it. + // + // TODO: Consider putting this behind a narrower API to guard against emitting + // multiple times. + struct BindingPatternInfo { + // The corresponding AnyBindName inst. + SemIR::InstId bind_name_id; + // The region of insts that computes the type of the binding. + SemIR::ExprRegionId type_expr_id; + }; + auto bind_name_map() -> Map& { + return bind_name_map_; } private: @@ -738,10 +790,10 @@ class Context { // FinalizeImportRefBlock() will produce an inst block for them. llvm::SmallVector import_ref_ids_; - // Cache of allocated AnyBindName insts, keyed by the entity names they refer - // to. These are allocated while generating the pattern IR, but are emitted - // later as part of the pattern-match IR. - Map bind_name_cache_; + Map bind_name_map_; + + // Stack of single-entry regions being built. + ArrayStack region_stack_; }; } // namespace Carbon::Check diff --git a/toolchain/check/handle_binding_pattern.cpp b/toolchain/check/handle_binding_pattern.cpp index dba8505115c35..92dd1d366429c 100644 --- a/toolchain/check/handle_binding_pattern.cpp +++ b/toolchain/check/handle_binding_pattern.cpp @@ -20,6 +20,9 @@ static auto HandleAnyBindingPattern(Context& context, Parse::NodeId node_id, // TODO: Handle `_` bindings. + SemIR::ExprRegionId type_expr_region_id = + context.EndSubpatternAsExpr(cast_type_inst_id); + // Every other kind of pattern binding has a name. auto [name_node, name_id] = context.node_stack().PopNameWithNodeId(); @@ -212,10 +215,6 @@ static auto HandleAnyBindingPattern(Context& context, Parse::NodeId node_id, context.AddNameToLookup(name_id, bind_id); auto entity_name_id = context.insts().GetAs(bind_id).entity_name_id; - bool inserted = context.bind_name_cache() - .Insert(entity_name_id, bind_id) - .is_inserted(); - CARBON_CHECK(inserted); auto pattern_inst_id = SemIR::InstId::Invalid; if (is_generic) { pattern_inst_id = @@ -227,6 +226,12 @@ static auto HandleAnyBindingPattern(Context& context, Parse::NodeId node_id, name_node, {.type_id = cast_type_id, .entity_name_id = entity_name_id}); } + bool inserted = + context.bind_name_map() + .Insert(pattern_inst_id, {.bind_name_id = bind_id, + .type_expr_id = type_expr_region_id}) + .is_inserted(); + CARBON_CHECK(inserted); param_pattern_id = context.AddPatternInst( node_id, { diff --git a/toolchain/check/handle_function.cpp b/toolchain/check/handle_function.cpp index 92083bd7e5f66..0c8cd63b7646a 100644 --- a/toolchain/check/handle_function.cpp +++ b/toolchain/check/handle_function.cpp @@ -378,9 +378,9 @@ static auto HandleFunctionDefinitionAfterSignature( // Create the function scope and the entry block. context.return_scope_stack().push_back({.decl_id = decl_id}); context.inst_block_stack().Push(); + context.PushRegion(context.inst_block_stack().PeekOrAdd()); context.scope_stack().Push(decl_id); StartGenericDefinition(context); - context.AddCurrentCodeBlockToFunction(); CheckFunctionDefinitionSignature(context, function); @@ -441,8 +441,10 @@ auto HandleParseNode(Context& context, Parse::FunctionDefinitionId node_id) context.return_scope_stack().pop_back(); context.decl_name_stack().PopScope(); - // If this is a generic function, collect information about the definition. auto& function = context.functions().Get(function_id); + function.body_block_ids = context.PopRegion(); + + // If this is a generic function, collect information about the definition. FinishGenericDefinition(context, function.generic_id); return true; diff --git a/toolchain/check/handle_if_expr.cpp b/toolchain/check/handle_if_expr.cpp index 7c8f1415cd092..e1e45ded96b9d 100644 --- a/toolchain/check/handle_if_expr.cpp +++ b/toolchain/check/handle_if_expr.cpp @@ -25,7 +25,7 @@ auto HandleParseNode(Context& context, Parse::IfExprIfId node_id) -> bool { // Start emitting the `then` block. context.inst_block_stack().Pop(); context.inst_block_stack().Push(then_block_id); - context.AddCurrentCodeBlockToFunction(node_id); + context.AddToRegion(then_block_id, node_id); context.node_stack().Push(if_node, else_block_id); return true; @@ -56,13 +56,18 @@ auto HandleParseNode(Context& context, Parse::IfExprThenId node_id) -> bool { // Start emitting the `else` block. context.inst_block_stack().Push(else_block_id); - context.AddCurrentCodeBlockToFunction(node_id); + context.AddToRegion(else_block_id, node_id); context.node_stack().Push(node_id, then_value_id); return true; } auto HandleParseNode(Context& context, Parse::IfExprElseId node_id) -> bool { + if (context.return_scope_stack().empty()) { + context.TODO(node_id, + "Control flow expressions are currently only supported inside " + "functions."); + } // Alias node_id for if/then/else consistency. auto& else_node = node_id; @@ -84,7 +89,6 @@ auto HandleParseNode(Context& context, Parse::IfExprElseId node_id) -> bool { if_node, {else_value_id, then_value_id}); context.SetBlockArgResultBeforeConstantUse(chosen_value_id, cond_value_id, then_value_id, else_value_id); - context.AddCurrentCodeBlockToFunction(node_id); // Push the result value. context.node_stack().Push(else_node, chosen_value_id); diff --git a/toolchain/check/handle_if_statement.cpp b/toolchain/check/handle_if_statement.cpp index f1f034f746148..3f44a382ae625 100644 --- a/toolchain/check/handle_if_statement.cpp +++ b/toolchain/check/handle_if_statement.cpp @@ -28,7 +28,7 @@ auto HandleParseNode(Context& context, Parse::IfConditionId node_id) -> bool { // Start emitting the `then` block. context.inst_block_stack().Pop(); context.inst_block_stack().Push(then_block_id); - context.AddCurrentCodeBlockToFunction(); + context.AddToRegion(then_block_id, node_id); context.node_stack().Push(node_id, else_block_id); return true; @@ -40,7 +40,7 @@ auto HandleParseNode(Context& context, Parse::IfStatementElseId node_id) // Switch to emitting the `else` block. context.inst_block_stack().Push(else_block_id); - context.AddCurrentCodeBlockToFunction(); + context.AddToRegion(else_block_id, node_id); context.node_stack().Push(node_id); return true; @@ -56,6 +56,7 @@ auto HandleParseNode(Context& context, Parse::IfStatementId node_id) -> bool { context.AddInst(node_id, {.target_id = else_block_id}); context.inst_block_stack().Pop(); context.inst_block_stack().Push(else_block_id); + context.AddToRegion(else_block_id, node_id); break; } @@ -72,7 +73,6 @@ auto HandleParseNode(Context& context, Parse::IfStatementId node_id) -> bool { } } - context.AddCurrentCodeBlockToFunction(); return true; } diff --git a/toolchain/check/handle_let_and_var.cpp b/toolchain/check/handle_let_and_var.cpp index ec21542e5ea21..623a482e9fb0a 100644 --- a/toolchain/check/handle_let_and_var.cpp +++ b/toolchain/check/handle_let_and_var.cpp @@ -22,6 +22,7 @@ static auto HandleIntroducer(Context& context, Parse::NodeId node_id) -> bool { // Push a bracketing node and pattern block to establish the pattern context. context.node_stack().Push(node_id); context.pattern_block_stack().Push(); + context.BeginSubpattern(); return true; } diff --git a/toolchain/check/handle_loop_statement.cpp b/toolchain/check/handle_loop_statement.cpp index c296eaf6edb28..78c70fd28e93b 100644 --- a/toolchain/check/handle_loop_statement.cpp +++ b/toolchain/check/handle_loop_statement.cpp @@ -21,7 +21,7 @@ auto HandleParseNode(Context& context, Parse::WhileConditionStartId node_id) // Start emitting the loop header block. context.inst_block_stack().Push(loop_header_id); - context.AddCurrentCodeBlockToFunction(); + context.AddToRegion(loop_header_id, node_id); context.node_stack().Push(node_id, loop_header_id); return true; @@ -42,7 +42,7 @@ auto HandleParseNode(Context& context, Parse::WhileConditionId node_id) // Start emitting the loop body. context.inst_block_stack().Push(loop_body_id); - context.AddCurrentCodeBlockToFunction(); + context.AddToRegion(loop_body_id, node_id); context.break_continue_stack().push_back( {.break_target = loop_exit_id, .continue_target = loop_header_id}); @@ -64,7 +64,7 @@ auto HandleParseNode(Context& context, Parse::WhileStatementId node_id) // Start emitting the loop exit block. context.inst_block_stack().Push(loop_exit_id); - context.AddCurrentCodeBlockToFunction(); + context.AddToRegion(loop_exit_id, node_id); return true; } diff --git a/toolchain/check/handle_operator.cpp b/toolchain/check/handle_operator.cpp index a5b893eb3a906..090dfab5182e6 100644 --- a/toolchain/check/handle_operator.cpp +++ b/toolchain/check/handle_operator.cpp @@ -363,7 +363,7 @@ static auto HandleShortCircuitOperand(Context& context, Parse::NodeId node_id, context.inst_block_stack().Pop(); context.inst_block_stack().Push(end_block_id); context.inst_block_stack().Push(rhs_block_id); - context.AddCurrentCodeBlockToFunction(node_id); + context.AddToRegion(rhs_block_id, node_id); // HandleShortCircuitOperator will follow, and doesn't need the operand on the // node stack. @@ -384,6 +384,11 @@ auto HandleParseNode(Context& context, Parse::ShortCircuitOperandOrId node_id) // occurs during operand handling. static auto HandleShortCircuitOperator(Context& context, Parse::NodeId node_id) -> bool { + if (context.return_scope_stack().empty()) { + context.TODO(node_id, + "Control flow expressions are currently only supported inside " + "functions."); + } auto [rhs_node, rhs_id] = context.node_stack().PopExprWithNodeId(); auto short_circuit_result_id = context.node_stack().PopExpr(); auto branch_value_id = context.node_stack().PopExpr(); @@ -399,7 +404,7 @@ static auto HandleShortCircuitOperator(Context& context, Parse::NodeId node_id) context.AddInst( node_id, {.target_id = resume_block_id, .arg_id = rhs_id}); context.inst_block_stack().Pop(); - context.AddCurrentCodeBlockToFunction(node_id); + context.AddToRegion(context.inst_block_stack().PeekOrAdd(), node_id); // Collect the result from either the first or second operand. auto result_id = context.AddInst( diff --git a/toolchain/check/handle_pattern_list.cpp b/toolchain/check/handle_pattern_list.cpp index 44dbb4a36840d..527091fc42ad7 100644 --- a/toolchain/check/handle_pattern_list.cpp +++ b/toolchain/check/handle_pattern_list.cpp @@ -11,11 +11,17 @@ auto HandleParseNode(Context& context, Parse::ImplicitParamListStartId node_id) -> bool { context.node_stack().Push(node_id); context.param_and_arg_refs_stack().Push(); + context.BeginSubpattern(); return true; } auto HandleParseNode(Context& context, Parse::ImplicitParamListId node_id) -> bool { + if (context.node_stack().PeekIs()) { + // End the subpattern started by a trailing comma, or the opening delimiter + // of an empty list. + context.EndSubpatternAsEmpty(); + } // Note the Start node remains on the stack, where the param list handler can // make use of it. auto refs_id = context.param_and_arg_refs_stack().EndAndPop( @@ -26,20 +32,32 @@ auto HandleParseNode(Context& context, Parse::ImplicitParamListId node_id) return true; } -auto HandleParseNode(Context& context, Parse::TuplePatternStartId node_id) +static auto HandleTuplePatternStart(Context& context, Parse::NodeId node_id) -> bool { context.node_stack().Push(node_id); context.param_and_arg_refs_stack().Push(); + context.BeginSubpattern(); return true; } +auto HandleParseNode(Context& context, Parse::TuplePatternStartId node_id) + -> bool { + return HandleTuplePatternStart(context, node_id); +} + auto HandleParseNode(Context& context, Parse::PatternListCommaId /*node_id*/) -> bool { context.param_and_arg_refs_stack().ApplyComma(); + context.BeginSubpattern(); return true; } auto HandleParseNode(Context& context, Parse::TuplePatternId node_id) -> bool { + if (context.node_stack().PeekIs(Parse::NodeKind::TuplePatternStart)) { + // End the subpattern started by a trailing comma, or the opening delimiter + // of an empty list. + context.EndSubpatternAsEmpty(); + } // Note the Start node remains on the stack, where the param list handler can // make use of it. auto refs_id = context.param_and_arg_refs_stack().EndAndPop( diff --git a/toolchain/check/pattern_match.cpp b/toolchain/check/pattern_match.cpp index b2b1943a488b2..8d1d652e4037d 100644 --- a/toolchain/check/pattern_match.cpp +++ b/toolchain/check/pattern_match.cpp @@ -141,12 +141,9 @@ auto MatchContext::EmitPatternMatch(Context& context, case SemIR::BindingPattern::Kind: case SemIR::SymbolicBindingPattern::Kind: { CARBON_CHECK(kind_ == MatchKind::Callee); - auto binding_pattern = pattern.inst.As(); - auto cache_entry = - context.bind_name_cache().Lookup(binding_pattern.entity_name_id); - // The cached bind_name should only be used once. - auto bind_name_id = - std::exchange(cache_entry.value(), SemIR::InstId::Invalid); + auto [bind_name_id, type_expr_id] = + context.bind_name_map().Lookup(entry.pattern_id).value(); + context.InsertHere(type_expr_id); auto bind_name = context.insts().GetAs(bind_name_id); CARBON_CHECK(!bind_name.value_id.is_valid()); bind_name.value_id = entry.scrutinee_id; diff --git a/toolchain/check/testdata/alias/fail_bool_value.carbon b/toolchain/check/testdata/alias/fail_bool_value.carbon index 574ac1f201c02..3828cd96aceb5 100644 --- a/toolchain/check/testdata/alias/fail_bool_value.carbon +++ b/toolchain/check/testdata/alias/fail_bool_value.carbon @@ -18,8 +18,6 @@ let a_test: bool = a; // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %false: bool = bool_literal false [template] -// CHECK:STDOUT: %Bool.type: type = fn_type @Bool [template] -// CHECK:STDOUT: %Bool: %Bool.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -39,9 +37,6 @@ let a_test: bool = a; // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %false: bool = bool_literal false [template = constants.%false] // CHECK:STDOUT: %a: = bind_alias a, [template = ] -// CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc15_13.1: type = value_of_initializer %bool.make_type [template = bool] -// CHECK:STDOUT: %.loc15_13.2: type = converted %bool.make_type, %.loc15_13.1 [template = bool] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { diff --git a/toolchain/check/testdata/alias/fail_control_flow.carbon b/toolchain/check/testdata/alias/fail_control_flow.carbon index 3ea3107e4a126..3438a16abe4f7 100644 --- a/toolchain/check/testdata/alias/fail_control_flow.carbon +++ b/toolchain/check/testdata/alias/fail_control_flow.carbon @@ -8,10 +8,14 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/alias/fail_control_flow.carbon -// CHECK:STDERR: fail_control_flow.carbon:[[@LINE+11]]:11: error: semantics TODO: `Control flow expressions are currently only supported inside functions.` [SemanticsTodo] +// CHECK:STDERR: fail_control_flow.carbon:[[@LINE+15]]:11: error: semantics TODO: `Control flow expressions are currently only supported inside functions.` [SemanticsTodo] // CHECK:STDERR: alias a = true or false; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: +// CHECK:STDERR: fail_control_flow.carbon:[[@LINE+11]]:11: error: semantics TODO: `Control flow expressions are currently only supported inside functions.` [SemanticsTodo] +// CHECK:STDERR: alias a = true or false; +// CHECK:STDERR: ^~~~~~~~~~~~~ +// CHECK:STDERR: // CHECK:STDERR: fail_control_flow.carbon:[[@LINE+7]]:11: error: semantics TODO: `Control flow expressions are currently only supported inside functions.` [SemanticsTodo] // CHECK:STDERR: alias a = true or false; // CHECK:STDERR: ^~~~~~~~~~~~~ @@ -31,7 +35,7 @@ alias a = true or false; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { -// CHECK:STDOUT: %.loc22: bool = block_arg [template = constants.%true] +// CHECK:STDOUT: %.loc26: bool = block_arg [template = constants.%true] // CHECK:STDOUT: %a: = bind_alias a, [template = ] // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/alias/no_prelude/alias_of_alias.carbon b/toolchain/check/testdata/alias/no_prelude/alias_of_alias.carbon index 21323fa89c396..e8577e59e76ae 100644 --- a/toolchain/check/testdata/alias/no_prelude/alias_of_alias.carbon +++ b/toolchain/check/testdata/alias/no_prelude/alias_of_alias.carbon @@ -38,7 +38,6 @@ let d: c = {}; // CHECK:STDOUT: %b: type = bind_alias b, %a [template = constants.%C] // CHECK:STDOUT: %b.ref: type = name_ref b, %b [template = constants.%C] // CHECK:STDOUT: %c: type = bind_alias c, %b [template = constants.%C] -// CHECK:STDOUT: %c.ref: type = name_ref c, %c [template = constants.%C] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { diff --git a/toolchain/check/testdata/alias/no_prelude/export_name.carbon b/toolchain/check/testdata/alias/no_prelude/export_name.carbon index 1aa43c0dd8a6d..acd539fd11105 100644 --- a/toolchain/check/testdata/alias/no_prelude/export_name.carbon +++ b/toolchain/check/testdata/alias/no_prelude/export_name.carbon @@ -175,7 +175,6 @@ var d: D* = &c; // CHECK:STDOUT: .d = %d // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %D.ref: type = name_ref D, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %d.var: ref %C = var d // CHECK:STDOUT: %d: ref %C = bind_name d, %d.var // CHECK:STDOUT: } @@ -211,7 +210,6 @@ var d: D* = &c; // CHECK:STDOUT: .c = %c // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %C.ref: = name_ref C, [template = ] // CHECK:STDOUT: %c.var: ref = var c // CHECK:STDOUT: %c: ref = bind_name c, %c.var // CHECK:STDOUT: } @@ -248,11 +246,8 @@ var d: D* = &c; // CHECK:STDOUT: .d = %d // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.2 [template = constants.%C] // CHECK:STDOUT: %c.var: ref %C = var c // CHECK:STDOUT: %c: ref %C = bind_name c, %c.var -// CHECK:STDOUT: %D.ref: type = name_ref D, imports.%import_ref.1 [template = constants.%C] -// CHECK:STDOUT: %ptr: type = ptr_type %C [template = constants.%ptr.2] // CHECK:STDOUT: %d.var: ref %ptr.2 = var d // CHECK:STDOUT: %d: ref %ptr.2 = bind_name d, %d.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/alias/no_prelude/fail_aliased_name_in_diag.carbon b/toolchain/check/testdata/alias/no_prelude/fail_aliased_name_in_diag.carbon index 8d476ab00115a..1f01074530797 100644 --- a/toolchain/check/testdata/alias/no_prelude/fail_aliased_name_in_diag.carbon +++ b/toolchain/check/testdata/alias/no_prelude/fail_aliased_name_in_diag.carbon @@ -41,10 +41,8 @@ let c_var: c = d; // CHECK:STDOUT: %D.decl: type = class_decl @D [template = constants.%D] {} {} // CHECK:STDOUT: %C.ref: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %c: type = bind_alias c, %C.decl [template = constants.%C] -// CHECK:STDOUT: %D.ref: type = name_ref D, %D.decl [template = constants.%D] // CHECK:STDOUT: %d.var: ref %D = var d // CHECK:STDOUT: %d: ref %D = bind_name d, %d.var -// CHECK:STDOUT: %c.ref: type = name_ref c, %c [template = constants.%C] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { diff --git a/toolchain/check/testdata/alias/no_prelude/fail_name_conflict.carbon b/toolchain/check/testdata/alias/no_prelude/fail_name_conflict.carbon index 606438ed28455..828dfe4bd65af 100644 --- a/toolchain/check/testdata/alias/no_prelude/fail_name_conflict.carbon +++ b/toolchain/check/testdata/alias/no_prelude/fail_name_conflict.carbon @@ -47,10 +47,8 @@ alias b = C; // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: %C.ref.loc13: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %a.loc13: type = bind_alias a, %C.decl [template = constants.%C] -// CHECK:STDOUT: %C.ref.loc21: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %a.var: ref %C = var a // CHECK:STDOUT: %a.loc21: ref %C = bind_name a, %a.var -// CHECK:STDOUT: %C.ref.loc23: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %b.var: ref %C = var b // CHECK:STDOUT: %b: ref %C = bind_name b, %b.var // CHECK:STDOUT: %C.ref.loc30: type = name_ref C, %C.decl [template = constants.%C] diff --git a/toolchain/check/testdata/alias/no_prelude/fail_not_constant.carbon b/toolchain/check/testdata/alias/no_prelude/fail_not_constant.carbon index c7dcd8eea151c..4dc22d5c4e268 100644 --- a/toolchain/check/testdata/alias/no_prelude/fail_not_constant.carbon +++ b/toolchain/check/testdata/alias/no_prelude/fail_not_constant.carbon @@ -36,17 +36,12 @@ fn F() { // CHECK:STDOUT: // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc12_11.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc12_11.2: type = converted %.loc12_11.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %a.var: ref %empty_tuple.type = var a // CHECK:STDOUT: %a: ref %empty_tuple.type = bind_name a, %a.var // CHECK:STDOUT: %.loc12_16.1: %empty_tuple.type = tuple_literal () // CHECK:STDOUT: %.loc12_16.2: init %empty_tuple.type = tuple_init () to %a.var [template = constants.%empty_tuple] // CHECK:STDOUT: %.loc12_17: init %empty_tuple.type = converted %.loc12_16.1, %.loc12_16.2 [template = constants.%empty_tuple] // CHECK:STDOUT: assign %a.var, %.loc12_17 -// CHECK:STDOUT: %.loc13_11: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc13_12: type = converted %.loc13_11, constants.%empty_tuple.type [template = constants.%empty_tuple.type] -// CHECK:STDOUT: %ptr: type = ptr_type %empty_tuple.type [template = constants.%ptr] // CHECK:STDOUT: %b.var: ref %ptr = var b // CHECK:STDOUT: %b: ref %ptr = bind_name b, %b.var // CHECK:STDOUT: %a.ref: ref %empty_tuple.type = name_ref a, %a diff --git a/toolchain/check/testdata/alias/no_prelude/import.carbon b/toolchain/check/testdata/alias/no_prelude/import.carbon index d0cba099d79c4..003a1076e07db 100644 --- a/toolchain/check/testdata/alias/no_prelude/import.carbon +++ b/toolchain/check/testdata/alias/no_prelude/import.carbon @@ -82,10 +82,8 @@ var c: () = a_alias_alias; // CHECK:STDOUT: .a = %a // CHECK:STDOUT: } // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} -// CHECK:STDOUT: %C.ref.loc6: type = name_ref C, %C.decl [template = constants.%C] +// CHECK:STDOUT: %C.ref: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %c_alias: type = bind_alias c_alias, %C.decl [template = constants.%C] -// CHECK:STDOUT: %C.ref.loc8: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %ptr: type = ptr_type %C [template = constants.%ptr] // CHECK:STDOUT: %a.var: ref %ptr = var a // CHECK:STDOUT: %a: ref %ptr = bind_name a, %a.var // CHECK:STDOUT: } @@ -124,10 +122,8 @@ var c: () = a_alias_alias; // CHECK:STDOUT: .b = %b // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %c_alias.ref.loc6: type = name_ref c_alias, imports.%import_ref.2 [template = constants.%C] +// CHECK:STDOUT: %c_alias.ref: type = name_ref c_alias, imports.%import_ref.2 [template = constants.%C] // CHECK:STDOUT: %c_alias_alias: type = bind_alias c_alias_alias, imports.%import_ref.2 [template = constants.%C] -// CHECK:STDOUT: %c_alias.ref.loc8: type = name_ref c_alias, imports.%import_ref.2 [template = constants.%C] -// CHECK:STDOUT: %ptr: type = ptr_type %C [template = constants.%ptr] // CHECK:STDOUT: %b.var: ref %ptr = var b // CHECK:STDOUT: %b: ref %ptr = bind_name b, %b.var // CHECK:STDOUT: } @@ -161,8 +157,6 @@ var c: () = a_alias_alias; // CHECK:STDOUT: .c = %c // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %c_alias_alias.ref: type = name_ref c_alias_alias, imports.%import_ref.1 [template = constants.%C] -// CHECK:STDOUT: %ptr: type = ptr_type %C [template = constants.%ptr] // CHECK:STDOUT: %c.var: ref %ptr = var c // CHECK:STDOUT: %c: ref %ptr = bind_name c, %c.var // CHECK:STDOUT: } @@ -185,8 +179,6 @@ var c: () = a_alias_alias; // CHECK:STDOUT: .a = %a // CHECK:STDOUT: .a_alias = %a_alias // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc4_9.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc4_9.2: type = converted %.loc4_9.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %a.var: ref %empty_tuple.type = var a // CHECK:STDOUT: %a: ref %empty_tuple.type = bind_name a, %a.var // CHECK:STDOUT: %a.ref: ref %empty_tuple.type = name_ref a, %a @@ -224,8 +216,6 @@ var c: () = a_alias_alias; // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %a_alias.ref: ref %empty_tuple.type = name_ref a_alias, imports.%import_ref.2 // CHECK:STDOUT: %a_alias_alias: ref %empty_tuple.type = bind_alias a_alias_alias, imports.%import_ref.2 -// CHECK:STDOUT: %.loc8_9.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc8_9.2: type = converted %.loc8_9.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %b.var: ref %empty_tuple.type = var b // CHECK:STDOUT: %b: ref %empty_tuple.type = bind_name b, %b.var // CHECK:STDOUT: } @@ -258,8 +248,6 @@ var c: () = a_alias_alias; // CHECK:STDOUT: .c = %c // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %.loc10_9.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc10_9.2: type = converted %.loc10_9.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %c.var: ref %empty_tuple.type = var c // CHECK:STDOUT: %c: ref %empty_tuple.type = bind_name c, %c.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/alias/no_prelude/import_access.carbon b/toolchain/check/testdata/alias/no_prelude/import_access.carbon index affd369ff6ac9..ab4f0474d9c11 100644 --- a/toolchain/check/testdata/alias/no_prelude/import_access.carbon +++ b/toolchain/check/testdata/alias/no_prelude/import_access.carbon @@ -102,7 +102,6 @@ var inst: Test.A = {}; // CHECK:STDOUT: } // CHECK:STDOUT: %Test.import = import Test // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %A.ref: type = name_ref A, imports.%import_ref.2 [template = constants.%C] // CHECK:STDOUT: %inst.var: ref %C = var inst // CHECK:STDOUT: %inst: ref %C = bind_name inst, %inst.var // CHECK:STDOUT: } @@ -138,7 +137,6 @@ var inst: Test.A = {}; // CHECK:STDOUT: .inst = %inst // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %A.ref: = name_ref A, [template = ] // CHECK:STDOUT: %inst.var: ref = var inst // CHECK:STDOUT: %inst: ref = bind_name inst, %inst.var // CHECK:STDOUT: } @@ -168,8 +166,6 @@ var inst: Test.A = {}; // CHECK:STDOUT: .inst = %inst // CHECK:STDOUT: } // CHECK:STDOUT: %Test.import = import Test -// CHECK:STDOUT: %Test.ref: = name_ref Test, imports.%Test [template = imports.%Test] -// CHECK:STDOUT: %A.ref: = name_ref A, [template = ] // CHECK:STDOUT: %inst.var: ref = var inst // CHECK:STDOUT: %inst: ref = bind_name inst, %inst.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/alias/no_prelude/import_order.carbon b/toolchain/check/testdata/alias/no_prelude/import_order.carbon index 7eb7f93a8e258..491464378248b 100644 --- a/toolchain/check/testdata/alias/no_prelude/import_order.carbon +++ b/toolchain/check/testdata/alias/no_prelude/import_order.carbon @@ -60,14 +60,12 @@ var a_val: a = {.v = b_val.v}; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { -// CHECK:STDOUT: %.loc4_19.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc4_19.2: type = converted %.loc4_19.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] -// CHECK:STDOUT: %.loc4_16: %C.elem = field_decl v, element0 [template] +// CHECK:STDOUT: %.loc4: %C.elem = field_decl v, element0 [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.v [template = constants.%complete_type] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C -// CHECK:STDOUT: .v = %.loc4_16 +// CHECK:STDOUT: .v = %.loc4 // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } // CHECK:STDOUT: @@ -107,16 +105,12 @@ var a_val: a = {.v = b_val.v}; // CHECK:STDOUT: .a_val = %a_val // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %d.ref: type = name_ref d, imports.%import_ref.5 [template = constants.%C] // CHECK:STDOUT: %d_val.var: ref %C = var d_val // CHECK:STDOUT: %d_val: ref %C = bind_name d_val, %d_val.var -// CHECK:STDOUT: %c.ref: type = name_ref c, imports.%import_ref.4 [template = constants.%C] // CHECK:STDOUT: %c_val.var: ref %C = var c_val // CHECK:STDOUT: %c_val: ref %C = bind_name c_val, %c_val.var -// CHECK:STDOUT: %b.ref: type = name_ref b, imports.%import_ref.3 [template = constants.%C] // CHECK:STDOUT: %b_val.var: ref %C = var b_val // CHECK:STDOUT: %b_val: ref %C = bind_name b_val, %b_val.var -// CHECK:STDOUT: %a.ref: type = name_ref a, imports.%import_ref.2 [template = constants.%C] // CHECK:STDOUT: %a_val.var: ref %C = var a_val // CHECK:STDOUT: %a_val: ref %C = bind_name a_val, %a_val.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/alias/no_prelude/in_namespace.carbon b/toolchain/check/testdata/alias/no_prelude/in_namespace.carbon index f80e9da4399d1..6bd5845d32603 100644 --- a/toolchain/check/testdata/alias/no_prelude/in_namespace.carbon +++ b/toolchain/check/testdata/alias/no_prelude/in_namespace.carbon @@ -46,8 +46,6 @@ fn F() -> NS.a { // CHECK:STDOUT: } // CHECK:STDOUT: %C.ref: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %a: type = bind_alias a, %C.decl [template = constants.%C] -// CHECK:STDOUT: %NS.ref: = name_ref NS, %NS [template = %NS] -// CHECK:STDOUT: %a.ref: type = name_ref a, %a [template = constants.%C] // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %return.patt: %C = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %C = out_param_pattern %return.patt, runtime_param0 @@ -60,14 +58,12 @@ fn F() -> NS.a { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { -// CHECK:STDOUT: %.loc11_19.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc11_19.2: type = converted %.loc11_19.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] -// CHECK:STDOUT: %.loc11_16: %C.elem = field_decl v, element0 [template] +// CHECK:STDOUT: %.loc11: %C.elem = field_decl v, element0 [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.v [template = constants.%complete_type] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C -// CHECK:STDOUT: .v = %.loc11_16 +// CHECK:STDOUT: .v = %.loc11 // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/alias/no_prelude/local.carbon b/toolchain/check/testdata/alias/no_prelude/local.carbon index 00a6e6cfc0fea..10112e19a49d6 100644 --- a/toolchain/check/testdata/alias/no_prelude/local.carbon +++ b/toolchain/check/testdata/alias/no_prelude/local.carbon @@ -40,8 +40,6 @@ fn F() -> () { // CHECK:STDOUT: // CHECK:STDOUT: fn @F() -> %empty_tuple.type { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc12_11.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc12_11.2: type = converted %.loc12_11.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %a.var: ref %empty_tuple.type = var a // CHECK:STDOUT: %a: ref %empty_tuple.type = bind_name a, %a.var // CHECK:STDOUT: %.loc12_16.1: %empty_tuple.type = tuple_literal () diff --git a/toolchain/check/testdata/array/array_in_place.carbon b/toolchain/check/testdata/array/array_in_place.carbon index 55fe9f4468aa1..2d673a1f555c6 100644 --- a/toolchain/check/testdata/array/array_in_place.carbon +++ b/toolchain/check/testdata/array/array_in_place.carbon @@ -69,16 +69,6 @@ fn G() { // CHECK:STDOUT: // CHECK:STDOUT: fn @G() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int_32.loc14_12: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc14_12: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc14_17: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc14_17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc14_22: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc14_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc14_25.1: %tuple.type.1 = tuple_literal (%i32.loc14_12, %i32.loc14_17, %i32.loc14_22) -// CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2] -// CHECK:STDOUT: %.loc14_25.2: type = converted %.loc14_25.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] -// CHECK:STDOUT: %array_type: type = array_type %int_2, %tuple.type.2 [template = constants.%array_type] // CHECK:STDOUT: %v.var: ref %array_type = var v // CHECK:STDOUT: %v: ref %array_type = bind_name v, %v.var // CHECK:STDOUT: %F.ref.loc14_34: %F.type = name_ref F, file.%F.decl [template = constants.%F] diff --git a/toolchain/check/testdata/array/array_vs_tuple.carbon b/toolchain/check/testdata/array/array_vs_tuple.carbon index 1b616884bac3d..ff0cff43ca145 100644 --- a/toolchain/check/testdata/array/array_vs_tuple.carbon +++ b/toolchain/check/testdata/array/array_vs_tuple.carbon @@ -41,7 +41,6 @@ fn G() { // CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_3.2: %i32 = int_value 3 [template] // CHECK:STDOUT: %array: %array_type = tuple_value (%int_1.2, %int_2.2, %int_3.2) [template] -// CHECK:STDOUT: %tuple.type.2: type = tuple_type (type, type, type) [template] // CHECK:STDOUT: %tuple.type.3: type = tuple_type (%i32, %i32, %i32) [template] // CHECK:STDOUT: %tuple: %tuple.type.3 = tuple_value (%int_1.2, %int_2.2, %int_3.2) [template] // CHECK:STDOUT: } @@ -66,16 +65,12 @@ fn G() { // CHECK:STDOUT: // CHECK:STDOUT: fn @G() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int_32.loc13: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc13: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_3.loc13_16: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] -// CHECK:STDOUT: %array_type: type = array_type %int_3.loc13_16, %i32 [template = constants.%array_type] // CHECK:STDOUT: %a.var: ref %array_type = var a // CHECK:STDOUT: %a: ref %array_type = bind_name a, %a.var // CHECK:STDOUT: %int_1.loc13_22: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_2.loc13_25: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %int_3.loc13_28: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] -// CHECK:STDOUT: %.loc13_29.1: %tuple.type.1 = tuple_literal (%int_1.loc13_22, %int_2.loc13_25, %int_3.loc13_28) +// CHECK:STDOUT: %int_3.loc13: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] +// CHECK:STDOUT: %.loc13_29.1: %tuple.type.1 = tuple_literal (%int_1.loc13_22, %int_2.loc13_25, %int_3.loc13) // CHECK:STDOUT: %impl.elem0.loc13_29.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc13_29.1: = bound_method %int_1.loc13_22, %impl.elem0.loc13_29.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc13_29.1: = specific_function %Convert.bound.loc13_29.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] @@ -93,24 +88,16 @@ fn G() { // CHECK:STDOUT: %.loc13_29.6: ref %i32 = array_index %a.var, %int_1.loc13_29 // CHECK:STDOUT: %.loc13_29.7: init %i32 = initialize_from %.loc13_29.5 to %.loc13_29.6 [template = constants.%int_2.2] // CHECK:STDOUT: %impl.elem0.loc13_29.3: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc13_29.3: = bound_method %int_3.loc13_28, %impl.elem0.loc13_29.3 [template = constants.%Convert.bound.3] +// CHECK:STDOUT: %Convert.bound.loc13_29.3: = bound_method %int_3.loc13, %impl.elem0.loc13_29.3 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc13_29.3: = specific_function %Convert.bound.loc13_29.3, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] -// CHECK:STDOUT: %int.convert_checked.loc13_29.3: init %i32 = call %Convert.specific_fn.loc13_29.3(%int_3.loc13_28) [template = constants.%int_3.2] -// CHECK:STDOUT: %.loc13_29.8: init %i32 = converted %int_3.loc13_28, %int.convert_checked.loc13_29.3 [template = constants.%int_3.2] +// CHECK:STDOUT: %int.convert_checked.loc13_29.3: init %i32 = call %Convert.specific_fn.loc13_29.3(%int_3.loc13) [template = constants.%int_3.2] +// CHECK:STDOUT: %.loc13_29.8: init %i32 = converted %int_3.loc13, %int.convert_checked.loc13_29.3 [template = constants.%int_3.2] // CHECK:STDOUT: %int_2.loc13_29: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %.loc13_29.9: ref %i32 = array_index %a.var, %int_2.loc13_29 // CHECK:STDOUT: %.loc13_29.10: init %i32 = initialize_from %.loc13_29.8 to %.loc13_29.9 [template = constants.%int_3.2] // CHECK:STDOUT: %.loc13_29.11: init %array_type = array_init (%.loc13_29.4, %.loc13_29.7, %.loc13_29.10) to %a.var [template = constants.%array] // CHECK:STDOUT: %.loc13_30: init %array_type = converted %.loc13_29.1, %.loc13_29.11 [template = constants.%array] // CHECK:STDOUT: assign %a.var, %.loc13_30 -// CHECK:STDOUT: %int_32.loc14_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc14_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc14_16: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc14_16: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc14_21: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc14_21: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc14_24.1: %tuple.type.2 = tuple_literal (%i32.loc14_11, %i32.loc14_16, %i32.loc14_21) -// CHECK:STDOUT: %.loc14_24.2: type = converted %.loc14_24.1, constants.%tuple.type.3 [template = constants.%tuple.type.3] // CHECK:STDOUT: %b.var: ref %tuple.type.3 = var b // CHECK:STDOUT: %b: ref %tuple.type.3 = bind_name b, %b.var // CHECK:STDOUT: %int_1.loc14: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] diff --git a/toolchain/check/testdata/array/assign_return_value.carbon b/toolchain/check/testdata/array/assign_return_value.carbon index 93be65ea45e90..c58cc909019ff 100644 --- a/toolchain/check/testdata/array/assign_return_value.carbon +++ b/toolchain/check/testdata/array/assign_return_value.carbon @@ -86,10 +86,6 @@ fn Run() { // CHECK:STDOUT: // CHECK:STDOUT: fn @Run() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1] -// CHECK:STDOUT: %array_type: type = array_type %int_1, %i32 [template = constants.%array_type] // CHECK:STDOUT: %t.var: ref %array_type = var t // CHECK:STDOUT: %t: ref %array_type = bind_name t, %t.var // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [template = constants.%F] diff --git a/toolchain/check/testdata/array/assign_var.carbon b/toolchain/check/testdata/array/assign_var.carbon index 5e6e03639d01c..45857cf35f665 100644 --- a/toolchain/check/testdata/array/assign_var.carbon +++ b/toolchain/check/testdata/array/assign_var.carbon @@ -16,7 +16,6 @@ var b: [i32; 3] = a; // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] -// CHECK:STDOUT: %tuple.type.1: type = tuple_type (type, type, type) [template] // CHECK:STDOUT: %tuple.type.2: type = tuple_type (%i32, %i32, %i32) [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] @@ -56,20 +55,8 @@ var b: [i32; 3] = a; // CHECK:STDOUT: .b = %b // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int_32.loc11_9: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc11_9: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc11_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc11_14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc11_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc11_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_22.1: %tuple.type.1 = tuple_literal (%i32.loc11_9, %i32.loc11_14, %i32.loc11_19) -// CHECK:STDOUT: %.loc11_22.2: type = converted %.loc11_22.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %a.var: ref %tuple.type.2 = var a // CHECK:STDOUT: %a: ref %tuple.type.2 = bind_name a, %a.var -// CHECK:STDOUT: %int_32.loc12: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc12: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] -// CHECK:STDOUT: %array_type: type = array_type %int_3, %i32 [template = constants.%array_type] // CHECK:STDOUT: %b.var: ref %array_type = var b // CHECK:STDOUT: %b: ref %array_type = bind_name b, %b.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/array/base.carbon b/toolchain/check/testdata/array/base.carbon index 21002ef401a59..8db35a3d17227 100644 --- a/toolchain/check/testdata/array/base.carbon +++ b/toolchain/check/testdata/array/base.carbon @@ -30,9 +30,6 @@ var c: [(); 5] = ((), (), (), (), (),); // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] // CHECK:STDOUT: %array.1: %array_type.1 = tuple_value (%int_1.2) [template] -// CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [template] -// CHECK:STDOUT: %Float.type: type = fn_type @Float [template] -// CHECK:STDOUT: %Float: %Float.type = struct_value () [template] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %array_type.2: type = array_type %int_2, f64 [template] // CHECK:STDOUT: %float.1: f64 = float_literal 11.100000000000001 [template] @@ -66,24 +63,10 @@ var c: [(); 5] = ((), (), (), (), (),); // CHECK:STDOUT: .c = %c // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %array_type.loc11: type = array_type %int_1, %i32 [template = constants.%array_type.1] // CHECK:STDOUT: %a.var: ref %array_type.1 = var a // CHECK:STDOUT: %a: ref %array_type.1 = bind_name a, %a.var -// CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type: init type = call constants.%Float(%int_64) [template = f64] -// CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2] -// CHECK:STDOUT: %.loc12_9.1: type = value_of_initializer %float.make_type [template = f64] -// CHECK:STDOUT: %.loc12_9.2: type = converted %float.make_type, %.loc12_9.1 [template = f64] -// CHECK:STDOUT: %array_type.loc12: type = array_type %int_2, f64 [template = constants.%array_type.2] // CHECK:STDOUT: %b.var: ref %array_type.2 = var b // CHECK:STDOUT: %b: ref %array_type.2 = bind_name b, %b.var -// CHECK:STDOUT: %.loc13_10.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %int_5: Core.IntLiteral = int_value 5 [template = constants.%int_5] -// CHECK:STDOUT: %.loc13_10.2: type = converted %.loc13_10.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] -// CHECK:STDOUT: %array_type.loc13: type = array_type %int_5, %empty_tuple.type [template = constants.%array_type.3] // CHECK:STDOUT: %c.var: ref %array_type.3 = var c // CHECK:STDOUT: %c: ref %array_type.3 = bind_name c, %c.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/array/canonicalize_index.carbon b/toolchain/check/testdata/array/canonicalize_index.carbon index ede43d291df3b..3e1d3b1dc5184 100644 --- a/toolchain/check/testdata/array/canonicalize_index.carbon +++ b/toolchain/check/testdata/array/canonicalize_index.carbon @@ -28,7 +28,6 @@ let c: [i32; ConvertToU32(3)]* = &a; // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] // CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] @@ -39,11 +38,6 @@ let c: [i32; ConvertToU32(3)]* = &a; // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] // CHECK:STDOUT: %int_3.1: %i32 = int_value 3 [template] -// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.3, @impl.2(%int_32) [template] -// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [template] -// CHECK:STDOUT: %interface.6: = interface_witness (%Convert.11) [template] -// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_3.1, %Convert.11 [template] -// CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.3(%int_32) [template] // CHECK:STDOUT: %int_3.2: Core.IntLiteral = int_value 3 [template] // CHECK:STDOUT: %array_type: type = array_type %int_3.2, %i32 [template] // CHECK:STDOUT: %ptr: type = ptr_type %array_type [template] @@ -52,12 +46,6 @@ let c: [i32; ConvertToU32(3)]* = &a; // CHECK:STDOUT: %Convert.bound.4: = bound_method %int_3.2, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.4: = specific_function %Convert.bound.4, @Convert.2(%int_32) [template] // CHECK:STDOUT: %array: %array_type = tuple_value (%int_1.2, %int_2.2, %int_3.1) [template] -// CHECK:STDOUT: %int_3.3: %u32 = int_value 3 [template] -// CHECK:STDOUT: %Convert.type.16: type = fn_type @Convert.8, @impl.32(%int_32) [template] -// CHECK:STDOUT: %Convert.16: %Convert.type.16 = struct_value () [template] -// CHECK:STDOUT: %interface.11: = interface_witness (%Convert.16) [template] -// CHECK:STDOUT: %Convert.bound.5: = bound_method %int_3.3, %Convert.16 [template] -// CHECK:STDOUT: %Convert.specific_fn.5: = specific_function %Convert.bound.5, @Convert.8(%int_32) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -88,15 +76,19 @@ let c: [i32; ConvertToU32(3)]* = &a; // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc11_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc11_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc11_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc11_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc11_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc11_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc11_11: type = splice_block %i32.loc11_11 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc11_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc11_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %.loc11_19: type = splice_block %i32.loc11_19 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc11_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc11_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -107,70 +99,19 @@ let c: [i32; ConvertToU32(3)]* = &a; // CHECK:STDOUT: %return.patt: %u32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %u32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc12_20: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc12_28: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %u32: type = class_type @UInt, @UInt(constants.%int_32) [template = constants.%u32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc12: type = splice_block %i32 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc12_20: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %u32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %u32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %int_32.loc14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %Add.ref: %Add.type.1 = name_ref Add, %Add.decl [template = constants.%Add] -// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %impl.elem0.loc14_18: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc14_18: = bound_method %int_1, %impl.elem0.loc14_18 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc14_18: = specific_function %Convert.bound.loc14_18, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc14_18: init %i32 = call %Convert.specific_fn.loc14_18(%int_1) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc14_18.1: %i32 = value_of_initializer %int.convert_checked.loc14_18 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc14_18.2: %i32 = converted %int_1, %.loc14_18.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc14_21: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc14_21: = bound_method %int_2, %impl.elem0.loc14_21 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc14_21: = specific_function %Convert.bound.loc14_21, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] -// CHECK:STDOUT: %int.convert_checked.loc14_21: init %i32 = call %Convert.specific_fn.loc14_21(%int_2) [template = constants.%int_2.2] -// CHECK:STDOUT: %.loc14_21.1: %i32 = value_of_initializer %int.convert_checked.loc14_21 [template = constants.%int_2.2] -// CHECK:STDOUT: %.loc14_21.2: %i32 = converted %int_2, %.loc14_21.1 [template = constants.%int_2.2] -// CHECK:STDOUT: %int.sadd: init %i32 = call %Add.ref(%.loc14_18.2, %.loc14_21.2) [template = constants.%int_3.1] -// CHECK:STDOUT: %impl.elem0.loc14_22: %Convert.type.5 = interface_witness_access constants.%interface.6, element0 [template = constants.%Convert.11] -// CHECK:STDOUT: %Convert.bound.loc14_22: = bound_method %int.sadd, %impl.elem0.loc14_22 [template = constants.%Convert.bound.3] -// CHECK:STDOUT: %Convert.specific_fn.loc14_22: = specific_function %Convert.bound.loc14_22, @Convert.3(constants.%int_32) [template = constants.%Convert.specific_fn.3] -// CHECK:STDOUT: %.loc14_22.1: %i32 = value_of_initializer %int.sadd [template = constants.%int_3.1] -// CHECK:STDOUT: %.loc14_22.2: %i32 = converted %int.sadd, %.loc14_22.1 [template = constants.%int_3.1] -// CHECK:STDOUT: %int.convert_checked.loc14_22: init Core.IntLiteral = call %Convert.specific_fn.loc14_22(%.loc14_22.2) [template = constants.%int_3.2] -// CHECK:STDOUT: %.loc14_22.3: Core.IntLiteral = value_of_initializer %int.convert_checked.loc14_22 [template = constants.%int_3.2] -// CHECK:STDOUT: %.loc14_22.4: Core.IntLiteral = converted %int.sadd, %.loc14_22.3 [template = constants.%int_3.2] -// CHECK:STDOUT: %array_type.loc14: type = array_type %.loc14_22.4, %i32 [template = constants.%array_type] // CHECK:STDOUT: %a.var: ref %array_type = var a // CHECK:STDOUT: %a: ref %array_type = bind_name a, %a.var -// CHECK:STDOUT: %int_32.loc15: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc15: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_3.loc15: Core.IntLiteral = int_value 3 [template = constants.%int_3.2] -// CHECK:STDOUT: %array_type.loc15: type = array_type %int_3.loc15, %i32 [template = constants.%array_type] -// CHECK:STDOUT: %ptr.loc15: type = ptr_type %array_type [template = constants.%ptr] -// CHECK:STDOUT: %int_32.loc16: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc16: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %ConvertToU32.ref: %ConvertToU32.type = name_ref ConvertToU32, %ConvertToU32.decl [template = constants.%ConvertToU32] -// CHECK:STDOUT: %int_3.loc16: Core.IntLiteral = int_value 3 [template = constants.%int_3.2] -// CHECK:STDOUT: %impl.elem0.loc16_27: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc16_27: = bound_method %int_3.loc16, %impl.elem0.loc16_27 [template = constants.%Convert.bound.4] -// CHECK:STDOUT: %Convert.specific_fn.loc16_27: = specific_function %Convert.bound.loc16_27, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.4] -// CHECK:STDOUT: %int.convert_checked.loc16_27: init %i32 = call %Convert.specific_fn.loc16_27(%int_3.loc16) [template = constants.%int_3.1] -// CHECK:STDOUT: %.loc16_27.1: %i32 = value_of_initializer %int.convert_checked.loc16_27 [template = constants.%int_3.1] -// CHECK:STDOUT: %.loc16_27.2: %i32 = converted %int_3.loc16, %.loc16_27.1 [template = constants.%int_3.1] -// CHECK:STDOUT: %int.convert_checked.loc16_28.1: init %u32 = call %ConvertToU32.ref(%.loc16_27.2) [template = constants.%int_3.3] -// CHECK:STDOUT: %impl.elem0.loc16_28: %Convert.type.5 = interface_witness_access constants.%interface.11, element0 [template = constants.%Convert.16] -// CHECK:STDOUT: %Convert.bound.loc16_28: = bound_method %int.convert_checked.loc16_28.1, %impl.elem0.loc16_28 [template = constants.%Convert.bound.5] -// CHECK:STDOUT: %Convert.specific_fn.loc16_28: = specific_function %Convert.bound.loc16_28, @Convert.8(constants.%int_32) [template = constants.%Convert.specific_fn.5] -// CHECK:STDOUT: %.loc16_28.1: %u32 = value_of_initializer %int.convert_checked.loc16_28.1 [template = constants.%int_3.3] -// CHECK:STDOUT: %.loc16_28.2: %u32 = converted %int.convert_checked.loc16_28.1, %.loc16_28.1 [template = constants.%int_3.3] -// CHECK:STDOUT: %int.convert_checked.loc16_28.2: init Core.IntLiteral = call %Convert.specific_fn.loc16_28(%.loc16_28.2) [template = constants.%int_3.2] -// CHECK:STDOUT: %.loc16_28.3: Core.IntLiteral = value_of_initializer %int.convert_checked.loc16_28.2 [template = constants.%int_3.2] -// CHECK:STDOUT: %.loc16_28.4: Core.IntLiteral = converted %int.convert_checked.loc16_28.1, %.loc16_28.3 [template = constants.%int_3.2] -// CHECK:STDOUT: %array_type.loc16: type = array_type %.loc16_28.4, %i32 [template = constants.%array_type] -// CHECK:STDOUT: %ptr.loc16: type = ptr_type %array_type [template = constants.%ptr] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Add.1(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.sadd"; diff --git a/toolchain/check/testdata/array/fail_bound_negative.carbon b/toolchain/check/testdata/array/fail_bound_negative.carbon index a262268b7a816..8d73ce7929ea9 100644 --- a/toolchain/check/testdata/array/fail_bound_negative.carbon +++ b/toolchain/check/testdata/array/fail_bound_negative.carbon @@ -22,22 +22,6 @@ var a: [i32; Negate(1)]; // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %Negate.type.1: type = fn_type @Negate.1 [template] // CHECK:STDOUT: %Negate: %Negate.type.1 = struct_value () [template] -// CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] -// CHECK:STDOUT: %int_-1.1: %i32 = int_value -1 [template] -// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.3, @impl.2(%int_32) [template] -// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [template] -// CHECK:STDOUT: %interface.6: = interface_witness (%Convert.11) [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_-1.1, %Convert.11 [template] -// CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.3(%int_32) [template] -// CHECK:STDOUT: %int_-1.2: Core.IntLiteral = int_value -1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -62,35 +46,17 @@ var a: [i32; Negate(1)]; // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc11_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc11_14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc11_22: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc11_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %n.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc11: type = splice_block %i32.loc11_14 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc11_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc11_14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %n: %i32 = bind_name n, %n.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %Negate.ref: %Negate.type.1 = name_ref Negate, %Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc16_21: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc16_21: = bound_method %int_1, %impl.elem0.loc16_21 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc16_21: = specific_function %Convert.bound.loc16_21, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc16_21: init %i32 = call %Convert.specific_fn.loc16_21(%int_1) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc16_21.1: %i32 = value_of_initializer %int.convert_checked.loc16_21 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc16_21.2: %i32 = converted %int_1, %.loc16_21.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %int.snegate: init %i32 = call %Negate.ref(%.loc16_21.2) [template = constants.%int_-1.1] -// CHECK:STDOUT: %impl.elem0.loc16_22: %Convert.type.5 = interface_witness_access constants.%interface.6, element0 [template = constants.%Convert.11] -// CHECK:STDOUT: %Convert.bound.loc16_22: = bound_method %int.snegate, %impl.elem0.loc16_22 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc16_22: = specific_function %Convert.bound.loc16_22, @Convert.3(constants.%int_32) [template = constants.%Convert.specific_fn.2] -// CHECK:STDOUT: %.loc16_22.1: %i32 = value_of_initializer %int.snegate [template = constants.%int_-1.1] -// CHECK:STDOUT: %.loc16_22.2: %i32 = converted %int.snegate, %.loc16_22.1 [template = constants.%int_-1.1] -// CHECK:STDOUT: %int.convert_checked.loc16_22: init Core.IntLiteral = call %Convert.specific_fn.loc16_22(%.loc16_22.2) [template = constants.%int_-1.2] -// CHECK:STDOUT: %.loc16_22.3: Core.IntLiteral = value_of_initializer %int.convert_checked.loc16_22 [template = constants.%int_-1.2] -// CHECK:STDOUT: %.loc16_22.4: Core.IntLiteral = converted %int.snegate, %.loc16_22.3 [template = constants.%int_-1.2] -// CHECK:STDOUT: %array_type: type = array_type %.loc16_22.4, %i32 [template = ] // CHECK:STDOUT: %a.var: ref = var a // CHECK:STDOUT: %a: ref = bind_name a, %a.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/array/fail_bound_overflow.carbon b/toolchain/check/testdata/array/fail_bound_overflow.carbon index 4c2a086cf6832..3566457a3c175 100644 --- a/toolchain/check/testdata/array/fail_bound_overflow.carbon +++ b/toolchain/check/testdata/array/fail_bound_overflow.carbon @@ -25,10 +25,6 @@ var b: [1; 39999999999999999993]; // CHECK:STDOUT: --- fail_bound_overflow.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] -// CHECK:STDOUT: %int_39999999999999999993: Core.IntLiteral = int_value 39999999999999999993 [template] -// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -47,16 +43,8 @@ var b: [1; 39999999999999999993]; // CHECK:STDOUT: .b = %b // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_39999999999999999993.loc15: Core.IntLiteral = int_value 39999999999999999993 [template = constants.%int_39999999999999999993] -// CHECK:STDOUT: %array_type.loc15: type = array_type %int_39999999999999999993.loc15, %i32 [template = ] // CHECK:STDOUT: %a.var: ref = var a // CHECK:STDOUT: %a: ref = bind_name a, %a.var -// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1] -// CHECK:STDOUT: %int_39999999999999999993.loc23: Core.IntLiteral = int_value 39999999999999999993 [template = constants.%int_39999999999999999993] -// CHECK:STDOUT: %.loc23: type = converted %int_1, [template = ] -// CHECK:STDOUT: %array_type.loc23: type = array_type %int_39999999999999999993.loc23, [template = ] // CHECK:STDOUT: %b.var: ref = var b // CHECK:STDOUT: %b: ref = bind_name b, %b.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/array/fail_incomplete_element.carbon b/toolchain/check/testdata/array/fail_incomplete_element.carbon index 1d71e7496c870..646553e5fc297 100644 --- a/toolchain/check/testdata/array/fail_incomplete_element.carbon +++ b/toolchain/check/testdata/array/fail_incomplete_element.carbon @@ -24,8 +24,6 @@ var p: Incomplete* = &a[0]; // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %Incomplete: type = class_type @Incomplete [template] -// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %array_type: type = array_type %int_1, %Incomplete [template] // CHECK:STDOUT: %ptr: type = ptr_type %Incomplete [template] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: } @@ -46,13 +44,8 @@ var p: Incomplete* = &a[0]; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Incomplete.decl: type = class_decl @Incomplete [template = constants.%Incomplete] {} {} -// CHECK:STDOUT: %Incomplete.ref.loc19: type = name_ref Incomplete, %Incomplete.decl [template = constants.%Incomplete] -// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1] -// CHECK:STDOUT: %array_type: type = array_type %int_1, %Incomplete [template = constants.%array_type] // CHECK:STDOUT: %a.var: ref = var a // CHECK:STDOUT: %a: ref = bind_name a, %a.var -// CHECK:STDOUT: %Incomplete.ref.loc21: type = name_ref Incomplete, %Incomplete.decl [template = constants.%Incomplete] -// CHECK:STDOUT: %ptr: type = ptr_type %Incomplete [template = constants.%ptr] // CHECK:STDOUT: %p.var: ref %ptr = var p // CHECK:STDOUT: %p: ref %ptr = bind_name p, %p.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/array/fail_invalid_type.carbon b/toolchain/check/testdata/array/fail_invalid_type.carbon index ebd146e51f09e..71129eb3a35e1 100644 --- a/toolchain/check/testdata/array/fail_invalid_type.carbon +++ b/toolchain/check/testdata/array/fail_invalid_type.carbon @@ -19,7 +19,6 @@ var a: [1; 1]; // CHECK:STDOUT: --- fail_invalid_type.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -36,10 +35,6 @@ var a: [1; 1]; // CHECK:STDOUT: .a = %a // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int_1.loc17_9: Core.IntLiteral = int_value 1 [template = constants.%int_1] -// CHECK:STDOUT: %int_1.loc17_12: Core.IntLiteral = int_value 1 [template = constants.%int_1] -// CHECK:STDOUT: %.loc17: type = converted %int_1.loc17_9, [template = ] -// CHECK:STDOUT: %array_type: type = array_type %int_1.loc17_12, [template = ] // CHECK:STDOUT: %a.var: ref = var a // CHECK:STDOUT: %a: ref = bind_name a, %a.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/array/fail_out_of_bound.carbon b/toolchain/check/testdata/array/fail_out_of_bound.carbon index 2a6703503e50f..3ca3a4a106a2c 100644 --- a/toolchain/check/testdata/array/fail_out_of_bound.carbon +++ b/toolchain/check/testdata/array/fail_out_of_bound.carbon @@ -39,10 +39,6 @@ var a: [i32; 1] = (1, 2, 3); // CHECK:STDOUT: .a = %a // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1] -// CHECK:STDOUT: %array_type: type = array_type %int_1, %i32 [template = constants.%array_type] // CHECK:STDOUT: %a.var: ref %array_type = var a // CHECK:STDOUT: %a: ref %array_type = bind_name a, %a.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/array/fail_out_of_bound_non_literal.carbon b/toolchain/check/testdata/array/fail_out_of_bound_non_literal.carbon index df76585e27475..60d8cd1bfd8d0 100644 --- a/toolchain/check/testdata/array/fail_out_of_bound_non_literal.carbon +++ b/toolchain/check/testdata/array/fail_out_of_bound_non_literal.carbon @@ -59,14 +59,8 @@ var b: i32 = a[{.index = 3}.index]; // CHECK:STDOUT: .b = %b // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int_32.loc11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] -// CHECK:STDOUT: %array_type: type = array_type %int_3, %i32 [template = constants.%array_type] // CHECK:STDOUT: %a.var: ref %array_type = var a // CHECK:STDOUT: %a: ref %array_type = bind_name a, %a.var -// CHECK:STDOUT: %int_32.loc15: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc15: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %b.var: ref %i32 = var b // CHECK:STDOUT: %b: ref %i32 = bind_name b, %b.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/array/fail_type_mismatch.carbon b/toolchain/check/testdata/array/fail_type_mismatch.carbon index 072888fe8dad6..9f4537cbc912f 100644 --- a/toolchain/check/testdata/array/fail_type_mismatch.carbon +++ b/toolchain/check/testdata/array/fail_type_mismatch.carbon @@ -58,11 +58,9 @@ var d: [i32; 3] = t2; // CHECK:STDOUT: %Convert.bound: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] -// CHECK:STDOUT: %tuple.type.2: type = tuple_type (type, type, type) [template] // CHECK:STDOUT: %tuple.type.3: type = tuple_type (%i32, String, String) [template] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %tuple.type.5: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [template] -// CHECK:STDOUT: %tuple.type.6: type = tuple_type (type, type) [template] // CHECK:STDOUT: %tuple.type.7: type = tuple_type (%i32, %i32) [template] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -86,42 +84,16 @@ var d: [i32; 3] = t2; // CHECK:STDOUT: .d = %d // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int_32.loc18: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc18: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_3.loc18: Core.IntLiteral = int_value 3 [template = constants.%int_3] -// CHECK:STDOUT: %array_type.loc18: type = array_type %int_3.loc18, %i32 [template = constants.%array_type] // CHECK:STDOUT: %a.var: ref %array_type = var a // CHECK:STDOUT: %a: ref %array_type = bind_name a, %a.var -// CHECK:STDOUT: %int_32.loc20: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc20: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc20_29.1: %tuple.type.2 = tuple_literal (%i32.loc20, String, String) -// CHECK:STDOUT: %.loc20_29.2: type = converted %.loc20_29.1, constants.%tuple.type.3 [template = constants.%tuple.type.3] // CHECK:STDOUT: %t1.var: ref %tuple.type.3 = var t1 // CHECK:STDOUT: %t1: ref %tuple.type.3 = bind_name t1, %t1.var -// CHECK:STDOUT: %int_32.loc28: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc28: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_3.loc28: Core.IntLiteral = int_value 3 [template = constants.%int_3] -// CHECK:STDOUT: %array_type.loc28: type = array_type %int_3.loc28, %i32 [template = constants.%array_type] // CHECK:STDOUT: %b.var: ref %array_type = var b // CHECK:STDOUT: %b: ref %array_type = bind_name b, %b.var -// CHECK:STDOUT: %int_32.loc34: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc34: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_3.loc34: Core.IntLiteral = int_value 3 [template = constants.%int_3] -// CHECK:STDOUT: %array_type.loc34: type = array_type %int_3.loc34, %i32 [template = constants.%array_type] // CHECK:STDOUT: %c.var: ref %array_type = var c // CHECK:STDOUT: %c: ref %array_type = bind_name c, %c.var -// CHECK:STDOUT: %int_32.loc36_10: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc36_10: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc36_15: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc36_15: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc36_18.1: %tuple.type.6 = tuple_literal (%i32.loc36_10, %i32.loc36_15) -// CHECK:STDOUT: %.loc36_18.2: type = converted %.loc36_18.1, constants.%tuple.type.7 [template = constants.%tuple.type.7] // CHECK:STDOUT: %t2.var: ref %tuple.type.7 = var t2 // CHECK:STDOUT: %t2: ref %tuple.type.7 = bind_name t2, %t2.var -// CHECK:STDOUT: %int_32.loc40: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc40: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_3.loc40: Core.IntLiteral = int_value 3 [template = constants.%int_3] -// CHECK:STDOUT: %array_type.loc40: type = array_type %int_3.loc40, %i32 [template = constants.%array_type] // CHECK:STDOUT: %d.var: ref %array_type = var d // CHECK:STDOUT: %d: ref %array_type = bind_name d, %d.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/array/function_param.carbon b/toolchain/check/testdata/array/function_param.carbon index e0cd796efac20..83fef56138da9 100644 --- a/toolchain/check/testdata/array/function_param.carbon +++ b/toolchain/check/testdata/array/function_param.carbon @@ -71,17 +71,21 @@ fn G() -> i32 { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc11_12: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc11_12: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] -// CHECK:STDOUT: %array_type: type = array_type %int_3, %i32 [template = constants.%array_type] -// CHECK:STDOUT: %int_32.loc11_24: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc11_24: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc11_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc11_32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %arr.param: %array_type = value_param runtime_param0 +// CHECK:STDOUT: %.loc11_18: type = splice_block %array_type [template = constants.%array_type] { +// CHECK:STDOUT: %int_32.loc11_12: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc11_12: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] +// CHECK:STDOUT: %array_type: type = array_type %int_3, %i32 [template = constants.%array_type] +// CHECK:STDOUT: } // CHECK:STDOUT: %arr: %array_type = bind_name arr, %arr.param // CHECK:STDOUT: %i.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %.loc11_24: type = splice_block %i32.loc11_24 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc11_24: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc11_24: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %i: %i32 = bind_name i, %i.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param diff --git a/toolchain/check/testdata/array/generic_empty.carbon b/toolchain/check/testdata/array/generic_empty.carbon index b5cb4b349da11..b834d15677180 100644 --- a/toolchain/check/testdata/array/generic_empty.carbon +++ b/toolchain/check/testdata/array/generic_empty.carbon @@ -54,20 +54,17 @@ fn G(T:! type) { // CHECK:STDOUT: %T.patt.loc11_6.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc11_6.2 (constants.%T.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %array_type.loc13_17.2: type = array_type constants.%int_0, @G.%T.loc11_6.2 (%T) [symbolic = %array_type.loc13_17.2 (constants.%array_type)] -// CHECK:STDOUT: %require_complete: = require_complete_type @G.%array_type.loc13_17.2 (%array_type) [symbolic = %require_complete (constants.%require_complete)] -// CHECK:STDOUT: %array: @G.%array_type.loc13_17.2 (%array_type) = tuple_value () [symbolic = %array (constants.%array)] +// CHECK:STDOUT: %array_type: type = array_type constants.%int_0, @G.%T.loc11_6.2 (%T) [symbolic = %array_type (constants.%array_type)] +// CHECK:STDOUT: %require_complete: = require_complete_type @G.%array_type (%array_type) [symbolic = %require_complete (constants.%require_complete)] +// CHECK:STDOUT: %array: @G.%array_type (%array_type) = tuple_value () [symbolic = %array (constants.%array)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%T.param_patt: type) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc11_6.1 [symbolic = %T.loc11_6.2 (constants.%T)] -// CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0] -// CHECK:STDOUT: %array_type.loc13_17.1: type = array_type %int_0, %T [symbolic = %array_type.loc13_17.2 (constants.%array_type)] -// CHECK:STDOUT: %arr.var: ref @G.%array_type.loc13_17.2 (%array_type) = var arr -// CHECK:STDOUT: %arr: ref @G.%array_type.loc13_17.2 (%array_type) = bind_name arr, %arr.var +// CHECK:STDOUT: %arr.var: ref @G.%array_type (%array_type) = var arr +// CHECK:STDOUT: %arr: ref @G.%array_type (%array_type) = bind_name arr, %arr.var // CHECK:STDOUT: %.loc13_22.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc13_22.2: init @G.%array_type.loc13_17.2 (%array_type) = array_init () to %arr.var [symbolic = %array (constants.%array)] -// CHECK:STDOUT: %.loc13_23: init @G.%array_type.loc13_17.2 (%array_type) = converted %.loc13_22.1, %.loc13_22.2 [symbolic = %array (constants.%array)] +// CHECK:STDOUT: %.loc13_22.2: init @G.%array_type (%array_type) = array_init () to %arr.var [symbolic = %array (constants.%array)] +// CHECK:STDOUT: %.loc13_23: init @G.%array_type (%array_type) = converted %.loc13_22.1, %.loc13_22.2 [symbolic = %array (constants.%array)] // CHECK:STDOUT: assign %arr.var, %.loc13_23 // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/array/import.carbon b/toolchain/check/testdata/array/import.carbon index 386005f97f55c..ba7d24c01d9d7 100644 --- a/toolchain/check/testdata/array/import.carbon +++ b/toolchain/check/testdata/array/import.carbon @@ -98,11 +98,13 @@ fn G(n: i32) -> i32 { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc4_9: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc4_9: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc4_17: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc4_17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %n.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc4: type = splice_block %i32.loc4_9 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc4_9: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc4_9: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %n: %i32 = bind_name n, %n.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param diff --git a/toolchain/check/testdata/array/index_not_literal.carbon b/toolchain/check/testdata/array/index_not_literal.carbon index 6864670828873..53980489b320b 100644 --- a/toolchain/check/testdata/array/index_not_literal.carbon +++ b/toolchain/check/testdata/array/index_not_literal.carbon @@ -56,14 +56,8 @@ var b: i32 = a[{.index = 2}.index]; // CHECK:STDOUT: .b = %b // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int_32.loc11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] -// CHECK:STDOUT: %array_type: type = array_type %int_3, %i32 [template = constants.%array_type] // CHECK:STDOUT: %a.var: ref %array_type = var a // CHECK:STDOUT: %a: ref %array_type = bind_name a, %a.var -// CHECK:STDOUT: %int_32.loc12: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc12: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %b.var: ref %i32 = var b // CHECK:STDOUT: %b: ref %i32 = bind_name b, %b.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/array/nine_elements.carbon b/toolchain/check/testdata/array/nine_elements.carbon index cd514aa9c9f77..43aa7a1a5988b 100644 --- a/toolchain/check/testdata/array/nine_elements.carbon +++ b/toolchain/check/testdata/array/nine_elements.carbon @@ -76,10 +76,6 @@ var a: [i32; 9] = (1, 2, 3, 4, 5, 6, 7, 8, 9); // CHECK:STDOUT: .a = %a // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_9: Core.IntLiteral = int_value 9 [template = constants.%int_9.1] -// CHECK:STDOUT: %array_type: type = array_type %int_9, %i32 [template = constants.%array_type] // CHECK:STDOUT: %a.var: ref %array_type = var a // CHECK:STDOUT: %a: ref %array_type = bind_name a, %a.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/as/adapter_conversion.carbon b/toolchain/check/testdata/as/adapter_conversion.carbon index df56a25ad0dad..e36fcbcce4024 100644 --- a/toolchain/check/testdata/as/adapter_conversion.carbon +++ b/toolchain/check/testdata/as/adapter_conversion.carbon @@ -157,24 +157,14 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %A.decl: type = class_decl @A [template = constants.%A] {} {} // CHECK:STDOUT: %B.decl: type = class_decl @B [template = constants.%B] {} {} -// CHECK:STDOUT: %A.ref.loc17: type = name_ref A, %A.decl [template = constants.%A] // CHECK:STDOUT: %a_ref.var: ref %A = var a_ref // CHECK:STDOUT: %a_ref: ref %A = bind_name a_ref, %a_ref.var -// CHECK:STDOUT: %A.ref.loc18: type = name_ref A, %A.decl [template = constants.%A] -// CHECK:STDOUT: %B.ref.loc21: type = name_ref B, %B.decl [template = constants.%B] -// CHECK:STDOUT: %B.ref.loc22: type = name_ref B, %B.decl [template = constants.%B] -// CHECK:STDOUT: %ptr: type = ptr_type %B [template = constants.%ptr.2] -// CHECK:STDOUT: %B.ref.loc24: type = name_ref B, %B.decl [template = constants.%B] // CHECK:STDOUT: %b_factory.var: ref %B = var b_factory // CHECK:STDOUT: %b_factory: ref %B = bind_name b_factory, %b_factory.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @A { -// CHECK:STDOUT: %int_32.loc5: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc5: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc5: %A.elem = field_decl x, element0 [template] -// CHECK:STDOUT: %int_32.loc6: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc6: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc6: %A.elem = field_decl y, element1 [template] // CHECK:STDOUT: %Make.decl: %Make.type = fn_decl @Make [template = constants.%Make] { // CHECK:STDOUT: %return.patt: %A = return_slot_pattern @@ -311,9 +301,6 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %A.decl: type = class_decl @A [template = constants.%A] {} {} -// CHECK:STDOUT: %A.ref: type = name_ref A, %A.decl [template = constants.%A] -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @A { @@ -384,7 +371,6 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: %B.decl: type = class_decl @B [template = constants.%B] {} {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: %D.decl: type = class_decl @D [template = constants.%D] {} {} -// CHECK:STDOUT: %D.ref: type = name_ref D, %D.decl [template = constants.%D] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @A { @@ -485,18 +471,12 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %A.decl: type = class_decl @A [template = constants.%A] {} {} // CHECK:STDOUT: %B.decl: type = class_decl @B [template = constants.%B] {} {} -// CHECK:STDOUT: %B.ref.loc13: type = name_ref B, %B.decl [template = constants.%B] -// CHECK:STDOUT: %B.ref.loc24: type = name_ref B, %B.decl [template = constants.%B] // CHECK:STDOUT: %b_init.var: ref %B = var b_init // CHECK:STDOUT: %b_init: ref %B = bind_name b_init, %b_init.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @A { -// CHECK:STDOUT: %int_32.loc5: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc5: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc5: %A.elem = field_decl x, element0 [template] -// CHECK:STDOUT: %int_32.loc6: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc6: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc6: %A.elem = field_decl y, element1 [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.x.y.1 [template = constants.%complete_type.3] // CHECK:STDOUT: @@ -609,14 +589,11 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %A.decl: type = class_decl @A [template = constants.%A] {} {} // CHECK:STDOUT: %B.decl: type = class_decl @B [template = constants.%B] {} {} -// CHECK:STDOUT: %B.ref: type = name_ref B, %B.decl [template = constants.%B] // CHECK:STDOUT: %b.var: ref %B = var b // CHECK:STDOUT: %b: ref %B = bind_name b, %b.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @A { -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc5: %A.elem = field_decl x, element0 [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.x.1 [template = constants.%complete_type.3] // CHECK:STDOUT: diff --git a/toolchain/check/testdata/as/fail_no_conversion.carbon b/toolchain/check/testdata/as/fail_no_conversion.carbon index 69e583751d471..4cfebd498b8d7 100644 --- a/toolchain/check/testdata/as/fail_no_conversion.carbon +++ b/toolchain/check/testdata/as/fail_no_conversion.carbon @@ -41,12 +41,6 @@ let n: (i32, i32) = 1 as (i32, i32); // CHECK:STDOUT: .n = @__global_init.%n // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int_32.loc17_9: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc17_9: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc17_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc17_14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc17_17.1: %tuple.type.1 = tuple_literal (%i32.loc17_9, %i32.loc17_14) -// CHECK:STDOUT: %.loc17_17.2: type = converted %.loc17_17.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { diff --git a/toolchain/check/testdata/as/fail_not_type.carbon b/toolchain/check/testdata/as/fail_not_type.carbon index 18c0aa0bdcf94..804c9eb87de69 100644 --- a/toolchain/check/testdata/as/fail_not_type.carbon +++ b/toolchain/check/testdata/as/fail_not_type.carbon @@ -40,8 +40,6 @@ let n: i32 = 1 as 2; // CHECK:STDOUT: .n = @__global_init.%n // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { diff --git a/toolchain/check/testdata/as/identity.carbon b/toolchain/check/testdata/as/identity.carbon index c7d63cca4baaa..ca2331739ee3f 100644 --- a/toolchain/check/testdata/as/identity.carbon +++ b/toolchain/check/testdata/as/identity.carbon @@ -67,17 +67,19 @@ fn Initializing() { // CHECK:STDOUT: %n.patt: %X = binding_pattern n // CHECK:STDOUT: %n.param_patt: %X = value_param_pattern %n.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %X.ref.loc17: type = name_ref X, file.%X.decl [template = constants.%X] // CHECK:STDOUT: %n.param: %X = value_param runtime_param0 +// CHECK:STDOUT: %X.ref.loc17: type = name_ref X, file.%X.decl [template = constants.%X] // CHECK:STDOUT: %n: %X = bind_name n, %n.param // CHECK:STDOUT: } // CHECK:STDOUT: %Reference.decl: %Reference.type = fn_decl @Reference [template = constants.%Reference] { // CHECK:STDOUT: %p.patt: %ptr.2 = binding_pattern p // CHECK:STDOUT: %p.param_patt: %ptr.2 = value_param_pattern %p.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %X.ref.loc21: type = name_ref X, file.%X.decl [template = constants.%X] -// CHECK:STDOUT: %ptr.loc21: type = ptr_type %X [template = constants.%ptr.2] // CHECK:STDOUT: %p.param: %ptr.2 = value_param runtime_param0 +// CHECK:STDOUT: %.loc21: type = splice_block %ptr [template = constants.%ptr.2] { +// CHECK:STDOUT: %X.ref.loc21: type = name_ref X, file.%X.decl [template = constants.%X] +// CHECK:STDOUT: %ptr: type = ptr_type %X [template = constants.%ptr.2] +// CHECK:STDOUT: } // CHECK:STDOUT: %p: %ptr.2 = bind_name p, %p.param // CHECK:STDOUT: } // CHECK:STDOUT: %Make.decl: %Make.type = fn_decl @Make [template = constants.%Make] { @@ -101,20 +103,17 @@ fn Initializing() { // CHECK:STDOUT: // CHECK:STDOUT: fn @Value(%n.param_patt: %X) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %X.ref.loc18_10: type = name_ref X, file.%X.decl [template = constants.%X] // CHECK:STDOUT: %n.ref: %X = name_ref n, %n -// CHECK:STDOUT: %X.ref.loc18_19: type = name_ref X, file.%X.decl [template = constants.%X] +// CHECK:STDOUT: %X.ref.loc18: type = name_ref X, file.%X.decl [template = constants.%X] // CHECK:STDOUT: %m: %X = bind_name m, %n.ref // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Reference(%p.param_patt: %ptr.2) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %X.ref.loc22_10: type = name_ref X, file.%X.decl [template = constants.%X] -// CHECK:STDOUT: %ptr.loc22: type = ptr_type %X [template = constants.%ptr.2] // CHECK:STDOUT: %p.ref: %ptr.2 = name_ref p, %p // CHECK:STDOUT: %.loc22: ref %X = deref %p.ref -// CHECK:STDOUT: %X.ref.loc22_23: type = name_ref X, file.%X.decl [template = constants.%X] +// CHECK:STDOUT: %X.ref.loc22: type = name_ref X, file.%X.decl [template = constants.%X] // CHECK:STDOUT: %addr: %ptr.2 = addr_of %.loc22 // CHECK:STDOUT: %q: %ptr.2 = bind_name q, %addr // CHECK:STDOUT: return @@ -124,13 +123,12 @@ fn Initializing() { // CHECK:STDOUT: // CHECK:STDOUT: fn @Initializing() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %X.ref.loc28_10: type = name_ref X, file.%X.decl [template = constants.%X] // CHECK:STDOUT: %x.var: ref %X = var x // CHECK:STDOUT: %x: ref %X = bind_name x, %x.var // CHECK:STDOUT: %Make.ref: %Make.type = name_ref Make, file.%Make.decl [template = constants.%Make] // CHECK:STDOUT: %.loc28: ref %X = splice_block %x.var {} // CHECK:STDOUT: %Make.call: init %X = call %Make.ref() to %.loc28 -// CHECK:STDOUT: %X.ref.loc28_25: type = name_ref X, file.%X.decl [template = constants.%X] +// CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [template = constants.%X] // CHECK:STDOUT: assign %x.var, %Make.call // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/as/no_prelude/tuple.carbon b/toolchain/check/testdata/as/no_prelude/tuple.carbon index f905622985bb5..83061e85677a7 100644 --- a/toolchain/check/testdata/as/no_prelude/tuple.carbon +++ b/toolchain/check/testdata/as/no_prelude/tuple.carbon @@ -72,10 +72,6 @@ fn Var() { // CHECK:STDOUT: // CHECK:STDOUT: fn @Let() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %X.ref.loc19_11: type = name_ref X, file.%X.decl [template = constants.%X] -// CHECK:STDOUT: %X.ref.loc19_14: type = name_ref X, file.%X.decl [template = constants.%X] -// CHECK:STDOUT: %.loc19_15.1: %tuple.type.1 = tuple_literal (%X.ref.loc19_11, %X.ref.loc19_14) -// CHECK:STDOUT: %.loc19_15.2: type = converted %.loc19_15.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %Make.ref.loc19_20: %Make.type = name_ref Make, file.%Make.decl [template = constants.%Make] // CHECK:STDOUT: %.loc19_25.1: ref %X = temporary_storage // CHECK:STDOUT: %Make.call.loc19_25: init %X = call %Make.ref.loc19_20() to %.loc19_25.1 @@ -99,10 +95,6 @@ fn Var() { // CHECK:STDOUT: // CHECK:STDOUT: fn @Var() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %X.ref.loc24_11: type = name_ref X, file.%X.decl [template = constants.%X] -// CHECK:STDOUT: %X.ref.loc24_14: type = name_ref X, file.%X.decl [template = constants.%X] -// CHECK:STDOUT: %.loc24_15.1: %tuple.type.1 = tuple_literal (%X.ref.loc24_11, %X.ref.loc24_14) -// CHECK:STDOUT: %.loc24_15.2: type = converted %.loc24_15.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %b.var: ref %tuple.type.2 = var b // CHECK:STDOUT: %b: ref %tuple.type.2 = bind_name b, %b.var // CHECK:STDOUT: %Make.ref.loc24_20: %Make.type = name_ref Make, file.%Make.decl [template = constants.%Make] diff --git a/toolchain/check/testdata/as/overloaded.carbon b/toolchain/check/testdata/as/overloaded.carbon index 8212121495e51..3c8462ee80933 100644 --- a/toolchain/check/testdata/as/overloaded.carbon +++ b/toolchain/check/testdata/as/overloaded.carbon @@ -87,8 +87,6 @@ let n: i32 = ((4 as i32) as X) as i32; // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %As.type: type = facet_type <@As, @As(constants.%i32)> [template = constants.%As.type.4] // CHECK:STDOUT: } -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.1: %i32 as %As.type { @@ -98,10 +96,12 @@ let n: i32 = ((4 as i32) as X) as i32; // CHECK:STDOUT: %return.patt: %X = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %X = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [template = constants.%X] // CHECK:STDOUT: %self.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc16_20: type = splice_block %i32 [template = constants.%i32] { +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %self: %i32 = bind_name self, %self.param // CHECK:STDOUT: %return.param: ref %X = out_param runtime_param1 // CHECK:STDOUT: %return: ref %X = return_slot %return.param @@ -120,10 +120,10 @@ let n: i32 = ((4 as i32) as X) as i32; // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [template = constants.%X] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %self.param: %X = value_param runtime_param0 +// CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [template = constants.%X] // CHECK:STDOUT: %self: %X = bind_name self, %self.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -136,8 +136,6 @@ let n: i32 = ((4 as i32) as X) as i32; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @X { -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc12: %X.elem = field_decl n, element0 [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.n [template = constants.%complete_type.3] // CHECK:STDOUT: diff --git a/toolchain/check/testdata/basics/builtin_types.carbon b/toolchain/check/testdata/basics/builtin_types.carbon index 33d0bc462bdb8..1852151eacc37 100644 --- a/toolchain/check/testdata/basics/builtin_types.carbon +++ b/toolchain/check/testdata/basics/builtin_types.carbon @@ -26,9 +26,6 @@ var test_type: type = i32; // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] -// CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [template] -// CHECK:STDOUT: %Float.type: type = fn_type @Float [template] -// CHECK:STDOUT: %Float: %Float.type = struct_value () [template] // CHECK:STDOUT: %float: f64 = float_literal 0.10000000000000001 [template] // CHECK:STDOUT: %str: String = string_literal "Test" [template] // CHECK:STDOUT: } @@ -52,14 +49,8 @@ var test_type: type = i32; // CHECK:STDOUT: .test_type = %test_type // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %test_i32.var: ref %i32 = var test_i32 // CHECK:STDOUT: %test_i32: ref %i32 = bind_name test_i32, %test_i32.var -// CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type: init type = call constants.%Float(%int_64) [template = f64] -// CHECK:STDOUT: %.loc12_15.1: type = value_of_initializer %float.make_type [template = f64] -// CHECK:STDOUT: %.loc12_15.2: type = converted %float.make_type, %.loc12_15.1 [template = f64] // CHECK:STDOUT: %test_f64.var: ref f64 = var test_f64 // CHECK:STDOUT: %test_f64: ref f64 = bind_name test_f64, %test_f64.var // CHECK:STDOUT: %test_type.var: ref type = var test_type diff --git a/toolchain/check/testdata/basics/fail_bad_run_2.carbon b/toolchain/check/testdata/basics/fail_bad_run_2.carbon index e0e7c47161fe9..bbe34ec1f04b1 100644 --- a/toolchain/check/testdata/basics/fail_bad_run_2.carbon +++ b/toolchain/check/testdata/basics/fail_bad_run_2.carbon @@ -40,9 +40,11 @@ fn Run(n: i32) {} // CHECK:STDOUT: %n.patt: %i32 = binding_pattern n // CHECK:STDOUT: %n.param_patt: %i32 = value_param_pattern %n.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %n.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc14: type = splice_block %i32 [template = constants.%i32] { +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %n: %i32 = bind_name n, %n.param // CHECK:STDOUT: } // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/basics/fail_numeric_literal_overflow.carbon b/toolchain/check/testdata/basics/fail_numeric_literal_overflow.carbon index 3a7a956a7d338..6a6d77d70900f 100644 --- a/toolchain/check/testdata/basics/fail_numeric_literal_overflow.carbon +++ b/toolchain/check/testdata/basics/fail_numeric_literal_overflow.carbon @@ -54,9 +54,6 @@ let e: f64 = 5.0e39999999999999999993; // CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2147483648.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2147483648.2: %i32 = int_value 2147483648 [template] -// CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [template] -// CHECK:STDOUT: %Float.type: type = fn_type @Float [template] -// CHECK:STDOUT: %Float: %Float.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -79,20 +76,6 @@ let e: f64 = 5.0e39999999999999999993; // CHECK:STDOUT: .e = @__global_init.%e // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int_32.loc15: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc15: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc21: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc21: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_64.loc33: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc33: init type = call constants.%Float(%int_64.loc33) [template = f64] -// CHECK:STDOUT: %.loc33_8.1: type = value_of_initializer %float.make_type.loc33 [template = f64] -// CHECK:STDOUT: %.loc33_8.2: type = converted %float.make_type.loc33, %.loc33_8.1 [template = f64] -// CHECK:STDOUT: %int_64.loc38: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc38: init type = call constants.%Float(%int_64.loc38) [template = f64] -// CHECK:STDOUT: %.loc38_8.1: type = value_of_initializer %float.make_type.loc38 [template = f64] -// CHECK:STDOUT: %.loc38_8.2: type = converted %float.make_type.loc38, %.loc38_8.1 [template = f64] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { diff --git a/toolchain/check/testdata/basics/no_prelude/multifile_raw_and_textual_ir.carbon b/toolchain/check/testdata/basics/no_prelude/multifile_raw_and_textual_ir.carbon index 85ad0be50c147..fb22d00d7cb53 100644 --- a/toolchain/check/testdata/basics/no_prelude/multifile_raw_and_textual_ir.carbon +++ b/toolchain/check/testdata/basics/no_prelude/multifile_raw_and_textual_ir.carbon @@ -36,7 +36,7 @@ fn B() { // CHECK:STDOUT: name_scope0: {inst: inst12, parent_scope: name_scope, has_error: false, extended_scopes: [], names: {name0: inst13}} // CHECK:STDOUT: entity_names: {} // CHECK:STDOUT: functions: -// CHECK:STDOUT: function0: {name: name0, parent_scope: name_scope0, body: [inst_block4]} +// CHECK:STDOUT: function0: {name: name0, parent_scope: name_scope0, body: [inst_block5]} // CHECK:STDOUT: classes: {} // CHECK:STDOUT: generics: {} // CHECK:STDOUT: specifics: {} @@ -70,9 +70,10 @@ fn B() { // CHECK:STDOUT: 0: inst13 // CHECK:STDOUT: import_refs: {} // CHECK:STDOUT: global_init: {} -// CHECK:STDOUT: inst_block4: -// CHECK:STDOUT: 0: inst17 +// CHECK:STDOUT: inst_block4: {} // CHECK:STDOUT: inst_block5: +// CHECK:STDOUT: 0: inst17 +// CHECK:STDOUT: inst_block6: // CHECK:STDOUT: 0: inst12 // CHECK:STDOUT: 1: inst13 // CHECK:STDOUT: ... @@ -111,7 +112,7 @@ fn B() { // CHECK:STDOUT: entity_names: // CHECK:STDOUT: entity_name0: {name: name1, parent_scope: name_scope1, index: comp_time_bind} // CHECK:STDOUT: functions: -// CHECK:STDOUT: function0: {name: name0, parent_scope: name_scope0, body: [inst_block4]} +// CHECK:STDOUT: function0: {name: name0, parent_scope: name_scope0, body: [inst_block5]} // CHECK:STDOUT: function1: {name: name1, parent_scope: name_scope1} // CHECK:STDOUT: classes: {} // CHECK:STDOUT: generics: {} @@ -165,12 +166,13 @@ fn B() { // CHECK:STDOUT: 0: inst14 // CHECK:STDOUT: 1: inst20 // CHECK:STDOUT: global_init: {} -// CHECK:STDOUT: inst_block4: +// CHECK:STDOUT: inst_block4: {} +// CHECK:STDOUT: inst_block5: // CHECK:STDOUT: 0: inst19 // CHECK:STDOUT: 1: inst24 // CHECK:STDOUT: 2: inst25 // CHECK:STDOUT: 3: inst26 -// CHECK:STDOUT: inst_block5: +// CHECK:STDOUT: inst_block6: // CHECK:STDOUT: 0: inst12 // CHECK:STDOUT: 1: inst13 // CHECK:STDOUT: 2: inst15 diff --git a/toolchain/check/testdata/basics/no_prelude/multifile_raw_ir.carbon b/toolchain/check/testdata/basics/no_prelude/multifile_raw_ir.carbon index 42a95227cc8af..8e17cd105bf22 100644 --- a/toolchain/check/testdata/basics/no_prelude/multifile_raw_ir.carbon +++ b/toolchain/check/testdata/basics/no_prelude/multifile_raw_ir.carbon @@ -36,7 +36,7 @@ fn B() { // CHECK:STDOUT: name_scope0: {inst: inst12, parent_scope: name_scope, has_error: false, extended_scopes: [], names: {name0: inst13}} // CHECK:STDOUT: entity_names: {} // CHECK:STDOUT: functions: -// CHECK:STDOUT: function0: {name: name0, parent_scope: name_scope0, body: [inst_block4]} +// CHECK:STDOUT: function0: {name: name0, parent_scope: name_scope0, body: [inst_block5]} // CHECK:STDOUT: classes: {} // CHECK:STDOUT: generics: {} // CHECK:STDOUT: specifics: {} @@ -70,9 +70,10 @@ fn B() { // CHECK:STDOUT: 0: inst13 // CHECK:STDOUT: import_refs: {} // CHECK:STDOUT: global_init: {} -// CHECK:STDOUT: inst_block4: -// CHECK:STDOUT: 0: inst17 +// CHECK:STDOUT: inst_block4: {} // CHECK:STDOUT: inst_block5: +// CHECK:STDOUT: 0: inst17 +// CHECK:STDOUT: inst_block6: // CHECK:STDOUT: 0: inst12 // CHECK:STDOUT: 1: inst13 // CHECK:STDOUT: ... @@ -91,7 +92,7 @@ fn B() { // CHECK:STDOUT: entity_names: // CHECK:STDOUT: entity_name0: {name: name1, parent_scope: name_scope1, index: comp_time_bind} // CHECK:STDOUT: functions: -// CHECK:STDOUT: function0: {name: name0, parent_scope: name_scope0, body: [inst_block4]} +// CHECK:STDOUT: function0: {name: name0, parent_scope: name_scope0, body: [inst_block5]} // CHECK:STDOUT: function1: {name: name1, parent_scope: name_scope1} // CHECK:STDOUT: classes: {} // CHECK:STDOUT: generics: {} @@ -145,12 +146,13 @@ fn B() { // CHECK:STDOUT: 0: inst14 // CHECK:STDOUT: 1: inst20 // CHECK:STDOUT: global_init: {} -// CHECK:STDOUT: inst_block4: +// CHECK:STDOUT: inst_block4: {} +// CHECK:STDOUT: inst_block5: // CHECK:STDOUT: 0: inst19 // CHECK:STDOUT: 1: inst24 // CHECK:STDOUT: 2: inst25 // CHECK:STDOUT: 3: inst26 -// CHECK:STDOUT: inst_block5: +// CHECK:STDOUT: inst_block6: // CHECK:STDOUT: 0: inst12 // CHECK:STDOUT: 1: inst13 // CHECK:STDOUT: 2: inst15 diff --git a/toolchain/check/testdata/basics/no_prelude/raw_and_textual_ir.carbon b/toolchain/check/testdata/basics/no_prelude/raw_and_textual_ir.carbon index 34f376f44b3a7..08a3a4d1ee96c 100644 --- a/toolchain/check/testdata/basics/no_prelude/raw_and_textual_ir.carbon +++ b/toolchain/check/testdata/basics/no_prelude/raw_and_textual_ir.carbon @@ -23,11 +23,11 @@ fn Foo(n: ()) -> ((), ()) { // CHECK:STDOUT: ir0: {decl_id: inst, is_export: false} // CHECK:STDOUT: import_ir_insts: {} // CHECK:STDOUT: name_scopes: -// CHECK:STDOUT: name_scope0: {inst: inst12, parent_scope: name_scope, has_error: false, extended_scopes: [], names: {name0: inst31}} +// CHECK:STDOUT: name_scope0: {inst: inst12, parent_scope: name_scope, has_error: false, extended_scopes: [], names: {name0: inst32}} // CHECK:STDOUT: entity_names: // CHECK:STDOUT: entity_name0: {name: name1, parent_scope: name_scope, index: comp_time_bind} // CHECK:STDOUT: functions: -// CHECK:STDOUT: function0: {name: name0, parent_scope: name_scope0, return_slot_pattern: inst27, body: [inst_block9]} +// CHECK:STDOUT: function0: {name: name0, parent_scope: name_scope0, return_slot_pattern: inst27, body: [inst_block10]} // CHECK:STDOUT: classes: {} // CHECK:STDOUT: generics: {} // CHECK:STDOUT: specifics: {} @@ -37,10 +37,10 @@ fn Foo(n: ()) -> ((), ()) { // CHECK:STDOUT: 'type(TypeType)': {kind: copy, type: type(TypeType)} // CHECK:STDOUT: 'type(Error)': {kind: copy, type: type(Error)} // CHECK:STDOUT: 'type(inst(NamespaceType))': {kind: copy, type: type(inst(NamespaceType))} -// CHECK:STDOUT: 'type(inst32)': {kind: none, type: type(inst13)} +// CHECK:STDOUT: 'type(inst33)': {kind: none, type: type(inst13)} // CHECK:STDOUT: 'type(inst13)': {kind: none, type: type(inst13)} -// CHECK:STDOUT: 'type(inst21)': {kind: pointer, type: type(inst34)} -// CHECK:STDOUT: 'type(inst34)': {kind: copy, type: type(inst34)} +// CHECK:STDOUT: 'type(inst21)': {kind: pointer, type: type(inst35)} +// CHECK:STDOUT: 'type(inst35)': {kind: copy, type: type(inst35)} // CHECK:STDOUT: type_blocks: // CHECK:STDOUT: type_block0: {} // CHECK:STDOUT: type_block1: @@ -57,33 +57,34 @@ fn Foo(n: ()) -> ((), ()) { // CHECK:STDOUT: inst19: {kind: TupleLiteral, arg0: inst_block_empty, type: type(inst13)} // CHECK:STDOUT: inst20: {kind: TupleLiteral, arg0: inst_block_empty, type: type(inst13)} // CHECK:STDOUT: inst21: {kind: TupleType, arg0: type_block1, type: type(TypeType)} -// CHECK:STDOUT: inst22: {kind: TupleLiteral, arg0: inst_block5, type: type(inst21)} +// CHECK:STDOUT: inst22: {kind: TupleLiteral, arg0: inst_block6, type: type(inst21)} // CHECK:STDOUT: inst23: {kind: Converted, arg0: inst19, arg1: inst13, type: type(TypeType)} // CHECK:STDOUT: inst24: {kind: Converted, arg0: inst20, arg1: inst13, type: type(TypeType)} // CHECK:STDOUT: inst25: {kind: Converted, arg0: inst22, arg1: inst21, type: type(TypeType)} // CHECK:STDOUT: inst26: {kind: ReturnSlotPattern, arg0: inst22, type: type(inst21)} // CHECK:STDOUT: inst27: {kind: OutParamPattern, arg0: inst26, arg1: runtime_param1, type: type(inst21)} // CHECK:STDOUT: inst28: {kind: ValueParam, arg0: runtime_param0, arg1: name1, type: type(inst13)} -// CHECK:STDOUT: inst29: {kind: OutParam, arg0: runtime_param1, arg1: name(ReturnSlot), type: type(inst21)} -// CHECK:STDOUT: inst30: {kind: ReturnSlot, arg0: inst22, arg1: inst29, type: type(inst21)} -// CHECK:STDOUT: inst31: {kind: FunctionDecl, arg0: function0, arg1: inst_block8, type: type(inst32)} -// CHECK:STDOUT: inst32: {kind: FunctionType, arg0: function0, arg1: specific, type: type(TypeType)} -// CHECK:STDOUT: inst33: {kind: StructValue, arg0: inst_block_empty, type: type(inst32)} -// CHECK:STDOUT: inst34: {kind: PointerType, arg0: type(inst21), type: type(TypeType)} -// CHECK:STDOUT: inst35: {kind: NameRef, arg0: name1, arg1: inst16, type: type(inst13)} -// CHECK:STDOUT: inst36: {kind: TupleLiteral, arg0: inst_block_empty, type: type(inst13)} -// CHECK:STDOUT: inst37: {kind: TupleLiteral, arg0: inst_block10, type: type(inst21)} -// CHECK:STDOUT: inst38: {kind: TupleAccess, arg0: inst30, arg1: element0, type: type(inst13)} -// CHECK:STDOUT: inst39: {kind: TupleInit, arg0: inst_block11, arg1: inst38, type: type(inst13)} -// CHECK:STDOUT: inst40: {kind: TupleValue, arg0: inst_block_empty, type: type(inst13)} -// CHECK:STDOUT: inst41: {kind: Converted, arg0: inst35, arg1: inst39, type: type(inst13)} -// CHECK:STDOUT: inst42: {kind: TupleAccess, arg0: inst30, arg1: element1, type: type(inst13)} -// CHECK:STDOUT: inst43: {kind: TupleInit, arg0: inst_block_empty, arg1: inst42, type: type(inst13)} -// CHECK:STDOUT: inst44: {kind: Converted, arg0: inst36, arg1: inst43, type: type(inst13)} -// CHECK:STDOUT: inst45: {kind: TupleInit, arg0: inst_block12, arg1: inst30, type: type(inst21)} -// CHECK:STDOUT: inst46: {kind: TupleValue, arg0: inst_block13, type: type(inst21)} -// CHECK:STDOUT: inst47: {kind: Converted, arg0: inst37, arg1: inst45, type: type(inst21)} -// CHECK:STDOUT: inst48: {kind: ReturnExpr, arg0: inst47, arg1: inst30} +// CHECK:STDOUT: inst29: {kind: SpliceBlock, arg0: inst_block4, arg1: inst15, type: type(TypeType)} +// CHECK:STDOUT: inst30: {kind: OutParam, arg0: runtime_param1, arg1: name(ReturnSlot), type: type(inst21)} +// CHECK:STDOUT: inst31: {kind: ReturnSlot, arg0: inst22, arg1: inst30, type: type(inst21)} +// CHECK:STDOUT: inst32: {kind: FunctionDecl, arg0: function0, arg1: inst_block9, type: type(inst33)} +// CHECK:STDOUT: inst33: {kind: FunctionType, arg0: function0, arg1: specific, type: type(TypeType)} +// CHECK:STDOUT: inst34: {kind: StructValue, arg0: inst_block_empty, type: type(inst33)} +// CHECK:STDOUT: inst35: {kind: PointerType, arg0: type(inst21), type: type(TypeType)} +// CHECK:STDOUT: inst36: {kind: NameRef, arg0: name1, arg1: inst16, type: type(inst13)} +// CHECK:STDOUT: inst37: {kind: TupleLiteral, arg0: inst_block_empty, type: type(inst13)} +// CHECK:STDOUT: inst38: {kind: TupleLiteral, arg0: inst_block11, type: type(inst21)} +// CHECK:STDOUT: inst39: {kind: TupleAccess, arg0: inst31, arg1: element0, type: type(inst13)} +// CHECK:STDOUT: inst40: {kind: TupleInit, arg0: inst_block12, arg1: inst39, type: type(inst13)} +// CHECK:STDOUT: inst41: {kind: TupleValue, arg0: inst_block_empty, type: type(inst13)} +// CHECK:STDOUT: inst42: {kind: Converted, arg0: inst36, arg1: inst40, type: type(inst13)} +// CHECK:STDOUT: inst43: {kind: TupleAccess, arg0: inst31, arg1: element1, type: type(inst13)} +// CHECK:STDOUT: inst44: {kind: TupleInit, arg0: inst_block_empty, arg1: inst43, type: type(inst13)} +// CHECK:STDOUT: inst45: {kind: Converted, arg0: inst37, arg1: inst44, type: type(inst13)} +// CHECK:STDOUT: inst46: {kind: TupleInit, arg0: inst_block13, arg1: inst31, type: type(inst21)} +// CHECK:STDOUT: inst47: {kind: TupleValue, arg0: inst_block14, type: type(inst21)} +// CHECK:STDOUT: inst48: {kind: Converted, arg0: inst38, arg1: inst46, type: type(inst21)} +// CHECK:STDOUT: inst49: {kind: ReturnExpr, arg0: inst48, arg1: inst31} // CHECK:STDOUT: constant_values: // CHECK:STDOUT: inst12: template_constant(inst12) // CHECK:STDOUT: inst13: template_constant(inst13) @@ -92,77 +93,80 @@ fn Foo(n: ()) -> ((), ()) { // CHECK:STDOUT: inst23: template_constant(inst13) // CHECK:STDOUT: inst24: template_constant(inst13) // CHECK:STDOUT: inst25: template_constant(inst21) -// CHECK:STDOUT: inst31: template_constant(inst33) -// CHECK:STDOUT: inst32: template_constant(inst32) +// CHECK:STDOUT: inst29: template_constant(inst13) +// CHECK:STDOUT: inst32: template_constant(inst34) // CHECK:STDOUT: inst33: template_constant(inst33) // CHECK:STDOUT: inst34: template_constant(inst34) -// CHECK:STDOUT: inst39: template_constant(inst40) -// CHECK:STDOUT: inst40: template_constant(inst40) -// CHECK:STDOUT: inst41: template_constant(inst40) -// CHECK:STDOUT: inst43: template_constant(inst40) -// CHECK:STDOUT: inst44: template_constant(inst40) -// CHECK:STDOUT: inst45: template_constant(inst46) -// CHECK:STDOUT: inst46: template_constant(inst46) -// CHECK:STDOUT: inst47: template_constant(inst46) +// CHECK:STDOUT: inst35: template_constant(inst35) +// CHECK:STDOUT: inst40: template_constant(inst41) +// CHECK:STDOUT: inst41: template_constant(inst41) +// CHECK:STDOUT: inst42: template_constant(inst41) +// CHECK:STDOUT: inst44: template_constant(inst41) +// CHECK:STDOUT: inst45: template_constant(inst41) +// CHECK:STDOUT: inst46: template_constant(inst47) +// CHECK:STDOUT: inst47: template_constant(inst47) +// CHECK:STDOUT: inst48: template_constant(inst47) // CHECK:STDOUT: symbolic_constants: {} // CHECK:STDOUT: inst_blocks: // CHECK:STDOUT: inst_block_empty: {} // CHECK:STDOUT: exports: -// CHECK:STDOUT: 0: inst31 +// CHECK:STDOUT: 0: inst32 // CHECK:STDOUT: import_refs: {} // CHECK:STDOUT: global_init: {} // CHECK:STDOUT: inst_block4: -// CHECK:STDOUT: 0: inst18 +// CHECK:STDOUT: 0: inst14 +// CHECK:STDOUT: 1: inst15 // CHECK:STDOUT: inst_block5: +// CHECK:STDOUT: 0: inst18 +// CHECK:STDOUT: inst_block6: // CHECK:STDOUT: 0: inst19 // CHECK:STDOUT: 1: inst20 -// CHECK:STDOUT: inst_block6: -// CHECK:STDOUT: 0: inst28 -// CHECK:STDOUT: 1: inst29 // CHECK:STDOUT: inst_block7: +// CHECK:STDOUT: 0: inst28 +// CHECK:STDOUT: 1: inst30 +// CHECK:STDOUT: inst_block8: // CHECK:STDOUT: 0: inst17 // CHECK:STDOUT: 1: inst18 // CHECK:STDOUT: 2: inst26 // CHECK:STDOUT: 3: inst27 -// CHECK:STDOUT: inst_block8: -// CHECK:STDOUT: 0: inst14 -// CHECK:STDOUT: 1: inst15 -// CHECK:STDOUT: 2: inst19 -// CHECK:STDOUT: 3: inst20 -// CHECK:STDOUT: 4: inst22 -// CHECK:STDOUT: 5: inst23 -// CHECK:STDOUT: 6: inst24 -// CHECK:STDOUT: 7: inst25 -// CHECK:STDOUT: 8: inst28 -// CHECK:STDOUT: 9: inst16 -// CHECK:STDOUT: 10: inst29 -// CHECK:STDOUT: 11: inst30 // CHECK:STDOUT: inst_block9: -// CHECK:STDOUT: 0: inst35 -// CHECK:STDOUT: 1: inst36 -// CHECK:STDOUT: 2: inst37 -// CHECK:STDOUT: 3: inst38 -// CHECK:STDOUT: 4: inst39 -// CHECK:STDOUT: 5: inst41 -// CHECK:STDOUT: 6: inst42 -// CHECK:STDOUT: 7: inst43 -// CHECK:STDOUT: 8: inst44 -// CHECK:STDOUT: 9: inst45 -// CHECK:STDOUT: 10: inst47 -// CHECK:STDOUT: 11: inst48 +// CHECK:STDOUT: 0: inst19 +// CHECK:STDOUT: 1: inst20 +// CHECK:STDOUT: 2: inst22 +// CHECK:STDOUT: 3: inst23 +// CHECK:STDOUT: 4: inst24 +// CHECK:STDOUT: 5: inst25 +// CHECK:STDOUT: 6: inst28 +// CHECK:STDOUT: 7: inst29 +// CHECK:STDOUT: 8: inst16 +// CHECK:STDOUT: 9: inst30 +// CHECK:STDOUT: 10: inst31 // CHECK:STDOUT: inst_block10: -// CHECK:STDOUT: 0: inst35 -// CHECK:STDOUT: 1: inst36 -// CHECK:STDOUT: inst_block11: {} -// CHECK:STDOUT: inst_block12: -// CHECK:STDOUT: 0: inst41 -// CHECK:STDOUT: 1: inst44 +// CHECK:STDOUT: 0: inst36 +// CHECK:STDOUT: 1: inst37 +// CHECK:STDOUT: 2: inst38 +// CHECK:STDOUT: 3: inst39 +// CHECK:STDOUT: 4: inst40 +// CHECK:STDOUT: 5: inst42 +// CHECK:STDOUT: 6: inst43 +// CHECK:STDOUT: 7: inst44 +// CHECK:STDOUT: 8: inst45 +// CHECK:STDOUT: 9: inst46 +// CHECK:STDOUT: 10: inst48 +// CHECK:STDOUT: 11: inst49 +// CHECK:STDOUT: inst_block11: +// CHECK:STDOUT: 0: inst36 +// CHECK:STDOUT: 1: inst37 +// CHECK:STDOUT: inst_block12: {} // CHECK:STDOUT: inst_block13: -// CHECK:STDOUT: 0: inst40 -// CHECK:STDOUT: 1: inst40 +// CHECK:STDOUT: 0: inst42 +// CHECK:STDOUT: 1: inst45 // CHECK:STDOUT: inst_block14: +// CHECK:STDOUT: 0: inst41 +// CHECK:STDOUT: 1: inst41 +// CHECK:STDOUT: inst_block15: // CHECK:STDOUT: 0: inst12 -// CHECK:STDOUT: 1: inst31 +// CHECK:STDOUT: 1: inst32 // CHECK:STDOUT: ... // CHECK:STDOUT: // CHECK:STDOUT: --- raw_and_textual_ir.carbon @@ -186,8 +190,6 @@ fn Foo(n: ()) -> ((), ()) { // CHECK:STDOUT: %return.patt: %tuple.type = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %tuple.type = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc15_12.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc15_12.2: type = converted %.loc15_12.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %.loc15_20: %empty_tuple.type = tuple_literal () // CHECK:STDOUT: %.loc15_24: %empty_tuple.type = tuple_literal () // CHECK:STDOUT: %.loc15_25.1: %tuple.type = tuple_literal (%.loc15_20, %.loc15_24) @@ -195,6 +197,10 @@ fn Foo(n: ()) -> ((), ()) { // CHECK:STDOUT: %.loc15_25.3: type = converted %.loc15_24, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %.loc15_25.4: type = converted %.loc15_25.1, constants.%tuple.type [template = constants.%tuple.type] // CHECK:STDOUT: %n.param: %empty_tuple.type = value_param runtime_param0 +// CHECK:STDOUT: %.loc15_12.3: type = splice_block %.loc15_12.2 [template = constants.%empty_tuple.type] { +// CHECK:STDOUT: %.loc15_12.1: %empty_tuple.type = tuple_literal () +// CHECK:STDOUT: %.loc15_12.2: type = converted %.loc15_12.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] +// CHECK:STDOUT: } // CHECK:STDOUT: %n: %empty_tuple.type = bind_name n, %n.param // CHECK:STDOUT: %return.param: ref %tuple.type = out_param runtime_param1 // CHECK:STDOUT: %return: ref %tuple.type = return_slot %return.param diff --git a/toolchain/check/testdata/basics/no_prelude/raw_identifier.carbon b/toolchain/check/testdata/basics/no_prelude/raw_identifier.carbon index b5dd1331efa38..e5a90e65a592d 100644 --- a/toolchain/check/testdata/basics/no_prelude/raw_identifier.carbon +++ b/toolchain/check/testdata/basics/no_prelude/raw_identifier.carbon @@ -48,11 +48,13 @@ fn C(r#if: ()) -> () { // CHECK:STDOUT: %return.patt: %empty_tuple.type = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %empty_tuple.type = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc15_10.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc15_10.2: type = converted %.loc15_10.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %.loc15_17.1: %empty_tuple.type = tuple_literal () // CHECK:STDOUT: %.loc15_17.2: type = converted %.loc15_17.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %n.param: %empty_tuple.type = value_param runtime_param0 +// CHECK:STDOUT: %.loc15_10.3: type = splice_block %.loc15_10.2 [template = constants.%empty_tuple.type] { +// CHECK:STDOUT: %.loc15_10.1: %empty_tuple.type = tuple_literal () +// CHECK:STDOUT: %.loc15_10.2: type = converted %.loc15_10.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] +// CHECK:STDOUT: } // CHECK:STDOUT: %n: %empty_tuple.type = bind_name n, %n.param // CHECK:STDOUT: %return.param: ref %empty_tuple.type = out_param runtime_param1 // CHECK:STDOUT: %return: ref %empty_tuple.type = return_slot %return.param @@ -63,11 +65,13 @@ fn C(r#if: ()) -> () { // CHECK:STDOUT: %return.patt: %empty_tuple.type = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %empty_tuple.type = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc19_12.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc19_12.2: type = converted %.loc19_12.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %.loc19_19.1: %empty_tuple.type = tuple_literal () // CHECK:STDOUT: %.loc19_19.2: type = converted %.loc19_19.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %n.param: %empty_tuple.type = value_param runtime_param0 +// CHECK:STDOUT: %.loc19_12.3: type = splice_block %.loc19_12.2 [template = constants.%empty_tuple.type] { +// CHECK:STDOUT: %.loc19_12.1: %empty_tuple.type = tuple_literal () +// CHECK:STDOUT: %.loc19_12.2: type = converted %.loc19_12.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] +// CHECK:STDOUT: } // CHECK:STDOUT: %n: %empty_tuple.type = bind_name n, %n.param // CHECK:STDOUT: %return.param: ref %empty_tuple.type = out_param runtime_param1 // CHECK:STDOUT: %return: ref %empty_tuple.type = return_slot %return.param @@ -78,11 +82,13 @@ fn C(r#if: ()) -> () { // CHECK:STDOUT: %return.patt: %empty_tuple.type = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %empty_tuple.type = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc23_13.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc23_13.2: type = converted %.loc23_13.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %.loc23_20.1: %empty_tuple.type = tuple_literal () // CHECK:STDOUT: %.loc23_20.2: type = converted %.loc23_20.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %if.param: %empty_tuple.type = value_param runtime_param0 +// CHECK:STDOUT: %.loc23_13.3: type = splice_block %.loc23_13.2 [template = constants.%empty_tuple.type] { +// CHECK:STDOUT: %.loc23_13.1: %empty_tuple.type = tuple_literal () +// CHECK:STDOUT: %.loc23_13.2: type = converted %.loc23_13.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] +// CHECK:STDOUT: } // CHECK:STDOUT: %if: %empty_tuple.type = bind_name r#if, %if.param // CHECK:STDOUT: %return.param: ref %empty_tuple.type = out_param runtime_param1 // CHECK:STDOUT: %return: ref %empty_tuple.type = return_slot %return.param diff --git a/toolchain/check/testdata/basics/no_prelude/raw_ir.carbon b/toolchain/check/testdata/basics/no_prelude/raw_ir.carbon index 6eead5ca98af2..08379ee715fd3 100644 --- a/toolchain/check/testdata/basics/no_prelude/raw_ir.carbon +++ b/toolchain/check/testdata/basics/no_prelude/raw_ir.carbon @@ -28,12 +28,12 @@ fn Foo[T:! type](n: T) -> (T, ()) { // CHECK:STDOUT: entity_name0: {name: name1, parent_scope: name_scope, index: comp_time_bind0} // CHECK:STDOUT: entity_name1: {name: name2, parent_scope: name_scope, index: comp_time_bind} // CHECK:STDOUT: functions: -// CHECK:STDOUT: function0: {name: name0, parent_scope: name_scope0, return_slot_pattern: inst31, body: [inst_block14]} +// CHECK:STDOUT: function0: {name: name0, parent_scope: name_scope0, return_slot_pattern: inst31, body: [inst_block16]} // CHECK:STDOUT: classes: {} // CHECK:STDOUT: generics: -// CHECK:STDOUT: generic0: {decl: inst36, bindings: inst_block10} +// CHECK:STDOUT: generic0: {decl: inst36, bindings: inst_block12} // CHECK:STDOUT: specifics: -// CHECK:STDOUT: specific0: {generic: generic0, args: inst_block12} +// CHECK:STDOUT: specific0: {generic: generic0, args: inst_block14} // CHECK:STDOUT: struct_type_fields: // CHECK:STDOUT: struct_type_fields0: {} // CHECK:STDOUT: types: @@ -74,7 +74,7 @@ fn Foo[T:! type](n: T) -> (T, ()) { // CHECK:STDOUT: inst23: {kind: TupleType, arg0: type_block0, type: type(TypeType)} // CHECK:STDOUT: inst24: {kind: TupleLiteral, arg0: inst_block_empty, type: type(inst23)} // CHECK:STDOUT: inst25: {kind: TupleType, arg0: type_block1, type: type(TypeType)} -// CHECK:STDOUT: inst26: {kind: TupleLiteral, arg0: inst_block6, type: type(inst25)} +// CHECK:STDOUT: inst26: {kind: TupleLiteral, arg0: inst_block8, type: type(inst25)} // CHECK:STDOUT: inst27: {kind: Converted, arg0: inst24, arg1: inst23, type: type(TypeType)} // CHECK:STDOUT: inst28: {kind: TupleType, arg0: type_block2, type: type(TypeType)} // CHECK:STDOUT: inst29: {kind: Converted, arg0: inst26, arg1: inst28, type: type(TypeType)} @@ -84,7 +84,7 @@ fn Foo[T:! type](n: T) -> (T, ()) { // CHECK:STDOUT: inst33: {kind: ValueParam, arg0: runtime_param0, arg1: name2, type: type(symbolic_constant3)} // CHECK:STDOUT: inst34: {kind: OutParam, arg0: runtime_param1, arg1: name(ReturnSlot), type: type(symbolic_constant5)} // CHECK:STDOUT: inst35: {kind: ReturnSlot, arg0: inst26, arg1: inst34, type: type(symbolic_constant5)} -// CHECK:STDOUT: inst36: {kind: FunctionDecl, arg0: function0, arg1: inst_block9, type: type(inst40)} +// CHECK:STDOUT: inst36: {kind: FunctionDecl, arg0: function0, arg1: inst_block11, type: type(inst40)} // CHECK:STDOUT: inst37: {kind: BindSymbolicName, arg0: entity_name0, arg1: inst, type: type(TypeType)} // CHECK:STDOUT: inst38: {kind: SymbolicBindingPattern, arg0: entity_name0, type: type(TypeType)} // CHECK:STDOUT: inst39: {kind: TupleType, arg0: type_block3, type: type(TypeType)} @@ -97,7 +97,7 @@ fn Foo[T:! type](n: T) -> (T, ()) { // CHECK:STDOUT: inst46: {kind: RequireCompleteType, arg0: type(symbolic_constant0), type: type(inst(WitnessType))} // CHECK:STDOUT: inst47: {kind: NameRef, arg0: name2, arg1: inst19, type: type(symbolic_constant3)} // CHECK:STDOUT: inst48: {kind: TupleLiteral, arg0: inst_block_empty, type: type(inst23)} -// CHECK:STDOUT: inst49: {kind: TupleLiteral, arg0: inst_block15, type: type(symbolic_constant5)} +// CHECK:STDOUT: inst49: {kind: TupleLiteral, arg0: inst_block17, type: type(symbolic_constant5)} // CHECK:STDOUT: inst50: {kind: RequireCompleteType, arg0: type(symbolic_constant5), type: type(inst(WitnessType))} // CHECK:STDOUT: inst51: {kind: TupleAccess, arg0: inst35, arg1: element0, type: type(symbolic_constant3)} // CHECK:STDOUT: inst52: {kind: RequireCompleteType, arg0: type(symbolic_constant0), type: type(inst(WitnessType))} @@ -106,7 +106,7 @@ fn Foo[T:! type](n: T) -> (T, ()) { // CHECK:STDOUT: inst55: {kind: TupleInit, arg0: inst_block_empty, arg1: inst54, type: type(inst23)} // CHECK:STDOUT: inst56: {kind: TupleValue, arg0: inst_block_empty, type: type(inst23)} // CHECK:STDOUT: inst57: {kind: Converted, arg0: inst48, arg1: inst55, type: type(inst23)} -// CHECK:STDOUT: inst58: {kind: TupleInit, arg0: inst_block16, arg1: inst35, type: type(symbolic_constant5)} +// CHECK:STDOUT: inst58: {kind: TupleInit, arg0: inst_block18, arg1: inst35, type: type(symbolic_constant5)} // CHECK:STDOUT: inst59: {kind: Converted, arg0: inst49, arg1: inst58, type: type(symbolic_constant5)} // CHECK:STDOUT: inst60: {kind: ReturnExpr, arg0: inst59, arg1: inst35} // CHECK:STDOUT: inst61: {kind: RequireCompleteType, arg0: type(symbolic_constant5), type: type(inst(WitnessType))} @@ -161,49 +161,52 @@ fn Foo[T:! type](n: T) -> (T, ()) { // CHECK:STDOUT: 0: inst36 // CHECK:STDOUT: import_refs: {} // CHECK:STDOUT: global_init: {} -// CHECK:STDOUT: inst_block4: -// CHECK:STDOUT: 0: inst17 +// CHECK:STDOUT: inst_block4: {} // CHECK:STDOUT: inst_block5: -// CHECK:STDOUT: 0: inst21 +// CHECK:STDOUT: 0: inst17 // CHECK:STDOUT: inst_block6: +// CHECK:STDOUT: 0: inst18 +// CHECK:STDOUT: inst_block7: +// CHECK:STDOUT: 0: inst21 +// CHECK:STDOUT: inst_block8: // CHECK:STDOUT: 0: inst22 // CHECK:STDOUT: 1: inst24 -// CHECK:STDOUT: inst_block7: +// CHECK:STDOUT: inst_block9: // CHECK:STDOUT: 0: inst33 // CHECK:STDOUT: 1: inst34 -// CHECK:STDOUT: inst_block8: +// CHECK:STDOUT: inst_block10: // CHECK:STDOUT: 0: inst15 // CHECK:STDOUT: 1: inst17 // CHECK:STDOUT: 2: inst20 // CHECK:STDOUT: 3: inst21 // CHECK:STDOUT: 4: inst30 // CHECK:STDOUT: 5: inst31 -// CHECK:STDOUT: inst_block9: -// CHECK:STDOUT: 0: inst18 -// CHECK:STDOUT: 1: inst22 -// CHECK:STDOUT: 2: inst24 -// CHECK:STDOUT: 3: inst26 -// CHECK:STDOUT: 4: inst27 -// CHECK:STDOUT: 5: inst29 -// CHECK:STDOUT: 6: inst32 -// CHECK:STDOUT: 7: inst13 -// CHECK:STDOUT: 8: inst33 +// CHECK:STDOUT: inst_block11: +// CHECK:STDOUT: 0: inst22 +// CHECK:STDOUT: 1: inst24 +// CHECK:STDOUT: 2: inst26 +// CHECK:STDOUT: 3: inst27 +// CHECK:STDOUT: 4: inst29 +// CHECK:STDOUT: 5: inst32 +// CHECK:STDOUT: 6: inst13 +// CHECK:STDOUT: 7: inst33 +// CHECK:STDOUT: 8: inst18 // CHECK:STDOUT: 9: inst19 // CHECK:STDOUT: 10: inst34 // CHECK:STDOUT: 11: inst35 -// CHECK:STDOUT: inst_block10: +// CHECK:STDOUT: inst_block12: // CHECK:STDOUT: 0: inst13 -// CHECK:STDOUT: inst_block11: +// CHECK:STDOUT: inst_block13: // CHECK:STDOUT: 0: inst37 // CHECK:STDOUT: 1: inst38 // CHECK:STDOUT: 2: inst39 -// CHECK:STDOUT: inst_block12: +// CHECK:STDOUT: inst_block14: // CHECK:STDOUT: 0: inst14 -// CHECK:STDOUT: inst_block13: +// CHECK:STDOUT: inst_block15: // CHECK:STDOUT: 0: inst14 // CHECK:STDOUT: 1: inst14 // CHECK:STDOUT: 2: inst28 -// CHECK:STDOUT: inst_block14: +// CHECK:STDOUT: inst_block16: // CHECK:STDOUT: 0: inst47 // CHECK:STDOUT: 1: inst48 // CHECK:STDOUT: 2: inst49 @@ -215,16 +218,16 @@ fn Foo[T:! type](n: T) -> (T, ()) { // CHECK:STDOUT: 8: inst58 // CHECK:STDOUT: 9: inst59 // CHECK:STDOUT: 10: inst60 -// CHECK:STDOUT: inst_block15: +// CHECK:STDOUT: inst_block17: // CHECK:STDOUT: 0: inst47 // CHECK:STDOUT: 1: inst48 -// CHECK:STDOUT: inst_block16: +// CHECK:STDOUT: inst_block18: // CHECK:STDOUT: 0: inst53 // CHECK:STDOUT: 1: inst57 -// CHECK:STDOUT: inst_block17: +// CHECK:STDOUT: inst_block19: // CHECK:STDOUT: 0: inst61 // CHECK:STDOUT: 1: inst62 -// CHECK:STDOUT: inst_block18: +// CHECK:STDOUT: inst_block20: // CHECK:STDOUT: 0: inst12 // CHECK:STDOUT: 1: inst36 // CHECK:STDOUT: ... diff --git a/toolchain/check/testdata/basics/no_prelude/textual_ir.carbon b/toolchain/check/testdata/basics/no_prelude/textual_ir.carbon index ac14228ccc1d1..b285cacb73931 100644 --- a/toolchain/check/testdata/basics/no_prelude/textual_ir.carbon +++ b/toolchain/check/testdata/basics/no_prelude/textual_ir.carbon @@ -37,8 +37,6 @@ fn Foo(n: ()) -> ((), ()) { // CHECK:STDOUT: %return.patt: %tuple.type = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %tuple.type = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc15_12.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc15_12.2: type = converted %.loc15_12.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %.loc15_20: %empty_tuple.type = tuple_literal () // CHECK:STDOUT: %.loc15_24: %empty_tuple.type = tuple_literal () // CHECK:STDOUT: %.loc15_25.1: %tuple.type = tuple_literal (%.loc15_20, %.loc15_24) @@ -46,6 +44,10 @@ fn Foo(n: ()) -> ((), ()) { // CHECK:STDOUT: %.loc15_25.3: type = converted %.loc15_24, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %.loc15_25.4: type = converted %.loc15_25.1, constants.%tuple.type [template = constants.%tuple.type] // CHECK:STDOUT: %n.param: %empty_tuple.type = value_param runtime_param0 +// CHECK:STDOUT: %.loc15_12.3: type = splice_block %.loc15_12.2 [template = constants.%empty_tuple.type] { +// CHECK:STDOUT: %.loc15_12.1: %empty_tuple.type = tuple_literal () +// CHECK:STDOUT: %.loc15_12.2: type = converted %.loc15_12.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] +// CHECK:STDOUT: } // CHECK:STDOUT: %n: %empty_tuple.type = bind_name n, %n.param // CHECK:STDOUT: %return.param: ref %tuple.type = out_param runtime_param1 // CHECK:STDOUT: %return: ref %tuple.type = return_slot %return.param diff --git a/toolchain/check/testdata/basics/numeric_literals.carbon b/toolchain/check/testdata/basics/numeric_literals.carbon index 052ab63f6f82f..33bd20e9d21d6 100644 --- a/toolchain/check/testdata/basics/numeric_literals.carbon +++ b/toolchain/check/testdata/basics/numeric_literals.carbon @@ -62,9 +62,6 @@ fn F() { // CHECK:STDOUT: %int_2147483647.2: %i32 = int_value 2147483647 [template] // CHECK:STDOUT: %int_5: Core.IntLiteral = int_value 5 [template] // CHECK:STDOUT: %array.1: %array_type.1 = tuple_value (%int_8.2, %int_9.2, %int_8.2, %int_8.2, %int_2147483647.2, %int_2147483647.2) [template] -// CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [template] -// CHECK:STDOUT: %Float.type: type = fn_type @Float [template] -// CHECK:STDOUT: %Float: %Float.type = struct_value () [template] // CHECK:STDOUT: %array_type.2: type = array_type %int_6, f64 [template] // CHECK:STDOUT: %float.1: f64 = float_literal 0.90000000000000002 [template] // CHECK:STDOUT: %float.2: f64 = float_literal 8 [template] @@ -97,10 +94,6 @@ fn F() { // CHECK:STDOUT: // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_6.loc14: Core.IntLiteral = int_value 6 [template = constants.%int_6] -// CHECK:STDOUT: %array_type.loc14: type = array_type %int_6.loc14, %i32 [template = constants.%array_type.1] // CHECK:STDOUT: %ints.var: ref %array_type.1 = var ints // CHECK:STDOUT: %ints: ref %array_type.1 = bind_name ints, %ints.var // CHECK:STDOUT: %int_8.loc15: Core.IntLiteral = int_value 8 [template = constants.%int_8.1] @@ -161,12 +154,6 @@ fn F() { // CHECK:STDOUT: %.loc21_3.20: init %array_type.1 = array_init (%.loc21_3.4, %.loc21_3.7, %.loc21_3.10, %.loc21_3.13, %.loc21_3.16, %.loc21_3.19) to %ints.var [template = constants.%array.1] // CHECK:STDOUT: %.loc21_4: init %array_type.1 = converted %.loc21_3.1, %.loc21_3.20 [template = constants.%array.1] // CHECK:STDOUT: assign %ints.var, %.loc21_4 -// CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type: init type = call constants.%Float(%int_64) [template = f64] -// CHECK:STDOUT: %int_6.loc22: Core.IntLiteral = int_value 6 [template = constants.%int_6] -// CHECK:STDOUT: %.loc22_16.1: type = value_of_initializer %float.make_type [template = f64] -// CHECK:STDOUT: %.loc22_16.2: type = converted %float.make_type, %.loc22_16.1 [template = f64] -// CHECK:STDOUT: %array_type.loc22: type = array_type %int_6.loc22, f64 [template = constants.%array_type.2] // CHECK:STDOUT: %floats.var: ref %array_type.2 = var floats // CHECK:STDOUT: %floats: ref %array_type.2 = bind_name floats, %floats.var // CHECK:STDOUT: %float.loc23: f64 = float_literal 0.90000000000000002 [template = constants.%float.1] diff --git a/toolchain/check/testdata/basics/parens.carbon b/toolchain/check/testdata/basics/parens.carbon index 1ef20850d5ace..3823451af2ab1 100644 --- a/toolchain/check/testdata/basics/parens.carbon +++ b/toolchain/check/testdata/basics/parens.carbon @@ -46,12 +46,8 @@ var b: i32 = ((2)); // CHECK:STDOUT: .b = %b // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int_32.loc11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.var: ref %i32 = var a // CHECK:STDOUT: %a: ref %i32 = bind_name a, %a.var -// CHECK:STDOUT: %int_32.loc12: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc12: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %b.var: ref %i32 = var b // CHECK:STDOUT: %b: ref %i32 = bind_name b, %b.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/basics/type_literals.carbon b/toolchain/check/testdata/basics/type_literals.carbon index 00aaf3a58c843..20feaf723feb1 100644 --- a/toolchain/check/testdata/basics/type_literals.carbon +++ b/toolchain/check/testdata/basics/type_literals.carbon @@ -152,16 +152,10 @@ var test_f128: f128; // CHECK:STDOUT: .test_i64 = %test_i64 // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int_8: Core.IntLiteral = int_value 8 [template = constants.%int_8] -// CHECK:STDOUT: %i8: type = class_type @Int, @Int(constants.%int_8) [template = constants.%i8] // CHECK:STDOUT: %test_i8.var: ref %i8 = var test_i8 // CHECK:STDOUT: %test_i8: ref %i8 = bind_name test_i8, %test_i8.var -// CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [template = constants.%int_16] -// CHECK:STDOUT: %i16: type = class_type @Int, @Int(constants.%int_16) [template = constants.%i16] // CHECK:STDOUT: %test_i16.var: ref %i16 = var test_i16 // CHECK:STDOUT: %test_i16: ref %i16 = bind_name test_i16, %test_i16.var -// CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %i64: type = class_type @Int, @Int(constants.%int_64) [template = constants.%i64] // CHECK:STDOUT: %test_i64.var: ref %i64 = var test_i64 // CHECK:STDOUT: %test_i64: ref %i64 = bind_name test_i64, %test_i64.var // CHECK:STDOUT: } @@ -200,16 +194,10 @@ var test_f128: f128; // CHECK:STDOUT: .test_u64 = %test_u64 // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int_8: Core.IntLiteral = int_value 8 [template = constants.%int_8] -// CHECK:STDOUT: %u8: type = class_type @UInt, @UInt(constants.%int_8) [template = constants.%u8] // CHECK:STDOUT: %test_u8.var: ref %u8 = var test_u8 // CHECK:STDOUT: %test_u8: ref %u8 = bind_name test_u8, %test_u8.var -// CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [template = constants.%int_16] -// CHECK:STDOUT: %u16: type = class_type @UInt, @UInt(constants.%int_16) [template = constants.%u16] // CHECK:STDOUT: %test_u16.var: ref %u16 = var test_u16 // CHECK:STDOUT: %test_u16: ref %u16 = bind_name test_u16, %test_u16.var -// CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %u64: type = class_type @UInt, @UInt(constants.%int_64) [template = constants.%u64] // CHECK:STDOUT: %test_u64.var: ref %u64 = var test_u64 // CHECK:STDOUT: %test_u64: ref %u64 = bind_name test_u64, %test_u64.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/builtins/bool/eq.carbon b/toolchain/check/testdata/builtins/bool/eq.carbon index 082e5ecf25335..be1e74dc02083 100644 --- a/toolchain/check/testdata/builtins/bool/eq.carbon +++ b/toolchain/check/testdata/builtins/bool/eq.carbon @@ -91,18 +91,22 @@ var d: C(false == false) = True(); // CHECK:STDOUT: %return.patt: bool = return_slot_pattern // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %bool.make_type.loc4_10: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc4_10.1: type = value_of_initializer %bool.make_type.loc4_10 [template = bool] -// CHECK:STDOUT: %.loc4_10.2: type = converted %bool.make_type.loc4_10, %.loc4_10.1 [template = bool] -// CHECK:STDOUT: %bool.make_type.loc4_19: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc4_19.1: type = value_of_initializer %bool.make_type.loc4_19 [template = bool] -// CHECK:STDOUT: %.loc4_19.2: type = converted %bool.make_type.loc4_19, %.loc4_19.1 [template = bool] // CHECK:STDOUT: %bool.make_type.loc4_28: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc4_28.1: type = value_of_initializer %bool.make_type.loc4_28 [template = bool] // CHECK:STDOUT: %.loc4_28.2: type = converted %bool.make_type.loc4_28, %.loc4_28.1 [template = bool] // CHECK:STDOUT: %a.param: bool = value_param runtime_param0 +// CHECK:STDOUT: %.loc4_10.3: type = splice_block %.loc4_10.2 [template = bool] { +// CHECK:STDOUT: %bool.make_type.loc4_10: init type = call constants.%Bool() [template = bool] +// CHECK:STDOUT: %.loc4_10.1: type = value_of_initializer %bool.make_type.loc4_10 [template = bool] +// CHECK:STDOUT: %.loc4_10.2: type = converted %bool.make_type.loc4_10, %.loc4_10.1 [template = bool] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: bool = bind_name a, %a.param // CHECK:STDOUT: %b.param: bool = value_param runtime_param1 +// CHECK:STDOUT: %.loc4_19.3: type = splice_block %.loc4_19.2 [template = bool] { +// CHECK:STDOUT: %bool.make_type.loc4_19: init type = call constants.%Bool() [template = bool] +// CHECK:STDOUT: %.loc4_19.1: type = value_of_initializer %bool.make_type.loc4_19 [template = bool] +// CHECK:STDOUT: %.loc4_19.2: type = converted %bool.make_type.loc4_19, %.loc4_19.1 [template = bool] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: bool = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param @@ -111,10 +115,12 @@ var d: C(false == false) = True(); // CHECK:STDOUT: %B.patt.loc6_9.1: bool = symbolic_binding_pattern B, 0 [symbolic = %B.patt.loc6_9.2 (constants.%B.patt)] // CHECK:STDOUT: %B.param_patt: bool = value_param_pattern %B.patt.loc6_9.1, runtime_param [symbolic = %B.patt.loc6_9.2 (constants.%B.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc6_13.1: type = value_of_initializer %bool.make_type [template = bool] -// CHECK:STDOUT: %.loc6_13.2: type = converted %bool.make_type, %.loc6_13.1 [template = bool] // CHECK:STDOUT: %B.param: bool = value_param runtime_param +// CHECK:STDOUT: %.loc6_13.3: type = splice_block %.loc6_13.2 [template = bool] { +// CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] +// CHECK:STDOUT: %.loc6_13.1: type = value_of_initializer %bool.make_type [template = bool] +// CHECK:STDOUT: %.loc6_13.2: type = converted %bool.make_type, %.loc6_13.1 [template = bool] +// CHECK:STDOUT: } // CHECK:STDOUT: %B.loc6_9.1: bool = bind_symbolic_name B, 0, %B.param [symbolic = %B.loc6_9.2 (constants.%B)] // CHECK:STDOUT: } // CHECK:STDOUT: %True.decl: %True.type = fn_decl @True [template = constants.%True] { @@ -137,44 +143,12 @@ var d: C(false == false) = True(); // CHECK:STDOUT: %return.param: ref %C.3 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %C.3 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %C.ref.loc11: %C.type = name_ref C, %C.decl [template = constants.%C.generic] -// CHECK:STDOUT: %Eq.ref.loc11: %Eq.type = name_ref Eq, %Eq.decl [template = constants.%Eq] -// CHECK:STDOUT: %true.loc11_13: bool = bool_literal true [template = constants.%true] -// CHECK:STDOUT: %true.loc11_19: bool = bool_literal true [template = constants.%true] -// CHECK:STDOUT: %bool.eq.loc11: init bool = call %Eq.ref.loc11(%true.loc11_13, %true.loc11_19) [template = constants.%true] -// CHECK:STDOUT: %.loc11_24.1: bool = value_of_initializer %bool.eq.loc11 [template = constants.%true] -// CHECK:STDOUT: %.loc11_24.2: bool = converted %bool.eq.loc11, %.loc11_24.1 [template = constants.%true] -// CHECK:STDOUT: %C.loc11: type = class_type @C, @C(constants.%true) [template = constants.%C.2] // CHECK:STDOUT: %a.var: ref %C.2 = var a // CHECK:STDOUT: %a: ref %C.2 = bind_name a, %a.var -// CHECK:STDOUT: %C.ref.loc12: %C.type = name_ref C, %C.decl [template = constants.%C.generic] -// CHECK:STDOUT: %Eq.ref.loc12: %Eq.type = name_ref Eq, %Eq.decl [template = constants.%Eq] -// CHECK:STDOUT: %true.loc12: bool = bool_literal true [template = constants.%true] -// CHECK:STDOUT: %false.loc12: bool = bool_literal false [template = constants.%false] -// CHECK:STDOUT: %bool.eq.loc12: init bool = call %Eq.ref.loc12(%true.loc12, %false.loc12) [template = constants.%false] -// CHECK:STDOUT: %.loc12_25.1: bool = value_of_initializer %bool.eq.loc12 [template = constants.%false] -// CHECK:STDOUT: %.loc12_25.2: bool = converted %bool.eq.loc12, %.loc12_25.1 [template = constants.%false] -// CHECK:STDOUT: %C.loc12: type = class_type @C, @C(constants.%false) [template = constants.%C.3] // CHECK:STDOUT: %b.var: ref %C.3 = var b // CHECK:STDOUT: %b: ref %C.3 = bind_name b, %b.var -// CHECK:STDOUT: %C.ref.loc13: %C.type = name_ref C, %C.decl [template = constants.%C.generic] -// CHECK:STDOUT: %Eq.ref.loc13: %Eq.type = name_ref Eq, %Eq.decl [template = constants.%Eq] -// CHECK:STDOUT: %false.loc13: bool = bool_literal false [template = constants.%false] -// CHECK:STDOUT: %true.loc13: bool = bool_literal true [template = constants.%true] -// CHECK:STDOUT: %bool.eq.loc13: init bool = call %Eq.ref.loc13(%false.loc13, %true.loc13) [template = constants.%false] -// CHECK:STDOUT: %.loc13_25.1: bool = value_of_initializer %bool.eq.loc13 [template = constants.%false] -// CHECK:STDOUT: %.loc13_25.2: bool = converted %bool.eq.loc13, %.loc13_25.1 [template = constants.%false] -// CHECK:STDOUT: %C.loc13: type = class_type @C, @C(constants.%false) [template = constants.%C.3] // CHECK:STDOUT: %c.var: ref %C.3 = var c // CHECK:STDOUT: %c: ref %C.3 = bind_name c, %c.var -// CHECK:STDOUT: %C.ref.loc14: %C.type = name_ref C, %C.decl [template = constants.%C.generic] -// CHECK:STDOUT: %Eq.ref.loc14: %Eq.type = name_ref Eq, %Eq.decl [template = constants.%Eq] -// CHECK:STDOUT: %false.loc14_13: bool = bool_literal false [template = constants.%false] -// CHECK:STDOUT: %false.loc14_20: bool = bool_literal false [template = constants.%false] -// CHECK:STDOUT: %bool.eq.loc14: init bool = call %Eq.ref.loc14(%false.loc14_13, %false.loc14_20) [template = constants.%true] -// CHECK:STDOUT: %.loc14_26.1: bool = value_of_initializer %bool.eq.loc14 [template = constants.%true] -// CHECK:STDOUT: %.loc14_26.2: bool = converted %bool.eq.loc14, %.loc14_26.1 [template = constants.%true] -// CHECK:STDOUT: %C.loc14: type = class_type @C, @C(constants.%true) [template = constants.%C.2] // CHECK:STDOUT: %d.var: ref %C.2 = var d // CHECK:STDOUT: %d: ref %C.2 = bind_name d, %d.var // CHECK:STDOUT: } @@ -260,14 +234,6 @@ var d: C(false == false) = True(); // CHECK:STDOUT: %C.3: type = class_type @C, @C(%false) [template] // CHECK:STDOUT: %False.type: type = fn_type @False [template] // CHECK:STDOUT: %False: %False.type = struct_value () [template] -// CHECK:STDOUT: %Equal.type.1: type = fn_type @Equal.1 [template] -// CHECK:STDOUT: %NotEqual.type: type = fn_type @NotEqual [template] -// CHECK:STDOUT: %NotEqual: %NotEqual.type = struct_value () [template] -// CHECK:STDOUT: %Equal.type.2: type = fn_type @Equal.2 [template] -// CHECK:STDOUT: %Equal.2: %Equal.type.2 = struct_value () [template] -// CHECK:STDOUT: %interface: = interface_witness (%Equal.2, %NotEqual) [template] -// CHECK:STDOUT: %Equal.bound.1: = bound_method %true, %Equal.2 [template] -// CHECK:STDOUT: %Equal.bound.2: = bound_method %false, %Equal.2 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -295,10 +261,12 @@ var d: C(false == false) = True(); // CHECK:STDOUT: %B.patt.loc4_9.1: bool = symbolic_binding_pattern B, 0 [symbolic = %B.patt.loc4_9.2 (constants.%B.patt)] // CHECK:STDOUT: %B.param_patt: bool = value_param_pattern %B.patt.loc4_9.1, runtime_param [symbolic = %B.patt.loc4_9.2 (constants.%B.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc4_13.1: type = value_of_initializer %bool.make_type [template = bool] -// CHECK:STDOUT: %.loc4_13.2: type = converted %bool.make_type, %.loc4_13.1 [template = bool] // CHECK:STDOUT: %B.param: bool = value_param runtime_param +// CHECK:STDOUT: %.loc4_13.3: type = splice_block %.loc4_13.2 [template = bool] { +// CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] +// CHECK:STDOUT: %.loc4_13.1: type = value_of_initializer %bool.make_type [template = bool] +// CHECK:STDOUT: %.loc4_13.2: type = converted %bool.make_type, %.loc4_13.1 [template = bool] +// CHECK:STDOUT: } // CHECK:STDOUT: %B.loc4_9.1: bool = bind_symbolic_name B, 0, %B.param [symbolic = %B.loc4_9.2 (constants.%B)] // CHECK:STDOUT: } // CHECK:STDOUT: %True.decl: %True.type = fn_decl @True [template = constants.%True] { @@ -321,48 +289,12 @@ var d: C(false == false) = True(); // CHECK:STDOUT: %return.param: ref %C.3 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %C.3 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %C.ref.loc9: %C.type = name_ref C, %C.decl [template = constants.%C.generic] -// CHECK:STDOUT: %true.loc9_10: bool = bool_literal true [template = constants.%true] -// CHECK:STDOUT: %true.loc9_18: bool = bool_literal true [template = constants.%true] -// CHECK:STDOUT: %impl.elem0.loc9: %Equal.type.1 = interface_witness_access constants.%interface, element0 [template = constants.%Equal.2] -// CHECK:STDOUT: %Equal.bound.loc9: = bound_method %true.loc9_10, %impl.elem0.loc9 [template = constants.%Equal.bound.1] -// CHECK:STDOUT: %bool.eq.loc9: init bool = call %Equal.bound.loc9(%true.loc9_10, %true.loc9_18) [template = constants.%true] -// CHECK:STDOUT: %.loc9_22.1: bool = value_of_initializer %bool.eq.loc9 [template = constants.%true] -// CHECK:STDOUT: %.loc9_22.2: bool = converted %bool.eq.loc9, %.loc9_22.1 [template = constants.%true] -// CHECK:STDOUT: %C.loc9: type = class_type @C, @C(constants.%true) [template = constants.%C.2] // CHECK:STDOUT: %a.var: ref %C.2 = var a // CHECK:STDOUT: %a: ref %C.2 = bind_name a, %a.var -// CHECK:STDOUT: %C.ref.loc10: %C.type = name_ref C, %C.decl [template = constants.%C.generic] -// CHECK:STDOUT: %true.loc10: bool = bool_literal true [template = constants.%true] -// CHECK:STDOUT: %false.loc10: bool = bool_literal false [template = constants.%false] -// CHECK:STDOUT: %impl.elem0.loc10: %Equal.type.1 = interface_witness_access constants.%interface, element0 [template = constants.%Equal.2] -// CHECK:STDOUT: %Equal.bound.loc10: = bound_method %true.loc10, %impl.elem0.loc10 [template = constants.%Equal.bound.1] -// CHECK:STDOUT: %bool.eq.loc10: init bool = call %Equal.bound.loc10(%true.loc10, %false.loc10) [template = constants.%false] -// CHECK:STDOUT: %.loc10_23.1: bool = value_of_initializer %bool.eq.loc10 [template = constants.%false] -// CHECK:STDOUT: %.loc10_23.2: bool = converted %bool.eq.loc10, %.loc10_23.1 [template = constants.%false] -// CHECK:STDOUT: %C.loc10: type = class_type @C, @C(constants.%false) [template = constants.%C.3] // CHECK:STDOUT: %b.var: ref %C.3 = var b // CHECK:STDOUT: %b: ref %C.3 = bind_name b, %b.var -// CHECK:STDOUT: %C.ref.loc11: %C.type = name_ref C, %C.decl [template = constants.%C.generic] -// CHECK:STDOUT: %false.loc11: bool = bool_literal false [template = constants.%false] -// CHECK:STDOUT: %true.loc11: bool = bool_literal true [template = constants.%true] -// CHECK:STDOUT: %impl.elem0.loc11: %Equal.type.1 = interface_witness_access constants.%interface, element0 [template = constants.%Equal.2] -// CHECK:STDOUT: %Equal.bound.loc11: = bound_method %false.loc11, %impl.elem0.loc11 [template = constants.%Equal.bound.2] -// CHECK:STDOUT: %bool.eq.loc11: init bool = call %Equal.bound.loc11(%false.loc11, %true.loc11) [template = constants.%false] -// CHECK:STDOUT: %.loc11_23.1: bool = value_of_initializer %bool.eq.loc11 [template = constants.%false] -// CHECK:STDOUT: %.loc11_23.2: bool = converted %bool.eq.loc11, %.loc11_23.1 [template = constants.%false] -// CHECK:STDOUT: %C.loc11: type = class_type @C, @C(constants.%false) [template = constants.%C.3] // CHECK:STDOUT: %c.var: ref %C.3 = var c // CHECK:STDOUT: %c: ref %C.3 = bind_name c, %c.var -// CHECK:STDOUT: %C.ref.loc12: %C.type = name_ref C, %C.decl [template = constants.%C.generic] -// CHECK:STDOUT: %false.loc12_10: bool = bool_literal false [template = constants.%false] -// CHECK:STDOUT: %false.loc12_19: bool = bool_literal false [template = constants.%false] -// CHECK:STDOUT: %impl.elem0.loc12: %Equal.type.1 = interface_witness_access constants.%interface, element0 [template = constants.%Equal.2] -// CHECK:STDOUT: %Equal.bound.loc12: = bound_method %false.loc12_10, %impl.elem0.loc12 [template = constants.%Equal.bound.2] -// CHECK:STDOUT: %bool.eq.loc12: init bool = call %Equal.bound.loc12(%false.loc12_10, %false.loc12_19) [template = constants.%true] -// CHECK:STDOUT: %.loc12_24.1: bool = value_of_initializer %bool.eq.loc12 [template = constants.%true] -// CHECK:STDOUT: %.loc12_24.2: bool = converted %bool.eq.loc12, %.loc12_24.1 [template = constants.%true] -// CHECK:STDOUT: %C.loc12: type = class_type @C, @C(constants.%true) [template = constants.%C.2] // CHECK:STDOUT: %d.var: ref %C.2 = var d // CHECK:STDOUT: %d: ref %C.2 = bind_name d, %d.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/builtins/bool/make_type.carbon b/toolchain/check/testdata/builtins/bool/make_type.carbon index 272bc28ae7ac5..73ac6f395e406 100644 --- a/toolchain/check/testdata/builtins/bool/make_type.carbon +++ b/toolchain/check/testdata/builtins/bool/make_type.carbon @@ -77,10 +77,6 @@ var b: Bool() = false; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %Bool.ref: %Bool.type = name_ref Bool, imports.%import_ref [template = constants.%Bool] -// CHECK:STDOUT: %bool.make_type: init type = call %Bool.ref() [template = bool] -// CHECK:STDOUT: %.loc6_13.1: type = value_of_initializer %bool.make_type [template = bool] -// CHECK:STDOUT: %.loc6_13.2: type = converted %bool.make_type, %.loc6_13.1 [template = bool] // CHECK:STDOUT: %b.var: ref bool = var b // CHECK:STDOUT: %b: ref bool = bind_name b, %b.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/builtins/bool/neq.carbon b/toolchain/check/testdata/builtins/bool/neq.carbon index bfa5a1df54902..97f127e556f0b 100644 --- a/toolchain/check/testdata/builtins/bool/neq.carbon +++ b/toolchain/check/testdata/builtins/bool/neq.carbon @@ -91,18 +91,22 @@ var d: C(false != false) = False(); // CHECK:STDOUT: %return.patt: bool = return_slot_pattern // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %bool.make_type.loc4_11: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %bool.make_type.loc4_11 [template = bool] -// CHECK:STDOUT: %.loc4_11.2: type = converted %bool.make_type.loc4_11, %.loc4_11.1 [template = bool] -// CHECK:STDOUT: %bool.make_type.loc4_20: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc4_20.1: type = value_of_initializer %bool.make_type.loc4_20 [template = bool] -// CHECK:STDOUT: %.loc4_20.2: type = converted %bool.make_type.loc4_20, %.loc4_20.1 [template = bool] // CHECK:STDOUT: %bool.make_type.loc4_29: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc4_29.1: type = value_of_initializer %bool.make_type.loc4_29 [template = bool] // CHECK:STDOUT: %.loc4_29.2: type = converted %bool.make_type.loc4_29, %.loc4_29.1 [template = bool] // CHECK:STDOUT: %a.param: bool = value_param runtime_param0 +// CHECK:STDOUT: %.loc4_11.3: type = splice_block %.loc4_11.2 [template = bool] { +// CHECK:STDOUT: %bool.make_type.loc4_11: init type = call constants.%Bool() [template = bool] +// CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %bool.make_type.loc4_11 [template = bool] +// CHECK:STDOUT: %.loc4_11.2: type = converted %bool.make_type.loc4_11, %.loc4_11.1 [template = bool] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: bool = bind_name a, %a.param // CHECK:STDOUT: %b.param: bool = value_param runtime_param1 +// CHECK:STDOUT: %.loc4_20.3: type = splice_block %.loc4_20.2 [template = bool] { +// CHECK:STDOUT: %bool.make_type.loc4_20: init type = call constants.%Bool() [template = bool] +// CHECK:STDOUT: %.loc4_20.1: type = value_of_initializer %bool.make_type.loc4_20 [template = bool] +// CHECK:STDOUT: %.loc4_20.2: type = converted %bool.make_type.loc4_20, %.loc4_20.1 [template = bool] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: bool = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param @@ -111,10 +115,12 @@ var d: C(false != false) = False(); // CHECK:STDOUT: %B.patt.loc6_9.1: bool = symbolic_binding_pattern B, 0 [symbolic = %B.patt.loc6_9.2 (constants.%B.patt)] // CHECK:STDOUT: %B.param_patt: bool = value_param_pattern %B.patt.loc6_9.1, runtime_param [symbolic = %B.patt.loc6_9.2 (constants.%B.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc6_13.1: type = value_of_initializer %bool.make_type [template = bool] -// CHECK:STDOUT: %.loc6_13.2: type = converted %bool.make_type, %.loc6_13.1 [template = bool] // CHECK:STDOUT: %B.param: bool = value_param runtime_param +// CHECK:STDOUT: %.loc6_13.3: type = splice_block %.loc6_13.2 [template = bool] { +// CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] +// CHECK:STDOUT: %.loc6_13.1: type = value_of_initializer %bool.make_type [template = bool] +// CHECK:STDOUT: %.loc6_13.2: type = converted %bool.make_type, %.loc6_13.1 [template = bool] +// CHECK:STDOUT: } // CHECK:STDOUT: %B.loc6_9.1: bool = bind_symbolic_name B, 0, %B.param [symbolic = %B.loc6_9.2 (constants.%B)] // CHECK:STDOUT: } // CHECK:STDOUT: %True.decl: %True.type = fn_decl @True [template = constants.%True] { @@ -137,44 +143,12 @@ var d: C(false != false) = False(); // CHECK:STDOUT: %return.param: ref %C.3 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %C.3 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %C.ref.loc11: %C.type = name_ref C, %C.decl [template = constants.%C.generic] -// CHECK:STDOUT: %Neq.ref.loc11: %Neq.type = name_ref Neq, %Neq.decl [template = constants.%Neq] -// CHECK:STDOUT: %true.loc11_14: bool = bool_literal true [template = constants.%true] -// CHECK:STDOUT: %true.loc11_20: bool = bool_literal true [template = constants.%true] -// CHECK:STDOUT: %bool.neq.loc11: init bool = call %Neq.ref.loc11(%true.loc11_14, %true.loc11_20) [template = constants.%false] -// CHECK:STDOUT: %.loc11_25.1: bool = value_of_initializer %bool.neq.loc11 [template = constants.%false] -// CHECK:STDOUT: %.loc11_25.2: bool = converted %bool.neq.loc11, %.loc11_25.1 [template = constants.%false] -// CHECK:STDOUT: %C.loc11: type = class_type @C, @C(constants.%false) [template = constants.%C.3] // CHECK:STDOUT: %a.var: ref %C.3 = var a // CHECK:STDOUT: %a: ref %C.3 = bind_name a, %a.var -// CHECK:STDOUT: %C.ref.loc12: %C.type = name_ref C, %C.decl [template = constants.%C.generic] -// CHECK:STDOUT: %Neq.ref.loc12: %Neq.type = name_ref Neq, %Neq.decl [template = constants.%Neq] -// CHECK:STDOUT: %true.loc12: bool = bool_literal true [template = constants.%true] -// CHECK:STDOUT: %false.loc12: bool = bool_literal false [template = constants.%false] -// CHECK:STDOUT: %bool.neq.loc12: init bool = call %Neq.ref.loc12(%true.loc12, %false.loc12) [template = constants.%true] -// CHECK:STDOUT: %.loc12_26.1: bool = value_of_initializer %bool.neq.loc12 [template = constants.%true] -// CHECK:STDOUT: %.loc12_26.2: bool = converted %bool.neq.loc12, %.loc12_26.1 [template = constants.%true] -// CHECK:STDOUT: %C.loc12: type = class_type @C, @C(constants.%true) [template = constants.%C.2] // CHECK:STDOUT: %b.var: ref %C.2 = var b // CHECK:STDOUT: %b: ref %C.2 = bind_name b, %b.var -// CHECK:STDOUT: %C.ref.loc13: %C.type = name_ref C, %C.decl [template = constants.%C.generic] -// CHECK:STDOUT: %Neq.ref.loc13: %Neq.type = name_ref Neq, %Neq.decl [template = constants.%Neq] -// CHECK:STDOUT: %false.loc13: bool = bool_literal false [template = constants.%false] -// CHECK:STDOUT: %true.loc13: bool = bool_literal true [template = constants.%true] -// CHECK:STDOUT: %bool.neq.loc13: init bool = call %Neq.ref.loc13(%false.loc13, %true.loc13) [template = constants.%true] -// CHECK:STDOUT: %.loc13_26.1: bool = value_of_initializer %bool.neq.loc13 [template = constants.%true] -// CHECK:STDOUT: %.loc13_26.2: bool = converted %bool.neq.loc13, %.loc13_26.1 [template = constants.%true] -// CHECK:STDOUT: %C.loc13: type = class_type @C, @C(constants.%true) [template = constants.%C.2] // CHECK:STDOUT: %c.var: ref %C.2 = var c // CHECK:STDOUT: %c: ref %C.2 = bind_name c, %c.var -// CHECK:STDOUT: %C.ref.loc14: %C.type = name_ref C, %C.decl [template = constants.%C.generic] -// CHECK:STDOUT: %Neq.ref.loc14: %Neq.type = name_ref Neq, %Neq.decl [template = constants.%Neq] -// CHECK:STDOUT: %false.loc14_14: bool = bool_literal false [template = constants.%false] -// CHECK:STDOUT: %false.loc14_21: bool = bool_literal false [template = constants.%false] -// CHECK:STDOUT: %bool.neq.loc14: init bool = call %Neq.ref.loc14(%false.loc14_14, %false.loc14_21) [template = constants.%false] -// CHECK:STDOUT: %.loc14_27.1: bool = value_of_initializer %bool.neq.loc14 [template = constants.%false] -// CHECK:STDOUT: %.loc14_27.2: bool = converted %bool.neq.loc14, %.loc14_27.1 [template = constants.%false] -// CHECK:STDOUT: %C.loc14: type = class_type @C, @C(constants.%false) [template = constants.%C.3] // CHECK:STDOUT: %d.var: ref %C.3 = var d // CHECK:STDOUT: %d: ref %C.3 = bind_name d, %d.var // CHECK:STDOUT: } @@ -260,14 +234,6 @@ var d: C(false != false) = False(); // CHECK:STDOUT: %C.3: type = class_type @C, @C(%false) [template] // CHECK:STDOUT: %False.type: type = fn_type @False [template] // CHECK:STDOUT: %False: %False.type = struct_value () [template] -// CHECK:STDOUT: %NotEqual.type.1: type = fn_type @NotEqual.1 [template] -// CHECK:STDOUT: %NotEqual.type.2: type = fn_type @NotEqual.2 [template] -// CHECK:STDOUT: %NotEqual.2: %NotEqual.type.2 = struct_value () [template] -// CHECK:STDOUT: %Equal.type: type = fn_type @Equal [template] -// CHECK:STDOUT: %Equal: %Equal.type = struct_value () [template] -// CHECK:STDOUT: %interface: = interface_witness (%Equal, %NotEqual.2) [template] -// CHECK:STDOUT: %NotEqual.bound.1: = bound_method %true, %NotEqual.2 [template] -// CHECK:STDOUT: %NotEqual.bound.2: = bound_method %false, %NotEqual.2 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -295,10 +261,12 @@ var d: C(false != false) = False(); // CHECK:STDOUT: %B.patt.loc4_9.1: bool = symbolic_binding_pattern B, 0 [symbolic = %B.patt.loc4_9.2 (constants.%B.patt)] // CHECK:STDOUT: %B.param_patt: bool = value_param_pattern %B.patt.loc4_9.1, runtime_param [symbolic = %B.patt.loc4_9.2 (constants.%B.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc4_13.1: type = value_of_initializer %bool.make_type [template = bool] -// CHECK:STDOUT: %.loc4_13.2: type = converted %bool.make_type, %.loc4_13.1 [template = bool] // CHECK:STDOUT: %B.param: bool = value_param runtime_param +// CHECK:STDOUT: %.loc4_13.3: type = splice_block %.loc4_13.2 [template = bool] { +// CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] +// CHECK:STDOUT: %.loc4_13.1: type = value_of_initializer %bool.make_type [template = bool] +// CHECK:STDOUT: %.loc4_13.2: type = converted %bool.make_type, %.loc4_13.1 [template = bool] +// CHECK:STDOUT: } // CHECK:STDOUT: %B.loc4_9.1: bool = bind_symbolic_name B, 0, %B.param [symbolic = %B.loc4_9.2 (constants.%B)] // CHECK:STDOUT: } // CHECK:STDOUT: %True.decl: %True.type = fn_decl @True [template = constants.%True] { @@ -321,48 +289,12 @@ var d: C(false != false) = False(); // CHECK:STDOUT: %return.param: ref %C.3 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %C.3 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %C.ref.loc9: %C.type = name_ref C, %C.decl [template = constants.%C.generic] -// CHECK:STDOUT: %true.loc9_10: bool = bool_literal true [template = constants.%true] -// CHECK:STDOUT: %true.loc9_18: bool = bool_literal true [template = constants.%true] -// CHECK:STDOUT: %impl.elem1.loc9: %NotEqual.type.1 = interface_witness_access constants.%interface, element1 [template = constants.%NotEqual.2] -// CHECK:STDOUT: %NotEqual.bound.loc9: = bound_method %true.loc9_10, %impl.elem1.loc9 [template = constants.%NotEqual.bound.1] -// CHECK:STDOUT: %bool.neq.loc9: init bool = call %NotEqual.bound.loc9(%true.loc9_10, %true.loc9_18) [template = constants.%false] -// CHECK:STDOUT: %.loc9_22.1: bool = value_of_initializer %bool.neq.loc9 [template = constants.%false] -// CHECK:STDOUT: %.loc9_22.2: bool = converted %bool.neq.loc9, %.loc9_22.1 [template = constants.%false] -// CHECK:STDOUT: %C.loc9: type = class_type @C, @C(constants.%false) [template = constants.%C.3] // CHECK:STDOUT: %a.var: ref %C.3 = var a // CHECK:STDOUT: %a: ref %C.3 = bind_name a, %a.var -// CHECK:STDOUT: %C.ref.loc10: %C.type = name_ref C, %C.decl [template = constants.%C.generic] -// CHECK:STDOUT: %true.loc10: bool = bool_literal true [template = constants.%true] -// CHECK:STDOUT: %false.loc10: bool = bool_literal false [template = constants.%false] -// CHECK:STDOUT: %impl.elem1.loc10: %NotEqual.type.1 = interface_witness_access constants.%interface, element1 [template = constants.%NotEqual.2] -// CHECK:STDOUT: %NotEqual.bound.loc10: = bound_method %true.loc10, %impl.elem1.loc10 [template = constants.%NotEqual.bound.1] -// CHECK:STDOUT: %bool.neq.loc10: init bool = call %NotEqual.bound.loc10(%true.loc10, %false.loc10) [template = constants.%true] -// CHECK:STDOUT: %.loc10_23.1: bool = value_of_initializer %bool.neq.loc10 [template = constants.%true] -// CHECK:STDOUT: %.loc10_23.2: bool = converted %bool.neq.loc10, %.loc10_23.1 [template = constants.%true] -// CHECK:STDOUT: %C.loc10: type = class_type @C, @C(constants.%true) [template = constants.%C.2] // CHECK:STDOUT: %b.var: ref %C.2 = var b // CHECK:STDOUT: %b: ref %C.2 = bind_name b, %b.var -// CHECK:STDOUT: %C.ref.loc11: %C.type = name_ref C, %C.decl [template = constants.%C.generic] -// CHECK:STDOUT: %false.loc11: bool = bool_literal false [template = constants.%false] -// CHECK:STDOUT: %true.loc11: bool = bool_literal true [template = constants.%true] -// CHECK:STDOUT: %impl.elem1.loc11: %NotEqual.type.1 = interface_witness_access constants.%interface, element1 [template = constants.%NotEqual.2] -// CHECK:STDOUT: %NotEqual.bound.loc11: = bound_method %false.loc11, %impl.elem1.loc11 [template = constants.%NotEqual.bound.2] -// CHECK:STDOUT: %bool.neq.loc11: init bool = call %NotEqual.bound.loc11(%false.loc11, %true.loc11) [template = constants.%true] -// CHECK:STDOUT: %.loc11_23.1: bool = value_of_initializer %bool.neq.loc11 [template = constants.%true] -// CHECK:STDOUT: %.loc11_23.2: bool = converted %bool.neq.loc11, %.loc11_23.1 [template = constants.%true] -// CHECK:STDOUT: %C.loc11: type = class_type @C, @C(constants.%true) [template = constants.%C.2] // CHECK:STDOUT: %c.var: ref %C.2 = var c // CHECK:STDOUT: %c: ref %C.2 = bind_name c, %c.var -// CHECK:STDOUT: %C.ref.loc12: %C.type = name_ref C, %C.decl [template = constants.%C.generic] -// CHECK:STDOUT: %false.loc12_10: bool = bool_literal false [template = constants.%false] -// CHECK:STDOUT: %false.loc12_19: bool = bool_literal false [template = constants.%false] -// CHECK:STDOUT: %impl.elem1.loc12: %NotEqual.type.1 = interface_witness_access constants.%interface, element1 [template = constants.%NotEqual.2] -// CHECK:STDOUT: %NotEqual.bound.loc12: = bound_method %false.loc12_10, %impl.elem1.loc12 [template = constants.%NotEqual.bound.2] -// CHECK:STDOUT: %bool.neq.loc12: init bool = call %NotEqual.bound.loc12(%false.loc12_10, %false.loc12_19) [template = constants.%false] -// CHECK:STDOUT: %.loc12_24.1: bool = value_of_initializer %bool.neq.loc12 [template = constants.%false] -// CHECK:STDOUT: %.loc12_24.2: bool = converted %bool.neq.loc12, %.loc12_24.1 [template = constants.%false] -// CHECK:STDOUT: %C.loc12: type = class_type @C, @C(constants.%false) [template = constants.%C.3] // CHECK:STDOUT: %d.var: ref %C.3 = var d // CHECK:STDOUT: %d: ref %C.3 = bind_name d, %d.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/builtins/float/add.carbon b/toolchain/check/testdata/builtins/float/add.carbon index 64d2deb187ae9..af85730e1b965 100644 --- a/toolchain/check/testdata/builtins/float/add.carbon +++ b/toolchain/check/testdata/builtins/float/add.carbon @@ -89,21 +89,25 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %return.patt: f64 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: f64 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_64.loc2_11: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc2_11: init type = call constants.%Float(%int_64.loc2_11) [template = f64] -// CHECK:STDOUT: %.loc2_11.1: type = value_of_initializer %float.make_type.loc2_11 [template = f64] -// CHECK:STDOUT: %.loc2_11.2: type = converted %float.make_type.loc2_11, %.loc2_11.1 [template = f64] -// CHECK:STDOUT: %int_64.loc2_19: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc2_19: init type = call constants.%Float(%int_64.loc2_19) [template = f64] -// CHECK:STDOUT: %.loc2_19.1: type = value_of_initializer %float.make_type.loc2_19 [template = f64] -// CHECK:STDOUT: %.loc2_19.2: type = converted %float.make_type.loc2_19, %.loc2_19.1 [template = f64] // CHECK:STDOUT: %int_64.loc2_27: Core.IntLiteral = int_value 64 [template = constants.%int_64] // CHECK:STDOUT: %float.make_type.loc2_27: init type = call constants.%Float(%int_64.loc2_27) [template = f64] // CHECK:STDOUT: %.loc2_27.1: type = value_of_initializer %float.make_type.loc2_27 [template = f64] // CHECK:STDOUT: %.loc2_27.2: type = converted %float.make_type.loc2_27, %.loc2_27.1 [template = f64] // CHECK:STDOUT: %a.param: f64 = value_param runtime_param0 +// CHECK:STDOUT: %.loc2_11.3: type = splice_block %.loc2_11.2 [template = f64] { +// CHECK:STDOUT: %int_64.loc2_11: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc2_11: init type = call constants.%Float(%int_64.loc2_11) [template = f64] +// CHECK:STDOUT: %.loc2_11.1: type = value_of_initializer %float.make_type.loc2_11 [template = f64] +// CHECK:STDOUT: %.loc2_11.2: type = converted %float.make_type.loc2_11, %.loc2_11.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %b.param: f64 = value_param runtime_param1 +// CHECK:STDOUT: %.loc2_19.3: type = splice_block %.loc2_19.2 [template = f64] { +// CHECK:STDOUT: %int_64.loc2_19: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc2_19: init type = call constants.%Float(%int_64.loc2_19) [template = f64] +// CHECK:STDOUT: %.loc2_19.1: type = value_of_initializer %float.make_type.loc2_19 [template = f64] +// CHECK:STDOUT: %.loc2_19.2: type = converted %float.make_type.loc2_19, %.loc2_19.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref f64 = out_param runtime_param2 // CHECK:STDOUT: %return: ref f64 = return_slot %return.param @@ -116,29 +120,29 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %return.patt: f64 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: f64 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_64.loc4_19: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc4_19: init type = call constants.%Float(%int_64.loc4_19) [template = f64] -// CHECK:STDOUT: %.loc4_19.1: type = value_of_initializer %float.make_type.loc4_19 [template = f64] -// CHECK:STDOUT: %.loc4_19.2: type = converted %float.make_type.loc4_19, %.loc4_19.1 [template = f64] -// CHECK:STDOUT: %int_64.loc4_27: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc4_27: init type = call constants.%Float(%int_64.loc4_27) [template = f64] -// CHECK:STDOUT: %.loc4_27.1: type = value_of_initializer %float.make_type.loc4_27 [template = f64] -// CHECK:STDOUT: %.loc4_27.2: type = converted %float.make_type.loc4_27, %.loc4_27.1 [template = f64] // CHECK:STDOUT: %int_64.loc4_35: Core.IntLiteral = int_value 64 [template = constants.%int_64] // CHECK:STDOUT: %float.make_type.loc4_35: init type = call constants.%Float(%int_64.loc4_35) [template = f64] // CHECK:STDOUT: %.loc4_35.1: type = value_of_initializer %float.make_type.loc4_35 [template = f64] // CHECK:STDOUT: %.loc4_35.2: type = converted %float.make_type.loc4_35, %.loc4_35.1 [template = f64] // CHECK:STDOUT: %a.param: f64 = value_param runtime_param0 +// CHECK:STDOUT: %.loc4_19.3: type = splice_block %.loc4_19.2 [template = f64] { +// CHECK:STDOUT: %int_64.loc4_19: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc4_19: init type = call constants.%Float(%int_64.loc4_19) [template = f64] +// CHECK:STDOUT: %.loc4_19.1: type = value_of_initializer %float.make_type.loc4_19 [template = f64] +// CHECK:STDOUT: %.loc4_19.2: type = converted %float.make_type.loc4_19, %.loc4_19.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %b.param: f64 = value_param runtime_param1 +// CHECK:STDOUT: %.loc4_27.3: type = splice_block %.loc4_27.2 [template = f64] { +// CHECK:STDOUT: %int_64.loc4_27: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc4_27: init type = call constants.%Float(%int_64.loc4_27) [template = f64] +// CHECK:STDOUT: %.loc4_27.1: type = value_of_initializer %float.make_type.loc4_27 [template = f64] +// CHECK:STDOUT: %.loc4_27.2: type = converted %float.make_type.loc4_27, %.loc4_27.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref f64 = out_param runtime_param2 // CHECK:STDOUT: %return: ref f64 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type: init type = call constants.%Float(%int_64) [template = f64] -// CHECK:STDOUT: %.loc8_8.1: type = value_of_initializer %float.make_type [template = f64] -// CHECK:STDOUT: %.loc8_8.2: type = converted %float.make_type, %.loc8_8.1 [template = f64] // CHECK:STDOUT: %x.var: ref f64 = var x // CHECK:STDOUT: %x: ref f64 = bind_name x, %x.var // CHECK:STDOUT: } @@ -217,15 +221,17 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %return.patt: f64 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: f64 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_64.loc8_14: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc8_14: init type = call constants.%Float(%int_64.loc8_14) [template = f64] -// CHECK:STDOUT: %.loc8_14.1: type = value_of_initializer %float.make_type.loc8_14 [template = f64] -// CHECK:STDOUT: %.loc8_14.2: type = converted %float.make_type.loc8_14, %.loc8_14.1 [template = f64] // CHECK:STDOUT: %int_64.loc8_22: Core.IntLiteral = int_value 64 [template = constants.%int_64] // CHECK:STDOUT: %float.make_type.loc8_22: init type = call constants.%Float(%int_64.loc8_22) [template = f64] // CHECK:STDOUT: %.loc8_22.1: type = value_of_initializer %float.make_type.loc8_22 [template = f64] // CHECK:STDOUT: %.loc8_22.2: type = converted %float.make_type.loc8_22, %.loc8_22.1 [template = f64] // CHECK:STDOUT: %a.param: f64 = value_param runtime_param0 +// CHECK:STDOUT: %.loc8_14.3: type = splice_block %.loc8_14.2 [template = f64] { +// CHECK:STDOUT: %int_64.loc8_14: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc8_14: init type = call constants.%Float(%int_64.loc8_14) [template = f64] +// CHECK:STDOUT: %.loc8_14.1: type = value_of_initializer %float.make_type.loc8_14 [template = f64] +// CHECK:STDOUT: %.loc8_14.2: type = converted %float.make_type.loc8_14, %.loc8_14.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref f64 = out_param runtime_param1 // CHECK:STDOUT: %return: ref f64 = return_slot %return.param @@ -240,27 +246,33 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %return.patt: f64 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: f64 = out_param_pattern %return.patt, runtime_param3 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_64.loc13_15: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc13_15: init type = call constants.%Float(%int_64.loc13_15) [template = f64] -// CHECK:STDOUT: %.loc13_15.1: type = value_of_initializer %float.make_type.loc13_15 [template = f64] -// CHECK:STDOUT: %.loc13_15.2: type = converted %float.make_type.loc13_15, %.loc13_15.1 [template = f64] -// CHECK:STDOUT: %int_64.loc13_23: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc13_23: init type = call constants.%Float(%int_64.loc13_23) [template = f64] -// CHECK:STDOUT: %.loc13_23.1: type = value_of_initializer %float.make_type.loc13_23 [template = f64] -// CHECK:STDOUT: %.loc13_23.2: type = converted %float.make_type.loc13_23, %.loc13_23.1 [template = f64] -// CHECK:STDOUT: %int_64.loc13_31: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc13_31: init type = call constants.%Float(%int_64.loc13_31) [template = f64] -// CHECK:STDOUT: %.loc13_31.1: type = value_of_initializer %float.make_type.loc13_31 [template = f64] -// CHECK:STDOUT: %.loc13_31.2: type = converted %float.make_type.loc13_31, %.loc13_31.1 [template = f64] // CHECK:STDOUT: %int_64.loc13_39: Core.IntLiteral = int_value 64 [template = constants.%int_64] // CHECK:STDOUT: %float.make_type.loc13_39: init type = call constants.%Float(%int_64.loc13_39) [template = f64] // CHECK:STDOUT: %.loc13_39.1: type = value_of_initializer %float.make_type.loc13_39 [template = f64] // CHECK:STDOUT: %.loc13_39.2: type = converted %float.make_type.loc13_39, %.loc13_39.1 [template = f64] // CHECK:STDOUT: %a.param: f64 = value_param runtime_param0 +// CHECK:STDOUT: %.loc13_15.3: type = splice_block %.loc13_15.2 [template = f64] { +// CHECK:STDOUT: %int_64.loc13_15: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc13_15: init type = call constants.%Float(%int_64.loc13_15) [template = f64] +// CHECK:STDOUT: %.loc13_15.1: type = value_of_initializer %float.make_type.loc13_15 [template = f64] +// CHECK:STDOUT: %.loc13_15.2: type = converted %float.make_type.loc13_15, %.loc13_15.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %b.param: f64 = value_param runtime_param1 +// CHECK:STDOUT: %.loc13_23.3: type = splice_block %.loc13_23.2 [template = f64] { +// CHECK:STDOUT: %int_64.loc13_23: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc13_23: init type = call constants.%Float(%int_64.loc13_23) [template = f64] +// CHECK:STDOUT: %.loc13_23.1: type = value_of_initializer %float.make_type.loc13_23 [template = f64] +// CHECK:STDOUT: %.loc13_23.2: type = converted %float.make_type.loc13_23, %.loc13_23.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %c.param: f64 = value_param runtime_param2 +// CHECK:STDOUT: %.loc13_31.3: type = splice_block %.loc13_31.2 [template = f64] { +// CHECK:STDOUT: %int_64.loc13_31: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc13_31: init type = call constants.%Float(%int_64.loc13_31) [template = f64] +// CHECK:STDOUT: %.loc13_31.1: type = value_of_initializer %float.make_type.loc13_31 [template = f64] +// CHECK:STDOUT: %.loc13_31.2: type = converted %float.make_type.loc13_31, %.loc13_31.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %c: f64 = bind_name c, %c.param // CHECK:STDOUT: %return.param: ref f64 = out_param runtime_param3 // CHECK:STDOUT: %return: ref f64 = return_slot %return.param @@ -273,20 +285,24 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %return.patt: bool = return_slot_pattern // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_64.loc17_21: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc17_21: init type = call constants.%Float(%int_64.loc17_21) [template = f64] -// CHECK:STDOUT: %.loc17_21.1: type = value_of_initializer %float.make_type.loc17_21 [template = f64] -// CHECK:STDOUT: %.loc17_21.2: type = converted %float.make_type.loc17_21, %.loc17_21.1 [template = f64] -// CHECK:STDOUT: %int_64.loc17_29: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc17_29: init type = call constants.%Float(%int_64.loc17_29) [template = f64] -// CHECK:STDOUT: %.loc17_29.1: type = value_of_initializer %float.make_type.loc17_29 [template = f64] -// CHECK:STDOUT: %.loc17_29.2: type = converted %float.make_type.loc17_29, %.loc17_29.1 [template = f64] // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc17_37.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc17_37.2: type = converted %bool.make_type, %.loc17_37.1 [template = bool] // CHECK:STDOUT: %a.param: f64 = value_param runtime_param0 +// CHECK:STDOUT: %.loc17_21.3: type = splice_block %.loc17_21.2 [template = f64] { +// CHECK:STDOUT: %int_64.loc17_21: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc17_21: init type = call constants.%Float(%int_64.loc17_21) [template = f64] +// CHECK:STDOUT: %.loc17_21.1: type = value_of_initializer %float.make_type.loc17_21 [template = f64] +// CHECK:STDOUT: %.loc17_21.2: type = converted %float.make_type.loc17_21, %.loc17_21.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %b.param: f64 = value_param runtime_param1 +// CHECK:STDOUT: %.loc17_29.3: type = splice_block %.loc17_29.2 [template = f64] { +// CHECK:STDOUT: %int_64.loc17_29: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc17_29: init type = call constants.%Float(%int_64.loc17_29) [template = f64] +// CHECK:STDOUT: %.loc17_29.1: type = value_of_initializer %float.make_type.loc17_29 [template = f64] +// CHECK:STDOUT: %.loc17_29.2: type = converted %float.make_type.loc17_29, %.loc17_29.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param @@ -299,21 +315,25 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %return.patt: f64 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: f64 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_64.loc18_17: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc18_17: init type = call constants.%Float(%int_64.loc18_17) [template = f64] -// CHECK:STDOUT: %.loc18_17.1: type = value_of_initializer %float.make_type.loc18_17 [template = f64] -// CHECK:STDOUT: %.loc18_17.2: type = converted %float.make_type.loc18_17, %.loc18_17.1 [template = f64] -// CHECK:STDOUT: %int_64.loc18_25: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc18_25: init type = call constants.%Float(%int_64.loc18_25) [template = f64] -// CHECK:STDOUT: %.loc18_25.1: type = value_of_initializer %float.make_type.loc18_25 [template = f64] -// CHECK:STDOUT: %.loc18_25.2: type = converted %float.make_type.loc18_25, %.loc18_25.1 [template = f64] // CHECK:STDOUT: %int_64.loc18_33: Core.IntLiteral = int_value 64 [template = constants.%int_64] // CHECK:STDOUT: %float.make_type.loc18_33: init type = call constants.%Float(%int_64.loc18_33) [template = f64] // CHECK:STDOUT: %.loc18_33.1: type = value_of_initializer %float.make_type.loc18_33 [template = f64] // CHECK:STDOUT: %.loc18_33.2: type = converted %float.make_type.loc18_33, %.loc18_33.1 [template = f64] // CHECK:STDOUT: %a.param: f64 = value_param runtime_param0 +// CHECK:STDOUT: %.loc18_17.3: type = splice_block %.loc18_17.2 [template = f64] { +// CHECK:STDOUT: %int_64.loc18_17: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc18_17: init type = call constants.%Float(%int_64.loc18_17) [template = f64] +// CHECK:STDOUT: %.loc18_17.1: type = value_of_initializer %float.make_type.loc18_17 [template = f64] +// CHECK:STDOUT: %.loc18_17.2: type = converted %float.make_type.loc18_17, %.loc18_17.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %b.param: f64 = value_param runtime_param1 +// CHECK:STDOUT: %.loc18_25.3: type = splice_block %.loc18_25.2 [template = f64] { +// CHECK:STDOUT: %int_64.loc18_25: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc18_25: init type = call constants.%Float(%int_64.loc18_25) [template = f64] +// CHECK:STDOUT: %.loc18_25.1: type = value_of_initializer %float.make_type.loc18_25 [template = f64] +// CHECK:STDOUT: %.loc18_25.2: type = converted %float.make_type.loc18_25, %.loc18_25.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref f64 = out_param runtime_param2 // CHECK:STDOUT: %return: ref f64 = return_slot %return.param @@ -324,15 +344,17 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %return.patt: f64 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: f64 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_64.loc20_25: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc20_25: init type = call constants.%Float(%int_64.loc20_25) [template = f64] -// CHECK:STDOUT: %.loc20_25.1: type = value_of_initializer %float.make_type.loc20_25 [template = f64] -// CHECK:STDOUT: %.loc20_25.2: type = converted %float.make_type.loc20_25, %.loc20_25.1 [template = f64] // CHECK:STDOUT: %int_64.loc20_33: Core.IntLiteral = int_value 64 [template = constants.%int_64] // CHECK:STDOUT: %float.make_type.loc20_33: init type = call constants.%Float(%int_64.loc20_33) [template = f64] // CHECK:STDOUT: %.loc20_33.1: type = value_of_initializer %float.make_type.loc20_33 [template = f64] // CHECK:STDOUT: %.loc20_33.2: type = converted %float.make_type.loc20_33, %.loc20_33.1 [template = f64] // CHECK:STDOUT: %a.param: f64 = value_param runtime_param0 +// CHECK:STDOUT: %.loc20_25.3: type = splice_block %.loc20_25.2 [template = f64] { +// CHECK:STDOUT: %int_64.loc20_25: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc20_25: init type = call constants.%Float(%int_64.loc20_25) [template = f64] +// CHECK:STDOUT: %.loc20_25.1: type = value_of_initializer %float.make_type.loc20_25 [template = f64] +// CHECK:STDOUT: %.loc20_25.2: type = converted %float.make_type.loc20_25, %.loc20_25.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref f64 = out_param runtime_param1 // CHECK:STDOUT: %return: ref f64 = return_slot %return.param @@ -347,27 +369,33 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %return.patt: f64 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: f64 = out_param_pattern %return.patt, runtime_param3 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_64.loc24_26: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc24_26: init type = call constants.%Float(%int_64.loc24_26) [template = f64] -// CHECK:STDOUT: %.loc24_26.1: type = value_of_initializer %float.make_type.loc24_26 [template = f64] -// CHECK:STDOUT: %.loc24_26.2: type = converted %float.make_type.loc24_26, %.loc24_26.1 [template = f64] -// CHECK:STDOUT: %int_64.loc24_34: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc24_34: init type = call constants.%Float(%int_64.loc24_34) [template = f64] -// CHECK:STDOUT: %.loc24_34.1: type = value_of_initializer %float.make_type.loc24_34 [template = f64] -// CHECK:STDOUT: %.loc24_34.2: type = converted %float.make_type.loc24_34, %.loc24_34.1 [template = f64] -// CHECK:STDOUT: %int_64.loc24_42: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc24_42: init type = call constants.%Float(%int_64.loc24_42) [template = f64] -// CHECK:STDOUT: %.loc24_42.1: type = value_of_initializer %float.make_type.loc24_42 [template = f64] -// CHECK:STDOUT: %.loc24_42.2: type = converted %float.make_type.loc24_42, %.loc24_42.1 [template = f64] // CHECK:STDOUT: %int_64.loc24_50: Core.IntLiteral = int_value 64 [template = constants.%int_64] // CHECK:STDOUT: %float.make_type.loc24_50: init type = call constants.%Float(%int_64.loc24_50) [template = f64] // CHECK:STDOUT: %.loc24_50.1: type = value_of_initializer %float.make_type.loc24_50 [template = f64] // CHECK:STDOUT: %.loc24_50.2: type = converted %float.make_type.loc24_50, %.loc24_50.1 [template = f64] // CHECK:STDOUT: %a.param: f64 = value_param runtime_param0 +// CHECK:STDOUT: %.loc24_26.3: type = splice_block %.loc24_26.2 [template = f64] { +// CHECK:STDOUT: %int_64.loc24_26: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc24_26: init type = call constants.%Float(%int_64.loc24_26) [template = f64] +// CHECK:STDOUT: %.loc24_26.1: type = value_of_initializer %float.make_type.loc24_26 [template = f64] +// CHECK:STDOUT: %.loc24_26.2: type = converted %float.make_type.loc24_26, %.loc24_26.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %b.param: f64 = value_param runtime_param1 +// CHECK:STDOUT: %.loc24_34.3: type = splice_block %.loc24_34.2 [template = f64] { +// CHECK:STDOUT: %int_64.loc24_34: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc24_34: init type = call constants.%Float(%int_64.loc24_34) [template = f64] +// CHECK:STDOUT: %.loc24_34.1: type = value_of_initializer %float.make_type.loc24_34 [template = f64] +// CHECK:STDOUT: %.loc24_34.2: type = converted %float.make_type.loc24_34, %.loc24_34.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %c.param: f64 = value_param runtime_param2 +// CHECK:STDOUT: %.loc24_42.3: type = splice_block %.loc24_42.2 [template = f64] { +// CHECK:STDOUT: %int_64.loc24_42: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc24_42: init type = call constants.%Float(%int_64.loc24_42) [template = f64] +// CHECK:STDOUT: %.loc24_42.1: type = value_of_initializer %float.make_type.loc24_42 [template = f64] +// CHECK:STDOUT: %.loc24_42.2: type = converted %float.make_type.loc24_42, %.loc24_42.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %c: f64 = bind_name c, %c.param // CHECK:STDOUT: %return.param: ref f64 = out_param runtime_param3 // CHECK:STDOUT: %return: ref f64 = return_slot %return.param @@ -380,20 +408,24 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %return.patt: bool = return_slot_pattern // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_64.loc28_32: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc28_32: init type = call constants.%Float(%int_64.loc28_32) [template = f64] -// CHECK:STDOUT: %.loc28_32.1: type = value_of_initializer %float.make_type.loc28_32 [template = f64] -// CHECK:STDOUT: %.loc28_32.2: type = converted %float.make_type.loc28_32, %.loc28_32.1 [template = f64] -// CHECK:STDOUT: %int_64.loc28_40: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc28_40: init type = call constants.%Float(%int_64.loc28_40) [template = f64] -// CHECK:STDOUT: %.loc28_40.1: type = value_of_initializer %float.make_type.loc28_40 [template = f64] -// CHECK:STDOUT: %.loc28_40.2: type = converted %float.make_type.loc28_40, %.loc28_40.1 [template = f64] // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc28_48.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc28_48.2: type = converted %bool.make_type, %.loc28_48.1 [template = bool] // CHECK:STDOUT: %a.param: f64 = value_param runtime_param0 +// CHECK:STDOUT: %.loc28_32.3: type = splice_block %.loc28_32.2 [template = f64] { +// CHECK:STDOUT: %int_64.loc28_32: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc28_32: init type = call constants.%Float(%int_64.loc28_32) [template = f64] +// CHECK:STDOUT: %.loc28_32.1: type = value_of_initializer %float.make_type.loc28_32 [template = f64] +// CHECK:STDOUT: %.loc28_32.2: type = converted %float.make_type.loc28_32, %.loc28_32.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %b.param: f64 = value_param runtime_param1 +// CHECK:STDOUT: %.loc28_40.3: type = splice_block %.loc28_40.2 [template = f64] { +// CHECK:STDOUT: %int_64.loc28_40: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc28_40: init type = call constants.%Float(%int_64.loc28_40) [template = f64] +// CHECK:STDOUT: %.loc28_40.1: type = value_of_initializer %float.make_type.loc28_40 [template = f64] +// CHECK:STDOUT: %.loc28_40.2: type = converted %float.make_type.loc28_40, %.loc28_40.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param diff --git a/toolchain/check/testdata/builtins/float/div.carbon b/toolchain/check/testdata/builtins/float/div.carbon index df99f7e56deaf..a3eb82a0e4240 100644 --- a/toolchain/check/testdata/builtins/float/div.carbon +++ b/toolchain/check/testdata/builtins/float/div.carbon @@ -97,21 +97,25 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %return.patt: f64 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: f64 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_64.loc2_11: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc2_11: init type = call constants.%Float(%int_64.loc2_11) [template = f64] -// CHECK:STDOUT: %.loc2_11.1: type = value_of_initializer %float.make_type.loc2_11 [template = f64] -// CHECK:STDOUT: %.loc2_11.2: type = converted %float.make_type.loc2_11, %.loc2_11.1 [template = f64] -// CHECK:STDOUT: %int_64.loc2_19: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc2_19: init type = call constants.%Float(%int_64.loc2_19) [template = f64] -// CHECK:STDOUT: %.loc2_19.1: type = value_of_initializer %float.make_type.loc2_19 [template = f64] -// CHECK:STDOUT: %.loc2_19.2: type = converted %float.make_type.loc2_19, %.loc2_19.1 [template = f64] // CHECK:STDOUT: %int_64.loc2_27: Core.IntLiteral = int_value 64 [template = constants.%int_64] // CHECK:STDOUT: %float.make_type.loc2_27: init type = call constants.%Float(%int_64.loc2_27) [template = f64] // CHECK:STDOUT: %.loc2_27.1: type = value_of_initializer %float.make_type.loc2_27 [template = f64] // CHECK:STDOUT: %.loc2_27.2: type = converted %float.make_type.loc2_27, %.loc2_27.1 [template = f64] // CHECK:STDOUT: %a.param: f64 = value_param runtime_param0 +// CHECK:STDOUT: %.loc2_11.3: type = splice_block %.loc2_11.2 [template = f64] { +// CHECK:STDOUT: %int_64.loc2_11: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc2_11: init type = call constants.%Float(%int_64.loc2_11) [template = f64] +// CHECK:STDOUT: %.loc2_11.1: type = value_of_initializer %float.make_type.loc2_11 [template = f64] +// CHECK:STDOUT: %.loc2_11.2: type = converted %float.make_type.loc2_11, %.loc2_11.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %b.param: f64 = value_param runtime_param1 +// CHECK:STDOUT: %.loc2_19.3: type = splice_block %.loc2_19.2 [template = f64] { +// CHECK:STDOUT: %int_64.loc2_19: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc2_19: init type = call constants.%Float(%int_64.loc2_19) [template = f64] +// CHECK:STDOUT: %.loc2_19.1: type = value_of_initializer %float.make_type.loc2_19 [template = f64] +// CHECK:STDOUT: %.loc2_19.2: type = converted %float.make_type.loc2_19, %.loc2_19.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref f64 = out_param runtime_param2 // CHECK:STDOUT: %return: ref f64 = return_slot %return.param @@ -124,39 +128,31 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %return.patt: f64 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: f64 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_64.loc4_19: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc4_19: init type = call constants.%Float(%int_64.loc4_19) [template = f64] -// CHECK:STDOUT: %.loc4_19.1: type = value_of_initializer %float.make_type.loc4_19 [template = f64] -// CHECK:STDOUT: %.loc4_19.2: type = converted %float.make_type.loc4_19, %.loc4_19.1 [template = f64] -// CHECK:STDOUT: %int_64.loc4_27: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc4_27: init type = call constants.%Float(%int_64.loc4_27) [template = f64] -// CHECK:STDOUT: %.loc4_27.1: type = value_of_initializer %float.make_type.loc4_27 [template = f64] -// CHECK:STDOUT: %.loc4_27.2: type = converted %float.make_type.loc4_27, %.loc4_27.1 [template = f64] // CHECK:STDOUT: %int_64.loc4_35: Core.IntLiteral = int_value 64 [template = constants.%int_64] // CHECK:STDOUT: %float.make_type.loc4_35: init type = call constants.%Float(%int_64.loc4_35) [template = f64] // CHECK:STDOUT: %.loc4_35.1: type = value_of_initializer %float.make_type.loc4_35 [template = f64] // CHECK:STDOUT: %.loc4_35.2: type = converted %float.make_type.loc4_35, %.loc4_35.1 [template = f64] // CHECK:STDOUT: %a.param: f64 = value_param runtime_param0 +// CHECK:STDOUT: %.loc4_19.3: type = splice_block %.loc4_19.2 [template = f64] { +// CHECK:STDOUT: %int_64.loc4_19: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc4_19: init type = call constants.%Float(%int_64.loc4_19) [template = f64] +// CHECK:STDOUT: %.loc4_19.1: type = value_of_initializer %float.make_type.loc4_19 [template = f64] +// CHECK:STDOUT: %.loc4_19.2: type = converted %float.make_type.loc4_19, %.loc4_19.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %b.param: f64 = value_param runtime_param1 +// CHECK:STDOUT: %.loc4_27.3: type = splice_block %.loc4_27.2 [template = f64] { +// CHECK:STDOUT: %int_64.loc4_27: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc4_27: init type = call constants.%Float(%int_64.loc4_27) [template = f64] +// CHECK:STDOUT: %.loc4_27.1: type = value_of_initializer %float.make_type.loc4_27 [template = f64] +// CHECK:STDOUT: %.loc4_27.2: type = converted %float.make_type.loc4_27, %.loc4_27.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref f64 = out_param runtime_param2 // CHECK:STDOUT: %return: ref f64 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %int_64.loc8: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc8: init type = call constants.%Float(%int_64.loc8) [template = f64] -// CHECK:STDOUT: %.loc8_8.1: type = value_of_initializer %float.make_type.loc8 [template = f64] -// CHECK:STDOUT: %.loc8_8.2: type = converted %float.make_type.loc8, %.loc8_8.1 [template = f64] // CHECK:STDOUT: %a.var: ref f64 = var a // CHECK:STDOUT: %a: ref f64 = bind_name a, %a.var -// CHECK:STDOUT: %int_64.loc9: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc9: init type = call constants.%Float(%int_64.loc9) [template = f64] -// CHECK:STDOUT: %.loc9_8.1: type = value_of_initializer %float.make_type.loc9 [template = f64] -// CHECK:STDOUT: %.loc9_8.2: type = converted %float.make_type.loc9, %.loc9_8.1 [template = f64] -// CHECK:STDOUT: %int_64.loc10: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc10: init type = call constants.%Float(%int_64.loc10) [template = f64] -// CHECK:STDOUT: %.loc10_8.1: type = value_of_initializer %float.make_type.loc10 [template = f64] -// CHECK:STDOUT: %.loc10_8.2: type = converted %float.make_type.loc10, %.loc10_8.1 [template = f64] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Div(%a.param_patt: f64, %b.param_patt: f64) -> f64 = "float.div"; @@ -247,15 +243,17 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %return.patt: f64 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: f64 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_64.loc8_14: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc8_14: init type = call constants.%Float(%int_64.loc8_14) [template = f64] -// CHECK:STDOUT: %.loc8_14.1: type = value_of_initializer %float.make_type.loc8_14 [template = f64] -// CHECK:STDOUT: %.loc8_14.2: type = converted %float.make_type.loc8_14, %.loc8_14.1 [template = f64] // CHECK:STDOUT: %int_64.loc8_22: Core.IntLiteral = int_value 64 [template = constants.%int_64] // CHECK:STDOUT: %float.make_type.loc8_22: init type = call constants.%Float(%int_64.loc8_22) [template = f64] // CHECK:STDOUT: %.loc8_22.1: type = value_of_initializer %float.make_type.loc8_22 [template = f64] // CHECK:STDOUT: %.loc8_22.2: type = converted %float.make_type.loc8_22, %.loc8_22.1 [template = f64] // CHECK:STDOUT: %a.param: f64 = value_param runtime_param0 +// CHECK:STDOUT: %.loc8_14.3: type = splice_block %.loc8_14.2 [template = f64] { +// CHECK:STDOUT: %int_64.loc8_14: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc8_14: init type = call constants.%Float(%int_64.loc8_14) [template = f64] +// CHECK:STDOUT: %.loc8_14.1: type = value_of_initializer %float.make_type.loc8_14 [template = f64] +// CHECK:STDOUT: %.loc8_14.2: type = converted %float.make_type.loc8_14, %.loc8_14.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref f64 = out_param runtime_param1 // CHECK:STDOUT: %return: ref f64 = return_slot %return.param @@ -270,27 +268,33 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %return.patt: f64 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: f64 = out_param_pattern %return.patt, runtime_param3 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_64.loc13_15: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc13_15: init type = call constants.%Float(%int_64.loc13_15) [template = f64] -// CHECK:STDOUT: %.loc13_15.1: type = value_of_initializer %float.make_type.loc13_15 [template = f64] -// CHECK:STDOUT: %.loc13_15.2: type = converted %float.make_type.loc13_15, %.loc13_15.1 [template = f64] -// CHECK:STDOUT: %int_64.loc13_23: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc13_23: init type = call constants.%Float(%int_64.loc13_23) [template = f64] -// CHECK:STDOUT: %.loc13_23.1: type = value_of_initializer %float.make_type.loc13_23 [template = f64] -// CHECK:STDOUT: %.loc13_23.2: type = converted %float.make_type.loc13_23, %.loc13_23.1 [template = f64] -// CHECK:STDOUT: %int_64.loc13_31: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc13_31: init type = call constants.%Float(%int_64.loc13_31) [template = f64] -// CHECK:STDOUT: %.loc13_31.1: type = value_of_initializer %float.make_type.loc13_31 [template = f64] -// CHECK:STDOUT: %.loc13_31.2: type = converted %float.make_type.loc13_31, %.loc13_31.1 [template = f64] // CHECK:STDOUT: %int_64.loc13_39: Core.IntLiteral = int_value 64 [template = constants.%int_64] // CHECK:STDOUT: %float.make_type.loc13_39: init type = call constants.%Float(%int_64.loc13_39) [template = f64] // CHECK:STDOUT: %.loc13_39.1: type = value_of_initializer %float.make_type.loc13_39 [template = f64] // CHECK:STDOUT: %.loc13_39.2: type = converted %float.make_type.loc13_39, %.loc13_39.1 [template = f64] // CHECK:STDOUT: %a.param: f64 = value_param runtime_param0 +// CHECK:STDOUT: %.loc13_15.3: type = splice_block %.loc13_15.2 [template = f64] { +// CHECK:STDOUT: %int_64.loc13_15: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc13_15: init type = call constants.%Float(%int_64.loc13_15) [template = f64] +// CHECK:STDOUT: %.loc13_15.1: type = value_of_initializer %float.make_type.loc13_15 [template = f64] +// CHECK:STDOUT: %.loc13_15.2: type = converted %float.make_type.loc13_15, %.loc13_15.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %b.param: f64 = value_param runtime_param1 +// CHECK:STDOUT: %.loc13_23.3: type = splice_block %.loc13_23.2 [template = f64] { +// CHECK:STDOUT: %int_64.loc13_23: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc13_23: init type = call constants.%Float(%int_64.loc13_23) [template = f64] +// CHECK:STDOUT: %.loc13_23.1: type = value_of_initializer %float.make_type.loc13_23 [template = f64] +// CHECK:STDOUT: %.loc13_23.2: type = converted %float.make_type.loc13_23, %.loc13_23.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %c.param: f64 = value_param runtime_param2 +// CHECK:STDOUT: %.loc13_31.3: type = splice_block %.loc13_31.2 [template = f64] { +// CHECK:STDOUT: %int_64.loc13_31: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc13_31: init type = call constants.%Float(%int_64.loc13_31) [template = f64] +// CHECK:STDOUT: %.loc13_31.1: type = value_of_initializer %float.make_type.loc13_31 [template = f64] +// CHECK:STDOUT: %.loc13_31.2: type = converted %float.make_type.loc13_31, %.loc13_31.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %c: f64 = bind_name c, %c.param // CHECK:STDOUT: %return.param: ref f64 = out_param runtime_param3 // CHECK:STDOUT: %return: ref f64 = return_slot %return.param @@ -303,20 +307,24 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %return.patt: bool = return_slot_pattern // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_64.loc17_21: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc17_21: init type = call constants.%Float(%int_64.loc17_21) [template = f64] -// CHECK:STDOUT: %.loc17_21.1: type = value_of_initializer %float.make_type.loc17_21 [template = f64] -// CHECK:STDOUT: %.loc17_21.2: type = converted %float.make_type.loc17_21, %.loc17_21.1 [template = f64] -// CHECK:STDOUT: %int_64.loc17_29: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc17_29: init type = call constants.%Float(%int_64.loc17_29) [template = f64] -// CHECK:STDOUT: %.loc17_29.1: type = value_of_initializer %float.make_type.loc17_29 [template = f64] -// CHECK:STDOUT: %.loc17_29.2: type = converted %float.make_type.loc17_29, %.loc17_29.1 [template = f64] // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc17_37.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc17_37.2: type = converted %bool.make_type, %.loc17_37.1 [template = bool] // CHECK:STDOUT: %a.param: f64 = value_param runtime_param0 +// CHECK:STDOUT: %.loc17_21.3: type = splice_block %.loc17_21.2 [template = f64] { +// CHECK:STDOUT: %int_64.loc17_21: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc17_21: init type = call constants.%Float(%int_64.loc17_21) [template = f64] +// CHECK:STDOUT: %.loc17_21.1: type = value_of_initializer %float.make_type.loc17_21 [template = f64] +// CHECK:STDOUT: %.loc17_21.2: type = converted %float.make_type.loc17_21, %.loc17_21.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %b.param: f64 = value_param runtime_param1 +// CHECK:STDOUT: %.loc17_29.3: type = splice_block %.loc17_29.2 [template = f64] { +// CHECK:STDOUT: %int_64.loc17_29: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc17_29: init type = call constants.%Float(%int_64.loc17_29) [template = f64] +// CHECK:STDOUT: %.loc17_29.1: type = value_of_initializer %float.make_type.loc17_29 [template = f64] +// CHECK:STDOUT: %.loc17_29.2: type = converted %float.make_type.loc17_29, %.loc17_29.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param @@ -329,21 +337,25 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %return.patt: f64 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: f64 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_64.loc18_17: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc18_17: init type = call constants.%Float(%int_64.loc18_17) [template = f64] -// CHECK:STDOUT: %.loc18_17.1: type = value_of_initializer %float.make_type.loc18_17 [template = f64] -// CHECK:STDOUT: %.loc18_17.2: type = converted %float.make_type.loc18_17, %.loc18_17.1 [template = f64] -// CHECK:STDOUT: %int_64.loc18_25: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc18_25: init type = call constants.%Float(%int_64.loc18_25) [template = f64] -// CHECK:STDOUT: %.loc18_25.1: type = value_of_initializer %float.make_type.loc18_25 [template = f64] -// CHECK:STDOUT: %.loc18_25.2: type = converted %float.make_type.loc18_25, %.loc18_25.1 [template = f64] // CHECK:STDOUT: %int_64.loc18_33: Core.IntLiteral = int_value 64 [template = constants.%int_64] // CHECK:STDOUT: %float.make_type.loc18_33: init type = call constants.%Float(%int_64.loc18_33) [template = f64] // CHECK:STDOUT: %.loc18_33.1: type = value_of_initializer %float.make_type.loc18_33 [template = f64] // CHECK:STDOUT: %.loc18_33.2: type = converted %float.make_type.loc18_33, %.loc18_33.1 [template = f64] // CHECK:STDOUT: %a.param: f64 = value_param runtime_param0 +// CHECK:STDOUT: %.loc18_17.3: type = splice_block %.loc18_17.2 [template = f64] { +// CHECK:STDOUT: %int_64.loc18_17: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc18_17: init type = call constants.%Float(%int_64.loc18_17) [template = f64] +// CHECK:STDOUT: %.loc18_17.1: type = value_of_initializer %float.make_type.loc18_17 [template = f64] +// CHECK:STDOUT: %.loc18_17.2: type = converted %float.make_type.loc18_17, %.loc18_17.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %b.param: f64 = value_param runtime_param1 +// CHECK:STDOUT: %.loc18_25.3: type = splice_block %.loc18_25.2 [template = f64] { +// CHECK:STDOUT: %int_64.loc18_25: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc18_25: init type = call constants.%Float(%int_64.loc18_25) [template = f64] +// CHECK:STDOUT: %.loc18_25.1: type = value_of_initializer %float.make_type.loc18_25 [template = f64] +// CHECK:STDOUT: %.loc18_25.2: type = converted %float.make_type.loc18_25, %.loc18_25.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref f64 = out_param runtime_param2 // CHECK:STDOUT: %return: ref f64 = return_slot %return.param @@ -354,15 +366,17 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %return.patt: f64 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: f64 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_64.loc20_25: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc20_25: init type = call constants.%Float(%int_64.loc20_25) [template = f64] -// CHECK:STDOUT: %.loc20_25.1: type = value_of_initializer %float.make_type.loc20_25 [template = f64] -// CHECK:STDOUT: %.loc20_25.2: type = converted %float.make_type.loc20_25, %.loc20_25.1 [template = f64] // CHECK:STDOUT: %int_64.loc20_33: Core.IntLiteral = int_value 64 [template = constants.%int_64] // CHECK:STDOUT: %float.make_type.loc20_33: init type = call constants.%Float(%int_64.loc20_33) [template = f64] // CHECK:STDOUT: %.loc20_33.1: type = value_of_initializer %float.make_type.loc20_33 [template = f64] // CHECK:STDOUT: %.loc20_33.2: type = converted %float.make_type.loc20_33, %.loc20_33.1 [template = f64] // CHECK:STDOUT: %a.param: f64 = value_param runtime_param0 +// CHECK:STDOUT: %.loc20_25.3: type = splice_block %.loc20_25.2 [template = f64] { +// CHECK:STDOUT: %int_64.loc20_25: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc20_25: init type = call constants.%Float(%int_64.loc20_25) [template = f64] +// CHECK:STDOUT: %.loc20_25.1: type = value_of_initializer %float.make_type.loc20_25 [template = f64] +// CHECK:STDOUT: %.loc20_25.2: type = converted %float.make_type.loc20_25, %.loc20_25.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref f64 = out_param runtime_param1 // CHECK:STDOUT: %return: ref f64 = return_slot %return.param @@ -377,27 +391,33 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %return.patt: f64 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: f64 = out_param_pattern %return.patt, runtime_param3 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_64.loc24_26: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc24_26: init type = call constants.%Float(%int_64.loc24_26) [template = f64] -// CHECK:STDOUT: %.loc24_26.1: type = value_of_initializer %float.make_type.loc24_26 [template = f64] -// CHECK:STDOUT: %.loc24_26.2: type = converted %float.make_type.loc24_26, %.loc24_26.1 [template = f64] -// CHECK:STDOUT: %int_64.loc24_34: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc24_34: init type = call constants.%Float(%int_64.loc24_34) [template = f64] -// CHECK:STDOUT: %.loc24_34.1: type = value_of_initializer %float.make_type.loc24_34 [template = f64] -// CHECK:STDOUT: %.loc24_34.2: type = converted %float.make_type.loc24_34, %.loc24_34.1 [template = f64] -// CHECK:STDOUT: %int_64.loc24_42: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc24_42: init type = call constants.%Float(%int_64.loc24_42) [template = f64] -// CHECK:STDOUT: %.loc24_42.1: type = value_of_initializer %float.make_type.loc24_42 [template = f64] -// CHECK:STDOUT: %.loc24_42.2: type = converted %float.make_type.loc24_42, %.loc24_42.1 [template = f64] // CHECK:STDOUT: %int_64.loc24_50: Core.IntLiteral = int_value 64 [template = constants.%int_64] // CHECK:STDOUT: %float.make_type.loc24_50: init type = call constants.%Float(%int_64.loc24_50) [template = f64] // CHECK:STDOUT: %.loc24_50.1: type = value_of_initializer %float.make_type.loc24_50 [template = f64] // CHECK:STDOUT: %.loc24_50.2: type = converted %float.make_type.loc24_50, %.loc24_50.1 [template = f64] // CHECK:STDOUT: %a.param: f64 = value_param runtime_param0 +// CHECK:STDOUT: %.loc24_26.3: type = splice_block %.loc24_26.2 [template = f64] { +// CHECK:STDOUT: %int_64.loc24_26: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc24_26: init type = call constants.%Float(%int_64.loc24_26) [template = f64] +// CHECK:STDOUT: %.loc24_26.1: type = value_of_initializer %float.make_type.loc24_26 [template = f64] +// CHECK:STDOUT: %.loc24_26.2: type = converted %float.make_type.loc24_26, %.loc24_26.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %b.param: f64 = value_param runtime_param1 +// CHECK:STDOUT: %.loc24_34.3: type = splice_block %.loc24_34.2 [template = f64] { +// CHECK:STDOUT: %int_64.loc24_34: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc24_34: init type = call constants.%Float(%int_64.loc24_34) [template = f64] +// CHECK:STDOUT: %.loc24_34.1: type = value_of_initializer %float.make_type.loc24_34 [template = f64] +// CHECK:STDOUT: %.loc24_34.2: type = converted %float.make_type.loc24_34, %.loc24_34.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %c.param: f64 = value_param runtime_param2 +// CHECK:STDOUT: %.loc24_42.3: type = splice_block %.loc24_42.2 [template = f64] { +// CHECK:STDOUT: %int_64.loc24_42: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc24_42: init type = call constants.%Float(%int_64.loc24_42) [template = f64] +// CHECK:STDOUT: %.loc24_42.1: type = value_of_initializer %float.make_type.loc24_42 [template = f64] +// CHECK:STDOUT: %.loc24_42.2: type = converted %float.make_type.loc24_42, %.loc24_42.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %c: f64 = bind_name c, %c.param // CHECK:STDOUT: %return.param: ref f64 = out_param runtime_param3 // CHECK:STDOUT: %return: ref f64 = return_slot %return.param @@ -410,20 +430,24 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %return.patt: bool = return_slot_pattern // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_64.loc28_32: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc28_32: init type = call constants.%Float(%int_64.loc28_32) [template = f64] -// CHECK:STDOUT: %.loc28_32.1: type = value_of_initializer %float.make_type.loc28_32 [template = f64] -// CHECK:STDOUT: %.loc28_32.2: type = converted %float.make_type.loc28_32, %.loc28_32.1 [template = f64] -// CHECK:STDOUT: %int_64.loc28_40: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc28_40: init type = call constants.%Float(%int_64.loc28_40) [template = f64] -// CHECK:STDOUT: %.loc28_40.1: type = value_of_initializer %float.make_type.loc28_40 [template = f64] -// CHECK:STDOUT: %.loc28_40.2: type = converted %float.make_type.loc28_40, %.loc28_40.1 [template = f64] // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc28_48.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc28_48.2: type = converted %bool.make_type, %.loc28_48.1 [template = bool] // CHECK:STDOUT: %a.param: f64 = value_param runtime_param0 +// CHECK:STDOUT: %.loc28_32.3: type = splice_block %.loc28_32.2 [template = f64] { +// CHECK:STDOUT: %int_64.loc28_32: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc28_32: init type = call constants.%Float(%int_64.loc28_32) [template = f64] +// CHECK:STDOUT: %.loc28_32.1: type = value_of_initializer %float.make_type.loc28_32 [template = f64] +// CHECK:STDOUT: %.loc28_32.2: type = converted %float.make_type.loc28_32, %.loc28_32.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %b.param: f64 = value_param runtime_param1 +// CHECK:STDOUT: %.loc28_40.3: type = splice_block %.loc28_40.2 [template = f64] { +// CHECK:STDOUT: %int_64.loc28_40: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc28_40: init type = call constants.%Float(%int_64.loc28_40) [template = f64] +// CHECK:STDOUT: %.loc28_40.1: type = value_of_initializer %float.make_type.loc28_40 [template = f64] +// CHECK:STDOUT: %.loc28_40.2: type = converted %float.make_type.loc28_40, %.loc28_40.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param diff --git a/toolchain/check/testdata/builtins/float/eq.carbon b/toolchain/check/testdata/builtins/float/eq.carbon index 9b4432e2bd0b3..02bc70b577108 100644 --- a/toolchain/check/testdata/builtins/float/eq.carbon +++ b/toolchain/check/testdata/builtins/float/eq.carbon @@ -84,20 +84,24 @@ fn WrongResult(a: f64, b: f64) -> f64 = "float.eq"; // CHECK:STDOUT: %return.patt: bool = return_slot_pattern // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_64.loc2_10: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc2_10: init type = call constants.%Float(%int_64.loc2_10) [template = f64] -// CHECK:STDOUT: %.loc2_10.1: type = value_of_initializer %float.make_type.loc2_10 [template = f64] -// CHECK:STDOUT: %.loc2_10.2: type = converted %float.make_type.loc2_10, %.loc2_10.1 [template = f64] -// CHECK:STDOUT: %int_64.loc2_18: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc2_18: init type = call constants.%Float(%int_64.loc2_18) [template = f64] -// CHECK:STDOUT: %.loc2_18.1: type = value_of_initializer %float.make_type.loc2_18 [template = f64] -// CHECK:STDOUT: %.loc2_18.2: type = converted %float.make_type.loc2_18, %.loc2_18.1 [template = f64] // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc2_26.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc2_26.2: type = converted %bool.make_type, %.loc2_26.1 [template = bool] // CHECK:STDOUT: %a.param: f64 = value_param runtime_param0 +// CHECK:STDOUT: %.loc2_10.3: type = splice_block %.loc2_10.2 [template = f64] { +// CHECK:STDOUT: %int_64.loc2_10: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc2_10: init type = call constants.%Float(%int_64.loc2_10) [template = f64] +// CHECK:STDOUT: %.loc2_10.1: type = value_of_initializer %float.make_type.loc2_10 [template = f64] +// CHECK:STDOUT: %.loc2_10.2: type = converted %float.make_type.loc2_10, %.loc2_10.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %b.param: f64 = value_param runtime_param1 +// CHECK:STDOUT: %.loc2_18.3: type = splice_block %.loc2_18.2 [template = f64] { +// CHECK:STDOUT: %int_64.loc2_18: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc2_18: init type = call constants.%Float(%int_64.loc2_18) [template = f64] +// CHECK:STDOUT: %.loc2_18.1: type = value_of_initializer %float.make_type.loc2_18 [template = f64] +// CHECK:STDOUT: %.loc2_18.2: type = converted %float.make_type.loc2_18, %.loc2_18.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param @@ -110,11 +114,11 @@ fn WrongResult(a: f64, b: f64) -> f64 = "float.eq"; // CHECK:STDOUT: %false_.patt: %False = binding_pattern false_ // CHECK:STDOUT: %false_.param_patt: %False = value_param_pattern %false_.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %True.ref.loc7: type = name_ref True, file.%True.decl [template = constants.%True] -// CHECK:STDOUT: %False.ref.loc7: type = name_ref False, file.%False.decl [template = constants.%False] // CHECK:STDOUT: %true_.param: %True = value_param runtime_param0 +// CHECK:STDOUT: %True.ref.loc7: type = name_ref True, file.%True.decl [template = constants.%True] // CHECK:STDOUT: %true_: %True = bind_name true_, %true_.param // CHECK:STDOUT: %false_.param: %False = value_param runtime_param1 +// CHECK:STDOUT: %False.ref.loc7: type = name_ref False, file.%False.decl [template = constants.%False] // CHECK:STDOUT: %false_: %False = bind_name false_, %false_.param // CHECK:STDOUT: } // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { @@ -125,20 +129,24 @@ fn WrongResult(a: f64, b: f64) -> f64 = "float.eq"; // CHECK:STDOUT: %return.patt: bool = return_slot_pattern // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_64.loc12_19: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc12_19: init type = call constants.%Float(%int_64.loc12_19) [template = f64] -// CHECK:STDOUT: %.loc12_19.1: type = value_of_initializer %float.make_type.loc12_19 [template = f64] -// CHECK:STDOUT: %.loc12_19.2: type = converted %float.make_type.loc12_19, %.loc12_19.1 [template = f64] -// CHECK:STDOUT: %int_64.loc12_27: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc12_27: init type = call constants.%Float(%int_64.loc12_27) [template = f64] -// CHECK:STDOUT: %.loc12_27.1: type = value_of_initializer %float.make_type.loc12_27 [template = f64] -// CHECK:STDOUT: %.loc12_27.2: type = converted %float.make_type.loc12_27, %.loc12_27.1 [template = f64] // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc12_35.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc12_35.2: type = converted %bool.make_type, %.loc12_35.1 [template = bool] // CHECK:STDOUT: %a.param: f64 = value_param runtime_param0 +// CHECK:STDOUT: %.loc12_19.3: type = splice_block %.loc12_19.2 [template = f64] { +// CHECK:STDOUT: %int_64.loc12_19: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc12_19: init type = call constants.%Float(%int_64.loc12_19) [template = f64] +// CHECK:STDOUT: %.loc12_19.1: type = value_of_initializer %float.make_type.loc12_19 [template = f64] +// CHECK:STDOUT: %.loc12_19.2: type = converted %float.make_type.loc12_19, %.loc12_19.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %b.param: f64 = value_param runtime_param1 +// CHECK:STDOUT: %.loc12_27.3: type = splice_block %.loc12_27.2 [template = f64] { +// CHECK:STDOUT: %int_64.loc12_27: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc12_27: init type = call constants.%Float(%int_64.loc12_27) [template = f64] +// CHECK:STDOUT: %.loc12_27.1: type = value_of_initializer %float.make_type.loc12_27 [template = f64] +// CHECK:STDOUT: %.loc12_27.2: type = converted %float.make_type.loc12_27, %.loc12_27.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param @@ -249,21 +257,25 @@ fn WrongResult(a: f64, b: f64) -> f64 = "float.eq"; // CHECK:STDOUT: %return.patt: f64 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: f64 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_64.loc7_19: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc7_19: init type = call constants.%Float(%int_64.loc7_19) [template = f64] -// CHECK:STDOUT: %.loc7_19.1: type = value_of_initializer %float.make_type.loc7_19 [template = f64] -// CHECK:STDOUT: %.loc7_19.2: type = converted %float.make_type.loc7_19, %.loc7_19.1 [template = f64] -// CHECK:STDOUT: %int_64.loc7_27: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc7_27: init type = call constants.%Float(%int_64.loc7_27) [template = f64] -// CHECK:STDOUT: %.loc7_27.1: type = value_of_initializer %float.make_type.loc7_27 [template = f64] -// CHECK:STDOUT: %.loc7_27.2: type = converted %float.make_type.loc7_27, %.loc7_27.1 [template = f64] // CHECK:STDOUT: %int_64.loc7_35: Core.IntLiteral = int_value 64 [template = constants.%int_64] // CHECK:STDOUT: %float.make_type.loc7_35: init type = call constants.%Float(%int_64.loc7_35) [template = f64] // CHECK:STDOUT: %.loc7_35.1: type = value_of_initializer %float.make_type.loc7_35 [template = f64] // CHECK:STDOUT: %.loc7_35.2: type = converted %float.make_type.loc7_35, %.loc7_35.1 [template = f64] // CHECK:STDOUT: %a.param: f64 = value_param runtime_param0 +// CHECK:STDOUT: %.loc7_19.3: type = splice_block %.loc7_19.2 [template = f64] { +// CHECK:STDOUT: %int_64.loc7_19: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc7_19: init type = call constants.%Float(%int_64.loc7_19) [template = f64] +// CHECK:STDOUT: %.loc7_19.1: type = value_of_initializer %float.make_type.loc7_19 [template = f64] +// CHECK:STDOUT: %.loc7_19.2: type = converted %float.make_type.loc7_19, %.loc7_19.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %b.param: f64 = value_param runtime_param1 +// CHECK:STDOUT: %.loc7_27.3: type = splice_block %.loc7_27.2 [template = f64] { +// CHECK:STDOUT: %int_64.loc7_27: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc7_27: init type = call constants.%Float(%int_64.loc7_27) [template = f64] +// CHECK:STDOUT: %.loc7_27.1: type = value_of_initializer %float.make_type.loc7_27 [template = f64] +// CHECK:STDOUT: %.loc7_27.2: type = converted %float.make_type.loc7_27, %.loc7_27.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref f64 = out_param runtime_param2 // CHECK:STDOUT: %return: ref f64 = return_slot %return.param diff --git a/toolchain/check/testdata/builtins/float/greater.carbon b/toolchain/check/testdata/builtins/float/greater.carbon index c3c8c1efd437e..b91d825dc0d54 100644 --- a/toolchain/check/testdata/builtins/float/greater.carbon +++ b/toolchain/check/testdata/builtins/float/greater.carbon @@ -84,20 +84,24 @@ fn RuntimeCall(a: f64, b: f64) -> bool { // CHECK:STDOUT: %return.patt: bool = return_slot_pattern // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_64.loc2_15: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc2_15: init type = call constants.%Float(%int_64.loc2_15) [template = f64] -// CHECK:STDOUT: %.loc2_15.1: type = value_of_initializer %float.make_type.loc2_15 [template = f64] -// CHECK:STDOUT: %.loc2_15.2: type = converted %float.make_type.loc2_15, %.loc2_15.1 [template = f64] -// CHECK:STDOUT: %int_64.loc2_23: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc2_23: init type = call constants.%Float(%int_64.loc2_23) [template = f64] -// CHECK:STDOUT: %.loc2_23.1: type = value_of_initializer %float.make_type.loc2_23 [template = f64] -// CHECK:STDOUT: %.loc2_23.2: type = converted %float.make_type.loc2_23, %.loc2_23.1 [template = f64] // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc2_31.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc2_31.2: type = converted %bool.make_type, %.loc2_31.1 [template = bool] // CHECK:STDOUT: %a.param: f64 = value_param runtime_param0 +// CHECK:STDOUT: %.loc2_15.3: type = splice_block %.loc2_15.2 [template = f64] { +// CHECK:STDOUT: %int_64.loc2_15: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc2_15: init type = call constants.%Float(%int_64.loc2_15) [template = f64] +// CHECK:STDOUT: %.loc2_15.1: type = value_of_initializer %float.make_type.loc2_15 [template = f64] +// CHECK:STDOUT: %.loc2_15.2: type = converted %float.make_type.loc2_15, %.loc2_15.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %b.param: f64 = value_param runtime_param1 +// CHECK:STDOUT: %.loc2_23.3: type = splice_block %.loc2_23.2 [template = f64] { +// CHECK:STDOUT: %int_64.loc2_23: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc2_23: init type = call constants.%Float(%int_64.loc2_23) [template = f64] +// CHECK:STDOUT: %.loc2_23.1: type = value_of_initializer %float.make_type.loc2_23 [template = f64] +// CHECK:STDOUT: %.loc2_23.2: type = converted %float.make_type.loc2_23, %.loc2_23.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param @@ -108,15 +112,17 @@ fn RuntimeCall(a: f64, b: f64) -> bool { // CHECK:STDOUT: %return.patt: f64 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: f64 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_64.loc3_14: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc3_14: init type = call constants.%Float(%int_64.loc3_14) [template = f64] -// CHECK:STDOUT: %.loc3_14.1: type = value_of_initializer %float.make_type.loc3_14 [template = f64] -// CHECK:STDOUT: %.loc3_14.2: type = converted %float.make_type.loc3_14, %.loc3_14.1 [template = f64] // CHECK:STDOUT: %int_64.loc3_22: Core.IntLiteral = int_value 64 [template = constants.%int_64] // CHECK:STDOUT: %float.make_type.loc3_22: init type = call constants.%Float(%int_64.loc3_22) [template = f64] // CHECK:STDOUT: %.loc3_22.1: type = value_of_initializer %float.make_type.loc3_22 [template = f64] // CHECK:STDOUT: %.loc3_22.2: type = converted %float.make_type.loc3_22, %.loc3_22.1 [template = f64] // CHECK:STDOUT: %a.param: f64 = value_param runtime_param0 +// CHECK:STDOUT: %.loc3_14.3: type = splice_block %.loc3_14.2 [template = f64] { +// CHECK:STDOUT: %int_64.loc3_14: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc3_14: init type = call constants.%Float(%int_64.loc3_14) [template = f64] +// CHECK:STDOUT: %.loc3_14.1: type = value_of_initializer %float.make_type.loc3_14 [template = f64] +// CHECK:STDOUT: %.loc3_14.2: type = converted %float.make_type.loc3_14, %.loc3_14.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref f64 = out_param runtime_param1 // CHECK:STDOUT: %return: ref f64 = return_slot %return.param @@ -129,11 +135,11 @@ fn RuntimeCall(a: f64, b: f64) -> bool { // CHECK:STDOUT: %false_.patt: %False = binding_pattern false_ // CHECK:STDOUT: %false_.param_patt: %False = value_param_pattern %false_.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %True.ref.loc8: type = name_ref True, file.%True.decl [template = constants.%True] -// CHECK:STDOUT: %False.ref.loc8: type = name_ref False, file.%False.decl [template = constants.%False] // CHECK:STDOUT: %true_.param: %True = value_param runtime_param0 +// CHECK:STDOUT: %True.ref.loc8: type = name_ref True, file.%True.decl [template = constants.%True] // CHECK:STDOUT: %true_: %True = bind_name true_, %true_.param // CHECK:STDOUT: %false_.param: %False = value_param runtime_param1 +// CHECK:STDOUT: %False.ref.loc8: type = name_ref False, file.%False.decl [template = constants.%False] // CHECK:STDOUT: %false_: %False = bind_name false_, %false_.param // CHECK:STDOUT: } // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { @@ -144,20 +150,24 @@ fn RuntimeCall(a: f64, b: f64) -> bool { // CHECK:STDOUT: %return.patt: bool = return_slot_pattern // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_64.loc16_19: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc16_19: init type = call constants.%Float(%int_64.loc16_19) [template = f64] -// CHECK:STDOUT: %.loc16_19.1: type = value_of_initializer %float.make_type.loc16_19 [template = f64] -// CHECK:STDOUT: %.loc16_19.2: type = converted %float.make_type.loc16_19, %.loc16_19.1 [template = f64] -// CHECK:STDOUT: %int_64.loc16_27: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc16_27: init type = call constants.%Float(%int_64.loc16_27) [template = f64] -// CHECK:STDOUT: %.loc16_27.1: type = value_of_initializer %float.make_type.loc16_27 [template = f64] -// CHECK:STDOUT: %.loc16_27.2: type = converted %float.make_type.loc16_27, %.loc16_27.1 [template = f64] // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc16_35.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc16_35.2: type = converted %bool.make_type, %.loc16_35.1 [template = bool] // CHECK:STDOUT: %a.param: f64 = value_param runtime_param0 +// CHECK:STDOUT: %.loc16_19.3: type = splice_block %.loc16_19.2 [template = f64] { +// CHECK:STDOUT: %int_64.loc16_19: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc16_19: init type = call constants.%Float(%int_64.loc16_19) [template = f64] +// CHECK:STDOUT: %.loc16_19.1: type = value_of_initializer %float.make_type.loc16_19 [template = f64] +// CHECK:STDOUT: %.loc16_19.2: type = converted %float.make_type.loc16_19, %.loc16_19.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %b.param: f64 = value_param runtime_param1 +// CHECK:STDOUT: %.loc16_27.3: type = splice_block %.loc16_27.2 [template = f64] { +// CHECK:STDOUT: %int_64.loc16_27: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc16_27: init type = call constants.%Float(%int_64.loc16_27) [template = f64] +// CHECK:STDOUT: %.loc16_27.1: type = value_of_initializer %float.make_type.loc16_27 [template = f64] +// CHECK:STDOUT: %.loc16_27.2: type = converted %float.make_type.loc16_27, %.loc16_27.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param diff --git a/toolchain/check/testdata/builtins/float/greater_eq.carbon b/toolchain/check/testdata/builtins/float/greater_eq.carbon index 14d3f065fda14..3036c4d5d8607 100644 --- a/toolchain/check/testdata/builtins/float/greater_eq.carbon +++ b/toolchain/check/testdata/builtins/float/greater_eq.carbon @@ -84,20 +84,24 @@ fn RuntimeCall(a: f64, b: f64) -> bool { // CHECK:STDOUT: %return.patt: bool = return_slot_pattern // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_64.loc2_17: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc2_17: init type = call constants.%Float(%int_64.loc2_17) [template = f64] -// CHECK:STDOUT: %.loc2_17.1: type = value_of_initializer %float.make_type.loc2_17 [template = f64] -// CHECK:STDOUT: %.loc2_17.2: type = converted %float.make_type.loc2_17, %.loc2_17.1 [template = f64] -// CHECK:STDOUT: %int_64.loc2_25: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc2_25: init type = call constants.%Float(%int_64.loc2_25) [template = f64] -// CHECK:STDOUT: %.loc2_25.1: type = value_of_initializer %float.make_type.loc2_25 [template = f64] -// CHECK:STDOUT: %.loc2_25.2: type = converted %float.make_type.loc2_25, %.loc2_25.1 [template = f64] // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc2_33.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc2_33.2: type = converted %bool.make_type, %.loc2_33.1 [template = bool] // CHECK:STDOUT: %a.param: f64 = value_param runtime_param0 +// CHECK:STDOUT: %.loc2_17.3: type = splice_block %.loc2_17.2 [template = f64] { +// CHECK:STDOUT: %int_64.loc2_17: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc2_17: init type = call constants.%Float(%int_64.loc2_17) [template = f64] +// CHECK:STDOUT: %.loc2_17.1: type = value_of_initializer %float.make_type.loc2_17 [template = f64] +// CHECK:STDOUT: %.loc2_17.2: type = converted %float.make_type.loc2_17, %.loc2_17.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %b.param: f64 = value_param runtime_param1 +// CHECK:STDOUT: %.loc2_25.3: type = splice_block %.loc2_25.2 [template = f64] { +// CHECK:STDOUT: %int_64.loc2_25: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc2_25: init type = call constants.%Float(%int_64.loc2_25) [template = f64] +// CHECK:STDOUT: %.loc2_25.1: type = value_of_initializer %float.make_type.loc2_25 [template = f64] +// CHECK:STDOUT: %.loc2_25.2: type = converted %float.make_type.loc2_25, %.loc2_25.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param @@ -108,15 +112,17 @@ fn RuntimeCall(a: f64, b: f64) -> bool { // CHECK:STDOUT: %return.patt: f64 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: f64 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_64.loc3_14: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc3_14: init type = call constants.%Float(%int_64.loc3_14) [template = f64] -// CHECK:STDOUT: %.loc3_14.1: type = value_of_initializer %float.make_type.loc3_14 [template = f64] -// CHECK:STDOUT: %.loc3_14.2: type = converted %float.make_type.loc3_14, %.loc3_14.1 [template = f64] // CHECK:STDOUT: %int_64.loc3_22: Core.IntLiteral = int_value 64 [template = constants.%int_64] // CHECK:STDOUT: %float.make_type.loc3_22: init type = call constants.%Float(%int_64.loc3_22) [template = f64] // CHECK:STDOUT: %.loc3_22.1: type = value_of_initializer %float.make_type.loc3_22 [template = f64] // CHECK:STDOUT: %.loc3_22.2: type = converted %float.make_type.loc3_22, %.loc3_22.1 [template = f64] // CHECK:STDOUT: %a.param: f64 = value_param runtime_param0 +// CHECK:STDOUT: %.loc3_14.3: type = splice_block %.loc3_14.2 [template = f64] { +// CHECK:STDOUT: %int_64.loc3_14: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc3_14: init type = call constants.%Float(%int_64.loc3_14) [template = f64] +// CHECK:STDOUT: %.loc3_14.1: type = value_of_initializer %float.make_type.loc3_14 [template = f64] +// CHECK:STDOUT: %.loc3_14.2: type = converted %float.make_type.loc3_14, %.loc3_14.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref f64 = out_param runtime_param1 // CHECK:STDOUT: %return: ref f64 = return_slot %return.param @@ -129,11 +135,11 @@ fn RuntimeCall(a: f64, b: f64) -> bool { // CHECK:STDOUT: %false_.patt: %False = binding_pattern false_ // CHECK:STDOUT: %false_.param_patt: %False = value_param_pattern %false_.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %True.ref.loc8: type = name_ref True, file.%True.decl [template = constants.%True] -// CHECK:STDOUT: %False.ref.loc8: type = name_ref False, file.%False.decl [template = constants.%False] // CHECK:STDOUT: %true_.param: %True = value_param runtime_param0 +// CHECK:STDOUT: %True.ref.loc8: type = name_ref True, file.%True.decl [template = constants.%True] // CHECK:STDOUT: %true_: %True = bind_name true_, %true_.param // CHECK:STDOUT: %false_.param: %False = value_param runtime_param1 +// CHECK:STDOUT: %False.ref.loc8: type = name_ref False, file.%False.decl [template = constants.%False] // CHECK:STDOUT: %false_: %False = bind_name false_, %false_.param // CHECK:STDOUT: } // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { @@ -144,20 +150,24 @@ fn RuntimeCall(a: f64, b: f64) -> bool { // CHECK:STDOUT: %return.patt: bool = return_slot_pattern // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_64.loc16_19: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc16_19: init type = call constants.%Float(%int_64.loc16_19) [template = f64] -// CHECK:STDOUT: %.loc16_19.1: type = value_of_initializer %float.make_type.loc16_19 [template = f64] -// CHECK:STDOUT: %.loc16_19.2: type = converted %float.make_type.loc16_19, %.loc16_19.1 [template = f64] -// CHECK:STDOUT: %int_64.loc16_27: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc16_27: init type = call constants.%Float(%int_64.loc16_27) [template = f64] -// CHECK:STDOUT: %.loc16_27.1: type = value_of_initializer %float.make_type.loc16_27 [template = f64] -// CHECK:STDOUT: %.loc16_27.2: type = converted %float.make_type.loc16_27, %.loc16_27.1 [template = f64] // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc16_35.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc16_35.2: type = converted %bool.make_type, %.loc16_35.1 [template = bool] // CHECK:STDOUT: %a.param: f64 = value_param runtime_param0 +// CHECK:STDOUT: %.loc16_19.3: type = splice_block %.loc16_19.2 [template = f64] { +// CHECK:STDOUT: %int_64.loc16_19: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc16_19: init type = call constants.%Float(%int_64.loc16_19) [template = f64] +// CHECK:STDOUT: %.loc16_19.1: type = value_of_initializer %float.make_type.loc16_19 [template = f64] +// CHECK:STDOUT: %.loc16_19.2: type = converted %float.make_type.loc16_19, %.loc16_19.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %b.param: f64 = value_param runtime_param1 +// CHECK:STDOUT: %.loc16_27.3: type = splice_block %.loc16_27.2 [template = f64] { +// CHECK:STDOUT: %int_64.loc16_27: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc16_27: init type = call constants.%Float(%int_64.loc16_27) [template = f64] +// CHECK:STDOUT: %.loc16_27.1: type = value_of_initializer %float.make_type.loc16_27 [template = f64] +// CHECK:STDOUT: %.loc16_27.2: type = converted %float.make_type.loc16_27, %.loc16_27.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param diff --git a/toolchain/check/testdata/builtins/float/less.carbon b/toolchain/check/testdata/builtins/float/less.carbon index b921649b2643a..9d09242ad78be 100644 --- a/toolchain/check/testdata/builtins/float/less.carbon +++ b/toolchain/check/testdata/builtins/float/less.carbon @@ -84,20 +84,24 @@ fn RuntimeCall(a: f64, b: f64) -> bool { // CHECK:STDOUT: %return.patt: bool = return_slot_pattern // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_64.loc2_12: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc2_12: init type = call constants.%Float(%int_64.loc2_12) [template = f64] -// CHECK:STDOUT: %.loc2_12.1: type = value_of_initializer %float.make_type.loc2_12 [template = f64] -// CHECK:STDOUT: %.loc2_12.2: type = converted %float.make_type.loc2_12, %.loc2_12.1 [template = f64] -// CHECK:STDOUT: %int_64.loc2_20: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc2_20: init type = call constants.%Float(%int_64.loc2_20) [template = f64] -// CHECK:STDOUT: %.loc2_20.1: type = value_of_initializer %float.make_type.loc2_20 [template = f64] -// CHECK:STDOUT: %.loc2_20.2: type = converted %float.make_type.loc2_20, %.loc2_20.1 [template = f64] // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc2_28.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc2_28.2: type = converted %bool.make_type, %.loc2_28.1 [template = bool] // CHECK:STDOUT: %a.param: f64 = value_param runtime_param0 +// CHECK:STDOUT: %.loc2_12.3: type = splice_block %.loc2_12.2 [template = f64] { +// CHECK:STDOUT: %int_64.loc2_12: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc2_12: init type = call constants.%Float(%int_64.loc2_12) [template = f64] +// CHECK:STDOUT: %.loc2_12.1: type = value_of_initializer %float.make_type.loc2_12 [template = f64] +// CHECK:STDOUT: %.loc2_12.2: type = converted %float.make_type.loc2_12, %.loc2_12.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %b.param: f64 = value_param runtime_param1 +// CHECK:STDOUT: %.loc2_20.3: type = splice_block %.loc2_20.2 [template = f64] { +// CHECK:STDOUT: %int_64.loc2_20: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc2_20: init type = call constants.%Float(%int_64.loc2_20) [template = f64] +// CHECK:STDOUT: %.loc2_20.1: type = value_of_initializer %float.make_type.loc2_20 [template = f64] +// CHECK:STDOUT: %.loc2_20.2: type = converted %float.make_type.loc2_20, %.loc2_20.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param @@ -108,15 +112,17 @@ fn RuntimeCall(a: f64, b: f64) -> bool { // CHECK:STDOUT: %return.patt: f64 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: f64 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_64.loc3_14: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc3_14: init type = call constants.%Float(%int_64.loc3_14) [template = f64] -// CHECK:STDOUT: %.loc3_14.1: type = value_of_initializer %float.make_type.loc3_14 [template = f64] -// CHECK:STDOUT: %.loc3_14.2: type = converted %float.make_type.loc3_14, %.loc3_14.1 [template = f64] // CHECK:STDOUT: %int_64.loc3_22: Core.IntLiteral = int_value 64 [template = constants.%int_64] // CHECK:STDOUT: %float.make_type.loc3_22: init type = call constants.%Float(%int_64.loc3_22) [template = f64] // CHECK:STDOUT: %.loc3_22.1: type = value_of_initializer %float.make_type.loc3_22 [template = f64] // CHECK:STDOUT: %.loc3_22.2: type = converted %float.make_type.loc3_22, %.loc3_22.1 [template = f64] // CHECK:STDOUT: %a.param: f64 = value_param runtime_param0 +// CHECK:STDOUT: %.loc3_14.3: type = splice_block %.loc3_14.2 [template = f64] { +// CHECK:STDOUT: %int_64.loc3_14: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc3_14: init type = call constants.%Float(%int_64.loc3_14) [template = f64] +// CHECK:STDOUT: %.loc3_14.1: type = value_of_initializer %float.make_type.loc3_14 [template = f64] +// CHECK:STDOUT: %.loc3_14.2: type = converted %float.make_type.loc3_14, %.loc3_14.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref f64 = out_param runtime_param1 // CHECK:STDOUT: %return: ref f64 = return_slot %return.param @@ -129,11 +135,11 @@ fn RuntimeCall(a: f64, b: f64) -> bool { // CHECK:STDOUT: %false_.patt: %False = binding_pattern false_ // CHECK:STDOUT: %false_.param_patt: %False = value_param_pattern %false_.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %True.ref.loc8: type = name_ref True, file.%True.decl [template = constants.%True] -// CHECK:STDOUT: %False.ref.loc8: type = name_ref False, file.%False.decl [template = constants.%False] // CHECK:STDOUT: %true_.param: %True = value_param runtime_param0 +// CHECK:STDOUT: %True.ref.loc8: type = name_ref True, file.%True.decl [template = constants.%True] // CHECK:STDOUT: %true_: %True = bind_name true_, %true_.param // CHECK:STDOUT: %false_.param: %False = value_param runtime_param1 +// CHECK:STDOUT: %False.ref.loc8: type = name_ref False, file.%False.decl [template = constants.%False] // CHECK:STDOUT: %false_: %False = bind_name false_, %false_.param // CHECK:STDOUT: } // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { @@ -144,20 +150,24 @@ fn RuntimeCall(a: f64, b: f64) -> bool { // CHECK:STDOUT: %return.patt: bool = return_slot_pattern // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_64.loc16_19: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc16_19: init type = call constants.%Float(%int_64.loc16_19) [template = f64] -// CHECK:STDOUT: %.loc16_19.1: type = value_of_initializer %float.make_type.loc16_19 [template = f64] -// CHECK:STDOUT: %.loc16_19.2: type = converted %float.make_type.loc16_19, %.loc16_19.1 [template = f64] -// CHECK:STDOUT: %int_64.loc16_27: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc16_27: init type = call constants.%Float(%int_64.loc16_27) [template = f64] -// CHECK:STDOUT: %.loc16_27.1: type = value_of_initializer %float.make_type.loc16_27 [template = f64] -// CHECK:STDOUT: %.loc16_27.2: type = converted %float.make_type.loc16_27, %.loc16_27.1 [template = f64] // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc16_35.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc16_35.2: type = converted %bool.make_type, %.loc16_35.1 [template = bool] // CHECK:STDOUT: %a.param: f64 = value_param runtime_param0 +// CHECK:STDOUT: %.loc16_19.3: type = splice_block %.loc16_19.2 [template = f64] { +// CHECK:STDOUT: %int_64.loc16_19: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc16_19: init type = call constants.%Float(%int_64.loc16_19) [template = f64] +// CHECK:STDOUT: %.loc16_19.1: type = value_of_initializer %float.make_type.loc16_19 [template = f64] +// CHECK:STDOUT: %.loc16_19.2: type = converted %float.make_type.loc16_19, %.loc16_19.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %b.param: f64 = value_param runtime_param1 +// CHECK:STDOUT: %.loc16_27.3: type = splice_block %.loc16_27.2 [template = f64] { +// CHECK:STDOUT: %int_64.loc16_27: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc16_27: init type = call constants.%Float(%int_64.loc16_27) [template = f64] +// CHECK:STDOUT: %.loc16_27.1: type = value_of_initializer %float.make_type.loc16_27 [template = f64] +// CHECK:STDOUT: %.loc16_27.2: type = converted %float.make_type.loc16_27, %.loc16_27.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param diff --git a/toolchain/check/testdata/builtins/float/less_eq.carbon b/toolchain/check/testdata/builtins/float/less_eq.carbon index 8e0d95c45775d..fa8940f233fda 100644 --- a/toolchain/check/testdata/builtins/float/less_eq.carbon +++ b/toolchain/check/testdata/builtins/float/less_eq.carbon @@ -84,20 +84,24 @@ fn RuntimeCall(a: f64, b: f64) -> bool { // CHECK:STDOUT: %return.patt: bool = return_slot_pattern // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_64.loc2_14: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc2_14: init type = call constants.%Float(%int_64.loc2_14) [template = f64] -// CHECK:STDOUT: %.loc2_14.1: type = value_of_initializer %float.make_type.loc2_14 [template = f64] -// CHECK:STDOUT: %.loc2_14.2: type = converted %float.make_type.loc2_14, %.loc2_14.1 [template = f64] -// CHECK:STDOUT: %int_64.loc2_22: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc2_22: init type = call constants.%Float(%int_64.loc2_22) [template = f64] -// CHECK:STDOUT: %.loc2_22.1: type = value_of_initializer %float.make_type.loc2_22 [template = f64] -// CHECK:STDOUT: %.loc2_22.2: type = converted %float.make_type.loc2_22, %.loc2_22.1 [template = f64] // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc2_30.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc2_30.2: type = converted %bool.make_type, %.loc2_30.1 [template = bool] // CHECK:STDOUT: %a.param: f64 = value_param runtime_param0 +// CHECK:STDOUT: %.loc2_14.3: type = splice_block %.loc2_14.2 [template = f64] { +// CHECK:STDOUT: %int_64.loc2_14: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc2_14: init type = call constants.%Float(%int_64.loc2_14) [template = f64] +// CHECK:STDOUT: %.loc2_14.1: type = value_of_initializer %float.make_type.loc2_14 [template = f64] +// CHECK:STDOUT: %.loc2_14.2: type = converted %float.make_type.loc2_14, %.loc2_14.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %b.param: f64 = value_param runtime_param1 +// CHECK:STDOUT: %.loc2_22.3: type = splice_block %.loc2_22.2 [template = f64] { +// CHECK:STDOUT: %int_64.loc2_22: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc2_22: init type = call constants.%Float(%int_64.loc2_22) [template = f64] +// CHECK:STDOUT: %.loc2_22.1: type = value_of_initializer %float.make_type.loc2_22 [template = f64] +// CHECK:STDOUT: %.loc2_22.2: type = converted %float.make_type.loc2_22, %.loc2_22.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param @@ -108,15 +112,17 @@ fn RuntimeCall(a: f64, b: f64) -> bool { // CHECK:STDOUT: %return.patt: f64 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: f64 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_64.loc3_14: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc3_14: init type = call constants.%Float(%int_64.loc3_14) [template = f64] -// CHECK:STDOUT: %.loc3_14.1: type = value_of_initializer %float.make_type.loc3_14 [template = f64] -// CHECK:STDOUT: %.loc3_14.2: type = converted %float.make_type.loc3_14, %.loc3_14.1 [template = f64] // CHECK:STDOUT: %int_64.loc3_22: Core.IntLiteral = int_value 64 [template = constants.%int_64] // CHECK:STDOUT: %float.make_type.loc3_22: init type = call constants.%Float(%int_64.loc3_22) [template = f64] // CHECK:STDOUT: %.loc3_22.1: type = value_of_initializer %float.make_type.loc3_22 [template = f64] // CHECK:STDOUT: %.loc3_22.2: type = converted %float.make_type.loc3_22, %.loc3_22.1 [template = f64] // CHECK:STDOUT: %a.param: f64 = value_param runtime_param0 +// CHECK:STDOUT: %.loc3_14.3: type = splice_block %.loc3_14.2 [template = f64] { +// CHECK:STDOUT: %int_64.loc3_14: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc3_14: init type = call constants.%Float(%int_64.loc3_14) [template = f64] +// CHECK:STDOUT: %.loc3_14.1: type = value_of_initializer %float.make_type.loc3_14 [template = f64] +// CHECK:STDOUT: %.loc3_14.2: type = converted %float.make_type.loc3_14, %.loc3_14.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref f64 = out_param runtime_param1 // CHECK:STDOUT: %return: ref f64 = return_slot %return.param @@ -129,11 +135,11 @@ fn RuntimeCall(a: f64, b: f64) -> bool { // CHECK:STDOUT: %false_.patt: %False = binding_pattern false_ // CHECK:STDOUT: %false_.param_patt: %False = value_param_pattern %false_.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %True.ref.loc8: type = name_ref True, file.%True.decl [template = constants.%True] -// CHECK:STDOUT: %False.ref.loc8: type = name_ref False, file.%False.decl [template = constants.%False] // CHECK:STDOUT: %true_.param: %True = value_param runtime_param0 +// CHECK:STDOUT: %True.ref.loc8: type = name_ref True, file.%True.decl [template = constants.%True] // CHECK:STDOUT: %true_: %True = bind_name true_, %true_.param // CHECK:STDOUT: %false_.param: %False = value_param runtime_param1 +// CHECK:STDOUT: %False.ref.loc8: type = name_ref False, file.%False.decl [template = constants.%False] // CHECK:STDOUT: %false_: %False = bind_name false_, %false_.param // CHECK:STDOUT: } // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { @@ -144,20 +150,24 @@ fn RuntimeCall(a: f64, b: f64) -> bool { // CHECK:STDOUT: %return.patt: bool = return_slot_pattern // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_64.loc16_19: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc16_19: init type = call constants.%Float(%int_64.loc16_19) [template = f64] -// CHECK:STDOUT: %.loc16_19.1: type = value_of_initializer %float.make_type.loc16_19 [template = f64] -// CHECK:STDOUT: %.loc16_19.2: type = converted %float.make_type.loc16_19, %.loc16_19.1 [template = f64] -// CHECK:STDOUT: %int_64.loc16_27: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc16_27: init type = call constants.%Float(%int_64.loc16_27) [template = f64] -// CHECK:STDOUT: %.loc16_27.1: type = value_of_initializer %float.make_type.loc16_27 [template = f64] -// CHECK:STDOUT: %.loc16_27.2: type = converted %float.make_type.loc16_27, %.loc16_27.1 [template = f64] // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc16_35.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc16_35.2: type = converted %bool.make_type, %.loc16_35.1 [template = bool] // CHECK:STDOUT: %a.param: f64 = value_param runtime_param0 +// CHECK:STDOUT: %.loc16_19.3: type = splice_block %.loc16_19.2 [template = f64] { +// CHECK:STDOUT: %int_64.loc16_19: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc16_19: init type = call constants.%Float(%int_64.loc16_19) [template = f64] +// CHECK:STDOUT: %.loc16_19.1: type = value_of_initializer %float.make_type.loc16_19 [template = f64] +// CHECK:STDOUT: %.loc16_19.2: type = converted %float.make_type.loc16_19, %.loc16_19.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %b.param: f64 = value_param runtime_param1 +// CHECK:STDOUT: %.loc16_27.3: type = splice_block %.loc16_27.2 [template = f64] { +// CHECK:STDOUT: %int_64.loc16_27: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc16_27: init type = call constants.%Float(%int_64.loc16_27) [template = f64] +// CHECK:STDOUT: %.loc16_27.1: type = value_of_initializer %float.make_type.loc16_27 [template = f64] +// CHECK:STDOUT: %.loc16_27.2: type = converted %float.make_type.loc16_27, %.loc16_27.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param diff --git a/toolchain/check/testdata/builtins/float/make_type.carbon b/toolchain/check/testdata/builtins/float/make_type.carbon index 7fb8e8f28e4f6..90ab08701326f 100644 --- a/toolchain/check/testdata/builtins/float/make_type.carbon +++ b/toolchain/check/testdata/builtins/float/make_type.carbon @@ -73,9 +73,11 @@ var dyn: Float(dyn_size); // CHECK:STDOUT: %return.patt: type = return_slot_pattern // CHECK:STDOUT: %return.param_patt: type = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %size.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc4: type = splice_block %i32 [template = constants.%i32] { +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %size: %i32 = bind_name size, %size.param // CHECK:STDOUT: %return.param: ref type = out_param runtime_param1 // CHECK:STDOUT: %return: ref type = return_slot %return.param @@ -91,14 +93,6 @@ var dyn: Float(dyn_size); // CHECK:STDOUT: %Float: %Float.type = struct_value () [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] -// CHECK:STDOUT: %int_64.1: Core.IntLiteral = int_value 64 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_64.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_64.2: %i32 = int_value 64 [template] // CHECK:STDOUT: %float: f64 = float_literal 0 [template] // CHECK:STDOUT: %GetFloat.type: type = fn_type @GetFloat [template] // CHECK:STDOUT: %GetFloat: %GetFloat.type = struct_value () [template] @@ -123,17 +117,6 @@ var dyn: Float(dyn_size); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %Float.ref: %Float.type = name_ref Float, imports.%import_ref.1 [template = constants.%Float] -// CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [template = constants.%int_64.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_64, %impl.elem0 [template = constants.%Convert.bound] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_64) [template = constants.%int_64.2] -// CHECK:STDOUT: %.loc6_14.1: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_64.2] -// CHECK:STDOUT: %.loc6_14.2: %i32 = converted %int_64, %.loc6_14.1 [template = constants.%int_64.2] -// CHECK:STDOUT: %float.make_type: init type = call %Float.ref(%.loc6_14.2) [template = f64] -// CHECK:STDOUT: %.loc6_16.1: type = value_of_initializer %float.make_type [template = f64] -// CHECK:STDOUT: %.loc6_16.2: type = converted %float.make_type, %.loc6_16.1 [template = f64] // CHECK:STDOUT: %f.var: ref f64 = var f // CHECK:STDOUT: %f: ref f64 = bind_name f, %f.var // CHECK:STDOUT: %GetFloat.decl: %GetFloat.type = fn_decl @GetFloat [template = constants.%GetFloat] { @@ -142,9 +125,11 @@ var dyn: Float(dyn_size); // CHECK:STDOUT: %return.patt: type = return_slot_pattern // CHECK:STDOUT: %return.param_patt: type = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %dyn_size.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc8: type = splice_block %i32 [template = constants.%i32] { +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %dyn_size: %i32 = bind_name dyn_size, %dyn_size.param // CHECK:STDOUT: %return.param: ref type = out_param runtime_param1 // CHECK:STDOUT: %return: ref type = return_slot %return.param @@ -181,9 +166,6 @@ var dyn: Float(dyn_size); // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32.1) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] // CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_32.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32.1) [template] -// CHECK:STDOUT: %int_32.2: %i32 = int_value 32 [template] // CHECK:STDOUT: %int_64.1: Core.IntLiteral = int_value 64 [template] // CHECK:STDOUT: %Convert.bound.2: = bound_method %int_64.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32.1) [template] @@ -210,29 +192,10 @@ var dyn: Float(dyn_size); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %Float.ref.loc10: %Float.type = name_ref Float, imports.%import_ref.1 [template = constants.%Float] -// CHECK:STDOUT: %int_32.loc10: Core.IntLiteral = int_value 32 [template = constants.%int_32.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_32.loc10, %impl.elem0 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32.1) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_32.loc10) [template = constants.%int_32.2] -// CHECK:STDOUT: %.loc10_26.1: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_32.2] -// CHECK:STDOUT: %.loc10_26.2: %i32 = converted %int_32.loc10, %.loc10_26.1 [template = constants.%int_32.2] -// CHECK:STDOUT: %float.make_type.loc10: init type = call %Float.ref.loc10(%.loc10_26.2) [template = ] -// CHECK:STDOUT: %.loc10_28.1: type = value_of_initializer %float.make_type.loc10 [template = ] -// CHECK:STDOUT: %.loc10_28.2: type = converted %float.make_type.loc10, %.loc10_28.1 [template = ] // CHECK:STDOUT: %invalid_float.var: ref = var invalid_float // CHECK:STDOUT: %invalid_float: ref = bind_name invalid_float, %invalid_float.var -// CHECK:STDOUT: %int_32.loc12: Core.IntLiteral = int_value 32 [template = constants.%int_32.1] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32.1) [template = constants.%i32] // CHECK:STDOUT: %dyn_size.var: ref %i32 = var dyn_size // CHECK:STDOUT: %dyn_size: ref %i32 = bind_name dyn_size, %dyn_size.var -// CHECK:STDOUT: %Float.ref.loc16: %Float.type = name_ref Float, imports.%import_ref.1 [template = constants.%Float] -// CHECK:STDOUT: %dyn_size.ref: ref %i32 = name_ref dyn_size, %dyn_size -// CHECK:STDOUT: %.loc16_16: %i32 = bind_value %dyn_size.ref -// CHECK:STDOUT: %float.make_type.loc16: init type = call %Float.ref.loc16(%.loc16_16) -// CHECK:STDOUT: %.loc16_24.1: type = value_of_initializer %float.make_type.loc16 -// CHECK:STDOUT: %.loc16_24.2: type = converted %float.make_type.loc16, %.loc16_24.1 // CHECK:STDOUT: %dyn.var: ref = var dyn // CHECK:STDOUT: %dyn: ref = bind_name dyn, %dyn.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/builtins/float/mul.carbon b/toolchain/check/testdata/builtins/float/mul.carbon index b76b9c7a76cc7..3bd14ab9a5d70 100644 --- a/toolchain/check/testdata/builtins/float/mul.carbon +++ b/toolchain/check/testdata/builtins/float/mul.carbon @@ -89,21 +89,25 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %return.patt: f64 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: f64 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_64.loc2_11: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc2_11: init type = call constants.%Float(%int_64.loc2_11) [template = f64] -// CHECK:STDOUT: %.loc2_11.1: type = value_of_initializer %float.make_type.loc2_11 [template = f64] -// CHECK:STDOUT: %.loc2_11.2: type = converted %float.make_type.loc2_11, %.loc2_11.1 [template = f64] -// CHECK:STDOUT: %int_64.loc2_19: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc2_19: init type = call constants.%Float(%int_64.loc2_19) [template = f64] -// CHECK:STDOUT: %.loc2_19.1: type = value_of_initializer %float.make_type.loc2_19 [template = f64] -// CHECK:STDOUT: %.loc2_19.2: type = converted %float.make_type.loc2_19, %.loc2_19.1 [template = f64] // CHECK:STDOUT: %int_64.loc2_27: Core.IntLiteral = int_value 64 [template = constants.%int_64] // CHECK:STDOUT: %float.make_type.loc2_27: init type = call constants.%Float(%int_64.loc2_27) [template = f64] // CHECK:STDOUT: %.loc2_27.1: type = value_of_initializer %float.make_type.loc2_27 [template = f64] // CHECK:STDOUT: %.loc2_27.2: type = converted %float.make_type.loc2_27, %.loc2_27.1 [template = f64] // CHECK:STDOUT: %a.param: f64 = value_param runtime_param0 +// CHECK:STDOUT: %.loc2_11.3: type = splice_block %.loc2_11.2 [template = f64] { +// CHECK:STDOUT: %int_64.loc2_11: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc2_11: init type = call constants.%Float(%int_64.loc2_11) [template = f64] +// CHECK:STDOUT: %.loc2_11.1: type = value_of_initializer %float.make_type.loc2_11 [template = f64] +// CHECK:STDOUT: %.loc2_11.2: type = converted %float.make_type.loc2_11, %.loc2_11.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %b.param: f64 = value_param runtime_param1 +// CHECK:STDOUT: %.loc2_19.3: type = splice_block %.loc2_19.2 [template = f64] { +// CHECK:STDOUT: %int_64.loc2_19: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc2_19: init type = call constants.%Float(%int_64.loc2_19) [template = f64] +// CHECK:STDOUT: %.loc2_19.1: type = value_of_initializer %float.make_type.loc2_19 [template = f64] +// CHECK:STDOUT: %.loc2_19.2: type = converted %float.make_type.loc2_19, %.loc2_19.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref f64 = out_param runtime_param2 // CHECK:STDOUT: %return: ref f64 = return_slot %return.param @@ -116,29 +120,29 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %return.patt: f64 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: f64 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_64.loc4_19: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc4_19: init type = call constants.%Float(%int_64.loc4_19) [template = f64] -// CHECK:STDOUT: %.loc4_19.1: type = value_of_initializer %float.make_type.loc4_19 [template = f64] -// CHECK:STDOUT: %.loc4_19.2: type = converted %float.make_type.loc4_19, %.loc4_19.1 [template = f64] -// CHECK:STDOUT: %int_64.loc4_27: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc4_27: init type = call constants.%Float(%int_64.loc4_27) [template = f64] -// CHECK:STDOUT: %.loc4_27.1: type = value_of_initializer %float.make_type.loc4_27 [template = f64] -// CHECK:STDOUT: %.loc4_27.2: type = converted %float.make_type.loc4_27, %.loc4_27.1 [template = f64] // CHECK:STDOUT: %int_64.loc4_35: Core.IntLiteral = int_value 64 [template = constants.%int_64] // CHECK:STDOUT: %float.make_type.loc4_35: init type = call constants.%Float(%int_64.loc4_35) [template = f64] // CHECK:STDOUT: %.loc4_35.1: type = value_of_initializer %float.make_type.loc4_35 [template = f64] // CHECK:STDOUT: %.loc4_35.2: type = converted %float.make_type.loc4_35, %.loc4_35.1 [template = f64] // CHECK:STDOUT: %a.param: f64 = value_param runtime_param0 +// CHECK:STDOUT: %.loc4_19.3: type = splice_block %.loc4_19.2 [template = f64] { +// CHECK:STDOUT: %int_64.loc4_19: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc4_19: init type = call constants.%Float(%int_64.loc4_19) [template = f64] +// CHECK:STDOUT: %.loc4_19.1: type = value_of_initializer %float.make_type.loc4_19 [template = f64] +// CHECK:STDOUT: %.loc4_19.2: type = converted %float.make_type.loc4_19, %.loc4_19.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %b.param: f64 = value_param runtime_param1 +// CHECK:STDOUT: %.loc4_27.3: type = splice_block %.loc4_27.2 [template = f64] { +// CHECK:STDOUT: %int_64.loc4_27: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc4_27: init type = call constants.%Float(%int_64.loc4_27) [template = f64] +// CHECK:STDOUT: %.loc4_27.1: type = value_of_initializer %float.make_type.loc4_27 [template = f64] +// CHECK:STDOUT: %.loc4_27.2: type = converted %float.make_type.loc4_27, %.loc4_27.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref f64 = out_param runtime_param2 // CHECK:STDOUT: %return: ref f64 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type: init type = call constants.%Float(%int_64) [template = f64] -// CHECK:STDOUT: %.loc8_8.1: type = value_of_initializer %float.make_type [template = f64] -// CHECK:STDOUT: %.loc8_8.2: type = converted %float.make_type, %.loc8_8.1 [template = f64] // CHECK:STDOUT: %x.var: ref f64 = var x // CHECK:STDOUT: %x: ref f64 = bind_name x, %x.var // CHECK:STDOUT: } @@ -217,15 +221,17 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %return.patt: f64 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: f64 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_64.loc8_14: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc8_14: init type = call constants.%Float(%int_64.loc8_14) [template = f64] -// CHECK:STDOUT: %.loc8_14.1: type = value_of_initializer %float.make_type.loc8_14 [template = f64] -// CHECK:STDOUT: %.loc8_14.2: type = converted %float.make_type.loc8_14, %.loc8_14.1 [template = f64] // CHECK:STDOUT: %int_64.loc8_22: Core.IntLiteral = int_value 64 [template = constants.%int_64] // CHECK:STDOUT: %float.make_type.loc8_22: init type = call constants.%Float(%int_64.loc8_22) [template = f64] // CHECK:STDOUT: %.loc8_22.1: type = value_of_initializer %float.make_type.loc8_22 [template = f64] // CHECK:STDOUT: %.loc8_22.2: type = converted %float.make_type.loc8_22, %.loc8_22.1 [template = f64] // CHECK:STDOUT: %a.param: f64 = value_param runtime_param0 +// CHECK:STDOUT: %.loc8_14.3: type = splice_block %.loc8_14.2 [template = f64] { +// CHECK:STDOUT: %int_64.loc8_14: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc8_14: init type = call constants.%Float(%int_64.loc8_14) [template = f64] +// CHECK:STDOUT: %.loc8_14.1: type = value_of_initializer %float.make_type.loc8_14 [template = f64] +// CHECK:STDOUT: %.loc8_14.2: type = converted %float.make_type.loc8_14, %.loc8_14.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref f64 = out_param runtime_param1 // CHECK:STDOUT: %return: ref f64 = return_slot %return.param @@ -240,27 +246,33 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %return.patt: f64 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: f64 = out_param_pattern %return.patt, runtime_param3 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_64.loc13_15: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc13_15: init type = call constants.%Float(%int_64.loc13_15) [template = f64] -// CHECK:STDOUT: %.loc13_15.1: type = value_of_initializer %float.make_type.loc13_15 [template = f64] -// CHECK:STDOUT: %.loc13_15.2: type = converted %float.make_type.loc13_15, %.loc13_15.1 [template = f64] -// CHECK:STDOUT: %int_64.loc13_23: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc13_23: init type = call constants.%Float(%int_64.loc13_23) [template = f64] -// CHECK:STDOUT: %.loc13_23.1: type = value_of_initializer %float.make_type.loc13_23 [template = f64] -// CHECK:STDOUT: %.loc13_23.2: type = converted %float.make_type.loc13_23, %.loc13_23.1 [template = f64] -// CHECK:STDOUT: %int_64.loc13_31: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc13_31: init type = call constants.%Float(%int_64.loc13_31) [template = f64] -// CHECK:STDOUT: %.loc13_31.1: type = value_of_initializer %float.make_type.loc13_31 [template = f64] -// CHECK:STDOUT: %.loc13_31.2: type = converted %float.make_type.loc13_31, %.loc13_31.1 [template = f64] // CHECK:STDOUT: %int_64.loc13_39: Core.IntLiteral = int_value 64 [template = constants.%int_64] // CHECK:STDOUT: %float.make_type.loc13_39: init type = call constants.%Float(%int_64.loc13_39) [template = f64] // CHECK:STDOUT: %.loc13_39.1: type = value_of_initializer %float.make_type.loc13_39 [template = f64] // CHECK:STDOUT: %.loc13_39.2: type = converted %float.make_type.loc13_39, %.loc13_39.1 [template = f64] // CHECK:STDOUT: %a.param: f64 = value_param runtime_param0 +// CHECK:STDOUT: %.loc13_15.3: type = splice_block %.loc13_15.2 [template = f64] { +// CHECK:STDOUT: %int_64.loc13_15: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc13_15: init type = call constants.%Float(%int_64.loc13_15) [template = f64] +// CHECK:STDOUT: %.loc13_15.1: type = value_of_initializer %float.make_type.loc13_15 [template = f64] +// CHECK:STDOUT: %.loc13_15.2: type = converted %float.make_type.loc13_15, %.loc13_15.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %b.param: f64 = value_param runtime_param1 +// CHECK:STDOUT: %.loc13_23.3: type = splice_block %.loc13_23.2 [template = f64] { +// CHECK:STDOUT: %int_64.loc13_23: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc13_23: init type = call constants.%Float(%int_64.loc13_23) [template = f64] +// CHECK:STDOUT: %.loc13_23.1: type = value_of_initializer %float.make_type.loc13_23 [template = f64] +// CHECK:STDOUT: %.loc13_23.2: type = converted %float.make_type.loc13_23, %.loc13_23.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %c.param: f64 = value_param runtime_param2 +// CHECK:STDOUT: %.loc13_31.3: type = splice_block %.loc13_31.2 [template = f64] { +// CHECK:STDOUT: %int_64.loc13_31: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc13_31: init type = call constants.%Float(%int_64.loc13_31) [template = f64] +// CHECK:STDOUT: %.loc13_31.1: type = value_of_initializer %float.make_type.loc13_31 [template = f64] +// CHECK:STDOUT: %.loc13_31.2: type = converted %float.make_type.loc13_31, %.loc13_31.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %c: f64 = bind_name c, %c.param // CHECK:STDOUT: %return.param: ref f64 = out_param runtime_param3 // CHECK:STDOUT: %return: ref f64 = return_slot %return.param @@ -273,20 +285,24 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %return.patt: bool = return_slot_pattern // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_64.loc17_21: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc17_21: init type = call constants.%Float(%int_64.loc17_21) [template = f64] -// CHECK:STDOUT: %.loc17_21.1: type = value_of_initializer %float.make_type.loc17_21 [template = f64] -// CHECK:STDOUT: %.loc17_21.2: type = converted %float.make_type.loc17_21, %.loc17_21.1 [template = f64] -// CHECK:STDOUT: %int_64.loc17_29: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc17_29: init type = call constants.%Float(%int_64.loc17_29) [template = f64] -// CHECK:STDOUT: %.loc17_29.1: type = value_of_initializer %float.make_type.loc17_29 [template = f64] -// CHECK:STDOUT: %.loc17_29.2: type = converted %float.make_type.loc17_29, %.loc17_29.1 [template = f64] // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc17_37.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc17_37.2: type = converted %bool.make_type, %.loc17_37.1 [template = bool] // CHECK:STDOUT: %a.param: f64 = value_param runtime_param0 +// CHECK:STDOUT: %.loc17_21.3: type = splice_block %.loc17_21.2 [template = f64] { +// CHECK:STDOUT: %int_64.loc17_21: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc17_21: init type = call constants.%Float(%int_64.loc17_21) [template = f64] +// CHECK:STDOUT: %.loc17_21.1: type = value_of_initializer %float.make_type.loc17_21 [template = f64] +// CHECK:STDOUT: %.loc17_21.2: type = converted %float.make_type.loc17_21, %.loc17_21.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %b.param: f64 = value_param runtime_param1 +// CHECK:STDOUT: %.loc17_29.3: type = splice_block %.loc17_29.2 [template = f64] { +// CHECK:STDOUT: %int_64.loc17_29: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc17_29: init type = call constants.%Float(%int_64.loc17_29) [template = f64] +// CHECK:STDOUT: %.loc17_29.1: type = value_of_initializer %float.make_type.loc17_29 [template = f64] +// CHECK:STDOUT: %.loc17_29.2: type = converted %float.make_type.loc17_29, %.loc17_29.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param @@ -299,21 +315,25 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %return.patt: f64 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: f64 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_64.loc18_17: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc18_17: init type = call constants.%Float(%int_64.loc18_17) [template = f64] -// CHECK:STDOUT: %.loc18_17.1: type = value_of_initializer %float.make_type.loc18_17 [template = f64] -// CHECK:STDOUT: %.loc18_17.2: type = converted %float.make_type.loc18_17, %.loc18_17.1 [template = f64] -// CHECK:STDOUT: %int_64.loc18_25: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc18_25: init type = call constants.%Float(%int_64.loc18_25) [template = f64] -// CHECK:STDOUT: %.loc18_25.1: type = value_of_initializer %float.make_type.loc18_25 [template = f64] -// CHECK:STDOUT: %.loc18_25.2: type = converted %float.make_type.loc18_25, %.loc18_25.1 [template = f64] // CHECK:STDOUT: %int_64.loc18_33: Core.IntLiteral = int_value 64 [template = constants.%int_64] // CHECK:STDOUT: %float.make_type.loc18_33: init type = call constants.%Float(%int_64.loc18_33) [template = f64] // CHECK:STDOUT: %.loc18_33.1: type = value_of_initializer %float.make_type.loc18_33 [template = f64] // CHECK:STDOUT: %.loc18_33.2: type = converted %float.make_type.loc18_33, %.loc18_33.1 [template = f64] // CHECK:STDOUT: %a.param: f64 = value_param runtime_param0 +// CHECK:STDOUT: %.loc18_17.3: type = splice_block %.loc18_17.2 [template = f64] { +// CHECK:STDOUT: %int_64.loc18_17: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc18_17: init type = call constants.%Float(%int_64.loc18_17) [template = f64] +// CHECK:STDOUT: %.loc18_17.1: type = value_of_initializer %float.make_type.loc18_17 [template = f64] +// CHECK:STDOUT: %.loc18_17.2: type = converted %float.make_type.loc18_17, %.loc18_17.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %b.param: f64 = value_param runtime_param1 +// CHECK:STDOUT: %.loc18_25.3: type = splice_block %.loc18_25.2 [template = f64] { +// CHECK:STDOUT: %int_64.loc18_25: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc18_25: init type = call constants.%Float(%int_64.loc18_25) [template = f64] +// CHECK:STDOUT: %.loc18_25.1: type = value_of_initializer %float.make_type.loc18_25 [template = f64] +// CHECK:STDOUT: %.loc18_25.2: type = converted %float.make_type.loc18_25, %.loc18_25.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref f64 = out_param runtime_param2 // CHECK:STDOUT: %return: ref f64 = return_slot %return.param @@ -324,15 +344,17 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %return.patt: f64 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: f64 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_64.loc20_25: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc20_25: init type = call constants.%Float(%int_64.loc20_25) [template = f64] -// CHECK:STDOUT: %.loc20_25.1: type = value_of_initializer %float.make_type.loc20_25 [template = f64] -// CHECK:STDOUT: %.loc20_25.2: type = converted %float.make_type.loc20_25, %.loc20_25.1 [template = f64] // CHECK:STDOUT: %int_64.loc20_33: Core.IntLiteral = int_value 64 [template = constants.%int_64] // CHECK:STDOUT: %float.make_type.loc20_33: init type = call constants.%Float(%int_64.loc20_33) [template = f64] // CHECK:STDOUT: %.loc20_33.1: type = value_of_initializer %float.make_type.loc20_33 [template = f64] // CHECK:STDOUT: %.loc20_33.2: type = converted %float.make_type.loc20_33, %.loc20_33.1 [template = f64] // CHECK:STDOUT: %a.param: f64 = value_param runtime_param0 +// CHECK:STDOUT: %.loc20_25.3: type = splice_block %.loc20_25.2 [template = f64] { +// CHECK:STDOUT: %int_64.loc20_25: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc20_25: init type = call constants.%Float(%int_64.loc20_25) [template = f64] +// CHECK:STDOUT: %.loc20_25.1: type = value_of_initializer %float.make_type.loc20_25 [template = f64] +// CHECK:STDOUT: %.loc20_25.2: type = converted %float.make_type.loc20_25, %.loc20_25.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref f64 = out_param runtime_param1 // CHECK:STDOUT: %return: ref f64 = return_slot %return.param @@ -347,27 +369,33 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %return.patt: f64 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: f64 = out_param_pattern %return.patt, runtime_param3 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_64.loc24_26: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc24_26: init type = call constants.%Float(%int_64.loc24_26) [template = f64] -// CHECK:STDOUT: %.loc24_26.1: type = value_of_initializer %float.make_type.loc24_26 [template = f64] -// CHECK:STDOUT: %.loc24_26.2: type = converted %float.make_type.loc24_26, %.loc24_26.1 [template = f64] -// CHECK:STDOUT: %int_64.loc24_34: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc24_34: init type = call constants.%Float(%int_64.loc24_34) [template = f64] -// CHECK:STDOUT: %.loc24_34.1: type = value_of_initializer %float.make_type.loc24_34 [template = f64] -// CHECK:STDOUT: %.loc24_34.2: type = converted %float.make_type.loc24_34, %.loc24_34.1 [template = f64] -// CHECK:STDOUT: %int_64.loc24_42: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc24_42: init type = call constants.%Float(%int_64.loc24_42) [template = f64] -// CHECK:STDOUT: %.loc24_42.1: type = value_of_initializer %float.make_type.loc24_42 [template = f64] -// CHECK:STDOUT: %.loc24_42.2: type = converted %float.make_type.loc24_42, %.loc24_42.1 [template = f64] // CHECK:STDOUT: %int_64.loc24_50: Core.IntLiteral = int_value 64 [template = constants.%int_64] // CHECK:STDOUT: %float.make_type.loc24_50: init type = call constants.%Float(%int_64.loc24_50) [template = f64] // CHECK:STDOUT: %.loc24_50.1: type = value_of_initializer %float.make_type.loc24_50 [template = f64] // CHECK:STDOUT: %.loc24_50.2: type = converted %float.make_type.loc24_50, %.loc24_50.1 [template = f64] // CHECK:STDOUT: %a.param: f64 = value_param runtime_param0 +// CHECK:STDOUT: %.loc24_26.3: type = splice_block %.loc24_26.2 [template = f64] { +// CHECK:STDOUT: %int_64.loc24_26: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc24_26: init type = call constants.%Float(%int_64.loc24_26) [template = f64] +// CHECK:STDOUT: %.loc24_26.1: type = value_of_initializer %float.make_type.loc24_26 [template = f64] +// CHECK:STDOUT: %.loc24_26.2: type = converted %float.make_type.loc24_26, %.loc24_26.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %b.param: f64 = value_param runtime_param1 +// CHECK:STDOUT: %.loc24_34.3: type = splice_block %.loc24_34.2 [template = f64] { +// CHECK:STDOUT: %int_64.loc24_34: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc24_34: init type = call constants.%Float(%int_64.loc24_34) [template = f64] +// CHECK:STDOUT: %.loc24_34.1: type = value_of_initializer %float.make_type.loc24_34 [template = f64] +// CHECK:STDOUT: %.loc24_34.2: type = converted %float.make_type.loc24_34, %.loc24_34.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %c.param: f64 = value_param runtime_param2 +// CHECK:STDOUT: %.loc24_42.3: type = splice_block %.loc24_42.2 [template = f64] { +// CHECK:STDOUT: %int_64.loc24_42: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc24_42: init type = call constants.%Float(%int_64.loc24_42) [template = f64] +// CHECK:STDOUT: %.loc24_42.1: type = value_of_initializer %float.make_type.loc24_42 [template = f64] +// CHECK:STDOUT: %.loc24_42.2: type = converted %float.make_type.loc24_42, %.loc24_42.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %c: f64 = bind_name c, %c.param // CHECK:STDOUT: %return.param: ref f64 = out_param runtime_param3 // CHECK:STDOUT: %return: ref f64 = return_slot %return.param @@ -380,20 +408,24 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %return.patt: bool = return_slot_pattern // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_64.loc28_32: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc28_32: init type = call constants.%Float(%int_64.loc28_32) [template = f64] -// CHECK:STDOUT: %.loc28_32.1: type = value_of_initializer %float.make_type.loc28_32 [template = f64] -// CHECK:STDOUT: %.loc28_32.2: type = converted %float.make_type.loc28_32, %.loc28_32.1 [template = f64] -// CHECK:STDOUT: %int_64.loc28_40: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc28_40: init type = call constants.%Float(%int_64.loc28_40) [template = f64] -// CHECK:STDOUT: %.loc28_40.1: type = value_of_initializer %float.make_type.loc28_40 [template = f64] -// CHECK:STDOUT: %.loc28_40.2: type = converted %float.make_type.loc28_40, %.loc28_40.1 [template = f64] // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc28_48.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc28_48.2: type = converted %bool.make_type, %.loc28_48.1 [template = bool] // CHECK:STDOUT: %a.param: f64 = value_param runtime_param0 +// CHECK:STDOUT: %.loc28_32.3: type = splice_block %.loc28_32.2 [template = f64] { +// CHECK:STDOUT: %int_64.loc28_32: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc28_32: init type = call constants.%Float(%int_64.loc28_32) [template = f64] +// CHECK:STDOUT: %.loc28_32.1: type = value_of_initializer %float.make_type.loc28_32 [template = f64] +// CHECK:STDOUT: %.loc28_32.2: type = converted %float.make_type.loc28_32, %.loc28_32.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %b.param: f64 = value_param runtime_param1 +// CHECK:STDOUT: %.loc28_40.3: type = splice_block %.loc28_40.2 [template = f64] { +// CHECK:STDOUT: %int_64.loc28_40: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc28_40: init type = call constants.%Float(%int_64.loc28_40) [template = f64] +// CHECK:STDOUT: %.loc28_40.1: type = value_of_initializer %float.make_type.loc28_40 [template = f64] +// CHECK:STDOUT: %.loc28_40.2: type = converted %float.make_type.loc28_40, %.loc28_40.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param diff --git a/toolchain/check/testdata/builtins/float/negate.carbon b/toolchain/check/testdata/builtins/float/negate.carbon index 4d7d145df3057..65d3580294236 100644 --- a/toolchain/check/testdata/builtins/float/negate.carbon +++ b/toolchain/check/testdata/builtins/float/negate.carbon @@ -107,15 +107,17 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %return.patt: f64 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: f64 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_64.loc2_14: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc2_14: init type = call constants.%Float(%int_64.loc2_14) [template = f64] -// CHECK:STDOUT: %.loc2_14.1: type = value_of_initializer %float.make_type.loc2_14 [template = f64] -// CHECK:STDOUT: %.loc2_14.2: type = converted %float.make_type.loc2_14, %.loc2_14.1 [template = f64] // CHECK:STDOUT: %int_64.loc2_22: Core.IntLiteral = int_value 64 [template = constants.%int_64] // CHECK:STDOUT: %float.make_type.loc2_22: init type = call constants.%Float(%int_64.loc2_22) [template = f64] // CHECK:STDOUT: %.loc2_22.1: type = value_of_initializer %float.make_type.loc2_22 [template = f64] // CHECK:STDOUT: %.loc2_22.2: type = converted %float.make_type.loc2_22, %.loc2_22.1 [template = f64] // CHECK:STDOUT: %a.param: f64 = value_param runtime_param0 +// CHECK:STDOUT: %.loc2_14.3: type = splice_block %.loc2_14.2 [template = f64] { +// CHECK:STDOUT: %int_64.loc2_14: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc2_14: init type = call constants.%Float(%int_64.loc2_14) [template = f64] +// CHECK:STDOUT: %.loc2_14.1: type = value_of_initializer %float.make_type.loc2_14 [template = f64] +// CHECK:STDOUT: %.loc2_14.2: type = converted %float.make_type.loc2_14, %.loc2_14.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref f64 = out_param runtime_param1 // CHECK:STDOUT: %return: ref f64 = return_slot %return.param @@ -128,29 +130,29 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %return.patt: f64 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: f64 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_64.loc4_19: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc4_19: init type = call constants.%Float(%int_64.loc4_19) [template = f64] -// CHECK:STDOUT: %.loc4_19.1: type = value_of_initializer %float.make_type.loc4_19 [template = f64] -// CHECK:STDOUT: %.loc4_19.2: type = converted %float.make_type.loc4_19, %.loc4_19.1 [template = f64] -// CHECK:STDOUT: %int_64.loc4_27: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc4_27: init type = call constants.%Float(%int_64.loc4_27) [template = f64] -// CHECK:STDOUT: %.loc4_27.1: type = value_of_initializer %float.make_type.loc4_27 [template = f64] -// CHECK:STDOUT: %.loc4_27.2: type = converted %float.make_type.loc4_27, %.loc4_27.1 [template = f64] // CHECK:STDOUT: %int_64.loc4_35: Core.IntLiteral = int_value 64 [template = constants.%int_64] // CHECK:STDOUT: %float.make_type.loc4_35: init type = call constants.%Float(%int_64.loc4_35) [template = f64] // CHECK:STDOUT: %.loc4_35.1: type = value_of_initializer %float.make_type.loc4_35 [template = f64] // CHECK:STDOUT: %.loc4_35.2: type = converted %float.make_type.loc4_35, %.loc4_35.1 [template = f64] // CHECK:STDOUT: %a.param: f64 = value_param runtime_param0 +// CHECK:STDOUT: %.loc4_19.3: type = splice_block %.loc4_19.2 [template = f64] { +// CHECK:STDOUT: %int_64.loc4_19: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc4_19: init type = call constants.%Float(%int_64.loc4_19) [template = f64] +// CHECK:STDOUT: %.loc4_19.1: type = value_of_initializer %float.make_type.loc4_19 [template = f64] +// CHECK:STDOUT: %.loc4_19.2: type = converted %float.make_type.loc4_19, %.loc4_19.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %b.param: f64 = value_param runtime_param1 +// CHECK:STDOUT: %.loc4_27.3: type = splice_block %.loc4_27.2 [template = f64] { +// CHECK:STDOUT: %int_64.loc4_27: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc4_27: init type = call constants.%Float(%int_64.loc4_27) [template = f64] +// CHECK:STDOUT: %.loc4_27.1: type = value_of_initializer %float.make_type.loc4_27 [template = f64] +// CHECK:STDOUT: %.loc4_27.2: type = converted %float.make_type.loc4_27, %.loc4_27.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref f64 = out_param runtime_param2 // CHECK:STDOUT: %return: ref f64 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type: init type = call constants.%Float(%int_64) [template = f64] -// CHECK:STDOUT: %.loc8_8.1: type = value_of_initializer %float.make_type [template = f64] -// CHECK:STDOUT: %.loc8_8.2: type = converted %float.make_type, %.loc8_8.1 [template = f64] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Negate(%a.param_patt: f64) -> f64 = "float.negate"; @@ -240,21 +242,25 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %return.patt: f64 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: f64 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_64.loc13_15: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc13_15: init type = call constants.%Float(%int_64.loc13_15) [template = f64] -// CHECK:STDOUT: %.loc13_15.1: type = value_of_initializer %float.make_type.loc13_15 [template = f64] -// CHECK:STDOUT: %.loc13_15.2: type = converted %float.make_type.loc13_15, %.loc13_15.1 [template = f64] -// CHECK:STDOUT: %int_64.loc13_23: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc13_23: init type = call constants.%Float(%int_64.loc13_23) [template = f64] -// CHECK:STDOUT: %.loc13_23.1: type = value_of_initializer %float.make_type.loc13_23 [template = f64] -// CHECK:STDOUT: %.loc13_23.2: type = converted %float.make_type.loc13_23, %.loc13_23.1 [template = f64] // CHECK:STDOUT: %int_64.loc13_31: Core.IntLiteral = int_value 64 [template = constants.%int_64] // CHECK:STDOUT: %float.make_type.loc13_31: init type = call constants.%Float(%int_64.loc13_31) [template = f64] // CHECK:STDOUT: %.loc13_31.1: type = value_of_initializer %float.make_type.loc13_31 [template = f64] // CHECK:STDOUT: %.loc13_31.2: type = converted %float.make_type.loc13_31, %.loc13_31.1 [template = f64] // CHECK:STDOUT: %a.param: f64 = value_param runtime_param0 +// CHECK:STDOUT: %.loc13_15.3: type = splice_block %.loc13_15.2 [template = f64] { +// CHECK:STDOUT: %int_64.loc13_15: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc13_15: init type = call constants.%Float(%int_64.loc13_15) [template = f64] +// CHECK:STDOUT: %.loc13_15.1: type = value_of_initializer %float.make_type.loc13_15 [template = f64] +// CHECK:STDOUT: %.loc13_15.2: type = converted %float.make_type.loc13_15, %.loc13_15.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %b.param: f64 = value_param runtime_param1 +// CHECK:STDOUT: %.loc13_23.3: type = splice_block %.loc13_23.2 [template = f64] { +// CHECK:STDOUT: %int_64.loc13_23: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc13_23: init type = call constants.%Float(%int_64.loc13_23) [template = f64] +// CHECK:STDOUT: %.loc13_23.1: type = value_of_initializer %float.make_type.loc13_23 [template = f64] +// CHECK:STDOUT: %.loc13_23.2: type = converted %float.make_type.loc13_23, %.loc13_23.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref f64 = out_param runtime_param2 // CHECK:STDOUT: %return: ref f64 = return_slot %return.param @@ -265,14 +271,16 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %return.patt: bool = return_slot_pattern // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type: init type = call constants.%Float(%int_64) [template = f64] -// CHECK:STDOUT: %.loc18_21.1: type = value_of_initializer %float.make_type [template = f64] -// CHECK:STDOUT: %.loc18_21.2: type = converted %float.make_type, %.loc18_21.1 [template = f64] // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc18_29.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc18_29.2: type = converted %bool.make_type, %.loc18_29.1 [template = bool] // CHECK:STDOUT: %a.param: f64 = value_param runtime_param0 +// CHECK:STDOUT: %.loc18_21.3: type = splice_block %.loc18_21.2 [template = f64] { +// CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type: init type = call constants.%Float(%int_64) [template = f64] +// CHECK:STDOUT: %.loc18_21.1: type = value_of_initializer %float.make_type [template = f64] +// CHECK:STDOUT: %.loc18_21.2: type = converted %float.make_type, %.loc18_21.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param1 // CHECK:STDOUT: %return: ref bool = return_slot %return.param @@ -283,15 +291,17 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %return.patt: f64 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: f64 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_64.loc19_17: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc19_17: init type = call constants.%Float(%int_64.loc19_17) [template = f64] -// CHECK:STDOUT: %.loc19_17.1: type = value_of_initializer %float.make_type.loc19_17 [template = f64] -// CHECK:STDOUT: %.loc19_17.2: type = converted %float.make_type.loc19_17, %.loc19_17.1 [template = f64] // CHECK:STDOUT: %int_64.loc19_25: Core.IntLiteral = int_value 64 [template = constants.%int_64] // CHECK:STDOUT: %float.make_type.loc19_25: init type = call constants.%Float(%int_64.loc19_25) [template = f64] // CHECK:STDOUT: %.loc19_25.1: type = value_of_initializer %float.make_type.loc19_25 [template = f64] // CHECK:STDOUT: %.loc19_25.2: type = converted %float.make_type.loc19_25, %.loc19_25.1 [template = f64] // CHECK:STDOUT: %a.param: f64 = value_param runtime_param0 +// CHECK:STDOUT: %.loc19_17.3: type = splice_block %.loc19_17.2 [template = f64] { +// CHECK:STDOUT: %int_64.loc19_17: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc19_17: init type = call constants.%Float(%int_64.loc19_17) [template = f64] +// CHECK:STDOUT: %.loc19_17.1: type = value_of_initializer %float.make_type.loc19_17 [template = f64] +// CHECK:STDOUT: %.loc19_17.2: type = converted %float.make_type.loc19_17, %.loc19_17.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref f64 = out_param runtime_param1 // CHECK:STDOUT: %return: ref f64 = return_slot %return.param @@ -302,15 +312,17 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %return.patt: f64 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: f64 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_64.loc21_25: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc21_25: init type = call constants.%Float(%int_64.loc21_25) [template = f64] -// CHECK:STDOUT: %.loc21_25.1: type = value_of_initializer %float.make_type.loc21_25 [template = f64] -// CHECK:STDOUT: %.loc21_25.2: type = converted %float.make_type.loc21_25, %.loc21_25.1 [template = f64] // CHECK:STDOUT: %int_64.loc21_33: Core.IntLiteral = int_value 64 [template = constants.%int_64] // CHECK:STDOUT: %float.make_type.loc21_33: init type = call constants.%Float(%int_64.loc21_33) [template = f64] // CHECK:STDOUT: %.loc21_33.1: type = value_of_initializer %float.make_type.loc21_33 [template = f64] // CHECK:STDOUT: %.loc21_33.2: type = converted %float.make_type.loc21_33, %.loc21_33.1 [template = f64] // CHECK:STDOUT: %a.param: f64 = value_param runtime_param0 +// CHECK:STDOUT: %.loc21_25.3: type = splice_block %.loc21_25.2 [template = f64] { +// CHECK:STDOUT: %int_64.loc21_25: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc21_25: init type = call constants.%Float(%int_64.loc21_25) [template = f64] +// CHECK:STDOUT: %.loc21_25.1: type = value_of_initializer %float.make_type.loc21_25 [template = f64] +// CHECK:STDOUT: %.loc21_25.2: type = converted %float.make_type.loc21_25, %.loc21_25.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref f64 = out_param runtime_param1 // CHECK:STDOUT: %return: ref f64 = return_slot %return.param @@ -325,27 +337,33 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %return.patt: f64 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: f64 = out_param_pattern %return.patt, runtime_param3 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_64.loc32_26: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc32_26: init type = call constants.%Float(%int_64.loc32_26) [template = f64] -// CHECK:STDOUT: %.loc32_26.1: type = value_of_initializer %float.make_type.loc32_26 [template = f64] -// CHECK:STDOUT: %.loc32_26.2: type = converted %float.make_type.loc32_26, %.loc32_26.1 [template = f64] -// CHECK:STDOUT: %int_64.loc32_34: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc32_34: init type = call constants.%Float(%int_64.loc32_34) [template = f64] -// CHECK:STDOUT: %.loc32_34.1: type = value_of_initializer %float.make_type.loc32_34 [template = f64] -// CHECK:STDOUT: %.loc32_34.2: type = converted %float.make_type.loc32_34, %.loc32_34.1 [template = f64] -// CHECK:STDOUT: %int_64.loc32_42: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc32_42: init type = call constants.%Float(%int_64.loc32_42) [template = f64] -// CHECK:STDOUT: %.loc32_42.1: type = value_of_initializer %float.make_type.loc32_42 [template = f64] -// CHECK:STDOUT: %.loc32_42.2: type = converted %float.make_type.loc32_42, %.loc32_42.1 [template = f64] // CHECK:STDOUT: %int_64.loc32_50: Core.IntLiteral = int_value 64 [template = constants.%int_64] // CHECK:STDOUT: %float.make_type.loc32_50: init type = call constants.%Float(%int_64.loc32_50) [template = f64] // CHECK:STDOUT: %.loc32_50.1: type = value_of_initializer %float.make_type.loc32_50 [template = f64] // CHECK:STDOUT: %.loc32_50.2: type = converted %float.make_type.loc32_50, %.loc32_50.1 [template = f64] // CHECK:STDOUT: %a.param: f64 = value_param runtime_param0 +// CHECK:STDOUT: %.loc32_26.3: type = splice_block %.loc32_26.2 [template = f64] { +// CHECK:STDOUT: %int_64.loc32_26: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc32_26: init type = call constants.%Float(%int_64.loc32_26) [template = f64] +// CHECK:STDOUT: %.loc32_26.1: type = value_of_initializer %float.make_type.loc32_26 [template = f64] +// CHECK:STDOUT: %.loc32_26.2: type = converted %float.make_type.loc32_26, %.loc32_26.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %b.param: f64 = value_param runtime_param1 +// CHECK:STDOUT: %.loc32_34.3: type = splice_block %.loc32_34.2 [template = f64] { +// CHECK:STDOUT: %int_64.loc32_34: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc32_34: init type = call constants.%Float(%int_64.loc32_34) [template = f64] +// CHECK:STDOUT: %.loc32_34.1: type = value_of_initializer %float.make_type.loc32_34 [template = f64] +// CHECK:STDOUT: %.loc32_34.2: type = converted %float.make_type.loc32_34, %.loc32_34.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %c.param: f64 = value_param runtime_param2 +// CHECK:STDOUT: %.loc32_42.3: type = splice_block %.loc32_42.2 [template = f64] { +// CHECK:STDOUT: %int_64.loc32_42: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc32_42: init type = call constants.%Float(%int_64.loc32_42) [template = f64] +// CHECK:STDOUT: %.loc32_42.1: type = value_of_initializer %float.make_type.loc32_42 [template = f64] +// CHECK:STDOUT: %.loc32_42.2: type = converted %float.make_type.loc32_42, %.loc32_42.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %c: f64 = bind_name c, %c.param // CHECK:STDOUT: %return.param: ref f64 = out_param runtime_param3 // CHECK:STDOUT: %return: ref f64 = return_slot %return.param @@ -358,20 +376,24 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %return.patt: bool = return_slot_pattern // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_64.loc43_32: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc43_32: init type = call constants.%Float(%int_64.loc43_32) [template = f64] -// CHECK:STDOUT: %.loc43_32.1: type = value_of_initializer %float.make_type.loc43_32 [template = f64] -// CHECK:STDOUT: %.loc43_32.2: type = converted %float.make_type.loc43_32, %.loc43_32.1 [template = f64] -// CHECK:STDOUT: %int_64.loc43_40: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc43_40: init type = call constants.%Float(%int_64.loc43_40) [template = f64] -// CHECK:STDOUT: %.loc43_40.1: type = value_of_initializer %float.make_type.loc43_40 [template = f64] -// CHECK:STDOUT: %.loc43_40.2: type = converted %float.make_type.loc43_40, %.loc43_40.1 [template = f64] // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc43_48.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc43_48.2: type = converted %bool.make_type, %.loc43_48.1 [template = bool] // CHECK:STDOUT: %a.param: f64 = value_param runtime_param0 +// CHECK:STDOUT: %.loc43_32.3: type = splice_block %.loc43_32.2 [template = f64] { +// CHECK:STDOUT: %int_64.loc43_32: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc43_32: init type = call constants.%Float(%int_64.loc43_32) [template = f64] +// CHECK:STDOUT: %.loc43_32.1: type = value_of_initializer %float.make_type.loc43_32 [template = f64] +// CHECK:STDOUT: %.loc43_32.2: type = converted %float.make_type.loc43_32, %.loc43_32.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %b.param: f64 = value_param runtime_param1 +// CHECK:STDOUT: %.loc43_40.3: type = splice_block %.loc43_40.2 [template = f64] { +// CHECK:STDOUT: %int_64.loc43_40: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc43_40: init type = call constants.%Float(%int_64.loc43_40) [template = f64] +// CHECK:STDOUT: %.loc43_40.1: type = value_of_initializer %float.make_type.loc43_40 [template = f64] +// CHECK:STDOUT: %.loc43_40.2: type = converted %float.make_type.loc43_40, %.loc43_40.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param diff --git a/toolchain/check/testdata/builtins/float/neq.carbon b/toolchain/check/testdata/builtins/float/neq.carbon index 67782c3b17a5a..a0291dbf186c3 100644 --- a/toolchain/check/testdata/builtins/float/neq.carbon +++ b/toolchain/check/testdata/builtins/float/neq.carbon @@ -84,20 +84,24 @@ fn WrongResult(a: f64, b: f64) -> f64 = "float.neq"; // CHECK:STDOUT: %return.patt: bool = return_slot_pattern // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_64.loc2_11: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc2_11: init type = call constants.%Float(%int_64.loc2_11) [template = f64] -// CHECK:STDOUT: %.loc2_11.1: type = value_of_initializer %float.make_type.loc2_11 [template = f64] -// CHECK:STDOUT: %.loc2_11.2: type = converted %float.make_type.loc2_11, %.loc2_11.1 [template = f64] -// CHECK:STDOUT: %int_64.loc2_19: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc2_19: init type = call constants.%Float(%int_64.loc2_19) [template = f64] -// CHECK:STDOUT: %.loc2_19.1: type = value_of_initializer %float.make_type.loc2_19 [template = f64] -// CHECK:STDOUT: %.loc2_19.2: type = converted %float.make_type.loc2_19, %.loc2_19.1 [template = f64] // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc2_27.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc2_27.2: type = converted %bool.make_type, %.loc2_27.1 [template = bool] // CHECK:STDOUT: %a.param: f64 = value_param runtime_param0 +// CHECK:STDOUT: %.loc2_11.3: type = splice_block %.loc2_11.2 [template = f64] { +// CHECK:STDOUT: %int_64.loc2_11: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc2_11: init type = call constants.%Float(%int_64.loc2_11) [template = f64] +// CHECK:STDOUT: %.loc2_11.1: type = value_of_initializer %float.make_type.loc2_11 [template = f64] +// CHECK:STDOUT: %.loc2_11.2: type = converted %float.make_type.loc2_11, %.loc2_11.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %b.param: f64 = value_param runtime_param1 +// CHECK:STDOUT: %.loc2_19.3: type = splice_block %.loc2_19.2 [template = f64] { +// CHECK:STDOUT: %int_64.loc2_19: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc2_19: init type = call constants.%Float(%int_64.loc2_19) [template = f64] +// CHECK:STDOUT: %.loc2_19.1: type = value_of_initializer %float.make_type.loc2_19 [template = f64] +// CHECK:STDOUT: %.loc2_19.2: type = converted %float.make_type.loc2_19, %.loc2_19.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param @@ -110,11 +114,11 @@ fn WrongResult(a: f64, b: f64) -> f64 = "float.neq"; // CHECK:STDOUT: %false_.patt: %False = binding_pattern false_ // CHECK:STDOUT: %false_.param_patt: %False = value_param_pattern %false_.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %True.ref.loc7: type = name_ref True, file.%True.decl [template = constants.%True] -// CHECK:STDOUT: %False.ref.loc7: type = name_ref False, file.%False.decl [template = constants.%False] // CHECK:STDOUT: %true_.param: %True = value_param runtime_param0 +// CHECK:STDOUT: %True.ref.loc7: type = name_ref True, file.%True.decl [template = constants.%True] // CHECK:STDOUT: %true_: %True = bind_name true_, %true_.param // CHECK:STDOUT: %false_.param: %False = value_param runtime_param1 +// CHECK:STDOUT: %False.ref.loc7: type = name_ref False, file.%False.decl [template = constants.%False] // CHECK:STDOUT: %false_: %False = bind_name false_, %false_.param // CHECK:STDOUT: } // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { @@ -125,20 +129,24 @@ fn WrongResult(a: f64, b: f64) -> f64 = "float.neq"; // CHECK:STDOUT: %return.patt: bool = return_slot_pattern // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_64.loc12_19: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc12_19: init type = call constants.%Float(%int_64.loc12_19) [template = f64] -// CHECK:STDOUT: %.loc12_19.1: type = value_of_initializer %float.make_type.loc12_19 [template = f64] -// CHECK:STDOUT: %.loc12_19.2: type = converted %float.make_type.loc12_19, %.loc12_19.1 [template = f64] -// CHECK:STDOUT: %int_64.loc12_27: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc12_27: init type = call constants.%Float(%int_64.loc12_27) [template = f64] -// CHECK:STDOUT: %.loc12_27.1: type = value_of_initializer %float.make_type.loc12_27 [template = f64] -// CHECK:STDOUT: %.loc12_27.2: type = converted %float.make_type.loc12_27, %.loc12_27.1 [template = f64] // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc12_35.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc12_35.2: type = converted %bool.make_type, %.loc12_35.1 [template = bool] // CHECK:STDOUT: %a.param: f64 = value_param runtime_param0 +// CHECK:STDOUT: %.loc12_19.3: type = splice_block %.loc12_19.2 [template = f64] { +// CHECK:STDOUT: %int_64.loc12_19: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc12_19: init type = call constants.%Float(%int_64.loc12_19) [template = f64] +// CHECK:STDOUT: %.loc12_19.1: type = value_of_initializer %float.make_type.loc12_19 [template = f64] +// CHECK:STDOUT: %.loc12_19.2: type = converted %float.make_type.loc12_19, %.loc12_19.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %b.param: f64 = value_param runtime_param1 +// CHECK:STDOUT: %.loc12_27.3: type = splice_block %.loc12_27.2 [template = f64] { +// CHECK:STDOUT: %int_64.loc12_27: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc12_27: init type = call constants.%Float(%int_64.loc12_27) [template = f64] +// CHECK:STDOUT: %.loc12_27.1: type = value_of_initializer %float.make_type.loc12_27 [template = f64] +// CHECK:STDOUT: %.loc12_27.2: type = converted %float.make_type.loc12_27, %.loc12_27.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param @@ -249,21 +257,25 @@ fn WrongResult(a: f64, b: f64) -> f64 = "float.neq"; // CHECK:STDOUT: %return.patt: f64 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: f64 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_64.loc7_19: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc7_19: init type = call constants.%Float(%int_64.loc7_19) [template = f64] -// CHECK:STDOUT: %.loc7_19.1: type = value_of_initializer %float.make_type.loc7_19 [template = f64] -// CHECK:STDOUT: %.loc7_19.2: type = converted %float.make_type.loc7_19, %.loc7_19.1 [template = f64] -// CHECK:STDOUT: %int_64.loc7_27: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc7_27: init type = call constants.%Float(%int_64.loc7_27) [template = f64] -// CHECK:STDOUT: %.loc7_27.1: type = value_of_initializer %float.make_type.loc7_27 [template = f64] -// CHECK:STDOUT: %.loc7_27.2: type = converted %float.make_type.loc7_27, %.loc7_27.1 [template = f64] // CHECK:STDOUT: %int_64.loc7_35: Core.IntLiteral = int_value 64 [template = constants.%int_64] // CHECK:STDOUT: %float.make_type.loc7_35: init type = call constants.%Float(%int_64.loc7_35) [template = f64] // CHECK:STDOUT: %.loc7_35.1: type = value_of_initializer %float.make_type.loc7_35 [template = f64] // CHECK:STDOUT: %.loc7_35.2: type = converted %float.make_type.loc7_35, %.loc7_35.1 [template = f64] // CHECK:STDOUT: %a.param: f64 = value_param runtime_param0 +// CHECK:STDOUT: %.loc7_19.3: type = splice_block %.loc7_19.2 [template = f64] { +// CHECK:STDOUT: %int_64.loc7_19: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc7_19: init type = call constants.%Float(%int_64.loc7_19) [template = f64] +// CHECK:STDOUT: %.loc7_19.1: type = value_of_initializer %float.make_type.loc7_19 [template = f64] +// CHECK:STDOUT: %.loc7_19.2: type = converted %float.make_type.loc7_19, %.loc7_19.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %b.param: f64 = value_param runtime_param1 +// CHECK:STDOUT: %.loc7_27.3: type = splice_block %.loc7_27.2 [template = f64] { +// CHECK:STDOUT: %int_64.loc7_27: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc7_27: init type = call constants.%Float(%int_64.loc7_27) [template = f64] +// CHECK:STDOUT: %.loc7_27.1: type = value_of_initializer %float.make_type.loc7_27 [template = f64] +// CHECK:STDOUT: %.loc7_27.2: type = converted %float.make_type.loc7_27, %.loc7_27.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref f64 = out_param runtime_param2 // CHECK:STDOUT: %return: ref f64 = return_slot %return.param diff --git a/toolchain/check/testdata/builtins/float/sub.carbon b/toolchain/check/testdata/builtins/float/sub.carbon index 04551d598a66d..5c57f97769a30 100644 --- a/toolchain/check/testdata/builtins/float/sub.carbon +++ b/toolchain/check/testdata/builtins/float/sub.carbon @@ -89,21 +89,25 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %return.patt: f64 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: f64 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_64.loc2_11: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc2_11: init type = call constants.%Float(%int_64.loc2_11) [template = f64] -// CHECK:STDOUT: %.loc2_11.1: type = value_of_initializer %float.make_type.loc2_11 [template = f64] -// CHECK:STDOUT: %.loc2_11.2: type = converted %float.make_type.loc2_11, %.loc2_11.1 [template = f64] -// CHECK:STDOUT: %int_64.loc2_19: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc2_19: init type = call constants.%Float(%int_64.loc2_19) [template = f64] -// CHECK:STDOUT: %.loc2_19.1: type = value_of_initializer %float.make_type.loc2_19 [template = f64] -// CHECK:STDOUT: %.loc2_19.2: type = converted %float.make_type.loc2_19, %.loc2_19.1 [template = f64] // CHECK:STDOUT: %int_64.loc2_27: Core.IntLiteral = int_value 64 [template = constants.%int_64] // CHECK:STDOUT: %float.make_type.loc2_27: init type = call constants.%Float(%int_64.loc2_27) [template = f64] // CHECK:STDOUT: %.loc2_27.1: type = value_of_initializer %float.make_type.loc2_27 [template = f64] // CHECK:STDOUT: %.loc2_27.2: type = converted %float.make_type.loc2_27, %.loc2_27.1 [template = f64] // CHECK:STDOUT: %a.param: f64 = value_param runtime_param0 +// CHECK:STDOUT: %.loc2_11.3: type = splice_block %.loc2_11.2 [template = f64] { +// CHECK:STDOUT: %int_64.loc2_11: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc2_11: init type = call constants.%Float(%int_64.loc2_11) [template = f64] +// CHECK:STDOUT: %.loc2_11.1: type = value_of_initializer %float.make_type.loc2_11 [template = f64] +// CHECK:STDOUT: %.loc2_11.2: type = converted %float.make_type.loc2_11, %.loc2_11.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %b.param: f64 = value_param runtime_param1 +// CHECK:STDOUT: %.loc2_19.3: type = splice_block %.loc2_19.2 [template = f64] { +// CHECK:STDOUT: %int_64.loc2_19: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc2_19: init type = call constants.%Float(%int_64.loc2_19) [template = f64] +// CHECK:STDOUT: %.loc2_19.1: type = value_of_initializer %float.make_type.loc2_19 [template = f64] +// CHECK:STDOUT: %.loc2_19.2: type = converted %float.make_type.loc2_19, %.loc2_19.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref f64 = out_param runtime_param2 // CHECK:STDOUT: %return: ref f64 = return_slot %return.param @@ -116,29 +120,29 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %return.patt: f64 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: f64 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_64.loc4_19: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc4_19: init type = call constants.%Float(%int_64.loc4_19) [template = f64] -// CHECK:STDOUT: %.loc4_19.1: type = value_of_initializer %float.make_type.loc4_19 [template = f64] -// CHECK:STDOUT: %.loc4_19.2: type = converted %float.make_type.loc4_19, %.loc4_19.1 [template = f64] -// CHECK:STDOUT: %int_64.loc4_27: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc4_27: init type = call constants.%Float(%int_64.loc4_27) [template = f64] -// CHECK:STDOUT: %.loc4_27.1: type = value_of_initializer %float.make_type.loc4_27 [template = f64] -// CHECK:STDOUT: %.loc4_27.2: type = converted %float.make_type.loc4_27, %.loc4_27.1 [template = f64] // CHECK:STDOUT: %int_64.loc4_35: Core.IntLiteral = int_value 64 [template = constants.%int_64] // CHECK:STDOUT: %float.make_type.loc4_35: init type = call constants.%Float(%int_64.loc4_35) [template = f64] // CHECK:STDOUT: %.loc4_35.1: type = value_of_initializer %float.make_type.loc4_35 [template = f64] // CHECK:STDOUT: %.loc4_35.2: type = converted %float.make_type.loc4_35, %.loc4_35.1 [template = f64] // CHECK:STDOUT: %a.param: f64 = value_param runtime_param0 +// CHECK:STDOUT: %.loc4_19.3: type = splice_block %.loc4_19.2 [template = f64] { +// CHECK:STDOUT: %int_64.loc4_19: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc4_19: init type = call constants.%Float(%int_64.loc4_19) [template = f64] +// CHECK:STDOUT: %.loc4_19.1: type = value_of_initializer %float.make_type.loc4_19 [template = f64] +// CHECK:STDOUT: %.loc4_19.2: type = converted %float.make_type.loc4_19, %.loc4_19.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %b.param: f64 = value_param runtime_param1 +// CHECK:STDOUT: %.loc4_27.3: type = splice_block %.loc4_27.2 [template = f64] { +// CHECK:STDOUT: %int_64.loc4_27: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc4_27: init type = call constants.%Float(%int_64.loc4_27) [template = f64] +// CHECK:STDOUT: %.loc4_27.1: type = value_of_initializer %float.make_type.loc4_27 [template = f64] +// CHECK:STDOUT: %.loc4_27.2: type = converted %float.make_type.loc4_27, %.loc4_27.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref f64 = out_param runtime_param2 // CHECK:STDOUT: %return: ref f64 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type: init type = call constants.%Float(%int_64) [template = f64] -// CHECK:STDOUT: %.loc8_8.1: type = value_of_initializer %float.make_type [template = f64] -// CHECK:STDOUT: %.loc8_8.2: type = converted %float.make_type, %.loc8_8.1 [template = f64] // CHECK:STDOUT: %x.var: ref f64 = var x // CHECK:STDOUT: %x: ref f64 = bind_name x, %x.var // CHECK:STDOUT: } @@ -217,15 +221,17 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %return.patt: f64 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: f64 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_64.loc8_14: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc8_14: init type = call constants.%Float(%int_64.loc8_14) [template = f64] -// CHECK:STDOUT: %.loc8_14.1: type = value_of_initializer %float.make_type.loc8_14 [template = f64] -// CHECK:STDOUT: %.loc8_14.2: type = converted %float.make_type.loc8_14, %.loc8_14.1 [template = f64] // CHECK:STDOUT: %int_64.loc8_22: Core.IntLiteral = int_value 64 [template = constants.%int_64] // CHECK:STDOUT: %float.make_type.loc8_22: init type = call constants.%Float(%int_64.loc8_22) [template = f64] // CHECK:STDOUT: %.loc8_22.1: type = value_of_initializer %float.make_type.loc8_22 [template = f64] // CHECK:STDOUT: %.loc8_22.2: type = converted %float.make_type.loc8_22, %.loc8_22.1 [template = f64] // CHECK:STDOUT: %a.param: f64 = value_param runtime_param0 +// CHECK:STDOUT: %.loc8_14.3: type = splice_block %.loc8_14.2 [template = f64] { +// CHECK:STDOUT: %int_64.loc8_14: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc8_14: init type = call constants.%Float(%int_64.loc8_14) [template = f64] +// CHECK:STDOUT: %.loc8_14.1: type = value_of_initializer %float.make_type.loc8_14 [template = f64] +// CHECK:STDOUT: %.loc8_14.2: type = converted %float.make_type.loc8_14, %.loc8_14.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref f64 = out_param runtime_param1 // CHECK:STDOUT: %return: ref f64 = return_slot %return.param @@ -240,27 +246,33 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %return.patt: f64 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: f64 = out_param_pattern %return.patt, runtime_param3 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_64.loc13_15: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc13_15: init type = call constants.%Float(%int_64.loc13_15) [template = f64] -// CHECK:STDOUT: %.loc13_15.1: type = value_of_initializer %float.make_type.loc13_15 [template = f64] -// CHECK:STDOUT: %.loc13_15.2: type = converted %float.make_type.loc13_15, %.loc13_15.1 [template = f64] -// CHECK:STDOUT: %int_64.loc13_23: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc13_23: init type = call constants.%Float(%int_64.loc13_23) [template = f64] -// CHECK:STDOUT: %.loc13_23.1: type = value_of_initializer %float.make_type.loc13_23 [template = f64] -// CHECK:STDOUT: %.loc13_23.2: type = converted %float.make_type.loc13_23, %.loc13_23.1 [template = f64] -// CHECK:STDOUT: %int_64.loc13_31: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc13_31: init type = call constants.%Float(%int_64.loc13_31) [template = f64] -// CHECK:STDOUT: %.loc13_31.1: type = value_of_initializer %float.make_type.loc13_31 [template = f64] -// CHECK:STDOUT: %.loc13_31.2: type = converted %float.make_type.loc13_31, %.loc13_31.1 [template = f64] // CHECK:STDOUT: %int_64.loc13_39: Core.IntLiteral = int_value 64 [template = constants.%int_64] // CHECK:STDOUT: %float.make_type.loc13_39: init type = call constants.%Float(%int_64.loc13_39) [template = f64] // CHECK:STDOUT: %.loc13_39.1: type = value_of_initializer %float.make_type.loc13_39 [template = f64] // CHECK:STDOUT: %.loc13_39.2: type = converted %float.make_type.loc13_39, %.loc13_39.1 [template = f64] // CHECK:STDOUT: %a.param: f64 = value_param runtime_param0 +// CHECK:STDOUT: %.loc13_15.3: type = splice_block %.loc13_15.2 [template = f64] { +// CHECK:STDOUT: %int_64.loc13_15: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc13_15: init type = call constants.%Float(%int_64.loc13_15) [template = f64] +// CHECK:STDOUT: %.loc13_15.1: type = value_of_initializer %float.make_type.loc13_15 [template = f64] +// CHECK:STDOUT: %.loc13_15.2: type = converted %float.make_type.loc13_15, %.loc13_15.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %b.param: f64 = value_param runtime_param1 +// CHECK:STDOUT: %.loc13_23.3: type = splice_block %.loc13_23.2 [template = f64] { +// CHECK:STDOUT: %int_64.loc13_23: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc13_23: init type = call constants.%Float(%int_64.loc13_23) [template = f64] +// CHECK:STDOUT: %.loc13_23.1: type = value_of_initializer %float.make_type.loc13_23 [template = f64] +// CHECK:STDOUT: %.loc13_23.2: type = converted %float.make_type.loc13_23, %.loc13_23.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %c.param: f64 = value_param runtime_param2 +// CHECK:STDOUT: %.loc13_31.3: type = splice_block %.loc13_31.2 [template = f64] { +// CHECK:STDOUT: %int_64.loc13_31: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc13_31: init type = call constants.%Float(%int_64.loc13_31) [template = f64] +// CHECK:STDOUT: %.loc13_31.1: type = value_of_initializer %float.make_type.loc13_31 [template = f64] +// CHECK:STDOUT: %.loc13_31.2: type = converted %float.make_type.loc13_31, %.loc13_31.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %c: f64 = bind_name c, %c.param // CHECK:STDOUT: %return.param: ref f64 = out_param runtime_param3 // CHECK:STDOUT: %return: ref f64 = return_slot %return.param @@ -273,20 +285,24 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %return.patt: bool = return_slot_pattern // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_64.loc17_21: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc17_21: init type = call constants.%Float(%int_64.loc17_21) [template = f64] -// CHECK:STDOUT: %.loc17_21.1: type = value_of_initializer %float.make_type.loc17_21 [template = f64] -// CHECK:STDOUT: %.loc17_21.2: type = converted %float.make_type.loc17_21, %.loc17_21.1 [template = f64] -// CHECK:STDOUT: %int_64.loc17_29: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc17_29: init type = call constants.%Float(%int_64.loc17_29) [template = f64] -// CHECK:STDOUT: %.loc17_29.1: type = value_of_initializer %float.make_type.loc17_29 [template = f64] -// CHECK:STDOUT: %.loc17_29.2: type = converted %float.make_type.loc17_29, %.loc17_29.1 [template = f64] // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc17_37.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc17_37.2: type = converted %bool.make_type, %.loc17_37.1 [template = bool] // CHECK:STDOUT: %a.param: f64 = value_param runtime_param0 +// CHECK:STDOUT: %.loc17_21.3: type = splice_block %.loc17_21.2 [template = f64] { +// CHECK:STDOUT: %int_64.loc17_21: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc17_21: init type = call constants.%Float(%int_64.loc17_21) [template = f64] +// CHECK:STDOUT: %.loc17_21.1: type = value_of_initializer %float.make_type.loc17_21 [template = f64] +// CHECK:STDOUT: %.loc17_21.2: type = converted %float.make_type.loc17_21, %.loc17_21.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %b.param: f64 = value_param runtime_param1 +// CHECK:STDOUT: %.loc17_29.3: type = splice_block %.loc17_29.2 [template = f64] { +// CHECK:STDOUT: %int_64.loc17_29: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc17_29: init type = call constants.%Float(%int_64.loc17_29) [template = f64] +// CHECK:STDOUT: %.loc17_29.1: type = value_of_initializer %float.make_type.loc17_29 [template = f64] +// CHECK:STDOUT: %.loc17_29.2: type = converted %float.make_type.loc17_29, %.loc17_29.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param @@ -299,21 +315,25 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %return.patt: f64 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: f64 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_64.loc18_17: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc18_17: init type = call constants.%Float(%int_64.loc18_17) [template = f64] -// CHECK:STDOUT: %.loc18_17.1: type = value_of_initializer %float.make_type.loc18_17 [template = f64] -// CHECK:STDOUT: %.loc18_17.2: type = converted %float.make_type.loc18_17, %.loc18_17.1 [template = f64] -// CHECK:STDOUT: %int_64.loc18_25: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc18_25: init type = call constants.%Float(%int_64.loc18_25) [template = f64] -// CHECK:STDOUT: %.loc18_25.1: type = value_of_initializer %float.make_type.loc18_25 [template = f64] -// CHECK:STDOUT: %.loc18_25.2: type = converted %float.make_type.loc18_25, %.loc18_25.1 [template = f64] // CHECK:STDOUT: %int_64.loc18_33: Core.IntLiteral = int_value 64 [template = constants.%int_64] // CHECK:STDOUT: %float.make_type.loc18_33: init type = call constants.%Float(%int_64.loc18_33) [template = f64] // CHECK:STDOUT: %.loc18_33.1: type = value_of_initializer %float.make_type.loc18_33 [template = f64] // CHECK:STDOUT: %.loc18_33.2: type = converted %float.make_type.loc18_33, %.loc18_33.1 [template = f64] // CHECK:STDOUT: %a.param: f64 = value_param runtime_param0 +// CHECK:STDOUT: %.loc18_17.3: type = splice_block %.loc18_17.2 [template = f64] { +// CHECK:STDOUT: %int_64.loc18_17: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc18_17: init type = call constants.%Float(%int_64.loc18_17) [template = f64] +// CHECK:STDOUT: %.loc18_17.1: type = value_of_initializer %float.make_type.loc18_17 [template = f64] +// CHECK:STDOUT: %.loc18_17.2: type = converted %float.make_type.loc18_17, %.loc18_17.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %b.param: f64 = value_param runtime_param1 +// CHECK:STDOUT: %.loc18_25.3: type = splice_block %.loc18_25.2 [template = f64] { +// CHECK:STDOUT: %int_64.loc18_25: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc18_25: init type = call constants.%Float(%int_64.loc18_25) [template = f64] +// CHECK:STDOUT: %.loc18_25.1: type = value_of_initializer %float.make_type.loc18_25 [template = f64] +// CHECK:STDOUT: %.loc18_25.2: type = converted %float.make_type.loc18_25, %.loc18_25.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref f64 = out_param runtime_param2 // CHECK:STDOUT: %return: ref f64 = return_slot %return.param @@ -324,15 +344,17 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %return.patt: f64 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: f64 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_64.loc20_25: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc20_25: init type = call constants.%Float(%int_64.loc20_25) [template = f64] -// CHECK:STDOUT: %.loc20_25.1: type = value_of_initializer %float.make_type.loc20_25 [template = f64] -// CHECK:STDOUT: %.loc20_25.2: type = converted %float.make_type.loc20_25, %.loc20_25.1 [template = f64] // CHECK:STDOUT: %int_64.loc20_33: Core.IntLiteral = int_value 64 [template = constants.%int_64] // CHECK:STDOUT: %float.make_type.loc20_33: init type = call constants.%Float(%int_64.loc20_33) [template = f64] // CHECK:STDOUT: %.loc20_33.1: type = value_of_initializer %float.make_type.loc20_33 [template = f64] // CHECK:STDOUT: %.loc20_33.2: type = converted %float.make_type.loc20_33, %.loc20_33.1 [template = f64] // CHECK:STDOUT: %a.param: f64 = value_param runtime_param0 +// CHECK:STDOUT: %.loc20_25.3: type = splice_block %.loc20_25.2 [template = f64] { +// CHECK:STDOUT: %int_64.loc20_25: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc20_25: init type = call constants.%Float(%int_64.loc20_25) [template = f64] +// CHECK:STDOUT: %.loc20_25.1: type = value_of_initializer %float.make_type.loc20_25 [template = f64] +// CHECK:STDOUT: %.loc20_25.2: type = converted %float.make_type.loc20_25, %.loc20_25.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref f64 = out_param runtime_param1 // CHECK:STDOUT: %return: ref f64 = return_slot %return.param @@ -347,27 +369,33 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %return.patt: f64 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: f64 = out_param_pattern %return.patt, runtime_param3 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_64.loc24_26: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc24_26: init type = call constants.%Float(%int_64.loc24_26) [template = f64] -// CHECK:STDOUT: %.loc24_26.1: type = value_of_initializer %float.make_type.loc24_26 [template = f64] -// CHECK:STDOUT: %.loc24_26.2: type = converted %float.make_type.loc24_26, %.loc24_26.1 [template = f64] -// CHECK:STDOUT: %int_64.loc24_34: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc24_34: init type = call constants.%Float(%int_64.loc24_34) [template = f64] -// CHECK:STDOUT: %.loc24_34.1: type = value_of_initializer %float.make_type.loc24_34 [template = f64] -// CHECK:STDOUT: %.loc24_34.2: type = converted %float.make_type.loc24_34, %.loc24_34.1 [template = f64] -// CHECK:STDOUT: %int_64.loc24_42: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc24_42: init type = call constants.%Float(%int_64.loc24_42) [template = f64] -// CHECK:STDOUT: %.loc24_42.1: type = value_of_initializer %float.make_type.loc24_42 [template = f64] -// CHECK:STDOUT: %.loc24_42.2: type = converted %float.make_type.loc24_42, %.loc24_42.1 [template = f64] // CHECK:STDOUT: %int_64.loc24_50: Core.IntLiteral = int_value 64 [template = constants.%int_64] // CHECK:STDOUT: %float.make_type.loc24_50: init type = call constants.%Float(%int_64.loc24_50) [template = f64] // CHECK:STDOUT: %.loc24_50.1: type = value_of_initializer %float.make_type.loc24_50 [template = f64] // CHECK:STDOUT: %.loc24_50.2: type = converted %float.make_type.loc24_50, %.loc24_50.1 [template = f64] // CHECK:STDOUT: %a.param: f64 = value_param runtime_param0 +// CHECK:STDOUT: %.loc24_26.3: type = splice_block %.loc24_26.2 [template = f64] { +// CHECK:STDOUT: %int_64.loc24_26: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc24_26: init type = call constants.%Float(%int_64.loc24_26) [template = f64] +// CHECK:STDOUT: %.loc24_26.1: type = value_of_initializer %float.make_type.loc24_26 [template = f64] +// CHECK:STDOUT: %.loc24_26.2: type = converted %float.make_type.loc24_26, %.loc24_26.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %b.param: f64 = value_param runtime_param1 +// CHECK:STDOUT: %.loc24_34.3: type = splice_block %.loc24_34.2 [template = f64] { +// CHECK:STDOUT: %int_64.loc24_34: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc24_34: init type = call constants.%Float(%int_64.loc24_34) [template = f64] +// CHECK:STDOUT: %.loc24_34.1: type = value_of_initializer %float.make_type.loc24_34 [template = f64] +// CHECK:STDOUT: %.loc24_34.2: type = converted %float.make_type.loc24_34, %.loc24_34.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %c.param: f64 = value_param runtime_param2 +// CHECK:STDOUT: %.loc24_42.3: type = splice_block %.loc24_42.2 [template = f64] { +// CHECK:STDOUT: %int_64.loc24_42: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc24_42: init type = call constants.%Float(%int_64.loc24_42) [template = f64] +// CHECK:STDOUT: %.loc24_42.1: type = value_of_initializer %float.make_type.loc24_42 [template = f64] +// CHECK:STDOUT: %.loc24_42.2: type = converted %float.make_type.loc24_42, %.loc24_42.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %c: f64 = bind_name c, %c.param // CHECK:STDOUT: %return.param: ref f64 = out_param runtime_param3 // CHECK:STDOUT: %return: ref f64 = return_slot %return.param @@ -380,20 +408,24 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %return.patt: bool = return_slot_pattern // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_64.loc28_32: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc28_32: init type = call constants.%Float(%int_64.loc28_32) [template = f64] -// CHECK:STDOUT: %.loc28_32.1: type = value_of_initializer %float.make_type.loc28_32 [template = f64] -// CHECK:STDOUT: %.loc28_32.2: type = converted %float.make_type.loc28_32, %.loc28_32.1 [template = f64] -// CHECK:STDOUT: %int_64.loc28_40: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc28_40: init type = call constants.%Float(%int_64.loc28_40) [template = f64] -// CHECK:STDOUT: %.loc28_40.1: type = value_of_initializer %float.make_type.loc28_40 [template = f64] -// CHECK:STDOUT: %.loc28_40.2: type = converted %float.make_type.loc28_40, %.loc28_40.1 [template = f64] // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc28_48.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc28_48.2: type = converted %bool.make_type, %.loc28_48.1 [template = bool] // CHECK:STDOUT: %a.param: f64 = value_param runtime_param0 +// CHECK:STDOUT: %.loc28_32.3: type = splice_block %.loc28_32.2 [template = f64] { +// CHECK:STDOUT: %int_64.loc28_32: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc28_32: init type = call constants.%Float(%int_64.loc28_32) [template = f64] +// CHECK:STDOUT: %.loc28_32.1: type = value_of_initializer %float.make_type.loc28_32 [template = f64] +// CHECK:STDOUT: %.loc28_32.2: type = converted %float.make_type.loc28_32, %.loc28_32.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %b.param: f64 = value_param runtime_param1 +// CHECK:STDOUT: %.loc28_40.3: type = splice_block %.loc28_40.2 [template = f64] { +// CHECK:STDOUT: %int_64.loc28_40: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc28_40: init type = call constants.%Float(%int_64.loc28_40) [template = f64] +// CHECK:STDOUT: %.loc28_40.1: type = value_of_initializer %float.make_type.loc28_40 [template = f64] +// CHECK:STDOUT: %.loc28_40.2: type = converted %float.make_type.loc28_40, %.loc28_40.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param diff --git a/toolchain/check/testdata/builtins/int/and.carbon b/toolchain/check/testdata/builtins/int/and.carbon index be154cb47204f..11a19c0b6943a 100644 --- a/toolchain/check/testdata/builtins/int/and.carbon +++ b/toolchain/check/testdata/builtins/int/and.carbon @@ -26,25 +26,6 @@ fn RuntimeCall(a: i32, b: i32) -> i32 { // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %And.type: type = fn_type @And [template] // CHECK:STDOUT: %And: %And.type = struct_value () [template] -// CHECK:STDOUT: %int_12.1: Core.IntLiteral = int_value 12 [template] -// CHECK:STDOUT: %int_10.1: Core.IntLiteral = int_value 10 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_12.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_12.2: %i32 = int_value 12 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_10.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_10.2: %i32 = int_value 10 [template] -// CHECK:STDOUT: %int_8.1: %i32 = int_value 8 [template] -// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.3, @impl.2(%int_32) [template] -// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [template] -// CHECK:STDOUT: %interface.6: = interface_witness (%Convert.11) [template] -// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_8.1, %Convert.11 [template] -// CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.3(%int_32) [template] // CHECK:STDOUT: %int_8.2: Core.IntLiteral = int_value 8 [template] // CHECK:STDOUT: %array_type: type = array_type %int_8.2, %i32 [template] // CHECK:STDOUT: %ptr: type = ptr_type %array_type [template] @@ -78,53 +59,25 @@ fn RuntimeCall(a: i32, b: i32) -> i32 { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc2_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc2_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc2_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc2_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc2_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc2_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc2_11: type = splice_block %i32.loc2_11 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc2_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc2_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %.loc2_19: type = splice_block %i32.loc2_19 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc2_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc2_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %int_32.loc4: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc4: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %And.ref: %And.type = name_ref And, %And.decl [template = constants.%And] -// CHECK:STDOUT: %int_12: Core.IntLiteral = int_value 12 [template = constants.%int_12.1] -// CHECK:STDOUT: %int_10: Core.IntLiteral = int_value 10 [template = constants.%int_10.1] -// CHECK:STDOUT: %impl.elem0.loc4_20: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc4_20: = bound_method %int_12, %impl.elem0.loc4_20 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc4_20: = specific_function %Convert.bound.loc4_20, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc4_20: init %i32 = call %Convert.specific_fn.loc4_20(%int_12) [template = constants.%int_12.2] -// CHECK:STDOUT: %.loc4_20.1: %i32 = value_of_initializer %int.convert_checked.loc4_20 [template = constants.%int_12.2] -// CHECK:STDOUT: %.loc4_20.2: %i32 = converted %int_12, %.loc4_20.1 [template = constants.%int_12.2] -// CHECK:STDOUT: %impl.elem0.loc4_24: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc4_24: = bound_method %int_10, %impl.elem0.loc4_24 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc4_24: = specific_function %Convert.bound.loc4_24, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] -// CHECK:STDOUT: %int.convert_checked.loc4_24: init %i32 = call %Convert.specific_fn.loc4_24(%int_10) [template = constants.%int_10.2] -// CHECK:STDOUT: %.loc4_24.1: %i32 = value_of_initializer %int.convert_checked.loc4_24 [template = constants.%int_10.2] -// CHECK:STDOUT: %.loc4_24.2: %i32 = converted %int_10, %.loc4_24.1 [template = constants.%int_10.2] -// CHECK:STDOUT: %int.and: init %i32 = call %And.ref(%.loc4_20.2, %.loc4_24.2) [template = constants.%int_8.1] -// CHECK:STDOUT: %impl.elem0.loc4_26: %Convert.type.5 = interface_witness_access constants.%interface.6, element0 [template = constants.%Convert.11] -// CHECK:STDOUT: %Convert.bound.loc4_26: = bound_method %int.and, %impl.elem0.loc4_26 [template = constants.%Convert.bound.3] -// CHECK:STDOUT: %Convert.specific_fn.loc4_26: = specific_function %Convert.bound.loc4_26, @Convert.3(constants.%int_32) [template = constants.%Convert.specific_fn.3] -// CHECK:STDOUT: %.loc4_26.1: %i32 = value_of_initializer %int.and [template = constants.%int_8.1] -// CHECK:STDOUT: %.loc4_26.2: %i32 = converted %int.and, %.loc4_26.1 [template = constants.%int_8.1] -// CHECK:STDOUT: %int.convert_checked.loc4_26: init Core.IntLiteral = call %Convert.specific_fn.loc4_26(%.loc4_26.2) [template = constants.%int_8.2] -// CHECK:STDOUT: %.loc4_26.3: Core.IntLiteral = value_of_initializer %int.convert_checked.loc4_26 [template = constants.%int_8.2] -// CHECK:STDOUT: %.loc4_26.4: Core.IntLiteral = converted %int.and, %.loc4_26.3 [template = constants.%int_8.2] -// CHECK:STDOUT: %array_type.loc4: type = array_type %.loc4_26.4, %i32 [template = constants.%array_type] // CHECK:STDOUT: %arr.var: ref %array_type = var arr // CHECK:STDOUT: %arr: ref %array_type = bind_name arr, %arr.var -// CHECK:STDOUT: %int_32.loc5: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc5: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_8: Core.IntLiteral = int_value 8 [template = constants.%int_8.2] -// CHECK:STDOUT: %array_type.loc5: type = array_type %int_8, %i32 [template = constants.%array_type] -// CHECK:STDOUT: %ptr: type = ptr_type %array_type [template = constants.%ptr] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { // CHECK:STDOUT: %a.patt: %i32 = binding_pattern a // CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 @@ -133,15 +86,19 @@ fn RuntimeCall(a: i32, b: i32) -> i32 { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc7_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc7_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc7_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc7_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc7_35: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc7_35: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc7_19: type = splice_block %i32.loc7_19 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc7_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc7_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %.loc7_27: type = splice_block %i32.loc7_27 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc7_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc7_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param diff --git a/toolchain/check/testdata/builtins/int/complement.carbon b/toolchain/check/testdata/builtins/int/complement.carbon index 7ab8b08777fc6..ee858a1a98150 100644 --- a/toolchain/check/testdata/builtins/int/complement.carbon +++ b/toolchain/check/testdata/builtins/int/complement.carbon @@ -29,26 +29,6 @@ fn RuntimeCall(a: i32) -> i32 { // CHECK:STDOUT: %Complement: %Complement.type = struct_value () [template] // CHECK:STDOUT: %And.type: type = fn_type @And [template] // CHECK:STDOUT: %And: %And.type = struct_value () [template] -// CHECK:STDOUT: %int_1193046.1: Core.IntLiteral = int_value 1193046 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1193046.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_1193046.2: %i32 = int_value 1193046 [template] -// CHECK:STDOUT: %int_-1193047: %i32 = int_value -1193047 [template] -// CHECK:STDOUT: %int_16777215.1: Core.IntLiteral = int_value 16777215 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_16777215.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_16777215.2: %i32 = int_value 16777215 [template] -// CHECK:STDOUT: %int_15584169.1: %i32 = int_value 15584169 [template] -// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.3, @impl.2(%int_32) [template] -// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [template] -// CHECK:STDOUT: %interface.6: = interface_witness (%Convert.11) [template] -// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_15584169.1, %Convert.11 [template] -// CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.3(%int_32) [template] // CHECK:STDOUT: %int_15584169.2: Core.IntLiteral = int_value 15584169 [template] // CHECK:STDOUT: %array_type: type = array_type %int_15584169.2, %i32 [template] // CHECK:STDOUT: %ptr: type = ptr_type %array_type [template] @@ -81,11 +61,13 @@ fn RuntimeCall(a: i32) -> i32 { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc2_18: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc2_18: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc2_26: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc2_26: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc2: type = splice_block %i32.loc2_18 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc2_18: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc2_18: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -98,68 +80,38 @@ fn RuntimeCall(a: i32) -> i32 { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc3_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc3_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc3_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc3_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc3_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc3_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc3_11: type = splice_block %i32.loc3_11 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc3_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc3_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %.loc3_19: type = splice_block %i32.loc3_19 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc3_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc3_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %int_32.loc5: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc5: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %And.ref: %And.type = name_ref And, %And.decl [template = constants.%And] -// CHECK:STDOUT: %Complement.ref: %Complement.type = name_ref Complement, %Complement.decl [template = constants.%Complement] -// CHECK:STDOUT: %int_1193046: Core.IntLiteral = int_value 1193046 [template = constants.%int_1193046.1] -// CHECK:STDOUT: %impl.elem0.loc5_31: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc5_31: = bound_method %int_1193046, %impl.elem0.loc5_31 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc5_31: = specific_function %Convert.bound.loc5_31, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc5_31: init %i32 = call %Convert.specific_fn.loc5_31(%int_1193046) [template = constants.%int_1193046.2] -// CHECK:STDOUT: %.loc5_31.1: %i32 = value_of_initializer %int.convert_checked.loc5_31 [template = constants.%int_1193046.2] -// CHECK:STDOUT: %.loc5_31.2: %i32 = converted %int_1193046, %.loc5_31.1 [template = constants.%int_1193046.2] -// CHECK:STDOUT: %int.complement: init %i32 = call %Complement.ref(%.loc5_31.2) [template = constants.%int_-1193047] -// CHECK:STDOUT: %int_16777215: Core.IntLiteral = int_value 16777215 [template = constants.%int_16777215.1] -// CHECK:STDOUT: %.loc5_39.1: %i32 = value_of_initializer %int.complement [template = constants.%int_-1193047] -// CHECK:STDOUT: %.loc5_39.2: %i32 = converted %int.complement, %.loc5_39.1 [template = constants.%int_-1193047] -// CHECK:STDOUT: %impl.elem0.loc5_42: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc5_42: = bound_method %int_16777215, %impl.elem0.loc5_42 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc5_42: = specific_function %Convert.bound.loc5_42, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] -// CHECK:STDOUT: %int.convert_checked.loc5_42: init %i32 = call %Convert.specific_fn.loc5_42(%int_16777215) [template = constants.%int_16777215.2] -// CHECK:STDOUT: %.loc5_42.1: %i32 = value_of_initializer %int.convert_checked.loc5_42 [template = constants.%int_16777215.2] -// CHECK:STDOUT: %.loc5_42.2: %i32 = converted %int_16777215, %.loc5_42.1 [template = constants.%int_16777215.2] -// CHECK:STDOUT: %int.and: init %i32 = call %And.ref(%.loc5_39.2, %.loc5_42.2) [template = constants.%int_15584169.1] -// CHECK:STDOUT: %impl.elem0.loc5_50: %Convert.type.5 = interface_witness_access constants.%interface.6, element0 [template = constants.%Convert.11] -// CHECK:STDOUT: %Convert.bound.loc5_50: = bound_method %int.and, %impl.elem0.loc5_50 [template = constants.%Convert.bound.3] -// CHECK:STDOUT: %Convert.specific_fn.loc5_50: = specific_function %Convert.bound.loc5_50, @Convert.3(constants.%int_32) [template = constants.%Convert.specific_fn.3] -// CHECK:STDOUT: %.loc5_50.1: %i32 = value_of_initializer %int.and [template = constants.%int_15584169.1] -// CHECK:STDOUT: %.loc5_50.2: %i32 = converted %int.and, %.loc5_50.1 [template = constants.%int_15584169.1] -// CHECK:STDOUT: %int.convert_checked.loc5_50: init Core.IntLiteral = call %Convert.specific_fn.loc5_50(%.loc5_50.2) [template = constants.%int_15584169.2] -// CHECK:STDOUT: %.loc5_50.3: Core.IntLiteral = value_of_initializer %int.convert_checked.loc5_50 [template = constants.%int_15584169.2] -// CHECK:STDOUT: %.loc5_50.4: Core.IntLiteral = converted %int.and, %.loc5_50.3 [template = constants.%int_15584169.2] -// CHECK:STDOUT: %array_type.loc5: type = array_type %.loc5_50.4, %i32 [template = constants.%array_type] // CHECK:STDOUT: %arr.var: ref %array_type = var arr // CHECK:STDOUT: %arr: ref %array_type = bind_name arr, %arr.var -// CHECK:STDOUT: %int_32.loc6: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc6: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_15584169: Core.IntLiteral = int_value 15584169 [template = constants.%int_15584169.2] -// CHECK:STDOUT: %array_type.loc6: type = array_type %int_15584169, %i32 [template = constants.%array_type] -// CHECK:STDOUT: %ptr: type = ptr_type %array_type [template = constants.%ptr] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { // CHECK:STDOUT: %a.patt: %i32 = binding_pattern a // CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc8_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc8_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc8_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc8_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc8: type = splice_block %i32.loc8_19 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc8_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc8_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param diff --git a/toolchain/check/testdata/builtins/int/convert_checked.carbon b/toolchain/check/testdata/builtins/int/convert_checked.carbon index 31a00ee65264f..c3e3d09f7e27c 100644 --- a/toolchain/check/testdata/builtins/int/convert_checked.carbon +++ b/toolchain/check/testdata/builtins/int/convert_checked.carbon @@ -345,11 +345,13 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc4_17: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc4_17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc4_25: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc4_25: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc4: type = splice_block %i32.loc4_17 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc4_17: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc4_17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -362,15 +364,19 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc5_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc5_14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc5_22: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc5_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc5_30: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc5_30: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc5_14: type = splice_block %i32.loc5_14 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc5_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc5_14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %.loc5_22: type = splice_block %i32.loc5_22 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc5_22: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc5_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -383,15 +389,19 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %return.patt: %u32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %u32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc6_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %u32.loc6_14: type = class_type @UInt, @UInt(constants.%int_32) [template = constants.%u32] -// CHECK:STDOUT: %int_32.loc6_22: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %u32.loc6_22: type = class_type @UInt, @UInt(constants.%int_32) [template = constants.%u32] // CHECK:STDOUT: %int_32.loc6_30: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %u32.loc6_30: type = class_type @UInt, @UInt(constants.%int_32) [template = constants.%u32] // CHECK:STDOUT: %a.param: %u32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc6_14: type = splice_block %u32.loc6_14 [template = constants.%u32] { +// CHECK:STDOUT: %int_32.loc6_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %u32.loc6_14: type = class_type @UInt, @UInt(constants.%int_32) [template = constants.%u32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %u32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %u32 = value_param runtime_param1 +// CHECK:STDOUT: %.loc6_22: type = splice_block %u32.loc6_22 [template = constants.%u32] { +// CHECK:STDOUT: %int_32.loc6_22: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %u32.loc6_22: type = class_type @UInt, @UInt(constants.%int_32) [template = constants.%u32] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: %u32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref %u32 = out_param runtime_param2 // CHECK:STDOUT: %return: ref %u32 = return_slot %return.param @@ -409,11 +419,13 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc10_20: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc10_20: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc10_28: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc10_28: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc10: type = splice_block %i32.loc10_20 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc10_20: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc10_20: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -424,11 +436,13 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %return.patt: %u32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %u32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc11_21: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc11_29: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %u32: type = class_type @UInt, @UInt(constants.%int_32) [template = constants.%u32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc11: type = splice_block %i32 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc11_21: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %u32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %u32 = return_slot %return.param @@ -439,11 +453,13 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc12_21: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %u32: type = class_type @UInt, @UInt(constants.%int_32) [template = constants.%u32] // CHECK:STDOUT: %int_32.loc12_29: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %u32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc12: type = splice_block %u32 [template = constants.%u32] { +// CHECK:STDOUT: %int_32.loc12_21: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %u32: type = class_type @UInt, @UInt(constants.%int_32) [template = constants.%u32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %u32 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -454,11 +470,13 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %return.patt: %u32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %u32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc13_22: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %u32.loc13_22: type = class_type @UInt, @UInt(constants.%int_32) [template = constants.%u32] // CHECK:STDOUT: %int_32.loc13_30: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %u32.loc13_30: type = class_type @UInt, @UInt(constants.%int_32) [template = constants.%u32] // CHECK:STDOUT: %a.param: %u32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc13: type = splice_block %u32.loc13_22 [template = constants.%u32] { +// CHECK:STDOUT: %int_32.loc13_22: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %u32.loc13_22: type = class_type @UInt, @UInt(constants.%int_32) [template = constants.%u32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %u32 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %u32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %u32 = return_slot %return.param @@ -469,15 +487,17 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %return.patt: Core.IntLiteral = return_slot_pattern // CHECK:STDOUT: %return.param_patt: Core.IntLiteral = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %IntLiteral.ref.loc14_30: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [template = constants.%IntLiteral] -// CHECK:STDOUT: %int_literal.make_type.loc14_41: init type = call %IntLiteral.ref.loc14_30() [template = Core.IntLiteral] -// CHECK:STDOUT: %.loc14_41.1: type = value_of_initializer %int_literal.make_type.loc14_41 [template = Core.IntLiteral] -// CHECK:STDOUT: %.loc14_41.2: type = converted %int_literal.make_type.loc14_41, %.loc14_41.1 [template = Core.IntLiteral] // CHECK:STDOUT: %IntLiteral.ref.loc14_47: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [template = constants.%IntLiteral] // CHECK:STDOUT: %int_literal.make_type.loc14_58: init type = call %IntLiteral.ref.loc14_47() [template = Core.IntLiteral] // CHECK:STDOUT: %.loc14_58.1: type = value_of_initializer %int_literal.make_type.loc14_58 [template = Core.IntLiteral] // CHECK:STDOUT: %.loc14_58.2: type = converted %int_literal.make_type.loc14_58, %.loc14_58.1 [template = Core.IntLiteral] // CHECK:STDOUT: %a.param: Core.IntLiteral = value_param runtime_param0 +// CHECK:STDOUT: %.loc14_41.3: type = splice_block %.loc14_41.2 [template = Core.IntLiteral] { +// CHECK:STDOUT: %IntLiteral.ref.loc14_30: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [template = constants.%IntLiteral] +// CHECK:STDOUT: %int_literal.make_type.loc14_41: init type = call %IntLiteral.ref.loc14_30() [template = Core.IntLiteral] +// CHECK:STDOUT: %.loc14_41.1: type = value_of_initializer %int_literal.make_type.loc14_41 [template = Core.IntLiteral] +// CHECK:STDOUT: %.loc14_41.2: type = converted %int_literal.make_type.loc14_41, %.loc14_41.1 [template = Core.IntLiteral] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: Core.IntLiteral = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref Core.IntLiteral = out_param runtime_param1 // CHECK:STDOUT: %return: ref Core.IntLiteral = return_slot %return.param @@ -488,11 +508,13 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %return.patt: %i16 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i16 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [template = constants.%int_16] // CHECK:STDOUT: %i16: type = class_type @Int, @Int(constants.%int_16) [template = constants.%i16] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc18: type = splice_block %i32 [template = constants.%i32] { +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %i16 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i16 = return_slot %return.param @@ -503,11 +525,13 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %return.patt: %u16 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %u16 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [template = constants.%int_16] // CHECK:STDOUT: %u16: type = class_type @UInt, @UInt(constants.%int_16) [template = constants.%u16] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc19: type = splice_block %i32 [template = constants.%i32] { +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %u16 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %u16 = return_slot %return.param @@ -518,11 +542,13 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %return.patt: %i16 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i16 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %u32: type = class_type @UInt, @UInt(constants.%int_32) [template = constants.%u32] // CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [template = constants.%int_16] // CHECK:STDOUT: %i16: type = class_type @Int, @Int(constants.%int_16) [template = constants.%i16] // CHECK:STDOUT: %a.param: %u32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc20: type = splice_block %u32 [template = constants.%u32] { +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %u32: type = class_type @UInt, @UInt(constants.%int_32) [template = constants.%u32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %u32 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %i16 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i16 = return_slot %return.param @@ -533,11 +559,13 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %return.patt: %u16 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %u16 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %u32: type = class_type @UInt, @UInt(constants.%int_32) [template = constants.%u32] // CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [template = constants.%int_16] // CHECK:STDOUT: %u16: type = class_type @UInt, @UInt(constants.%int_16) [template = constants.%u16] // CHECK:STDOUT: %a.param: %u32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc21: type = splice_block %u32 [template = constants.%u32] { +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %u32: type = class_type @UInt, @UInt(constants.%int_32) [template = constants.%u32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %u32 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %u16 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %u16 = return_slot %return.param @@ -548,13 +576,15 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %return.patt: %i16 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i16 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [template = constants.%IntLiteral] -// CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral] -// CHECK:STDOUT: %.loc22_36.1: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral] -// CHECK:STDOUT: %.loc22_36.2: type = converted %int_literal.make_type, %.loc22_36.1 [template = Core.IntLiteral] // CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [template = constants.%int_16] // CHECK:STDOUT: %i16: type = class_type @Int, @Int(constants.%int_16) [template = constants.%i16] // CHECK:STDOUT: %a.param: Core.IntLiteral = value_param runtime_param0 +// CHECK:STDOUT: %.loc22_36.3: type = splice_block %.loc22_36.2 [template = Core.IntLiteral] { +// CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [template = constants.%IntLiteral] +// CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral] +// CHECK:STDOUT: %.loc22_36.1: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral] +// CHECK:STDOUT: %.loc22_36.2: type = converted %int_literal.make_type, %.loc22_36.1 [template = Core.IntLiteral] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: Core.IntLiteral = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %i16 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i16 = return_slot %return.param @@ -565,13 +595,15 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %return.patt: %u16 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %u16 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [template = constants.%IntLiteral] -// CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral] -// CHECK:STDOUT: %.loc23_37.1: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral] -// CHECK:STDOUT: %.loc23_37.2: type = converted %int_literal.make_type, %.loc23_37.1 [template = Core.IntLiteral] // CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [template = constants.%int_16] // CHECK:STDOUT: %u16: type = class_type @UInt, @UInt(constants.%int_16) [template = constants.%u16] // CHECK:STDOUT: %a.param: Core.IntLiteral = value_param runtime_param0 +// CHECK:STDOUT: %.loc23_37.3: type = splice_block %.loc23_37.2 [template = Core.IntLiteral] { +// CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [template = constants.%IntLiteral] +// CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral] +// CHECK:STDOUT: %.loc23_37.1: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral] +// CHECK:STDOUT: %.loc23_37.2: type = converted %int_literal.make_type, %.loc23_37.1 [template = Core.IntLiteral] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: Core.IntLiteral = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %u16 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %u16 = return_slot %return.param @@ -582,11 +614,13 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %return.patt: %i64 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i64 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [template = constants.%int_64] // CHECK:STDOUT: %i64: type = class_type @Int, @Int(constants.%int_64) [template = constants.%i64] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc26: type = splice_block %i32 [template = constants.%i32] { +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %i64 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i64 = return_slot %return.param @@ -597,11 +631,13 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %return.patt: %u64 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %u64 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [template = constants.%int_64] // CHECK:STDOUT: %u64: type = class_type @UInt, @UInt(constants.%int_64) [template = constants.%u64] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc27: type = splice_block %i32 [template = constants.%i32] { +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %u64 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %u64 = return_slot %return.param @@ -612,11 +648,13 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %return.patt: %i64 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i64 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %u32: type = class_type @UInt, @UInt(constants.%int_32) [template = constants.%u32] // CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [template = constants.%int_64] // CHECK:STDOUT: %i64: type = class_type @Int, @Int(constants.%int_64) [template = constants.%i64] // CHECK:STDOUT: %a.param: %u32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc28: type = splice_block %u32 [template = constants.%u32] { +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %u32: type = class_type @UInt, @UInt(constants.%int_32) [template = constants.%u32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %u32 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %i64 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i64 = return_slot %return.param @@ -627,11 +665,13 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %return.patt: %u64 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %u64 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %u32: type = class_type @UInt, @UInt(constants.%int_32) [template = constants.%u32] // CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [template = constants.%int_64] // CHECK:STDOUT: %u64: type = class_type @UInt, @UInt(constants.%int_64) [template = constants.%u64] // CHECK:STDOUT: %a.param: %u32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc29: type = splice_block %u32 [template = constants.%u32] { +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %u32: type = class_type @UInt, @UInt(constants.%int_32) [template = constants.%u32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %u32 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %u64 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %u64 = return_slot %return.param @@ -642,13 +682,15 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %return.patt: Core.IntLiteral = return_slot_pattern // CHECK:STDOUT: %return.param_patt: Core.IntLiteral = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [template = constants.%IntLiteral] // CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral] // CHECK:STDOUT: %.loc30_44.1: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral] // CHECK:STDOUT: %.loc30_44.2: type = converted %int_literal.make_type, %.loc30_44.1 [template = Core.IntLiteral] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc30_25: type = splice_block %i32 [template = constants.%i32] { +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref Core.IntLiteral = out_param runtime_param1 // CHECK:STDOUT: %return: ref Core.IntLiteral = return_slot %return.param @@ -659,13 +701,15 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %return.patt: Core.IntLiteral = return_slot_pattern // CHECK:STDOUT: %return.param_patt: Core.IntLiteral = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %u32: type = class_type @UInt, @UInt(constants.%int_32) [template = constants.%u32] // CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [template = constants.%IntLiteral] // CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral] // CHECK:STDOUT: %.loc31_46.1: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral] // CHECK:STDOUT: %.loc31_46.2: type = converted %int_literal.make_type, %.loc31_46.1 [template = Core.IntLiteral] // CHECK:STDOUT: %a.param: %u32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc31_27: type = splice_block %u32 [template = constants.%u32] { +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %u32: type = class_type @UInt, @UInt(constants.%int_32) [template = constants.%u32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %u32 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref Core.IntLiteral = out_param runtime_param1 // CHECK:STDOUT: %return: ref Core.IntLiteral = return_slot %return.param @@ -814,16 +858,6 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %int_32.loc5: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc5: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc6: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc6: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc7: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc7: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, imports.%import_ref.4 [template = constants.%IntLiteral] -// CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral] -// CHECK:STDOUT: %.loc8_19.1: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral] -// CHECK:STDOUT: %.loc8_19.2: type = converted %int_literal.make_type, %.loc8_19.1 [template = Core.IntLiteral] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32ToInt32(%a.param_patt: %i32) -> %i32 = "int.convert_checked" [from "int_ops.carbon"]; @@ -995,10 +1029,6 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %int_32.loc5: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %u32: type = class_type @UInt, @UInt(constants.%int_32) [template = constants.%u32] -// CHECK:STDOUT: %int_32.loc6: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32ToUint32(%a.param_patt: %i32) -> %u32 = "int.convert_checked" [from "int_ops.carbon"]; @@ -1167,30 +1197,6 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %int_16.loc5: Core.IntLiteral = int_value 16 [template = constants.%int_16] -// CHECK:STDOUT: %u16.loc5: type = class_type @UInt, @UInt(constants.%int_16) [template = constants.%u16] -// CHECK:STDOUT: %int_16.loc6: Core.IntLiteral = int_value 16 [template = constants.%int_16] -// CHECK:STDOUT: %u16.loc6: type = class_type @UInt, @UInt(constants.%int_16) [template = constants.%u16] -// CHECK:STDOUT: %int_16.loc8: Core.IntLiteral = int_value 16 [template = constants.%int_16] -// CHECK:STDOUT: %i16.loc8: type = class_type @Int, @Int(constants.%int_16) [template = constants.%i16] -// CHECK:STDOUT: %int_16.loc9: Core.IntLiteral = int_value 16 [template = constants.%int_16] -// CHECK:STDOUT: %i16.loc9: type = class_type @Int, @Int(constants.%int_16) [template = constants.%i16] -// CHECK:STDOUT: %int_16.loc11: Core.IntLiteral = int_value 16 [template = constants.%int_16] -// CHECK:STDOUT: %u16.loc11: type = class_type @UInt, @UInt(constants.%int_16) [template = constants.%u16] -// CHECK:STDOUT: %int_16.loc12: Core.IntLiteral = int_value 16 [template = constants.%int_16] -// CHECK:STDOUT: %u16.loc12: type = class_type @UInt, @UInt(constants.%int_16) [template = constants.%u16] -// CHECK:STDOUT: %int_16.loc14: Core.IntLiteral = int_value 16 [template = constants.%int_16] -// CHECK:STDOUT: %i16.loc14: type = class_type @Int, @Int(constants.%int_16) [template = constants.%i16] -// CHECK:STDOUT: %int_16.loc15: Core.IntLiteral = int_value 16 [template = constants.%int_16] -// CHECK:STDOUT: %i16.loc15: type = class_type @Int, @Int(constants.%int_16) [template = constants.%i16] -// CHECK:STDOUT: %int_16.loc17: Core.IntLiteral = int_value 16 [template = constants.%int_16] -// CHECK:STDOUT: %i16.loc17: type = class_type @Int, @Int(constants.%int_16) [template = constants.%i16] -// CHECK:STDOUT: %int_16.loc18: Core.IntLiteral = int_value 16 [template = constants.%int_16] -// CHECK:STDOUT: %i16.loc18: type = class_type @Int, @Int(constants.%int_16) [template = constants.%i16] -// CHECK:STDOUT: %int_16.loc20: Core.IntLiteral = int_value 16 [template = constants.%int_16] -// CHECK:STDOUT: %u16.loc20: type = class_type @UInt, @UInt(constants.%int_16) [template = constants.%u16] -// CHECK:STDOUT: %int_16.loc21: Core.IntLiteral = int_value 16 [template = constants.%int_16] -// CHECK:STDOUT: %u16.loc21: type = class_type @UInt, @UInt(constants.%int_16) [template = constants.%u16] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32ToUint16(%a.param_patt: %i32) -> %u16 = "int.convert_checked" [from "int_ops.carbon"]; @@ -1506,14 +1512,6 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %int_64.loc5: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %u64.loc5: type = class_type @UInt, @UInt(constants.%int_64) [template = constants.%u64] -// CHECK:STDOUT: %int_64.loc6: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %u64.loc6: type = class_type @UInt, @UInt(constants.%int_64) [template = constants.%u64] -// CHECK:STDOUT: %int_64.loc11: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %i64.loc11: type = class_type @Int, @Int(constants.%int_64) [template = constants.%i64] -// CHECK:STDOUT: %int_64.loc12: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %i64.loc12: type = class_type @Int, @Int(constants.%int_64) [template = constants.%i64] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Uint32ToUint64(%a.param_patt: %u32) -> %u64 = "int.convert_checked" [from "int_ops.carbon"]; @@ -1755,14 +1753,6 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %int_64.loc5: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %u64.loc5: type = class_type @UInt, @UInt(constants.%int_64) [template = constants.%u64] -// CHECK:STDOUT: %int_64.loc6: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %u64.loc6: type = class_type @UInt, @UInt(constants.%int_64) [template = constants.%u64] -// CHECK:STDOUT: %int_64.loc8: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %i64.loc8: type = class_type @Int, @Int(constants.%int_64) [template = constants.%i64] -// CHECK:STDOUT: %int_64.loc9: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %i64.loc9: type = class_type @Int, @Int(constants.%int_64) [template = constants.%i64] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32ToUint64(%a.param_patt: %i32) -> %u64 = "int.convert_checked" [from "int_ops.carbon"]; @@ -1929,8 +1919,6 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Uint32ToInt32(%a.param_patt: %u32) -> %i32 = "int.convert_checked" [from "int_ops.carbon"]; @@ -2053,8 +2041,6 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [template = constants.%int_16] -// CHECK:STDOUT: %i16: type = class_type @Int, @Int(constants.%int_16) [template = constants.%i16] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32ToInt16(%a.param_patt: %i32) -> %i16 = "int.convert_checked" [from "int_ops.carbon"]; @@ -2154,8 +2140,6 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [template = constants.%int_16] -// CHECK:STDOUT: %u16: type = class_type @UInt, @UInt(constants.%int_16) [template = constants.%u16] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32ToUint16(%a.param_patt: %i32) -> %u16 = "int.convert_checked" [from "int_ops.carbon"]; @@ -2259,8 +2243,6 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [template = constants.%int_16] -// CHECK:STDOUT: %i16: type = class_type @Int, @Int(constants.%int_16) [template = constants.%i16] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Uint32ToInt16(%a.param_patt: %u32) -> %i16 = "int.convert_checked" [from "int_ops.carbon"]; @@ -2370,8 +2352,6 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [template = constants.%int_16] -// CHECK:STDOUT: %u16: type = class_type @UInt, @UInt(constants.%int_16) [template = constants.%u16] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Uint32ToUint16(%a.param_patt: %u32) -> %u16 = "int.convert_checked" [from "int_ops.carbon"]; @@ -2484,8 +2464,6 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [template = constants.%int_16] -// CHECK:STDOUT: %u16: type = class_type @UInt, @UInt(constants.%int_16) [template = constants.%u16] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32ToUint16(%a.param_patt: %i32) -> %u16 = "int.convert_checked" [from "int_ops.carbon"]; @@ -2604,8 +2582,6 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %u32: type = class_type @UInt, @UInt(constants.%int_32) [template = constants.%u32] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32ToUint32(%a.param_patt: %i32) -> %u32 = "int.convert_checked" [from "int_ops.carbon"]; @@ -2725,8 +2701,6 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %u64: type = class_type @UInt, @UInt(constants.%int_64) [template = constants.%u64] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32ToUint64(%a.param_patt: %i32) -> %u64 = "int.convert_checked" [from "int_ops.carbon"]; @@ -2842,8 +2816,6 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [template = constants.%int_16] -// CHECK:STDOUT: %i16: type = class_type @Int, @Int(constants.%int_16) [template = constants.%i16] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32ToInt16(%a.param_patt: %i32) -> %i16 = "int.convert_checked" [from "int_ops.carbon"]; @@ -2957,14 +2929,6 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %int_32.loc5: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc5: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [template = constants.%int_16] -// CHECK:STDOUT: %i16: type = class_type @Int, @Int(constants.%int_16) [template = constants.%i16] -// CHECK:STDOUT: %int_32.loc25: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc25: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %i64: type = class_type @Int, @Int(constants.%int_64) [template = constants.%i64] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32ToInt16(%a.param_patt: %i32) -> %i16 = "int.convert_checked" [from "int_ops.carbon"]; diff --git a/toolchain/check/testdata/builtins/int/eq.carbon b/toolchain/check/testdata/builtins/int/eq.carbon index d8a3614bad6ea..d01ff9aba5827 100644 --- a/toolchain/check/testdata/builtins/int/eq.carbon +++ b/toolchain/check/testdata/builtins/int/eq.carbon @@ -94,16 +94,20 @@ fn WrongResult(a: i32, b: i32) -> i32 = "int.eq"; // CHECK:STDOUT: %return.patt: bool = return_slot_pattern // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc2_10: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc2_10: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc2_18: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc2_18: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc2_26.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc2_26.2: type = converted %bool.make_type, %.loc2_26.1 [template = bool] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc2_10: type = splice_block %i32.loc2_10 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc2_10: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc2_10: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %.loc2_18: type = splice_block %i32.loc2_18 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc2_18: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc2_18: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param @@ -116,11 +120,11 @@ fn WrongResult(a: i32, b: i32) -> i32 = "int.eq"; // CHECK:STDOUT: %false_.patt: %False = binding_pattern false_ // CHECK:STDOUT: %false_.param_patt: %False = value_param_pattern %false_.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %True.ref.loc7: type = name_ref True, file.%True.decl [template = constants.%True] -// CHECK:STDOUT: %False.ref.loc7: type = name_ref False, file.%False.decl [template = constants.%False] // CHECK:STDOUT: %true_.param: %True = value_param runtime_param0 +// CHECK:STDOUT: %True.ref.loc7: type = name_ref True, file.%True.decl [template = constants.%True] // CHECK:STDOUT: %true_: %True = bind_name true_, %true_.param // CHECK:STDOUT: %false_.param: %False = value_param runtime_param1 +// CHECK:STDOUT: %False.ref.loc7: type = name_ref False, file.%False.decl [template = constants.%False] // CHECK:STDOUT: %false_: %False = bind_name false_, %false_.param // CHECK:STDOUT: } // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { @@ -131,16 +135,20 @@ fn WrongResult(a: i32, b: i32) -> i32 = "int.eq"; // CHECK:STDOUT: %return.patt: bool = return_slot_pattern // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc12_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc12_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc12_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc12_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc12_35.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc12_35.2: type = converted %bool.make_type, %.loc12_35.1 [template = bool] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc12_19: type = splice_block %i32.loc12_19 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc12_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc12_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %.loc12_27: type = splice_block %i32.loc12_27 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc12_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc12_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param @@ -274,15 +282,19 @@ fn WrongResult(a: i32, b: i32) -> i32 = "int.eq"; // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc7_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc7_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc7_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc7_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc7_35: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc7_35: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc7_19: type = splice_block %i32.loc7_19 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc7_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc7_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %.loc7_27: type = splice_block %i32.loc7_27 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc7_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc7_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param diff --git a/toolchain/check/testdata/builtins/int/greater.carbon b/toolchain/check/testdata/builtins/int/greater.carbon index 430c602d3043a..73a4d4ec2d71d 100644 --- a/toolchain/check/testdata/builtins/int/greater.carbon +++ b/toolchain/check/testdata/builtins/int/greater.carbon @@ -97,16 +97,20 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %return.patt: bool = return_slot_pattern // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc2_15: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc2_15: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc2_23: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc2_23: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc2_31.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc2_31.2: type = converted %bool.make_type, %.loc2_31.1 [template = bool] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc2_15: type = splice_block %i32.loc2_15 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc2_15: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc2_15: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %.loc2_23: type = splice_block %i32.loc2_23 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc2_23: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc2_23: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param @@ -117,11 +121,13 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc3_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc3_14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc3_22: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc3_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc3: type = splice_block %i32.loc3_14 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc3_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc3_14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -134,11 +140,11 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %false_.patt: %False = binding_pattern false_ // CHECK:STDOUT: %false_.param_patt: %False = value_param_pattern %false_.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %True.ref.loc8: type = name_ref True, file.%True.decl [template = constants.%True] -// CHECK:STDOUT: %False.ref.loc8: type = name_ref False, file.%False.decl [template = constants.%False] // CHECK:STDOUT: %true_.param: %True = value_param runtime_param0 +// CHECK:STDOUT: %True.ref.loc8: type = name_ref True, file.%True.decl [template = constants.%True] // CHECK:STDOUT: %true_: %True = bind_name true_, %true_.param // CHECK:STDOUT: %false_.param: %False = value_param runtime_param1 +// CHECK:STDOUT: %False.ref.loc8: type = name_ref False, file.%False.decl [template = constants.%False] // CHECK:STDOUT: %false_: %False = bind_name false_, %false_.param // CHECK:STDOUT: } // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { @@ -149,16 +155,20 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %return.patt: bool = return_slot_pattern // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc16_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc16_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc16_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc16_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc16_35.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc16_35.2: type = converted %bool.make_type, %.loc16_35.1 [template = bool] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc16_19: type = splice_block %i32.loc16_19 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc16_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc16_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %.loc16_27: type = splice_block %i32.loc16_27 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc16_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc16_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param diff --git a/toolchain/check/testdata/builtins/int/greater_eq.carbon b/toolchain/check/testdata/builtins/int/greater_eq.carbon index b1c2f176a697e..0322f2e423ebe 100644 --- a/toolchain/check/testdata/builtins/int/greater_eq.carbon +++ b/toolchain/check/testdata/builtins/int/greater_eq.carbon @@ -97,16 +97,20 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %return.patt: bool = return_slot_pattern // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc2_17: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc2_17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc2_25: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc2_25: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc2_33.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc2_33.2: type = converted %bool.make_type, %.loc2_33.1 [template = bool] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc2_17: type = splice_block %i32.loc2_17 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc2_17: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc2_17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %.loc2_25: type = splice_block %i32.loc2_25 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc2_25: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc2_25: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param @@ -117,11 +121,13 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc3_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc3_14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc3_22: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc3_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc3: type = splice_block %i32.loc3_14 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc3_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc3_14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -134,11 +140,11 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %false_.patt: %False = binding_pattern false_ // CHECK:STDOUT: %false_.param_patt: %False = value_param_pattern %false_.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %True.ref.loc8: type = name_ref True, file.%True.decl [template = constants.%True] -// CHECK:STDOUT: %False.ref.loc8: type = name_ref False, file.%False.decl [template = constants.%False] // CHECK:STDOUT: %true_.param: %True = value_param runtime_param0 +// CHECK:STDOUT: %True.ref.loc8: type = name_ref True, file.%True.decl [template = constants.%True] // CHECK:STDOUT: %true_: %True = bind_name true_, %true_.param // CHECK:STDOUT: %false_.param: %False = value_param runtime_param1 +// CHECK:STDOUT: %False.ref.loc8: type = name_ref False, file.%False.decl [template = constants.%False] // CHECK:STDOUT: %false_: %False = bind_name false_, %false_.param // CHECK:STDOUT: } // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { @@ -149,16 +155,20 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %return.patt: bool = return_slot_pattern // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc16_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc16_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc16_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc16_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc16_35.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc16_35.2: type = converted %bool.make_type, %.loc16_35.1 [template = bool] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc16_19: type = splice_block %i32.loc16_19 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc16_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc16_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %.loc16_27: type = splice_block %i32.loc16_27 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc16_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc16_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param diff --git a/toolchain/check/testdata/builtins/int/left_shift.carbon b/toolchain/check/testdata/builtins/int/left_shift.carbon index a76d6a00e7bbd..7663a25e84602 100644 --- a/toolchain/check/testdata/builtins/int/left_shift.carbon +++ b/toolchain/check/testdata/builtins/int/left_shift.carbon @@ -70,25 +70,6 @@ let negative: i32 = LeftShift(1, Negate(1)); // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %LeftShift.type.1: type = fn_type @LeftShift.1 [template] // CHECK:STDOUT: %LeftShift: %LeftShift.type.1 = struct_value () [template] -// CHECK:STDOUT: %int_5.1: Core.IntLiteral = int_value 5 [template] -// CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_5.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_5.2: %i32 = int_value 5 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] -// CHECK:STDOUT: %int_20.1: %i32 = int_value 20 [template] -// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.3, @impl.2(%int_32) [template] -// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [template] -// CHECK:STDOUT: %interface.6: = interface_witness (%Convert.11) [template] -// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_20.1, %Convert.11 [template] -// CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.3(%int_32) [template] // CHECK:STDOUT: %int_20.2: Core.IntLiteral = int_value 20 [template] // CHECK:STDOUT: %array_type: type = array_type %int_20.2, %i32 [template] // CHECK:STDOUT: %ptr: type = ptr_type %array_type [template] @@ -122,53 +103,25 @@ let negative: i32 = LeftShift(1, Negate(1)); // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc2_17: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc2_17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc2_25: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc2_25: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc2_33: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc2_33: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc2_17: type = splice_block %i32.loc2_17 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc2_17: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc2_17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %.loc2_25: type = splice_block %i32.loc2_25 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc2_25: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc2_25: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %int_32.loc4: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc4: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %LeftShift.ref: %LeftShift.type.1 = name_ref LeftShift, %LeftShift.decl [template = constants.%LeftShift] -// CHECK:STDOUT: %int_5: Core.IntLiteral = int_value 5 [template = constants.%int_5.1] -// CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %impl.elem0.loc4_26: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc4_26: = bound_method %int_5, %impl.elem0.loc4_26 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc4_26: = specific_function %Convert.bound.loc4_26, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc4_26: init %i32 = call %Convert.specific_fn.loc4_26(%int_5) [template = constants.%int_5.2] -// CHECK:STDOUT: %.loc4_26.1: %i32 = value_of_initializer %int.convert_checked.loc4_26 [template = constants.%int_5.2] -// CHECK:STDOUT: %.loc4_26.2: %i32 = converted %int_5, %.loc4_26.1 [template = constants.%int_5.2] -// CHECK:STDOUT: %impl.elem0.loc4_29: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc4_29: = bound_method %int_2, %impl.elem0.loc4_29 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc4_29: = specific_function %Convert.bound.loc4_29, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] -// CHECK:STDOUT: %int.convert_checked.loc4_29: init %i32 = call %Convert.specific_fn.loc4_29(%int_2) [template = constants.%int_2.2] -// CHECK:STDOUT: %.loc4_29.1: %i32 = value_of_initializer %int.convert_checked.loc4_29 [template = constants.%int_2.2] -// CHECK:STDOUT: %.loc4_29.2: %i32 = converted %int_2, %.loc4_29.1 [template = constants.%int_2.2] -// CHECK:STDOUT: %int.left_shift: init %i32 = call %LeftShift.ref(%.loc4_26.2, %.loc4_29.2) [template = constants.%int_20.1] -// CHECK:STDOUT: %impl.elem0.loc4_30: %Convert.type.5 = interface_witness_access constants.%interface.6, element0 [template = constants.%Convert.11] -// CHECK:STDOUT: %Convert.bound.loc4_30: = bound_method %int.left_shift, %impl.elem0.loc4_30 [template = constants.%Convert.bound.3] -// CHECK:STDOUT: %Convert.specific_fn.loc4_30: = specific_function %Convert.bound.loc4_30, @Convert.3(constants.%int_32) [template = constants.%Convert.specific_fn.3] -// CHECK:STDOUT: %.loc4_30.1: %i32 = value_of_initializer %int.left_shift [template = constants.%int_20.1] -// CHECK:STDOUT: %.loc4_30.2: %i32 = converted %int.left_shift, %.loc4_30.1 [template = constants.%int_20.1] -// CHECK:STDOUT: %int.convert_checked.loc4_30: init Core.IntLiteral = call %Convert.specific_fn.loc4_30(%.loc4_30.2) [template = constants.%int_20.2] -// CHECK:STDOUT: %.loc4_30.3: Core.IntLiteral = value_of_initializer %int.convert_checked.loc4_30 [template = constants.%int_20.2] -// CHECK:STDOUT: %.loc4_30.4: Core.IntLiteral = converted %int.left_shift, %.loc4_30.3 [template = constants.%int_20.2] -// CHECK:STDOUT: %array_type.loc4: type = array_type %.loc4_30.4, %i32 [template = constants.%array_type] // CHECK:STDOUT: %arr.var: ref %array_type = var arr // CHECK:STDOUT: %arr: ref %array_type = bind_name arr, %arr.var -// CHECK:STDOUT: %int_32.loc5: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc5: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_20: Core.IntLiteral = int_value 20 [template = constants.%int_20.2] -// CHECK:STDOUT: %array_type.loc5: type = array_type %int_20, %i32 [template = constants.%array_type] -// CHECK:STDOUT: %ptr: type = ptr_type %array_type [template = constants.%ptr] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { // CHECK:STDOUT: %a.patt: %i32 = binding_pattern a // CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 @@ -177,15 +130,19 @@ let negative: i32 = LeftShift(1, Negate(1)); // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc7_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc7_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc7_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc7_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc7_35: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc7_35: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc7_19: type = splice_block %i32.loc7_19 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc7_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc7_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %.loc7_27: type = splice_block %i32.loc7_27 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc7_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc7_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -285,15 +242,19 @@ let negative: i32 = LeftShift(1, Negate(1)); // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc4_17: Core.IntLiteral = int_value 32 [template = constants.%int_32.1] -// CHECK:STDOUT: %i32.loc4_17: type = class_type @Int, @Int(constants.%int_32.1) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc4_25: Core.IntLiteral = int_value 32 [template = constants.%int_32.1] -// CHECK:STDOUT: %i32.loc4_25: type = class_type @Int, @Int(constants.%int_32.1) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc4_33: Core.IntLiteral = int_value 32 [template = constants.%int_32.1] // CHECK:STDOUT: %i32.loc4_33: type = class_type @Int, @Int(constants.%int_32.1) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc4_17: type = splice_block %i32.loc4_17 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc4_17: Core.IntLiteral = int_value 32 [template = constants.%int_32.1] +// CHECK:STDOUT: %i32.loc4_17: type = class_type @Int, @Int(constants.%int_32.1) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %.loc4_25: type = splice_block %i32.loc4_25 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc4_25: Core.IntLiteral = int_value 32 [template = constants.%int_32.1] +// CHECK:STDOUT: %i32.loc4_25: type = class_type @Int, @Int(constants.%int_32.1) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -304,31 +265,17 @@ let negative: i32 = LeftShift(1, Negate(1)); // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc5_14: Core.IntLiteral = int_value 32 [template = constants.%int_32.1] -// CHECK:STDOUT: %i32.loc5_14: type = class_type @Int, @Int(constants.%int_32.1) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc5_22: Core.IntLiteral = int_value 32 [template = constants.%int_32.1] // CHECK:STDOUT: %i32.loc5_22: type = class_type @Int, @Int(constants.%int_32.1) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc5: type = splice_block %i32.loc5_14 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc5_14: Core.IntLiteral = int_value 32 [template = constants.%int_32.1] +// CHECK:STDOUT: %i32.loc5_14: type = class_type @Int, @Int(constants.%int_32.1) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %int_32.loc8: Core.IntLiteral = int_value 32 [template = constants.%int_32.1] -// CHECK:STDOUT: %i32.loc8: type = class_type @Int, @Int(constants.%int_32.1) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc13: Core.IntLiteral = int_value 32 [template = constants.%int_32.1] -// CHECK:STDOUT: %i32.loc13: type = class_type @Int, @Int(constants.%int_32.1) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc18: Core.IntLiteral = int_value 32 [template = constants.%int_32.1] -// CHECK:STDOUT: %i32.loc18: type = class_type @Int, @Int(constants.%int_32.1) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc21: Core.IntLiteral = int_value 32 [template = constants.%int_32.1] -// CHECK:STDOUT: %i32.loc21: type = class_type @Int, @Int(constants.%int_32.1) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc26: Core.IntLiteral = int_value 32 [template = constants.%int_32.1] -// CHECK:STDOUT: %i32.loc26: type = class_type @Int, @Int(constants.%int_32.1) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc29: Core.IntLiteral = int_value 32 [template = constants.%int_32.1] -// CHECK:STDOUT: %i32.loc29: type = class_type @Int, @Int(constants.%int_32.1) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc34: Core.IntLiteral = int_value 32 [template = constants.%int_32.1] -// CHECK:STDOUT: %i32.loc34: type = class_type @Int, @Int(constants.%int_32.1) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc40: Core.IntLiteral = int_value 32 [template = constants.%int_32.1] -// CHECK:STDOUT: %i32.loc40: type = class_type @Int, @Int(constants.%int_32.1) [template = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @LeftShift.1(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.left_shift"; diff --git a/toolchain/check/testdata/builtins/int/less.carbon b/toolchain/check/testdata/builtins/int/less.carbon index 6948816cc661c..dd1a3ab4a5461 100644 --- a/toolchain/check/testdata/builtins/int/less.carbon +++ b/toolchain/check/testdata/builtins/int/less.carbon @@ -97,16 +97,20 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %return.patt: bool = return_slot_pattern // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc2_12: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc2_12: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc2_20: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc2_20: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc2_28.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc2_28.2: type = converted %bool.make_type, %.loc2_28.1 [template = bool] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc2_12: type = splice_block %i32.loc2_12 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc2_12: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc2_12: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %.loc2_20: type = splice_block %i32.loc2_20 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc2_20: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc2_20: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param @@ -117,11 +121,13 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc3_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc3_14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc3_22: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc3_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc3: type = splice_block %i32.loc3_14 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc3_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc3_14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -134,11 +140,11 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %false_.patt: %False = binding_pattern false_ // CHECK:STDOUT: %false_.param_patt: %False = value_param_pattern %false_.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %True.ref.loc8: type = name_ref True, file.%True.decl [template = constants.%True] -// CHECK:STDOUT: %False.ref.loc8: type = name_ref False, file.%False.decl [template = constants.%False] // CHECK:STDOUT: %true_.param: %True = value_param runtime_param0 +// CHECK:STDOUT: %True.ref.loc8: type = name_ref True, file.%True.decl [template = constants.%True] // CHECK:STDOUT: %true_: %True = bind_name true_, %true_.param // CHECK:STDOUT: %false_.param: %False = value_param runtime_param1 +// CHECK:STDOUT: %False.ref.loc8: type = name_ref False, file.%False.decl [template = constants.%False] // CHECK:STDOUT: %false_: %False = bind_name false_, %false_.param // CHECK:STDOUT: } // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { @@ -149,16 +155,20 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %return.patt: bool = return_slot_pattern // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc16_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc16_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc16_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc16_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc16_35.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc16_35.2: type = converted %bool.make_type, %.loc16_35.1 [template = bool] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc16_19: type = splice_block %i32.loc16_19 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc16_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc16_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %.loc16_27: type = splice_block %i32.loc16_27 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc16_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc16_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param diff --git a/toolchain/check/testdata/builtins/int/less_eq.carbon b/toolchain/check/testdata/builtins/int/less_eq.carbon index 0febd2da77e53..99b5acbf01579 100644 --- a/toolchain/check/testdata/builtins/int/less_eq.carbon +++ b/toolchain/check/testdata/builtins/int/less_eq.carbon @@ -97,16 +97,20 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %return.patt: bool = return_slot_pattern // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc2_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc2_14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc2_22: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc2_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc2_30.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc2_30.2: type = converted %bool.make_type, %.loc2_30.1 [template = bool] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc2_14: type = splice_block %i32.loc2_14 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc2_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc2_14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %.loc2_22: type = splice_block %i32.loc2_22 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc2_22: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc2_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param @@ -117,11 +121,13 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc3_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc3_14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc3_22: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc3_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc3: type = splice_block %i32.loc3_14 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc3_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc3_14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -134,11 +140,11 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %false_.patt: %False = binding_pattern false_ // CHECK:STDOUT: %false_.param_patt: %False = value_param_pattern %false_.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %True.ref.loc8: type = name_ref True, file.%True.decl [template = constants.%True] -// CHECK:STDOUT: %False.ref.loc8: type = name_ref False, file.%False.decl [template = constants.%False] // CHECK:STDOUT: %true_.param: %True = value_param runtime_param0 +// CHECK:STDOUT: %True.ref.loc8: type = name_ref True, file.%True.decl [template = constants.%True] // CHECK:STDOUT: %true_: %True = bind_name true_, %true_.param // CHECK:STDOUT: %false_.param: %False = value_param runtime_param1 +// CHECK:STDOUT: %False.ref.loc8: type = name_ref False, file.%False.decl [template = constants.%False] // CHECK:STDOUT: %false_: %False = bind_name false_, %false_.param // CHECK:STDOUT: } // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { @@ -149,16 +155,20 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %return.patt: bool = return_slot_pattern // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc16_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc16_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc16_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc16_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc16_35.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc16_35.2: type = converted %bool.make_type, %.loc16_35.1 [template = bool] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc16_19: type = splice_block %i32.loc16_19 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc16_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc16_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %.loc16_27: type = splice_block %i32.loc16_27 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc16_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc16_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param diff --git a/toolchain/check/testdata/builtins/int/make_type_signed.carbon b/toolchain/check/testdata/builtins/int/make_type_signed.carbon index 5f5a11aebeddc..0ce0f2716e9f2 100644 --- a/toolchain/check/testdata/builtins/int/make_type_signed.carbon +++ b/toolchain/check/testdata/builtins/int/make_type_signed.carbon @@ -125,11 +125,13 @@ var m: Int(1000000000); // CHECK:STDOUT: %return.patt: type = return_slot_pattern // CHECK:STDOUT: %return.param_patt: type = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [template = constants.%IntLiteral] -// CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral] -// CHECK:STDOUT: %.loc5_22.1: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral] -// CHECK:STDOUT: %.loc5_22.2: type = converted %int_literal.make_type, %.loc5_22.1 [template = Core.IntLiteral] // CHECK:STDOUT: %n.param: Core.IntLiteral = value_param runtime_param0 +// CHECK:STDOUT: %.loc5_22.3: type = splice_block %.loc5_22.2 [template = Core.IntLiteral] { +// CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [template = constants.%IntLiteral] +// CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral] +// CHECK:STDOUT: %.loc5_22.1: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral] +// CHECK:STDOUT: %.loc5_22.2: type = converted %int_literal.make_type, %.loc5_22.1 [template = Core.IntLiteral] +// CHECK:STDOUT: } // CHECK:STDOUT: %n: Core.IntLiteral = bind_name n, %n.param // CHECK:STDOUT: %return.param: ref type = out_param runtime_param1 // CHECK:STDOUT: %return: ref type = return_slot %return.param @@ -189,17 +191,19 @@ var m: Int(1000000000); // CHECK:STDOUT: %return.patt: %i64.builtin = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i64.builtin = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Int.ref.loc6_9: %Int.type = name_ref Int, imports.%import_ref.2 [template = constants.%Int] -// CHECK:STDOUT: %int_64.loc6_13: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %int.make_type_signed.loc6_15: init type = call %Int.ref.loc6_9(%int_64.loc6_13) [template = constants.%i64.builtin] -// CHECK:STDOUT: %.loc6_15.1: type = value_of_initializer %int.make_type_signed.loc6_15 [template = constants.%i64.builtin] -// CHECK:STDOUT: %.loc6_15.2: type = converted %int.make_type_signed.loc6_15, %.loc6_15.1 [template = constants.%i64.builtin] // CHECK:STDOUT: %Int.ref.loc6_21: %Int.type = name_ref Int, imports.%import_ref.2 [template = constants.%Int] // CHECK:STDOUT: %int_64.loc6_25: Core.IntLiteral = int_value 64 [template = constants.%int_64] // CHECK:STDOUT: %int.make_type_signed.loc6_27: init type = call %Int.ref.loc6_21(%int_64.loc6_25) [template = constants.%i64.builtin] // CHECK:STDOUT: %.loc6_27.1: type = value_of_initializer %int.make_type_signed.loc6_27 [template = constants.%i64.builtin] // CHECK:STDOUT: %.loc6_27.2: type = converted %int.make_type_signed.loc6_27, %.loc6_27.1 [template = constants.%i64.builtin] // CHECK:STDOUT: %n.param: %i64.builtin = value_param runtime_param0 +// CHECK:STDOUT: %.loc6_15.3: type = splice_block %.loc6_15.2 [template = constants.%i64.builtin] { +// CHECK:STDOUT: %Int.ref.loc6_9: %Int.type = name_ref Int, imports.%import_ref.2 [template = constants.%Int] +// CHECK:STDOUT: %int_64.loc6_13: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %int.make_type_signed.loc6_15: init type = call %Int.ref.loc6_9(%int_64.loc6_13) [template = constants.%i64.builtin] +// CHECK:STDOUT: %.loc6_15.1: type = value_of_initializer %int.make_type_signed.loc6_15 [template = constants.%i64.builtin] +// CHECK:STDOUT: %.loc6_15.2: type = converted %int.make_type_signed.loc6_15, %.loc6_15.1 [template = constants.%i64.builtin] +// CHECK:STDOUT: } // CHECK:STDOUT: %n: %i64.builtin = bind_name n, %n.param // CHECK:STDOUT: %return.param: ref %i64.builtin = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i64.builtin = return_slot %return.param @@ -210,17 +214,19 @@ var m: Int(1000000000); // CHECK:STDOUT: %return.patt: %i13.builtin = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i13.builtin = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Int.ref.loc10_9: %Int.type = name_ref Int, imports.%import_ref.2 [template = constants.%Int] -// CHECK:STDOUT: %int_13.loc10_13: Core.IntLiteral = int_value 13 [template = constants.%int_13] -// CHECK:STDOUT: %int.make_type_signed.loc10_15: init type = call %Int.ref.loc10_9(%int_13.loc10_13) [template = constants.%i13.builtin] -// CHECK:STDOUT: %.loc10_15.1: type = value_of_initializer %int.make_type_signed.loc10_15 [template = constants.%i13.builtin] -// CHECK:STDOUT: %.loc10_15.2: type = converted %int.make_type_signed.loc10_15, %.loc10_15.1 [template = constants.%i13.builtin] // CHECK:STDOUT: %Int.ref.loc10_21: %Int.type = name_ref Int, imports.%import_ref.2 [template = constants.%Int] // CHECK:STDOUT: %int_13.loc10_25: Core.IntLiteral = int_value 13 [template = constants.%int_13] // CHECK:STDOUT: %int.make_type_signed.loc10_27: init type = call %Int.ref.loc10_21(%int_13.loc10_25) [template = constants.%i13.builtin] // CHECK:STDOUT: %.loc10_27.1: type = value_of_initializer %int.make_type_signed.loc10_27 [template = constants.%i13.builtin] // CHECK:STDOUT: %.loc10_27.2: type = converted %int.make_type_signed.loc10_27, %.loc10_27.1 [template = constants.%i13.builtin] // CHECK:STDOUT: %n.param: %i13.builtin = value_param runtime_param0 +// CHECK:STDOUT: %.loc10_15.3: type = splice_block %.loc10_15.2 [template = constants.%i13.builtin] { +// CHECK:STDOUT: %Int.ref.loc10_9: %Int.type = name_ref Int, imports.%import_ref.2 [template = constants.%Int] +// CHECK:STDOUT: %int_13.loc10_13: Core.IntLiteral = int_value 13 [template = constants.%int_13] +// CHECK:STDOUT: %int.make_type_signed.loc10_15: init type = call %Int.ref.loc10_9(%int_13.loc10_13) [template = constants.%i13.builtin] +// CHECK:STDOUT: %.loc10_15.1: type = value_of_initializer %int.make_type_signed.loc10_15 [template = constants.%i13.builtin] +// CHECK:STDOUT: %.loc10_15.2: type = converted %int.make_type_signed.loc10_15, %.loc10_15.1 [template = constants.%i13.builtin] +// CHECK:STDOUT: } // CHECK:STDOUT: %n: %i13.builtin = bind_name n, %n.param // CHECK:STDOUT: %return.param: ref %i13.builtin = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i13.builtin = return_slot %return.param @@ -233,23 +239,27 @@ var m: Int(1000000000); // CHECK:STDOUT: %return.patt: @Symbolic.%iN.builtin (%iN.builtin) = return_slot_pattern // CHECK:STDOUT: %return.param_patt: @Symbolic.%iN.builtin (%iN.builtin) = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, imports.%import_ref.1 [template = constants.%IntLiteral] -// CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral] -// CHECK:STDOUT: %.loc14_28.1: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral] -// CHECK:STDOUT: %.loc14_28.2: type = converted %int_literal.make_type, %.loc14_28.1 [template = Core.IntLiteral] -// CHECK:STDOUT: %Int.ref.loc14_34: %Int.type = name_ref Int, imports.%import_ref.2 [template = constants.%Int] -// CHECK:STDOUT: %N.ref.loc14_38: Core.IntLiteral = name_ref N, %N.loc14_13.1 [symbolic = %N.loc14_13.2 (constants.%N)] -// CHECK:STDOUT: %int.make_type_signed.loc14_39: init type = call %Int.ref.loc14_34(%N.ref.loc14_38) [symbolic = %iN.builtin (constants.%iN.builtin)] -// CHECK:STDOUT: %.loc14_39.1: type = value_of_initializer %int.make_type_signed.loc14_39 [symbolic = %iN.builtin (constants.%iN.builtin)] -// CHECK:STDOUT: %.loc14_39.2: type = converted %int.make_type_signed.loc14_39, %.loc14_39.1 [symbolic = %iN.builtin (constants.%iN.builtin)] // CHECK:STDOUT: %Int.ref.loc14_45: %Int.type = name_ref Int, imports.%import_ref.2 [template = constants.%Int] // CHECK:STDOUT: %N.ref.loc14_49: Core.IntLiteral = name_ref N, %N.loc14_13.1 [symbolic = %N.loc14_13.2 (constants.%N)] // CHECK:STDOUT: %int.make_type_signed.loc14_50: init type = call %Int.ref.loc14_45(%N.ref.loc14_49) [symbolic = %iN.builtin (constants.%iN.builtin)] // CHECK:STDOUT: %.loc14_50.1: type = value_of_initializer %int.make_type_signed.loc14_50 [symbolic = %iN.builtin (constants.%iN.builtin)] // CHECK:STDOUT: %.loc14_50.2: type = converted %int.make_type_signed.loc14_50, %.loc14_50.1 [symbolic = %iN.builtin (constants.%iN.builtin)] // CHECK:STDOUT: %N.param: Core.IntLiteral = value_param runtime_param +// CHECK:STDOUT: %.loc14_28.3: type = splice_block %.loc14_28.2 [template = Core.IntLiteral] { +// CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, imports.%import_ref.1 [template = constants.%IntLiteral] +// CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral] +// CHECK:STDOUT: %.loc14_28.1: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral] +// CHECK:STDOUT: %.loc14_28.2: type = converted %int_literal.make_type, %.loc14_28.1 [template = Core.IntLiteral] +// CHECK:STDOUT: } // CHECK:STDOUT: %N.loc14_13.1: Core.IntLiteral = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc14_13.2 (constants.%N)] // CHECK:STDOUT: %x.param: @Symbolic.%iN.builtin (%iN.builtin) = value_param runtime_param0 +// CHECK:STDOUT: %.loc14_39.3: type = splice_block %.loc14_39.2 [symbolic = %iN.builtin (constants.%iN.builtin)] { +// CHECK:STDOUT: %Int.ref.loc14_34: %Int.type = name_ref Int, imports.%import_ref.2 [template = constants.%Int] +// CHECK:STDOUT: %N.ref.loc14_38: Core.IntLiteral = name_ref N, %N.loc14_13.1 [symbolic = %N.loc14_13.2 (constants.%N)] +// CHECK:STDOUT: %int.make_type_signed.loc14_39: init type = call %Int.ref.loc14_34(%N.ref.loc14_38) [symbolic = %iN.builtin (constants.%iN.builtin)] +// CHECK:STDOUT: %.loc14_39.1: type = value_of_initializer %int.make_type_signed.loc14_39 [symbolic = %iN.builtin (constants.%iN.builtin)] +// CHECK:STDOUT: %.loc14_39.2: type = converted %int.make_type_signed.loc14_39, %.loc14_39.1 [symbolic = %iN.builtin (constants.%iN.builtin)] +// CHECK:STDOUT: } // CHECK:STDOUT: %x: @Symbolic.%iN.builtin (%iN.builtin) = bind_name x, %x.param // CHECK:STDOUT: %return.param: ref @Symbolic.%iN.builtin (%iN.builtin) = out_param runtime_param1 // CHECK:STDOUT: %return: ref @Symbolic.%iN.builtin (%iN.builtin) = return_slot %return.param @@ -356,17 +366,19 @@ var m: Int(1000000000); // CHECK:STDOUT: %return.patt: %i64.builtin = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i64.builtin = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Int.ref.loc7_12: %Int.type = name_ref Int, imports.%import_ref.2 [template = constants.%Int] -// CHECK:STDOUT: %int_64.loc7_16: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %int.make_type_signed.loc7_18: init type = call %Int.ref.loc7_12(%int_64.loc7_16) [template = constants.%i64.builtin] -// CHECK:STDOUT: %.loc7_18.1: type = value_of_initializer %int.make_type_signed.loc7_18 [template = constants.%i64.builtin] -// CHECK:STDOUT: %.loc7_18.2: type = converted %int.make_type_signed.loc7_18, %.loc7_18.1 [template = constants.%i64.builtin] // CHECK:STDOUT: %Int.ref.loc7_24: %Int.type = name_ref Int, imports.%import_ref.2 [template = constants.%Int] // CHECK:STDOUT: %int_64.loc7_28: Core.IntLiteral = int_value 64 [template = constants.%int_64] // CHECK:STDOUT: %int.make_type_signed.loc7_30: init type = call %Int.ref.loc7_24(%int_64.loc7_28) [template = constants.%i64.builtin] // CHECK:STDOUT: %.loc7_30.1: type = value_of_initializer %int.make_type_signed.loc7_30 [template = constants.%i64.builtin] // CHECK:STDOUT: %.loc7_30.2: type = converted %int.make_type_signed.loc7_30, %.loc7_30.1 [template = constants.%i64.builtin] // CHECK:STDOUT: %n.param: %i64.builtin = value_param runtime_param0 +// CHECK:STDOUT: %.loc7_18.3: type = splice_block %.loc7_18.2 [template = constants.%i64.builtin] { +// CHECK:STDOUT: %Int.ref.loc7_12: %Int.type = name_ref Int, imports.%import_ref.2 [template = constants.%Int] +// CHECK:STDOUT: %int_64.loc7_16: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %int.make_type_signed.loc7_18: init type = call %Int.ref.loc7_12(%int_64.loc7_16) [template = constants.%i64.builtin] +// CHECK:STDOUT: %.loc7_18.1: type = value_of_initializer %int.make_type_signed.loc7_18 [template = constants.%i64.builtin] +// CHECK:STDOUT: %.loc7_18.2: type = converted %int.make_type_signed.loc7_18, %.loc7_18.1 [template = constants.%i64.builtin] +// CHECK:STDOUT: } // CHECK:STDOUT: %n: %i64.builtin = bind_name n, %n.param // CHECK:STDOUT: %return.param: ref %i64.builtin = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i64.builtin = return_slot %return.param @@ -377,17 +389,19 @@ var m: Int(1000000000); // CHECK:STDOUT: %return.patt: %i13.builtin = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i13.builtin = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Int.ref.loc11_12: %Int.type = name_ref Int, imports.%import_ref.2 [template = constants.%Int] -// CHECK:STDOUT: %int_13.loc11_16: Core.IntLiteral = int_value 13 [template = constants.%int_13] -// CHECK:STDOUT: %int.make_type_signed.loc11_18: init type = call %Int.ref.loc11_12(%int_13.loc11_16) [template = constants.%i13.builtin] -// CHECK:STDOUT: %.loc11_18.1: type = value_of_initializer %int.make_type_signed.loc11_18 [template = constants.%i13.builtin] -// CHECK:STDOUT: %.loc11_18.2: type = converted %int.make_type_signed.loc11_18, %.loc11_18.1 [template = constants.%i13.builtin] // CHECK:STDOUT: %Int.ref.loc11_24: %Int.type = name_ref Int, imports.%import_ref.2 [template = constants.%Int] // CHECK:STDOUT: %int_13.loc11_28: Core.IntLiteral = int_value 13 [template = constants.%int_13] // CHECK:STDOUT: %int.make_type_signed.loc11_30: init type = call %Int.ref.loc11_24(%int_13.loc11_28) [template = constants.%i13.builtin] // CHECK:STDOUT: %.loc11_30.1: type = value_of_initializer %int.make_type_signed.loc11_30 [template = constants.%i13.builtin] // CHECK:STDOUT: %.loc11_30.2: type = converted %int.make_type_signed.loc11_30, %.loc11_30.1 [template = constants.%i13.builtin] // CHECK:STDOUT: %n.param: %i13.builtin = value_param runtime_param0 +// CHECK:STDOUT: %.loc11_18.3: type = splice_block %.loc11_18.2 [template = constants.%i13.builtin] { +// CHECK:STDOUT: %Int.ref.loc11_12: %Int.type = name_ref Int, imports.%import_ref.2 [template = constants.%Int] +// CHECK:STDOUT: %int_13.loc11_16: Core.IntLiteral = int_value 13 [template = constants.%int_13] +// CHECK:STDOUT: %int.make_type_signed.loc11_18: init type = call %Int.ref.loc11_12(%int_13.loc11_16) [template = constants.%i13.builtin] +// CHECK:STDOUT: %.loc11_18.1: type = value_of_initializer %int.make_type_signed.loc11_18 [template = constants.%i13.builtin] +// CHECK:STDOUT: %.loc11_18.2: type = converted %int.make_type_signed.loc11_18, %.loc11_18.1 [template = constants.%i13.builtin] +// CHECK:STDOUT: } // CHECK:STDOUT: %n: %i13.builtin = bind_name n, %n.param // CHECK:STDOUT: %return.param: ref %i13.builtin = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i13.builtin = return_slot %return.param @@ -398,17 +412,19 @@ var m: Int(1000000000); // CHECK:STDOUT: %return.patt: %i24.builtin = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i24.builtin = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Int.ref.loc15_19: %Int.type = name_ref Int, imports.%import_ref.2 [template = constants.%Int] -// CHECK:STDOUT: %int_24.loc15_23: Core.IntLiteral = int_value 24 [template = constants.%int_24] -// CHECK:STDOUT: %int.make_type_signed.loc15_25: init type = call %Int.ref.loc15_19(%int_24.loc15_23) [template = constants.%i24.builtin] -// CHECK:STDOUT: %.loc15_25.1: type = value_of_initializer %int.make_type_signed.loc15_25 [template = constants.%i24.builtin] -// CHECK:STDOUT: %.loc15_25.2: type = converted %int.make_type_signed.loc15_25, %.loc15_25.1 [template = constants.%i24.builtin] // CHECK:STDOUT: %Int.ref.loc15_31: %Int.type = name_ref Int, imports.%import_ref.2 [template = constants.%Int] // CHECK:STDOUT: %int_24.loc15_35: Core.IntLiteral = int_value 24 [template = constants.%int_24] // CHECK:STDOUT: %int.make_type_signed.loc15_37: init type = call %Int.ref.loc15_31(%int_24.loc15_35) [template = constants.%i24.builtin] // CHECK:STDOUT: %.loc15_37.1: type = value_of_initializer %int.make_type_signed.loc15_37 [template = constants.%i24.builtin] // CHECK:STDOUT: %.loc15_37.2: type = converted %int.make_type_signed.loc15_37, %.loc15_37.1 [template = constants.%i24.builtin] // CHECK:STDOUT: %n.param: %i24.builtin = value_param runtime_param0 +// CHECK:STDOUT: %.loc15_25.3: type = splice_block %.loc15_25.2 [template = constants.%i24.builtin] { +// CHECK:STDOUT: %Int.ref.loc15_19: %Int.type = name_ref Int, imports.%import_ref.2 [template = constants.%Int] +// CHECK:STDOUT: %int_24.loc15_23: Core.IntLiteral = int_value 24 [template = constants.%int_24] +// CHECK:STDOUT: %int.make_type_signed.loc15_25: init type = call %Int.ref.loc15_19(%int_24.loc15_23) [template = constants.%i24.builtin] +// CHECK:STDOUT: %.loc15_25.1: type = value_of_initializer %int.make_type_signed.loc15_25 [template = constants.%i24.builtin] +// CHECK:STDOUT: %.loc15_25.2: type = converted %int.make_type_signed.loc15_25, %.loc15_25.1 [template = constants.%i24.builtin] +// CHECK:STDOUT: } // CHECK:STDOUT: %n: %i24.builtin = bind_name n, %n.param // CHECK:STDOUT: %return.param: ref %i24.builtin = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i24.builtin = return_slot %return.param @@ -484,7 +500,6 @@ var m: Int(1000000000); // CHECK:STDOUT: constants { // CHECK:STDOUT: %Int.type: type = fn_type @Int [template] // CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -505,11 +520,6 @@ var m: Int(1000000000); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %Int.ref: %Int.type = name_ref Int, imports.%import_ref.2 [template = constants.%Int] -// CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0] -// CHECK:STDOUT: %int.make_type_signed: init type = call %Int.ref(%int_0) [template = ] -// CHECK:STDOUT: %.loc10_13.1: type = value_of_initializer %int.make_type_signed [template = ] -// CHECK:STDOUT: %.loc10_13.2: type = converted %int.make_type_signed, %.loc10_13.1 [template = ] // CHECK:STDOUT: %n.var: ref = var n // CHECK:STDOUT: %n: ref = bind_name n, %n.var // CHECK:STDOUT: } @@ -525,22 +535,6 @@ var m: Int(1000000000); // CHECK:STDOUT: %Negate: %Negate.type.1 = struct_value () [template] // CHECK:STDOUT: %Int.type.2: type = fn_type @Int.1 [template] // CHECK:STDOUT: %Int.2: %Int.type.2 = struct_value () [template] -// CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] -// CHECK:STDOUT: %int_-1.1: %i32 = int_value -1 [template] -// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.3, @impl.2(%int_32) [template] -// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [template] -// CHECK:STDOUT: %interface.6: = interface_witness (%Convert.11) [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_-1.1, %Convert.11 [template] -// CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.3(%int_32) [template] -// CHECK:STDOUT: %int_-1.2: Core.IntLiteral = int_value -1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -570,36 +564,17 @@ var m: Int(1000000000); // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc6_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc6_14: type = class_type @Int.2, @Int.2(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc6_22: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc6_22: type = class_type @Int.2, @Int.2(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %n.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc6: type = splice_block %i32.loc6_14 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc6_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc6_14: type = class_type @Int.2, @Int.2(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %n: %i32 = bind_name n, %n.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %Int.ref: %Int.type.2 = name_ref Int, imports.%import_ref.2 [template = constants.%Int.2] -// CHECK:STDOUT: %Negate.ref: %Negate.type.1 = name_ref Negate, %Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc12_19: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc12_19: = bound_method %int_1, %impl.elem0.loc12_19 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc12_19: = specific_function %Convert.bound.loc12_19, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc12_19: init %i32 = call %Convert.specific_fn.loc12_19(%int_1) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc12_19.1: %i32 = value_of_initializer %int.convert_checked.loc12_19 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc12_19.2: %i32 = converted %int_1, %.loc12_19.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %int.snegate: init %i32 = call %Negate.ref(%.loc12_19.2) [template = constants.%int_-1.1] -// CHECK:STDOUT: %impl.elem0.loc12_20: %Convert.type.5 = interface_witness_access constants.%interface.6, element0 [template = constants.%Convert.11] -// CHECK:STDOUT: %Convert.bound.loc12_20: = bound_method %int.snegate, %impl.elem0.loc12_20 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc12_20: = specific_function %Convert.bound.loc12_20, @Convert.3(constants.%int_32) [template = constants.%Convert.specific_fn.2] -// CHECK:STDOUT: %.loc12_20.1: %i32 = value_of_initializer %int.snegate [template = constants.%int_-1.1] -// CHECK:STDOUT: %.loc12_20.2: %i32 = converted %int.snegate, %.loc12_20.1 [template = constants.%int_-1.1] -// CHECK:STDOUT: %int.convert_checked.loc12_20: init Core.IntLiteral = call %Convert.specific_fn.loc12_20(%.loc12_20.2) [template = constants.%int_-1.2] -// CHECK:STDOUT: %.loc12_20.3: Core.IntLiteral = value_of_initializer %int.convert_checked.loc12_20 [template = constants.%int_-1.2] -// CHECK:STDOUT: %.loc12_20.4: Core.IntLiteral = converted %int.snegate, %.loc12_20.3 [template = constants.%int_-1.2] -// CHECK:STDOUT: %int.make_type_signed: init type = call %Int.ref(%.loc12_20.4) [template = ] -// CHECK:STDOUT: %.loc12_21.1: type = value_of_initializer %int.make_type_signed [template = ] -// CHECK:STDOUT: %.loc12_21.2: type = converted %int.make_type_signed, %.loc12_21.1 [template = ] // CHECK:STDOUT: %n.var: ref = var n // CHECK:STDOUT: %n: ref = bind_name n, %n.var // CHECK:STDOUT: } @@ -613,7 +588,6 @@ var m: Int(1000000000); // CHECK:STDOUT: constants { // CHECK:STDOUT: %Int.type: type = fn_type @Int [template] // CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %int_1000000000: Core.IntLiteral = int_value 1000000000 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -634,11 +608,6 @@ var m: Int(1000000000); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %Int.ref: %Int.type = name_ref Int, imports.%import_ref.2 [template = constants.%Int] -// CHECK:STDOUT: %int_1000000000: Core.IntLiteral = int_value 1000000000 [template = constants.%int_1000000000] -// CHECK:STDOUT: %int.make_type_signed: init type = call %Int.ref(%int_1000000000) [template = ] -// CHECK:STDOUT: %.loc9_22.1: type = value_of_initializer %int.make_type_signed [template = ] -// CHECK:STDOUT: %.loc9_22.2: type = converted %int.make_type_signed, %.loc9_22.1 [template = ] // CHECK:STDOUT: %m.var: ref = var m // CHECK:STDOUT: %m: ref = bind_name m, %m.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/builtins/int/make_type_unsigned.carbon b/toolchain/check/testdata/builtins/int/make_type_unsigned.carbon index aba3e03aec4c1..934a5f6996751 100644 --- a/toolchain/check/testdata/builtins/int/make_type_unsigned.carbon +++ b/toolchain/check/testdata/builtins/int/make_type_unsigned.carbon @@ -106,11 +106,13 @@ var m: UInt(1000000000); // CHECK:STDOUT: %return.patt: type = return_slot_pattern // CHECK:STDOUT: %return.param_patt: type = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [template = constants.%IntLiteral] -// CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral] -// CHECK:STDOUT: %.loc5_23.1: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral] -// CHECK:STDOUT: %.loc5_23.2: type = converted %int_literal.make_type, %.loc5_23.1 [template = Core.IntLiteral] // CHECK:STDOUT: %n.param: Core.IntLiteral = value_param runtime_param0 +// CHECK:STDOUT: %.loc5_23.3: type = splice_block %.loc5_23.2 [template = Core.IntLiteral] { +// CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [template = constants.%IntLiteral] +// CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral] +// CHECK:STDOUT: %.loc5_23.1: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral] +// CHECK:STDOUT: %.loc5_23.2: type = converted %int_literal.make_type, %.loc5_23.1 [template = Core.IntLiteral] +// CHECK:STDOUT: } // CHECK:STDOUT: %n: Core.IntLiteral = bind_name n, %n.param // CHECK:STDOUT: %return.param: ref type = out_param runtime_param1 // CHECK:STDOUT: %return: ref type = return_slot %return.param @@ -170,17 +172,19 @@ var m: UInt(1000000000); // CHECK:STDOUT: %return.patt: %u64.builtin = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %u64.builtin = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %UInt.ref.loc6_9: %UInt.type = name_ref UInt, imports.%import_ref.2 [template = constants.%UInt] -// CHECK:STDOUT: %int_64.loc6_14: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %int.make_type_unsigned.loc6_16: init type = call %UInt.ref.loc6_9(%int_64.loc6_14) [template = constants.%u64.builtin] -// CHECK:STDOUT: %.loc6_16.1: type = value_of_initializer %int.make_type_unsigned.loc6_16 [template = constants.%u64.builtin] -// CHECK:STDOUT: %.loc6_16.2: type = converted %int.make_type_unsigned.loc6_16, %.loc6_16.1 [template = constants.%u64.builtin] // CHECK:STDOUT: %UInt.ref.loc6_22: %UInt.type = name_ref UInt, imports.%import_ref.2 [template = constants.%UInt] // CHECK:STDOUT: %int_64.loc6_27: Core.IntLiteral = int_value 64 [template = constants.%int_64] // CHECK:STDOUT: %int.make_type_unsigned.loc6_29: init type = call %UInt.ref.loc6_22(%int_64.loc6_27) [template = constants.%u64.builtin] // CHECK:STDOUT: %.loc6_29.1: type = value_of_initializer %int.make_type_unsigned.loc6_29 [template = constants.%u64.builtin] // CHECK:STDOUT: %.loc6_29.2: type = converted %int.make_type_unsigned.loc6_29, %.loc6_29.1 [template = constants.%u64.builtin] // CHECK:STDOUT: %n.param: %u64.builtin = value_param runtime_param0 +// CHECK:STDOUT: %.loc6_16.3: type = splice_block %.loc6_16.2 [template = constants.%u64.builtin] { +// CHECK:STDOUT: %UInt.ref.loc6_9: %UInt.type = name_ref UInt, imports.%import_ref.2 [template = constants.%UInt] +// CHECK:STDOUT: %int_64.loc6_14: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %int.make_type_unsigned.loc6_16: init type = call %UInt.ref.loc6_9(%int_64.loc6_14) [template = constants.%u64.builtin] +// CHECK:STDOUT: %.loc6_16.1: type = value_of_initializer %int.make_type_unsigned.loc6_16 [template = constants.%u64.builtin] +// CHECK:STDOUT: %.loc6_16.2: type = converted %int.make_type_unsigned.loc6_16, %.loc6_16.1 [template = constants.%u64.builtin] +// CHECK:STDOUT: } // CHECK:STDOUT: %n: %u64.builtin = bind_name n, %n.param // CHECK:STDOUT: %return.param: ref %u64.builtin = out_param runtime_param1 // CHECK:STDOUT: %return: ref %u64.builtin = return_slot %return.param @@ -191,17 +195,19 @@ var m: UInt(1000000000); // CHECK:STDOUT: %return.patt: %u13.builtin = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %u13.builtin = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %UInt.ref.loc10_9: %UInt.type = name_ref UInt, imports.%import_ref.2 [template = constants.%UInt] -// CHECK:STDOUT: %int_13.loc10_14: Core.IntLiteral = int_value 13 [template = constants.%int_13] -// CHECK:STDOUT: %int.make_type_unsigned.loc10_16: init type = call %UInt.ref.loc10_9(%int_13.loc10_14) [template = constants.%u13.builtin] -// CHECK:STDOUT: %.loc10_16.1: type = value_of_initializer %int.make_type_unsigned.loc10_16 [template = constants.%u13.builtin] -// CHECK:STDOUT: %.loc10_16.2: type = converted %int.make_type_unsigned.loc10_16, %.loc10_16.1 [template = constants.%u13.builtin] // CHECK:STDOUT: %UInt.ref.loc10_22: %UInt.type = name_ref UInt, imports.%import_ref.2 [template = constants.%UInt] // CHECK:STDOUT: %int_13.loc10_27: Core.IntLiteral = int_value 13 [template = constants.%int_13] // CHECK:STDOUT: %int.make_type_unsigned.loc10_29: init type = call %UInt.ref.loc10_22(%int_13.loc10_27) [template = constants.%u13.builtin] // CHECK:STDOUT: %.loc10_29.1: type = value_of_initializer %int.make_type_unsigned.loc10_29 [template = constants.%u13.builtin] // CHECK:STDOUT: %.loc10_29.2: type = converted %int.make_type_unsigned.loc10_29, %.loc10_29.1 [template = constants.%u13.builtin] // CHECK:STDOUT: %n.param: %u13.builtin = value_param runtime_param0 +// CHECK:STDOUT: %.loc10_16.3: type = splice_block %.loc10_16.2 [template = constants.%u13.builtin] { +// CHECK:STDOUT: %UInt.ref.loc10_9: %UInt.type = name_ref UInt, imports.%import_ref.2 [template = constants.%UInt] +// CHECK:STDOUT: %int_13.loc10_14: Core.IntLiteral = int_value 13 [template = constants.%int_13] +// CHECK:STDOUT: %int.make_type_unsigned.loc10_16: init type = call %UInt.ref.loc10_9(%int_13.loc10_14) [template = constants.%u13.builtin] +// CHECK:STDOUT: %.loc10_16.1: type = value_of_initializer %int.make_type_unsigned.loc10_16 [template = constants.%u13.builtin] +// CHECK:STDOUT: %.loc10_16.2: type = converted %int.make_type_unsigned.loc10_16, %.loc10_16.1 [template = constants.%u13.builtin] +// CHECK:STDOUT: } // CHECK:STDOUT: %n: %u13.builtin = bind_name n, %n.param // CHECK:STDOUT: %return.param: ref %u13.builtin = out_param runtime_param1 // CHECK:STDOUT: %return: ref %u13.builtin = return_slot %return.param @@ -214,23 +220,27 @@ var m: UInt(1000000000); // CHECK:STDOUT: %return.patt: @Symbolic.%uN.builtin (%uN.builtin) = return_slot_pattern // CHECK:STDOUT: %return.param_patt: @Symbolic.%uN.builtin (%uN.builtin) = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, imports.%import_ref.1 [template = constants.%IntLiteral] -// CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral] -// CHECK:STDOUT: %.loc14_28.1: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral] -// CHECK:STDOUT: %.loc14_28.2: type = converted %int_literal.make_type, %.loc14_28.1 [template = Core.IntLiteral] -// CHECK:STDOUT: %UInt.ref.loc14_34: %UInt.type = name_ref UInt, imports.%import_ref.2 [template = constants.%UInt] -// CHECK:STDOUT: %N.ref.loc14_39: Core.IntLiteral = name_ref N, %N.loc14_13.1 [symbolic = %N.loc14_13.2 (constants.%N)] -// CHECK:STDOUT: %int.make_type_unsigned.loc14_40: init type = call %UInt.ref.loc14_34(%N.ref.loc14_39) [symbolic = %uN.builtin (constants.%uN.builtin)] -// CHECK:STDOUT: %.loc14_40.1: type = value_of_initializer %int.make_type_unsigned.loc14_40 [symbolic = %uN.builtin (constants.%uN.builtin)] -// CHECK:STDOUT: %.loc14_40.2: type = converted %int.make_type_unsigned.loc14_40, %.loc14_40.1 [symbolic = %uN.builtin (constants.%uN.builtin)] // CHECK:STDOUT: %UInt.ref.loc14_46: %UInt.type = name_ref UInt, imports.%import_ref.2 [template = constants.%UInt] // CHECK:STDOUT: %N.ref.loc14_51: Core.IntLiteral = name_ref N, %N.loc14_13.1 [symbolic = %N.loc14_13.2 (constants.%N)] // CHECK:STDOUT: %int.make_type_unsigned.loc14_52: init type = call %UInt.ref.loc14_46(%N.ref.loc14_51) [symbolic = %uN.builtin (constants.%uN.builtin)] // CHECK:STDOUT: %.loc14_52.1: type = value_of_initializer %int.make_type_unsigned.loc14_52 [symbolic = %uN.builtin (constants.%uN.builtin)] // CHECK:STDOUT: %.loc14_52.2: type = converted %int.make_type_unsigned.loc14_52, %.loc14_52.1 [symbolic = %uN.builtin (constants.%uN.builtin)] // CHECK:STDOUT: %N.param: Core.IntLiteral = value_param runtime_param +// CHECK:STDOUT: %.loc14_28.3: type = splice_block %.loc14_28.2 [template = Core.IntLiteral] { +// CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, imports.%import_ref.1 [template = constants.%IntLiteral] +// CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral] +// CHECK:STDOUT: %.loc14_28.1: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral] +// CHECK:STDOUT: %.loc14_28.2: type = converted %int_literal.make_type, %.loc14_28.1 [template = Core.IntLiteral] +// CHECK:STDOUT: } // CHECK:STDOUT: %N.loc14_13.1: Core.IntLiteral = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc14_13.2 (constants.%N)] // CHECK:STDOUT: %x.param: @Symbolic.%uN.builtin (%uN.builtin) = value_param runtime_param0 +// CHECK:STDOUT: %.loc14_40.3: type = splice_block %.loc14_40.2 [symbolic = %uN.builtin (constants.%uN.builtin)] { +// CHECK:STDOUT: %UInt.ref.loc14_34: %UInt.type = name_ref UInt, imports.%import_ref.2 [template = constants.%UInt] +// CHECK:STDOUT: %N.ref.loc14_39: Core.IntLiteral = name_ref N, %N.loc14_13.1 [symbolic = %N.loc14_13.2 (constants.%N)] +// CHECK:STDOUT: %int.make_type_unsigned.loc14_40: init type = call %UInt.ref.loc14_34(%N.ref.loc14_39) [symbolic = %uN.builtin (constants.%uN.builtin)] +// CHECK:STDOUT: %.loc14_40.1: type = value_of_initializer %int.make_type_unsigned.loc14_40 [symbolic = %uN.builtin (constants.%uN.builtin)] +// CHECK:STDOUT: %.loc14_40.2: type = converted %int.make_type_unsigned.loc14_40, %.loc14_40.1 [symbolic = %uN.builtin (constants.%uN.builtin)] +// CHECK:STDOUT: } // CHECK:STDOUT: %x: @Symbolic.%uN.builtin (%uN.builtin) = bind_name x, %x.param // CHECK:STDOUT: %return.param: ref @Symbolic.%uN.builtin (%uN.builtin) = out_param runtime_param1 // CHECK:STDOUT: %return: ref @Symbolic.%uN.builtin (%uN.builtin) = return_slot %return.param @@ -279,7 +289,6 @@ var m: UInt(1000000000); // CHECK:STDOUT: constants { // CHECK:STDOUT: %UInt.type: type = fn_type @UInt [template] // CHECK:STDOUT: %UInt: %UInt.type = struct_value () [template] -// CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -300,11 +309,6 @@ var m: UInt(1000000000); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %UInt.ref: %UInt.type = name_ref UInt, imports.%import_ref.2 [template = constants.%UInt] -// CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0] -// CHECK:STDOUT: %int.make_type_unsigned: init type = call %UInt.ref(%int_0) [template = ] -// CHECK:STDOUT: %.loc10_14.1: type = value_of_initializer %int.make_type_unsigned [template = ] -// CHECK:STDOUT: %.loc10_14.2: type = converted %int.make_type_unsigned, %.loc10_14.1 [template = ] // CHECK:STDOUT: %n.var: ref = var n // CHECK:STDOUT: %n: ref = bind_name n, %n.var // CHECK:STDOUT: } @@ -320,22 +324,6 @@ var m: UInt(1000000000); // CHECK:STDOUT: %Negate: %Negate.type.1 = struct_value () [template] // CHECK:STDOUT: %UInt.type: type = fn_type @UInt [template] // CHECK:STDOUT: %UInt: %UInt.type = struct_value () [template] -// CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] -// CHECK:STDOUT: %int_-1.1: %i32 = int_value -1 [template] -// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.3, @impl.2(%int_32) [template] -// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [template] -// CHECK:STDOUT: %interface.6: = interface_witness (%Convert.11) [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_-1.1, %Convert.11 [template] -// CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.3(%int_32) [template] -// CHECK:STDOUT: %int_-1.2: Core.IntLiteral = int_value -1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -365,36 +353,17 @@ var m: UInt(1000000000); // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc6_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc6_14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc6_22: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc6_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %n.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc6: type = splice_block %i32.loc6_14 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc6_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc6_14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %n: %i32 = bind_name n, %n.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %UInt.ref: %UInt.type = name_ref UInt, imports.%import_ref.2 [template = constants.%UInt] -// CHECK:STDOUT: %Negate.ref: %Negate.type.1 = name_ref Negate, %Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc12_20: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc12_20: = bound_method %int_1, %impl.elem0.loc12_20 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc12_20: = specific_function %Convert.bound.loc12_20, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc12_20: init %i32 = call %Convert.specific_fn.loc12_20(%int_1) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc12_20.1: %i32 = value_of_initializer %int.convert_checked.loc12_20 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc12_20.2: %i32 = converted %int_1, %.loc12_20.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %int.snegate: init %i32 = call %Negate.ref(%.loc12_20.2) [template = constants.%int_-1.1] -// CHECK:STDOUT: %impl.elem0.loc12_21: %Convert.type.5 = interface_witness_access constants.%interface.6, element0 [template = constants.%Convert.11] -// CHECK:STDOUT: %Convert.bound.loc12_21: = bound_method %int.snegate, %impl.elem0.loc12_21 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc12_21: = specific_function %Convert.bound.loc12_21, @Convert.3(constants.%int_32) [template = constants.%Convert.specific_fn.2] -// CHECK:STDOUT: %.loc12_21.1: %i32 = value_of_initializer %int.snegate [template = constants.%int_-1.1] -// CHECK:STDOUT: %.loc12_21.2: %i32 = converted %int.snegate, %.loc12_21.1 [template = constants.%int_-1.1] -// CHECK:STDOUT: %int.convert_checked.loc12_21: init Core.IntLiteral = call %Convert.specific_fn.loc12_21(%.loc12_21.2) [template = constants.%int_-1.2] -// CHECK:STDOUT: %.loc12_21.3: Core.IntLiteral = value_of_initializer %int.convert_checked.loc12_21 [template = constants.%int_-1.2] -// CHECK:STDOUT: %.loc12_21.4: Core.IntLiteral = converted %int.snegate, %.loc12_21.3 [template = constants.%int_-1.2] -// CHECK:STDOUT: %int.make_type_unsigned: init type = call %UInt.ref(%.loc12_21.4) [template = ] -// CHECK:STDOUT: %.loc12_22.1: type = value_of_initializer %int.make_type_unsigned [template = ] -// CHECK:STDOUT: %.loc12_22.2: type = converted %int.make_type_unsigned, %.loc12_22.1 [template = ] // CHECK:STDOUT: %n.var: ref = var n // CHECK:STDOUT: %n: ref = bind_name n, %n.var // CHECK:STDOUT: } @@ -408,7 +377,6 @@ var m: UInt(1000000000); // CHECK:STDOUT: constants { // CHECK:STDOUT: %UInt.type: type = fn_type @UInt [template] // CHECK:STDOUT: %UInt: %UInt.type = struct_value () [template] -// CHECK:STDOUT: %int_1000000000: Core.IntLiteral = int_value 1000000000 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -429,11 +397,6 @@ var m: UInt(1000000000); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %UInt.ref: %UInt.type = name_ref UInt, imports.%import_ref.2 [template = constants.%UInt] -// CHECK:STDOUT: %int_1000000000: Core.IntLiteral = int_value 1000000000 [template = constants.%int_1000000000] -// CHECK:STDOUT: %int.make_type_unsigned: init type = call %UInt.ref(%int_1000000000) [template = ] -// CHECK:STDOUT: %.loc9_23.1: type = value_of_initializer %int.make_type_unsigned [template = ] -// CHECK:STDOUT: %.loc9_23.2: type = converted %int.make_type_unsigned, %.loc9_23.1 [template = ] // CHECK:STDOUT: %m.var: ref = var m // CHECK:STDOUT: %m: ref = bind_name m, %m.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/builtins/int/neq.carbon b/toolchain/check/testdata/builtins/int/neq.carbon index d189bd30ca352..0767f710c642f 100644 --- a/toolchain/check/testdata/builtins/int/neq.carbon +++ b/toolchain/check/testdata/builtins/int/neq.carbon @@ -85,16 +85,20 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %return.patt: bool = return_slot_pattern // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc2_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc2_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc2_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc2_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc2_27.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc2_27.2: type = converted %bool.make_type, %.loc2_27.1 [template = bool] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc2_11: type = splice_block %i32.loc2_11 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc2_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc2_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %.loc2_19: type = splice_block %i32.loc2_19 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc2_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc2_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param @@ -107,11 +111,11 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %false_.patt: %False = binding_pattern false_ // CHECK:STDOUT: %false_.param_patt: %False = value_param_pattern %false_.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %True.ref.loc7: type = name_ref True, file.%True.decl [template = constants.%True] -// CHECK:STDOUT: %False.ref.loc7: type = name_ref False, file.%False.decl [template = constants.%False] // CHECK:STDOUT: %true_.param: %True = value_param runtime_param0 +// CHECK:STDOUT: %True.ref.loc7: type = name_ref True, file.%True.decl [template = constants.%True] // CHECK:STDOUT: %true_: %True = bind_name true_, %true_.param // CHECK:STDOUT: %false_.param: %False = value_param runtime_param1 +// CHECK:STDOUT: %False.ref.loc7: type = name_ref False, file.%False.decl [template = constants.%False] // CHECK:STDOUT: %false_: %False = bind_name false_, %false_.param // CHECK:STDOUT: } // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { @@ -122,16 +126,20 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %return.patt: bool = return_slot_pattern // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc12_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc12_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc12_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc12_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc12_35.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc12_35.2: type = converted %bool.make_type, %.loc12_35.1 [template = bool] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc12_19: type = splice_block %i32.loc12_19 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc12_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc12_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %.loc12_27: type = splice_block %i32.loc12_27 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc12_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc12_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param diff --git a/toolchain/check/testdata/builtins/int/or.carbon b/toolchain/check/testdata/builtins/int/or.carbon index 760ead62a98e3..83817e6a1c833 100644 --- a/toolchain/check/testdata/builtins/int/or.carbon +++ b/toolchain/check/testdata/builtins/int/or.carbon @@ -26,25 +26,6 @@ fn RuntimeCall(a: i32, b: i32) -> i32 { // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %Or.type: type = fn_type @Or [template] // CHECK:STDOUT: %Or: %Or.type = struct_value () [template] -// CHECK:STDOUT: %int_12.1: Core.IntLiteral = int_value 12 [template] -// CHECK:STDOUT: %int_10.1: Core.IntLiteral = int_value 10 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_12.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_12.2: %i32 = int_value 12 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_10.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_10.2: %i32 = int_value 10 [template] -// CHECK:STDOUT: %int_14.1: %i32 = int_value 14 [template] -// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.3, @impl.2(%int_32) [template] -// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [template] -// CHECK:STDOUT: %interface.6: = interface_witness (%Convert.11) [template] -// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_14.1, %Convert.11 [template] -// CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.3(%int_32) [template] // CHECK:STDOUT: %int_14.2: Core.IntLiteral = int_value 14 [template] // CHECK:STDOUT: %array_type: type = array_type %int_14.2, %i32 [template] // CHECK:STDOUT: %ptr: type = ptr_type %array_type [template] @@ -78,53 +59,25 @@ fn RuntimeCall(a: i32, b: i32) -> i32 { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc2_10: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc2_10: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc2_18: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc2_18: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc2_26: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc2_26: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc2_10: type = splice_block %i32.loc2_10 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc2_10: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc2_10: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %.loc2_18: type = splice_block %i32.loc2_18 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc2_18: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc2_18: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %int_32.loc4: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc4: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %Or.ref: %Or.type = name_ref Or, %Or.decl [template = constants.%Or] -// CHECK:STDOUT: %int_12: Core.IntLiteral = int_value 12 [template = constants.%int_12.1] -// CHECK:STDOUT: %int_10: Core.IntLiteral = int_value 10 [template = constants.%int_10.1] -// CHECK:STDOUT: %impl.elem0.loc4_19: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc4_19: = bound_method %int_12, %impl.elem0.loc4_19 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc4_19: = specific_function %Convert.bound.loc4_19, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc4_19: init %i32 = call %Convert.specific_fn.loc4_19(%int_12) [template = constants.%int_12.2] -// CHECK:STDOUT: %.loc4_19.1: %i32 = value_of_initializer %int.convert_checked.loc4_19 [template = constants.%int_12.2] -// CHECK:STDOUT: %.loc4_19.2: %i32 = converted %int_12, %.loc4_19.1 [template = constants.%int_12.2] -// CHECK:STDOUT: %impl.elem0.loc4_23: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc4_23: = bound_method %int_10, %impl.elem0.loc4_23 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc4_23: = specific_function %Convert.bound.loc4_23, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] -// CHECK:STDOUT: %int.convert_checked.loc4_23: init %i32 = call %Convert.specific_fn.loc4_23(%int_10) [template = constants.%int_10.2] -// CHECK:STDOUT: %.loc4_23.1: %i32 = value_of_initializer %int.convert_checked.loc4_23 [template = constants.%int_10.2] -// CHECK:STDOUT: %.loc4_23.2: %i32 = converted %int_10, %.loc4_23.1 [template = constants.%int_10.2] -// CHECK:STDOUT: %int.or: init %i32 = call %Or.ref(%.loc4_19.2, %.loc4_23.2) [template = constants.%int_14.1] -// CHECK:STDOUT: %impl.elem0.loc4_25: %Convert.type.5 = interface_witness_access constants.%interface.6, element0 [template = constants.%Convert.11] -// CHECK:STDOUT: %Convert.bound.loc4_25: = bound_method %int.or, %impl.elem0.loc4_25 [template = constants.%Convert.bound.3] -// CHECK:STDOUT: %Convert.specific_fn.loc4_25: = specific_function %Convert.bound.loc4_25, @Convert.3(constants.%int_32) [template = constants.%Convert.specific_fn.3] -// CHECK:STDOUT: %.loc4_25.1: %i32 = value_of_initializer %int.or [template = constants.%int_14.1] -// CHECK:STDOUT: %.loc4_25.2: %i32 = converted %int.or, %.loc4_25.1 [template = constants.%int_14.1] -// CHECK:STDOUT: %int.convert_checked.loc4_25: init Core.IntLiteral = call %Convert.specific_fn.loc4_25(%.loc4_25.2) [template = constants.%int_14.2] -// CHECK:STDOUT: %.loc4_25.3: Core.IntLiteral = value_of_initializer %int.convert_checked.loc4_25 [template = constants.%int_14.2] -// CHECK:STDOUT: %.loc4_25.4: Core.IntLiteral = converted %int.or, %.loc4_25.3 [template = constants.%int_14.2] -// CHECK:STDOUT: %array_type.loc4: type = array_type %.loc4_25.4, %i32 [template = constants.%array_type] // CHECK:STDOUT: %arr.var: ref %array_type = var arr // CHECK:STDOUT: %arr: ref %array_type = bind_name arr, %arr.var -// CHECK:STDOUT: %int_32.loc5: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc5: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_14: Core.IntLiteral = int_value 14 [template = constants.%int_14.2] -// CHECK:STDOUT: %array_type.loc5: type = array_type %int_14, %i32 [template = constants.%array_type] -// CHECK:STDOUT: %ptr: type = ptr_type %array_type [template = constants.%ptr] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { // CHECK:STDOUT: %a.patt: %i32 = binding_pattern a // CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 @@ -133,15 +86,19 @@ fn RuntimeCall(a: i32, b: i32) -> i32 { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc7_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc7_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc7_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc7_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc7_35: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc7_35: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc7_19: type = splice_block %i32.loc7_19 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc7_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc7_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %.loc7_27: type = splice_block %i32.loc7_27 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc7_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc7_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param diff --git a/toolchain/check/testdata/builtins/int/right_shift.carbon b/toolchain/check/testdata/builtins/int/right_shift.carbon index 654ed666db699..b32b0cce6901e 100644 --- a/toolchain/check/testdata/builtins/int/right_shift.carbon +++ b/toolchain/check/testdata/builtins/int/right_shift.carbon @@ -71,25 +71,6 @@ let negative: i32 = RightShift(1, Negate(1)); // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %RightShift.type.1: type = fn_type @RightShift.1 [template] // CHECK:STDOUT: %RightShift: %RightShift.type.1 = struct_value () [template] -// CHECK:STDOUT: %int_22.1: Core.IntLiteral = int_value 22 [template] -// CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_22.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_22.2: %i32 = int_value 22 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] -// CHECK:STDOUT: %int_5.1: %i32 = int_value 5 [template] -// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.3, @impl.2(%int_32) [template] -// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [template] -// CHECK:STDOUT: %interface.6: = interface_witness (%Convert.11) [template] -// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_5.1, %Convert.11 [template] -// CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.3(%int_32) [template] // CHECK:STDOUT: %int_5.2: Core.IntLiteral = int_value 5 [template] // CHECK:STDOUT: %array_type: type = array_type %int_5.2, %i32 [template] // CHECK:STDOUT: %ptr: type = ptr_type %array_type [template] @@ -123,53 +104,25 @@ let negative: i32 = RightShift(1, Negate(1)); // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc2_18: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc2_18: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc2_26: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc2_26: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc2_34: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc2_34: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc2_18: type = splice_block %i32.loc2_18 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc2_18: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc2_18: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %.loc2_26: type = splice_block %i32.loc2_26 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc2_26: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc2_26: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %int_32.loc4: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc4: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %RightShift.ref: %RightShift.type.1 = name_ref RightShift, %RightShift.decl [template = constants.%RightShift] -// CHECK:STDOUT: %int_22: Core.IntLiteral = int_value 22 [template = constants.%int_22.1] -// CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %impl.elem0.loc4_27: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc4_27: = bound_method %int_22, %impl.elem0.loc4_27 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc4_27: = specific_function %Convert.bound.loc4_27, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc4_27: init %i32 = call %Convert.specific_fn.loc4_27(%int_22) [template = constants.%int_22.2] -// CHECK:STDOUT: %.loc4_27.1: %i32 = value_of_initializer %int.convert_checked.loc4_27 [template = constants.%int_22.2] -// CHECK:STDOUT: %.loc4_27.2: %i32 = converted %int_22, %.loc4_27.1 [template = constants.%int_22.2] -// CHECK:STDOUT: %impl.elem0.loc4_31: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc4_31: = bound_method %int_2, %impl.elem0.loc4_31 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc4_31: = specific_function %Convert.bound.loc4_31, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] -// CHECK:STDOUT: %int.convert_checked.loc4_31: init %i32 = call %Convert.specific_fn.loc4_31(%int_2) [template = constants.%int_2.2] -// CHECK:STDOUT: %.loc4_31.1: %i32 = value_of_initializer %int.convert_checked.loc4_31 [template = constants.%int_2.2] -// CHECK:STDOUT: %.loc4_31.2: %i32 = converted %int_2, %.loc4_31.1 [template = constants.%int_2.2] -// CHECK:STDOUT: %int.right_shift: init %i32 = call %RightShift.ref(%.loc4_27.2, %.loc4_31.2) [template = constants.%int_5.1] -// CHECK:STDOUT: %impl.elem0.loc4_32: %Convert.type.5 = interface_witness_access constants.%interface.6, element0 [template = constants.%Convert.11] -// CHECK:STDOUT: %Convert.bound.loc4_32: = bound_method %int.right_shift, %impl.elem0.loc4_32 [template = constants.%Convert.bound.3] -// CHECK:STDOUT: %Convert.specific_fn.loc4_32: = specific_function %Convert.bound.loc4_32, @Convert.3(constants.%int_32) [template = constants.%Convert.specific_fn.3] -// CHECK:STDOUT: %.loc4_32.1: %i32 = value_of_initializer %int.right_shift [template = constants.%int_5.1] -// CHECK:STDOUT: %.loc4_32.2: %i32 = converted %int.right_shift, %.loc4_32.1 [template = constants.%int_5.1] -// CHECK:STDOUT: %int.convert_checked.loc4_32: init Core.IntLiteral = call %Convert.specific_fn.loc4_32(%.loc4_32.2) [template = constants.%int_5.2] -// CHECK:STDOUT: %.loc4_32.3: Core.IntLiteral = value_of_initializer %int.convert_checked.loc4_32 [template = constants.%int_5.2] -// CHECK:STDOUT: %.loc4_32.4: Core.IntLiteral = converted %int.right_shift, %.loc4_32.3 [template = constants.%int_5.2] -// CHECK:STDOUT: %array_type.loc4: type = array_type %.loc4_32.4, %i32 [template = constants.%array_type] // CHECK:STDOUT: %arr.var: ref %array_type = var arr // CHECK:STDOUT: %arr: ref %array_type = bind_name arr, %arr.var -// CHECK:STDOUT: %int_32.loc5: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc5: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_5: Core.IntLiteral = int_value 5 [template = constants.%int_5.2] -// CHECK:STDOUT: %array_type.loc5: type = array_type %int_5, %i32 [template = constants.%array_type] -// CHECK:STDOUT: %ptr: type = ptr_type %array_type [template = constants.%ptr] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { // CHECK:STDOUT: %a.patt: %i32 = binding_pattern a // CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 @@ -178,15 +131,19 @@ let negative: i32 = RightShift(1, Negate(1)); // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc7_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc7_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc7_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc7_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc7_35: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc7_35: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc7_19: type = splice_block %i32.loc7_19 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc7_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc7_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %.loc7_27: type = splice_block %i32.loc7_27 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc7_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc7_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -224,35 +181,8 @@ let negative: i32 = RightShift(1, Negate(1)); // CHECK:STDOUT: %Negate.type.1: type = fn_type @Negate.1 [template] // CHECK:STDOUT: %Negate: %Negate.type.1 = struct_value () [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] -// CHECK:STDOUT: %int_-1: %i32 = int_value -1 [template] -// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.3, @impl.2(%int_32) [template] -// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [template] -// CHECK:STDOUT: %interface.6: = interface_witness (%Convert.11) [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_1.2, %Convert.11 [template] -// CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.3(%int_32) [template] // CHECK:STDOUT: %array_type.1: type = array_type %int_1.1, %i32 [template] // CHECK:STDOUT: %ptr.1: type = ptr_type %array_type.1 [template] -// CHECK:STDOUT: %int_10.1: Core.IntLiteral = int_value 10 [template] -// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_10.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_10.2: %i32 = int_value 10 [template] -// CHECK:STDOUT: %int_-10: %i32 = int_value -10 [template] -// CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %Convert.bound.4: = bound_method %int_2.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.4: = specific_function %Convert.bound.4, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] -// CHECK:STDOUT: %int_-3: %i32 = int_value -3 [template] -// CHECK:STDOUT: %int_3.1: %i32 = int_value 3 [template] -// CHECK:STDOUT: %Convert.bound.5: = bound_method %int_3.1, %Convert.11 [template] -// CHECK:STDOUT: %Convert.specific_fn.5: = specific_function %Convert.bound.5, @Convert.3(%int_32) [template] // CHECK:STDOUT: %int_3.2: Core.IntLiteral = int_value 3 [template] // CHECK:STDOUT: %array_type.2: type = array_type %int_3.2, %i32 [template] // CHECK:STDOUT: %ptr.2: type = ptr_type %array_type.2 [template] @@ -286,15 +216,19 @@ let negative: i32 = RightShift(1, Negate(1)); // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc6_18: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc6_18: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc6_26: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc6_26: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc6_34: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc6_34: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc6_18: type = splice_block %i32.loc6_18 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc6_18: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc6_18: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %.loc6_26: type = splice_block %i32.loc6_26 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc6_26: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc6_26: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -305,99 +239,21 @@ let negative: i32 = RightShift(1, Negate(1)); // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc7_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc7_14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc7_22: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc7_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc7: type = splice_block %i32.loc7_14 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc7_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc7_14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %int_32.loc10: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc10: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %Negate.ref.loc10_17: %Negate.type.1 = name_ref Negate, %Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %RightShift.ref.loc10: %RightShift.type.1 = name_ref RightShift, %RightShift.decl [template = constants.%RightShift] -// CHECK:STDOUT: %Negate.ref.loc10_35: %Negate.type.1 = name_ref Negate, %Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %int_1.loc10_42: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc10_42: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc10_42: = bound_method %int_1.loc10_42, %impl.elem0.loc10_42 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc10_42: = specific_function %Convert.bound.loc10_42, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc10_42: init %i32 = call %Convert.specific_fn.loc10_42(%int_1.loc10_42) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc10_42.1: %i32 = value_of_initializer %int.convert_checked.loc10_42 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc10_42.2: %i32 = converted %int_1.loc10_42, %.loc10_42.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %int.snegate.loc10_43: init %i32 = call %Negate.ref.loc10_35(%.loc10_42.2) [template = constants.%int_-1] -// CHECK:STDOUT: %int_1.loc10_46: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %.loc10_43.1: %i32 = value_of_initializer %int.snegate.loc10_43 [template = constants.%int_-1] -// CHECK:STDOUT: %.loc10_43.2: %i32 = converted %int.snegate.loc10_43, %.loc10_43.1 [template = constants.%int_-1] -// CHECK:STDOUT: %impl.elem0.loc10_46: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc10_46: = bound_method %int_1.loc10_46, %impl.elem0.loc10_46 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc10_46: = specific_function %Convert.bound.loc10_46, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc10_46: init %i32 = call %Convert.specific_fn.loc10_46(%int_1.loc10_46) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc10_46.1: %i32 = value_of_initializer %int.convert_checked.loc10_46 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc10_46.2: %i32 = converted %int_1.loc10_46, %.loc10_46.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %int.right_shift.loc10: init %i32 = call %RightShift.ref.loc10(%.loc10_43.2, %.loc10_46.2) [template = constants.%int_-1] -// CHECK:STDOUT: %.loc10_47.1: %i32 = value_of_initializer %int.right_shift.loc10 [template = constants.%int_-1] -// CHECK:STDOUT: %.loc10_47.2: %i32 = converted %int.right_shift.loc10, %.loc10_47.1 [template = constants.%int_-1] -// CHECK:STDOUT: %int.snegate.loc10_48: init %i32 = call %Negate.ref.loc10_17(%.loc10_47.2) [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc10_48: %Convert.type.5 = interface_witness_access constants.%interface.6, element0 [template = constants.%Convert.11] -// CHECK:STDOUT: %Convert.bound.loc10_48: = bound_method %int.snegate.loc10_48, %impl.elem0.loc10_48 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc10_48: = specific_function %Convert.bound.loc10_48, @Convert.3(constants.%int_32) [template = constants.%Convert.specific_fn.2] -// CHECK:STDOUT: %.loc10_48.1: %i32 = value_of_initializer %int.snegate.loc10_48 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc10_48.2: %i32 = converted %int.snegate.loc10_48, %.loc10_48.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %int.convert_checked.loc10_48: init Core.IntLiteral = call %Convert.specific_fn.loc10_48(%.loc10_48.2) [template = constants.%int_1.1] -// CHECK:STDOUT: %.loc10_48.3: Core.IntLiteral = value_of_initializer %int.convert_checked.loc10_48 [template = constants.%int_1.1] -// CHECK:STDOUT: %.loc10_48.4: Core.IntLiteral = converted %int.snegate.loc10_48, %.loc10_48.3 [template = constants.%int_1.1] -// CHECK:STDOUT: %array_type.loc10: type = array_type %.loc10_48.4, %i32 [template = constants.%array_type.1] // CHECK:STDOUT: %arr1.var: ref %array_type.1 = var arr1 // CHECK:STDOUT: %arr1: ref %array_type.1 = bind_name arr1, %arr1.var -// CHECK:STDOUT: %int_32.loc11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_1.loc11: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %array_type.loc11: type = array_type %int_1.loc11, %i32 [template = constants.%array_type.1] -// CHECK:STDOUT: %ptr.loc11: type = ptr_type %array_type.1 [template = constants.%ptr.1] -// CHECK:STDOUT: %int_32.loc14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %Negate.ref.loc14_17: %Negate.type.1 = name_ref Negate, %Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %RightShift.ref.loc14: %RightShift.type.1 = name_ref RightShift, %RightShift.decl [template = constants.%RightShift] -// CHECK:STDOUT: %Negate.ref.loc14_35: %Negate.type.1 = name_ref Negate, %Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %int_10: Core.IntLiteral = int_value 10 [template = constants.%int_10.1] -// CHECK:STDOUT: %impl.elem0.loc14_42: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc14_42: = bound_method %int_10, %impl.elem0.loc14_42 [template = constants.%Convert.bound.3] -// CHECK:STDOUT: %Convert.specific_fn.loc14_42: = specific_function %Convert.bound.loc14_42, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] -// CHECK:STDOUT: %int.convert_checked.loc14_42: init %i32 = call %Convert.specific_fn.loc14_42(%int_10) [template = constants.%int_10.2] -// CHECK:STDOUT: %.loc14_42.1: %i32 = value_of_initializer %int.convert_checked.loc14_42 [template = constants.%int_10.2] -// CHECK:STDOUT: %.loc14_42.2: %i32 = converted %int_10, %.loc14_42.1 [template = constants.%int_10.2] -// CHECK:STDOUT: %int.snegate.loc14_44: init %i32 = call %Negate.ref.loc14_35(%.loc14_42.2) [template = constants.%int_-10] -// CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %.loc14_44.1: %i32 = value_of_initializer %int.snegate.loc14_44 [template = constants.%int_-10] -// CHECK:STDOUT: %.loc14_44.2: %i32 = converted %int.snegate.loc14_44, %.loc14_44.1 [template = constants.%int_-10] -// CHECK:STDOUT: %impl.elem0.loc14_47: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc14_47: = bound_method %int_2, %impl.elem0.loc14_47 [template = constants.%Convert.bound.4] -// CHECK:STDOUT: %Convert.specific_fn.loc14_47: = specific_function %Convert.bound.loc14_47, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.4] -// CHECK:STDOUT: %int.convert_checked.loc14_47: init %i32 = call %Convert.specific_fn.loc14_47(%int_2) [template = constants.%int_2.2] -// CHECK:STDOUT: %.loc14_47.1: %i32 = value_of_initializer %int.convert_checked.loc14_47 [template = constants.%int_2.2] -// CHECK:STDOUT: %.loc14_47.2: %i32 = converted %int_2, %.loc14_47.1 [template = constants.%int_2.2] -// CHECK:STDOUT: %int.right_shift.loc14: init %i32 = call %RightShift.ref.loc14(%.loc14_44.2, %.loc14_47.2) [template = constants.%int_-3] -// CHECK:STDOUT: %.loc14_48.1: %i32 = value_of_initializer %int.right_shift.loc14 [template = constants.%int_-3] -// CHECK:STDOUT: %.loc14_48.2: %i32 = converted %int.right_shift.loc14, %.loc14_48.1 [template = constants.%int_-3] -// CHECK:STDOUT: %int.snegate.loc14_49: init %i32 = call %Negate.ref.loc14_17(%.loc14_48.2) [template = constants.%int_3.1] -// CHECK:STDOUT: %impl.elem0.loc14_49: %Convert.type.5 = interface_witness_access constants.%interface.6, element0 [template = constants.%Convert.11] -// CHECK:STDOUT: %Convert.bound.loc14_49: = bound_method %int.snegate.loc14_49, %impl.elem0.loc14_49 [template = constants.%Convert.bound.5] -// CHECK:STDOUT: %Convert.specific_fn.loc14_49: = specific_function %Convert.bound.loc14_49, @Convert.3(constants.%int_32) [template = constants.%Convert.specific_fn.5] -// CHECK:STDOUT: %.loc14_49.1: %i32 = value_of_initializer %int.snegate.loc14_49 [template = constants.%int_3.1] -// CHECK:STDOUT: %.loc14_49.2: %i32 = converted %int.snegate.loc14_49, %.loc14_49.1 [template = constants.%int_3.1] -// CHECK:STDOUT: %int.convert_checked.loc14_49: init Core.IntLiteral = call %Convert.specific_fn.loc14_49(%.loc14_49.2) [template = constants.%int_3.2] -// CHECK:STDOUT: %.loc14_49.3: Core.IntLiteral = value_of_initializer %int.convert_checked.loc14_49 [template = constants.%int_3.2] -// CHECK:STDOUT: %.loc14_49.4: Core.IntLiteral = converted %int.snegate.loc14_49, %.loc14_49.3 [template = constants.%int_3.2] -// CHECK:STDOUT: %array_type.loc14: type = array_type %.loc14_49.4, %i32 [template = constants.%array_type.2] // CHECK:STDOUT: %arr2.var: ref %array_type.2 = var arr2 // CHECK:STDOUT: %arr2: ref %array_type.2 = bind_name arr2, %arr2.var -// CHECK:STDOUT: %int_32.loc15: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc15: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3.2] -// CHECK:STDOUT: %array_type.loc15: type = array_type %int_3, %i32 [template = constants.%array_type.2] -// CHECK:STDOUT: %ptr.loc15: type = ptr_type %array_type.2 [template = constants.%ptr.2] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @RightShift.1(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.right_shift"; @@ -475,15 +331,19 @@ let negative: i32 = RightShift(1, Negate(1)); // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc4_18: Core.IntLiteral = int_value 32 [template = constants.%int_32.1] -// CHECK:STDOUT: %i32.loc4_18: type = class_type @Int, @Int(constants.%int_32.1) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc4_26: Core.IntLiteral = int_value 32 [template = constants.%int_32.1] -// CHECK:STDOUT: %i32.loc4_26: type = class_type @Int, @Int(constants.%int_32.1) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc4_34: Core.IntLiteral = int_value 32 [template = constants.%int_32.1] // CHECK:STDOUT: %i32.loc4_34: type = class_type @Int, @Int(constants.%int_32.1) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc4_18: type = splice_block %i32.loc4_18 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc4_18: Core.IntLiteral = int_value 32 [template = constants.%int_32.1] +// CHECK:STDOUT: %i32.loc4_18: type = class_type @Int, @Int(constants.%int_32.1) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %.loc4_26: type = splice_block %i32.loc4_26 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc4_26: Core.IntLiteral = int_value 32 [template = constants.%int_32.1] +// CHECK:STDOUT: %i32.loc4_26: type = class_type @Int, @Int(constants.%int_32.1) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -494,23 +354,17 @@ let negative: i32 = RightShift(1, Negate(1)); // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc5_14: Core.IntLiteral = int_value 32 [template = constants.%int_32.1] -// CHECK:STDOUT: %i32.loc5_14: type = class_type @Int, @Int(constants.%int_32.1) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc5_22: Core.IntLiteral = int_value 32 [template = constants.%int_32.1] // CHECK:STDOUT: %i32.loc5_22: type = class_type @Int, @Int(constants.%int_32.1) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc5: type = splice_block %i32.loc5_14 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc5_14: Core.IntLiteral = int_value 32 [template = constants.%int_32.1] +// CHECK:STDOUT: %i32.loc5_14: type = class_type @Int, @Int(constants.%int_32.1) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %int_32.loc8: Core.IntLiteral = int_value 32 [template = constants.%int_32.1] -// CHECK:STDOUT: %i32.loc8: type = class_type @Int, @Int(constants.%int_32.1) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc13: Core.IntLiteral = int_value 32 [template = constants.%int_32.1] -// CHECK:STDOUT: %i32.loc13: type = class_type @Int, @Int(constants.%int_32.1) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc18: Core.IntLiteral = int_value 32 [template = constants.%int_32.1] -// CHECK:STDOUT: %i32.loc18: type = class_type @Int, @Int(constants.%int_32.1) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc24: Core.IntLiteral = int_value 32 [template = constants.%int_32.1] -// CHECK:STDOUT: %i32.loc24: type = class_type @Int, @Int(constants.%int_32.1) [template = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @RightShift.1(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.right_shift"; diff --git a/toolchain/check/testdata/builtins/int/sadd.carbon b/toolchain/check/testdata/builtins/int/sadd.carbon index 2e9e4df436a39..0737efcc02746 100644 --- a/toolchain/check/testdata/builtins/int/sadd.carbon +++ b/toolchain/check/testdata/builtins/int/sadd.carbon @@ -96,25 +96,6 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %Add.type.1: type = fn_type @Add.1 [template] // CHECK:STDOUT: %Add: %Add.type.1 = struct_value () [template] -// CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] -// CHECK:STDOUT: %int_3.1: %i32 = int_value 3 [template] -// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.3, @impl.2(%int_32) [template] -// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [template] -// CHECK:STDOUT: %interface.6: = interface_witness (%Convert.11) [template] -// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_3.1, %Convert.11 [template] -// CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.3(%int_32) [template] // CHECK:STDOUT: %int_3.2: Core.IntLiteral = int_value 3 [template] // CHECK:STDOUT: %array_type: type = array_type %int_3.2, %i32 [template] // CHECK:STDOUT: %ptr: type = ptr_type %array_type [template] @@ -148,53 +129,25 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc2_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc2_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc2_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc2_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc2_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc2_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc2_11: type = splice_block %i32.loc2_11 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc2_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc2_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %.loc2_19: type = splice_block %i32.loc2_19 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc2_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc2_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %int_32.loc4: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc4: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %Add.ref: %Add.type.1 = name_ref Add, %Add.decl [template = constants.%Add] -// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %impl.elem0.loc4_20: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc4_20: = bound_method %int_1, %impl.elem0.loc4_20 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc4_20: = specific_function %Convert.bound.loc4_20, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc4_20: init %i32 = call %Convert.specific_fn.loc4_20(%int_1) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc4_20.1: %i32 = value_of_initializer %int.convert_checked.loc4_20 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc4_20.2: %i32 = converted %int_1, %.loc4_20.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc4_23: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc4_23: = bound_method %int_2, %impl.elem0.loc4_23 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc4_23: = specific_function %Convert.bound.loc4_23, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] -// CHECK:STDOUT: %int.convert_checked.loc4_23: init %i32 = call %Convert.specific_fn.loc4_23(%int_2) [template = constants.%int_2.2] -// CHECK:STDOUT: %.loc4_23.1: %i32 = value_of_initializer %int.convert_checked.loc4_23 [template = constants.%int_2.2] -// CHECK:STDOUT: %.loc4_23.2: %i32 = converted %int_2, %.loc4_23.1 [template = constants.%int_2.2] -// CHECK:STDOUT: %int.sadd: init %i32 = call %Add.ref(%.loc4_20.2, %.loc4_23.2) [template = constants.%int_3.1] -// CHECK:STDOUT: %impl.elem0.loc4_24: %Convert.type.5 = interface_witness_access constants.%interface.6, element0 [template = constants.%Convert.11] -// CHECK:STDOUT: %Convert.bound.loc4_24: = bound_method %int.sadd, %impl.elem0.loc4_24 [template = constants.%Convert.bound.3] -// CHECK:STDOUT: %Convert.specific_fn.loc4_24: = specific_function %Convert.bound.loc4_24, @Convert.3(constants.%int_32) [template = constants.%Convert.specific_fn.3] -// CHECK:STDOUT: %.loc4_24.1: %i32 = value_of_initializer %int.sadd [template = constants.%int_3.1] -// CHECK:STDOUT: %.loc4_24.2: %i32 = converted %int.sadd, %.loc4_24.1 [template = constants.%int_3.1] -// CHECK:STDOUT: %int.convert_checked.loc4_24: init Core.IntLiteral = call %Convert.specific_fn.loc4_24(%.loc4_24.2) [template = constants.%int_3.2] -// CHECK:STDOUT: %.loc4_24.3: Core.IntLiteral = value_of_initializer %int.convert_checked.loc4_24 [template = constants.%int_3.2] -// CHECK:STDOUT: %.loc4_24.4: Core.IntLiteral = converted %int.sadd, %.loc4_24.3 [template = constants.%int_3.2] -// CHECK:STDOUT: %array_type.loc4: type = array_type %.loc4_24.4, %i32 [template = constants.%array_type] // CHECK:STDOUT: %arr.var: ref %array_type = var arr // CHECK:STDOUT: %arr: ref %array_type = bind_name arr, %arr.var -// CHECK:STDOUT: %int_32.loc5: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc5: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3.2] -// CHECK:STDOUT: %array_type.loc5: type = array_type %int_3, %i32 [template = constants.%array_type] -// CHECK:STDOUT: %ptr: type = ptr_type %array_type [template = constants.%ptr] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { // CHECK:STDOUT: %a.patt: %i32 = binding_pattern a // CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 @@ -203,15 +156,19 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc7_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc7_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc7_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc7_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc7_35: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc7_35: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc7_19: type = splice_block %i32.loc7_19 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc7_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc7_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %.loc7_27: type = splice_block %i32.loc7_27 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc7_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc7_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -254,22 +211,6 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: %BadReturnType: %BadReturnType.type = struct_value () [template] // CHECK:STDOUT: %JustRight.type: type = fn_type @JustRight [template] // CHECK:STDOUT: %JustRight: %JustRight.type = struct_value () [template] -// CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] -// CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %int_3.1: Core.IntLiteral = int_value 3 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] -// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_3.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_3.2: %i32 = int_value 3 [template] // CHECK:STDOUT: %RuntimeCallTooFew.type: type = fn_type @RuntimeCallTooFew [template] // CHECK:STDOUT: %RuntimeCallTooFew: %RuntimeCallTooFew.type = struct_value () [template] // CHECK:STDOUT: %RuntimeCallTooMany.type: type = fn_type @RuntimeCallTooMany [template] @@ -310,11 +251,13 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc8_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc8_14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc8_22: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc8_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc8: type = splice_block %i32.loc8_14 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc8_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc8_14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -329,19 +272,25 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param3 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc13_15: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc13_15: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc13_23: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc13_23: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc13_31: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc13_31: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc13_39: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc13_39: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc13_15: type = splice_block %i32.loc13_15 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc13_15: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc13_15: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %.loc13_23: type = splice_block %i32.loc13_23 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc13_23: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc13_23: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %c.param: %i32 = value_param runtime_param2 +// CHECK:STDOUT: %.loc13_31: type = splice_block %i32.loc13_31 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc13_31: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc13_31: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %c: %i32 = bind_name c, %c.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param3 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -354,16 +303,20 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: %return.patt: bool = return_slot_pattern // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc18_21: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc18_21: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc18_29: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc18_29: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc18_37.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc18_37.2: type = converted %bool.make_type, %.loc18_37.1 [template = bool] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc18_21: type = splice_block %i32.loc18_21 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc18_21: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc18_21: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %.loc18_29: type = splice_block %i32.loc18_29 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc18_29: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc18_29: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param @@ -376,86 +329,29 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc19_17: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc19_17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc19_25: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc19_25: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc19_33: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc19_33: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc19_17: type = splice_block %i32.loc19_17 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc19_17: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc19_17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %.loc19_25: type = splice_block %i32.loc19_25 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc19_25: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc19_25: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %int_32.loc25: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc25: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %TooFew.ref: %TooFew.type = name_ref TooFew, %TooFew.decl [template = constants.%TooFew] -// CHECK:STDOUT: %int_1.loc25: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc25: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc25: = bound_method %int_1.loc25, %impl.elem0.loc25 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc25: = specific_function %Convert.bound.loc25, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc25: init %i32 = call %Convert.specific_fn.loc25(%int_1.loc25) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc25_27.1: %i32 = value_of_initializer %int.convert_checked.loc25 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc25_27.2: %i32 = converted %int_1.loc25, %.loc25_27.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %TooFew.call: init %i32 = call %TooFew.ref(%.loc25_27.2) // CHECK:STDOUT: %too_few.var: ref = var too_few // CHECK:STDOUT: %too_few: ref = bind_name too_few, %too_few.var -// CHECK:STDOUT: %int_32.loc30: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc30: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %TooMany.ref: %TooMany.type = name_ref TooMany, %TooMany.decl [template = constants.%TooMany] -// CHECK:STDOUT: %int_1.loc30: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %int_2.loc30: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %int_3.loc30: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] -// CHECK:STDOUT: %impl.elem0.loc30_29: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc30_29: = bound_method %int_1.loc30, %impl.elem0.loc30_29 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc30_29: = specific_function %Convert.bound.loc30_29, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc30_29: init %i32 = call %Convert.specific_fn.loc30_29(%int_1.loc30) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc30_29.1: %i32 = value_of_initializer %int.convert_checked.loc30_29 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc30_29.2: %i32 = converted %int_1.loc30, %.loc30_29.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc30_32: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc30_32: = bound_method %int_2.loc30, %impl.elem0.loc30_32 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc30_32: = specific_function %Convert.bound.loc30_32, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] -// CHECK:STDOUT: %int.convert_checked.loc30_32: init %i32 = call %Convert.specific_fn.loc30_32(%int_2.loc30) [template = constants.%int_2.2] -// CHECK:STDOUT: %.loc30_32.1: %i32 = value_of_initializer %int.convert_checked.loc30_32 [template = constants.%int_2.2] -// CHECK:STDOUT: %.loc30_32.2: %i32 = converted %int_2.loc30, %.loc30_32.1 [template = constants.%int_2.2] -// CHECK:STDOUT: %impl.elem0.loc30_35: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc30_35: = bound_method %int_3.loc30, %impl.elem0.loc30_35 [template = constants.%Convert.bound.3] -// CHECK:STDOUT: %Convert.specific_fn.loc30_35: = specific_function %Convert.bound.loc30_35, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] -// CHECK:STDOUT: %int.convert_checked.loc30_35: init %i32 = call %Convert.specific_fn.loc30_35(%int_3.loc30) [template = constants.%int_3.2] -// CHECK:STDOUT: %.loc30_35.1: %i32 = value_of_initializer %int.convert_checked.loc30_35 [template = constants.%int_3.2] -// CHECK:STDOUT: %.loc30_35.2: %i32 = converted %int_3.loc30, %.loc30_35.1 [template = constants.%int_3.2] -// CHECK:STDOUT: %TooMany.call: init %i32 = call %TooMany.ref(%.loc30_29.2, %.loc30_32.2, %.loc30_35.2) // CHECK:STDOUT: %too_many.var: ref = var too_many // CHECK:STDOUT: %too_many: ref = bind_name too_many, %too_many.var -// CHECK:STDOUT: %int_32.loc35: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc35: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %BadReturnType.ref: %BadReturnType.type = name_ref BadReturnType, %BadReturnType.decl [template = constants.%BadReturnType] -// CHECK:STDOUT: %int_1.loc35: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %int_2.loc35: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %impl.elem0.loc35_42: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc35_42: = bound_method %int_1.loc35, %impl.elem0.loc35_42 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc35_42: = specific_function %Convert.bound.loc35_42, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc35_42: init %i32 = call %Convert.specific_fn.loc35_42(%int_1.loc35) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc35_42.1: %i32 = value_of_initializer %int.convert_checked.loc35_42 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc35_42.2: %i32 = converted %int_1.loc35, %.loc35_42.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc35_45: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc35_45: = bound_method %int_2.loc35, %impl.elem0.loc35_45 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc35_45: = specific_function %Convert.bound.loc35_45, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] -// CHECK:STDOUT: %int.convert_checked.loc35_45: init %i32 = call %Convert.specific_fn.loc35_45(%int_2.loc35) [template = constants.%int_2.2] -// CHECK:STDOUT: %.loc35_45.1: %i32 = value_of_initializer %int.convert_checked.loc35_45 [template = constants.%int_2.2] -// CHECK:STDOUT: %.loc35_45.2: %i32 = converted %int_2.loc35, %.loc35_45.1 [template = constants.%int_2.2] -// CHECK:STDOUT: %BadReturnType.call: init bool = call %BadReturnType.ref(%.loc35_42.2, %.loc35_45.2) // CHECK:STDOUT: %bad_return_type.var: ref = var bad_return_type // CHECK:STDOUT: %bad_return_type: ref = bind_name bad_return_type, %bad_return_type.var -// CHECK:STDOUT: %int_32.loc44: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc44: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %JustRight.ref: %JustRight.type = name_ref JustRight, %JustRight.decl [template = constants.%JustRight] -// CHECK:STDOUT: %int_1.loc44: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %int_2.loc44: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %int_3.loc44: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] -// CHECK:STDOUT: %array_type: type = array_type , %i32 [template = ] // CHECK:STDOUT: %bad_call.var: ref = var bad_call // CHECK:STDOUT: %bad_call: ref = bind_name bad_call, %bad_call.var // CHECK:STDOUT: %RuntimeCallTooFew.decl: %RuntimeCallTooFew.type = fn_decl @RuntimeCallTooFew [template = constants.%RuntimeCallTooFew] { @@ -464,11 +360,13 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc46_25: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc46_25: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc46_33: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc46_33: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc46: type = splice_block %i32.loc46_25 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc46_25: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc46_25: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -483,19 +381,25 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param3 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc50_26: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc50_26: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc50_34: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc50_34: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc50_42: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc50_42: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc50_50: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc50_50: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc50_26: type = splice_block %i32.loc50_26 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc50_26: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc50_26: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %.loc50_34: type = splice_block %i32.loc50_34 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc50_34: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc50_34: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %c.param: %i32 = value_param runtime_param2 +// CHECK:STDOUT: %.loc50_42: type = splice_block %i32.loc50_42 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc50_42: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc50_42: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %c: %i32 = bind_name c, %c.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param3 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -508,16 +412,20 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: %return.patt: bool = return_slot_pattern // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc54_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc54_32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc54_40: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc54_40: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc54_48.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc54_48.2: type = converted %bool.make_type, %.loc54_48.1 [template = bool] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc54_32: type = splice_block %i32.loc54_32 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc54_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc54_32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %.loc54_40: type = splice_block %i32.loc54_40 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc54_40: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc54_40: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param @@ -616,23 +524,23 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc4_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc4_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc4_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc4_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc4_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc4_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc4_11: type = splice_block %i32.loc4_11 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc4_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc4_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %.loc4_19: type = splice_block %i32.loc4_19 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc4_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc4_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %int_32.loc6: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc6: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc10: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc10: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Add.1(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.sadd"; diff --git a/toolchain/check/testdata/builtins/int/sdiv.carbon b/toolchain/check/testdata/builtins/int/sdiv.carbon index a834a6133611e..c5cbd9c2a52e1 100644 --- a/toolchain/check/testdata/builtins/int/sdiv.carbon +++ b/toolchain/check/testdata/builtins/int/sdiv.carbon @@ -64,25 +64,6 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %Div.type.1: type = fn_type @Div.1 [template] // CHECK:STDOUT: %Div: %Div.type.1 = struct_value () [template] -// CHECK:STDOUT: %int_3.1: Core.IntLiteral = int_value 3 [template] -// CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_3.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_3.2: %i32 = int_value 3 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] -// CHECK:STDOUT: %int_1.1: %i32 = int_value 1 [template] -// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.3, @impl.2(%int_32) [template] -// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [template] -// CHECK:STDOUT: %interface.6: = interface_witness (%Convert.11) [template] -// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_1.1, %Convert.11 [template] -// CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.3(%int_32) [template] // CHECK:STDOUT: %int_1.2: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %array_type: type = array_type %int_1.2, %i32 [template] // CHECK:STDOUT: %ptr: type = ptr_type %array_type [template] @@ -116,53 +97,25 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc2_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc2_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc2_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc2_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc2_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc2_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc2_11: type = splice_block %i32.loc2_11 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc2_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc2_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %.loc2_19: type = splice_block %i32.loc2_19 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc2_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc2_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %int_32.loc4: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc4: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %Div.ref: %Div.type.1 = name_ref Div, %Div.decl [template = constants.%Div] -// CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] -// CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %impl.elem0.loc4_20: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc4_20: = bound_method %int_3, %impl.elem0.loc4_20 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc4_20: = specific_function %Convert.bound.loc4_20, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc4_20: init %i32 = call %Convert.specific_fn.loc4_20(%int_3) [template = constants.%int_3.2] -// CHECK:STDOUT: %.loc4_20.1: %i32 = value_of_initializer %int.convert_checked.loc4_20 [template = constants.%int_3.2] -// CHECK:STDOUT: %.loc4_20.2: %i32 = converted %int_3, %.loc4_20.1 [template = constants.%int_3.2] -// CHECK:STDOUT: %impl.elem0.loc4_23: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc4_23: = bound_method %int_2, %impl.elem0.loc4_23 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc4_23: = specific_function %Convert.bound.loc4_23, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] -// CHECK:STDOUT: %int.convert_checked.loc4_23: init %i32 = call %Convert.specific_fn.loc4_23(%int_2) [template = constants.%int_2.2] -// CHECK:STDOUT: %.loc4_23.1: %i32 = value_of_initializer %int.convert_checked.loc4_23 [template = constants.%int_2.2] -// CHECK:STDOUT: %.loc4_23.2: %i32 = converted %int_2, %.loc4_23.1 [template = constants.%int_2.2] -// CHECK:STDOUT: %int.sdiv: init %i32 = call %Div.ref(%.loc4_20.2, %.loc4_23.2) [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc4_24: %Convert.type.5 = interface_witness_access constants.%interface.6, element0 [template = constants.%Convert.11] -// CHECK:STDOUT: %Convert.bound.loc4_24: = bound_method %int.sdiv, %impl.elem0.loc4_24 [template = constants.%Convert.bound.3] -// CHECK:STDOUT: %Convert.specific_fn.loc4_24: = specific_function %Convert.bound.loc4_24, @Convert.3(constants.%int_32) [template = constants.%Convert.specific_fn.3] -// CHECK:STDOUT: %.loc4_24.1: %i32 = value_of_initializer %int.sdiv [template = constants.%int_1.1] -// CHECK:STDOUT: %.loc4_24.2: %i32 = converted %int.sdiv, %.loc4_24.1 [template = constants.%int_1.1] -// CHECK:STDOUT: %int.convert_checked.loc4_24: init Core.IntLiteral = call %Convert.specific_fn.loc4_24(%.loc4_24.2) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc4_24.3: Core.IntLiteral = value_of_initializer %int.convert_checked.loc4_24 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc4_24.4: Core.IntLiteral = converted %int.sdiv, %.loc4_24.3 [template = constants.%int_1.2] -// CHECK:STDOUT: %array_type.loc4: type = array_type %.loc4_24.4, %i32 [template = constants.%array_type] // CHECK:STDOUT: %arr.var: ref %array_type = var arr // CHECK:STDOUT: %arr: ref %array_type = bind_name arr, %arr.var -// CHECK:STDOUT: %int_32.loc5: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc5: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.2] -// CHECK:STDOUT: %array_type.loc5: type = array_type %int_1, %i32 [template = constants.%array_type] -// CHECK:STDOUT: %ptr: type = ptr_type %array_type [template = constants.%ptr] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { // CHECK:STDOUT: %a.patt: %i32 = binding_pattern a // CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 @@ -171,15 +124,19 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc7_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc7_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc7_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc7_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc7_35: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc7_35: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc7_19: type = splice_block %i32.loc7_19 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc7_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc7_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %.loc7_27: type = splice_block %i32.loc7_27 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc7_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc7_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -263,15 +220,19 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc4_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc4_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc4_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc4_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc4_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc4_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc4_11: type = splice_block %i32.loc4_11 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc4_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc4_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %.loc4_19: type = splice_block %i32.loc4_19 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc4_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc4_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -284,15 +245,19 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc5_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc5_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc5_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc5_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc5_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc5_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc5_11: type = splice_block %i32.loc5_11 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc5_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc5_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %.loc5_19: type = splice_block %i32.loc5_19 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc5_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc5_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -303,21 +268,17 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc6_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc6_14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc6_22: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc6_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc6: type = splice_block %i32.loc6_14 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc6_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc6_14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %int_32.loc9: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc9: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc12: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc12: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Div.1(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.sdiv"; @@ -476,23 +437,23 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc4_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc4_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc4_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc4_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc4_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc4_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc4_11: type = splice_block %i32.loc4_11 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc4_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc4_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %.loc4_19: type = splice_block %i32.loc4_19 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc4_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc4_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %int_32.loc10: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc10: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc15: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc15: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Div.1(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.sdiv"; diff --git a/toolchain/check/testdata/builtins/int/smod.carbon b/toolchain/check/testdata/builtins/int/smod.carbon index 514490a086f0f..e529f6346131a 100644 --- a/toolchain/check/testdata/builtins/int/smod.carbon +++ b/toolchain/check/testdata/builtins/int/smod.carbon @@ -67,25 +67,6 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %Mod.type.1: type = fn_type @Mod.1 [template] // CHECK:STDOUT: %Mod: %Mod.type.1 = struct_value () [template] -// CHECK:STDOUT: %int_5.1: Core.IntLiteral = int_value 5 [template] -// CHECK:STDOUT: %int_3.1: Core.IntLiteral = int_value 3 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_5.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_5.2: %i32 = int_value 5 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_3.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_3.2: %i32 = int_value 3 [template] -// CHECK:STDOUT: %int_2.1: %i32 = int_value 2 [template] -// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.3, @impl.2(%int_32) [template] -// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [template] -// CHECK:STDOUT: %interface.6: = interface_witness (%Convert.11) [template] -// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_2.1, %Convert.11 [template] -// CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.3(%int_32) [template] // CHECK:STDOUT: %int_2.2: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %array_type: type = array_type %int_2.2, %i32 [template] // CHECK:STDOUT: %ptr: type = ptr_type %array_type [template] @@ -119,53 +100,25 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc2_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc2_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc2_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc2_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc2_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc2_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc2_11: type = splice_block %i32.loc2_11 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc2_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc2_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %.loc2_19: type = splice_block %i32.loc2_19 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc2_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc2_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %int_32.loc4: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc4: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %Mod.ref: %Mod.type.1 = name_ref Mod, %Mod.decl [template = constants.%Mod] -// CHECK:STDOUT: %int_5: Core.IntLiteral = int_value 5 [template = constants.%int_5.1] -// CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] -// CHECK:STDOUT: %impl.elem0.loc4_20: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc4_20: = bound_method %int_5, %impl.elem0.loc4_20 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc4_20: = specific_function %Convert.bound.loc4_20, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc4_20: init %i32 = call %Convert.specific_fn.loc4_20(%int_5) [template = constants.%int_5.2] -// CHECK:STDOUT: %.loc4_20.1: %i32 = value_of_initializer %int.convert_checked.loc4_20 [template = constants.%int_5.2] -// CHECK:STDOUT: %.loc4_20.2: %i32 = converted %int_5, %.loc4_20.1 [template = constants.%int_5.2] -// CHECK:STDOUT: %impl.elem0.loc4_23: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc4_23: = bound_method %int_3, %impl.elem0.loc4_23 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc4_23: = specific_function %Convert.bound.loc4_23, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] -// CHECK:STDOUT: %int.convert_checked.loc4_23: init %i32 = call %Convert.specific_fn.loc4_23(%int_3) [template = constants.%int_3.2] -// CHECK:STDOUT: %.loc4_23.1: %i32 = value_of_initializer %int.convert_checked.loc4_23 [template = constants.%int_3.2] -// CHECK:STDOUT: %.loc4_23.2: %i32 = converted %int_3, %.loc4_23.1 [template = constants.%int_3.2] -// CHECK:STDOUT: %int.smod: init %i32 = call %Mod.ref(%.loc4_20.2, %.loc4_23.2) [template = constants.%int_2.1] -// CHECK:STDOUT: %impl.elem0.loc4_24: %Convert.type.5 = interface_witness_access constants.%interface.6, element0 [template = constants.%Convert.11] -// CHECK:STDOUT: %Convert.bound.loc4_24: = bound_method %int.smod, %impl.elem0.loc4_24 [template = constants.%Convert.bound.3] -// CHECK:STDOUT: %Convert.specific_fn.loc4_24: = specific_function %Convert.bound.loc4_24, @Convert.3(constants.%int_32) [template = constants.%Convert.specific_fn.3] -// CHECK:STDOUT: %.loc4_24.1: %i32 = value_of_initializer %int.smod [template = constants.%int_2.1] -// CHECK:STDOUT: %.loc4_24.2: %i32 = converted %int.smod, %.loc4_24.1 [template = constants.%int_2.1] -// CHECK:STDOUT: %int.convert_checked.loc4_24: init Core.IntLiteral = call %Convert.specific_fn.loc4_24(%.loc4_24.2) [template = constants.%int_2.2] -// CHECK:STDOUT: %.loc4_24.3: Core.IntLiteral = value_of_initializer %int.convert_checked.loc4_24 [template = constants.%int_2.2] -// CHECK:STDOUT: %.loc4_24.4: Core.IntLiteral = converted %int.smod, %.loc4_24.3 [template = constants.%int_2.2] -// CHECK:STDOUT: %array_type.loc4: type = array_type %.loc4_24.4, %i32 [template = constants.%array_type] // CHECK:STDOUT: %arr.var: ref %array_type = var arr // CHECK:STDOUT: %arr: ref %array_type = bind_name arr, %arr.var -// CHECK:STDOUT: %int_32.loc5: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc5: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.2] -// CHECK:STDOUT: %array_type.loc5: type = array_type %int_2, %i32 [template = constants.%array_type] -// CHECK:STDOUT: %ptr: type = ptr_type %array_type [template = constants.%ptr] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { // CHECK:STDOUT: %a.patt: %i32 = binding_pattern a // CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 @@ -174,15 +127,19 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc7_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc7_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc7_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc7_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc7_35: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc7_35: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc7_19: type = splice_block %i32.loc7_19 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc7_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc7_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %.loc7_27: type = splice_block %i32.loc7_27 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc7_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc7_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -267,15 +224,19 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc4_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc4_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc4_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc4_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc4_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc4_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc4_11: type = splice_block %i32.loc4_11 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc4_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc4_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %.loc4_19: type = splice_block %i32.loc4_19 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc4_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc4_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -288,15 +249,19 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc5_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc5_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc5_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc5_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc5_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc5_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc5_11: type = splice_block %i32.loc5_11 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc5_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc5_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %.loc5_19: type = splice_block %i32.loc5_19 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc5_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc5_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -307,21 +272,17 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc6_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc6_14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc6_22: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc6_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc6: type = splice_block %i32.loc6_14 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc6_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc6_14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %int_32.loc9: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc9: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc12: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc12: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc20: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc20: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Mod.1(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.smod"; @@ -480,23 +441,23 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc4_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc4_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc4_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc4_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc4_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc4_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc4_11: type = splice_block %i32.loc4_11 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc4_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc4_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %.loc4_19: type = splice_block %i32.loc4_19 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc4_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc4_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %int_32.loc12: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc12: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc17: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Mod.1(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.smod"; diff --git a/toolchain/check/testdata/builtins/int/smul.carbon b/toolchain/check/testdata/builtins/int/smul.carbon index 28c34a728c36e..72b5cb63472bf 100644 --- a/toolchain/check/testdata/builtins/int/smul.carbon +++ b/toolchain/check/testdata/builtins/int/smul.carbon @@ -38,25 +38,6 @@ let b: i32 = Mul(0x8000, 0x10000); // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %Mul.type.1: type = fn_type @Mul.1 [template] // CHECK:STDOUT: %Mul: %Mul.type.1 = struct_value () [template] -// CHECK:STDOUT: %int_3.1: Core.IntLiteral = int_value 3 [template] -// CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_3.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_3.2: %i32 = int_value 3 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] -// CHECK:STDOUT: %int_6.1: %i32 = int_value 6 [template] -// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.3, @impl.2(%int_32) [template] -// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [template] -// CHECK:STDOUT: %interface.6: = interface_witness (%Convert.11) [template] -// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_6.1, %Convert.11 [template] -// CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.3(%int_32) [template] // CHECK:STDOUT: %int_6.2: Core.IntLiteral = int_value 6 [template] // CHECK:STDOUT: %array_type: type = array_type %int_6.2, %i32 [template] // CHECK:STDOUT: %ptr: type = ptr_type %array_type [template] @@ -90,53 +71,25 @@ let b: i32 = Mul(0x8000, 0x10000); // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc2_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc2_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc2_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc2_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc2_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc2_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc2_11: type = splice_block %i32.loc2_11 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc2_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc2_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %.loc2_19: type = splice_block %i32.loc2_19 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc2_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc2_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %int_32.loc4: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc4: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %Mul.ref: %Mul.type.1 = name_ref Mul, %Mul.decl [template = constants.%Mul] -// CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] -// CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %impl.elem0.loc4_20: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc4_20: = bound_method %int_3, %impl.elem0.loc4_20 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc4_20: = specific_function %Convert.bound.loc4_20, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc4_20: init %i32 = call %Convert.specific_fn.loc4_20(%int_3) [template = constants.%int_3.2] -// CHECK:STDOUT: %.loc4_20.1: %i32 = value_of_initializer %int.convert_checked.loc4_20 [template = constants.%int_3.2] -// CHECK:STDOUT: %.loc4_20.2: %i32 = converted %int_3, %.loc4_20.1 [template = constants.%int_3.2] -// CHECK:STDOUT: %impl.elem0.loc4_23: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc4_23: = bound_method %int_2, %impl.elem0.loc4_23 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc4_23: = specific_function %Convert.bound.loc4_23, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] -// CHECK:STDOUT: %int.convert_checked.loc4_23: init %i32 = call %Convert.specific_fn.loc4_23(%int_2) [template = constants.%int_2.2] -// CHECK:STDOUT: %.loc4_23.1: %i32 = value_of_initializer %int.convert_checked.loc4_23 [template = constants.%int_2.2] -// CHECK:STDOUT: %.loc4_23.2: %i32 = converted %int_2, %.loc4_23.1 [template = constants.%int_2.2] -// CHECK:STDOUT: %int.smul: init %i32 = call %Mul.ref(%.loc4_20.2, %.loc4_23.2) [template = constants.%int_6.1] -// CHECK:STDOUT: %impl.elem0.loc4_24: %Convert.type.5 = interface_witness_access constants.%interface.6, element0 [template = constants.%Convert.11] -// CHECK:STDOUT: %Convert.bound.loc4_24: = bound_method %int.smul, %impl.elem0.loc4_24 [template = constants.%Convert.bound.3] -// CHECK:STDOUT: %Convert.specific_fn.loc4_24: = specific_function %Convert.bound.loc4_24, @Convert.3(constants.%int_32) [template = constants.%Convert.specific_fn.3] -// CHECK:STDOUT: %.loc4_24.1: %i32 = value_of_initializer %int.smul [template = constants.%int_6.1] -// CHECK:STDOUT: %.loc4_24.2: %i32 = converted %int.smul, %.loc4_24.1 [template = constants.%int_6.1] -// CHECK:STDOUT: %int.convert_checked.loc4_24: init Core.IntLiteral = call %Convert.specific_fn.loc4_24(%.loc4_24.2) [template = constants.%int_6.2] -// CHECK:STDOUT: %.loc4_24.3: Core.IntLiteral = value_of_initializer %int.convert_checked.loc4_24 [template = constants.%int_6.2] -// CHECK:STDOUT: %.loc4_24.4: Core.IntLiteral = converted %int.smul, %.loc4_24.3 [template = constants.%int_6.2] -// CHECK:STDOUT: %array_type.loc4: type = array_type %.loc4_24.4, %i32 [template = constants.%array_type] // CHECK:STDOUT: %arr.var: ref %array_type = var arr // CHECK:STDOUT: %arr: ref %array_type = bind_name arr, %arr.var -// CHECK:STDOUT: %int_32.loc5: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc5: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_6: Core.IntLiteral = int_value 6 [template = constants.%int_6.2] -// CHECK:STDOUT: %array_type.loc5: type = array_type %int_6, %i32 [template = constants.%array_type] -// CHECK:STDOUT: %ptr: type = ptr_type %array_type [template = constants.%ptr] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { // CHECK:STDOUT: %a.patt: %i32 = binding_pattern a // CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 @@ -145,15 +98,19 @@ let b: i32 = Mul(0x8000, 0x10000); // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc7_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc7_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc7_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc7_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc7_35: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc7_35: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc7_19: type = splice_block %i32.loc7_19 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc7_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc7_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %.loc7_27: type = splice_block %i32.loc7_27 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc7_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc7_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -233,23 +190,23 @@ let b: i32 = Mul(0x8000, 0x10000); // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc4_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc4_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc4_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc4_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc4_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc4_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc4_11: type = splice_block %i32.loc4_11 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc4_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc4_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %.loc4_19: type = splice_block %i32.loc4_19 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc4_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc4_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %int_32.loc6: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc6: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc10: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc10: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Mul.1(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.smul"; diff --git a/toolchain/check/testdata/builtins/int/snegate.carbon b/toolchain/check/testdata/builtins/int/snegate.carbon index 78e436b3f7fc1..829736364d21a 100644 --- a/toolchain/check/testdata/builtins/int/snegate.carbon +++ b/toolchain/check/testdata/builtins/int/snegate.carbon @@ -125,19 +125,9 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %Negate: %Negate.type.1 = struct_value () [template] // CHECK:STDOUT: %int_123.1: Core.IntLiteral = int_value 123 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] // CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_123.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_123.2: %i32 = int_value 123 [template] -// CHECK:STDOUT: %int_-123: %i32 = int_value -123 [template] -// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.3, @impl.2(%int_32) [template] -// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [template] -// CHECK:STDOUT: %interface.6: = interface_witness (%Convert.11) [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_123.2, %Convert.11 [template] -// CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.3(%int_32) [template] // CHECK:STDOUT: %array_type: type = array_type %int_123.1, %i32 [template] // CHECK:STDOUT: %ptr: type = ptr_type %array_type [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] @@ -174,48 +164,19 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc2_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc2_14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc2_22: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc2_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc2: type = splice_block %i32.loc2_14 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc2_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc2_14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %int_32.loc4: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc4: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %Negate.ref.loc4_16: %Negate.type.1 = name_ref Negate, %Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %Negate.ref.loc4_23: %Negate.type.1 = name_ref Negate, %Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %int_123.loc4: Core.IntLiteral = int_value 123 [template = constants.%int_123.1] -// CHECK:STDOUT: %impl.elem0.loc4_30: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc4_30: = bound_method %int_123.loc4, %impl.elem0.loc4_30 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc4_30: = specific_function %Convert.bound.loc4_30, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc4_30: init %i32 = call %Convert.specific_fn.loc4_30(%int_123.loc4) [template = constants.%int_123.2] -// CHECK:STDOUT: %.loc4_30.1: %i32 = value_of_initializer %int.convert_checked.loc4_30 [template = constants.%int_123.2] -// CHECK:STDOUT: %.loc4_30.2: %i32 = converted %int_123.loc4, %.loc4_30.1 [template = constants.%int_123.2] -// CHECK:STDOUT: %int.snegate.loc4_33: init %i32 = call %Negate.ref.loc4_23(%.loc4_30.2) [template = constants.%int_-123] -// CHECK:STDOUT: %.loc4_33.1: %i32 = value_of_initializer %int.snegate.loc4_33 [template = constants.%int_-123] -// CHECK:STDOUT: %.loc4_33.2: %i32 = converted %int.snegate.loc4_33, %.loc4_33.1 [template = constants.%int_-123] -// CHECK:STDOUT: %int.snegate.loc4_34: init %i32 = call %Negate.ref.loc4_16(%.loc4_33.2) [template = constants.%int_123.2] -// CHECK:STDOUT: %impl.elem0.loc4_34: %Convert.type.5 = interface_witness_access constants.%interface.6, element0 [template = constants.%Convert.11] -// CHECK:STDOUT: %Convert.bound.loc4_34: = bound_method %int.snegate.loc4_34, %impl.elem0.loc4_34 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc4_34: = specific_function %Convert.bound.loc4_34, @Convert.3(constants.%int_32) [template = constants.%Convert.specific_fn.2] -// CHECK:STDOUT: %.loc4_34.1: %i32 = value_of_initializer %int.snegate.loc4_34 [template = constants.%int_123.2] -// CHECK:STDOUT: %.loc4_34.2: %i32 = converted %int.snegate.loc4_34, %.loc4_34.1 [template = constants.%int_123.2] -// CHECK:STDOUT: %int.convert_checked.loc4_34: init Core.IntLiteral = call %Convert.specific_fn.loc4_34(%.loc4_34.2) [template = constants.%int_123.1] -// CHECK:STDOUT: %.loc4_34.3: Core.IntLiteral = value_of_initializer %int.convert_checked.loc4_34 [template = constants.%int_123.1] -// CHECK:STDOUT: %.loc4_34.4: Core.IntLiteral = converted %int.snegate.loc4_34, %.loc4_34.3 [template = constants.%int_123.1] -// CHECK:STDOUT: %array_type.loc4: type = array_type %.loc4_34.4, %i32 [template = constants.%array_type] // CHECK:STDOUT: %arr.var: ref %array_type = var arr // CHECK:STDOUT: %arr: ref %array_type = bind_name arr, %arr.var -// CHECK:STDOUT: %int_32.loc5: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc5: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_123.loc5: Core.IntLiteral = int_value 123 [template = constants.%int_123.1] -// CHECK:STDOUT: %array_type.loc5: type = array_type %int_123.loc5, %i32 [template = constants.%array_type] -// CHECK:STDOUT: %ptr: type = ptr_type %array_type [template = constants.%ptr] -// CHECK:STDOUT: %int_32.loc7: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc7: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { // CHECK:STDOUT: %a.patt: %i32 = binding_pattern a // CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 @@ -224,15 +185,19 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc9_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc9_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc9_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc9_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc9_35: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc9_35: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc9_19: type = splice_block %i32.loc9_19 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc9_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc9_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %.loc9_27: type = splice_block %i32.loc9_27 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc9_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc9_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -286,18 +251,6 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %BadReturnType: %BadReturnType.type = struct_value () [template] // CHECK:STDOUT: %JustRight.type: type = fn_type @JustRight [template] // CHECK:STDOUT: %JustRight: %JustRight.type = struct_value () [template] -// CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] // CHECK:STDOUT: %RuntimeCallTooFew.type: type = fn_type @RuntimeCallTooFew [template] // CHECK:STDOUT: %RuntimeCallTooFew: %RuntimeCallTooFew.type = struct_value () [template] // CHECK:STDOUT: %RuntimeCallTooMany.type: type = fn_type @RuntimeCallTooMany [template] @@ -349,15 +302,19 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc13_15: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc13_15: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc13_23: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc13_23: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc13_31: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc13_31: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc13_15: type = splice_block %i32.loc13_15 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc13_15: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc13_15: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %.loc13_23: type = splice_block %i32.loc13_23 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc13_23: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc13_23: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -368,12 +325,14 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %return.patt: bool = return_slot_pattern // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc18_29.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc18_29.2: type = converted %bool.make_type, %.loc18_29.1 [template = bool] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc18_21: type = splice_block %i32 [template = constants.%i32] { +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param1 // CHECK:STDOUT: %return: ref bool = return_slot %return.param @@ -384,60 +343,23 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc19_17: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc19_17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc19_25: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc19_25: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc19: type = splice_block %i32.loc19_17 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc19_17: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc19_17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %int_32.loc25: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc25: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %TooFew.ref: %TooFew.type = name_ref TooFew, %TooFew.decl [template = constants.%TooFew] -// CHECK:STDOUT: %TooFew.call: init %i32 = call %TooFew.ref() // CHECK:STDOUT: %too_few.var: ref = var too_few // CHECK:STDOUT: %too_few: ref = bind_name too_few, %too_few.var -// CHECK:STDOUT: %int_32.loc30: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc30: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %TooMany.ref: %TooMany.type = name_ref TooMany, %TooMany.decl [template = constants.%TooMany] -// CHECK:STDOUT: %int_1.loc30: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %int_2.loc30: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %impl.elem0.loc30_29: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc30_29: = bound_method %int_1.loc30, %impl.elem0.loc30_29 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc30_29: = specific_function %Convert.bound.loc30_29, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc30_29: init %i32 = call %Convert.specific_fn.loc30_29(%int_1.loc30) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc30_29.1: %i32 = value_of_initializer %int.convert_checked.loc30_29 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc30_29.2: %i32 = converted %int_1.loc30, %.loc30_29.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc30_32: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc30_32: = bound_method %int_2.loc30, %impl.elem0.loc30_32 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc30_32: = specific_function %Convert.bound.loc30_32, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] -// CHECK:STDOUT: %int.convert_checked.loc30_32: init %i32 = call %Convert.specific_fn.loc30_32(%int_2.loc30) [template = constants.%int_2.2] -// CHECK:STDOUT: %.loc30_32.1: %i32 = value_of_initializer %int.convert_checked.loc30_32 [template = constants.%int_2.2] -// CHECK:STDOUT: %.loc30_32.2: %i32 = converted %int_2.loc30, %.loc30_32.1 [template = constants.%int_2.2] -// CHECK:STDOUT: %TooMany.call: init %i32 = call %TooMany.ref(%.loc30_29.2, %.loc30_32.2) // CHECK:STDOUT: %too_many.var: ref = var too_many // CHECK:STDOUT: %too_many: ref = bind_name too_many, %too_many.var -// CHECK:STDOUT: %int_32.loc35: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc35: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %BadReturnType.ref: %BadReturnType.type = name_ref BadReturnType, %BadReturnType.decl [template = constants.%BadReturnType] -// CHECK:STDOUT: %int_1.loc35: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc35: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc35: = bound_method %int_1.loc35, %impl.elem0.loc35 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc35: = specific_function %Convert.bound.loc35, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc35: init %i32 = call %Convert.specific_fn.loc35(%int_1.loc35) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc35_42.1: %i32 = value_of_initializer %int.convert_checked.loc35 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc35_42.2: %i32 = converted %int_1.loc35, %.loc35_42.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %BadReturnType.call: init bool = call %BadReturnType.ref(%.loc35_42.2) // CHECK:STDOUT: %bad_return_type.var: ref = var bad_return_type // CHECK:STDOUT: %bad_return_type: ref = bind_name bad_return_type, %bad_return_type.var -// CHECK:STDOUT: %int_32.loc44: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc44: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %JustRight.ref: %JustRight.type = name_ref JustRight, %JustRight.decl [template = constants.%JustRight] -// CHECK:STDOUT: %int_1.loc44: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %int_2.loc44: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %array_type: type = array_type , %i32 [template = ] // CHECK:STDOUT: %bad_call.var: ref = var bad_call // CHECK:STDOUT: %bad_call: ref = bind_name bad_call, %bad_call.var // CHECK:STDOUT: %RuntimeCallTooFew.decl: %RuntimeCallTooFew.type = fn_decl @RuntimeCallTooFew [template = constants.%RuntimeCallTooFew] { @@ -446,11 +368,13 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc46_25: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc46_25: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc46_33: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc46_33: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc46: type = splice_block %i32.loc46_25 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc46_25: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc46_25: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -465,19 +389,25 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param3 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc57_26: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc57_26: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc57_34: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc57_34: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc57_42: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc57_42: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc57_50: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc57_50: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc57_26: type = splice_block %i32.loc57_26 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc57_26: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc57_26: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %.loc57_34: type = splice_block %i32.loc57_34 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc57_34: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc57_34: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %c.param: %i32 = value_param runtime_param2 +// CHECK:STDOUT: %.loc57_42: type = splice_block %i32.loc57_42 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc57_42: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc57_42: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %c: %i32 = bind_name c, %c.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param3 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -490,16 +420,20 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %return.patt: bool = return_slot_pattern // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc68_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc68_32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc68_40: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc68_40: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc68_48.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc68_48.2: type = converted %bool.make_type, %.loc68_48.1 [template = bool] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc68_32: type = splice_block %i32.loc68_32 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc68_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc68_32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %.loc68_40: type = splice_block %i32.loc68_40 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc68_40: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc68_40: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param @@ -587,11 +521,13 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc4_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc4_14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc4_22: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc4_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc4: type = splice_block %i32.loc4_14 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc4_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc4_14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -604,23 +540,23 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc5_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc5_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc5_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc5_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc5_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc5_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc5_11: type = splice_block %i32.loc5_11 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc5_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc5_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %.loc5_19: type = splice_block %i32.loc5_19 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc5_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc5_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %int_32.loc8: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc8: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Negate.1(%a.param_patt: %i32) -> %i32 = "int.snegate"; diff --git a/toolchain/check/testdata/builtins/int/ssub.carbon b/toolchain/check/testdata/builtins/int/ssub.carbon index 946ff54e71424..308e79c50eb2d 100644 --- a/toolchain/check/testdata/builtins/int/ssub.carbon +++ b/toolchain/check/testdata/builtins/int/ssub.carbon @@ -39,25 +39,6 @@ let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %Sub.type.1: type = fn_type @Sub.1 [template] // CHECK:STDOUT: %Sub: %Sub.type.1 = struct_value () [template] -// CHECK:STDOUT: %int_3.1: Core.IntLiteral = int_value 3 [template] -// CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_3.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_3.2: %i32 = int_value 3 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] -// CHECK:STDOUT: %int_1.1: %i32 = int_value 1 [template] -// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.3, @impl.2(%int_32) [template] -// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [template] -// CHECK:STDOUT: %interface.6: = interface_witness (%Convert.11) [template] -// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_1.1, %Convert.11 [template] -// CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.3(%int_32) [template] // CHECK:STDOUT: %int_1.2: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %array_type: type = array_type %int_1.2, %i32 [template] // CHECK:STDOUT: %ptr: type = ptr_type %array_type [template] @@ -91,53 +72,25 @@ let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc2_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc2_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc2_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc2_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc2_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc2_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc2_11: type = splice_block %i32.loc2_11 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc2_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc2_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %.loc2_19: type = splice_block %i32.loc2_19 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc2_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc2_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %int_32.loc4: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc4: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %Sub.ref: %Sub.type.1 = name_ref Sub, %Sub.decl [template = constants.%Sub] -// CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] -// CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %impl.elem0.loc4_20: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc4_20: = bound_method %int_3, %impl.elem0.loc4_20 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc4_20: = specific_function %Convert.bound.loc4_20, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc4_20: init %i32 = call %Convert.specific_fn.loc4_20(%int_3) [template = constants.%int_3.2] -// CHECK:STDOUT: %.loc4_20.1: %i32 = value_of_initializer %int.convert_checked.loc4_20 [template = constants.%int_3.2] -// CHECK:STDOUT: %.loc4_20.2: %i32 = converted %int_3, %.loc4_20.1 [template = constants.%int_3.2] -// CHECK:STDOUT: %impl.elem0.loc4_23: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc4_23: = bound_method %int_2, %impl.elem0.loc4_23 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc4_23: = specific_function %Convert.bound.loc4_23, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] -// CHECK:STDOUT: %int.convert_checked.loc4_23: init %i32 = call %Convert.specific_fn.loc4_23(%int_2) [template = constants.%int_2.2] -// CHECK:STDOUT: %.loc4_23.1: %i32 = value_of_initializer %int.convert_checked.loc4_23 [template = constants.%int_2.2] -// CHECK:STDOUT: %.loc4_23.2: %i32 = converted %int_2, %.loc4_23.1 [template = constants.%int_2.2] -// CHECK:STDOUT: %int.ssub: init %i32 = call %Sub.ref(%.loc4_20.2, %.loc4_23.2) [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc4_24: %Convert.type.5 = interface_witness_access constants.%interface.6, element0 [template = constants.%Convert.11] -// CHECK:STDOUT: %Convert.bound.loc4_24: = bound_method %int.ssub, %impl.elem0.loc4_24 [template = constants.%Convert.bound.3] -// CHECK:STDOUT: %Convert.specific_fn.loc4_24: = specific_function %Convert.bound.loc4_24, @Convert.3(constants.%int_32) [template = constants.%Convert.specific_fn.3] -// CHECK:STDOUT: %.loc4_24.1: %i32 = value_of_initializer %int.ssub [template = constants.%int_1.1] -// CHECK:STDOUT: %.loc4_24.2: %i32 = converted %int.ssub, %.loc4_24.1 [template = constants.%int_1.1] -// CHECK:STDOUT: %int.convert_checked.loc4_24: init Core.IntLiteral = call %Convert.specific_fn.loc4_24(%.loc4_24.2) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc4_24.3: Core.IntLiteral = value_of_initializer %int.convert_checked.loc4_24 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc4_24.4: Core.IntLiteral = converted %int.ssub, %.loc4_24.3 [template = constants.%int_1.2] -// CHECK:STDOUT: %array_type.loc4: type = array_type %.loc4_24.4, %i32 [template = constants.%array_type] // CHECK:STDOUT: %arr.var: ref %array_type = var arr // CHECK:STDOUT: %arr: ref %array_type = bind_name arr, %arr.var -// CHECK:STDOUT: %int_32.loc5: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc5: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.2] -// CHECK:STDOUT: %array_type.loc5: type = array_type %int_1, %i32 [template = constants.%array_type] -// CHECK:STDOUT: %ptr: type = ptr_type %array_type [template = constants.%ptr] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { // CHECK:STDOUT: %a.patt: %i32 = binding_pattern a // CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 @@ -146,15 +99,19 @@ let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc7_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc7_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc7_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc7_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc7_35: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc7_35: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc7_19: type = splice_block %i32.loc7_19 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc7_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc7_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %.loc7_27: type = splice_block %i32.loc7_27 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc7_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc7_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -239,25 +196,23 @@ let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc4_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc4_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc4_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc4_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc4_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc4_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc4_11: type = splice_block %i32.loc4_11 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc4_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc4_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %.loc4_19: type = splice_block %i32.loc4_19 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc4_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc4_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %int_32.loc6: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc6: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc7: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc7: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Sub.1(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.ssub"; diff --git a/toolchain/check/testdata/builtins/int/uadd.carbon b/toolchain/check/testdata/builtins/int/uadd.carbon index 4d45c1f842dea..67a4fdf8ddef9 100644 --- a/toolchain/check/testdata/builtins/int/uadd.carbon +++ b/toolchain/check/testdata/builtins/int/uadd.carbon @@ -93,25 +93,6 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %Add.type.1: type = fn_type @Add.1 [template] // CHECK:STDOUT: %Add: %Add.type.1 = struct_value () [template] -// CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] -// CHECK:STDOUT: %int_3.1: %i32 = int_value 3 [template] -// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.3, @impl.2(%int_32) [template] -// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [template] -// CHECK:STDOUT: %interface.6: = interface_witness (%Convert.11) [template] -// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_3.1, %Convert.11 [template] -// CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.3(%int_32) [template] // CHECK:STDOUT: %int_3.2: Core.IntLiteral = int_value 3 [template] // CHECK:STDOUT: %array_type: type = array_type %int_3.2, %i32 [template] // CHECK:STDOUT: %ptr: type = ptr_type %array_type [template] @@ -145,53 +126,25 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc2_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc2_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc2_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc2_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc2_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc2_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc2_11: type = splice_block %i32.loc2_11 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc2_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc2_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %.loc2_19: type = splice_block %i32.loc2_19 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc2_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc2_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %int_32.loc4: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc4: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %Add.ref: %Add.type.1 = name_ref Add, %Add.decl [template = constants.%Add] -// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %impl.elem0.loc4_20: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc4_20: = bound_method %int_1, %impl.elem0.loc4_20 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc4_20: = specific_function %Convert.bound.loc4_20, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc4_20: init %i32 = call %Convert.specific_fn.loc4_20(%int_1) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc4_20.1: %i32 = value_of_initializer %int.convert_checked.loc4_20 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc4_20.2: %i32 = converted %int_1, %.loc4_20.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc4_23: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc4_23: = bound_method %int_2, %impl.elem0.loc4_23 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc4_23: = specific_function %Convert.bound.loc4_23, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] -// CHECK:STDOUT: %int.convert_checked.loc4_23: init %i32 = call %Convert.specific_fn.loc4_23(%int_2) [template = constants.%int_2.2] -// CHECK:STDOUT: %.loc4_23.1: %i32 = value_of_initializer %int.convert_checked.loc4_23 [template = constants.%int_2.2] -// CHECK:STDOUT: %.loc4_23.2: %i32 = converted %int_2, %.loc4_23.1 [template = constants.%int_2.2] -// CHECK:STDOUT: %int.uadd: init %i32 = call %Add.ref(%.loc4_20.2, %.loc4_23.2) [template = constants.%int_3.1] -// CHECK:STDOUT: %impl.elem0.loc4_24: %Convert.type.5 = interface_witness_access constants.%interface.6, element0 [template = constants.%Convert.11] -// CHECK:STDOUT: %Convert.bound.loc4_24: = bound_method %int.uadd, %impl.elem0.loc4_24 [template = constants.%Convert.bound.3] -// CHECK:STDOUT: %Convert.specific_fn.loc4_24: = specific_function %Convert.bound.loc4_24, @Convert.3(constants.%int_32) [template = constants.%Convert.specific_fn.3] -// CHECK:STDOUT: %.loc4_24.1: %i32 = value_of_initializer %int.uadd [template = constants.%int_3.1] -// CHECK:STDOUT: %.loc4_24.2: %i32 = converted %int.uadd, %.loc4_24.1 [template = constants.%int_3.1] -// CHECK:STDOUT: %int.convert_checked.loc4_24: init Core.IntLiteral = call %Convert.specific_fn.loc4_24(%.loc4_24.2) [template = constants.%int_3.2] -// CHECK:STDOUT: %.loc4_24.3: Core.IntLiteral = value_of_initializer %int.convert_checked.loc4_24 [template = constants.%int_3.2] -// CHECK:STDOUT: %.loc4_24.4: Core.IntLiteral = converted %int.uadd, %.loc4_24.3 [template = constants.%int_3.2] -// CHECK:STDOUT: %array_type.loc4: type = array_type %.loc4_24.4, %i32 [template = constants.%array_type] // CHECK:STDOUT: %arr.var: ref %array_type = var arr // CHECK:STDOUT: %arr: ref %array_type = bind_name arr, %arr.var -// CHECK:STDOUT: %int_32.loc5: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc5: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3.2] -// CHECK:STDOUT: %array_type.loc5: type = array_type %int_3, %i32 [template = constants.%array_type] -// CHECK:STDOUT: %ptr: type = ptr_type %array_type [template = constants.%ptr] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { // CHECK:STDOUT: %a.patt: %i32 = binding_pattern a // CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 @@ -200,15 +153,19 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc7_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc7_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc7_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc7_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc7_35: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc7_35: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc7_19: type = splice_block %i32.loc7_19 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc7_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc7_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %.loc7_27: type = splice_block %i32.loc7_27 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc7_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc7_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -251,22 +208,6 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: %BadReturnType: %BadReturnType.type = struct_value () [template] // CHECK:STDOUT: %JustRight.type: type = fn_type @JustRight [template] // CHECK:STDOUT: %JustRight: %JustRight.type = struct_value () [template] -// CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] -// CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %int_3.1: Core.IntLiteral = int_value 3 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] -// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_3.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_3.2: %i32 = int_value 3 [template] // CHECK:STDOUT: %RuntimeCallTooFew.type: type = fn_type @RuntimeCallTooFew [template] // CHECK:STDOUT: %RuntimeCallTooFew: %RuntimeCallTooFew.type = struct_value () [template] // CHECK:STDOUT: %RuntimeCallTooMany.type: type = fn_type @RuntimeCallTooMany [template] @@ -307,11 +248,13 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc8_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc8_14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc8_22: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc8_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc8: type = splice_block %i32.loc8_14 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc8_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc8_14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -326,19 +269,25 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param3 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc13_15: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc13_15: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc13_23: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc13_23: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc13_31: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc13_31: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc13_39: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc13_39: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc13_15: type = splice_block %i32.loc13_15 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc13_15: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc13_15: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %.loc13_23: type = splice_block %i32.loc13_23 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc13_23: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc13_23: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %c.param: %i32 = value_param runtime_param2 +// CHECK:STDOUT: %.loc13_31: type = splice_block %i32.loc13_31 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc13_31: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc13_31: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %c: %i32 = bind_name c, %c.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param3 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -351,16 +300,20 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: %return.patt: bool = return_slot_pattern // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc18_21: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc18_21: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc18_29: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc18_29: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc18_37.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc18_37.2: type = converted %bool.make_type, %.loc18_37.1 [template = bool] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc18_21: type = splice_block %i32.loc18_21 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc18_21: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc18_21: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %.loc18_29: type = splice_block %i32.loc18_29 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc18_29: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc18_29: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param @@ -373,86 +326,29 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc19_17: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc19_17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc19_25: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc19_25: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc19_33: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc19_33: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc19_17: type = splice_block %i32.loc19_17 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc19_17: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc19_17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %.loc19_25: type = splice_block %i32.loc19_25 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc19_25: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc19_25: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %int_32.loc25: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc25: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %TooFew.ref: %TooFew.type = name_ref TooFew, %TooFew.decl [template = constants.%TooFew] -// CHECK:STDOUT: %int_1.loc25: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc25: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc25: = bound_method %int_1.loc25, %impl.elem0.loc25 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc25: = specific_function %Convert.bound.loc25, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc25: init %i32 = call %Convert.specific_fn.loc25(%int_1.loc25) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc25_27.1: %i32 = value_of_initializer %int.convert_checked.loc25 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc25_27.2: %i32 = converted %int_1.loc25, %.loc25_27.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %TooFew.call: init %i32 = call %TooFew.ref(%.loc25_27.2) // CHECK:STDOUT: %too_few.var: ref = var too_few // CHECK:STDOUT: %too_few: ref = bind_name too_few, %too_few.var -// CHECK:STDOUT: %int_32.loc30: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc30: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %TooMany.ref: %TooMany.type = name_ref TooMany, %TooMany.decl [template = constants.%TooMany] -// CHECK:STDOUT: %int_1.loc30: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %int_2.loc30: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %int_3.loc30: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] -// CHECK:STDOUT: %impl.elem0.loc30_29: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc30_29: = bound_method %int_1.loc30, %impl.elem0.loc30_29 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc30_29: = specific_function %Convert.bound.loc30_29, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc30_29: init %i32 = call %Convert.specific_fn.loc30_29(%int_1.loc30) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc30_29.1: %i32 = value_of_initializer %int.convert_checked.loc30_29 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc30_29.2: %i32 = converted %int_1.loc30, %.loc30_29.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc30_32: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc30_32: = bound_method %int_2.loc30, %impl.elem0.loc30_32 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc30_32: = specific_function %Convert.bound.loc30_32, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] -// CHECK:STDOUT: %int.convert_checked.loc30_32: init %i32 = call %Convert.specific_fn.loc30_32(%int_2.loc30) [template = constants.%int_2.2] -// CHECK:STDOUT: %.loc30_32.1: %i32 = value_of_initializer %int.convert_checked.loc30_32 [template = constants.%int_2.2] -// CHECK:STDOUT: %.loc30_32.2: %i32 = converted %int_2.loc30, %.loc30_32.1 [template = constants.%int_2.2] -// CHECK:STDOUT: %impl.elem0.loc30_35: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc30_35: = bound_method %int_3.loc30, %impl.elem0.loc30_35 [template = constants.%Convert.bound.3] -// CHECK:STDOUT: %Convert.specific_fn.loc30_35: = specific_function %Convert.bound.loc30_35, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] -// CHECK:STDOUT: %int.convert_checked.loc30_35: init %i32 = call %Convert.specific_fn.loc30_35(%int_3.loc30) [template = constants.%int_3.2] -// CHECK:STDOUT: %.loc30_35.1: %i32 = value_of_initializer %int.convert_checked.loc30_35 [template = constants.%int_3.2] -// CHECK:STDOUT: %.loc30_35.2: %i32 = converted %int_3.loc30, %.loc30_35.1 [template = constants.%int_3.2] -// CHECK:STDOUT: %TooMany.call: init %i32 = call %TooMany.ref(%.loc30_29.2, %.loc30_32.2, %.loc30_35.2) // CHECK:STDOUT: %too_many.var: ref = var too_many // CHECK:STDOUT: %too_many: ref = bind_name too_many, %too_many.var -// CHECK:STDOUT: %int_32.loc35: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc35: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %BadReturnType.ref: %BadReturnType.type = name_ref BadReturnType, %BadReturnType.decl [template = constants.%BadReturnType] -// CHECK:STDOUT: %int_1.loc35: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %int_2.loc35: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %impl.elem0.loc35_42: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc35_42: = bound_method %int_1.loc35, %impl.elem0.loc35_42 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc35_42: = specific_function %Convert.bound.loc35_42, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc35_42: init %i32 = call %Convert.specific_fn.loc35_42(%int_1.loc35) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc35_42.1: %i32 = value_of_initializer %int.convert_checked.loc35_42 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc35_42.2: %i32 = converted %int_1.loc35, %.loc35_42.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc35_45: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc35_45: = bound_method %int_2.loc35, %impl.elem0.loc35_45 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc35_45: = specific_function %Convert.bound.loc35_45, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] -// CHECK:STDOUT: %int.convert_checked.loc35_45: init %i32 = call %Convert.specific_fn.loc35_45(%int_2.loc35) [template = constants.%int_2.2] -// CHECK:STDOUT: %.loc35_45.1: %i32 = value_of_initializer %int.convert_checked.loc35_45 [template = constants.%int_2.2] -// CHECK:STDOUT: %.loc35_45.2: %i32 = converted %int_2.loc35, %.loc35_45.1 [template = constants.%int_2.2] -// CHECK:STDOUT: %BadReturnType.call: init bool = call %BadReturnType.ref(%.loc35_42.2, %.loc35_45.2) // CHECK:STDOUT: %bad_return_type.var: ref = var bad_return_type // CHECK:STDOUT: %bad_return_type: ref = bind_name bad_return_type, %bad_return_type.var -// CHECK:STDOUT: %int_32.loc43: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc43: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %JustRight.ref: %JustRight.type = name_ref JustRight, %JustRight.decl [template = constants.%JustRight] -// CHECK:STDOUT: %int_1.loc43: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %int_2.loc43: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %int_3.loc43: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] -// CHECK:STDOUT: %array_type: type = array_type , %i32 [template = ] // CHECK:STDOUT: %bad_call.var: ref = var bad_call // CHECK:STDOUT: %bad_call: ref = bind_name bad_call, %bad_call.var // CHECK:STDOUT: %RuntimeCallTooFew.decl: %RuntimeCallTooFew.type = fn_decl @RuntimeCallTooFew [template = constants.%RuntimeCallTooFew] { @@ -461,11 +357,13 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc45_25: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc45_25: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc45_33: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc45_33: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc45: type = splice_block %i32.loc45_25 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc45_25: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc45_25: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -480,19 +378,25 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param3 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc49_26: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc49_26: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc49_34: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc49_34: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc49_42: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc49_42: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc49_50: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc49_50: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc49_26: type = splice_block %i32.loc49_26 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc49_26: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc49_26: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %.loc49_34: type = splice_block %i32.loc49_34 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc49_34: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc49_34: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %c.param: %i32 = value_param runtime_param2 +// CHECK:STDOUT: %.loc49_42: type = splice_block %i32.loc49_42 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc49_42: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc49_42: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %c: %i32 = bind_name c, %c.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param3 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -505,16 +409,20 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: %return.patt: bool = return_slot_pattern // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc53_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc53_32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc53_40: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc53_40: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc53_48.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc53_48.2: type = converted %bool.make_type, %.loc53_48.1 [template = bool] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc53_32: type = splice_block %i32.loc53_32 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc53_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc53_32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %.loc53_40: type = splice_block %i32.loc53_40 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc53_40: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc53_40: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param @@ -613,23 +521,23 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc4_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc4_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc4_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc4_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc4_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc4_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc4_11: type = splice_block %i32.loc4_11 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc4_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc4_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %.loc4_19: type = splice_block %i32.loc4_19 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc4_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc4_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %int_32.loc7: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc7: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc8: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc8: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Add.1(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.uadd"; diff --git a/toolchain/check/testdata/builtins/int/udiv.carbon b/toolchain/check/testdata/builtins/int/udiv.carbon index aa6b80315153b..1e529db8ee3a4 100644 --- a/toolchain/check/testdata/builtins/int/udiv.carbon +++ b/toolchain/check/testdata/builtins/int/udiv.carbon @@ -60,25 +60,6 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %Div.type.1: type = fn_type @Div.1 [template] // CHECK:STDOUT: %Div: %Div.type.1 = struct_value () [template] -// CHECK:STDOUT: %int_3.1: Core.IntLiteral = int_value 3 [template] -// CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_3.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_3.2: %i32 = int_value 3 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] -// CHECK:STDOUT: %int_1.1: %i32 = int_value 1 [template] -// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.3, @impl.2(%int_32) [template] -// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [template] -// CHECK:STDOUT: %interface.6: = interface_witness (%Convert.11) [template] -// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_1.1, %Convert.11 [template] -// CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.3(%int_32) [template] // CHECK:STDOUT: %int_1.2: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %array_type: type = array_type %int_1.2, %i32 [template] // CHECK:STDOUT: %ptr: type = ptr_type %array_type [template] @@ -112,53 +93,25 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc2_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc2_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc2_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc2_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc2_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc2_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc2_11: type = splice_block %i32.loc2_11 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc2_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc2_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %.loc2_19: type = splice_block %i32.loc2_19 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc2_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc2_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %int_32.loc4: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc4: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %Div.ref: %Div.type.1 = name_ref Div, %Div.decl [template = constants.%Div] -// CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] -// CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %impl.elem0.loc4_20: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc4_20: = bound_method %int_3, %impl.elem0.loc4_20 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc4_20: = specific_function %Convert.bound.loc4_20, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc4_20: init %i32 = call %Convert.specific_fn.loc4_20(%int_3) [template = constants.%int_3.2] -// CHECK:STDOUT: %.loc4_20.1: %i32 = value_of_initializer %int.convert_checked.loc4_20 [template = constants.%int_3.2] -// CHECK:STDOUT: %.loc4_20.2: %i32 = converted %int_3, %.loc4_20.1 [template = constants.%int_3.2] -// CHECK:STDOUT: %impl.elem0.loc4_23: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc4_23: = bound_method %int_2, %impl.elem0.loc4_23 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc4_23: = specific_function %Convert.bound.loc4_23, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] -// CHECK:STDOUT: %int.convert_checked.loc4_23: init %i32 = call %Convert.specific_fn.loc4_23(%int_2) [template = constants.%int_2.2] -// CHECK:STDOUT: %.loc4_23.1: %i32 = value_of_initializer %int.convert_checked.loc4_23 [template = constants.%int_2.2] -// CHECK:STDOUT: %.loc4_23.2: %i32 = converted %int_2, %.loc4_23.1 [template = constants.%int_2.2] -// CHECK:STDOUT: %int.udiv: init %i32 = call %Div.ref(%.loc4_20.2, %.loc4_23.2) [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc4_24: %Convert.type.5 = interface_witness_access constants.%interface.6, element0 [template = constants.%Convert.11] -// CHECK:STDOUT: %Convert.bound.loc4_24: = bound_method %int.udiv, %impl.elem0.loc4_24 [template = constants.%Convert.bound.3] -// CHECK:STDOUT: %Convert.specific_fn.loc4_24: = specific_function %Convert.bound.loc4_24, @Convert.3(constants.%int_32) [template = constants.%Convert.specific_fn.3] -// CHECK:STDOUT: %.loc4_24.1: %i32 = value_of_initializer %int.udiv [template = constants.%int_1.1] -// CHECK:STDOUT: %.loc4_24.2: %i32 = converted %int.udiv, %.loc4_24.1 [template = constants.%int_1.1] -// CHECK:STDOUT: %int.convert_checked.loc4_24: init Core.IntLiteral = call %Convert.specific_fn.loc4_24(%.loc4_24.2) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc4_24.3: Core.IntLiteral = value_of_initializer %int.convert_checked.loc4_24 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc4_24.4: Core.IntLiteral = converted %int.udiv, %.loc4_24.3 [template = constants.%int_1.2] -// CHECK:STDOUT: %array_type.loc4: type = array_type %.loc4_24.4, %i32 [template = constants.%array_type] // CHECK:STDOUT: %arr.var: ref %array_type = var arr // CHECK:STDOUT: %arr: ref %array_type = bind_name arr, %arr.var -// CHECK:STDOUT: %int_32.loc5: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc5: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.2] -// CHECK:STDOUT: %array_type.loc5: type = array_type %int_1, %i32 [template = constants.%array_type] -// CHECK:STDOUT: %ptr: type = ptr_type %array_type [template = constants.%ptr] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { // CHECK:STDOUT: %a.patt: %i32 = binding_pattern a // CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 @@ -167,15 +120,19 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc7_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc7_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc7_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc7_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc7_35: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc7_35: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc7_19: type = splice_block %i32.loc7_19 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc7_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc7_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %.loc7_27: type = splice_block %i32.loc7_27 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc7_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc7_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -260,15 +217,19 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc4_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc4_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc4_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc4_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc4_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc4_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc4_11: type = splice_block %i32.loc4_11 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc4_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc4_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %.loc4_19: type = splice_block %i32.loc4_19 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc4_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc4_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -281,15 +242,19 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc5_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc5_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc5_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc5_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc5_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc5_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc5_11: type = splice_block %i32.loc5_11 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc5_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc5_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %.loc5_19: type = splice_block %i32.loc5_19 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc5_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc5_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -300,21 +265,17 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc6_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc6_14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc6_22: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc6_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc6: type = splice_block %i32.loc6_14 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc6_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc6_14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %int_32.loc9: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc9: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc12: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc12: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc15: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc15: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Div.1(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.udiv"; @@ -473,23 +434,23 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc4_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc4_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc4_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc4_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc4_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc4_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc4_11: type = splice_block %i32.loc4_11 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc4_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc4_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %.loc4_19: type = splice_block %i32.loc4_19 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc4_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc4_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %int_32.loc10: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc10: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc15: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc15: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Div.1(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.udiv"; diff --git a/toolchain/check/testdata/builtins/int/umod.carbon b/toolchain/check/testdata/builtins/int/umod.carbon index 4cac02d36ec57..50060fad4c920 100644 --- a/toolchain/check/testdata/builtins/int/umod.carbon +++ b/toolchain/check/testdata/builtins/int/umod.carbon @@ -62,25 +62,6 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %Mod.type.1: type = fn_type @Mod.1 [template] // CHECK:STDOUT: %Mod: %Mod.type.1 = struct_value () [template] -// CHECK:STDOUT: %int_5.1: Core.IntLiteral = int_value 5 [template] -// CHECK:STDOUT: %int_3.1: Core.IntLiteral = int_value 3 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_5.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_5.2: %i32 = int_value 5 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_3.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_3.2: %i32 = int_value 3 [template] -// CHECK:STDOUT: %int_2.1: %i32 = int_value 2 [template] -// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.3, @impl.2(%int_32) [template] -// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [template] -// CHECK:STDOUT: %interface.6: = interface_witness (%Convert.11) [template] -// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_2.1, %Convert.11 [template] -// CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.3(%int_32) [template] // CHECK:STDOUT: %int_2.2: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %array_type: type = array_type %int_2.2, %i32 [template] // CHECK:STDOUT: %ptr: type = ptr_type %array_type [template] @@ -114,53 +95,25 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc2_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc2_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc2_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc2_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc2_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc2_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc2_11: type = splice_block %i32.loc2_11 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc2_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc2_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %.loc2_19: type = splice_block %i32.loc2_19 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc2_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc2_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %int_32.loc4: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc4: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %Mod.ref: %Mod.type.1 = name_ref Mod, %Mod.decl [template = constants.%Mod] -// CHECK:STDOUT: %int_5: Core.IntLiteral = int_value 5 [template = constants.%int_5.1] -// CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] -// CHECK:STDOUT: %impl.elem0.loc4_20: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc4_20: = bound_method %int_5, %impl.elem0.loc4_20 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc4_20: = specific_function %Convert.bound.loc4_20, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc4_20: init %i32 = call %Convert.specific_fn.loc4_20(%int_5) [template = constants.%int_5.2] -// CHECK:STDOUT: %.loc4_20.1: %i32 = value_of_initializer %int.convert_checked.loc4_20 [template = constants.%int_5.2] -// CHECK:STDOUT: %.loc4_20.2: %i32 = converted %int_5, %.loc4_20.1 [template = constants.%int_5.2] -// CHECK:STDOUT: %impl.elem0.loc4_23: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc4_23: = bound_method %int_3, %impl.elem0.loc4_23 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc4_23: = specific_function %Convert.bound.loc4_23, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] -// CHECK:STDOUT: %int.convert_checked.loc4_23: init %i32 = call %Convert.specific_fn.loc4_23(%int_3) [template = constants.%int_3.2] -// CHECK:STDOUT: %.loc4_23.1: %i32 = value_of_initializer %int.convert_checked.loc4_23 [template = constants.%int_3.2] -// CHECK:STDOUT: %.loc4_23.2: %i32 = converted %int_3, %.loc4_23.1 [template = constants.%int_3.2] -// CHECK:STDOUT: %int.umod: init %i32 = call %Mod.ref(%.loc4_20.2, %.loc4_23.2) [template = constants.%int_2.1] -// CHECK:STDOUT: %impl.elem0.loc4_24: %Convert.type.5 = interface_witness_access constants.%interface.6, element0 [template = constants.%Convert.11] -// CHECK:STDOUT: %Convert.bound.loc4_24: = bound_method %int.umod, %impl.elem0.loc4_24 [template = constants.%Convert.bound.3] -// CHECK:STDOUT: %Convert.specific_fn.loc4_24: = specific_function %Convert.bound.loc4_24, @Convert.3(constants.%int_32) [template = constants.%Convert.specific_fn.3] -// CHECK:STDOUT: %.loc4_24.1: %i32 = value_of_initializer %int.umod [template = constants.%int_2.1] -// CHECK:STDOUT: %.loc4_24.2: %i32 = converted %int.umod, %.loc4_24.1 [template = constants.%int_2.1] -// CHECK:STDOUT: %int.convert_checked.loc4_24: init Core.IntLiteral = call %Convert.specific_fn.loc4_24(%.loc4_24.2) [template = constants.%int_2.2] -// CHECK:STDOUT: %.loc4_24.3: Core.IntLiteral = value_of_initializer %int.convert_checked.loc4_24 [template = constants.%int_2.2] -// CHECK:STDOUT: %.loc4_24.4: Core.IntLiteral = converted %int.umod, %.loc4_24.3 [template = constants.%int_2.2] -// CHECK:STDOUT: %array_type.loc4: type = array_type %.loc4_24.4, %i32 [template = constants.%array_type] // CHECK:STDOUT: %arr.var: ref %array_type = var arr // CHECK:STDOUT: %arr: ref %array_type = bind_name arr, %arr.var -// CHECK:STDOUT: %int_32.loc5: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc5: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.2] -// CHECK:STDOUT: %array_type.loc5: type = array_type %int_2, %i32 [template = constants.%array_type] -// CHECK:STDOUT: %ptr: type = ptr_type %array_type [template = constants.%ptr] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { // CHECK:STDOUT: %a.patt: %i32 = binding_pattern a // CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 @@ -169,15 +122,19 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc7_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc7_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc7_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc7_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc7_35: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc7_35: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc7_19: type = splice_block %i32.loc7_19 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc7_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc7_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %.loc7_27: type = splice_block %i32.loc7_27 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc7_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc7_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -262,15 +219,19 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc4_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc4_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc4_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc4_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc4_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc4_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc4_11: type = splice_block %i32.loc4_11 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc4_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc4_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %.loc4_19: type = splice_block %i32.loc4_19 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc4_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc4_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -283,15 +244,19 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc5_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc5_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc5_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc5_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc5_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc5_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc5_11: type = splice_block %i32.loc5_11 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc5_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc5_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %.loc5_19: type = splice_block %i32.loc5_19 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc5_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc5_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -302,21 +267,17 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc6_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc6_14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc6_22: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc6_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc6: type = splice_block %i32.loc6_14 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc6_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc6_14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %int_32.loc9: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc9: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc12: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc12: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc15: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc15: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Mod.1(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.umod"; @@ -475,23 +436,23 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc4_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc4_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc4_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc4_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc4_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc4_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc4_11: type = splice_block %i32.loc4_11 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc4_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc4_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %.loc4_19: type = splice_block %i32.loc4_19 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc4_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc4_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %int_32.loc12: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc12: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc17: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Mod.1(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.umod"; diff --git a/toolchain/check/testdata/builtins/int/umul.carbon b/toolchain/check/testdata/builtins/int/umul.carbon index 87eff36d2ee55..04efd8669fa50 100644 --- a/toolchain/check/testdata/builtins/int/umul.carbon +++ b/toolchain/check/testdata/builtins/int/umul.carbon @@ -35,25 +35,6 @@ let b: i32 = Mul(0x8000, 0x10000); // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %Mul.type.1: type = fn_type @Mul.1 [template] // CHECK:STDOUT: %Mul: %Mul.type.1 = struct_value () [template] -// CHECK:STDOUT: %int_3.1: Core.IntLiteral = int_value 3 [template] -// CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_3.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_3.2: %i32 = int_value 3 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] -// CHECK:STDOUT: %int_6.1: %i32 = int_value 6 [template] -// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.3, @impl.2(%int_32) [template] -// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [template] -// CHECK:STDOUT: %interface.6: = interface_witness (%Convert.11) [template] -// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_6.1, %Convert.11 [template] -// CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.3(%int_32) [template] // CHECK:STDOUT: %int_6.2: Core.IntLiteral = int_value 6 [template] // CHECK:STDOUT: %array_type: type = array_type %int_6.2, %i32 [template] // CHECK:STDOUT: %ptr: type = ptr_type %array_type [template] @@ -87,53 +68,25 @@ let b: i32 = Mul(0x8000, 0x10000); // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc2_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc2_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc2_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc2_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc2_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc2_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc2_11: type = splice_block %i32.loc2_11 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc2_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc2_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %.loc2_19: type = splice_block %i32.loc2_19 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc2_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc2_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %int_32.loc4: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc4: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %Mul.ref: %Mul.type.1 = name_ref Mul, %Mul.decl [template = constants.%Mul] -// CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] -// CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %impl.elem0.loc4_20: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc4_20: = bound_method %int_3, %impl.elem0.loc4_20 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc4_20: = specific_function %Convert.bound.loc4_20, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc4_20: init %i32 = call %Convert.specific_fn.loc4_20(%int_3) [template = constants.%int_3.2] -// CHECK:STDOUT: %.loc4_20.1: %i32 = value_of_initializer %int.convert_checked.loc4_20 [template = constants.%int_3.2] -// CHECK:STDOUT: %.loc4_20.2: %i32 = converted %int_3, %.loc4_20.1 [template = constants.%int_3.2] -// CHECK:STDOUT: %impl.elem0.loc4_23: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc4_23: = bound_method %int_2, %impl.elem0.loc4_23 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc4_23: = specific_function %Convert.bound.loc4_23, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] -// CHECK:STDOUT: %int.convert_checked.loc4_23: init %i32 = call %Convert.specific_fn.loc4_23(%int_2) [template = constants.%int_2.2] -// CHECK:STDOUT: %.loc4_23.1: %i32 = value_of_initializer %int.convert_checked.loc4_23 [template = constants.%int_2.2] -// CHECK:STDOUT: %.loc4_23.2: %i32 = converted %int_2, %.loc4_23.1 [template = constants.%int_2.2] -// CHECK:STDOUT: %int.umul: init %i32 = call %Mul.ref(%.loc4_20.2, %.loc4_23.2) [template = constants.%int_6.1] -// CHECK:STDOUT: %impl.elem0.loc4_24: %Convert.type.5 = interface_witness_access constants.%interface.6, element0 [template = constants.%Convert.11] -// CHECK:STDOUT: %Convert.bound.loc4_24: = bound_method %int.umul, %impl.elem0.loc4_24 [template = constants.%Convert.bound.3] -// CHECK:STDOUT: %Convert.specific_fn.loc4_24: = specific_function %Convert.bound.loc4_24, @Convert.3(constants.%int_32) [template = constants.%Convert.specific_fn.3] -// CHECK:STDOUT: %.loc4_24.1: %i32 = value_of_initializer %int.umul [template = constants.%int_6.1] -// CHECK:STDOUT: %.loc4_24.2: %i32 = converted %int.umul, %.loc4_24.1 [template = constants.%int_6.1] -// CHECK:STDOUT: %int.convert_checked.loc4_24: init Core.IntLiteral = call %Convert.specific_fn.loc4_24(%.loc4_24.2) [template = constants.%int_6.2] -// CHECK:STDOUT: %.loc4_24.3: Core.IntLiteral = value_of_initializer %int.convert_checked.loc4_24 [template = constants.%int_6.2] -// CHECK:STDOUT: %.loc4_24.4: Core.IntLiteral = converted %int.umul, %.loc4_24.3 [template = constants.%int_6.2] -// CHECK:STDOUT: %array_type.loc4: type = array_type %.loc4_24.4, %i32 [template = constants.%array_type] // CHECK:STDOUT: %arr.var: ref %array_type = var arr // CHECK:STDOUT: %arr: ref %array_type = bind_name arr, %arr.var -// CHECK:STDOUT: %int_32.loc5: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc5: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_6: Core.IntLiteral = int_value 6 [template = constants.%int_6.2] -// CHECK:STDOUT: %array_type.loc5: type = array_type %int_6, %i32 [template = constants.%array_type] -// CHECK:STDOUT: %ptr: type = ptr_type %array_type [template = constants.%ptr] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { // CHECK:STDOUT: %a.patt: %i32 = binding_pattern a // CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 @@ -142,15 +95,19 @@ let b: i32 = Mul(0x8000, 0x10000); // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc7_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc7_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc7_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc7_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc7_35: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc7_35: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc7_19: type = splice_block %i32.loc7_19 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc7_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc7_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %.loc7_27: type = splice_block %i32.loc7_27 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc7_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc7_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -230,23 +187,23 @@ let b: i32 = Mul(0x8000, 0x10000); // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc4_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc4_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc4_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc4_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc4_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc4_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc4_11: type = splice_block %i32.loc4_11 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc4_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc4_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %.loc4_19: type = splice_block %i32.loc4_19 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc4_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc4_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %int_32.loc6: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc6: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc7: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc7: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Mul.1(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.umul"; diff --git a/toolchain/check/testdata/builtins/int/unegate.carbon b/toolchain/check/testdata/builtins/int/unegate.carbon index ac618441a9b3b..06f0228ce82bf 100644 --- a/toolchain/check/testdata/builtins/int/unegate.carbon +++ b/toolchain/check/testdata/builtins/int/unegate.carbon @@ -121,19 +121,9 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %Negate: %Negate.type.1 = struct_value () [template] // CHECK:STDOUT: %int_123.1: Core.IntLiteral = int_value 123 [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] // CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_123.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_123.2: %i32 = int_value 123 [template] -// CHECK:STDOUT: %int_-123: %i32 = int_value -123 [template] -// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.3, @impl.2(%int_32) [template] -// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [template] -// CHECK:STDOUT: %interface.6: = interface_witness (%Convert.11) [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_123.2, %Convert.11 [template] -// CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.3(%int_32) [template] // CHECK:STDOUT: %array_type: type = array_type %int_123.1, %i32 [template] // CHECK:STDOUT: %ptr: type = ptr_type %array_type [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] @@ -170,48 +160,19 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc2_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc2_14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc2_22: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc2_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc2: type = splice_block %i32.loc2_14 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc2_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc2_14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %int_32.loc4: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc4: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %Negate.ref.loc4_16: %Negate.type.1 = name_ref Negate, %Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %Negate.ref.loc4_23: %Negate.type.1 = name_ref Negate, %Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %int_123.loc4: Core.IntLiteral = int_value 123 [template = constants.%int_123.1] -// CHECK:STDOUT: %impl.elem0.loc4_30: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc4_30: = bound_method %int_123.loc4, %impl.elem0.loc4_30 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc4_30: = specific_function %Convert.bound.loc4_30, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc4_30: init %i32 = call %Convert.specific_fn.loc4_30(%int_123.loc4) [template = constants.%int_123.2] -// CHECK:STDOUT: %.loc4_30.1: %i32 = value_of_initializer %int.convert_checked.loc4_30 [template = constants.%int_123.2] -// CHECK:STDOUT: %.loc4_30.2: %i32 = converted %int_123.loc4, %.loc4_30.1 [template = constants.%int_123.2] -// CHECK:STDOUT: %int.unegate.loc4_33: init %i32 = call %Negate.ref.loc4_23(%.loc4_30.2) [template = constants.%int_-123] -// CHECK:STDOUT: %.loc4_33.1: %i32 = value_of_initializer %int.unegate.loc4_33 [template = constants.%int_-123] -// CHECK:STDOUT: %.loc4_33.2: %i32 = converted %int.unegate.loc4_33, %.loc4_33.1 [template = constants.%int_-123] -// CHECK:STDOUT: %int.unegate.loc4_34: init %i32 = call %Negate.ref.loc4_16(%.loc4_33.2) [template = constants.%int_123.2] -// CHECK:STDOUT: %impl.elem0.loc4_34: %Convert.type.5 = interface_witness_access constants.%interface.6, element0 [template = constants.%Convert.11] -// CHECK:STDOUT: %Convert.bound.loc4_34: = bound_method %int.unegate.loc4_34, %impl.elem0.loc4_34 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc4_34: = specific_function %Convert.bound.loc4_34, @Convert.3(constants.%int_32) [template = constants.%Convert.specific_fn.2] -// CHECK:STDOUT: %.loc4_34.1: %i32 = value_of_initializer %int.unegate.loc4_34 [template = constants.%int_123.2] -// CHECK:STDOUT: %.loc4_34.2: %i32 = converted %int.unegate.loc4_34, %.loc4_34.1 [template = constants.%int_123.2] -// CHECK:STDOUT: %int.convert_checked.loc4_34: init Core.IntLiteral = call %Convert.specific_fn.loc4_34(%.loc4_34.2) [template = constants.%int_123.1] -// CHECK:STDOUT: %.loc4_34.3: Core.IntLiteral = value_of_initializer %int.convert_checked.loc4_34 [template = constants.%int_123.1] -// CHECK:STDOUT: %.loc4_34.4: Core.IntLiteral = converted %int.unegate.loc4_34, %.loc4_34.3 [template = constants.%int_123.1] -// CHECK:STDOUT: %array_type.loc4: type = array_type %.loc4_34.4, %i32 [template = constants.%array_type] // CHECK:STDOUT: %arr.var: ref %array_type = var arr // CHECK:STDOUT: %arr: ref %array_type = bind_name arr, %arr.var -// CHECK:STDOUT: %int_32.loc5: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc5: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_123.loc5: Core.IntLiteral = int_value 123 [template = constants.%int_123.1] -// CHECK:STDOUT: %array_type.loc5: type = array_type %int_123.loc5, %i32 [template = constants.%array_type] -// CHECK:STDOUT: %ptr: type = ptr_type %array_type [template = constants.%ptr] -// CHECK:STDOUT: %int_32.loc7: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc7: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { // CHECK:STDOUT: %a.patt: %i32 = binding_pattern a // CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 @@ -220,15 +181,19 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc9_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc9_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc9_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc9_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc9_35: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc9_35: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc9_19: type = splice_block %i32.loc9_19 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc9_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc9_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %.loc9_27: type = splice_block %i32.loc9_27 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc9_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc9_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -282,18 +247,6 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %BadReturnType: %BadReturnType.type = struct_value () [template] // CHECK:STDOUT: %JustRight.type: type = fn_type @JustRight [template] // CHECK:STDOUT: %JustRight: %JustRight.type = struct_value () [template] -// CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] // CHECK:STDOUT: %RuntimeCallTooFew.type: type = fn_type @RuntimeCallTooFew [template] // CHECK:STDOUT: %RuntimeCallTooFew: %RuntimeCallTooFew.type = struct_value () [template] // CHECK:STDOUT: %RuntimeCallTooMany.type: type = fn_type @RuntimeCallTooMany [template] @@ -345,15 +298,19 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc13_15: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc13_15: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc13_23: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc13_23: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc13_31: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc13_31: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc13_15: type = splice_block %i32.loc13_15 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc13_15: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc13_15: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %.loc13_23: type = splice_block %i32.loc13_23 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc13_23: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc13_23: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -364,12 +321,14 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %return.patt: bool = return_slot_pattern // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc18_29.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc18_29.2: type = converted %bool.make_type, %.loc18_29.1 [template = bool] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc18_21: type = splice_block %i32 [template = constants.%i32] { +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param1 // CHECK:STDOUT: %return: ref bool = return_slot %return.param @@ -380,60 +339,23 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc19_17: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc19_17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc19_25: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc19_25: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc19: type = splice_block %i32.loc19_17 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc19_17: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc19_17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %int_32.loc25: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc25: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %TooFew.ref: %TooFew.type = name_ref TooFew, %TooFew.decl [template = constants.%TooFew] -// CHECK:STDOUT: %TooFew.call: init %i32 = call %TooFew.ref() // CHECK:STDOUT: %too_few.var: ref = var too_few // CHECK:STDOUT: %too_few: ref = bind_name too_few, %too_few.var -// CHECK:STDOUT: %int_32.loc30: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc30: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %TooMany.ref: %TooMany.type = name_ref TooMany, %TooMany.decl [template = constants.%TooMany] -// CHECK:STDOUT: %int_1.loc30: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %int_2.loc30: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %impl.elem0.loc30_29: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc30_29: = bound_method %int_1.loc30, %impl.elem0.loc30_29 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc30_29: = specific_function %Convert.bound.loc30_29, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc30_29: init %i32 = call %Convert.specific_fn.loc30_29(%int_1.loc30) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc30_29.1: %i32 = value_of_initializer %int.convert_checked.loc30_29 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc30_29.2: %i32 = converted %int_1.loc30, %.loc30_29.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc30_32: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc30_32: = bound_method %int_2.loc30, %impl.elem0.loc30_32 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc30_32: = specific_function %Convert.bound.loc30_32, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] -// CHECK:STDOUT: %int.convert_checked.loc30_32: init %i32 = call %Convert.specific_fn.loc30_32(%int_2.loc30) [template = constants.%int_2.2] -// CHECK:STDOUT: %.loc30_32.1: %i32 = value_of_initializer %int.convert_checked.loc30_32 [template = constants.%int_2.2] -// CHECK:STDOUT: %.loc30_32.2: %i32 = converted %int_2.loc30, %.loc30_32.1 [template = constants.%int_2.2] -// CHECK:STDOUT: %TooMany.call: init %i32 = call %TooMany.ref(%.loc30_29.2, %.loc30_32.2) // CHECK:STDOUT: %too_many.var: ref = var too_many // CHECK:STDOUT: %too_many: ref = bind_name too_many, %too_many.var -// CHECK:STDOUT: %int_32.loc35: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc35: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %BadReturnType.ref: %BadReturnType.type = name_ref BadReturnType, %BadReturnType.decl [template = constants.%BadReturnType] -// CHECK:STDOUT: %int_1.loc35: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc35: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc35: = bound_method %int_1.loc35, %impl.elem0.loc35 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc35: = specific_function %Convert.bound.loc35, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc35: init %i32 = call %Convert.specific_fn.loc35(%int_1.loc35) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc35_42.1: %i32 = value_of_initializer %int.convert_checked.loc35 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc35_42.2: %i32 = converted %int_1.loc35, %.loc35_42.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %BadReturnType.call: init bool = call %BadReturnType.ref(%.loc35_42.2) // CHECK:STDOUT: %bad_return_type.var: ref = var bad_return_type // CHECK:STDOUT: %bad_return_type: ref = bind_name bad_return_type, %bad_return_type.var -// CHECK:STDOUT: %int_32.loc44: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc44: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %JustRight.ref: %JustRight.type = name_ref JustRight, %JustRight.decl [template = constants.%JustRight] -// CHECK:STDOUT: %int_1.loc44: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %int_2.loc44: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %array_type: type = array_type , %i32 [template = ] // CHECK:STDOUT: %bad_call.var: ref = var bad_call // CHECK:STDOUT: %bad_call: ref = bind_name bad_call, %bad_call.var // CHECK:STDOUT: %RuntimeCallTooFew.decl: %RuntimeCallTooFew.type = fn_decl @RuntimeCallTooFew [template = constants.%RuntimeCallTooFew] { @@ -442,11 +364,13 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc46_25: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc46_25: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc46_33: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc46_33: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc46: type = splice_block %i32.loc46_25 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc46_25: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc46_25: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -461,19 +385,25 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param3 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc57_26: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc57_26: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc57_34: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc57_34: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc57_42: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc57_42: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc57_50: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc57_50: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc57_26: type = splice_block %i32.loc57_26 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc57_26: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc57_26: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %.loc57_34: type = splice_block %i32.loc57_34 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc57_34: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc57_34: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %c.param: %i32 = value_param runtime_param2 +// CHECK:STDOUT: %.loc57_42: type = splice_block %i32.loc57_42 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc57_42: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc57_42: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %c: %i32 = bind_name c, %c.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param3 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -486,16 +416,20 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %return.patt: bool = return_slot_pattern // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc68_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc68_32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc68_40: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc68_40: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc68_48.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc68_48.2: type = converted %bool.make_type, %.loc68_48.1 [template = bool] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc68_32: type = splice_block %i32.loc68_32 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc68_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc68_32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %.loc68_40: type = splice_block %i32.loc68_40 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc68_40: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc68_40: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param @@ -583,11 +517,13 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc4_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc4_14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc4_22: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc4_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc4: type = splice_block %i32.loc4_14 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc4_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc4_14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -600,23 +536,23 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc5_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc5_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc5_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc5_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc5_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc5_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc5_11: type = splice_block %i32.loc5_11 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc5_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc5_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %.loc5_19: type = splice_block %i32.loc5_19 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc5_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc5_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %int_32.loc8: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc8: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Negate.1(%a.param_patt: %i32) -> %i32 = "int.unegate"; diff --git a/toolchain/check/testdata/builtins/int/usub.carbon b/toolchain/check/testdata/builtins/int/usub.carbon index 3e2f4fcdee5e6..65113f94b1e7b 100644 --- a/toolchain/check/testdata/builtins/int/usub.carbon +++ b/toolchain/check/testdata/builtins/int/usub.carbon @@ -36,25 +36,6 @@ let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %Sub.type.1: type = fn_type @Sub.1 [template] // CHECK:STDOUT: %Sub: %Sub.type.1 = struct_value () [template] -// CHECK:STDOUT: %int_3.1: Core.IntLiteral = int_value 3 [template] -// CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_3.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_3.2: %i32 = int_value 3 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] -// CHECK:STDOUT: %int_1.1: %i32 = int_value 1 [template] -// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.3, @impl.2(%int_32) [template] -// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [template] -// CHECK:STDOUT: %interface.6: = interface_witness (%Convert.11) [template] -// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_1.1, %Convert.11 [template] -// CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.3(%int_32) [template] // CHECK:STDOUT: %int_1.2: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %array_type: type = array_type %int_1.2, %i32 [template] // CHECK:STDOUT: %ptr: type = ptr_type %array_type [template] @@ -88,53 +69,25 @@ let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc2_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc2_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc2_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc2_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc2_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc2_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc2_11: type = splice_block %i32.loc2_11 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc2_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc2_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %.loc2_19: type = splice_block %i32.loc2_19 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc2_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc2_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %int_32.loc4: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc4: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %Sub.ref: %Sub.type.1 = name_ref Sub, %Sub.decl [template = constants.%Sub] -// CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] -// CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %impl.elem0.loc4_20: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc4_20: = bound_method %int_3, %impl.elem0.loc4_20 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc4_20: = specific_function %Convert.bound.loc4_20, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc4_20: init %i32 = call %Convert.specific_fn.loc4_20(%int_3) [template = constants.%int_3.2] -// CHECK:STDOUT: %.loc4_20.1: %i32 = value_of_initializer %int.convert_checked.loc4_20 [template = constants.%int_3.2] -// CHECK:STDOUT: %.loc4_20.2: %i32 = converted %int_3, %.loc4_20.1 [template = constants.%int_3.2] -// CHECK:STDOUT: %impl.elem0.loc4_23: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc4_23: = bound_method %int_2, %impl.elem0.loc4_23 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc4_23: = specific_function %Convert.bound.loc4_23, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] -// CHECK:STDOUT: %int.convert_checked.loc4_23: init %i32 = call %Convert.specific_fn.loc4_23(%int_2) [template = constants.%int_2.2] -// CHECK:STDOUT: %.loc4_23.1: %i32 = value_of_initializer %int.convert_checked.loc4_23 [template = constants.%int_2.2] -// CHECK:STDOUT: %.loc4_23.2: %i32 = converted %int_2, %.loc4_23.1 [template = constants.%int_2.2] -// CHECK:STDOUT: %int.usub: init %i32 = call %Sub.ref(%.loc4_20.2, %.loc4_23.2) [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc4_24: %Convert.type.5 = interface_witness_access constants.%interface.6, element0 [template = constants.%Convert.11] -// CHECK:STDOUT: %Convert.bound.loc4_24: = bound_method %int.usub, %impl.elem0.loc4_24 [template = constants.%Convert.bound.3] -// CHECK:STDOUT: %Convert.specific_fn.loc4_24: = specific_function %Convert.bound.loc4_24, @Convert.3(constants.%int_32) [template = constants.%Convert.specific_fn.3] -// CHECK:STDOUT: %.loc4_24.1: %i32 = value_of_initializer %int.usub [template = constants.%int_1.1] -// CHECK:STDOUT: %.loc4_24.2: %i32 = converted %int.usub, %.loc4_24.1 [template = constants.%int_1.1] -// CHECK:STDOUT: %int.convert_checked.loc4_24: init Core.IntLiteral = call %Convert.specific_fn.loc4_24(%.loc4_24.2) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc4_24.3: Core.IntLiteral = value_of_initializer %int.convert_checked.loc4_24 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc4_24.4: Core.IntLiteral = converted %int.usub, %.loc4_24.3 [template = constants.%int_1.2] -// CHECK:STDOUT: %array_type.loc4: type = array_type %.loc4_24.4, %i32 [template = constants.%array_type] // CHECK:STDOUT: %arr.var: ref %array_type = var arr // CHECK:STDOUT: %arr: ref %array_type = bind_name arr, %arr.var -// CHECK:STDOUT: %int_32.loc5: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc5: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.2] -// CHECK:STDOUT: %array_type.loc5: type = array_type %int_1, %i32 [template = constants.%array_type] -// CHECK:STDOUT: %ptr: type = ptr_type %array_type [template = constants.%ptr] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { // CHECK:STDOUT: %a.patt: %i32 = binding_pattern a // CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 @@ -143,15 +96,19 @@ let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc7_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc7_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc7_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc7_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc7_35: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc7_35: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc7_19: type = splice_block %i32.loc7_19 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc7_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc7_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %.loc7_27: type = splice_block %i32.loc7_27 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc7_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc7_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -236,25 +193,23 @@ let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc4_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc4_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc4_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc4_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc4_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc4_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc4_11: type = splice_block %i32.loc4_11 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc4_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc4_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %.loc4_19: type = splice_block %i32.loc4_19 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc4_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc4_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %int_32.loc6: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc6: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc7: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc7: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc8: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc8: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Sub.1(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.usub"; diff --git a/toolchain/check/testdata/builtins/int/xor.carbon b/toolchain/check/testdata/builtins/int/xor.carbon index de1754bd8d933..f3503f7d002b8 100644 --- a/toolchain/check/testdata/builtins/int/xor.carbon +++ b/toolchain/check/testdata/builtins/int/xor.carbon @@ -26,25 +26,6 @@ fn RuntimeCall(a: i32, b: i32) -> i32 { // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %Xor.type: type = fn_type @Xor [template] // CHECK:STDOUT: %Xor: %Xor.type = struct_value () [template] -// CHECK:STDOUT: %int_12.1: Core.IntLiteral = int_value 12 [template] -// CHECK:STDOUT: %int_10.1: Core.IntLiteral = int_value 10 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_12.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_12.2: %i32 = int_value 12 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_10.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_10.2: %i32 = int_value 10 [template] -// CHECK:STDOUT: %int_6.1: %i32 = int_value 6 [template] -// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.3, @impl.2(%int_32) [template] -// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [template] -// CHECK:STDOUT: %interface.6: = interface_witness (%Convert.11) [template] -// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_6.1, %Convert.11 [template] -// CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.3(%int_32) [template] // CHECK:STDOUT: %int_6.2: Core.IntLiteral = int_value 6 [template] // CHECK:STDOUT: %array_type: type = array_type %int_6.2, %i32 [template] // CHECK:STDOUT: %ptr: type = ptr_type %array_type [template] @@ -78,53 +59,25 @@ fn RuntimeCall(a: i32, b: i32) -> i32 { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc2_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc2_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc2_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc2_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc2_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc2_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc2_11: type = splice_block %i32.loc2_11 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc2_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc2_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %.loc2_19: type = splice_block %i32.loc2_19 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc2_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc2_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %int_32.loc4: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc4: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %Xor.ref: %Xor.type = name_ref Xor, %Xor.decl [template = constants.%Xor] -// CHECK:STDOUT: %int_12: Core.IntLiteral = int_value 12 [template = constants.%int_12.1] -// CHECK:STDOUT: %int_10: Core.IntLiteral = int_value 10 [template = constants.%int_10.1] -// CHECK:STDOUT: %impl.elem0.loc4_20: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc4_20: = bound_method %int_12, %impl.elem0.loc4_20 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc4_20: = specific_function %Convert.bound.loc4_20, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc4_20: init %i32 = call %Convert.specific_fn.loc4_20(%int_12) [template = constants.%int_12.2] -// CHECK:STDOUT: %.loc4_20.1: %i32 = value_of_initializer %int.convert_checked.loc4_20 [template = constants.%int_12.2] -// CHECK:STDOUT: %.loc4_20.2: %i32 = converted %int_12, %.loc4_20.1 [template = constants.%int_12.2] -// CHECK:STDOUT: %impl.elem0.loc4_24: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc4_24: = bound_method %int_10, %impl.elem0.loc4_24 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc4_24: = specific_function %Convert.bound.loc4_24, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] -// CHECK:STDOUT: %int.convert_checked.loc4_24: init %i32 = call %Convert.specific_fn.loc4_24(%int_10) [template = constants.%int_10.2] -// CHECK:STDOUT: %.loc4_24.1: %i32 = value_of_initializer %int.convert_checked.loc4_24 [template = constants.%int_10.2] -// CHECK:STDOUT: %.loc4_24.2: %i32 = converted %int_10, %.loc4_24.1 [template = constants.%int_10.2] -// CHECK:STDOUT: %int.xor: init %i32 = call %Xor.ref(%.loc4_20.2, %.loc4_24.2) [template = constants.%int_6.1] -// CHECK:STDOUT: %impl.elem0.loc4_26: %Convert.type.5 = interface_witness_access constants.%interface.6, element0 [template = constants.%Convert.11] -// CHECK:STDOUT: %Convert.bound.loc4_26: = bound_method %int.xor, %impl.elem0.loc4_26 [template = constants.%Convert.bound.3] -// CHECK:STDOUT: %Convert.specific_fn.loc4_26: = specific_function %Convert.bound.loc4_26, @Convert.3(constants.%int_32) [template = constants.%Convert.specific_fn.3] -// CHECK:STDOUT: %.loc4_26.1: %i32 = value_of_initializer %int.xor [template = constants.%int_6.1] -// CHECK:STDOUT: %.loc4_26.2: %i32 = converted %int.xor, %.loc4_26.1 [template = constants.%int_6.1] -// CHECK:STDOUT: %int.convert_checked.loc4_26: init Core.IntLiteral = call %Convert.specific_fn.loc4_26(%.loc4_26.2) [template = constants.%int_6.2] -// CHECK:STDOUT: %.loc4_26.3: Core.IntLiteral = value_of_initializer %int.convert_checked.loc4_26 [template = constants.%int_6.2] -// CHECK:STDOUT: %.loc4_26.4: Core.IntLiteral = converted %int.xor, %.loc4_26.3 [template = constants.%int_6.2] -// CHECK:STDOUT: %array_type.loc4: type = array_type %.loc4_26.4, %i32 [template = constants.%array_type] // CHECK:STDOUT: %arr.var: ref %array_type = var arr // CHECK:STDOUT: %arr: ref %array_type = bind_name arr, %arr.var -// CHECK:STDOUT: %int_32.loc5: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc5: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_6: Core.IntLiteral = int_value 6 [template = constants.%int_6.2] -// CHECK:STDOUT: %array_type.loc5: type = array_type %int_6, %i32 [template = constants.%array_type] -// CHECK:STDOUT: %ptr: type = ptr_type %array_type [template = constants.%ptr] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { // CHECK:STDOUT: %a.patt: %i32 = binding_pattern a // CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 @@ -133,15 +86,19 @@ fn RuntimeCall(a: i32, b: i32) -> i32 { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc7_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc7_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc7_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc7_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc7_35: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc7_35: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc7_19: type = splice_block %i32.loc7_19 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc7_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc7_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %.loc7_27: type = splice_block %i32.loc7_27 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc7_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc7_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param diff --git a/toolchain/check/testdata/builtins/int_literal/make_type.carbon b/toolchain/check/testdata/builtins/int_literal/make_type.carbon index 92dd742a889ae..df724bca53bac 100644 --- a/toolchain/check/testdata/builtins/int_literal/make_type.carbon +++ b/toolchain/check/testdata/builtins/int_literal/make_type.carbon @@ -76,10 +76,6 @@ var i: IntLiteral(); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, imports.%import_ref [template = constants.%IntLiteral] -// CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral] -// CHECK:STDOUT: %.loc6_19.1: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral] -// CHECK:STDOUT: %.loc6_19.2: type = converted %int_literal.make_type, %.loc6_19.1 [template = Core.IntLiteral] // CHECK:STDOUT: %i.var: ref Core.IntLiteral = var i // CHECK:STDOUT: %i: ref Core.IntLiteral = bind_name i, %i.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/builtins/print/char.carbon b/toolchain/check/testdata/builtins/print/char.carbon index 1eb168d79e520..d9a9b442937bf 100644 --- a/toolchain/check/testdata/builtins/print/char.carbon +++ b/toolchain/check/testdata/builtins/print/char.carbon @@ -67,11 +67,13 @@ fn Main() { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc13_17: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc13_17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc13_25: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc13_25: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc13: type = splice_block %i32.loc13_17 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc13_17: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc13_17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param diff --git a/toolchain/check/testdata/builtins/print/int.carbon b/toolchain/check/testdata/builtins/print/int.carbon index 4b24230f45268..d2294037411e1 100644 --- a/toolchain/check/testdata/builtins/print/int.carbon +++ b/toolchain/check/testdata/builtins/print/int.carbon @@ -67,9 +67,11 @@ fn Main() { // CHECK:STDOUT: %a.patt: %i32 = binding_pattern a // CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc13: type = splice_block %i32 [template = constants.%i32] { +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: } // CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} {} diff --git a/toolchain/check/testdata/builtins/read/int.carbon b/toolchain/check/testdata/builtins/read/int.carbon index 29cb202acf331..2a382b1502f81 100644 --- a/toolchain/check/testdata/builtins/read/int.carbon +++ b/toolchain/check/testdata/builtins/read/int.carbon @@ -64,15 +64,11 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: fn @Main() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int_32.loc16: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc16: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %ReadChar.ref.loc16: %ReadChar.type.1 = name_ref ReadChar, file.%ReadChar.decl [template = constants.%ReadChar.1] // CHECK:STDOUT: %read.char.loc16: init %i32 = call %ReadChar.ref.loc16() // CHECK:STDOUT: %.loc16_26.1: %i32 = value_of_initializer %read.char.loc16 // CHECK:STDOUT: %.loc16_26.2: %i32 = converted %read.char.loc16, %.loc16_26.1 // CHECK:STDOUT: %n: %i32 = bind_name n, %.loc16_26.2 -// CHECK:STDOUT: %int_32.loc17: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %ReadChar.ref.loc17: %ReadChar.type.2 = name_ref ReadChar, imports.%import_ref.5 [template = constants.%ReadChar.2] // CHECK:STDOUT: %read.char.loc17: init %i32 = call %ReadChar.ref.loc17() diff --git a/toolchain/check/testdata/class/access_modifers.carbon b/toolchain/check/testdata/class/access_modifers.carbon index 14157472dd793..4c9ef50efdb80 100644 --- a/toolchain/check/testdata/class/access_modifers.carbon +++ b/toolchain/check/testdata/class/access_modifers.carbon @@ -197,11 +197,7 @@ class A { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Circle { -// CHECK:STDOUT: %int_32.loc5: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc5: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc5: %Circle.elem = field_decl radius, element0 [template] -// CHECK:STDOUT: %int_32.loc6: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc6: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_5: Core.IntLiteral = int_value 5 [template = constants.%int_5.1] // CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_5, %impl.elem0 [template = constants.%Convert.bound.1] @@ -268,16 +264,13 @@ class A { // CHECK:STDOUT: // CHECK:STDOUT: fn @Run() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Circle.ref.loc18_15: type = name_ref Circle, file.%Circle.decl [template = constants.%Circle] -// CHECK:STDOUT: %Circle.ref.loc18_24: type = name_ref Circle, file.%Circle.decl [template = constants.%Circle] +// CHECK:STDOUT: %Circle.ref: type = name_ref Circle, file.%Circle.decl [template = constants.%Circle] // CHECK:STDOUT: %Make.ref: %Make.type = name_ref Make, @Circle.%Make.decl [template = constants.%Make] // CHECK:STDOUT: %.loc18_36.1: ref %Circle = temporary_storage // CHECK:STDOUT: %Make.call: init %Circle = call %Make.ref() to %.loc18_36.1 // CHECK:STDOUT: %.loc18_36.2: ref %Circle = temporary %.loc18_36.1, %Make.call // CHECK:STDOUT: %.loc18_36.3: %Circle = bind_value %.loc18_36.2 // CHECK:STDOUT: %circle: %Circle = bind_name circle, %.loc18_36.3 -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %circle.ref.loc26: %Circle = name_ref circle, %circle // CHECK:STDOUT: %radius.ref.loc26: = name_ref radius, [template = ] // CHECK:STDOUT: %radius: %i32 = bind_name radius, @@ -325,8 +318,6 @@ class A { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @A { -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc5: %A.elem = field_decl x, element0 [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.x [template = constants.%complete_type.3] // CHECK:STDOUT: @@ -338,8 +329,6 @@ class A { // CHECK:STDOUT: // CHECK:STDOUT: fn @Run() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%A] // CHECK:STDOUT: %x.ref: = name_ref x, [template = ] // CHECK:STDOUT: %x: %i32 = bind_name x, @@ -390,8 +379,6 @@ class A { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Circle { -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc5: %Circle.elem = field_decl radius, element0 [template] // CHECK:STDOUT: %GetRadius.decl: %GetRadius.type = fn_decl @GetRadius [template = constants.%GetRadius] { // CHECK:STDOUT: %self.patt: %Circle = binding_pattern self @@ -399,10 +386,10 @@ class A { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Circle [template = constants.%Circle] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %self.param: %Circle = value_param runtime_param0 +// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Circle [template = constants.%Circle] // CHECK:STDOUT: %self: %Circle = bind_name self, %self.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -422,10 +409,10 @@ class A { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Circle [template = constants.%Circle] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %self.param: %Circle = value_param runtime_param0 +// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Circle [template = constants.%Circle] // CHECK:STDOUT: %self: %Circle = bind_name self, %self.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -507,13 +494,9 @@ class A { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %A.decl: type = class_decl @A [template = constants.%A] {} {} -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @A { -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_5: Core.IntLiteral = int_value 5 [template = constants.%int_5.1] // CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_5, %impl.elem0 [template = constants.%Convert.bound] @@ -574,15 +557,9 @@ class A { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %A.decl: type = class_decl @A [template = constants.%A] {} {} -// CHECK:STDOUT: %int_32.loc16: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc16: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc23: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc23: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @A { -// CHECK:STDOUT: %int_32.loc5: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc5: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_5.loc5: Core.IntLiteral = int_value 5 [template = constants.%int_5.1] // CHECK:STDOUT: %impl.elem0.loc5: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc5: = bound_method %int_5.loc5, %impl.elem0.loc5 [template = constants.%Convert.bound] @@ -591,8 +568,6 @@ class A { // CHECK:STDOUT: %.loc5_27.1: %i32 = value_of_initializer %int.convert_checked.loc5 [template = constants.%int_5.2] // CHECK:STDOUT: %.loc5_27.2: %i32 = converted %int_5.loc5, %.loc5_27.1 [template = constants.%int_5.2] // CHECK:STDOUT: %x: %i32 = bind_name x, %.loc5_27.2 -// CHECK:STDOUT: %int_32.loc6: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc6: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_5.loc6: Core.IntLiteral = int_value 5 [template = constants.%int_5.1] // CHECK:STDOUT: %impl.elem0.loc6: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc6: = bound_method %int_5.loc6, %impl.elem0.loc6 [template = constants.%Convert.bound] diff --git a/toolchain/check/testdata/class/adapter/adapt.carbon b/toolchain/check/testdata/class/adapter/adapt.carbon index 9799d4dfe38c8..f15bf71e18d01 100644 --- a/toolchain/check/testdata/class/adapter/adapt.carbon +++ b/toolchain/check/testdata/class/adapter/adapt.carbon @@ -80,11 +80,7 @@ fn F(a: AdaptNotExtend) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @SomeClass { -// CHECK:STDOUT: %int_32.loc5: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc5: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc5: %SomeClass.elem = field_decl a, element0 [template] -// CHECK:STDOUT: %int_32.loc6: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc6: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc6: %SomeClass.elem = field_decl b, element1 [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a.b [template = constants.%complete_type.3] // CHECK:STDOUT: @@ -153,8 +149,8 @@ fn F(a: AdaptNotExtend) { // CHECK:STDOUT: %a.patt: %AdaptNotExtend = binding_pattern a // CHECK:STDOUT: %a.param_patt: %AdaptNotExtend = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %AdaptNotExtend.ref: type = name_ref AdaptNotExtend, file.%AdaptNotExtend.decl [template = constants.%AdaptNotExtend] // CHECK:STDOUT: %a.param: %AdaptNotExtend = value_param runtime_param0 +// CHECK:STDOUT: %AdaptNotExtend.ref: type = name_ref AdaptNotExtend, file.%AdaptNotExtend.decl [template = constants.%AdaptNotExtend] // CHECK:STDOUT: %a: %AdaptNotExtend = bind_name a, %a.param // CHECK:STDOUT: } // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/adapter/adapt_copy.carbon b/toolchain/check/testdata/class/adapter/adapt_copy.carbon index 4c36fadfdfbba..589d80ab2137c 100644 --- a/toolchain/check/testdata/class/adapter/adapt_copy.carbon +++ b/toolchain/check/testdata/class/adapter/adapt_copy.carbon @@ -139,9 +139,9 @@ fn H(a: AdaptNoncopyableIndirect) -> AdaptNoncopyableIndirect { // CHECK:STDOUT: %return.patt: %AdaptCopyable = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %AdaptCopyable = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %AdaptCopyable.ref.loc10_9: type = name_ref AdaptCopyable, file.%AdaptCopyable.decl [template = constants.%AdaptCopyable] // CHECK:STDOUT: %AdaptCopyable.ref.loc10_27: type = name_ref AdaptCopyable, file.%AdaptCopyable.decl [template = constants.%AdaptCopyable] // CHECK:STDOUT: %c.param: %AdaptCopyable = value_param runtime_param0 +// CHECK:STDOUT: %AdaptCopyable.ref.loc10_9: type = name_ref AdaptCopyable, file.%AdaptCopyable.decl [template = constants.%AdaptCopyable] // CHECK:STDOUT: %c: %AdaptCopyable = bind_name c, %c.param // CHECK:STDOUT: %return.param: ref %AdaptCopyable = out_param runtime_param1 // CHECK:STDOUT: %return: ref %AdaptCopyable = return_slot %return.param @@ -152,17 +152,19 @@ fn H(a: AdaptNoncopyableIndirect) -> AdaptNoncopyableIndirect { // CHECK:STDOUT: %return.patt: %tuple.type.2 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %tuple.type.2 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %AdaptCopyable.ref.loc15_16: type = name_ref AdaptCopyable, file.%AdaptCopyable.decl [template = constants.%AdaptCopyable] -// CHECK:STDOUT: %int_32.loc15_31: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc15_31: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc15_34.1: %tuple.type.1 = tuple_literal (%AdaptCopyable.ref.loc15_16, %i32.loc15_31) -// CHECK:STDOUT: %.loc15_34.2: type = converted %.loc15_34.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %AdaptCopyable.ref.loc15_41: type = name_ref AdaptCopyable, file.%AdaptCopyable.decl [template = constants.%AdaptCopyable] // CHECK:STDOUT: %int_32.loc15_56: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc15_56: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc15_59.1: %tuple.type.1 = tuple_literal (%AdaptCopyable.ref.loc15_41, %i32.loc15_56) // CHECK:STDOUT: %.loc15_59.2: type = converted %.loc15_59.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %c.param: %tuple.type.2 = value_param runtime_param0 +// CHECK:STDOUT: %.loc15_34.3: type = splice_block %.loc15_34.2 [template = constants.%tuple.type.2] { +// CHECK:STDOUT: %AdaptCopyable.ref.loc15_16: type = name_ref AdaptCopyable, file.%AdaptCopyable.decl [template = constants.%AdaptCopyable] +// CHECK:STDOUT: %int_32.loc15_31: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc15_31: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc15_34.1: %tuple.type.1 = tuple_literal (%AdaptCopyable.ref.loc15_16, %i32.loc15_31) +// CHECK:STDOUT: %.loc15_34.2: type = converted %.loc15_34.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] +// CHECK:STDOUT: } // CHECK:STDOUT: %c: %tuple.type.2 = bind_name c, %c.param // CHECK:STDOUT: %return.param: ref %tuple.type.2 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %tuple.type.2 = return_slot %return.param @@ -182,7 +184,6 @@ fn H(a: AdaptNoncopyableIndirect) -> AdaptNoncopyableIndirect { // CHECK:STDOUT: // CHECK:STDOUT: fn @F(%c.param_patt: %AdaptCopyable) -> %AdaptCopyable { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %AdaptCopyable.ref.loc11: type = name_ref AdaptCopyable, file.%AdaptCopyable.decl [template = constants.%AdaptCopyable] // CHECK:STDOUT: %d.var: ref %AdaptCopyable = var d // CHECK:STDOUT: %d: ref %AdaptCopyable = bind_name d, %d.var // CHECK:STDOUT: %c.ref: %AdaptCopyable = name_ref c, %c @@ -194,11 +195,6 @@ fn H(a: AdaptNoncopyableIndirect) -> AdaptNoncopyableIndirect { // CHECK:STDOUT: // CHECK:STDOUT: fn @InTuple(%c.param_patt: %tuple.type.2) -> %return.param_patt: %tuple.type.2 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %AdaptCopyable.ref.loc16: type = name_ref AdaptCopyable, file.%AdaptCopyable.decl [template = constants.%AdaptCopyable] -// CHECK:STDOUT: %int_32.loc16: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc16: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc16_29.1: %tuple.type.1 = tuple_literal (%AdaptCopyable.ref.loc16, %i32.loc16) -// CHECK:STDOUT: %.loc16_29.2: type = converted %.loc16_29.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %d.var: ref %tuple.type.2 = var d // CHECK:STDOUT: %d: ref %tuple.type.2 = bind_name d, %d.var // CHECK:STDOUT: %c.ref: %tuple.type.2 = name_ref c, %c @@ -260,9 +256,9 @@ fn H(a: AdaptNoncopyableIndirect) -> AdaptNoncopyableIndirect { // CHECK:STDOUT: %return.patt: %AdaptTuple = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %AdaptTuple = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %AdaptTuple.ref.loc10_9: type = name_ref AdaptTuple, file.%AdaptTuple.decl [template = constants.%AdaptTuple] // CHECK:STDOUT: %AdaptTuple.ref.loc10_24: type = name_ref AdaptTuple, file.%AdaptTuple.decl [template = constants.%AdaptTuple] // CHECK:STDOUT: %c.param: %AdaptTuple = value_param runtime_param0 +// CHECK:STDOUT: %AdaptTuple.ref.loc10_9: type = name_ref AdaptTuple, file.%AdaptTuple.decl [template = constants.%AdaptTuple] // CHECK:STDOUT: %c: %AdaptTuple = bind_name c, %c.param // CHECK:STDOUT: %return.param: ref %AdaptTuple = out_param runtime_param1 // CHECK:STDOUT: %return: ref %AdaptTuple = return_slot %return.param @@ -286,7 +282,6 @@ fn H(a: AdaptNoncopyableIndirect) -> AdaptNoncopyableIndirect { // CHECK:STDOUT: // CHECK:STDOUT: fn @F(%c.param_patt: %AdaptTuple) -> %return.param_patt: %AdaptTuple { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %AdaptTuple.ref.loc15: type = name_ref AdaptTuple, file.%AdaptTuple.decl [template = constants.%AdaptTuple] // CHECK:STDOUT: %d.var: ref %AdaptTuple = var d // CHECK:STDOUT: %d: ref %AdaptTuple = bind_name d, %d.var // CHECK:STDOUT: %c.ref: %AdaptTuple = name_ref c, %c @@ -330,9 +325,9 @@ fn H(a: AdaptNoncopyableIndirect) -> AdaptNoncopyableIndirect { // CHECK:STDOUT: %return.patt: %AdaptNoncopyable = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %AdaptNoncopyable = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %AdaptNoncopyable.ref.loc12_9: type = name_ref AdaptNoncopyable, file.%AdaptNoncopyable.decl [template = constants.%AdaptNoncopyable] // CHECK:STDOUT: %AdaptNoncopyable.ref.loc12_30: type = name_ref AdaptNoncopyable, file.%AdaptNoncopyable.decl [template = constants.%AdaptNoncopyable] // CHECK:STDOUT: %a.param: %AdaptNoncopyable = value_param runtime_param0 +// CHECK:STDOUT: %AdaptNoncopyable.ref.loc12_9: type = name_ref AdaptNoncopyable, file.%AdaptNoncopyable.decl [template = constants.%AdaptNoncopyable] // CHECK:STDOUT: %a: %AdaptNoncopyable = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %AdaptNoncopyable = out_param runtime_param1 // CHECK:STDOUT: %return: ref %AdaptNoncopyable = return_slot %return.param @@ -359,7 +354,6 @@ fn H(a: AdaptNoncopyableIndirect) -> AdaptNoncopyableIndirect { // CHECK:STDOUT: // CHECK:STDOUT: fn @G(%a.param_patt: %AdaptNoncopyable) -> %return.param_patt: %AdaptNoncopyable { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %AdaptNoncopyable.ref.loc17: type = name_ref AdaptNoncopyable, file.%AdaptNoncopyable.decl [template = constants.%AdaptNoncopyable] // CHECK:STDOUT: %b.var: ref %AdaptNoncopyable = var b // CHECK:STDOUT: %b: ref %AdaptNoncopyable = bind_name b, %b.var // CHECK:STDOUT: %a.ref: %AdaptNoncopyable = name_ref a, %a @@ -409,9 +403,9 @@ fn H(a: AdaptNoncopyableIndirect) -> AdaptNoncopyableIndirect { // CHECK:STDOUT: %return.patt: %AdaptNoncopyableIndirect = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %AdaptNoncopyableIndirect = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %AdaptNoncopyableIndirect.ref.loc12_9: type = name_ref AdaptNoncopyableIndirect, file.%AdaptNoncopyableIndirect.decl [template = constants.%AdaptNoncopyableIndirect] // CHECK:STDOUT: %AdaptNoncopyableIndirect.ref.loc12_38: type = name_ref AdaptNoncopyableIndirect, file.%AdaptNoncopyableIndirect.decl [template = constants.%AdaptNoncopyableIndirect] // CHECK:STDOUT: %a.param: %AdaptNoncopyableIndirect = value_param runtime_param0 +// CHECK:STDOUT: %AdaptNoncopyableIndirect.ref.loc12_9: type = name_ref AdaptNoncopyableIndirect, file.%AdaptNoncopyableIndirect.decl [template = constants.%AdaptNoncopyableIndirect] // CHECK:STDOUT: %a: %AdaptNoncopyableIndirect = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %AdaptNoncopyableIndirect = out_param runtime_param1 // CHECK:STDOUT: %return: ref %AdaptNoncopyableIndirect = return_slot %return.param @@ -444,7 +438,6 @@ fn H(a: AdaptNoncopyableIndirect) -> AdaptNoncopyableIndirect { // CHECK:STDOUT: // CHECK:STDOUT: fn @H(%a.param_patt: %AdaptNoncopyableIndirect) -> %return.param_patt: %AdaptNoncopyableIndirect { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %AdaptNoncopyableIndirect.ref.loc17: type = name_ref AdaptNoncopyableIndirect, file.%AdaptNoncopyableIndirect.decl [template = constants.%AdaptNoncopyableIndirect] // CHECK:STDOUT: %b.var: ref %AdaptNoncopyableIndirect = var b // CHECK:STDOUT: %b: ref %AdaptNoncopyableIndirect = bind_name b, %b.var // CHECK:STDOUT: %a.ref: %AdaptNoncopyableIndirect = name_ref a, %a diff --git a/toolchain/check/testdata/class/adapter/extend_adapt.carbon b/toolchain/check/testdata/class/adapter/extend_adapt.carbon index 3c624e91a6c7d..139d924157ee4 100644 --- a/toolchain/check/testdata/class/adapter/extend_adapt.carbon +++ b/toolchain/check/testdata/class/adapter/extend_adapt.carbon @@ -182,16 +182,16 @@ fn F(a: IntAdapter) -> i32 { // CHECK:STDOUT: %a.patt: %SomeClassAdapter = binding_pattern a // CHECK:STDOUT: %a.param_patt: %SomeClassAdapter = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %SomeClassAdapter.ref: type = name_ref SomeClassAdapter, file.%SomeClassAdapter.decl.loc4 [template = constants.%SomeClassAdapter] // CHECK:STDOUT: %a.param: %SomeClassAdapter = value_param runtime_param0 +// CHECK:STDOUT: %SomeClassAdapter.ref: type = name_ref SomeClassAdapter, file.%SomeClassAdapter.decl.loc4 [template = constants.%SomeClassAdapter] // CHECK:STDOUT: %a: %SomeClassAdapter = bind_name a, %a.param // CHECK:STDOUT: } // CHECK:STDOUT: %TestAdapterMethod.decl: %TestAdapterMethod.type = fn_decl @TestAdapterMethod [template = constants.%TestAdapterMethod] { // CHECK:STDOUT: %a.patt: %SomeClassAdapter = binding_pattern a // CHECK:STDOUT: %a.param_patt: %SomeClassAdapter = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %SomeClassAdapter.ref: type = name_ref SomeClassAdapter, file.%SomeClassAdapter.decl.loc4 [template = constants.%SomeClassAdapter] // CHECK:STDOUT: %a.param: %SomeClassAdapter = value_param runtime_param0 +// CHECK:STDOUT: %SomeClassAdapter.ref: type = name_ref SomeClassAdapter, file.%SomeClassAdapter.decl.loc4 [template = constants.%SomeClassAdapter] // CHECK:STDOUT: %a: %SomeClassAdapter = bind_name a, %a.param // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -208,19 +208,15 @@ fn F(a: IntAdapter) -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @SomeClass { -// CHECK:STDOUT: %int_32.loc7: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc7: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc7: %SomeClass.elem = field_decl a, element0 [template] -// CHECK:STDOUT: %int_32.loc8: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc8: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc8: %SomeClass.elem = field_decl b, element1 [template] // CHECK:STDOUT: %StaticMemberFunction.decl: %StaticMemberFunction.type = fn_decl @StaticMemberFunction [template = constants.%StaticMemberFunction] {} {} // CHECK:STDOUT: %AdapterMethod.decl: %AdapterMethod.type = fn_decl @AdapterMethod [template = constants.%AdapterMethod] { // CHECK:STDOUT: %self.patt: %SomeClassAdapter = binding_pattern self // CHECK:STDOUT: %self.param_patt: %SomeClassAdapter = value_param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %SomeClassAdapter.ref: type = name_ref SomeClassAdapter, file.%SomeClassAdapter.decl.loc4 [template = constants.%SomeClassAdapter] // CHECK:STDOUT: %self.param: %SomeClassAdapter = value_param runtime_param0 +// CHECK:STDOUT: %SomeClassAdapter.ref: type = name_ref SomeClassAdapter, file.%SomeClassAdapter.decl.loc4 [template = constants.%SomeClassAdapter] // CHECK:STDOUT: %self: %SomeClassAdapter = bind_name self, %self.param // CHECK:STDOUT: } // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a.b [template = constants.%complete_type.3] @@ -291,8 +287,8 @@ fn F(a: IntAdapter) -> i32 { // CHECK:STDOUT: %a.patt: %SomeClassAdapter = binding_pattern a // CHECK:STDOUT: %a.param_patt: %SomeClassAdapter = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %SomeClassAdapter.ref: type = name_ref SomeClassAdapter, file.%SomeClassAdapter.decl [template = constants.%SomeClassAdapter] // CHECK:STDOUT: %a.param: %SomeClassAdapter = value_param runtime_param0 +// CHECK:STDOUT: %SomeClassAdapter.ref: type = name_ref SomeClassAdapter, file.%SomeClassAdapter.decl [template = constants.%SomeClassAdapter] // CHECK:STDOUT: %a: %SomeClassAdapter = bind_name a, %a.param // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -302,8 +298,8 @@ fn F(a: IntAdapter) -> i32 { // CHECK:STDOUT: %self.patt: %SomeClass = binding_pattern self // CHECK:STDOUT: %self.param_patt: %SomeClass = value_param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%SomeClass [template = constants.%SomeClass] // CHECK:STDOUT: %self.param: %SomeClass = value_param runtime_param0 +// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%SomeClass [template = constants.%SomeClass] // CHECK:STDOUT: %self: %SomeClass = bind_name self, %self.param // CHECK:STDOUT: } // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] @@ -376,10 +372,10 @@ fn F(a: IntAdapter) -> i32 { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %SomeClassAdapter.ref: type = name_ref SomeClassAdapter, file.%SomeClassAdapter.decl [template = constants.%SomeClassAdapter] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %SomeClassAdapter = value_param runtime_param0 +// CHECK:STDOUT: %SomeClassAdapter.ref: type = name_ref SomeClassAdapter, file.%SomeClassAdapter.decl [template = constants.%SomeClassAdapter] // CHECK:STDOUT: %a: %SomeClassAdapter = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -387,11 +383,7 @@ fn F(a: IntAdapter) -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @SomeClass { -// CHECK:STDOUT: %int_32.loc5: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc5: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc5: %SomeClass.elem = field_decl a, element0 [template] -// CHECK:STDOUT: %int_32.loc6: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc6: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc6: %SomeClass.elem = field_decl b, element1 [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a.b [template = constants.%complete_type.3] // CHECK:STDOUT: @@ -456,10 +448,10 @@ fn F(a: IntAdapter) -> i32 { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %StructAdapter.ref: type = name_ref StructAdapter, file.%StructAdapter.decl [template = constants.%StructAdapter] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %StructAdapter = value_param runtime_param0 +// CHECK:STDOUT: %StructAdapter.ref: type = name_ref StructAdapter, file.%StructAdapter.decl [template = constants.%StructAdapter] // CHECK:STDOUT: %a: %StructAdapter = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -524,10 +516,10 @@ fn F(a: IntAdapter) -> i32 { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %TupleAdapter.ref: type = name_ref TupleAdapter, file.%TupleAdapter.decl [template = constants.%TupleAdapter] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %TupleAdapter = value_param runtime_param0 +// CHECK:STDOUT: %TupleAdapter.ref: type = name_ref TupleAdapter, file.%TupleAdapter.decl [template = constants.%TupleAdapter] // CHECK:STDOUT: %a: %TupleAdapter = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -597,12 +589,14 @@ fn F(a: IntAdapter) -> i32 { // CHECK:STDOUT: %return.patt: type = return_slot_pattern // CHECK:STDOUT: %return.param_patt: type = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] -// CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, imports.%import_ref.1 [template = constants.%IntLiteral] -// CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral] -// CHECK:STDOUT: %.loc4_31.1: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral] -// CHECK:STDOUT: %.loc4_31.2: type = converted %int_literal.make_type, %.loc4_31.1 [template = Core.IntLiteral] // CHECK:STDOUT: %N.param: Core.IntLiteral = value_param runtime_param0 +// CHECK:STDOUT: %.loc4_31.3: type = splice_block %.loc4_31.2 [template = Core.IntLiteral] { +// CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] +// CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, imports.%import_ref.1 [template = constants.%IntLiteral] +// CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral] +// CHECK:STDOUT: %.loc4_31.1: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral] +// CHECK:STDOUT: %.loc4_31.2: type = converted %int_literal.make_type, %.loc4_31.1 [template = Core.IntLiteral] +// CHECK:STDOUT: } // CHECK:STDOUT: %N: Core.IntLiteral = bind_name N, %N.param // CHECK:STDOUT: %return.param: ref type = out_param runtime_param1 // CHECK:STDOUT: %return: ref type = return_slot %return.param @@ -614,10 +608,10 @@ fn F(a: IntAdapter) -> i32 { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %IntAdapter.ref: type = name_ref IntAdapter, file.%IntAdapter.decl [template = constants.%IntAdapter] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %IntAdapter = value_param runtime_param0 +// CHECK:STDOUT: %IntAdapter.ref: type = name_ref IntAdapter, file.%IntAdapter.decl [template = constants.%IntAdapter] // CHECK:STDOUT: %a: %IntAdapter = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param diff --git a/toolchain/check/testdata/class/adapter/fail_adapt_bad_decl.carbon b/toolchain/check/testdata/class/adapter/fail_adapt_bad_decl.carbon index f0fa494924792..0340d91f64f2e 100644 --- a/toolchain/check/testdata/class/adapter/fail_adapt_bad_decl.carbon +++ b/toolchain/check/testdata/class/adapter/fail_adapt_bad_decl.carbon @@ -131,8 +131,8 @@ class C { // CHECK:STDOUT: %b.patt: %Bad = binding_pattern b // CHECK:STDOUT: %b.param_patt: %Bad = value_param_pattern %b.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Bad.ref: type = name_ref Bad, file.%Bad.decl [template = constants.%Bad] // CHECK:STDOUT: %b.param: %Bad = value_param runtime_param0 +// CHECK:STDOUT: %Bad.ref: type = name_ref Bad, file.%Bad.decl [template = constants.%Bad] // CHECK:STDOUT: %b: %Bad = bind_name b, %b.param // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -184,8 +184,8 @@ class C { // CHECK:STDOUT: %b.patt: %Bad = binding_pattern b // CHECK:STDOUT: %b.param_patt: %Bad = value_param_pattern %b.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Bad.ref: type = name_ref Bad, file.%Bad.decl [template = constants.%Bad] // CHECK:STDOUT: %b.param: %Bad = value_param runtime_param0 +// CHECK:STDOUT: %Bad.ref: type = name_ref Bad, file.%Bad.decl [template = constants.%Bad] // CHECK:STDOUT: %b: %Bad = bind_name b, %b.param // CHECK:STDOUT: } // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/adapter/fail_adapt_with_subobjects.carbon b/toolchain/check/testdata/class/adapter/fail_adapt_with_subobjects.carbon index 85d278e74ab4c..6cde41d272bd1 100644 --- a/toolchain/check/testdata/class/adapter/fail_adapt_with_subobjects.carbon +++ b/toolchain/check/testdata/class/adapter/fail_adapt_with_subobjects.carbon @@ -158,11 +158,9 @@ class AdaptWithBaseAndFields { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @AdaptWithField { -// CHECK:STDOUT: %int_32.loc8: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc8: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: adapt_decl %i32.loc8 [template] -// CHECK:STDOUT: %int_32.loc13: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc13: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: adapt_decl %i32 [template] // CHECK:STDOUT: %.loc13: %AdaptWithField.elem = field_decl n, element [template] // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -172,17 +170,11 @@ class AdaptWithBaseAndFields { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @AdaptWithFields { -// CHECK:STDOUT: %int_32.loc20: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc20: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: adapt_decl %i32.loc20 [template] -// CHECK:STDOUT: %int_32.loc25: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc25: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: adapt_decl %i32 [template] // CHECK:STDOUT: %.loc25: %AdaptWithFields.elem = field_decl a, element [template] -// CHECK:STDOUT: %int_32.loc26: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc26: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc26: %AdaptWithFields.elem = field_decl b, element [template] -// CHECK:STDOUT: %int_32.loc27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc27: %AdaptWithFields.elem = field_decl c, element [template] // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -236,8 +228,6 @@ class AdaptWithBaseAndFields { // CHECK:STDOUT: class @AdaptWithBaseAndFields { // CHECK:STDOUT: %Base.ref: type = name_ref Base, file.%Base.decl [template = constants.%Base] // CHECK:STDOUT: %.loc7: %AdaptWithBaseAndFields.elem.1 = base_decl %Base.ref, element [template] -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc8: %AdaptWithBaseAndFields.elem.2 = field_decl n, element [template] // CHECK:STDOUT: %.loc15_10: %empty_struct_type = struct_literal () // CHECK:STDOUT: %.loc15_11: type = converted %.loc15_10, constants.%empty_struct_type [template = constants.%empty_struct_type] diff --git a/toolchain/check/testdata/class/adapter/init_adapt.carbon b/toolchain/check/testdata/class/adapter/init_adapt.carbon index db23ec1c7ff97..b222fa8f16818 100644 --- a/toolchain/check/testdata/class/adapter/init_adapt.carbon +++ b/toolchain/check/testdata/class/adapter/init_adapt.carbon @@ -146,9 +146,6 @@ var e: C = MakeAdaptC(); // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: %AdaptC.decl: type = class_decl @AdaptC [template = constants.%AdaptC] {} {} -// CHECK:STDOUT: %C.ref.loc13: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %AdaptC.ref.loc15: type = name_ref AdaptC, %AdaptC.decl [template = constants.%AdaptC] -// CHECK:STDOUT: %C.ref.loc17: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %MakeC.decl: %MakeC.type = fn_decl @MakeC [template = constants.%MakeC] { // CHECK:STDOUT: %return.patt: %C = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %C = out_param_pattern %return.patt, runtime_param0 @@ -165,20 +162,14 @@ var e: C = MakeAdaptC(); // CHECK:STDOUT: %return.param: ref %AdaptC = out_param runtime_param0 // CHECK:STDOUT: %return: ref %AdaptC = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %AdaptC.ref.loc23: type = name_ref AdaptC, %AdaptC.decl [template = constants.%AdaptC] // CHECK:STDOUT: %d.var: ref %AdaptC = var d // CHECK:STDOUT: %d: ref %AdaptC = bind_name d, %d.var -// CHECK:STDOUT: %C.ref.loc25: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %e.var: ref %C = var e // CHECK:STDOUT: %e: ref %C = bind_name e, %e.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { -// CHECK:STDOUT: %int_32.loc5: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc5: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc5: %C.elem = field_decl a, element0 [template] -// CHECK:STDOUT: %int_32.loc6: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc6: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc6: %C.elem = field_decl b, element1 [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a.b.1 [template = constants.%complete_type.3] // CHECK:STDOUT: @@ -310,9 +301,6 @@ var e: C = MakeAdaptC(); // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: %AdaptC.decl: type = class_decl @AdaptC [template = constants.%AdaptC] {} {} -// CHECK:STDOUT: %C.ref.loc13: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %AdaptC.ref.loc24: type = name_ref AdaptC, %AdaptC.decl [template = constants.%AdaptC] -// CHECK:STDOUT: %C.ref.loc33: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %MakeC.decl: %MakeC.type = fn_decl @MakeC [template = constants.%MakeC] { // CHECK:STDOUT: %return.patt: %C = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %C = out_param_pattern %return.patt, runtime_param0 @@ -329,20 +317,14 @@ var e: C = MakeAdaptC(); // CHECK:STDOUT: %return.param: ref %AdaptC = out_param runtime_param0 // CHECK:STDOUT: %return: ref %AdaptC = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %AdaptC.ref.loc46: type = name_ref AdaptC, %AdaptC.decl [template = constants.%AdaptC] // CHECK:STDOUT: %d.var: ref %AdaptC = var d // CHECK:STDOUT: %d: ref %AdaptC = bind_name d, %d.var -// CHECK:STDOUT: %C.ref.loc54: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %e.var: ref %C = var e // CHECK:STDOUT: %e: ref %C = bind_name e, %e.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { -// CHECK:STDOUT: %int_32.loc5: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc5: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc5: %C.elem = field_decl a, element0 [template] -// CHECK:STDOUT: %int_32.loc6: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc6: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc6: %C.elem = field_decl b, element1 [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a.b.1 [template = constants.%complete_type.3] // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/base.carbon b/toolchain/check/testdata/class/base.carbon index 1206470ba429d..59ad333269ded 100644 --- a/toolchain/check/testdata/class/base.carbon +++ b/toolchain/check/testdata/class/base.carbon @@ -116,7 +116,6 @@ class Derived { // CHECK:STDOUT: %return.patt: %tuple.type.2 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %tuple.type.2 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Derived.ref: type = name_ref Derived, file.%Derived.decl [template = constants.%Derived] // CHECK:STDOUT: %int_32.loc17_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc17_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc17_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] @@ -124,6 +123,7 @@ class Derived { // CHECK:STDOUT: %.loc17_35.1: %tuple.type.1 = tuple_literal (%i32.loc17_27, %i32.loc17_32) // CHECK:STDOUT: %.loc17_35.2: type = converted %.loc17_35.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %d.param: %Derived = value_param runtime_param0 +// CHECK:STDOUT: %Derived.ref: type = name_ref Derived, file.%Derived.decl [template = constants.%Derived] // CHECK:STDOUT: %d: %Derived = bind_name d, %d.param // CHECK:STDOUT: %return.param: ref %tuple.type.2 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %tuple.type.2 = return_slot %return.param @@ -131,8 +131,6 @@ class Derived { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Base { -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc4: %Base.elem = field_decl b, element0 [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.b.1 [template = constants.%complete_type.3] // CHECK:STDOUT: @@ -145,8 +143,6 @@ class Derived { // CHECK:STDOUT: class @Derived { // CHECK:STDOUT: %Base.ref: type = name_ref Base, file.%Base.decl [template = constants.%Base] // CHECK:STDOUT: %.loc8: %Derived.elem.1 = base_decl %Base.ref, element0 [template] -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc10: %Derived.elem.2 = field_decl d, element1 [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.base.d.1 [template = constants.%complete_type.4] // CHECK:STDOUT: @@ -251,8 +247,6 @@ class Derived { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Derived { -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc7: %Derived.elem = field_decl d, element0 [template] // CHECK:STDOUT: %Base.ref: type = name_ref Base, file.%Base.decl [template = constants.%Base] // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.d [template = constants.%complete_type.4] diff --git a/toolchain/check/testdata/class/base_field.carbon b/toolchain/check/testdata/class/base_field.carbon index 52868facb66c3..f30b0f5464fb1 100644 --- a/toolchain/check/testdata/class/base_field.carbon +++ b/toolchain/check/testdata/class/base_field.carbon @@ -69,12 +69,14 @@ fn Access(p: Derived*) -> i32* { // CHECK:STDOUT: %return.patt: %ptr.3 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %ptr.3 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Derived.ref: type = name_ref Derived, file.%Derived.decl [template = constants.%Derived] -// CHECK:STDOUT: %ptr.loc24_21: type = ptr_type %Derived [template = constants.%ptr.2] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %ptr.loc24_30: type = ptr_type %i32 [template = constants.%ptr.3] // CHECK:STDOUT: %p.param: %ptr.2 = value_param runtime_param0 +// CHECK:STDOUT: %.loc24: type = splice_block %ptr.loc24_21 [template = constants.%ptr.2] { +// CHECK:STDOUT: %Derived.ref: type = name_ref Derived, file.%Derived.decl [template = constants.%Derived] +// CHECK:STDOUT: %ptr.loc24_21: type = ptr_type %Derived [template = constants.%ptr.2] +// CHECK:STDOUT: } // CHECK:STDOUT: %p: %ptr.2 = bind_name p, %p.param // CHECK:STDOUT: %return.param: ref %ptr.3 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %ptr.3 = return_slot %return.param @@ -82,14 +84,8 @@ fn Access(p: Derived*) -> i32* { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Base { -// CHECK:STDOUT: %int_32.loc12: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc12: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc12: %Base.elem = field_decl a, element0 [template] -// CHECK:STDOUT: %int_32.loc13: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc13: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc13: %Base.elem = field_decl b, element1 [template] -// CHECK:STDOUT: %int_32.loc14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc14: %Base.elem = field_decl c, element2 [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a.b.c [template = constants.%complete_type.3] // CHECK:STDOUT: @@ -104,11 +100,7 @@ fn Access(p: Derived*) -> i32* { // CHECK:STDOUT: class @Derived { // CHECK:STDOUT: %Base.ref: type = name_ref Base, file.%Base.decl [template = constants.%Base] // CHECK:STDOUT: %.loc18: %Derived.elem.1 = base_decl %Base.ref, element0 [template] -// CHECK:STDOUT: %int_32.loc20: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc20: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc20: %Derived.elem.2 = field_decl d, element1 [template] -// CHECK:STDOUT: %int_32.loc21: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc21: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc21: %Derived.elem.2 = field_decl e, element2 [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.base.d.e.1 [template = constants.%complete_type.4] // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/base_method.carbon b/toolchain/check/testdata/class/base_method.carbon index 7e148f16e3722..747b90c83db67 100644 --- a/toolchain/check/testdata/class/base_method.carbon +++ b/toolchain/check/testdata/class/base_method.carbon @@ -77,11 +77,13 @@ fn Call(p: Derived*) { // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %self.patt: %ptr.1 = binding_pattern self // CHECK:STDOUT: %self.param_patt: %ptr.1 = value_param_pattern %self.patt, runtime_param0 -// CHECK:STDOUT: %.loc17: auto = addr_pattern %self.param_patt +// CHECK:STDOUT: %.loc17_11: auto = addr_pattern %self.param_patt // CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref.loc17: type = name_ref Self, constants.%Base [template = constants.%Base] -// CHECK:STDOUT: %ptr.loc17: type = ptr_type %Base [template = constants.%ptr.1] // CHECK:STDOUT: %self.param.loc17: %ptr.1 = value_param runtime_param0 +// CHECK:STDOUT: %.loc17_26: type = splice_block %ptr.loc17 [template = constants.%ptr.1] { +// CHECK:STDOUT: %Self.ref.loc17: type = name_ref Self, constants.%Base [template = constants.%Base] +// CHECK:STDOUT: %ptr.loc17: type = ptr_type %Base [template = constants.%ptr.1] +// CHECK:STDOUT: } // CHECK:STDOUT: %self.loc17: %ptr.1 = bind_name self, %self.param.loc17 // CHECK:STDOUT: } // CHECK:STDOUT: %Derived.decl: type = class_decl @Derived [template = constants.%Derived] {} {} @@ -89,25 +91,27 @@ fn Call(p: Derived*) { // CHECK:STDOUT: %p.patt: %ptr.3 = binding_pattern p // CHECK:STDOUT: %p.param_patt: %ptr.3 = value_param_pattern %p.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Derived.ref: type = name_ref Derived, file.%Derived.decl [template = constants.%Derived] -// CHECK:STDOUT: %ptr: type = ptr_type %Derived [template = constants.%ptr.3] // CHECK:STDOUT: %p.param: %ptr.3 = value_param runtime_param0 +// CHECK:STDOUT: %.loc25: type = splice_block %ptr [template = constants.%ptr.3] { +// CHECK:STDOUT: %Derived.ref: type = name_ref Derived, file.%Derived.decl [template = constants.%Derived] +// CHECK:STDOUT: %ptr: type = ptr_type %Derived [template = constants.%ptr.3] +// CHECK:STDOUT: } // CHECK:STDOUT: %p: %ptr.3 = bind_name p, %p.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Base { -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc12: %Base.elem = field_decl a, element0 [template] // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %self.patt: %ptr.1 = binding_pattern self // CHECK:STDOUT: %self.param_patt: %ptr.1 = value_param_pattern %self.patt, runtime_param0 -// CHECK:STDOUT: %.loc17: auto = addr_pattern %self.param_patt +// CHECK:STDOUT: %.loc17_11: auto = addr_pattern %self.param_patt // CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref.loc14: type = name_ref Self, constants.%Base [template = constants.%Base] -// CHECK:STDOUT: %ptr.loc14: type = ptr_type %Base [template = constants.%ptr.1] // CHECK:STDOUT: %self.param.loc14: %ptr.1 = value_param runtime_param0 +// CHECK:STDOUT: %.loc14: type = splice_block %ptr.loc14 [template = constants.%ptr.1] { +// CHECK:STDOUT: %Self.ref.loc14: type = name_ref Self, constants.%Base [template = constants.%Base] +// CHECK:STDOUT: %ptr.loc14: type = ptr_type %Base [template = constants.%ptr.1] +// CHECK:STDOUT: } // CHECK:STDOUT: %self.loc14: %ptr.1 = bind_name self, %self.param.loc14 // CHECK:STDOUT: } // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a [template = constants.%complete_type.3] diff --git a/toolchain/check/testdata/class/base_method_qualified.carbon b/toolchain/check/testdata/class/base_method_qualified.carbon index 44f6e73974989..f6684ee51895c 100644 --- a/toolchain/check/testdata/class/base_method_qualified.carbon +++ b/toolchain/check/testdata/class/base_method_qualified.carbon @@ -97,10 +97,10 @@ fn PassDerivedToBaseIndirect(p: Derived*) -> i32 { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Derived.ref: type = name_ref Derived, file.%Derived.decl.loc11 [template = constants.%Derived] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %Derived = value_param runtime_param0 +// CHECK:STDOUT: %Derived.ref: type = name_ref Derived, file.%Derived.decl.loc11 [template = constants.%Derived] // CHECK:STDOUT: %a: %Derived = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -111,11 +111,13 @@ fn PassDerivedToBaseIndirect(p: Derived*) -> i32 { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Derived.ref: type = name_ref Derived, file.%Derived.decl.loc11 [template = constants.%Derived] -// CHECK:STDOUT: %ptr: type = ptr_type %Derived [template = constants.%ptr.3] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %p.param: %ptr.3 = value_param runtime_param0 +// CHECK:STDOUT: %.loc29: type = splice_block %ptr [template = constants.%ptr.3] { +// CHECK:STDOUT: %Derived.ref: type = name_ref Derived, file.%Derived.decl.loc11 [template = constants.%Derived] +// CHECK:STDOUT: %ptr: type = ptr_type %Derived [template = constants.%ptr.3] +// CHECK:STDOUT: } // CHECK:STDOUT: %p: %ptr.3 = bind_name p, %p.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -126,10 +128,10 @@ fn PassDerivedToBaseIndirect(p: Derived*) -> i32 { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Derived.ref: type = name_ref Derived, file.%Derived.decl.loc11 [template = constants.%Derived] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %Derived = value_param runtime_param0 +// CHECK:STDOUT: %Derived.ref: type = name_ref Derived, file.%Derived.decl.loc11 [template = constants.%Derived] // CHECK:STDOUT: %a: %Derived = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -140,11 +142,13 @@ fn PassDerivedToBaseIndirect(p: Derived*) -> i32 { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Derived.ref: type = name_ref Derived, file.%Derived.decl.loc11 [template = constants.%Derived] -// CHECK:STDOUT: %ptr: type = ptr_type %Derived [template = constants.%ptr.3] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %p.param: %ptr.3 = value_param runtime_param0 +// CHECK:STDOUT: %.loc37: type = splice_block %ptr [template = constants.%ptr.3] { +// CHECK:STDOUT: %Derived.ref: type = name_ref Derived, file.%Derived.decl.loc11 [template = constants.%Derived] +// CHECK:STDOUT: %ptr: type = ptr_type %Derived [template = constants.%ptr.3] +// CHECK:STDOUT: } // CHECK:STDOUT: %p: %ptr.3 = bind_name p, %p.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -158,16 +162,16 @@ fn PassDerivedToBaseIndirect(p: Derived*) -> i32 { // CHECK:STDOUT: %self.patt: %Derived = binding_pattern self // CHECK:STDOUT: %self.param_patt: %Derived = value_param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Derived [template = constants.%Derived] // CHECK:STDOUT: %self.param: %Derived = value_param runtime_param0 +// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Derived [template = constants.%Derived] // CHECK:STDOUT: %self: %Derived = bind_name self, %self.param // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type.2 = fn_decl @G.2 [template = constants.%G.2] { // CHECK:STDOUT: %self.patt: %Derived = binding_pattern self // CHECK:STDOUT: %self.param_patt: %Derived = value_param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Derived [template = constants.%Derived] // CHECK:STDOUT: %self.param: %Derived = value_param runtime_param0 +// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Derived [template = constants.%Derived] // CHECK:STDOUT: %self: %Derived = bind_name self, %self.param // CHECK:STDOUT: } // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.base.1 [template = constants.%complete_type.3] @@ -188,10 +192,10 @@ fn PassDerivedToBaseIndirect(p: Derived*) -> i32 { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Base [template = constants.%Base] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %self.param: %Base = value_param runtime_param0 +// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Base [template = constants.%Base] // CHECK:STDOUT: %self: %Base = bind_name self, %self.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -202,10 +206,10 @@ fn PassDerivedToBaseIndirect(p: Derived*) -> i32 { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Derived.ref: type = name_ref Derived, file.%Derived.decl.loc11 [template = constants.%Derived] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %self.param: %Derived = value_param runtime_param0 +// CHECK:STDOUT: %Derived.ref: type = name_ref Derived, file.%Derived.decl.loc11 [template = constants.%Derived] // CHECK:STDOUT: %self: %Derived = bind_name self, %self.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param diff --git a/toolchain/check/testdata/class/base_method_shadow.carbon b/toolchain/check/testdata/class/base_method_shadow.carbon index 63cfe6d4e61c5..77068a8135fc3 100644 --- a/toolchain/check/testdata/class/base_method_shadow.carbon +++ b/toolchain/check/testdata/class/base_method_shadow.carbon @@ -95,21 +95,29 @@ fn Call(a: A*, b: B*, c: C*, d: D*) { // CHECK:STDOUT: %d.patt: %ptr.6 = binding_pattern d // CHECK:STDOUT: %d.param_patt: %ptr.6 = value_param_pattern %d.patt, runtime_param3 // CHECK:STDOUT: } { -// CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%A] -// CHECK:STDOUT: %ptr.loc29_13: type = ptr_type %A [template = constants.%ptr.1] -// CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [template = constants.%B] -// CHECK:STDOUT: %ptr.loc29_20: type = ptr_type %B [template = constants.%ptr.3] -// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %ptr.loc29_27: type = ptr_type %C [template = constants.%ptr.5] -// CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [template = constants.%D] -// CHECK:STDOUT: %ptr.loc29_34: type = ptr_type %D [template = constants.%ptr.6] // CHECK:STDOUT: %a.param: %ptr.1 = value_param runtime_param0 +// CHECK:STDOUT: %.loc29_13: type = splice_block %ptr.loc29_13 [template = constants.%ptr.1] { +// CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%A] +// CHECK:STDOUT: %ptr.loc29_13: type = ptr_type %A [template = constants.%ptr.1] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %ptr.1 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %ptr.3 = value_param runtime_param1 +// CHECK:STDOUT: %.loc29_20: type = splice_block %ptr.loc29_20 [template = constants.%ptr.3] { +// CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [template = constants.%B] +// CHECK:STDOUT: %ptr.loc29_20: type = ptr_type %B [template = constants.%ptr.3] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: %ptr.3 = bind_name b, %b.param // CHECK:STDOUT: %c.param: %ptr.5 = value_param runtime_param2 +// CHECK:STDOUT: %.loc29_27: type = splice_block %ptr.loc29_27 [template = constants.%ptr.5] { +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %ptr.loc29_27: type = ptr_type %C [template = constants.%ptr.5] +// CHECK:STDOUT: } // CHECK:STDOUT: %c: %ptr.5 = bind_name c, %c.param // CHECK:STDOUT: %d.param: %ptr.6 = value_param runtime_param3 +// CHECK:STDOUT: %.loc29_34: type = splice_block %ptr.loc29_34 [template = constants.%ptr.6] { +// CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [template = constants.%D] +// CHECK:STDOUT: %ptr.loc29_34: type = ptr_type %D [template = constants.%ptr.6] +// CHECK:STDOUT: } // CHECK:STDOUT: %d: %ptr.6 = bind_name d, %d.param // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -118,11 +126,13 @@ fn Call(a: A*, b: B*, c: C*, d: D*) { // CHECK:STDOUT: %F.decl: %F.type.1 = fn_decl @F.1 [template = constants.%F.1] { // CHECK:STDOUT: %self.patt: %ptr.1 = binding_pattern self // CHECK:STDOUT: %self.param_patt: %ptr.1 = value_param_pattern %self.patt, runtime_param0 -// CHECK:STDOUT: %.loc12: auto = addr_pattern %self.param_patt +// CHECK:STDOUT: %.loc12_8: auto = addr_pattern %self.param_patt // CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%A [template = constants.%A] -// CHECK:STDOUT: %ptr: type = ptr_type %A [template = constants.%ptr.1] // CHECK:STDOUT: %self.param: %ptr.1 = value_param runtime_param0 +// CHECK:STDOUT: %.loc12_23: type = splice_block %ptr [template = constants.%ptr.1] { +// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%A [template = constants.%A] +// CHECK:STDOUT: %ptr: type = ptr_type %A [template = constants.%ptr.1] +// CHECK:STDOUT: } // CHECK:STDOUT: %self: %ptr.1 = bind_name self, %self.param // CHECK:STDOUT: } // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] @@ -139,11 +149,13 @@ fn Call(a: A*, b: B*, c: C*, d: D*) { // CHECK:STDOUT: %F.decl: %F.type.2 = fn_decl @F.2 [template = constants.%F.2] { // CHECK:STDOUT: %self.patt: %ptr.3 = binding_pattern self // CHECK:STDOUT: %self.param_patt: %ptr.3 = value_param_pattern %self.patt, runtime_param0 -// CHECK:STDOUT: %.loc17: auto = addr_pattern %self.param_patt +// CHECK:STDOUT: %.loc17_8: auto = addr_pattern %self.param_patt // CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%B [template = constants.%B] -// CHECK:STDOUT: %ptr: type = ptr_type %B [template = constants.%ptr.3] // CHECK:STDOUT: %self.param: %ptr.3 = value_param runtime_param0 +// CHECK:STDOUT: %.loc17_23: type = splice_block %ptr [template = constants.%ptr.3] { +// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%B [template = constants.%B] +// CHECK:STDOUT: %ptr: type = ptr_type %B [template = constants.%ptr.3] +// CHECK:STDOUT: } // CHECK:STDOUT: %self: %ptr.3 = bind_name self, %self.param // CHECK:STDOUT: } // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.base.1 [template = constants.%complete_type.2] @@ -162,11 +174,13 @@ fn Call(a: A*, b: B*, c: C*, d: D*) { // CHECK:STDOUT: %F.decl: %F.type.3 = fn_decl @F.3 [template = constants.%F.3] { // CHECK:STDOUT: %self.patt: %ptr.5 = binding_pattern self // CHECK:STDOUT: %self.param_patt: %ptr.5 = value_param_pattern %self.patt, runtime_param0 -// CHECK:STDOUT: %.loc22: auto = addr_pattern %self.param_patt +// CHECK:STDOUT: %.loc22_8: auto = addr_pattern %self.param_patt // CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C [template = constants.%C] -// CHECK:STDOUT: %ptr: type = ptr_type %C [template = constants.%ptr.5] // CHECK:STDOUT: %self.param: %ptr.5 = value_param runtime_param0 +// CHECK:STDOUT: %.loc22_23: type = splice_block %ptr [template = constants.%ptr.5] { +// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C [template = constants.%C] +// CHECK:STDOUT: %ptr: type = ptr_type %C [template = constants.%ptr.5] +// CHECK:STDOUT: } // CHECK:STDOUT: %self: %ptr.5 = bind_name self, %self.param // CHECK:STDOUT: } // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.base.3 [template = constants.%complete_type.3] diff --git a/toolchain/check/testdata/class/basic.carbon b/toolchain/check/testdata/class/basic.carbon index ec52c5abbfa8a..c7a8d89e65c4f 100644 --- a/toolchain/check/testdata/class/basic.carbon +++ b/toolchain/check/testdata/class/basic.carbon @@ -74,11 +74,13 @@ fn Run() -> i32 { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc21_15: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc21_15: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc21_23: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc21_23: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %n.param.loc21: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc21: type = splice_block %i32.loc21_15 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc21_15: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc21_15: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %n.loc21: %i32 = bind_name n, %n.param.loc21 // CHECK:STDOUT: %return.param.loc21: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return.loc21: ref %i32 = return_slot %return.param.loc21 @@ -103,11 +105,13 @@ fn Run() -> i32 { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc12_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc12_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc12_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc12_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %n.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc12: type = splice_block %i32.loc12_11 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc12_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc12_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %n: %i32 = bind_name n, %n.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -118,17 +122,17 @@ fn Run() -> i32 { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc16_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc16_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc16_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc16_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %n.param.loc16: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc16: type = splice_block %i32.loc16_11 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc16_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc16_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %n.loc16: %i32 = bind_name n, %n.param.loc16 // CHECK:STDOUT: %return.param.loc16: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return.loc16: ref %i32 = return_slot %return.param.loc16 // CHECK:STDOUT: } -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc18: %Class.elem = field_decl k, element0 [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.k [template = constants.%complete_type.3] // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/complete_in_member_fn.carbon b/toolchain/check/testdata/class/complete_in_member_fn.carbon index 50b7d737294c0..e187b287e9c82 100644 --- a/toolchain/check/testdata/class/complete_in_member_fn.carbon +++ b/toolchain/check/testdata/class/complete_in_member_fn.carbon @@ -51,16 +51,14 @@ class C { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %c.param: %C = value_param runtime_param0 +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %c: %C = bind_name c, %c.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc14: %C.elem = field_decl a, element0 [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a [template = constants.%complete_type.3] // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/compound_field.carbon b/toolchain/check/testdata/class/compound_field.carbon index c0186b5d0d09a..86f9af24e2c2f 100644 --- a/toolchain/check/testdata/class/compound_field.carbon +++ b/toolchain/check/testdata/class/compound_field.carbon @@ -90,10 +90,10 @@ fn AccessBaseIndirect(p: Derived*) -> i32* { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Derived.ref.loc24: type = name_ref Derived, file.%Derived.decl [template = constants.%Derived] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %d.param: %Derived = value_param runtime_param0 +// CHECK:STDOUT: %Derived.ref.loc24: type = name_ref Derived, file.%Derived.decl [template = constants.%Derived] // CHECK:STDOUT: %d: %Derived = bind_name d, %d.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -104,10 +104,10 @@ fn AccessBaseIndirect(p: Derived*) -> i32* { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Derived.ref: type = name_ref Derived, file.%Derived.decl [template = constants.%Derived] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %d.param: %Derived = value_param runtime_param0 +// CHECK:STDOUT: %Derived.ref: type = name_ref Derived, file.%Derived.decl [template = constants.%Derived] // CHECK:STDOUT: %d: %Derived = bind_name d, %d.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -118,12 +118,14 @@ fn AccessBaseIndirect(p: Derived*) -> i32* { // CHECK:STDOUT: %return.patt: %ptr.5 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %ptr.5 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Derived.ref.loc32: type = name_ref Derived, file.%Derived.decl [template = constants.%Derived] -// CHECK:STDOUT: %ptr.loc32_36: type = ptr_type %Derived [template = constants.%ptr.4] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %ptr.loc32_45: type = ptr_type %i32 [template = constants.%ptr.5] // CHECK:STDOUT: %p.param: %ptr.4 = value_param runtime_param0 +// CHECK:STDOUT: %.loc32: type = splice_block %ptr.loc32_36 [template = constants.%ptr.4] { +// CHECK:STDOUT: %Derived.ref.loc32: type = name_ref Derived, file.%Derived.decl [template = constants.%Derived] +// CHECK:STDOUT: %ptr.loc32_36: type = ptr_type %Derived [template = constants.%ptr.4] +// CHECK:STDOUT: } // CHECK:STDOUT: %p: %ptr.4 = bind_name p, %p.param // CHECK:STDOUT: %return.param: ref %ptr.5 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %ptr.5 = return_slot %return.param @@ -134,12 +136,14 @@ fn AccessBaseIndirect(p: Derived*) -> i32* { // CHECK:STDOUT: %return.patt: %ptr.5 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %ptr.5 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Derived.ref: type = name_ref Derived, file.%Derived.decl [template = constants.%Derived] -// CHECK:STDOUT: %ptr.loc36_33: type = ptr_type %Derived [template = constants.%ptr.4] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %ptr.loc36_42: type = ptr_type %i32 [template = constants.%ptr.5] // CHECK:STDOUT: %p.param: %ptr.4 = value_param runtime_param0 +// CHECK:STDOUT: %.loc36: type = splice_block %ptr.loc36_33 [template = constants.%ptr.4] { +// CHECK:STDOUT: %Derived.ref: type = name_ref Derived, file.%Derived.decl [template = constants.%Derived] +// CHECK:STDOUT: %ptr.loc36_33: type = ptr_type %Derived [template = constants.%ptr.4] +// CHECK:STDOUT: } // CHECK:STDOUT: %p: %ptr.4 = bind_name p, %p.param // CHECK:STDOUT: %return.param: ref %ptr.5 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %ptr.5 = return_slot %return.param @@ -147,14 +151,8 @@ fn AccessBaseIndirect(p: Derived*) -> i32* { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Base { -// CHECK:STDOUT: %int_32.loc12: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc12: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc12: %Base.elem = field_decl a, element0 [template] -// CHECK:STDOUT: %int_32.loc13: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc13: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc13: %Base.elem = field_decl b, element1 [template] -// CHECK:STDOUT: %int_32.loc14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc14: %Base.elem = field_decl c, element2 [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a.b.c [template = constants.%complete_type.3] // CHECK:STDOUT: @@ -169,11 +167,7 @@ fn AccessBaseIndirect(p: Derived*) -> i32* { // CHECK:STDOUT: class @Derived { // CHECK:STDOUT: %Base.ref: type = name_ref Base, file.%Base.decl [template = constants.%Base] // CHECK:STDOUT: %.loc18: %Derived.elem.1 = base_decl %Base.ref, element0 [template] -// CHECK:STDOUT: %int_32.loc20: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc20: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc20: %Derived.elem.2 = field_decl d, element1 [template] -// CHECK:STDOUT: %int_32.loc21: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc21: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc21: %Derived.elem.2 = field_decl e, element2 [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.base.d.e.1 [template = constants.%complete_type.4] // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/cross_package_import.carbon b/toolchain/check/testdata/class/cross_package_import.carbon index d2fbf9b2d7345..62b5487289ee2 100644 --- a/toolchain/check/testdata/class/cross_package_import.carbon +++ b/toolchain/check/testdata/class/cross_package_import.carbon @@ -201,7 +201,6 @@ var c: Other.C = {}; // CHECK:STDOUT: .C = %import_ref.1 // CHECK:STDOUT: import Other//other_define // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref Other//other_define, C, loaded [template = constants.%C] // CHECK:STDOUT: %import_ref.2: = import_ref Other//other_define, loc4_10, loaded [template = constants.%complete_type] // CHECK:STDOUT: %import_ref.3 = import_ref Other//other_define, inst16 [no loc], unloaded // CHECK:STDOUT: } @@ -214,8 +213,6 @@ var c: Other.C = {}; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Other.import = import Other -// CHECK:STDOUT: %Other.ref: = name_ref Other, imports.%Other [template = imports.%Other] -// CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %c.var: ref %C = var c // CHECK:STDOUT: %c: ref %C = bind_name c, %c.var // CHECK:STDOUT: } @@ -238,7 +235,6 @@ var c: Other.C = {}; // CHECK:STDOUT: --- fail_extern.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -251,7 +247,6 @@ var c: Other.C = {}; // CHECK:STDOUT: .C = %import_ref // CHECK:STDOUT: import Other//other_extern // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref: type = import_ref Other//other_extern, C, loaded [template = constants.%C] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -262,8 +257,6 @@ var c: Other.C = {}; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Other.import = import Other -// CHECK:STDOUT: %Other.ref: = name_ref Other, imports.%Other [template = imports.%Other] -// CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref [template = constants.%C] // CHECK:STDOUT: %c.var: ref = var c // CHECK:STDOUT: %c: ref = bind_name c, %c.var // CHECK:STDOUT: } @@ -296,7 +289,6 @@ var c: Other.C = {}; // CHECK:STDOUT: import Other//other_define // CHECK:STDOUT: import Other//other_extern // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref Other//other_define, C, loaded [template = constants.%C] // CHECK:STDOUT: %import_ref.2: = import_ref Other//other_define, loc4_10, loaded [template = constants.%complete_type] // CHECK:STDOUT: %import_ref.3 = import_ref Other//other_define, inst16 [no loc], unloaded // CHECK:STDOUT: } @@ -309,8 +301,6 @@ var c: Other.C = {}; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Other.import = import Other -// CHECK:STDOUT: %Other.ref: = name_ref Other, imports.%Other [template = imports.%Other] -// CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %c.var: ref %C = var c // CHECK:STDOUT: %c: ref %C = bind_name c, %c.var // CHECK:STDOUT: } @@ -349,7 +339,6 @@ var c: Other.C = {}; // CHECK:STDOUT: import Other//other_define // CHECK:STDOUT: import Other//other_conflict // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref Other//other_define, C, loaded [template = constants.%C] // CHECK:STDOUT: %import_ref.2: = import_ref Other//other_define, loc4_10, loaded [template = constants.%complete_type] // CHECK:STDOUT: %import_ref.3 = import_ref Other//other_define, inst16 [no loc], unloaded // CHECK:STDOUT: } @@ -362,8 +351,6 @@ var c: Other.C = {}; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Other.import = import Other -// CHECK:STDOUT: %Other.ref: = name_ref Other, imports.%Other [template = imports.%Other] -// CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %c.var: ref %C = var c // CHECK:STDOUT: %c: ref %C = bind_name c, %c.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/derived_to_base.carbon b/toolchain/check/testdata/class/derived_to_base.carbon index d21ea07f24b2c..f6830842aca74 100644 --- a/toolchain/check/testdata/class/derived_to_base.carbon +++ b/toolchain/check/testdata/class/derived_to_base.carbon @@ -128,11 +128,13 @@ fn ConvertInit() { // CHECK:STDOUT: %return.patt: %ptr.5 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %ptr.5 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %ptr.loc25_20: type = ptr_type %C [template = constants.%ptr.4] // CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [template = constants.%B] // CHECK:STDOUT: %ptr.loc25_27: type = ptr_type %B [template = constants.%ptr.5] // CHECK:STDOUT: %p.param: %ptr.4 = value_param runtime_param0 +// CHECK:STDOUT: %.loc25_20: type = splice_block %ptr.loc25_20 [template = constants.%ptr.4] { +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %ptr.loc25_20: type = ptr_type %C [template = constants.%ptr.4] +// CHECK:STDOUT: } // CHECK:STDOUT: %p: %ptr.4 = bind_name p, %p.param // CHECK:STDOUT: %return.param: ref %ptr.5 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %ptr.5 = return_slot %return.param @@ -143,11 +145,13 @@ fn ConvertInit() { // CHECK:STDOUT: %return.patt: %ptr.8 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %ptr.8 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [template = constants.%B] -// CHECK:STDOUT: %ptr.loc26_20: type = ptr_type %B [template = constants.%ptr.5] // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%A] // CHECK:STDOUT: %ptr.loc26_27: type = ptr_type %A [template = constants.%ptr.8] // CHECK:STDOUT: %p.param: %ptr.5 = value_param runtime_param0 +// CHECK:STDOUT: %.loc26_20: type = splice_block %ptr.loc26_20 [template = constants.%ptr.5] { +// CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [template = constants.%B] +// CHECK:STDOUT: %ptr.loc26_20: type = ptr_type %B [template = constants.%ptr.5] +// CHECK:STDOUT: } // CHECK:STDOUT: %p: %ptr.5 = bind_name p, %p.param // CHECK:STDOUT: %return.param: ref %ptr.8 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %ptr.8 = return_slot %return.param @@ -158,11 +162,13 @@ fn ConvertInit() { // CHECK:STDOUT: %return.patt: %ptr.8 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %ptr.8 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %ptr.loc27_20: type = ptr_type %C [template = constants.%ptr.4] // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%A] // CHECK:STDOUT: %ptr.loc27_27: type = ptr_type %A [template = constants.%ptr.8] // CHECK:STDOUT: %p.param: %ptr.4 = value_param runtime_param0 +// CHECK:STDOUT: %.loc27_20: type = splice_block %ptr.loc27_20 [template = constants.%ptr.4] { +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %ptr.loc27_20: type = ptr_type %C [template = constants.%ptr.4] +// CHECK:STDOUT: } // CHECK:STDOUT: %p: %ptr.4 = bind_name p, %p.param // CHECK:STDOUT: %return.param: ref %ptr.8 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %ptr.8 = return_slot %return.param @@ -171,8 +177,8 @@ fn ConvertInit() { // CHECK:STDOUT: %c.patt: %C = binding_pattern c // CHECK:STDOUT: %c.param_patt: %C = value_param_pattern %c.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %c.param: %C = value_param runtime_param0 +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %c: %C = bind_name c, %c.param // CHECK:STDOUT: } // CHECK:STDOUT: %ConvertRef.decl: %ConvertRef.type = fn_decl @ConvertRef [template = constants.%ConvertRef] { @@ -181,11 +187,13 @@ fn ConvertInit() { // CHECK:STDOUT: %return.patt: %ptr.8 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %ptr.8 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %ptr.loc33_19: type = ptr_type %C [template = constants.%ptr.4] // CHECK:STDOUT: %A.ref.loc33: type = name_ref A, file.%A.decl [template = constants.%A] // CHECK:STDOUT: %ptr.loc33_26: type = ptr_type %A [template = constants.%ptr.8] // CHECK:STDOUT: %c.param: %ptr.4 = value_param runtime_param0 +// CHECK:STDOUT: %.loc33: type = splice_block %ptr.loc33_19 [template = constants.%ptr.4] { +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %ptr.loc33_19: type = ptr_type %C [template = constants.%ptr.4] +// CHECK:STDOUT: } // CHECK:STDOUT: %c: %ptr.4 = bind_name c, %c.param // CHECK:STDOUT: %return.param: ref %ptr.8 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %ptr.8 = return_slot %return.param @@ -194,8 +202,6 @@ fn ConvertInit() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @A { -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc12: %A.elem = field_decl a, element0 [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a.1 [template = constants.%complete_type.3] // CHECK:STDOUT: @@ -208,8 +214,6 @@ fn ConvertInit() { // CHECK:STDOUT: class @B { // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%A] // CHECK:STDOUT: %.loc16: %B.elem.1 = base_decl %A.ref, element0 [template] -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc17: %B.elem.2 = field_decl b, element1 [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.base.b.1 [template = constants.%complete_type.4] // CHECK:STDOUT: @@ -224,8 +228,6 @@ fn ConvertInit() { // CHECK:STDOUT: class @C { // CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [template = constants.%B] // CHECK:STDOUT: %.loc21: %C.elem.1 = base_decl %B.ref, element0 [template] -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc22: %C.elem.2 = field_decl c, element1 [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.base.c.1 [template = constants.%complete_type.5] // CHECK:STDOUT: @@ -270,7 +272,6 @@ fn ConvertInit() { // CHECK:STDOUT: // CHECK:STDOUT: fn @ConvertValue(%c.param_patt: %C) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%A] // CHECK:STDOUT: %c.ref: %C = name_ref c, %c // CHECK:STDOUT: %.loc30_15.1: ref %B = class_element_access %c.ref, element0 // CHECK:STDOUT: %.loc30_15.2: ref %A = class_element_access %.loc30_15.1, element0 @@ -294,7 +295,6 @@ fn ConvertInit() { // CHECK:STDOUT: // CHECK:STDOUT: fn @ConvertInit() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%A] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %.loc38_39.1: %struct_type.a.2 = struct_literal (%int_1) // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] diff --git a/toolchain/check/testdata/class/fail_abstract.carbon b/toolchain/check/testdata/class/fail_abstract.carbon index 7d5dd15499e90..7441ecf269dcd 100644 --- a/toolchain/check/testdata/class/fail_abstract.carbon +++ b/toolchain/check/testdata/class/fail_abstract.carbon @@ -224,7 +224,6 @@ fn CallReturnAbstract() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Contains { -// CHECK:STDOUT: %Abstract.ref: type = name_ref Abstract, file.%Abstract.decl [template = constants.%Abstract] // CHECK:STDOUT: %.loc15: = field_decl a, element0 [template] // CHECK:STDOUT: %complete_type: = complete_type_witness [template = ] // CHECK:STDOUT: @@ -272,7 +271,6 @@ fn CallReturnAbstract() { // CHECK:STDOUT: // CHECK:STDOUT: fn @Var() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Abstract.ref: type = name_ref Abstract, file.%Abstract.decl [template = constants.%Abstract] // CHECK:STDOUT: %v.var: ref = var v // CHECK:STDOUT: %v: ref = bind_name v, %v.var // CHECK:STDOUT: return @@ -307,8 +305,8 @@ fn CallReturnAbstract() { // CHECK:STDOUT: %a.patt: %Abstract = binding_pattern a // CHECK:STDOUT: %a.param_patt: %Abstract = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Abstract.ref.loc7: type = name_ref Abstract, file.%Abstract.decl [template = constants.%Abstract] // CHECK:STDOUT: %a.param: %Abstract = value_param runtime_param0 +// CHECK:STDOUT: %Abstract.ref: type = name_ref Abstract, file.%Abstract.decl [template = constants.%Abstract] // CHECK:STDOUT: %a: %Abstract = bind_name a, %a.param // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -323,7 +321,6 @@ fn CallReturnAbstract() { // CHECK:STDOUT: // CHECK:STDOUT: fn @F(%a.param_patt: %Abstract) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Abstract.ref.loc8: type = name_ref Abstract, file.%Abstract.decl [template = constants.%Abstract] // CHECK:STDOUT: %a.ref: %Abstract = name_ref a, %a // CHECK:STDOUT: %l: %Abstract = bind_name l, // CHECK:STDOUT: return @@ -407,16 +404,16 @@ fn CallReturnAbstract() { // CHECK:STDOUT: %a.patt: %Abstract = binding_pattern a // CHECK:STDOUT: %a.param_patt: %Abstract = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Abstract.ref: type = name_ref Abstract, file.%Abstract.decl [template = constants.%Abstract] // CHECK:STDOUT: %a.param: %Abstract = value_param runtime_param0 +// CHECK:STDOUT: %Abstract.ref: type = name_ref Abstract, file.%Abstract.decl [template = constants.%Abstract] // CHECK:STDOUT: %a: %Abstract = bind_name a, %a.param // CHECK:STDOUT: } // CHECK:STDOUT: %Call.decl: %Call.type = fn_decl @Call [template = constants.%Call] { // CHECK:STDOUT: %p.patt: %Abstract = binding_pattern p // CHECK:STDOUT: %p.param_patt: %Abstract = value_param_pattern %p.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Abstract.ref: type = name_ref Abstract, file.%Abstract.decl [template = constants.%Abstract] // CHECK:STDOUT: %p.param: %Abstract = value_param runtime_param0 +// CHECK:STDOUT: %Abstract.ref: type = name_ref Abstract, file.%Abstract.decl [template = constants.%Abstract] // CHECK:STDOUT: %p: %Abstract = bind_name p, %p.param // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -499,8 +496,6 @@ fn CallReturnAbstract() { // CHECK:STDOUT: class @Derived { // CHECK:STDOUT: %Abstract.ref: type = name_ref Abstract, file.%Abstract.decl [template = constants.%Abstract] // CHECK:STDOUT: %.loc8: %Derived.elem.1 = base_decl %Abstract.ref, element0 [template] -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc10: %Derived.elem.2 = field_decl d, element1 [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.base.d.1 [template = constants.%complete_type.4] // CHECK:STDOUT: @@ -562,9 +557,9 @@ fn CallReturnAbstract() { // CHECK:STDOUT: %return.patt: %Abstract = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %Abstract = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Abstract.ref.loc13_14: type = name_ref Abstract, file.%Abstract.decl [template = constants.%Abstract] // CHECK:STDOUT: %Abstract.ref.loc13_27: type = name_ref Abstract, file.%Abstract.decl [template = constants.%Abstract] // CHECK:STDOUT: %a.param: %Abstract = value_param runtime_param0 +// CHECK:STDOUT: %Abstract.ref.loc13_14: type = name_ref Abstract, file.%Abstract.decl [template = constants.%Abstract] // CHECK:STDOUT: %a: %Abstract = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %Abstract = out_param runtime_param1 // CHECK:STDOUT: %return: ref %Abstract = return_slot %return.param @@ -582,8 +577,6 @@ fn CallReturnAbstract() { // CHECK:STDOUT: class @Derived { // CHECK:STDOUT: %Abstract.ref: type = name_ref Abstract, file.%Abstract.decl [template = constants.%Abstract] // CHECK:STDOUT: %.loc8: %Derived.elem.1 = base_decl %Abstract.ref, element0 [template] -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc10: %Derived.elem.2 = field_decl d, element1 [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.base.d [template = constants.%complete_type.4] // CHECK:STDOUT: @@ -643,10 +636,10 @@ fn CallReturnAbstract() { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Derived.ref: type = name_ref Derived, file.%Derived.decl [template = constants.%Derived] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %d.param: %Derived = value_param runtime_param0 +// CHECK:STDOUT: %Derived.ref: type = name_ref Derived, file.%Derived.decl [template = constants.%Derived] // CHECK:STDOUT: %d: %Derived = bind_name d, %d.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -654,8 +647,6 @@ fn CallReturnAbstract() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Abstract { -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc5: %Abstract.elem = field_decl a, element0 [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a [template = constants.%complete_type.3] // CHECK:STDOUT: @@ -668,8 +659,6 @@ fn CallReturnAbstract() { // CHECK:STDOUT: class @Derived { // CHECK:STDOUT: %Abstract.ref: type = name_ref Abstract, file.%Abstract.decl [template = constants.%Abstract] // CHECK:STDOUT: %.loc9: %Derived.elem.1 = base_decl %Abstract.ref, element0 [template] -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc11: %Derived.elem.2 = field_decl d, element1 [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.base.d.1 [template = constants.%complete_type.4] // CHECK:STDOUT: @@ -728,7 +717,6 @@ fn CallReturnAbstract() { // CHECK:STDOUT: // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Abstract.ref: type = name_ref Abstract, file.%Abstract.decl [template = constants.%Abstract] // CHECK:STDOUT: %.loc8: %empty_struct_type = struct_literal () // CHECK:STDOUT: %l: %Abstract = bind_name l, // CHECK:STDOUT: return diff --git a/toolchain/check/testdata/class/fail_addr_not_self.carbon b/toolchain/check/testdata/class/fail_addr_not_self.carbon index 17375149f2a66..c4be24431262f 100644 --- a/toolchain/check/testdata/class/fail_addr_not_self.carbon +++ b/toolchain/check/testdata/class/fail_addr_not_self.carbon @@ -57,18 +57,22 @@ class Class { // CHECK:STDOUT: %a.patt.loc16_13.2: %ptr = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc16_13.1 (constants.%a.patt)] // CHECK:STDOUT: %a.param_patt: %ptr = value_param_pattern %a.patt.loc16_13.2, runtime_param [symbolic = %a.patt.loc16_13.1 (constants.%a.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class] -// CHECK:STDOUT: %ptr: type = ptr_type %Class [template = constants.%ptr] // CHECK:STDOUT: %a.param: %ptr = value_param runtime_param +// CHECK:STDOUT: %.loc16: type = splice_block %ptr [template = constants.%ptr] { +// CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class] +// CHECK:STDOUT: %ptr: type = ptr_type %Class [template = constants.%ptr] +// CHECK:STDOUT: } // CHECK:STDOUT: %a.loc16_13.2: %ptr = bind_symbolic_name a, 0, %a.param [symbolic = %a.loc16_13.1 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %b.patt: %ptr = binding_pattern b // CHECK:STDOUT: %b.param_patt: %ptr = value_param_pattern %b.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class] -// CHECK:STDOUT: %ptr: type = ptr_type %Class [template = constants.%ptr] // CHECK:STDOUT: %b.param: %ptr = value_param runtime_param0 +// CHECK:STDOUT: %.loc21: type = splice_block %ptr [template = constants.%ptr] { +// CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class] +// CHECK:STDOUT: %ptr: type = ptr_type %Class [template = constants.%ptr] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: %ptr = bind_name b, %b.param // CHECK:STDOUT: } // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] diff --git a/toolchain/check/testdata/class/fail_addr_self.carbon b/toolchain/check/testdata/class/fail_addr_self.carbon index ee4409ee6c14b..5a585232daded 100644 --- a/toolchain/check/testdata/class/fail_addr_self.carbon +++ b/toolchain/check/testdata/class/fail_addr_self.carbon @@ -71,12 +71,14 @@ fn F(c: Class, p: Class*) { // CHECK:STDOUT: %p.patt: %ptr.1 = binding_pattern p // CHECK:STDOUT: %p.param_patt: %ptr.1 = value_param_pattern %p.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Class.ref.loc20_9: type = name_ref Class, file.%Class.decl [template = constants.%Class] -// CHECK:STDOUT: %Class.ref.loc20_19: type = name_ref Class, file.%Class.decl [template = constants.%Class] -// CHECK:STDOUT: %ptr: type = ptr_type %Class [template = constants.%ptr.1] // CHECK:STDOUT: %c.param: %Class = value_param runtime_param0 +// CHECK:STDOUT: %Class.ref.loc20_9: type = name_ref Class, file.%Class.decl [template = constants.%Class] // CHECK:STDOUT: %c: %Class = bind_name c, %c.param // CHECK:STDOUT: %p.param: %ptr.1 = value_param runtime_param1 +// CHECK:STDOUT: %.loc20: type = splice_block %ptr [template = constants.%ptr.1] { +// CHECK:STDOUT: %Class.ref.loc20_19: type = name_ref Class, file.%Class.decl [template = constants.%Class] +// CHECK:STDOUT: %ptr: type = ptr_type %Class [template = constants.%ptr.1] +// CHECK:STDOUT: } // CHECK:STDOUT: %p: %ptr.1 = bind_name p, %p.param // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -85,19 +87,21 @@ fn F(c: Class, p: Class*) { // CHECK:STDOUT: %F.decl: %F.type.1 = fn_decl @F.1 [template = constants.%F.1] { // CHECK:STDOUT: %self.patt: %ptr.1 = binding_pattern self // CHECK:STDOUT: %self.param_patt: %ptr.1 = value_param_pattern %self.patt, runtime_param0 -// CHECK:STDOUT: %.loc12: auto = addr_pattern %self.param_patt +// CHECK:STDOUT: %.loc12_8: auto = addr_pattern %self.param_patt // CHECK:STDOUT: } { -// CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class] -// CHECK:STDOUT: %ptr: type = ptr_type %Class [template = constants.%ptr.1] // CHECK:STDOUT: %self.param: %ptr.1 = value_param runtime_param0 +// CHECK:STDOUT: %.loc12_24: type = splice_block %ptr [template = constants.%ptr.1] { +// CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class] +// CHECK:STDOUT: %ptr: type = ptr_type %Class [template = constants.%ptr.1] +// CHECK:STDOUT: } // CHECK:STDOUT: %self: %ptr.1 = bind_name self, %self.param // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %self.patt: %Class = binding_pattern self // CHECK:STDOUT: %self.param_patt: %Class = value_param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class] // CHECK:STDOUT: %self.param: %Class = value_param runtime_param0 +// CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class] // CHECK:STDOUT: %self: %Class = bind_name self, %self.param // CHECK:STDOUT: } // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] diff --git a/toolchain/check/testdata/class/fail_base_bad_type.carbon b/toolchain/check/testdata/class/fail_base_bad_type.carbon index a8507308fa66a..2e4d8c582b78f 100644 --- a/toolchain/check/testdata/class/fail_base_bad_type.carbon +++ b/toolchain/check/testdata/class/fail_base_bad_type.carbon @@ -210,11 +210,13 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %DeriveFromError.ref: type = name_ref DeriveFromError, file.%DeriveFromError.decl [template = constants.%DeriveFromError] -// CHECK:STDOUT: %ptr: type = ptr_type %DeriveFromError [template = constants.%ptr] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %p.param: %ptr = value_param runtime_param0 +// CHECK:STDOUT: %.loc13_55: type = splice_block %ptr [template = constants.%ptr] { +// CHECK:STDOUT: %DeriveFromError.ref: type = name_ref DeriveFromError, file.%DeriveFromError.decl [template = constants.%DeriveFromError] +// CHECK:STDOUT: %ptr: type = ptr_type %DeriveFromError [template = constants.%ptr] +// CHECK:STDOUT: } // CHECK:STDOUT: %p: %ptr = bind_name p, %p.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -236,7 +238,7 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: fn @AccessMemberWithInvalidBaseError(%p.param_patt: %ptr) -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %p.ref: %ptr = name_ref p, %p -// CHECK:STDOUT: %.loc13: ref %DeriveFromError = deref %p.ref +// CHECK:STDOUT: %.loc13_75: ref %DeriveFromError = deref %p.ref // CHECK:STDOUT: %n.ref: = name_ref n, [template = ] // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -275,11 +277,13 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %DeriveFromNonType.ref: type = name_ref DeriveFromNonType, file.%DeriveFromNonType.decl [template = constants.%DeriveFromNonType] -// CHECK:STDOUT: %ptr: type = ptr_type %DeriveFromNonType [template = constants.%ptr] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %p.param: %ptr = value_param runtime_param0 +// CHECK:STDOUT: %.loc15_58: type = splice_block %ptr [template = constants.%ptr] { +// CHECK:STDOUT: %DeriveFromNonType.ref: type = name_ref DeriveFromNonType, file.%DeriveFromNonType.decl [template = constants.%DeriveFromNonType] +// CHECK:STDOUT: %ptr: type = ptr_type %DeriveFromNonType [template = constants.%ptr] +// CHECK:STDOUT: } // CHECK:STDOUT: %p: %ptr = bind_name p, %p.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -302,7 +306,7 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: fn @AccessMemberWithInvalidBasNonType(%p.param_patt: %ptr) -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %p.ref: %ptr = name_ref p, %p -// CHECK:STDOUT: %.loc15: ref %DeriveFromNonType = deref %p.ref +// CHECK:STDOUT: %.loc15_78: ref %DeriveFromNonType = deref %p.ref // CHECK:STDOUT: %n.ref: = name_ref n, [template = ] // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -347,12 +351,14 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: %return.patt: %ptr.2 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %ptr.2 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %DeriveFromi32.ref: type = name_ref DeriveFromi32, file.%DeriveFromi32.decl [template = constants.%DeriveFromi32] -// CHECK:STDOUT: %ptr.loc14_40: type = ptr_type %DeriveFromi32 [template = constants.%ptr.1] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %ptr.loc14_49: type = ptr_type %i32 [template = constants.%ptr.2] // CHECK:STDOUT: %p.param: %ptr.1 = value_param runtime_param0 +// CHECK:STDOUT: %.loc14_40: type = splice_block %ptr.loc14_40 [template = constants.%ptr.1] { +// CHECK:STDOUT: %DeriveFromi32.ref: type = name_ref DeriveFromi32, file.%DeriveFromi32.decl [template = constants.%DeriveFromi32] +// CHECK:STDOUT: %ptr.loc14_40: type = ptr_type %DeriveFromi32 [template = constants.%ptr.1] +// CHECK:STDOUT: } // CHECK:STDOUT: %p: %ptr.1 = bind_name p, %p.param // CHECK:STDOUT: %return.param: ref %ptr.2 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %ptr.2 = return_slot %return.param @@ -363,11 +369,13 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %DeriveFromi32.ref: type = name_ref DeriveFromi32, file.%DeriveFromi32.decl [template = constants.%DeriveFromi32] -// CHECK:STDOUT: %ptr: type = ptr_type %DeriveFromi32 [template = constants.%ptr.1] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %p.param: %ptr.1 = value_param runtime_param0 +// CHECK:STDOUT: %.loc20_51: type = splice_block %ptr [template = constants.%ptr.1] { +// CHECK:STDOUT: %DeriveFromi32.ref: type = name_ref DeriveFromi32, file.%DeriveFromi32.decl [template = constants.%DeriveFromi32] +// CHECK:STDOUT: %ptr: type = ptr_type %DeriveFromi32 [template = constants.%ptr.1] +// CHECK:STDOUT: } // CHECK:STDOUT: %p: %ptr.1 = bind_name p, %p.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -400,7 +408,7 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: fn @AccessMemberWithInvalidBasei32(%p.param_patt: %ptr.1) -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %p.ref: %ptr.1 = name_ref p, %p -// CHECK:STDOUT: %.loc20: ref %DeriveFromi32 = deref %p.ref +// CHECK:STDOUT: %.loc20_71: ref %DeriveFromi32 = deref %p.ref // CHECK:STDOUT: %n.ref: = name_ref n, [template = ] // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -450,13 +458,15 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: %return.patt: %ptr.3 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %ptr.3 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %DeriveFromTuple.ref: type = name_ref DeriveFromTuple, file.%DeriveFromTuple.decl [template = constants.%DeriveFromTuple] -// CHECK:STDOUT: %ptr.loc21_44: type = ptr_type %DeriveFromTuple [template = constants.%ptr.2] // CHECK:STDOUT: %Base.ref: type = name_ref Base, file.%Base.decl [template = constants.%Base] // CHECK:STDOUT: %.loc21_56: %tuple.type.1 = tuple_literal (%Base.ref) // CHECK:STDOUT: %.loc21_57: type = converted %.loc21_56, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %ptr.loc21_57: type = ptr_type %tuple.type.2 [template = constants.%ptr.3] // CHECK:STDOUT: %p.param: %ptr.2 = value_param runtime_param0 +// CHECK:STDOUT: %.loc21_44: type = splice_block %ptr.loc21_44 [template = constants.%ptr.2] { +// CHECK:STDOUT: %DeriveFromTuple.ref: type = name_ref DeriveFromTuple, file.%DeriveFromTuple.decl [template = constants.%DeriveFromTuple] +// CHECK:STDOUT: %ptr.loc21_44: type = ptr_type %DeriveFromTuple [template = constants.%ptr.2] +// CHECK:STDOUT: } // CHECK:STDOUT: %p: %ptr.2 = bind_name p, %p.param // CHECK:STDOUT: %return.param: ref %ptr.3 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %ptr.3 = return_slot %return.param @@ -467,11 +477,13 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %DeriveFromTuple.ref: type = name_ref DeriveFromTuple, file.%DeriveFromTuple.decl [template = constants.%DeriveFromTuple] -// CHECK:STDOUT: %ptr: type = ptr_type %DeriveFromTuple [template = constants.%ptr.2] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %p.param: %ptr.2 = value_param runtime_param0 +// CHECK:STDOUT: %.loc23_55: type = splice_block %ptr [template = constants.%ptr.2] { +// CHECK:STDOUT: %DeriveFromTuple.ref: type = name_ref DeriveFromTuple, file.%DeriveFromTuple.decl [template = constants.%DeriveFromTuple] +// CHECK:STDOUT: %ptr: type = ptr_type %DeriveFromTuple [template = constants.%ptr.2] +// CHECK:STDOUT: } // CHECK:STDOUT: %p: %ptr.2 = bind_name p, %p.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -510,7 +522,7 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: fn @AccessMemberWithInvalidBaseTuple(%p.param_patt: %ptr.2) -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %p.ref: %ptr.2 = name_ref p, %p -// CHECK:STDOUT: %.loc23: ref %DeriveFromTuple = deref %p.ref +// CHECK:STDOUT: %.loc23_75: ref %DeriveFromTuple = deref %p.ref // CHECK:STDOUT: %n.ref: = name_ref n, [template = ] // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -554,8 +566,6 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: %return.patt: %ptr.1 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %ptr.1 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %DeriveFromStruct.ref: type = name_ref DeriveFromStruct, file.%DeriveFromStruct.decl [template = constants.%DeriveFromStruct] -// CHECK:STDOUT: %ptr.loc21_46: type = ptr_type %DeriveFromStruct [template = constants.%ptr.2] // CHECK:STDOUT: %int_32.loc21_57: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc21_57: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc21_66: Core.IntLiteral = int_value 32 [template = constants.%int_32] @@ -563,6 +573,10 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: %struct_type.a.b: type = struct_type {.a: %i32, .b: %i32} [template = constants.%struct_type.a.b] // CHECK:STDOUT: %ptr.loc21_70: type = ptr_type %struct_type.a.b [template = constants.%ptr.1] // CHECK:STDOUT: %p.param: %ptr.2 = value_param runtime_param0 +// CHECK:STDOUT: %.loc21_46: type = splice_block %ptr.loc21_46 [template = constants.%ptr.2] { +// CHECK:STDOUT: %DeriveFromStruct.ref: type = name_ref DeriveFromStruct, file.%DeriveFromStruct.decl [template = constants.%DeriveFromStruct] +// CHECK:STDOUT: %ptr.loc21_46: type = ptr_type %DeriveFromStruct [template = constants.%ptr.2] +// CHECK:STDOUT: } // CHECK:STDOUT: %p: %ptr.2 = bind_name p, %p.param // CHECK:STDOUT: %return.param: ref %ptr.1 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %ptr.1 = return_slot %return.param @@ -573,11 +587,13 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %DeriveFromStruct.ref: type = name_ref DeriveFromStruct, file.%DeriveFromStruct.decl [template = constants.%DeriveFromStruct] -// CHECK:STDOUT: %ptr: type = ptr_type %DeriveFromStruct [template = constants.%ptr.2] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %p.param: %ptr.2 = value_param runtime_param0 +// CHECK:STDOUT: %.loc24_57: type = splice_block %ptr [template = constants.%ptr.2] { +// CHECK:STDOUT: %DeriveFromStruct.ref: type = name_ref DeriveFromStruct, file.%DeriveFromStruct.decl [template = constants.%DeriveFromStruct] +// CHECK:STDOUT: %ptr: type = ptr_type %DeriveFromStruct [template = constants.%ptr.2] +// CHECK:STDOUT: } // CHECK:STDOUT: %p: %ptr.2 = bind_name p, %p.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -603,14 +619,14 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: fn @ConvertToBadBaseStruct(%p.param_patt: %ptr.2) -> %ptr.1 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %p.ref: %ptr.2 = name_ref p, %p -// CHECK:STDOUT: %.loc21: %ptr.1 = converted %p.ref, [template = ] +// CHECK:STDOUT: %.loc21_82: %ptr.1 = converted %p.ref, [template = ] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @AccessMemberWithInvalidBaseStruct(%p.param_patt: %ptr.2) -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %p.ref: %ptr.2 = name_ref p, %p -// CHECK:STDOUT: %.loc24: ref %DeriveFromStruct = deref %p.ref +// CHECK:STDOUT: %.loc24_77: ref %DeriveFromStruct = deref %p.ref // CHECK:STDOUT: %n.ref: = name_ref n, [template = ] // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -656,11 +672,13 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: %return.patt: %ptr.2 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %ptr.2 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %DeriveFromIncomplete.ref: type = name_ref DeriveFromIncomplete, file.%DeriveFromIncomplete.decl [template = constants.%DeriveFromIncomplete] -// CHECK:STDOUT: %ptr.loc28_54: type = ptr_type %DeriveFromIncomplete [template = constants.%ptr.1] // CHECK:STDOUT: %Incomplete.ref: type = name_ref Incomplete, file.%Incomplete.decl [template = constants.%Incomplete] // CHECK:STDOUT: %ptr.loc28_70: type = ptr_type %Incomplete [template = constants.%ptr.2] // CHECK:STDOUT: %p.param: %ptr.1 = value_param runtime_param0 +// CHECK:STDOUT: %.loc28_54: type = splice_block %ptr.loc28_54 [template = constants.%ptr.1] { +// CHECK:STDOUT: %DeriveFromIncomplete.ref: type = name_ref DeriveFromIncomplete, file.%DeriveFromIncomplete.decl [template = constants.%DeriveFromIncomplete] +// CHECK:STDOUT: %ptr.loc28_54: type = ptr_type %DeriveFromIncomplete [template = constants.%ptr.1] +// CHECK:STDOUT: } // CHECK:STDOUT: %p: %ptr.1 = bind_name p, %p.param // CHECK:STDOUT: %return.param: ref %ptr.2 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %ptr.2 = return_slot %return.param @@ -671,11 +689,13 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %DeriveFromIncomplete.ref: type = name_ref DeriveFromIncomplete, file.%DeriveFromIncomplete.decl [template = constants.%DeriveFromIncomplete] -// CHECK:STDOUT: %ptr: type = ptr_type %DeriveFromIncomplete [template = constants.%ptr.1] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %p.param: %ptr.1 = value_param runtime_param0 +// CHECK:STDOUT: %.loc30_65: type = splice_block %ptr [template = constants.%ptr.1] { +// CHECK:STDOUT: %DeriveFromIncomplete.ref: type = name_ref DeriveFromIncomplete, file.%DeriveFromIncomplete.decl [template = constants.%DeriveFromIncomplete] +// CHECK:STDOUT: %ptr: type = ptr_type %DeriveFromIncomplete [template = constants.%ptr.1] +// CHECK:STDOUT: } // CHECK:STDOUT: %p: %ptr.1 = bind_name p, %p.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -699,14 +719,14 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: fn @ConvertToBadBaseIncomplete(%p.param_patt: %ptr.1) -> %ptr.2 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %p.ref: %ptr.1 = name_ref p, %p -// CHECK:STDOUT: %.loc28: %ptr.2 = converted %p.ref, [template = ] +// CHECK:STDOUT: %.loc28_82: %ptr.2 = converted %p.ref, [template = ] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @AccessMemberWithInvalidBaseIncomplete(%p.param_patt: %ptr.1) -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %p.ref: %ptr.1 = name_ref p, %p -// CHECK:STDOUT: %.loc30: ref %DeriveFromIncomplete = deref %p.ref +// CHECK:STDOUT: %.loc30_85: ref %DeriveFromIncomplete = deref %p.ref // CHECK:STDOUT: %n.ref: = name_ref n, [template = ] // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -760,11 +780,13 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: %return.patt: %ptr.3 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %ptr.3 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %DeriveFromFinal.ref: type = name_ref DeriveFromFinal, file.%DeriveFromFinal.decl [template = constants.%DeriveFromFinal] -// CHECK:STDOUT: %ptr.loc17_44: type = ptr_type %DeriveFromFinal [template = constants.%ptr.2] // CHECK:STDOUT: %Final.ref: type = name_ref Final, file.%Final.decl [template = constants.%Final] // CHECK:STDOUT: %ptr.loc17_55: type = ptr_type %Final [template = constants.%ptr.3] // CHECK:STDOUT: %p.param: %ptr.2 = value_param runtime_param0 +// CHECK:STDOUT: %.loc17: type = splice_block %ptr.loc17_44 [template = constants.%ptr.2] { +// CHECK:STDOUT: %DeriveFromFinal.ref: type = name_ref DeriveFromFinal, file.%DeriveFromFinal.decl [template = constants.%DeriveFromFinal] +// CHECK:STDOUT: %ptr.loc17_44: type = ptr_type %DeriveFromFinal [template = constants.%ptr.2] +// CHECK:STDOUT: } // CHECK:STDOUT: %p: %ptr.2 = bind_name p, %p.param // CHECK:STDOUT: %return.param: ref %ptr.3 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %ptr.3 = return_slot %return.param @@ -775,11 +797,13 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %DeriveFromFinal.ref: type = name_ref DeriveFromFinal, file.%DeriveFromFinal.decl [template = constants.%DeriveFromFinal] -// CHECK:STDOUT: %ptr: type = ptr_type %DeriveFromFinal [template = constants.%ptr.2] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %p.param: %ptr.2 = value_param runtime_param0 +// CHECK:STDOUT: %.loc21: type = splice_block %ptr [template = constants.%ptr.2] { +// CHECK:STDOUT: %DeriveFromFinal.ref: type = name_ref DeriveFromFinal, file.%DeriveFromFinal.decl [template = constants.%DeriveFromFinal] +// CHECK:STDOUT: %ptr: type = ptr_type %DeriveFromFinal [template = constants.%ptr.2] +// CHECK:STDOUT: } // CHECK:STDOUT: %p: %ptr.2 = bind_name p, %p.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -790,11 +814,13 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %DeriveFromFinal.ref: type = name_ref DeriveFromFinal, file.%DeriveFromFinal.decl [template = constants.%DeriveFromFinal] -// CHECK:STDOUT: %ptr: type = ptr_type %DeriveFromFinal [template = constants.%ptr.2] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %p.param: %ptr.2 = value_param runtime_param0 +// CHECK:STDOUT: %.loc25: type = splice_block %ptr [template = constants.%ptr.2] { +// CHECK:STDOUT: %DeriveFromFinal.ref: type = name_ref DeriveFromFinal, file.%DeriveFromFinal.decl [template = constants.%DeriveFromFinal] +// CHECK:STDOUT: %ptr: type = ptr_type %DeriveFromFinal [template = constants.%ptr.2] +// CHECK:STDOUT: } // CHECK:STDOUT: %p: %ptr.2 = bind_name p, %p.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -802,8 +828,6 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Final { -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc5: %Final.elem = field_decl a, element0 [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a [template = constants.%complete_type.3] // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/fail_base_misplaced.carbon b/toolchain/check/testdata/class/fail_base_misplaced.carbon index fbd0ce4c4fae9..cab8006aab9b4 100644 --- a/toolchain/check/testdata/class/fail_base_misplaced.carbon +++ b/toolchain/check/testdata/class/fail_base_misplaced.carbon @@ -45,7 +45,5 @@ fn F() { // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F() { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: } +// CHECK:STDOUT: fn @F(); // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/fail_base_unbound.carbon b/toolchain/check/testdata/class/fail_base_unbound.carbon index 76b1ad017bdbe..1ed694588f75e 100644 --- a/toolchain/check/testdata/class/fail_base_unbound.carbon +++ b/toolchain/check/testdata/class/fail_base_unbound.carbon @@ -48,7 +48,6 @@ let b: B = C.base; // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %B.decl: type = class_decl @B [template = constants.%B] {} {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} -// CHECK:STDOUT: %B.ref: type = name_ref B, %B.decl [template = constants.%B] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @B { diff --git a/toolchain/check/testdata/class/fail_compound_type_mismatch.carbon b/toolchain/check/testdata/class/fail_compound_type_mismatch.carbon index 6cddd1cf7dc85..deee7774126a5 100644 --- a/toolchain/check/testdata/class/fail_compound_type_mismatch.carbon +++ b/toolchain/check/testdata/class/fail_compound_type_mismatch.carbon @@ -68,10 +68,10 @@ fn AccessBInA(a: A) -> i32 { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%A] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %A = value_param runtime_param0 +// CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%A] // CHECK:STDOUT: %a: %A = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -79,8 +79,6 @@ fn AccessBInA(a: A) -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @A { -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc12: %A.elem = field_decl a, element0 [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a [template = constants.%complete_type.3] // CHECK:STDOUT: @@ -91,8 +89,6 @@ fn AccessBInA(a: A) -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @B { -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc16: %B.elem = field_decl b, element0 [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.b [template = constants.%complete_type.4] // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/fail_convert_to_invalid.carbon b/toolchain/check/testdata/class/fail_convert_to_invalid.carbon index 8243ac5840d96..dd2b85dab7c99 100644 --- a/toolchain/check/testdata/class/fail_convert_to_invalid.carbon +++ b/toolchain/check/testdata/class/fail_convert_to_invalid.carbon @@ -55,7 +55,6 @@ fn Make() -> C { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { -// CHECK:STDOUT: %NoSuchType.ref: = name_ref NoSuchType, [template = ] // CHECK:STDOUT: %.loc15: = field_decl a, element0 [template] // CHECK:STDOUT: %complete_type: = complete_type_witness [template = ] // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/fail_derived_to_base.carbon b/toolchain/check/testdata/class/fail_derived_to_base.carbon index a4cbf0c1d80ab..6b319c89ebdd0 100644 --- a/toolchain/check/testdata/class/fail_derived_to_base.carbon +++ b/toolchain/check/testdata/class/fail_derived_to_base.carbon @@ -96,11 +96,13 @@ fn ConvertIncomplete(p: Incomplete*) -> A2* { return p; } // CHECK:STDOUT: %return.patt: %ptr.3 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %ptr.3 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %B2.ref: type = name_ref B2, file.%B2.decl [template = constants.%B2] -// CHECK:STDOUT: %ptr.loc31_26: type = ptr_type %B2 [template = constants.%ptr.2] // CHECK:STDOUT: %A1.ref: type = name_ref A1, file.%A1.decl [template = constants.%A1] // CHECK:STDOUT: %ptr.loc31_34: type = ptr_type %A1 [template = constants.%ptr.3] // CHECK:STDOUT: %p.param: %ptr.2 = value_param runtime_param0 +// CHECK:STDOUT: %.loc31_26: type = splice_block %ptr.loc31_26 [template = constants.%ptr.2] { +// CHECK:STDOUT: %B2.ref: type = name_ref B2, file.%B2.decl [template = constants.%B2] +// CHECK:STDOUT: %ptr.loc31_26: type = ptr_type %B2 [template = constants.%ptr.2] +// CHECK:STDOUT: } // CHECK:STDOUT: %p: %ptr.2 = bind_name p, %p.param // CHECK:STDOUT: %return.param: ref %ptr.3 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %ptr.3 = return_slot %return.param @@ -112,11 +114,13 @@ fn ConvertIncomplete(p: Incomplete*) -> A2* { return p; } // CHECK:STDOUT: %return.patt: %ptr.7 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %ptr.7 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Incomplete.ref: type = name_ref Incomplete, file.%Incomplete.decl [template = constants.%Incomplete] -// CHECK:STDOUT: %ptr.loc41_35: type = ptr_type %Incomplete [template = constants.%ptr.6] // CHECK:STDOUT: %A2.ref: type = name_ref A2, file.%A2.decl [template = constants.%A2] // CHECK:STDOUT: %ptr.loc41_43: type = ptr_type %A2 [template = constants.%ptr.7] // CHECK:STDOUT: %p.param: %ptr.6 = value_param runtime_param0 +// CHECK:STDOUT: %.loc41_35: type = splice_block %ptr.loc41_35 [template = constants.%ptr.6] { +// CHECK:STDOUT: %Incomplete.ref: type = name_ref Incomplete, file.%Incomplete.decl [template = constants.%Incomplete] +// CHECK:STDOUT: %ptr.loc41_35: type = ptr_type %Incomplete [template = constants.%ptr.6] +// CHECK:STDOUT: } // CHECK:STDOUT: %p: %ptr.6 = bind_name p, %p.param // CHECK:STDOUT: %return.param: ref %ptr.7 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %ptr.7 = return_slot %return.param @@ -124,8 +128,6 @@ fn ConvertIncomplete(p: Incomplete*) -> A2* { return p; } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @A1 { -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc12: %A1.elem = field_decl a, element0 [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a [template = constants.%complete_type.3] // CHECK:STDOUT: @@ -136,8 +138,6 @@ fn ConvertIncomplete(p: Incomplete*) -> A2* { return p; } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @A2 { -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc16: %A2.elem = field_decl a, element0 [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a [template = constants.%complete_type.3] // CHECK:STDOUT: @@ -150,8 +150,6 @@ fn ConvertIncomplete(p: Incomplete*) -> A2* { return p; } // CHECK:STDOUT: class @B2 { // CHECK:STDOUT: %A2.ref: type = name_ref A2, file.%A2.decl [template = constants.%A2] // CHECK:STDOUT: %.loc20: %B2.elem.1 = base_decl %A2.ref, element0 [template] -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc21: %B2.elem.2 = field_decl b, element1 [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.base.b.1 [template = constants.%complete_type.4] // CHECK:STDOUT: @@ -168,14 +166,14 @@ fn ConvertIncomplete(p: Incomplete*) -> A2* { return p; } // CHECK:STDOUT: fn @ConvertUnrelated(%p.param_patt: %ptr.2) -> %ptr.3 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %p.ref: %ptr.2 = name_ref p, %p -// CHECK:STDOUT: %.loc31: %ptr.3 = converted %p.ref, [template = ] +// CHECK:STDOUT: %.loc31_46: %ptr.3 = converted %p.ref, [template = ] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @ConvertIncomplete(%p.param_patt: %ptr.6) -> %ptr.7 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %p.ref: %ptr.6 = name_ref p, %p -// CHECK:STDOUT: %.loc41: %ptr.7 = converted %p.ref, [template = ] +// CHECK:STDOUT: %.loc41_55: %ptr.7 = converted %p.ref, [template = ] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/fail_extend_cycle.carbon b/toolchain/check/testdata/class/fail_extend_cycle.carbon index e984c9946f9b5..e451fc829426b 100644 --- a/toolchain/check/testdata/class/fail_extend_cycle.carbon +++ b/toolchain/check/testdata/class/fail_extend_cycle.carbon @@ -87,7 +87,6 @@ base class A { // CHECK:STDOUT: class @.1 { // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%A] // CHECK:STDOUT: %.loc27: %.elem = base_decl %A.ref, element0 [template] -// CHECK:STDOUT: %C.ref: = name_ref C, [template = ] // CHECK:STDOUT: %.loc31: = field_decl c, element1 [template] // CHECK:STDOUT: %complete_type: = complete_type_witness [template = ] // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/fail_field_modifiers.carbon b/toolchain/check/testdata/class/fail_field_modifiers.carbon index 45a26d9633d07..db3d41b167da6 100644 --- a/toolchain/check/testdata/class/fail_field_modifiers.carbon +++ b/toolchain/check/testdata/class/fail_field_modifiers.carbon @@ -76,14 +76,8 @@ class Class { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Class { -// CHECK:STDOUT: %int_32.loc17: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc17: %Class.elem = field_decl j, element0 [template] -// CHECK:STDOUT: %int_32.loc23: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc23: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc23: %Class.elem = field_decl k, element1 [template] -// CHECK:STDOUT: %int_32.loc29: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc29: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %impl.elem0.loc29: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc29: = bound_method %int_0, %impl.elem0.loc29 [template = constants.%Convert.bound.1] @@ -92,8 +86,6 @@ class Class { // CHECK:STDOUT: %.loc29_25.1: %i32 = value_of_initializer %int.convert_checked.loc29 [template = constants.%int_0.2] // CHECK:STDOUT: %.loc29_25.2: %i32 = converted %int_0, %.loc29_25.1 [template = constants.%int_0.2] // CHECK:STDOUT: %l: %i32 = bind_name l, %.loc29_25.2 -// CHECK:STDOUT: %int_32.loc34: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc34: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %impl.elem0.loc34: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc34: = bound_method %int_1, %impl.elem0.loc34 [template = constants.%Convert.bound.2] diff --git a/toolchain/check/testdata/class/fail_generic_method.carbon b/toolchain/check/testdata/class/fail_generic_method.carbon index a29eab64d3a95..053e35afa5da2 100644 --- a/toolchain/check/testdata/class/fail_generic_method.carbon +++ b/toolchain/check/testdata/class/fail_generic_method.carbon @@ -80,15 +80,17 @@ fn Class(N:! i32).F[self: Self](n: T) {} // CHECK:STDOUT: %n.patt: = binding_pattern n // CHECK:STDOUT: %n.param_patt: = value_param_pattern %n.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %N.param: %i32 = value_param runtime_param +// CHECK:STDOUT: %.loc32: type = splice_block %i32 [template = constants.%i32] { +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %N.loc32_10.1: %i32 = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc32_10.2 (constants.%N.2)] -// CHECK:STDOUT: %Self.ref: = name_ref Self, [template = ] -// CHECK:STDOUT: %T.ref: = name_ref T, [template = ] // CHECK:STDOUT: %self.param: = value_param runtime_param0 +// CHECK:STDOUT: %Self.ref: = name_ref Self, [template = ] // CHECK:STDOUT: %self: = bind_name self, %self.param // CHECK:STDOUT: %n.param: = value_param runtime_param1 +// CHECK:STDOUT: %T.ref: = name_ref T, [template = ] // CHECK:STDOUT: %n: = bind_name n, %n.param // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -107,7 +109,6 @@ fn Class(N:! i32).F[self: Self](n: T) {} // CHECK:STDOUT: %complete_type.loc14_1.2: = complete_type_witness @Class.%struct_type.a (%struct_type.a) [symbolic = %complete_type.loc14_1.2 (constants.%complete_type.1)] // CHECK:STDOUT: // CHECK:STDOUT: class { -// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc11_13.1 [symbolic = %T.loc11_13.2 (constants.%T)] // CHECK:STDOUT: %.loc12: @Class.%Class.elem (%Class.elem) = field_decl a, element0 [template] // CHECK:STDOUT: %F.decl: @Class.%F.type (%F.type) = fn_decl @F [symbolic = @Class.%F (constants.%F)] { // CHECK:STDOUT: %self.patt: @F.%Class (%Class) = binding_pattern self @@ -115,12 +116,14 @@ fn Class(N:! i32).F[self: Self](n: T) {} // CHECK:STDOUT: %n.patt: @F.%T (%T) = binding_pattern n // CHECK:STDOUT: %n.param_patt: @F.%T (%T) = value_param_pattern %n.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc13: type = specific_constant constants.%Class, @Class(constants.%T) [symbolic = %Class (constants.%Class)] -// CHECK:STDOUT: %Self.ref: type = name_ref Self, %.loc13 [symbolic = %Class (constants.%Class)] -// CHECK:STDOUT: %T.ref: type = name_ref T, @Class.%T.loc11_13.1 [symbolic = %T (constants.%T)] // CHECK:STDOUT: %self.param: @F.%Class (%Class) = value_param runtime_param0 +// CHECK:STDOUT: %.loc13_14.2: type = splice_block %Self.ref [symbolic = %Class (constants.%Class)] { +// CHECK:STDOUT: %.loc13_14.1: type = specific_constant constants.%Class, @Class(constants.%T) [symbolic = %Class (constants.%Class)] +// CHECK:STDOUT: %Self.ref: type = name_ref Self, %.loc13_14.1 [symbolic = %Class (constants.%Class)] +// CHECK:STDOUT: } // CHECK:STDOUT: %self: @F.%Class (%Class) = bind_name self, %self.param // CHECK:STDOUT: %n.param: @F.%T (%T) = value_param runtime_param1 +// CHECK:STDOUT: %T.ref: type = name_ref T, @Class.%T.loc11_13.1 [symbolic = %T (constants.%T)] // CHECK:STDOUT: %n: @F.%T (%T) = bind_name n, %n.param // CHECK:STDOUT: } // CHECK:STDOUT: %complete_type.loc14_1.1: = complete_type_witness %struct_type.a [symbolic = %complete_type.loc14_1.2 (constants.%complete_type.1)] diff --git a/toolchain/check/testdata/class/fail_import_misuses.carbon b/toolchain/check/testdata/class/fail_import_misuses.carbon index 2ec2f5fb8e6d9..48db94307c6a2 100644 --- a/toolchain/check/testdata/class/fail_import_misuses.carbon +++ b/toolchain/check/testdata/class/fail_import_misuses.carbon @@ -111,7 +111,6 @@ var a: Incomplete; // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %.decl: type = class_decl @.1 [template = constants.%.1] {} {} -// CHECK:STDOUT: %Incomplete.ref: type = name_ref Incomplete, imports.%import_ref.2 [template = constants.%Incomplete] // CHECK:STDOUT: %a.var: ref = var a // CHECK:STDOUT: %a: ref = bind_name a, %a.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/fail_incomplete.carbon b/toolchain/check/testdata/class/fail_incomplete.carbon index 982296f8646ad..d08f14abfb730 100644 --- a/toolchain/check/testdata/class/fail_incomplete.carbon +++ b/toolchain/check/testdata/class/fail_incomplete.carbon @@ -242,7 +242,6 @@ class C { // CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} {} // CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.1] {} {} // CHECK:STDOUT: %CallClassFunction.decl: %CallClassFunction.type = fn_decl @CallClassFunction [template = constants.%CallClassFunction] {} {} -// CHECK:STDOUT: %Class.ref: type = name_ref Class, %Class.decl [template = constants.%Class] // CHECK:STDOUT: %global_var.var: ref = var global_var // CHECK:STDOUT: %global_var: ref = bind_name global_var, %global_var.var // CHECK:STDOUT: %ConvertFromStruct.decl: %ConvertFromStruct.type = fn_decl @ConvertFromStruct [template = constants.%ConvertFromStruct] { @@ -259,11 +258,13 @@ class C { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class] -// CHECK:STDOUT: %ptr: type = ptr_type %Class [template = constants.%ptr.1] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %p.param: %ptr.1 = value_param runtime_param0 +// CHECK:STDOUT: %.loc44: type = splice_block %ptr [template = constants.%ptr.1] { +// CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class] +// CHECK:STDOUT: %ptr: type = ptr_type %Class [template = constants.%ptr.1] +// CHECK:STDOUT: } // CHECK:STDOUT: %p: %ptr.1 = bind_name p, %p.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -274,11 +275,13 @@ class C { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class] -// CHECK:STDOUT: %ptr: type = ptr_type %Class [template = constants.%ptr.1] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %p.param: %ptr.1 = value_param runtime_param0 +// CHECK:STDOUT: %.loc55: type = splice_block %ptr [template = constants.%ptr.1] { +// CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class] +// CHECK:STDOUT: %ptr: type = ptr_type %Class [template = constants.%ptr.1] +// CHECK:STDOUT: } // CHECK:STDOUT: %p: %ptr.1 = bind_name p, %p.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -289,10 +292,12 @@ class C { // CHECK:STDOUT: %return.patt: %Class = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %Class = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Class.ref.loc73_12: type = name_ref Class, file.%Class.decl [template = constants.%Class] -// CHECK:STDOUT: %ptr: type = ptr_type %Class [template = constants.%ptr.1] // CHECK:STDOUT: %Class.ref.loc73_23: type = name_ref Class, file.%Class.decl [template = constants.%Class] // CHECK:STDOUT: %p.param: %ptr.1 = value_param runtime_param0 +// CHECK:STDOUT: %.loc73: type = splice_block %ptr [template = constants.%ptr.1] { +// CHECK:STDOUT: %Class.ref.loc73_12: type = name_ref Class, file.%Class.decl [template = constants.%Class] +// CHECK:STDOUT: %ptr: type = ptr_type %Class [template = constants.%ptr.1] +// CHECK:STDOUT: } // CHECK:STDOUT: %p: %ptr.1 = bind_name p, %p.param // CHECK:STDOUT: %return.param: ref %Class = out_param runtime_param1 // CHECK:STDOUT: %return: ref %Class = return_slot %return.param @@ -301,17 +306,19 @@ class C { // CHECK:STDOUT: %p.patt: %ptr.1 = binding_pattern p // CHECK:STDOUT: %p.param_patt: %ptr.1 = value_param_pattern %p.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Class.ref.loc77: type = name_ref Class, file.%Class.decl [template = constants.%Class] -// CHECK:STDOUT: %ptr: type = ptr_type %Class [template = constants.%ptr.1] // CHECK:STDOUT: %p.param: %ptr.1 = value_param runtime_param0 +// CHECK:STDOUT: %.loc77: type = splice_block %ptr [template = constants.%ptr.1] { +// CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class] +// CHECK:STDOUT: %ptr: type = ptr_type %Class [template = constants.%ptr.1] +// CHECK:STDOUT: } // CHECK:STDOUT: %p: %ptr.1 = bind_name p, %p.param // CHECK:STDOUT: } // CHECK:STDOUT: %TakeIncomplete.decl: %TakeIncomplete.type = fn_decl @TakeIncomplete [template = constants.%TakeIncomplete] { // CHECK:STDOUT: %c.patt: %Class = binding_pattern c // CHECK:STDOUT: %c.param_patt: %Class = value_param_pattern %c.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class] // CHECK:STDOUT: %c.param: %Class = value_param runtime_param0 +// CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class] // CHECK:STDOUT: %c: %Class = bind_name c, %c.param // CHECK:STDOUT: } // CHECK:STDOUT: %ReturnIncomplete.decl: %ReturnIncomplete.type = fn_decl @ReturnIncomplete [template = constants.%ReturnIncomplete] { @@ -326,9 +333,11 @@ class C { // CHECK:STDOUT: %p.patt: %ptr.1 = binding_pattern p // CHECK:STDOUT: %p.param_patt: %ptr.1 = value_param_pattern %p.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class] -// CHECK:STDOUT: %ptr: type = ptr_type %Class [template = constants.%ptr.1] // CHECK:STDOUT: %p.param: %ptr.1 = value_param runtime_param0 +// CHECK:STDOUT: %.loc92: type = splice_block %ptr [template = constants.%ptr.1] { +// CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class] +// CHECK:STDOUT: %ptr: type = ptr_type %Class [template = constants.%ptr.1] +// CHECK:STDOUT: } // CHECK:STDOUT: %p: %ptr.1 = bind_name p, %p.param // CHECK:STDOUT: } // CHECK:STDOUT: %CallReturnIncomplete.decl: %CallReturnIncomplete.type = fn_decl @CallReturnIncomplete [template = constants.%CallReturnIncomplete] {} {} @@ -337,9 +346,11 @@ class C { // CHECK:STDOUT: %p.patt: %ptr.1 = binding_pattern p // CHECK:STDOUT: %p.param_patt: %ptr.1 = value_param_pattern %p.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class] -// CHECK:STDOUT: %ptr: type = ptr_type %Class [template = constants.%ptr.1] // CHECK:STDOUT: %p.param: %ptr.1 = value_param runtime_param0 +// CHECK:STDOUT: %.loc136: type = splice_block %ptr [template = constants.%ptr.1] { +// CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class] +// CHECK:STDOUT: %ptr: type = ptr_type %Class [template = constants.%ptr.1] +// CHECK:STDOUT: } // CHECK:STDOUT: %p: %ptr.1 = bind_name p, %p.param // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -350,11 +361,13 @@ class C { // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %self.patt: %ptr.1 = binding_pattern self // CHECK:STDOUT: %self.param_patt: %ptr.1 = value_param_pattern %self.patt, runtime_param0 -// CHECK:STDOUT: %.loc133: auto = addr_pattern %self.param_patt +// CHECK:STDOUT: %.loc133_8: auto = addr_pattern %self.param_patt // CHECK:STDOUT: } { -// CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class] -// CHECK:STDOUT: %ptr: type = ptr_type %Class [template = constants.%ptr.1] // CHECK:STDOUT: %self.param: %ptr.1 = value_param runtime_param0 +// CHECK:STDOUT: %.loc133_24: type = splice_block %ptr [template = constants.%ptr.1] { +// CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class] +// CHECK:STDOUT: %ptr: type = ptr_type %Class [template = constants.%ptr.1] +// CHECK:STDOUT: } // CHECK:STDOUT: %self: %ptr.1 = bind_name self, %self.param // CHECK:STDOUT: } // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.3] @@ -406,7 +419,6 @@ class C { // CHECK:STDOUT: // CHECK:STDOUT: fn @Let(%p.param_patt: %ptr.1) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Class.ref.loc85: type = name_ref Class, file.%Class.decl [template = constants.%Class] // CHECK:STDOUT: %p.ref: %ptr.1 = name_ref p, %p // CHECK:STDOUT: %.loc85: ref %Class = deref %p.ref // CHECK:STDOUT: %c: = bind_name c, @@ -473,7 +485,6 @@ class C { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { -// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %.loc11: = field_decl c, element0 [template] // CHECK:STDOUT: %complete_type: = complete_type_witness [template = ] // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/fail_init.carbon b/toolchain/check/testdata/class/fail_init.carbon index f713a96dec8f3..dde6a52bcda92 100644 --- a/toolchain/check/testdata/class/fail_init.carbon +++ b/toolchain/check/testdata/class/fail_init.carbon @@ -77,11 +77,7 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Class { -// CHECK:STDOUT: %int_32.loc12: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc12: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc12: %Class.elem = field_decl a, element0 [template] -// CHECK:STDOUT: %int_32.loc13: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc13: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc13: %Class.elem = field_decl b, element1 [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a.b [template = constants.%complete_type.3] // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/fail_init_as_inplace.carbon b/toolchain/check/testdata/class/fail_init_as_inplace.carbon index b25bb19094bf6..c154e1e5101e1 100644 --- a/toolchain/check/testdata/class/fail_init_as_inplace.carbon +++ b/toolchain/check/testdata/class/fail_init_as_inplace.carbon @@ -79,20 +79,18 @@ fn F() { // CHECK:STDOUT: %p.patt: %ptr.1 = binding_pattern p // CHECK:STDOUT: %p.param_patt: %ptr.1 = value_param_pattern %p.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class] -// CHECK:STDOUT: %ptr: type = ptr_type %Class [template = constants.%ptr.1] // CHECK:STDOUT: %p.param: %ptr.1 = value_param runtime_param0 +// CHECK:STDOUT: %.loc16: type = splice_block %ptr [template = constants.%ptr.1] { +// CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class] +// CHECK:STDOUT: %ptr: type = ptr_type %Class [template = constants.%ptr.1] +// CHECK:STDOUT: } // CHECK:STDOUT: %p: %ptr.1 = bind_name p, %p.param // CHECK:STDOUT: } // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Class { -// CHECK:STDOUT: %int_32.loc12: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc12: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc12: %Class.elem = field_decl a, element0 [template] -// CHECK:STDOUT: %int_32.loc13: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc13: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc13: %Class.elem = field_decl b, element1 [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a.b.1 [template = constants.%complete_type.3] // CHECK:STDOUT: @@ -107,13 +105,12 @@ fn F() { // CHECK:STDOUT: // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Class.ref.loc25_10: type = name_ref Class, file.%Class.decl [template = constants.%Class] // CHECK:STDOUT: %c.var: ref %Class = var c // CHECK:STDOUT: %c: ref %Class = bind_name c, %c.var // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %.loc25_33.1: %struct_type.a.b.2 = struct_literal (%int_1, %int_2) -// CHECK:STDOUT: %Class.ref.loc25_38: type = name_ref Class, file.%Class.decl [template = constants.%Class] +// CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class] // CHECK:STDOUT: %impl.elem0.loc25_33.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc25_33.1: = bound_method %int_1, %impl.elem0.loc25_33.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc25_33.1: = specific_function %Convert.bound.loc25_33.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] diff --git a/toolchain/check/testdata/class/fail_memaccess_category.carbon b/toolchain/check/testdata/class/fail_memaccess_category.carbon index 2fe95cf72eb75..c3158aae6a1fc 100644 --- a/toolchain/check/testdata/class/fail_memaccess_category.carbon +++ b/toolchain/check/testdata/class/fail_memaccess_category.carbon @@ -79,12 +79,14 @@ fn F(s: {.a: A}, b: B) { // CHECK:STDOUT: %b.patt: %B = binding_pattern b // CHECK:STDOUT: %b.param_patt: %B = value_param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%A] -// CHECK:STDOUT: %struct_type.a: type = struct_type {.a: %A} [template = constants.%struct_type.a.1] -// CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [template = constants.%B] // CHECK:STDOUT: %s.param: %struct_type.a.1 = value_param runtime_param0 +// CHECK:STDOUT: %.loc19: type = splice_block %struct_type.a [template = constants.%struct_type.a.1] { +// CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%A] +// CHECK:STDOUT: %struct_type.a: type = struct_type {.a: %A} [template = constants.%struct_type.a.1] +// CHECK:STDOUT: } // CHECK:STDOUT: %s: %struct_type.a.1 = bind_name s, %s.param // CHECK:STDOUT: %b.param: %B = value_param runtime_param1 +// CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [template = constants.%B] // CHECK:STDOUT: %b: %B = bind_name b, %b.param // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -93,11 +95,13 @@ fn F(s: {.a: A}, b: B) { // CHECK:STDOUT: %F.decl: %F.type.1 = fn_decl @F.1 [template = constants.%F.1] { // CHECK:STDOUT: %self.patt: %ptr.1 = binding_pattern self // CHECK:STDOUT: %self.param_patt: %ptr.1 = value_param_pattern %self.patt, runtime_param0 -// CHECK:STDOUT: %.loc12: auto = addr_pattern %self.param_patt +// CHECK:STDOUT: %.loc12_8: auto = addr_pattern %self.param_patt // CHECK:STDOUT: } { -// CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%A] -// CHECK:STDOUT: %ptr: type = ptr_type %A [template = constants.%ptr.1] // CHECK:STDOUT: %self.param: %ptr.1 = value_param runtime_param0 +// CHECK:STDOUT: %.loc12_20: type = splice_block %ptr [template = constants.%ptr.1] { +// CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%A] +// CHECK:STDOUT: %ptr: type = ptr_type %A [template = constants.%ptr.1] +// CHECK:STDOUT: } // CHECK:STDOUT: %self: %ptr.1 = bind_name self, %self.param // CHECK:STDOUT: } // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] @@ -109,7 +113,6 @@ fn F(s: {.a: A}, b: B) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @B { -// CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%A] // CHECK:STDOUT: %.loc16: %B.elem = field_decl a, element0 [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a.1 [template = constants.%complete_type.2] // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/fail_method.carbon b/toolchain/check/testdata/class/fail_method.carbon index ea19c923e1e0e..63a7dcb57c4dc 100644 --- a/toolchain/check/testdata/class/fail_method.carbon +++ b/toolchain/check/testdata/class/fail_method.carbon @@ -84,8 +84,8 @@ fn F(c: Class) { // CHECK:STDOUT: %c.patt: %Class = binding_pattern c // CHECK:STDOUT: %c.param_patt: %Class = value_param_pattern %c.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Class.ref.loc18: type = name_ref Class, file.%Class.decl [template = constants.%Class] // CHECK:STDOUT: %c.param: %Class = value_param runtime_param0 +// CHECK:STDOUT: %Class.ref.loc18: type = name_ref Class, file.%Class.decl [template = constants.%Class] // CHECK:STDOUT: %c: %Class = bind_name c, %c.param // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -96,8 +96,8 @@ fn F(c: Class) { // CHECK:STDOUT: %self.patt: %Class = binding_pattern self // CHECK:STDOUT: %self.param_patt: %Class = value_param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class] // CHECK:STDOUT: %self.param: %Class = value_param runtime_param0 +// CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class] // CHECK:STDOUT: %self: %Class = bind_name self, %self.param // CHECK:STDOUT: } // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] diff --git a/toolchain/check/testdata/class/fail_method_modifiers.carbon b/toolchain/check/testdata/class/fail_method_modifiers.carbon index 15513e95bfdca..c74835a28bd18 100644 --- a/toolchain/check/testdata/class/fail_method_modifiers.carbon +++ b/toolchain/check/testdata/class/fail_method_modifiers.carbon @@ -100,16 +100,16 @@ base class BaseClass { // CHECK:STDOUT: %self.patt: %FinalClass = binding_pattern self // CHECK:STDOUT: %self.param_patt: %FinalClass = value_param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%FinalClass [template = constants.%FinalClass] // CHECK:STDOUT: %self.param: %FinalClass = value_param runtime_param0 +// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%FinalClass [template = constants.%FinalClass] // CHECK:STDOUT: %self: %FinalClass = bind_name self, %self.param // CHECK:STDOUT: } // CHECK:STDOUT: %Virtual.decl: %Virtual.type = fn_decl @Virtual [template = constants.%Virtual] { // CHECK:STDOUT: %self.patt: %FinalClass = binding_pattern self // CHECK:STDOUT: %self.param_patt: %FinalClass = value_param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%FinalClass [template = constants.%FinalClass] // CHECK:STDOUT: %self.param: %FinalClass = value_param runtime_param0 +// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%FinalClass [template = constants.%FinalClass] // CHECK:STDOUT: %self: %FinalClass = bind_name self, %self.param // CHECK:STDOUT: } // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] @@ -126,16 +126,16 @@ base class BaseClass { // CHECK:STDOUT: %self.patt: %AbstractClass = binding_pattern self // CHECK:STDOUT: %self.param_patt: %AbstractClass = value_param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%AbstractClass [template = constants.%AbstractClass] // CHECK:STDOUT: %self.param: %AbstractClass = value_param runtime_param0 +// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%AbstractClass [template = constants.%AbstractClass] // CHECK:STDOUT: %self: %AbstractClass = bind_name self, %self.param // CHECK:STDOUT: } // CHECK:STDOUT: %Final.decl: %Final.type = fn_decl @Final [template = constants.%Final] { // CHECK:STDOUT: %self.patt: %AbstractClass = binding_pattern self // CHECK:STDOUT: %self.param_patt: %AbstractClass = value_param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%AbstractClass [template = constants.%AbstractClass] // CHECK:STDOUT: %self.param: %AbstractClass = value_param runtime_param0 +// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%AbstractClass [template = constants.%AbstractClass] // CHECK:STDOUT: %self: %AbstractClass = bind_name self, %self.param // CHECK:STDOUT: } // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] @@ -152,8 +152,8 @@ base class BaseClass { // CHECK:STDOUT: %self.patt: %BaseClass = binding_pattern self // CHECK:STDOUT: %self.param_patt: %BaseClass = value_param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%BaseClass [template = constants.%BaseClass] // CHECK:STDOUT: %self.param: %BaseClass = value_param runtime_param0 +// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%BaseClass [template = constants.%BaseClass] // CHECK:STDOUT: %self: %BaseClass = bind_name self, %self.param // CHECK:STDOUT: } // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] diff --git a/toolchain/check/testdata/class/fail_method_redefinition.carbon b/toolchain/check/testdata/class/fail_method_redefinition.carbon index 4336edc648cb5..1e6fbaf8e2a42 100644 --- a/toolchain/check/testdata/class/fail_method_redefinition.carbon +++ b/toolchain/check/testdata/class/fail_method_redefinition.carbon @@ -59,8 +59,5 @@ class Class { // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return -// CHECK:STDOUT: -// CHECK:STDOUT: !.loc19: -// CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/fail_redefinition.carbon b/toolchain/check/testdata/class/fail_redefinition.carbon index 35f2b6d4ebf08..edcb3e1fd4ace 100644 --- a/toolchain/check/testdata/class/fail_redefinition.carbon +++ b/toolchain/check/testdata/class/fail_redefinition.carbon @@ -128,9 +128,6 @@ fn Class.I() {} // CHECK:STDOUT: fn @I.1() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return -// CHECK:STDOUT: -// CHECK:STDOUT: !.loc43: -// CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @G.1(); diff --git a/toolchain/check/testdata/class/fail_self.carbon b/toolchain/check/testdata/class/fail_self.carbon index f811759befd35..3c642bb093f8d 100644 --- a/toolchain/check/testdata/class/fail_self.carbon +++ b/toolchain/check/testdata/class/fail_self.carbon @@ -94,8 +94,8 @@ fn CallWrongSelf(ws: WrongSelf) { // CHECK:STDOUT: %self.patt: %Class = binding_pattern self // CHECK:STDOUT: %self.param_patt: %Class = value_param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref.loc25: type = name_ref Self, constants.%Class [template = constants.%Class] // CHECK:STDOUT: %self.param.loc25: %Class = value_param runtime_param0 +// CHECK:STDOUT: %Self.ref.loc25: type = name_ref Self, constants.%Class [template = constants.%Class] // CHECK:STDOUT: %self.loc25: %Class = bind_name self, %self.param.loc25 // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { @@ -111,8 +111,8 @@ fn CallWrongSelf(ws: WrongSelf) { // CHECK:STDOUT: %ws.patt: %WrongSelf = binding_pattern ws // CHECK:STDOUT: %ws.param_patt: %WrongSelf = value_param_pattern %ws.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %WrongSelf.ref: type = name_ref WrongSelf, file.%WrongSelf.decl [template = constants.%WrongSelf] // CHECK:STDOUT: %ws.param: %WrongSelf = value_param runtime_param0 +// CHECK:STDOUT: %WrongSelf.ref: type = name_ref WrongSelf, file.%WrongSelf.decl [template = constants.%WrongSelf] // CHECK:STDOUT: %ws: %WrongSelf = bind_name ws, %ws.param // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -122,8 +122,8 @@ fn CallWrongSelf(ws: WrongSelf) { // CHECK:STDOUT: %self.patt: %Class = binding_pattern self // CHECK:STDOUT: %self.param_patt: %Class = value_param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref.loc16: type = name_ref Self, constants.%Class [template = constants.%Class] // CHECK:STDOUT: %self.param.loc16: %Class = value_param runtime_param0 +// CHECK:STDOUT: %Self.ref.loc16: type = name_ref Self, constants.%Class [template = constants.%Class] // CHECK:STDOUT: %self.loc16: %Class = bind_name self, %self.param.loc16 // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { @@ -148,8 +148,8 @@ fn CallWrongSelf(ws: WrongSelf) { // CHECK:STDOUT: %self.patt: %Class = binding_pattern self // CHECK:STDOUT: %self.param_patt: %Class = value_param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class] // CHECK:STDOUT: %self.param: %Class = value_param runtime_param0 +// CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class] // CHECK:STDOUT: %self: %Class = bind_name self, %self.param // CHECK:STDOUT: } // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] @@ -167,7 +167,6 @@ fn CallWrongSelf(ws: WrongSelf) { // CHECK:STDOUT: // CHECK:STDOUT: fn @G() -> %return.param_patt: %Class { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Self.ref.loc33: type = name_ref Self, constants.%Class [template = constants.%Class] // CHECK:STDOUT: %self.var: ref %Class = var self // CHECK:STDOUT: %self: ref %Class = bind_name self, %self.var // CHECK:STDOUT: %self.ref: ref %Class = name_ref self, %self diff --git a/toolchain/check/testdata/class/fail_self_param.carbon b/toolchain/check/testdata/class/fail_self_param.carbon index 9c63a698b3a09..1ef6924cf2f5d 100644 --- a/toolchain/check/testdata/class/fail_self_param.carbon +++ b/toolchain/check/testdata/class/fail_self_param.carbon @@ -22,7 +22,6 @@ var v: C(0); // CHECK:STDOUT: %C.generic: %C.type = struct_value () [template] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] -// CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -43,12 +42,10 @@ var v: C(0); // CHECK:STDOUT: %x.patt.loc14_22.1: = symbolic_binding_pattern x, 0 [symbolic = %x.patt.loc14_22.2 (constants.%x.patt)] // CHECK:STDOUT: %x.param_patt: = value_param_pattern %x.patt.loc14_22.1, runtime_param [symbolic = %x.patt.loc14_22.2 (constants.%x.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %self.ref: = name_ref self, [template = ] // CHECK:STDOUT: %x.param: = value_param runtime_param +// CHECK:STDOUT: %self.ref: = name_ref self, [template = ] // CHECK:STDOUT: %x: = bind_symbolic_name x, 0, %x.param [template = ] // CHECK:STDOUT: } -// CHECK:STDOUT: %C.ref: %C.type = name_ref C, %C.decl [template = constants.%C.generic] -// CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0] // CHECK:STDOUT: %v.var: ref = var v // CHECK:STDOUT: %v: ref = bind_name v, %v.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/fail_self_type_member.carbon b/toolchain/check/testdata/class/fail_self_type_member.carbon index ce7510e8cf3fc..9db3b12b3df01 100644 --- a/toolchain/check/testdata/class/fail_self_type_member.carbon +++ b/toolchain/check/testdata/class/fail_self_type_member.carbon @@ -29,8 +29,6 @@ fn F() -> bool { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %Class: type = class_type @Class [template] -// CHECK:STDOUT: %Bool.type: type = fn_type @Bool [template] -// CHECK:STDOUT: %Bool: %Bool.type = struct_value () [template] // CHECK:STDOUT: %Class.elem: type = unbound_element_type %Class, bool [template] // CHECK:STDOUT: %struct_type.b: type = struct_type {.b: bool} [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.b [template] @@ -39,19 +37,14 @@ fn F() -> bool { // CHECK:STDOUT: file {} // CHECK:STDOUT: // CHECK:STDOUT: class @Class { -// CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc12_10.1: type = value_of_initializer %bool.make_type [template = bool] -// CHECK:STDOUT: %.loc12_10.2: type = converted %bool.make_type, %.loc12_10.1 [template = bool] -// CHECK:STDOUT: %.loc12_8: %Class.elem = field_decl b, element0 [template] +// CHECK:STDOUT: %.loc12: %Class.elem = field_decl b, element0 [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.b [template = constants.%complete_type] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class -// CHECK:STDOUT: .b = %.loc12_8 +// CHECK:STDOUT: .b = %.loc12 // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F() -> bool { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: } +// CHECK:STDOUT: fn @F() -> bool; // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/fail_todo_local_class.carbon b/toolchain/check/testdata/class/fail_todo_local_class.carbon index 39c8fc2aa61c9..7b246ca8fe424 100644 --- a/toolchain/check/testdata/class/fail_todo_local_class.carbon +++ b/toolchain/check/testdata/class/fail_todo_local_class.carbon @@ -48,7 +48,5 @@ class A { // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F() { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: } +// CHECK:STDOUT: fn @F(); // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/fail_unbound_field.carbon b/toolchain/check/testdata/class/fail_unbound_field.carbon index 3c28b48a51fb6..37f56bcf47aea 100644 --- a/toolchain/check/testdata/class/fail_unbound_field.carbon +++ b/toolchain/check/testdata/class/fail_unbound_field.carbon @@ -69,8 +69,6 @@ fn G() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Class { -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc12: %Class.elem = field_decl field, element0 [template] // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern diff --git a/toolchain/check/testdata/class/fail_unknown_member.carbon b/toolchain/check/testdata/class/fail_unknown_member.carbon index f381b0f3297d3..70ffa1b3537a7 100644 --- a/toolchain/check/testdata/class/fail_unknown_member.carbon +++ b/toolchain/check/testdata/class/fail_unknown_member.carbon @@ -55,10 +55,10 @@ fn G(c: Class) -> i32 { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %c.param: %Class = value_param runtime_param0 +// CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class] // CHECK:STDOUT: %c: %Class = bind_name c, %c.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -66,8 +66,6 @@ fn G(c: Class) -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Class { -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc12: %Class.elem = field_decl n, element0 [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.n [template = constants.%complete_type.3] // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/field_access.carbon b/toolchain/check/testdata/class/field_access.carbon index e237f048eebc9..75379cfab9d36 100644 --- a/toolchain/check/testdata/class/field_access.carbon +++ b/toolchain/check/testdata/class/field_access.carbon @@ -67,11 +67,7 @@ fn Run() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Class { -// CHECK:STDOUT: %int_32.loc12: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc12: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc12: %Class.elem = field_decl j, element0 [template] -// CHECK:STDOUT: %int_32.loc13: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc13: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc13: %Class.elem = field_decl k, element1 [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.j.k [template = constants.%complete_type.3] // CHECK:STDOUT: @@ -84,7 +80,6 @@ fn Run() { // CHECK:STDOUT: // CHECK:STDOUT: fn @Run() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class] // CHECK:STDOUT: %c.var: ref %Class = var c // CHECK:STDOUT: %c: ref %Class = bind_name c, %c.var // CHECK:STDOUT: %c.ref.loc18: ref %Class = name_ref c, %c @@ -107,8 +102,6 @@ fn Run() { // CHECK:STDOUT: %int.convert_checked.loc19: init %i32 = call %Convert.specific_fn.loc19(%int_2) [template = constants.%int_2.2] // CHECK:STDOUT: %.loc19_7: init %i32 = converted %int_2, %int.convert_checked.loc19 [template = constants.%int_2.2] // CHECK:STDOUT: assign %.loc19_4, %.loc19_7 -// CHECK:STDOUT: %int_32.loc20: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc20: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %cj.var: ref %i32 = var cj // CHECK:STDOUT: %cj: ref %i32 = bind_name cj, %cj.var // CHECK:STDOUT: %c.ref.loc20: ref %Class = name_ref c, %c @@ -116,8 +109,6 @@ fn Run() { // CHECK:STDOUT: %.loc20_18.1: ref %i32 = class_element_access %c.ref.loc20, element0 // CHECK:STDOUT: %.loc20_18.2: %i32 = bind_value %.loc20_18.1 // CHECK:STDOUT: assign %cj.var, %.loc20_18.2 -// CHECK:STDOUT: %int_32.loc21: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc21: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %ck.var: ref %i32 = var ck // CHECK:STDOUT: %ck: ref %i32 = bind_name ck, %ck.var // CHECK:STDOUT: %c.ref.loc21: ref %Class = name_ref c, %c diff --git a/toolchain/check/testdata/class/field_access_in_value.carbon b/toolchain/check/testdata/class/field_access_in_value.carbon index 748ddba84a38b..8fef8721fe7e3 100644 --- a/toolchain/check/testdata/class/field_access_in_value.carbon +++ b/toolchain/check/testdata/class/field_access_in_value.carbon @@ -68,11 +68,7 @@ fn Test() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Class { -// CHECK:STDOUT: %int_32.loc12: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc12: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc12: %Class.elem = field_decl j, element0 [template] -// CHECK:STDOUT: %int_32.loc13: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc13: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc13: %Class.elem = field_decl k, element1 [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.j.k [template = constants.%complete_type.3] // CHECK:STDOUT: @@ -85,7 +81,6 @@ fn Test() { // CHECK:STDOUT: // CHECK:STDOUT: fn @Test() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Class.ref.loc17: type = name_ref Class, file.%Class.decl [template = constants.%Class] // CHECK:STDOUT: %cv.var: ref %Class = var cv // CHECK:STDOUT: %cv: ref %Class = bind_name cv, %cv.var // CHECK:STDOUT: %cv.ref.loc18: ref %Class = name_ref cv, %cv @@ -108,12 +103,9 @@ fn Test() { // CHECK:STDOUT: %int.convert_checked.loc19: init %i32 = call %Convert.specific_fn.loc19(%int_2) [template = constants.%int_2.2] // CHECK:STDOUT: %.loc19_8: init %i32 = converted %int_2, %int.convert_checked.loc19 [template = constants.%int_2.2] // CHECK:STDOUT: assign %.loc19_5, %.loc19_8 -// CHECK:STDOUT: %Class.ref.loc20: type = name_ref Class, file.%Class.decl [template = constants.%Class] // CHECK:STDOUT: %cv.ref.loc20: ref %Class = name_ref cv, %cv // CHECK:STDOUT: %.loc20: %Class = bind_value %cv.ref.loc20 // CHECK:STDOUT: %c: %Class = bind_name c, %.loc20 -// CHECK:STDOUT: %int_32.loc21: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc21: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %cj.var: ref %i32 = var cj // CHECK:STDOUT: %cj: ref %i32 = bind_name cj, %cj.var // CHECK:STDOUT: %c.ref.loc21: %Class = name_ref c, %c @@ -121,8 +113,6 @@ fn Test() { // CHECK:STDOUT: %.loc21_18.1: ref %i32 = class_element_access %c.ref.loc21, element0 // CHECK:STDOUT: %.loc21_18.2: %i32 = bind_value %.loc21_18.1 // CHECK:STDOUT: assign %cj.var, %.loc21_18.2 -// CHECK:STDOUT: %int_32.loc22: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %ck.var: ref %i32 = var ck // CHECK:STDOUT: %ck: ref %i32 = bind_name ck, %ck.var // CHECK:STDOUT: %c.ref.loc22: %Class = name_ref c, %c diff --git a/toolchain/check/testdata/class/forward_declared.carbon b/toolchain/check/testdata/class/forward_declared.carbon index 3a48a2227a03f..2e732fd03fbc8 100644 --- a/toolchain/check/testdata/class/forward_declared.carbon +++ b/toolchain/check/testdata/class/forward_declared.carbon @@ -42,11 +42,13 @@ fn F(p: Class*) -> Class* { return p; } // CHECK:STDOUT: %return.patt: %ptr = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %ptr = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Class.ref.loc13_9: type = name_ref Class, file.%Class.decl [template = constants.%Class] -// CHECK:STDOUT: %ptr.loc13_14: type = ptr_type %Class [template = constants.%ptr] // CHECK:STDOUT: %Class.ref.loc13_20: type = name_ref Class, file.%Class.decl [template = constants.%Class] // CHECK:STDOUT: %ptr.loc13_25: type = ptr_type %Class [template = constants.%ptr] // CHECK:STDOUT: %p.param: %ptr = value_param runtime_param0 +// CHECK:STDOUT: %.loc13: type = splice_block %ptr.loc13_14 [template = constants.%ptr] { +// CHECK:STDOUT: %Class.ref.loc13_9: type = name_ref Class, file.%Class.decl [template = constants.%Class] +// CHECK:STDOUT: %ptr.loc13_14: type = ptr_type %Class [template = constants.%ptr] +// CHECK:STDOUT: } // CHECK:STDOUT: %p: %ptr = bind_name p, %p.param // CHECK:STDOUT: %return.param: ref %ptr = out_param runtime_param1 // CHECK:STDOUT: %return: ref %ptr = return_slot %return.param diff --git a/toolchain/check/testdata/class/generic/adapt.carbon b/toolchain/check/testdata/class/generic/adapt.carbon index fbd77d1ae7675..e934762500d84 100644 --- a/toolchain/check/testdata/class/generic/adapt.carbon +++ b/toolchain/check/testdata/class/generic/adapt.carbon @@ -175,10 +175,10 @@ fn ImportedConvertLocal(a: Adapter(C)) -> i32 { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Adapter.ref: type = name_ref Adapter, file.%Adapter.decl [template = constants.%Adapter] // CHECK:STDOUT: %int_32.loc12: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc12: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %Adapter = value_param runtime_param0 +// CHECK:STDOUT: %Adapter.ref: type = name_ref Adapter, file.%Adapter.decl [template = constants.%Adapter] // CHECK:STDOUT: %a: %Adapter = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -197,7 +197,6 @@ fn ImportedConvertLocal(a: Adapter(C)) -> i32 { // CHECK:STDOUT: %complete_type.loc6_1.2: = complete_type_witness @C.%struct_type.x (%struct_type.x.1) [symbolic = %complete_type.loc6_1.2 (constants.%complete_type.1)] // CHECK:STDOUT: // CHECK:STDOUT: class { -// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc4_9.1 [symbolic = %T.loc4_9.2 (constants.%T)] // CHECK:STDOUT: %.loc5: @C.%C.elem (%C.elem.1) = field_decl x, element0 [template] // CHECK:STDOUT: %complete_type.loc6_1.1: = complete_type_witness %struct_type.x.1 [symbolic = %complete_type.loc6_1.2 (constants.%complete_type.1)] // CHECK:STDOUT: @@ -312,10 +311,10 @@ fn ImportedConvertLocal(a: Adapter(C)) -> i32 { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Adapter.ref: type = name_ref Adapter, imports.%import_ref.2 [template = constants.%Adapter] // CHECK:STDOUT: %int_32.loc6: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc6: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %Adapter = value_param runtime_param0 +// CHECK:STDOUT: %Adapter.ref: type = name_ref Adapter, imports.%import_ref.2 [template = constants.%Adapter] // CHECK:STDOUT: %a: %Adapter = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -437,10 +436,10 @@ fn ImportedConvertLocal(a: Adapter(C)) -> i32 { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Adapter.ref: type = name_ref Adapter, file.%Adapter.decl [template = constants.%Adapter] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %Adapter = value_param runtime_param0 +// CHECK:STDOUT: %Adapter.ref: type = name_ref Adapter, file.%Adapter.decl [template = constants.%Adapter] // CHECK:STDOUT: %a: %Adapter = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -459,7 +458,6 @@ fn ImportedConvertLocal(a: Adapter(C)) -> i32 { // CHECK:STDOUT: %complete_type.loc6_1.2: = complete_type_witness @C.%struct_type.x (%struct_type.x.1) [symbolic = %complete_type.loc6_1.2 (constants.%complete_type.1)] // CHECK:STDOUT: // CHECK:STDOUT: class { -// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc4_9.1 [symbolic = %T.loc4_9.2 (constants.%T)] // CHECK:STDOUT: %.loc5: @C.%C.elem (%C.elem.1) = field_decl x, element0 [template] // CHECK:STDOUT: %complete_type.loc6_1.1: = complete_type_witness %struct_type.x.1 [symbolic = %complete_type.loc6_1.2 (constants.%complete_type.1)] // CHECK:STDOUT: @@ -572,7 +570,6 @@ fn ImportedConvertLocal(a: Adapter(C)) -> i32 { // CHECK:STDOUT: %complete_type.loc9_1.2: = complete_type_witness @C.%struct_type.x (%struct_type.x.1) [symbolic = %complete_type.loc9_1.2 (constants.%complete_type.1)] // CHECK:STDOUT: // CHECK:STDOUT: class { -// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc7_9.1 [symbolic = %T.loc7_9.2 (constants.%T)] // CHECK:STDOUT: %.loc8: @C.%C.elem (%C.elem.1) = field_decl x, element0 [template] // CHECK:STDOUT: %complete_type.loc9_1.1: = complete_type_witness %struct_type.x.1 [symbolic = %complete_type.loc9_1.2 (constants.%complete_type.1)] // CHECK:STDOUT: @@ -671,10 +668,10 @@ fn ImportedConvertLocal(a: Adapter(C)) -> i32 { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Adapter.ref: type = name_ref Adapter, imports.%import_ref.2 [template = constants.%Adapter] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %Adapter = value_param runtime_param0 +// CHECK:STDOUT: %Adapter.ref: type = name_ref Adapter, imports.%import_ref.2 [template = constants.%Adapter] // CHECK:STDOUT: %a: %Adapter = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -783,13 +780,15 @@ fn ImportedConvertLocal(a: Adapter(C)) -> i32 { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Adapter.ref: %Adapter.type = name_ref Adapter, file.%Adapter.decl [template = constants.%Adapter.generic] -// CHECK:STDOUT: %int_32.loc8_23: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc8_23: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %Adapter: type = class_type @Adapter, @Adapter(constants.%i32) [template = constants.%Adapter.2] // CHECK:STDOUT: %int_32.loc8_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc8_32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %Adapter.2 = value_param runtime_param0 +// CHECK:STDOUT: %.loc8: type = splice_block %Adapter [template = constants.%Adapter.2] { +// CHECK:STDOUT: %Adapter.ref: %Adapter.type = name_ref Adapter, file.%Adapter.decl [template = constants.%Adapter.generic] +// CHECK:STDOUT: %int_32.loc8_23: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc8_23: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %Adapter: type = class_type @Adapter, @Adapter(constants.%i32) [template = constants.%Adapter.2] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %Adapter.2 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -895,13 +894,15 @@ fn ImportedConvertLocal(a: Adapter(C)) -> i32 { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Adapter.ref: %Adapter.type = name_ref Adapter, imports.%import_ref.1 [template = constants.%Adapter.generic] -// CHECK:STDOUT: %int_32.loc6_31: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc6_31: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %Adapter: type = class_type @Adapter, @Adapter(constants.%i32) [template = constants.%Adapter.2] // CHECK:STDOUT: %int_32.loc6_40: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc6_40: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %Adapter.2 = value_param runtime_param0 +// CHECK:STDOUT: %.loc6: type = splice_block %Adapter [template = constants.%Adapter.2] { +// CHECK:STDOUT: %Adapter.ref: %Adapter.type = name_ref Adapter, imports.%import_ref.1 [template = constants.%Adapter.generic] +// CHECK:STDOUT: %int_32.loc6_31: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc6_31: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %Adapter: type = class_type @Adapter, @Adapter(constants.%i32) [template = constants.%Adapter.2] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %Adapter.2 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -913,12 +914,14 @@ fn ImportedConvertLocal(a: Adapter(C)) -> i32 { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Adapter.ref: %Adapter.type = name_ref Adapter, imports.%import_ref.1 [template = constants.%Adapter.generic] -// CHECK:STDOUT: %C.ref.loc14: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %Adapter: type = class_type @Adapter, @Adapter(constants.%C) [template = constants.%Adapter.3] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %Adapter.3 = value_param runtime_param0 +// CHECK:STDOUT: %.loc14: type = splice_block %Adapter [template = constants.%Adapter.3] { +// CHECK:STDOUT: %Adapter.ref: %Adapter.type = name_ref Adapter, imports.%import_ref.1 [template = constants.%Adapter.generic] +// CHECK:STDOUT: %C.ref.loc14: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %Adapter: type = class_type @Adapter, @Adapter(constants.%C) [template = constants.%Adapter.3] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %Adapter.3 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -941,8 +944,6 @@ fn ImportedConvertLocal(a: Adapter(C)) -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc11: %C.elem = field_decl n, element0 [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.n [template = constants.%complete_type.5] // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/generic/base_is_generic.carbon b/toolchain/check/testdata/class/generic/base_is_generic.carbon index e73a3bf47288d..e20aa461dc8b0 100644 --- a/toolchain/check/testdata/class/generic/base_is_generic.carbon +++ b/toolchain/check/testdata/class/generic/base_is_generic.carbon @@ -146,10 +146,10 @@ fn H() { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Derived.ref: type = name_ref Derived, file.%Derived.decl [template = constants.%Derived] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %d.param: %Derived = value_param runtime_param0 +// CHECK:STDOUT: %Derived.ref: type = name_ref Derived, file.%Derived.decl [template = constants.%Derived] // CHECK:STDOUT: %d: %Derived = bind_name d, %d.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -168,7 +168,6 @@ fn H() { // CHECK:STDOUT: %complete_type.loc6_1.2: = complete_type_witness @Base.%struct_type.x (%struct_type.x.1) [symbolic = %complete_type.loc6_1.2 (constants.%complete_type.1)] // CHECK:STDOUT: // CHECK:STDOUT: class { -// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc4_17.1 [symbolic = %T.loc4_17.2 (constants.%T)] // CHECK:STDOUT: %.loc5: @Base.%Base.elem (%Base.elem.1) = field_decl x, element0 [template] // CHECK:STDOUT: %complete_type.loc6_1.1: = complete_type_witness %struct_type.x.1 [symbolic = %complete_type.loc6_1.2 (constants.%complete_type.1)] // CHECK:STDOUT: @@ -180,8 +179,6 @@ fn H() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Param { -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc9: %Param.elem = field_decl y, element0 [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.y [template = constants.%complete_type.4] // CHECK:STDOUT: @@ -303,10 +300,10 @@ fn H() { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Derived.ref: type = name_ref Derived, imports.%import_ref.3 [template = constants.%Derived] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %d.param: %Derived = value_param runtime_param0 +// CHECK:STDOUT: %Derived.ref: type = name_ref Derived, imports.%import_ref.3 [template = constants.%Derived] // CHECK:STDOUT: %d: %Derived = bind_name d, %d.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -632,11 +629,9 @@ fn H() { // CHECK:STDOUT: // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int_32.loc13_10: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc13_10: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [template = constants.%C.generic] -// CHECK:STDOUT: %int_32.loc13_18: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc13_18: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %C: type = class_type @C, @C(constants.%i32) [template = constants.%C.2] // CHECK:STDOUT: %.loc13_22: %G.type.3 = specific_constant @X.%G.decl, @X(constants.%i32) [template = constants.%G.3] // CHECK:STDOUT: %G.ref: %G.type.3 = name_ref G, %.loc13_22 [template = constants.%G.3] @@ -832,11 +827,9 @@ fn H() { // CHECK:STDOUT: // CHECK:STDOUT: fn @H() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int_32.loc7_10: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc7_10: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %C.ref: %C.type = name_ref C, imports.%import_ref.2 [template = constants.%C.generic] -// CHECK:STDOUT: %int_32.loc7_18: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc7_18: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %C: type = class_type @C, @C(constants.%i32) [template = constants.%C.2] // CHECK:STDOUT: %.loc7_22: %G.type.3 = specific_constant imports.%import_ref.10, @X(constants.%i32) [template = constants.%G.3] // CHECK:STDOUT: %G.ref: %G.type.3 = name_ref G, %.loc7_22 [template = constants.%G.3] diff --git a/toolchain/check/testdata/class/generic/basic.carbon b/toolchain/check/testdata/class/generic/basic.carbon index 8f57ad7b575e6..40e22c404fa9a 100644 --- a/toolchain/check/testdata/class/generic/basic.carbon +++ b/toolchain/check/testdata/class/generic/basic.carbon @@ -101,12 +101,14 @@ class Declaration(T:! type); // CHECK:STDOUT: %return.patt: @GetAddr.%ptr.loc12_38.1 (%ptr.2) = return_slot_pattern // CHECK:STDOUT: %return.param_patt: @GetAddr.%ptr.loc12_38.1 (%ptr.2) = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc12_25: type = specific_constant constants.%Class, @Class(constants.%T) [symbolic = %Class (constants.%Class)] -// CHECK:STDOUT: %Self.ref: type = name_ref Self, %.loc12_25 [symbolic = %Class (constants.%Class)] -// CHECK:STDOUT: %ptr.loc12_29.2: type = ptr_type %Class [symbolic = %ptr.loc12_29.1 (constants.%ptr.1)] // CHECK:STDOUT: %T.ref: type = name_ref T, @Class.%T.loc11_13.1 [symbolic = %T (constants.%T)] // CHECK:STDOUT: %ptr.loc12_38.2: type = ptr_type %T [symbolic = %ptr.loc12_38.1 (constants.%ptr.2)] // CHECK:STDOUT: %self.param: @GetAddr.%ptr.loc12_29.1 (%ptr.1) = value_param runtime_param0 +// CHECK:STDOUT: %.loc12_29: type = splice_block %ptr.loc12_29.2 [symbolic = %ptr.loc12_29.1 (constants.%ptr.1)] { +// CHECK:STDOUT: %.loc12_25: type = specific_constant constants.%Class, @Class(constants.%T) [symbolic = %Class (constants.%Class)] +// CHECK:STDOUT: %Self.ref: type = name_ref Self, %.loc12_25 [symbolic = %Class (constants.%Class)] +// CHECK:STDOUT: %ptr.loc12_29.2: type = ptr_type %Class [symbolic = %ptr.loc12_29.1 (constants.%ptr.1)] +// CHECK:STDOUT: } // CHECK:STDOUT: %self: @GetAddr.%ptr.loc12_29.1 (%ptr.1) = bind_name self, %self.param // CHECK:STDOUT: %return.param: ref @GetAddr.%ptr.loc12_38.1 (%ptr.2) = out_param runtime_param1 // CHECK:STDOUT: %return: ref @GetAddr.%ptr.loc12_38.1 (%ptr.2) = return_slot %return.param @@ -117,15 +119,16 @@ class Declaration(T:! type); // CHECK:STDOUT: %return.patt: @GetValue.%T (%T) = return_slot_pattern // CHECK:STDOUT: %return.param_patt: @GetValue.%T (%T) = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc17: type = specific_constant constants.%Class, @Class(constants.%T) [symbolic = %Class (constants.%Class)] -// CHECK:STDOUT: %Self.ref: type = name_ref Self, %.loc17 [symbolic = %Class (constants.%Class)] // CHECK:STDOUT: %T.ref: type = name_ref T, @Class.%T.loc11_13.1 [symbolic = %T (constants.%T)] // CHECK:STDOUT: %self.param: @GetValue.%Class (%Class) = value_param runtime_param0 +// CHECK:STDOUT: %.loc17_21.2: type = splice_block %Self.ref [symbolic = %Class (constants.%Class)] { +// CHECK:STDOUT: %.loc17_21.1: type = specific_constant constants.%Class, @Class(constants.%T) [symbolic = %Class (constants.%Class)] +// CHECK:STDOUT: %Self.ref: type = name_ref Self, %.loc17_21.1 [symbolic = %Class (constants.%Class)] +// CHECK:STDOUT: } // CHECK:STDOUT: %self: @GetValue.%Class (%Class) = bind_name self, %self.param // CHECK:STDOUT: %return.param: ref @GetValue.%T (%T) = out_param runtime_param1 // CHECK:STDOUT: %return: ref @GetValue.%T (%T) = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc11_13.1 [symbolic = %T.loc11_13.2 (constants.%T)] // CHECK:STDOUT: %.loc21: @Class.%Class.elem (%Class.elem) = field_decl k, element0 [template] // CHECK:STDOUT: %complete_type.loc22_1.1: = complete_type_witness %struct_type.k [symbolic = %complete_type.loc22_1.2 (constants.%complete_type)] // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/generic/call.carbon b/toolchain/check/testdata/class/generic/call.carbon index 377985bd09b08..ed8b1c7bba3f9 100644 --- a/toolchain/check/testdata/class/generic/call.carbon +++ b/toolchain/check/testdata/class/generic/call.carbon @@ -101,18 +101,8 @@ class Outer(T:! type) { // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] // CHECK:STDOUT: %complete_type.2: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %ptr.1: type = ptr_type %i32 [template] -// CHECK:STDOUT: %int_5.1: Core.IntLiteral = int_value 5 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_5.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_5.2: %i32 = int_value 5 [template] // CHECK:STDOUT: %Class.2: type = class_type @Class, @Class(%ptr.1, %int_5.2) [template] -// CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_0.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] // CHECK:STDOUT: %Class.3: type = class_type @Class, @Class(%empty_tuple.type, %int_0.2) [template] // CHECK:STDOUT: } @@ -140,38 +130,17 @@ class Outer(T:! type) { // CHECK:STDOUT: %N.patt.loc4_23.1: %i32 = symbolic_binding_pattern N, 1 [symbolic = %N.patt.loc4_23.2 (constants.%N.patt.2)] // CHECK:STDOUT: %N.param_patt: %i32 = value_param_pattern %N.patt.loc4_23.1, runtime_param [symbolic = %N.patt.loc4_23.2 (constants.%N.patt.2)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %T.param: type = value_param runtime_param // CHECK:STDOUT: %T.loc4_13.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc4_13.2 (constants.%T)] // CHECK:STDOUT: %N.param: %i32 = value_param runtime_param +// CHECK:STDOUT: %.loc4: type = splice_block %i32 [template = constants.%i32] { +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %N.loc4_23.1: %i32 = bind_symbolic_name N, 1, %N.param [symbolic = %N.loc4_23.2 (constants.%N.2)] // CHECK:STDOUT: } -// CHECK:STDOUT: %Class.ref.loc6: %Class.type = name_ref Class, %Class.decl [template = constants.%Class.generic] -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %ptr: type = ptr_type %i32 [template = constants.%ptr.1] -// CHECK:STDOUT: %int_5: Core.IntLiteral = int_value 5 [template = constants.%int_5.1] -// CHECK:STDOUT: %impl.elem0.loc6: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc6: = bound_method %int_5, %impl.elem0.loc6 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc6: = specific_function %Convert.bound.loc6, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc6: init %i32 = call %Convert.specific_fn.loc6(%int_5) [template = constants.%int_5.2] -// CHECK:STDOUT: %.loc6_21.1: %i32 = value_of_initializer %int.convert_checked.loc6 [template = constants.%int_5.2] -// CHECK:STDOUT: %.loc6_21.2: %i32 = converted %int_5, %.loc6_21.1 [template = constants.%int_5.2] -// CHECK:STDOUT: %Class.loc6: type = class_type @Class, @Class(constants.%ptr.1, constants.%int_5.2) [template = constants.%Class.2] // CHECK:STDOUT: %a.var: ref %Class.2 = var a // CHECK:STDOUT: %a: ref %Class.2 = bind_name a, %a.var -// CHECK:STDOUT: %Class.ref.loc9: %Class.type = name_ref Class, %Class.decl [template = constants.%Class.generic] -// CHECK:STDOUT: %.loc9_15: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %.loc9_19.1: type = converted %.loc9_15, constants.%empty_tuple.type [template = constants.%empty_tuple.type] -// CHECK:STDOUT: %impl.elem0.loc9: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc9: = bound_method %int_0, %impl.elem0.loc9 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc9: = specific_function %Convert.bound.loc9, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] -// CHECK:STDOUT: %int.convert_checked.loc9: init %i32 = call %Convert.specific_fn.loc9(%int_0) [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc9_19.2: %i32 = value_of_initializer %int.convert_checked.loc9 [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc9_19.3: %i32 = converted %int_0, %.loc9_19.2 [template = constants.%int_0.2] -// CHECK:STDOUT: %Class.loc9: type = class_type @Class, @Class(constants.%empty_tuple.type, constants.%int_0.2) [template = constants.%Class.3] // CHECK:STDOUT: %b.var: ref %Class.3 = var b // CHECK:STDOUT: %b: ref %Class.3 = bind_name b, %b.var // CHECK:STDOUT: } @@ -232,7 +201,6 @@ class Outer(T:! type) { // CHECK:STDOUT: %Class: type = class_type @Class, @Class(%T, %N.2) [symbolic] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] // CHECK:STDOUT: %complete_type.2: = complete_type_witness %empty_struct_type [template] -// CHECK:STDOUT: %ptr: type = ptr_type %i32 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -256,17 +224,15 @@ class Outer(T:! type) { // CHECK:STDOUT: %N.patt.loc4_23.1: %i32 = symbolic_binding_pattern N, 1 [symbolic = %N.patt.loc4_23.2 (constants.%N.patt.2)] // CHECK:STDOUT: %N.param_patt: %i32 = value_param_pattern %N.patt.loc4_23.1, runtime_param [symbolic = %N.patt.loc4_23.2 (constants.%N.patt.2)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %T.param: type = value_param runtime_param // CHECK:STDOUT: %T.loc4_13.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc4_13.2 (constants.%T)] // CHECK:STDOUT: %N.param: %i32 = value_param runtime_param +// CHECK:STDOUT: %.loc4: type = splice_block %i32 [template = constants.%i32] { +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %N.loc4_23.1: %i32 = bind_symbolic_name N, 1, %N.param [symbolic = %N.loc4_23.2 (constants.%N.2)] // CHECK:STDOUT: } -// CHECK:STDOUT: %Class.ref: %Class.type = name_ref Class, %Class.decl [template = constants.%Class.generic] -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %ptr: type = ptr_type %i32 [template = constants.%ptr] // CHECK:STDOUT: %a.var: ref = var a // CHECK:STDOUT: %a: ref = bind_name a, %a.var // CHECK:STDOUT: } @@ -309,9 +275,6 @@ class Outer(T:! type) { // CHECK:STDOUT: %Class: type = class_type @Class, @Class(%T, %N.2) [symbolic] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] // CHECK:STDOUT: %complete_type.2: = complete_type_witness %empty_struct_type [template] -// CHECK:STDOUT: %ptr: type = ptr_type %i32 [template] -// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -335,19 +298,15 @@ class Outer(T:! type) { // CHECK:STDOUT: %N.patt.loc4_23.1: %i32 = symbolic_binding_pattern N, 1 [symbolic = %N.patt.loc4_23.2 (constants.%N.patt.2)] // CHECK:STDOUT: %N.param_patt: %i32 = value_param_pattern %N.patt.loc4_23.1, runtime_param [symbolic = %N.patt.loc4_23.2 (constants.%N.patt.2)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %T.param: type = value_param runtime_param // CHECK:STDOUT: %T.loc4_13.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc4_13.2 (constants.%T)] // CHECK:STDOUT: %N.param: %i32 = value_param runtime_param +// CHECK:STDOUT: %.loc4: type = splice_block %i32 [template = constants.%i32] { +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %N.loc4_23.1: %i32 = bind_symbolic_name N, 1, %N.param [symbolic = %N.loc4_23.2 (constants.%N.2)] // CHECK:STDOUT: } -// CHECK:STDOUT: %Class.ref: %Class.type = name_ref Class, %Class.decl [template = constants.%Class.generic] -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %ptr: type = ptr_type %i32 [template = constants.%ptr] -// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1] -// CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2] // CHECK:STDOUT: %a.var: ref = var a // CHECK:STDOUT: %a: ref = bind_name a, %a.var // CHECK:STDOUT: } @@ -390,8 +349,6 @@ class Outer(T:! type) { // CHECK:STDOUT: %Class: type = class_type @Class, @Class(%T, %N.2) [symbolic] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] // CHECK:STDOUT: %complete_type.2: = complete_type_witness %empty_struct_type [template] -// CHECK:STDOUT: %int_5: Core.IntLiteral = int_value 5 [template] -// CHECK:STDOUT: %ptr: type = ptr_type %i32 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -416,19 +373,15 @@ class Outer(T:! type) { // CHECK:STDOUT: %N.patt.loc4_23.1: %i32 = symbolic_binding_pattern N, 1 [symbolic = %N.patt.loc4_23.2 (constants.%N.patt.2)] // CHECK:STDOUT: %N.param_patt: %i32 = value_param_pattern %N.patt.loc4_23.1, runtime_param [symbolic = %N.patt.loc4_23.2 (constants.%N.patt.2)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %T.param: type = value_param runtime_param // CHECK:STDOUT: %T.loc4_13.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc4_13.2 (constants.%T)] // CHECK:STDOUT: %N.param: %i32 = value_param runtime_param +// CHECK:STDOUT: %.loc4: type = splice_block %i32 [template = constants.%i32] { +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %N.loc4_23.1: %i32 = bind_symbolic_name N, 1, %N.param [symbolic = %N.loc4_23.2 (constants.%N.2)] // CHECK:STDOUT: } -// CHECK:STDOUT: %Class.ref: %Class.type = name_ref Class, %Class.decl [template = constants.%Class.generic] -// CHECK:STDOUT: %int_5: Core.IntLiteral = int_value 5 [template = constants.%int_5] -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %ptr: type = ptr_type %i32 [template = constants.%ptr] -// CHECK:STDOUT: %.loc15: type = converted %int_5, [template = ] // CHECK:STDOUT: %a.var: ref = var a // CHECK:STDOUT: %a: ref = bind_name a, %a.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/generic/complete_in_conversion.carbon b/toolchain/check/testdata/class/generic/complete_in_conversion.carbon index 25f7c6f0cf00e..8f8f7759eb2f8 100644 --- a/toolchain/check/testdata/class/generic/complete_in_conversion.carbon +++ b/toolchain/check/testdata/class/generic/complete_in_conversion.carbon @@ -48,10 +48,8 @@ fn F(a: A(0)*) { // CHECK:STDOUT: %A.generic: %A.type = struct_value () [template] // CHECK:STDOUT: %A.1: type = class_type @A, @A(%N.2) [symbolic] // CHECK:STDOUT: %A.elem.1: type = unbound_element_type %A.1, %B [symbolic] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] // CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.3, @impl.2(%int_32) [template] // CHECK:STDOUT: %Convert.9: %Convert.type.9 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.9) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %N.2, %Convert.9 [symbolic] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.3(%int_32) [symbolic] // CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %Convert.specific_fn.1(%N.2) [symbolic] @@ -104,12 +102,14 @@ fn F(a: A(0)*) { // CHECK:STDOUT: %return.patt: type = return_slot_pattern // CHECK:STDOUT: %return.param_patt: type = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] -// CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, imports.%import_ref.1 [template = constants.%IntLiteral] -// CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral] -// CHECK:STDOUT: %.loc2_27.1: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral] -// CHECK:STDOUT: %.loc2_27.2: type = converted %int_literal.make_type, %.loc2_27.1 [template = Core.IntLiteral] // CHECK:STDOUT: %N.param: Core.IntLiteral = value_param runtime_param0 +// CHECK:STDOUT: %.loc2_27.3: type = splice_block %.loc2_27.2 [template = Core.IntLiteral] { +// CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] +// CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, imports.%import_ref.1 [template = constants.%IntLiteral] +// CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral] +// CHECK:STDOUT: %.loc2_27.1: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral] +// CHECK:STDOUT: %.loc2_27.2: type = converted %int_literal.make_type, %.loc2_27.1 [template = Core.IntLiteral] +// CHECK:STDOUT: } // CHECK:STDOUT: %N: Core.IntLiteral = bind_name N, %N.param // CHECK:STDOUT: %return.param: ref type = out_param runtime_param1 // CHECK:STDOUT: %return: ref type = return_slot %return.param @@ -119,26 +119,30 @@ fn F(a: A(0)*) { // CHECK:STDOUT: %N.patt.loc6_9.1: %i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc6_9.2 (constants.%N.patt.2)] // CHECK:STDOUT: %N.param_patt: %i32 = value_param_pattern %N.patt.loc6_9.1, runtime_param [symbolic = %N.patt.loc6_9.2 (constants.%N.patt.2)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int.2, @Int.2(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %N.param: %i32 = value_param runtime_param +// CHECK:STDOUT: %.loc6: type = splice_block %i32 [template = constants.%i32] { +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32: type = class_type @Int.2, @Int.2(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %N.loc6_9.1: %i32 = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc6_9.2 (constants.%N.2)] // CHECK:STDOUT: } // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %a.patt: %ptr.2 = binding_pattern a // CHECK:STDOUT: %a.param_patt: %ptr.2 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %A.ref: %A.type = name_ref A, file.%A.decl [template = constants.%A.generic] -// CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.10 = interface_witness_access constants.%interface.6, element0 [template = constants.%Convert.11] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc15_12.1: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc15_12.2: %i32 = converted %int_0, %.loc15_12.1 [template = constants.%int_0.2] -// CHECK:STDOUT: %A: type = class_type @A, @A(constants.%int_0.2) [template = constants.%A.2] -// CHECK:STDOUT: %ptr.loc15: type = ptr_type %A.2 [template = constants.%ptr.2] // CHECK:STDOUT: %a.param: %ptr.2 = value_param runtime_param0 +// CHECK:STDOUT: %.loc15_13: type = splice_block %ptr [template = constants.%ptr.2] { +// CHECK:STDOUT: %A.ref: %A.type = name_ref A, file.%A.decl [template = constants.%A.generic] +// CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] +// CHECK:STDOUT: %impl.elem0: %Convert.type.10 = interface_witness_access constants.%interface.6, element0 [template = constants.%Convert.11] +// CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound.2] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.2] +// CHECK:STDOUT: %.loc15_12.1: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_0.2] +// CHECK:STDOUT: %.loc15_12.2: %i32 = converted %int_0, %.loc15_12.1 [template = constants.%int_0.2] +// CHECK:STDOUT: %A: type = class_type @A, @A(constants.%int_0.2) [template = constants.%A.2] +// CHECK:STDOUT: %ptr: type = ptr_type %A.2 [template = constants.%ptr.2] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %ptr.2 = bind_name a, %a.param // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -158,10 +162,10 @@ fn F(a: A(0)*) { // CHECK:STDOUT: !definition: // CHECK:STDOUT: %A: type = class_type @A, @A(%N.loc6_9.2) [symbolic = %A (constants.%A.1)] // CHECK:STDOUT: %A.elem.loc7: type = unbound_element_type @A.%A (%A.1), %B [symbolic = %A.elem.loc7 (constants.%A.elem.1)] -// CHECK:STDOUT: %Convert.bound.loc12_14.2: = bound_method %N.loc6_9.2, constants.%Convert.9 [symbolic = %Convert.bound.loc12_14.2 (constants.%Convert.bound.1)] -// CHECK:STDOUT: %Convert.specific_fn.loc12_14.2: = specific_function %Convert.bound.loc12_14.2, @Convert.3(constants.%int_32) [symbolic = %Convert.specific_fn.loc12_14.2 (constants.%Convert.specific_fn.1)] -// CHECK:STDOUT: %int.convert_checked.loc12_14.2: init Core.IntLiteral = call %Convert.specific_fn.loc12_14.2(%N.loc6_9.2) [symbolic = %int.convert_checked.loc12_14.2 (constants.%int.convert_checked)] -// CHECK:STDOUT: %iN.builtin: type = int_type signed, %int.convert_checked.loc12_14.2 [symbolic = %iN.builtin (constants.%iN.builtin.2)] +// CHECK:STDOUT: %Convert.bound: = bound_method %N.loc6_9.2, constants.%Convert.9 [symbolic = %Convert.bound (constants.%Convert.bound.1)] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.3(constants.%int_32) [symbolic = %Convert.specific_fn (constants.%Convert.specific_fn.1)] +// CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %Convert.specific_fn(%N.loc6_9.2) [symbolic = %int.convert_checked (constants.%int.convert_checked)] +// CHECK:STDOUT: %iN.builtin: type = int_type signed, %int.convert_checked [symbolic = %iN.builtin (constants.%iN.builtin.2)] // CHECK:STDOUT: %require_complete: = require_complete_type @A.%iN.builtin (%iN.builtin.2) [symbolic = %require_complete (constants.%require_complete.5)] // CHECK:STDOUT: %A.elem.loc12: type = unbound_element_type @A.%A (%A.1), @A.%iN.builtin (%iN.builtin.2) [symbolic = %A.elem.loc12 (constants.%A.elem.2)] // CHECK:STDOUT: %struct_type.base.n: type = struct_type {.base: %B, .n: @A.%iN.builtin (%iN.builtin.2)} [symbolic = %struct_type.base.n (constants.%struct_type.base.n)] @@ -170,24 +174,13 @@ fn F(a: A(0)*) { // CHECK:STDOUT: class { // CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [template = constants.%B] // CHECK:STDOUT: %.loc7: @A.%A.elem.loc7 (%A.elem.1) = base_decl %B.ref, element0 [template] -// CHECK:STDOUT: %Int.ref: %Int.type.1 = name_ref Int, file.%Int.decl [template = constants.%Int.1] -// CHECK:STDOUT: %N.ref: %i32 = name_ref N, %N.loc6_9.1 [symbolic = %N.loc6_9.2 (constants.%N.2)] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.9] -// CHECK:STDOUT: %Convert.bound.loc12_14.1: = bound_method %N.ref, %impl.elem0 [symbolic = %Convert.bound.loc12_14.2 (constants.%Convert.bound.1)] -// CHECK:STDOUT: %Convert.specific_fn.loc12_14.1: = specific_function %Convert.bound.loc12_14.1, @Convert.3(constants.%int_32) [symbolic = %Convert.specific_fn.loc12_14.2 (constants.%Convert.specific_fn.1)] -// CHECK:STDOUT: %int.convert_checked.loc12_14.1: init Core.IntLiteral = call %Convert.specific_fn.loc12_14.1(%N.ref) [symbolic = %int.convert_checked.loc12_14.2 (constants.%int.convert_checked)] -// CHECK:STDOUT: %.loc12_14.1: Core.IntLiteral = value_of_initializer %int.convert_checked.loc12_14.1 [symbolic = %int.convert_checked.loc12_14.2 (constants.%int.convert_checked)] -// CHECK:STDOUT: %.loc12_14.2: Core.IntLiteral = converted %N.ref, %.loc12_14.1 [symbolic = %int.convert_checked.loc12_14.2 (constants.%int.convert_checked)] -// CHECK:STDOUT: %int.make_type_signed: init type = call %Int.ref(%.loc12_14.2) [symbolic = %iN.builtin (constants.%iN.builtin.2)] -// CHECK:STDOUT: %.loc12_15.1: type = value_of_initializer %int.make_type_signed [symbolic = %iN.builtin (constants.%iN.builtin.2)] -// CHECK:STDOUT: %.loc12_15.2: type = converted %int.make_type_signed, %.loc12_15.1 [symbolic = %iN.builtin (constants.%iN.builtin.2)] -// CHECK:STDOUT: %.loc12_8: @A.%A.elem.loc12 (%A.elem.2) = field_decl n, element1 [template] +// CHECK:STDOUT: %.loc12: @A.%A.elem.loc12 (%A.elem.2) = field_decl n, element1 [template] // CHECK:STDOUT: %complete_type.loc13_1.1: = complete_type_witness %struct_type.base.n [symbolic = %complete_type.loc13_1.2 (constants.%complete_type.4)] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%A.1 // CHECK:STDOUT: .base = %.loc7 -// CHECK:STDOUT: .n = %.loc12_8 +// CHECK:STDOUT: .n = %.loc12 // CHECK:STDOUT: extend %B.ref // CHECK:STDOUT: complete_type_witness = %complete_type.loc13_1.1 // CHECK:STDOUT: } @@ -197,8 +190,6 @@ fn F(a: A(0)*) { // CHECK:STDOUT: // CHECK:STDOUT: fn @F(%a.param_patt: %ptr.2) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [template = constants.%B] -// CHECK:STDOUT: %ptr.loc19: type = ptr_type %B [template = constants.%ptr.3] // CHECK:STDOUT: %a.ref: %ptr.2 = name_ref a, %a // CHECK:STDOUT: %.loc19_16.1: ref %A.2 = deref %a.ref // CHECK:STDOUT: %.loc19_16.2: ref %B = class_element_access %.loc19_16.1, element0 @@ -222,9 +213,9 @@ fn F(a: A(0)*) { // CHECK:STDOUT: !definition: // CHECK:STDOUT: %A => constants.%A.2 // CHECK:STDOUT: %A.elem.loc7 => constants.%A.elem.3 -// CHECK:STDOUT: %Convert.bound.loc12_14.2 => constants.%Convert.bound.3 -// CHECK:STDOUT: %Convert.specific_fn.loc12_14.2 => constants.%Convert.specific_fn.3 -// CHECK:STDOUT: %int.convert_checked.loc12_14.2 => constants.%int_0.1 +// CHECK:STDOUT: %Convert.bound => constants.%Convert.bound.3 +// CHECK:STDOUT: %Convert.specific_fn => constants.%Convert.specific_fn.3 +// CHECK:STDOUT: %int.convert_checked => constants.%int_0.1 // CHECK:STDOUT: %iN.builtin => // CHECK:STDOUT: %require_complete => // CHECK:STDOUT: %A.elem.loc12 => diff --git a/toolchain/check/testdata/class/generic/field.carbon b/toolchain/check/testdata/class/generic/field.carbon index 8bf84d3bab364..95a9889dc701d 100644 --- a/toolchain/check/testdata/class/generic/field.carbon +++ b/toolchain/check/testdata/class/generic/field.carbon @@ -91,13 +91,15 @@ fn H(U:! type, c: Class(U)) -> U { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Class.ref: %Class.type = name_ref Class, file.%Class.decl [template = constants.%Class.generic] -// CHECK:STDOUT: %int_32.loc15_15: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc15_15: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %Class: type = class_type @Class, @Class(constants.%i32) [template = constants.%Class.2] // CHECK:STDOUT: %int_32.loc15_24: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc15_24: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %c.param: %Class.2 = value_param runtime_param0 +// CHECK:STDOUT: %.loc15: type = splice_block %Class [template = constants.%Class.2] { +// CHECK:STDOUT: %Class.ref: %Class.type = name_ref Class, file.%Class.decl [template = constants.%Class.generic] +// CHECK:STDOUT: %int_32.loc15_15: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc15_15: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %Class: type = class_type @Class, @Class(constants.%i32) [template = constants.%Class.2] +// CHECK:STDOUT: } // CHECK:STDOUT: %c: %Class.2 = bind_name c, %c.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -110,13 +112,15 @@ fn H(U:! type, c: Class(U)) -> U { // CHECK:STDOUT: %return.patt: @G.%T.loc19_6.2 (%T) = return_slot_pattern // CHECK:STDOUT: %return.param_patt: @G.%T.loc19_6.2 (%T) = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Class.ref: %Class.type = name_ref Class, file.%Class.decl [template = constants.%Class.generic] -// CHECK:STDOUT: %T.ref.loc19_25: type = name_ref T, %T.loc19_6.1 [symbolic = %T.loc19_6.2 (constants.%T)] -// CHECK:STDOUT: %Class.loc19_26.1: type = class_type @Class, @Class(constants.%T) [symbolic = %Class.loc19_26.2 (constants.%Class.1)] // CHECK:STDOUT: %T.ref.loc19_32: type = name_ref T, %T.loc19_6.1 [symbolic = %T.loc19_6.2 (constants.%T)] // CHECK:STDOUT: %T.param: type = value_param runtime_param // CHECK:STDOUT: %T.loc19_6.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc19_6.2 (constants.%T)] // CHECK:STDOUT: %c.param: @G.%Class.loc19_26.2 (%Class.1) = value_param runtime_param0 +// CHECK:STDOUT: %.loc19: type = splice_block %Class.loc19_26.1 [symbolic = %Class.loc19_26.2 (constants.%Class.1)] { +// CHECK:STDOUT: %Class.ref: %Class.type = name_ref Class, file.%Class.decl [template = constants.%Class.generic] +// CHECK:STDOUT: %T.ref.loc19_25: type = name_ref T, %T.loc19_6.1 [symbolic = %T.loc19_6.2 (constants.%T)] +// CHECK:STDOUT: %Class.loc19_26.1: type = class_type @Class, @Class(constants.%T) [symbolic = %Class.loc19_26.2 (constants.%Class.1)] +// CHECK:STDOUT: } // CHECK:STDOUT: %c: @G.%Class.loc19_26.2 (%Class.1) = bind_name c, %c.param // CHECK:STDOUT: %return.param: ref @G.%T.loc19_6.2 (%T) = out_param runtime_param1 // CHECK:STDOUT: %return: ref @G.%T.loc19_6.2 (%T) = return_slot %return.param @@ -129,13 +133,15 @@ fn H(U:! type, c: Class(U)) -> U { // CHECK:STDOUT: %return.patt: @H.%U.loc23_6.2 (%U) = return_slot_pattern // CHECK:STDOUT: %return.param_patt: @H.%U.loc23_6.2 (%U) = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Class.ref: %Class.type = name_ref Class, file.%Class.decl [template = constants.%Class.generic] -// CHECK:STDOUT: %U.ref.loc23_25: type = name_ref U, %U.loc23_6.1 [symbolic = %U.loc23_6.2 (constants.%U)] -// CHECK:STDOUT: %Class.loc23_26.1: type = class_type @Class, @Class(constants.%U) [symbolic = %Class.loc23_26.2 (constants.%Class.3)] // CHECK:STDOUT: %U.ref.loc23_32: type = name_ref U, %U.loc23_6.1 [symbolic = %U.loc23_6.2 (constants.%U)] // CHECK:STDOUT: %U.param: type = value_param runtime_param // CHECK:STDOUT: %U.loc23_6.1: type = bind_symbolic_name U, 0, %U.param [symbolic = %U.loc23_6.2 (constants.%U)] // CHECK:STDOUT: %c.param: @H.%Class.loc23_26.2 (%Class.3) = value_param runtime_param0 +// CHECK:STDOUT: %.loc23: type = splice_block %Class.loc23_26.1 [symbolic = %Class.loc23_26.2 (constants.%Class.3)] { +// CHECK:STDOUT: %Class.ref: %Class.type = name_ref Class, file.%Class.decl [template = constants.%Class.generic] +// CHECK:STDOUT: %U.ref.loc23_25: type = name_ref U, %U.loc23_6.1 [symbolic = %U.loc23_6.2 (constants.%U)] +// CHECK:STDOUT: %Class.loc23_26.1: type = class_type @Class, @Class(constants.%U) [symbolic = %Class.loc23_26.2 (constants.%Class.3)] +// CHECK:STDOUT: } // CHECK:STDOUT: %c: @H.%Class.loc23_26.2 (%Class.3) = bind_name c, %c.param // CHECK:STDOUT: %return.param: ref @H.%U.loc23_6.2 (%U) = out_param runtime_param1 // CHECK:STDOUT: %return: ref @H.%U.loc23_6.2 (%U) = return_slot %return.param @@ -154,7 +160,6 @@ fn H(U:! type, c: Class(U)) -> U { // CHECK:STDOUT: %complete_type.loc13_1.2: = complete_type_witness @Class.%struct_type.x (%struct_type.x.1) [symbolic = %complete_type.loc13_1.2 (constants.%complete_type.1)] // CHECK:STDOUT: // CHECK:STDOUT: class { -// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc11_13.1 [symbolic = %T.loc11_13.2 (constants.%T)] // CHECK:STDOUT: %.loc12: @Class.%Class.elem (%Class.elem.1) = field_decl x, element0 [template] // CHECK:STDOUT: %complete_type.loc13_1.1: = complete_type_witness %struct_type.x.1 [symbolic = %complete_type.loc13_1.2 (constants.%complete_type.1)] // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/generic/import.carbon b/toolchain/check/testdata/class/generic/import.carbon index 42a27cb9d555c..9f8180f539d01 100644 --- a/toolchain/check/testdata/class/generic/import.carbon +++ b/toolchain/check/testdata/class/generic/import.carbon @@ -176,8 +176,6 @@ class Class(U:! type) { // CHECK:STDOUT: %F: @CompleteClass.%F.type (%F.type.1) = struct_value () [symbolic = %F (constants.%F.1)] // CHECK:STDOUT: // CHECK:STDOUT: class { -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc7: @CompleteClass.%CompleteClass.elem (%CompleteClass.elem) = field_decl n, element0 [template] // CHECK:STDOUT: %F.decl: @CompleteClass.%F.type (%F.type.1) = fn_decl @F.1 [symbolic = @CompleteClass.%F (constants.%F.1)] { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern @@ -337,7 +335,6 @@ class Class(U:! type) { // CHECK:STDOUT: %complete_type.loc6_1.2: = complete_type_witness @Class.%struct_type.x (%struct_type.x) [symbolic = %complete_type.loc6_1.2 (constants.%complete_type.3)] // CHECK:STDOUT: // CHECK:STDOUT: class { -// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc4 [symbolic = %T.1 (constants.%T)] // CHECK:STDOUT: %.loc5: @Class.%Class.elem (%Class.elem) = field_decl x, element0 [template] // CHECK:STDOUT: %complete_type.loc6_1.1: = complete_type_witness %struct_type.x [symbolic = %complete_type.loc6_1.2 (constants.%complete_type.3)] // CHECK:STDOUT: @@ -480,8 +477,8 @@ class Class(U:! type) { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc5: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc5: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } @@ -489,8 +486,8 @@ class Class(U:! type) { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc10: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc10: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } @@ -517,10 +514,6 @@ class Class(U:! type) { // CHECK:STDOUT: // CHECK:STDOUT: fn @UseMethod() -> %i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %CompleteClass.ref: %CompleteClass.type = name_ref CompleteClass, imports.%import_ref.2 [template = constants.%CompleteClass.generic] -// CHECK:STDOUT: %int_32.loc6: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc6: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %CompleteClass: type = class_type @CompleteClass, @CompleteClass(constants.%i32) [template = constants.%CompleteClass.2] // CHECK:STDOUT: %v.var: ref %CompleteClass.2 = var v // CHECK:STDOUT: %v: ref %CompleteClass.2 = bind_name v, %v.var // CHECK:STDOUT: %F.ref.loc6: %F.type.3 = name_ref F, imports.%import_ref.3 [template = constants.%F.3] @@ -547,10 +540,6 @@ class Class(U:! type) { // CHECK:STDOUT: // CHECK:STDOUT: fn @UseField() -> %i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %CompleteClass.ref: %CompleteClass.type = name_ref CompleteClass, imports.%import_ref.2 [template = constants.%CompleteClass.generic] -// CHECK:STDOUT: %int_32.loc11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %CompleteClass: type = class_type @CompleteClass, @CompleteClass(constants.%i32) [template = constants.%CompleteClass.2] // CHECK:STDOUT: %v.var: ref %CompleteClass.2 = var v // CHECK:STDOUT: %v: ref %CompleteClass.2 = bind_name v, %v.var // CHECK:STDOUT: %F.ref: %F.type.3 = name_ref F, imports.%import_ref.3 [template = constants.%F.3] @@ -674,11 +663,6 @@ class Class(U:! type) { // CHECK:STDOUT: // CHECK:STDOUT: fn @Use() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %CompleteClass.ref: %CompleteClass.type = name_ref CompleteClass, imports.%import_ref.2 [template = constants.%CompleteClass.generic] -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %ptr: type = ptr_type %i32 [template = constants.%ptr.1] -// CHECK:STDOUT: %CompleteClass: type = class_type @CompleteClass, @CompleteClass(constants.%ptr.1) [template = constants.%CompleteClass.2] // CHECK:STDOUT: %v.var: ref %CompleteClass.2 = var v // CHECK:STDOUT: %v: ref %CompleteClass.2 = bind_name v, %v.var // CHECK:STDOUT: %F.ref: %F.type.3 = name_ref F, imports.%import_ref.3 [template = constants.%F.3] @@ -791,7 +775,6 @@ class Class(U:! type) { // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: class { -// CHECK:STDOUT: %T.ref: = name_ref T, [template = ] // CHECK:STDOUT: %.loc16: = field_decl x, element0 [template] // CHECK:STDOUT: %complete_type: = complete_type_witness [template = ] // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/generic/init.carbon b/toolchain/check/testdata/class/generic/init.carbon index bbe942e6c1289..58b33b621e74a 100644 --- a/toolchain/check/testdata/class/generic/init.carbon +++ b/toolchain/check/testdata/class/generic/init.carbon @@ -100,11 +100,11 @@ fn InitFromAdaptedSpecific(x: i32) -> i32 { // CHECK:STDOUT: %return.patt: @InitFromStructGeneric.%T.loc8_26.2 (%T) = return_slot_pattern // CHECK:STDOUT: %return.param_patt: @InitFromStructGeneric.%T.loc8_26.2 (%T) = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.ref.loc8_39: type = name_ref T, %T.loc8_26.1 [symbolic = %T.loc8_26.2 (constants.%T)] // CHECK:STDOUT: %T.ref.loc8_45: type = name_ref T, %T.loc8_26.1 [symbolic = %T.loc8_26.2 (constants.%T)] // CHECK:STDOUT: %T.param: type = value_param runtime_param // CHECK:STDOUT: %T.loc8_26.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc8_26.2 (constants.%T)] // CHECK:STDOUT: %x.param: @InitFromStructGeneric.%T.loc8_26.2 (%T) = value_param runtime_param0 +// CHECK:STDOUT: %T.ref.loc8_39: type = name_ref T, %T.loc8_26.1 [symbolic = %T.loc8_26.2 (constants.%T)] // CHECK:STDOUT: %x: @InitFromStructGeneric.%T.loc8_26.2 (%T) = bind_name x, %x.param // CHECK:STDOUT: %return.param: ref @InitFromStructGeneric.%T.loc8_26.2 (%T) = out_param runtime_param1 // CHECK:STDOUT: %return: ref @InitFromStructGeneric.%T.loc8_26.2 (%T) = return_slot %return.param @@ -115,11 +115,13 @@ fn InitFromAdaptedSpecific(x: i32) -> i32 { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc13_30: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc13_30: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc13_38: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc13_38: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %x.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc13: type = splice_block %i32.loc13_30 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc13_30: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc13_30: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %x: %i32 = bind_name x, %x.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -138,7 +140,6 @@ fn InitFromAdaptedSpecific(x: i32) -> i32 { // CHECK:STDOUT: %complete_type.loc6_1.2: = complete_type_witness @Class.%struct_type.k (%struct_type.k.1) [symbolic = %complete_type.loc6_1.2 (constants.%complete_type.1)] // CHECK:STDOUT: // CHECK:STDOUT: class { -// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc4_13.1 [symbolic = %T.loc4_13.2 (constants.%T)] // CHECK:STDOUT: %.loc5: @Class.%Class.elem (%Class.elem.1) = field_decl k, element0 [template] // CHECK:STDOUT: %complete_type.loc6_1.1: = complete_type_witness %struct_type.k.1 [symbolic = %complete_type.loc6_1.2 (constants.%complete_type.1)] // CHECK:STDOUT: @@ -155,26 +156,23 @@ fn InitFromAdaptedSpecific(x: i32) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete.loc8: = require_complete_type @InitFromStructGeneric.%T.loc8_26.2 (%T) [symbolic = %require_complete.loc8 (constants.%require_complete.1)] -// CHECK:STDOUT: %Class.loc9_17.2: type = class_type @Class, @Class(%T.loc8_26.2) [symbolic = %Class.loc9_17.2 (constants.%Class.1)] -// CHECK:STDOUT: %require_complete.loc9: = require_complete_type @InitFromStructGeneric.%Class.loc9_17.2 (%Class.1) [symbolic = %require_complete.loc9 (constants.%require_complete.2)] +// CHECK:STDOUT: %Class: type = class_type @Class, @Class(%T.loc8_26.2) [symbolic = %Class (constants.%Class.1)] +// CHECK:STDOUT: %require_complete.loc9: = require_complete_type @InitFromStructGeneric.%Class (%Class.1) [symbolic = %require_complete.loc9 (constants.%require_complete.2)] // CHECK:STDOUT: %struct_type.k: type = struct_type {.k: @InitFromStructGeneric.%T.loc8_26.2 (%T)} [symbolic = %struct_type.k (constants.%struct_type.k.1)] -// CHECK:STDOUT: %Class.elem: type = unbound_element_type @InitFromStructGeneric.%Class.loc9_17.2 (%Class.1), @InitFromStructGeneric.%T.loc8_26.2 (%T) [symbolic = %Class.elem (constants.%Class.elem.1)] +// CHECK:STDOUT: %Class.elem: type = unbound_element_type @InitFromStructGeneric.%Class (%Class.1), @InitFromStructGeneric.%T.loc8_26.2 (%T) [symbolic = %Class.elem (constants.%Class.elem.1)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%T.param_patt: type, %x.param_patt: @InitFromStructGeneric.%T.loc8_26.2 (%T)) -> @InitFromStructGeneric.%T.loc8_26.2 (%T) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Class.ref: %Class.type = name_ref Class, file.%Class.decl [template = constants.%Class.generic] -// CHECK:STDOUT: %T.ref.loc9: type = name_ref T, %T.loc8_26.1 [symbolic = %T.loc8_26.2 (constants.%T)] -// CHECK:STDOUT: %Class.loc9_17.1: type = class_type @Class, @Class(constants.%T) [symbolic = %Class.loc9_17.2 (constants.%Class.1)] -// CHECK:STDOUT: %v.var: ref @InitFromStructGeneric.%Class.loc9_17.2 (%Class.1) = var v -// CHECK:STDOUT: %v: ref @InitFromStructGeneric.%Class.loc9_17.2 (%Class.1) = bind_name v, %v.var +// CHECK:STDOUT: %v.var: ref @InitFromStructGeneric.%Class (%Class.1) = var v +// CHECK:STDOUT: %v: ref @InitFromStructGeneric.%Class (%Class.1) = bind_name v, %v.var // CHECK:STDOUT: %x.ref: @InitFromStructGeneric.%T.loc8_26.2 (%T) = name_ref x, %x // CHECK:STDOUT: %.loc9_28.1: @InitFromStructGeneric.%struct_type.k (%struct_type.k.1) = struct_literal (%x.ref) // CHECK:STDOUT: %.loc9_28.2: ref @InitFromStructGeneric.%T.loc8_26.2 (%T) = class_element_access %v.var, element0 // CHECK:STDOUT: %.loc9_28.3: init @InitFromStructGeneric.%T.loc8_26.2 (%T) = initialize_from %x.ref to %.loc9_28.2 -// CHECK:STDOUT: %.loc9_28.4: init @InitFromStructGeneric.%Class.loc9_17.2 (%Class.1) = class_init (%.loc9_28.3), %v.var -// CHECK:STDOUT: %.loc9_29: init @InitFromStructGeneric.%Class.loc9_17.2 (%Class.1) = converted %.loc9_28.1, %.loc9_28.4 +// CHECK:STDOUT: %.loc9_28.4: init @InitFromStructGeneric.%Class (%Class.1) = class_init (%.loc9_28.3), %v.var +// CHECK:STDOUT: %.loc9_29: init @InitFromStructGeneric.%Class (%Class.1) = converted %.loc9_28.1, %.loc9_28.4 // CHECK:STDOUT: assign %v.var, %.loc9_29 -// CHECK:STDOUT: %v.ref: ref @InitFromStructGeneric.%Class.loc9_17.2 (%Class.1) = name_ref v, %v +// CHECK:STDOUT: %v.ref: ref @InitFromStructGeneric.%Class (%Class.1) = name_ref v, %v // CHECK:STDOUT: %k.ref: @InitFromStructGeneric.%Class.elem (%Class.elem.1) = name_ref k, @Class.%.loc5 [template = @Class.%.loc5] // CHECK:STDOUT: %.loc10_11.1: ref @InitFromStructGeneric.%T.loc8_26.2 (%T) = class_element_access %v.ref, element0 // CHECK:STDOUT: %.loc10_11.2: @InitFromStructGeneric.%T.loc8_26.2 (%T) = bind_value %.loc10_11.1 @@ -184,10 +182,6 @@ fn InitFromAdaptedSpecific(x: i32) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: fn @InitFromStructSpecific(%x.param_patt: %i32) -> %i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Class.ref: %Class.type = name_ref Class, file.%Class.decl [template = constants.%Class.generic] -// CHECK:STDOUT: %int_32.loc14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %Class: type = class_type @Class, @Class(constants.%i32) [template = constants.%Class.2] // CHECK:STDOUT: %v.var: ref %Class.2 = var v // CHECK:STDOUT: %v: ref %Class.2 = bind_name v, %v.var // CHECK:STDOUT: %x.ref: %i32 = name_ref x, %x @@ -291,11 +285,11 @@ fn InitFromAdaptedSpecific(x: i32) -> i32 { // CHECK:STDOUT: %return.patt: @InitFromAdaptedGeneric.%T.loc8_27.2 (%T) = return_slot_pattern // CHECK:STDOUT: %return.param_patt: @InitFromAdaptedGeneric.%T.loc8_27.2 (%T) = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.ref.loc8_40: type = name_ref T, %T.loc8_27.1 [symbolic = %T.loc8_27.2 (constants.%T)] // CHECK:STDOUT: %T.ref.loc8_46: type = name_ref T, %T.loc8_27.1 [symbolic = %T.loc8_27.2 (constants.%T)] // CHECK:STDOUT: %T.param: type = value_param runtime_param // CHECK:STDOUT: %T.loc8_27.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc8_27.2 (constants.%T)] // CHECK:STDOUT: %x.param: @InitFromAdaptedGeneric.%T.loc8_27.2 (%T) = value_param runtime_param0 +// CHECK:STDOUT: %T.ref.loc8_40: type = name_ref T, %T.loc8_27.1 [symbolic = %T.loc8_27.2 (constants.%T)] // CHECK:STDOUT: %x: @InitFromAdaptedGeneric.%T.loc8_27.2 (%T) = bind_name x, %x.param // CHECK:STDOUT: %return.param: ref @InitFromAdaptedGeneric.%T.loc8_27.2 (%T) = out_param runtime_param1 // CHECK:STDOUT: %return: ref @InitFromAdaptedGeneric.%T.loc8_27.2 (%T) = return_slot %return.param @@ -306,11 +300,13 @@ fn InitFromAdaptedSpecific(x: i32) -> i32 { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc12_31: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc12_31: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc12_39: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc12_39: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %x.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc12: type = splice_block %i32.loc12_31 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc12_31: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc12_31: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %x: %i32 = bind_name x, %x.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param diff --git a/toolchain/check/testdata/class/generic/member_access.carbon b/toolchain/check/testdata/class/generic/member_access.carbon index b723c18aab9fa..b55fb156dbb5f 100644 --- a/toolchain/check/testdata/class/generic/member_access.carbon +++ b/toolchain/check/testdata/class/generic/member_access.carbon @@ -123,13 +123,15 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Class.ref: %Class.type = name_ref Class, file.%Class.decl [template = constants.%Class.generic] -// CHECK:STDOUT: %int_32.loc10_31: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc10_31: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %Class: type = class_type @Class, @Class(constants.%i32) [template = constants.%Class.2] // CHECK:STDOUT: %int_32.loc10_40: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc10_40: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %x.param: %Class.2 = value_param runtime_param0 +// CHECK:STDOUT: %.loc10: type = splice_block %Class [template = constants.%Class.2] { +// CHECK:STDOUT: %Class.ref: %Class.type = name_ref Class, file.%Class.decl [template = constants.%Class.generic] +// CHECK:STDOUT: %int_32.loc10_31: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc10_31: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %Class: type = class_type @Class, @Class(constants.%i32) [template = constants.%Class.2] +// CHECK:STDOUT: } // CHECK:STDOUT: %x: %Class.2 = bind_name x, %x.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -140,13 +142,15 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Class.ref: %Class.type = name_ref Class, file.%Class.decl [template = constants.%Class.generic] -// CHECK:STDOUT: %int_32.loc14_24: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc14_24: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %Class: type = class_type @Class, @Class(constants.%i32) [template = constants.%Class.2] // CHECK:STDOUT: %int_32.loc14_33: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc14_33: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %x.param: %Class.2 = value_param runtime_param0 +// CHECK:STDOUT: %.loc14: type = splice_block %Class [template = constants.%Class.2] { +// CHECK:STDOUT: %Class.ref: %Class.type = name_ref Class, file.%Class.decl [template = constants.%Class.generic] +// CHECK:STDOUT: %int_32.loc14_24: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc14_24: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %Class: type = class_type @Class, @Class(constants.%i32) [template = constants.%Class.2] +// CHECK:STDOUT: } // CHECK:STDOUT: %x: %Class.2 = bind_name x, %x.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -157,14 +161,16 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Class.ref: %Class.type = name_ref Class, file.%Class.decl [template = constants.%Class.generic] -// CHECK:STDOUT: %int_32.loc18_28: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc18_28: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %Class: type = class_type @Class, @Class(constants.%i32) [template = constants.%Class.2] -// CHECK:STDOUT: %ptr: type = ptr_type %Class.2 [template = constants.%ptr.5] // CHECK:STDOUT: %int_32.loc18_38: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc18_38: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %p.param: %ptr.5 = value_param runtime_param0 +// CHECK:STDOUT: %.loc18: type = splice_block %ptr [template = constants.%ptr.5] { +// CHECK:STDOUT: %Class.ref: %Class.type = name_ref Class, file.%Class.decl [template = constants.%Class.generic] +// CHECK:STDOUT: %int_32.loc18_28: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc18_28: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %Class: type = class_type @Class, @Class(constants.%i32) [template = constants.%Class.2] +// CHECK:STDOUT: %ptr: type = ptr_type %Class.2 [template = constants.%ptr.5] +// CHECK:STDOUT: } // CHECK:STDOUT: %p: %ptr.5 = bind_name p, %p.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -187,7 +193,6 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: %complete_type.loc8_1.2: = complete_type_witness @Class.%struct_type.x (%struct_type.x.1) [symbolic = %complete_type.loc8_1.2 (constants.%complete_type.1)] // CHECK:STDOUT: // CHECK:STDOUT: class { -// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc2_13.1 [symbolic = %T.loc2_13.2 (constants.%T)] // CHECK:STDOUT: %.loc3: @Class.%Class.elem (%Class.elem.1) = field_decl x, element0 [template] // CHECK:STDOUT: %Get.decl: @Class.%Get.type (%Get.type.1) = fn_decl @Get [symbolic = @Class.%Get (constants.%Get.1)] { // CHECK:STDOUT: %self.patt: @Get.%Class (%Class.1) = binding_pattern self @@ -195,10 +200,12 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: %return.patt: @Get.%T (%T) = return_slot_pattern // CHECK:STDOUT: %return.param_patt: @Get.%T (%T) = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc5_16: type = specific_constant constants.%Class.1, @Class(constants.%T) [symbolic = %Class (constants.%Class.1)] -// CHECK:STDOUT: %Self.ref: type = name_ref Self, %.loc5_16 [symbolic = %Class (constants.%Class.1)] // CHECK:STDOUT: %T.ref: type = name_ref T, @Class.%T.loc2_13.1 [symbolic = %T (constants.%T)] // CHECK:STDOUT: %self.param: @Get.%Class (%Class.1) = value_param runtime_param0 +// CHECK:STDOUT: %.loc5_16.2: type = splice_block %Self.ref [symbolic = %Class (constants.%Class.1)] { +// CHECK:STDOUT: %.loc5_16.1: type = specific_constant constants.%Class.1, @Class(constants.%T) [symbolic = %Class (constants.%Class.1)] +// CHECK:STDOUT: %Self.ref: type = name_ref Self, %.loc5_16.1 [symbolic = %Class (constants.%Class.1)] +// CHECK:STDOUT: } // CHECK:STDOUT: %self: @Get.%Class (%Class.1) = bind_name self, %self.param // CHECK:STDOUT: %return.param: ref @Get.%T (%T) = out_param runtime_param1 // CHECK:STDOUT: %return: ref @Get.%T (%T) = return_slot %return.param @@ -210,12 +217,14 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: %return.patt: @GetAddr.%ptr.loc7_38.1 (%ptr.2) = return_slot_pattern // CHECK:STDOUT: %return.param_patt: @GetAddr.%ptr.loc7_38.1 (%ptr.2) = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc7_25: type = specific_constant constants.%Class.1, @Class(constants.%T) [symbolic = %Class (constants.%Class.1)] -// CHECK:STDOUT: %Self.ref: type = name_ref Self, %.loc7_25 [symbolic = %Class (constants.%Class.1)] -// CHECK:STDOUT: %ptr.loc7_29.2: type = ptr_type %Class.1 [symbolic = %ptr.loc7_29.1 (constants.%ptr.1)] // CHECK:STDOUT: %T.ref: type = name_ref T, @Class.%T.loc2_13.1 [symbolic = %T (constants.%T)] // CHECK:STDOUT: %ptr.loc7_38.2: type = ptr_type %T [symbolic = %ptr.loc7_38.1 (constants.%ptr.2)] // CHECK:STDOUT: %self.param: @GetAddr.%ptr.loc7_29.1 (%ptr.1) = value_param runtime_param0 +// CHECK:STDOUT: %.loc7_29: type = splice_block %ptr.loc7_29.2 [symbolic = %ptr.loc7_29.1 (constants.%ptr.1)] { +// CHECK:STDOUT: %.loc7_25: type = specific_constant constants.%Class.1, @Class(constants.%T) [symbolic = %Class (constants.%Class.1)] +// CHECK:STDOUT: %Self.ref: type = name_ref Self, %.loc7_25 [symbolic = %Class (constants.%Class.1)] +// CHECK:STDOUT: %ptr.loc7_29.2: type = ptr_type %Class.1 [symbolic = %ptr.loc7_29.1 (constants.%ptr.1)] +// CHECK:STDOUT: } // CHECK:STDOUT: %self: @GetAddr.%ptr.loc7_29.1 (%ptr.1) = bind_name self, %self.param // CHECK:STDOUT: %return.param: ref @GetAddr.%ptr.loc7_38.1 (%ptr.2) = out_param runtime_param1 // CHECK:STDOUT: %return: ref @GetAddr.%ptr.loc7_38.1 (%ptr.2) = return_slot %return.param diff --git a/toolchain/check/testdata/class/generic/member_inline.carbon b/toolchain/check/testdata/class/generic/member_inline.carbon index daa2d24f0400e..b1e789b9d645a 100644 --- a/toolchain/check/testdata/class/generic/member_inline.carbon +++ b/toolchain/check/testdata/class/generic/member_inline.carbon @@ -101,9 +101,9 @@ class C(T:! type) { // CHECK:STDOUT: %return.patt: @F.%T (%T) = return_slot_pattern // CHECK:STDOUT: %return.param_patt: @F.%T (%T) = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.ref.loc5_11: type = name_ref T, @Class.%T.loc4_13.1 [symbolic = %T (constants.%T)] // CHECK:STDOUT: %T.ref.loc5_17: type = name_ref T, @Class.%T.loc4_13.1 [symbolic = %T (constants.%T)] // CHECK:STDOUT: %n.param: @F.%T (%T) = value_param runtime_param0 +// CHECK:STDOUT: %T.ref.loc5_11: type = name_ref T, @Class.%T.loc4_13.1 [symbolic = %T (constants.%T)] // CHECK:STDOUT: %n: @F.%T (%T) = bind_name n, %n.param // CHECK:STDOUT: %return.param: ref @F.%T (%T) = out_param runtime_param1 // CHECK:STDOUT: %return: ref @F.%T (%T) = return_slot %return.param @@ -114,15 +114,16 @@ class C(T:! type) { // CHECK:STDOUT: %return.patt: @G.%T (%T) = return_slot_pattern // CHECK:STDOUT: %return.param_patt: @G.%T (%T) = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc9: type = specific_constant constants.%Class, @Class(constants.%T) [symbolic = %Class (constants.%Class)] -// CHECK:STDOUT: %Self.ref: type = name_ref Self, %.loc9 [symbolic = %Class (constants.%Class)] // CHECK:STDOUT: %T.ref: type = name_ref T, @Class.%T.loc4_13.1 [symbolic = %T (constants.%T)] // CHECK:STDOUT: %self.param: @G.%Class (%Class) = value_param runtime_param0 +// CHECK:STDOUT: %.loc9_14.2: type = splice_block %Self.ref [symbolic = %Class (constants.%Class)] { +// CHECK:STDOUT: %.loc9_14.1: type = specific_constant constants.%Class, @Class(constants.%T) [symbolic = %Class (constants.%Class)] +// CHECK:STDOUT: %Self.ref: type = name_ref Self, %.loc9_14.1 [symbolic = %Class (constants.%Class)] +// CHECK:STDOUT: } // CHECK:STDOUT: %self: @G.%Class (%Class) = bind_name self, %self.param // CHECK:STDOUT: %return.param: ref @G.%T (%T) = out_param runtime_param1 // CHECK:STDOUT: %return: ref @G.%T (%T) = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc4_13.1 [symbolic = %T.loc4_13.2 (constants.%T)] // CHECK:STDOUT: %.loc13: @Class.%Class.elem (%Class.elem) = field_decl n, element0 [template] // CHECK:STDOUT: %complete_type.loc14_1.1: = complete_type_witness %struct_type.n [symbolic = %complete_type.loc14_1.2 (constants.%complete_type)] // CHECK:STDOUT: @@ -246,15 +247,13 @@ class C(T:! type) { // CHECK:STDOUT: // CHECK:STDOUT: class { // CHECK:STDOUT: %F.decl: @C.%F.type (%F.type) = fn_decl @F [symbolic = @C.%F (constants.%F)] {} {} -// CHECK:STDOUT: %.loc11_14.1: %empty_struct_type = struct_literal () -// CHECK:STDOUT: %.loc11_14.2: type = converted %.loc11_14.1, constants.%empty_struct_type [template = constants.%empty_struct_type] -// CHECK:STDOUT: %.loc11_11: @C.%C.elem (%C.elem) = field_decl data, element0 [template] +// CHECK:STDOUT: %.loc11: @C.%C.elem (%C.elem) = field_decl data, element0 [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.data [template = constants.%complete_type] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: .data = %.loc11_11 +// CHECK:STDOUT: .data = %.loc11 // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -267,7 +266,7 @@ class C(T:! type) { // CHECK:STDOUT: // CHECK:STDOUT: fn() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %data.ref: @F.%C.elem (%C.elem) = name_ref data, @C.%.loc11_11 [template = @C.%.loc11_11] +// CHECK:STDOUT: %data.ref: @F.%C.elem (%C.elem) = name_ref data, @C.%.loc11 [template = @C.%.loc11] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/generic/member_lookup.carbon b/toolchain/check/testdata/class/generic/member_lookup.carbon index 4fdc4a9547084..71a799cc46436 100644 --- a/toolchain/check/testdata/class/generic/member_lookup.carbon +++ b/toolchain/check/testdata/class/generic/member_lookup.carbon @@ -151,13 +151,15 @@ fn AccessMissingConcrete(x: Derived(i32)) -> i32 { // CHECK:STDOUT: %return.patt: @AccessDerived.%T.loc13_18.2 (%T) = return_slot_pattern // CHECK:STDOUT: %return.param_patt: @AccessDerived.%T.loc13_18.2 (%T) = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Derived.ref: %Derived.type = name_ref Derived, file.%Derived.decl [template = constants.%Derived.generic] -// CHECK:STDOUT: %T.ref.loc13_39: type = name_ref T, %T.loc13_18.1 [symbolic = %T.loc13_18.2 (constants.%T)] -// CHECK:STDOUT: %Derived.loc13_40.1: type = class_type @Derived, @Derived(constants.%T) [symbolic = %Derived.loc13_40.2 (constants.%Derived.1)] // CHECK:STDOUT: %T.ref.loc13_46: type = name_ref T, %T.loc13_18.1 [symbolic = %T.loc13_18.2 (constants.%T)] // CHECK:STDOUT: %T.param: type = value_param runtime_param // CHECK:STDOUT: %T.loc13_18.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc13_18.2 (constants.%T)] // CHECK:STDOUT: %x.param: @AccessDerived.%Derived.loc13_40.2 (%Derived.1) = value_param runtime_param0 +// CHECK:STDOUT: %.loc13: type = splice_block %Derived.loc13_40.1 [symbolic = %Derived.loc13_40.2 (constants.%Derived.1)] { +// CHECK:STDOUT: %Derived.ref: %Derived.type = name_ref Derived, file.%Derived.decl [template = constants.%Derived.generic] +// CHECK:STDOUT: %T.ref.loc13_39: type = name_ref T, %T.loc13_18.1 [symbolic = %T.loc13_18.2 (constants.%T)] +// CHECK:STDOUT: %Derived.loc13_40.1: type = class_type @Derived, @Derived(constants.%T) [symbolic = %Derived.loc13_40.2 (constants.%Derived.1)] +// CHECK:STDOUT: } // CHECK:STDOUT: %x: @AccessDerived.%Derived.loc13_40.2 (%Derived.1) = bind_name x, %x.param // CHECK:STDOUT: %return.param: ref @AccessDerived.%T.loc13_18.2 (%T) = out_param runtime_param1 // CHECK:STDOUT: %return: ref @AccessDerived.%T.loc13_18.2 (%T) = return_slot %return.param @@ -170,13 +172,15 @@ fn AccessMissingConcrete(x: Derived(i32)) -> i32 { // CHECK:STDOUT: %return.patt: @AccessBase.%T.loc17_15.2 (%T) = return_slot_pattern // CHECK:STDOUT: %return.param_patt: @AccessBase.%T.loc17_15.2 (%T) = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Derived.ref: %Derived.type = name_ref Derived, file.%Derived.decl [template = constants.%Derived.generic] -// CHECK:STDOUT: %T.ref.loc17_36: type = name_ref T, %T.loc17_15.1 [symbolic = %T.loc17_15.2 (constants.%T)] -// CHECK:STDOUT: %Derived.loc17_37.1: type = class_type @Derived, @Derived(constants.%T) [symbolic = %Derived.loc17_37.2 (constants.%Derived.1)] // CHECK:STDOUT: %T.ref.loc17_43: type = name_ref T, %T.loc17_15.1 [symbolic = %T.loc17_15.2 (constants.%T)] // CHECK:STDOUT: %T.param: type = value_param runtime_param // CHECK:STDOUT: %T.loc17_15.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc17_15.2 (constants.%T)] // CHECK:STDOUT: %x.param: @AccessBase.%Derived.loc17_37.2 (%Derived.1) = value_param runtime_param0 +// CHECK:STDOUT: %.loc17: type = splice_block %Derived.loc17_37.1 [symbolic = %Derived.loc17_37.2 (constants.%Derived.1)] { +// CHECK:STDOUT: %Derived.ref: %Derived.type = name_ref Derived, file.%Derived.decl [template = constants.%Derived.generic] +// CHECK:STDOUT: %T.ref.loc17_36: type = name_ref T, %T.loc17_15.1 [symbolic = %T.loc17_15.2 (constants.%T)] +// CHECK:STDOUT: %Derived.loc17_37.1: type = class_type @Derived, @Derived(constants.%T) [symbolic = %Derived.loc17_37.2 (constants.%Derived.1)] +// CHECK:STDOUT: } // CHECK:STDOUT: %x: @AccessBase.%Derived.loc17_37.2 (%Derived.1) = bind_name x, %x.param // CHECK:STDOUT: %return.param: ref @AccessBase.%T.loc17_15.2 (%T) = out_param runtime_param1 // CHECK:STDOUT: %return: ref @AccessBase.%T.loc17_15.2 (%T) = return_slot %return.param @@ -187,13 +191,15 @@ fn AccessMissingConcrete(x: Derived(i32)) -> i32 { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Derived.ref: %Derived.type = name_ref Derived, file.%Derived.decl [template = constants.%Derived.generic] -// CHECK:STDOUT: %int_32.loc21_30: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc21_30: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %Derived: type = class_type @Derived, @Derived(constants.%i32) [template = constants.%Derived.2] // CHECK:STDOUT: %int_32.loc21_39: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc21_39: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %x.param: %Derived.2 = value_param runtime_param0 +// CHECK:STDOUT: %.loc21: type = splice_block %Derived [template = constants.%Derived.2] { +// CHECK:STDOUT: %Derived.ref: %Derived.type = name_ref Derived, file.%Derived.decl [template = constants.%Derived.generic] +// CHECK:STDOUT: %int_32.loc21_30: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc21_30: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %Derived: type = class_type @Derived, @Derived(constants.%i32) [template = constants.%Derived.2] +// CHECK:STDOUT: } // CHECK:STDOUT: %x: %Derived.2 = bind_name x, %x.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -212,7 +218,6 @@ fn AccessMissingConcrete(x: Derived(i32)) -> i32 { // CHECK:STDOUT: %complete_type.loc6_1.2: = complete_type_witness @Base.%struct_type.b (%struct_type.b.1) [symbolic = %complete_type.loc6_1.2 (constants.%complete_type.1)] // CHECK:STDOUT: // CHECK:STDOUT: class { -// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc4_17.1 [symbolic = %T.loc4_17.2 (constants.%T)] // CHECK:STDOUT: %.loc5: @Base.%Base.elem (%Base.elem.1) = field_decl b, element0 [template] // CHECK:STDOUT: %complete_type.loc6_1.1: = complete_type_witness %struct_type.b.1 [symbolic = %complete_type.loc6_1.2 (constants.%complete_type.1)] // CHECK:STDOUT: @@ -239,10 +244,9 @@ fn AccessMissingConcrete(x: Derived(i32)) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: class { // CHECK:STDOUT: %Base.ref: %Base.type = name_ref Base, file.%Base.decl [template = constants.%Base.generic] -// CHECK:STDOUT: %T.ref.loc9: type = name_ref T, %T.loc8_15.1 [symbolic = %T.loc8_15.2 (constants.%T)] +// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc8_15.1 [symbolic = %T.loc8_15.2 (constants.%T)] // CHECK:STDOUT: %Base.loc9_22.1: type = class_type @Base, @Base(constants.%T) [symbolic = %Base.loc9_22.2 (constants.%Base.1)] // CHECK:STDOUT: %.loc9: @Derived.%Derived.elem.loc9 (%Derived.elem.1) = base_decl %Base.loc9_22.1, element0 [template] -// CHECK:STDOUT: %T.ref.loc10: type = name_ref T, %T.loc8_15.1 [symbolic = %T.loc8_15.2 (constants.%T)] // CHECK:STDOUT: %.loc10: @Derived.%Derived.elem.loc10 (%Derived.elem.2) = field_decl d, element1 [template] // CHECK:STDOUT: %complete_type.loc11_1.1: = complete_type_witness %struct_type.base.d.1 [symbolic = %complete_type.loc11_1.2 (constants.%complete_type.2)] // CHECK:STDOUT: @@ -470,13 +474,15 @@ fn AccessMissingConcrete(x: Derived(i32)) -> i32 { // CHECK:STDOUT: %return.patt: @AccessMissingBase.%T.loc13_22.2 (%T) = return_slot_pattern // CHECK:STDOUT: %return.param_patt: @AccessMissingBase.%T.loc13_22.2 (%T) = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Base.ref: %Base.type = name_ref Base, file.%Base.decl [template = constants.%Base.generic] -// CHECK:STDOUT: %T.ref.loc13_40: type = name_ref T, %T.loc13_22.1 [symbolic = %T.loc13_22.2 (constants.%T)] -// CHECK:STDOUT: %Base.loc13_41.1: type = class_type @Base, @Base(constants.%T) [symbolic = %Base.loc13_41.2 (constants.%Base.1)] // CHECK:STDOUT: %T.ref.loc13_47: type = name_ref T, %T.loc13_22.1 [symbolic = %T.loc13_22.2 (constants.%T)] // CHECK:STDOUT: %T.param: type = value_param runtime_param // CHECK:STDOUT: %T.loc13_22.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc13_22.2 (constants.%T)] // CHECK:STDOUT: %x.param: @AccessMissingBase.%Base.loc13_41.2 (%Base.1) = value_param runtime_param0 +// CHECK:STDOUT: %.loc13: type = splice_block %Base.loc13_41.1 [symbolic = %Base.loc13_41.2 (constants.%Base.1)] { +// CHECK:STDOUT: %Base.ref: %Base.type = name_ref Base, file.%Base.decl [template = constants.%Base.generic] +// CHECK:STDOUT: %T.ref.loc13_40: type = name_ref T, %T.loc13_22.1 [symbolic = %T.loc13_22.2 (constants.%T)] +// CHECK:STDOUT: %Base.loc13_41.1: type = class_type @Base, @Base(constants.%T) [symbolic = %Base.loc13_41.2 (constants.%Base.1)] +// CHECK:STDOUT: } // CHECK:STDOUT: %x: @AccessMissingBase.%Base.loc13_41.2 (%Base.1) = bind_name x, %x.param // CHECK:STDOUT: %return.param: ref @AccessMissingBase.%T.loc13_22.2 (%T) = out_param runtime_param1 // CHECK:STDOUT: %return: ref @AccessMissingBase.%T.loc13_22.2 (%T) = return_slot %return.param @@ -489,13 +495,15 @@ fn AccessMissingConcrete(x: Derived(i32)) -> i32 { // CHECK:STDOUT: %return.patt: @AccessMissingDerived.%T.loc21_25.2 (%T) = return_slot_pattern // CHECK:STDOUT: %return.param_patt: @AccessMissingDerived.%T.loc21_25.2 (%T) = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Derived.ref: %Derived.type = name_ref Derived, file.%Derived.decl [template = constants.%Derived.generic] -// CHECK:STDOUT: %T.ref.loc21_46: type = name_ref T, %T.loc21_25.1 [symbolic = %T.loc21_25.2 (constants.%T)] -// CHECK:STDOUT: %Derived.loc21_47.1: type = class_type @Derived, @Derived(constants.%T) [symbolic = %Derived.loc21_47.2 (constants.%Derived.1)] // CHECK:STDOUT: %T.ref.loc21_53: type = name_ref T, %T.loc21_25.1 [symbolic = %T.loc21_25.2 (constants.%T)] // CHECK:STDOUT: %T.param: type = value_param runtime_param // CHECK:STDOUT: %T.loc21_25.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc21_25.2 (constants.%T)] // CHECK:STDOUT: %x.param: @AccessMissingDerived.%Derived.loc21_47.2 (%Derived.1) = value_param runtime_param0 +// CHECK:STDOUT: %.loc21: type = splice_block %Derived.loc21_47.1 [symbolic = %Derived.loc21_47.2 (constants.%Derived.1)] { +// CHECK:STDOUT: %Derived.ref: %Derived.type = name_ref Derived, file.%Derived.decl [template = constants.%Derived.generic] +// CHECK:STDOUT: %T.ref.loc21_46: type = name_ref T, %T.loc21_25.1 [symbolic = %T.loc21_25.2 (constants.%T)] +// CHECK:STDOUT: %Derived.loc21_47.1: type = class_type @Derived, @Derived(constants.%T) [symbolic = %Derived.loc21_47.2 (constants.%Derived.1)] +// CHECK:STDOUT: } // CHECK:STDOUT: %x: @AccessMissingDerived.%Derived.loc21_47.2 (%Derived.1) = bind_name x, %x.param // CHECK:STDOUT: %return.param: ref @AccessMissingDerived.%T.loc21_25.2 (%T) = out_param runtime_param1 // CHECK:STDOUT: %return: ref @AccessMissingDerived.%T.loc21_25.2 (%T) = return_slot %return.param @@ -506,13 +514,15 @@ fn AccessMissingConcrete(x: Derived(i32)) -> i32 { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Derived.ref: %Derived.type = name_ref Derived, file.%Derived.decl [template = constants.%Derived.generic] -// CHECK:STDOUT: %int_32.loc29_37: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc29_37: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %Derived: type = class_type @Derived, @Derived(constants.%i32) [template = constants.%Derived.2] // CHECK:STDOUT: %int_32.loc29_46: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc29_46: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %x.param: %Derived.2 = value_param runtime_param0 +// CHECK:STDOUT: %.loc29: type = splice_block %Derived [template = constants.%Derived.2] { +// CHECK:STDOUT: %Derived.ref: %Derived.type = name_ref Derived, file.%Derived.decl [template = constants.%Derived.generic] +// CHECK:STDOUT: %int_32.loc29_37: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc29_37: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %Derived: type = class_type @Derived, @Derived(constants.%i32) [template = constants.%Derived.2] +// CHECK:STDOUT: } // CHECK:STDOUT: %x: %Derived.2 = bind_name x, %x.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -531,7 +541,6 @@ fn AccessMissingConcrete(x: Derived(i32)) -> i32 { // CHECK:STDOUT: %complete_type.loc6_1.2: = complete_type_witness @Base.%struct_type.b (%struct_type.b.1) [symbolic = %complete_type.loc6_1.2 (constants.%complete_type.1)] // CHECK:STDOUT: // CHECK:STDOUT: class { -// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc4_17.1 [symbolic = %T.loc4_17.2 (constants.%T)] // CHECK:STDOUT: %.loc5: @Base.%Base.elem (%Base.elem.1) = field_decl b, element0 [template] // CHECK:STDOUT: %complete_type.loc6_1.1: = complete_type_witness %struct_type.b.1 [symbolic = %complete_type.loc6_1.2 (constants.%complete_type.1)] // CHECK:STDOUT: @@ -558,10 +567,9 @@ fn AccessMissingConcrete(x: Derived(i32)) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: class { // CHECK:STDOUT: %Base.ref: %Base.type = name_ref Base, file.%Base.decl [template = constants.%Base.generic] -// CHECK:STDOUT: %T.ref.loc9: type = name_ref T, %T.loc8_15.1 [symbolic = %T.loc8_15.2 (constants.%T)] +// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc8_15.1 [symbolic = %T.loc8_15.2 (constants.%T)] // CHECK:STDOUT: %Base.loc9_22.1: type = class_type @Base, @Base(constants.%T) [symbolic = %Base.loc9_22.2 (constants.%Base.1)] // CHECK:STDOUT: %.loc9: @Derived.%Derived.elem.loc9 (%Derived.elem.1) = base_decl %Base.loc9_22.1, element0 [template] -// CHECK:STDOUT: %T.ref.loc10: type = name_ref T, %T.loc8_15.1 [symbolic = %T.loc8_15.2 (constants.%T)] // CHECK:STDOUT: %.loc10: @Derived.%Derived.elem.loc10 (%Derived.elem.2) = field_decl d, element1 [template] // CHECK:STDOUT: %complete_type.loc11_1.1: = complete_type_witness %struct_type.base.d.1 [symbolic = %complete_type.loc11_1.2 (constants.%complete_type.2)] // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/generic/member_out_of_line.carbon b/toolchain/check/testdata/class/generic/member_out_of_line.carbon index a0b5b04009059..d00cadf435ba6 100644 --- a/toolchain/check/testdata/class/generic/member_out_of_line.carbon +++ b/toolchain/check/testdata/class/generic/member_out_of_line.carbon @@ -152,9 +152,9 @@ fn Generic(T:! ()).WrongType() {} // CHECK:STDOUT: } { // CHECK:STDOUT: %T.param: type = value_param runtime_param // CHECK:STDOUT: %T.loc10: type = bind_symbolic_name T, 0, %T.param [symbolic = constants.%T] -// CHECK:STDOUT: %T.ref.loc10_25: type = name_ref T, %T.loc10 [symbolic = constants.%T] // CHECK:STDOUT: %T.ref.loc10_31: type = name_ref T, %T.loc10 [symbolic = constants.%T] // CHECK:STDOUT: %n.param.loc10: %T = value_param runtime_param0 +// CHECK:STDOUT: %T.ref.loc10_25: type = name_ref T, %T.loc10 [symbolic = constants.%T] // CHECK:STDOUT: %n.loc10: %T = bind_name n, %n.param.loc10 // CHECK:STDOUT: %return.param.loc10: ref %T = out_param runtime_param1 // CHECK:STDOUT: %return.loc10: ref %T = return_slot %return.param.loc10 @@ -167,10 +167,12 @@ fn Generic(T:! ()).WrongType() {} // CHECK:STDOUT: } { // CHECK:STDOUT: %T.param: type = value_param runtime_param // CHECK:STDOUT: %T.loc14: type = bind_symbolic_name T, 0, %T.param [symbolic = constants.%T] -// CHECK:STDOUT: %.loc14: type = specific_constant constants.%Class, @Class(constants.%T) [symbolic = constants.%Class] -// CHECK:STDOUT: %Self.ref.loc14: type = name_ref Self, %.loc14 [symbolic = constants.%Class] // CHECK:STDOUT: %T.ref.loc14: type = name_ref T, %T.loc14 [symbolic = constants.%T] // CHECK:STDOUT: %self.param.loc14: %Class = value_param runtime_param0 +// CHECK:STDOUT: %.loc14_28.2: type = splice_block %Self.ref.loc14 [symbolic = constants.%Class] { +// CHECK:STDOUT: %.loc14_28.1: type = specific_constant constants.%Class, @Class(constants.%T) [symbolic = constants.%Class] +// CHECK:STDOUT: %Self.ref.loc14: type = name_ref Self, %.loc14_28.1 [symbolic = constants.%Class] +// CHECK:STDOUT: } // CHECK:STDOUT: %self.loc14: %Class = bind_name self, %self.param.loc14 // CHECK:STDOUT: %return.param.loc14: ref %T = out_param runtime_param1 // CHECK:STDOUT: %return.loc14: ref %T = return_slot %return.param.loc14 @@ -199,9 +201,9 @@ fn Generic(T:! ()).WrongType() {} // CHECK:STDOUT: %return.patt: %T = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %T = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.ref.loc5_11: type = name_ref T, @Class.%T.loc4_13.1 [symbolic = %T.loc5 (constants.%T)] // CHECK:STDOUT: %T.ref.loc5_17: type = name_ref T, @Class.%T.loc4_13.1 [symbolic = %T.loc5 (constants.%T)] // CHECK:STDOUT: %n.param.loc5: @F.%T.loc5 (%T) = value_param runtime_param0 +// CHECK:STDOUT: %T.ref.loc5_11: type = name_ref T, @Class.%T.loc4_13.1 [symbolic = %T.loc5 (constants.%T)] // CHECK:STDOUT: %n.loc5: @F.%T.loc5 (%T) = bind_name n, %n.param.loc5 // CHECK:STDOUT: %return.param.loc5: ref @F.%T.loc5 (%T) = out_param runtime_param1 // CHECK:STDOUT: %return.loc5: ref @F.%T.loc5 (%T) = return_slot %return.param.loc5 @@ -212,15 +214,16 @@ fn Generic(T:! ()).WrongType() {} // CHECK:STDOUT: %return.patt: %T = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %T = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc6: type = specific_constant constants.%Class, @Class(constants.%T) [symbolic = %Class (constants.%Class)] -// CHECK:STDOUT: %Self.ref.loc6: type = name_ref Self, %.loc6 [symbolic = %Class (constants.%Class)] // CHECK:STDOUT: %T.ref.loc6: type = name_ref T, @Class.%T.loc4_13.1 [symbolic = %T.loc6 (constants.%T)] // CHECK:STDOUT: %self.param.loc6: @G.%Class (%Class) = value_param runtime_param0 +// CHECK:STDOUT: %.loc6_14.2: type = splice_block %Self.ref.loc6 [symbolic = %Class (constants.%Class)] { +// CHECK:STDOUT: %.loc6_14.1: type = specific_constant constants.%Class, @Class(constants.%T) [symbolic = %Class (constants.%Class)] +// CHECK:STDOUT: %Self.ref.loc6: type = name_ref Self, %.loc6_14.1 [symbolic = %Class (constants.%Class)] +// CHECK:STDOUT: } // CHECK:STDOUT: %self.loc6: @G.%Class (%Class) = bind_name self, %self.param.loc6 // CHECK:STDOUT: %return.param.loc6: ref @G.%T.loc6 (%T) = out_param runtime_param1 // CHECK:STDOUT: %return.loc6: ref @G.%T.loc6 (%T) = return_slot %return.param.loc6 // CHECK:STDOUT: } -// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc4_13.1 [symbolic = %T.loc4_13.2 (constants.%T)] // CHECK:STDOUT: %.loc7: @Class.%Class.elem (%Class.elem) = field_decl n, element0 [template] // CHECK:STDOUT: %complete_type.loc8_1.1: = complete_type_witness %struct_type.n [symbolic = %complete_type.loc8_1.2 (constants.%complete_type)] // CHECK:STDOUT: @@ -343,15 +346,17 @@ fn Generic(T:! ()).WrongType() {} // CHECK:STDOUT: } { // CHECK:STDOUT: %T.param: type = value_param runtime_param // CHECK:STDOUT: %T.loc10: type = bind_symbolic_name T, 0, %T.param [symbolic = constants.%T] -// CHECK:STDOUT: %T.ref.loc10_22: type = name_ref T, %T.loc10 [symbolic = constants.%T] // CHECK:STDOUT: %N.param: %T = value_param runtime_param +// CHECK:STDOUT: %T.ref.loc10_22: type = name_ref T, %T.loc10 [symbolic = constants.%T] // CHECK:STDOUT: %N.loc10: %T = bind_symbolic_name N, 1, %N.param [symbolic = constants.%N] -// CHECK:STDOUT: %.loc10: type = specific_constant constants.%B, @B(constants.%T, constants.%N) [symbolic = constants.%B] -// CHECK:STDOUT: %Self.ref.loc10: type = name_ref Self, %.loc10 [symbolic = constants.%B] -// CHECK:STDOUT: %T.ref.loc10_42: type = name_ref T, %T.loc10 [symbolic = constants.%T] // CHECK:STDOUT: %self.param.loc10: %B = value_param runtime_param0 +// CHECK:STDOUT: %.loc10_33.2: type = splice_block %Self.ref.loc10 [symbolic = constants.%B] { +// CHECK:STDOUT: %.loc10_33.1: type = specific_constant constants.%B, @B(constants.%T, constants.%N) [symbolic = constants.%B] +// CHECK:STDOUT: %Self.ref.loc10: type = name_ref Self, %.loc10_33.1 [symbolic = constants.%B] +// CHECK:STDOUT: } // CHECK:STDOUT: %self.loc10: %B = bind_name self, %self.param.loc10 // CHECK:STDOUT: %a.param.loc10: %T = value_param runtime_param1 +// CHECK:STDOUT: %T.ref.loc10_42: type = name_ref T, %T.loc10 [symbolic = constants.%T] // CHECK:STDOUT: %a.loc10: %T = bind_name a, %a.param.loc10 // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -369,8 +374,8 @@ fn Generic(T:! ()).WrongType() {} // CHECK:STDOUT: %N.patt.loc5_11.1: @B.%T (%T) = symbolic_binding_pattern N, 1 [symbolic = %N.patt.loc5_11.2 (constants.%N.patt)] // CHECK:STDOUT: %N.param_patt: @B.%T (%T) = value_param_pattern %N.patt.loc5_11.1, runtime_param [symbolic = %N.patt.loc5_11.2 (constants.%N.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.ref: type = name_ref T, @A.%T.loc4_9.1 [symbolic = %T (constants.%T)] // CHECK:STDOUT: %N.param: @B.%T (%T) = value_param runtime_param +// CHECK:STDOUT: %T.ref: type = name_ref T, @A.%T.loc4_9.1 [symbolic = %T (constants.%T)] // CHECK:STDOUT: %N.loc5_11.1: @B.%T (%T) = bind_symbolic_name N, 1, %N.param [symbolic = %N.loc5_11.2 (constants.%N)] // CHECK:STDOUT: } // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] @@ -398,12 +403,14 @@ fn Generic(T:! ()).WrongType() {} // CHECK:STDOUT: %a.patt: %T = binding_pattern a // CHECK:STDOUT: %a.param_patt: %T = value_param_pattern %a.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc6: type = specific_constant constants.%B, @B(constants.%T, constants.%N) [symbolic = %B (constants.%B)] -// CHECK:STDOUT: %Self.ref.loc6: type = name_ref Self, %.loc6 [symbolic = %B (constants.%B)] -// CHECK:STDOUT: %T.ref.loc6: type = name_ref T, @A.%T.loc4_9.1 [symbolic = %T.loc6 (constants.%T)] // CHECK:STDOUT: %self.param.loc6: @F.%B (%B) = value_param runtime_param0 +// CHECK:STDOUT: %.loc6_16.2: type = splice_block %Self.ref.loc6 [symbolic = %B (constants.%B)] { +// CHECK:STDOUT: %.loc6_16.1: type = specific_constant constants.%B, @B(constants.%T, constants.%N) [symbolic = %B (constants.%B)] +// CHECK:STDOUT: %Self.ref.loc6: type = name_ref Self, %.loc6_16.1 [symbolic = %B (constants.%B)] +// CHECK:STDOUT: } // CHECK:STDOUT: %self.loc6: @F.%B (%B) = bind_name self, %self.param.loc6 // CHECK:STDOUT: %a.param.loc6: @F.%T.loc6 (%T) = value_param runtime_param1 +// CHECK:STDOUT: %T.ref.loc6: type = name_ref T, @A.%T.loc4_9.1 [symbolic = %T.loc6 (constants.%T)] // CHECK:STDOUT: %a.loc6: @F.%T.loc6 (%T) = bind_name a, %a.param.loc6 // CHECK:STDOUT: } // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] @@ -741,9 +748,11 @@ fn Generic(T:! ()).WrongType() {} // CHECK:STDOUT: %T.loc4_15.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc4_15.2 (constants.%T.1)] // CHECK:STDOUT: } // CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.1] {} { -// CHECK:STDOUT: %.loc14_17.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc14_17.2: type = converted %.loc14_17.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %T.param: %empty_tuple.type = value_param runtime_param +// CHECK:STDOUT: %.loc14_17.3: type = splice_block %.loc14_17.2 [template = constants.%empty_tuple.type] { +// CHECK:STDOUT: %.loc14_17.1: %empty_tuple.type = tuple_literal () +// CHECK:STDOUT: %.loc14_17.2: type = converted %.loc14_17.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] +// CHECK:STDOUT: } // CHECK:STDOUT: %T.loc14_12.1: %empty_tuple.type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc14_12.2 (constants.%T.2)] // CHECK:STDOUT: } // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/generic/method_deduce.carbon b/toolchain/check/testdata/class/generic/method_deduce.carbon index dcf0429e1f2d9..abffce41b6dd2 100644 --- a/toolchain/check/testdata/class/generic/method_deduce.carbon +++ b/toolchain/check/testdata/class/generic/method_deduce.carbon @@ -97,14 +97,16 @@ fn CallGenericMethodWithNonDeducedParam(c: Class(A)) -> (A, B) { // CHECK:STDOUT: %return.patt: %tuple.type.3 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %tuple.type.3 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Class.ref: %Class.type = name_ref Class, file.%Class.decl [template = constants.%Class.generic] -// CHECK:STDOUT: %A.ref.loc19_31: type = name_ref A, file.%A.decl [template = constants.%A] -// CHECK:STDOUT: %Class: type = class_type @Class, @Class(constants.%A) [template = constants.%Class.2] // CHECK:STDOUT: %A.ref.loc19_39: type = name_ref A, file.%A.decl [template = constants.%A] // CHECK:STDOUT: %B.ref.loc19: type = name_ref B, file.%B.decl [template = constants.%B] // CHECK:STDOUT: %.loc19_43.1: %tuple.type.1 = tuple_literal (%A.ref.loc19_39, %B.ref.loc19) // CHECK:STDOUT: %.loc19_43.2: type = converted %.loc19_43.1, constants.%tuple.type.3 [template = constants.%tuple.type.3] // CHECK:STDOUT: %c.param: %Class.2 = value_param runtime_param0 +// CHECK:STDOUT: %.loc19_32: type = splice_block %Class [template = constants.%Class.2] { +// CHECK:STDOUT: %Class.ref: %Class.type = name_ref Class, file.%Class.decl [template = constants.%Class.generic] +// CHECK:STDOUT: %A.ref.loc19_31: type = name_ref A, file.%A.decl [template = constants.%A] +// CHECK:STDOUT: %Class: type = class_type @Class, @Class(constants.%A) [template = constants.%Class.2] +// CHECK:STDOUT: } // CHECK:STDOUT: %c: %Class.2 = bind_name c, %c.param // CHECK:STDOUT: %return.param: ref %tuple.type.3 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %tuple.type.3 = return_slot %return.param @@ -115,14 +117,16 @@ fn CallGenericMethodWithNonDeducedParam(c: Class(A)) -> (A, B) { // CHECK:STDOUT: %return.patt: %tuple.type.3 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %tuple.type.3 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Class.ref: %Class.type = name_ref Class, file.%Class.decl [template = constants.%Class.generic] -// CHECK:STDOUT: %A.ref.loc23_50: type = name_ref A, file.%A.decl [template = constants.%A] -// CHECK:STDOUT: %Class: type = class_type @Class, @Class(constants.%A) [template = constants.%Class.2] // CHECK:STDOUT: %A.ref.loc23_58: type = name_ref A, file.%A.decl [template = constants.%A] // CHECK:STDOUT: %B.ref.loc23: type = name_ref B, file.%B.decl [template = constants.%B] // CHECK:STDOUT: %.loc23_62.1: %tuple.type.1 = tuple_literal (%A.ref.loc23_58, %B.ref.loc23) // CHECK:STDOUT: %.loc23_62.2: type = converted %.loc23_62.1, constants.%tuple.type.3 [template = constants.%tuple.type.3] // CHECK:STDOUT: %c.param: %Class.2 = value_param runtime_param0 +// CHECK:STDOUT: %.loc23_51: type = splice_block %Class [template = constants.%Class.2] { +// CHECK:STDOUT: %Class.ref: %Class.type = name_ref Class, file.%Class.decl [template = constants.%Class.generic] +// CHECK:STDOUT: %A.ref.loc23_50: type = name_ref A, file.%A.decl [template = constants.%A] +// CHECK:STDOUT: %Class: type = class_type @Class, @Class(constants.%A) [template = constants.%Class.2] +// CHECK:STDOUT: } // CHECK:STDOUT: %c: %Class.2 = bind_name c, %c.param // CHECK:STDOUT: %return.param: ref %tuple.type.3 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %tuple.type.3 = return_slot %return.param @@ -179,12 +183,12 @@ fn CallGenericMethodWithNonDeducedParam(c: Class(A)) -> (A, B) { // CHECK:STDOUT: %return.patt: @GetNoDeduce.%tuple.type (%tuple.type.2) = return_slot_pattern // CHECK:STDOUT: %return.param_patt: @GetNoDeduce.%tuple.type (%tuple.type.2) = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.ref.loc16_21: type = name_ref T, @Class.%T.loc14_13.1 [symbolic = %T (constants.%T)] // CHECK:STDOUT: %T.ref.loc16_38: type = name_ref T, @Class.%T.loc14_13.1 [symbolic = %T (constants.%T)] // CHECK:STDOUT: %U.ref.loc16_41: type = name_ref U, %U.loc16_24.2 [symbolic = %U.loc16_24.1 (constants.%U)] // CHECK:STDOUT: %.loc16_42.1: %tuple.type.1 = tuple_literal (%T.ref.loc16_38, %U.ref.loc16_41) // CHECK:STDOUT: %.loc16_42.2: type = converted %.loc16_42.1, constants.%tuple.type.2 [symbolic = %tuple.type (constants.%tuple.type.2)] // CHECK:STDOUT: %x.param: @GetNoDeduce.%T (%T) = value_param runtime_param0 +// CHECK:STDOUT: %T.ref.loc16_21: type = name_ref T, @Class.%T.loc14_13.1 [symbolic = %T (constants.%T)] // CHECK:STDOUT: %x: @GetNoDeduce.%T (%T) = bind_name x, %x.param // CHECK:STDOUT: %U.param: type = value_param runtime_param // CHECK:STDOUT: %U.loc16_24.2: type = bind_symbolic_name U, 1, %U.param [symbolic = %U.loc16_24.1 (constants.%U)] diff --git a/toolchain/check/testdata/class/generic/redeclare.carbon b/toolchain/check/testdata/class/generic/redeclare.carbon index bb0eb10ba11ec..867a293925e2a 100644 --- a/toolchain/check/testdata/class/generic/redeclare.carbon +++ b/toolchain/check/testdata/class/generic/redeclare.carbon @@ -243,9 +243,11 @@ class E(U:! type) {} // CHECK:STDOUT: %N.patt.loc4_9.1: %i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc4_9.2 (constants.%N.patt.2)] // CHECK:STDOUT: %N.param_patt: %i32 = value_param_pattern %N.patt.loc4_9.1, runtime_param [symbolic = %N.patt.loc4_9.2 (constants.%N.patt.2)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %N.param: %i32 = value_param runtime_param +// CHECK:STDOUT: %.loc4: type = splice_block %i32 [template = constants.%i32] { +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %N.loc4_9.1: %i32 = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc4_9.2 (constants.%N.2)] // CHECK:STDOUT: } // CHECK:STDOUT: %.decl: %.type = class_decl @.1 [template = constants.%.generic] { @@ -254,10 +256,10 @@ class E(U:! type) {} // CHECK:STDOUT: %N.patt.loc12_19.1: @.1.%T.loc12_9.2 (%T) = symbolic_binding_pattern N, 1 [symbolic = %N.patt.loc12_19.2 (constants.%N.patt.3)] // CHECK:STDOUT: %N.param_patt: @.1.%T.loc12_9.2 (%T) = value_param_pattern %N.patt.loc12_19.1, runtime_param [symbolic = %N.patt.loc12_19.2 (constants.%N.patt.3)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc12_9.1 [symbolic = %T.loc12_9.2 (constants.%T)] // CHECK:STDOUT: %T.param: type = value_param runtime_param // CHECK:STDOUT: %T.loc12_9.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc12_9.2 (constants.%T)] // CHECK:STDOUT: %N.param: @.1.%T.loc12_9.2 (%T) = value_param runtime_param +// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc12_9.1 [symbolic = %T.loc12_9.2 (constants.%T)] // CHECK:STDOUT: %N.loc12_19.1: @.1.%T.loc12_9.2 (%T) = bind_symbolic_name N, 1, %N.param [symbolic = %N.loc12_19.2 (constants.%N.3)] // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -343,11 +345,13 @@ class E(U:! type) {} // CHECK:STDOUT: %U.patt.loc12_19.1: %i32 = symbolic_binding_pattern U, 1 [symbolic = %U.patt.loc12_19.2 (constants.%U.patt)] // CHECK:STDOUT: %U.param_patt: %i32 = value_param_pattern %U.patt.loc12_19.1, runtime_param [symbolic = %U.patt.loc12_19.2 (constants.%U.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %T.param: type = value_param runtime_param // CHECK:STDOUT: %T.loc12_9.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc12_9.2 (constants.%T)] // CHECK:STDOUT: %U.param: %i32 = value_param runtime_param +// CHECK:STDOUT: %.loc12: type = splice_block %i32 [template = constants.%i32] { +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %U.loc12_19.1: %i32 = bind_symbolic_name U, 1, %U.param [symbolic = %U.loc12_19.2 (constants.%U)] // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -431,9 +435,11 @@ class E(U:! type) {} // CHECK:STDOUT: %T.patt.loc12_9.1: %i32 = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc12_9.2 (constants.%T.patt.2)] // CHECK:STDOUT: %T.param_patt: %i32 = value_param_pattern %T.patt.loc12_9.1, runtime_param [symbolic = %T.patt.loc12_9.2 (constants.%T.patt.2)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %T.param: %i32 = value_param runtime_param +// CHECK:STDOUT: %.loc12: type = splice_block %i32 [template = constants.%i32] { +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %T.loc12_9.1: %i32 = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc12_9.2 (constants.%T.2)] // CHECK:STDOUT: } // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/generic/self.carbon b/toolchain/check/testdata/class/generic/self.carbon index 3e80296538cb5..fc9b75f2f6e3a 100644 --- a/toolchain/check/testdata/class/generic/self.carbon +++ b/toolchain/check/testdata/class/generic/self.carbon @@ -144,8 +144,8 @@ class Class(T:! type) { // CHECK:STDOUT: generic fn @F(@Class.%T.loc11_13.1: type) { // CHECK:STDOUT: !definition: // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)] -// CHECK:STDOUT: %Class.loc17_19.2: type = class_type @Class, @Class(%T) [symbolic = %Class.loc17_19.2 (constants.%Class)] -// CHECK:STDOUT: %require_complete: = require_complete_type @F.%Class.loc17_19.2 (%Class) [symbolic = %require_complete (constants.%require_complete)] +// CHECK:STDOUT: %Class: type = class_type @Class, @Class(%T) [symbolic = %Class (constants.%Class)] +// CHECK:STDOUT: %require_complete: = require_complete_type @F.%Class (%Class) [symbolic = %require_complete (constants.%require_complete)] // CHECK:STDOUT: %MakeSelf.type: type = fn_type @MakeSelf, @Class(%T) [symbolic = %MakeSelf.type (constants.%MakeSelf.type)] // CHECK:STDOUT: %MakeSelf: @F.%MakeSelf.type (%MakeSelf.type) = struct_value () [symbolic = %MakeSelf (constants.%MakeSelf)] // CHECK:STDOUT: %MakeSelf.specific_fn.loc17_23.2: = specific_function %MakeSelf, @MakeSelf(%T) [symbolic = %MakeSelf.specific_fn.loc17_23.2 (constants.%MakeSelf.specific_fn)] @@ -155,26 +155,21 @@ class Class(T:! type) { // CHECK:STDOUT: // CHECK:STDOUT: fn() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Class.ref: %Class.type = name_ref Class, file.%Class.decl [template = constants.%Class.generic] -// CHECK:STDOUT: %T.ref: type = name_ref T, @Class.%T.loc11_13.1 [symbolic = %T (constants.%T)] -// CHECK:STDOUT: %Class.loc17_19.1: type = class_type @Class, @Class(constants.%T) [symbolic = %Class.loc17_19.2 (constants.%Class)] -// CHECK:STDOUT: %c.var: ref @F.%Class.loc17_19.2 (%Class) = var c -// CHECK:STDOUT: %c: ref @F.%Class.loc17_19.2 (%Class) = bind_name c, %c.var +// CHECK:STDOUT: %c.var: ref @F.%Class (%Class) = var c +// CHECK:STDOUT: %c: ref @F.%Class (%Class) = bind_name c, %c.var // CHECK:STDOUT: %.loc17_23: @F.%MakeSelf.type (%MakeSelf.type) = specific_constant @Class.%MakeSelf.decl, @Class(constants.%T) [symbolic = %MakeSelf (constants.%MakeSelf)] // CHECK:STDOUT: %MakeSelf.ref: @F.%MakeSelf.type (%MakeSelf.type) = name_ref MakeSelf, %.loc17_23 [symbolic = %MakeSelf (constants.%MakeSelf)] // CHECK:STDOUT: %MakeSelf.specific_fn.loc17_23.1: = specific_function %MakeSelf.ref, @MakeSelf(constants.%T) [symbolic = %MakeSelf.specific_fn.loc17_23.2 (constants.%MakeSelf.specific_fn)] -// CHECK:STDOUT: %.loc17_9: ref @F.%Class.loc17_19.2 (%Class) = splice_block %c.var {} -// CHECK:STDOUT: %MakeSelf.call: init @F.%Class.loc17_19.2 (%Class) = call %MakeSelf.specific_fn.loc17_23.1() to %.loc17_9 +// CHECK:STDOUT: %.loc17_9: ref @F.%Class (%Class) = splice_block %c.var {} +// CHECK:STDOUT: %MakeSelf.call: init @F.%Class (%Class) = call %MakeSelf.specific_fn.loc17_23.1() to %.loc17_9 // CHECK:STDOUT: assign %c.var, %MakeSelf.call -// CHECK:STDOUT: %.loc18_12: type = specific_constant constants.%Class, @Class(constants.%T) [symbolic = %Class.loc17_19.2 (constants.%Class)] -// CHECK:STDOUT: %Self.ref: type = name_ref Self, %.loc18_12 [symbolic = %Class.loc17_19.2 (constants.%Class)] -// CHECK:STDOUT: %s.var: ref @F.%Class.loc17_19.2 (%Class) = var s -// CHECK:STDOUT: %s: ref @F.%Class.loc17_19.2 (%Class) = bind_name s, %s.var +// CHECK:STDOUT: %s.var: ref @F.%Class (%Class) = var s +// CHECK:STDOUT: %s: ref @F.%Class (%Class) = bind_name s, %s.var // CHECK:STDOUT: %.loc18_19: @F.%MakeClass.type (%MakeClass.type) = specific_constant @Class.%MakeClass.decl, @Class(constants.%T) [symbolic = %MakeClass (constants.%MakeClass)] // CHECK:STDOUT: %MakeClass.ref: @F.%MakeClass.type (%MakeClass.type) = name_ref MakeClass, %.loc18_19 [symbolic = %MakeClass (constants.%MakeClass)] // CHECK:STDOUT: %MakeClass.specific_fn.loc18_19.1: = specific_function %MakeClass.ref, @MakeClass(constants.%T) [symbolic = %MakeClass.specific_fn.loc18_19.2 (constants.%MakeClass.specific_fn)] -// CHECK:STDOUT: %.loc18_9: ref @F.%Class.loc17_19.2 (%Class) = splice_block %s.var {} -// CHECK:STDOUT: %MakeClass.call: init @F.%Class.loc17_19.2 (%Class) = call %MakeClass.specific_fn.loc18_19.1() to %.loc18_9 +// CHECK:STDOUT: %.loc18_9: ref @F.%Class (%Class) = splice_block %s.var {} +// CHECK:STDOUT: %MakeClass.call: init @F.%Class (%Class) = call %MakeClass.specific_fn.loc18_19.1() to %.loc18_9 // CHECK:STDOUT: assign %s.var, %MakeClass.call // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/generic/stringify.carbon b/toolchain/check/testdata/class/generic/stringify.carbon index 8c4a9b0f34541..b14be55814b39 100644 --- a/toolchain/check/testdata/class/generic/stringify.carbon +++ b/toolchain/check/testdata/class/generic/stringify.carbon @@ -117,11 +117,8 @@ var g: E({.a = 1, .b = 2}) = {} as E({.a = 3, .b = 4} as D); // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %NoParams.decl: type = class_decl @NoParams [template = constants.%NoParams] {} {} // CHECK:STDOUT: %EmptyParams.decl: %EmptyParams.type = class_decl @EmptyParams [template = constants.%EmptyParams.generic] {} {} -// CHECK:STDOUT: %NoParams.ref: type = name_ref NoParams, %NoParams.decl [template = constants.%NoParams] // CHECK:STDOUT: %v.var: ref %NoParams = var v // CHECK:STDOUT: %v: ref %NoParams = bind_name v, %v.var -// CHECK:STDOUT: %EmptyParams.ref: %EmptyParams.type = name_ref EmptyParams, %EmptyParams.decl [template = constants.%EmptyParams.generic] -// CHECK:STDOUT: %EmptyParams: type = class_type @EmptyParams [template = constants.%EmptyParams] // CHECK:STDOUT: %w.var: ref %EmptyParams = var w // CHECK:STDOUT: %w: ref %EmptyParams = bind_name w, %w.var // CHECK:STDOUT: } @@ -200,25 +197,8 @@ var g: E({.a = 1, .b = 2}) = {} as E({.a = 3, .b = 4} as D); // CHECK:STDOUT: %T.param: type = value_param runtime_param // CHECK:STDOUT: %T.loc4_13.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc4_13.2 (constants.%T)] // CHECK:STDOUT: } -// CHECK:STDOUT: %Outer.ref.loc9: %Outer.type = name_ref Outer, %Outer.decl [template = constants.%Outer.generic] -// CHECK:STDOUT: %.loc9_15: %empty_struct_type = struct_literal () -// CHECK:STDOUT: %.loc9_16: type = converted %.loc9_15, constants.%empty_struct_type [template = constants.%empty_struct_type] -// CHECK:STDOUT: %ptr.loc9: type = ptr_type %empty_struct_type [template = constants.%ptr.1] -// CHECK:STDOUT: %Outer.loc9: type = class_type @Outer, @Outer(constants.%ptr.1) [template = constants.%Outer.2] // CHECK:STDOUT: %v.var: ref %Outer.2 = var v // CHECK:STDOUT: %v: ref %Outer.2 = bind_name v, %v.var -// CHECK:STDOUT: %Outer.ref.loc19: %Outer.type = name_ref Outer, %Outer.decl [template = constants.%Outer.generic] -// CHECK:STDOUT: %.loc19_15: %empty_struct_type = struct_literal () -// CHECK:STDOUT: %.loc19_16: type = converted %.loc19_15, constants.%empty_struct_type [template = constants.%empty_struct_type] -// CHECK:STDOUT: %ptr.loc19_16: type = ptr_type %empty_struct_type [template = constants.%ptr.1] -// CHECK:STDOUT: %Outer.loc19: type = class_type @Outer, @Outer(constants.%ptr.1) [template = constants.%Outer.2] -// CHECK:STDOUT: %.loc19_18: %Inner.type.2 = specific_constant @Outer.%Inner.decl, @Outer(constants.%ptr.1) [template = constants.%Inner.generic.2] -// CHECK:STDOUT: %Inner.ref: %Inner.type.2 = name_ref Inner, %.loc19_18 [template = constants.%Inner.generic.2] -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %struct_type.a: type = struct_type {.a: %i32} [template = constants.%struct_type.a] -// CHECK:STDOUT: %ptr.loc19_34: type = ptr_type %struct_type.a [template = constants.%ptr.2] -// CHECK:STDOUT: %Inner: type = class_type @Inner, @Inner(constants.%ptr.1, constants.%ptr.2) [template = constants.%Inner.2] // CHECK:STDOUT: %w.var: ref %Inner.2 = var w // CHECK:STDOUT: %w: ref %Inner.2 = bind_name w, %w.var // CHECK:STDOUT: } @@ -312,13 +292,6 @@ var g: E({.a = 1, .b = 2}) = {} as E({.a = 3, .b = 4} as D); // CHECK:STDOUT: %C.1: type = class_type @C, @C(%N.2) [symbolic] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] // CHECK:STDOUT: %complete_type.2: = complete_type_witness %empty_struct_type [template] -// CHECK:STDOUT: %int_123.1: Core.IntLiteral = int_value 123 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_123.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_123.2: %i32 = int_value 123 [template] // CHECK:STDOUT: %C.2: type = class_type @C, @C(%int_123.2) [template] // CHECK:STDOUT: } @@ -343,20 +316,13 @@ var g: E({.a = 1, .b = 2}) = {} as E({.a = 3, .b = 4} as D); // CHECK:STDOUT: %N.patt.loc4_9.1: %i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc4_9.2 (constants.%N.patt.2)] // CHECK:STDOUT: %N.param_patt: %i32 = value_param_pattern %N.patt.loc4_9.1, runtime_param [symbolic = %N.patt.loc4_9.2 (constants.%N.patt.2)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %N.param: %i32 = value_param runtime_param +// CHECK:STDOUT: %.loc4: type = splice_block %i32 [template = constants.%i32] { +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %N.loc4_9.1: %i32 = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc4_9.2 (constants.%N.2)] // CHECK:STDOUT: } -// CHECK:STDOUT: %C.ref: %C.type = name_ref C, %C.decl [template = constants.%C.generic] -// CHECK:STDOUT: %int_123: Core.IntLiteral = int_value 123 [template = constants.%int_123.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_123, %impl.elem0 [template = constants.%Convert.bound] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_123) [template = constants.%int_123.2] -// CHECK:STDOUT: %.loc13_13.1: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_123.2] -// CHECK:STDOUT: %.loc13_13.2: %i32 = converted %int_123, %.loc13_13.1 [template = constants.%int_123.2] -// CHECK:STDOUT: %C: type = class_type @C, @C(constants.%int_123.2) [template = constants.%C.2] // CHECK:STDOUT: %v.var: ref %C.2 = var v // CHECK:STDOUT: %v: ref %C.2 = bind_name v, %v.var // CHECK:STDOUT: } @@ -412,20 +378,11 @@ var g: E({.a = 1, .b = 2}) = {} as E({.a = 3, .b = 4} as D); // CHECK:STDOUT: %E: type = class_type @E, @E(%F) [symbolic] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] // CHECK:STDOUT: %complete_type.4: = complete_type_witness %empty_struct_type [template] -// CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %struct_type.a.b.2: type = struct_type {.a: Core.IntLiteral, .b: Core.IntLiteral} [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] // CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] -// CHECK:STDOUT: %D.val.1: %D = struct_value (%int_1.2, %int_2.2) [template] // CHECK:STDOUT: %int_3.1: Core.IntLiteral = int_value 3 [template] // CHECK:STDOUT: %int_4.1: Core.IntLiteral = int_value 4 [template] // CHECK:STDOUT: %Convert.bound.3: = bound_method %int_3.1, %Convert.10 [template] @@ -459,43 +416,16 @@ var g: E({.a = 1, .b = 2}) = {} as E({.a = 3, .b = 4} as D); // CHECK:STDOUT: %F.patt.loc9_9.1: %D = symbolic_binding_pattern F, 0 [symbolic = %F.patt.loc9_9.2 (constants.%F.patt)] // CHECK:STDOUT: %F.param_patt: %D = value_param_pattern %F.patt.loc9_9.1, runtime_param [symbolic = %F.patt.loc9_9.2 (constants.%F.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [template = constants.%D] // CHECK:STDOUT: %F.param: %D = value_param runtime_param +// CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [template = constants.%D] // CHECK:STDOUT: %F.loc9_9.1: %D = bind_symbolic_name F, 0, %F.param [symbolic = %F.loc9_9.2 (constants.%F)] // CHECK:STDOUT: } -// CHECK:STDOUT: %E.ref: %E.type = name_ref E, %E.decl [template = constants.%E.generic] -// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %.loc24_25.1: %struct_type.a.b.2 = struct_literal (%int_1, %int_2) -// CHECK:STDOUT: %impl.elem0.loc24_25.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc24_25.1: = bound_method %int_1, %impl.elem0.loc24_25.1 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc24_25.1: = specific_function %Convert.bound.loc24_25.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc24_25.1: init %i32 = call %Convert.specific_fn.loc24_25.1(%int_1) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc24_25.2: init %i32 = converted %int_1, %int.convert_checked.loc24_25.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc24_25.3: ref %D = temporary_storage -// CHECK:STDOUT: %.loc24_25.4: ref %i32 = class_element_access %.loc24_25.3, element0 -// CHECK:STDOUT: %.loc24_25.5: init %i32 = initialize_from %.loc24_25.2 to %.loc24_25.4 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc24_25.2: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc24_25.2: = bound_method %int_2, %impl.elem0.loc24_25.2 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc24_25.2: = specific_function %Convert.bound.loc24_25.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] -// CHECK:STDOUT: %int.convert_checked.loc24_25.2: init %i32 = call %Convert.specific_fn.loc24_25.2(%int_2) [template = constants.%int_2.2] -// CHECK:STDOUT: %.loc24_25.6: init %i32 = converted %int_2, %int.convert_checked.loc24_25.2 [template = constants.%int_2.2] -// CHECK:STDOUT: %.loc24_25.7: ref %i32 = class_element_access %.loc24_25.3, element1 -// CHECK:STDOUT: %.loc24_25.8: init %i32 = initialize_from %.loc24_25.6 to %.loc24_25.7 [template = constants.%int_2.2] -// CHECK:STDOUT: %.loc24_25.9: init %D = class_init (%.loc24_25.5, %.loc24_25.8), %.loc24_25.3 [template = constants.%D.val.1] -// CHECK:STDOUT: %.loc24_25.10: ref %D = temporary %.loc24_25.3, %.loc24_25.9 -// CHECK:STDOUT: %.loc24_26.1: ref %D = converted %.loc24_25.1, %.loc24_25.10 -// CHECK:STDOUT: %.loc24_26.2: %D = bind_value %.loc24_26.1 // CHECK:STDOUT: %g.var: ref = var g // CHECK:STDOUT: %g: ref = bind_name g, %g.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @D { -// CHECK:STDOUT: %int_32.loc5: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc5: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc5: %D.elem = field_decl a, element0 [template] -// CHECK:STDOUT: %int_32.loc6: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc6: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc6: %D.elem = field_decl b, element1 [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a.b.1 [template = constants.%complete_type.3] // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/generic_method.carbon b/toolchain/check/testdata/class/generic_method.carbon index 18b894325615d..5944b23dca7dd 100644 --- a/toolchain/check/testdata/class/generic_method.carbon +++ b/toolchain/check/testdata/class/generic_method.carbon @@ -60,12 +60,14 @@ fn Class(T:! type).F[self: Self](n: T) {} // CHECK:STDOUT: } { // CHECK:STDOUT: %T.param: type = value_param runtime_param // CHECK:STDOUT: %T.loc16: type = bind_symbolic_name T, 0, %T.param [symbolic = constants.%T] -// CHECK:STDOUT: %.loc16: type = specific_constant constants.%Class, @Class(constants.%T) [symbolic = constants.%Class] -// CHECK:STDOUT: %Self.ref.loc16: type = name_ref Self, %.loc16 [symbolic = constants.%Class] -// CHECK:STDOUT: %T.ref.loc16: type = name_ref T, %T.loc16 [symbolic = constants.%T] // CHECK:STDOUT: %self.param.loc16: %Class = value_param runtime_param0 +// CHECK:STDOUT: %.loc16_28.2: type = splice_block %Self.ref.loc16 [symbolic = constants.%Class] { +// CHECK:STDOUT: %.loc16_28.1: type = specific_constant constants.%Class, @Class(constants.%T) [symbolic = constants.%Class] +// CHECK:STDOUT: %Self.ref.loc16: type = name_ref Self, %.loc16_28.1 [symbolic = constants.%Class] +// CHECK:STDOUT: } // CHECK:STDOUT: %self.loc16: %Class = bind_name self, %self.param.loc16 // CHECK:STDOUT: %n.param.loc16: %T = value_param runtime_param1 +// CHECK:STDOUT: %T.ref.loc16: type = name_ref T, %T.loc16 [symbolic = constants.%T] // CHECK:STDOUT: %n.loc16: %T = bind_name n, %n.param.loc16 // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -84,7 +86,6 @@ fn Class(T:! type).F[self: Self](n: T) {} // CHECK:STDOUT: %complete_type.loc14_1.2: = complete_type_witness @Class.%struct_type.a (%struct_type.a) [symbolic = %complete_type.loc14_1.2 (constants.%complete_type)] // CHECK:STDOUT: // CHECK:STDOUT: class { -// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc11_13.1 [symbolic = %T.loc11_13.2 (constants.%T)] // CHECK:STDOUT: %.loc12: @Class.%Class.elem (%Class.elem) = field_decl a, element0 [template] // CHECK:STDOUT: %F.decl: @Class.%F.type (%F.type) = fn_decl @F [symbolic = @Class.%F (constants.%F)] { // CHECK:STDOUT: %self.patt: %Class = binding_pattern self @@ -92,12 +93,14 @@ fn Class(T:! type).F[self: Self](n: T) {} // CHECK:STDOUT: %n.patt: %T = binding_pattern n // CHECK:STDOUT: %n.param_patt: %T = value_param_pattern %n.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc13: type = specific_constant constants.%Class, @Class(constants.%T) [symbolic = %Class (constants.%Class)] -// CHECK:STDOUT: %Self.ref.loc13: type = name_ref Self, %.loc13 [symbolic = %Class (constants.%Class)] -// CHECK:STDOUT: %T.ref.loc13: type = name_ref T, @Class.%T.loc11_13.1 [symbolic = %T.loc13 (constants.%T)] // CHECK:STDOUT: %self.param.loc13: @F.%Class (%Class) = value_param runtime_param0 +// CHECK:STDOUT: %.loc13_14.2: type = splice_block %Self.ref.loc13 [symbolic = %Class (constants.%Class)] { +// CHECK:STDOUT: %.loc13_14.1: type = specific_constant constants.%Class, @Class(constants.%T) [symbolic = %Class (constants.%Class)] +// CHECK:STDOUT: %Self.ref.loc13: type = name_ref Self, %.loc13_14.1 [symbolic = %Class (constants.%Class)] +// CHECK:STDOUT: } // CHECK:STDOUT: %self.loc13: @F.%Class (%Class) = bind_name self, %self.param.loc13 // CHECK:STDOUT: %n.param.loc13: @F.%T.loc13 (%T) = value_param runtime_param1 +// CHECK:STDOUT: %T.ref.loc13: type = name_ref T, @Class.%T.loc11_13.1 [symbolic = %T.loc13 (constants.%T)] // CHECK:STDOUT: %n.loc13: @F.%T.loc13 (%T) = bind_name n, %n.param.loc13 // CHECK:STDOUT: } // CHECK:STDOUT: %complete_type.loc14_1.1: = complete_type_witness %struct_type.a [symbolic = %complete_type.loc14_1.2 (constants.%complete_type)] diff --git a/toolchain/check/testdata/class/import.carbon b/toolchain/check/testdata/class/import.carbon index 8dda32981715a..713eb12d0db6d 100644 --- a/toolchain/check/testdata/class/import.carbon +++ b/toolchain/check/testdata/class/import.carbon @@ -103,8 +103,6 @@ fn Run() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Field { -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc8: %Field.elem = field_decl x, element0 [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.x [template = constants.%complete_type.4] // CHECK:STDOUT: @@ -119,18 +117,20 @@ fn Run() { // CHECK:STDOUT: %self.patt: %ForwardDeclared = binding_pattern self // CHECK:STDOUT: %self.param_patt: %ForwardDeclared = value_param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%ForwardDeclared [template = constants.%ForwardDeclared] // CHECK:STDOUT: %self.param: %ForwardDeclared = value_param runtime_param0 +// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%ForwardDeclared [template = constants.%ForwardDeclared] // CHECK:STDOUT: %self: %ForwardDeclared = bind_name self, %self.param // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %self.patt: %ptr = binding_pattern self // CHECK:STDOUT: %self.param_patt: %ptr = value_param_pattern %self.patt, runtime_param0 -// CHECK:STDOUT: %.loc15: auto = addr_pattern %self.param_patt +// CHECK:STDOUT: %.loc15_8: auto = addr_pattern %self.param_patt // CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%ForwardDeclared [template = constants.%ForwardDeclared] -// CHECK:STDOUT: %ptr: type = ptr_type %ForwardDeclared [template = constants.%ptr] // CHECK:STDOUT: %self.param: %ptr = value_param runtime_param0 +// CHECK:STDOUT: %.loc15_23: type = splice_block %ptr [template = constants.%ptr] { +// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%ForwardDeclared [template = constants.%ForwardDeclared] +// CHECK:STDOUT: %ptr: type = ptr_type %ForwardDeclared [template = constants.%ptr] +// CHECK:STDOUT: } // CHECK:STDOUT: %self: %ptr = bind_name self, %self.param // CHECK:STDOUT: } // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.1] @@ -261,14 +261,12 @@ fn Run() { // CHECK:STDOUT: // CHECK:STDOUT: fn @Run() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Empty.ref: type = name_ref Empty, imports.%import_ref.1 [template = constants.%Empty] // CHECK:STDOUT: %a.var: ref %Empty = var a // CHECK:STDOUT: %a: ref %Empty = bind_name a, %a.var // CHECK:STDOUT: %.loc7_19.1: %empty_struct_type = struct_literal () // CHECK:STDOUT: %.loc7_19.2: init %Empty = class_init (), %a.var [template = constants.%Empty.val] // CHECK:STDOUT: %.loc7_20: init %Empty = converted %.loc7_19.1, %.loc7_19.2 [template = constants.%Empty.val] // CHECK:STDOUT: assign %a.var, %.loc7_20 -// CHECK:STDOUT: %Field.ref: type = name_ref Field, imports.%import_ref.2 [template = constants.%Field] // CHECK:STDOUT: %b.var: ref %Field = var b // CHECK:STDOUT: %b: ref %Field = bind_name b, %b.var // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] @@ -293,7 +291,6 @@ fn Run() { // CHECK:STDOUT: %int.convert_checked.loc10: init %i32 = call %Convert.specific_fn.loc10(%int_2) [template = constants.%int_2.2] // CHECK:STDOUT: %.loc10_7: init %i32 = converted %int_2, %int.convert_checked.loc10 [template = constants.%int_2.2] // CHECK:STDOUT: assign %.loc10_4, %.loc10_7 -// CHECK:STDOUT: %ForwardDeclared.ref.loc12: type = name_ref ForwardDeclared, imports.%import_ref.3 [template = constants.%ForwardDeclared.1] // CHECK:STDOUT: %c.var: ref %ForwardDeclared.1 = var c // CHECK:STDOUT: %c: ref %ForwardDeclared.1 = bind_name c, %c.var // CHECK:STDOUT: %.loc12_29.1: %empty_struct_type = struct_literal () @@ -310,15 +307,11 @@ fn Run() { // CHECK:STDOUT: %G.bound: = bound_method %c.ref.loc14, %G.ref // CHECK:STDOUT: %addr.loc14: %ptr.3 = addr_of %c.ref.loc14 // CHECK:STDOUT: %G.call: init %empty_tuple.type = call %G.bound(%addr.loc14) -// CHECK:STDOUT: %ForwardDeclared.ref.loc16: type = name_ref ForwardDeclared, imports.%import_ref.3 [template = constants.%ForwardDeclared.1] -// CHECK:STDOUT: %ptr.loc16: type = ptr_type %ForwardDeclared.1 [template = constants.%ptr.3] // CHECK:STDOUT: %d.var: ref %ptr.3 = var d // CHECK:STDOUT: %d: ref %ptr.3 = bind_name d, %d.var // CHECK:STDOUT: %c.ref.loc16: ref %ForwardDeclared.1 = name_ref c, %c // CHECK:STDOUT: %addr.loc16: %ptr.3 = addr_of %c.ref.loc16 // CHECK:STDOUT: assign %d.var, %addr.loc16 -// CHECK:STDOUT: %Incomplete.ref: type = name_ref Incomplete, imports.%import_ref.4 [template = constants.%Incomplete] -// CHECK:STDOUT: %ptr.loc18: type = ptr_type %Incomplete [template = constants.%ptr.4] // CHECK:STDOUT: %e.var: ref %ptr.4 = var e // CHECK:STDOUT: %e: ref %ptr.4 = bind_name e, %e.var // CHECK:STDOUT: return diff --git a/toolchain/check/testdata/class/import_base.carbon b/toolchain/check/testdata/class/import_base.carbon index 25c1c062f52c1..ec5e98eb4aa42 100644 --- a/toolchain/check/testdata/class/import_base.carbon +++ b/toolchain/check/testdata/class/import_base.carbon @@ -79,23 +79,19 @@ fn Run() { // CHECK:STDOUT: %self.patt: %Base = binding_pattern self // CHECK:STDOUT: %self.param_patt: %Base = value_param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Base [template = constants.%Base] // CHECK:STDOUT: %self.param: %Base = value_param runtime_param0 +// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Base [template = constants.%Base] // CHECK:STDOUT: %self: %Base = bind_name self, %self.param // CHECK:STDOUT: } // CHECK:STDOUT: %Unused.decl: %Unused.type = fn_decl @Unused [template = constants.%Unused] { // CHECK:STDOUT: %self.patt: %Base = binding_pattern self // CHECK:STDOUT: %self.param_patt: %Base = value_param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Base [template = constants.%Base] // CHECK:STDOUT: %self.param: %Base = value_param runtime_param0 +// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Base [template = constants.%Base] // CHECK:STDOUT: %self: %Base = bind_name self, %self.param // CHECK:STDOUT: } -// CHECK:STDOUT: %int_32.loc8: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc8: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc8: %Base.elem = field_decl x, element0 [template] -// CHECK:STDOUT: %int_32.loc9: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc9: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc9: %Base.elem = field_decl unused, element1 [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.x.unused [template = constants.%complete_type.3] // CHECK:STDOUT: @@ -215,7 +211,6 @@ fn Run() { // CHECK:STDOUT: // CHECK:STDOUT: fn @Run() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Child.ref: type = name_ref Child, imports.%import_ref.2 [template = constants.%Child] // CHECK:STDOUT: %a.var: ref %Child = var a // CHECK:STDOUT: %a: ref %Child = bind_name a, %a.var // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] diff --git a/toolchain/check/testdata/class/import_indirect.carbon b/toolchain/check/testdata/class/import_indirect.carbon index 8d1b4c744db48..543b8f626471e 100644 --- a/toolchain/check/testdata/class/import_indirect.carbon +++ b/toolchain/check/testdata/class/import_indirect.carbon @@ -162,13 +162,10 @@ var ptr: E* = &val; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %C.ref.loc6: type = name_ref C, imports.%import_ref.1 [template = constants.%C] +// CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %D: type = bind_alias D, imports.%import_ref.1 [template = constants.%C] -// CHECK:STDOUT: %C.ref.loc8: type = name_ref C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %b_val.var: ref %C = var b_val // CHECK:STDOUT: %b_val: ref %C = bind_name b_val, %b_val.var -// CHECK:STDOUT: %D.ref: type = name_ref D, %D [template = constants.%C] -// CHECK:STDOUT: %ptr: type = ptr_type %C [template = constants.%ptr.2] // CHECK:STDOUT: %b_ptr.var: ref %ptr.2 = var b_ptr // CHECK:STDOUT: %b_ptr: ref %ptr.2 = bind_name b_ptr, %b_ptr.var // CHECK:STDOUT: } @@ -221,13 +218,10 @@ var ptr: E* = &val; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %C.ref.loc6: type = name_ref C, imports.%import_ref.1 [template = constants.%C] +// CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %E: type = bind_alias E, imports.%import_ref.1 [template = constants.%C] -// CHECK:STDOUT: %C.ref.loc8: type = name_ref C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %c_val.var: ref %C = var c_val // CHECK:STDOUT: %c_val: ref %C = bind_name c_val, %c_val.var -// CHECK:STDOUT: %E.ref: type = name_ref E, %E [template = constants.%C] -// CHECK:STDOUT: %ptr: type = ptr_type %C [template = constants.%ptr.2] // CHECK:STDOUT: %c_ptr.var: ref %ptr.2 = var c_ptr // CHECK:STDOUT: %c_ptr: ref %ptr.2 = bind_name c_ptr, %c_ptr.var // CHECK:STDOUT: } @@ -281,17 +275,14 @@ var ptr: E* = &val; // CHECK:STDOUT: .b_ptr = imports.%import_ref.4 // CHECK:STDOUT: .Core = imports.%Core // CHECK:STDOUT: .val = %val -// CHECK:STDOUT: .ptr = %ptr.loc8_5 +// CHECK:STDOUT: .ptr = %ptr // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %val.var: ref %C = var val // CHECK:STDOUT: %val: ref %C = bind_name val, %val.var -// CHECK:STDOUT: %D.ref: type = name_ref D, imports.%import_ref.2 [template = constants.%C] -// CHECK:STDOUT: %ptr.loc8_11: type = ptr_type %C [template = constants.%ptr.2] // CHECK:STDOUT: %ptr.var: ref %ptr.2 = var ptr -// CHECK:STDOUT: %ptr.loc8_5: ref %ptr.2 = bind_name ptr, %ptr.var +// CHECK:STDOUT: %ptr: ref %ptr.2 = bind_name ptr, %ptr.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C [from "a.carbon"] { @@ -343,17 +334,14 @@ var ptr: E* = &val; // CHECK:STDOUT: .C = imports.%import_ref.4 // CHECK:STDOUT: .Core = imports.%Core // CHECK:STDOUT: .val = %val -// CHECK:STDOUT: .ptr = %ptr.loc8_5 +// CHECK:STDOUT: .ptr = %ptr // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.4 [template = constants.%C] // CHECK:STDOUT: %val.var: ref %C = var val // CHECK:STDOUT: %val: ref %C = bind_name val, %val.var -// CHECK:STDOUT: %D.ref: type = name_ref D, imports.%import_ref.1 [template = constants.%C] -// CHECK:STDOUT: %ptr.loc8_11: type = ptr_type %C [template = constants.%ptr.2] // CHECK:STDOUT: %ptr.var: ref %ptr.2 = var ptr -// CHECK:STDOUT: %ptr.loc8_5: ref %ptr.2 = bind_name ptr, %ptr.var +// CHECK:STDOUT: %ptr: ref %ptr.2 = bind_name ptr, %ptr.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C [from "a.carbon"] { @@ -409,17 +397,14 @@ var ptr: E* = &val; // CHECK:STDOUT: .c_ptr = imports.%import_ref.6 // CHECK:STDOUT: .Core = imports.%Core // CHECK:STDOUT: .val = %val -// CHECK:STDOUT: .ptr = %ptr.loc8_5 +// CHECK:STDOUT: .ptr = %ptr // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %D.ref: type = name_ref D, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %val.var: ref %C = var val // CHECK:STDOUT: %val: ref %C = bind_name val, %val.var -// CHECK:STDOUT: %E.ref: type = name_ref E, imports.%import_ref.4 [template = constants.%C] -// CHECK:STDOUT: %ptr.loc8_11: type = ptr_type %C [template = constants.%ptr.2] // CHECK:STDOUT: %ptr.var: ref %ptr.2 = var ptr -// CHECK:STDOUT: %ptr.loc8_5: ref %ptr.2 = bind_name ptr, %ptr.var +// CHECK:STDOUT: %ptr: ref %ptr.2 = bind_name ptr, %ptr.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C [from "b.carbon"] { @@ -475,17 +460,14 @@ var ptr: E* = &val; // CHECK:STDOUT: .b_ptr = imports.%import_ref.6 // CHECK:STDOUT: .Core = imports.%Core // CHECK:STDOUT: .val = %val -// CHECK:STDOUT: .ptr = %ptr.loc8_5 +// CHECK:STDOUT: .ptr = %ptr // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %D.ref: type = name_ref D, imports.%import_ref.4 [template = constants.%C] // CHECK:STDOUT: %val.var: ref %C = var val // CHECK:STDOUT: %val: ref %C = bind_name val, %val.var -// CHECK:STDOUT: %E.ref: type = name_ref E, imports.%import_ref.1 [template = constants.%C] -// CHECK:STDOUT: %ptr.loc8_11: type = ptr_type %C [template = constants.%ptr.2] // CHECK:STDOUT: %ptr.var: ref %ptr.2 = var ptr -// CHECK:STDOUT: %ptr.loc8_5: ref %ptr.2 = bind_name ptr, %ptr.var +// CHECK:STDOUT: %ptr: ref %ptr.2 = bind_name ptr, %ptr.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C [from "b.carbon"] { diff --git a/toolchain/check/testdata/class/import_member_cycle.carbon b/toolchain/check/testdata/class/import_member_cycle.carbon index ddf0929ac804d..091f67709c82f 100644 --- a/toolchain/check/testdata/class/import_member_cycle.carbon +++ b/toolchain/check/testdata/class/import_member_cycle.carbon @@ -53,8 +53,6 @@ fn Run() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Cycle { -// CHECK:STDOUT: %Cycle.ref: type = name_ref Cycle, file.%Cycle.decl [template = constants.%Cycle] -// CHECK:STDOUT: %ptr: type = ptr_type %Cycle [template = constants.%ptr] // CHECK:STDOUT: %.loc5: %Cycle.elem = field_decl a, element0 [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a [template = constants.%complete_type] // CHECK:STDOUT: @@ -106,8 +104,6 @@ fn Run() { // CHECK:STDOUT: // CHECK:STDOUT: fn @Run() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Cycle.ref: type = name_ref Cycle, imports.%import_ref.1 [template = constants.%Cycle] -// CHECK:STDOUT: %ptr: type = ptr_type %Cycle [template = constants.%ptr] // CHECK:STDOUT: %a.var: ref %ptr = var a // CHECK:STDOUT: %a: ref %ptr = bind_name a, %a.var // CHECK:STDOUT: return diff --git a/toolchain/check/testdata/class/import_struct_cyle.carbon b/toolchain/check/testdata/class/import_struct_cyle.carbon index c4abd2475b5e5..f095db044631c 100644 --- a/toolchain/check/testdata/class/import_struct_cyle.carbon +++ b/toolchain/check/testdata/class/import_struct_cyle.carbon @@ -57,18 +57,12 @@ fn Run() { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Cycle.decl.loc4: type = class_decl @Cycle [template = constants.%Cycle] {} {} -// CHECK:STDOUT: %Cycle.ref: type = name_ref Cycle, %Cycle.decl.loc4 [template = constants.%Cycle] -// CHECK:STDOUT: %ptr: type = ptr_type %Cycle [template = constants.%ptr] -// CHECK:STDOUT: %struct_type.b: type = struct_type {.b: %ptr} [template = constants.%struct_type.b] // CHECK:STDOUT: %a.var: ref %struct_type.b = var a // CHECK:STDOUT: %a: ref %struct_type.b = bind_name a, %a.var // CHECK:STDOUT: %Cycle.decl.loc8: type = class_decl @Cycle [template = constants.%Cycle] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Cycle { -// CHECK:STDOUT: %Cycle.ref: type = name_ref Cycle, file.%Cycle.decl.loc4 [template = constants.%Cycle] -// CHECK:STDOUT: %ptr: type = ptr_type %Cycle [template = constants.%ptr] -// CHECK:STDOUT: %struct_type.b: type = struct_type {.b: %ptr} [template = constants.%struct_type.b] // CHECK:STDOUT: %.loc10: %Cycle.elem = field_decl c, element0 [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.c [template = constants.%complete_type] // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/inheritance_access.carbon b/toolchain/check/testdata/class/inheritance_access.carbon index 3e6157e419e1f..cfc02546cd711 100644 --- a/toolchain/check/testdata/class/inheritance_access.carbon +++ b/toolchain/check/testdata/class/inheritance_access.carbon @@ -265,11 +265,7 @@ class B { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Shape { -// CHECK:STDOUT: %int_32.loc5: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc5: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc5: %Shape.elem = field_decl x, element0 [template] -// CHECK:STDOUT: %int_32.loc6: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc6: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc6: %Shape.elem = field_decl y, element1 [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.x.y [template = constants.%complete_type.3] // CHECK:STDOUT: @@ -289,7 +285,6 @@ class B { // CHECK:STDOUT: %return.patt: %tuple.type.2 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %tuple.type.2 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Circle [template = constants.%Circle] // CHECK:STDOUT: %int_32.loc12_36: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc12_36: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc12_41: Core.IntLiteral = int_value 32 [template = constants.%int_32] @@ -297,6 +292,7 @@ class B { // CHECK:STDOUT: %.loc12_44.1: %tuple.type.1 = tuple_literal (%i32.loc12_36, %i32.loc12_41) // CHECK:STDOUT: %.loc12_44.2: type = converted %.loc12_44.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %self.param: %Circle = value_param runtime_param0 +// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Circle [template = constants.%Circle] // CHECK:STDOUT: %self: %Circle = bind_name self, %self.param // CHECK:STDOUT: %return.param: ref %tuple.type.2 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %tuple.type.2 = return_slot %return.param @@ -423,10 +419,10 @@ class B { // CHECK:STDOUT: %return.patt: %empty_tuple.type = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %empty_tuple.type = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C [template = constants.%C] // CHECK:STDOUT: %.loc15_26.1: %empty_tuple.type = tuple_literal () // CHECK:STDOUT: %.loc15_26.2: type = converted %.loc15_26.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %self.param: %C = value_param runtime_param0 +// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C [template = constants.%C] // CHECK:STDOUT: %self: %C = bind_name self, %self.param // CHECK:STDOUT: %return.param: ref %empty_tuple.type = out_param runtime_param1 // CHECK:STDOUT: %return: ref %empty_tuple.type = return_slot %return.param @@ -506,8 +502,6 @@ class B { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @A { -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_5: Core.IntLiteral = int_value 5 [template = constants.%int_5.1] // CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_5, %impl.elem0 [template = constants.%Convert.bound] @@ -632,8 +626,6 @@ class B { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Shape { -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc5: %Shape.elem = field_decl y, element0 [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.y [template = constants.%complete_type.3] // CHECK:STDOUT: @@ -652,10 +644,10 @@ class B { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Square [template = constants.%Square] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %self.param: %Square = value_param runtime_param0 +// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Square [template = constants.%Square] // CHECK:STDOUT: %self: %Square = bind_name self, %self.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -977,8 +969,6 @@ class B { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @A { -// CHECK:STDOUT: %int_32.loc5: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc5: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_5.loc5: Core.IntLiteral = int_value 5 [template = constants.%int_5.1] // CHECK:STDOUT: %impl.elem0.loc5: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc5: = bound_method %int_5.loc5, %impl.elem0.loc5 [template = constants.%Convert.bound] @@ -987,8 +977,6 @@ class B { // CHECK:STDOUT: %.loc5_49.1: %i32 = value_of_initializer %int.convert_checked.loc5 [template = constants.%int_5.2] // CHECK:STDOUT: %.loc5_49.2: %i32 = converted %int_5.loc5, %.loc5_49.1 [template = constants.%int_5.2] // CHECK:STDOUT: %SOME_PROTECTED_CONSTANT: %i32 = bind_name SOME_PROTECTED_CONSTANT, %.loc5_49.2 -// CHECK:STDOUT: %int_32.loc6: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc6: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_5.loc6: Core.IntLiteral = int_value 5 [template = constants.%int_5.1] // CHECK:STDOUT: %impl.elem0.loc6: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc6: = bound_method %int_5.loc6, %impl.elem0.loc6 [template = constants.%Convert.bound] @@ -1007,8 +995,6 @@ class B { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Internal { -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_5: Core.IntLiteral = int_value 5 [template = constants.%int_5.1] // CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_5, %impl.elem0 [template = constants.%Convert.bound] @@ -1026,7 +1012,6 @@ class B { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @B { -// CHECK:STDOUT: %Internal.ref: type = name_ref Internal, file.%Internal.decl [template = constants.%Internal] // CHECK:STDOUT: %.loc14: %B.elem = field_decl internal, element0 [template] // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern @@ -1043,10 +1028,10 @@ class B { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%B [template = constants.%B] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %self.param: %B = value_param runtime_param0 +// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%B [template = constants.%B] // CHECK:STDOUT: %self: %B = bind_name self, %self.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -1117,8 +1102,6 @@ class B { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @A { -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc5: %A.elem = field_decl x, element0 [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.x [template = constants.%complete_type.3] // CHECK:STDOUT: @@ -1135,8 +1118,8 @@ class B { // CHECK:STDOUT: %self.patt: %B = binding_pattern self // CHECK:STDOUT: %self.param_patt: %B = value_param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%B [template = constants.%B] // CHECK:STDOUT: %self.param: %B = value_param runtime_param0 +// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%B [template = constants.%B] // CHECK:STDOUT: %self: %B = bind_name self, %self.param // CHECK:STDOUT: } // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.base.1 [template = constants.%complete_type.4] @@ -1194,8 +1177,6 @@ class B { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @A { -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc5: %A.elem = field_decl x, element0 [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.x [template = constants.%complete_type.3] // CHECK:STDOUT: @@ -1212,8 +1193,8 @@ class B { // CHECK:STDOUT: %self.patt: %B = binding_pattern self // CHECK:STDOUT: %self.param_patt: %B = value_param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%B [template = constants.%B] // CHECK:STDOUT: %self.param: %B = value_param runtime_param0 +// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%B [template = constants.%B] // CHECK:STDOUT: %self: %B = bind_name self, %self.param // CHECK:STDOUT: } // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.base.1 [template = constants.%complete_type.4] diff --git a/toolchain/check/testdata/class/init.carbon b/toolchain/check/testdata/class/init.carbon index 4864e383294a5..37309376670dd 100644 --- a/toolchain/check/testdata/class/init.carbon +++ b/toolchain/check/testdata/class/init.carbon @@ -64,14 +64,18 @@ fn MakeReorder(n: i32, next: Class*) -> Class { // CHECK:STDOUT: %return.patt: %Class = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %Class = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %Class.ref.loc16_23: type = name_ref Class, file.%Class.decl [template = constants.%Class] -// CHECK:STDOUT: %ptr: type = ptr_type %Class [template = constants.%ptr.1] // CHECK:STDOUT: %Class.ref.loc16_34: type = name_ref Class, file.%Class.decl [template = constants.%Class] // CHECK:STDOUT: %n.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc16_12: type = splice_block %i32 [template = constants.%i32] { +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %n: %i32 = bind_name n, %n.param // CHECK:STDOUT: %next.param: %ptr.1 = value_param runtime_param1 +// CHECK:STDOUT: %.loc16_28: type = splice_block %ptr [template = constants.%ptr.1] { +// CHECK:STDOUT: %Class.ref.loc16_23: type = name_ref Class, file.%Class.decl [template = constants.%Class] +// CHECK:STDOUT: %ptr: type = ptr_type %Class [template = constants.%ptr.1] +// CHECK:STDOUT: } // CHECK:STDOUT: %next: %ptr.1 = bind_name next, %next.param // CHECK:STDOUT: %return.param: ref %Class = out_param runtime_param2 // CHECK:STDOUT: %return: ref %Class = return_slot %return.param @@ -84,14 +88,18 @@ fn MakeReorder(n: i32, next: Class*) -> Class { // CHECK:STDOUT: %return.patt: %Class = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %Class = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %Class.ref.loc20_30: type = name_ref Class, file.%Class.decl [template = constants.%Class] -// CHECK:STDOUT: %ptr: type = ptr_type %Class [template = constants.%ptr.1] // CHECK:STDOUT: %Class.ref.loc20_41: type = name_ref Class, file.%Class.decl [template = constants.%Class] // CHECK:STDOUT: %n.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc20_19: type = splice_block %i32 [template = constants.%i32] { +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %n: %i32 = bind_name n, %n.param // CHECK:STDOUT: %next.param: %ptr.1 = value_param runtime_param1 +// CHECK:STDOUT: %.loc20_35: type = splice_block %ptr [template = constants.%ptr.1] { +// CHECK:STDOUT: %Class.ref.loc20_30: type = name_ref Class, file.%Class.decl [template = constants.%Class] +// CHECK:STDOUT: %ptr: type = ptr_type %Class [template = constants.%ptr.1] +// CHECK:STDOUT: } // CHECK:STDOUT: %next: %ptr.1 = bind_name next, %next.param // CHECK:STDOUT: %return.param: ref %Class = out_param runtime_param2 // CHECK:STDOUT: %return: ref %Class = return_slot %return.param @@ -99,11 +107,7 @@ fn MakeReorder(n: i32, next: Class*) -> Class { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Class { -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc12: %Class.elem.1 = field_decl n, element0 [template] -// CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class] -// CHECK:STDOUT: %ptr: type = ptr_type %Class [template = constants.%ptr.1] // CHECK:STDOUT: %.loc13: %Class.elem.2 = field_decl next, element1 [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.n.next [template = constants.%complete_type.3] // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/init_as.carbon b/toolchain/check/testdata/class/init_as.carbon index ae17bfe7c386e..ab74464177900 100644 --- a/toolchain/check/testdata/class/init_as.carbon +++ b/toolchain/check/testdata/class/init_as.carbon @@ -73,11 +73,7 @@ fn F() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Class { -// CHECK:STDOUT: %int_32.loc12: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc12: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc12: %Class.elem = field_decl a, element0 [template] -// CHECK:STDOUT: %int_32.loc13: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc13: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc13: %Class.elem = field_decl b, element1 [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a.b.1 [template = constants.%complete_type.3] // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/init_nested.carbon b/toolchain/check/testdata/class/init_nested.carbon index 921120aabeabf..27268658e03a9 100644 --- a/toolchain/check/testdata/class/init_nested.carbon +++ b/toolchain/check/testdata/class/init_nested.carbon @@ -81,11 +81,7 @@ fn MakeOuter() -> Outer { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Inner { -// CHECK:STDOUT: %int_32.loc12: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc12: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc12: %Inner.elem = field_decl a, element0 [template] -// CHECK:STDOUT: %int_32.loc13: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc13: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc13: %Inner.elem = field_decl b, element1 [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a.b [template = constants.%complete_type.3] // CHECK:STDOUT: @@ -97,9 +93,7 @@ fn MakeOuter() -> Outer { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Outer { -// CHECK:STDOUT: %Inner.ref.loc19: type = name_ref Inner, file.%Inner.decl [template = constants.%Inner] // CHECK:STDOUT: %.loc19: %Outer.elem = field_decl c, element0 [template] -// CHECK:STDOUT: %Inner.ref.loc20: type = name_ref Inner, file.%Inner.decl [template = constants.%Inner] // CHECK:STDOUT: %.loc20: %Outer.elem = field_decl d, element1 [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.c.d.1 [template = constants.%complete_type.4] // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/method.carbon b/toolchain/check/testdata/class/method.carbon index da12f212d428e..410af5e3a8488 100644 --- a/toolchain/check/testdata/class/method.carbon +++ b/toolchain/check/testdata/class/method.carbon @@ -133,10 +133,10 @@ fn CallGOnInitializingExpr() -> i32 { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref.loc20: type = name_ref Self, constants.%Class [template = constants.%Class] // CHECK:STDOUT: %int_32.loc20: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc20: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %self.param.loc20: %Class = value_param runtime_param0 +// CHECK:STDOUT: %Self.ref.loc20: type = name_ref Self, constants.%Class [template = constants.%Class] // CHECK:STDOUT: %self.loc20: %Class = bind_name self, %self.param.loc20 // CHECK:STDOUT: %return.param.loc20: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return.loc20: ref %i32 = return_slot %return.param.loc20 @@ -147,10 +147,10 @@ fn CallGOnInitializingExpr() -> i32 { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %c.param: %Class = value_param runtime_param0 +// CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class] // CHECK:STDOUT: %c: %Class = bind_name c, %c.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -161,10 +161,10 @@ fn CallGOnInitializingExpr() -> i32 { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %c.param: %Class = value_param runtime_param0 +// CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class] // CHECK:STDOUT: %c: %Class = bind_name c, %c.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -193,11 +193,13 @@ fn CallGOnInitializingExpr() -> i32 { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class] -// CHECK:STDOUT: %ptr: type = ptr_type %Class [template = constants.%ptr.1] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %p.param: %ptr.1 = value_param runtime_param0 +// CHECK:STDOUT: %.loc43: type = splice_block %ptr [template = constants.%ptr.1] { +// CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class] +// CHECK:STDOUT: %ptr: type = ptr_type %Class [template = constants.%ptr.1] +// CHECK:STDOUT: } // CHECK:STDOUT: %p: %ptr.1 = bind_name p, %p.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -208,11 +210,13 @@ fn CallGOnInitializingExpr() -> i32 { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class] -// CHECK:STDOUT: %ptr: type = ptr_type %Class [template = constants.%ptr.1] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %p.param: %ptr.1 = value_param runtime_param0 +// CHECK:STDOUT: %.loc47: type = splice_block %ptr [template = constants.%ptr.1] { +// CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class] +// CHECK:STDOUT: %ptr: type = ptr_type %Class [template = constants.%ptr.1] +// CHECK:STDOUT: } // CHECK:STDOUT: %p: %ptr.1 = bind_name p, %p.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -252,10 +256,10 @@ fn CallGOnInitializingExpr() -> i32 { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref.loc12: type = name_ref Self, constants.%Class [template = constants.%Class] // CHECK:STDOUT: %int_32.loc12: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc12: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %self.param.loc12: %Class = value_param runtime_param0 +// CHECK:STDOUT: %Self.ref.loc12: type = name_ref Self, constants.%Class [template = constants.%Class] // CHECK:STDOUT: %self.loc12: %Class = bind_name self, %self.param.loc12 // CHECK:STDOUT: %return.param.loc12: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return.loc12: ref %i32 = return_slot %return.param.loc12 @@ -263,23 +267,23 @@ fn CallGOnInitializingExpr() -> i32 { // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %self.patt: %ptr.1 = binding_pattern self // CHECK:STDOUT: %self.param_patt: %ptr.1 = value_param_pattern %self.patt, runtime_param0 -// CHECK:STDOUT: %.loc13: auto = addr_pattern %self.param_patt +// CHECK:STDOUT: %.loc13_8: auto = addr_pattern %self.param_patt // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Class [template = constants.%Class] -// CHECK:STDOUT: %ptr: type = ptr_type %Class [template = constants.%ptr.1] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %self.param: %ptr.1 = value_param runtime_param0 +// CHECK:STDOUT: %.loc13_23: type = splice_block %ptr [template = constants.%ptr.1] { +// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Class [template = constants.%Class] +// CHECK:STDOUT: %ptr: type = ptr_type %Class [template = constants.%ptr.1] +// CHECK:STDOUT: } // CHECK:STDOUT: %self: %ptr.1 = bind_name self, %self.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %F.ref: %F.type = name_ref F, %F.decl [template = constants.%F] // CHECK:STDOUT: %A: %F.type = bind_alias A, %F.decl [template = constants.%F] -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc17: %Class.elem = field_decl k, element0 [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.k.1 [template = constants.%complete_type.3] // CHECK:STDOUT: @@ -352,7 +356,6 @@ fn CallGOnInitializingExpr() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: fn @CallWithAddr() -> %i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class] // CHECK:STDOUT: %c.var: ref %Class = var c // CHECK:STDOUT: %c: ref %Class = bind_name c, %c.var // CHECK:STDOUT: %c.ref: ref %Class = name_ref c, %c diff --git a/toolchain/check/testdata/class/nested.carbon b/toolchain/check/testdata/class/nested.carbon index 2693c4c10a232..a865fc3547a42 100644 --- a/toolchain/check/testdata/class/nested.carbon +++ b/toolchain/check/testdata/class/nested.carbon @@ -93,9 +93,11 @@ fn F(a: Outer*) { // CHECK:STDOUT: %a.patt: %ptr.2 = binding_pattern a // CHECK:STDOUT: %a.param_patt: %ptr.2 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Outer.ref.loc41: type = name_ref Outer, file.%Outer.decl [template = constants.%Outer] -// CHECK:STDOUT: %ptr.loc41: type = ptr_type %Outer [template = constants.%ptr.2] // CHECK:STDOUT: %a.param: %ptr.2 = value_param runtime_param0 +// CHECK:STDOUT: %.loc41: type = splice_block %ptr [template = constants.%ptr.2] { +// CHECK:STDOUT: %Outer.ref: type = name_ref Outer, file.%Outer.decl [template = constants.%Outer] +// CHECK:STDOUT: %ptr: type = ptr_type %Outer [template = constants.%ptr.2] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %ptr.2 = bind_name a, %a.param // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -104,14 +106,8 @@ fn F(a: Outer*) { // CHECK:STDOUT: %F.decl: %F.type.1 = fn_decl @F.1 [template = constants.%F.1] {} {} // CHECK:STDOUT: %Inner.decl: type = class_decl @Inner [template = constants.%Inner] {} {} // CHECK:STDOUT: %H.decl: %H.type = fn_decl @H [template = constants.%H] {} {} -// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Outer [template = constants.%Outer] -// CHECK:STDOUT: %ptr.loc36: type = ptr_type %Outer [template = constants.%ptr.2] // CHECK:STDOUT: %.loc36: %Outer.elem.1 = field_decl po, element0 [template] -// CHECK:STDOUT: %Outer.ref: type = name_ref Outer, file.%Outer.decl [template = constants.%Outer] -// CHECK:STDOUT: %ptr.loc37: type = ptr_type %Outer [template = constants.%ptr.2] // CHECK:STDOUT: %.loc37: %Outer.elem.1 = field_decl qo, element1 [template] -// CHECK:STDOUT: %Inner.ref: type = name_ref Inner, %Inner.decl [template = constants.%Inner] -// CHECK:STDOUT: %ptr.loc38: type = ptr_type %Inner [template = constants.%ptr.1] // CHECK:STDOUT: %.loc38: %Outer.elem.2 = field_decl pi, element2 [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.po.qo.pi [template = constants.%complete_type.2] // CHECK:STDOUT: @@ -127,14 +123,8 @@ fn F(a: Outer*) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Inner { -// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Inner [template = constants.%Inner] -// CHECK:STDOUT: %ptr.loc19: type = ptr_type %Inner [template = constants.%ptr.1] // CHECK:STDOUT: %.loc19: %Inner.elem.1 = field_decl pi, element0 [template] -// CHECK:STDOUT: %Outer.ref: type = name_ref Outer, file.%Outer.decl [template = constants.%Outer] -// CHECK:STDOUT: %ptr.loc20: type = ptr_type %Outer [template = constants.%ptr.2] // CHECK:STDOUT: %.loc20: %Inner.elem.2 = field_decl po, element1 [template] -// CHECK:STDOUT: %Inner.ref: type = name_ref Inner, @Outer.%Inner.decl [template = constants.%Inner] -// CHECK:STDOUT: %ptr.loc21: type = ptr_type %Inner [template = constants.%ptr.1] // CHECK:STDOUT: %.loc21: %Inner.elem.1 = field_decl qi, element2 [template] // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] {} {} // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.pi.po.qi [template = constants.%complete_type.1] @@ -150,10 +140,8 @@ fn F(a: Outer*) { // CHECK:STDOUT: // CHECK:STDOUT: fn @F.1() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Outer.ref: type = name_ref Outer, file.%Outer.decl [template = constants.%Outer] // CHECK:STDOUT: %o.var: ref %Outer = var o // CHECK:STDOUT: %o: ref %Outer = bind_name o, %o.var -// CHECK:STDOUT: %Inner.ref: type = name_ref Inner, @Outer.%Inner.decl [template = constants.%Inner] // CHECK:STDOUT: %i.var: ref %Inner = var i // CHECK:STDOUT: %i: ref %Inner = bind_name i, %i.var // CHECK:STDOUT: return @@ -161,10 +149,8 @@ fn F(a: Outer*) { // CHECK:STDOUT: // CHECK:STDOUT: fn @G() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Outer.ref: type = name_ref Outer, file.%Outer.decl [template = constants.%Outer] // CHECK:STDOUT: %o.var: ref %Outer = var o // CHECK:STDOUT: %o: ref %Outer = bind_name o, %o.var -// CHECK:STDOUT: %Inner.ref: type = name_ref Inner, @Outer.%Inner.decl [template = constants.%Inner] // CHECK:STDOUT: %i.var: ref %Inner = var i // CHECK:STDOUT: %i: ref %Inner = bind_name i, %i.var // CHECK:STDOUT: return @@ -172,10 +158,8 @@ fn F(a: Outer*) { // CHECK:STDOUT: // CHECK:STDOUT: fn @H() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Outer.ref: type = name_ref Outer, file.%Outer.decl [template = constants.%Outer] // CHECK:STDOUT: %o.var: ref %Outer = var o // CHECK:STDOUT: %o: ref %Outer = bind_name o, %o.var -// CHECK:STDOUT: %Inner.ref: type = name_ref Inner, @Outer.%Inner.decl [template = constants.%Inner] // CHECK:STDOUT: %i.var: ref %Inner = var i // CHECK:STDOUT: %i: ref %Inner = bind_name i, %i.var // CHECK:STDOUT: return @@ -183,9 +167,6 @@ fn F(a: Outer*) { // CHECK:STDOUT: // CHECK:STDOUT: fn @F.2(%a.param_patt: %ptr.2) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Outer.ref.loc42: type = name_ref Outer, file.%Outer.decl [template = constants.%Outer] -// CHECK:STDOUT: %Inner.ref: type = name_ref Inner, @Outer.%Inner.decl [template = constants.%Inner] -// CHECK:STDOUT: %ptr.loc42: type = ptr_type %Inner [template = constants.%ptr.1] // CHECK:STDOUT: %a.ref.loc42: %ptr.2 = name_ref a, %a // CHECK:STDOUT: %.loc42_26: ref %Outer = deref %a.ref.loc42 // CHECK:STDOUT: %pi.ref.loc42: %Outer.elem.2 = name_ref pi, @Outer.%.loc38 [template = @Outer.%.loc38] diff --git a/toolchain/check/testdata/class/nested_name.carbon b/toolchain/check/testdata/class/nested_name.carbon index 3c30950e6d657..342fc4c135d43 100644 --- a/toolchain/check/testdata/class/nested_name.carbon +++ b/toolchain/check/testdata/class/nested_name.carbon @@ -63,11 +63,13 @@ fn G(o: Outer) { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Outer.ref: type = name_ref Outer, file.%Outer.decl [template = constants.%Outer] -// CHECK:STDOUT: %Inner.ref: type = name_ref Inner, @Outer.%Inner.decl [template = constants.%Inner] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %oi.param: %Inner = value_param runtime_param0 +// CHECK:STDOUT: %.loc17: type = splice_block %Inner.ref [template = constants.%Inner] { +// CHECK:STDOUT: %Outer.ref: type = name_ref Outer, file.%Outer.decl [template = constants.%Outer] +// CHECK:STDOUT: %Inner.ref: type = name_ref Inner, @Outer.%Inner.decl [template = constants.%Inner] +// CHECK:STDOUT: } // CHECK:STDOUT: %oi: %Inner = bind_name oi, %oi.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -76,8 +78,8 @@ fn G(o: Outer) { // CHECK:STDOUT: %o.patt: %Outer = binding_pattern o // CHECK:STDOUT: %o.param_patt: %Outer = value_param_pattern %o.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Outer.ref: type = name_ref Outer, file.%Outer.decl [template = constants.%Outer] // CHECK:STDOUT: %o.param: %Outer = value_param runtime_param0 +// CHECK:STDOUT: %Outer.ref: type = name_ref Outer, file.%Outer.decl [template = constants.%Outer] // CHECK:STDOUT: %o: %Outer = bind_name o, %o.param // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -93,8 +95,6 @@ fn G(o: Outer) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Inner { -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc13: %Inner.elem = field_decl n, element0 [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.n [template = constants.%complete_type.3] // CHECK:STDOUT: @@ -115,8 +115,6 @@ fn G(o: Outer) { // CHECK:STDOUT: // CHECK:STDOUT: fn @G(%o.param_patt: %Outer) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %o.ref: %Outer = name_ref o, %o -// CHECK:STDOUT: %Inner.ref: type = name_ref Inner, @Outer.%Inner.decl [template = constants.%Inner] // CHECK:STDOUT: %i.var: ref %Inner = var i // CHECK:STDOUT: %i: ref %Inner = bind_name i, %i.var // CHECK:STDOUT: return diff --git a/toolchain/check/testdata/class/no_prelude/export_name.carbon b/toolchain/check/testdata/class/no_prelude/export_name.carbon index 4996ab9a3a8ab..07da9891059ae 100644 --- a/toolchain/check/testdata/class/no_prelude/export_name.carbon +++ b/toolchain/check/testdata/class/no_prelude/export_name.carbon @@ -110,7 +110,6 @@ var c: C = {}; // CHECK:STDOUT: .c = %c // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %c.var: ref %C = var c // CHECK:STDOUT: %c: ref %C = bind_name c, %c.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/no_prelude/generic_vs_params.carbon b/toolchain/check/testdata/class/no_prelude/generic_vs_params.carbon index 6cd023473a0d7..fd54e2a739ff1 100644 --- a/toolchain/check/testdata/class/no_prelude/generic_vs_params.carbon +++ b/toolchain/check/testdata/class/no_prelude/generic_vs_params.carbon @@ -82,7 +82,6 @@ fn F(T:! type) { // CHECK:STDOUT: %NotGenericButParams.val: %NotGenericButParams = struct_value () [template] // CHECK:STDOUT: %GenericAndParams.3: type = class_type @GenericAndParams.1, @GenericAndParams.1(%X) [template] // CHECK:STDOUT: %GenericAndParams.val.1: %GenericAndParams.3 = struct_value () [template] -// CHECK:STDOUT: %C.2: type = class_type @C, @C(%X) [template] // CHECK:STDOUT: %GenericAndParams.type.3: type = generic_class_type @GenericAndParams.2, @C(%X) [template] // CHECK:STDOUT: %GenericAndParams.generic.3: %GenericAndParams.type.3 = struct_value () [template] // CHECK:STDOUT: %GenericNoParams.val: %GenericNoParams.1 = struct_value () [template] @@ -120,31 +119,14 @@ fn F(T:! type) { // CHECK:STDOUT: %T.loc8_9.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc8_9.2 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: %X.decl: type = class_decl @X [template = constants.%X] {} {} -// CHECK:STDOUT: %NotGenericNoParams.ref: type = name_ref NotGenericNoParams, %NotGenericNoParams.decl [template = constants.%NotGenericNoParams] // CHECK:STDOUT: %a.var: ref %NotGenericNoParams = var a // CHECK:STDOUT: %a: ref %NotGenericNoParams = bind_name a, %a.var -// CHECK:STDOUT: %NotGenericButParams.ref: %NotGenericButParams.type = name_ref NotGenericButParams, %NotGenericButParams.decl [template = constants.%NotGenericButParams.generic] -// CHECK:STDOUT: %NotGenericButParams: type = class_type @NotGenericButParams [template = constants.%NotGenericButParams] // CHECK:STDOUT: %b.var: ref %NotGenericButParams = var b // CHECK:STDOUT: %b: ref %NotGenericButParams = bind_name b, %b.var -// CHECK:STDOUT: %GenericAndParams.ref.loc17: %GenericAndParams.type.1 = name_ref GenericAndParams, %GenericAndParams.decl [template = constants.%GenericAndParams.generic.1] -// CHECK:STDOUT: %X.ref.loc17: type = name_ref X, %X.decl [template = constants.%X] -// CHECK:STDOUT: %GenericAndParams.loc17: type = class_type @GenericAndParams.1, @GenericAndParams.1(constants.%X) [template = constants.%GenericAndParams.3] // CHECK:STDOUT: %c.var: ref %GenericAndParams.3 = var c // CHECK:STDOUT: %c: ref %GenericAndParams.3 = bind_name c, %c.var -// CHECK:STDOUT: %C.ref.loc18: %C.type = name_ref C, %C.decl [template = constants.%C.generic] -// CHECK:STDOUT: %X.ref.loc18: type = name_ref X, %X.decl [template = constants.%X] -// CHECK:STDOUT: %C.loc18: type = class_type @C, @C(constants.%X) [template = constants.%C.2] -// CHECK:STDOUT: %GenericNoParams.ref: type = name_ref GenericNoParams, @C.%GenericNoParams.decl [template = constants.%GenericNoParams.1] // CHECK:STDOUT: %d.var: ref %GenericNoParams.1 = var d // CHECK:STDOUT: %d: ref %GenericNoParams.1 = bind_name d, %d.var -// CHECK:STDOUT: %C.ref.loc19: %C.type = name_ref C, %C.decl [template = constants.%C.generic] -// CHECK:STDOUT: %X.ref.loc19_10: type = name_ref X, %X.decl [template = constants.%X] -// CHECK:STDOUT: %C.loc19: type = class_type @C, @C(constants.%X) [template = constants.%C.2] -// CHECK:STDOUT: %.loc19: %GenericAndParams.type.3 = specific_constant @C.%GenericAndParams.decl, @C(constants.%X) [template = constants.%GenericAndParams.generic.3] -// CHECK:STDOUT: %GenericAndParams.ref.loc19: %GenericAndParams.type.3 = name_ref GenericAndParams, %.loc19 [template = constants.%GenericAndParams.generic.3] -// CHECK:STDOUT: %X.ref.loc19_30: type = name_ref X, %X.decl [template = constants.%X] -// CHECK:STDOUT: %GenericAndParams.loc19: type = class_type @GenericAndParams.2, @GenericAndParams.2(constants.%X, constants.%X) [template = constants.%GenericAndParams.4] // CHECK:STDOUT: %e.var: ref %GenericAndParams.4 = var e // CHECK:STDOUT: %e: ref %GenericAndParams.4 = bind_name e, %e.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/no_prelude/import_access.carbon b/toolchain/check/testdata/class/no_prelude/import_access.carbon index 28bd83637d176..6b5ca0a8d2b71 100644 --- a/toolchain/check/testdata/class/no_prelude/import_access.carbon +++ b/toolchain/check/testdata/class/no_prelude/import_access.carbon @@ -219,7 +219,6 @@ private class Redecl {} // CHECK:STDOUT: } // CHECK:STDOUT: %Test.import = import Test // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %Def.ref: type = name_ref Def, imports.%import_ref.1 [template = constants.%Def] // CHECK:STDOUT: %c.var: ref %Def = var c // CHECK:STDOUT: %c: ref %Def = bind_name c, %c.var // CHECK:STDOUT: } @@ -250,7 +249,6 @@ private class Redecl {} // CHECK:STDOUT: .c = %c // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %Def.ref: = name_ref Def, [template = ] // CHECK:STDOUT: %c.var: ref = var c // CHECK:STDOUT: %c: ref = bind_name c, %c.var // CHECK:STDOUT: } @@ -280,8 +278,6 @@ private class Redecl {} // CHECK:STDOUT: .c = %c // CHECK:STDOUT: } // CHECK:STDOUT: %Test.import = import Test -// CHECK:STDOUT: %Test.ref: = name_ref Test, imports.%Test [template = imports.%Test] -// CHECK:STDOUT: %Def.ref: = name_ref Def, [template = ] // CHECK:STDOUT: %c.var: ref = var c // CHECK:STDOUT: %c: ref = bind_name c, %c.var // CHECK:STDOUT: } @@ -315,7 +311,6 @@ private class Redecl {} // CHECK:STDOUT: } // CHECK:STDOUT: %Test.import = import Test // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %ForwardWithDef.ref: type = name_ref ForwardWithDef, imports.%import_ref.1 [template = constants.%ForwardWithDef] // CHECK:STDOUT: %c.var: ref %ForwardWithDef = var c // CHECK:STDOUT: %c: ref %ForwardWithDef = bind_name c, %c.var // CHECK:STDOUT: } @@ -346,7 +341,6 @@ private class Redecl {} // CHECK:STDOUT: .c = %c // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %ForwardWithDef.ref: = name_ref ForwardWithDef, [template = ] // CHECK:STDOUT: %c.var: ref = var c // CHECK:STDOUT: %c: ref = bind_name c, %c.var // CHECK:STDOUT: } @@ -376,8 +370,6 @@ private class Redecl {} // CHECK:STDOUT: .c = %c // CHECK:STDOUT: } // CHECK:STDOUT: %Test.import = import Test -// CHECK:STDOUT: %Test.ref: = name_ref Test, imports.%Test [template = imports.%Test] -// CHECK:STDOUT: %ForwardWithDef.ref: = name_ref ForwardWithDef, [template = ] // CHECK:STDOUT: %c.var: ref = var c // CHECK:STDOUT: %c: ref = bind_name c, %c.var // CHECK:STDOUT: } @@ -415,9 +407,11 @@ private class Redecl {} // CHECK:STDOUT: %c.patt: %ptr = binding_pattern c // CHECK:STDOUT: %c.param_patt: %ptr = value_param_pattern %c.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Forward.ref: type = name_ref Forward, imports.%import_ref [template = constants.%Forward] -// CHECK:STDOUT: %ptr: type = ptr_type %Forward [template = constants.%ptr] // CHECK:STDOUT: %c.param: %ptr = value_param runtime_param0 +// CHECK:STDOUT: %.loc4: type = splice_block %ptr [template = constants.%ptr] { +// CHECK:STDOUT: %Forward.ref: type = name_ref Forward, imports.%import_ref [template = constants.%Forward] +// CHECK:STDOUT: %ptr: type = ptr_type %Forward [template = constants.%ptr] +// CHECK:STDOUT: } // CHECK:STDOUT: %c: %ptr = bind_name c, %c.param // CHECK:STDOUT: } // CHECK:STDOUT: %Forward.decl: type = class_decl @Forward [template = constants.%Forward] {} {} @@ -452,9 +446,11 @@ private class Redecl {} // CHECK:STDOUT: %c.patt: = binding_pattern c // CHECK:STDOUT: %c.param_patt: = value_param_pattern %c.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Forward.ref: = name_ref Forward, [template = ] -// CHECK:STDOUT: %ptr: type = ptr_type [template = ] // CHECK:STDOUT: %c.param: = value_param runtime_param0 +// CHECK:STDOUT: %.loc10: type = splice_block %ptr [template = ] { +// CHECK:STDOUT: %Forward.ref: = name_ref Forward, [template = ] +// CHECK:STDOUT: %ptr: type = ptr_type [template = ] +// CHECK:STDOUT: } // CHECK:STDOUT: %c: = bind_name c, %c.param // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -487,10 +483,12 @@ private class Redecl {} // CHECK:STDOUT: %c.patt: = binding_pattern c // CHECK:STDOUT: %c.param_patt: = value_param_pattern %c.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Test.ref: = name_ref Test, imports.%Test [template = imports.%Test] -// CHECK:STDOUT: %Forward.ref: = name_ref Forward, [template = ] -// CHECK:STDOUT: %ptr: type = ptr_type [template = ] // CHECK:STDOUT: %c.param: = value_param runtime_param0 +// CHECK:STDOUT: %.loc9: type = splice_block %ptr [template = ] { +// CHECK:STDOUT: %Test.ref: = name_ref Test, imports.%Test [template = imports.%Test] +// CHECK:STDOUT: %Forward.ref: = name_ref Forward, [template = ] +// CHECK:STDOUT: %ptr: type = ptr_type [template = ] +// CHECK:STDOUT: } // CHECK:STDOUT: %c: = bind_name c, %c.param // CHECK:STDOUT: } // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/no_prelude/indirect_import_member.carbon b/toolchain/check/testdata/class/no_prelude/indirect_import_member.carbon index 1a0f4cdfd9945..2a4c655cb3444 100644 --- a/toolchain/check/testdata/class/no_prelude/indirect_import_member.carbon +++ b/toolchain/check/testdata/class/no_prelude/indirect_import_member.carbon @@ -269,8 +269,6 @@ var x: () = D.C.F(); // CHECK:STDOUT: .x = %x // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %.loc6_9.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc6_9.2: type = converted %.loc6_9.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %x.var: ref %empty_tuple.type = var x // CHECK:STDOUT: %x: ref %empty_tuple.type = bind_name x, %x.var // CHECK:STDOUT: } @@ -317,8 +315,6 @@ var x: () = D.C.F(); // CHECK:STDOUT: .x = %x // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %.loc6_9.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc6_9.2: type = converted %.loc6_9.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %x.var: ref %empty_tuple.type = var x // CHECK:STDOUT: %x: ref %empty_tuple.type = bind_name x, %x.var // CHECK:STDOUT: } @@ -365,8 +361,6 @@ var x: () = D.C.F(); // CHECK:STDOUT: .x = %x // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %.loc6_9.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc6_9.2: type = converted %.loc6_9.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %x.var: ref %empty_tuple.type = var x // CHECK:STDOUT: %x: ref %empty_tuple.type = bind_name x, %x.var // CHECK:STDOUT: } @@ -417,8 +411,6 @@ var x: () = D.C.F(); // CHECK:STDOUT: .x = %x // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %.loc6_9.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc6_9.2: type = converted %.loc6_9.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %x.var: ref %empty_tuple.type = var x // CHECK:STDOUT: %x: ref %empty_tuple.type = bind_name x, %x.var // CHECK:STDOUT: } @@ -477,8 +469,6 @@ var x: () = D.C.F(); // CHECK:STDOUT: .x = %x // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %.loc6_9.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc6_9.2: type = converted %.loc6_9.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %x.var: ref %empty_tuple.type = var x // CHECK:STDOUT: %x: ref %empty_tuple.type = bind_name x, %x.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/no_prelude/syntactic_merge.carbon b/toolchain/check/testdata/class/no_prelude/syntactic_merge.carbon index 84aa7a56cc2cd..d4d34a0a92981 100644 --- a/toolchain/check/testdata/class/no_prelude/syntactic_merge.carbon +++ b/toolchain/check/testdata/class/no_prelude/syntactic_merge.carbon @@ -209,32 +209,32 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: %a.patt.loc8: %C = symbolic_binding_pattern a, 0 [symbolic = constants.%a.patt] // CHECK:STDOUT: %a.param_patt: %C = value_param_pattern %a.patt.loc8, runtime_param [symbolic = constants.%a.patt] // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref.loc7: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a.param.loc7: %C = value_param runtime_param +// CHECK:STDOUT: %C.ref.loc7: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a.loc7_11.1: %C = bind_symbolic_name a, 0, %a.param.loc7 [symbolic = %a.loc7_11.2 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: %Foo.decl.loc8: %Foo.type = class_decl @Foo [template = constants.%Foo.generic] { // CHECK:STDOUT: %a.patt.loc8: %C = symbolic_binding_pattern a, 0 [symbolic = constants.%a.patt] // CHECK:STDOUT: %a.param_patt: %C = value_param_pattern %a.patt.loc8, runtime_param [symbolic = constants.%a.patt] // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref.loc8: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a.param.loc8: %C = value_param runtime_param +// CHECK:STDOUT: %C.ref.loc8: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a.loc8: %C = bind_symbolic_name a, 0, %a.param.loc8 [symbolic = constants.%a] // CHECK:STDOUT: } // CHECK:STDOUT: %Bar.decl.loc10: %Bar.type = class_decl @Bar [template = constants.%Bar.generic] { // CHECK:STDOUT: %a.patt.loc11: %C = symbolic_binding_pattern a, 0 [symbolic = constants.%a.patt] // CHECK:STDOUT: %a.param_patt: %C = value_param_pattern %a.patt.loc11, runtime_param [symbolic = constants.%a.patt] // CHECK:STDOUT: } { -// CHECK:STDOUT: %D.ref.loc10: type = name_ref D, file.%D [template = constants.%C] // CHECK:STDOUT: %a.param.loc10: %C = value_param runtime_param +// CHECK:STDOUT: %D.ref.loc10: type = name_ref D, file.%D [template = constants.%C] // CHECK:STDOUT: %a.loc10_11.1: %C = bind_symbolic_name a, 0, %a.param.loc10 [symbolic = %a.loc10_11.2 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: %Bar.decl.loc11: %Bar.type = class_decl @Bar [template = constants.%Bar.generic] { // CHECK:STDOUT: %a.patt.loc11: %C = symbolic_binding_pattern a, 0 [symbolic = constants.%a.patt] // CHECK:STDOUT: %a.param_patt: %C = value_param_pattern %a.patt.loc11, runtime_param [symbolic = constants.%a.patt] // CHECK:STDOUT: } { -// CHECK:STDOUT: %D.ref.loc11: type = name_ref D, file.%D [template = constants.%C] // CHECK:STDOUT: %a.param.loc11: %C = value_param runtime_param +// CHECK:STDOUT: %D.ref.loc11: type = name_ref D, file.%D [template = constants.%C] // CHECK:STDOUT: %a.loc11: %C = bind_symbolic_name a, 0, %a.param.loc11 [symbolic = constants.%a] // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -310,16 +310,16 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: %a.patt.loc7: %C = symbolic_binding_pattern a, 0 [symbolic = constants.%a.patt] // CHECK:STDOUT: %a.param_patt: %C = value_param_pattern %a.patt.loc7, runtime_param [symbolic = constants.%a.patt] // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref.loc6: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a.param.loc6: %C = value_param runtime_param +// CHECK:STDOUT: %C.ref.loc6: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a.loc6_17.1: %C = bind_symbolic_name a, 0, %a.param.loc6 [symbolic = %a.loc6_17.2 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: %Foo.decl.loc7: %Foo.type = class_decl @Foo [template = constants.%Foo.generic] { // CHECK:STDOUT: %a.patt.loc7: %C = symbolic_binding_pattern a, 0 [symbolic = constants.%a.patt] // CHECK:STDOUT: %a.param_patt: %C = value_param_pattern %a.patt.loc7, runtime_param [symbolic = constants.%a.patt] // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref.loc7: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a.param.loc7: %C = value_param runtime_param +// CHECK:STDOUT: %C.ref.loc7: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a.loc7: %C = bind_symbolic_name a, 0, %a.param.loc7 [symbolic = constants.%a] // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -377,16 +377,16 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: %a.patt.loc6_11.1: %C = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc6_11.2 (constants.%a.patt)] // CHECK:STDOUT: %a.param_patt: %C = value_param_pattern %a.patt.loc6_11.1, runtime_param [symbolic = %a.patt.loc6_11.2 (constants.%a.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a.param: %C = value_param runtime_param +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a.loc6_11.1: %C = bind_symbolic_name a, 0, %a.param [symbolic = %a.loc6_11.2 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: %.decl: %.type = class_decl @.1 [template = constants.%.generic] { // CHECK:STDOUT: %a.patt.loc14_11.1: %C = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc14_11.2 (constants.%a.patt)] // CHECK:STDOUT: %a.param_patt: %C = value_param_pattern %a.patt.loc14_11.1, runtime_param [symbolic = %a.patt.loc14_11.2 (constants.%a.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a.param: %C = value_param runtime_param +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a.loc14_11.1: %C = bind_symbolic_name a, 0, %a.param [symbolic = %a.loc14_11.2 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -454,16 +454,16 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: %a.patt.loc7: %C = symbolic_binding_pattern a, 0 [symbolic = constants.%a.patt] // CHECK:STDOUT: %a.param_patt: %C = value_param_pattern %a.patt.loc7, runtime_param [symbolic = constants.%a.patt] // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref.loc6: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a.param.loc6: %C = value_param runtime_param +// CHECK:STDOUT: %C.ref.loc6: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a.loc6_11.1: %C = bind_symbolic_name a, 0, %a.param.loc6 [symbolic = %a.loc6_11.2 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: %Foo.decl.loc7: %Foo.type = class_decl @Foo [template = constants.%Foo.generic] { // CHECK:STDOUT: %a.patt.loc7: %C = symbolic_binding_pattern a, 0 [symbolic = constants.%a.patt] // CHECK:STDOUT: %a.param_patt: %C = value_param_pattern %a.patt.loc7, runtime_param [symbolic = constants.%a.patt] // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref.loc7: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a.param.loc7: %C = value_param runtime_param +// CHECK:STDOUT: %C.ref.loc7: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a.loc7: %C = bind_symbolic_name a, 0, %a.param.loc7 [symbolic = constants.%a] // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -524,16 +524,16 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: %a.patt.loc7_11.1: %C = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc7_11.2 (constants.%a.patt)] // CHECK:STDOUT: %a.param_patt: %C = value_param_pattern %a.patt.loc7_11.1, runtime_param [symbolic = %a.patt.loc7_11.2 (constants.%a.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a.param: %C = value_param runtime_param +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a.loc7_11.1: %C = bind_symbolic_name a, 0, %a.param [symbolic = %a.loc7_11.2 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: %Bar.decl: %Bar.type = class_decl @Bar [template = constants.%Bar.generic] { // CHECK:STDOUT: %a.patt.loc8_11.1: %C = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc8_11.2 (constants.%a.patt)] // CHECK:STDOUT: %a.param_patt: %C = value_param_pattern %a.patt.loc8_11.1, runtime_param [symbolic = %a.patt.loc8_11.2 (constants.%a.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %D.ref: type = name_ref D, file.%D [template = constants.%C] // CHECK:STDOUT: %a.param: %C = value_param runtime_param +// CHECK:STDOUT: %D.ref: type = name_ref D, file.%D [template = constants.%C] // CHECK:STDOUT: %a.loc8_11.1: %C = bind_symbolic_name a, 0, %a.param [symbolic = %a.loc8_11.2 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -606,16 +606,16 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: %a.patt.loc4: %C = symbolic_binding_pattern a, 0 [symbolic = constants.%a.patt] // CHECK:STDOUT: %a.param_patt: %C = value_param_pattern %a.patt.loc4, runtime_param [symbolic = constants.%a.patt] // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %a.param: %C = value_param runtime_param +// CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %a.loc4: %C = bind_symbolic_name a, 0, %a.param [symbolic = constants.%a] // CHECK:STDOUT: } // CHECK:STDOUT: %Bar.decl: %Bar.type = class_decl @Bar [template = constants.%Bar.generic] { // CHECK:STDOUT: %a.patt.loc5: %C = symbolic_binding_pattern a, 0 [symbolic = constants.%a.patt] // CHECK:STDOUT: %a.param_patt: %C = value_param_pattern %a.patt.loc5, runtime_param [symbolic = constants.%a.patt] // CHECK:STDOUT: } { -// CHECK:STDOUT: %D.ref: type = name_ref D, imports.%import_ref.2 [template = constants.%C] // CHECK:STDOUT: %a.param: %C = value_param runtime_param +// CHECK:STDOUT: %D.ref: type = name_ref D, imports.%import_ref.2 [template = constants.%C] // CHECK:STDOUT: %a.loc5: %C = bind_symbolic_name a, 0, %a.param [symbolic = constants.%a] // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -696,16 +696,16 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: %a.patt.loc7_11.1: %C = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc7_11.2 (constants.%a.patt)] // CHECK:STDOUT: %a.param_patt: %C = value_param_pattern %a.patt.loc7_11.1, runtime_param [symbolic = %a.patt.loc7_11.2 (constants.%a.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a.param: %C = value_param runtime_param +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a.loc7_11.1: %C = bind_symbolic_name a, 0, %a.param [symbolic = %a.loc7_11.2 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: %.decl: %.type = class_decl @.1 [template = constants.%.generic] { // CHECK:STDOUT: %b.patt.loc15_11.1: %C = symbolic_binding_pattern b, 0 [symbolic = %b.patt.loc15_11.2 (constants.%b.patt)] // CHECK:STDOUT: %b.param_patt: %C = value_param_pattern %b.patt.loc15_11.1, runtime_param [symbolic = %b.patt.loc15_11.2 (constants.%b.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %D.ref: type = name_ref D, file.%D [template = constants.%C] // CHECK:STDOUT: %b.param: %C = value_param runtime_param +// CHECK:STDOUT: %D.ref: type = name_ref D, file.%D [template = constants.%C] // CHECK:STDOUT: %b.loc15_11.1: %C = bind_symbolic_name b, 0, %b.param [symbolic = %b.loc15_11.2 (constants.%b)] // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -778,16 +778,16 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: %a.patt.loc7_11.1: %C = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc7_11.2 (constants.%a.patt)] // CHECK:STDOUT: %a.param_patt: %C = value_param_pattern %a.patt.loc7_11.1, runtime_param [symbolic = %a.patt.loc7_11.2 (constants.%a.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a.param: %C = value_param runtime_param +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a.loc7_11.1: %C = bind_symbolic_name a, 0, %a.param [symbolic = %a.loc7_11.2 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: %.decl: %.type = class_decl @.1 [template = constants.%.generic] { // CHECK:STDOUT: %a.patt.loc15_11.1: %C = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc15_11.2 (constants.%a.patt)] // CHECK:STDOUT: %a.param_patt: %C = value_param_pattern %a.patt.loc15_11.1, runtime_param [symbolic = %a.patt.loc15_11.2 (constants.%a.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %D.ref: type = name_ref D, file.%D [template = constants.%C] // CHECK:STDOUT: %a.param: %C = value_param runtime_param +// CHECK:STDOUT: %D.ref: type = name_ref D, file.%D [template = constants.%C] // CHECK:STDOUT: %a.loc15_11.1: %C = bind_symbolic_name a, 0, %a.param [symbolic = %a.loc15_11.2 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -860,16 +860,16 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: %a.patt.loc7_11.1: %C = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc7_11.2 (constants.%a.patt)] // CHECK:STDOUT: %a.param_patt: %C = value_param_pattern %a.patt.loc7_11.1, runtime_param [symbolic = %a.patt.loc7_11.2 (constants.%a.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a.param: %C = value_param runtime_param +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a.loc7_11.1: %C = bind_symbolic_name a, 0, %a.param [symbolic = %a.loc7_11.2 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: %.decl: %.type = class_decl @.1 [template = constants.%.generic] { // CHECK:STDOUT: %a.patt.loc15_11.1: %C = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc15_11.2 (constants.%a.patt)] // CHECK:STDOUT: %a.param_patt: %C = value_param_pattern %a.patt.loc15_11.1, runtime_param [symbolic = %a.patt.loc15_11.2 (constants.%a.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %D.ref: type = name_ref D, file.%D [template = constants.%C] // CHECK:STDOUT: %a.param: %C = value_param runtime_param +// CHECK:STDOUT: %D.ref: type = name_ref D, file.%D [template = constants.%C] // CHECK:STDOUT: %a.loc15_11.1: %C = bind_symbolic_name a, 0, %a.param [symbolic = %a.loc15_11.2 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -936,8 +936,8 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: %a.patt.loc6_11.1: %C = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc6_11.2 (constants.%a.patt)] // CHECK:STDOUT: %a.param_patt: %C = value_param_pattern %a.patt.loc6_11.1, runtime_param [symbolic = %a.patt.loc6_11.2 (constants.%a.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a.param: %C = value_param runtime_param +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a.loc6_11.1: %C = bind_symbolic_name a, 0, %a.param [symbolic = %a.loc6_11.2 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -995,8 +995,8 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: %a.patt.loc6: %C = symbolic_binding_pattern a, 0 [symbolic = constants.%a.patt] // CHECK:STDOUT: %a.param_patt: %C = value_param_pattern %a.patt.loc6, runtime_param [symbolic = constants.%a.patt] // CHECK:STDOUT: } { -// CHECK:STDOUT: %D.ref: type = name_ref D, file.%D [template = constants.%C] // CHECK:STDOUT: %a.param: %C = value_param runtime_param +// CHECK:STDOUT: %D.ref: type = name_ref D, file.%D [template = constants.%C] // CHECK:STDOUT: %a.loc6: %C = bind_symbolic_name a, 0, %a.param [symbolic = constants.%a] // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -1053,19 +1053,23 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: %a.patt.loc6_11.1: %const = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc6_11.2 (constants.%a.patt)] // CHECK:STDOUT: %a.param_patt: %const = value_param_pattern %a.patt.loc6_11.1, runtime_param [symbolic = %a.patt.loc6_11.2 (constants.%a.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %const: type = const_type %C [template = constants.%const] // CHECK:STDOUT: %a.param: %const = value_param runtime_param +// CHECK:STDOUT: %.loc6: type = splice_block %const [template = constants.%const] { +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %const: type = const_type %C [template = constants.%const] +// CHECK:STDOUT: } // CHECK:STDOUT: %a.loc6_11.1: %const = bind_symbolic_name a, 0, %a.param [symbolic = %a.loc6_11.2 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: %.decl: %.type = class_decl @.1 [template = constants.%.generic] { // CHECK:STDOUT: %a.patt.loc18_11.1: %const = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc18_11.2 (constants.%a.patt)] // CHECK:STDOUT: %a.param_patt: %const = value_param_pattern %a.patt.loc18_11.1, runtime_param [symbolic = %a.patt.loc18_11.2 (constants.%a.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %const.loc18_22: type = const_type %C [template = constants.%const] -// CHECK:STDOUT: %const.loc18_15: type = const_type %const [template = constants.%const] // CHECK:STDOUT: %a.param: %const = value_param runtime_param +// CHECK:STDOUT: %.loc18: type = splice_block %const.loc18_15 [template = constants.%const] { +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %const.loc18_22: type = const_type %C [template = constants.%const] +// CHECK:STDOUT: %const.loc18_15: type = const_type %const [template = constants.%const] +// CHECK:STDOUT: } // CHECK:STDOUT: %a.loc18_11.1: %const = bind_symbolic_name a, 0, %a.param [symbolic = %a.loc18_11.2 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -1134,34 +1138,36 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.1] { // CHECK:STDOUT: %self.patt: %ptr.1 = binding_pattern self // CHECK:STDOUT: %self.param_patt: %ptr.1 = value_param_pattern %self.patt, runtime_param0 -// CHECK:STDOUT: %.loc16: auto = addr_pattern %self.param_patt +// CHECK:STDOUT: %.loc16_11: auto = addr_pattern %self.param_patt // CHECK:STDOUT: } { -// CHECK:STDOUT: %Base.ref: type = name_ref Base, file.%Base.decl [template = constants.%Base] -// CHECK:STDOUT: %ptr: type = ptr_type %Base [template = constants.%ptr.1] // CHECK:STDOUT: %self.param: %ptr.1 = value_param runtime_param0 +// CHECK:STDOUT: %.loc16_26: type = splice_block %ptr [template = constants.%ptr.1] { +// CHECK:STDOUT: %Base.ref: type = name_ref Base, file.%Base.decl [template = constants.%Base] +// CHECK:STDOUT: %ptr: type = ptr_type %Base [template = constants.%ptr.1] +// CHECK:STDOUT: } // CHECK:STDOUT: %self: %ptr.1 = bind_name self, %self.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Base { -// CHECK:STDOUT: %.loc5_11.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc5_11.2: type = converted %.loc5_11.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] -// CHECK:STDOUT: %.loc5_8: %Base.elem = field_decl a, element0 [template] +// CHECK:STDOUT: %.loc5: %Base.elem = field_decl a, element0 [template] // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %self.patt: %ptr.1 = binding_pattern self // CHECK:STDOUT: %self.param_patt: %ptr.1 = value_param_pattern %self.patt, runtime_param0 -// CHECK:STDOUT: %.loc7: auto = addr_pattern %self.param_patt +// CHECK:STDOUT: %.loc7_8: auto = addr_pattern %self.param_patt // CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Base [template = constants.%Base] -// CHECK:STDOUT: %ptr: type = ptr_type %Base [template = constants.%ptr.1] // CHECK:STDOUT: %self.param: %ptr.1 = value_param runtime_param0 +// CHECK:STDOUT: %.loc7_23: type = splice_block %ptr [template = constants.%ptr.1] { +// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Base [template = constants.%Base] +// CHECK:STDOUT: %ptr: type = ptr_type %Base [template = constants.%ptr.1] +// CHECK:STDOUT: } // CHECK:STDOUT: %self: %ptr.1 = bind_name self, %self.param // CHECK:STDOUT: } // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a [template = constants.%complete_type] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Base -// CHECK:STDOUT: .a = %.loc5_8 +// CHECK:STDOUT: .a = %.loc5 // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } @@ -1172,7 +1178,7 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %self.ref: %ptr.1 = name_ref self, %self // CHECK:STDOUT: %.loc17_4: ref %Base = deref %self.ref -// CHECK:STDOUT: %a.ref: %Base.elem = name_ref a, @Base.%.loc5_8 [template = @Base.%.loc5_8] +// CHECK:STDOUT: %a.ref: %Base.elem = name_ref a, @Base.%.loc5 [template = @Base.%.loc5] // CHECK:STDOUT: %.loc17_10: ref %empty_tuple.type = class_element_access %.loc17_4, element0 // CHECK:STDOUT: %.loc17_16.1: %empty_tuple.type = tuple_literal () // CHECK:STDOUT: %.loc17_16.2: init %empty_tuple.type = tuple_init () to %.loc17_10 [template = constants.%empty_tuple] diff --git a/toolchain/check/testdata/class/raw_self.carbon b/toolchain/check/testdata/class/raw_self.carbon index 9c884c627548e..79ab8c843c563 100644 --- a/toolchain/check/testdata/class/raw_self.carbon +++ b/toolchain/check/testdata/class/raw_self.carbon @@ -58,17 +58,21 @@ fn Class.G[self: Self](r#self: i32) -> (i32, i32) { // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %self.patt.loc17_17: %ptr.1 = binding_pattern self // CHECK:STDOUT: %self.param_patt.loc17_21: %ptr.1 = value_param_pattern %self.patt.loc17_17, runtime_param0 -// CHECK:STDOUT: %.loc17: auto = addr_pattern %self.param_patt.loc17_21 +// CHECK:STDOUT: %.loc17_12: auto = addr_pattern %self.param_patt.loc17_21 // CHECK:STDOUT: %self.patt.loc17_30: %i32 = binding_pattern r#self // CHECK:STDOUT: %self.param_patt.loc17_36: %i32 = value_param_pattern %self.patt.loc17_30, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref.loc17: type = name_ref Self, constants.%Class [template = constants.%Class] -// CHECK:STDOUT: %ptr.loc17: type = ptr_type %Class [template = constants.%ptr.1] -// CHECK:STDOUT: %int_32.loc17: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %self.param.loc17_21: %ptr.1 = value_param runtime_param0 +// CHECK:STDOUT: %.loc17_27: type = splice_block %ptr.loc17 [template = constants.%ptr.1] { +// CHECK:STDOUT: %Self.ref.loc17: type = name_ref Self, constants.%Class [template = constants.%Class] +// CHECK:STDOUT: %ptr.loc17: type = ptr_type %Class [template = constants.%ptr.1] +// CHECK:STDOUT: } // CHECK:STDOUT: %self.loc17_17: %ptr.1 = bind_name self, %self.param.loc17_21 // CHECK:STDOUT: %self.param.loc17_36: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %.loc17_38: type = splice_block %i32.loc17 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc17: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %self.loc17_30: %i32 = bind_name r#self, %self.param.loc17_36 // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { @@ -79,9 +83,6 @@ fn Class.G[self: Self](r#self: i32) -> (i32, i32) { // CHECK:STDOUT: %return.patt: %tuple.type.2 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %tuple.type.2 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref.loc21: type = name_ref Self, constants.%Class [template = constants.%Class] -// CHECK:STDOUT: %int_32.loc21_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc21_32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc21_41: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc21_41: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc21_46: Core.IntLiteral = int_value 32 [template = constants.%int_32] @@ -89,8 +90,13 @@ fn Class.G[self: Self](r#self: i32) -> (i32, i32) { // CHECK:STDOUT: %.loc21_49.1: %tuple.type.1 = tuple_literal (%i32.loc21_41, %i32.loc21_46) // CHECK:STDOUT: %.loc21_49.2: type = converted %.loc21_49.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %self.param.loc21_16: %Class = value_param runtime_param0 +// CHECK:STDOUT: %Self.ref.loc21: type = name_ref Self, constants.%Class [template = constants.%Class] // CHECK:STDOUT: %self.loc21_12: %Class = bind_name self, %self.param.loc21_16 // CHECK:STDOUT: %self.param.loc21_30: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %.loc21_32: type = splice_block %i32.loc21_32 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc21_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc21_32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %self.loc21_24: %i32 = bind_name r#self, %self.param.loc21_30 // CHECK:STDOUT: %return.param.loc21: ref %tuple.type.2 = out_param runtime_param2 // CHECK:STDOUT: %return.loc21: ref %tuple.type.2 = return_slot %return.param.loc21 @@ -101,17 +107,21 @@ fn Class.G[self: Self](r#self: i32) -> (i32, i32) { // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %self.patt.loc17_17: %ptr.1 = binding_pattern self // CHECK:STDOUT: %self.param_patt.loc17_21: %ptr.1 = value_param_pattern %self.patt.loc17_17, runtime_param0 -// CHECK:STDOUT: %.loc17: auto = addr_pattern %self.param_patt.loc17_21 +// CHECK:STDOUT: %.loc17_12: auto = addr_pattern %self.param_patt.loc17_21 // CHECK:STDOUT: %self.patt.loc17_30: %i32 = binding_pattern r#self // CHECK:STDOUT: %self.param_patt.loc17_36: %i32 = value_param_pattern %self.patt.loc17_30, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref.loc12: type = name_ref Self, constants.%Class [template = constants.%Class] -// CHECK:STDOUT: %ptr.loc12: type = ptr_type %Class [template = constants.%ptr.1] -// CHECK:STDOUT: %int_32.loc12: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc12: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %self.param.loc12_17: %ptr.1 = value_param runtime_param0 +// CHECK:STDOUT: %.loc12_23: type = splice_block %ptr.loc12 [template = constants.%ptr.1] { +// CHECK:STDOUT: %Self.ref.loc12: type = name_ref Self, constants.%Class [template = constants.%Class] +// CHECK:STDOUT: %ptr.loc12: type = ptr_type %Class [template = constants.%ptr.1] +// CHECK:STDOUT: } // CHECK:STDOUT: %self.loc12_13: %ptr.1 = bind_name self, %self.param.loc12_17 // CHECK:STDOUT: %self.param.loc12_32: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %.loc12_34: type = splice_block %i32.loc12 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc12: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc12: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %self.loc12_26: %i32 = bind_name r#self, %self.param.loc12_32 // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { @@ -122,9 +132,6 @@ fn Class.G[self: Self](r#self: i32) -> (i32, i32) { // CHECK:STDOUT: %return.patt: %tuple.type.2 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %tuple.type.2 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref.loc13: type = name_ref Self, constants.%Class [template = constants.%Class] -// CHECK:STDOUT: %int_32.loc13_28: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc13_28: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc13_37: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc13_37: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc13_42: Core.IntLiteral = int_value 32 [template = constants.%int_32] @@ -132,14 +139,17 @@ fn Class.G[self: Self](r#self: i32) -> (i32, i32) { // CHECK:STDOUT: %.loc13_45.1: %tuple.type.1 = tuple_literal (%i32.loc13_37, %i32.loc13_42) // CHECK:STDOUT: %.loc13_45.2: type = converted %.loc13_45.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %self.param.loc13_12: %Class = value_param runtime_param0 +// CHECK:STDOUT: %Self.ref.loc13: type = name_ref Self, constants.%Class [template = constants.%Class] // CHECK:STDOUT: %self.loc13_8: %Class = bind_name self, %self.param.loc13_12 // CHECK:STDOUT: %self.param.loc13_26: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %.loc13_28: type = splice_block %i32.loc13_28 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc13_28: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc13_28: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %self.loc13_20: %i32 = bind_name r#self, %self.param.loc13_26 // CHECK:STDOUT: %return.param.loc13: ref %tuple.type.2 = out_param runtime_param2 // CHECK:STDOUT: %return.loc13: ref %tuple.type.2 = return_slot %return.param.loc13 // CHECK:STDOUT: } -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc14: %Class.elem = field_decl n, element0 [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.n [template = constants.%complete_type.3] // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/raw_self_type.carbon b/toolchain/check/testdata/class/raw_self_type.carbon index b24e0deef1567..586d5f67f3c70 100644 --- a/toolchain/check/testdata/class/raw_self_type.carbon +++ b/toolchain/check/testdata/class/raw_self_type.carbon @@ -60,11 +60,11 @@ fn MemberNamedSelf.F(x: Self, y: r#Self) {} // CHECK:STDOUT: %y.patt: %Self = binding_pattern y // CHECK:STDOUT: %y.param_patt: %Self = value_param_pattern %y.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref.loc24_25: type = name_ref Self, constants.%MemberNamedSelf [template = constants.%MemberNamedSelf] -// CHECK:STDOUT: %Self.ref.loc24_34: type = name_ref r#Self, @MemberNamedSelf.%Self.decl [template = constants.%Self] // CHECK:STDOUT: %x.param.loc24: %MemberNamedSelf = value_param runtime_param0 +// CHECK:STDOUT: %Self.ref.loc24_25: type = name_ref Self, constants.%MemberNamedSelf [template = constants.%MemberNamedSelf] // CHECK:STDOUT: %x.loc24: %MemberNamedSelf = bind_name x, %x.param.loc24 // CHECK:STDOUT: %y.param.loc24: %Self = value_param runtime_param1 +// CHECK:STDOUT: %Self.ref.loc24_34: type = name_ref r#Self, @MemberNamedSelf.%Self.decl [template = constants.%Self] // CHECK:STDOUT: %y.loc24: %Self = bind_name y, %y.param.loc24 // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -87,11 +87,11 @@ fn MemberNamedSelf.F(x: Self, y: r#Self) {} // CHECK:STDOUT: %y.patt: %Self = binding_pattern y // CHECK:STDOUT: %y.param_patt: %Self = value_param_pattern %y.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref.loc21_11: type = name_ref Self, constants.%MemberNamedSelf [template = constants.%MemberNamedSelf] -// CHECK:STDOUT: %Self.ref.loc21_20: type = name_ref r#Self, @MemberNamedSelf.%Self.decl [template = constants.%Self] // CHECK:STDOUT: %x.param.loc21: %MemberNamedSelf = value_param runtime_param0 +// CHECK:STDOUT: %Self.ref.loc21_11: type = name_ref Self, constants.%MemberNamedSelf [template = constants.%MemberNamedSelf] // CHECK:STDOUT: %x.loc21: %MemberNamedSelf = bind_name x, %x.param.loc21 // CHECK:STDOUT: %y.param.loc21: %Self = value_param runtime_param1 +// CHECK:STDOUT: %Self.ref.loc21_20: type = name_ref r#Self, @MemberNamedSelf.%Self.decl [template = constants.%Self] // CHECK:STDOUT: %y.loc21: %Self = bind_name y, %y.param.loc21 // CHECK:STDOUT: } // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] @@ -113,16 +113,12 @@ fn MemberNamedSelf.F(x: Self, y: r#Self) {} // CHECK:STDOUT: // CHECK:STDOUT: fn @F.1() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Self.ref.loc13: type = name_ref Self, constants.%Class [template = constants.%Class] -// CHECK:STDOUT: %ptr.loc13: type = ptr_type %Class [template = constants.%ptr.1] // CHECK:STDOUT: %Self.var: ref %ptr.1 = var r#Self // CHECK:STDOUT: %Self: ref %ptr.1 = bind_name r#Self, %Self.var -// CHECK:STDOUT: %Self.ref.loc14_12: type = name_ref Self, constants.%Class [template = constants.%Class] -// CHECK:STDOUT: %ptr.loc14: type = ptr_type %Class [template = constants.%ptr.1] // CHECK:STDOUT: %p.var: ref %ptr.1 = var p // CHECK:STDOUT: %p: ref %ptr.1 = bind_name p, %p.var -// CHECK:STDOUT: %Self.ref.loc14_20: ref %ptr.1 = name_ref r#Self, %Self -// CHECK:STDOUT: %.loc14: %ptr.1 = bind_value %Self.ref.loc14_20 +// CHECK:STDOUT: %Self.ref: ref %ptr.1 = name_ref r#Self, %Self +// CHECK:STDOUT: %.loc14: %ptr.1 = bind_value %Self.ref // CHECK:STDOUT: assign %p.var, %.loc14 // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/redeclaration.carbon b/toolchain/check/testdata/class/redeclaration.carbon index e1dfd868b2889..beaa82775e7d5 100644 --- a/toolchain/check/testdata/class/redeclaration.carbon +++ b/toolchain/check/testdata/class/redeclaration.carbon @@ -50,13 +50,15 @@ fn Class.F[self: Self](b: bool) {} // CHECK:STDOUT: %b.patt: bool = binding_pattern b // CHECK:STDOUT: %b.param_patt: bool = value_param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref.loc17: type = name_ref Self, constants.%Class [template = constants.%Class] -// CHECK:STDOUT: %bool.make_type.loc17: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc17_27.1: type = value_of_initializer %bool.make_type.loc17 [template = bool] -// CHECK:STDOUT: %.loc17_27.2: type = converted %bool.make_type.loc17, %.loc17_27.1 [template = bool] // CHECK:STDOUT: %self.param.loc17: %Class = value_param runtime_param0 +// CHECK:STDOUT: %Self.ref.loc17: type = name_ref Self, constants.%Class [template = constants.%Class] // CHECK:STDOUT: %self.loc17: %Class = bind_name self, %self.param.loc17 // CHECK:STDOUT: %b.param.loc17: bool = value_param runtime_param1 +// CHECK:STDOUT: %.loc17_27.3: type = splice_block %.loc17_27.2 [template = bool] { +// CHECK:STDOUT: %bool.make_type.loc17: init type = call constants.%Bool() [template = bool] +// CHECK:STDOUT: %.loc17_27.1: type = value_of_initializer %bool.make_type.loc17 [template = bool] +// CHECK:STDOUT: %.loc17_27.2: type = converted %bool.make_type.loc17, %.loc17_27.1 [template = bool] +// CHECK:STDOUT: } // CHECK:STDOUT: %b.loc17: bool = bind_name b, %b.param.loc17 // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -68,13 +70,15 @@ fn Class.F[self: Self](b: bool) {} // CHECK:STDOUT: %b.patt: bool = binding_pattern b // CHECK:STDOUT: %b.param_patt: bool = value_param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref.loc14: type = name_ref Self, constants.%Class [template = constants.%Class] -// CHECK:STDOUT: %bool.make_type.loc14: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc14_23.1: type = value_of_initializer %bool.make_type.loc14 [template = bool] -// CHECK:STDOUT: %.loc14_23.2: type = converted %bool.make_type.loc14, %.loc14_23.1 [template = bool] // CHECK:STDOUT: %self.param.loc14: %Class = value_param runtime_param0 +// CHECK:STDOUT: %Self.ref.loc14: type = name_ref Self, constants.%Class [template = constants.%Class] // CHECK:STDOUT: %self.loc14: %Class = bind_name self, %self.param.loc14 // CHECK:STDOUT: %b.param.loc14: bool = value_param runtime_param1 +// CHECK:STDOUT: %.loc14_23.3: type = splice_block %.loc14_23.2 [template = bool] { +// CHECK:STDOUT: %bool.make_type.loc14: init type = call constants.%Bool() [template = bool] +// CHECK:STDOUT: %.loc14_23.1: type = value_of_initializer %bool.make_type.loc14 [template = bool] +// CHECK:STDOUT: %.loc14_23.2: type = converted %bool.make_type.loc14, %.loc14_23.1 [template = bool] +// CHECK:STDOUT: } // CHECK:STDOUT: %b.loc14: bool = bind_name b, %b.param.loc14 // CHECK:STDOUT: } // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] diff --git a/toolchain/check/testdata/class/reorder_qualified.carbon b/toolchain/check/testdata/class/reorder_qualified.carbon index 1e751bccc03c1..0ea2f83557fb2 100644 --- a/toolchain/check/testdata/class/reorder_qualified.carbon +++ b/toolchain/check/testdata/class/reorder_qualified.carbon @@ -130,8 +130,6 @@ class A { // CHECK:STDOUT: %B.decl: type = class_decl @B [template = constants.%B] {} {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: %AF.decl: %AF.type = fn_decl @AF [template = constants.%AF] {} {} -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc46: %A.elem = field_decl a, element0 [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a.1 [template = constants.%complete_type.6] // CHECK:STDOUT: @@ -146,8 +144,6 @@ class A { // CHECK:STDOUT: class @B { // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: %BF.decl: %BF.type = fn_decl @BF [template = constants.%BF] {} {} -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc16: %B.elem = field_decl b, element0 [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.b.1 [template = constants.%complete_type.3] // CHECK:STDOUT: @@ -163,8 +159,6 @@ class A { // CHECK:STDOUT: %D.decl: type = class_decl @D [template = constants.%D] {} {} // CHECK:STDOUT: %DF.decl: %DF.type = fn_decl @DF [template = constants.%DF] {} {} // CHECK:STDOUT: %CF.decl: %CF.type = fn_decl @CF [template = constants.%CF] {} {} -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc42: %C.elem = field_decl c, element0 [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.c.1 [template = constants.%complete_type.5] // CHECK:STDOUT: @@ -179,8 +173,6 @@ class A { // CHECK:STDOUT: class @D { // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {} // CHECK:STDOUT: %DF.decl: %DF.type = fn_decl @DF [template = constants.%DF] {} {} -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc24: %D.elem = field_decl d, element0 [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.d.1 [template = constants.%complete_type.4] // CHECK:STDOUT: @@ -198,7 +190,6 @@ class A { // CHECK:STDOUT: // CHECK:STDOUT: fn @DF() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%A] // CHECK:STDOUT: %a.var: ref %A = var a // CHECK:STDOUT: %a: ref %A = bind_name a, %a.var // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] @@ -213,7 +204,6 @@ class A { // CHECK:STDOUT: %.loc29_25.5: init %A = class_init (%.loc29_25.4), %a.var [template = constants.%A.val] // CHECK:STDOUT: %.loc29_26: init %A = converted %.loc29_25.1, %.loc29_25.5 [template = constants.%A.val] // CHECK:STDOUT: assign %a.var, %.loc29_26 -// CHECK:STDOUT: %B.ref: type = name_ref B, @A.%B.decl [template = constants.%B] // CHECK:STDOUT: %b.var: ref %B = var b // CHECK:STDOUT: %b: ref %B = bind_name b, %b.var // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] @@ -228,7 +218,6 @@ class A { // CHECK:STDOUT: %.loc30_25.5: init %B = class_init (%.loc30_25.4), %b.var [template = constants.%B.val] // CHECK:STDOUT: %.loc30_26: init %B = converted %.loc30_25.1, %.loc30_25.5 [template = constants.%B.val] // CHECK:STDOUT: assign %b.var, %.loc30_26 -// CHECK:STDOUT: %C.ref: type = name_ref C, @B.%C.decl [template = constants.%C] // CHECK:STDOUT: %c.var: ref %C = var c // CHECK:STDOUT: %c: ref %C = bind_name c, %c.var // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] @@ -243,7 +232,6 @@ class A { // CHECK:STDOUT: %.loc31_25.5: init %C = class_init (%.loc31_25.4), %c.var [template = constants.%C.val] // CHECK:STDOUT: %.loc31_26: init %C = converted %.loc31_25.1, %.loc31_25.5 [template = constants.%C.val] // CHECK:STDOUT: assign %c.var, %.loc31_26 -// CHECK:STDOUT: %D.ref: type = name_ref D, @C.%D.decl [template = constants.%D] // CHECK:STDOUT: %d.var: ref %D = var d // CHECK:STDOUT: %d: ref %D = bind_name d, %d.var // CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [template = constants.%int_4.1] diff --git a/toolchain/check/testdata/class/scope.carbon b/toolchain/check/testdata/class/scope.carbon index 37d7a955a74fb..c3b19c62027c2 100644 --- a/toolchain/check/testdata/class/scope.carbon +++ b/toolchain/check/testdata/class/scope.carbon @@ -150,15 +150,11 @@ fn Run() { // CHECK:STDOUT: // CHECK:STDOUT: fn @Run() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int_32.loc26: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc26: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.var: ref %i32 = var a // CHECK:STDOUT: %a: ref %i32 = bind_name a, %a.var // CHECK:STDOUT: %F.ref.loc26: %F.type.2 = name_ref F, file.%F.decl [template = constants.%F.2] // CHECK:STDOUT: %F.call.loc26: init %i32 = call %F.ref.loc26() // CHECK:STDOUT: assign %a.var, %F.call.loc26 -// CHECK:STDOUT: %int_32.loc27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %b.var: ref %i32 = var b // CHECK:STDOUT: %b: ref %i32 = bind_name b, %b.var // CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class] diff --git a/toolchain/check/testdata/class/self.carbon b/toolchain/check/testdata/class/self.carbon index eda1353e5c407..25d45957f1416 100644 --- a/toolchain/check/testdata/class/self.carbon +++ b/toolchain/check/testdata/class/self.carbon @@ -78,10 +78,10 @@ class Class { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref.loc11: type = name_ref Self, constants.%Class [template = constants.%Class] // CHECK:STDOUT: %int_32.loc11: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %self.param.loc11: %Class = value_param runtime_param0 +// CHECK:STDOUT: %Self.ref.loc11: type = name_ref Self, constants.%Class [template = constants.%Class] // CHECK:STDOUT: %self.loc11: %Class = bind_name self, %self.param.loc11 // CHECK:STDOUT: %return.param.loc11: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return.loc11: ref %i32 = return_slot %return.param.loc11 @@ -89,15 +89,17 @@ class Class { // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %self.patt: %ptr.1 = binding_pattern self // CHECK:STDOUT: %self.param_patt: %ptr.1 = value_param_pattern %self.patt, runtime_param0 -// CHECK:STDOUT: %.loc15: auto = addr_pattern %self.param_patt +// CHECK:STDOUT: %.loc15_12: auto = addr_pattern %self.param_patt // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref.loc15: type = name_ref Self, constants.%Class [template = constants.%Class] -// CHECK:STDOUT: %ptr.loc15: type = ptr_type %Class [template = constants.%ptr.1] // CHECK:STDOUT: %int_32.loc15: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc15: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %self.param.loc15: %ptr.1 = value_param runtime_param0 +// CHECK:STDOUT: %.loc15_27: type = splice_block %ptr.loc15 [template = constants.%ptr.1] { +// CHECK:STDOUT: %Self.ref.loc15: type = name_ref Self, constants.%Class [template = constants.%Class] +// CHECK:STDOUT: %ptr.loc15: type = ptr_type %Class [template = constants.%ptr.1] +// CHECK:STDOUT: } // CHECK:STDOUT: %self.loc15: %ptr.1 = bind_name self, %self.param.loc15 // CHECK:STDOUT: %return.param.loc15: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return.loc15: ref %i32 = return_slot %return.param.loc15 @@ -111,10 +113,10 @@ class Class { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref.loc5: type = name_ref Self, constants.%Class [template = constants.%Class] // CHECK:STDOUT: %int_32.loc5: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc5: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %self.param.loc5: %Class = value_param runtime_param0 +// CHECK:STDOUT: %Self.ref.loc5: type = name_ref Self, constants.%Class [template = constants.%Class] // CHECK:STDOUT: %self.loc5: %Class = bind_name self, %self.param.loc5 // CHECK:STDOUT: %return.param.loc5: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return.loc5: ref %i32 = return_slot %return.param.loc5 @@ -122,21 +124,21 @@ class Class { // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %self.patt: %ptr.1 = binding_pattern self // CHECK:STDOUT: %self.param_patt: %ptr.1 = value_param_pattern %self.patt, runtime_param0 -// CHECK:STDOUT: %.loc15: auto = addr_pattern %self.param_patt +// CHECK:STDOUT: %.loc15_12: auto = addr_pattern %self.param_patt // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref.loc6: type = name_ref Self, constants.%Class [template = constants.%Class] -// CHECK:STDOUT: %ptr.loc6: type = ptr_type %Class [template = constants.%ptr.1] // CHECK:STDOUT: %int_32.loc6: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc6: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %self.param.loc6: %ptr.1 = value_param runtime_param0 +// CHECK:STDOUT: %.loc6: type = splice_block %ptr.loc6 [template = constants.%ptr.1] { +// CHECK:STDOUT: %Self.ref.loc6: type = name_ref Self, constants.%Class [template = constants.%Class] +// CHECK:STDOUT: %ptr.loc6: type = ptr_type %Class [template = constants.%ptr.1] +// CHECK:STDOUT: } // CHECK:STDOUT: %self.loc6: %ptr.1 = bind_name self, %self.param.loc6 // CHECK:STDOUT: %return.param.loc6: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return.loc6: ref %i32 = return_slot %return.param.loc6 // CHECK:STDOUT: } -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc8: %Class.elem = field_decl n, element0 [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.n [template = constants.%complete_type.3] // CHECK:STDOUT: @@ -201,10 +203,10 @@ class Class { // CHECK:STDOUT: %return.patt: = return_slot_pattern // CHECK:STDOUT: %return.param_patt: = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Class [template = constants.%Class] // CHECK:STDOUT: %self.ref: %Class = name_ref self, %self // CHECK:STDOUT: %.loc11: type = converted %self.ref, [template = ] // CHECK:STDOUT: %self.param: %Class = value_param runtime_param0 +// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Class [template = constants.%Class] // CHECK:STDOUT: %self: %Class = bind_name self, %self.param // CHECK:STDOUT: %return.param: ref = out_param runtime_param1 // CHECK:STDOUT: %return: ref = return_slot %return.param diff --git a/toolchain/check/testdata/class/self_conversion.carbon b/toolchain/check/testdata/class/self_conversion.carbon index 93b5fa090ecdc..cf4a2b9202914 100644 --- a/toolchain/check/testdata/class/self_conversion.carbon +++ b/toolchain/check/testdata/class/self_conversion.carbon @@ -89,10 +89,10 @@ fn Call(p: Derived*) -> i32 { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Base.ref.loc22: type = name_ref Base, file.%Base.decl [template = constants.%Base] // CHECK:STDOUT: %int_32.loc22: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %self.param.loc22: %Base = value_param runtime_param0 +// CHECK:STDOUT: %Base.ref.loc22: type = name_ref Base, file.%Base.decl [template = constants.%Base] // CHECK:STDOUT: %self.loc22: %Base = bind_name self, %self.param.loc22 // CHECK:STDOUT: %return.param.loc22: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return.loc22: ref %i32 = return_slot %return.param.loc22 @@ -100,11 +100,13 @@ fn Call(p: Derived*) -> i32 { // CHECK:STDOUT: %AddrSelfBase.decl: %AddrSelfBase.type = fn_decl @AddrSelfBase [template = constants.%AddrSelfBase] { // CHECK:STDOUT: %self.patt: %ptr.2 = binding_pattern self // CHECK:STDOUT: %self.param_patt: %ptr.2 = value_param_pattern %self.patt, runtime_param0 -// CHECK:STDOUT: %.loc26: auto = addr_pattern %self.param_patt +// CHECK:STDOUT: %.loc26_25: auto = addr_pattern %self.param_patt // CHECK:STDOUT: } { -// CHECK:STDOUT: %Base.ref.loc26: type = name_ref Base, file.%Base.decl [template = constants.%Base] -// CHECK:STDOUT: %ptr.loc26: type = ptr_type %Base [template = constants.%ptr.2] // CHECK:STDOUT: %self.param.loc26: %ptr.2 = value_param runtime_param0 +// CHECK:STDOUT: %.loc26_40: type = splice_block %ptr.loc26 [template = constants.%ptr.2] { +// CHECK:STDOUT: %Base.ref.loc26: type = name_ref Base, file.%Base.decl [template = constants.%Base] +// CHECK:STDOUT: %ptr.loc26: type = ptr_type %Base [template = constants.%ptr.2] +// CHECK:STDOUT: } // CHECK:STDOUT: %self.loc26: %ptr.2 = bind_name self, %self.param.loc26 // CHECK:STDOUT: } // CHECK:STDOUT: %Call.decl: %Call.type = fn_decl @Call [template = constants.%Call] { @@ -113,11 +115,13 @@ fn Call(p: Derived*) -> i32 { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Derived.ref: type = name_ref Derived, file.%Derived.decl [template = constants.%Derived] -// CHECK:STDOUT: %ptr: type = ptr_type %Derived [template = constants.%ptr.3] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %p.param: %ptr.3 = value_param runtime_param0 +// CHECK:STDOUT: %.loc30: type = splice_block %ptr [template = constants.%ptr.3] { +// CHECK:STDOUT: %Derived.ref: type = name_ref Derived, file.%Derived.decl [template = constants.%Derived] +// CHECK:STDOUT: %ptr: type = ptr_type %Derived [template = constants.%ptr.3] +// CHECK:STDOUT: } // CHECK:STDOUT: %p: %ptr.3 = bind_name p, %p.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -125,8 +129,6 @@ fn Call(p: Derived*) -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Base { -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc12: %Base.elem = field_decl a, element0 [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a [template = constants.%complete_type.3] // CHECK:STDOUT: @@ -145,10 +147,10 @@ fn Call(p: Derived*) -> i32 { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Base.ref.loc18: type = name_ref Base, file.%Base.decl [template = constants.%Base] // CHECK:STDOUT: %int_32.loc18: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc18: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %self.param.loc18: %Base = value_param runtime_param0 +// CHECK:STDOUT: %Base.ref.loc18: type = name_ref Base, file.%Base.decl [template = constants.%Base] // CHECK:STDOUT: %self.loc18: %Base = bind_name self, %self.param.loc18 // CHECK:STDOUT: %return.param.loc18: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return.loc18: ref %i32 = return_slot %return.param.loc18 @@ -156,11 +158,13 @@ fn Call(p: Derived*) -> i32 { // CHECK:STDOUT: %AddrSelfBase.decl: %AddrSelfBase.type = fn_decl @AddrSelfBase [template = constants.%AddrSelfBase] { // CHECK:STDOUT: %self.patt: %ptr.2 = binding_pattern self // CHECK:STDOUT: %self.param_patt: %ptr.2 = value_param_pattern %self.patt, runtime_param0 -// CHECK:STDOUT: %.loc26: auto = addr_pattern %self.param_patt +// CHECK:STDOUT: %.loc26_25: auto = addr_pattern %self.param_patt // CHECK:STDOUT: } { -// CHECK:STDOUT: %Base.ref.loc19: type = name_ref Base, file.%Base.decl [template = constants.%Base] -// CHECK:STDOUT: %ptr.loc19: type = ptr_type %Base [template = constants.%ptr.2] // CHECK:STDOUT: %self.param.loc19: %ptr.2 = value_param runtime_param0 +// CHECK:STDOUT: %.loc19: type = splice_block %ptr.loc19 [template = constants.%ptr.2] { +// CHECK:STDOUT: %Base.ref.loc19: type = name_ref Base, file.%Base.decl [template = constants.%Base] +// CHECK:STDOUT: %ptr.loc19: type = ptr_type %Base [template = constants.%ptr.2] +// CHECK:STDOUT: } // CHECK:STDOUT: %self.loc19: %ptr.2 = bind_name self, %self.param.loc19 // CHECK:STDOUT: } // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.base.1 [template = constants.%complete_type.4] diff --git a/toolchain/check/testdata/class/self_type.carbon b/toolchain/check/testdata/class/self_type.carbon index 31ff802a5992a..fc7227e9b72e5 100644 --- a/toolchain/check/testdata/class/self_type.carbon +++ b/toolchain/check/testdata/class/self_type.carbon @@ -59,10 +59,10 @@ fn Class.F[self: Self]() -> i32 { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref.loc21: type = name_ref Self, constants.%Class [template = constants.%Class] // CHECK:STDOUT: %int_32.loc21: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc21: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %self.param.loc21: %Class = value_param runtime_param0 +// CHECK:STDOUT: %Self.ref.loc21: type = name_ref Self, constants.%Class [template = constants.%Class] // CHECK:STDOUT: %self.loc21: %Class = bind_name self, %self.param.loc21 // CHECK:STDOUT: %return.param.loc21: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return.loc21: ref %i32 = return_slot %return.param.loc21 @@ -76,10 +76,10 @@ fn Class.F[self: Self]() -> i32 { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref.loc12: type = name_ref Self, constants.%Class [template = constants.%Class] // CHECK:STDOUT: %int_32.loc12: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc12: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %self.param.loc12: %Class = value_param runtime_param0 +// CHECK:STDOUT: %Self.ref.loc12: type = name_ref Self, constants.%Class [template = constants.%Class] // CHECK:STDOUT: %self.loc12: %Class = bind_name self, %self.param.loc12 // CHECK:STDOUT: %return.param.loc12: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return.loc12: ref %i32 = return_slot %return.param.loc12 @@ -88,12 +88,10 @@ fn Class.F[self: Self]() -> i32 { // CHECK:STDOUT: %return.patt: %Class = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %Class = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref.loc13: type = name_ref Self, constants.%Class [template = constants.%Class] +// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Class [template = constants.%Class] // CHECK:STDOUT: %return.param: ref %Class = out_param runtime_param0 // CHECK:STDOUT: %return: ref %Class = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Class [template = constants.%Class] -// CHECK:STDOUT: %ptr: type = ptr_type %Class [template = constants.%ptr.1] // CHECK:STDOUT: %.loc18: %Class.elem = field_decl p, element0 [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.p [template = constants.%complete_type.2] // CHECK:STDOUT: @@ -123,7 +121,6 @@ fn Class.F[self: Self]() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: fn @Make() -> %return.param_patt: %Class { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Self.ref.loc14: type = name_ref Self, constants.%Class [template = constants.%Class] // CHECK:STDOUT: %s: ref %Class = bind_name s, %return // CHECK:STDOUT: %s.ref.loc15_5: ref %Class = name_ref s, %s // CHECK:STDOUT: %s.ref.loc15_16: ref %Class = name_ref s, %s diff --git a/toolchain/check/testdata/class/static_method.carbon b/toolchain/check/testdata/class/static_method.carbon index 1f533238d1074..d74b9726f36fa 100644 --- a/toolchain/check/testdata/class/static_method.carbon +++ b/toolchain/check/testdata/class/static_method.carbon @@ -82,7 +82,6 @@ fn Run() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: fn @Run() -> %i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class] // CHECK:STDOUT: %c.var: ref %Class = var c // CHECK:STDOUT: %c: ref %Class = bind_name c, %c.var // CHECK:STDOUT: %c.ref: ref %Class = name_ref c, %c diff --git a/toolchain/check/testdata/class/syntactic_merge_literal.carbon b/toolchain/check/testdata/class/syntactic_merge_literal.carbon index f29cab40ed0e8..2e36a324be45c 100644 --- a/toolchain/check/testdata/class/syntactic_merge_literal.carbon +++ b/toolchain/check/testdata/class/syntactic_merge_literal.carbon @@ -78,41 +78,47 @@ class D(b:! C(1_000)) {} // CHECK:STDOUT: %a.patt.loc4_9.1: %i32 = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc4_9.2 (constants.%a.patt)] // CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt.loc4_9.1, runtime_param [symbolic = %a.patt.loc4_9.2 (constants.%a.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param +// CHECK:STDOUT: %.loc4: type = splice_block %i32 [template = constants.%i32] { +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a.loc4_9.1: %i32 = bind_symbolic_name a, 0, %a.param [symbolic = %a.loc4_9.2 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: %D.decl.loc5: %D.type = class_decl @D [template = constants.%D.generic] { // CHECK:STDOUT: %b.patt.loc6: %C.2 = symbolic_binding_pattern b, 0 [symbolic = constants.%b.patt] // CHECK:STDOUT: %b.param_patt: %C.2 = value_param_pattern %b.patt.loc6, runtime_param [symbolic = constants.%b.patt] // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref.loc5: %C.type = name_ref C, file.%C.decl [template = constants.%C.generic] -// CHECK:STDOUT: %int_1000.loc5: Core.IntLiteral = int_value 1000 [template = constants.%int_1000.1] -// CHECK:STDOUT: %impl.elem0.loc5: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc5: = bound_method %int_1000.loc5, %impl.elem0.loc5 [template = constants.%Convert.bound] -// CHECK:STDOUT: %Convert.specific_fn.loc5: = specific_function %Convert.bound.loc5, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked.loc5: init %i32 = call %Convert.specific_fn.loc5(%int_1000.loc5) [template = constants.%int_1000.2] -// CHECK:STDOUT: %.loc5_20.1: %i32 = value_of_initializer %int.convert_checked.loc5 [template = constants.%int_1000.2] -// CHECK:STDOUT: %.loc5_20.2: %i32 = converted %int_1000.loc5, %.loc5_20.1 [template = constants.%int_1000.2] -// CHECK:STDOUT: %C.loc5: type = class_type @C, @C(constants.%int_1000.2) [template = constants.%C.2] // CHECK:STDOUT: %b.param.loc5: %C.2 = value_param runtime_param +// CHECK:STDOUT: %.loc5_20.3: type = splice_block %C.loc5 [template = constants.%C.2] { +// CHECK:STDOUT: %C.ref.loc5: %C.type = name_ref C, file.%C.decl [template = constants.%C.generic] +// CHECK:STDOUT: %int_1000.loc5: Core.IntLiteral = int_value 1000 [template = constants.%int_1000.1] +// CHECK:STDOUT: %impl.elem0.loc5: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %Convert.bound.loc5: = bound_method %int_1000.loc5, %impl.elem0.loc5 [template = constants.%Convert.bound] +// CHECK:STDOUT: %Convert.specific_fn.loc5: = specific_function %Convert.bound.loc5, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %int.convert_checked.loc5: init %i32 = call %Convert.specific_fn.loc5(%int_1000.loc5) [template = constants.%int_1000.2] +// CHECK:STDOUT: %.loc5_20.1: %i32 = value_of_initializer %int.convert_checked.loc5 [template = constants.%int_1000.2] +// CHECK:STDOUT: %.loc5_20.2: %i32 = converted %int_1000.loc5, %.loc5_20.1 [template = constants.%int_1000.2] +// CHECK:STDOUT: %C.loc5: type = class_type @C, @C(constants.%int_1000.2) [template = constants.%C.2] +// CHECK:STDOUT: } // CHECK:STDOUT: %b.loc5_9.1: %C.2 = bind_symbolic_name b, 0, %b.param.loc5 [symbolic = %b.loc5_9.2 (constants.%b)] // CHECK:STDOUT: } // CHECK:STDOUT: %D.decl.loc6: %D.type = class_decl @D [template = constants.%D.generic] { // CHECK:STDOUT: %b.patt.loc6: %C.2 = symbolic_binding_pattern b, 0 [symbolic = constants.%b.patt] // CHECK:STDOUT: %b.param_patt: %C.2 = value_param_pattern %b.patt.loc6, runtime_param [symbolic = constants.%b.patt] // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref.loc6: %C.type = name_ref C, file.%C.decl [template = constants.%C.generic] -// CHECK:STDOUT: %int_1000.loc6: Core.IntLiteral = int_value 1000 [template = constants.%int_1000.1] -// CHECK:STDOUT: %impl.elem0.loc6: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc6: = bound_method %int_1000.loc6, %impl.elem0.loc6 [template = constants.%Convert.bound] -// CHECK:STDOUT: %Convert.specific_fn.loc6: = specific_function %Convert.bound.loc6, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked.loc6: init %i32 = call %Convert.specific_fn.loc6(%int_1000.loc6) [template = constants.%int_1000.2] -// CHECK:STDOUT: %.loc6_20.1: %i32 = value_of_initializer %int.convert_checked.loc6 [template = constants.%int_1000.2] -// CHECK:STDOUT: %.loc6_20.2: %i32 = converted %int_1000.loc6, %.loc6_20.1 [template = constants.%int_1000.2] -// CHECK:STDOUT: %C.loc6: type = class_type @C, @C(constants.%int_1000.2) [template = constants.%C.2] // CHECK:STDOUT: %b.param.loc6: %C.2 = value_param runtime_param +// CHECK:STDOUT: %.loc6_20.3: type = splice_block %C.loc6 [template = constants.%C.2] { +// CHECK:STDOUT: %C.ref.loc6: %C.type = name_ref C, file.%C.decl [template = constants.%C.generic] +// CHECK:STDOUT: %int_1000.loc6: Core.IntLiteral = int_value 1000 [template = constants.%int_1000.1] +// CHECK:STDOUT: %impl.elem0.loc6: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %Convert.bound.loc6: = bound_method %int_1000.loc6, %impl.elem0.loc6 [template = constants.%Convert.bound] +// CHECK:STDOUT: %Convert.specific_fn.loc6: = specific_function %Convert.bound.loc6, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %int.convert_checked.loc6: init %i32 = call %Convert.specific_fn.loc6(%int_1000.loc6) [template = constants.%int_1000.2] +// CHECK:STDOUT: %.loc6_20.1: %i32 = value_of_initializer %int.convert_checked.loc6 [template = constants.%int_1000.2] +// CHECK:STDOUT: %.loc6_20.2: %i32 = converted %int_1000.loc6, %.loc6_20.1 [template = constants.%int_1000.2] +// CHECK:STDOUT: %C.loc6: type = class_type @C, @C(constants.%int_1000.2) [template = constants.%C.2] +// CHECK:STDOUT: } // CHECK:STDOUT: %b.loc6: %C.2 = bind_symbolic_name b, 0, %b.param.loc6 [symbolic = constants.%b] // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -212,41 +218,47 @@ class D(b:! C(1_000)) {} // CHECK:STDOUT: %a.patt.loc4_9.1: %i32 = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc4_9.2 (constants.%a.patt)] // CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt.loc4_9.1, runtime_param [symbolic = %a.patt.loc4_9.2 (constants.%a.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param +// CHECK:STDOUT: %.loc4: type = splice_block %i32 [template = constants.%i32] { +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a.loc4_9.1: %i32 = bind_symbolic_name a, 0, %a.param [symbolic = %a.loc4_9.2 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: %D.decl: %D.type = class_decl @D [template = constants.%D.generic] { // CHECK:STDOUT: %b.patt.loc5_9.1: %C.2 = symbolic_binding_pattern b, 0 [symbolic = %b.patt.loc5_9.2 (constants.%b.patt)] // CHECK:STDOUT: %b.param_patt: %C.2 = value_param_pattern %b.patt.loc5_9.1, runtime_param [symbolic = %b.patt.loc5_9.2 (constants.%b.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [template = constants.%C.generic] -// CHECK:STDOUT: %int_1000: Core.IntLiteral = int_value 1000 [template = constants.%int_1000.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_1000, %impl.elem0 [template = constants.%Convert.bound] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_1000) [template = constants.%int_1000.2] -// CHECK:STDOUT: %.loc5_19.1: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_1000.2] -// CHECK:STDOUT: %.loc5_19.2: %i32 = converted %int_1000, %.loc5_19.1 [template = constants.%int_1000.2] -// CHECK:STDOUT: %C: type = class_type @C, @C(constants.%int_1000.2) [template = constants.%C.2] // CHECK:STDOUT: %b.param: %C.2 = value_param runtime_param +// CHECK:STDOUT: %.loc5_19.3: type = splice_block %C [template = constants.%C.2] { +// CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [template = constants.%C.generic] +// CHECK:STDOUT: %int_1000: Core.IntLiteral = int_value 1000 [template = constants.%int_1000.1] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %Convert.bound: = bound_method %int_1000, %impl.elem0 [template = constants.%Convert.bound] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_1000) [template = constants.%int_1000.2] +// CHECK:STDOUT: %.loc5_19.1: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_1000.2] +// CHECK:STDOUT: %.loc5_19.2: %i32 = converted %int_1000, %.loc5_19.1 [template = constants.%int_1000.2] +// CHECK:STDOUT: %C: type = class_type @C, @C(constants.%int_1000.2) [template = constants.%C.2] +// CHECK:STDOUT: } // CHECK:STDOUT: %b.loc5_9.1: %C.2 = bind_symbolic_name b, 0, %b.param [symbolic = %b.loc5_9.2 (constants.%b)] // CHECK:STDOUT: } // CHECK:STDOUT: %.decl: %.type = class_decl @.1 [template = constants.%.generic] { // CHECK:STDOUT: %b.patt.loc12_9.1: %C.2 = symbolic_binding_pattern b, 0 [symbolic = %b.patt.loc12_9.2 (constants.%b.patt)] // CHECK:STDOUT: %b.param_patt: %C.2 = value_param_pattern %b.patt.loc12_9.1, runtime_param [symbolic = %b.patt.loc12_9.2 (constants.%b.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [template = constants.%C.generic] -// CHECK:STDOUT: %int_1000: Core.IntLiteral = int_value 1000 [template = constants.%int_1000.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_1000, %impl.elem0 [template = constants.%Convert.bound] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_1000) [template = constants.%int_1000.2] -// CHECK:STDOUT: %.loc12_20.1: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_1000.2] -// CHECK:STDOUT: %.loc12_20.2: %i32 = converted %int_1000, %.loc12_20.1 [template = constants.%int_1000.2] -// CHECK:STDOUT: %C: type = class_type @C, @C(constants.%int_1000.2) [template = constants.%C.2] // CHECK:STDOUT: %b.param: %C.2 = value_param runtime_param +// CHECK:STDOUT: %.loc12_20.3: type = splice_block %C [template = constants.%C.2] { +// CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [template = constants.%C.generic] +// CHECK:STDOUT: %int_1000: Core.IntLiteral = int_value 1000 [template = constants.%int_1000.1] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %Convert.bound: = bound_method %int_1000, %impl.elem0 [template = constants.%Convert.bound] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_1000) [template = constants.%int_1000.2] +// CHECK:STDOUT: %.loc12_20.1: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_1000.2] +// CHECK:STDOUT: %.loc12_20.2: %i32 = converted %int_1000, %.loc12_20.1 [template = constants.%int_1000.2] +// CHECK:STDOUT: %C: type = class_type @C, @C(constants.%int_1000.2) [template = constants.%C.2] +// CHECK:STDOUT: } // CHECK:STDOUT: %b.loc12_9.1: %C.2 = bind_symbolic_name b, 0, %b.param [symbolic = %b.loc12_9.2 (constants.%b)] // CHECK:STDOUT: } // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/todo_access_modifiers.carbon b/toolchain/check/testdata/class/todo_access_modifiers.carbon index 5ca3193059b69..ff55c85f8c30d 100644 --- a/toolchain/check/testdata/class/todo_access_modifiers.carbon +++ b/toolchain/check/testdata/class/todo_access_modifiers.carbon @@ -54,11 +54,7 @@ class Access { // CHECK:STDOUT: class @Access { // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {} // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] {} {} -// CHECK:STDOUT: %int_32.loc17: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc17: %Access.elem = field_decl k, element0 [template] -// CHECK:STDOUT: %int_32.loc19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc19: %Access.elem = field_decl l, element1 [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.k.l [template = constants.%complete_type.3] // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/virtual_modifiers.carbon b/toolchain/check/testdata/class/virtual_modifiers.carbon index 2e9bca9f20758..ef3ca23227d61 100644 --- a/toolchain/check/testdata/class/virtual_modifiers.carbon +++ b/toolchain/check/testdata/class/virtual_modifiers.carbon @@ -266,7 +266,6 @@ class Derived { // CHECK:STDOUT: .Base = %import_ref.1 // CHECK:STDOUT: import Modifiers//default // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref Modifiers//default, Base, loaded [template = constants.%Base] // CHECK:STDOUT: %import_ref.2: = import_ref Modifiers//default, loc6_1, loaded [template = constants.%complete_type] // CHECK:STDOUT: %import_ref.3 = import_ref Modifiers//default, inst16 [no loc], unloaded // CHECK:STDOUT: %import_ref.4 = import_ref Modifiers//default, loc5_17, unloaded @@ -292,8 +291,6 @@ class Derived { // CHECK:STDOUT: // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Modifiers.ref: = name_ref Modifiers, imports.%Modifiers [template = imports.%Modifiers] -// CHECK:STDOUT: %Base.ref: type = name_ref Base, imports.%import_ref.1 [template = constants.%Base] // CHECK:STDOUT: %v.var: ref %Base = var v // CHECK:STDOUT: %v: ref %Base = bind_name v, %v.var // CHECK:STDOUT: %.loc7_28.1: %empty_struct_type = struct_literal () @@ -550,11 +547,7 @@ class Derived { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Base { -// CHECK:STDOUT: %int_32.loc5: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc5: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc5: %Base.elem = field_decl m1, element1 [template] -// CHECK:STDOUT: %int_32.loc6: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc6: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc6: %Base.elem = field_decl m2, element2 [template] // CHECK:STDOUT: %F.decl: %F.type.1 = fn_decl @F.1 [template = constants.%F.1] {} {} // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.vptr.m1.m2 [template = constants.%complete_type.3] @@ -571,8 +564,6 @@ class Derived { // CHECK:STDOUT: // CHECK:STDOUT: fn @F.2() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %i.var: ref %i32 = var i // CHECK:STDOUT: %i: ref %i32 = bind_name i, %i.var // CHECK:STDOUT: %int_3.loc12: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] @@ -582,7 +573,6 @@ class Derived { // CHECK:STDOUT: %int.convert_checked.loc12: init %i32 = call %Convert.specific_fn.loc12(%int_3.loc12) [template = constants.%int_3.2] // CHECK:STDOUT: %.loc12: init %i32 = converted %int_3.loc12, %int.convert_checked.loc12 [template = constants.%int_3.2] // CHECK:STDOUT: assign %i.var, %.loc12 -// CHECK:STDOUT: %Base.ref.loc14: type = name_ref Base, file.%Base.decl [template = constants.%Base] // CHECK:STDOUT: %b1.var: ref %Base = var b1 // CHECK:STDOUT: %b1: ref %Base = bind_name b1, %b1.var // CHECK:STDOUT: %i.ref.loc14_25: ref %i32 = name_ref i, %i @@ -600,7 +590,6 @@ class Derived { // CHECK:STDOUT: %.loc14_35.9: init %Base = class_init (%.loc14_35.4, %.loc14_35.6, %.loc14_35.8), %b1.var // CHECK:STDOUT: %.loc14_36: init %Base = converted %.loc14_35.1, %.loc14_35.9 // CHECK:STDOUT: assign %b1.var, %.loc14_36 -// CHECK:STDOUT: %Base.ref.loc15: type = name_ref Base, file.%Base.decl [template = constants.%Base] // CHECK:STDOUT: %b2.var: ref %Base = var b2 // CHECK:STDOUT: %b2: ref %Base = bind_name b2, %b2.var // CHECK:STDOUT: %int_3.loc15: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] diff --git a/toolchain/check/testdata/const/basic.carbon b/toolchain/check/testdata/const/basic.carbon index 7d9ac7c06746a..61b7489f559e4 100644 --- a/toolchain/check/testdata/const/basic.carbon +++ b/toolchain/check/testdata/const/basic.carbon @@ -53,17 +53,19 @@ fn B(p: const (i32*)) -> const (i32*) { // CHECK:STDOUT: %return.patt: %ptr.2 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %ptr.2 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc11_15: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc11_15: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %const.loc11_9: type = const_type %i32 [template = constants.%const.1] -// CHECK:STDOUT: %ptr.loc11_18: type = ptr_type %const.1 [template = constants.%ptr.1] -// CHECK:STDOUT: %ptr.loc11_19: type = ptr_type %ptr.1 [template = constants.%ptr.2] // CHECK:STDOUT: %int_32.loc11_31: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc11_31: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %const.loc11_25: type = const_type %i32 [template = constants.%const.1] // CHECK:STDOUT: %ptr.loc11_34: type = ptr_type %const.1 [template = constants.%ptr.1] // CHECK:STDOUT: %ptr.loc11_35: type = ptr_type %ptr.1 [template = constants.%ptr.2] // CHECK:STDOUT: %p.param: %ptr.2 = value_param runtime_param0 +// CHECK:STDOUT: %.loc11: type = splice_block %ptr.loc11_19 [template = constants.%ptr.2] { +// CHECK:STDOUT: %int_32.loc11_15: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc11_15: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %const.loc11_9: type = const_type %i32 [template = constants.%const.1] +// CHECK:STDOUT: %ptr.loc11_18: type = ptr_type %const.1 [template = constants.%ptr.1] +// CHECK:STDOUT: %ptr.loc11_19: type = ptr_type %ptr.1 [template = constants.%ptr.2] +// CHECK:STDOUT: } // CHECK:STDOUT: %p: %ptr.2 = bind_name p, %p.param // CHECK:STDOUT: %return.param: ref %ptr.2 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %ptr.2 = return_slot %return.param @@ -74,15 +76,17 @@ fn B(p: const (i32*)) -> const (i32*) { // CHECK:STDOUT: %return.patt: %const.2 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %const.2 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc15_16: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc15_16: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %ptr.loc15_19: type = ptr_type %i32 [template = constants.%ptr.3] -// CHECK:STDOUT: %const.loc15_9: type = const_type %ptr.3 [template = constants.%const.2] // CHECK:STDOUT: %int_32.loc15_33: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc15_33: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %ptr.loc15_36: type = ptr_type %i32 [template = constants.%ptr.3] // CHECK:STDOUT: %const.loc15_26: type = const_type %ptr.3 [template = constants.%const.2] // CHECK:STDOUT: %p.param: %const.2 = value_param runtime_param0 +// CHECK:STDOUT: %.loc15: type = splice_block %const.loc15_9 [template = constants.%const.2] { +// CHECK:STDOUT: %int_32.loc15_16: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc15_16: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %ptr.loc15_19: type = ptr_type %i32 [template = constants.%ptr.3] +// CHECK:STDOUT: %const.loc15_9: type = const_type %ptr.3 [template = constants.%const.2] +// CHECK:STDOUT: } // CHECK:STDOUT: %p: %const.2 = bind_name p, %p.param // CHECK:STDOUT: %return.param: ref %const.2 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %const.2 = return_slot %return.param diff --git a/toolchain/check/testdata/const/collapse.carbon b/toolchain/check/testdata/const/collapse.carbon index 78a508b4f57cf..8dc7107441983 100644 --- a/toolchain/check/testdata/const/collapse.carbon +++ b/toolchain/check/testdata/const/collapse.carbon @@ -48,11 +48,6 @@ fn F(p: const i32**) -> const (const i32)** { // CHECK:STDOUT: %return.patt: %ptr.2 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %ptr.2 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc15_15: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc15_15: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %const.loc15_9: type = const_type %i32 [template = constants.%const] -// CHECK:STDOUT: %ptr.loc15_18: type = ptr_type %const [template = constants.%ptr.1] -// CHECK:STDOUT: %ptr.loc15_19: type = ptr_type %ptr.1 [template = constants.%ptr.2] // CHECK:STDOUT: %int_32.loc15_38: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc15_38: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %const.loc15_32: type = const_type %i32 [template = constants.%const] @@ -60,6 +55,13 @@ fn F(p: const i32**) -> const (const i32)** { // CHECK:STDOUT: %ptr.loc15_42: type = ptr_type %const [template = constants.%ptr.1] // CHECK:STDOUT: %ptr.loc15_43: type = ptr_type %ptr.1 [template = constants.%ptr.2] // CHECK:STDOUT: %p.param: %ptr.2 = value_param runtime_param0 +// CHECK:STDOUT: %.loc15: type = splice_block %ptr.loc15_19 [template = constants.%ptr.2] { +// CHECK:STDOUT: %int_32.loc15_15: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc15_15: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %const.loc15_9: type = const_type %i32 [template = constants.%const] +// CHECK:STDOUT: %ptr.loc15_18: type = ptr_type %const [template = constants.%ptr.1] +// CHECK:STDOUT: %ptr.loc15_19: type = ptr_type %ptr.1 [template = constants.%ptr.2] +// CHECK:STDOUT: } // CHECK:STDOUT: %p: %ptr.2 = bind_name p, %p.param // CHECK:STDOUT: %return.param: ref %ptr.2 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %ptr.2 = return_slot %return.param diff --git a/toolchain/check/testdata/const/fail_collapse.carbon b/toolchain/check/testdata/const/fail_collapse.carbon index 9a2ca3f3f0e8b..45eaddef75c10 100644 --- a/toolchain/check/testdata/const/fail_collapse.carbon +++ b/toolchain/check/testdata/const/fail_collapse.carbon @@ -57,17 +57,19 @@ fn G(p: const (const i32)**) -> i32** { // CHECK:STDOUT: %return.patt: %ptr.4 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %ptr.4 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc15_22: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc15_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %const.loc15_16: type = const_type %i32 [template = constants.%const] -// CHECK:STDOUT: %const.loc15_9: type = const_type %const [template = constants.%const] -// CHECK:STDOUT: %ptr.loc15_26: type = ptr_type %const [template = constants.%ptr.1] -// CHECK:STDOUT: %ptr.loc15_27: type = ptr_type %ptr.1 [template = constants.%ptr.2] // CHECK:STDOUT: %int_32.loc15_33: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc15_33: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %ptr.loc15_36: type = ptr_type %i32 [template = constants.%ptr.3] // CHECK:STDOUT: %ptr.loc15_37: type = ptr_type %ptr.3 [template = constants.%ptr.4] // CHECK:STDOUT: %p.param: %ptr.2 = value_param runtime_param0 +// CHECK:STDOUT: %.loc15: type = splice_block %ptr.loc15_27 [template = constants.%ptr.2] { +// CHECK:STDOUT: %int_32.loc15_22: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc15_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %const.loc15_16: type = const_type %i32 [template = constants.%const] +// CHECK:STDOUT: %const.loc15_9: type = const_type %const [template = constants.%const] +// CHECK:STDOUT: %ptr.loc15_26: type = ptr_type %const [template = constants.%ptr.1] +// CHECK:STDOUT: %ptr.loc15_27: type = ptr_type %ptr.1 [template = constants.%ptr.2] +// CHECK:STDOUT: } // CHECK:STDOUT: %p: %ptr.2 = bind_name p, %p.param // CHECK:STDOUT: %return.param: ref %ptr.4 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %ptr.4 = return_slot %return.param diff --git a/toolchain/check/testdata/const/import.carbon b/toolchain/check/testdata/const/import.carbon index 6542ef8664921..d6081fd8ab91a 100644 --- a/toolchain/check/testdata/const/import.carbon +++ b/toolchain/check/testdata/const/import.carbon @@ -63,15 +63,8 @@ var a_ptr: const i32* = a_ptr_ref; // CHECK:STDOUT: %return.param: ref %const = out_param runtime_param0 // CHECK:STDOUT: %return: ref %const = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %int_32.loc6: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc6: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %const.loc6: type = const_type %i32 [template = constants.%const] // CHECK:STDOUT: %a_ref.var: ref %const = var a_ref // CHECK:STDOUT: %a_ref: ref %const = bind_name a_ref, %a_ref.var -// CHECK:STDOUT: %int_32.loc7: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc7: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %const.loc7: type = const_type %i32 [template = constants.%const] -// CHECK:STDOUT: %ptr: type = ptr_type %const [template = constants.%ptr] // CHECK:STDOUT: %a_ptr_ref.var: ref %ptr = var a_ptr_ref // CHECK:STDOUT: %a_ptr_ref: ref %ptr = bind_name a_ptr_ref, %a_ptr_ref.var // CHECK:STDOUT: } @@ -121,16 +114,8 @@ var a_ptr: const i32* = a_ptr_ref; // CHECK:STDOUT: %Implicit.import = import Implicit // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int_32.loc6: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc6: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %const.loc6: type = const_type %i32 [template = constants.%const] -// CHECK:STDOUT: %ptr.loc6: type = ptr_type %const [template = constants.%ptr] // CHECK:STDOUT: %a.var: ref %ptr = var a // CHECK:STDOUT: %a: ref %ptr = bind_name a, %a.var -// CHECK:STDOUT: %int_32.loc7: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc7: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %const.loc7: type = const_type %i32 [template = constants.%const] -// CHECK:STDOUT: %ptr.loc7: type = ptr_type %const [template = constants.%ptr] // CHECK:STDOUT: %a_ptr.var: ref %ptr = var a_ptr // CHECK:STDOUT: %a_ptr: ref %ptr = bind_name a_ptr, %a_ptr.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/deduce/array.carbon b/toolchain/check/testdata/deduce/array.carbon index 7d54e8d6624a7..d9b8fd354ac2c 100644 --- a/toolchain/check/testdata/deduce/array.carbon +++ b/toolchain/check/testdata/deduce/array.carbon @@ -159,13 +159,15 @@ fn G() -> C { // CHECK:STDOUT: %return.patt: @F.%T.loc6_6.2 (%T) = return_slot_pattern // CHECK:STDOUT: %return.param_patt: @F.%T.loc6_6.2 (%T) = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.ref.loc6_20: type = name_ref T, %T.loc6_6.1 [symbolic = %T.loc6_6.2 (constants.%T)] -// CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3] -// CHECK:STDOUT: %array_type.loc6_24.1: type = array_type %int_3, %T [symbolic = %array_type.loc6_24.2 (constants.%array_type.1)] // CHECK:STDOUT: %T.ref.loc6_30: type = name_ref T, %T.loc6_6.1 [symbolic = %T.loc6_6.2 (constants.%T)] // CHECK:STDOUT: %T.param: type = value_param runtime_param // CHECK:STDOUT: %T.loc6_6.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc6_6.2 (constants.%T)] // CHECK:STDOUT: %a.param: @F.%array_type.loc6_24.2 (%array_type.1) = value_param runtime_param0 +// CHECK:STDOUT: %.loc6_24: type = splice_block %array_type.loc6_24.1 [symbolic = %array_type.loc6_24.2 (constants.%array_type.1)] { +// CHECK:STDOUT: %T.ref.loc6_20: type = name_ref T, %T.loc6_6.1 [symbolic = %T.loc6_6.2 (constants.%T)] +// CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3] +// CHECK:STDOUT: %array_type.loc6_24.1: type = array_type %int_3, %T [symbolic = %array_type.loc6_24.2 (constants.%array_type.1)] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: @F.%array_type.loc6_24.2 (%array_type.1) = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref @F.%T.loc6_6.2 (%T) = out_param runtime_param1 // CHECK:STDOUT: %return: ref @F.%T.loc6_6.2 (%T) = return_slot %return.param @@ -174,7 +176,7 @@ fn G() -> C { // CHECK:STDOUT: %return.patt: %C = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %C = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref.loc8: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %return.param: ref %C = out_param runtime_param0 // CHECK:STDOUT: %return: ref %C = return_slot %return.param // CHECK:STDOUT: } @@ -218,9 +220,6 @@ fn G() -> C { // CHECK:STDOUT: // CHECK:STDOUT: fn @G() -> %return.param_patt: %C { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %C.ref.loc9: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3] -// CHECK:STDOUT: %array_type: type = array_type %int_3, %C [template = constants.%array_type.2] // CHECK:STDOUT: %a.var: ref %array_type.2 = var a // CHECK:STDOUT: %a: ref %array_type.2 = bind_name a, %a.var // CHECK:STDOUT: %.loc9_21.1: %empty_struct_type = struct_literal () @@ -324,22 +323,26 @@ fn G() -> C { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc10_10: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc10_10: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %N.ref.loc10_22: %i32 = name_ref N, %N.loc10_6.1 [symbolic = %N.loc10_6.2 (constants.%N.2)] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.9] -// CHECK:STDOUT: %Convert.bound.loc10_22.1: = bound_method %N.ref.loc10_22, %impl.elem0 [symbolic = %Convert.bound.loc10_22.2 (constants.%Convert.bound)] -// CHECK:STDOUT: %Convert.specific_fn.loc10_22.1: = specific_function %Convert.bound.loc10_22.1, @Convert.3(constants.%int_32) [symbolic = %Convert.specific_fn.loc10_22.2 (constants.%Convert.specific_fn)] -// CHECK:STDOUT: %int.convert_checked.loc10_22.1: init Core.IntLiteral = call %Convert.specific_fn.loc10_22.1(%N.ref.loc10_22) [symbolic = %int.convert_checked.loc10_22.2 (constants.%int.convert_checked)] -// CHECK:STDOUT: %.loc10_22.1: Core.IntLiteral = value_of_initializer %int.convert_checked.loc10_22.1 [symbolic = %int.convert_checked.loc10_22.2 (constants.%int.convert_checked)] -// CHECK:STDOUT: %.loc10_22.2: Core.IntLiteral = converted %N.ref.loc10_22, %.loc10_22.1 [symbolic = %int.convert_checked.loc10_22.2 (constants.%int.convert_checked)] -// CHECK:STDOUT: %array_type: type = array_type %.loc10_22.2, %C [template = ] // CHECK:STDOUT: %int_32.loc10_29: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc10_29: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %N.param: %i32 = value_param runtime_param +// CHECK:STDOUT: %.loc10_10: type = splice_block %i32.loc10_10 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc10_10: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc10_10: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %N.loc10_6.1: %i32 = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc10_6.2 (constants.%N.2)] // CHECK:STDOUT: %a.param: = value_param runtime_param0 +// CHECK:STDOUT: %.loc10_23: type = splice_block %array_type [template = ] { +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %N.ref.loc10_22: %i32 = name_ref N, %N.loc10_6.1 [symbolic = %N.loc10_6.2 (constants.%N.2)] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.9] +// CHECK:STDOUT: %Convert.bound.loc10_22.1: = bound_method %N.ref.loc10_22, %impl.elem0 [symbolic = %Convert.bound.loc10_22.2 (constants.%Convert.bound)] +// CHECK:STDOUT: %Convert.specific_fn.loc10_22.1: = specific_function %Convert.bound.loc10_22.1, @Convert.3(constants.%int_32) [symbolic = %Convert.specific_fn.loc10_22.2 (constants.%Convert.specific_fn)] +// CHECK:STDOUT: %int.convert_checked.loc10_22.1: init Core.IntLiteral = call %Convert.specific_fn.loc10_22.1(%N.ref.loc10_22) [symbolic = %int.convert_checked.loc10_22.2 (constants.%int.convert_checked)] +// CHECK:STDOUT: %.loc10_22.1: Core.IntLiteral = value_of_initializer %int.convert_checked.loc10_22.1 [symbolic = %int.convert_checked.loc10_22.2 (constants.%int.convert_checked)] +// CHECK:STDOUT: %.loc10_22.2: Core.IntLiteral = converted %N.ref.loc10_22, %.loc10_22.1 [symbolic = %int.convert_checked.loc10_22.2 (constants.%int.convert_checked)] +// CHECK:STDOUT: %array_type: type = array_type %.loc10_22.2, %C [template = ] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -348,7 +351,7 @@ fn G() -> C { // CHECK:STDOUT: %return.patt: %C = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %C = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref.loc12: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %return.param: ref %C = out_param runtime_param0 // CHECK:STDOUT: %return: ref %C = return_slot %return.param // CHECK:STDOUT: } @@ -380,9 +383,6 @@ fn G() -> C { // CHECK:STDOUT: // CHECK:STDOUT: fn @G() -> %return.param_patt: %C { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %C.ref.loc13: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3] -// CHECK:STDOUT: %array_type: type = array_type %int_3, %C [template = constants.%array_type] // CHECK:STDOUT: %a.var: ref %array_type = var a // CHECK:STDOUT: %a: ref %array_type = bind_name a, %a.var // CHECK:STDOUT: %.loc13_21.1: %empty_struct_type = struct_literal () @@ -478,23 +478,27 @@ fn G() -> C { // CHECK:STDOUT: %return.patt: @F.%T.loc10_6.2 (%T) = return_slot_pattern // CHECK:STDOUT: %return.param_patt: @F.%T.loc10_6.2 (%T) = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %T.ref.loc10_29: type = name_ref T, %T.loc10_6.1 [symbolic = %T.loc10_6.2 (constants.%T)] -// CHECK:STDOUT: %N.ref: %i32 = name_ref N, %N.loc10_16.1 [symbolic = %N.loc10_16.2 (constants.%N.2)] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.9] -// CHECK:STDOUT: %Convert.bound.loc10_32.1: = bound_method %N.ref, %impl.elem0 [symbolic = %Convert.bound.loc10_32.2 (constants.%Convert.bound)] -// CHECK:STDOUT: %Convert.specific_fn.loc10_32.1: = specific_function %Convert.bound.loc10_32.1, @Convert.3(constants.%int_32) [symbolic = %Convert.specific_fn.loc10_32.2 (constants.%Convert.specific_fn)] -// CHECK:STDOUT: %int.convert_checked.loc10_32.1: init Core.IntLiteral = call %Convert.specific_fn.loc10_32.1(%N.ref) [symbolic = %int.convert_checked.loc10_32.2 (constants.%int.convert_checked)] -// CHECK:STDOUT: %.loc10_32.1: Core.IntLiteral = value_of_initializer %int.convert_checked.loc10_32.1 [symbolic = %int.convert_checked.loc10_32.2 (constants.%int.convert_checked)] -// CHECK:STDOUT: %.loc10_32.2: Core.IntLiteral = converted %N.ref, %.loc10_32.1 [symbolic = %int.convert_checked.loc10_32.2 (constants.%int.convert_checked)] -// CHECK:STDOUT: %array_type: type = array_type %.loc10_32.2, %T [template = ] // CHECK:STDOUT: %T.ref.loc10_39: type = name_ref T, %T.loc10_6.1 [symbolic = %T.loc10_6.2 (constants.%T)] // CHECK:STDOUT: %T.param: type = value_param runtime_param // CHECK:STDOUT: %T.loc10_6.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc10_6.2 (constants.%T)] // CHECK:STDOUT: %N.param: %i32 = value_param runtime_param +// CHECK:STDOUT: %.loc10_20: type = splice_block %i32 [template = constants.%i32] { +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %N.loc10_16.1: %i32 = bind_symbolic_name N, 1, %N.param [symbolic = %N.loc10_16.2 (constants.%N.2)] // CHECK:STDOUT: %a.param: = value_param runtime_param0 +// CHECK:STDOUT: %.loc10_33: type = splice_block %array_type [template = ] { +// CHECK:STDOUT: %T.ref.loc10_29: type = name_ref T, %T.loc10_6.1 [symbolic = %T.loc10_6.2 (constants.%T)] +// CHECK:STDOUT: %N.ref: %i32 = name_ref N, %N.loc10_16.1 [symbolic = %N.loc10_16.2 (constants.%N.2)] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.9] +// CHECK:STDOUT: %Convert.bound.loc10_32.1: = bound_method %N.ref, %impl.elem0 [symbolic = %Convert.bound.loc10_32.2 (constants.%Convert.bound)] +// CHECK:STDOUT: %Convert.specific_fn.loc10_32.1: = specific_function %Convert.bound.loc10_32.1, @Convert.3(constants.%int_32) [symbolic = %Convert.specific_fn.loc10_32.2 (constants.%Convert.specific_fn)] +// CHECK:STDOUT: %int.convert_checked.loc10_32.1: init Core.IntLiteral = call %Convert.specific_fn.loc10_32.1(%N.ref) [symbolic = %int.convert_checked.loc10_32.2 (constants.%int.convert_checked)] +// CHECK:STDOUT: %.loc10_32.1: Core.IntLiteral = value_of_initializer %int.convert_checked.loc10_32.1 [symbolic = %int.convert_checked.loc10_32.2 (constants.%int.convert_checked)] +// CHECK:STDOUT: %.loc10_32.2: Core.IntLiteral = converted %N.ref, %.loc10_32.1 [symbolic = %int.convert_checked.loc10_32.2 (constants.%int.convert_checked)] +// CHECK:STDOUT: %array_type: type = array_type %.loc10_32.2, %T [template = ] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref @F.%T.loc10_6.2 (%T) = out_param runtime_param1 // CHECK:STDOUT: %return: ref @F.%T.loc10_6.2 (%T) = return_slot %return.param @@ -503,7 +507,7 @@ fn G() -> C { // CHECK:STDOUT: %return.patt: %C = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %C = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref.loc12: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %return.param: ref %C = out_param runtime_param0 // CHECK:STDOUT: %return: ref %C = return_slot %return.param // CHECK:STDOUT: } @@ -531,9 +535,6 @@ fn G() -> C { // CHECK:STDOUT: // CHECK:STDOUT: fn @G() -> %return.param_patt: %C { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %C.ref.loc13: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3] -// CHECK:STDOUT: %array_type: type = array_type %int_3, %C [template = constants.%array_type] // CHECK:STDOUT: %a.var: ref %array_type = var a // CHECK:STDOUT: %a: ref %array_type = bind_name a, %a.var // CHECK:STDOUT: %.loc13_21.1: %empty_struct_type = struct_literal () @@ -633,13 +634,15 @@ fn G() -> C { // CHECK:STDOUT: %return.patt: @F.%T.loc6_6.2 (%T) = return_slot_pattern // CHECK:STDOUT: %return.param_patt: @F.%T.loc6_6.2 (%T) = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.ref.loc6_20: type = name_ref T, %T.loc6_6.1 [symbolic = %T.loc6_6.2 (constants.%T)] -// CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2] -// CHECK:STDOUT: %array_type.loc6_24.1: type = array_type %int_2, %T [symbolic = %array_type.loc6_24.2 (constants.%array_type.1)] // CHECK:STDOUT: %T.ref.loc6_30: type = name_ref T, %T.loc6_6.1 [symbolic = %T.loc6_6.2 (constants.%T)] // CHECK:STDOUT: %T.param: type = value_param runtime_param // CHECK:STDOUT: %T.loc6_6.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc6_6.2 (constants.%T)] // CHECK:STDOUT: %a.param: @F.%array_type.loc6_24.2 (%array_type.1) = value_param runtime_param0 +// CHECK:STDOUT: %.loc6_24: type = splice_block %array_type.loc6_24.1 [symbolic = %array_type.loc6_24.2 (constants.%array_type.1)] { +// CHECK:STDOUT: %T.ref.loc6_20: type = name_ref T, %T.loc6_6.1 [symbolic = %T.loc6_6.2 (constants.%T)] +// CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2] +// CHECK:STDOUT: %array_type.loc6_24.1: type = array_type %int_2, %T [symbolic = %array_type.loc6_24.2 (constants.%array_type.1)] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: @F.%array_type.loc6_24.2 (%array_type.1) = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref @F.%T.loc6_6.2 (%T) = out_param runtime_param1 // CHECK:STDOUT: %return: ref @F.%T.loc6_6.2 (%T) = return_slot %return.param @@ -648,7 +651,7 @@ fn G() -> C { // CHECK:STDOUT: %return.patt: %C = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %C = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref.loc8: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %return.param: ref %C = out_param runtime_param0 // CHECK:STDOUT: %return: ref %C = return_slot %return.param // CHECK:STDOUT: } @@ -692,9 +695,6 @@ fn G() -> C { // CHECK:STDOUT: // CHECK:STDOUT: fn @G() -> %return.param_patt: %C { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %C.ref.loc10: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3] -// CHECK:STDOUT: %array_type: type = array_type %int_3, %C [template = constants.%array_type.2] // CHECK:STDOUT: %a.var: ref %array_type.2 = var a // CHECK:STDOUT: %a: ref %array_type.2 = bind_name a, %a.var // CHECK:STDOUT: %.loc10_21.1: %empty_struct_type = struct_literal () @@ -801,22 +801,26 @@ fn G() -> C { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc10_10: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc10_10: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %N.ref.loc10_22: %i32 = name_ref N, %N.loc10_6.1 [symbolic = %N.loc10_6.2 (constants.%N.2)] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.9] -// CHECK:STDOUT: %Convert.bound.loc10_22.1: = bound_method %N.ref.loc10_22, %impl.elem0 [symbolic = %Convert.bound.loc10_22.2 (constants.%Convert.bound)] -// CHECK:STDOUT: %Convert.specific_fn.loc10_22.1: = specific_function %Convert.bound.loc10_22.1, @Convert.3(constants.%int_32) [symbolic = %Convert.specific_fn.loc10_22.2 (constants.%Convert.specific_fn)] -// CHECK:STDOUT: %int.convert_checked.loc10_22.1: init Core.IntLiteral = call %Convert.specific_fn.loc10_22.1(%N.ref.loc10_22) [symbolic = %int.convert_checked.loc10_22.2 (constants.%int.convert_checked)] -// CHECK:STDOUT: %.loc10_22.1: Core.IntLiteral = value_of_initializer %int.convert_checked.loc10_22.1 [symbolic = %int.convert_checked.loc10_22.2 (constants.%int.convert_checked)] -// CHECK:STDOUT: %.loc10_22.2: Core.IntLiteral = converted %N.ref.loc10_22, %.loc10_22.1 [symbolic = %int.convert_checked.loc10_22.2 (constants.%int.convert_checked)] -// CHECK:STDOUT: %array_type: type = array_type %.loc10_22.2, %C [template = ] // CHECK:STDOUT: %int_32.loc10_29: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc10_29: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %N.param: %i32 = value_param runtime_param +// CHECK:STDOUT: %.loc10_10: type = splice_block %i32.loc10_10 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc10_10: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc10_10: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %N.loc10_6.1: %i32 = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc10_6.2 (constants.%N.2)] // CHECK:STDOUT: %a.param: = value_param runtime_param0 +// CHECK:STDOUT: %.loc10_23: type = splice_block %array_type [template = ] { +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %N.ref.loc10_22: %i32 = name_ref N, %N.loc10_6.1 [symbolic = %N.loc10_6.2 (constants.%N.2)] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.9] +// CHECK:STDOUT: %Convert.bound.loc10_22.1: = bound_method %N.ref.loc10_22, %impl.elem0 [symbolic = %Convert.bound.loc10_22.2 (constants.%Convert.bound)] +// CHECK:STDOUT: %Convert.specific_fn.loc10_22.1: = specific_function %Convert.bound.loc10_22.1, @Convert.3(constants.%int_32) [symbolic = %Convert.specific_fn.loc10_22.2 (constants.%Convert.specific_fn)] +// CHECK:STDOUT: %int.convert_checked.loc10_22.1: init Core.IntLiteral = call %Convert.specific_fn.loc10_22.1(%N.ref.loc10_22) [symbolic = %int.convert_checked.loc10_22.2 (constants.%int.convert_checked)] +// CHECK:STDOUT: %.loc10_22.1: Core.IntLiteral = value_of_initializer %int.convert_checked.loc10_22.1 [symbolic = %int.convert_checked.loc10_22.2 (constants.%int.convert_checked)] +// CHECK:STDOUT: %.loc10_22.2: Core.IntLiteral = converted %N.ref.loc10_22, %.loc10_22.1 [symbolic = %int.convert_checked.loc10_22.2 (constants.%int.convert_checked)] +// CHECK:STDOUT: %array_type: type = array_type %.loc10_22.2, %C [template = ] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -865,9 +869,6 @@ fn G() -> C { // CHECK:STDOUT: // CHECK:STDOUT: fn @G() -> %return.param_patt: %C { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [template = constants.%D] -// CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3] -// CHECK:STDOUT: %array_type: type = array_type %int_3, %D [template = constants.%array_type] // CHECK:STDOUT: %a.var: ref %array_type = var a // CHECK:STDOUT: %a: ref %array_type = bind_name a, %a.var // CHECK:STDOUT: %.loc13_21.1: %empty_struct_type = struct_literal () diff --git a/toolchain/check/testdata/deduce/generic_type.carbon b/toolchain/check/testdata/deduce/generic_type.carbon index 922bfd13ba060..d8a71a4c888f8 100644 --- a/toolchain/check/testdata/deduce/generic_type.carbon +++ b/toolchain/check/testdata/deduce/generic_type.carbon @@ -119,13 +119,15 @@ fn G() -> i32 { // CHECK:STDOUT: %return.patt: @F.%T.loc7_6.2 (%T) = return_slot_pattern // CHECK:STDOUT: %return.param_patt: @F.%T.loc7_6.2 (%T) = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [template = constants.%C.generic] -// CHECK:STDOUT: %T.ref.loc7_21: type = name_ref T, %T.loc7_6.1 [symbolic = %T.loc7_6.2 (constants.%T)] -// CHECK:STDOUT: %C.loc7_22.1: type = class_type @C, @C(constants.%T) [symbolic = %C.loc7_22.2 (constants.%C.1)] // CHECK:STDOUT: %T.ref.loc7_28: type = name_ref T, %T.loc7_6.1 [symbolic = %T.loc7_6.2 (constants.%T)] // CHECK:STDOUT: %T.param: type = value_param runtime_param // CHECK:STDOUT: %T.loc7_6.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc7_6.2 (constants.%T)] // CHECK:STDOUT: %p.param: @F.%C.loc7_22.2 (%C.1) = value_param runtime_param0 +// CHECK:STDOUT: %.loc7_22: type = splice_block %C.loc7_22.1 [symbolic = %C.loc7_22.2 (constants.%C.1)] { +// CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [template = constants.%C.generic] +// CHECK:STDOUT: %T.ref.loc7_21: type = name_ref T, %T.loc7_6.1 [symbolic = %T.loc7_6.2 (constants.%T)] +// CHECK:STDOUT: %C.loc7_22.1: type = class_type @C, @C(constants.%T) [symbolic = %C.loc7_22.2 (constants.%C.1)] +// CHECK:STDOUT: } // CHECK:STDOUT: %p: @F.%C.loc7_22.2 (%C.1) = bind_name p, %p.param // CHECK:STDOUT: %return.param: ref @F.%T.loc7_6.2 (%T) = out_param runtime_param1 // CHECK:STDOUT: %return: ref @F.%T.loc7_6.2 (%T) = return_slot %return.param @@ -136,11 +138,13 @@ fn G() -> i32 { // CHECK:STDOUT: %return.patt: %D = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %D = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [template = constants.%C.generic] -// CHECK:STDOUT: %D.ref.loc9_11: type = name_ref D, file.%D.decl [template = constants.%D] -// CHECK:STDOUT: %C: type = class_type @C, @C(constants.%D) [template = constants.%C.2] // CHECK:STDOUT: %D.ref.loc9_18: type = name_ref D, file.%D.decl [template = constants.%D] // CHECK:STDOUT: %p.param: %C.2 = value_param runtime_param0 +// CHECK:STDOUT: %.loc9_12: type = splice_block %C [template = constants.%C.2] { +// CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [template = constants.%C.generic] +// CHECK:STDOUT: %D.ref.loc9_11: type = name_ref D, file.%D.decl [template = constants.%D] +// CHECK:STDOUT: %C: type = class_type @C, @C(constants.%D) [template = constants.%C.2] +// CHECK:STDOUT: } // CHECK:STDOUT: %p: %C.2 = bind_name p, %p.param // CHECK:STDOUT: %return.param: ref %D = out_param runtime_param1 // CHECK:STDOUT: %return: ref %D = return_slot %return.param @@ -197,8 +201,8 @@ fn G() -> i32 { // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [template = constants.%F] // CHECK:STDOUT: %p.ref: %C.2 = name_ref p, %p // CHECK:STDOUT: %F.specific_fn: = specific_function %F.ref, @F(constants.%D) [template = constants.%F.specific_fn.2] -// CHECK:STDOUT: %.loc9: ref %D = splice_block %return {} -// CHECK:STDOUT: %F.call: init %D = call %F.specific_fn(%p.ref) to %.loc9 +// CHECK:STDOUT: %.loc9_15: ref %D = splice_block %return {} +// CHECK:STDOUT: %F.call: init %D = call %F.specific_fn(%p.ref) to %.loc9_15 // CHECK:STDOUT: return %F.call to %return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -295,13 +299,15 @@ fn G() -> i32 { // CHECK:STDOUT: %return.patt: %C = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %C = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %I.ref: %I.type = name_ref I, file.%I.decl [template = constants.%I.generic] -// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc7_6.1 [symbolic = %T.loc7_6.2 (constants.%T)] -// CHECK:STDOUT: %I.loc7_22.1: type = class_type @I, @I(constants.%T) [symbolic = %I.loc7_22.2 (constants.%I.1)] // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %T.param: type = value_param runtime_param // CHECK:STDOUT: %T.loc7_6.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc7_6.2 (constants.%T)] // CHECK:STDOUT: %p.param: @F.%I.loc7_22.2 (%I.1) = value_param runtime_param0 +// CHECK:STDOUT: %.loc7_22: type = splice_block %I.loc7_22.1 [symbolic = %I.loc7_22.2 (constants.%I.1)] { +// CHECK:STDOUT: %I.ref: %I.type = name_ref I, file.%I.decl [template = constants.%I.generic] +// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc7_6.1 [symbolic = %T.loc7_6.2 (constants.%T)] +// CHECK:STDOUT: %I.loc7_22.1: type = class_type @I, @I(constants.%T) [symbolic = %I.loc7_22.2 (constants.%I.1)] +// CHECK:STDOUT: } // CHECK:STDOUT: %p: @F.%I.loc7_22.2 (%I.1) = bind_name p, %p.param // CHECK:STDOUT: %return.param: ref %C = out_param runtime_param1 // CHECK:STDOUT: %return: ref %C = return_slot %return.param @@ -312,11 +318,13 @@ fn G() -> i32 { // CHECK:STDOUT: %return.patt: %C = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %C = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %I.ref: %I.type = name_ref I, file.%I.decl [template = constants.%I.generic] -// CHECK:STDOUT: %C.ref.loc9_11: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %I: type = class_type @I, @I(constants.%C) [template = constants.%I.2] // CHECK:STDOUT: %C.ref.loc9_18: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %p.param: %I.2 = value_param runtime_param0 +// CHECK:STDOUT: %.loc9_12: type = splice_block %I [template = constants.%I.2] { +// CHECK:STDOUT: %I.ref: %I.type = name_ref I, file.%I.decl [template = constants.%I.generic] +// CHECK:STDOUT: %C.ref.loc9_11: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %I: type = class_type @I, @I(constants.%C) [template = constants.%I.2] +// CHECK:STDOUT: } // CHECK:STDOUT: %p: %I.2 = bind_name p, %p.param // CHECK:STDOUT: %return.param: ref %C = out_param runtime_param1 // CHECK:STDOUT: %return: ref %C = return_slot %return.param @@ -360,8 +368,8 @@ fn G() -> i32 { // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [template = constants.%F] // CHECK:STDOUT: %p.ref: @F.%I.loc7_22.2 (%I.1) = name_ref p, %p // CHECK:STDOUT: %F.specific_fn.loc7_39.1: = specific_function %F.ref, @F(constants.%T) [symbolic = %F.specific_fn.loc7_39.2 (constants.%F.specific_fn.1)] -// CHECK:STDOUT: %.loc7: ref %C = splice_block %return {} -// CHECK:STDOUT: %F.call: init %C = call %F.specific_fn.loc7_39.1(%p.ref) to %.loc7 +// CHECK:STDOUT: %.loc7_25: ref %C = splice_block %return {} +// CHECK:STDOUT: %F.call: init %C = call %F.specific_fn.loc7_39.1(%p.ref) to %.loc7_25 // CHECK:STDOUT: return %F.call to %return // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -371,8 +379,8 @@ fn G() -> i32 { // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [template = constants.%F] // CHECK:STDOUT: %p.ref: %I.2 = name_ref p, %p // CHECK:STDOUT: %F.specific_fn: = specific_function %F.ref, @F(constants.%C) [template = constants.%F.specific_fn.2] -// CHECK:STDOUT: %.loc9: ref %C = splice_block %return {} -// CHECK:STDOUT: %F.call: init %C = call %F.specific_fn(%p.ref) to %.loc9 +// CHECK:STDOUT: %.loc9_15: ref %C = splice_block %return {} +// CHECK:STDOUT: %F.call: init %C = call %F.specific_fn(%p.ref) to %.loc9_15 // CHECK:STDOUT: return %F.call to %return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -488,13 +496,6 @@ fn G() -> i32 { // CHECK:STDOUT: %return.patt: @F.%tuple.type (%tuple.type.2) = return_slot_pattern // CHECK:STDOUT: %return.param_patt: @F.%tuple.type (%tuple.type.2) = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Outer.ref: %Outer.type = name_ref Outer, file.%Outer.decl [template = constants.%Outer.generic] -// CHECK:STDOUT: %T.ref.loc13_35: type = name_ref T, %T.loc13_6.1 [symbolic = %T.loc13_6.2 (constants.%T)] -// CHECK:STDOUT: %Outer.loc13_36.1: type = class_type @Outer, @Outer(constants.%T) [symbolic = %Outer.loc13_36.2 (constants.%Outer.1)] -// CHECK:STDOUT: %.loc13_37: @F.%Inner.type (%Inner.type.1) = specific_constant @Outer.%Inner.decl, @Outer(constants.%T) [symbolic = %Inner.generic (constants.%Inner.generic.1)] -// CHECK:STDOUT: %Inner.ref: @F.%Inner.type (%Inner.type.1) = name_ref Inner, %.loc13_37 [symbolic = %Inner.generic (constants.%Inner.generic.1)] -// CHECK:STDOUT: %U.ref.loc13_44: type = name_ref U, %U.loc13_16.1 [symbolic = %U.loc13_16.2 (constants.%U)] -// CHECK:STDOUT: %Inner.loc13_45.1: type = class_type @Inner, @Inner(constants.%T, constants.%U) [symbolic = %Inner.loc13_45.2 (constants.%Inner.1)] // CHECK:STDOUT: %T.ref.loc13_52: type = name_ref T, %T.loc13_6.1 [symbolic = %T.loc13_6.2 (constants.%T)] // CHECK:STDOUT: %U.ref.loc13_55: type = name_ref U, %U.loc13_16.1 [symbolic = %U.loc13_16.2 (constants.%U)] // CHECK:STDOUT: %.loc13_56.1: %tuple.type.1 = tuple_literal (%T.ref.loc13_52, %U.ref.loc13_55) @@ -504,6 +505,15 @@ fn G() -> i32 { // CHECK:STDOUT: %U.param: type = value_param runtime_param // CHECK:STDOUT: %U.loc13_16.1: type = bind_symbolic_name U, 1, %U.param [symbolic = %U.loc13_16.2 (constants.%U)] // CHECK:STDOUT: %p.param: @F.%Inner.loc13_45.2 (%Inner.1) = value_param runtime_param0 +// CHECK:STDOUT: %.loc13_45: type = splice_block %Inner.loc13_45.1 [symbolic = %Inner.loc13_45.2 (constants.%Inner.1)] { +// CHECK:STDOUT: %Outer.ref: %Outer.type = name_ref Outer, file.%Outer.decl [template = constants.%Outer.generic] +// CHECK:STDOUT: %T.ref.loc13_35: type = name_ref T, %T.loc13_6.1 [symbolic = %T.loc13_6.2 (constants.%T)] +// CHECK:STDOUT: %Outer.loc13_36.1: type = class_type @Outer, @Outer(constants.%T) [symbolic = %Outer.loc13_36.2 (constants.%Outer.1)] +// CHECK:STDOUT: %.loc13_37: @F.%Inner.type (%Inner.type.1) = specific_constant @Outer.%Inner.decl, @Outer(constants.%T) [symbolic = %Inner.generic (constants.%Inner.generic.1)] +// CHECK:STDOUT: %Inner.ref: @F.%Inner.type (%Inner.type.1) = name_ref Inner, %.loc13_37 [symbolic = %Inner.generic (constants.%Inner.generic.1)] +// CHECK:STDOUT: %U.ref.loc13_44: type = name_ref U, %U.loc13_16.1 [symbolic = %U.loc13_16.2 (constants.%U)] +// CHECK:STDOUT: %Inner.loc13_45.1: type = class_type @Inner, @Inner(constants.%T, constants.%U) [symbolic = %Inner.loc13_45.2 (constants.%Inner.1)] +// CHECK:STDOUT: } // CHECK:STDOUT: %p: @F.%Inner.loc13_45.2 (%Inner.1) = bind_name p, %p.param // CHECK:STDOUT: %return.param: ref @F.%tuple.type (%tuple.type.2) = out_param runtime_param1 // CHECK:STDOUT: %return: ref @F.%tuple.type (%tuple.type.2) = return_slot %return.param @@ -514,18 +524,20 @@ fn G() -> i32 { // CHECK:STDOUT: %return.patt: %tuple.type.3 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %tuple.type.3 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Outer.ref: %Outer.type = name_ref Outer, file.%Outer.decl [template = constants.%Outer.generic] -// CHECK:STDOUT: %C.ref.loc15_15: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %Outer: type = class_type @Outer, @Outer(constants.%C) [template = constants.%Outer.2] -// CHECK:STDOUT: %.loc15_17: %Inner.type.2 = specific_constant @Outer.%Inner.decl, @Outer(constants.%C) [template = constants.%Inner.generic.2] -// CHECK:STDOUT: %Inner.ref: %Inner.type.2 = name_ref Inner, %.loc15_17 [template = constants.%Inner.generic.2] -// CHECK:STDOUT: %D.ref.loc15_24: type = name_ref D, file.%D.decl [template = constants.%D] -// CHECK:STDOUT: %Inner: type = class_type @Inner, @Inner(constants.%C, constants.%D) [template = constants.%Inner.2] // CHECK:STDOUT: %C.ref.loc15_32: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %D.ref.loc15_35: type = name_ref D, file.%D.decl [template = constants.%D] // CHECK:STDOUT: %.loc15_36.1: %tuple.type.1 = tuple_literal (%C.ref.loc15_32, %D.ref.loc15_35) // CHECK:STDOUT: %.loc15_36.2: type = converted %.loc15_36.1, constants.%tuple.type.3 [template = constants.%tuple.type.3] // CHECK:STDOUT: %p.param: %Inner.2 = value_param runtime_param0 +// CHECK:STDOUT: %.loc15_25: type = splice_block %Inner [template = constants.%Inner.2] { +// CHECK:STDOUT: %Outer.ref: %Outer.type = name_ref Outer, file.%Outer.decl [template = constants.%Outer.generic] +// CHECK:STDOUT: %C.ref.loc15_15: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %Outer: type = class_type @Outer, @Outer(constants.%C) [template = constants.%Outer.2] +// CHECK:STDOUT: %.loc15_17: %Inner.type.2 = specific_constant @Outer.%Inner.decl, @Outer(constants.%C) [template = constants.%Inner.generic.2] +// CHECK:STDOUT: %Inner.ref: %Inner.type.2 = name_ref Inner, %.loc15_17 [template = constants.%Inner.generic.2] +// CHECK:STDOUT: %D.ref.loc15_24: type = name_ref D, file.%D.decl [template = constants.%D] +// CHECK:STDOUT: %Inner: type = class_type @Inner, @Inner(constants.%C, constants.%D) [template = constants.%Inner.2] +// CHECK:STDOUT: } // CHECK:STDOUT: %p: %Inner.2 = bind_name p, %p.param // CHECK:STDOUT: %return.param: ref %tuple.type.3 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %tuple.type.3 = return_slot %return.param @@ -770,9 +782,11 @@ fn G() -> i32 { // CHECK:STDOUT: %N.patt.loc4_19.1: %i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc4_19.2 (constants.%N.patt.2)] // CHECK:STDOUT: %N.param_patt: %i32 = value_param_pattern %N.patt.loc4_19.1, runtime_param [symbolic = %N.patt.loc4_19.2 (constants.%N.patt.2)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %N.param: %i32 = value_param runtime_param +// CHECK:STDOUT: %.loc4: type = splice_block %i32 [template = constants.%i32] { +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %N.loc4_19.1: %i32 = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc4_19.2 (constants.%N.2)] // CHECK:STDOUT: } // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { @@ -783,16 +797,20 @@ fn G() -> i32 { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc6_10: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc6_10: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %WithNontype.ref: %WithNontype.type = name_ref WithNontype, file.%WithNontype.decl [template = constants.%WithNontype.generic] -// CHECK:STDOUT: %N.ref.loc6_30: %i32 = name_ref N, %N.loc6_6.1 [symbolic = %N.loc6_6.2 (constants.%N.2)] -// CHECK:STDOUT: %WithNontype.loc6_31.1: type = class_type @WithNontype, @WithNontype(constants.%N.2) [symbolic = %WithNontype.loc6_31.2 (constants.%WithNontype.1)] // CHECK:STDOUT: %int_32.loc6_37: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc6_37: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %N.param: %i32 = value_param runtime_param +// CHECK:STDOUT: %.loc6_10: type = splice_block %i32.loc6_10 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc6_10: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc6_10: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %N.loc6_6.1: %i32 = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc6_6.2 (constants.%N.2)] // CHECK:STDOUT: %x.param: @F.%WithNontype.loc6_31.2 (%WithNontype.1) = value_param runtime_param0 +// CHECK:STDOUT: %.loc6_31: type = splice_block %WithNontype.loc6_31.1 [symbolic = %WithNontype.loc6_31.2 (constants.%WithNontype.1)] { +// CHECK:STDOUT: %WithNontype.ref: %WithNontype.type = name_ref WithNontype, file.%WithNontype.decl [template = constants.%WithNontype.generic] +// CHECK:STDOUT: %N.ref.loc6_30: %i32 = name_ref N, %N.loc6_6.1 [symbolic = %N.loc6_6.2 (constants.%N.2)] +// CHECK:STDOUT: %WithNontype.loc6_31.1: type = class_type @WithNontype, @WithNontype(constants.%N.2) [symbolic = %WithNontype.loc6_31.2 (constants.%WithNontype.1)] +// CHECK:STDOUT: } // CHECK:STDOUT: %x: @F.%WithNontype.loc6_31.2 (%WithNontype.1) = bind_name x, %x.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param diff --git a/toolchain/check/testdata/deduce/int_float.carbon b/toolchain/check/testdata/deduce/int_float.carbon index e6fefe00175bc..1d4a1598e0167 100644 --- a/toolchain/check/testdata/deduce/int_float.carbon +++ b/toolchain/check/testdata/deduce/int_float.carbon @@ -84,23 +84,27 @@ fn G(a: f64) -> Core.IntLiteral() { // CHECK:STDOUT: %return.patt: Core.IntLiteral = return_slot_pattern // CHECK:STDOUT: %return.param_patt: Core.IntLiteral = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Core.ref.loc4_10: = name_ref Core, imports.%Core [template = imports.%Core] -// CHECK:STDOUT: %IntLiteral.ref.loc4_14: %IntLiteral.type = name_ref IntLiteral, imports.%import_ref.1 [template = constants.%IntLiteral] -// CHECK:STDOUT: %int_literal.make_type.loc4_26: init type = call %IntLiteral.ref.loc4_14() [template = Core.IntLiteral] -// CHECK:STDOUT: %.loc4_26.1: type = value_of_initializer %int_literal.make_type.loc4_26 [template = Core.IntLiteral] -// CHECK:STDOUT: %.loc4_26.2: type = converted %int_literal.make_type.loc4_26, %.loc4_26.1 [template = Core.IntLiteral] -// CHECK:STDOUT: %Core.ref.loc4_32: = name_ref Core, imports.%Core [template = imports.%Core] -// CHECK:STDOUT: %Int.ref: %Int.type = name_ref Int, imports.%import_ref.2 [template = constants.%Int.generic] -// CHECK:STDOUT: %N.ref.loc4: Core.IntLiteral = name_ref N, %N.loc4_6.1 [symbolic = %N.loc4_6.2 (constants.%N)] -// CHECK:STDOUT: %Int.loc4_42.1: type = class_type @Int, @Int(constants.%N) [symbolic = %Int.loc4_42.2 (constants.%Int)] // CHECK:STDOUT: %Core.ref.loc4_48: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %IntLiteral.ref.loc4_52: %IntLiteral.type = name_ref IntLiteral, imports.%import_ref.1 [template = constants.%IntLiteral] // CHECK:STDOUT: %int_literal.make_type.loc4_64: init type = call %IntLiteral.ref.loc4_52() [template = Core.IntLiteral] // CHECK:STDOUT: %.loc4_64.1: type = value_of_initializer %int_literal.make_type.loc4_64 [template = Core.IntLiteral] // CHECK:STDOUT: %.loc4_64.2: type = converted %int_literal.make_type.loc4_64, %.loc4_64.1 [template = Core.IntLiteral] // CHECK:STDOUT: %N.param: Core.IntLiteral = value_param runtime_param +// CHECK:STDOUT: %.loc4_26.3: type = splice_block %.loc4_26.2 [template = Core.IntLiteral] { +// CHECK:STDOUT: %Core.ref.loc4_10: = name_ref Core, imports.%Core [template = imports.%Core] +// CHECK:STDOUT: %IntLiteral.ref.loc4_14: %IntLiteral.type = name_ref IntLiteral, imports.%import_ref.1 [template = constants.%IntLiteral] +// CHECK:STDOUT: %int_literal.make_type.loc4_26: init type = call %IntLiteral.ref.loc4_14() [template = Core.IntLiteral] +// CHECK:STDOUT: %.loc4_26.1: type = value_of_initializer %int_literal.make_type.loc4_26 [template = Core.IntLiteral] +// CHECK:STDOUT: %.loc4_26.2: type = converted %int_literal.make_type.loc4_26, %.loc4_26.1 [template = Core.IntLiteral] +// CHECK:STDOUT: } // CHECK:STDOUT: %N.loc4_6.1: Core.IntLiteral = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc4_6.2 (constants.%N)] // CHECK:STDOUT: %n.param: @F.%Int.loc4_42.2 (%Int) = value_param runtime_param0 +// CHECK:STDOUT: %.loc4_42: type = splice_block %Int.loc4_42.1 [symbolic = %Int.loc4_42.2 (constants.%Int)] { +// CHECK:STDOUT: %Core.ref.loc4_32: = name_ref Core, imports.%Core [template = imports.%Core] +// CHECK:STDOUT: %Int.ref: %Int.type = name_ref Int, imports.%import_ref.2 [template = constants.%Int.generic] +// CHECK:STDOUT: %N.ref.loc4: Core.IntLiteral = name_ref N, %N.loc4_6.1 [symbolic = %N.loc4_6.2 (constants.%N)] +// CHECK:STDOUT: %Int.loc4_42.1: type = class_type @Int, @Int(constants.%N) [symbolic = %Int.loc4_42.2 (constants.%Int)] +// CHECK:STDOUT: } // CHECK:STDOUT: %n: @F.%Int.loc4_42.2 (%Int) = bind_name n, %n.param // CHECK:STDOUT: %return.param: ref Core.IntLiteral = out_param runtime_param1 // CHECK:STDOUT: %return: ref Core.IntLiteral = return_slot %return.param @@ -111,14 +115,16 @@ fn G(a: f64) -> Core.IntLiteral() { // CHECK:STDOUT: %return.patt: Core.IntLiteral = return_slot_pattern // CHECK:STDOUT: %return.param_patt: Core.IntLiteral = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %i64: type = class_type @Int, @Int(constants.%int_64) [template = constants.%i64] // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, imports.%import_ref.1 [template = constants.%IntLiteral] // CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral] // CHECK:STDOUT: %.loc8_33.1: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral] // CHECK:STDOUT: %.loc8_33.2: type = converted %int_literal.make_type, %.loc8_33.1 [template = Core.IntLiteral] // CHECK:STDOUT: %a.param: %i64 = value_param runtime_param0 +// CHECK:STDOUT: %.loc8_9: type = splice_block %i64 [template = constants.%i64] { +// CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %i64: type = class_type @Int, @Int(constants.%int_64) [template = constants.%i64] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i64 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref Core.IntLiteral = out_param runtime_param1 // CHECK:STDOUT: %return: ref Core.IntLiteral = return_slot %return.param @@ -208,25 +214,29 @@ fn G(a: f64) -> Core.IntLiteral() { // CHECK:STDOUT: %return.patt: Core.IntLiteral = return_slot_pattern // CHECK:STDOUT: %return.param_patt: Core.IntLiteral = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Core.ref.loc8_10: = name_ref Core, imports.%Core [template = imports.%Core] -// CHECK:STDOUT: %IntLiteral.ref.loc8_14: %IntLiteral.type = name_ref IntLiteral, imports.%import_ref.1 [template = constants.%IntLiteral] -// CHECK:STDOUT: %int_literal.make_type.loc8_26: init type = call %IntLiteral.ref.loc8_14() [template = Core.IntLiteral] -// CHECK:STDOUT: %.loc8_26.1: type = value_of_initializer %int_literal.make_type.loc8_26 [template = Core.IntLiteral] -// CHECK:STDOUT: %.loc8_26.2: type = converted %int_literal.make_type.loc8_26, %.loc8_26.1 [template = Core.IntLiteral] -// CHECK:STDOUT: %Core.ref.loc8_32: = name_ref Core, imports.%Core [template = imports.%Core] -// CHECK:STDOUT: %Float.ref: %Float.type = name_ref Float, imports.%import_ref.2 [template = constants.%Float] -// CHECK:STDOUT: %N.ref.loc8: Core.IntLiteral = name_ref N, %N.loc8_6.1 [symbolic = %N.loc8_6.2 (constants.%N)] -// CHECK:STDOUT: %float.make_type: init type = call %Float.ref(%N.ref.loc8) -// CHECK:STDOUT: %.loc8_44.1: type = value_of_initializer %float.make_type -// CHECK:STDOUT: %.loc8_44.2: type = converted %float.make_type, %.loc8_44.1 // CHECK:STDOUT: %Core.ref.loc8_50: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %IntLiteral.ref.loc8_54: %IntLiteral.type = name_ref IntLiteral, imports.%import_ref.1 [template = constants.%IntLiteral] // CHECK:STDOUT: %int_literal.make_type.loc8_66: init type = call %IntLiteral.ref.loc8_54() [template = Core.IntLiteral] // CHECK:STDOUT: %.loc8_66.1: type = value_of_initializer %int_literal.make_type.loc8_66 [template = Core.IntLiteral] // CHECK:STDOUT: %.loc8_66.2: type = converted %int_literal.make_type.loc8_66, %.loc8_66.1 [template = Core.IntLiteral] // CHECK:STDOUT: %N.param: Core.IntLiteral = value_param runtime_param +// CHECK:STDOUT: %.loc8_26.3: type = splice_block %.loc8_26.2 [template = Core.IntLiteral] { +// CHECK:STDOUT: %Core.ref.loc8_10: = name_ref Core, imports.%Core [template = imports.%Core] +// CHECK:STDOUT: %IntLiteral.ref.loc8_14: %IntLiteral.type = name_ref IntLiteral, imports.%import_ref.1 [template = constants.%IntLiteral] +// CHECK:STDOUT: %int_literal.make_type.loc8_26: init type = call %IntLiteral.ref.loc8_14() [template = Core.IntLiteral] +// CHECK:STDOUT: %.loc8_26.1: type = value_of_initializer %int_literal.make_type.loc8_26 [template = Core.IntLiteral] +// CHECK:STDOUT: %.loc8_26.2: type = converted %int_literal.make_type.loc8_26, %.loc8_26.1 [template = Core.IntLiteral] +// CHECK:STDOUT: } // CHECK:STDOUT: %N.loc8_6.1: Core.IntLiteral = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc8_6.2 (constants.%N)] // CHECK:STDOUT: %n.param: = value_param runtime_param0 +// CHECK:STDOUT: %.1: = splice_block [template = ] { +// CHECK:STDOUT: %Core.ref.loc8_32: = name_ref Core, imports.%Core [template = imports.%Core] +// CHECK:STDOUT: %Float.ref: %Float.type = name_ref Float, imports.%import_ref.2 [template = constants.%Float] +// CHECK:STDOUT: %N.ref.loc8: Core.IntLiteral = name_ref N, %N.loc8_6.1 [symbolic = %N.loc8_6.2 (constants.%N)] +// CHECK:STDOUT: %float.make_type: init type = call %Float.ref(%N.ref.loc8) +// CHECK:STDOUT: %.loc8_44.1: type = value_of_initializer %float.make_type +// CHECK:STDOUT: %.loc8_44.2: type = converted %float.make_type, %.loc8_44.1 +// CHECK:STDOUT: } // CHECK:STDOUT: %n: = bind_name n, %n.param // CHECK:STDOUT: %return.param: ref Core.IntLiteral = out_param runtime_param1 // CHECK:STDOUT: %return: ref Core.IntLiteral = return_slot %return.param @@ -237,16 +247,18 @@ fn G(a: f64) -> Core.IntLiteral() { // CHECK:STDOUT: %return.patt: Core.IntLiteral = return_slot_pattern // CHECK:STDOUT: %return.param_patt: Core.IntLiteral = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type: init type = call constants.%Float(%int_64) [template = f64] -// CHECK:STDOUT: %.loc12_9.1: type = value_of_initializer %float.make_type [template = f64] -// CHECK:STDOUT: %.loc12_9.2: type = converted %float.make_type, %.loc12_9.1 [template = f64] // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, imports.%import_ref.1 [template = constants.%IntLiteral] // CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral] // CHECK:STDOUT: %.loc12_33.1: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral] // CHECK:STDOUT: %.loc12_33.2: type = converted %int_literal.make_type, %.loc12_33.1 [template = Core.IntLiteral] // CHECK:STDOUT: %a.param: f64 = value_param runtime_param0 +// CHECK:STDOUT: %.loc12_9.3: type = splice_block %.loc12_9.2 [template = f64] { +// CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type: init type = call constants.%Float(%int_64) [template = f64] +// CHECK:STDOUT: %.loc12_9.1: type = value_of_initializer %float.make_type [template = f64] +// CHECK:STDOUT: %.loc12_9.2: type = converted %float.make_type, %.loc12_9.1 [template = f64] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref Core.IntLiteral = out_param runtime_param1 // CHECK:STDOUT: %return: ref Core.IntLiteral = return_slot %return.param diff --git a/toolchain/check/testdata/deduce/tuple.carbon b/toolchain/check/testdata/deduce/tuple.carbon index 18c5f9933aa73..e266424c7ae2a 100644 --- a/toolchain/check/testdata/deduce/tuple.carbon +++ b/toolchain/check/testdata/deduce/tuple.carbon @@ -105,16 +105,18 @@ fn G(pair: (C, D)) -> D { // CHECK:STDOUT: %return.patt: @F.%U.loc7_16.2 (%U) = return_slot_pattern // CHECK:STDOUT: %return.param_patt: @F.%U.loc7_16.2 (%U) = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc7_6.1 [symbolic = %T.loc7_6.2 (constants.%T)] -// CHECK:STDOUT: %U.ref.loc7_36: type = name_ref U, %U.loc7_16.1 [symbolic = %U.loc7_16.2 (constants.%U)] -// CHECK:STDOUT: %.loc7_37.1: %tuple.type.1 = tuple_literal (%T.ref, %U.ref.loc7_36) -// CHECK:STDOUT: %.loc7_37.2: type = converted %.loc7_37.1, constants.%tuple.type.2 [symbolic = %tuple.type (constants.%tuple.type.2)] // CHECK:STDOUT: %U.ref.loc7_43: type = name_ref U, %U.loc7_16.1 [symbolic = %U.loc7_16.2 (constants.%U)] // CHECK:STDOUT: %T.param: type = value_param runtime_param // CHECK:STDOUT: %T.loc7_6.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc7_6.2 (constants.%T)] // CHECK:STDOUT: %U.param: type = value_param runtime_param // CHECK:STDOUT: %U.loc7_16.1: type = bind_symbolic_name U, 1, %U.param [symbolic = %U.loc7_16.2 (constants.%U)] // CHECK:STDOUT: %pair.param: @F.%tuple.type (%tuple.type.2) = value_param runtime_param0 +// CHECK:STDOUT: %.loc7_37.3: type = splice_block %.loc7_37.2 [symbolic = %tuple.type (constants.%tuple.type.2)] { +// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc7_6.1 [symbolic = %T.loc7_6.2 (constants.%T)] +// CHECK:STDOUT: %U.ref.loc7_36: type = name_ref U, %U.loc7_16.1 [symbolic = %U.loc7_16.2 (constants.%U)] +// CHECK:STDOUT: %.loc7_37.1: %tuple.type.1 = tuple_literal (%T.ref, %U.ref.loc7_36) +// CHECK:STDOUT: %.loc7_37.2: type = converted %.loc7_37.1, constants.%tuple.type.2 [symbolic = %tuple.type (constants.%tuple.type.2)] +// CHECK:STDOUT: } // CHECK:STDOUT: %pair: @F.%tuple.type (%tuple.type.2) = bind_name pair, %pair.param // CHECK:STDOUT: %return.param: ref @F.%U.loc7_16.2 (%U) = out_param runtime_param1 // CHECK:STDOUT: %return: ref @F.%U.loc7_16.2 (%U) = return_slot %return.param @@ -125,12 +127,14 @@ fn G(pair: (C, D)) -> D { // CHECK:STDOUT: %return.patt: %D = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %D = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %D.ref.loc9_16: type = name_ref D, file.%D.decl [template = constants.%D] -// CHECK:STDOUT: %.loc9_17.1: %tuple.type.1 = tuple_literal (%C.ref, %D.ref.loc9_16) -// CHECK:STDOUT: %.loc9_17.2: type = converted %.loc9_17.1, constants.%tuple.type.3 [template = constants.%tuple.type.3] // CHECK:STDOUT: %D.ref.loc9_23: type = name_ref D, file.%D.decl [template = constants.%D] // CHECK:STDOUT: %pair.param: %tuple.type.3 = value_param runtime_param0 +// CHECK:STDOUT: %.loc9_17.3: type = splice_block %.loc9_17.2 [template = constants.%tuple.type.3] { +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %D.ref.loc9_16: type = name_ref D, file.%D.decl [template = constants.%D] +// CHECK:STDOUT: %.loc9_17.1: %tuple.type.1 = tuple_literal (%C.ref, %D.ref.loc9_16) +// CHECK:STDOUT: %.loc9_17.2: type = converted %.loc9_17.1, constants.%tuple.type.3 [template = constants.%tuple.type.3] +// CHECK:STDOUT: } // CHECK:STDOUT: %pair: %tuple.type.3 = bind_name pair, %pair.param // CHECK:STDOUT: %return.param: ref %D = out_param runtime_param1 // CHECK:STDOUT: %return: ref %D = return_slot %return.param @@ -279,13 +283,15 @@ fn G(pair: (C, D)) -> D { // CHECK:STDOUT: %Pair.patt.loc4_15.1: %tuple.type.2 = symbolic_binding_pattern Pair, 0 [symbolic = %Pair.patt.loc4_15.2 (constants.%Pair.patt)] // CHECK:STDOUT: %Pair.param_patt: %tuple.type.2 = value_param_pattern %Pair.patt.loc4_15.1, runtime_param [symbolic = %Pair.patt.loc4_15.2 (constants.%Pair.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc4_23: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc4_23: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc4_28: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc4_28: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc4_31.1: %tuple.type.1 = tuple_literal (%i32.loc4_23, %i32.loc4_28) -// CHECK:STDOUT: %.loc4_31.2: type = converted %.loc4_31.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %Pair.param: %tuple.type.2 = value_param runtime_param +// CHECK:STDOUT: %.loc4_31.3: type = splice_block %.loc4_31.2 [template = constants.%tuple.type.2] { +// CHECK:STDOUT: %int_32.loc4_23: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc4_23: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %int_32.loc4_28: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc4_28: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc4_31.1: %tuple.type.1 = tuple_literal (%i32.loc4_23, %i32.loc4_28) +// CHECK:STDOUT: %.loc4_31.2: type = converted %.loc4_31.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] +// CHECK:STDOUT: } // CHECK:STDOUT: %Pair.loc4_15.1: %tuple.type.2 = bind_symbolic_name Pair, 0, %Pair.param [symbolic = %Pair.loc4_15.2 (constants.%Pair)] // CHECK:STDOUT: } // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { @@ -298,24 +304,30 @@ fn G(pair: (C, D)) -> D { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc6_10: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc6_10: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc6_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc6_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %HasPair.ref: %HasPair.type = name_ref HasPair, file.%HasPair.decl [template = constants.%HasPair.generic] -// CHECK:STDOUT: %A.ref: %i32 = name_ref A, %A.loc6_6.1 [symbolic = %A.loc6_6.2 (constants.%A)] -// CHECK:STDOUT: %B.ref.loc6_39: %i32 = name_ref B, %B.loc6_15.1 [symbolic = %B.loc6_15.2 (constants.%B)] -// CHECK:STDOUT: %.loc6_40: %tuple.type.2 = tuple_literal (%A.ref, %B.ref.loc6_39) -// CHECK:STDOUT: %tuple.loc6_40.1: %tuple.type.2 = tuple_value (%A.ref, %B.ref.loc6_39) [symbolic = %tuple.loc6_40.2 (constants.%tuple.1)] -// CHECK:STDOUT: %.loc6_41: %tuple.type.2 = converted %.loc6_40, %tuple.loc6_40.1 [symbolic = %tuple.loc6_40.2 (constants.%tuple.1)] -// CHECK:STDOUT: %HasPair.loc6_41.1: type = class_type @HasPair, @HasPair(constants.%tuple.1) [symbolic = %HasPair.loc6_41.2 (constants.%HasPair.2)] // CHECK:STDOUT: %int_32.loc6_47: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc6_47: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %A.param: %i32 = value_param runtime_param +// CHECK:STDOUT: %.loc6_10: type = splice_block %i32.loc6_10 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc6_10: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc6_10: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %A.loc6_6.1: %i32 = bind_symbolic_name A, 0, %A.param [symbolic = %A.loc6_6.2 (constants.%A)] // CHECK:STDOUT: %B.param: %i32 = value_param runtime_param +// CHECK:STDOUT: %.loc6_19: type = splice_block %i32.loc6_19 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc6_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc6_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %B.loc6_15.1: %i32 = bind_symbolic_name B, 1, %B.param [symbolic = %B.loc6_15.2 (constants.%B)] // CHECK:STDOUT: %h.param: @F.%HasPair.loc6_41.2 (%HasPair.2) = value_param runtime_param0 +// CHECK:STDOUT: %.loc6_41.2: type = splice_block %HasPair.loc6_41.1 [symbolic = %HasPair.loc6_41.2 (constants.%HasPair.2)] { +// CHECK:STDOUT: %HasPair.ref: %HasPair.type = name_ref HasPair, file.%HasPair.decl [template = constants.%HasPair.generic] +// CHECK:STDOUT: %A.ref: %i32 = name_ref A, %A.loc6_6.1 [symbolic = %A.loc6_6.2 (constants.%A)] +// CHECK:STDOUT: %B.ref.loc6_39: %i32 = name_ref B, %B.loc6_15.1 [symbolic = %B.loc6_15.2 (constants.%B)] +// CHECK:STDOUT: %.loc6_40: %tuple.type.2 = tuple_literal (%A.ref, %B.ref.loc6_39) +// CHECK:STDOUT: %tuple.loc6_40.1: %tuple.type.2 = tuple_value (%A.ref, %B.ref.loc6_39) [symbolic = %tuple.loc6_40.2 (constants.%tuple.1)] +// CHECK:STDOUT: %.loc6_41.1: %tuple.type.2 = converted %.loc6_40, %tuple.loc6_40.1 [symbolic = %tuple.loc6_40.2 (constants.%tuple.1)] +// CHECK:STDOUT: %HasPair.loc6_41.1: type = class_type @HasPair, @HasPair(constants.%tuple.1) [symbolic = %HasPair.loc6_41.2 (constants.%HasPair.2)] +// CHECK:STDOUT: } // CHECK:STDOUT: %h: @F.%HasPair.loc6_41.2 (%HasPair.2) = bind_name h, %h.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -326,28 +338,30 @@ fn G(pair: (C, D)) -> D { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %HasPair.ref: %HasPair.type = name_ref HasPair, file.%HasPair.decl [template = constants.%HasPair.generic] -// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %.loc8_22.1: %tuple.type.3 = tuple_literal (%int_1, %int_2) -// CHECK:STDOUT: %impl.elem0.loc8_22.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc8_22.1: = bound_method %int_1, %impl.elem0.loc8_22.1 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc8_22.1: = specific_function %Convert.bound.loc8_22.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc8_22.1: init %i32 = call %Convert.specific_fn.loc8_22.1(%int_1) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc8_22.2: %i32 = value_of_initializer %int.convert_checked.loc8_22.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc8_22.3: %i32 = converted %int_1, %.loc8_22.2 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc8_22.2: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc8_22.2: = bound_method %int_2, %impl.elem0.loc8_22.2 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc8_22.2: = specific_function %Convert.bound.loc8_22.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] -// CHECK:STDOUT: %int.convert_checked.loc8_22.2: init %i32 = call %Convert.specific_fn.loc8_22.2(%int_2) [template = constants.%int_2.2] -// CHECK:STDOUT: %.loc8_22.4: %i32 = value_of_initializer %int.convert_checked.loc8_22.2 [template = constants.%int_2.2] -// CHECK:STDOUT: %.loc8_22.5: %i32 = converted %int_2, %.loc8_22.4 [template = constants.%int_2.2] -// CHECK:STDOUT: %tuple: %tuple.type.2 = tuple_value (%.loc8_22.3, %.loc8_22.5) [template = constants.%tuple.2] -// CHECK:STDOUT: %.loc8_23: %tuple.type.2 = converted %.loc8_22.1, %tuple [template = constants.%tuple.2] -// CHECK:STDOUT: %HasPair: type = class_type @HasPair, @HasPair(constants.%tuple.2) [template = constants.%HasPair.3] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %h.param: %HasPair.3 = value_param runtime_param0 +// CHECK:STDOUT: %.loc8_23.2: type = splice_block %HasPair [template = constants.%HasPair.3] { +// CHECK:STDOUT: %HasPair.ref: %HasPair.type = name_ref HasPair, file.%HasPair.decl [template = constants.%HasPair.generic] +// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] +// CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] +// CHECK:STDOUT: %.loc8_22.1: %tuple.type.3 = tuple_literal (%int_1, %int_2) +// CHECK:STDOUT: %impl.elem0.loc8_22.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %Convert.bound.loc8_22.1: = bound_method %int_1, %impl.elem0.loc8_22.1 [template = constants.%Convert.bound.1] +// CHECK:STDOUT: %Convert.specific_fn.loc8_22.1: = specific_function %Convert.bound.loc8_22.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] +// CHECK:STDOUT: %int.convert_checked.loc8_22.1: init %i32 = call %Convert.specific_fn.loc8_22.1(%int_1) [template = constants.%int_1.2] +// CHECK:STDOUT: %.loc8_22.2: %i32 = value_of_initializer %int.convert_checked.loc8_22.1 [template = constants.%int_1.2] +// CHECK:STDOUT: %.loc8_22.3: %i32 = converted %int_1, %.loc8_22.2 [template = constants.%int_1.2] +// CHECK:STDOUT: %impl.elem0.loc8_22.2: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %Convert.bound.loc8_22.2: = bound_method %int_2, %impl.elem0.loc8_22.2 [template = constants.%Convert.bound.2] +// CHECK:STDOUT: %Convert.specific_fn.loc8_22.2: = specific_function %Convert.bound.loc8_22.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] +// CHECK:STDOUT: %int.convert_checked.loc8_22.2: init %i32 = call %Convert.specific_fn.loc8_22.2(%int_2) [template = constants.%int_2.2] +// CHECK:STDOUT: %.loc8_22.4: %i32 = value_of_initializer %int.convert_checked.loc8_22.2 [template = constants.%int_2.2] +// CHECK:STDOUT: %.loc8_22.5: %i32 = converted %int_2, %.loc8_22.4 [template = constants.%int_2.2] +// CHECK:STDOUT: %tuple: %tuple.type.2 = tuple_value (%.loc8_22.3, %.loc8_22.5) [template = constants.%tuple.2] +// CHECK:STDOUT: %.loc8_23.1: %tuple.type.2 = converted %.loc8_22.1, %tuple [template = constants.%tuple.2] +// CHECK:STDOUT: %HasPair: type = class_type @HasPair, @HasPair(constants.%tuple.2) [template = constants.%HasPair.3] +// CHECK:STDOUT: } // CHECK:STDOUT: %h: %HasPair.3 = bind_name h, %h.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -484,14 +498,16 @@ fn G(pair: (C, D)) -> D { // CHECK:STDOUT: %return.patt: @F.%T.loc7_6.2 (%T) = return_slot_pattern // CHECK:STDOUT: %return.param_patt: @F.%T.loc7_6.2 (%T) = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.ref.loc7_23: type = name_ref T, %T.loc7_6.1 [symbolic = %T.loc7_6.2 (constants.%T)] -// CHECK:STDOUT: %T.ref.loc7_26: type = name_ref T, %T.loc7_6.1 [symbolic = %T.loc7_6.2 (constants.%T)] -// CHECK:STDOUT: %.loc7_27.1: %tuple.type.1 = tuple_literal (%T.ref.loc7_23, %T.ref.loc7_26) -// CHECK:STDOUT: %.loc7_27.2: type = converted %.loc7_27.1, constants.%tuple.type.2 [symbolic = %tuple.type (constants.%tuple.type.2)] // CHECK:STDOUT: %T.ref.loc7_33: type = name_ref T, %T.loc7_6.1 [symbolic = %T.loc7_6.2 (constants.%T)] // CHECK:STDOUT: %T.param: type = value_param runtime_param // CHECK:STDOUT: %T.loc7_6.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc7_6.2 (constants.%T)] // CHECK:STDOUT: %pair.param: @F.%tuple.type (%tuple.type.2) = value_param runtime_param0 +// CHECK:STDOUT: %.loc7_27.3: type = splice_block %.loc7_27.2 [symbolic = %tuple.type (constants.%tuple.type.2)] { +// CHECK:STDOUT: %T.ref.loc7_23: type = name_ref T, %T.loc7_6.1 [symbolic = %T.loc7_6.2 (constants.%T)] +// CHECK:STDOUT: %T.ref.loc7_26: type = name_ref T, %T.loc7_6.1 [symbolic = %T.loc7_6.2 (constants.%T)] +// CHECK:STDOUT: %.loc7_27.1: %tuple.type.1 = tuple_literal (%T.ref.loc7_23, %T.ref.loc7_26) +// CHECK:STDOUT: %.loc7_27.2: type = converted %.loc7_27.1, constants.%tuple.type.2 [symbolic = %tuple.type (constants.%tuple.type.2)] +// CHECK:STDOUT: } // CHECK:STDOUT: %pair: @F.%tuple.type (%tuple.type.2) = bind_name pair, %pair.param // CHECK:STDOUT: %return.param: ref @F.%T.loc7_6.2 (%T) = out_param runtime_param1 // CHECK:STDOUT: %return: ref @F.%T.loc7_6.2 (%T) = return_slot %return.param @@ -502,12 +518,14 @@ fn G(pair: (C, D)) -> D { // CHECK:STDOUT: %return.patt: %D = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %D = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %D.ref.loc9_16: type = name_ref D, file.%D.decl [template = constants.%D] -// CHECK:STDOUT: %.loc9_17.1: %tuple.type.1 = tuple_literal (%C.ref, %D.ref.loc9_16) -// CHECK:STDOUT: %.loc9_17.2: type = converted %.loc9_17.1, constants.%tuple.type.3 [template = constants.%tuple.type.3] // CHECK:STDOUT: %D.ref.loc9_23: type = name_ref D, file.%D.decl [template = constants.%D] // CHECK:STDOUT: %pair.param: %tuple.type.3 = value_param runtime_param0 +// CHECK:STDOUT: %.loc9_17.3: type = splice_block %.loc9_17.2 [template = constants.%tuple.type.3] { +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %D.ref.loc9_16: type = name_ref D, file.%D.decl [template = constants.%D] +// CHECK:STDOUT: %.loc9_17.1: %tuple.type.1 = tuple_literal (%C.ref, %D.ref.loc9_16) +// CHECK:STDOUT: %.loc9_17.2: type = converted %.loc9_17.1, constants.%tuple.type.3 [template = constants.%tuple.type.3] +// CHECK:STDOUT: } // CHECK:STDOUT: %pair: %tuple.type.3 = bind_name pair, %pair.param // CHECK:STDOUT: %return.param: ref %D = out_param runtime_param1 // CHECK:STDOUT: %return: ref %D = return_slot %return.param diff --git a/toolchain/check/testdata/deduce/type_operator.carbon b/toolchain/check/testdata/deduce/type_operator.carbon index 7031f55c2a540..8a2d8bad3cbb9 100644 --- a/toolchain/check/testdata/deduce/type_operator.carbon +++ b/toolchain/check/testdata/deduce/type_operator.carbon @@ -107,12 +107,14 @@ fn G(p: C*) -> const C { // CHECK:STDOUT: %return.patt: @F.%T.loc6_6.2 (%T) = return_slot_pattern // CHECK:STDOUT: %return.param_patt: @F.%T.loc6_6.2 (%T) = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.ref.loc6_19: type = name_ref T, %T.loc6_6.1 [symbolic = %T.loc6_6.2 (constants.%T)] -// CHECK:STDOUT: %ptr.loc6_20.1: type = ptr_type %T [symbolic = %ptr.loc6_20.2 (constants.%ptr.1)] // CHECK:STDOUT: %T.ref.loc6_26: type = name_ref T, %T.loc6_6.1 [symbolic = %T.loc6_6.2 (constants.%T)] // CHECK:STDOUT: %T.param: type = value_param runtime_param // CHECK:STDOUT: %T.loc6_6.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc6_6.2 (constants.%T)] // CHECK:STDOUT: %p.param: @F.%ptr.loc6_20.2 (%ptr.1) = value_param runtime_param0 +// CHECK:STDOUT: %.loc6_20: type = splice_block %ptr.loc6_20.1 [symbolic = %ptr.loc6_20.2 (constants.%ptr.1)] { +// CHECK:STDOUT: %T.ref.loc6_19: type = name_ref T, %T.loc6_6.1 [symbolic = %T.loc6_6.2 (constants.%T)] +// CHECK:STDOUT: %ptr.loc6_20.1: type = ptr_type %T [symbolic = %ptr.loc6_20.2 (constants.%ptr.1)] +// CHECK:STDOUT: } // CHECK:STDOUT: %p: @F.%ptr.loc6_20.2 (%ptr.1) = bind_name p, %p.param // CHECK:STDOUT: %return.param: ref @F.%T.loc6_6.2 (%T) = out_param runtime_param1 // CHECK:STDOUT: %return: ref @F.%T.loc6_6.2 (%T) = return_slot %return.param @@ -123,10 +125,12 @@ fn G(p: C*) -> const C { // CHECK:STDOUT: %return.patt: %C = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %C = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref.loc8_9: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %ptr: type = ptr_type %C [template = constants.%ptr.2] // CHECK:STDOUT: %C.ref.loc8_16: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %p.param: %ptr.2 = value_param runtime_param0 +// CHECK:STDOUT: %.loc8_10: type = splice_block %ptr [template = constants.%ptr.2] { +// CHECK:STDOUT: %C.ref.loc8_9: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %ptr: type = ptr_type %C [template = constants.%ptr.2] +// CHECK:STDOUT: } // CHECK:STDOUT: %p: %ptr.2 = bind_name p, %p.param // CHECK:STDOUT: %return.param: ref %C = out_param runtime_param1 // CHECK:STDOUT: %return: ref %C = return_slot %return.param @@ -168,8 +172,8 @@ fn G(p: C*) -> const C { // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [template = constants.%F] // CHECK:STDOUT: %p.ref: %ptr.2 = name_ref p, %p // CHECK:STDOUT: %F.specific_fn: = specific_function %F.ref, @F(constants.%C) [template = constants.%F.specific_fn.2] -// CHECK:STDOUT: %.loc8: ref %C = splice_block %return {} -// CHECK:STDOUT: %F.call: init %C = call %F.specific_fn(%p.ref) to %.loc8 +// CHECK:STDOUT: %.loc8_13: ref %C = splice_block %return {} +// CHECK:STDOUT: %F.call: init %C = call %F.specific_fn(%p.ref) to %.loc8_13 // CHECK:STDOUT: return %F.call to %return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -244,13 +248,15 @@ fn G(p: C*) -> const C { // CHECK:STDOUT: %return.patt: @F.%T.loc6_6.2 (%T) = return_slot_pattern // CHECK:STDOUT: %return.param_patt: @F.%T.loc6_6.2 (%T) = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.ref.loc6_25: type = name_ref T, %T.loc6_6.1 [symbolic = %T.loc6_6.2 (constants.%T)] -// CHECK:STDOUT: %const.loc6_19.1: type = const_type %T [symbolic = %const.loc6_19.2 (constants.%const.1)] -// CHECK:STDOUT: %ptr.loc6_26.1: type = ptr_type %const.1 [symbolic = %ptr.loc6_26.2 (constants.%ptr.1)] // CHECK:STDOUT: %T.ref.loc6_32: type = name_ref T, %T.loc6_6.1 [symbolic = %T.loc6_6.2 (constants.%T)] // CHECK:STDOUT: %T.param: type = value_param runtime_param // CHECK:STDOUT: %T.loc6_6.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc6_6.2 (constants.%T)] // CHECK:STDOUT: %p.param: @F.%ptr.loc6_26.2 (%ptr.1) = value_param runtime_param0 +// CHECK:STDOUT: %.loc6_26: type = splice_block %ptr.loc6_26.1 [symbolic = %ptr.loc6_26.2 (constants.%ptr.1)] { +// CHECK:STDOUT: %T.ref.loc6_25: type = name_ref T, %T.loc6_6.1 [symbolic = %T.loc6_6.2 (constants.%T)] +// CHECK:STDOUT: %const.loc6_19.1: type = const_type %T [symbolic = %const.loc6_19.2 (constants.%const.1)] +// CHECK:STDOUT: %ptr.loc6_26.1: type = ptr_type %const.1 [symbolic = %ptr.loc6_26.2 (constants.%ptr.1)] +// CHECK:STDOUT: } // CHECK:STDOUT: %p: @F.%ptr.loc6_26.2 (%ptr.1) = bind_name p, %p.param // CHECK:STDOUT: %return.param: ref @F.%T.loc6_6.2 (%T) = out_param runtime_param1 // CHECK:STDOUT: %return: ref @F.%T.loc6_6.2 (%T) = return_slot %return.param @@ -261,11 +267,13 @@ fn G(p: C*) -> const C { // CHECK:STDOUT: %return.patt: %C = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %C = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref.loc8_15: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %const: type = const_type %C [template = constants.%const.2] -// CHECK:STDOUT: %ptr: type = ptr_type %const.2 [template = constants.%ptr.2] // CHECK:STDOUT: %C.ref.loc8_22: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %p.param: %ptr.2 = value_param runtime_param0 +// CHECK:STDOUT: %.loc8_16: type = splice_block %ptr [template = constants.%ptr.2] { +// CHECK:STDOUT: %C.ref.loc8_15: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %const: type = const_type %C [template = constants.%const.2] +// CHECK:STDOUT: %ptr: type = ptr_type %const.2 [template = constants.%ptr.2] +// CHECK:STDOUT: } // CHECK:STDOUT: %p: %ptr.2 = bind_name p, %p.param // CHECK:STDOUT: %return.param: ref %C = out_param runtime_param1 // CHECK:STDOUT: %return: ref %C = return_slot %return.param @@ -308,8 +316,8 @@ fn G(p: C*) -> const C { // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [template = constants.%F] // CHECK:STDOUT: %p.ref: %ptr.2 = name_ref p, %p // CHECK:STDOUT: %F.specific_fn: = specific_function %F.ref, @F(constants.%C) [template = constants.%F.specific_fn.2] -// CHECK:STDOUT: %.loc8: ref %C = splice_block %return {} -// CHECK:STDOUT: %F.call: init %C = call %F.specific_fn(%p.ref) to %.loc8 +// CHECK:STDOUT: %.loc8_19: ref %C = splice_block %return {} +// CHECK:STDOUT: %F.call: init %C = call %F.specific_fn(%p.ref) to %.loc8_19 // CHECK:STDOUT: return %F.call to %return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -385,12 +393,14 @@ fn G(p: C*) -> const C { // CHECK:STDOUT: %return.patt: @F.%T.loc6_6.2 (%T) = return_slot_pattern // CHECK:STDOUT: %return.param_patt: @F.%T.loc6_6.2 (%T) = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.ref.loc6_19: type = name_ref T, %T.loc6_6.1 [symbolic = %T.loc6_6.2 (constants.%T)] -// CHECK:STDOUT: %ptr.loc6_20.1: type = ptr_type %T [symbolic = %ptr.loc6_20.2 (constants.%ptr.1)] // CHECK:STDOUT: %T.ref.loc6_26: type = name_ref T, %T.loc6_6.1 [symbolic = %T.loc6_6.2 (constants.%T)] // CHECK:STDOUT: %T.param: type = value_param runtime_param // CHECK:STDOUT: %T.loc6_6.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc6_6.2 (constants.%T)] // CHECK:STDOUT: %p.param: @F.%ptr.loc6_20.2 (%ptr.1) = value_param runtime_param0 +// CHECK:STDOUT: %.loc6_20: type = splice_block %ptr.loc6_20.1 [symbolic = %ptr.loc6_20.2 (constants.%ptr.1)] { +// CHECK:STDOUT: %T.ref.loc6_19: type = name_ref T, %T.loc6_6.1 [symbolic = %T.loc6_6.2 (constants.%T)] +// CHECK:STDOUT: %ptr.loc6_20.1: type = ptr_type %T [symbolic = %ptr.loc6_20.2 (constants.%ptr.1)] +// CHECK:STDOUT: } // CHECK:STDOUT: %p: @F.%ptr.loc6_20.2 (%ptr.1) = bind_name p, %p.param // CHECK:STDOUT: %return.param: ref @F.%T.loc6_6.2 (%T) = out_param runtime_param1 // CHECK:STDOUT: %return: ref @F.%T.loc6_6.2 (%T) = return_slot %return.param @@ -401,12 +411,14 @@ fn G(p: C*) -> const C { // CHECK:STDOUT: %return.patt: %const = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %const = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref.loc8_15: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %const.loc8_9: type = const_type %C [template = constants.%const] -// CHECK:STDOUT: %ptr: type = ptr_type %const [template = constants.%ptr.2] // CHECK:STDOUT: %C.ref.loc8_28: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %const.loc8_22: type = const_type %C [template = constants.%const] // CHECK:STDOUT: %p.param: %ptr.2 = value_param runtime_param0 +// CHECK:STDOUT: %.loc8_16: type = splice_block %ptr [template = constants.%ptr.2] { +// CHECK:STDOUT: %C.ref.loc8_15: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %const.loc8_9: type = const_type %C [template = constants.%const] +// CHECK:STDOUT: %ptr: type = ptr_type %const [template = constants.%ptr.2] +// CHECK:STDOUT: } // CHECK:STDOUT: %p: %ptr.2 = bind_name p, %p.param // CHECK:STDOUT: %return.param: ref %const = out_param runtime_param1 // CHECK:STDOUT: %return: ref %const = return_slot %return.param @@ -448,8 +460,8 @@ fn G(p: C*) -> const C { // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [template = constants.%F] // CHECK:STDOUT: %p.ref: %ptr.2 = name_ref p, %p // CHECK:STDOUT: %F.specific_fn: = specific_function %F.ref, @F(constants.%const) [template = constants.%F.specific_fn.2] -// CHECK:STDOUT: %.loc8: ref %const = splice_block %return {} -// CHECK:STDOUT: %F.call: init %const = call %F.specific_fn(%p.ref) to %.loc8 +// CHECK:STDOUT: %.loc8_19: ref %const = splice_block %return {} +// CHECK:STDOUT: %F.call: init %const = call %F.specific_fn(%p.ref) to %.loc8_19 // CHECK:STDOUT: return %F.call to %return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -522,13 +534,15 @@ fn G(p: C*) -> const C { // CHECK:STDOUT: %return.patt: @F.%T.loc6_6.2 (%T) = return_slot_pattern // CHECK:STDOUT: %return.param_patt: @F.%T.loc6_6.2 (%T) = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.ref.loc6_25: type = name_ref T, %T.loc6_6.1 [symbolic = %T.loc6_6.2 (constants.%T)] -// CHECK:STDOUT: %const.loc6_19.1: type = const_type %T [symbolic = %const.loc6_19.2 (constants.%const.1)] -// CHECK:STDOUT: %ptr.loc6_26.1: type = ptr_type %const.1 [symbolic = %ptr.loc6_26.2 (constants.%ptr.1)] // CHECK:STDOUT: %T.ref.loc6_32: type = name_ref T, %T.loc6_6.1 [symbolic = %T.loc6_6.2 (constants.%T)] // CHECK:STDOUT: %T.param: type = value_param runtime_param // CHECK:STDOUT: %T.loc6_6.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc6_6.2 (constants.%T)] // CHECK:STDOUT: %p.param: @F.%ptr.loc6_26.2 (%ptr.1) = value_param runtime_param0 +// CHECK:STDOUT: %.loc6_26: type = splice_block %ptr.loc6_26.1 [symbolic = %ptr.loc6_26.2 (constants.%ptr.1)] { +// CHECK:STDOUT: %T.ref.loc6_25: type = name_ref T, %T.loc6_6.1 [symbolic = %T.loc6_6.2 (constants.%T)] +// CHECK:STDOUT: %const.loc6_19.1: type = const_type %T [symbolic = %const.loc6_19.2 (constants.%const.1)] +// CHECK:STDOUT: %ptr.loc6_26.1: type = ptr_type %const.1 [symbolic = %ptr.loc6_26.2 (constants.%ptr.1)] +// CHECK:STDOUT: } // CHECK:STDOUT: %p: @F.%ptr.loc6_26.2 (%ptr.1) = bind_name p, %p.param // CHECK:STDOUT: %return.param: ref @F.%T.loc6_6.2 (%T) = out_param runtime_param1 // CHECK:STDOUT: %return: ref @F.%T.loc6_6.2 (%T) = return_slot %return.param @@ -539,11 +553,13 @@ fn G(p: C*) -> const C { // CHECK:STDOUT: %return.patt: %const.2 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %const.2 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref.loc8_9: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %ptr: type = ptr_type %C [template = constants.%ptr.2] // CHECK:STDOUT: %C.ref.loc8_22: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %const: type = const_type %C [template = constants.%const.2] // CHECK:STDOUT: %p.param: %ptr.2 = value_param runtime_param0 +// CHECK:STDOUT: %.loc8: type = splice_block %ptr [template = constants.%ptr.2] { +// CHECK:STDOUT: %C.ref.loc8_9: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %ptr: type = ptr_type %C [template = constants.%ptr.2] +// CHECK:STDOUT: } // CHECK:STDOUT: %p: %ptr.2 = bind_name p, %p.param // CHECK:STDOUT: %return.param: ref %const.2 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %const.2 = return_slot %return.param diff --git a/toolchain/check/testdata/eval/aggregate.carbon b/toolchain/check/testdata/eval/aggregate.carbon index c9aa14b37a8fa..4c61640caf159 100644 --- a/toolchain/check/testdata/eval/aggregate.carbon +++ b/toolchain/check/testdata/eval/aggregate.carbon @@ -80,33 +80,12 @@ var struct_access: [i32; 1] = (0,) as [i32; {.a = 3, .b = 1}.b]; // CHECK:STDOUT: .struct_access = %struct_access // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int_32.loc11_18: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc11_18: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc11_23: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc11_23: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_26.1: %tuple.type.1 = tuple_literal (%i32.loc11_18, %i32.loc11_23) -// CHECK:STDOUT: %.loc11_26.2: type = converted %.loc11_26.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %tuple_copy.var: ref %tuple.type.2 = var tuple_copy // CHECK:STDOUT: %tuple_copy: ref %tuple.type.2 = bind_name tuple_copy, %tuple_copy.var -// CHECK:STDOUT: %int_32.loc13_23: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc13_23: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc13_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc13_32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc13_41: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc13_41: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %struct_type.a.b.c: type = struct_type {.a: %i32, .b: %i32, .c: %i32} [template = constants.%struct_type.a.b.c] // CHECK:STDOUT: %struct_copy.var: ref %struct_type.a.b.c = var struct_copy // CHECK:STDOUT: %struct_copy: ref %struct_type.a.b.c = bind_name struct_copy, %struct_copy.var -// CHECK:STDOUT: %int_32.loc15: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc15: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_1.loc15: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %array_type.loc15: type = array_type %int_1.loc15, %i32 [template = constants.%array_type] // CHECK:STDOUT: %tuple_index.var: ref %array_type = var tuple_index // CHECK:STDOUT: %tuple_index: ref %array_type = bind_name tuple_index, %tuple_index.var -// CHECK:STDOUT: %int_32.loc17: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_1.loc17: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %array_type.loc17: type = array_type %int_1.loc17, %i32 [template = constants.%array_type] // CHECK:STDOUT: %struct_access.var: ref %array_type = var struct_access // CHECK:STDOUT: %struct_access: ref %array_type = bind_name struct_access, %struct_access.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/eval/fail_aggregate.carbon b/toolchain/check/testdata/eval/fail_aggregate.carbon index 5c171d007fbaa..5a275ea40f855 100644 --- a/toolchain/check/testdata/eval/fail_aggregate.carbon +++ b/toolchain/check/testdata/eval/fail_aggregate.carbon @@ -69,10 +69,6 @@ var array_index: [i32; 1] = (0,) as [i32; ((5, 7, 1, 9) as [i32; 4])[2]]; // CHECK:STDOUT: .array_index = %array_index // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %array_type: type = array_type %int_1, %i32 [template = constants.%array_type.1] // CHECK:STDOUT: %array_index.var: ref %array_type.1 = var array_index // CHECK:STDOUT: %array_index: ref %array_type.1 = bind_name array_index, %array_index.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/eval/fail_symbolic.carbon b/toolchain/check/testdata/eval/fail_symbolic.carbon index 00f64b707eef5..651a420ab0b00 100644 --- a/toolchain/check/testdata/eval/fail_symbolic.carbon +++ b/toolchain/check/testdata/eval/fail_symbolic.carbon @@ -25,10 +25,8 @@ fn G(N:! i32) { // CHECK:STDOUT: %N.patt.2: %i32 = symbolic_binding_pattern N, 0 [symbolic] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] // CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.3, @impl.2(%int_32) [template] // CHECK:STDOUT: %Convert.9: %Convert.type.9 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.9) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %N.2, %Convert.9 [symbolic] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.3(%int_32) [symbolic] // CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %Convert.specific_fn(%N.2) [symbolic] @@ -53,9 +51,11 @@ fn G(N:! i32) { // CHECK:STDOUT: %N.patt.loc12_6.1: %i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc12_6.2 (constants.%N.patt.2)] // CHECK:STDOUT: %N.param_patt: %i32 = value_param_pattern %N.patt.loc12_6.1, runtime_param [symbolic = %N.patt.loc12_6.2 (constants.%N.patt.2)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc12: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc12: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %N.param: %i32 = value_param runtime_param +// CHECK:STDOUT: %.loc12: type = splice_block %i32 [template = constants.%i32] { +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %N.loc12_6.1: %i32 = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc12_6.2 (constants.%N.2)] // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -65,22 +65,12 @@ fn G(N:! i32) { // CHECK:STDOUT: %N.patt.loc12_6.2: %i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc12_6.2 (constants.%N.patt.2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Convert.bound.loc16_16.2: = bound_method %N.loc12_6.2, constants.%Convert.9 [symbolic = %Convert.bound.loc16_16.2 (constants.%Convert.bound)] -// CHECK:STDOUT: %Convert.specific_fn.loc16_16.2: = specific_function %Convert.bound.loc16_16.2, @Convert.3(constants.%int_32) [symbolic = %Convert.specific_fn.loc16_16.2 (constants.%Convert.specific_fn)] -// CHECK:STDOUT: %int.convert_checked.loc16_16.2: init Core.IntLiteral = call %Convert.specific_fn.loc16_16.2(%N.loc12_6.2) [symbolic = %int.convert_checked.loc16_16.2 (constants.%int.convert_checked)] +// CHECK:STDOUT: %Convert.bound: = bound_method %N.loc12_6.2, constants.%Convert.9 [symbolic = %Convert.bound (constants.%Convert.bound)] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.3(constants.%int_32) [symbolic = %Convert.specific_fn (constants.%Convert.specific_fn)] +// CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %Convert.specific_fn(%N.loc12_6.2) [symbolic = %int.convert_checked (constants.%int.convert_checked)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%N.param_patt: %i32) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int_32.loc16: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc16: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %N.ref: %i32 = name_ref N, %N.loc12_6.1 [symbolic = %N.loc12_6.2 (constants.%N.2)] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.9] -// CHECK:STDOUT: %Convert.bound.loc16_16.1: = bound_method %N.ref, %impl.elem0 [symbolic = %Convert.bound.loc16_16.2 (constants.%Convert.bound)] -// CHECK:STDOUT: %Convert.specific_fn.loc16_16.1: = specific_function %Convert.bound.loc16_16.1, @Convert.3(constants.%int_32) [symbolic = %Convert.specific_fn.loc16_16.2 (constants.%Convert.specific_fn)] -// CHECK:STDOUT: %int.convert_checked.loc16_16.1: init Core.IntLiteral = call %Convert.specific_fn.loc16_16.1(%N.ref) [symbolic = %int.convert_checked.loc16_16.2 (constants.%int.convert_checked)] -// CHECK:STDOUT: %.loc16_16.1: Core.IntLiteral = value_of_initializer %int.convert_checked.loc16_16.1 [symbolic = %int.convert_checked.loc16_16.2 (constants.%int.convert_checked)] -// CHECK:STDOUT: %.loc16_16.2: Core.IntLiteral = converted %N.ref, %.loc16_16.1 [symbolic = %int.convert_checked.loc16_16.2 (constants.%int.convert_checked)] -// CHECK:STDOUT: %array_type: type = array_type %.loc16_16.2, %i32 [template = ] // CHECK:STDOUT: %k.var: ref = var k // CHECK:STDOUT: %k: ref = bind_name k, %k.var // CHECK:STDOUT: return diff --git a/toolchain/check/testdata/eval/symbolic.carbon b/toolchain/check/testdata/eval/symbolic.carbon index 6d79a08c24fae..1e08d7c5e6f79 100644 --- a/toolchain/check/testdata/eval/symbolic.carbon +++ b/toolchain/check/testdata/eval/symbolic.carbon @@ -24,7 +24,6 @@ fn F(T:! type) { // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %ptr.1: type = ptr_type %T [symbolic] // CHECK:STDOUT: %const: type = const_type %T [symbolic] -// CHECK:STDOUT: %tuple.type.1: type = tuple_type (type, type) [template] // CHECK:STDOUT: %tuple.type.2: type = tuple_type (%ptr.1, %const) [symbolic] // CHECK:STDOUT: %require_complete.1: = require_complete_type %tuple.type.2 [symbolic] // CHECK:STDOUT: %struct_type.a: type = struct_type {.a: %T} [symbolic] @@ -61,34 +60,23 @@ fn F(T:! type) { // CHECK:STDOUT: %T.patt.loc12_6.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc12_6.2 (constants.%T.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %ptr.loc13_12.2: type = ptr_type @F.%T.loc12_6.2 (%T) [symbolic = %ptr.loc13_12.2 (constants.%ptr.1)] -// CHECK:STDOUT: %const.loc13_15.2: type = const_type @F.%T.loc12_6.2 (%T) [symbolic = %const.loc13_15.2 (constants.%const)] -// CHECK:STDOUT: %tuple.type: type = tuple_type (@F.%ptr.loc13_12.2 (%ptr.1), @F.%const.loc13_15.2 (%const)) [symbolic = %tuple.type (constants.%tuple.type.2)] +// CHECK:STDOUT: %ptr: type = ptr_type @F.%T.loc12_6.2 (%T) [symbolic = %ptr (constants.%ptr.1)] +// CHECK:STDOUT: %const: type = const_type @F.%T.loc12_6.2 (%T) [symbolic = %const (constants.%const)] +// CHECK:STDOUT: %tuple.type: type = tuple_type (@F.%ptr (%ptr.1), @F.%const (%const)) [symbolic = %tuple.type (constants.%tuple.type.2)] // CHECK:STDOUT: %require_complete.loc13: = require_complete_type @F.%tuple.type (%tuple.type.2) [symbolic = %require_complete.loc13 (constants.%require_complete.1)] -// CHECK:STDOUT: %struct_type.a.loc14_16.2: type = struct_type {.a: @F.%T.loc12_6.2 (%T)} [symbolic = %struct_type.a.loc14_16.2 (constants.%struct_type.a)] -// CHECK:STDOUT: %require_complete.loc14: = require_complete_type @F.%struct_type.a.loc14_16.2 (%struct_type.a) [symbolic = %require_complete.loc14 (constants.%require_complete.2)] -// CHECK:STDOUT: %array_type.loc15_15.2: type = array_type constants.%int_5, @F.%T.loc12_6.2 (%T) [symbolic = %array_type.loc15_15.2 (constants.%array_type)] -// CHECK:STDOUT: %require_complete.loc15: = require_complete_type @F.%array_type.loc15_15.2 (%array_type) [symbolic = %require_complete.loc15 (constants.%require_complete.3)] +// CHECK:STDOUT: %struct_type.a: type = struct_type {.a: @F.%T.loc12_6.2 (%T)} [symbolic = %struct_type.a (constants.%struct_type.a)] +// CHECK:STDOUT: %require_complete.loc14: = require_complete_type @F.%struct_type.a (%struct_type.a) [symbolic = %require_complete.loc14 (constants.%require_complete.2)] +// CHECK:STDOUT: %array_type: type = array_type constants.%int_5, @F.%T.loc12_6.2 (%T) [symbolic = %array_type (constants.%array_type)] +// CHECK:STDOUT: %require_complete.loc15: = require_complete_type @F.%array_type (%array_type) [symbolic = %require_complete.loc15 (constants.%require_complete.3)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%T.param_patt: type) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %T.ref.loc13_11: type = name_ref T, %T.loc12_6.1 [symbolic = %T.loc12_6.2 (constants.%T)] -// CHECK:STDOUT: %ptr.loc13_12.1: type = ptr_type %T [symbolic = %ptr.loc13_12.2 (constants.%ptr.1)] -// CHECK:STDOUT: %T.ref.loc13_21: type = name_ref T, %T.loc12_6.1 [symbolic = %T.loc12_6.2 (constants.%T)] -// CHECK:STDOUT: %const.loc13_15.1: type = const_type %T [symbolic = %const.loc13_15.2 (constants.%const)] -// CHECK:STDOUT: %.loc13_22.1: %tuple.type.1 = tuple_literal (%ptr.loc13_12.1, %const.loc13_15.1) -// CHECK:STDOUT: %.loc13_22.2: type = converted %.loc13_22.1, constants.%tuple.type.2 [symbolic = %tuple.type (constants.%tuple.type.2)] // CHECK:STDOUT: %u.var: ref @F.%tuple.type (%tuple.type.2) = var u // CHECK:STDOUT: %u: ref @F.%tuple.type (%tuple.type.2) = bind_name u, %u.var -// CHECK:STDOUT: %T.ref.loc14: type = name_ref T, %T.loc12_6.1 [symbolic = %T.loc12_6.2 (constants.%T)] -// CHECK:STDOUT: %struct_type.a.loc14_16.1: type = struct_type {.a: %T} [symbolic = %struct_type.a.loc14_16.2 (constants.%struct_type.a)] -// CHECK:STDOUT: %v.var: ref @F.%struct_type.a.loc14_16.2 (%struct_type.a) = var v -// CHECK:STDOUT: %v: ref @F.%struct_type.a.loc14_16.2 (%struct_type.a) = bind_name v, %v.var -// CHECK:STDOUT: %T.ref.loc15: type = name_ref T, %T.loc12_6.1 [symbolic = %T.loc12_6.2 (constants.%T)] -// CHECK:STDOUT: %int_5: Core.IntLiteral = int_value 5 [template = constants.%int_5] -// CHECK:STDOUT: %array_type.loc15_15.1: type = array_type %int_5, %T [symbolic = %array_type.loc15_15.2 (constants.%array_type)] -// CHECK:STDOUT: %w.var: ref @F.%array_type.loc15_15.2 (%array_type) = var w -// CHECK:STDOUT: %w: ref @F.%array_type.loc15_15.2 (%array_type) = bind_name w, %w.var +// CHECK:STDOUT: %v.var: ref @F.%struct_type.a (%struct_type.a) = var v +// CHECK:STDOUT: %v: ref @F.%struct_type.a (%struct_type.a) = bind_name v, %v.var +// CHECK:STDOUT: %w.var: ref @F.%array_type (%array_type) = var w +// CHECK:STDOUT: %w: ref @F.%array_type (%array_type) = bind_name w, %w.var // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/expr_category/in_place_tuple_init.carbon b/toolchain/check/testdata/expr_category/in_place_tuple_init.carbon index 5a2f2d6b7323f..a2a2fb7ac5a8c 100644 --- a/toolchain/check/testdata/expr_category/in_place_tuple_init.carbon +++ b/toolchain/check/testdata/expr_category/in_place_tuple_init.carbon @@ -93,17 +93,11 @@ fn H() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: fn @G() -> %return.param_patt: %tuple.type.2 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int_32.loc14_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc14_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc14_16: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc14_16: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc14_19.1: %tuple.type.1 = tuple_literal (%i32.loc14_11, %i32.loc14_16) -// CHECK:STDOUT: %.loc14_19.2: type = converted %.loc14_19.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %v.var: ref %tuple.type.2 = var v // CHECK:STDOUT: %v: ref %tuple.type.2 = bind_name v, %v.var // CHECK:STDOUT: %F.ref.loc14: %F.type = name_ref F, file.%F.decl [template = constants.%F] -// CHECK:STDOUT: %.loc14_7: ref %tuple.type.2 = splice_block %v.var {} -// CHECK:STDOUT: %F.call.loc14: init %tuple.type.2 = call %F.ref.loc14() to %.loc14_7 +// CHECK:STDOUT: %.loc14: ref %tuple.type.2 = splice_block %v.var {} +// CHECK:STDOUT: %F.call.loc14: init %tuple.type.2 = call %F.ref.loc14() to %.loc14 // CHECK:STDOUT: assign %v.var, %F.call.loc14 // CHECK:STDOUT: %v.ref: ref %tuple.type.2 = name_ref v, %v // CHECK:STDOUT: %F.ref.loc15: %F.type = name_ref F, file.%F.decl [template = constants.%F] diff --git a/toolchain/check/testdata/function/builtin/call.carbon b/toolchain/check/testdata/function/builtin/call.carbon index 85b951881c5d5..d30611da114ce 100644 --- a/toolchain/check/testdata/function/builtin/call.carbon +++ b/toolchain/check/testdata/function/builtin/call.carbon @@ -19,25 +19,6 @@ var arr: [i32; Add(1, 2)]; // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %Add.type.1: type = fn_type @Add.1 [template] // CHECK:STDOUT: %Add: %Add.type.1 = struct_value () [template] -// CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] -// CHECK:STDOUT: %int_3.1: %i32 = int_value 3 [template] -// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.3, @impl.2(%int_32) [template] -// CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [template] -// CHECK:STDOUT: %interface.6: = interface_witness (%Convert.11) [template] -// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_3.1, %Convert.11 [template] -// CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.3(%int_32) [template] // CHECK:STDOUT: %int_3.2: Core.IntLiteral = int_value 3 [template] // CHECK:STDOUT: %array_type: type = array_type %int_3.2, %i32 [template] // CHECK:STDOUT: } @@ -66,46 +47,23 @@ var arr: [i32; Add(1, 2)]; // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc11_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc11_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc11_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc11_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc11_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc11_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc11_11: type = splice_block %i32.loc11_11 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc11_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc11_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %.loc11_19: type = splice_block %i32.loc11_19 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc11_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc11_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %Add.ref: %Add.type.1 = name_ref Add, %Add.decl [template = constants.%Add] -// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %impl.elem0.loc13_20: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc13_20: = bound_method %int_1, %impl.elem0.loc13_20 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc13_20: = specific_function %Convert.bound.loc13_20, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc13_20: init %i32 = call %Convert.specific_fn.loc13_20(%int_1) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc13_20.1: %i32 = value_of_initializer %int.convert_checked.loc13_20 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc13_20.2: %i32 = converted %int_1, %.loc13_20.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc13_23: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc13_23: = bound_method %int_2, %impl.elem0.loc13_23 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc13_23: = specific_function %Convert.bound.loc13_23, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] -// CHECK:STDOUT: %int.convert_checked.loc13_23: init %i32 = call %Convert.specific_fn.loc13_23(%int_2) [template = constants.%int_2.2] -// CHECK:STDOUT: %.loc13_23.1: %i32 = value_of_initializer %int.convert_checked.loc13_23 [template = constants.%int_2.2] -// CHECK:STDOUT: %.loc13_23.2: %i32 = converted %int_2, %.loc13_23.1 [template = constants.%int_2.2] -// CHECK:STDOUT: %int.sadd: init %i32 = call %Add.ref(%.loc13_20.2, %.loc13_23.2) [template = constants.%int_3.1] -// CHECK:STDOUT: %impl.elem0.loc13_24: %Convert.type.5 = interface_witness_access constants.%interface.6, element0 [template = constants.%Convert.11] -// CHECK:STDOUT: %Convert.bound.loc13_24: = bound_method %int.sadd, %impl.elem0.loc13_24 [template = constants.%Convert.bound.3] -// CHECK:STDOUT: %Convert.specific_fn.loc13_24: = specific_function %Convert.bound.loc13_24, @Convert.3(constants.%int_32) [template = constants.%Convert.specific_fn.3] -// CHECK:STDOUT: %.loc13_24.1: %i32 = value_of_initializer %int.sadd [template = constants.%int_3.1] -// CHECK:STDOUT: %.loc13_24.2: %i32 = converted %int.sadd, %.loc13_24.1 [template = constants.%int_3.1] -// CHECK:STDOUT: %int.convert_checked.loc13_24: init Core.IntLiteral = call %Convert.specific_fn.loc13_24(%.loc13_24.2) [template = constants.%int_3.2] -// CHECK:STDOUT: %.loc13_24.3: Core.IntLiteral = value_of_initializer %int.convert_checked.loc13_24 [template = constants.%int_3.2] -// CHECK:STDOUT: %.loc13_24.4: Core.IntLiteral = converted %int.sadd, %.loc13_24.3 [template = constants.%int_3.2] -// CHECK:STDOUT: %array_type: type = array_type %.loc13_24.4, %i32 [template = constants.%array_type] // CHECK:STDOUT: %arr.var: ref %array_type = var arr // CHECK:STDOUT: %arr: ref %array_type = bind_name arr, %arr.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/function/builtin/definition.carbon b/toolchain/check/testdata/function/builtin/definition.carbon index 7e23baf037f00..a84a47f03e565 100644 --- a/toolchain/check/testdata/function/builtin/definition.carbon +++ b/toolchain/check/testdata/function/builtin/definition.carbon @@ -41,15 +41,19 @@ fn Add(a: i32, b: i32) -> i32 = "int.sadd"; // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc11_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc11_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc11_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc11_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc11_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc11_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc11_11: type = splice_block %i32.loc11_11 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc11_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc11_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %.loc11_19: type = splice_block %i32.loc11_19 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc11_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc11_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param diff --git a/toolchain/check/testdata/function/builtin/fail_redefined.carbon b/toolchain/check/testdata/function/builtin/fail_redefined.carbon index 6cdd3ec65d335..5494614ef3561 100644 --- a/toolchain/check/testdata/function/builtin/fail_redefined.carbon +++ b/toolchain/check/testdata/function/builtin/fail_redefined.carbon @@ -74,15 +74,19 @@ fn C(n: i32, m: i32) -> i32 = "int.sadd"; // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc11_9: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc11_9: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc11_17: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc11_17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc11_25: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc11_25: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %n.param.loc11: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc11_9: type = splice_block %i32.loc11_9 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc11_9: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc11_9: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %n.loc11: %i32 = bind_name n, %n.param.loc11 // CHECK:STDOUT: %m.param.loc11: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %.loc11_17: type = splice_block %i32.loc11_17 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc11_17: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc11_17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %m.loc11: %i32 = bind_name m, %m.param.loc11 // CHECK:STDOUT: %return.param.loc11: ref %i32 = out_param runtime_param2 // CHECK:STDOUT: %return.loc11: ref %i32 = return_slot %return.param.loc11 @@ -95,15 +99,19 @@ fn C(n: i32, m: i32) -> i32 = "int.sadd"; // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc19_9: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc19_9: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc19_17: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc19_17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc19_25: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc19_25: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %n.param.loc19: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc19_9: type = splice_block %i32.loc19_9 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc19_9: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc19_9: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %n.loc19: %i32 = bind_name n, %n.param.loc19 // CHECK:STDOUT: %m.param.loc19: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %.loc19_17: type = splice_block %i32.loc19_17 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc19_17: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc19_17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %m.loc19: %i32 = bind_name m, %m.param.loc19 // CHECK:STDOUT: %return.param.loc19: ref %i32 = out_param runtime_param2 // CHECK:STDOUT: %return.loc19: ref %i32 = return_slot %return.param.loc19 @@ -116,15 +124,19 @@ fn C(n: i32, m: i32) -> i32 = "int.sadd"; // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc21_9: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc21_9: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc21_17: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc21_17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc21_25: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc21_25: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %n.param.loc21: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc21_9: type = splice_block %i32.loc21_9 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc21_9: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc21_9: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %n.loc21: %i32 = bind_name n, %n.param.loc21 // CHECK:STDOUT: %m.param.loc21: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %.loc21_17: type = splice_block %i32.loc21_17 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc21_17: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc21_17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %m.loc21: %i32 = bind_name m, %m.param.loc21 // CHECK:STDOUT: %return.param.loc21: ref %i32 = out_param runtime_param2 // CHECK:STDOUT: %return.loc21: ref %i32 = return_slot %return.param.loc21 @@ -137,15 +149,19 @@ fn C(n: i32, m: i32) -> i32 = "int.sadd"; // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc29_9: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc29_9: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc29_17: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc29_17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc29_25: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc29_25: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %n.param.loc29: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc29_9: type = splice_block %i32.loc29_9 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc29_9: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc29_9: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %n.loc29: %i32 = bind_name n, %n.param.loc29 // CHECK:STDOUT: %m.param.loc29: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %.loc29_17: type = splice_block %i32.loc29_17 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc29_17: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc29_17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %m.loc29: %i32 = bind_name m, %m.param.loc29 // CHECK:STDOUT: %return.param.loc29: ref %i32 = out_param runtime_param2 // CHECK:STDOUT: %return.loc29: ref %i32 = return_slot %return.param.loc29 @@ -158,15 +174,19 @@ fn C(n: i32, m: i32) -> i32 = "int.sadd"; // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc31_9: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc31_9: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc31_17: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc31_17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc31_25: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc31_25: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %n.param.loc31: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc31_9: type = splice_block %i32.loc31_9 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc31_9: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc31_9: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %n.loc31: %i32 = bind_name n, %n.param.loc31 // CHECK:STDOUT: %m.param.loc31: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %.loc31_17: type = splice_block %i32.loc31_17 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc31_17: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc31_17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %m.loc31: %i32 = bind_name m, %m.param.loc31 // CHECK:STDOUT: %return.param.loc31: ref %i32 = out_param runtime_param2 // CHECK:STDOUT: %return.loc31: ref %i32 = return_slot %return.param.loc31 @@ -179,15 +199,19 @@ fn C(n: i32, m: i32) -> i32 = "int.sadd"; // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc38_9: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc38_9: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc38_17: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc38_17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc38_25: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc38_25: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %n.param.loc38: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc38_9: type = splice_block %i32.loc38_9 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc38_9: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc38_9: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %n.loc38: %i32 = bind_name n, %n.param.loc38 // CHECK:STDOUT: %m.param.loc38: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %.loc38_17: type = splice_block %i32.loc38_17 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc38_17: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc38_17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %m.loc38: %i32 = bind_name m, %m.param.loc38 // CHECK:STDOUT: %return.param.loc38: ref %i32 = out_param runtime_param2 // CHECK:STDOUT: %return.loc38: ref %i32 = return_slot %return.param.loc38 diff --git a/toolchain/check/testdata/function/builtin/method.carbon b/toolchain/check/testdata/function/builtin/method.carbon index 0e484d50fbbe5..177b99b7eb600 100644 --- a/toolchain/check/testdata/function/builtin/method.carbon +++ b/toolchain/check/testdata/function/builtin/method.carbon @@ -34,30 +34,6 @@ var arr: [i32; (1 as i32).(I.F)(2)]; // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [template] // CHECK:STDOUT: %I.facet: %I.type = facet_value %i32, %i32 [template] // CHECK:STDOUT: %interface.1: = interface_witness (%F.2) [template] -// CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @As(%i32) [template] -// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.2, @ImplicitAs(Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.5, @impl.4(%int_32) [template] -// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.6: = interface_witness (%Convert.10) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.5(%int_32) [template] -// CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] -// CHECK:STDOUT: %F.bound: = bound_method %int_1.2, %F.2 [template] -// CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.2, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.12: type = fn_type @Convert.3, @impl.2(%int_32) [template] -// CHECK:STDOUT: %Convert.12: %Convert.type.12 = struct_value () [template] -// CHECK:STDOUT: %interface.7: = interface_witness (%Convert.12) [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.12 [template] -// CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.3(%int_32) [template] -// CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] -// CHECK:STDOUT: %int_3.1: %i32 = int_value 3 [template] -// CHECK:STDOUT: %Convert.type.13: type = fn_type @Convert.4, @impl.3(%int_32) [template] -// CHECK:STDOUT: %Convert.13: %Convert.type.13 = struct_value () [template] -// CHECK:STDOUT: %interface.8: = interface_witness (%Convert.13) [template] -// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_3.1, %Convert.13 [template] -// CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.4(%int_32) [template] // CHECK:STDOUT: %int_3.2: Core.IntLiteral = int_value 3 [template] // CHECK:STDOUT: %array_type: type = array_type %int_3.2, %i32 [template] // CHECK:STDOUT: } @@ -85,38 +61,6 @@ var arr: [i32; (1 as i32).(I.F)(2)]; // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%I.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %int_32.loc19_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc19_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %int_32.loc19_22: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc19_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc19_19: %Convert.type.2 = interface_witness_access constants.%interface.6, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc19_19: = bound_method %int_1, %impl.elem0.loc19_19 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc19_19: = specific_function %Convert.bound.loc19_19, @Convert.5(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc19_19: init %i32 = call %Convert.specific_fn.loc19_19(%int_1) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc19_19.1: %i32 = value_of_initializer %int.convert_checked.loc19_19 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc19_19.2: %i32 = converted %int_1, %.loc19_19.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %I.ref: type = name_ref I, %I.decl [template = constants.%I.type] -// CHECK:STDOUT: %F.ref: %F.assoc_type = name_ref F, @I.%assoc0 [template = constants.%assoc0.1] -// CHECK:STDOUT: %impl.elem0.loc19_26: %F.type.1 = interface_witness_access constants.%interface.1, element0 [template = constants.%F.2] -// CHECK:STDOUT: %F.bound: = bound_method %.loc19_19.2, %impl.elem0.loc19_26 [template = constants.%F.bound] -// CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %impl.elem0.loc19_33: %Convert.type.11 = interface_witness_access constants.%interface.7, element0 [template = constants.%Convert.12] -// CHECK:STDOUT: %Convert.bound.loc19_33: = bound_method %int_2, %impl.elem0.loc19_33 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc19_33: = specific_function %Convert.bound.loc19_33, @Convert.3(constants.%int_32) [template = constants.%Convert.specific_fn.2] -// CHECK:STDOUT: %int.convert_checked.loc19_33: init %i32 = call %Convert.specific_fn.loc19_33(%int_2) [template = constants.%int_2.2] -// CHECK:STDOUT: %.loc19_33.1: %i32 = value_of_initializer %int.convert_checked.loc19_33 [template = constants.%int_2.2] -// CHECK:STDOUT: %.loc19_33.2: %i32 = converted %int_2, %.loc19_33.1 [template = constants.%int_2.2] -// CHECK:STDOUT: %int.sadd: init %i32 = call %F.bound(%.loc19_19.2, %.loc19_33.2) [template = constants.%int_3.1] -// CHECK:STDOUT: %impl.elem0.loc19_34: %Convert.type.6 = interface_witness_access constants.%interface.8, element0 [template = constants.%Convert.13] -// CHECK:STDOUT: %Convert.bound.loc19_34: = bound_method %int.sadd, %impl.elem0.loc19_34 [template = constants.%Convert.bound.3] -// CHECK:STDOUT: %Convert.specific_fn.loc19_34: = specific_function %Convert.bound.loc19_34, @Convert.4(constants.%int_32) [template = constants.%Convert.specific_fn.3] -// CHECK:STDOUT: %.loc19_34.1: %i32 = value_of_initializer %int.sadd [template = constants.%int_3.1] -// CHECK:STDOUT: %.loc19_34.2: %i32 = converted %int.sadd, %.loc19_34.1 [template = constants.%int_3.1] -// CHECK:STDOUT: %int.convert_checked.loc19_34: init Core.IntLiteral = call %Convert.specific_fn.loc19_34(%.loc19_34.2) [template = constants.%int_3.2] -// CHECK:STDOUT: %.loc19_34.3: Core.IntLiteral = value_of_initializer %int.convert_checked.loc19_34 [template = constants.%int_3.2] -// CHECK:STDOUT: %.loc19_34.4: Core.IntLiteral = converted %int.sadd, %.loc19_34.3 [template = constants.%int_3.2] -// CHECK:STDOUT: %array_type: type = array_type %.loc19_34.4, %i32 [template = constants.%array_type] // CHECK:STDOUT: %arr.var: ref %array_type = var arr // CHECK:STDOUT: %arr: ref %array_type = bind_name arr, %arr.var // CHECK:STDOUT: } @@ -131,18 +75,22 @@ var arr: [i32; (1 as i32).(I.F)(2)]; // CHECK:STDOUT: %return.patt: @F.1.%Self.as_type.loc12_14.1 (%Self.as_type.1) = return_slot_pattern // CHECK:STDOUT: %return.param_patt: @F.1.%Self.as_type.loc12_14.1 (%Self.as_type.1) = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref.loc12_14: %I.type = name_ref Self, @I.%Self [symbolic = %Self (constants.%Self.1)] -// CHECK:STDOUT: %Self.as_type.loc12_14.2: type = facet_access_type %Self.ref.loc12_14 [symbolic = %Self.as_type.loc12_14.1 (constants.%Self.as_type.1)] -// CHECK:STDOUT: %.loc12_14: type = converted %Self.ref.loc12_14, %Self.as_type.loc12_14.2 [symbolic = %Self.as_type.loc12_14.1 (constants.%Self.as_type.1)] -// CHECK:STDOUT: %Self.ref.loc12_27: %I.type = name_ref Self, @I.%Self [symbolic = %Self (constants.%Self.1)] -// CHECK:STDOUT: %Self.as_type.loc12_27: type = facet_access_type %Self.ref.loc12_27 [symbolic = %Self.as_type.loc12_14.1 (constants.%Self.as_type.1)] -// CHECK:STDOUT: %.loc12_27: type = converted %Self.ref.loc12_27, %Self.as_type.loc12_27 [symbolic = %Self.as_type.loc12_14.1 (constants.%Self.as_type.1)] // CHECK:STDOUT: %Self.ref.loc12_36: %I.type = name_ref Self, @I.%Self [symbolic = %Self (constants.%Self.1)] // CHECK:STDOUT: %Self.as_type.loc12_36: type = facet_access_type %Self.ref.loc12_36 [symbolic = %Self.as_type.loc12_14.1 (constants.%Self.as_type.1)] // CHECK:STDOUT: %.loc12_36: type = converted %Self.ref.loc12_36, %Self.as_type.loc12_36 [symbolic = %Self.as_type.loc12_14.1 (constants.%Self.as_type.1)] // CHECK:STDOUT: %self.param: @F.1.%Self.as_type.loc12_14.1 (%Self.as_type.1) = value_param runtime_param0 +// CHECK:STDOUT: %.loc12_14.2: type = splice_block %.loc12_14.1 [symbolic = %Self.as_type.loc12_14.1 (constants.%Self.as_type.1)] { +// CHECK:STDOUT: %Self.ref.loc12_14: %I.type = name_ref Self, @I.%Self [symbolic = %Self (constants.%Self.1)] +// CHECK:STDOUT: %Self.as_type.loc12_14.2: type = facet_access_type %Self.ref.loc12_14 [symbolic = %Self.as_type.loc12_14.1 (constants.%Self.as_type.1)] +// CHECK:STDOUT: %.loc12_14.1: type = converted %Self.ref.loc12_14, %Self.as_type.loc12_14.2 [symbolic = %Self.as_type.loc12_14.1 (constants.%Self.as_type.1)] +// CHECK:STDOUT: } // CHECK:STDOUT: %self: @F.1.%Self.as_type.loc12_14.1 (%Self.as_type.1) = bind_name self, %self.param // CHECK:STDOUT: %other.param: @F.1.%Self.as_type.loc12_14.1 (%Self.as_type.1) = value_param runtime_param1 +// CHECK:STDOUT: %.loc12_27.2: type = splice_block %.loc12_27.1 [symbolic = %Self.as_type.loc12_14.1 (constants.%Self.as_type.1)] { +// CHECK:STDOUT: %Self.ref.loc12_27: %I.type = name_ref Self, @I.%Self [symbolic = %Self (constants.%Self.1)] +// CHECK:STDOUT: %Self.as_type.loc12_27: type = facet_access_type %Self.ref.loc12_27 [symbolic = %Self.as_type.loc12_14.1 (constants.%Self.as_type.1)] +// CHECK:STDOUT: %.loc12_27.1: type = converted %Self.ref.loc12_27, %Self.as_type.loc12_27 [symbolic = %Self.as_type.loc12_14.1 (constants.%Self.as_type.1)] +// CHECK:STDOUT: } // CHECK:STDOUT: %other: @F.1.%Self.as_type.loc12_14.1 (%Self.as_type.1) = bind_name other, %other.param // CHECK:STDOUT: %return.param: ref @F.1.%Self.as_type.loc12_14.1 (%Self.as_type.1) = out_param runtime_param2 // CHECK:STDOUT: %return: ref @F.1.%Self.as_type.loc12_14.1 (%Self.as_type.1) = return_slot %return.param @@ -164,15 +112,19 @@ var arr: [i32; (1 as i32).(I.F)(2)]; // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc16_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc16_14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc16_26: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc16_26: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc16_34: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc16_34: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %self.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc16_14: type = splice_block %i32.loc16_14 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc16_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc16_14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %self: %i32 = bind_name self, %self.param // CHECK:STDOUT: %other.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %.loc16_26: type = splice_block %i32.loc16_26 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc16_26: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc16_26: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %other: %i32 = bind_name other, %other.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param diff --git a/toolchain/check/testdata/function/builtin/no_prelude/adapted_type.carbon b/toolchain/check/testdata/function/builtin/no_prelude/adapted_type.carbon index a48d4495fe86e..e8c2f8ea9520e 100644 --- a/toolchain/check/testdata/function/builtin/no_prelude/adapted_type.carbon +++ b/toolchain/check/testdata/function/builtin/no_prelude/adapted_type.carbon @@ -92,8 +92,8 @@ fn Int(N: MyIntLiteral) -> type = "int.make_type_signed"; // CHECK:STDOUT: %return.patt: type = return_slot_pattern // CHECK:STDOUT: %return.param_patt: type = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %MyIntLiteral.ref: type = name_ref MyIntLiteral, file.%MyIntLiteral.decl [template = constants.%MyIntLiteral] // CHECK:STDOUT: %N.param: %MyIntLiteral = value_param runtime_param0 +// CHECK:STDOUT: %MyIntLiteral.ref: type = name_ref MyIntLiteral, file.%MyIntLiteral.decl [template = constants.%MyIntLiteral] // CHECK:STDOUT: %N: %MyIntLiteral = bind_name N, %N.param // CHECK:STDOUT: %return.param: ref type = out_param runtime_param1 // CHECK:STDOUT: %return: ref type = return_slot %return.param @@ -105,9 +105,9 @@ fn Int(N: MyIntLiteral) -> type = "int.make_type_signed"; // CHECK:STDOUT: %return.patt: %MyInt32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %MyInt32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %MyIntLiteral.ref.loc18: type = name_ref MyIntLiteral, file.%MyIntLiteral.decl [template = constants.%MyIntLiteral] // CHECK:STDOUT: %MyInt32.ref.loc18: type = name_ref MyInt32, file.%MyInt32.decl [template = constants.%MyInt32] // CHECK:STDOUT: %a.param.loc18: %MyIntLiteral = value_param runtime_param0 +// CHECK:STDOUT: %MyIntLiteral.ref.loc18: type = name_ref MyIntLiteral, file.%MyIntLiteral.decl [template = constants.%MyIntLiteral] // CHECK:STDOUT: %a.loc18: %MyIntLiteral = bind_name a, %a.param.loc18 // CHECK:STDOUT: %return.param.loc18: ref %MyInt32 = out_param runtime_param1 // CHECK:STDOUT: %return.loc18: ref %MyInt32 = return_slot %return.param.loc18 @@ -120,17 +120,16 @@ fn Int(N: MyIntLiteral) -> type = "int.make_type_signed"; // CHECK:STDOUT: %return.patt: %MyInt32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %MyInt32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %MyInt32.ref.loc20_13: type = name_ref MyInt32, file.%MyInt32.decl [template = constants.%MyInt32] -// CHECK:STDOUT: %MyInt32.ref.loc20_25: type = name_ref MyInt32, file.%MyInt32.decl [template = constants.%MyInt32] // CHECK:STDOUT: %MyInt32.ref.loc20_37: type = name_ref MyInt32, file.%MyInt32.decl [template = constants.%MyInt32] // CHECK:STDOUT: %a.param: %MyInt32 = value_param runtime_param0 +// CHECK:STDOUT: %MyInt32.ref.loc20_13: type = name_ref MyInt32, file.%MyInt32.decl [template = constants.%MyInt32] // CHECK:STDOUT: %a: %MyInt32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %MyInt32 = value_param runtime_param1 +// CHECK:STDOUT: %MyInt32.ref.loc20_25: type = name_ref MyInt32, file.%MyInt32.decl [template = constants.%MyInt32] // CHECK:STDOUT: %b: %MyInt32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref %MyInt32 = out_param runtime_param2 // CHECK:STDOUT: %return: ref %MyInt32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %MyInt32.ref: type = name_ref MyInt32, %MyInt32.decl [template = constants.%MyInt32] // CHECK:STDOUT: %v.var: ref %MyInt32 = var v // CHECK:STDOUT: %v: ref %MyInt32 = bind_name v, %v.var // CHECK:STDOUT: } @@ -164,9 +163,9 @@ fn Int(N: MyIntLiteral) -> type = "int.make_type_signed"; // CHECK:STDOUT: %return.patt: %MyInt32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %MyInt32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %MyIntLiteral.ref.loc15: type = name_ref MyIntLiteral, file.%MyIntLiteral.decl [template = constants.%MyIntLiteral] // CHECK:STDOUT: %MyInt32.ref.loc15: type = name_ref MyInt32, file.%MyInt32.decl [template = constants.%MyInt32] // CHECK:STDOUT: %a.param.loc15: %MyIntLiteral = value_param runtime_param0 +// CHECK:STDOUT: %MyIntLiteral.ref.loc15: type = name_ref MyIntLiteral, file.%MyIntLiteral.decl [template = constants.%MyIntLiteral] // CHECK:STDOUT: %a.loc15: %MyIntLiteral = bind_name a, %a.param.loc15 // CHECK:STDOUT: %return.param.loc15: ref %MyInt32 = out_param runtime_param1 // CHECK:STDOUT: %return.loc15: ref %MyInt32 = return_slot %return.param.loc15 @@ -235,8 +234,8 @@ fn Int(N: MyIntLiteral) -> type = "int.make_type_signed"; // CHECK:STDOUT: %return.patt: type = return_slot_pattern // CHECK:STDOUT: %return.param_patt: type = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %MyIntLiteral.ref: type = name_ref MyIntLiteral, file.%MyIntLiteral.decl [template = constants.%MyIntLiteral] // CHECK:STDOUT: %N.param: %MyIntLiteral = value_param runtime_param0 +// CHECK:STDOUT: %MyIntLiteral.ref: type = name_ref MyIntLiteral, file.%MyIntLiteral.decl [template = constants.%MyIntLiteral] // CHECK:STDOUT: %N: %MyIntLiteral = bind_name N, %N.param // CHECK:STDOUT: %return.param: ref type = out_param runtime_param1 // CHECK:STDOUT: %return: ref type = return_slot %return.param diff --git a/toolchain/check/testdata/function/builtin/no_prelude/call_from_operator.carbon b/toolchain/check/testdata/function/builtin/no_prelude/call_from_operator.carbon index 90ad12a5290d7..f7e06e8a67122 100644 --- a/toolchain/check/testdata/function/builtin/no_prelude/call_from_operator.carbon +++ b/toolchain/check/testdata/function/builtin/no_prelude/call_from_operator.carbon @@ -139,11 +139,13 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: %return.patt: type = return_slot_pattern // CHECK:STDOUT: %return.param_patt: type = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [template = constants.%IntLiteral] -// CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral] -// CHECK:STDOUT: %.loc5_22.1: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral] -// CHECK:STDOUT: %.loc5_22.2: type = converted %int_literal.make_type, %.loc5_22.1 [template = Core.IntLiteral] // CHECK:STDOUT: %N.param: Core.IntLiteral = value_param runtime_param0 +// CHECK:STDOUT: %.loc5_22.3: type = splice_block %.loc5_22.2 [template = Core.IntLiteral] { +// CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [template = constants.%IntLiteral] +// CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral] +// CHECK:STDOUT: %.loc5_22.1: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral] +// CHECK:STDOUT: %.loc5_22.2: type = converted %int_literal.make_type, %.loc5_22.1 [template = Core.IntLiteral] +// CHECK:STDOUT: } // CHECK:STDOUT: %N: Core.IntLiteral = bind_name N, %N.param // CHECK:STDOUT: %return.param: ref type = out_param runtime_param1 // CHECK:STDOUT: %return: ref type = return_slot %return.param @@ -218,18 +220,22 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: %return.patt: @Op.1.%Self.as_type.loc8_15.1 (%Self.as_type.1) = return_slot_pattern // CHECK:STDOUT: %return.param_patt: @Op.1.%Self.as_type.loc8_15.1 (%Self.as_type.1) = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref.loc8_15: %Add.type = name_ref Self, @Add.%Self [symbolic = %Self (constants.%Self.1)] -// CHECK:STDOUT: %Self.as_type.loc8_15.2: type = facet_access_type %Self.ref.loc8_15 [symbolic = %Self.as_type.loc8_15.1 (constants.%Self.as_type.1)] -// CHECK:STDOUT: %.loc8_15: type = converted %Self.ref.loc8_15, %Self.as_type.loc8_15.2 [symbolic = %Self.as_type.loc8_15.1 (constants.%Self.as_type.1)] -// CHECK:STDOUT: %Self.ref.loc8_28: %Add.type = name_ref Self, @Add.%Self [symbolic = %Self (constants.%Self.1)] -// CHECK:STDOUT: %Self.as_type.loc8_28: type = facet_access_type %Self.ref.loc8_28 [symbolic = %Self.as_type.loc8_15.1 (constants.%Self.as_type.1)] -// CHECK:STDOUT: %.loc8_28: type = converted %Self.ref.loc8_28, %Self.as_type.loc8_28 [symbolic = %Self.as_type.loc8_15.1 (constants.%Self.as_type.1)] // CHECK:STDOUT: %Self.ref.loc8_37: %Add.type = name_ref Self, @Add.%Self [symbolic = %Self (constants.%Self.1)] // CHECK:STDOUT: %Self.as_type.loc8_37: type = facet_access_type %Self.ref.loc8_37 [symbolic = %Self.as_type.loc8_15.1 (constants.%Self.as_type.1)] // CHECK:STDOUT: %.loc8_37: type = converted %Self.ref.loc8_37, %Self.as_type.loc8_37 [symbolic = %Self.as_type.loc8_15.1 (constants.%Self.as_type.1)] // CHECK:STDOUT: %self.param: @Op.1.%Self.as_type.loc8_15.1 (%Self.as_type.1) = value_param runtime_param0 +// CHECK:STDOUT: %.loc8_15.2: type = splice_block %.loc8_15.1 [symbolic = %Self.as_type.loc8_15.1 (constants.%Self.as_type.1)] { +// CHECK:STDOUT: %Self.ref.loc8_15: %Add.type = name_ref Self, @Add.%Self [symbolic = %Self (constants.%Self.1)] +// CHECK:STDOUT: %Self.as_type.loc8_15.2: type = facet_access_type %Self.ref.loc8_15 [symbolic = %Self.as_type.loc8_15.1 (constants.%Self.as_type.1)] +// CHECK:STDOUT: %.loc8_15.1: type = converted %Self.ref.loc8_15, %Self.as_type.loc8_15.2 [symbolic = %Self.as_type.loc8_15.1 (constants.%Self.as_type.1)] +// CHECK:STDOUT: } // CHECK:STDOUT: %self: @Op.1.%Self.as_type.loc8_15.1 (%Self.as_type.1) = bind_name self, %self.param // CHECK:STDOUT: %other.param: @Op.1.%Self.as_type.loc8_15.1 (%Self.as_type.1) = value_param runtime_param1 +// CHECK:STDOUT: %.loc8_28.2: type = splice_block %.loc8_28.1 [symbolic = %Self.as_type.loc8_15.1 (constants.%Self.as_type.1)] { +// CHECK:STDOUT: %Self.ref.loc8_28: %Add.type = name_ref Self, @Add.%Self [symbolic = %Self (constants.%Self.1)] +// CHECK:STDOUT: %Self.as_type.loc8_28: type = facet_access_type %Self.ref.loc8_28 [symbolic = %Self.as_type.loc8_15.1 (constants.%Self.as_type.1)] +// CHECK:STDOUT: %.loc8_28.1: type = converted %Self.ref.loc8_28, %Self.as_type.loc8_28 [symbolic = %Self.as_type.loc8_15.1 (constants.%Self.as_type.1)] +// CHECK:STDOUT: } // CHECK:STDOUT: %other: @Op.1.%Self.as_type.loc8_15.1 (%Self.as_type.1) = bind_name other, %other.param // CHECK:STDOUT: %return.param: ref @Op.1.%Self.as_type.loc8_15.1 (%Self.as_type.1) = out_param runtime_param2 // CHECK:STDOUT: %return: ref @Op.1.%Self.as_type.loc8_15.1 (%Self.as_type.1) = return_slot %return.param @@ -262,12 +268,14 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: %return.patt: @Convert.1.%T (%T) = return_slot_pattern // CHECK:STDOUT: %return.param_patt: @Convert.1.%T (%T) = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc12_20.1: @Convert.1.%As.type (%As.type.2) = specific_constant @As.%Self.1, @As(constants.%T) [symbolic = %Self (constants.%Self.2)] -// CHECK:STDOUT: %Self.ref: @Convert.1.%As.type (%As.type.2) = name_ref Self, %.loc12_20.1 [symbolic = %Self (constants.%Self.2)] -// CHECK:STDOUT: %Self.as_type.loc12_20.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc12_20.1 (constants.%Self.as_type.2)] -// CHECK:STDOUT: %.loc12_20.2: type = converted %Self.ref, %Self.as_type.loc12_20.2 [symbolic = %Self.as_type.loc12_20.1 (constants.%Self.as_type.2)] // CHECK:STDOUT: %T.ref: type = name_ref T, @As.%T.loc11_14.1 [symbolic = %T (constants.%T)] // CHECK:STDOUT: %self.param: @Convert.1.%Self.as_type.loc12_20.1 (%Self.as_type.2) = value_param runtime_param0 +// CHECK:STDOUT: %.loc12_20.3: type = splice_block %.loc12_20.2 [symbolic = %Self.as_type.loc12_20.1 (constants.%Self.as_type.2)] { +// CHECK:STDOUT: %.loc12_20.1: @Convert.1.%As.type (%As.type.2) = specific_constant @As.%Self.1, @As(constants.%T) [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: %Self.ref: @Convert.1.%As.type (%As.type.2) = name_ref Self, %.loc12_20.1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: %Self.as_type.loc12_20.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc12_20.1 (constants.%Self.as_type.2)] +// CHECK:STDOUT: %.loc12_20.2: type = converted %Self.ref, %Self.as_type.loc12_20.2 [symbolic = %Self.as_type.loc12_20.1 (constants.%Self.as_type.2)] +// CHECK:STDOUT: } // CHECK:STDOUT: %self: @Convert.1.%Self.as_type.loc12_20.1 (%Self.as_type.2) = bind_name self, %self.param // CHECK:STDOUT: %return.param: ref @Convert.1.%T (%T) = out_param runtime_param1 // CHECK:STDOUT: %return: ref @Convert.1.%T (%T) = return_slot %return.param @@ -301,12 +309,14 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: %return.patt: @Convert.2.%T (%T) = return_slot_pattern // CHECK:STDOUT: %return.param_patt: @Convert.2.%T (%T) = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc16_20.1: @Convert.2.%ImplicitAs.type (%ImplicitAs.type.2) = specific_constant @ImplicitAs.%Self.1, @ImplicitAs(constants.%T) [symbolic = %Self (constants.%Self.3)] -// CHECK:STDOUT: %Self.ref: @Convert.2.%ImplicitAs.type (%ImplicitAs.type.2) = name_ref Self, %.loc16_20.1 [symbolic = %Self (constants.%Self.3)] -// CHECK:STDOUT: %Self.as_type.loc16_20.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc16_20.1 (constants.%Self.as_type.3)] -// CHECK:STDOUT: %.loc16_20.2: type = converted %Self.ref, %Self.as_type.loc16_20.2 [symbolic = %Self.as_type.loc16_20.1 (constants.%Self.as_type.3)] // CHECK:STDOUT: %T.ref: type = name_ref T, @ImplicitAs.%T.loc15_22.1 [symbolic = %T (constants.%T)] // CHECK:STDOUT: %self.param: @Convert.2.%Self.as_type.loc16_20.1 (%Self.as_type.3) = value_param runtime_param0 +// CHECK:STDOUT: %.loc16_20.3: type = splice_block %.loc16_20.2 [symbolic = %Self.as_type.loc16_20.1 (constants.%Self.as_type.3)] { +// CHECK:STDOUT: %.loc16_20.1: @Convert.2.%ImplicitAs.type (%ImplicitAs.type.2) = specific_constant @ImplicitAs.%Self.1, @ImplicitAs(constants.%T) [symbolic = %Self (constants.%Self.3)] +// CHECK:STDOUT: %Self.ref: @Convert.2.%ImplicitAs.type (%ImplicitAs.type.2) = name_ref Self, %.loc16_20.1 [symbolic = %Self (constants.%Self.3)] +// CHECK:STDOUT: %Self.as_type.loc16_20.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc16_20.1 (constants.%Self.as_type.3)] +// CHECK:STDOUT: %.loc16_20.2: type = converted %Self.ref, %Self.as_type.loc16_20.2 [symbolic = %Self.as_type.loc16_20.1 (constants.%Self.as_type.3)] +// CHECK:STDOUT: } // CHECK:STDOUT: %self: @Convert.2.%Self.as_type.loc16_20.1 (%Self.as_type.3) = bind_name self, %self.param // CHECK:STDOUT: %return.param: ref @Convert.2.%T (%T) = out_param runtime_param1 // CHECK:STDOUT: %return: ref @Convert.2.%T (%T) = return_slot %return.param @@ -329,12 +339,12 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: %return.patt: %i32.builtin = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32.builtin = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref.loc20_15: type = name_ref Self, @impl.1.%.loc19_6.2 [template = constants.%i32.builtin] -// CHECK:STDOUT: %Self.ref.loc20_28: type = name_ref Self, @impl.1.%.loc19_6.2 [template = constants.%i32.builtin] // CHECK:STDOUT: %Self.ref.loc20_37: type = name_ref Self, @impl.1.%.loc19_6.2 [template = constants.%i32.builtin] // CHECK:STDOUT: %self.param: %i32.builtin = value_param runtime_param0 +// CHECK:STDOUT: %Self.ref.loc20_15: type = name_ref Self, @impl.1.%.loc19_6.2 [template = constants.%i32.builtin] // CHECK:STDOUT: %self: %i32.builtin = bind_name self, %self.param // CHECK:STDOUT: %other.param: %i32.builtin = value_param runtime_param1 +// CHECK:STDOUT: %Self.ref.loc20_28: type = name_ref Self, @impl.1.%.loc19_6.2 [template = constants.%i32.builtin] // CHECK:STDOUT: %other: %i32.builtin = bind_name other, %other.param // CHECK:STDOUT: %return.param: ref %i32.builtin = out_param runtime_param2 // CHECK:STDOUT: %return: ref %i32.builtin = return_slot %return.param @@ -353,12 +363,12 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: %return.patt: %i32.builtin = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32.builtin = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref: type = name_ref Self, @impl.2.%.loc23_17.2 [template = Core.IntLiteral] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32.builtin] // CHECK:STDOUT: %.loc24_31.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32.builtin] // CHECK:STDOUT: %.loc24_31.2: type = converted %int.make_type_signed, %.loc24_31.1 [template = constants.%i32.builtin] // CHECK:STDOUT: %self.param: Core.IntLiteral = value_param runtime_param0 +// CHECK:STDOUT: %Self.ref: type = name_ref Self, @impl.2.%.loc23_17.2 [template = Core.IntLiteral] // CHECK:STDOUT: %self: Core.IntLiteral = bind_name self, %self.param // CHECK:STDOUT: %return.param: ref %i32.builtin = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32.builtin = return_slot %return.param @@ -377,12 +387,12 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: %return.patt: %i32.builtin = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32.builtin = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref: type = name_ref Self, @impl.3.%.loc27_17.2 [template = Core.IntLiteral] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32.builtin] // CHECK:STDOUT: %.loc28_31.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32.builtin] // CHECK:STDOUT: %.loc28_31.2: type = converted %int.make_type_signed, %.loc28_31.1 [template = constants.%i32.builtin] // CHECK:STDOUT: %self.param: Core.IntLiteral = value_param runtime_param0 +// CHECK:STDOUT: %Self.ref: type = name_ref Self, @impl.3.%.loc27_17.2 [template = Core.IntLiteral] // CHECK:STDOUT: %self: Core.IntLiteral = bind_name self, %self.param // CHECK:STDOUT: %return.param: ref %i32.builtin = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32.builtin = return_slot %return.param @@ -401,12 +411,12 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: %return.patt: Core.IntLiteral = return_slot_pattern // CHECK:STDOUT: %return.param_patt: Core.IntLiteral = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref: type = name_ref Self, @impl.4.%.loc31_6.2 [template = constants.%i32.builtin] // CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [template = constants.%IntLiteral] // CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral] // CHECK:STDOUT: %.loc32_42.1: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral] // CHECK:STDOUT: %.loc32_42.2: type = converted %int_literal.make_type, %.loc32_42.1 [template = Core.IntLiteral] // CHECK:STDOUT: %self.param: %i32.builtin = value_param runtime_param0 +// CHECK:STDOUT: %Self.ref: type = name_ref Self, @impl.4.%.loc31_6.2 [template = constants.%i32.builtin] // CHECK:STDOUT: %self: %i32.builtin = bind_name self, %self.param // CHECK:STDOUT: %return.param: ref Core.IntLiteral = out_param runtime_param1 // CHECK:STDOUT: %return: ref Core.IntLiteral = return_slot %return.param @@ -602,11 +612,7 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.3 [template] // CHECK:STDOUT: %Convert.6: %Convert.type.6 = struct_value () [template] // CHECK:STDOUT: %interface.1: = interface_witness (%Convert.6) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.6 [template] -// CHECK:STDOUT: %int_1.2: %i32.builtin = int_value 1 [template] // CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.6 [template] -// CHECK:STDOUT: %int_2.2: %i32.builtin = int_value 2 [template] // CHECK:STDOUT: %Op.type.1: type = fn_type @Op.1 [template] // CHECK:STDOUT: %Self.as_type.3: type = facet_access_type %Self.2 [symbolic] // CHECK:STDOUT: %Op.assoc_type: type = assoc_entity_type %Add.type, %Op.type.1 [template] @@ -614,13 +620,11 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: %Op.type.2: type = fn_type @Op.2 [template] // CHECK:STDOUT: %Op.2: %Op.type.2 = struct_value () [template] // CHECK:STDOUT: %interface.2: = interface_witness (%Op.2) [template] -// CHECK:STDOUT: %Op.bound.1: = bound_method %int_1.2, %Op.2 [template] // CHECK:STDOUT: %int_3.1: %i32.builtin = int_value 3 [template] // CHECK:STDOUT: %assoc0.8: %Convert.assoc_type.3 = assoc_entity element0, imports.%import_ref.32 [symbolic] // CHECK:STDOUT: %Convert.type.7: type = fn_type @Convert.4 [template] // CHECK:STDOUT: %Convert.7: %Convert.type.7 = struct_value () [template] // CHECK:STDOUT: %interface.3: = interface_witness (%Convert.7) [template] -// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_3.1, %Convert.7 [template] // CHECK:STDOUT: %int_3.2: Core.IntLiteral = int_value 3 [template] // CHECK:STDOUT: %array_type: type = array_type %int_3.2, %i32.builtin [template] // CHECK:STDOUT: %int_4.1: Core.IntLiteral = int_value 4 [template] @@ -647,11 +651,11 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: .ImplicitAs = %import_ref.31 // CHECK:STDOUT: import Core//default // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.3 = import_ref Core//default, inst82 [no loc], unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref Core//default, inst85 [no loc], unloaded // CHECK:STDOUT: %import_ref.4: @As.%Convert.assoc_type (%Convert.assoc_type.1) = import_ref Core//default, loc12_32, loaded [symbolic = @As.%assoc0 (constants.%assoc0.3)] // CHECK:STDOUT: %import_ref.5 = import_ref Core//default, Convert, unloaded // CHECK:STDOUT: %import_ref.6 = import_ref Core//default, loc12_32, unloaded -// CHECK:STDOUT: %import_ref.8 = import_ref Core//default, inst38 [no loc], unloaded +// CHECK:STDOUT: %import_ref.8 = import_ref Core//default, inst39 [no loc], unloaded // CHECK:STDOUT: %import_ref.9: %Op.assoc_type = import_ref Core//default, loc8_41, loaded [template = constants.%assoc0.7] // CHECK:STDOUT: %import_ref.10 = import_ref Core//default, Op, unloaded // CHECK:STDOUT: %import_ref.11: type = import_ref Core//default, loc19_6, loaded [template = constants.%i32.builtin] @@ -660,7 +664,7 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: %import_ref.14: type = import_ref Core//default, loc23_17, loaded [template = Core.IntLiteral] // CHECK:STDOUT: %import_ref.15: type = import_ref Core//default, loc23_28, loaded [template = constants.%As.type.3] // CHECK:STDOUT: %import_ref.16: = import_ref Core//default, loc23_30, loaded [template = constants.%interface.1] -// CHECK:STDOUT: %import_ref.17 = import_ref Core//default, inst124 [no loc], unloaded +// CHECK:STDOUT: %import_ref.17 = import_ref Core//default, inst128 [no loc], unloaded // CHECK:STDOUT: %import_ref.18: @ImplicitAs.%Convert.assoc_type (%Convert.assoc_type.3) = import_ref Core//default, loc16_32, loaded [symbolic = @ImplicitAs.%assoc0 (constants.%assoc0.8)] // CHECK:STDOUT: %import_ref.19 = import_ref Core//default, Convert, unloaded // CHECK:STDOUT: %import_ref.20: type = import_ref Core//default, loc27_17, loaded [template = Core.IntLiteral] @@ -678,41 +682,6 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: .arr = %arr // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int_32.loc4_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc4_11: init type = call constants.%Int(%int_32.loc4_11) [template = constants.%i32.builtin] -// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %int_32.loc4_22: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc4_22: init type = call constants.%Int(%int_32.loc4_22) [template = constants.%i32.builtin] -// CHECK:STDOUT: %.loc4_22.1: type = value_of_initializer %int.make_type_signed.loc4_22 [template = constants.%i32.builtin] -// CHECK:STDOUT: %.loc4_22.2: type = converted %int.make_type_signed.loc4_22, %.loc4_22.1 [template = constants.%i32.builtin] -// CHECK:STDOUT: %impl.elem0.loc4_19: %Convert.type.2 = interface_witness_access constants.%interface.1, element0 [template = constants.%Convert.6] -// CHECK:STDOUT: %Convert.bound.loc4_19: = bound_method %int_1, %impl.elem0.loc4_19 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %int.convert_checked.loc4_19: init %i32.builtin = call %Convert.bound.loc4_19(%int_1) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc4_19.1: %i32.builtin = value_of_initializer %int.convert_checked.loc4_19 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc4_19.2: %i32.builtin = converted %int_1, %.loc4_19.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %int_32.loc4_35: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc4_35: init type = call constants.%Int(%int_32.loc4_35) [template = constants.%i32.builtin] -// CHECK:STDOUT: %.loc4_35.1: type = value_of_initializer %int.make_type_signed.loc4_35 [template = constants.%i32.builtin] -// CHECK:STDOUT: %.loc4_35.2: type = converted %int.make_type_signed.loc4_35, %.loc4_35.1 [template = constants.%i32.builtin] -// CHECK:STDOUT: %impl.elem0.loc4_32: %Convert.type.2 = interface_witness_access constants.%interface.1, element0 [template = constants.%Convert.6] -// CHECK:STDOUT: %Convert.bound.loc4_32: = bound_method %int_2, %impl.elem0.loc4_32 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %int.convert_checked.loc4_32: init %i32.builtin = call %Convert.bound.loc4_32(%int_2) [template = constants.%int_2.2] -// CHECK:STDOUT: %.loc4_32.1: %i32.builtin = value_of_initializer %int.convert_checked.loc4_32 [template = constants.%int_2.2] -// CHECK:STDOUT: %.loc4_32.2: %i32.builtin = converted %int_2, %.loc4_32.1 [template = constants.%int_2.2] -// CHECK:STDOUT: %impl.elem0.loc4_27.1: %Op.type.1 = interface_witness_access constants.%interface.2, element0 [template = constants.%Op.2] -// CHECK:STDOUT: %Op.bound: = bound_method %.loc4_19.2, %impl.elem0.loc4_27.1 [template = constants.%Op.bound.1] -// CHECK:STDOUT: %int.sadd: init %i32.builtin = call %Op.bound(%.loc4_19.2, %.loc4_32.2) [template = constants.%int_3.1] -// CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_signed.loc4_11 [template = constants.%i32.builtin] -// CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_signed.loc4_11, %.loc4_11.1 [template = constants.%i32.builtin] -// CHECK:STDOUT: %impl.elem0.loc4_27.2: %Convert.type.5 = interface_witness_access constants.%interface.3, element0 [template = constants.%Convert.7] -// CHECK:STDOUT: %Convert.bound.loc4_27: = bound_method %int.sadd, %impl.elem0.loc4_27.2 [template = constants.%Convert.bound.3] -// CHECK:STDOUT: %.loc4_27.1: %i32.builtin = value_of_initializer %int.sadd [template = constants.%int_3.1] -// CHECK:STDOUT: %.loc4_27.2: %i32.builtin = converted %int.sadd, %.loc4_27.1 [template = constants.%int_3.1] -// CHECK:STDOUT: %int.convert_checked.loc4_27: init Core.IntLiteral = call %Convert.bound.loc4_27(%.loc4_27.2) [template = constants.%int_3.2] -// CHECK:STDOUT: %.loc4_27.3: Core.IntLiteral = value_of_initializer %int.convert_checked.loc4_27 [template = constants.%int_3.2] -// CHECK:STDOUT: %.loc4_27.4: Core.IntLiteral = converted %int.sadd, %.loc4_27.3 [template = constants.%int_3.2] -// CHECK:STDOUT: %array_type: type = array_type %.loc4_27.4, %i32.builtin [template = constants.%array_type] // CHECK:STDOUT: %arr.var: ref %array_type = var arr // CHECK:STDOUT: %arr: ref %array_type = bind_name arr, %arr.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/function/builtin/no_prelude/import.carbon b/toolchain/check/testdata/function/builtin/no_prelude/import.carbon index 323b98e6ff1f1..b6d3c726cfbeb 100644 --- a/toolchain/check/testdata/function/builtin/no_prelude/import.carbon +++ b/toolchain/check/testdata/function/builtin/no_prelude/import.carbon @@ -65,11 +65,13 @@ var arr: [i32; Core.AsIntLiteral(Core.TestAdd(Core.AsI32(1), Core.AsI32(2)))] = // CHECK:STDOUT: %return.patt: type = return_slot_pattern // CHECK:STDOUT: %return.param_patt: type = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [template = constants.%IntLiteral] -// CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral] -// CHECK:STDOUT: %.loc6_22.1: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral] -// CHECK:STDOUT: %.loc6_22.2: type = converted %int_literal.make_type, %.loc6_22.1 [template = Core.IntLiteral] // CHECK:STDOUT: %N.param: Core.IntLiteral = value_param runtime_param0 +// CHECK:STDOUT: %.loc6_22.3: type = splice_block %.loc6_22.2 [template = Core.IntLiteral] { +// CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [template = constants.%IntLiteral] +// CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral] +// CHECK:STDOUT: %.loc6_22.1: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral] +// CHECK:STDOUT: %.loc6_22.2: type = converted %int_literal.make_type, %.loc6_22.1 [template = Core.IntLiteral] +// CHECK:STDOUT: } // CHECK:STDOUT: %N: Core.IntLiteral = bind_name N, %N.param // CHECK:STDOUT: %return.param: ref type = out_param runtime_param1 // CHECK:STDOUT: %return: ref type = return_slot %return.param @@ -80,15 +82,17 @@ var arr: [i32; Core.AsIntLiteral(Core.TestAdd(Core.AsI32(1), Core.AsI32(2)))] = // CHECK:STDOUT: %return.patt: %i32.builtin = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32.builtin = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [template = constants.%IntLiteral] -// CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral] -// CHECK:STDOUT: %.loc8_24.1: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral] -// CHECK:STDOUT: %.loc8_24.2: type = converted %int_literal.make_type, %.loc8_24.1 [template = Core.IntLiteral] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32.builtin] // CHECK:STDOUT: %.loc8_30.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32.builtin] // CHECK:STDOUT: %.loc8_30.2: type = converted %int.make_type_signed, %.loc8_30.1 [template = constants.%i32.builtin] // CHECK:STDOUT: %a.param: Core.IntLiteral = value_param runtime_param0 +// CHECK:STDOUT: %.loc8_24.3: type = splice_block %.loc8_24.2 [template = Core.IntLiteral] { +// CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [template = constants.%IntLiteral] +// CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral] +// CHECK:STDOUT: %.loc8_24.1: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral] +// CHECK:STDOUT: %.loc8_24.2: type = converted %int_literal.make_type, %.loc8_24.1 [template = Core.IntLiteral] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: Core.IntLiteral = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %i32.builtin = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32.builtin = return_slot %return.param @@ -99,15 +103,17 @@ var arr: [i32; Core.AsIntLiteral(Core.TestAdd(Core.AsI32(1), Core.AsI32(2)))] = // CHECK:STDOUT: %return.patt: Core.IntLiteral = return_slot_pattern // CHECK:STDOUT: %return.param_patt: Core.IntLiteral = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32.builtin] -// CHECK:STDOUT: %.loc9_20.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32.builtin] -// CHECK:STDOUT: %.loc9_20.2: type = converted %int.make_type_signed, %.loc9_20.1 [template = constants.%i32.builtin] // CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [template = constants.%IntLiteral] // CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral] // CHECK:STDOUT: %.loc9_39.1: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral] // CHECK:STDOUT: %.loc9_39.2: type = converted %int_literal.make_type, %.loc9_39.1 [template = Core.IntLiteral] // CHECK:STDOUT: %a.param: %i32.builtin = value_param runtime_param0 +// CHECK:STDOUT: %.loc9_20.3: type = splice_block %.loc9_20.2 [template = constants.%i32.builtin] { +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32.builtin] +// CHECK:STDOUT: %.loc9_20.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32.builtin] +// CHECK:STDOUT: %.loc9_20.2: type = converted %int.make_type_signed, %.loc9_20.1 [template = constants.%i32.builtin] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32.builtin = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref Core.IntLiteral = out_param runtime_param1 // CHECK:STDOUT: %return: ref Core.IntLiteral = return_slot %return.param @@ -120,21 +126,25 @@ var arr: [i32; Core.AsIntLiteral(Core.TestAdd(Core.AsI32(1), Core.AsI32(2)))] = // CHECK:STDOUT: %return.patt: %i32.builtin = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32.builtin = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc11_15: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11_15: init type = call constants.%Int(%int_32.loc11_15) [template = constants.%i32.builtin] -// CHECK:STDOUT: %.loc11_15.1: type = value_of_initializer %int.make_type_signed.loc11_15 [template = constants.%i32.builtin] -// CHECK:STDOUT: %.loc11_15.2: type = converted %int.make_type_signed.loc11_15, %.loc11_15.1 [template = constants.%i32.builtin] -// CHECK:STDOUT: %int_32.loc11_23: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc11_23: init type = call constants.%Int(%int_32.loc11_23) [template = constants.%i32.builtin] -// CHECK:STDOUT: %.loc11_23.1: type = value_of_initializer %int.make_type_signed.loc11_23 [template = constants.%i32.builtin] -// CHECK:STDOUT: %.loc11_23.2: type = converted %int.make_type_signed.loc11_23, %.loc11_23.1 [template = constants.%i32.builtin] // CHECK:STDOUT: %int_32.loc11_31: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %int.make_type_signed.loc11_31: init type = call constants.%Int(%int_32.loc11_31) [template = constants.%i32.builtin] // CHECK:STDOUT: %.loc11_31.1: type = value_of_initializer %int.make_type_signed.loc11_31 [template = constants.%i32.builtin] // CHECK:STDOUT: %.loc11_31.2: type = converted %int.make_type_signed.loc11_31, %.loc11_31.1 [template = constants.%i32.builtin] // CHECK:STDOUT: %a.param: %i32.builtin = value_param runtime_param0 +// CHECK:STDOUT: %.loc11_15.3: type = splice_block %.loc11_15.2 [template = constants.%i32.builtin] { +// CHECK:STDOUT: %int_32.loc11_15: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %int.make_type_signed.loc11_15: init type = call constants.%Int(%int_32.loc11_15) [template = constants.%i32.builtin] +// CHECK:STDOUT: %.loc11_15.1: type = value_of_initializer %int.make_type_signed.loc11_15 [template = constants.%i32.builtin] +// CHECK:STDOUT: %.loc11_15.2: type = converted %int.make_type_signed.loc11_15, %.loc11_15.1 [template = constants.%i32.builtin] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32.builtin = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32.builtin = value_param runtime_param1 +// CHECK:STDOUT: %.loc11_23.3: type = splice_block %.loc11_23.2 [template = constants.%i32.builtin] { +// CHECK:STDOUT: %int_32.loc11_23: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %int.make_type_signed.loc11_23: init type = call constants.%Int(%int_32.loc11_23) [template = constants.%i32.builtin] +// CHECK:STDOUT: %.loc11_23.1: type = value_of_initializer %int.make_type_signed.loc11_23 [template = constants.%i32.builtin] +// CHECK:STDOUT: %.loc11_23.2: type = converted %int.make_type_signed.loc11_23, %.loc11_23.1 [template = constants.%i32.builtin] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: %i32.builtin = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref %i32.builtin = out_param runtime_param2 // CHECK:STDOUT: %return: ref %i32.builtin = return_slot %return.param @@ -155,13 +165,7 @@ var arr: [i32; Core.AsIntLiteral(Core.TestAdd(Core.AsI32(1), Core.AsI32(2)))] = // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] // CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [template] -// CHECK:STDOUT: %AsIntLiteral.type: type = fn_type @AsIntLiteral [template] -// CHECK:STDOUT: %AsIntLiteral: %AsIntLiteral.type = struct_value () [template] -// CHECK:STDOUT: %TestAdd.type: type = fn_type @TestAdd [template] -// CHECK:STDOUT: %TestAdd: %TestAdd.type = struct_value () [template] // CHECK:STDOUT: %AsI32.type: type = fn_type @AsI32 [template] // CHECK:STDOUT: %AsI32: %AsI32.type = struct_value () [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] @@ -184,8 +188,6 @@ var arr: [i32; Core.AsIntLiteral(Core.TestAdd(Core.AsI32(1), Core.AsI32(2)))] = // CHECK:STDOUT: .AsI32 = %import_ref.4 // CHECK:STDOUT: import Core//core // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.2: %AsIntLiteral.type = import_ref Core//core, AsIntLiteral, loaded [template = constants.%AsIntLiteral] -// CHECK:STDOUT: %import_ref.3: %TestAdd.type = import_ref Core//core, TestAdd, loaded [template = constants.%TestAdd] // CHECK:STDOUT: %import_ref.4: %AsI32.type = import_ref Core//core, AsI32, loaded [template = constants.%AsI32] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -195,33 +197,6 @@ var arr: [i32; Core.AsIntLiteral(Core.TestAdd(Core.AsI32(1), Core.AsI32(2)))] = // CHECK:STDOUT: .arr = %arr // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32.builtin] -// CHECK:STDOUT: %Core.ref.loc4_16: = name_ref Core, imports.%Core [template = imports.%Core] -// CHECK:STDOUT: %AsIntLiteral.ref: %AsIntLiteral.type = name_ref AsIntLiteral, imports.%import_ref.2 [template = constants.%AsIntLiteral] -// CHECK:STDOUT: %Core.ref.loc4_34: = name_ref Core, imports.%Core [template = imports.%Core] -// CHECK:STDOUT: %TestAdd.ref: %TestAdd.type = name_ref TestAdd, imports.%import_ref.3 [template = constants.%TestAdd] -// CHECK:STDOUT: %Core.ref.loc4_47: = name_ref Core, imports.%Core [template = imports.%Core] -// CHECK:STDOUT: %AsI32.ref.loc4_51: %AsI32.type = name_ref AsI32, imports.%import_ref.4 [template = constants.%AsI32] -// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %int.convert_checked.loc4_59: init %i32.builtin = call %AsI32.ref.loc4_51(%int_1) [template = constants.%int_1.2] -// CHECK:STDOUT: %Core.ref.loc4_62: = name_ref Core, imports.%Core [template = imports.%Core] -// CHECK:STDOUT: %AsI32.ref.loc4_66: %AsI32.type = name_ref AsI32, imports.%import_ref.4 [template = constants.%AsI32] -// CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %int.convert_checked.loc4_74: init %i32.builtin = call %AsI32.ref.loc4_66(%int_2) [template = constants.%int_2.2] -// CHECK:STDOUT: %.loc4_59.1: %i32.builtin = value_of_initializer %int.convert_checked.loc4_59 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc4_59.2: %i32.builtin = converted %int.convert_checked.loc4_59, %.loc4_59.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc4_74.1: %i32.builtin = value_of_initializer %int.convert_checked.loc4_74 [template = constants.%int_2.2] -// CHECK:STDOUT: %.loc4_74.2: %i32.builtin = converted %int.convert_checked.loc4_74, %.loc4_74.1 [template = constants.%int_2.2] -// CHECK:STDOUT: %int.sadd: init %i32.builtin = call %TestAdd.ref(%.loc4_59.2, %.loc4_74.2) [template = constants.%int_3.1] -// CHECK:STDOUT: %.loc4_75.1: %i32.builtin = value_of_initializer %int.sadd [template = constants.%int_3.1] -// CHECK:STDOUT: %.loc4_75.2: %i32.builtin = converted %int.sadd, %.loc4_75.1 [template = constants.%int_3.1] -// CHECK:STDOUT: %int.convert_checked.loc4_76: init Core.IntLiteral = call %AsIntLiteral.ref(%.loc4_75.2) [template = constants.%int_3.2] -// CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32.builtin] -// CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_signed, %.loc4_11.1 [template = constants.%i32.builtin] -// CHECK:STDOUT: %.loc4_76.1: Core.IntLiteral = value_of_initializer %int.convert_checked.loc4_76 [template = constants.%int_3.2] -// CHECK:STDOUT: %.loc4_76.2: Core.IntLiteral = converted %int.convert_checked.loc4_76, %.loc4_76.1 [template = constants.%int_3.2] -// CHECK:STDOUT: %array_type: type = array_type %.loc4_76.2, %i32.builtin [template = constants.%array_type] // CHECK:STDOUT: %arr.var: ref %array_type = var arr // CHECK:STDOUT: %arr: ref %array_type = bind_name arr, %arr.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/function/call/fail_not_callable.carbon b/toolchain/check/testdata/function/call/fail_not_callable.carbon index bf4252f757528..90ce1887a29d6 100644 --- a/toolchain/check/testdata/function/call/fail_not_callable.carbon +++ b/toolchain/check/testdata/function/call/fail_not_callable.carbon @@ -44,8 +44,6 @@ fn Run() { // CHECK:STDOUT: // CHECK:STDOUT: fn @Run() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %x.var: ref %i32 = var x // CHECK:STDOUT: %x: ref %i32 = bind_name x, %x.var // CHECK:STDOUT: %str: String = string_literal "hello" [template = constants.%str] diff --git a/toolchain/check/testdata/function/call/fail_param_count.carbon b/toolchain/check/testdata/function/call/fail_param_count.carbon index abfbc572e780e..1267560ca9fab 100644 --- a/toolchain/check/testdata/function/call/fail_param_count.carbon +++ b/toolchain/check/testdata/function/call/fail_param_count.carbon @@ -103,9 +103,11 @@ fn Main() { // CHECK:STDOUT: %a.patt: %i32 = binding_pattern a // CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc12: type = splice_block %i32 [template = constants.%i32] { +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: } // CHECK:STDOUT: %Run2.decl: %Run2.type = fn_decl @Run2 [template = constants.%Run2] { @@ -114,13 +116,17 @@ fn Main() { // CHECK:STDOUT: %b.patt: %i32 = binding_pattern b // CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc13_12: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc13_12: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc13_20: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc13_20: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc13_12: type = splice_block %i32.loc13_12 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc13_12: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc13_12: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %.loc13_20: type = splice_block %i32.loc13_20 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc13_20: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc13_20: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: } // CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} {} diff --git a/toolchain/check/testdata/function/call/fail_param_type.carbon b/toolchain/check/testdata/function/call/fail_param_type.carbon index d83e4bc2810e9..0946fef0b062e 100644 --- a/toolchain/check/testdata/function/call/fail_param_type.carbon +++ b/toolchain/check/testdata/function/call/fail_param_type.carbon @@ -56,9 +56,11 @@ fn F() { // CHECK:STDOUT: %a.patt: %i32 = binding_pattern a // CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc11: type = splice_block %i32 [template = constants.%i32] { +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: } // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {} diff --git a/toolchain/check/testdata/function/call/fail_return_type_mismatch.carbon b/toolchain/check/testdata/function/call/fail_return_type_mismatch.carbon index 84f125a43aa5b..262bd26f50d57 100644 --- a/toolchain/check/testdata/function/call/fail_return_type_mismatch.carbon +++ b/toolchain/check/testdata/function/call/fail_return_type_mismatch.carbon @@ -74,8 +74,6 @@ fn Run() { // CHECK:STDOUT: // CHECK:STDOUT: fn @Run() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %x.var: ref %i32 = var x // CHECK:STDOUT: %x: ref %i32 = bind_name x, %x.var // CHECK:STDOUT: %Foo.ref: %Foo.type = name_ref Foo, file.%Foo.decl [template = constants.%Foo] diff --git a/toolchain/check/testdata/function/call/i32.carbon b/toolchain/check/testdata/function/call/i32.carbon index f86058a34f7dd..728319a639585 100644 --- a/toolchain/check/testdata/function/call/i32.carbon +++ b/toolchain/check/testdata/function/call/i32.carbon @@ -57,11 +57,13 @@ fn Main() { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc11_12: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc11_12: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc11_20: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc11_20: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc11: type = splice_block %i32.loc11_12 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc11_12: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc11_12: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -77,8 +79,6 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: fn @Main() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %b.var: ref %i32 = var b // CHECK:STDOUT: %b: ref %i32 = bind_name b, %b.var // CHECK:STDOUT: %Echo.ref: %Echo.type = name_ref Echo, file.%Echo.decl [template = constants.%Echo] diff --git a/toolchain/check/testdata/function/call/more_param_ir.carbon b/toolchain/check/testdata/function/call/more_param_ir.carbon index b506d7dd3fc92..b74cfefdfec08 100644 --- a/toolchain/check/testdata/function/call/more_param_ir.carbon +++ b/toolchain/check/testdata/function/call/more_param_ir.carbon @@ -26,7 +26,6 @@ fn Main() { // CHECK:STDOUT: %Foo: %Foo.type = struct_value () [template] // CHECK:STDOUT: %Main.type: type = fn_type @Main [template] // CHECK:STDOUT: %Main: %Main.type = struct_value () [template] -// CHECK:STDOUT: %tuple.type.1: type = tuple_type (type) [template] // CHECK:STDOUT: %tuple.type.2: type = tuple_type (%i32) [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %tuple.type.3: type = tuple_type (Core.IntLiteral) [template] @@ -67,13 +66,17 @@ fn Main() { // CHECK:STDOUT: %b.patt: %i32 = binding_pattern b // CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc11_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc11_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc11_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc11_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc11_11: type = splice_block %i32.loc11_11 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc11_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc11_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %.loc11_19: type = splice_block %i32.loc11_19 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc11_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc11_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: } // CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} {} @@ -86,10 +89,6 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: fn @Main() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc14_15.1: %tuple.type.1 = tuple_literal (%i32) -// CHECK:STDOUT: %.loc14_15.2: type = converted %.loc14_15.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %x.var: ref %tuple.type.2 = var x // CHECK:STDOUT: %x: ref %tuple.type.2 = bind_name x, %x.var // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] diff --git a/toolchain/check/testdata/function/call/no_prelude/alias.carbon b/toolchain/check/testdata/function/call/no_prelude/alias.carbon index a4c6d5cf89b17..6e61c2bbf26c2 100644 --- a/toolchain/check/testdata/function/call/no_prelude/alias.carbon +++ b/toolchain/check/testdata/function/call/no_prelude/alias.carbon @@ -57,8 +57,6 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: fn @Main() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc16_11.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc16_11.2: type = converted %.loc16_11.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %b.var: ref %empty_tuple.type = var b // CHECK:STDOUT: %b: ref %empty_tuple.type = bind_name b, %b.var // CHECK:STDOUT: %B.ref: %A.type = name_ref B, file.%B [template = constants.%A] diff --git a/toolchain/check/testdata/function/call/no_prelude/empty_struct.carbon b/toolchain/check/testdata/function/call/no_prelude/empty_struct.carbon index 7a9315d27fb57..410317f8f6873 100644 --- a/toolchain/check/testdata/function/call/no_prelude/empty_struct.carbon +++ b/toolchain/check/testdata/function/call/no_prelude/empty_struct.carbon @@ -38,11 +38,13 @@ fn Main() { // CHECK:STDOUT: %return.patt: %empty_struct_type = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %empty_struct_type = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc11_13.1: %empty_struct_type = struct_literal () -// CHECK:STDOUT: %.loc11_13.2: type = converted %.loc11_13.1, constants.%empty_struct_type [template = constants.%empty_struct_type] // CHECK:STDOUT: %.loc11_20.1: %empty_struct_type = struct_literal () // CHECK:STDOUT: %.loc11_20.2: type = converted %.loc11_20.1, constants.%empty_struct_type [template = constants.%empty_struct_type] // CHECK:STDOUT: %a.param: %empty_struct_type = value_param runtime_param0 +// CHECK:STDOUT: %.loc11_13.3: type = splice_block %.loc11_13.2 [template = constants.%empty_struct_type] { +// CHECK:STDOUT: %.loc11_13.1: %empty_struct_type = struct_literal () +// CHECK:STDOUT: %.loc11_13.2: type = converted %.loc11_13.1, constants.%empty_struct_type [template = constants.%empty_struct_type] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %empty_struct_type = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %empty_struct_type = out_param runtime_param1 // CHECK:STDOUT: %return: ref %empty_struct_type = return_slot %return.param diff --git a/toolchain/check/testdata/function/call/no_prelude/empty_tuple.carbon b/toolchain/check/testdata/function/call/no_prelude/empty_tuple.carbon index 531e91e3b8e8a..07cac638281cb 100644 --- a/toolchain/check/testdata/function/call/no_prelude/empty_tuple.carbon +++ b/toolchain/check/testdata/function/call/no_prelude/empty_tuple.carbon @@ -38,11 +38,13 @@ fn Main() { // CHECK:STDOUT: %return.patt: %empty_tuple.type = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %empty_tuple.type = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc11_13.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc11_13.2: type = converted %.loc11_13.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %.loc11_20.1: %empty_tuple.type = tuple_literal () // CHECK:STDOUT: %.loc11_20.2: type = converted %.loc11_20.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %a.param: %empty_tuple.type = value_param runtime_param0 +// CHECK:STDOUT: %.loc11_13.3: type = splice_block %.loc11_13.2 [template = constants.%empty_tuple.type] { +// CHECK:STDOUT: %.loc11_13.1: %empty_tuple.type = tuple_literal () +// CHECK:STDOUT: %.loc11_13.2: type = converted %.loc11_13.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %empty_tuple.type = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %empty_tuple.type = out_param runtime_param1 // CHECK:STDOUT: %return: ref %empty_tuple.type = return_slot %return.param diff --git a/toolchain/check/testdata/function/call/no_prelude/fail_explicit_self_param.carbon b/toolchain/check/testdata/function/call/no_prelude/fail_explicit_self_param.carbon index 589fa3171a009..064919ec0ff54 100644 --- a/toolchain/check/testdata/function/call/no_prelude/fail_explicit_self_param.carbon +++ b/toolchain/check/testdata/function/call/no_prelude/fail_explicit_self_param.carbon @@ -37,9 +37,11 @@ fn Run() { // CHECK:STDOUT: %self.patt: %empty_tuple.type = binding_pattern self // CHECK:STDOUT: %self.param_patt: %empty_tuple.type = value_param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc14_13.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc14_13.2: type = converted %.loc14_13.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %self.param: %empty_tuple.type = value_param runtime_param0 +// CHECK:STDOUT: %.loc14_13.3: type = splice_block %.loc14_13.2 [template = constants.%empty_tuple.type] { +// CHECK:STDOUT: %.loc14_13.1: %empty_tuple.type = tuple_literal () +// CHECK:STDOUT: %.loc14_13.2: type = converted %.loc14_13.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] +// CHECK:STDOUT: } // CHECK:STDOUT: %self: %empty_tuple.type = bind_name self, %self.param // CHECK:STDOUT: } // CHECK:STDOUT: %Run.decl: %Run.type = fn_decl @Run [template = constants.%Run] {} {} diff --git a/toolchain/check/testdata/function/call/no_prelude/fail_runtime_implicit_param.carbon b/toolchain/check/testdata/function/call/no_prelude/fail_runtime_implicit_param.carbon index 620bc55ded007..9cce73b8d8017 100644 --- a/toolchain/check/testdata/function/call/no_prelude/fail_runtime_implicit_param.carbon +++ b/toolchain/check/testdata/function/call/no_prelude/fail_runtime_implicit_param.carbon @@ -32,10 +32,7 @@ fn Run() { // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: .Run = %Run.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} { -// CHECK:STDOUT: %.loc14_10.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc14_10.2: type = converted %.loc14_10.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] -// CHECK:STDOUT: } +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {} // CHECK:STDOUT: %Run.decl: %Run.type = fn_decl @Run [template = constants.%Run] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/call/no_prelude/return_implicit.carbon b/toolchain/check/testdata/function/call/no_prelude/return_implicit.carbon index 185d753712850..d101f7d91efb5 100644 --- a/toolchain/check/testdata/function/call/no_prelude/return_implicit.carbon +++ b/toolchain/check/testdata/function/call/no_prelude/return_implicit.carbon @@ -41,8 +41,6 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: fn @Main() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc15_11.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc15_11.2: type = converted %.loc15_11.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %b.var: ref %empty_tuple.type = var b // CHECK:STDOUT: %b: ref %empty_tuple.type = bind_name b, %b.var // CHECK:STDOUT: %MakeImplicitEmptyTuple.ref: %MakeImplicitEmptyTuple.type = name_ref MakeImplicitEmptyTuple, file.%MakeImplicitEmptyTuple.decl [template = constants.%MakeImplicitEmptyTuple] diff --git a/toolchain/check/testdata/function/call/params_one.carbon b/toolchain/check/testdata/function/call/params_one.carbon index 6fd70f091a0ea..579c5ea9ab942 100644 --- a/toolchain/check/testdata/function/call/params_one.carbon +++ b/toolchain/check/testdata/function/call/params_one.carbon @@ -54,9 +54,11 @@ fn Main() { // CHECK:STDOUT: %a.patt: %i32 = binding_pattern a // CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc11: type = splice_block %i32 [template = constants.%i32] { +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: } // CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} {} diff --git a/toolchain/check/testdata/function/call/params_one_comma.carbon b/toolchain/check/testdata/function/call/params_one_comma.carbon index 688f10f5e0b7e..824200f8ac76a 100644 --- a/toolchain/check/testdata/function/call/params_one_comma.carbon +++ b/toolchain/check/testdata/function/call/params_one_comma.carbon @@ -55,9 +55,11 @@ fn Main() { // CHECK:STDOUT: %a.patt: %i32 = binding_pattern a // CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc11: type = splice_block %i32 [template = constants.%i32] { +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: } // CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} {} diff --git a/toolchain/check/testdata/function/call/params_two.carbon b/toolchain/check/testdata/function/call/params_two.carbon index 5f0c2b2ed1969..be496138e71fe 100644 --- a/toolchain/check/testdata/function/call/params_two.carbon +++ b/toolchain/check/testdata/function/call/params_two.carbon @@ -60,13 +60,17 @@ fn Main() { // CHECK:STDOUT: %b.patt: %i32 = binding_pattern b // CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc11_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc11_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc11_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc11_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc11_11: type = splice_block %i32.loc11_11 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc11_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc11_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %.loc11_19: type = splice_block %i32.loc11_19 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc11_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc11_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: } // CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} {} diff --git a/toolchain/check/testdata/function/call/params_two_comma.carbon b/toolchain/check/testdata/function/call/params_two_comma.carbon index 0f5fa8a494658..d7e1cf0d19550 100644 --- a/toolchain/check/testdata/function/call/params_two_comma.carbon +++ b/toolchain/check/testdata/function/call/params_two_comma.carbon @@ -61,13 +61,17 @@ fn Main() { // CHECK:STDOUT: %b.patt: %i32 = binding_pattern b // CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc11_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc11_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc11_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc11_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc11_11: type = splice_block %i32.loc11_11 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc11_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc11_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %.loc11_19: type = splice_block %i32.loc11_19 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc11_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc11_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: } // CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} {} diff --git a/toolchain/check/testdata/function/declaration/fail_param_in_type.carbon b/toolchain/check/testdata/function/declaration/fail_param_in_type.carbon index 66ef9c451f9e3..bfeff816da501 100644 --- a/toolchain/check/testdata/function/declaration/fail_param_in_type.carbon +++ b/toolchain/check/testdata/function/declaration/fail_param_in_type.carbon @@ -42,15 +42,19 @@ fn F(n: i32, a: [i32; n]*); // CHECK:STDOUT: %a.patt: = binding_pattern a // CHECK:STDOUT: %a.param_patt: = value_param_pattern %a.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc14_9: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc14_9: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc14_18: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc14_18: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %n.ref: %i32 = name_ref n, %n -// CHECK:STDOUT: %ptr: type = ptr_type [template = ] // CHECK:STDOUT: %n.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc14_9: type = splice_block %i32.loc14_9 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc14_9: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc14_9: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %n: %i32 = bind_name n, %n.param // CHECK:STDOUT: %a.param: = value_param runtime_param1 +// CHECK:STDOUT: %.loc14_25: type = splice_block %ptr [template = ] { +// CHECK:STDOUT: %int_32.loc14_18: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc14_18: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %n.ref: %i32 = name_ref n, %n +// CHECK:STDOUT: %ptr: type = ptr_type [template = ] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: = bind_name a, %a.param // CHECK:STDOUT: } // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/function/declaration/fail_param_redecl.carbon b/toolchain/check/testdata/function/declaration/fail_param_redecl.carbon index cf6745263b400..f0a59ce442a24 100644 --- a/toolchain/check/testdata/function/declaration/fail_param_redecl.carbon +++ b/toolchain/check/testdata/function/declaration/fail_param_redecl.carbon @@ -45,13 +45,17 @@ fn F(n: i32, n: i32); // CHECK:STDOUT: %n.patt.loc17_14: %i32 = binding_pattern n // CHECK:STDOUT: %n.param_patt.loc17_15: %i32 = value_param_pattern %n.patt.loc17_14, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc17_9: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc17_9: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc17_17: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc17_17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %n.param.loc17_7: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc17_9: type = splice_block %i32.loc17_9 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc17_9: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc17_9: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %n.loc17_6: %i32 = bind_name n, %n.param.loc17_7 // CHECK:STDOUT: %n.param.loc17_15: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %.loc17_17: type = splice_block %i32.loc17_17 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc17_17: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc17_17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %n.loc17_14: %i32 = bind_name n, %n.param.loc17_15 // CHECK:STDOUT: } // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/function/declaration/import.carbon b/toolchain/check/testdata/function/declaration/import.carbon index 9791eb8c8d7a2..89a96dce322e1 100644 --- a/toolchain/check/testdata/function/declaration/import.carbon +++ b/toolchain/check/testdata/function/declaration/import.carbon @@ -300,11 +300,13 @@ import library "extern_api"; // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc5_9: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc5_9: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc5_17: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc5_17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc5: type = splice_block %i32.loc5_9 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc5_9: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc5_9: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -315,14 +317,16 @@ import library "extern_api"; // CHECK:STDOUT: %return.patt: %struct_type.c = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %struct_type.c = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc6_10: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc6_10: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc6_14.1: %tuple.type.1 = tuple_literal (%i32.loc6_10) -// CHECK:STDOUT: %.loc6_14.2: type = converted %.loc6_14.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %int_32.loc6_25: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc6_25: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %struct_type.c: type = struct_type {.c: %i32} [template = constants.%struct_type.c] // CHECK:STDOUT: %c.param: %tuple.type.2 = value_param runtime_param0 +// CHECK:STDOUT: %.loc6_14.3: type = splice_block %.loc6_14.2 [template = constants.%tuple.type.2] { +// CHECK:STDOUT: %int_32.loc6_10: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc6_10: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc6_14.1: %tuple.type.1 = tuple_literal (%i32.loc6_10) +// CHECK:STDOUT: %.loc6_14.2: type = converted %.loc6_14.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] +// CHECK:STDOUT: } // CHECK:STDOUT: %c: %tuple.type.2 = bind_name c, %c.param // CHECK:STDOUT: %return.param: ref %struct_type.c = out_param runtime_param1 // CHECK:STDOUT: %return: ref %struct_type.c = return_slot %return.param @@ -389,11 +393,13 @@ import library "extern_api"; // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc5_44: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc5_44: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc5_52: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc5_52: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc5: type = splice_block %i32.loc5_44 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc5_44: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc5_44: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -404,14 +410,16 @@ import library "extern_api"; // CHECK:STDOUT: %return.patt: %struct_type.c = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %struct_type.c = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc6_45: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc6_45: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc6_49.1: %tuple.type.1 = tuple_literal (%i32.loc6_45) -// CHECK:STDOUT: %.loc6_49.2: type = converted %.loc6_49.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %int_32.loc6_60: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc6_60: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %struct_type.c: type = struct_type {.c: %i32} [template = constants.%struct_type.c] // CHECK:STDOUT: %c.param: %tuple.type.2 = value_param runtime_param0 +// CHECK:STDOUT: %.loc6_49.3: type = splice_block %.loc6_49.2 [template = constants.%tuple.type.2] { +// CHECK:STDOUT: %int_32.loc6_45: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc6_45: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc6_49.1: %tuple.type.1 = tuple_literal (%i32.loc6_45) +// CHECK:STDOUT: %.loc6_49.2: type = converted %.loc6_49.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] +// CHECK:STDOUT: } // CHECK:STDOUT: %c: %tuple.type.2 = bind_name c, %c.param // CHECK:STDOUT: %return.param: ref %struct_type.c = out_param runtime_param1 // CHECK:STDOUT: %return: ref %struct_type.c = return_slot %return.param @@ -497,25 +505,14 @@ import library "extern_api"; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %.loc6_9.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc6_9.2: type = converted %.loc6_9.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %a.var: ref %empty_tuple.type = var a // CHECK:STDOUT: %a: ref %empty_tuple.type = bind_name a, %a.var -// CHECK:STDOUT: %int_32.loc7: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc7: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %b.var: ref %i32 = var b // CHECK:STDOUT: %b: ref %i32 = bind_name b, %b.var -// CHECK:STDOUT: %int_32.loc8: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc8: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %struct_type.c: type = struct_type {.c: %i32} [template = constants.%struct_type.c] // CHECK:STDOUT: %c.var: ref %struct_type.c = var c // CHECK:STDOUT: %c: ref %struct_type.c = bind_name c, %c.var -// CHECK:STDOUT: %.loc9_9.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc9_9.2: type = converted %.loc9_9.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %d.var: ref %empty_tuple.type = var d // CHECK:STDOUT: %d: ref %empty_tuple.type = bind_name d, %d.var -// CHECK:STDOUT: %.loc10_9.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc10_9.2: type = converted %.loc10_9.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %e.var: ref %empty_tuple.type = var e // CHECK:STDOUT: %e: ref %empty_tuple.type = bind_name e, %e.var // CHECK:STDOUT: } @@ -630,49 +627,42 @@ import library "extern_api"; // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} {} // CHECK:STDOUT: %B.decl: %B.type = fn_decl @B [template = constants.%B] {} { -// CHECK:STDOUT: %int_32.loc23_16: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc23_16: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc23_24: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc23_24: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc23: type = splice_block %i32.loc23_16 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc23_16: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc23_16: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %C.decl: %C.type = fn_decl @C [template = constants.%C] {} { -// CHECK:STDOUT: %int_32.loc32_17: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc32_17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc32_21.1: %tuple.type.1 = tuple_literal (%i32.loc32_17) -// CHECK:STDOUT: %.loc32_21.2: type = converted %.loc32_21.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %int_32.loc32_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc32_32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %struct_type.c: type = struct_type {.c: %i32} [template = constants.%struct_type.c] // CHECK:STDOUT: %c.param: %tuple.type.2 = value_param runtime_param0 +// CHECK:STDOUT: %.loc32_21.3: type = splice_block %.loc32_21.2 [template = constants.%tuple.type.2] { +// CHECK:STDOUT: %int_32.loc32_17: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc32_17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc32_21.1: %tuple.type.1 = tuple_literal (%i32.loc32_17) +// CHECK:STDOUT: %.loc32_21.2: type = converted %.loc32_21.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] +// CHECK:STDOUT: } // CHECK:STDOUT: %c: %tuple.type.2 = bind_name c, %c.param // CHECK:STDOUT: %return.param: ref %struct_type.c = out_param runtime_param1 // CHECK:STDOUT: %return: ref %struct_type.c = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %D.decl: %D.type = fn_decl @D [template = constants.%D] {} {} // CHECK:STDOUT: %E.decl: %E.type = fn_decl @E [template = constants.%E] {} {} -// CHECK:STDOUT: %.loc52_9.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc52_9.2: type = converted %.loc52_9.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %a.var: ref %empty_tuple.type = var a // CHECK:STDOUT: %a: ref %empty_tuple.type = bind_name a, %a.var -// CHECK:STDOUT: %int_32.loc53: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc53: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %b.var: ref %i32 = var b // CHECK:STDOUT: %b: ref %i32 = bind_name b, %b.var -// CHECK:STDOUT: %int_32.loc54: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc54: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %struct_type.c: type = struct_type {.c: %i32} [template = constants.%struct_type.c] // CHECK:STDOUT: %c.var: ref %struct_type.c = var c // CHECK:STDOUT: %c: ref %struct_type.c = bind_name c, %c.var -// CHECK:STDOUT: %.loc55_9.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc55_9.2: type = converted %.loc55_9.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %d.var: ref %empty_tuple.type = var d // CHECK:STDOUT: %d: ref %empty_tuple.type = bind_name d, %d.var -// CHECK:STDOUT: %.loc56_9.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc56_9.2: type = converted %.loc56_9.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %e.var: ref %empty_tuple.type = var e // CHECK:STDOUT: %e: ref %empty_tuple.type = bind_name e, %e.var // CHECK:STDOUT: } @@ -787,49 +777,42 @@ import library "extern_api"; // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} {} // CHECK:STDOUT: %B.decl: %B.type = fn_decl @B [template = constants.%B] {} { -// CHECK:STDOUT: %int_32.loc7_16: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc7_16: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc7_24: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc7_24: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc7: type = splice_block %i32.loc7_16 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc7_16: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc7_16: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %C.decl: %C.type = fn_decl @C [template = constants.%C] {} { -// CHECK:STDOUT: %int_32.loc8_17: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc8_17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc8_21.1: %tuple.type.1 = tuple_literal (%i32.loc8_17) -// CHECK:STDOUT: %.loc8_21.2: type = converted %.loc8_21.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %int_32.loc8_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc8_32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %struct_type.c: type = struct_type {.c: %i32} [template = constants.%struct_type.c] // CHECK:STDOUT: %c.param: %tuple.type.2 = value_param runtime_param0 +// CHECK:STDOUT: %.loc8_21.3: type = splice_block %.loc8_21.2 [template = constants.%tuple.type.2] { +// CHECK:STDOUT: %int_32.loc8_17: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc8_17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc8_21.1: %tuple.type.1 = tuple_literal (%i32.loc8_17) +// CHECK:STDOUT: %.loc8_21.2: type = converted %.loc8_21.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] +// CHECK:STDOUT: } // CHECK:STDOUT: %c: %tuple.type.2 = bind_name c, %c.param // CHECK:STDOUT: %return.param: ref %struct_type.c = out_param runtime_param1 // CHECK:STDOUT: %return: ref %struct_type.c = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %D.decl: %D.type = fn_decl @D [template = constants.%D] {} {} // CHECK:STDOUT: %E.decl: %E.type = fn_decl @E [template = constants.%E] {} {} -// CHECK:STDOUT: %.loc12_9.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc12_9.2: type = converted %.loc12_9.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %a.var: ref %empty_tuple.type = var a // CHECK:STDOUT: %a: ref %empty_tuple.type = bind_name a, %a.var -// CHECK:STDOUT: %int_32.loc13: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc13: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %b.var: ref %i32 = var b // CHECK:STDOUT: %b: ref %i32 = bind_name b, %b.var -// CHECK:STDOUT: %int_32.loc14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %struct_type.c: type = struct_type {.c: %i32} [template = constants.%struct_type.c] // CHECK:STDOUT: %c.var: ref %struct_type.c = var c // CHECK:STDOUT: %c: ref %struct_type.c = bind_name c, %c.var -// CHECK:STDOUT: %.loc15_9.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc15_9.2: type = converted %.loc15_9.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %d.var: ref %empty_tuple.type = var d // CHECK:STDOUT: %d: ref %empty_tuple.type = bind_name d, %d.var -// CHECK:STDOUT: %.loc16_9.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc16_9.2: type = converted %.loc16_9.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %e.var: ref %empty_tuple.type = var e // CHECK:STDOUT: %e: ref %empty_tuple.type = bind_name e, %e.var // CHECK:STDOUT: } @@ -946,25 +929,14 @@ import library "extern_api"; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %.loc52_9.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc52_9.2: type = converted %.loc52_9.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %a.var: ref %empty_tuple.type = var a // CHECK:STDOUT: %a: ref %empty_tuple.type = bind_name a, %a.var -// CHECK:STDOUT: %int_32.loc53: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc53: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %b.var: ref %i32 = var b // CHECK:STDOUT: %b: ref %i32 = bind_name b, %b.var -// CHECK:STDOUT: %int_32.loc54: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc54: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %struct_type.c: type = struct_type {.c: %i32} [template = constants.%struct_type.c] // CHECK:STDOUT: %c.var: ref %struct_type.c = var c // CHECK:STDOUT: %c: ref %struct_type.c = bind_name c, %c.var -// CHECK:STDOUT: %.loc55_9.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc55_9.2: type = converted %.loc55_9.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %d.var: ref %empty_tuple.type = var d // CHECK:STDOUT: %d: ref %empty_tuple.type = bind_name d, %d.var -// CHECK:STDOUT: %.loc56_9.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc56_9.2: type = converted %.loc56_9.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %e.var: ref %empty_tuple.type = var e // CHECK:STDOUT: %e: ref %empty_tuple.type = bind_name e, %e.var // CHECK:STDOUT: } @@ -1081,25 +1053,14 @@ import library "extern_api"; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %.loc51_9.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc51_9.2: type = converted %.loc51_9.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %a.var: ref %empty_tuple.type = var a // CHECK:STDOUT: %a: ref %empty_tuple.type = bind_name a, %a.var -// CHECK:STDOUT: %int_32.loc52: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc52: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %b.var: ref %i32 = var b // CHECK:STDOUT: %b: ref %i32 = bind_name b, %b.var -// CHECK:STDOUT: %int_32.loc53: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc53: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %struct_type.c: type = struct_type {.c: %i32} [template = constants.%struct_type.c] // CHECK:STDOUT: %c.var: ref %struct_type.c = var c // CHECK:STDOUT: %c: ref %struct_type.c = bind_name c, %c.var -// CHECK:STDOUT: %.loc54_9.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc54_9.2: type = converted %.loc54_9.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %d.var: ref %empty_tuple.type = var d // CHECK:STDOUT: %d: ref %empty_tuple.type = bind_name d, %d.var -// CHECK:STDOUT: %.loc55_9.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc55_9.2: type = converted %.loc55_9.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %e.var: ref %empty_tuple.type = var e // CHECK:STDOUT: %e: ref %empty_tuple.type = bind_name e, %e.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/function/declaration/no_prelude/export_name.carbon b/toolchain/check/testdata/function/declaration/no_prelude/export_name.carbon index 80164df05ad5c..a1244d9924e16 100644 --- a/toolchain/check/testdata/function/declaration/no_prelude/export_name.carbon +++ b/toolchain/check/testdata/function/declaration/no_prelude/export_name.carbon @@ -93,8 +93,6 @@ var f: () = F(); // CHECK:STDOUT: .f = %f // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %.loc6_9.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc6_9.2: type = converted %.loc6_9.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %f.var: ref %empty_tuple.type = var f // CHECK:STDOUT: %f: ref %empty_tuple.type = bind_name f, %f.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/function/declaration/no_prelude/extern.carbon b/toolchain/check/testdata/function/declaration/no_prelude/extern.carbon index cfe90921d5f4d..26f127440cd66 100644 --- a/toolchain/check/testdata/function/declaration/no_prelude/extern.carbon +++ b/toolchain/check/testdata/function/declaration/no_prelude/extern.carbon @@ -114,8 +114,6 @@ extern library "basic" fn F(); // CHECK:STDOUT: .x = %x // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %.loc4_9.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc4_9.2: type = converted %.loc4_9.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %x.var: ref %empty_tuple.type = var x // CHECK:STDOUT: %x: ref %empty_tuple.type = bind_name x, %x.var // CHECK:STDOUT: } @@ -189,8 +187,8 @@ extern library "basic" fn F(); // CHECK:STDOUT: %self.patt: %C = binding_pattern self // CHECK:STDOUT: %self.param_patt: %C = value_param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C [template = constants.%C] // CHECK:STDOUT: %self.param: %C = value_param runtime_param0 +// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C [template = constants.%C] // CHECK:STDOUT: %self: %C = bind_name self, %self.param // CHECK:STDOUT: } // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] diff --git a/toolchain/check/testdata/function/declaration/no_prelude/fail_redecl.carbon b/toolchain/check/testdata/function/declaration/no_prelude/fail_redecl.carbon index 3b89094384957..84408490e0750 100644 --- a/toolchain/check/testdata/function/declaration/no_prelude/fail_redecl.carbon +++ b/toolchain/check/testdata/function/declaration/no_prelude/fail_redecl.carbon @@ -89,18 +89,22 @@ fn E() {} // CHECK:STDOUT: %x.patt: %empty_tuple.type = binding_pattern x // CHECK:STDOUT: %x.param_patt: %empty_tuple.type = value_param_pattern %x.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc21_10.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc21_10.2: type = converted %.loc21_10.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %x.param.loc21: %empty_tuple.type = value_param runtime_param0 +// CHECK:STDOUT: %.loc21_10.3: type = splice_block %.loc21_10.2 [template = constants.%empty_tuple.type] { +// CHECK:STDOUT: %.loc21_10.1: %empty_tuple.type = tuple_literal () +// CHECK:STDOUT: %.loc21_10.2: type = converted %.loc21_10.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] +// CHECK:STDOUT: } // CHECK:STDOUT: %x.loc21: %empty_tuple.type = bind_name x, %x.param.loc21 // CHECK:STDOUT: } // CHECK:STDOUT: %B.decl.loc29: %B.type = fn_decl @B [template = constants.%B] { // CHECK:STDOUT: %x.patt: %empty_tuple.type = binding_pattern x // CHECK:STDOUT: %x.param_patt: %empty_tuple.type = value_param_pattern %x.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc29_10.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc29_10.2: type = converted %.loc29_10.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %x.param.loc29: %empty_tuple.type = value_param runtime_param0 +// CHECK:STDOUT: %.loc29_10.3: type = splice_block %.loc29_10.2 [template = constants.%empty_tuple.type] { +// CHECK:STDOUT: %.loc29_10.1: %empty_tuple.type = tuple_literal () +// CHECK:STDOUT: %.loc29_10.2: type = converted %.loc29_10.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] +// CHECK:STDOUT: } // CHECK:STDOUT: %x.loc29: %empty_tuple.type = bind_name x, %x.param.loc29 // CHECK:STDOUT: } // CHECK:STDOUT: %C.decl: %C.type = fn_decl @C [template = constants.%C] {} {} @@ -108,9 +112,11 @@ fn E() {} // CHECK:STDOUT: %x.patt: %empty_tuple.type = binding_pattern x // CHECK:STDOUT: %x.param_patt: %empty_tuple.type = value_param_pattern %x.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc39_10.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc39_10.2: type = converted %.loc39_10.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %x.param: %empty_tuple.type = value_param runtime_param0 +// CHECK:STDOUT: %.loc39_10.3: type = splice_block %.loc39_10.2 [template = constants.%empty_tuple.type] { +// CHECK:STDOUT: %.loc39_10.1: %empty_tuple.type = tuple_literal () +// CHECK:STDOUT: %.loc39_10.2: type = converted %.loc39_10.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] +// CHECK:STDOUT: } // CHECK:STDOUT: %x: %empty_tuple.type = bind_name x, %x.param // CHECK:STDOUT: } // CHECK:STDOUT: %D.decl.loc41: %D.type = fn_decl @D [template = constants.%D] {} {} @@ -135,8 +141,5 @@ fn E() {} // CHECK:STDOUT: fn @E() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return -// CHECK:STDOUT: -// CHECK:STDOUT: !.loc58: -// CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/declaration/no_prelude/fail_todo_no_params.carbon b/toolchain/check/testdata/function/declaration/no_prelude/fail_todo_no_params.carbon index 9629f465b0be7..6dc933b664e09 100644 --- a/toolchain/check/testdata/function/declaration/no_prelude/fail_todo_no_params.carbon +++ b/toolchain/check/testdata/function/declaration/no_prelude/fail_todo_no_params.carbon @@ -112,8 +112,6 @@ fn A { // CHECK:STDOUT: .x = %x // CHECK:STDOUT: .A = %A.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc8_10.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc8_10.2: type = converted %.loc8_10.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %x.var: ref %empty_tuple.type = var x // CHECK:STDOUT: %x: %empty_tuple.type = bind_symbolic_name x, %x.var [symbolic = constants.%x] // CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} {} diff --git a/toolchain/check/testdata/function/declaration/no_prelude/name_poisoning.carbon b/toolchain/check/testdata/function/declaration/no_prelude/name_poisoning.carbon index 2fa916936f275..86b6cd9d32a23 100644 --- a/toolchain/check/testdata/function/declaration/no_prelude/name_poisoning.carbon +++ b/toolchain/check/testdata/function/declaration/no_prelude/name_poisoning.carbon @@ -289,16 +289,16 @@ class N.C {} // CHECK:STDOUT: %x.patt: %C.2 = binding_pattern x // CHECK:STDOUT: %x.param_patt: %C.2 = value_param_pattern %x.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl.loc8 [template = constants.%C.2] // CHECK:STDOUT: %x.param: %C.2 = value_param runtime_param0 +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl.loc8 [template = constants.%C.2] // CHECK:STDOUT: %x: %C.2 = bind_name x, %x.param // CHECK:STDOUT: } // CHECK:STDOUT: %F2.decl: %F2.type = fn_decl @F2 [template = constants.%F2] { // CHECK:STDOUT: %x.patt: %C.2 = binding_pattern x // CHECK:STDOUT: %x.param_patt: %C.2 = value_param_pattern %x.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl.loc8 [template = constants.%C.2] // CHECK:STDOUT: %x.param: %C.2 = value_param runtime_param0 +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl.loc8 [template = constants.%C.2] // CHECK:STDOUT: %x: %C.2 = bind_name x, %x.param // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -353,8 +353,8 @@ class N.C {} // CHECK:STDOUT: %x.patt: %C = binding_pattern x // CHECK:STDOUT: %x.param_patt: %C = value_param_pattern %x.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %x.param: %C = value_param runtime_param0 +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %x: %C = bind_name x, %x.param // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -393,8 +393,8 @@ class N.C {} // CHECK:STDOUT: %x.patt: %C = binding_pattern x // CHECK:STDOUT: %x.param_patt: %C = value_param_pattern %x.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %x.param: %C = value_param runtime_param0 +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %x: %C = bind_name x, %x.param // CHECK:STDOUT: } // CHECK:STDOUT: %.decl: type = class_decl @.1 [template = constants.%.1] {} {} @@ -442,8 +442,8 @@ class N.C {} // CHECK:STDOUT: %x.patt: %I.type = binding_pattern x // CHECK:STDOUT: %x.param_patt: %I.type = value_param_pattern %x.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%I.type] // CHECK:STDOUT: %x.param: %I.type = value_param runtime_param0 +// CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%I.type] // CHECK:STDOUT: %x: %I.type = bind_name x, %x.param // CHECK:STDOUT: } // CHECK:STDOUT: %.decl: type = interface_decl @.1 [template = constants.%.type] {} {} @@ -490,8 +490,8 @@ class N.C {} // CHECK:STDOUT: %x.patt: %C = binding_pattern x // CHECK:STDOUT: %x.param_patt: %C = value_param_pattern %x.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %x.param: %C = value_param runtime_param0 +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %x: %C = bind_name x, %x.param // CHECK:STDOUT: } // CHECK:STDOUT: %.loc17: = namespace [template] {} @@ -544,12 +544,11 @@ class N.C {} // CHECK:STDOUT: %x.patt: %C1 = binding_pattern x // CHECK:STDOUT: %x.param_patt: %C1 = value_param_pattern %x.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C1.ref: type = name_ref C1, file.%C1.decl [template = constants.%C1] // CHECK:STDOUT: %x.param: %C1 = value_param runtime_param0 +// CHECK:STDOUT: %C1.ref: type = name_ref C1, file.%C1.decl [template = constants.%C1] // CHECK:STDOUT: %x: %C1 = bind_name x, %x.param // CHECK:STDOUT: } // CHECK:STDOUT: %C2.decl: type = class_decl @C2 [template = constants.%C2] {} {} -// CHECK:STDOUT: %C2.ref: type = name_ref C2, %C2.decl [template = constants.%C2] // CHECK:STDOUT: %.loc18: %D.elem = field_decl C1, element0 [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.C1 [template = constants.%complete_type.2] // CHECK:STDOUT: @@ -595,8 +594,8 @@ class N.C {} // CHECK:STDOUT: %x.patt: %C = binding_pattern x // CHECK:STDOUT: %x.param_patt: %C = value_param_pattern %x.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %x.param: %C = value_param runtime_param0 +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %x: %C = bind_name x, %x.param // CHECK:STDOUT: } // CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.1] {} {} @@ -695,8 +694,8 @@ class N.C {} // CHECK:STDOUT: %x.patt: %C = binding_pattern x // CHECK:STDOUT: %x.param_patt: %C = value_param_pattern %x.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %x.param: %C = value_param runtime_param0 +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %x: %C = bind_name x, %x.param // CHECK:STDOUT: } // CHECK:STDOUT: %.decl: type = class_decl @.1 [template = constants.%.1] {} {} @@ -704,8 +703,8 @@ class N.C {} // CHECK:STDOUT: %x.patt: %C = binding_pattern x // CHECK:STDOUT: %x.param_patt: %C = value_param_pattern %x.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %x.param: %C = value_param runtime_param0 +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %x: %C = bind_name x, %x.param // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -831,8 +830,8 @@ class N.C {} // CHECK:STDOUT: %x.patt: %C = binding_pattern x // CHECK:STDOUT: %x.param_patt: %C = value_param_pattern %x.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %x.param: %C = value_param runtime_param0 +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %x: %C = bind_name x, %x.param // CHECK:STDOUT: } // CHECK:STDOUT: %.decl: type = class_decl @.1 [template = constants.%.1] {} {} diff --git a/toolchain/check/testdata/function/declaration/param_same_name.carbon b/toolchain/check/testdata/function/declaration/param_same_name.carbon index af2abab9c144a..8221b616b8afd 100644 --- a/toolchain/check/testdata/function/declaration/param_same_name.carbon +++ b/toolchain/check/testdata/function/declaration/param_same_name.carbon @@ -42,18 +42,22 @@ fn G(a: i32); // CHECK:STDOUT: %a.patt: %i32 = binding_pattern a // CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc11: type = splice_block %i32 [template = constants.%i32] { +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %a.patt: %i32 = binding_pattern a // CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc13: type = splice_block %i32 [template = constants.%i32] { +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: } // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/function/definition/import.carbon b/toolchain/check/testdata/function/definition/import.carbon index 5350eb2e06a00..b445c590c7bd1 100644 --- a/toolchain/check/testdata/function/definition/import.carbon +++ b/toolchain/check/testdata/function/definition/import.carbon @@ -152,11 +152,13 @@ fn D() {} // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc5_9: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc5_9: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc5_17: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc5_17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc5: type = splice_block %i32.loc5_9 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc5_9: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc5_9: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -167,14 +169,16 @@ fn D() {} // CHECK:STDOUT: %return.patt: %struct_type.c = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %struct_type.c = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc6_10: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc6_10: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc6_14.1: %tuple.type.1 = tuple_literal (%i32.loc6_10) -// CHECK:STDOUT: %.loc6_14.2: type = converted %.loc6_14.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %int_32.loc6_25: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc6_25: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %struct_type.c: type = struct_type {.c: %i32} [template = constants.%struct_type.c] // CHECK:STDOUT: %c.param: %tuple.type.2 = value_param runtime_param0 +// CHECK:STDOUT: %.loc6_14.3: type = splice_block %.loc6_14.2 [template = constants.%tuple.type.2] { +// CHECK:STDOUT: %int_32.loc6_10: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc6_10: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc6_14.1: %tuple.type.1 = tuple_literal (%i32.loc6_10) +// CHECK:STDOUT: %.loc6_14.2: type = converted %.loc6_14.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] +// CHECK:STDOUT: } // CHECK:STDOUT: %c: %tuple.type.2 = bind_name c, %c.param // CHECK:STDOUT: %return.param: ref %struct_type.c = out_param runtime_param1 // CHECK:STDOUT: %return: ref %struct_type.c = return_slot %return.param @@ -283,17 +287,10 @@ fn D() {} // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %.loc6_9.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc6_9.2: type = converted %.loc6_9.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %a.var: ref %empty_tuple.type = var a // CHECK:STDOUT: %a: ref %empty_tuple.type = bind_name a, %a.var -// CHECK:STDOUT: %int_32.loc7: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc7: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %b.var: ref %i32 = var b // CHECK:STDOUT: %b: ref %i32 = bind_name b, %b.var -// CHECK:STDOUT: %int_32.loc8: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc8: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %struct_type.c: type = struct_type {.c: %i32} [template = constants.%struct_type.c] // CHECK:STDOUT: %c.var: ref %struct_type.c = var c // CHECK:STDOUT: %c: ref %struct_type.c = bind_name c, %c.var // CHECK:STDOUT: } @@ -368,11 +365,13 @@ fn D() {} // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} {} // CHECK:STDOUT: %B.decl: %B.type = fn_decl @B [template = constants.%B] {} { -// CHECK:STDOUT: %int_32.loc23_9: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc23_9: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc23_17: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc23_17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc23: type = splice_block %i32.loc23_9 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc23_9: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc23_9: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param diff --git a/toolchain/check/testdata/function/definition/import_access.carbon b/toolchain/check/testdata/function/definition/import_access.carbon index b6785c12a6f8c..f81adbd190415 100644 --- a/toolchain/check/testdata/function/definition/import_access.carbon +++ b/toolchain/check/testdata/function/definition/import_access.carbon @@ -242,8 +242,6 @@ private fn Redecl() {} // CHECK:STDOUT: %Test.import = import Test // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %.loc4_9.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc4_9.2: type = converted %.loc4_9.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %f.var: ref %empty_tuple.type = var f // CHECK:STDOUT: %f: ref %empty_tuple.type = bind_name f, %f.var // CHECK:STDOUT: } @@ -278,8 +276,6 @@ private fn Redecl() {} // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %.loc10_9.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc10_9.2: type = converted %.loc10_9.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %f.var: ref %empty_tuple.type = var f // CHECK:STDOUT: %f: ref %empty_tuple.type = bind_name f, %f.var // CHECK:STDOUT: } @@ -315,8 +311,6 @@ private fn Redecl() {} // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Test.import = import Test -// CHECK:STDOUT: %.loc10_9.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc10_9.2: type = converted %.loc10_9.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %f.var: ref %empty_tuple.type = var f // CHECK:STDOUT: %f: ref %empty_tuple.type = bind_name f, %f.var // CHECK:STDOUT: } @@ -354,8 +348,6 @@ private fn Redecl() {} // CHECK:STDOUT: %Test.import = import Test // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %.loc4_9.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc4_9.2: type = converted %.loc4_9.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %f.var: ref %empty_tuple.type = var f // CHECK:STDOUT: %f: ref %empty_tuple.type = bind_name f, %f.var // CHECK:STDOUT: } @@ -390,8 +382,6 @@ private fn Redecl() {} // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %.loc10_9.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc10_9.2: type = converted %.loc10_9.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %f.var: ref %empty_tuple.type = var f // CHECK:STDOUT: %f: ref %empty_tuple.type = bind_name f, %f.var // CHECK:STDOUT: } @@ -427,8 +417,6 @@ private fn Redecl() {} // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Test.import = import Test -// CHECK:STDOUT: %.loc10_9.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc10_9.2: type = converted %.loc10_9.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %f.var: ref %empty_tuple.type = var f // CHECK:STDOUT: %f: ref %empty_tuple.type = bind_name f, %f.var // CHECK:STDOUT: } @@ -466,8 +454,6 @@ private fn Redecl() {} // CHECK:STDOUT: %Test.import = import Test // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %.loc4_9.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc4_9.2: type = converted %.loc4_9.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %f.var: ref %empty_tuple.type = var f // CHECK:STDOUT: %f: ref %empty_tuple.type = bind_name f, %f.var // CHECK:STDOUT: %Forward.decl: %Forward.type = fn_decl @Forward [template = constants.%Forward] {} {} @@ -506,8 +492,6 @@ private fn Redecl() {} // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %.loc10_9.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc10_9.2: type = converted %.loc10_9.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %f.var: ref %empty_tuple.type = var f // CHECK:STDOUT: %f: ref %empty_tuple.type = bind_name f, %f.var // CHECK:STDOUT: } @@ -543,8 +527,6 @@ private fn Redecl() {} // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Test.import = import Test -// CHECK:STDOUT: %.loc9_9.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc9_9.2: type = converted %.loc9_9.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %f.var: ref %empty_tuple.type = var f // CHECK:STDOUT: %f: ref %empty_tuple.type = bind_name f, %f.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/function/definition/no_prelude/basics.carbon b/toolchain/check/testdata/function/definition/no_prelude/basics.carbon index 5b07b297b6328..2a337ac0a2a31 100644 --- a/toolchain/check/testdata/function/definition/no_prelude/basics.carbon +++ b/toolchain/check/testdata/function/definition/no_prelude/basics.carbon @@ -39,8 +39,8 @@ fn F(n: C) {} // CHECK:STDOUT: %n.patt: %C = binding_pattern n // CHECK:STDOUT: %n.param_patt: %C = value_param_pattern %n.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %n.param: %C = value_param runtime_param0 +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %n: %C = bind_name n, %n.param // CHECK:STDOUT: } // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/function/definition/no_prelude/fail_decl_param_mismatch.carbon b/toolchain/check/testdata/function/definition/no_prelude/fail_decl_param_mismatch.carbon index 23a1eff6441ee..3369feb4a63b6 100644 --- a/toolchain/check/testdata/function/definition/no_prelude/fail_decl_param_mismatch.carbon +++ b/toolchain/check/testdata/function/definition/no_prelude/fail_decl_param_mismatch.carbon @@ -111,18 +111,22 @@ fn K() -> {} { return {}; } // CHECK:STDOUT: %x.patt: %empty_tuple.type = binding_pattern x // CHECK:STDOUT: %x.param_patt: %empty_tuple.type = value_param_pattern %x.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc19_10.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc19_10.2: type = converted %.loc19_10.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %x.param: %empty_tuple.type = value_param runtime_param0 +// CHECK:STDOUT: %.loc19_10.3: type = splice_block %.loc19_10.2 [template = constants.%empty_tuple.type] { +// CHECK:STDOUT: %.loc19_10.1: %empty_tuple.type = tuple_literal () +// CHECK:STDOUT: %.loc19_10.2: type = converted %.loc19_10.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] +// CHECK:STDOUT: } // CHECK:STDOUT: %x: %empty_tuple.type = bind_name x, %x.param // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %x.patt: %empty_tuple.type = binding_pattern x // CHECK:STDOUT: %x.param_patt: %empty_tuple.type = value_param_pattern %x.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc21_10.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc21_10.2: type = converted %.loc21_10.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %x.param: %empty_tuple.type = value_param runtime_param0 +// CHECK:STDOUT: %.loc21_10.3: type = splice_block %.loc21_10.2 [template = constants.%empty_tuple.type] { +// CHECK:STDOUT: %.loc21_10.1: %empty_tuple.type = tuple_literal () +// CHECK:STDOUT: %.loc21_10.2: type = converted %.loc21_10.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] +// CHECK:STDOUT: } // CHECK:STDOUT: %x: %empty_tuple.type = bind_name x, %x.param // CHECK:STDOUT: } // CHECK:STDOUT: %.decl.loc29: %.type.2 = fn_decl @.2 [template = constants.%.2] {} {} @@ -130,9 +134,11 @@ fn K() -> {} { return {}; } // CHECK:STDOUT: %x.patt: %empty_tuple.type = binding_pattern x // CHECK:STDOUT: %x.param_patt: %empty_tuple.type = value_param_pattern %x.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc31_10.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc31_10.2: type = converted %.loc31_10.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %x.param: %empty_tuple.type = value_param runtime_param0 +// CHECK:STDOUT: %.loc31_10.3: type = splice_block %.loc31_10.2 [template = constants.%empty_tuple.type] { +// CHECK:STDOUT: %.loc31_10.1: %empty_tuple.type = tuple_literal () +// CHECK:STDOUT: %.loc31_10.2: type = converted %.loc31_10.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] +// CHECK:STDOUT: } // CHECK:STDOUT: %x: %empty_tuple.type = bind_name x, %x.param // CHECK:STDOUT: } // CHECK:STDOUT: %.decl.loc36: %.type.3 = fn_decl @.3 [template = constants.%.3] { diff --git a/toolchain/check/testdata/function/definition/no_prelude/fail_redef.carbon b/toolchain/check/testdata/function/definition/no_prelude/fail_redef.carbon index 071cc8689801d..7b515e844e9ef 100644 --- a/toolchain/check/testdata/function/definition/no_prelude/fail_redef.carbon +++ b/toolchain/check/testdata/function/definition/no_prelude/fail_redef.carbon @@ -35,8 +35,5 @@ fn F() {} // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return -// CHECK:STDOUT: -// CHECK:STDOUT: !.loc18: -// CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/definition/no_prelude/syntactic_merge.carbon b/toolchain/check/testdata/function/definition/no_prelude/syntactic_merge.carbon index 03f753995e811..5c1d9fccf9d4b 100644 --- a/toolchain/check/testdata/function/definition/no_prelude/syntactic_merge.carbon +++ b/toolchain/check/testdata/function/definition/no_prelude/syntactic_merge.carbon @@ -194,32 +194,32 @@ fn Foo(a: const (const C)) {} // CHECK:STDOUT: %a.patt: %C = binding_pattern a // CHECK:STDOUT: %a.param_patt: %C = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref.loc7: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a.param.loc7: %C = value_param runtime_param0 +// CHECK:STDOUT: %C.ref.loc7: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a.loc7: %C = bind_name a, %a.param.loc7 // CHECK:STDOUT: } // CHECK:STDOUT: %Foo.decl.loc8: %Foo.type = fn_decl @Foo [template = constants.%Foo] { // CHECK:STDOUT: %a.patt: %C = binding_pattern a // CHECK:STDOUT: %a.param_patt: %C = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref.loc8: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a.param.loc8: %C = value_param runtime_param0 +// CHECK:STDOUT: %C.ref.loc8: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a.loc8: %C = bind_name a, %a.param.loc8 // CHECK:STDOUT: } // CHECK:STDOUT: %Bar.decl.loc10: %Bar.type = fn_decl @Bar [template = constants.%Bar] { // CHECK:STDOUT: %a.patt: %C = binding_pattern a // CHECK:STDOUT: %a.param_patt: %C = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %D.ref.loc10: type = name_ref D, file.%D [template = constants.%C] // CHECK:STDOUT: %a.param.loc10: %C = value_param runtime_param0 +// CHECK:STDOUT: %D.ref.loc10: type = name_ref D, file.%D [template = constants.%C] // CHECK:STDOUT: %a.loc10: %C = bind_name a, %a.param.loc10 // CHECK:STDOUT: } // CHECK:STDOUT: %Bar.decl.loc11: %Bar.type = fn_decl @Bar [template = constants.%Bar] { // CHECK:STDOUT: %a.patt: %C = binding_pattern a // CHECK:STDOUT: %a.param_patt: %C = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %D.ref.loc11: type = name_ref D, file.%D [template = constants.%C] // CHECK:STDOUT: %a.param.loc11: %C = value_param runtime_param0 +// CHECK:STDOUT: %D.ref.loc11: type = name_ref D, file.%D [template = constants.%C] // CHECK:STDOUT: %a.loc11: %C = bind_name a, %a.param.loc11 // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -262,16 +262,16 @@ fn Foo(a: const (const C)) {} // CHECK:STDOUT: %a.patt: %C = binding_pattern a // CHECK:STDOUT: %a.param_patt: %C = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref.loc6: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a.param.loc6: %C = value_param runtime_param0 +// CHECK:STDOUT: %C.ref.loc6: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a.loc6: %C = bind_name a, %a.param.loc6 // CHECK:STDOUT: } // CHECK:STDOUT: %Foo.decl.loc7: %Foo.type = fn_decl @Foo [template = constants.%Foo] { // CHECK:STDOUT: %a.patt: %C = binding_pattern a // CHECK:STDOUT: %a.param_patt: %C = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref.loc7: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a.param.loc7: %C = value_param runtime_param0 +// CHECK:STDOUT: %C.ref.loc7: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a.loc7: %C = bind_name a, %a.param.loc7 // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -311,16 +311,16 @@ fn Foo(a: const (const C)) {} // CHECK:STDOUT: %a.patt: %C = binding_pattern a // CHECK:STDOUT: %a.param_patt: %C = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a.param: %C = value_param runtime_param0 +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a: %C = bind_name a, %a.param // CHECK:STDOUT: } // CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.1] { // CHECK:STDOUT: %a.patt: %C = binding_pattern a // CHECK:STDOUT: %a.param_patt: %C = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a.param: %C = value_param runtime_param0 +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a: %C = bind_name a, %a.param // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -360,16 +360,16 @@ fn Foo(a: const (const C)) {} // CHECK:STDOUT: %a.patt: %C = binding_pattern a // CHECK:STDOUT: %a.param_patt: %C = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref.loc6: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a.param.loc6: %C = value_param runtime_param0 +// CHECK:STDOUT: %C.ref.loc6: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a.loc6: %C = bind_name a, %a.param.loc6 // CHECK:STDOUT: } // CHECK:STDOUT: %Foo.decl.loc7: %Foo.type = fn_decl @Foo [template = constants.%Foo] { // CHECK:STDOUT: %a.patt: %C = binding_pattern a // CHECK:STDOUT: %a.param_patt: %C = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref.loc7: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a.param.loc7: %C = value_param runtime_param0 +// CHECK:STDOUT: %C.ref.loc7: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a.loc7: %C = bind_name a, %a.param.loc7 // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -413,16 +413,16 @@ fn Foo(a: const (const C)) {} // CHECK:STDOUT: %a.patt: %C = binding_pattern a // CHECK:STDOUT: %a.param_patt: %C = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a.param: %C = value_param runtime_param0 +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a: %C = bind_name a, %a.param // CHECK:STDOUT: } // CHECK:STDOUT: %Bar.decl: %Bar.type = fn_decl @Bar [template = constants.%Bar] { // CHECK:STDOUT: %a.patt: %C = binding_pattern a // CHECK:STDOUT: %a.param_patt: %C = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %D.ref: type = name_ref D, file.%D [template = constants.%C] // CHECK:STDOUT: %a.param: %C = value_param runtime_param0 +// CHECK:STDOUT: %D.ref: type = name_ref D, file.%D [template = constants.%C] // CHECK:STDOUT: %a: %C = bind_name a, %a.param // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -471,16 +471,16 @@ fn Foo(a: const (const C)) {} // CHECK:STDOUT: %a.patt: %C = binding_pattern a // CHECK:STDOUT: %a.param_patt: %C = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %a.param: %C = value_param runtime_param0 +// CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %a: %C = bind_name a, %a.param // CHECK:STDOUT: } // CHECK:STDOUT: %Bar.decl: %Bar.type = fn_decl @Bar [template = constants.%Bar] { // CHECK:STDOUT: %a.patt: %C = binding_pattern a // CHECK:STDOUT: %a.param_patt: %C = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %D.ref: type = name_ref D, imports.%import_ref.2 [template = constants.%C] // CHECK:STDOUT: %a.param: %C = value_param runtime_param0 +// CHECK:STDOUT: %D.ref: type = name_ref D, imports.%import_ref.2 [template = constants.%C] // CHECK:STDOUT: %a: %C = bind_name a, %a.param // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -526,16 +526,16 @@ fn Foo(a: const (const C)) {} // CHECK:STDOUT: %a.patt: %C = binding_pattern a // CHECK:STDOUT: %a.param_patt: %C = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a.param: %C = value_param runtime_param0 +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a: %C = bind_name a, %a.param // CHECK:STDOUT: } // CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.1] { // CHECK:STDOUT: %b.patt: %C = binding_pattern b // CHECK:STDOUT: %b.param_patt: %C = value_param_pattern %b.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %D.ref: type = name_ref D, file.%D [template = constants.%C] // CHECK:STDOUT: %b.param: %C = value_param runtime_param0 +// CHECK:STDOUT: %D.ref: type = name_ref D, file.%D [template = constants.%C] // CHECK:STDOUT: %b: %C = bind_name b, %b.param // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -580,16 +580,16 @@ fn Foo(a: const (const C)) {} // CHECK:STDOUT: %a.patt: %C = binding_pattern a // CHECK:STDOUT: %a.param_patt: %C = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a.param: %C = value_param runtime_param0 +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a: %C = bind_name a, %a.param // CHECK:STDOUT: } // CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.1] { // CHECK:STDOUT: %a.patt: %C = binding_pattern a // CHECK:STDOUT: %a.param_patt: %C = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %D.ref: type = name_ref D, file.%D [template = constants.%C] // CHECK:STDOUT: %a.param: %C = value_param runtime_param0 +// CHECK:STDOUT: %D.ref: type = name_ref D, file.%D [template = constants.%C] // CHECK:STDOUT: %a: %C = bind_name a, %a.param // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -636,16 +636,16 @@ fn Foo(a: const (const C)) {} // CHECK:STDOUT: %a.patt.loc7_8.1: %C = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc7_8.2 (constants.%a.patt)] // CHECK:STDOUT: %a.param_patt: %C = value_param_pattern %a.patt.loc7_8.1, runtime_param [symbolic = %a.patt.loc7_8.2 (constants.%a.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a.param: %C = value_param runtime_param +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a.loc7_8.1: %C = bind_symbolic_name a, 0, %a.param [symbolic = %a.loc7_8.2 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.1] { // CHECK:STDOUT: %a.patt.loc15_8.1: %C = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc15_8.2 (constants.%a.patt)] // CHECK:STDOUT: %a.param_patt: %C = value_param_pattern %a.patt.loc15_8.1, runtime_param [symbolic = %a.patt.loc15_8.2 (constants.%a.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %D.ref: type = name_ref D, file.%D [template = constants.%C] // CHECK:STDOUT: %a.param: %C = value_param runtime_param +// CHECK:STDOUT: %D.ref: type = name_ref D, file.%D [template = constants.%C] // CHECK:STDOUT: %a.loc15_8.1: %C = bind_symbolic_name a, 0, %a.param [symbolic = %a.loc15_8.2 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -761,8 +761,8 @@ fn Foo(a: const (const C)) {} // CHECK:STDOUT: %a.patt: %C = binding_pattern a // CHECK:STDOUT: %a.param_patt: %C = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a.param: %C = value_param runtime_param0 +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a: %C = bind_name a, %a.param // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -807,8 +807,8 @@ fn Foo(a: const (const C)) {} // CHECK:STDOUT: %a.patt: %C = binding_pattern a // CHECK:STDOUT: %a.param_patt: %C = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %D.ref: type = name_ref D, file.%D [template = constants.%C] // CHECK:STDOUT: %a.param: %C = value_param runtime_param0 +// CHECK:STDOUT: %D.ref: type = name_ref D, file.%D [template = constants.%C] // CHECK:STDOUT: %a: %C = bind_name a, %a.param // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -847,19 +847,23 @@ fn Foo(a: const (const C)) {} // CHECK:STDOUT: %a.patt: %const = binding_pattern a // CHECK:STDOUT: %a.param_patt: %const = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %const: type = const_type %C [template = constants.%const] // CHECK:STDOUT: %a.param: %const = value_param runtime_param0 +// CHECK:STDOUT: %.loc6: type = splice_block %const [template = constants.%const] { +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %const: type = const_type %C [template = constants.%const] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %const = bind_name a, %a.param // CHECK:STDOUT: } // CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.1] { // CHECK:STDOUT: %a.patt: %const = binding_pattern a // CHECK:STDOUT: %a.param_patt: %const = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %const.loc17_18: type = const_type %C [template = constants.%const] -// CHECK:STDOUT: %const.loc17_11: type = const_type %const [template = constants.%const] // CHECK:STDOUT: %a.param: %const = value_param runtime_param0 +// CHECK:STDOUT: %.loc17: type = splice_block %const.loc17_11 [template = constants.%const] { +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %const.loc17_18: type = const_type %C [template = constants.%const] +// CHECK:STDOUT: %const.loc17_11: type = const_type %const [template = constants.%const] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %const = bind_name a, %a.param // CHECK:STDOUT: } // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/function/definition/params_one.carbon b/toolchain/check/testdata/function/definition/params_one.carbon index f2ad74d26383e..b5c9d2a3bd33e 100644 --- a/toolchain/check/testdata/function/definition/params_one.carbon +++ b/toolchain/check/testdata/function/definition/params_one.carbon @@ -37,9 +37,11 @@ fn Foo(a: i32) {} // CHECK:STDOUT: %a.patt: %i32 = binding_pattern a // CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc11: type = splice_block %i32 [template = constants.%i32] { +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: } // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/function/definition/params_one_comma.carbon b/toolchain/check/testdata/function/definition/params_one_comma.carbon index c1ba454b53ea2..40b8b4fe16674 100644 --- a/toolchain/check/testdata/function/definition/params_one_comma.carbon +++ b/toolchain/check/testdata/function/definition/params_one_comma.carbon @@ -37,9 +37,11 @@ fn Foo(a: i32,) {} // CHECK:STDOUT: %a.patt: %i32 = binding_pattern a // CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc11: type = splice_block %i32 [template = constants.%i32] { +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: } // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/function/definition/params_two.carbon b/toolchain/check/testdata/function/definition/params_two.carbon index 932197a02f20d..887e63449abb2 100644 --- a/toolchain/check/testdata/function/definition/params_two.carbon +++ b/toolchain/check/testdata/function/definition/params_two.carbon @@ -39,13 +39,17 @@ fn Foo(a: i32, b: i32) {} // CHECK:STDOUT: %b.patt: %i32 = binding_pattern b // CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc11_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc11_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc11_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc11_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc11_11: type = splice_block %i32.loc11_11 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc11_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc11_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %.loc11_19: type = splice_block %i32.loc11_19 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc11_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc11_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: } // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/function/definition/params_two_comma.carbon b/toolchain/check/testdata/function/definition/params_two_comma.carbon index 1ccccf8ca6e8f..c89215cd3866e 100644 --- a/toolchain/check/testdata/function/definition/params_two_comma.carbon +++ b/toolchain/check/testdata/function/definition/params_two_comma.carbon @@ -39,13 +39,17 @@ fn Foo(a: i32, b: i32,) {} // CHECK:STDOUT: %b.patt: %i32 = binding_pattern b // CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc11_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc11_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc11_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc11_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc11_11: type = splice_block %i32.loc11_11 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc11_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc11_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %.loc11_19: type = splice_block %i32.loc11_19 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc11_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc11_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: } // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/function/generic/deduce.carbon b/toolchain/check/testdata/function/generic/deduce.carbon index 45a24a1376e62..7ef56292af90e 100644 --- a/toolchain/check/testdata/function/generic/deduce.carbon +++ b/toolchain/check/testdata/function/generic/deduce.carbon @@ -539,12 +539,12 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: %return.patt: @ExplicitAndAlsoDeduced.%ptr.loc6_47.2 (%ptr.1) = return_slot_pattern // CHECK:STDOUT: %return.param_patt: @ExplicitAndAlsoDeduced.%ptr.loc6_47.2 (%ptr.1) = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.ref.loc6_40: type = name_ref T, %T.loc6_27.1 [symbolic = %T.loc6_27.2 (constants.%T)] // CHECK:STDOUT: %T.ref.loc6_46: type = name_ref T, %T.loc6_27.1 [symbolic = %T.loc6_27.2 (constants.%T)] // CHECK:STDOUT: %ptr.loc6_47.1: type = ptr_type %T [symbolic = %ptr.loc6_47.2 (constants.%ptr.1)] // CHECK:STDOUT: %T.param: type = value_param runtime_param // CHECK:STDOUT: %T.loc6_27.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc6_27.2 (constants.%T)] // CHECK:STDOUT: %x.param: @ExplicitAndAlsoDeduced.%T.loc6_27.2 (%T) = value_param runtime_param0 +// CHECK:STDOUT: %T.ref.loc6_40: type = name_ref T, %T.loc6_27.1 [symbolic = %T.loc6_27.2 (constants.%T)] // CHECK:STDOUT: %x: @ExplicitAndAlsoDeduced.%T.loc6_27.2 (%T) = bind_name x, %x.param // CHECK:STDOUT: %return.param: ref @ExplicitAndAlsoDeduced.%ptr.loc6_47.2 (%ptr.1) = out_param runtime_param1 // CHECK:STDOUT: %return: ref @ExplicitAndAlsoDeduced.%ptr.loc6_47.2 (%ptr.1) = return_slot %return.param @@ -677,12 +677,12 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: %return.patt: @ImplicitGenericParam.%ptr.loc4_45.2 (%ptr.1) = return_slot_pattern // CHECK:STDOUT: %return.param_patt: @ImplicitGenericParam.%ptr.loc4_45.2 (%ptr.1) = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.ref.loc4_38: type = name_ref T, %T.loc4_25.1 [symbolic = %T.loc4_25.2 (constants.%T)] // CHECK:STDOUT: %T.ref.loc4_44: type = name_ref T, %T.loc4_25.1 [symbolic = %T.loc4_25.2 (constants.%T)] // CHECK:STDOUT: %ptr.loc4_45.1: type = ptr_type %T [symbolic = %ptr.loc4_45.2 (constants.%ptr.1)] // CHECK:STDOUT: %T.param: type = value_param runtime_param // CHECK:STDOUT: %T.loc4_25.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc4_25.2 (constants.%T)] // CHECK:STDOUT: %x.param: @ImplicitGenericParam.%T.loc4_25.2 (%T) = value_param runtime_param0 +// CHECK:STDOUT: %T.ref.loc4_38: type = name_ref T, %T.loc4_25.1 [symbolic = %T.loc4_25.2 (constants.%T)] // CHECK:STDOUT: %x: @ImplicitGenericParam.%T.loc4_25.2 (%T) = bind_name x, %x.param // CHECK:STDOUT: %return.param: ref @ImplicitGenericParam.%ptr.loc4_45.2 (%ptr.1) = out_param runtime_param1 // CHECK:STDOUT: %return: ref @ImplicitGenericParam.%ptr.loc4_45.2 (%ptr.1) = return_slot %return.param @@ -693,12 +693,14 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: %return.patt: %ptr.2 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %ptr.2 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc6_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc6_32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc6_40: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc6_40: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %ptr: type = ptr_type %i32 [template = constants.%ptr.2] // CHECK:STDOUT: %n.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc6: type = splice_block %i32.loc6_32 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc6_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc6_32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %n: %i32 = bind_name n, %n.param // CHECK:STDOUT: %return.param: ref %ptr.2 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %ptr.2 = return_slot %return.param @@ -815,14 +817,16 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: %x.patt: @TupleParam.%tuple.type (%tuple.type.2) = binding_pattern x // CHECK:STDOUT: %x.param_patt: @TupleParam.%tuple.type (%tuple.type.2) = value_param_pattern %x.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc4_15.1 [symbolic = %T.loc4_15.2 (constants.%T)] -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc4_35.1: %tuple.type.1 = tuple_literal (%T.ref, %i32) -// CHECK:STDOUT: %.loc4_35.2: type = converted %.loc4_35.1, constants.%tuple.type.2 [symbolic = %tuple.type (constants.%tuple.type.2)] // CHECK:STDOUT: %T.param: type = value_param runtime_param // CHECK:STDOUT: %T.loc4_15.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc4_15.2 (constants.%T)] // CHECK:STDOUT: %x.param: @TupleParam.%tuple.type (%tuple.type.2) = value_param runtime_param0 +// CHECK:STDOUT: %.loc4_35.3: type = splice_block %.loc4_35.2 [symbolic = %tuple.type (constants.%tuple.type.2)] { +// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc4_15.1 [symbolic = %T.loc4_15.2 (constants.%T)] +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc4_35.1: %tuple.type.1 = tuple_literal (%T.ref, %i32) +// CHECK:STDOUT: %.loc4_35.2: type = converted %.loc4_35.1, constants.%tuple.type.2 [symbolic = %tuple.type (constants.%tuple.type.2)] +// CHECK:STDOUT: } // CHECK:STDOUT: %x: @TupleParam.%tuple.type (%tuple.type.2) = bind_name x, %x.param // CHECK:STDOUT: } // CHECK:STDOUT: %CallTupleParam.decl: %CallTupleParam.type = fn_decl @CallTupleParam [template = constants.%CallTupleParam] {} {} @@ -928,13 +932,15 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: %x.patt: @StructParam.%struct_type.a.b.loc4_44.2 (%struct_type.a.b.1) = binding_pattern x // CHECK:STDOUT: %x.param_patt: @StructParam.%struct_type.a.b.loc4_44.2 (%struct_type.a.b.1) = value_param_pattern %x.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc4_16.1 [symbolic = %T.loc4_16.2 (constants.%T)] -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %struct_type.a.b.loc4_44.1: type = struct_type {.a: %T, .b: %i32} [symbolic = %struct_type.a.b.loc4_44.2 (constants.%struct_type.a.b.1)] // CHECK:STDOUT: %T.param: type = value_param runtime_param // CHECK:STDOUT: %T.loc4_16.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc4_16.2 (constants.%T)] // CHECK:STDOUT: %x.param: @StructParam.%struct_type.a.b.loc4_44.2 (%struct_type.a.b.1) = value_param runtime_param0 +// CHECK:STDOUT: %.loc4: type = splice_block %struct_type.a.b.loc4_44.1 [symbolic = %struct_type.a.b.loc4_44.2 (constants.%struct_type.a.b.1)] { +// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc4_16.1 [symbolic = %T.loc4_16.2 (constants.%T)] +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %struct_type.a.b.loc4_44.1: type = struct_type {.a: %T, .b: %i32} [symbolic = %struct_type.a.b.loc4_44.2 (constants.%struct_type.a.b.1)] +// CHECK:STDOUT: } // CHECK:STDOUT: %x: @StructParam.%struct_type.a.b.loc4_44.2 (%struct_type.a.b.1) = bind_name x, %x.param // CHECK:STDOUT: } // CHECK:STDOUT: %CallStructParam.decl: %CallStructParam.type = fn_decl @CallStructParam [template = constants.%CallStructParam] {} {} @@ -1027,15 +1033,17 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: %x.patt: @BigStructParam.%struct_type.c.d.e.loc4_56.2 (%struct_type.c.d.e) = binding_pattern x // CHECK:STDOUT: %x.param_patt: @BigStructParam.%struct_type.c.d.e.loc4_56.2 (%struct_type.c.d.e) = value_param_pattern %x.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc4_19.1 [symbolic = %T.loc4_19.2 (constants.%T)] -// CHECK:STDOUT: %int_32.loc4_44: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc4_44: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc4_53: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc4_53: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %struct_type.c.d.e.loc4_56.1: type = struct_type {.c: %T, .d: %i32, .e: %i32} [symbolic = %struct_type.c.d.e.loc4_56.2 (constants.%struct_type.c.d.e)] // CHECK:STDOUT: %T.param: type = value_param runtime_param // CHECK:STDOUT: %T.loc4_19.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc4_19.2 (constants.%T)] // CHECK:STDOUT: %x.param: @BigStructParam.%struct_type.c.d.e.loc4_56.2 (%struct_type.c.d.e) = value_param runtime_param0 +// CHECK:STDOUT: %.loc4: type = splice_block %struct_type.c.d.e.loc4_56.1 [symbolic = %struct_type.c.d.e.loc4_56.2 (constants.%struct_type.c.d.e)] { +// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc4_19.1 [symbolic = %T.loc4_19.2 (constants.%T)] +// CHECK:STDOUT: %int_32.loc4_44: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc4_44: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %int_32.loc4_53: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc4_53: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %struct_type.c.d.e.loc4_56.1: type = struct_type {.c: %T, .d: %i32, .e: %i32} [symbolic = %struct_type.c.d.e.loc4_56.2 (constants.%struct_type.c.d.e)] +// CHECK:STDOUT: } // CHECK:STDOUT: %x: @BigStructParam.%struct_type.c.d.e.loc4_56.2 (%struct_type.c.d.e) = bind_name x, %x.param // CHECK:STDOUT: } // CHECK:STDOUT: %CallBigStructParam.decl: %CallBigStructParam.type = fn_decl @CallBigStructParam [template = constants.%CallBigStructParam] {} {} @@ -1110,13 +1118,15 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: %x.patt: @SmallStructParam.%struct_type.f.g.loc4_49.2 (%struct_type.f.g) = binding_pattern x // CHECK:STDOUT: %x.param_patt: @SmallStructParam.%struct_type.f.g.loc4_49.2 (%struct_type.f.g) = value_param_pattern %x.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc4_21.1 [symbolic = %T.loc4_21.2 (constants.%T)] -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %struct_type.f.g.loc4_49.1: type = struct_type {.f: %T, .g: %i32} [symbolic = %struct_type.f.g.loc4_49.2 (constants.%struct_type.f.g)] // CHECK:STDOUT: %T.param: type = value_param runtime_param // CHECK:STDOUT: %T.loc4_21.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc4_21.2 (constants.%T)] // CHECK:STDOUT: %x.param: @SmallStructParam.%struct_type.f.g.loc4_49.2 (%struct_type.f.g) = value_param runtime_param0 +// CHECK:STDOUT: %.loc4: type = splice_block %struct_type.f.g.loc4_49.1 [symbolic = %struct_type.f.g.loc4_49.2 (constants.%struct_type.f.g)] { +// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc4_21.1 [symbolic = %T.loc4_21.2 (constants.%T)] +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %struct_type.f.g.loc4_49.1: type = struct_type {.f: %T, .g: %i32} [symbolic = %struct_type.f.g.loc4_49.2 (constants.%struct_type.f.g)] +// CHECK:STDOUT: } // CHECK:STDOUT: %x: @SmallStructParam.%struct_type.f.g.loc4_49.2 (%struct_type.f.g) = bind_name x, %x.param // CHECK:STDOUT: } // CHECK:STDOUT: %CallSmallStructParam.decl: %CallSmallStructParam.type = fn_decl @CallSmallStructParam [template = constants.%CallSmallStructParam] {} {} @@ -1191,13 +1201,15 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: %x.patt: @WrongNameStructParam.%struct_type.i.different.loc4_61.2 (%struct_type.i.different) = binding_pattern x // CHECK:STDOUT: %x.param_patt: @WrongNameStructParam.%struct_type.i.different.loc4_61.2 (%struct_type.i.different) = value_param_pattern %x.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc4_25.1 [symbolic = %T.loc4_25.2 (constants.%T)] -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %struct_type.i.different.loc4_61.1: type = struct_type {.i: %T, .different: %i32} [symbolic = %struct_type.i.different.loc4_61.2 (constants.%struct_type.i.different)] // CHECK:STDOUT: %T.param: type = value_param runtime_param // CHECK:STDOUT: %T.loc4_25.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc4_25.2 (constants.%T)] // CHECK:STDOUT: %x.param: @WrongNameStructParam.%struct_type.i.different.loc4_61.2 (%struct_type.i.different) = value_param runtime_param0 +// CHECK:STDOUT: %.loc4: type = splice_block %struct_type.i.different.loc4_61.1 [symbolic = %struct_type.i.different.loc4_61.2 (constants.%struct_type.i.different)] { +// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc4_25.1 [symbolic = %T.loc4_25.2 (constants.%T)] +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %struct_type.i.different.loc4_61.1: type = struct_type {.i: %T, .different: %i32} [symbolic = %struct_type.i.different.loc4_61.2 (constants.%struct_type.i.different)] +// CHECK:STDOUT: } // CHECK:STDOUT: %x: @WrongNameStructParam.%struct_type.i.different.loc4_61.2 (%struct_type.i.different) = bind_name x, %x.param // CHECK:STDOUT: } // CHECK:STDOUT: %CallWrongNameStructParam.decl: %CallWrongNameStructParam.type = fn_decl @CallWrongNameStructParam [template = constants.%CallWrongNameStructParam] {} {} @@ -1271,13 +1283,15 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: %x.patt: @WrongOrderStructParam.%struct_type.first.second.loc4_63.2 (%struct_type.first.second) = binding_pattern x // CHECK:STDOUT: %x.param_patt: @WrongOrderStructParam.%struct_type.first.second.loc4_63.2 (%struct_type.first.second) = value_param_pattern %x.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc4_26.1 [symbolic = %T.loc4_26.2 (constants.%T)] -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %struct_type.first.second.loc4_63.1: type = struct_type {.first: %T, .second: %i32} [symbolic = %struct_type.first.second.loc4_63.2 (constants.%struct_type.first.second)] // CHECK:STDOUT: %T.param: type = value_param runtime_param // CHECK:STDOUT: %T.loc4_26.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc4_26.2 (constants.%T)] // CHECK:STDOUT: %x.param: @WrongOrderStructParam.%struct_type.first.second.loc4_63.2 (%struct_type.first.second) = value_param runtime_param0 +// CHECK:STDOUT: %.loc4: type = splice_block %struct_type.first.second.loc4_63.1 [symbolic = %struct_type.first.second.loc4_63.2 (constants.%struct_type.first.second)] { +// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc4_26.1 [symbolic = %T.loc4_26.2 (constants.%T)] +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %struct_type.first.second.loc4_63.1: type = struct_type {.first: %T, .second: %i32} [symbolic = %struct_type.first.second.loc4_63.2 (constants.%struct_type.first.second)] +// CHECK:STDOUT: } // CHECK:STDOUT: %x: @WrongOrderStructParam.%struct_type.first.second.loc4_63.2 (%struct_type.first.second) = bind_name x, %x.param // CHECK:STDOUT: } // CHECK:STDOUT: %CallWrongOrderStructParam.decl: %CallWrongOrderStructParam.type = fn_decl @CallWrongOrderStructParam [template = constants.%CallWrongOrderStructParam] {} {} @@ -1350,13 +1364,13 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: %return.patt: @ImplicitNotDeducible.%U.loc6_35.2 (%U) = return_slot_pattern // CHECK:STDOUT: %return.param_patt: @ImplicitNotDeducible.%U.loc6_35.2 (%U) = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc6_25.1 [symbolic = %T.loc6_25.2 (constants.%T)] // CHECK:STDOUT: %U.ref: type = name_ref U, %U.loc6_35.1 [symbolic = %U.loc6_35.2 (constants.%U)] // CHECK:STDOUT: %T.param: type = value_param runtime_param // CHECK:STDOUT: %T.loc6_25.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc6_25.2 (constants.%T)] // CHECK:STDOUT: %U.param: type = value_param runtime_param // CHECK:STDOUT: %U.loc6_35.1: type = bind_symbolic_name U, 1, %U.param [symbolic = %U.loc6_35.2 (constants.%U)] // CHECK:STDOUT: %x.param: @ImplicitNotDeducible.%T.loc6_25.2 (%T) = value_param runtime_param0 +// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc6_25.1 [symbolic = %T.loc6_25.2 (constants.%T)] // CHECK:STDOUT: %x: @ImplicitNotDeducible.%T.loc6_25.2 (%T) = bind_name x, %x.param // CHECK:STDOUT: %return.param: ref @ImplicitNotDeducible.%U.loc6_35.2 (%U) = out_param runtime_param1 // CHECK:STDOUT: %return: ref @ImplicitNotDeducible.%U.loc6_35.2 (%U) = return_slot %return.param @@ -1425,14 +1439,14 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: %return.patt: @ImplicitNotDeducible.%T.loc4_25.2 (%T) = return_slot_pattern // CHECK:STDOUT: %return.param_patt: @ImplicitNotDeducible.%T.loc4_25.2 (%T) = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.ref.loc4_38: type = name_ref T, %T.loc4_25.1 [symbolic = %T.loc4_25.2 (constants.%T)] -// CHECK:STDOUT: %T.ref.loc4_44: type = name_ref T, %T.loc4_25.1 [symbolic = %T.loc4_25.2 (constants.%T)] // CHECK:STDOUT: %T.ref.loc4_50: type = name_ref T, %T.loc4_25.1 [symbolic = %T.loc4_25.2 (constants.%T)] // CHECK:STDOUT: %T.param: type = value_param runtime_param // CHECK:STDOUT: %T.loc4_25.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc4_25.2 (constants.%T)] // CHECK:STDOUT: %x.param: @ImplicitNotDeducible.%T.loc4_25.2 (%T) = value_param runtime_param0 +// CHECK:STDOUT: %T.ref.loc4_38: type = name_ref T, %T.loc4_25.1 [symbolic = %T.loc4_25.2 (constants.%T)] // CHECK:STDOUT: %x: @ImplicitNotDeducible.%T.loc4_25.2 (%T) = bind_name x, %x.param // CHECK:STDOUT: %y.param: @ImplicitNotDeducible.%T.loc4_25.2 (%T) = value_param runtime_param1 +// CHECK:STDOUT: %T.ref.loc4_44: type = name_ref T, %T.loc4_25.1 [symbolic = %T.loc4_25.2 (constants.%T)] // CHECK:STDOUT: %y: @ImplicitNotDeducible.%T.loc4_25.2 (%T) = bind_name y, %y.param // CHECK:STDOUT: %return.param: ref @ImplicitNotDeducible.%T.loc4_25.2 (%T) = out_param runtime_param2 // CHECK:STDOUT: %return: ref @ImplicitNotDeducible.%T.loc4_25.2 (%T) = return_slot %return.param diff --git a/toolchain/check/testdata/function/generic/fail_todo_param_in_type.carbon b/toolchain/check/testdata/function/generic/fail_todo_param_in_type.carbon index a3440d58d5038..360c8ee860ebf 100644 --- a/toolchain/check/testdata/function/generic/fail_todo_param_in_type.carbon +++ b/toolchain/check/testdata/function/generic/fail_todo_param_in_type.carbon @@ -52,22 +52,26 @@ fn F(N:! i32, a: [i32; N]*); // CHECK:STDOUT: %a.patt: = binding_pattern a // CHECK:STDOUT: %a.param_patt: = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc14_10: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc14_10: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc14_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc14_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %N.ref: %i32 = name_ref N, %N.loc14_6.1 [symbolic = %N.loc14_6.2 (constants.%N.2)] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.9] -// CHECK:STDOUT: %Convert.bound.loc14_24.1: = bound_method %N.ref, %impl.elem0 [symbolic = %Convert.bound.loc14_24.2 (constants.%Convert.bound)] -// CHECK:STDOUT: %Convert.specific_fn.loc14_24.1: = specific_function %Convert.bound.loc14_24.1, @Convert.3(constants.%int_32) [symbolic = %Convert.specific_fn.loc14_24.2 (constants.%Convert.specific_fn)] -// CHECK:STDOUT: %int.convert_checked.loc14_24.1: init Core.IntLiteral = call %Convert.specific_fn.loc14_24.1(%N.ref) [symbolic = %int.convert_checked.loc14_24.2 (constants.%int.convert_checked)] -// CHECK:STDOUT: %.loc14_24.1: Core.IntLiteral = value_of_initializer %int.convert_checked.loc14_24.1 [symbolic = %int.convert_checked.loc14_24.2 (constants.%int.convert_checked)] -// CHECK:STDOUT: %.loc14_24.2: Core.IntLiteral = converted %N.ref, %.loc14_24.1 [symbolic = %int.convert_checked.loc14_24.2 (constants.%int.convert_checked)] -// CHECK:STDOUT: %array_type: type = array_type %.loc14_24.2, %i32 [template = ] -// CHECK:STDOUT: %ptr: type = ptr_type [template = ] // CHECK:STDOUT: %N.param: %i32 = value_param runtime_param +// CHECK:STDOUT: %.loc14_10: type = splice_block %i32.loc14_10 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc14_10: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc14_10: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %N.loc14_6.1: %i32 = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc14_6.2 (constants.%N.2)] // CHECK:STDOUT: %a.param: = value_param runtime_param0 +// CHECK:STDOUT: %.loc14_26: type = splice_block %ptr [template = ] { +// CHECK:STDOUT: %int_32.loc14_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc14_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %N.ref: %i32 = name_ref N, %N.loc14_6.1 [symbolic = %N.loc14_6.2 (constants.%N.2)] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.9] +// CHECK:STDOUT: %Convert.bound.loc14_24.1: = bound_method %N.ref, %impl.elem0 [symbolic = %Convert.bound.loc14_24.2 (constants.%Convert.bound)] +// CHECK:STDOUT: %Convert.specific_fn.loc14_24.1: = specific_function %Convert.bound.loc14_24.1, @Convert.3(constants.%int_32) [symbolic = %Convert.specific_fn.loc14_24.2 (constants.%Convert.specific_fn)] +// CHECK:STDOUT: %int.convert_checked.loc14_24.1: init Core.IntLiteral = call %Convert.specific_fn.loc14_24.1(%N.ref) [symbolic = %int.convert_checked.loc14_24.2 (constants.%int.convert_checked)] +// CHECK:STDOUT: %.loc14_24.1: Core.IntLiteral = value_of_initializer %int.convert_checked.loc14_24.1 [symbolic = %int.convert_checked.loc14_24.2 (constants.%int.convert_checked)] +// CHECK:STDOUT: %.loc14_24.2: Core.IntLiteral = converted %N.ref, %.loc14_24.1 [symbolic = %int.convert_checked.loc14_24.2 (constants.%int.convert_checked)] +// CHECK:STDOUT: %array_type: type = array_type %.loc14_24.2, %i32 [template = ] +// CHECK:STDOUT: %ptr: type = ptr_type [template = ] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: = bind_name a, %a.param // CHECK:STDOUT: } // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/function/generic/no_prelude/call.carbon b/toolchain/check/testdata/function/generic/no_prelude/call.carbon index a3ba689dbe612..7d204813ad63e 100644 --- a/toolchain/check/testdata/function/generic/no_prelude/call.carbon +++ b/toolchain/check/testdata/function/generic/no_prelude/call.carbon @@ -92,11 +92,11 @@ fn CallSpecific(x: C) -> C { // CHECK:STDOUT: %return.patt: @Function.%T.loc4_13.2 (%T) = return_slot_pattern // CHECK:STDOUT: %return.param_patt: @Function.%T.loc4_13.2 (%T) = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.ref.loc4_26: type = name_ref T, %T.loc4_13.1 [symbolic = %T.loc4_13.2 (constants.%T)] // CHECK:STDOUT: %T.ref.loc4_32: type = name_ref T, %T.loc4_13.1 [symbolic = %T.loc4_13.2 (constants.%T)] // CHECK:STDOUT: %T.param: type = value_param runtime_param // CHECK:STDOUT: %T.loc4_13.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc4_13.2 (constants.%T)] // CHECK:STDOUT: %x.param: @Function.%T.loc4_13.2 (%T) = value_param runtime_param0 +// CHECK:STDOUT: %T.ref.loc4_26: type = name_ref T, %T.loc4_13.1 [symbolic = %T.loc4_13.2 (constants.%T)] // CHECK:STDOUT: %x: @Function.%T.loc4_13.2 (%T) = bind_name x, %x.param // CHECK:STDOUT: %return.param: ref @Function.%T.loc4_13.2 (%T) = out_param runtime_param1 // CHECK:STDOUT: %return: ref @Function.%T.loc4_13.2 (%T) = return_slot %return.param @@ -109,11 +109,11 @@ fn CallSpecific(x: C) -> C { // CHECK:STDOUT: %return.patt: @CallGeneric.%T.loc8_16.2 (%T) = return_slot_pattern // CHECK:STDOUT: %return.param_patt: @CallGeneric.%T.loc8_16.2 (%T) = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.ref.loc8_29: type = name_ref T, %T.loc8_16.1 [symbolic = %T.loc8_16.2 (constants.%T)] // CHECK:STDOUT: %T.ref.loc8_35: type = name_ref T, %T.loc8_16.1 [symbolic = %T.loc8_16.2 (constants.%T)] // CHECK:STDOUT: %T.param: type = value_param runtime_param // CHECK:STDOUT: %T.loc8_16.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc8_16.2 (constants.%T)] // CHECK:STDOUT: %x.param: @CallGeneric.%T.loc8_16.2 (%T) = value_param runtime_param0 +// CHECK:STDOUT: %T.ref.loc8_29: type = name_ref T, %T.loc8_16.1 [symbolic = %T.loc8_16.2 (constants.%T)] // CHECK:STDOUT: %x: @CallGeneric.%T.loc8_16.2 (%T) = bind_name x, %x.param // CHECK:STDOUT: %return.param: ref @CallGeneric.%T.loc8_16.2 (%T) = out_param runtime_param1 // CHECK:STDOUT: %return: ref @CallGeneric.%T.loc8_16.2 (%T) = return_slot %return.param @@ -126,13 +126,15 @@ fn CallSpecific(x: C) -> C { // CHECK:STDOUT: %return.patt: @CallGenericPtr.%ptr.loc12_33.2 (%ptr.1) = return_slot_pattern // CHECK:STDOUT: %return.param_patt: @CallGenericPtr.%ptr.loc12_33.2 (%ptr.1) = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.ref.loc12_32: type = name_ref T, %T.loc12_19.1 [symbolic = %T.loc12_19.2 (constants.%T)] -// CHECK:STDOUT: %ptr.loc12_33.1: type = ptr_type %T [symbolic = %ptr.loc12_33.2 (constants.%ptr.1)] // CHECK:STDOUT: %T.ref.loc12_39: type = name_ref T, %T.loc12_19.1 [symbolic = %T.loc12_19.2 (constants.%T)] // CHECK:STDOUT: %ptr.loc12_40: type = ptr_type %T [symbolic = %ptr.loc12_33.2 (constants.%ptr.1)] // CHECK:STDOUT: %T.param: type = value_param runtime_param // CHECK:STDOUT: %T.loc12_19.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc12_19.2 (constants.%T)] // CHECK:STDOUT: %x.param: @CallGenericPtr.%ptr.loc12_33.2 (%ptr.1) = value_param runtime_param0 +// CHECK:STDOUT: %.loc12: type = splice_block %ptr.loc12_33.1 [symbolic = %ptr.loc12_33.2 (constants.%ptr.1)] { +// CHECK:STDOUT: %T.ref.loc12_32: type = name_ref T, %T.loc12_19.1 [symbolic = %T.loc12_19.2 (constants.%T)] +// CHECK:STDOUT: %ptr.loc12_33.1: type = ptr_type %T [symbolic = %ptr.loc12_33.2 (constants.%ptr.1)] +// CHECK:STDOUT: } // CHECK:STDOUT: %x: @CallGenericPtr.%ptr.loc12_33.2 (%ptr.1) = bind_name x, %x.param // CHECK:STDOUT: %return.param: ref @CallGenericPtr.%ptr.loc12_33.2 (%ptr.1) = out_param runtime_param1 // CHECK:STDOUT: %return: ref @CallGenericPtr.%ptr.loc12_33.2 (%ptr.1) = return_slot %return.param @@ -144,9 +146,9 @@ fn CallSpecific(x: C) -> C { // CHECK:STDOUT: %return.patt: %C = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %C = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref.loc18_20: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %C.ref.loc18_26: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %x.param: %C = value_param runtime_param0 +// CHECK:STDOUT: %C.ref.loc18_20: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %x: %C = bind_name x, %x.param // CHECK:STDOUT: %return.param: ref %C = out_param runtime_param1 // CHECK:STDOUT: %return: ref %C = return_slot %return.param @@ -309,11 +311,11 @@ fn CallSpecific(x: C) -> C { // CHECK:STDOUT: %return.patt: @Function.%T.loc4_13.2 (%T) = return_slot_pattern // CHECK:STDOUT: %return.param_patt: @Function.%T.loc4_13.2 (%T) = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.ref.loc4_26: type = name_ref T, %T.loc4_13.1 [symbolic = %T.loc4_13.2 (constants.%T)] // CHECK:STDOUT: %T.ref.loc4_32: type = name_ref T, %T.loc4_13.1 [symbolic = %T.loc4_13.2 (constants.%T)] // CHECK:STDOUT: %T.param: type = value_param runtime_param // CHECK:STDOUT: %T.loc4_13.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc4_13.2 (constants.%T)] // CHECK:STDOUT: %x.param: @Function.%T.loc4_13.2 (%T) = value_param runtime_param0 +// CHECK:STDOUT: %T.ref.loc4_26: type = name_ref T, %T.loc4_13.1 [symbolic = %T.loc4_13.2 (constants.%T)] // CHECK:STDOUT: %x: @Function.%T.loc4_13.2 (%T) = bind_name x, %x.param // CHECK:STDOUT: %return.param: ref @Function.%T.loc4_13.2 (%T) = out_param runtime_param1 // CHECK:STDOUT: %return: ref @Function.%T.loc4_13.2 (%T) = return_slot %return.param @@ -326,11 +328,11 @@ fn CallSpecific(x: C) -> C { // CHECK:STDOUT: %return.patt: @CallGeneric.%T.loc8_16.2 (%T) = return_slot_pattern // CHECK:STDOUT: %return.param_patt: @CallGeneric.%T.loc8_16.2 (%T) = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.ref.loc8_29: type = name_ref T, %T.loc8_16.1 [symbolic = %T.loc8_16.2 (constants.%T)] // CHECK:STDOUT: %T.ref.loc8_35: type = name_ref T, %T.loc8_16.1 [symbolic = %T.loc8_16.2 (constants.%T)] // CHECK:STDOUT: %T.param: type = value_param runtime_param // CHECK:STDOUT: %T.loc8_16.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc8_16.2 (constants.%T)] // CHECK:STDOUT: %x.param: @CallGeneric.%T.loc8_16.2 (%T) = value_param runtime_param0 +// CHECK:STDOUT: %T.ref.loc8_29: type = name_ref T, %T.loc8_16.1 [symbolic = %T.loc8_16.2 (constants.%T)] // CHECK:STDOUT: %x: @CallGeneric.%T.loc8_16.2 (%T) = bind_name x, %x.param // CHECK:STDOUT: %return.param: ref @CallGeneric.%T.loc8_16.2 (%T) = out_param runtime_param1 // CHECK:STDOUT: %return: ref @CallGeneric.%T.loc8_16.2 (%T) = return_slot %return.param @@ -343,13 +345,15 @@ fn CallSpecific(x: C) -> C { // CHECK:STDOUT: %return.patt: @CallGenericPtr.%ptr.loc12_33.2 (%ptr.1) = return_slot_pattern // CHECK:STDOUT: %return.param_patt: @CallGenericPtr.%ptr.loc12_33.2 (%ptr.1) = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.ref.loc12_32: type = name_ref T, %T.loc12_19.1 [symbolic = %T.loc12_19.2 (constants.%T)] -// CHECK:STDOUT: %ptr.loc12_33.1: type = ptr_type %T [symbolic = %ptr.loc12_33.2 (constants.%ptr.1)] // CHECK:STDOUT: %T.ref.loc12_39: type = name_ref T, %T.loc12_19.1 [symbolic = %T.loc12_19.2 (constants.%T)] // CHECK:STDOUT: %ptr.loc12_40: type = ptr_type %T [symbolic = %ptr.loc12_33.2 (constants.%ptr.1)] // CHECK:STDOUT: %T.param: type = value_param runtime_param // CHECK:STDOUT: %T.loc12_19.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc12_19.2 (constants.%T)] // CHECK:STDOUT: %x.param: @CallGenericPtr.%ptr.loc12_33.2 (%ptr.1) = value_param runtime_param0 +// CHECK:STDOUT: %.loc12: type = splice_block %ptr.loc12_33.1 [symbolic = %ptr.loc12_33.2 (constants.%ptr.1)] { +// CHECK:STDOUT: %T.ref.loc12_32: type = name_ref T, %T.loc12_19.1 [symbolic = %T.loc12_19.2 (constants.%T)] +// CHECK:STDOUT: %ptr.loc12_33.1: type = ptr_type %T [symbolic = %ptr.loc12_33.2 (constants.%ptr.1)] +// CHECK:STDOUT: } // CHECK:STDOUT: %x: @CallGenericPtr.%ptr.loc12_33.2 (%ptr.1) = bind_name x, %x.param // CHECK:STDOUT: %return.param: ref @CallGenericPtr.%ptr.loc12_33.2 (%ptr.1) = out_param runtime_param1 // CHECK:STDOUT: %return: ref @CallGenericPtr.%ptr.loc12_33.2 (%ptr.1) = return_slot %return.param @@ -361,9 +365,9 @@ fn CallSpecific(x: C) -> C { // CHECK:STDOUT: %return.patt: %C = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %C = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref.loc18_20: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %C.ref.loc18_26: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %x.param: %C = value_param runtime_param0 +// CHECK:STDOUT: %C.ref.loc18_20: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %x: %C = bind_name x, %x.param // CHECK:STDOUT: %return.param: ref %C = out_param runtime_param1 // CHECK:STDOUT: %return: ref %C = return_slot %return.param diff --git a/toolchain/check/testdata/function/generic/no_prelude/fail_type_param_mismatch.carbon b/toolchain/check/testdata/function/generic/no_prelude/fail_type_param_mismatch.carbon index 129e728e8d720..9f283eed466bd 100644 --- a/toolchain/check/testdata/function/generic/no_prelude/fail_type_param_mismatch.carbon +++ b/toolchain/check/testdata/function/generic/no_prelude/fail_type_param_mismatch.carbon @@ -54,19 +54,16 @@ fn F(T:! type, U:! type) { // CHECK:STDOUT: %U.patt.loc11_16.2: type = symbolic_binding_pattern U, 1 [symbolic = %U.patt.loc11_16.2 (constants.%U.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %ptr.loc12_11.2: type = ptr_type @F.%T.loc11_6.2 (%T) [symbolic = %ptr.loc12_11.2 (constants.%ptr)] -// CHECK:STDOUT: %require_complete.loc12: = require_complete_type @F.%ptr.loc12_11.2 (%ptr) [symbolic = %require_complete.loc12 (constants.%require_complete.1)] +// CHECK:STDOUT: %ptr: type = ptr_type @F.%T.loc11_6.2 (%T) [symbolic = %ptr (constants.%ptr)] +// CHECK:STDOUT: %require_complete.loc12: = require_complete_type @F.%ptr (%ptr) [symbolic = %require_complete.loc12 (constants.%require_complete.1)] // CHECK:STDOUT: %require_complete.loc16: = require_complete_type @F.%U.loc11_16.2 (%U) [symbolic = %require_complete.loc16 (constants.%require_complete.2)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%T.param_patt: type, %U.param_patt: type) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc11_6.1 [symbolic = %T.loc11_6.2 (constants.%T)] -// CHECK:STDOUT: %ptr.loc12_11.1: type = ptr_type %T [symbolic = %ptr.loc12_11.2 (constants.%ptr)] -// CHECK:STDOUT: %p.var: ref @F.%ptr.loc12_11.2 (%ptr) = var p -// CHECK:STDOUT: %p: ref @F.%ptr.loc12_11.2 (%ptr) = bind_name p, %p.var -// CHECK:STDOUT: %U.ref: type = name_ref U, %U.loc11_16.1 [symbolic = %U.loc11_16.2 (constants.%U)] -// CHECK:STDOUT: %p.ref: ref @F.%ptr.loc12_11.2 (%ptr) = name_ref p, %p -// CHECK:STDOUT: %.loc16_15: @F.%ptr.loc12_11.2 (%ptr) = bind_value %p.ref +// CHECK:STDOUT: %p.var: ref @F.%ptr (%ptr) = var p +// CHECK:STDOUT: %p: ref @F.%ptr (%ptr) = bind_name p, %p.var +// CHECK:STDOUT: %p.ref: ref @F.%ptr (%ptr) = name_ref p, %p +// CHECK:STDOUT: %.loc16_15: @F.%ptr (%ptr) = bind_value %p.ref // CHECK:STDOUT: %.loc16_14: ref @F.%T.loc11_6.2 (%T) = deref %.loc16_15 // CHECK:STDOUT: %.loc16_16: @F.%U.loc11_16.2 (%U) = converted %.loc16_14, [template = ] // CHECK:STDOUT: %n: @F.%U.loc11_16.2 (%U) = bind_name n, diff --git a/toolchain/check/testdata/function/generic/no_prelude/indirect_generic_type.carbon b/toolchain/check/testdata/function/generic/no_prelude/indirect_generic_type.carbon index 481c6f2ac1b94..c05bf347be35d 100644 --- a/toolchain/check/testdata/function/generic/no_prelude/indirect_generic_type.carbon +++ b/toolchain/check/testdata/function/generic/no_prelude/indirect_generic_type.carbon @@ -37,14 +37,16 @@ fn F(T:! type, p: T**) -> T* { // CHECK:STDOUT: %return.patt: @F.%ptr.loc11_20.2 (%ptr.1) = return_slot_pattern // CHECK:STDOUT: %return.param_patt: @F.%ptr.loc11_20.2 (%ptr.1) = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.ref.loc11_19: type = name_ref T, %T.loc11_6.1 [symbolic = %T.loc11_6.2 (constants.%T)] -// CHECK:STDOUT: %ptr.loc11_20.1: type = ptr_type %T [symbolic = %ptr.loc11_20.2 (constants.%ptr.1)] -// CHECK:STDOUT: %ptr.loc11_21.1: type = ptr_type %ptr.1 [symbolic = %ptr.loc11_21.2 (constants.%ptr.2)] // CHECK:STDOUT: %T.ref.loc11_27: type = name_ref T, %T.loc11_6.1 [symbolic = %T.loc11_6.2 (constants.%T)] // CHECK:STDOUT: %ptr.loc11_28: type = ptr_type %T [symbolic = %ptr.loc11_20.2 (constants.%ptr.1)] // CHECK:STDOUT: %T.param: type = value_param runtime_param // CHECK:STDOUT: %T.loc11_6.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc11_6.2 (constants.%T)] // CHECK:STDOUT: %p.param: @F.%ptr.loc11_21.2 (%ptr.2) = value_param runtime_param0 +// CHECK:STDOUT: %.loc11: type = splice_block %ptr.loc11_21.1 [symbolic = %ptr.loc11_21.2 (constants.%ptr.2)] { +// CHECK:STDOUT: %T.ref.loc11_19: type = name_ref T, %T.loc11_6.1 [symbolic = %T.loc11_6.2 (constants.%T)] +// CHECK:STDOUT: %ptr.loc11_20.1: type = ptr_type %T [symbolic = %ptr.loc11_20.2 (constants.%ptr.1)] +// CHECK:STDOUT: %ptr.loc11_21.1: type = ptr_type %ptr.1 [symbolic = %ptr.loc11_21.2 (constants.%ptr.2)] +// CHECK:STDOUT: } // CHECK:STDOUT: %p: @F.%ptr.loc11_21.2 (%ptr.2) = bind_name p, %p.param // CHECK:STDOUT: %return.param: ref @F.%ptr.loc11_20.2 (%ptr.1) = out_param runtime_param1 // CHECK:STDOUT: %return: ref @F.%ptr.loc11_20.2 (%ptr.1) = return_slot %return.param diff --git a/toolchain/check/testdata/function/generic/no_prelude/type_param.carbon b/toolchain/check/testdata/function/generic/no_prelude/type_param.carbon index 3e7ec0ecb1a89..a7f66e41c5b65 100644 --- a/toolchain/check/testdata/function/generic/no_prelude/type_param.carbon +++ b/toolchain/check/testdata/function/generic/no_prelude/type_param.carbon @@ -43,19 +43,16 @@ fn F(T:! type) { // CHECK:STDOUT: %T.patt.loc11_6.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc11_6.2 (constants.%T.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %ptr.loc12_11.2: type = ptr_type @F.%T.loc11_6.2 (%T) [symbolic = %ptr.loc12_11.2 (constants.%ptr)] -// CHECK:STDOUT: %require_complete.loc12: = require_complete_type @F.%ptr.loc12_11.2 (%ptr) [symbolic = %require_complete.loc12 (constants.%require_complete.1)] +// CHECK:STDOUT: %ptr: type = ptr_type @F.%T.loc11_6.2 (%T) [symbolic = %ptr (constants.%ptr)] +// CHECK:STDOUT: %require_complete.loc12: = require_complete_type @F.%ptr (%ptr) [symbolic = %require_complete.loc12 (constants.%require_complete.1)] // CHECK:STDOUT: %require_complete.loc13: = require_complete_type @F.%T.loc11_6.2 (%T) [symbolic = %require_complete.loc13 (constants.%require_complete.2)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%T.param_patt: type) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %T.ref.loc12: type = name_ref T, %T.loc11_6.1 [symbolic = %T.loc11_6.2 (constants.%T)] -// CHECK:STDOUT: %ptr.loc12_11.1: type = ptr_type %T [symbolic = %ptr.loc12_11.2 (constants.%ptr)] -// CHECK:STDOUT: %p.var: ref @F.%ptr.loc12_11.2 (%ptr) = var p -// CHECK:STDOUT: %p: ref @F.%ptr.loc12_11.2 (%ptr) = bind_name p, %p.var -// CHECK:STDOUT: %T.ref.loc13: type = name_ref T, %T.loc11_6.1 [symbolic = %T.loc11_6.2 (constants.%T)] -// CHECK:STDOUT: %p.ref: ref @F.%ptr.loc12_11.2 (%ptr) = name_ref p, %p -// CHECK:STDOUT: %.loc13_15: @F.%ptr.loc12_11.2 (%ptr) = bind_value %p.ref +// CHECK:STDOUT: %p.var: ref @F.%ptr (%ptr) = var p +// CHECK:STDOUT: %p: ref @F.%ptr (%ptr) = bind_name p, %p.var +// CHECK:STDOUT: %p.ref: ref @F.%ptr (%ptr) = name_ref p, %p +// CHECK:STDOUT: %.loc13_15: @F.%ptr (%ptr) = bind_value %p.ref // CHECK:STDOUT: %.loc13_14.1: ref @F.%T.loc11_6.2 (%T) = deref %.loc13_15 // CHECK:STDOUT: %.loc13_14.2: @F.%T.loc11_6.2 (%T) = bind_value %.loc13_14.1 // CHECK:STDOUT: %n: @F.%T.loc11_6.2 (%T) = bind_name n, %.loc13_14.2 diff --git a/toolchain/check/testdata/function/generic/no_prelude/type_param_scope.carbon b/toolchain/check/testdata/function/generic/no_prelude/type_param_scope.carbon index 3c7dadd197e3a..2d71c084fe0fd 100644 --- a/toolchain/check/testdata/function/generic/no_prelude/type_param_scope.carbon +++ b/toolchain/check/testdata/function/generic/no_prelude/type_param_scope.carbon @@ -35,11 +35,11 @@ fn F(T:! type, n: T) -> T { // CHECK:STDOUT: %return.patt: @F.%T.loc11_6.2 (%T) = return_slot_pattern // CHECK:STDOUT: %return.param_patt: @F.%T.loc11_6.2 (%T) = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.ref.loc11_19: type = name_ref T, %T.loc11_6.1 [symbolic = %T.loc11_6.2 (constants.%T)] // CHECK:STDOUT: %T.ref.loc11_25: type = name_ref T, %T.loc11_6.1 [symbolic = %T.loc11_6.2 (constants.%T)] // CHECK:STDOUT: %T.param: type = value_param runtime_param // CHECK:STDOUT: %T.loc11_6.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc11_6.2 (constants.%T)] // CHECK:STDOUT: %n.param: @F.%T.loc11_6.2 (%T) = value_param runtime_param0 +// CHECK:STDOUT: %T.ref.loc11_19: type = name_ref T, %T.loc11_6.1 [symbolic = %T.loc11_6.2 (constants.%T)] // CHECK:STDOUT: %n: @F.%T.loc11_6.2 (%T) = bind_name n, %n.param // CHECK:STDOUT: %return.param: ref @F.%T.loc11_6.2 (%T) = out_param runtime_param1 // CHECK:STDOUT: %return: ref @F.%T.loc11_6.2 (%T) = return_slot %return.param @@ -55,7 +55,6 @@ fn F(T:! type, n: T) -> T { // CHECK:STDOUT: // CHECK:STDOUT: fn(%T.param_patt: type, %n.param_patt: @F.%T.loc11_6.2 (%T)) -> @F.%T.loc11_6.2 (%T) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %T.ref.loc12: type = name_ref T, %T.loc11_6.1 [symbolic = %T.loc11_6.2 (constants.%T)] // CHECK:STDOUT: %n.ref: @F.%T.loc11_6.2 (%T) = name_ref n, %n // CHECK:STDOUT: %m: @F.%T.loc11_6.2 (%T) = bind_name m, %n.ref // CHECK:STDOUT: %m.ref: @F.%T.loc11_6.2 (%T) = name_ref m, %m diff --git a/toolchain/check/testdata/function/generic/resolve_used.carbon b/toolchain/check/testdata/function/generic/resolve_used.carbon index aab5b05e7e2a6..b9d1f10c3cc6f 100644 --- a/toolchain/check/testdata/function/generic/resolve_used.carbon +++ b/toolchain/check/testdata/function/generic/resolve_used.carbon @@ -43,8 +43,6 @@ fn CallNegative() { // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic] // CHECK:STDOUT: %ErrorIfNIsZero.type: type = fn_type @ErrorIfNIsZero [template] // CHECK:STDOUT: %ErrorIfNIsZero: %ErrorIfNIsZero.type = struct_value () [template] -// CHECK:STDOUT: %Int.type: type = generic_class_type @Int [template] -// CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [template] // CHECK:STDOUT: %Int: type = class_type @Int, @Int(%N) [symbolic] // CHECK:STDOUT: %require_complete.2: = require_complete_type %Int [symbolic] // CHECK:STDOUT: %CallNegative.type: type = fn_type @CallNegative [template] @@ -63,7 +61,6 @@ fn CallNegative() { // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: %IntLiteral.type = import_ref Core//prelude/types/int_literal, IntLiteral, loaded [template = constants.%IntLiteral] -// CHECK:STDOUT: %import_ref.2: %Int.type = import_ref Core//prelude/types/int, Int, loaded [template = constants.%Int.generic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -77,12 +74,14 @@ fn CallNegative() { // CHECK:STDOUT: %N.patt.loc4_19.1: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc4_19.2 (constants.%N.patt)] // CHECK:STDOUT: %N.param_patt: Core.IntLiteral = value_param_pattern %N.patt.loc4_19.1, runtime_param [symbolic = %N.patt.loc4_19.2 (constants.%N.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %Core.ref.loc4: = name_ref Core, imports.%Core [template = imports.%Core] -// CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, imports.%import_ref.1 [template = constants.%IntLiteral] -// CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral] -// CHECK:STDOUT: %.loc4_39.1: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral] -// CHECK:STDOUT: %.loc4_39.2: type = converted %int_literal.make_type, %.loc4_39.1 [template = Core.IntLiteral] // CHECK:STDOUT: %N.param: Core.IntLiteral = value_param runtime_param +// CHECK:STDOUT: %.loc4_39.3: type = splice_block %.loc4_39.2 [template = Core.IntLiteral] { +// CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] +// CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, imports.%import_ref.1 [template = constants.%IntLiteral] +// CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral] +// CHECK:STDOUT: %.loc4_39.1: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral] +// CHECK:STDOUT: %.loc4_39.2: type = converted %int_literal.make_type, %.loc4_39.1 [template = Core.IntLiteral] +// CHECK:STDOUT: } // CHECK:STDOUT: %N.loc4_19.1: Core.IntLiteral = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc4_19.2 (constants.%N)] // CHECK:STDOUT: } // CHECK:STDOUT: %CallNegative.decl: %CallNegative.type = fn_decl @CallNegative [template = constants.%CallNegative] {} {} @@ -93,17 +92,13 @@ fn CallNegative() { // CHECK:STDOUT: %N.patt.loc4_19.2: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc4_19.2 (constants.%N.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Int.loc15_20.2: type = class_type @Int, @Int(%N.loc4_19.2) [symbolic = %Int.loc15_20.2 (constants.%Int)] -// CHECK:STDOUT: %require_complete: = require_complete_type @ErrorIfNIsZero.%Int.loc15_20.2 (%Int) [symbolic = %require_complete (constants.%require_complete.2)] +// CHECK:STDOUT: %Int: type = class_type @Int, @Int(%N.loc4_19.2) [symbolic = %Int (constants.%Int)] +// CHECK:STDOUT: %require_complete: = require_complete_type @ErrorIfNIsZero.%Int (%Int) [symbolic = %require_complete (constants.%require_complete.2)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%N.param_patt: Core.IntLiteral) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Core.ref.loc15: = name_ref Core, imports.%Core [template = imports.%Core] -// CHECK:STDOUT: %Int.ref: %Int.type = name_ref Int, imports.%import_ref.2 [template = constants.%Int.generic] -// CHECK:STDOUT: %N.ref: Core.IntLiteral = name_ref N, %N.loc4_19.1 [symbolic = %N.loc4_19.2 (constants.%N)] -// CHECK:STDOUT: %Int.loc15_20.1: type = class_type @Int, @Int(constants.%N) [symbolic = %Int.loc15_20.2 (constants.%Int)] -// CHECK:STDOUT: %v.var: ref @ErrorIfNIsZero.%Int.loc15_20.2 (%Int) = var v -// CHECK:STDOUT: %v: ref @ErrorIfNIsZero.%Int.loc15_20.2 (%Int) = bind_name v, %v.var +// CHECK:STDOUT: %v.var: ref @ErrorIfNIsZero.%Int (%Int) = var v +// CHECK:STDOUT: %v: ref @ErrorIfNIsZero.%Int (%Int) = bind_name v, %v.var // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -127,7 +122,7 @@ fn CallNegative() { // CHECK:STDOUT: %N.patt.loc4_19.2 => constants.%int_0 // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Int.loc15_20.2 => constants.%i0 +// CHECK:STDOUT: %Int => constants.%i0 // CHECK:STDOUT: %require_complete => constants.%complete_type.2 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/generic/return_slot.carbon b/toolchain/check/testdata/function/generic/return_slot.carbon index 6c895df05c84f..954e4534e77de 100644 --- a/toolchain/check/testdata/function/generic/return_slot.carbon +++ b/toolchain/check/testdata/function/generic/return_slot.carbon @@ -116,10 +116,6 @@ fn G() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_100: Core.IntLiteral = int_value 100 [template = constants.%int_100] -// CHECK:STDOUT: %array_type: type = array_type %int_100, %i32 [template = constants.%array_type] // CHECK:STDOUT: %.loc15: %C.elem = field_decl arr, element0 [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.arr.1 [template = constants.%complete_type.4] // CHECK:STDOUT: @@ -152,21 +148,17 @@ fn G() { // CHECK:STDOUT: // CHECK:STDOUT: fn @G() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int_32.loc18_10: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc18_10: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.var: ref %i32 = var a // CHECK:STDOUT: %a: ref %i32 = bind_name a, %a.var // CHECK:STDOUT: %Wrap.ref.loc18: %Wrap.type = name_ref Wrap, file.%Wrap.decl [template = constants.%Wrap.generic] -// CHECK:STDOUT: %int_32.loc18_21: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc18_21: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %Wrap.loc18: type = class_type @Wrap, @Wrap(constants.%i32) [template = constants.%Wrap.2] // CHECK:STDOUT: %.loc18: %Make.type.2 = specific_constant @Wrap.%Make.decl, @Wrap(constants.%i32) [template = constants.%Make.2] // CHECK:STDOUT: %Make.ref.loc18: %Make.type.2 = name_ref Make, %.loc18 [template = constants.%Make.2] // CHECK:STDOUT: %Make.specific_fn.loc18: = specific_function %Make.ref.loc18, @Make(constants.%i32) [template = constants.%Make.specific_fn.2] // CHECK:STDOUT: %Make.call.loc18: init %i32 = call %Make.specific_fn.loc18() // CHECK:STDOUT: assign %a.var, %Make.call.loc18 -// CHECK:STDOUT: %.loc19_11.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc19_11.2: type = converted %.loc19_11.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %b.var: ref %empty_tuple.type = var b // CHECK:STDOUT: %b: ref %empty_tuple.type = bind_name b, %b.var // CHECK:STDOUT: %Wrap.ref.loc19: %Wrap.type = name_ref Wrap, file.%Wrap.decl [template = constants.%Wrap.generic] @@ -178,11 +170,10 @@ fn G() { // CHECK:STDOUT: %Make.specific_fn.loc19: = specific_function %Make.ref.loc19, @Make(constants.%empty_tuple.type) [template = constants.%Make.specific_fn.3] // CHECK:STDOUT: %Make.call.loc19: init %empty_tuple.type = call %Make.specific_fn.loc19() // CHECK:STDOUT: assign %b.var, %Make.call.loc19 -// CHECK:STDOUT: %C.ref.loc20_10: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %c.var: ref %C = var c // CHECK:STDOUT: %c: ref %C = bind_name c, %c.var // CHECK:STDOUT: %Wrap.ref.loc20: %Wrap.type = name_ref Wrap, file.%Wrap.decl [template = constants.%Wrap.generic] -// CHECK:STDOUT: %C.ref.loc20_19: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %Wrap.loc20: type = class_type @Wrap, @Wrap(constants.%C) [template = constants.%Wrap.4] // CHECK:STDOUT: %.loc20_21: %Make.type.4 = specific_constant @Wrap.%Make.decl, @Wrap(constants.%C) [template = constants.%Make.4] // CHECK:STDOUT: %Make.ref.loc20: %Make.type.4 = name_ref Make, %.loc20_21 [template = constants.%Make.4] diff --git a/toolchain/check/testdata/function/generic/undefined.carbon b/toolchain/check/testdata/function/generic/undefined.carbon index c12f288184544..5d17cc2abbf9b 100644 --- a/toolchain/check/testdata/function/generic/undefined.carbon +++ b/toolchain/check/testdata/function/generic/undefined.carbon @@ -99,11 +99,11 @@ fn CallUndefined() -> i32 { // CHECK:STDOUT: %return.patt: @Defined.%T.loc4_12.2 (%T) = return_slot_pattern // CHECK:STDOUT: %return.param_patt: @Defined.%T.loc4_12.2 (%T) = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.ref.loc4_25: type = name_ref T, %T.loc4_12.1 [symbolic = %T.loc4_12.2 (constants.%T)] // CHECK:STDOUT: %T.ref.loc4_31: type = name_ref T, %T.loc4_12.1 [symbolic = %T.loc4_12.2 (constants.%T)] // CHECK:STDOUT: %T.param: type = value_param runtime_param // CHECK:STDOUT: %T.loc4_12.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc4_12.2 (constants.%T)] // CHECK:STDOUT: %x.param: @Defined.%T.loc4_12.2 (%T) = value_param runtime_param0 +// CHECK:STDOUT: %T.ref.loc4_25: type = name_ref T, %T.loc4_12.1 [symbolic = %T.loc4_12.2 (constants.%T)] // CHECK:STDOUT: %x: @Defined.%T.loc4_12.2 (%T) = bind_name x, %x.param // CHECK:STDOUT: %return.param: ref @Defined.%T.loc4_12.2 (%T) = out_param runtime_param1 // CHECK:STDOUT: %return: ref @Defined.%T.loc4_12.2 (%T) = return_slot %return.param @@ -214,11 +214,11 @@ fn CallUndefined() -> i32 { // CHECK:STDOUT: %return.patt: %T = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %T = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.ref.loc4_25: type = name_ref T, %T.loc4_12.1 [symbolic = %T.loc4_12.2 (constants.%T)] // CHECK:STDOUT: %T.ref.loc4_31: type = name_ref T, %T.loc4_12.1 [symbolic = %T.loc4_12.2 (constants.%T)] // CHECK:STDOUT: %T.param.loc4: type = value_param runtime_param // CHECK:STDOUT: %T.loc4_12.1: type = bind_symbolic_name T, 0, %T.param.loc4 [symbolic = %T.loc4_12.2 (constants.%T)] // CHECK:STDOUT: %x.param.loc4: @Defined.%T.loc4_12.2 (%T) = value_param runtime_param0 +// CHECK:STDOUT: %T.ref.loc4_25: type = name_ref T, %T.loc4_12.1 [symbolic = %T.loc4_12.2 (constants.%T)] // CHECK:STDOUT: %x.loc4: @Defined.%T.loc4_12.2 (%T) = bind_name x, %x.param.loc4 // CHECK:STDOUT: %return.param.loc4: ref @Defined.%T.loc4_12.2 (%T) = out_param runtime_param1 // CHECK:STDOUT: %return.loc4: ref @Defined.%T.loc4_12.2 (%T) = return_slot %return.param.loc4 @@ -240,11 +240,11 @@ fn CallUndefined() -> i32 { // CHECK:STDOUT: %return.patt: %T = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %T = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.ref.loc10_25: type = name_ref T, %T.loc10 [symbolic = constants.%T] // CHECK:STDOUT: %T.ref.loc10_31: type = name_ref T, %T.loc10 [symbolic = constants.%T] // CHECK:STDOUT: %T.param.loc10: type = value_param runtime_param // CHECK:STDOUT: %T.loc10: type = bind_symbolic_name T, 0, %T.param.loc10 [symbolic = constants.%T] // CHECK:STDOUT: %x.param.loc10: %T = value_param runtime_param0 +// CHECK:STDOUT: %T.ref.loc10_25: type = name_ref T, %T.loc10 [symbolic = constants.%T] // CHECK:STDOUT: %x.loc10: %T = bind_name x, %x.param.loc10 // CHECK:STDOUT: %return.param.loc10: ref %T = out_param runtime_param1 // CHECK:STDOUT: %return.loc10: ref %T = return_slot %return.param.loc10 @@ -343,11 +343,11 @@ fn CallUndefined() -> i32 { // CHECK:STDOUT: %return.patt: @Undefined.%T.loc4_14.2 (%T) = return_slot_pattern // CHECK:STDOUT: %return.param_patt: @Undefined.%T.loc4_14.2 (%T) = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.ref.loc4_27: type = name_ref T, %T.loc4_14.1 [symbolic = %T.loc4_14.2 (constants.%T)] // CHECK:STDOUT: %T.ref.loc4_33: type = name_ref T, %T.loc4_14.1 [symbolic = %T.loc4_14.2 (constants.%T)] // CHECK:STDOUT: %T.param: type = value_param runtime_param // CHECK:STDOUT: %T.loc4_14.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc4_14.2 (constants.%T)] // CHECK:STDOUT: %x.param: @Undefined.%T.loc4_14.2 (%T) = value_param runtime_param0 +// CHECK:STDOUT: %T.ref.loc4_27: type = name_ref T, %T.loc4_14.1 [symbolic = %T.loc4_14.2 (constants.%T)] // CHECK:STDOUT: %x: @Undefined.%T.loc4_14.2 (%T) = bind_name x, %x.param // CHECK:STDOUT: %return.param: ref @Undefined.%T.loc4_14.2 (%T) = out_param runtime_param1 // CHECK:STDOUT: %return: ref @Undefined.%T.loc4_14.2 (%T) = return_slot %return.param diff --git a/toolchain/check/testdata/generic/complete_type.carbon b/toolchain/check/testdata/generic/complete_type.carbon index ffd0369675186..fe8e18f099fb1 100644 --- a/toolchain/check/testdata/generic/complete_type.carbon +++ b/toolchain/check/testdata/generic/complete_type.carbon @@ -125,10 +125,12 @@ fn G() { F(B); } // CHECK:STDOUT: %x.patt: %A.2 = binding_pattern x // CHECK:STDOUT: %x.param_patt: %A.2 = value_param_pattern %x.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %A.ref: %A.type = name_ref A, file.%A.decl [template = constants.%A.generic] -// CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl.loc4 [template = constants.%B] -// CHECK:STDOUT: %A: type = class_type @A, @A(constants.%B) [template = constants.%A.2] // CHECK:STDOUT: %x.param: %A.2 = value_param runtime_param0 +// CHECK:STDOUT: %.loc27: type = splice_block %A [template = constants.%A.2] { +// CHECK:STDOUT: %A.ref: %A.type = name_ref A, file.%A.decl [template = constants.%A.generic] +// CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl.loc4 [template = constants.%B] +// CHECK:STDOUT: %A: type = class_type @A, @A(constants.%B) [template = constants.%A.2] +// CHECK:STDOUT: } // CHECK:STDOUT: %x: %A.2 = bind_name x, %x.param // CHECK:STDOUT: } // CHECK:STDOUT: %B.decl.loc29: type = class_decl @B [template = constants.%B] {} {} @@ -154,7 +156,6 @@ fn G() { F(B); } // CHECK:STDOUT: %complete_type.loc14_1.2: = complete_type_witness @A.%struct_type.v (%struct_type.v.1) [symbolic = %complete_type.loc14_1.2 (constants.%complete_type.1)] // CHECK:STDOUT: // CHECK:STDOUT: class { -// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc6_9.1 [symbolic = %T.loc6_9.2 (constants.%T)] // CHECK:STDOUT: %.loc13: @A.%A.elem (%A.elem.1) = field_decl v, element0 [template] // CHECK:STDOUT: %complete_type.loc14_1.1: = complete_type_witness %struct_type.v.1 [symbolic = %complete_type.loc14_1.2 (constants.%complete_type.1)] // CHECK:STDOUT: @@ -250,7 +251,6 @@ fn G() { F(B); } // CHECK:STDOUT: // CHECK:STDOUT: fn(%T.param_patt: type) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc6_6.1 [symbolic = %T.loc6_6.2 (constants.%T)] // CHECK:STDOUT: %v.var: ref @F.%T.loc6_6.2 (%T) = var v // CHECK:STDOUT: %v: ref @F.%T.loc6_6.2 (%T) = bind_name v, %v.var // CHECK:STDOUT: return @@ -331,7 +331,6 @@ fn G() { F(B); } // CHECK:STDOUT: // CHECK:STDOUT: fn(%T.param_patt: type) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc6_6.1 [symbolic = %T.loc6_6.2 (constants.%T)] // CHECK:STDOUT: %v.var: ref @F.%T.loc6_6.2 (%T) = var v // CHECK:STDOUT: %v: ref @F.%T.loc6_6.2 (%T) = bind_name v, %v.var // CHECK:STDOUT: return diff --git a/toolchain/check/testdata/global/class_obj.carbon b/toolchain/check/testdata/global/class_obj.carbon index b1c7d97179e00..22d1d60a3bdb2 100644 --- a/toolchain/check/testdata/global/class_obj.carbon +++ b/toolchain/check/testdata/global/class_obj.carbon @@ -35,7 +35,6 @@ var a: A = {}; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %A.decl: type = class_decl @A [template = constants.%A] {} {} -// CHECK:STDOUT: %A.ref: type = name_ref A, %A.decl [template = constants.%A] // CHECK:STDOUT: %a.var: ref %A = var a // CHECK:STDOUT: %a: ref %A = bind_name a, %a.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/global/class_with_fun.carbon b/toolchain/check/testdata/global/class_with_fun.carbon index b705d4ddd288f..258c01038b7c8 100644 --- a/toolchain/check/testdata/global/class_with_fun.carbon +++ b/toolchain/check/testdata/global/class_with_fun.carbon @@ -50,7 +50,6 @@ var a: A = {}; // CHECK:STDOUT: %return.param: ref %A = out_param runtime_param0 // CHECK:STDOUT: %return: ref %A = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %A.ref: type = name_ref A, %A.decl [template = constants.%A] // CHECK:STDOUT: %a.var: ref %A = var a // CHECK:STDOUT: %a: ref %A = bind_name a, %a.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/global/decl.carbon b/toolchain/check/testdata/global/decl.carbon index 369c6c3d27d07..5c07ed62c1060 100644 --- a/toolchain/check/testdata/global/decl.carbon +++ b/toolchain/check/testdata/global/decl.carbon @@ -30,8 +30,6 @@ var a: i32; // CHECK:STDOUT: .a = %a // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.var: ref %i32 = var a // CHECK:STDOUT: %a: ref %i32 = bind_name a, %a.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/global/simple_init.carbon b/toolchain/check/testdata/global/simple_init.carbon index 93bc6830c620b..ce22fe8c47113 100644 --- a/toolchain/check/testdata/global/simple_init.carbon +++ b/toolchain/check/testdata/global/simple_init.carbon @@ -39,8 +39,6 @@ var a: i32 = 0; // CHECK:STDOUT: .a = %a // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.var: ref %i32 = var a // CHECK:STDOUT: %a: ref %i32 = bind_name a, %a.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/global/simple_with_fun.carbon b/toolchain/check/testdata/global/simple_with_fun.carbon index 68312197b44eb..9b415f907b946 100644 --- a/toolchain/check/testdata/global/simple_with_fun.carbon +++ b/toolchain/check/testdata/global/simple_with_fun.carbon @@ -56,8 +56,6 @@ var a: i32 = test_a(); // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.var: ref %i32 = var a // CHECK:STDOUT: %a: ref %i32 = bind_name a, %a.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/if/else.carbon b/toolchain/check/testdata/if/else.carbon index 412709dd37cb5..666b5cbf9bbd1 100644 --- a/toolchain/check/testdata/if/else.carbon +++ b/toolchain/check/testdata/if/else.carbon @@ -61,10 +61,12 @@ fn If(b: bool) { // CHECK:STDOUT: %b.patt: bool = binding_pattern b // CHECK:STDOUT: %b.param_patt: bool = value_param_pattern %b.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc15_10.1: type = value_of_initializer %bool.make_type [template = bool] -// CHECK:STDOUT: %.loc15_10.2: type = converted %bool.make_type, %.loc15_10.1 [template = bool] // CHECK:STDOUT: %b.param: bool = value_param runtime_param0 +// CHECK:STDOUT: %.loc15_10.3: type = splice_block %.loc15_10.2 [template = bool] { +// CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] +// CHECK:STDOUT: %.loc15_10.1: type = value_of_initializer %bool.make_type [template = bool] +// CHECK:STDOUT: %.loc15_10.2: type = converted %bool.make_type, %.loc15_10.1 [template = bool] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: bool = bind_name b, %b.param // CHECK:STDOUT: } // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/if/fail_reachable_fallthrough.carbon b/toolchain/check/testdata/if/fail_reachable_fallthrough.carbon index cd548bd17d3fd..181cd0ac3eda6 100644 --- a/toolchain/check/testdata/if/fail_reachable_fallthrough.carbon +++ b/toolchain/check/testdata/if/fail_reachable_fallthrough.carbon @@ -90,12 +90,14 @@ fn If3(b: bool) -> i32 { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %bool.make_type [template = bool] -// CHECK:STDOUT: %.loc11_11.2: type = converted %bool.make_type, %.loc11_11.1 [template = bool] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %b.param: bool = value_param runtime_param0 +// CHECK:STDOUT: %.loc11_11.3: type = splice_block %.loc11_11.2 [template = bool] { +// CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] +// CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %bool.make_type [template = bool] +// CHECK:STDOUT: %.loc11_11.2: type = converted %bool.make_type, %.loc11_11.1 [template = bool] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: bool = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -106,12 +108,14 @@ fn If3(b: bool) -> i32 { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc22_11.1: type = value_of_initializer %bool.make_type [template = bool] -// CHECK:STDOUT: %.loc22_11.2: type = converted %bool.make_type, %.loc22_11.1 [template = bool] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %b.param: bool = value_param runtime_param0 +// CHECK:STDOUT: %.loc22_11.3: type = splice_block %.loc22_11.2 [template = bool] { +// CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] +// CHECK:STDOUT: %.loc22_11.1: type = value_of_initializer %bool.make_type [template = bool] +// CHECK:STDOUT: %.loc22_11.2: type = converted %bool.make_type, %.loc22_11.1 [template = bool] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: bool = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -122,12 +126,14 @@ fn If3(b: bool) -> i32 { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc33_11.1: type = value_of_initializer %bool.make_type [template = bool] -// CHECK:STDOUT: %.loc33_11.2: type = converted %bool.make_type, %.loc33_11.1 [template = bool] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %b.param: bool = value_param runtime_param0 +// CHECK:STDOUT: %.loc33_11.3: type = splice_block %.loc33_11.2 [template = bool] { +// CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] +// CHECK:STDOUT: %.loc33_11.1: type = value_of_initializer %bool.make_type [template = bool] +// CHECK:STDOUT: %.loc33_11.2: type = converted %bool.make_type, %.loc33_11.1 [template = bool] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: bool = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param diff --git a/toolchain/check/testdata/if/fail_scope.carbon b/toolchain/check/testdata/if/fail_scope.carbon index 47051fee04a34..89eb2b35e0644 100644 --- a/toolchain/check/testdata/if/fail_scope.carbon +++ b/toolchain/check/testdata/if/fail_scope.carbon @@ -60,12 +60,14 @@ fn VarScope(b: bool) -> i32 { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc11_16.1: type = value_of_initializer %bool.make_type [template = bool] -// CHECK:STDOUT: %.loc11_16.2: type = converted %bool.make_type, %.loc11_16.1 [template = bool] -// CHECK:STDOUT: %int_32.loc11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %b.param: bool = value_param runtime_param0 +// CHECK:STDOUT: %.loc11_16.3: type = splice_block %.loc11_16.2 [template = bool] { +// CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] +// CHECK:STDOUT: %.loc11_16.1: type = value_of_initializer %bool.make_type [template = bool] +// CHECK:STDOUT: %.loc11_16.2: type = converted %bool.make_type, %.loc11_16.1 [template = bool] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: bool = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -78,8 +80,6 @@ fn VarScope(b: bool) -> i32 { // CHECK:STDOUT: if %b.ref br !if.then else br !if.else // CHECK:STDOUT: // CHECK:STDOUT: !if.then: -// CHECK:STDOUT: %int_32.loc13: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc13: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %n.var: ref %i32 = var n // CHECK:STDOUT: %n: ref %i32 = bind_name n, %n.var // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] diff --git a/toolchain/check/testdata/if/no_else.carbon b/toolchain/check/testdata/if/no_else.carbon index eb4546d3be127..ae01b6005d1e0 100644 --- a/toolchain/check/testdata/if/no_else.carbon +++ b/toolchain/check/testdata/if/no_else.carbon @@ -54,10 +54,12 @@ fn If(b: bool) { // CHECK:STDOUT: %b.patt: bool = binding_pattern b // CHECK:STDOUT: %b.param_patt: bool = value_param_pattern %b.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc14_10.1: type = value_of_initializer %bool.make_type [template = bool] -// CHECK:STDOUT: %.loc14_10.2: type = converted %bool.make_type, %.loc14_10.1 [template = bool] // CHECK:STDOUT: %b.param: bool = value_param runtime_param0 +// CHECK:STDOUT: %.loc14_10.3: type = splice_block %.loc14_10.2 [template = bool] { +// CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] +// CHECK:STDOUT: %.loc14_10.1: type = value_of_initializer %bool.make_type [template = bool] +// CHECK:STDOUT: %.loc14_10.2: type = converted %bool.make_type, %.loc14_10.1 [template = bool] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: bool = bind_name b, %b.param // CHECK:STDOUT: } // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/if/unreachable_fallthrough.carbon b/toolchain/check/testdata/if/unreachable_fallthrough.carbon index ccc7ec314d76b..d3f743e5d9fb1 100644 --- a/toolchain/check/testdata/if/unreachable_fallthrough.carbon +++ b/toolchain/check/testdata/if/unreachable_fallthrough.carbon @@ -62,12 +62,14 @@ fn If(b: bool) -> i32 { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc11_10.1: type = value_of_initializer %bool.make_type [template = bool] -// CHECK:STDOUT: %.loc11_10.2: type = converted %bool.make_type, %.loc11_10.1 [template = bool] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %b.param: bool = value_param runtime_param0 +// CHECK:STDOUT: %.loc11_10.3: type = splice_block %.loc11_10.2 [template = bool] { +// CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] +// CHECK:STDOUT: %.loc11_10.1: type = value_of_initializer %bool.make_type [template = bool] +// CHECK:STDOUT: %.loc11_10.2: type = converted %bool.make_type, %.loc11_10.1 [template = bool] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: bool = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param diff --git a/toolchain/check/testdata/if_expr/basic.carbon b/toolchain/check/testdata/if_expr/basic.carbon index c7d9e86e2c3af..a4a346038c140 100644 --- a/toolchain/check/testdata/if_expr/basic.carbon +++ b/toolchain/check/testdata/if_expr/basic.carbon @@ -62,20 +62,26 @@ fn F(b: bool, n: i32, m: i32) -> i32 { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param3 // CHECK:STDOUT: } { -// CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc11_9.1: type = value_of_initializer %bool.make_type [template = bool] -// CHECK:STDOUT: %.loc11_9.2: type = converted %bool.make_type, %.loc11_9.1 [template = bool] -// CHECK:STDOUT: %int_32.loc11_18: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc11_18: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc11_26: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc11_26: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc11_34: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc11_34: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %b.param: bool = value_param runtime_param0 +// CHECK:STDOUT: %.loc11_9.3: type = splice_block %.loc11_9.2 [template = bool] { +// CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] +// CHECK:STDOUT: %.loc11_9.1: type = value_of_initializer %bool.make_type [template = bool] +// CHECK:STDOUT: %.loc11_9.2: type = converted %bool.make_type, %.loc11_9.1 [template = bool] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: bool = bind_name b, %b.param // CHECK:STDOUT: %n.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %.loc11_18: type = splice_block %i32.loc11_18 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc11_18: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc11_18: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %n: %i32 = bind_name n, %n.param // CHECK:STDOUT: %m.param: %i32 = value_param runtime_param2 +// CHECK:STDOUT: %.loc11_26: type = splice_block %i32.loc11_26 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc11_26: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc11_26: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %m: %i32 = bind_name m, %m.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param3 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -84,10 +90,6 @@ fn F(b: bool, n: i32, m: i32) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: fn @F(%b.param_patt: bool, %n.param_patt: %i32, %m.param_patt: %i32) -> %i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int_32.loc12: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc12: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1] -// CHECK:STDOUT: %array_type: type = array_type %int_1, %i32 [template = constants.%array_type] // CHECK:STDOUT: %x.var: ref %array_type = var x // CHECK:STDOUT: %x: ref %array_type = bind_name x, %x.var // CHECK:STDOUT: %int_0.loc12_22: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] diff --git a/toolchain/check/testdata/if_expr/constant_condition.carbon b/toolchain/check/testdata/if_expr/constant_condition.carbon index 6c642c3dfcbb5..1d63bce3f0511 100644 --- a/toolchain/check/testdata/if_expr/constant_condition.carbon +++ b/toolchain/check/testdata/if_expr/constant_condition.carbon @@ -125,8 +125,8 @@ fn PartiallyConstant(t: type) -> i32 { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc22: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } @@ -136,8 +136,8 @@ fn PartiallyConstant(t: type) -> i32 { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc28: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc28: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %t.param: type = value_param runtime_param0 // CHECK:STDOUT: %t: type = bind_name t, %t.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 @@ -219,22 +219,6 @@ fn PartiallyConstant(t: type) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: fn @Constant() -> %i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %true: bool = bool_literal true [template = constants.%true] -// CHECK:STDOUT: if %true br !if.expr.then.loc23 else br !if.expr.else.loc23 -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.then.loc23: -// CHECK:STDOUT: %int_32.loc23_23: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc23_23: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: br !if.expr.result.loc23(%i32.loc23_23) -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.else.loc23: -// CHECK:STDOUT: %int_32.loc23_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc23_32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %ptr.loc23: type = ptr_type %i32 [template = constants.%ptr] -// CHECK:STDOUT: br !if.expr.result.loc23(%ptr.loc23) -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.result.loc23: -// CHECK:STDOUT: %.loc23_10: type = block_arg !if.expr.result.loc23 [template = constants.%i32] // CHECK:STDOUT: %v.var: ref %i32 = var v // CHECK:STDOUT: %v: ref %i32 = bind_name v, %v.var // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] @@ -242,24 +226,8 @@ fn PartiallyConstant(t: type) -> i32 { // CHECK:STDOUT: %Convert.bound: = bound_method %int_1, %impl.elem0 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_1) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc23_40: init %i32 = converted %int_1, %int.convert_checked [template = constants.%int_1.2] -// CHECK:STDOUT: assign %v.var, %.loc23_40 -// CHECK:STDOUT: %false: bool = bool_literal false [template = constants.%false] -// CHECK:STDOUT: if %false br !if.expr.then.loc24 else br !if.expr.else.loc24 -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.then.loc24: -// CHECK:STDOUT: %int_32.loc24_24: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc24_24: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: br !if.expr.result.loc24(%i32.loc24_24) -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.else.loc24: -// CHECK:STDOUT: %int_32.loc24_33: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc24_33: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %ptr.loc24: type = ptr_type %i32 [template = constants.%ptr] -// CHECK:STDOUT: br !if.expr.result.loc24(%ptr.loc24) -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.result.loc24: -// CHECK:STDOUT: %.loc24: type = block_arg !if.expr.result.loc24 [template = constants.%ptr] +// CHECK:STDOUT: %.loc23: init %i32 = converted %int_1, %int.convert_checked [template = constants.%int_1.2] +// CHECK:STDOUT: assign %v.var, %.loc23 // CHECK:STDOUT: %w.var: ref %ptr = var w // CHECK:STDOUT: %w: ref %ptr = bind_name w, %w.var // CHECK:STDOUT: %v.ref: ref %i32 = name_ref v, %v @@ -274,20 +242,6 @@ fn PartiallyConstant(t: type) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: fn @PartiallyConstant(%t.param_patt: type) -> %i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %true: bool = bool_literal true [template = constants.%true] -// CHECK:STDOUT: if %true br !if.expr.then.loc29 else br !if.expr.else.loc29 -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.then.loc29: -// CHECK:STDOUT: %int_32.loc29: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc29: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: br !if.expr.result.loc29(%i32.loc29) -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.else.loc29: -// CHECK:STDOUT: %t.ref.loc29: type = name_ref t, %t -// CHECK:STDOUT: br !if.expr.result.loc29(%t.ref.loc29) -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.result.loc29: -// CHECK:STDOUT: %.loc29_10: type = block_arg !if.expr.result.loc29 [template = constants.%i32] // CHECK:STDOUT: %v.var: ref %i32 = var v // CHECK:STDOUT: %v: ref %i32 = bind_name v, %v.var // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] @@ -295,23 +249,8 @@ fn PartiallyConstant(t: type) -> i32 { // CHECK:STDOUT: %Convert.bound: = bound_method %int_1, %impl.elem0 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_1) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc29_37: init %i32 = converted %int_1, %int.convert_checked [template = constants.%int_1.2] -// CHECK:STDOUT: assign %v.var, %.loc29_37 -// CHECK:STDOUT: %false: bool = bool_literal false [template = constants.%false] -// CHECK:STDOUT: if %false br !if.expr.then.loc30 else br !if.expr.else.loc30 -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.then.loc30: -// CHECK:STDOUT: %t.ref.loc30: type = name_ref t, %t -// CHECK:STDOUT: br !if.expr.result.loc30(%t.ref.loc30) -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.else.loc30: -// CHECK:STDOUT: %int_32.loc30: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc30: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %ptr: type = ptr_type %i32 [template = constants.%ptr] -// CHECK:STDOUT: br !if.expr.result.loc30(%ptr) -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.result.loc30: -// CHECK:STDOUT: %.loc30: type = block_arg !if.expr.result.loc30 [template = constants.%ptr] +// CHECK:STDOUT: %.loc29: init %i32 = converted %int_1, %int.convert_checked [template = constants.%int_1.2] +// CHECK:STDOUT: assign %v.var, %.loc29 // CHECK:STDOUT: %w.var: ref %ptr = var w // CHECK:STDOUT: %w: ref %ptr = bind_name w, %w.var // CHECK:STDOUT: %v.ref: ref %i32 = name_ref v, %v diff --git a/toolchain/check/testdata/if_expr/control_flow.carbon b/toolchain/check/testdata/if_expr/control_flow.carbon index 1e4814a629020..8427a022407df 100644 --- a/toolchain/check/testdata/if_expr/control_flow.carbon +++ b/toolchain/check/testdata/if_expr/control_flow.carbon @@ -84,12 +84,14 @@ fn F(b: bool) -> i32 { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc14_9.1: type = value_of_initializer %bool.make_type [template = bool] -// CHECK:STDOUT: %.loc14_9.2: type = converted %bool.make_type, %.loc14_9.1 [template = bool] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %b.param: bool = value_param runtime_param0 +// CHECK:STDOUT: %.loc14_9.3: type = splice_block %.loc14_9.2 [template = bool] { +// CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] +// CHECK:STDOUT: %.loc14_9.1: type = value_of_initializer %bool.make_type [template = bool] +// CHECK:STDOUT: %.loc14_9.2: type = converted %bool.make_type, %.loc14_9.1 [template = bool] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: bool = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param diff --git a/toolchain/check/testdata/if_expr/fail_not_in_function.carbon b/toolchain/check/testdata/if_expr/fail_not_in_function.carbon index 8c4c3bc09c90e..61b7c3884f98e 100644 --- a/toolchain/check/testdata/if_expr/fail_not_in_function.carbon +++ b/toolchain/check/testdata/if_expr/fail_not_in_function.carbon @@ -8,32 +8,44 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/if_expr/fail_not_in_function.carbon -// CHECK:STDERR: fail_not_in_function.carbon:[[@LINE+12]]:14: error: semantics TODO: `Control flow expressions are currently only supported inside functions.` [SemanticsTodo] +// CHECK:STDERR: fail_not_in_function.carbon:[[@LINE+16]]:14: error: semantics TODO: `Control flow expressions are currently only supported inside functions.` [SemanticsTodo] // CHECK:STDERR: let x: i32 = if true then 1 else 0; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_not_in_function.carbon:[[@LINE+8]]:14: error: semantics TODO: `Control flow expressions are currently only supported inside functions.` [SemanticsTodo] +// CHECK:STDERR: fail_not_in_function.carbon:[[@LINE+12]]:14: error: semantics TODO: `Control flow expressions are currently only supported inside functions.` [SemanticsTodo] // CHECK:STDERR: let x: i32 = if true then 1 else 0; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: +// CHECK:STDERR: fail_not_in_function.carbon:[[@LINE+8]]:14: error: semantics TODO: `Control flow expressions are currently only supported inside functions.` [SemanticsTodo] +// CHECK:STDERR: let x: i32 = if true then 1 else 0; +// CHECK:STDERR: ^~~~~~~ +// CHECK:STDERR: // CHECK:STDERR: fail_not_in_function.carbon:[[@LINE+4]]:22: error: semantics TODO: `Control flow expressions are currently only supported inside functions.` [SemanticsTodo] // CHECK:STDERR: let x: i32 = if true then 1 else 0; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: let x: i32 = if true then 1 else 0; +// CHECK:STDERR: fail_not_in_function.carbon:[[@LINE+4]]:8: error: semantics TODO: `Control flow expressions are currently only supported inside functions.` [SemanticsTodo] +// CHECK:STDERR: var y: if true then i32 else f64; +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: +var y: if true then i32 else f64; + +// CHECK:STDERR: fail_not_in_function.carbon:[[@LINE+8]]:9: error: semantics TODO: `Control flow expressions are currently only supported inside functions.` [SemanticsTodo] +// CHECK:STDERR: fn F(a: if true then i32 else f64); +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: +// CHECK:STDERR: fail_not_in_function.carbon:[[@LINE+4]]:9: error: semantics TODO: `Control flow expressions are currently only supported inside functions.` [SemanticsTodo] +// CHECK:STDERR: fn F(a: if true then i32 else f64); +// CHECK:STDERR: ^~~~~~~ +// CHECK:STDERR: +fn F(a: if true then i32 else f64); + class C { - // CHECK:STDERR: fail_not_in_function.carbon:[[@LINE+11]]:10: error: semantics TODO: `Control flow expressions are currently only supported inside functions.` [SemanticsTodo] - // CHECK:STDERR: var n: if true then i32 else f64; - // CHECK:STDERR: ^~~~~~~ - // CHECK:STDERR: - // CHECK:STDERR: fail_not_in_function.carbon:[[@LINE+7]]:10: error: semantics TODO: `Control flow expressions are currently only supported inside functions.` [SemanticsTodo] + // CHECK:STDERR: fail_not_in_function.carbon:[[@LINE+3]]:10: error: semantics TODO: `Control flow expressions are currently only supported inside functions.` [SemanticsTodo] // CHECK:STDERR: var n: if true then i32 else f64; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~ - // CHECK:STDERR: - // CHECK:STDERR: fail_not_in_function.carbon:[[@LINE+3]]:18: error: semantics TODO: `Control flow expressions are currently only supported inside functions.` [SemanticsTodo] - // CHECK:STDERR: var n: if true then i32 else f64; - // CHECK:STDERR: ^~~~~~~~ var n: if true then i32 else f64; } @@ -43,7 +55,12 @@ class C { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %true: bool = bool_literal true [template] +// CHECK:STDOUT: %F.type: type = fn_type @F [template] +// CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %C: type = class_type @C [template] +// CHECK:STDOUT: %C.elem: type = unbound_element_type %C, %i32 [template] +// CHECK:STDOUT: %struct_type.n: type = struct_type {.n: %i32} [template] +// CHECK:STDOUT: %complete_type.4: = complete_type_witness %struct_type.n [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -59,25 +76,36 @@ class C { // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = imports.%Core -// CHECK:STDOUT: .x = .inst43.loc23_5 +// CHECK:STDOUT: .x = .inst43.loc27_5 +// CHECK:STDOUT: .y = %y +// CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %y.var: ref %i32 = var y +// CHECK:STDOUT: %y: ref %i32 = bind_name y, %y.var +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: } // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { -// CHECK:STDOUT: %true: bool = bool_literal true [template = constants.%true] -// CHECK:STDOUT: if %true br !if.expr.then else br !if.expr.else +// CHECK:STDOUT: %.loc49: %C.elem = field_decl n, element0 [template] +// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.n [template = constants.%complete_type.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C -// CHECK:STDOUT: .n = .inst559.loc37_8 -// CHECK:STDOUT: complete_type_witness = .inst561.loc38_1 +// CHECK:STDOUT: .n = %.loc49 +// CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @F(%a.param_patt: %i32); +// CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %true: bool = bool_literal true [template = constants.%true] diff --git a/toolchain/check/testdata/if_expr/fail_partial_constant.carbon b/toolchain/check/testdata/if_expr/fail_partial_constant.carbon index 55c7e99d6b345..8c669d732cba1 100644 --- a/toolchain/check/testdata/if_expr/fail_partial_constant.carbon +++ b/toolchain/check/testdata/if_expr/fail_partial_constant.carbon @@ -46,8 +46,6 @@ fn ChosenBranchIsNonConstant(t: type) { // CHECK:STDOUT: %Bool: %Bool.type = struct_value () [template] // CHECK:STDOUT: %ConditionIsNonConstant.type: type = fn_type @ConditionIsNonConstant [template] // CHECK:STDOUT: %ConditionIsNonConstant: %ConditionIsNonConstant.type = struct_value () [template] -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -70,31 +68,18 @@ fn ChosenBranchIsNonConstant(t: type) { // CHECK:STDOUT: %b.patt: bool = binding_pattern b // CHECK:STDOUT: %b.param_patt: bool = value_param_pattern %b.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc4_30.1: type = value_of_initializer %bool.make_type [template = bool] -// CHECK:STDOUT: %.loc4_30.2: type = converted %bool.make_type, %.loc4_30.1 [template = bool] // CHECK:STDOUT: %b.param: bool = value_param runtime_param0 +// CHECK:STDOUT: %.loc4_30.3: type = splice_block %.loc4_30.2 [template = bool] { +// CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] +// CHECK:STDOUT: %.loc4_30.1: type = value_of_initializer %bool.make_type [template = bool] +// CHECK:STDOUT: %.loc4_30.2: type = converted %bool.make_type, %.loc4_30.1 [template = bool] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: bool = bind_name b, %b.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @ConditionIsNonConstant(%b.param_patt: bool) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %b.ref: bool = name_ref b, %b -// CHECK:STDOUT: if %b.ref br !if.expr.then else br !if.expr.else -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.then: -// CHECK:STDOUT: %int_32.loc12_20: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc12_20: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: br !if.expr.result(%i32.loc12_20) -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.else: -// CHECK:STDOUT: %int_32.loc12_29: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc12_29: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: br !if.expr.result(%i32.loc12_29) -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.result: -// CHECK:STDOUT: %.loc12: type = block_arg !if.expr.result // CHECK:STDOUT: %v.var: ref = var v // CHECK:STDOUT: %v: ref = bind_name v, %v.var // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1] @@ -107,11 +92,7 @@ fn ChosenBranchIsNonConstant(t: type) { // CHECK:STDOUT: constants { // CHECK:STDOUT: %ChosenBranchIsNonConstant.type: type = fn_type @ChosenBranchIsNonConstant [template] // CHECK:STDOUT: %ChosenBranchIsNonConstant: %ChosenBranchIsNonConstant.type = struct_value () [template] -// CHECK:STDOUT: %true: bool = bool_literal true [template] -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %false: bool = bool_literal false [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -139,38 +120,10 @@ fn ChosenBranchIsNonConstant(t: type) { // CHECK:STDOUT: // CHECK:STDOUT: fn @ChosenBranchIsNonConstant(%t.param_patt: type) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %true: bool = bool_literal true [template = constants.%true] -// CHECK:STDOUT: if %true br !if.expr.then.loc9 else br !if.expr.else.loc9 -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.then.loc9: -// CHECK:STDOUT: %t.ref.loc9: type = name_ref t, %t -// CHECK:STDOUT: br !if.expr.result.loc9(%t.ref.loc9) -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.else.loc9: -// CHECK:STDOUT: %int_32.loc9: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc9: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: br !if.expr.result.loc9(%i32.loc9) -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.result.loc9: -// CHECK:STDOUT: %.loc9: type = block_arg !if.expr.result.loc9 // CHECK:STDOUT: %v.var: ref = var v // CHECK:STDOUT: %v: ref = bind_name v, %v.var // CHECK:STDOUT: %int_1.loc9: Core.IntLiteral = int_value 1 [template = constants.%int_1] // CHECK:STDOUT: assign %v.var, -// CHECK:STDOUT: %false: bool = bool_literal false [template = constants.%false] -// CHECK:STDOUT: if %false br !if.expr.then.loc13 else br !if.expr.else.loc13 -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.then.loc13: -// CHECK:STDOUT: %int_32.loc13: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc13: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: br !if.expr.result.loc13(%i32.loc13) -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.else.loc13: -// CHECK:STDOUT: %t.ref.loc13: type = name_ref t, %t -// CHECK:STDOUT: br !if.expr.result.loc13(%t.ref.loc13) -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.result.loc13: -// CHECK:STDOUT: %.loc13: type = block_arg !if.expr.result.loc13 // CHECK:STDOUT: %w.var: ref = var w // CHECK:STDOUT: %w: ref = bind_name w, %w.var // CHECK:STDOUT: %int_1.loc13: Core.IntLiteral = int_value 1 [template = constants.%int_1] diff --git a/toolchain/check/testdata/if_expr/nested.carbon b/toolchain/check/testdata/if_expr/nested.carbon index c8d5e8fe113ff..e700adafd626b 100644 --- a/toolchain/check/testdata/if_expr/nested.carbon +++ b/toolchain/check/testdata/if_expr/nested.carbon @@ -69,22 +69,28 @@ fn F(a: bool, b: bool, c: bool) -> i32 { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param3 // CHECK:STDOUT: } { -// CHECK:STDOUT: %bool.make_type.loc11_9: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc11_9.1: type = value_of_initializer %bool.make_type.loc11_9 [template = bool] -// CHECK:STDOUT: %.loc11_9.2: type = converted %bool.make_type.loc11_9, %.loc11_9.1 [template = bool] -// CHECK:STDOUT: %bool.make_type.loc11_18: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc11_18.1: type = value_of_initializer %bool.make_type.loc11_18 [template = bool] -// CHECK:STDOUT: %.loc11_18.2: type = converted %bool.make_type.loc11_18, %.loc11_18.1 [template = bool] -// CHECK:STDOUT: %bool.make_type.loc11_27: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc11_27.1: type = value_of_initializer %bool.make_type.loc11_27 [template = bool] -// CHECK:STDOUT: %.loc11_27.2: type = converted %bool.make_type.loc11_27, %.loc11_27.1 [template = bool] // CHECK:STDOUT: %int_32.loc11: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: bool = value_param runtime_param0 +// CHECK:STDOUT: %.loc11_9.3: type = splice_block %.loc11_9.2 [template = bool] { +// CHECK:STDOUT: %bool.make_type.loc11_9: init type = call constants.%Bool() [template = bool] +// CHECK:STDOUT: %.loc11_9.1: type = value_of_initializer %bool.make_type.loc11_9 [template = bool] +// CHECK:STDOUT: %.loc11_9.2: type = converted %bool.make_type.loc11_9, %.loc11_9.1 [template = bool] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: bool = bind_name a, %a.param // CHECK:STDOUT: %b.param: bool = value_param runtime_param1 +// CHECK:STDOUT: %.loc11_18.3: type = splice_block %.loc11_18.2 [template = bool] { +// CHECK:STDOUT: %bool.make_type.loc11_18: init type = call constants.%Bool() [template = bool] +// CHECK:STDOUT: %.loc11_18.1: type = value_of_initializer %bool.make_type.loc11_18 [template = bool] +// CHECK:STDOUT: %.loc11_18.2: type = converted %bool.make_type.loc11_18, %.loc11_18.1 [template = bool] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: bool = bind_name b, %b.param // CHECK:STDOUT: %c.param: bool = value_param runtime_param2 +// CHECK:STDOUT: %.loc11_27.3: type = splice_block %.loc11_27.2 [template = bool] { +// CHECK:STDOUT: %bool.make_type.loc11_27: init type = call constants.%Bool() [template = bool] +// CHECK:STDOUT: %.loc11_27.1: type = value_of_initializer %bool.make_type.loc11_27 [template = bool] +// CHECK:STDOUT: %.loc11_27.2: type = converted %bool.make_type.loc11_27, %.loc11_27.1 [template = bool] +// CHECK:STDOUT: } // CHECK:STDOUT: %c: bool = bind_name c, %c.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param3 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param diff --git a/toolchain/check/testdata/if_expr/struct.carbon b/toolchain/check/testdata/if_expr/struct.carbon index 55583e3ee9558..3912d5aeb4647 100644 --- a/toolchain/check/testdata/if_expr/struct.carbon +++ b/toolchain/check/testdata/if_expr/struct.carbon @@ -65,22 +65,26 @@ fn F(cond: bool) { // CHECK:STDOUT: %s.patt: %struct_type.a.b.1 = binding_pattern s // CHECK:STDOUT: %s.param_patt: %struct_type.a.b.1 = value_param_pattern %s.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc11_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc11_14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc11_23: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc11_23: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %struct_type.a.b: type = struct_type {.a: %i32, .b: %i32} [template = constants.%struct_type.a.b.1] // CHECK:STDOUT: %s.param: %struct_type.a.b.1 = value_param runtime_param0 +// CHECK:STDOUT: %.loc11: type = splice_block %struct_type.a.b [template = constants.%struct_type.a.b.1] { +// CHECK:STDOUT: %int_32.loc11_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc11_14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %int_32.loc11_23: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc11_23: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %struct_type.a.b: type = struct_type {.a: %i32, .b: %i32} [template = constants.%struct_type.a.b.1] +// CHECK:STDOUT: } // CHECK:STDOUT: %s: %struct_type.a.b.1 = bind_name s, %s.param // CHECK:STDOUT: } // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %cond.patt: bool = binding_pattern cond // CHECK:STDOUT: %cond.param_patt: bool = value_param_pattern %cond.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc13_12.1: type = value_of_initializer %bool.make_type [template = bool] -// CHECK:STDOUT: %.loc13_12.2: type = converted %bool.make_type, %.loc13_12.1 [template = bool] // CHECK:STDOUT: %cond.param: bool = value_param runtime_param0 +// CHECK:STDOUT: %.loc13_12.3: type = splice_block %.loc13_12.2 [template = bool] { +// CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] +// CHECK:STDOUT: %.loc13_12.1: type = value_of_initializer %bool.make_type [template = bool] +// CHECK:STDOUT: %.loc13_12.2: type = converted %bool.make_type, %.loc13_12.1 [template = bool] +// CHECK:STDOUT: } // CHECK:STDOUT: %cond: bool = bind_name cond, %cond.param // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -89,11 +93,6 @@ fn F(cond: bool) { // CHECK:STDOUT: // CHECK:STDOUT: fn @F(%cond.param_patt: bool) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int_32.loc14_15: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc14_15: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc14_24: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc14_24: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %struct_type.a.b: type = struct_type {.a: %i32, .b: %i32} [template = constants.%struct_type.a.b.1] // CHECK:STDOUT: %a.var: ref %struct_type.a.b.1 = var a // CHECK:STDOUT: %a: ref %struct_type.a.b.1 = bind_name a, %a.var // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] diff --git a/toolchain/check/testdata/impl/compound.carbon b/toolchain/check/testdata/impl/compound.carbon index 4f6fa015cb592..3b9f11ca4999b 100644 --- a/toolchain/check/testdata/impl/compound.carbon +++ b/toolchain/check/testdata/impl/compound.carbon @@ -96,38 +96,46 @@ fn InstanceCallIndirect(p: i32*) { // CHECK:STDOUT: %n.patt: %i32 = binding_pattern n // CHECK:STDOUT: %n.param_patt: %i32 = value_param_pattern %n.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %n.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc21: type = splice_block %i32 [template = constants.%i32] { +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %n: %i32 = bind_name n, %n.param // CHECK:STDOUT: } // CHECK:STDOUT: %InstanceCall.decl: %InstanceCall.type = fn_decl @InstanceCall [template = constants.%InstanceCall] { // CHECK:STDOUT: %n.patt: %i32 = binding_pattern n // CHECK:STDOUT: %n.param_patt: %i32 = value_param_pattern %n.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %n.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc25: type = splice_block %i32 [template = constants.%i32] { +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %n: %i32 = bind_name n, %n.param // CHECK:STDOUT: } // CHECK:STDOUT: %NonInstanceCallIndirect.decl: %NonInstanceCallIndirect.type = fn_decl @NonInstanceCallIndirect [template = constants.%NonInstanceCallIndirect] { // CHECK:STDOUT: %p.patt: %ptr = binding_pattern p // CHECK:STDOUT: %p.param_patt: %ptr = value_param_pattern %p.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %ptr: type = ptr_type %i32 [template = constants.%ptr] // CHECK:STDOUT: %p.param: %ptr = value_param runtime_param0 +// CHECK:STDOUT: %.loc29: type = splice_block %ptr [template = constants.%ptr] { +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %ptr: type = ptr_type %i32 [template = constants.%ptr] +// CHECK:STDOUT: } // CHECK:STDOUT: %p: %ptr = bind_name p, %p.param // CHECK:STDOUT: } // CHECK:STDOUT: %InstanceCallIndirect.decl: %InstanceCallIndirect.type = fn_decl @InstanceCallIndirect [template = constants.%InstanceCallIndirect] { // CHECK:STDOUT: %p.patt: %ptr = binding_pattern p // CHECK:STDOUT: %p.param_patt: %ptr = value_param_pattern %p.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %ptr: type = ptr_type %i32 [template = constants.%ptr] // CHECK:STDOUT: %p.param: %ptr = value_param runtime_param0 +// CHECK:STDOUT: %.loc33: type = splice_block %ptr [template = constants.%ptr] { +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %ptr: type = ptr_type %i32 [template = constants.%ptr] +// CHECK:STDOUT: } // CHECK:STDOUT: %p: %ptr = bind_name p, %p.param // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -140,10 +148,12 @@ fn InstanceCallIndirect(p: i32*) { // CHECK:STDOUT: %self.patt: @G.1.%Self.as_type.loc13_14.1 (%Self.as_type.1) = binding_pattern self // CHECK:STDOUT: %self.param_patt: @G.1.%Self.as_type.loc13_14.1 (%Self.as_type.1) = value_param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref: %Simple.type = name_ref Self, @Simple.%Self [symbolic = %Self (constants.%Self.1)] -// CHECK:STDOUT: %Self.as_type.loc13_14.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc13_14.1 (constants.%Self.as_type.1)] -// CHECK:STDOUT: %.loc13: type = converted %Self.ref, %Self.as_type.loc13_14.2 [symbolic = %Self.as_type.loc13_14.1 (constants.%Self.as_type.1)] // CHECK:STDOUT: %self.param: @G.1.%Self.as_type.loc13_14.1 (%Self.as_type.1) = value_param runtime_param0 +// CHECK:STDOUT: %.loc13_14.2: type = splice_block %.loc13_14.1 [symbolic = %Self.as_type.loc13_14.1 (constants.%Self.as_type.1)] { +// CHECK:STDOUT: %Self.ref: %Simple.type = name_ref Self, @Simple.%Self [symbolic = %Self (constants.%Self.1)] +// CHECK:STDOUT: %Self.as_type.loc13_14.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc13_14.1 (constants.%Self.as_type.1)] +// CHECK:STDOUT: %.loc13_14.1: type = converted %Self.ref, %Self.as_type.loc13_14.2 [symbolic = %Self.as_type.loc13_14.1 (constants.%Self.as_type.1)] +// CHECK:STDOUT: } // CHECK:STDOUT: %self: @G.1.%Self.as_type.loc13_14.1 (%Self.as_type.1) = bind_name self, %self.param // CHECK:STDOUT: } // CHECK:STDOUT: %assoc1: %G.assoc_type = assoc_entity element1, %G.decl [template = constants.%assoc1] @@ -161,9 +171,11 @@ fn InstanceCallIndirect(p: i32*) { // CHECK:STDOUT: %self.patt: %i32 = binding_pattern self // CHECK:STDOUT: %self.param_patt: %i32 = value_param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %self.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc18: type = splice_block %i32 [template = constants.%i32] { +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %self: %i32 = bind_name self, %self.param // CHECK:STDOUT: } // CHECK:STDOUT: %interface: = interface_witness (%F.decl, %G.decl) [template = constants.%interface.1] diff --git a/toolchain/check/testdata/impl/extend_impl.carbon b/toolchain/check/testdata/impl/extend_impl.carbon index e7d9e6834bdc0..35dd68abf52ad 100644 --- a/toolchain/check/testdata/impl/extend_impl.carbon +++ b/toolchain/check/testdata/impl/extend_impl.carbon @@ -65,8 +65,8 @@ fn G(c: C) { // CHECK:STDOUT: %c.patt: %C = binding_pattern c // CHECK:STDOUT: %c.param_patt: %C = value_param_pattern %c.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref.loc21: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %c.param: %C = value_param runtime_param0 +// CHECK:STDOUT: %C.ref.loc21: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %c: %C = bind_name c, %c.param // CHECK:STDOUT: } // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/impl/extend_impl_generic.carbon b/toolchain/check/testdata/impl/extend_impl_generic.carbon index a51b6d2a9e6e0..ad5b63dff11f0 100644 --- a/toolchain/check/testdata/impl/extend_impl_generic.carbon +++ b/toolchain/check/testdata/impl/extend_impl_generic.carbon @@ -123,8 +123,8 @@ class X(U:! type) { // CHECK:STDOUT: %c.patt: %C = binding_pattern c // CHECK:STDOUT: %c.param_patt: %C = value_param_pattern %c.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref.loc20: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %c.param: %C = value_param runtime_param0 +// CHECK:STDOUT: %C.ref.loc20: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %c: %C = bind_name c, %c.param // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -177,8 +177,6 @@ class X(U:! type) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Param { -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc9: %Param.elem = field_decl x, element0 [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.x.1 [template = constants.%complete_type.3] // CHECK:STDOUT: @@ -227,8 +225,6 @@ class X(U:! type) { // CHECK:STDOUT: // CHECK:STDOUT: fn @G(%c.param_patt: %C) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int_32.loc21: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc21: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %C.ref.loc21: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %.loc21_17: %F.assoc_type.2 = specific_constant @HasF.%assoc0.loc5_14.1, @HasF(constants.%Param) [template = constants.%assoc0.2] // CHECK:STDOUT: %F.ref.loc21: %F.assoc_type.2 = name_ref F, %.loc21_17 [template = constants.%assoc0.2] @@ -240,8 +236,6 @@ class X(U:! type) { // CHECK:STDOUT: %.loc21_21.1: ref %i32 = class_element_access %.loc21_20.2, element0 // CHECK:STDOUT: %.loc21_21.2: %i32 = bind_value %.loc21_21.1 // CHECK:STDOUT: %a: %i32 = bind_name a, %.loc21_21.2 -// CHECK:STDOUT: %int_32.loc22: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %b.var: ref %i32 = var b // CHECK:STDOUT: %b: ref %i32 = bind_name b, %b.var // CHECK:STDOUT: %c.ref: %C = name_ref c, %c @@ -371,14 +365,16 @@ class X(U:! type) { // CHECK:STDOUT: %t.patt: @F.1.%T (%T) = binding_pattern t // CHECK:STDOUT: %t.param_patt: @F.1.%T (%T) = value_param_pattern %t.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc5_14.1: @F.1.%I.type (%I.type.2) = specific_constant @I.%Self.1, @I(constants.%T) [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %Self.ref: @F.1.%I.type (%I.type.2) = name_ref Self, %.loc5_14.1 [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %Self.as_type.loc5_14.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type)] -// CHECK:STDOUT: %.loc5_14.2: type = converted %Self.ref, %Self.as_type.loc5_14.2 [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type)] -// CHECK:STDOUT: %T.ref: type = name_ref T, @I.%T.loc4_13.1 [symbolic = %T (constants.%T)] // CHECK:STDOUT: %self.param: @F.1.%Self.as_type.loc5_14.1 (%Self.as_type) = value_param runtime_param0 +// CHECK:STDOUT: %.loc5_14.3: type = splice_block %.loc5_14.2 [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type)] { +// CHECK:STDOUT: %.loc5_14.1: @F.1.%I.type (%I.type.2) = specific_constant @I.%Self.1, @I(constants.%T) [symbolic = %Self (constants.%Self)] +// CHECK:STDOUT: %Self.ref: @F.1.%I.type (%I.type.2) = name_ref Self, %.loc5_14.1 [symbolic = %Self (constants.%Self)] +// CHECK:STDOUT: %Self.as_type.loc5_14.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %.loc5_14.2: type = converted %Self.ref, %Self.as_type.loc5_14.2 [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type)] +// CHECK:STDOUT: } // CHECK:STDOUT: %self: @F.1.%Self.as_type.loc5_14.1 (%Self.as_type) = bind_name self, %self.param // CHECK:STDOUT: %t.param: @F.1.%T (%T) = value_param runtime_param1 +// CHECK:STDOUT: %T.ref: type = name_ref T, @I.%T.loc4_13.1 [symbolic = %T (constants.%T)] // CHECK:STDOUT: %t: @F.1.%T (%T) = bind_name t, %t.param // CHECK:STDOUT: } // CHECK:STDOUT: %assoc0.loc5_25.1: @I.%F.assoc_type (%F.assoc_type.1) = assoc_entity element0, %F.decl [symbolic = %assoc0.loc5_25.2 (constants.%assoc0.1)] @@ -408,12 +404,14 @@ class X(U:! type) { // CHECK:STDOUT: %t.patt: @F.2.%U (%U) = binding_pattern t // CHECK:STDOUT: %t.param_patt: @F.2.%U (%U) = value_param_pattern %t.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc10: type = specific_constant constants.%X, @X(constants.%U) [symbolic = %X (constants.%X)] -// CHECK:STDOUT: %Self.ref: type = name_ref Self, %.loc10 [symbolic = %X (constants.%X)] -// CHECK:STDOUT: %U.ref: type = name_ref U, @X.%U.loc8_9.1 [symbolic = %U (constants.%U)] // CHECK:STDOUT: %self.param: @F.2.%X (%X) = value_param runtime_param0 +// CHECK:STDOUT: %.loc10_16.2: type = splice_block %Self.ref [symbolic = %X (constants.%X)] { +// CHECK:STDOUT: %.loc10_16.1: type = specific_constant constants.%X, @X(constants.%U) [symbolic = %X (constants.%X)] +// CHECK:STDOUT: %Self.ref: type = name_ref Self, %.loc10_16.1 [symbolic = %X (constants.%X)] +// CHECK:STDOUT: } // CHECK:STDOUT: %self: @F.2.%X (%X) = bind_name self, %self.param // CHECK:STDOUT: %t.param: @F.2.%U (%U) = value_param runtime_param1 +// CHECK:STDOUT: %U.ref: type = name_ref U, @X.%U.loc8_9.1 [symbolic = %U (constants.%U)] // CHECK:STDOUT: %t: @F.2.%U (%U) = bind_name t, %t.param // CHECK:STDOUT: } // CHECK:STDOUT: %interface.loc9_23.1: = interface_witness (%F.decl) [symbolic = %interface.loc9_23.2 (constants.%interface)] diff --git a/toolchain/check/testdata/impl/fail_call_invalid.carbon b/toolchain/check/testdata/impl/fail_call_invalid.carbon index c145cada11d07..bae7d9fe74da1 100644 --- a/toolchain/check/testdata/impl/fail_call_invalid.carbon +++ b/toolchain/check/testdata/impl/fail_call_invalid.carbon @@ -67,9 +67,11 @@ fn InstanceCall(n: i32) { // CHECK:STDOUT: %n.patt: %i32 = binding_pattern n // CHECK:STDOUT: %n.param_patt: %i32 = value_param_pattern %n.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %n.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc22: type = splice_block %i32 [template = constants.%i32] { +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %n: %i32 = bind_name n, %n.param // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -80,10 +82,12 @@ fn InstanceCall(n: i32) { // CHECK:STDOUT: %self.patt: @G.1.%Self.as_type.loc12_14.1 (%Self.as_type.1) = binding_pattern self // CHECK:STDOUT: %self.param_patt: @G.1.%Self.as_type.loc12_14.1 (%Self.as_type.1) = value_param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref: %Simple.type = name_ref Self, @Simple.%Self [symbolic = %Self (constants.%Self.1)] -// CHECK:STDOUT: %Self.as_type.loc12_14.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc12_14.1 (constants.%Self.as_type.1)] -// CHECK:STDOUT: %.loc12: type = converted %Self.ref, %Self.as_type.loc12_14.2 [symbolic = %Self.as_type.loc12_14.1 (constants.%Self.as_type.1)] // CHECK:STDOUT: %self.param: @G.1.%Self.as_type.loc12_14.1 (%Self.as_type.1) = value_param runtime_param0 +// CHECK:STDOUT: %.loc12_14.2: type = splice_block %.loc12_14.1 [symbolic = %Self.as_type.loc12_14.1 (constants.%Self.as_type.1)] { +// CHECK:STDOUT: %Self.ref: %Simple.type = name_ref Self, @Simple.%Self [symbolic = %Self (constants.%Self.1)] +// CHECK:STDOUT: %Self.as_type.loc12_14.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc12_14.1 (constants.%Self.as_type.1)] +// CHECK:STDOUT: %.loc12_14.1: type = converted %Self.ref, %Self.as_type.loc12_14.2 [symbolic = %Self.as_type.loc12_14.1 (constants.%Self.as_type.1)] +// CHECK:STDOUT: } // CHECK:STDOUT: %self: @G.1.%Self.as_type.loc12_14.1 (%Self.as_type.1) = bind_name self, %self.param // CHECK:STDOUT: } // CHECK:STDOUT: %assoc0: %G.assoc_type = assoc_entity element0, %G.decl [template = constants.%assoc0.1] @@ -99,8 +103,8 @@ fn InstanceCall(n: i32) { // CHECK:STDOUT: %self.patt: = binding_pattern self // CHECK:STDOUT: %self.param_patt: = value_param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Undeclared.ref: = name_ref Undeclared, [template = ] // CHECK:STDOUT: %self.param: = value_param runtime_param0 +// CHECK:STDOUT: %Undeclared.ref: = name_ref Undeclared, [template = ] // CHECK:STDOUT: %self: = bind_name self, %self.param // CHECK:STDOUT: } // CHECK:STDOUT: %interface: = interface_witness () [template = ] diff --git a/toolchain/check/testdata/impl/fail_extend_impl_forall.carbon b/toolchain/check/testdata/impl/fail_extend_impl_forall.carbon index 3834a64ceba6d..bfd1018450ce0 100644 --- a/toolchain/check/testdata/impl/fail_extend_impl_forall.carbon +++ b/toolchain/check/testdata/impl/fail_extend_impl_forall.carbon @@ -87,8 +87,8 @@ class C { // CHECK:STDOUT: %x.patt: @F.1.%T (%T) = binding_pattern x // CHECK:STDOUT: %x.param_patt: @F.1.%T (%T) = value_param_pattern %x.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.ref: type = name_ref T, @GenericInterface.%T.loc11_28.1 [symbolic = %T (constants.%T)] // CHECK:STDOUT: %x.param: @F.1.%T (%T) = value_param runtime_param0 +// CHECK:STDOUT: %T.ref: type = name_ref T, @GenericInterface.%T.loc11_28.1 [symbolic = %T (constants.%T)] // CHECK:STDOUT: %x: @F.1.%T (%T) = bind_name x, %x.param // CHECK:STDOUT: } // CHECK:STDOUT: %assoc0.loc12_13.1: @GenericInterface.%F.assoc_type (%F.assoc_type) = assoc_entity element0, %F.decl [symbolic = %assoc0.loc12_13.2 (constants.%assoc0)] @@ -116,8 +116,8 @@ class C { // CHECK:STDOUT: %x.patt: @F.2.%T (%T) = binding_pattern x // CHECK:STDOUT: %x.param_patt: @F.2.%T (%T) = value_param_pattern %x.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.ref: type = name_ref T, @impl.%T.loc19_23.1 [symbolic = %T (constants.%T)] // CHECK:STDOUT: %x.param: @F.2.%T (%T) = value_param runtime_param0 +// CHECK:STDOUT: %T.ref: type = name_ref T, @impl.%T.loc19_23.1 [symbolic = %T (constants.%T)] // CHECK:STDOUT: %x: @F.2.%T (%T) = bind_name x, %x.param // CHECK:STDOUT: } // CHECK:STDOUT: %interface.loc19_56.1: = interface_witness (%F.decl) [symbolic = %interface.loc19_56.2 (constants.%interface)] diff --git a/toolchain/check/testdata/impl/fail_extend_undefined_interface.carbon b/toolchain/check/testdata/impl/fail_extend_undefined_interface.carbon index b316c14142a51..1eb3a0f3b2d18 100644 --- a/toolchain/check/testdata/impl/fail_extend_undefined_interface.carbon +++ b/toolchain/check/testdata/impl/fail_extend_undefined_interface.carbon @@ -77,8 +77,8 @@ fn F(c: C) { // CHECK:STDOUT: %c.patt: %C = binding_pattern c // CHECK:STDOUT: %c.param_patt: %C = value_param_pattern %c.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref.loc24: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %c.param: %C = value_param runtime_param0 +// CHECK:STDOUT: %C.ref.loc24: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %c: %C = bind_name c, %c.param // CHECK:STDOUT: } // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/impl/fail_impl_bad_assoc_fn.carbon b/toolchain/check/testdata/impl/fail_impl_bad_assoc_fn.carbon index 642aa9c32ebab..e62f132969b54 100644 --- a/toolchain/check/testdata/impl/fail_impl_bad_assoc_fn.carbon +++ b/toolchain/check/testdata/impl/fail_impl_bad_assoc_fn.carbon @@ -388,18 +388,22 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %return.patt: bool = return_slot_pattern // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %bool.make_type.loc93_26: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc93_26.1: type = value_of_initializer %bool.make_type.loc93_26 [template = bool] -// CHECK:STDOUT: %.loc93_26.2: type = converted %bool.make_type.loc93_26, %.loc93_26.1 [template = bool] -// CHECK:STDOUT: %bool.make_type.loc93_35: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc93_35.1: type = value_of_initializer %bool.make_type.loc93_35 [template = bool] -// CHECK:STDOUT: %.loc93_35.2: type = converted %bool.make_type.loc93_35, %.loc93_35.1 [template = bool] // CHECK:STDOUT: %bool.make_type.loc93_44: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc93_44.1: type = value_of_initializer %bool.make_type.loc93_44 [template = bool] // CHECK:STDOUT: %.loc93_44.2: type = converted %bool.make_type.loc93_44, %.loc93_44.1 [template = bool] // CHECK:STDOUT: %self.param: bool = value_param runtime_param0 +// CHECK:STDOUT: %.loc93_26.3: type = splice_block %.loc93_26.2 [template = bool] { +// CHECK:STDOUT: %bool.make_type.loc93_26: init type = call constants.%Bool() [template = bool] +// CHECK:STDOUT: %.loc93_26.1: type = value_of_initializer %bool.make_type.loc93_26 [template = bool] +// CHECK:STDOUT: %.loc93_26.2: type = converted %bool.make_type.loc93_26, %.loc93_26.1 [template = bool] +// CHECK:STDOUT: } // CHECK:STDOUT: %self: bool = bind_name self, %self.param // CHECK:STDOUT: %b.param: bool = value_param runtime_param1 +// CHECK:STDOUT: %.loc93_35.3: type = splice_block %.loc93_35.2 [template = bool] { +// CHECK:STDOUT: %bool.make_type.loc93_35: init type = call constants.%Bool() [template = bool] +// CHECK:STDOUT: %.loc93_35.1: type = value_of_initializer %bool.make_type.loc93_35 [template = bool] +// CHECK:STDOUT: %.loc93_35.2: type = converted %bool.make_type.loc93_35, %.loc93_35.1 [template = bool] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: bool = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param @@ -420,24 +424,26 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %return.patt: @F.13.%array_type.loc188_52.1 (%array_type.1) = return_slot_pattern // CHECK:STDOUT: %return.param_patt: @F.13.%array_type.loc188_52.1 (%array_type.1) = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref.loc188_12: %SelfNested.type = name_ref Self, @SelfNested.%Self [symbolic = %Self (constants.%Self.3)] -// CHECK:STDOUT: %Self.as_type.loc188_16.2: type = facet_access_type %Self.ref.loc188_12 [symbolic = %Self.as_type.loc188_16.1 (constants.%Self.as_type)] -// CHECK:STDOUT: %.loc188_16: type = converted %Self.ref.loc188_12, %Self.as_type.loc188_16.2 [symbolic = %Self.as_type.loc188_16.1 (constants.%Self.as_type)] -// CHECK:STDOUT: %ptr.loc188_16.2: type = ptr_type %Self.as_type [symbolic = %ptr.loc188_16.1 (constants.%ptr.1)] -// CHECK:STDOUT: %Self.ref.loc188_24: %SelfNested.type = name_ref Self, @SelfNested.%Self [symbolic = %Self (constants.%Self.3)] -// CHECK:STDOUT: %Self.as_type.loc188_24: type = facet_access_type %Self.ref.loc188_24 [symbolic = %Self.as_type.loc188_16.1 (constants.%Self.as_type)] -// CHECK:STDOUT: %.loc188_24: type = converted %Self.ref.loc188_24, %Self.as_type.loc188_24 [symbolic = %Self.as_type.loc188_16.1 (constants.%Self.as_type)] -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %struct_type.x.y.loc188_37.2: type = struct_type {.x: %Self.as_type, .y: %i32} [symbolic = %struct_type.x.y.loc188_37.1 (constants.%struct_type.x.y.1)] -// CHECK:STDOUT: %.loc188_38.1: %tuple.type.1 = tuple_literal (%ptr.loc188_16.2, %struct_type.x.y.loc188_37.2) -// CHECK:STDOUT: %.loc188_38.2: type = converted %.loc188_38.1, constants.%tuple.type.2 [symbolic = %tuple.type (constants.%tuple.type.2)] // CHECK:STDOUT: %Self.ref.loc188_45: %SelfNested.type = name_ref Self, @SelfNested.%Self [symbolic = %Self (constants.%Self.3)] // CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [template = constants.%int_4] // CHECK:STDOUT: %Self.as_type.loc188_45: type = facet_access_type %Self.ref.loc188_45 [symbolic = %Self.as_type.loc188_16.1 (constants.%Self.as_type)] // CHECK:STDOUT: %.loc188_45: type = converted %Self.ref.loc188_45, %Self.as_type.loc188_45 [symbolic = %Self.as_type.loc188_16.1 (constants.%Self.as_type)] // CHECK:STDOUT: %array_type.loc188_52.2: type = array_type %int_4, %Self.as_type [symbolic = %array_type.loc188_52.1 (constants.%array_type.1)] // CHECK:STDOUT: %x.param: @F.13.%tuple.type (%tuple.type.2) = value_param runtime_param0 +// CHECK:STDOUT: %.loc188_38.3: type = splice_block %.loc188_38.2 [symbolic = %tuple.type (constants.%tuple.type.2)] { +// CHECK:STDOUT: %Self.ref.loc188_12: %SelfNested.type = name_ref Self, @SelfNested.%Self [symbolic = %Self (constants.%Self.3)] +// CHECK:STDOUT: %Self.as_type.loc188_16.2: type = facet_access_type %Self.ref.loc188_12 [symbolic = %Self.as_type.loc188_16.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %.loc188_16: type = converted %Self.ref.loc188_12, %Self.as_type.loc188_16.2 [symbolic = %Self.as_type.loc188_16.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %ptr.loc188_16.2: type = ptr_type %Self.as_type [symbolic = %ptr.loc188_16.1 (constants.%ptr.1)] +// CHECK:STDOUT: %Self.ref.loc188_24: %SelfNested.type = name_ref Self, @SelfNested.%Self [symbolic = %Self (constants.%Self.3)] +// CHECK:STDOUT: %Self.as_type.loc188_24: type = facet_access_type %Self.ref.loc188_24 [symbolic = %Self.as_type.loc188_16.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %.loc188_24: type = converted %Self.ref.loc188_24, %Self.as_type.loc188_24 [symbolic = %Self.as_type.loc188_16.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %struct_type.x.y.loc188_37.2: type = struct_type {.x: %Self.as_type, .y: %i32} [symbolic = %struct_type.x.y.loc188_37.1 (constants.%struct_type.x.y.1)] +// CHECK:STDOUT: %.loc188_38.1: %tuple.type.1 = tuple_literal (%ptr.loc188_16.2, %struct_type.x.y.loc188_37.2) +// CHECK:STDOUT: %.loc188_38.2: type = converted %.loc188_38.1, constants.%tuple.type.2 [symbolic = %tuple.type (constants.%tuple.type.2)] +// CHECK:STDOUT: } // CHECK:STDOUT: %x: @F.13.%tuple.type (%tuple.type.2) = bind_name x, %x.param // CHECK:STDOUT: %return.param: ref @F.13.%array_type.loc188_52.1 (%array_type.1) = out_param runtime_param1 // CHECK:STDOUT: %return: ref @F.13.%array_type.loc188_52.1 (%array_type.1) = return_slot %return.param @@ -481,10 +487,12 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %b.patt: bool = binding_pattern b // CHECK:STDOUT: %b.param_patt: bool = value_param_pattern %b.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc62_13.1: type = value_of_initializer %bool.make_type [template = bool] -// CHECK:STDOUT: %.loc62_13.2: type = converted %bool.make_type, %.loc62_13.1 [template = bool] // CHECK:STDOUT: %b.param: bool = value_param runtime_param0 +// CHECK:STDOUT: %.loc62_13.3: type = splice_block %.loc62_13.2 [template = bool] { +// CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] +// CHECK:STDOUT: %.loc62_13.1: type = value_of_initializer %bool.make_type [template = bool] +// CHECK:STDOUT: %.loc62_13.2: type = converted %bool.make_type, %.loc62_13.1 [template = bool] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: bool = bind_name b, %b.param // CHECK:STDOUT: } // CHECK:STDOUT: %interface: = interface_witness () [template = ] @@ -499,8 +507,8 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %self.patt: %FExtraImplicitParam = binding_pattern self // CHECK:STDOUT: %self.param_patt: %FExtraImplicitParam = value_param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%FExtraImplicitParam [template = constants.%FExtraImplicitParam] // CHECK:STDOUT: %self.param: %FExtraImplicitParam = value_param runtime_param0 +// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%FExtraImplicitParam [template = constants.%FExtraImplicitParam] // CHECK:STDOUT: %self: %FExtraImplicitParam = bind_name self, %self.param // CHECK:STDOUT: } // CHECK:STDOUT: %interface: = interface_witness () [template = ] @@ -535,13 +543,15 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %return.patt: bool = return_slot_pattern // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %bool.make_type.loc104_16: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc104_16.1: type = value_of_initializer %bool.make_type.loc104_16 [template = bool] -// CHECK:STDOUT: %.loc104_16.2: type = converted %bool.make_type.loc104_16, %.loc104_16.1 [template = bool] // CHECK:STDOUT: %bool.make_type.loc104_27: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc104_27.1: type = value_of_initializer %bool.make_type.loc104_27 [template = bool] // CHECK:STDOUT: %.loc104_27.2: type = converted %bool.make_type.loc104_27, %.loc104_27.1 [template = bool] // CHECK:STDOUT: %self.param: bool = value_param runtime_param0 +// CHECK:STDOUT: %.loc104_16.3: type = splice_block %.loc104_16.2 [template = bool] { +// CHECK:STDOUT: %bool.make_type.loc104_16: init type = call constants.%Bool() [template = bool] +// CHECK:STDOUT: %.loc104_16.1: type = value_of_initializer %bool.make_type.loc104_16 [template = bool] +// CHECK:STDOUT: %.loc104_16.2: type = converted %bool.make_type.loc104_16, %.loc104_16.1 [template = bool] +// CHECK:STDOUT: } // CHECK:STDOUT: %self: bool = bind_name self, %self.param // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param1 // CHECK:STDOUT: %return: ref bool = return_slot %return.param @@ -560,13 +570,15 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %return.patt: bool = return_slot_pattern // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %bool.make_type.loc117_13: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc117_13.1: type = value_of_initializer %bool.make_type.loc117_13 [template = bool] -// CHECK:STDOUT: %.loc117_13.2: type = converted %bool.make_type.loc117_13, %.loc117_13.1 [template = bool] // CHECK:STDOUT: %bool.make_type.loc117_22: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc117_22.1: type = value_of_initializer %bool.make_type.loc117_22 [template = bool] // CHECK:STDOUT: %.loc117_22.2: type = converted %bool.make_type.loc117_22, %.loc117_22.1 [template = bool] // CHECK:STDOUT: %b.param: bool = value_param runtime_param0 +// CHECK:STDOUT: %.loc117_13.3: type = splice_block %.loc117_13.2 [template = bool] { +// CHECK:STDOUT: %bool.make_type.loc117_13: init type = call constants.%Bool() [template = bool] +// CHECK:STDOUT: %.loc117_13.1: type = value_of_initializer %bool.make_type.loc117_13 [template = bool] +// CHECK:STDOUT: %.loc117_13.2: type = converted %bool.make_type.loc117_13, %.loc117_13.1 [template = bool] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: bool = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param1 // CHECK:STDOUT: %return: ref bool = return_slot %return.param @@ -585,15 +597,19 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %b.patt: bool = binding_pattern b // CHECK:STDOUT: %b.param_patt: bool = value_param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %bool.make_type.loc130_16: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc130_16.1: type = value_of_initializer %bool.make_type.loc130_16 [template = bool] -// CHECK:STDOUT: %.loc130_16.2: type = converted %bool.make_type.loc130_16, %.loc130_16.1 [template = bool] -// CHECK:STDOUT: %bool.make_type.loc130_25: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc130_25.1: type = value_of_initializer %bool.make_type.loc130_25 [template = bool] -// CHECK:STDOUT: %.loc130_25.2: type = converted %bool.make_type.loc130_25, %.loc130_25.1 [template = bool] // CHECK:STDOUT: %self.param: bool = value_param runtime_param0 +// CHECK:STDOUT: %.loc130_16.3: type = splice_block %.loc130_16.2 [template = bool] { +// CHECK:STDOUT: %bool.make_type.loc130_16: init type = call constants.%Bool() [template = bool] +// CHECK:STDOUT: %.loc130_16.1: type = value_of_initializer %bool.make_type.loc130_16 [template = bool] +// CHECK:STDOUT: %.loc130_16.2: type = converted %bool.make_type.loc130_16, %.loc130_16.1 [template = bool] +// CHECK:STDOUT: } // CHECK:STDOUT: %self: bool = bind_name self, %self.param // CHECK:STDOUT: %b.param: bool = value_param runtime_param1 +// CHECK:STDOUT: %.loc130_25.3: type = splice_block %.loc130_25.2 [template = bool] { +// CHECK:STDOUT: %bool.make_type.loc130_25: init type = call constants.%Bool() [template = bool] +// CHECK:STDOUT: %.loc130_25.1: type = value_of_initializer %bool.make_type.loc130_25 [template = bool] +// CHECK:STDOUT: %.loc130_25.2: type = converted %bool.make_type.loc130_25, %.loc130_25.1 [template = bool] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: bool = bind_name b, %b.param // CHECK:STDOUT: } // CHECK:STDOUT: %interface: = interface_witness () [template = ] @@ -612,16 +628,18 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %return.patt: bool = return_slot_pattern // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %bool.make_type.loc143_16: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc143_16.1: type = value_of_initializer %bool.make_type.loc143_16 [template = bool] -// CHECK:STDOUT: %.loc143_16.2: type = converted %bool.make_type.loc143_16, %.loc143_16.1 [template = bool] -// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%FDifferentParamType [template = constants.%FDifferentParamType] // CHECK:STDOUT: %bool.make_type.loc143_34: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc143_34.1: type = value_of_initializer %bool.make_type.loc143_34 [template = bool] // CHECK:STDOUT: %.loc143_34.2: type = converted %bool.make_type.loc143_34, %.loc143_34.1 [template = bool] // CHECK:STDOUT: %self.param: bool = value_param runtime_param0 +// CHECK:STDOUT: %.loc143_16.3: type = splice_block %.loc143_16.2 [template = bool] { +// CHECK:STDOUT: %bool.make_type.loc143_16: init type = call constants.%Bool() [template = bool] +// CHECK:STDOUT: %.loc143_16.1: type = value_of_initializer %bool.make_type.loc143_16 [template = bool] +// CHECK:STDOUT: %.loc143_16.2: type = converted %bool.make_type.loc143_16, %.loc143_16.1 [template = bool] +// CHECK:STDOUT: } // CHECK:STDOUT: %self: bool = bind_name self, %self.param // CHECK:STDOUT: %b.param: %FDifferentParamType = value_param runtime_param1 +// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%FDifferentParamType [template = constants.%FDifferentParamType] // CHECK:STDOUT: %b: %FDifferentParamType = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param @@ -642,16 +660,18 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %return.patt: bool = return_slot_pattern // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%FDifferentImplicitParamType [template = constants.%FDifferentImplicitParamType] -// CHECK:STDOUT: %bool.make_type.loc156_25: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc156_25.1: type = value_of_initializer %bool.make_type.loc156_25 [template = bool] -// CHECK:STDOUT: %.loc156_25.2: type = converted %bool.make_type.loc156_25, %.loc156_25.1 [template = bool] // CHECK:STDOUT: %bool.make_type.loc156_34: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc156_34.1: type = value_of_initializer %bool.make_type.loc156_34 [template = bool] // CHECK:STDOUT: %.loc156_34.2: type = converted %bool.make_type.loc156_34, %.loc156_34.1 [template = bool] // CHECK:STDOUT: %self.param: %FDifferentImplicitParamType = value_param runtime_param0 +// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%FDifferentImplicitParamType [template = constants.%FDifferentImplicitParamType] // CHECK:STDOUT: %self: %FDifferentImplicitParamType = bind_name self, %self.param // CHECK:STDOUT: %b.param: bool = value_param runtime_param1 +// CHECK:STDOUT: %.loc156_25.3: type = splice_block %.loc156_25.2 [template = bool] { +// CHECK:STDOUT: %bool.make_type.loc156_25: init type = call constants.%Bool() [template = bool] +// CHECK:STDOUT: %.loc156_25.1: type = value_of_initializer %bool.make_type.loc156_25 [template = bool] +// CHECK:STDOUT: %.loc156_25.2: type = converted %bool.make_type.loc156_25, %.loc156_25.1 [template = bool] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: bool = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param @@ -672,16 +692,20 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %return.patt: %FDifferentReturnType = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %FDifferentReturnType = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %bool.make_type.loc169_16: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc169_16.1: type = value_of_initializer %bool.make_type.loc169_16 [template = bool] -// CHECK:STDOUT: %.loc169_16.2: type = converted %bool.make_type.loc169_16, %.loc169_16.1 [template = bool] -// CHECK:STDOUT: %bool.make_type.loc169_25: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc169_25.1: type = value_of_initializer %bool.make_type.loc169_25 [template = bool] -// CHECK:STDOUT: %.loc169_25.2: type = converted %bool.make_type.loc169_25, %.loc169_25.1 [template = bool] // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%FDifferentReturnType [template = constants.%FDifferentReturnType] // CHECK:STDOUT: %self.param: bool = value_param runtime_param0 +// CHECK:STDOUT: %.loc169_16.3: type = splice_block %.loc169_16.2 [template = bool] { +// CHECK:STDOUT: %bool.make_type.loc169_16: init type = call constants.%Bool() [template = bool] +// CHECK:STDOUT: %.loc169_16.1: type = value_of_initializer %bool.make_type.loc169_16 [template = bool] +// CHECK:STDOUT: %.loc169_16.2: type = converted %bool.make_type.loc169_16, %.loc169_16.1 [template = bool] +// CHECK:STDOUT: } // CHECK:STDOUT: %self: bool = bind_name self, %self.param // CHECK:STDOUT: %b.param: bool = value_param runtime_param1 +// CHECK:STDOUT: %.loc169_25.3: type = splice_block %.loc169_25.2 [template = bool] { +// CHECK:STDOUT: %bool.make_type.loc169_25: init type = call constants.%Bool() [template = bool] +// CHECK:STDOUT: %.loc169_25.1: type = value_of_initializer %bool.make_type.loc169_25 [template = bool] +// CHECK:STDOUT: %.loc169_25.2: type = converted %bool.make_type.loc169_25, %.loc169_25.1 [template = bool] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: bool = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref %FDifferentReturnType = out_param runtime_param2 // CHECK:STDOUT: %return: ref %FDifferentReturnType = return_slot %return.param @@ -702,18 +726,22 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %return.patt: bool = return_slot_pattern // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %bool.make_type.loc183_16: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc183_16.1: type = value_of_initializer %bool.make_type.loc183_16 [template = bool] -// CHECK:STDOUT: %.loc183_16.2: type = converted %bool.make_type.loc183_16, %.loc183_16.1 [template = bool] -// CHECK:STDOUT: %bool.make_type.loc183_29: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc183_29.1: type = value_of_initializer %bool.make_type.loc183_29 [template = bool] -// CHECK:STDOUT: %.loc183_29.2: type = converted %bool.make_type.loc183_29, %.loc183_29.1 [template = bool] // CHECK:STDOUT: %bool.make_type.loc183_38: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc183_38.1: type = value_of_initializer %bool.make_type.loc183_38 [template = bool] // CHECK:STDOUT: %.loc183_38.2: type = converted %bool.make_type.loc183_38, %.loc183_38.1 [template = bool] // CHECK:STDOUT: %self.param: bool = value_param runtime_param0 +// CHECK:STDOUT: %.loc183_16.3: type = splice_block %.loc183_16.2 [template = bool] { +// CHECK:STDOUT: %bool.make_type.loc183_16: init type = call constants.%Bool() [template = bool] +// CHECK:STDOUT: %.loc183_16.1: type = value_of_initializer %bool.make_type.loc183_16 [template = bool] +// CHECK:STDOUT: %.loc183_16.2: type = converted %bool.make_type.loc183_16, %.loc183_16.1 [template = bool] +// CHECK:STDOUT: } // CHECK:STDOUT: %self: bool = bind_name self, %self.param // CHECK:STDOUT: %not_b.param: bool = value_param runtime_param1 +// CHECK:STDOUT: %.loc183_29.3: type = splice_block %.loc183_29.2 [template = bool] { +// CHECK:STDOUT: %bool.make_type.loc183_29: init type = call constants.%Bool() [template = bool] +// CHECK:STDOUT: %.loc183_29.1: type = value_of_initializer %bool.make_type.loc183_29 [template = bool] +// CHECK:STDOUT: %.loc183_29.2: type = converted %bool.make_type.loc183_29, %.loc183_29.1 [template = bool] +// CHECK:STDOUT: } // CHECK:STDOUT: %not_b: bool = bind_name not_b, %not_b.param // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param @@ -732,19 +760,21 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %return.patt: %array_type.2 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %array_type.2 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %SelfNestedBadParam.ref.loc200_14: type = name_ref SelfNestedBadParam, file.%SelfNestedBadParam.decl [template = constants.%SelfNestedBadParam] -// CHECK:STDOUT: %ptr: type = ptr_type %SelfNestedBadParam [template = constants.%ptr.2] -// CHECK:STDOUT: %int_32.loc200_40: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc200_40: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc200_49: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc200_49: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %struct_type.x.y: type = struct_type {.x: %i32, .y: %i32} [template = constants.%struct_type.x.y.2] -// CHECK:STDOUT: %.loc200_53.1: %tuple.type.1 = tuple_literal (%ptr, %struct_type.x.y) -// CHECK:STDOUT: %.loc200_53.2: type = converted %.loc200_53.1, constants.%tuple.type.3 [template = constants.%tuple.type.3] // CHECK:STDOUT: %SelfNestedBadParam.ref.loc200_60: type = name_ref SelfNestedBadParam, file.%SelfNestedBadParam.decl [template = constants.%SelfNestedBadParam] // CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [template = constants.%int_4] // CHECK:STDOUT: %array_type: type = array_type %int_4, %SelfNestedBadParam [template = constants.%array_type.2] // CHECK:STDOUT: %x.param: %tuple.type.3 = value_param runtime_param0 +// CHECK:STDOUT: %.loc200_53.3: type = splice_block %.loc200_53.2 [template = constants.%tuple.type.3] { +// CHECK:STDOUT: %SelfNestedBadParam.ref.loc200_14: type = name_ref SelfNestedBadParam, file.%SelfNestedBadParam.decl [template = constants.%SelfNestedBadParam] +// CHECK:STDOUT: %ptr: type = ptr_type %SelfNestedBadParam [template = constants.%ptr.2] +// CHECK:STDOUT: %int_32.loc200_40: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc200_40: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %int_32.loc200_49: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc200_49: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %struct_type.x.y: type = struct_type {.x: %i32, .y: %i32} [template = constants.%struct_type.x.y.2] +// CHECK:STDOUT: %.loc200_53.1: %tuple.type.1 = tuple_literal (%ptr, %struct_type.x.y) +// CHECK:STDOUT: %.loc200_53.2: type = converted %.loc200_53.1, constants.%tuple.type.3 [template = constants.%tuple.type.3] +// CHECK:STDOUT: } // CHECK:STDOUT: %x: %tuple.type.3 = bind_name x, %x.param // CHECK:STDOUT: %return.param: ref %array_type.2 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %array_type.2 = return_slot %return.param @@ -763,18 +793,20 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %return.patt: %array_type.2 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %array_type.2 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %SelfNestedBadReturnType.ref.loc212_14: type = name_ref SelfNestedBadReturnType, file.%SelfNestedBadReturnType.decl [template = constants.%SelfNestedBadReturnType] -// CHECK:STDOUT: %ptr: type = ptr_type %SelfNestedBadReturnType [template = constants.%ptr.3] -// CHECK:STDOUT: %SelfNestedBadReturnType.ref.loc212_45: type = name_ref SelfNestedBadReturnType, file.%SelfNestedBadReturnType.decl [template = constants.%SelfNestedBadReturnType] -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %struct_type.x.y: type = struct_type {.x: %SelfNestedBadReturnType, .y: %i32} [template = constants.%struct_type.x.y.4] -// CHECK:STDOUT: %.loc212_78.1: %tuple.type.1 = tuple_literal (%ptr, %struct_type.x.y) -// CHECK:STDOUT: %.loc212_78.2: type = converted %.loc212_78.1, constants.%tuple.type.5 [template = constants.%tuple.type.5] // CHECK:STDOUT: %SelfNestedBadParam.ref: type = name_ref SelfNestedBadParam, file.%SelfNestedBadParam.decl [template = constants.%SelfNestedBadParam] // CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [template = constants.%int_4] // CHECK:STDOUT: %array_type: type = array_type %int_4, %SelfNestedBadParam [template = constants.%array_type.2] // CHECK:STDOUT: %x.param: %tuple.type.5 = value_param runtime_param0 +// CHECK:STDOUT: %.loc212_78.3: type = splice_block %.loc212_78.2 [template = constants.%tuple.type.5] { +// CHECK:STDOUT: %SelfNestedBadReturnType.ref.loc212_14: type = name_ref SelfNestedBadReturnType, file.%SelfNestedBadReturnType.decl [template = constants.%SelfNestedBadReturnType] +// CHECK:STDOUT: %ptr: type = ptr_type %SelfNestedBadReturnType [template = constants.%ptr.3] +// CHECK:STDOUT: %SelfNestedBadReturnType.ref.loc212_45: type = name_ref SelfNestedBadReturnType, file.%SelfNestedBadReturnType.decl [template = constants.%SelfNestedBadReturnType] +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %struct_type.x.y: type = struct_type {.x: %SelfNestedBadReturnType, .y: %i32} [template = constants.%struct_type.x.y.4] +// CHECK:STDOUT: %.loc212_78.1: %tuple.type.1 = tuple_literal (%ptr, %struct_type.x.y) +// CHECK:STDOUT: %.loc212_78.2: type = converted %.loc212_78.1, constants.%tuple.type.5 [template = constants.%tuple.type.5] +// CHECK:STDOUT: } // CHECK:STDOUT: %x: %tuple.type.5 = bind_name x, %x.param // CHECK:STDOUT: %return.param: ref %array_type.2 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %array_type.2 = return_slot %return.param diff --git a/toolchain/check/testdata/impl/fail_self_type_mismatch.carbon b/toolchain/check/testdata/impl/fail_self_type_mismatch.carbon index ea967547bed1a..f7321d9e6a467 100644 --- a/toolchain/check/testdata/impl/fail_self_type_mismatch.carbon +++ b/toolchain/check/testdata/impl/fail_self_type_mismatch.carbon @@ -73,10 +73,10 @@ impl i32 as I { // CHECK:STDOUT: %X.patt.loc11_19.1: @C.%T.loc11_9.2 (%T) = symbolic_binding_pattern X, 1 [symbolic = %X.patt.loc11_19.2 (constants.%X.patt)] // CHECK:STDOUT: %X.param_patt: @C.%T.loc11_9.2 (%T) = value_param_pattern %X.patt.loc11_19.1, runtime_param [symbolic = %X.patt.loc11_19.2 (constants.%X.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc11_9.1 [symbolic = %T.loc11_9.2 (constants.%T)] // CHECK:STDOUT: %T.param: type = value_param runtime_param // CHECK:STDOUT: %T.loc11_9.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc11_9.2 (constants.%T)] // CHECK:STDOUT: %X.param: @C.%T.loc11_9.2 (%T) = value_param runtime_param +// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc11_9.1 [symbolic = %T.loc11_9.2 (constants.%T)] // CHECK:STDOUT: %X.loc11_19.1: @C.%T.loc11_9.2 (%T) = bind_symbolic_name X, 1, %X.param [symbolic = %X.loc11_19.2 (constants.%X)] // CHECK:STDOUT: } // CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%I.type] {} {} @@ -93,10 +93,12 @@ impl i32 as I { // CHECK:STDOUT: %c.patt: @F.1.%C.loc14_17.1 (%C.2) = binding_pattern c // CHECK:STDOUT: %c.param_patt: @F.1.%C.loc14_17.1 (%C.2) = value_param_pattern %c.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [template = constants.%C.generic] -// CHECK:STDOUT: %Self.ref: %I.type = name_ref Self, @I.%Self [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %C.loc14_17.2: type = class_type @C, @C(constants.%I.type, constants.%Self) [symbolic = %C.loc14_17.1 (constants.%C.2)] // CHECK:STDOUT: %c.param: @F.1.%C.loc14_17.1 (%C.2) = value_param runtime_param0 +// CHECK:STDOUT: %.loc14: type = splice_block %C.loc14_17.2 [symbolic = %C.loc14_17.1 (constants.%C.2)] { +// CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [template = constants.%C.generic] +// CHECK:STDOUT: %Self.ref: %I.type = name_ref Self, @I.%Self [symbolic = %Self (constants.%Self)] +// CHECK:STDOUT: %C.loc14_17.2: type = class_type @C, @C(constants.%I.type, constants.%Self) [symbolic = %C.loc14_17.1 (constants.%C.2)] +// CHECK:STDOUT: } // CHECK:STDOUT: %c: @F.1.%C.loc14_17.1 (%C.2) = bind_name c, %c.param // CHECK:STDOUT: } // CHECK:STDOUT: %assoc0: %F.assoc_type = assoc_entity element0, %F.decl [template = constants.%assoc0] @@ -112,11 +114,13 @@ impl i32 as I { // CHECK:STDOUT: %c.patt: %C.3 = binding_pattern c // CHECK:STDOUT: %c.param_patt: %C.3 = value_param_pattern %c.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [template = constants.%C.generic] -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %C: type = class_type @C, @C(type, constants.%i32) [template = constants.%C.3] // CHECK:STDOUT: %c.param: %C.3 = value_param runtime_param0 +// CHECK:STDOUT: %.loc24: type = splice_block %C [template = constants.%C.3] { +// CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [template = constants.%C.generic] +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %C: type = class_type @C, @C(type, constants.%i32) [template = constants.%C.3] +// CHECK:STDOUT: } // CHECK:STDOUT: %c: %C.3 = bind_name c, %c.param // CHECK:STDOUT: } // CHECK:STDOUT: %interface: = interface_witness () [template = ] diff --git a/toolchain/check/testdata/impl/impl_as.carbon b/toolchain/check/testdata/impl/impl_as.carbon index 5b32ce087ff76..da8b9aadd91a2 100644 --- a/toolchain/check/testdata/impl/impl_as.carbon +++ b/toolchain/check/testdata/impl/impl_as.carbon @@ -97,7 +97,6 @@ class C { // CHECK:STDOUT: // CHECK:STDOUT: fn @F.2() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %c.var: ref %C = var c // CHECK:STDOUT: %c: ref %C = bind_name c, %c.var // CHECK:STDOUT: %.loc19_19.1: %empty_struct_type = struct_literal () diff --git a/toolchain/check/testdata/impl/lookup/alias.carbon b/toolchain/check/testdata/impl/lookup/alias.carbon index ac3586b59830e..a71fc77e050b0 100644 --- a/toolchain/check/testdata/impl/lookup/alias.carbon +++ b/toolchain/check/testdata/impl/lookup/alias.carbon @@ -71,8 +71,8 @@ fn G(c: C) { // CHECK:STDOUT: %c.patt: %C = binding_pattern c // CHECK:STDOUT: %c.param_patt: %C = value_param_pattern %c.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref.loc23: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %c.param: %C = value_param runtime_param0 +// CHECK:STDOUT: %C.ref.loc23: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %c: %C = bind_name c, %c.param // CHECK:STDOUT: } // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/impl/lookup/fail_alias_impl_not_found.carbon b/toolchain/check/testdata/impl/lookup/fail_alias_impl_not_found.carbon index d6622d412adec..ca3fe49f966ce 100644 --- a/toolchain/check/testdata/impl/lookup/fail_alias_impl_not_found.carbon +++ b/toolchain/check/testdata/impl/lookup/fail_alias_impl_not_found.carbon @@ -65,8 +65,8 @@ fn F(c: C) { // CHECK:STDOUT: %c.patt: %C = binding_pattern c // CHECK:STDOUT: %c.param_patt: %C = value_param_pattern %c.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref.loc19: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %c.param: %C = value_param runtime_param0 +// CHECK:STDOUT: %C.ref.loc19: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %c: %C = bind_name c, %c.param // CHECK:STDOUT: } // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/impl/lookup/generic.carbon b/toolchain/check/testdata/impl/lookup/generic.carbon index 782a372382d64..25893dc3b9dde 100644 --- a/toolchain/check/testdata/impl/lookup/generic.carbon +++ b/toolchain/check/testdata/impl/lookup/generic.carbon @@ -174,9 +174,11 @@ fn G(x: A) { // CHECK:STDOUT: %x.patt: %empty_struct_type = binding_pattern x // CHECK:STDOUT: %x.param_patt: %empty_struct_type = value_param_pattern %x.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc12_10.1: %empty_struct_type = struct_literal () -// CHECK:STDOUT: %.loc12_10.2: type = converted %.loc12_10.1, constants.%empty_struct_type [template = constants.%empty_struct_type] // CHECK:STDOUT: %x.param: %empty_struct_type = value_param runtime_param0 +// CHECK:STDOUT: %.loc12_10.3: type = splice_block %.loc12_10.2 [template = constants.%empty_struct_type] { +// CHECK:STDOUT: %.loc12_10.1: %empty_struct_type = struct_literal () +// CHECK:STDOUT: %.loc12_10.2: type = converted %.loc12_10.1, constants.%empty_struct_type [template = constants.%empty_struct_type] +// CHECK:STDOUT: } // CHECK:STDOUT: %x: %empty_struct_type = bind_name x, %x.param // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -325,11 +327,13 @@ fn G(x: A) { // CHECK:STDOUT: %return.patt: %empty_struct_type = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %empty_struct_type = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc12_10.1: %empty_struct_type = struct_literal () -// CHECK:STDOUT: %.loc12_10.2: type = converted %.loc12_10.1, constants.%empty_struct_type [template = constants.%empty_struct_type] // CHECK:STDOUT: %.loc12_17.1: %empty_struct_type = struct_literal () // CHECK:STDOUT: %.loc12_17.2: type = converted %.loc12_17.1, constants.%empty_struct_type [template = constants.%empty_struct_type] // CHECK:STDOUT: %x.param: %empty_struct_type = value_param runtime_param0 +// CHECK:STDOUT: %.loc12_10.3: type = splice_block %.loc12_10.2 [template = constants.%empty_struct_type] { +// CHECK:STDOUT: %.loc12_10.1: %empty_struct_type = struct_literal () +// CHECK:STDOUT: %.loc12_10.2: type = converted %.loc12_10.1, constants.%empty_struct_type [template = constants.%empty_struct_type] +// CHECK:STDOUT: } // CHECK:STDOUT: %x: %empty_struct_type = bind_name x, %x.param // CHECK:STDOUT: %return.param: ref %empty_struct_type = out_param runtime_param1 // CHECK:STDOUT: %return: ref %empty_struct_type = return_slot %return.param @@ -344,13 +348,15 @@ fn G(x: A) { // CHECK:STDOUT: %return.patt: @F.1.%Self.as_type.loc5_14.1 (%Self.as_type) = return_slot_pattern // CHECK:STDOUT: %return.param_patt: @F.1.%Self.as_type.loc5_14.1 (%Self.as_type) = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref.loc5_14: %HasF.type = name_ref Self, @HasF.%Self [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %Self.as_type.loc5_14.2: type = facet_access_type %Self.ref.loc5_14 [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type)] -// CHECK:STDOUT: %.loc5_14: type = converted %Self.ref.loc5_14, %Self.as_type.loc5_14.2 [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type)] // CHECK:STDOUT: %Self.ref.loc5_25: %HasF.type = name_ref Self, @HasF.%Self [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: %Self.as_type.loc5_25: type = facet_access_type %Self.ref.loc5_25 [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type)] // CHECK:STDOUT: %.loc5_25: type = converted %Self.ref.loc5_25, %Self.as_type.loc5_25 [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type)] // CHECK:STDOUT: %self.param: @F.1.%Self.as_type.loc5_14.1 (%Self.as_type) = value_param runtime_param0 +// CHECK:STDOUT: %.loc5_14.2: type = splice_block %.loc5_14.1 [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type)] { +// CHECK:STDOUT: %Self.ref.loc5_14: %HasF.type = name_ref Self, @HasF.%Self [symbolic = %Self (constants.%Self)] +// CHECK:STDOUT: %Self.as_type.loc5_14.2: type = facet_access_type %Self.ref.loc5_14 [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %.loc5_14.1: type = converted %Self.ref.loc5_14, %Self.as_type.loc5_14.2 [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type)] +// CHECK:STDOUT: } // CHECK:STDOUT: %self: @F.1.%Self.as_type.loc5_14.1 (%Self.as_type) = bind_name self, %self.param // CHECK:STDOUT: %return.param: ref @F.1.%Self.as_type.loc5_14.1 (%Self.as_type) = out_param runtime_param1 // CHECK:STDOUT: %return: ref @F.1.%Self.as_type.loc5_14.1 (%Self.as_type) = return_slot %return.param @@ -379,9 +385,9 @@ fn G(x: A) { // CHECK:STDOUT: %return.patt: @F.2.%T (%T) = return_slot_pattern // CHECK:STDOUT: %return.param_patt: @F.2.%T (%T) = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref: type = name_ref Self, @impl.%T.ref [symbolic = %T (constants.%T)] // CHECK:STDOUT: %T.ref: type = name_ref T, @impl.%T.loc8_14.1 [symbolic = %T (constants.%T)] // CHECK:STDOUT: %self.param: @F.2.%T (%T) = value_param runtime_param0 +// CHECK:STDOUT: %Self.ref: type = name_ref Self, @impl.%T.ref [symbolic = %T (constants.%T)] // CHECK:STDOUT: %self: @F.2.%T (%T) = bind_name self, %self.param // CHECK:STDOUT: %return.param: ref @F.2.%T (%T) = out_param runtime_param1 // CHECK:STDOUT: %return: ref @F.2.%T (%T) = return_slot %return.param @@ -541,11 +547,13 @@ fn G(x: A) { // CHECK:STDOUT: %x.patt: %C.2 = binding_pattern x // CHECK:STDOUT: %x.param_patt: %C.2 = value_param_pattern %x.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [template = constants.%C.generic] -// CHECK:STDOUT: %.loc14_12: %empty_struct_type = struct_literal () -// CHECK:STDOUT: %.loc14_13: type = converted %.loc14_12, constants.%empty_struct_type [template = constants.%empty_struct_type] -// CHECK:STDOUT: %C: type = class_type @C, @C(constants.%empty_struct_type) [template = constants.%C.2] // CHECK:STDOUT: %x.param: %C.2 = value_param runtime_param0 +// CHECK:STDOUT: %.loc14_13.2: type = splice_block %C [template = constants.%C.2] { +// CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [template = constants.%C.generic] +// CHECK:STDOUT: %.loc14_12: %empty_struct_type = struct_literal () +// CHECK:STDOUT: %.loc14_13.1: type = converted %.loc14_12, constants.%empty_struct_type [template = constants.%empty_struct_type] +// CHECK:STDOUT: %C: type = class_type @C, @C(constants.%empty_struct_type) [template = constants.%C.2] +// CHECK:STDOUT: } // CHECK:STDOUT: %x: %C.2 = bind_name x, %x.param // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -740,9 +748,11 @@ fn G(x: A) { // CHECK:STDOUT: %x.patt: %empty_struct_type = binding_pattern x // CHECK:STDOUT: %x.param_patt: %empty_struct_type = value_param_pattern %x.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc12_10.1: %empty_struct_type = struct_literal () -// CHECK:STDOUT: %.loc12_10.2: type = converted %.loc12_10.1, constants.%empty_struct_type [template = constants.%empty_struct_type] // CHECK:STDOUT: %x.param: %empty_struct_type = value_param runtime_param0 +// CHECK:STDOUT: %.loc12_10.3: type = splice_block %.loc12_10.2 [template = constants.%empty_struct_type] { +// CHECK:STDOUT: %.loc12_10.1: %empty_struct_type = struct_literal () +// CHECK:STDOUT: %.loc12_10.2: type = converted %.loc12_10.1, constants.%empty_struct_type [template = constants.%empty_struct_type] +// CHECK:STDOUT: } // CHECK:STDOUT: %x: %empty_struct_type = bind_name x, %x.param // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -941,9 +951,11 @@ fn G(x: A) { // CHECK:STDOUT: %x.patt: %empty_struct_type = binding_pattern x // CHECK:STDOUT: %x.param_patt: %empty_struct_type = value_param_pattern %x.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc13_10.1: %empty_struct_type = struct_literal () -// CHECK:STDOUT: %.loc13_10.2: type = converted %.loc13_10.1, constants.%empty_struct_type [template = constants.%empty_struct_type] // CHECK:STDOUT: %x.param: %empty_struct_type = value_param runtime_param0 +// CHECK:STDOUT: %.loc13_10.3: type = splice_block %.loc13_10.2 [template = constants.%empty_struct_type] { +// CHECK:STDOUT: %.loc13_10.1: %empty_struct_type = struct_literal () +// CHECK:STDOUT: %.loc13_10.2: type = converted %.loc13_10.1, constants.%empty_struct_type [template = constants.%empty_struct_type] +// CHECK:STDOUT: } // CHECK:STDOUT: %x: %empty_struct_type = bind_name x, %x.param // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -1093,8 +1105,8 @@ fn G(x: A) { // CHECK:STDOUT: %x.patt: %A = binding_pattern x // CHECK:STDOUT: %x.param_patt: %A = value_param_pattern %x.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%A] // CHECK:STDOUT: %x.param: %A = value_param runtime_param0 +// CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%A] // CHECK:STDOUT: %x: %A = bind_name x, %x.param // CHECK:STDOUT: } // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/impl/lookup/instance_method.carbon b/toolchain/check/testdata/impl/lookup/instance_method.carbon index 0bcaab9d74225..c8980db1643ec 100644 --- a/toolchain/check/testdata/impl/lookup/instance_method.carbon +++ b/toolchain/check/testdata/impl/lookup/instance_method.carbon @@ -72,10 +72,10 @@ fn F(c: C) -> i32 { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl.loc11 [template = constants.%C] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %c.param: %C = value_param runtime_param0 +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl.loc11 [template = constants.%C] // CHECK:STDOUT: %c: %C = bind_name c, %c.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -90,12 +90,14 @@ fn F(c: C) -> i32 { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref: %I.type = name_ref Self, @I.%Self [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %Self.as_type.loc14_14.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc14_14.1 (constants.%Self.as_type)] -// CHECK:STDOUT: %.loc14: type = converted %Self.ref, %Self.as_type.loc14_14.2 [symbolic = %Self.as_type.loc14_14.1 (constants.%Self.as_type)] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %self.param: @F.1.%Self.as_type.loc14_14.1 (%Self.as_type) = value_param runtime_param0 +// CHECK:STDOUT: %.loc14_14.2: type = splice_block %.loc14_14.1 [symbolic = %Self.as_type.loc14_14.1 (constants.%Self.as_type)] { +// CHECK:STDOUT: %Self.ref: %I.type = name_ref Self, @I.%Self [symbolic = %Self (constants.%Self)] +// CHECK:STDOUT: %Self.as_type.loc14_14.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc14_14.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %.loc14_14.1: type = converted %Self.ref, %Self.as_type.loc14_14.2 [symbolic = %Self.as_type.loc14_14.1 (constants.%Self.as_type)] +// CHECK:STDOUT: } // CHECK:STDOUT: %self: @F.1.%Self.as_type.loc14_14.1 (%Self.as_type) = bind_name self, %self.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -115,10 +117,10 @@ fn F(c: C) -> i32 { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C [template = constants.%C] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %self.param: %C = value_param runtime_param0 +// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C [template = constants.%C] // CHECK:STDOUT: %self: %C = bind_name self, %self.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param diff --git a/toolchain/check/testdata/impl/lookup/no_prelude/impl_forall.carbon b/toolchain/check/testdata/impl/lookup/no_prelude/impl_forall.carbon index 19e684cceacdc..c17a57d9e7f4e 100644 --- a/toolchain/check/testdata/impl/lookup/no_prelude/impl_forall.carbon +++ b/toolchain/check/testdata/impl/lookup/no_prelude/impl_forall.carbon @@ -154,13 +154,15 @@ fn TestSpecific(a: A({})) -> {} { // CHECK:STDOUT: %return.patt: @TestGeneric.%W.loc16_16.2 (%W) = return_slot_pattern // CHECK:STDOUT: %return.param_patt: @TestGeneric.%W.loc16_16.2 (%W) = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %A.ref: %A.type = name_ref A, file.%A.decl [template = constants.%A.generic] -// CHECK:STDOUT: %W.ref.loc16_31: type = name_ref W, %W.loc16_16.1 [symbolic = %W.loc16_16.2 (constants.%W)] -// CHECK:STDOUT: %A.loc16_32.1: type = class_type @A, @A(constants.%W) [symbolic = %A.loc16_32.2 (constants.%A.3)] // CHECK:STDOUT: %W.ref.loc16_38: type = name_ref W, %W.loc16_16.1 [symbolic = %W.loc16_16.2 (constants.%W)] // CHECK:STDOUT: %W.param: type = value_param runtime_param // CHECK:STDOUT: %W.loc16_16.1: type = bind_symbolic_name W, 0, %W.param [symbolic = %W.loc16_16.2 (constants.%W)] // CHECK:STDOUT: %a.param: @TestGeneric.%A.loc16_32.2 (%A.3) = value_param runtime_param0 +// CHECK:STDOUT: %.loc16: type = splice_block %A.loc16_32.1 [symbolic = %A.loc16_32.2 (constants.%A.3)] { +// CHECK:STDOUT: %A.ref: %A.type = name_ref A, file.%A.decl [template = constants.%A.generic] +// CHECK:STDOUT: %W.ref.loc16_31: type = name_ref W, %W.loc16_16.1 [symbolic = %W.loc16_16.2 (constants.%W)] +// CHECK:STDOUT: %A.loc16_32.1: type = class_type @A, @A(constants.%W) [symbolic = %A.loc16_32.2 (constants.%A.3)] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: @TestGeneric.%A.loc16_32.2 (%A.3) = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref @TestGeneric.%W.loc16_16.2 (%W) = out_param runtime_param1 // CHECK:STDOUT: %return: ref @TestGeneric.%W.loc16_16.2 (%W) = return_slot %return.param @@ -171,13 +173,15 @@ fn TestSpecific(a: A({})) -> {} { // CHECK:STDOUT: %return.patt: %empty_struct_type = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %empty_struct_type = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %A.ref: %A.type = name_ref A, file.%A.decl [template = constants.%A.generic] -// CHECK:STDOUT: %.loc20_23: %empty_struct_type = struct_literal () -// CHECK:STDOUT: %.loc20_24: type = converted %.loc20_23, constants.%empty_struct_type [template = constants.%empty_struct_type] -// CHECK:STDOUT: %A: type = class_type @A, @A(constants.%empty_struct_type) [template = constants.%A.4] // CHECK:STDOUT: %.loc20_31.1: %empty_struct_type = struct_literal () // CHECK:STDOUT: %.loc20_31.2: type = converted %.loc20_31.1, constants.%empty_struct_type [template = constants.%empty_struct_type] // CHECK:STDOUT: %a.param: %A.4 = value_param runtime_param0 +// CHECK:STDOUT: %.loc20_24.2: type = splice_block %A [template = constants.%A.4] { +// CHECK:STDOUT: %A.ref: %A.type = name_ref A, file.%A.decl [template = constants.%A.generic] +// CHECK:STDOUT: %.loc20_23: %empty_struct_type = struct_literal () +// CHECK:STDOUT: %.loc20_24.1: type = converted %.loc20_23, constants.%empty_struct_type [template = constants.%empty_struct_type] +// CHECK:STDOUT: %A: type = class_type @A, @A(constants.%empty_struct_type) [template = constants.%A.4] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %A.4 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %empty_struct_type = out_param runtime_param1 // CHECK:STDOUT: %return: ref %empty_struct_type = return_slot %return.param @@ -204,12 +208,14 @@ fn TestSpecific(a: A({})) -> {} { // CHECK:STDOUT: %return.patt: @F.1.%U (%U) = return_slot_pattern // CHECK:STDOUT: %return.param_patt: @F.1.%U (%U) = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc7_14.1: @F.1.%I.type (%I.type.2) = specific_constant @I.%Self.1, @I(constants.%U) [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %Self.ref: @F.1.%I.type (%I.type.2) = name_ref Self, %.loc7_14.1 [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %Self.as_type.loc7_14.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc7_14.1 (constants.%Self.as_type)] -// CHECK:STDOUT: %.loc7_14.2: type = converted %Self.ref, %Self.as_type.loc7_14.2 [symbolic = %Self.as_type.loc7_14.1 (constants.%Self.as_type)] // CHECK:STDOUT: %U.ref: type = name_ref U, @I.%U.loc6_13.1 [symbolic = %U (constants.%U)] // CHECK:STDOUT: %self.param: @F.1.%Self.as_type.loc7_14.1 (%Self.as_type) = value_param runtime_param0 +// CHECK:STDOUT: %.loc7_14.3: type = splice_block %.loc7_14.2 [symbolic = %Self.as_type.loc7_14.1 (constants.%Self.as_type)] { +// CHECK:STDOUT: %.loc7_14.1: @F.1.%I.type (%I.type.2) = specific_constant @I.%Self.1, @I(constants.%U) [symbolic = %Self (constants.%Self)] +// CHECK:STDOUT: %Self.ref: @F.1.%I.type (%I.type.2) = name_ref Self, %.loc7_14.1 [symbolic = %Self (constants.%Self)] +// CHECK:STDOUT: %Self.as_type.loc7_14.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc7_14.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %.loc7_14.2: type = converted %Self.ref, %Self.as_type.loc7_14.2 [symbolic = %Self.as_type.loc7_14.1 (constants.%Self.as_type)] +// CHECK:STDOUT: } // CHECK:STDOUT: %self: @F.1.%Self.as_type.loc7_14.1 (%Self.as_type) = bind_name self, %self.param // CHECK:STDOUT: %return.param: ref @F.1.%U (%U) = out_param runtime_param1 // CHECK:STDOUT: %return: ref @F.1.%U (%U) = return_slot %return.param @@ -242,9 +248,9 @@ fn TestSpecific(a: A({})) -> {} { // CHECK:STDOUT: %return.patt: @F.2.%V (%V) = return_slot_pattern // CHECK:STDOUT: %return.param_patt: @F.2.%V (%V) = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref: type = name_ref Self, @impl.%A.loc10_27.1 [symbolic = %A (constants.%A.2)] // CHECK:STDOUT: %V.ref: type = name_ref V, @impl.%V.loc10_14.1 [symbolic = %V (constants.%V)] // CHECK:STDOUT: %self.param: @F.2.%A (%A.2) = value_param runtime_param0 +// CHECK:STDOUT: %Self.ref: type = name_ref Self, @impl.%A.loc10_27.1 [symbolic = %A (constants.%A.2)] // CHECK:STDOUT: %self: @F.2.%A (%A.2) = bind_name self, %self.param // CHECK:STDOUT: %return.param: ref @F.2.%V (%V) = out_param runtime_param1 // CHECK:STDOUT: %return: ref @F.2.%V (%V) = return_slot %return.param @@ -269,7 +275,6 @@ fn TestSpecific(a: A({})) -> {} { // CHECK:STDOUT: %complete_type.loc4_1.2: = complete_type_witness @A.%struct_type.n (%struct_type.n.1) [symbolic = %complete_type.loc4_1.2 (constants.%complete_type.1)] // CHECK:STDOUT: // CHECK:STDOUT: class { -// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc2_9.1 [symbolic = %T.loc2_9.2 (constants.%T)] // CHECK:STDOUT: %.loc3: @A.%A.elem (%A.elem.1) = field_decl n, element0 [template] // CHECK:STDOUT: %complete_type.loc4_1.1: = complete_type_witness %struct_type.n.1 [symbolic = %complete_type.loc4_1.2 (constants.%complete_type.1)] // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/lookup/no_prelude/import.carbon b/toolchain/check/testdata/impl/lookup/no_prelude/import.carbon index 2c734473f7afa..b748b2d67b941 100644 --- a/toolchain/check/testdata/impl/lookup/no_prelude/import.carbon +++ b/toolchain/check/testdata/impl/lookup/no_prelude/import.carbon @@ -474,9 +474,11 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %c.patt: %C = binding_pattern c // CHECK:STDOUT: %c.param_patt: %C = value_param_pattern %c.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %PackageA.ref.loc6: = name_ref PackageA, imports.%PackageA [template = imports.%PackageA] -// CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %c.param: %C = value_param runtime_param0 +// CHECK:STDOUT: %.loc6: type = splice_block %C.ref [template = constants.%C] { +// CHECK:STDOUT: %PackageA.ref.loc6: = name_ref PackageA, imports.%PackageA [template = imports.%PackageA] +// CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C] +// CHECK:STDOUT: } // CHECK:STDOUT: %c: %C = bind_name c, %c.param // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -587,9 +589,11 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %d.patt: %D = binding_pattern d // CHECK:STDOUT: %d.param_patt: %D = value_param_pattern %d.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %PackageB.ref: = name_ref PackageB, imports.%PackageB [template = imports.%PackageB] -// CHECK:STDOUT: %D.ref: type = name_ref D, imports.%import_ref.1 [template = constants.%D] // CHECK:STDOUT: %d.param: %D = value_param runtime_param0 +// CHECK:STDOUT: %.loc7: type = splice_block %D.ref [template = constants.%D] { +// CHECK:STDOUT: %PackageB.ref: = name_ref PackageB, imports.%PackageB [template = imports.%PackageB] +// CHECK:STDOUT: %D.ref: type = name_ref D, imports.%import_ref.1 [template = constants.%D] +// CHECK:STDOUT: } // CHECK:STDOUT: %d: %D = bind_name d, %d.param // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -728,9 +732,11 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %c.patt: %C = binding_pattern c // CHECK:STDOUT: %c.param_patt: %C = value_param_pattern %c.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %PackageA.ref: = name_ref PackageA, imports.%PackageA [template = imports.%PackageA] -// CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %c.param: %C = value_param runtime_param0 +// CHECK:STDOUT: %.loc7: type = splice_block %C.ref [template = constants.%C] { +// CHECK:STDOUT: %PackageA.ref: = name_ref PackageA, imports.%PackageA [template = imports.%PackageA] +// CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C] +// CHECK:STDOUT: } // CHECK:STDOUT: %c: %C = bind_name c, %c.param // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -861,9 +867,11 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %d.patt: %D = binding_pattern d // CHECK:STDOUT: %d.param_patt: %D = value_param_pattern %d.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %PackageB.ref.loc6: = name_ref PackageB, imports.%PackageB [template = imports.%PackageB] -// CHECK:STDOUT: %D.ref: type = name_ref D, imports.%import_ref.1 [template = constants.%D] // CHECK:STDOUT: %d.param: %D = value_param runtime_param0 +// CHECK:STDOUT: %.loc6: type = splice_block %D.ref [template = constants.%D] { +// CHECK:STDOUT: %PackageB.ref.loc6: = name_ref PackageB, imports.%PackageB [template = imports.%PackageB] +// CHECK:STDOUT: %D.ref: type = name_ref D, imports.%import_ref.1 [template = constants.%D] +// CHECK:STDOUT: } // CHECK:STDOUT: %d: %D = bind_name d, %d.param // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -1093,10 +1101,10 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %X.patt.loc4_26.1: @AnyParam.%T.loc4_16.2 (%T) = symbolic_binding_pattern X, 1 [symbolic = %X.patt.loc4_26.2 (constants.%X.patt)] // CHECK:STDOUT: %X.param_patt: @AnyParam.%T.loc4_16.2 (%T) = value_param_pattern %X.patt.loc4_26.1, runtime_param [symbolic = %X.patt.loc4_26.2 (constants.%X.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc4_16.1 [symbolic = %T.loc4_16.2 (constants.%T)] // CHECK:STDOUT: %T.param: type = value_param runtime_param // CHECK:STDOUT: %T.loc4_16.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc4_16.2 (constants.%T)] // CHECK:STDOUT: %X.param: @AnyParam.%T.loc4_16.2 (%T) = value_param runtime_param +// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc4_16.1 [symbolic = %T.loc4_16.2 (constants.%T)] // CHECK:STDOUT: %X.loc4_26.1: @AnyParam.%T.loc4_16.2 (%T) = bind_symbolic_name X, 1, %X.param [symbolic = %X.loc4_26.2 (constants.%X)] // CHECK:STDOUT: } // CHECK:STDOUT: %Y.decl: type = interface_decl @Y [template = constants.%Y.type] {} {} @@ -1283,10 +1291,6 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: // CHECK:STDOUT: fn @L() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %PackageHasParam.ref.loc13: = name_ref PackageHasParam, imports.%PackageHasParam [template = imports.%PackageHasParam] -// CHECK:STDOUT: %AnyParam.ref: %AnyParam.type = name_ref AnyParam, imports.%import_ref.1 [template = constants.%AnyParam.generic] -// CHECK:STDOUT: %GenericInterface.ref: %GenericInterface.type.1 = name_ref GenericInterface, file.%GenericInterface.decl [template = constants.%GenericInterface.generic] -// CHECK:STDOUT: %AnyParam: type = class_type @AnyParam, @AnyParam(constants.%GenericInterface.type.1, constants.%GenericInterface.generic) [template = constants.%AnyParam.2] // CHECK:STDOUT: %obj.var: ref %AnyParam.2 = var obj // CHECK:STDOUT: %obj: ref %AnyParam.2 = bind_name obj, %obj.var // CHECK:STDOUT: %.loc13_58.1: %empty_struct_type = struct_literal () @@ -1294,7 +1298,7 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %.loc13_59: init %AnyParam.2 = converted %.loc13_58.1, %.loc13_58.2 [template = constants.%AnyParam.val] // CHECK:STDOUT: assign %obj.var, %.loc13_59 // CHECK:STDOUT: %obj.ref: ref %AnyParam.2 = name_ref obj, %obj -// CHECK:STDOUT: %PackageHasParam.ref.loc14: = name_ref PackageHasParam, imports.%PackageHasParam [template = imports.%PackageHasParam] +// CHECK:STDOUT: %PackageHasParam.ref: = name_ref PackageHasParam, imports.%PackageHasParam [template = imports.%PackageHasParam] // CHECK:STDOUT: %Y.ref: type = name_ref Y, imports.%import_ref.4 [template = constants.%Y.type] // CHECK:STDOUT: %K.ref: %K.assoc_type = name_ref K, imports.%import_ref.6 [template = constants.%assoc0] // CHECK:STDOUT: %impl.elem0: %K.type.2 = interface_witness_access constants.%interface, element0 [template = constants.%K.1] @@ -1335,8 +1339,6 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %M.type: type = fn_type @M [template] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template] // CHECK:STDOUT: %M: %M.type = struct_value () [template] -// CHECK:STDOUT: %AnyParam.type: type = generic_class_type @AnyParam [template] -// CHECK:STDOUT: %AnyParam.generic: %AnyParam.type = struct_value () [template] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] @@ -1371,10 +1373,8 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: .GenericInterface = %import_ref.4 // CHECK:STDOUT: import PackageGenericInterface//default // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: %AnyParam.type = import_ref PackageHasParam//default, AnyParam, loaded [template = constants.%AnyParam.generic] // CHECK:STDOUT: %import_ref.2: = import_ref PackageHasParam//default, loc4_34, loaded [template = constants.%complete_type] // CHECK:STDOUT: %import_ref.3 = import_ref PackageHasParam//default, inst34 [no loc], unloaded -// CHECK:STDOUT: %import_ref.4: %GenericInterface.type.1 = import_ref PackageGenericInterface//default, GenericInterface, loaded [template = constants.%GenericInterface.generic] // CHECK:STDOUT: %import_ref.5 = import_ref PackageGenericInterface//default, inst28 [no loc], unloaded // CHECK:STDOUT: %import_ref.6: type = import_ref PackageHasParam//default, Y, loaded [template = constants.%Y.type] // CHECK:STDOUT: %import_ref.7 = import_ref PackageHasParam//default, inst40 [no loc], unloaded @@ -1440,11 +1440,6 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: // CHECK:STDOUT: fn @M() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %PackageHasParam.ref.loc8: = name_ref PackageHasParam, imports.%PackageHasParam [template = imports.%PackageHasParam] -// CHECK:STDOUT: %AnyParam.ref: %AnyParam.type = name_ref AnyParam, imports.%import_ref.1 [template = constants.%AnyParam.generic] -// CHECK:STDOUT: %PackageGenericInterface.ref: = name_ref PackageGenericInterface, imports.%PackageGenericInterface [template = imports.%PackageGenericInterface] -// CHECK:STDOUT: %GenericInterface.ref: %GenericInterface.type.1 = name_ref GenericInterface, imports.%import_ref.4 [template = constants.%GenericInterface.generic] -// CHECK:STDOUT: %AnyParam: type = class_type @AnyParam, @AnyParam(constants.%GenericInterface.type.1, constants.%GenericInterface.generic) [template = constants.%AnyParam.2] // CHECK:STDOUT: %obj.var: ref %AnyParam.2 = var obj // CHECK:STDOUT: %obj: ref %AnyParam.2 = bind_name obj, %obj.var // CHECK:STDOUT: %.loc9_50.1: %empty_struct_type = struct_literal () @@ -1452,7 +1447,7 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %.loc9_51: init %AnyParam.2 = converted %.loc9_50.1, %.loc9_50.2 [template = constants.%AnyParam.val] // CHECK:STDOUT: assign %obj.var, %.loc9_51 // CHECK:STDOUT: %obj.ref: ref %AnyParam.2 = name_ref obj, %obj -// CHECK:STDOUT: %PackageHasParam.ref.loc10: = name_ref PackageHasParam, imports.%PackageHasParam [template = imports.%PackageHasParam] +// CHECK:STDOUT: %PackageHasParam.ref: = name_ref PackageHasParam, imports.%PackageHasParam [template = imports.%PackageHasParam] // CHECK:STDOUT: %Y.ref: type = name_ref Y, imports.%import_ref.6 [template = constants.%Y.type] // CHECK:STDOUT: %K.ref: %K.assoc_type = name_ref K, imports.%import_ref.8 [template = constants.%assoc0] // CHECK:STDOUT: %impl.elem0: %K.type.1 = interface_witness_access constants.%interface, element0 [template = constants.%K.2] @@ -1768,10 +1763,12 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %c.patt: %C.2 = binding_pattern c // CHECK:STDOUT: %c.param_patt: %C.2 = value_param_pattern %c.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %HasExtraInterfaces.ref.loc5: = name_ref HasExtraInterfaces, imports.%HasExtraInterfaces [template = imports.%HasExtraInterfaces] -// CHECK:STDOUT: %C.ref: %C.type = name_ref C, imports.%import_ref.1 [template = constants.%C.generic] -// CHECK:STDOUT: %C: type = class_type @C, @C(type) [template = constants.%C.2] // CHECK:STDOUT: %c.param: %C.2 = value_param runtime_param0 +// CHECK:STDOUT: %.loc5: type = splice_block %C [template = constants.%C.2] { +// CHECK:STDOUT: %HasExtraInterfaces.ref.loc5: = name_ref HasExtraInterfaces, imports.%HasExtraInterfaces [template = imports.%HasExtraInterfaces] +// CHECK:STDOUT: %C.ref: %C.type = name_ref C, imports.%import_ref.1 [template = constants.%C.generic] +// CHECK:STDOUT: %C: type = class_type @C, @C(type) [template = constants.%C.2] +// CHECK:STDOUT: } // CHECK:STDOUT: %c: %C.2 = bind_name c, %c.param // CHECK:STDOUT: } // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/impl/lookup/no_prelude/specific_args.carbon b/toolchain/check/testdata/impl/lookup/no_prelude/specific_args.carbon index 14c7875c7ca99..e364b3ba25fe7 100644 --- a/toolchain/check/testdata/impl/lookup/no_prelude/specific_args.carbon +++ b/toolchain/check/testdata/impl/lookup/no_prelude/specific_args.carbon @@ -357,8 +357,8 @@ fn H(c: C(InClassArgs)) { c.(I(X).F)(); } // CHECK:STDOUT: %x.patt: %X = binding_pattern x // CHECK:STDOUT: %x.param_patt: %X = value_param_pattern %x.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %X.ref: type = name_ref X, imports.%import_ref.3 [template = constants.%X] // CHECK:STDOUT: %x.param: %X = value_param runtime_param0 +// CHECK:STDOUT: %X.ref: type = name_ref X, imports.%import_ref.3 [template = constants.%X] // CHECK:STDOUT: %x: %X = bind_name x, %x.param // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -673,10 +673,12 @@ fn H(c: C(InClassArgs)) { c.(I(X).F)(); } // CHECK:STDOUT: %c.patt: %C.2 = binding_pattern c // CHECK:STDOUT: %c.param_patt: %C.2 = value_param_pattern %c.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref: %C.type = name_ref C, imports.%import_ref.2 [template = constants.%C.generic] -// CHECK:STDOUT: %InClassArgs.ref: type = name_ref InClassArgs, imports.%import_ref.4 [template = constants.%InClassArgs] -// CHECK:STDOUT: %C: type = class_type @C, @C(constants.%InClassArgs) [template = constants.%C.2] // CHECK:STDOUT: %c.param: %C.2 = value_param runtime_param0 +// CHECK:STDOUT: %.loc6_22: type = splice_block %C [template = constants.%C.2] { +// CHECK:STDOUT: %C.ref: %C.type = name_ref C, imports.%import_ref.2 [template = constants.%C.generic] +// CHECK:STDOUT: %InClassArgs.ref: type = name_ref InClassArgs, imports.%import_ref.4 [template = constants.%InClassArgs] +// CHECK:STDOUT: %C: type = class_type @C, @C(constants.%InClassArgs) [template = constants.%C.2] +// CHECK:STDOUT: } // CHECK:STDOUT: %c: %C.2 = bind_name c, %c.param // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -737,8 +739,8 @@ fn H(c: C(InClassArgs)) { c.(I(X).F)(); } // CHECK:STDOUT: %I.ref: %I.type.1 = name_ref I, imports.%import_ref.1 [template = constants.%I.generic] // CHECK:STDOUT: %X.ref: type = name_ref X, imports.%import_ref.3 [template = constants.%X] // CHECK:STDOUT: %I.type: type = facet_type <@I, @I(constants.%X)> [template = constants.%I.type.3] -// CHECK:STDOUT: %.loc6: %F.assoc_type.2 = specific_constant imports.%import_ref.10, @I(constants.%X) [template = constants.%assoc0.2] -// CHECK:STDOUT: %F.ref: %F.assoc_type.2 = name_ref F, %.loc6 [template = constants.%assoc0.2] +// CHECK:STDOUT: %.loc6_34: %F.assoc_type.2 = specific_constant imports.%import_ref.10, @I(constants.%X) [template = constants.%assoc0.2] +// CHECK:STDOUT: %F.ref: %F.assoc_type.2 = name_ref F, %.loc6_34 [template = constants.%assoc0.2] // CHECK:STDOUT: %impl.elem0: %F.type.2 = interface_witness_access constants.%interface, element0 [template = constants.%F.3] // CHECK:STDOUT: %F.call: init %empty_tuple.type = call %impl.elem0() // CHECK:STDOUT: return diff --git a/toolchain/check/testdata/impl/multiple_extend.carbon b/toolchain/check/testdata/impl/multiple_extend.carbon index ce1fa85e68092..afdd102bce308 100644 --- a/toolchain/check/testdata/impl/multiple_extend.carbon +++ b/toolchain/check/testdata/impl/multiple_extend.carbon @@ -213,8 +213,8 @@ fn P(o: O) { // CHECK:STDOUT: %c.patt: %C = binding_pattern c // CHECK:STDOUT: %c.param_patt: %C = value_param_pattern %c.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref.loc21: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %c.param: %C = value_param runtime_param0 +// CHECK:STDOUT: %C.ref.loc21: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %c: %C = bind_name c, %c.param // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -379,8 +379,8 @@ fn P(o: O) { // CHECK:STDOUT: %d.patt: %D = binding_pattern d // CHECK:STDOUT: %d.param_patt: %D = value_param_pattern %d.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %D.ref.loc21: type = name_ref D, file.%D.decl [template = constants.%D] // CHECK:STDOUT: %d.param: %D = value_param runtime_param0 +// CHECK:STDOUT: %D.ref.loc21: type = name_ref D, file.%D.decl [template = constants.%D] // CHECK:STDOUT: %d: %D = bind_name d, %d.param // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -530,8 +530,8 @@ fn P(o: O) { // CHECK:STDOUT: %e.patt: %E = binding_pattern e // CHECK:STDOUT: %e.param_patt: %E = value_param_pattern %e.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %E.ref.loc19: type = name_ref E, file.%E.decl [template = constants.%E] // CHECK:STDOUT: %e.param: %E = value_param runtime_param0 +// CHECK:STDOUT: %E.ref.loc19: type = name_ref E, file.%E.decl [template = constants.%E] // CHECK:STDOUT: %e: %E = bind_name e, %e.param // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -670,8 +670,8 @@ fn P(o: O) { // CHECK:STDOUT: %l.patt: %L = binding_pattern l // CHECK:STDOUT: %l.param_patt: %L = value_param_pattern %l.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %L.ref.loc19: type = name_ref L, file.%L.decl [template = constants.%L] // CHECK:STDOUT: %l.param: %L = value_param runtime_param0 +// CHECK:STDOUT: %L.ref.loc19: type = name_ref L, file.%L.decl [template = constants.%L] // CHECK:STDOUT: %l: %L = bind_name l, %l.param // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -815,8 +815,8 @@ fn P(o: O) { // CHECK:STDOUT: %o.patt: %O = binding_pattern o // CHECK:STDOUT: %o.param_patt: %O = value_param_pattern %o.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %O.ref.loc27: type = name_ref O, file.%O.decl [template = constants.%O] // CHECK:STDOUT: %o.param: %O = value_param runtime_param0 +// CHECK:STDOUT: %O.ref.loc27: type = name_ref O, file.%O.decl [template = constants.%O] // CHECK:STDOUT: %o: %O = bind_name o, %o.param // CHECK:STDOUT: } // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/impl/no_prelude/generic_redeclaration.carbon b/toolchain/check/testdata/impl/no_prelude/generic_redeclaration.carbon index 5fc3fa3579b8f..1a8b9bde0ce49 100644 --- a/toolchain/check/testdata/impl/no_prelude/generic_redeclaration.carbon +++ b/toolchain/check/testdata/impl/no_prelude/generic_redeclaration.carbon @@ -108,96 +108,96 @@ impl (C, C).0 as I {} // CHECK:STDOUT: %T.patt.loc11_14.1: %I.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc11_14.2 (constants.%T.patt.1)] // CHECK:STDOUT: %T.param_patt: %I.type = value_param_pattern %T.patt.loc11_14.1, runtime_param [symbolic = %T.patt.loc11_14.2 (constants.%T.patt.1)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%I.type] // CHECK:STDOUT: %T.ref: %I.type = name_ref T, %T.loc11_14.1 [symbolic = %T.loc11_14.2 (constants.%T.1)] // CHECK:STDOUT: %T.as_type.loc11_21.1: type = facet_access_type %T.ref [symbolic = %T.as_type.loc11_21.2 (constants.%T.as_type.1)] // CHECK:STDOUT: %.loc11: type = converted %T.ref, %T.as_type.loc11_21.1 [symbolic = %T.as_type.loc11_21.2 (constants.%T.as_type.1)] // CHECK:STDOUT: %Interface.ref: type = name_ref Interface, file.%Interface.decl [template = constants.%Interface.type] // CHECK:STDOUT: %T.param: %I.type = value_param runtime_param +// CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%I.type] // CHECK:STDOUT: %T.loc11_14.1: %I.type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc11_14.2 (constants.%T.1)] // CHECK:STDOUT: } // CHECK:STDOUT: impl_decl @impl.2 [template] { // CHECK:STDOUT: %T.patt.loc12_14.1: %J.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc12_14.2 (constants.%T.patt.2)] // CHECK:STDOUT: %T.param_patt: %J.type = value_param_pattern %T.patt.loc12_14.1, runtime_param [symbolic = %T.patt.loc12_14.2 (constants.%T.patt.2)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [template = constants.%J.type] // CHECK:STDOUT: %T.ref: %J.type = name_ref T, %T.loc12_14.1 [symbolic = %T.loc12_14.2 (constants.%T.2)] // CHECK:STDOUT: %T.as_type.loc12_21.1: type = facet_access_type %T.ref [symbolic = %T.as_type.loc12_21.2 (constants.%T.as_type.2)] // CHECK:STDOUT: %.loc12: type = converted %T.ref, %T.as_type.loc12_21.1 [symbolic = %T.as_type.loc12_21.2 (constants.%T.as_type.2)] // CHECK:STDOUT: %Interface.ref: type = name_ref Interface, file.%Interface.decl [template = constants.%Interface.type] // CHECK:STDOUT: %T.param: %J.type = value_param runtime_param +// CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [template = constants.%J.type] // CHECK:STDOUT: %T.loc12_14.1: %J.type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc12_14.2 (constants.%T.2)] // CHECK:STDOUT: } // CHECK:STDOUT: impl_decl @impl.3 [template] { // CHECK:STDOUT: %T.patt.loc13_14.1: %K.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc13_14.2 (constants.%T.patt.3)] // CHECK:STDOUT: %T.param_patt: %K.type = value_param_pattern %T.patt.loc13_14.1, runtime_param [symbolic = %T.patt.loc13_14.2 (constants.%T.patt.3)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %K.ref: type = name_ref K, file.%K.decl [template = constants.%K.type] // CHECK:STDOUT: %T.ref: %K.type = name_ref T, %T.loc13_14.1 [symbolic = %T.loc13_14.2 (constants.%T.3)] // CHECK:STDOUT: %T.as_type.loc13_21.1: type = facet_access_type %T.ref [symbolic = %T.as_type.loc13_21.2 (constants.%T.as_type.3)] // CHECK:STDOUT: %.loc13: type = converted %T.ref, %T.as_type.loc13_21.1 [symbolic = %T.as_type.loc13_21.2 (constants.%T.as_type.3)] // CHECK:STDOUT: %Interface.ref: type = name_ref Interface, file.%Interface.decl [template = constants.%Interface.type] // CHECK:STDOUT: %T.param: %K.type = value_param runtime_param +// CHECK:STDOUT: %K.ref: type = name_ref K, file.%K.decl [template = constants.%K.type] // CHECK:STDOUT: %T.loc13_14.1: %K.type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc13_14.2 (constants.%T.3)] // CHECK:STDOUT: } // CHECK:STDOUT: impl_decl @impl.4 [template] { // CHECK:STDOUT: %T.patt.loc14_14.1: %L.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc14_14.2 (constants.%T.patt.4)] // CHECK:STDOUT: %T.param_patt: %L.type = value_param_pattern %T.patt.loc14_14.1, runtime_param [symbolic = %T.patt.loc14_14.2 (constants.%T.patt.4)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %L.ref: type = name_ref L, file.%L.decl [template = constants.%L.type] // CHECK:STDOUT: %T.ref: %L.type = name_ref T, %T.loc14_14.1 [symbolic = %T.loc14_14.2 (constants.%T.4)] // CHECK:STDOUT: %T.as_type.loc14_21.1: type = facet_access_type %T.ref [symbolic = %T.as_type.loc14_21.2 (constants.%T.as_type.4)] // CHECK:STDOUT: %.loc14: type = converted %T.ref, %T.as_type.loc14_21.1 [symbolic = %T.as_type.loc14_21.2 (constants.%T.as_type.4)] // CHECK:STDOUT: %Interface.ref: type = name_ref Interface, file.%Interface.decl [template = constants.%Interface.type] // CHECK:STDOUT: %T.param: %L.type = value_param runtime_param +// CHECK:STDOUT: %L.ref: type = name_ref L, file.%L.decl [template = constants.%L.type] // CHECK:STDOUT: %T.loc14_14.1: %L.type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc14_14.2 (constants.%T.4)] // CHECK:STDOUT: } // CHECK:STDOUT: impl_decl @impl.5 [template] { // CHECK:STDOUT: %T.patt.loc18_14.1: %I.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc18_14.2 (constants.%T.patt.1)] // CHECK:STDOUT: %T.param_patt: %I.type = value_param_pattern %T.patt.loc18_14.1, runtime_param [symbolic = %T.patt.loc18_14.2 (constants.%T.patt.1)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%I.type] // CHECK:STDOUT: %T.ref: %I.type = name_ref T, %T.loc18_14.1 [symbolic = %T.loc18_14.2 (constants.%T.1)] // CHECK:STDOUT: %T.as_type.loc18_21.1: type = facet_access_type %T.ref [symbolic = %T.as_type.loc18_21.2 (constants.%T.as_type.1)] // CHECK:STDOUT: %.loc18: type = converted %T.ref, %T.as_type.loc18_21.1 [symbolic = %T.as_type.loc18_21.2 (constants.%T.as_type.1)] // CHECK:STDOUT: %Interface.ref: type = name_ref Interface, file.%Interface.decl [template = constants.%Interface.type] // CHECK:STDOUT: %T.param: %I.type = value_param runtime_param +// CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%I.type] // CHECK:STDOUT: %T.loc18_14.1: %I.type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc18_14.2 (constants.%T.1)] // CHECK:STDOUT: } // CHECK:STDOUT: impl_decl @impl.6 [template] { // CHECK:STDOUT: %T.patt.loc19_14.1: %J.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc19_14.2 (constants.%T.patt.2)] // CHECK:STDOUT: %T.param_patt: %J.type = value_param_pattern %T.patt.loc19_14.1, runtime_param [symbolic = %T.patt.loc19_14.2 (constants.%T.patt.2)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [template = constants.%J.type] // CHECK:STDOUT: %T.ref: %J.type = name_ref T, %T.loc19_14.1 [symbolic = %T.loc19_14.2 (constants.%T.2)] // CHECK:STDOUT: %T.as_type.loc19_21.1: type = facet_access_type %T.ref [symbolic = %T.as_type.loc19_21.2 (constants.%T.as_type.2)] // CHECK:STDOUT: %.loc19: type = converted %T.ref, %T.as_type.loc19_21.1 [symbolic = %T.as_type.loc19_21.2 (constants.%T.as_type.2)] // CHECK:STDOUT: %Interface.ref: type = name_ref Interface, file.%Interface.decl [template = constants.%Interface.type] // CHECK:STDOUT: %T.param: %J.type = value_param runtime_param +// CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [template = constants.%J.type] // CHECK:STDOUT: %T.loc19_14.1: %J.type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc19_14.2 (constants.%T.2)] // CHECK:STDOUT: } // CHECK:STDOUT: impl_decl @impl.7 [template] { // CHECK:STDOUT: %T.patt.loc20_14.1: %K.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc20_14.2 (constants.%T.patt.3)] // CHECK:STDOUT: %T.param_patt: %K.type = value_param_pattern %T.patt.loc20_14.1, runtime_param [symbolic = %T.patt.loc20_14.2 (constants.%T.patt.3)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %K.ref: type = name_ref K, file.%K.decl [template = constants.%K.type] // CHECK:STDOUT: %T.ref: %K.type = name_ref T, %T.loc20_14.1 [symbolic = %T.loc20_14.2 (constants.%T.3)] // CHECK:STDOUT: %T.as_type.loc20_21.1: type = facet_access_type %T.ref [symbolic = %T.as_type.loc20_21.2 (constants.%T.as_type.3)] // CHECK:STDOUT: %.loc20: type = converted %T.ref, %T.as_type.loc20_21.1 [symbolic = %T.as_type.loc20_21.2 (constants.%T.as_type.3)] // CHECK:STDOUT: %Interface.ref: type = name_ref Interface, file.%Interface.decl [template = constants.%Interface.type] // CHECK:STDOUT: %T.param: %K.type = value_param runtime_param +// CHECK:STDOUT: %K.ref: type = name_ref K, file.%K.decl [template = constants.%K.type] // CHECK:STDOUT: %T.loc20_14.1: %K.type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc20_14.2 (constants.%T.3)] // CHECK:STDOUT: } // CHECK:STDOUT: impl_decl @impl.8 [template] { // CHECK:STDOUT: %T.patt.loc21_14.1: %L.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc21_14.2 (constants.%T.patt.4)] // CHECK:STDOUT: %T.param_patt: %L.type = value_param_pattern %T.patt.loc21_14.1, runtime_param [symbolic = %T.patt.loc21_14.2 (constants.%T.patt.4)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %L.ref: type = name_ref L, file.%L.decl [template = constants.%L.type] // CHECK:STDOUT: %T.ref: %L.type = name_ref T, %T.loc21_14.1 [symbolic = %T.loc21_14.2 (constants.%T.4)] // CHECK:STDOUT: %T.as_type.loc21_21.1: type = facet_access_type %T.ref [symbolic = %T.as_type.loc21_21.2 (constants.%T.as_type.4)] // CHECK:STDOUT: %.loc21: type = converted %T.ref, %T.as_type.loc21_21.1 [symbolic = %T.as_type.loc21_21.2 (constants.%T.as_type.4)] // CHECK:STDOUT: %Interface.ref: type = name_ref Interface, file.%Interface.decl [template = constants.%Interface.type] // CHECK:STDOUT: %T.param: %L.type = value_param runtime_param +// CHECK:STDOUT: %L.ref: type = name_ref L, file.%L.decl [template = constants.%L.type] // CHECK:STDOUT: %T.loc21_14.1: %L.type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc21_14.2 (constants.%T.4)] // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -405,24 +405,24 @@ impl (C, C).0 as I {} // CHECK:STDOUT: %T.patt.loc7_14.1: %I.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc7_14.2 (constants.%T.patt)] // CHECK:STDOUT: %T.param_patt: %I.type = value_param_pattern %T.patt.loc7_14.1, runtime_param [symbolic = %T.patt.loc7_14.2 (constants.%T.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %I.ref.loc7: type = name_ref I, file.%I.decl [template = constants.%I.type] // CHECK:STDOUT: %T.ref.loc7: %I.type = name_ref T, %T.loc7_14.1 [symbolic = %T.loc7_14.2 (constants.%T)] // CHECK:STDOUT: %T.as_type.loc7_21.1: type = facet_access_type %T.ref.loc7 [symbolic = %T.as_type.loc7_21.2 (constants.%T.as_type)] // CHECK:STDOUT: %.loc7: type = converted %T.ref.loc7, %T.as_type.loc7_21.1 [symbolic = %T.as_type.loc7_21.2 (constants.%T.as_type)] // CHECK:STDOUT: %J.ref.loc7: type = name_ref J, file.%J.decl [template = constants.%J.type] // CHECK:STDOUT: %T.param.loc7: %I.type = value_param runtime_param +// CHECK:STDOUT: %I.ref.loc7: type = name_ref I, file.%I.decl [template = constants.%I.type] // CHECK:STDOUT: %T.loc7_14.1: %I.type = bind_symbolic_name T, 0, %T.param.loc7 [symbolic = %T.loc7_14.2 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: impl_decl @impl [template] { // CHECK:STDOUT: %T.patt.loc7_14.1: %I.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc7_14.2 (constants.%T.patt)] // CHECK:STDOUT: %T.param_patt: %I.type = value_param_pattern %T.patt.loc7_14.1, runtime_param [symbolic = %T.patt.loc7_14.2 (constants.%T.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %I.ref.loc14: type = name_ref I, file.%I.decl [template = constants.%I.type] // CHECK:STDOUT: %T.ref.loc14: %I.type = name_ref T, %T.loc14 [symbolic = constants.%T] // CHECK:STDOUT: %T.as_type.loc14: type = facet_access_type %T.ref.loc14 [symbolic = constants.%T.as_type] // CHECK:STDOUT: %.loc14: type = converted %T.ref.loc14, %T.as_type.loc14 [symbolic = constants.%T.as_type] // CHECK:STDOUT: %J.ref.loc14: type = name_ref J, file.%J.decl [template = constants.%J.type] // CHECK:STDOUT: %T.param.loc14: %I.type = value_param runtime_param +// CHECK:STDOUT: %I.ref.loc14: type = name_ref I, file.%I.decl [template = constants.%I.type] // CHECK:STDOUT: %T.loc14: %I.type = bind_symbolic_name T, 0, %T.param.loc14 [symbolic = constants.%T] // CHECK:STDOUT: } // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/impl/no_prelude/import_builtin_call.carbon b/toolchain/check/testdata/impl/no_prelude/import_builtin_call.carbon index a657a7ac3a743..ec07fe4036183 100644 --- a/toolchain/check/testdata/impl/no_prelude/import_builtin_call.carbon +++ b/toolchain/check/testdata/impl/no_prelude/import_builtin_call.carbon @@ -129,11 +129,13 @@ var n: Int(64) = MakeFromClass(FromLiteral(64) as OtherInt); // CHECK:STDOUT: %return.patt: type = return_slot_pattern // CHECK:STDOUT: %return.param_patt: type = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [template = constants.%IntLiteral] -// CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral] -// CHECK:STDOUT: %.loc9_22.1: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral] -// CHECK:STDOUT: %.loc9_22.2: type = converted %int_literal.make_type, %.loc9_22.1 [template = Core.IntLiteral] // CHECK:STDOUT: %n.param: Core.IntLiteral = value_param runtime_param0 +// CHECK:STDOUT: %.loc9_22.3: type = splice_block %.loc9_22.2 [template = Core.IntLiteral] { +// CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [template = constants.%IntLiteral] +// CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral] +// CHECK:STDOUT: %.loc9_22.1: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral] +// CHECK:STDOUT: %.loc9_22.2: type = converted %int_literal.make_type, %.loc9_22.1 [template = Core.IntLiteral] +// CHECK:STDOUT: } // CHECK:STDOUT: %n: Core.IntLiteral = bind_name n, %n.param // CHECK:STDOUT: %return.param: ref type = out_param runtime_param1 // CHECK:STDOUT: %return: ref type = return_slot %return.param @@ -142,26 +144,30 @@ var n: Int(64) = MakeFromClass(FromLiteral(64) as OtherInt); // CHECK:STDOUT: %N.patt.loc11_13.1: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc11_13.2 (constants.%N.patt)] // CHECK:STDOUT: %N.param_patt: Core.IntLiteral = value_param_pattern %N.patt.loc11_13.1, runtime_param [symbolic = %N.patt.loc11_13.2 (constants.%N.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [template = constants.%IntLiteral] -// CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral] -// CHECK:STDOUT: %.loc11_28.1: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral] -// CHECK:STDOUT: %.loc11_28.2: type = converted %int_literal.make_type, %.loc11_28.1 [template = Core.IntLiteral] // CHECK:STDOUT: %N.param: Core.IntLiteral = value_param runtime_param +// CHECK:STDOUT: %.loc11_28.3: type = splice_block %.loc11_28.2 [template = Core.IntLiteral] { +// CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [template = constants.%IntLiteral] +// CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral] +// CHECK:STDOUT: %.loc11_28.1: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral] +// CHECK:STDOUT: %.loc11_28.2: type = converted %int_literal.make_type, %.loc11_28.1 [template = Core.IntLiteral] +// CHECK:STDOUT: } // CHECK:STDOUT: %N.loc11_13.1: Core.IntLiteral = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc11_13.2 (constants.%N)] // CHECK:STDOUT: } // CHECK:STDOUT: impl_decl @impl [template] { // CHECK:STDOUT: %N.patt.loc15_14.1: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc15_14.2 (constants.%N.patt)] // CHECK:STDOUT: %N.param_patt: Core.IntLiteral = value_param_pattern %N.patt.loc15_14.1, runtime_param [symbolic = %N.patt.loc15_14.2 (constants.%N.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [template = constants.%IntLiteral] -// CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral] -// CHECK:STDOUT: %.loc15_29.1: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral] -// CHECK:STDOUT: %.loc15_29.2: type = converted %int_literal.make_type, %.loc15_29.1 [template = Core.IntLiteral] // CHECK:STDOUT: %MyInt.ref: %MyInt.type = name_ref MyInt, file.%MyInt.decl [template = constants.%MyInt.generic] // CHECK:STDOUT: %N.ref: Core.IntLiteral = name_ref N, %N.loc15_14.1 [symbolic = %N.loc15_14.2 (constants.%N)] // CHECK:STDOUT: %MyInt.loc15_39.1: type = class_type @MyInt, @MyInt(constants.%N) [symbolic = %MyInt.loc15_39.2 (constants.%MyInt)] // CHECK:STDOUT: %Add.ref: type = name_ref Add, file.%Add.decl [template = constants.%Add.type] // CHECK:STDOUT: %N.param: Core.IntLiteral = value_param runtime_param +// CHECK:STDOUT: %.loc15_29.3: type = splice_block %.loc15_29.2 [template = Core.IntLiteral] { +// CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [template = constants.%IntLiteral] +// CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral] +// CHECK:STDOUT: %.loc15_29.1: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral] +// CHECK:STDOUT: %.loc15_29.2: type = converted %int_literal.make_type, %.loc15_29.1 [template = Core.IntLiteral] +// CHECK:STDOUT: } // CHECK:STDOUT: %N.loc15_14.1: Core.IntLiteral = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc15_14.2 (constants.%N)] // CHECK:STDOUT: } // CHECK:STDOUT: %Double.decl: %Double.type = fn_decl @Double [template = constants.%Double] { @@ -172,19 +178,23 @@ var n: Int(64) = MakeFromClass(FromLiteral(64) as OtherInt); // CHECK:STDOUT: %return.patt: @Double.%MyInt.loc19_39.2 (%MyInt) = return_slot_pattern // CHECK:STDOUT: %return.param_patt: @Double.%MyInt.loc19_39.2 (%MyInt) = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [template = constants.%IntLiteral] -// CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral] -// CHECK:STDOUT: %.loc19_26.1: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral] -// CHECK:STDOUT: %.loc19_26.2: type = converted %int_literal.make_type, %.loc19_26.1 [template = Core.IntLiteral] -// CHECK:STDOUT: %MyInt.ref.loc19_32: %MyInt.type = name_ref MyInt, file.%MyInt.decl [template = constants.%MyInt.generic] -// CHECK:STDOUT: %N.ref.loc19_38: Core.IntLiteral = name_ref N, %N.loc19_11.1 [symbolic = %N.loc19_11.2 (constants.%N)] -// CHECK:STDOUT: %MyInt.loc19_39.1: type = class_type @MyInt, @MyInt(constants.%N) [symbolic = %MyInt.loc19_39.2 (constants.%MyInt)] // CHECK:STDOUT: %MyInt.ref.loc19_45: %MyInt.type = name_ref MyInt, file.%MyInt.decl [template = constants.%MyInt.generic] // CHECK:STDOUT: %N.ref.loc19_51: Core.IntLiteral = name_ref N, %N.loc19_11.1 [symbolic = %N.loc19_11.2 (constants.%N)] // CHECK:STDOUT: %MyInt.loc19_52: type = class_type @MyInt, @MyInt(constants.%N) [symbolic = %MyInt.loc19_39.2 (constants.%MyInt)] // CHECK:STDOUT: %N.param: Core.IntLiteral = value_param runtime_param +// CHECK:STDOUT: %.loc19_26.3: type = splice_block %.loc19_26.2 [template = Core.IntLiteral] { +// CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [template = constants.%IntLiteral] +// CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral] +// CHECK:STDOUT: %.loc19_26.1: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral] +// CHECK:STDOUT: %.loc19_26.2: type = converted %int_literal.make_type, %.loc19_26.1 [template = Core.IntLiteral] +// CHECK:STDOUT: } // CHECK:STDOUT: %N.loc19_11.1: Core.IntLiteral = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc19_11.2 (constants.%N)] // CHECK:STDOUT: %x.param: @Double.%MyInt.loc19_39.2 (%MyInt) = value_param runtime_param0 +// CHECK:STDOUT: %.loc19_39: type = splice_block %MyInt.loc19_39.1 [symbolic = %MyInt.loc19_39.2 (constants.%MyInt)] { +// CHECK:STDOUT: %MyInt.ref.loc19_32: %MyInt.type = name_ref MyInt, file.%MyInt.decl [template = constants.%MyInt.generic] +// CHECK:STDOUT: %N.ref.loc19_38: Core.IntLiteral = name_ref N, %N.loc19_11.1 [symbolic = %N.loc19_11.2 (constants.%N)] +// CHECK:STDOUT: %MyInt.loc19_39.1: type = class_type @MyInt, @MyInt(constants.%N) [symbolic = %MyInt.loc19_39.2 (constants.%MyInt)] +// CHECK:STDOUT: } // CHECK:STDOUT: %x: @Double.%MyInt.loc19_39.2 (%MyInt) = bind_name x, %x.param // CHECK:STDOUT: %return.param: ref @Double.%MyInt.loc19_39.2 (%MyInt) = out_param runtime_param1 // CHECK:STDOUT: %return: ref @Double.%MyInt.loc19_39.2 (%MyInt) = return_slot %return.param @@ -201,18 +211,22 @@ var n: Int(64) = MakeFromClass(FromLiteral(64) as OtherInt); // CHECK:STDOUT: %return.patt: @Op.1.%Self.as_type.loc5_15.1 (%Self.as_type) = return_slot_pattern // CHECK:STDOUT: %return.param_patt: @Op.1.%Self.as_type.loc5_15.1 (%Self.as_type) = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref.loc5_15: %Add.type = name_ref Self, @Add.%Self [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %Self.as_type.loc5_15.2: type = facet_access_type %Self.ref.loc5_15 [symbolic = %Self.as_type.loc5_15.1 (constants.%Self.as_type)] -// CHECK:STDOUT: %.loc5_15: type = converted %Self.ref.loc5_15, %Self.as_type.loc5_15.2 [symbolic = %Self.as_type.loc5_15.1 (constants.%Self.as_type)] -// CHECK:STDOUT: %Self.ref.loc5_28: %Add.type = name_ref Self, @Add.%Self [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %Self.as_type.loc5_28: type = facet_access_type %Self.ref.loc5_28 [symbolic = %Self.as_type.loc5_15.1 (constants.%Self.as_type)] -// CHECK:STDOUT: %.loc5_28: type = converted %Self.ref.loc5_28, %Self.as_type.loc5_28 [symbolic = %Self.as_type.loc5_15.1 (constants.%Self.as_type)] // CHECK:STDOUT: %Self.ref.loc5_37: %Add.type = name_ref Self, @Add.%Self [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: %Self.as_type.loc5_37: type = facet_access_type %Self.ref.loc5_37 [symbolic = %Self.as_type.loc5_15.1 (constants.%Self.as_type)] // CHECK:STDOUT: %.loc5_37: type = converted %Self.ref.loc5_37, %Self.as_type.loc5_37 [symbolic = %Self.as_type.loc5_15.1 (constants.%Self.as_type)] // CHECK:STDOUT: %self.param: @Op.1.%Self.as_type.loc5_15.1 (%Self.as_type) = value_param runtime_param0 +// CHECK:STDOUT: %.loc5_15.2: type = splice_block %.loc5_15.1 [symbolic = %Self.as_type.loc5_15.1 (constants.%Self.as_type)] { +// CHECK:STDOUT: %Self.ref.loc5_15: %Add.type = name_ref Self, @Add.%Self [symbolic = %Self (constants.%Self)] +// CHECK:STDOUT: %Self.as_type.loc5_15.2: type = facet_access_type %Self.ref.loc5_15 [symbolic = %Self.as_type.loc5_15.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %.loc5_15.1: type = converted %Self.ref.loc5_15, %Self.as_type.loc5_15.2 [symbolic = %Self.as_type.loc5_15.1 (constants.%Self.as_type)] +// CHECK:STDOUT: } // CHECK:STDOUT: %self: @Op.1.%Self.as_type.loc5_15.1 (%Self.as_type) = bind_name self, %self.param // CHECK:STDOUT: %other.param: @Op.1.%Self.as_type.loc5_15.1 (%Self.as_type) = value_param runtime_param1 +// CHECK:STDOUT: %.loc5_28.2: type = splice_block %.loc5_28.1 [symbolic = %Self.as_type.loc5_15.1 (constants.%Self.as_type)] { +// CHECK:STDOUT: %Self.ref.loc5_28: %Add.type = name_ref Self, @Add.%Self [symbolic = %Self (constants.%Self)] +// CHECK:STDOUT: %Self.as_type.loc5_28: type = facet_access_type %Self.ref.loc5_28 [symbolic = %Self.as_type.loc5_15.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %.loc5_28.1: type = converted %Self.ref.loc5_28, %Self.as_type.loc5_28 [symbolic = %Self.as_type.loc5_15.1 (constants.%Self.as_type)] +// CHECK:STDOUT: } // CHECK:STDOUT: %other: @Op.1.%Self.as_type.loc5_15.1 (%Self.as_type) = bind_name other, %other.param // CHECK:STDOUT: %return.param: ref @Op.1.%Self.as_type.loc5_15.1 (%Self.as_type) = out_param runtime_param2 // CHECK:STDOUT: %return: ref @Op.1.%Self.as_type.loc5_15.1 (%Self.as_type) = return_slot %return.param @@ -245,12 +259,12 @@ var n: Int(64) = MakeFromClass(FromLiteral(64) as OtherInt); // CHECK:STDOUT: %return.patt: @Op.2.%MyInt (%MyInt) = return_slot_pattern // CHECK:STDOUT: %return.param_patt: @Op.2.%MyInt (%MyInt) = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref.loc16_15: type = name_ref Self, @impl.%MyInt.loc15_39.1 [symbolic = %MyInt (constants.%MyInt)] -// CHECK:STDOUT: %Self.ref.loc16_28: type = name_ref Self, @impl.%MyInt.loc15_39.1 [symbolic = %MyInt (constants.%MyInt)] // CHECK:STDOUT: %Self.ref.loc16_37: type = name_ref Self, @impl.%MyInt.loc15_39.1 [symbolic = %MyInt (constants.%MyInt)] // CHECK:STDOUT: %self.param: @Op.2.%MyInt (%MyInt) = value_param runtime_param0 +// CHECK:STDOUT: %Self.ref.loc16_15: type = name_ref Self, @impl.%MyInt.loc15_39.1 [symbolic = %MyInt (constants.%MyInt)] // CHECK:STDOUT: %self: @Op.2.%MyInt (%MyInt) = bind_name self, %self.param // CHECK:STDOUT: %other.param: @Op.2.%MyInt (%MyInt) = value_param runtime_param1 +// CHECK:STDOUT: %Self.ref.loc16_28: type = name_ref Self, @impl.%MyInt.loc15_39.1 [symbolic = %MyInt (constants.%MyInt)] // CHECK:STDOUT: %other: @Op.2.%MyInt (%MyInt) = bind_name other, %other.param // CHECK:STDOUT: %return.param: ref @Op.2.%MyInt (%MyInt) = out_param runtime_param2 // CHECK:STDOUT: %return: ref @Op.2.%MyInt (%MyInt) = return_slot %return.param @@ -432,7 +446,7 @@ var n: Int(64) = MakeFromClass(FromLiteral(64) as OtherInt); // CHECK:STDOUT: %import_ref.4: %MyInt.type = import_ref Main//generic_impl, MyInt, loaded [template = constants.%MyInt.generic] // CHECK:STDOUT: %import_ref.5: %Double.type = import_ref Main//generic_impl, Double, loaded [template = constants.%Double] // CHECK:STDOUT: %import_ref.7: = import_ref Main//generic_impl, loc13_1, loaded [symbolic = @MyInt.%complete_type (constants.%complete_type.1)] -// CHECK:STDOUT: %import_ref.8 = import_ref Main//generic_impl, inst85 [no loc], unloaded +// CHECK:STDOUT: %import_ref.8 = import_ref Main//generic_impl, inst89 [no loc], unloaded // CHECK:STDOUT: %import_ref.9 = import_ref Main//generic_impl, inst15 [no loc], unloaded // CHECK:STDOUT: %import_ref.10: %Op.assoc_type = import_ref Main//generic_impl, loc5_41, loaded [template = constants.%assoc0] // CHECK:STDOUT: %import_ref.11 = import_ref Main//generic_impl, Op, unloaded @@ -458,13 +472,15 @@ var n: Int(64) = MakeFromClass(FromLiteral(64) as OtherInt); // CHECK:STDOUT: %return.patt: %MyInt.2 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %MyInt.2 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %MyInt.ref.loc8_19: %MyInt.type = name_ref MyInt, imports.%import_ref.4 [template = constants.%MyInt.generic] -// CHECK:STDOUT: %int_64.loc8_25: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %MyInt.loc8_27: type = class_type @MyInt, @MyInt(constants.%int_64) [template = constants.%MyInt.2] // CHECK:STDOUT: %MyInt.ref.loc8_33: %MyInt.type = name_ref MyInt, imports.%import_ref.4 [template = constants.%MyInt.generic] // CHECK:STDOUT: %int_64.loc8_39: Core.IntLiteral = int_value 64 [template = constants.%int_64] // CHECK:STDOUT: %MyInt.loc8_41: type = class_type @MyInt, @MyInt(constants.%int_64) [template = constants.%MyInt.2] // CHECK:STDOUT: %x.param: %MyInt.2 = value_param runtime_param0 +// CHECK:STDOUT: %.loc8: type = splice_block %MyInt.loc8_27 [template = constants.%MyInt.2] { +// CHECK:STDOUT: %MyInt.ref.loc8_19: %MyInt.type = name_ref MyInt, imports.%import_ref.4 [template = constants.%MyInt.generic] +// CHECK:STDOUT: %int_64.loc8_25: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %MyInt.loc8_27: type = class_type @MyInt, @MyInt(constants.%int_64) [template = constants.%MyInt.2] +// CHECK:STDOUT: } // CHECK:STDOUT: %x: %MyInt.2 = bind_name x, %x.param // CHECK:STDOUT: %return.param: ref %MyInt.2 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %MyInt.2 = return_slot %return.param @@ -475,13 +491,15 @@ var n: Int(64) = MakeFromClass(FromLiteral(64) as OtherInt); // CHECK:STDOUT: %return.patt: %MyInt.2 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %MyInt.2 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %MyInt.ref.loc12_26: %MyInt.type = name_ref MyInt, imports.%import_ref.4 [template = constants.%MyInt.generic] -// CHECK:STDOUT: %int_64.loc12_32: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %MyInt.loc12_34: type = class_type @MyInt, @MyInt(constants.%int_64) [template = constants.%MyInt.2] // CHECK:STDOUT: %MyInt.ref.loc12_40: %MyInt.type = name_ref MyInt, imports.%import_ref.4 [template = constants.%MyInt.generic] // CHECK:STDOUT: %int_64.loc12_46: Core.IntLiteral = int_value 64 [template = constants.%int_64] // CHECK:STDOUT: %MyInt.loc12_48: type = class_type @MyInt, @MyInt(constants.%int_64) [template = constants.%MyInt.2] // CHECK:STDOUT: %n.param: %MyInt.2 = value_param runtime_param0 +// CHECK:STDOUT: %.loc12: type = splice_block %MyInt.loc12_34 [template = constants.%MyInt.2] { +// CHECK:STDOUT: %MyInt.ref.loc12_26: %MyInt.type = name_ref MyInt, imports.%import_ref.4 [template = constants.%MyInt.generic] +// CHECK:STDOUT: %int_64.loc12_32: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %MyInt.loc12_34: type = class_type @MyInt, @MyInt(constants.%int_64) [template = constants.%MyInt.2] +// CHECK:STDOUT: } // CHECK:STDOUT: %n: %MyInt.2 = bind_name n, %n.param // CHECK:STDOUT: %return.param: ref %MyInt.2 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %MyInt.2 = return_slot %return.param @@ -732,11 +750,13 @@ var n: Int(64) = MakeFromClass(FromLiteral(64) as OtherInt); // CHECK:STDOUT: %return.patt: type = return_slot_pattern // CHECK:STDOUT: %return.param_patt: type = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [template = constants.%IntLiteral] -// CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral] -// CHECK:STDOUT: %.loc5_22.1: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral] -// CHECK:STDOUT: %.loc5_22.2: type = converted %int_literal.make_type, %.loc5_22.1 [template = Core.IntLiteral] // CHECK:STDOUT: %n.param: Core.IntLiteral = value_param runtime_param0 +// CHECK:STDOUT: %.loc5_22.3: type = splice_block %.loc5_22.2 [template = Core.IntLiteral] { +// CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [template = constants.%IntLiteral] +// CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral] +// CHECK:STDOUT: %.loc5_22.1: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral] +// CHECK:STDOUT: %.loc5_22.2: type = converted %int_literal.make_type, %.loc5_22.1 [template = Core.IntLiteral] +// CHECK:STDOUT: } // CHECK:STDOUT: %n: Core.IntLiteral = bind_name n, %n.param // CHECK:STDOUT: %return.param: ref type = out_param runtime_param1 // CHECK:STDOUT: %return: ref type = return_slot %return.param @@ -747,16 +767,18 @@ var n: Int(64) = MakeFromClass(FromLiteral(64) as OtherInt); // CHECK:STDOUT: %return.patt: Core.IntLiteral = return_slot_pattern // CHECK:STDOUT: %return.param_patt: Core.IntLiteral = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Int.ref: %Int.type = name_ref Int, file.%Int.decl [template = constants.%Int] -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call %Int.ref(%int_32) [template = constants.%i32.builtin] -// CHECK:STDOUT: %.loc6_23.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32.builtin] -// CHECK:STDOUT: %.loc6_23.2: type = converted %int.make_type_signed, %.loc6_23.1 [template = constants.%i32.builtin] // CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [template = constants.%IntLiteral] // CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral] // CHECK:STDOUT: %.loc6_40.1: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral] // CHECK:STDOUT: %.loc6_40.2: type = converted %int_literal.make_type, %.loc6_40.1 [template = Core.IntLiteral] // CHECK:STDOUT: %n.param: %i32.builtin = value_param runtime_param0 +// CHECK:STDOUT: %.loc6_23.3: type = splice_block %.loc6_23.2 [template = constants.%i32.builtin] { +// CHECK:STDOUT: %Int.ref: %Int.type = name_ref Int, file.%Int.decl [template = constants.%Int] +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %int.make_type_signed: init type = call %Int.ref(%int_32) [template = constants.%i32.builtin] +// CHECK:STDOUT: %.loc6_23.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32.builtin] +// CHECK:STDOUT: %.loc6_23.2: type = converted %int.make_type_signed, %.loc6_23.1 [template = constants.%i32.builtin] +// CHECK:STDOUT: } // CHECK:STDOUT: %n: %i32.builtin = bind_name n, %n.param // CHECK:STDOUT: %return.param: ref Core.IntLiteral = out_param runtime_param1 // CHECK:STDOUT: %return: ref Core.IntLiteral = return_slot %return.param @@ -767,16 +789,18 @@ var n: Int(64) = MakeFromClass(FromLiteral(64) as OtherInt); // CHECK:STDOUT: %return.patt: %i32.builtin = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32.builtin = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [template = constants.%IntLiteral] -// CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral] -// CHECK:STDOUT: %.loc7_30.1: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral] -// CHECK:STDOUT: %.loc7_30.2: type = converted %int_literal.make_type, %.loc7_30.1 [template = Core.IntLiteral] // CHECK:STDOUT: %Int.ref: %Int.type = name_ref Int, file.%Int.decl [template = constants.%Int] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %int.make_type_signed: init type = call %Int.ref(%int_32) [template = constants.%i32.builtin] // CHECK:STDOUT: %.loc7_42.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32.builtin] // CHECK:STDOUT: %.loc7_42.2: type = converted %int.make_type_signed, %.loc7_42.1 [template = constants.%i32.builtin] // CHECK:STDOUT: %n.param: Core.IntLiteral = value_param runtime_param0 +// CHECK:STDOUT: %.loc7_30.3: type = splice_block %.loc7_30.2 [template = Core.IntLiteral] { +// CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [template = constants.%IntLiteral] +// CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral] +// CHECK:STDOUT: %.loc7_30.1: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral] +// CHECK:STDOUT: %.loc7_30.2: type = converted %int_literal.make_type, %.loc7_30.1 [template = Core.IntLiteral] +// CHECK:STDOUT: } // CHECK:STDOUT: %n: Core.IntLiteral = bind_name n, %n.param // CHECK:STDOUT: %return.param: ref %i32.builtin = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32.builtin = return_slot %return.param @@ -787,11 +811,6 @@ var n: Int(64) = MakeFromClass(FromLiteral(64) as OtherInt); // CHECK:STDOUT: %return.patt: @Make.%iN.builtin (%iN.builtin.1) = return_slot_pattern // CHECK:STDOUT: %return.param_patt: @Make.%iN.builtin (%iN.builtin.1) = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Int.ref.loc9_13: %Int.type = name_ref Int, file.%Int.decl [template = constants.%Int] -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc9_19: init type = call %Int.ref.loc9_13(%int_32) [template = constants.%i32.builtin] -// CHECK:STDOUT: %.loc9_19.1: type = value_of_initializer %int.make_type_signed.loc9_19 [template = constants.%i32.builtin] -// CHECK:STDOUT: %.loc9_19.2: type = converted %int.make_type_signed.loc9_19, %.loc9_19.1 [template = constants.%i32.builtin] // CHECK:STDOUT: %Int.ref.loc9_25: %Int.type = name_ref Int, file.%Int.decl [template = constants.%Int] // CHECK:STDOUT: %ToLiteral.ref: %ToLiteral.type.1 = name_ref ToLiteral, file.%ToLiteral.decl.loc6 [template = constants.%ToLiteral.1] // CHECK:STDOUT: %N.ref.loc9_39: %i32.builtin = name_ref N, %N.loc9_9.1 [symbolic = %N.loc9_9.2 (constants.%N.1)] @@ -802,6 +821,13 @@ var n: Int(64) = MakeFromClass(FromLiteral(64) as OtherInt); // CHECK:STDOUT: %.loc9_41.1: type = value_of_initializer %int.make_type_signed.loc9_41 [symbolic = %iN.builtin (constants.%iN.builtin.1)] // CHECK:STDOUT: %.loc9_41.2: type = converted %int.make_type_signed.loc9_41, %.loc9_41.1 [symbolic = %iN.builtin (constants.%iN.builtin.1)] // CHECK:STDOUT: %N.param: %i32.builtin = value_param runtime_param +// CHECK:STDOUT: %.loc9_19.3: type = splice_block %.loc9_19.2 [template = constants.%i32.builtin] { +// CHECK:STDOUT: %Int.ref.loc9_13: %Int.type = name_ref Int, file.%Int.decl [template = constants.%Int] +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %int.make_type_signed.loc9_19: init type = call %Int.ref.loc9_13(%int_32) [template = constants.%i32.builtin] +// CHECK:STDOUT: %.loc9_19.1: type = value_of_initializer %int.make_type_signed.loc9_19 [template = constants.%i32.builtin] +// CHECK:STDOUT: %.loc9_19.2: type = converted %int.make_type_signed.loc9_19, %.loc9_19.1 [template = constants.%i32.builtin] +// CHECK:STDOUT: } // CHECK:STDOUT: %N.loc9_9.1: %i32.builtin = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc9_9.2 (constants.%N.1)] // CHECK:STDOUT: %return.param: ref @Make.%iN.builtin (%iN.builtin.1) = out_param runtime_param0 // CHECK:STDOUT: %return: ref @Make.%iN.builtin (%iN.builtin.1) = return_slot %return.param @@ -813,12 +839,12 @@ var n: Int(64) = MakeFromClass(FromLiteral(64) as OtherInt); // CHECK:STDOUT: %return.patt: Core.IntLiteral = return_slot_pattern // CHECK:STDOUT: %return.param_patt: Core.IntLiteral = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref.loc16: type = name_ref Self, constants.%OtherInt [template = constants.%OtherInt] // CHECK:STDOUT: %IntLiteral.ref.loc16: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [template = constants.%IntLiteral] // CHECK:STDOUT: %int_literal.make_type.loc16: init type = call %IntLiteral.ref.loc16() [template = Core.IntLiteral] // CHECK:STDOUT: %.loc16_51.1: type = value_of_initializer %int_literal.make_type.loc16 [template = Core.IntLiteral] // CHECK:STDOUT: %.loc16_51.2: type = converted %int_literal.make_type.loc16, %.loc16_51.1 [template = Core.IntLiteral] // CHECK:STDOUT: %self.param.loc16: %OtherInt = value_param runtime_param0 +// CHECK:STDOUT: %Self.ref.loc16: type = name_ref Self, constants.%OtherInt [template = constants.%OtherInt] // CHECK:STDOUT: %self.loc16: %OtherInt = bind_name self, %self.param.loc16 // CHECK:STDOUT: %return.param.loc16: ref Core.IntLiteral = out_param runtime_param1 // CHECK:STDOUT: %return.loc16: ref Core.IntLiteral = return_slot %return.param.loc16 @@ -829,7 +855,6 @@ var n: Int(64) = MakeFromClass(FromLiteral(64) as OtherInt); // CHECK:STDOUT: %return.patt: @MakeFromClass.%iN.builtin (%iN.builtin.2) = return_slot_pattern // CHECK:STDOUT: %return.param_patt: @MakeFromClass.%iN.builtin (%iN.builtin.2) = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %OtherInt.ref: type = name_ref OtherInt, file.%OtherInt.decl [template = constants.%OtherInt] // CHECK:STDOUT: %Int.ref: %Int.type = name_ref Int, file.%Int.decl [template = constants.%Int] // CHECK:STDOUT: %N.ref.loc18_39: %OtherInt = name_ref N, %N.loc18_18.1 [symbolic = %N.loc18_18.2 (constants.%N.2)] // CHECK:STDOUT: %ToLiteral.ref: %ToLiteral.type.2 = name_ref ToLiteral, @OtherInt.%ToLiteral.decl [template = constants.%ToLiteral.2] @@ -841,6 +866,7 @@ var n: Int(64) = MakeFromClass(FromLiteral(64) as OtherInt); // CHECK:STDOUT: %.loc18_52.1: type = value_of_initializer %int.make_type_signed [symbolic = %iN.builtin (constants.%iN.builtin.2)] // CHECK:STDOUT: %.loc18_52.2: type = converted %int.make_type_signed, %.loc18_52.1 [symbolic = %iN.builtin (constants.%iN.builtin.2)] // CHECK:STDOUT: %N.param: %OtherInt = value_param runtime_param +// CHECK:STDOUT: %OtherInt.ref: type = name_ref OtherInt, file.%OtherInt.decl [template = constants.%OtherInt] // CHECK:STDOUT: %N.loc18_18.1: %OtherInt = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc18_18.2 (constants.%N.2)] // CHECK:STDOUT: %return.param: ref @MakeFromClass.%iN.builtin (%iN.builtin.2) = out_param runtime_param0 // CHECK:STDOUT: %return: ref @MakeFromClass.%iN.builtin (%iN.builtin.2) = return_slot %return.param @@ -860,12 +886,12 @@ var n: Int(64) = MakeFromClass(FromLiteral(64) as OtherInt); // CHECK:STDOUT: %return.patt: Core.IntLiteral = return_slot_pattern // CHECK:STDOUT: %return.param_patt: Core.IntLiteral = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref.loc13: type = name_ref Self, constants.%OtherInt [template = constants.%OtherInt] // CHECK:STDOUT: %IntLiteral.ref.loc13: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [template = constants.%IntLiteral] // CHECK:STDOUT: %int_literal.make_type.loc13: init type = call %IntLiteral.ref.loc13() [template = Core.IntLiteral] // CHECK:STDOUT: %.loc13_44.1: type = value_of_initializer %int_literal.make_type.loc13 [template = Core.IntLiteral] // CHECK:STDOUT: %.loc13_44.2: type = converted %int_literal.make_type.loc13, %.loc13_44.1 [template = Core.IntLiteral] // CHECK:STDOUT: %self.param.loc13: %OtherInt = value_param runtime_param0 +// CHECK:STDOUT: %Self.ref.loc13: type = name_ref Self, constants.%OtherInt [template = constants.%OtherInt] // CHECK:STDOUT: %self.loc13: %OtherInt = bind_name self, %self.param.loc13 // CHECK:STDOUT: %return.param.loc13: ref Core.IntLiteral = out_param runtime_param1 // CHECK:STDOUT: %return.loc13: ref Core.IntLiteral = return_slot %return.param.loc13 @@ -1010,7 +1036,7 @@ var n: Int(64) = MakeFromClass(FromLiteral(64) as OtherInt); // CHECK:STDOUT: %import_ref.6: type = import_ref Main//convert_symbolic, OtherInt, loaded [template = constants.%OtherInt] // CHECK:STDOUT: %import_ref.7: %MakeFromClass.type = import_ref Main//convert_symbolic, MakeFromClass, loaded [template = constants.%MakeFromClass] // CHECK:STDOUT: %import_ref.9: = import_ref Main//convert_symbolic, loc14_1, loaded [template = constants.%complete_type.1] -// CHECK:STDOUT: %import_ref.10 = import_ref Main//convert_symbolic, inst125 [no loc], unloaded +// CHECK:STDOUT: %import_ref.10 = import_ref Main//convert_symbolic, inst129 [no loc], unloaded // CHECK:STDOUT: %import_ref.11 = import_ref Main//convert_symbolic, loc13_45, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1027,18 +1053,8 @@ var n: Int(64) = MakeFromClass(FromLiteral(64) as OtherInt); // CHECK:STDOUT: .n = %n // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %Int.ref.loc6: %Int.type = name_ref Int, imports.%import_ref.2 [template = constants.%Int] -// CHECK:STDOUT: %int_64.loc6: Core.IntLiteral = int_value 64 [template = constants.%int_64.1] -// CHECK:STDOUT: %int.make_type_signed.loc6: init type = call %Int.ref.loc6(%int_64.loc6) [template = constants.%i64.builtin] -// CHECK:STDOUT: %.loc6_14.1: type = value_of_initializer %int.make_type_signed.loc6 [template = constants.%i64.builtin] -// CHECK:STDOUT: %.loc6_14.2: type = converted %int.make_type_signed.loc6, %.loc6_14.1 [template = constants.%i64.builtin] // CHECK:STDOUT: %m.var: ref %i64.builtin = var m // CHECK:STDOUT: %m: ref %i64.builtin = bind_name m, %m.var -// CHECK:STDOUT: %Int.ref.loc7: %Int.type = name_ref Int, imports.%import_ref.2 [template = constants.%Int] -// CHECK:STDOUT: %int_64.loc7: Core.IntLiteral = int_value 64 [template = constants.%int_64.1] -// CHECK:STDOUT: %int.make_type_signed.loc7: init type = call %Int.ref.loc7(%int_64.loc7) [template = constants.%i64.builtin] -// CHECK:STDOUT: %.loc7_14.1: type = value_of_initializer %int.make_type_signed.loc7 [template = constants.%i64.builtin] -// CHECK:STDOUT: %.loc7_14.2: type = converted %int.make_type_signed.loc7, %.loc7_14.1 [template = constants.%i64.builtin] // CHECK:STDOUT: %n.var: ref %i64.builtin = var n // CHECK:STDOUT: %n: ref %i64.builtin = bind_name n, %n.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/impl/no_prelude/import_extend_impl.carbon b/toolchain/check/testdata/impl/no_prelude/import_extend_impl.carbon index f7faa34949ad7..64f78a0faa336 100644 --- a/toolchain/check/testdata/impl/no_prelude/import_extend_impl.carbon +++ b/toolchain/check/testdata/impl/no_prelude/import_extend_impl.carbon @@ -151,8 +151,8 @@ fn G(c: C) { // CHECK:STDOUT: %c.patt: %C = binding_pattern c // CHECK:STDOUT: %c.param_patt: %C = value_param_pattern %c.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref.loc6: type = name_ref C, imports.%import_ref.2 [template = constants.%C] // CHECK:STDOUT: %c.param: %C = value_param runtime_param0 +// CHECK:STDOUT: %C.ref.loc6: type = name_ref C, imports.%import_ref.2 [template = constants.%C] // CHECK:STDOUT: %c: %C = bind_name c, %c.param // CHECK:STDOUT: } // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/impl/no_prelude/import_self.carbon b/toolchain/check/testdata/impl/no_prelude/import_self.carbon index cc725a2593ed0..482b8dfe78d4f 100644 --- a/toolchain/check/testdata/impl/no_prelude/import_self.carbon +++ b/toolchain/check/testdata/impl/no_prelude/import_self.carbon @@ -59,18 +59,22 @@ fn F(x: (), y: ()) -> () { // CHECK:STDOUT: %return.patt: @Op.%Self.as_type.loc5_15.1 (%Self.as_type) = return_slot_pattern // CHECK:STDOUT: %return.param_patt: @Op.%Self.as_type.loc5_15.1 (%Self.as_type) = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref.loc5_15: %Add.type = name_ref Self, @Add.%Self [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %Self.as_type.loc5_15.2: type = facet_access_type %Self.ref.loc5_15 [symbolic = %Self.as_type.loc5_15.1 (constants.%Self.as_type)] -// CHECK:STDOUT: %.loc5_15: type = converted %Self.ref.loc5_15, %Self.as_type.loc5_15.2 [symbolic = %Self.as_type.loc5_15.1 (constants.%Self.as_type)] -// CHECK:STDOUT: %Self.ref.loc5_28: %Add.type = name_ref Self, @Add.%Self [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %Self.as_type.loc5_28: type = facet_access_type %Self.ref.loc5_28 [symbolic = %Self.as_type.loc5_15.1 (constants.%Self.as_type)] -// CHECK:STDOUT: %.loc5_28: type = converted %Self.ref.loc5_28, %Self.as_type.loc5_28 [symbolic = %Self.as_type.loc5_15.1 (constants.%Self.as_type)] // CHECK:STDOUT: %Self.ref.loc5_37: %Add.type = name_ref Self, @Add.%Self [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: %Self.as_type.loc5_37: type = facet_access_type %Self.ref.loc5_37 [symbolic = %Self.as_type.loc5_15.1 (constants.%Self.as_type)] // CHECK:STDOUT: %.loc5_37: type = converted %Self.ref.loc5_37, %Self.as_type.loc5_37 [symbolic = %Self.as_type.loc5_15.1 (constants.%Self.as_type)] // CHECK:STDOUT: %self.param: @Op.%Self.as_type.loc5_15.1 (%Self.as_type) = value_param runtime_param0 +// CHECK:STDOUT: %.loc5_15.2: type = splice_block %.loc5_15.1 [symbolic = %Self.as_type.loc5_15.1 (constants.%Self.as_type)] { +// CHECK:STDOUT: %Self.ref.loc5_15: %Add.type = name_ref Self, @Add.%Self [symbolic = %Self (constants.%Self)] +// CHECK:STDOUT: %Self.as_type.loc5_15.2: type = facet_access_type %Self.ref.loc5_15 [symbolic = %Self.as_type.loc5_15.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %.loc5_15.1: type = converted %Self.ref.loc5_15, %Self.as_type.loc5_15.2 [symbolic = %Self.as_type.loc5_15.1 (constants.%Self.as_type)] +// CHECK:STDOUT: } // CHECK:STDOUT: %self: @Op.%Self.as_type.loc5_15.1 (%Self.as_type) = bind_name self, %self.param // CHECK:STDOUT: %other.param: @Op.%Self.as_type.loc5_15.1 (%Self.as_type) = value_param runtime_param1 +// CHECK:STDOUT: %.loc5_28.2: type = splice_block %.loc5_28.1 [symbolic = %Self.as_type.loc5_15.1 (constants.%Self.as_type)] { +// CHECK:STDOUT: %Self.ref.loc5_28: %Add.type = name_ref Self, @Add.%Self [symbolic = %Self (constants.%Self)] +// CHECK:STDOUT: %Self.as_type.loc5_28: type = facet_access_type %Self.ref.loc5_28 [symbolic = %Self.as_type.loc5_15.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %.loc5_28.1: type = converted %Self.ref.loc5_28, %Self.as_type.loc5_28 [symbolic = %Self.as_type.loc5_15.1 (constants.%Self.as_type)] +// CHECK:STDOUT: } // CHECK:STDOUT: %other: @Op.%Self.as_type.loc5_15.1 (%Self.as_type) = bind_name other, %other.param // CHECK:STDOUT: %return.param: ref @Op.%Self.as_type.loc5_15.1 (%Self.as_type) = out_param runtime_param2 // CHECK:STDOUT: %return: ref @Op.%Self.as_type.loc5_15.1 (%Self.as_type) = return_slot %return.param @@ -141,15 +145,19 @@ fn F(x: (), y: ()) -> () { // CHECK:STDOUT: %return.patt: %empty_tuple.type = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %empty_tuple.type = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc10_10.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc10_10.2: type = converted %.loc10_10.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] -// CHECK:STDOUT: %.loc10_17.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc10_17.2: type = converted %.loc10_17.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %.loc10_24.1: %empty_tuple.type = tuple_literal () // CHECK:STDOUT: %.loc10_24.2: type = converted %.loc10_24.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %x.param: %empty_tuple.type = value_param runtime_param0 +// CHECK:STDOUT: %.loc10_10.3: type = splice_block %.loc10_10.2 [template = constants.%empty_tuple.type] { +// CHECK:STDOUT: %.loc10_10.1: %empty_tuple.type = tuple_literal () +// CHECK:STDOUT: %.loc10_10.2: type = converted %.loc10_10.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] +// CHECK:STDOUT: } // CHECK:STDOUT: %x: %empty_tuple.type = bind_name x, %x.param // CHECK:STDOUT: %y.param: %empty_tuple.type = value_param runtime_param1 +// CHECK:STDOUT: %.loc10_17.3: type = splice_block %.loc10_17.2 [template = constants.%empty_tuple.type] { +// CHECK:STDOUT: %.loc10_17.1: %empty_tuple.type = tuple_literal () +// CHECK:STDOUT: %.loc10_17.2: type = converted %.loc10_17.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] +// CHECK:STDOUT: } // CHECK:STDOUT: %y: %empty_tuple.type = bind_name y, %y.param // CHECK:STDOUT: %return.param: ref %empty_tuple.type = out_param runtime_param2 // CHECK:STDOUT: %return: ref %empty_tuple.type = return_slot %return.param @@ -172,12 +180,12 @@ fn F(x: (), y: ()) -> () { // CHECK:STDOUT: %return.patt: %empty_tuple.type = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %empty_tuple.type = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref.loc7_15: type = name_ref Self, @impl.%.loc6_7.2 [template = constants.%empty_tuple.type] -// CHECK:STDOUT: %Self.ref.loc7_28: type = name_ref Self, @impl.%.loc6_7.2 [template = constants.%empty_tuple.type] // CHECK:STDOUT: %Self.ref.loc7_37: type = name_ref Self, @impl.%.loc6_7.2 [template = constants.%empty_tuple.type] // CHECK:STDOUT: %self.param: %empty_tuple.type = value_param runtime_param0 +// CHECK:STDOUT: %Self.ref.loc7_15: type = name_ref Self, @impl.%.loc6_7.2 [template = constants.%empty_tuple.type] // CHECK:STDOUT: %self: %empty_tuple.type = bind_name self, %self.param // CHECK:STDOUT: %other.param: %empty_tuple.type = value_param runtime_param1 +// CHECK:STDOUT: %Self.ref.loc7_28: type = name_ref Self, @impl.%.loc6_7.2 [template = constants.%empty_tuple.type] // CHECK:STDOUT: %other: %empty_tuple.type = bind_name other, %other.param // CHECK:STDOUT: %return.param: ref %empty_tuple.type = out_param runtime_param2 // CHECK:STDOUT: %return: ref %empty_tuple.type = return_slot %return.param diff --git a/toolchain/check/testdata/impl/no_prelude/import_use_generic.carbon b/toolchain/check/testdata/impl/no_prelude/import_use_generic.carbon index 66c1e6c9cff2a..e056317740819 100644 --- a/toolchain/check/testdata/impl/no_prelude/import_use_generic.carbon +++ b/toolchain/check/testdata/impl/no_prelude/import_use_generic.carbon @@ -223,10 +223,6 @@ fn F() -> c.(I.F)() {} // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %C.ref: %C.type = name_ref C, imports.%import_ref.1 [template = constants.%C.generic] -// CHECK:STDOUT: %.loc6_11: %empty_struct_type = struct_literal () -// CHECK:STDOUT: %.loc6_12: type = converted %.loc6_11, constants.%empty_struct_type [template = constants.%empty_struct_type] -// CHECK:STDOUT: %C: type = class_type @C, @C(constants.%empty_struct_type) [template = constants.%C.2] // CHECK:STDOUT: %c.var: ref %C.2 = var c // CHECK:STDOUT: %c: ref %C.2 = bind_name c, %c.var // CHECK:STDOUT: %F.decl: %F.type.4 = fn_decl @F.3 [template = constants.%F.4] { diff --git a/toolchain/check/testdata/impl/no_prelude/interface_args.carbon b/toolchain/check/testdata/impl/no_prelude/interface_args.carbon index feec609fe90a2..274b01380d9d8 100644 --- a/toolchain/check/testdata/impl/no_prelude/interface_args.carbon +++ b/toolchain/check/testdata/impl/no_prelude/interface_args.carbon @@ -138,8 +138,8 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: %a.patt: %A = binding_pattern a // CHECK:STDOUT: %a.param_patt: %A = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%A] // CHECK:STDOUT: %a.param: %A = value_param runtime_param0 +// CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%A] // CHECK:STDOUT: %a: %A = bind_name a, %a.param // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -314,8 +314,8 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: %a.patt: %A = binding_pattern a // CHECK:STDOUT: %a.param_patt: %A = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %A.ref: type = name_ref A, imports.%import_ref.2 [template = constants.%A] // CHECK:STDOUT: %a.param: %A = value_param runtime_param0 +// CHECK:STDOUT: %A.ref: type = name_ref A, imports.%import_ref.2 [template = constants.%A] // CHECK:STDOUT: %a: %A = bind_name a, %a.param // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -470,8 +470,8 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: %a.patt: %A = binding_pattern a // CHECK:STDOUT: %a.param_patt: %A = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %A.ref: type = name_ref A, imports.%import_ref.2 [template = constants.%A] // CHECK:STDOUT: %a.param: %A = value_param runtime_param0 +// CHECK:STDOUT: %A.ref: type = name_ref A, imports.%import_ref.2 [template = constants.%A] // CHECK:STDOUT: %a: %A = bind_name a, %a.param // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -784,9 +784,9 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: %return.patt: %B = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %B = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %A.ref: type = name_ref A, imports.%import_ref.2 [template = constants.%A] // CHECK:STDOUT: %B.ref.loc4: type = name_ref B, imports.%import_ref.3 [template = constants.%B] // CHECK:STDOUT: %a.param: %A = value_param runtime_param0 +// CHECK:STDOUT: %A.ref: type = name_ref A, imports.%import_ref.2 [template = constants.%A] // CHECK:STDOUT: %a: %A = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %B = out_param runtime_param1 // CHECK:STDOUT: %return: ref %B = return_slot %return.param @@ -945,9 +945,9 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: %return.patt: %C = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %C = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %A.ref: type = name_ref A, imports.%import_ref.2 [template = constants.%A] // CHECK:STDOUT: %C.ref.loc6: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a.param: %A = value_param runtime_param0 +// CHECK:STDOUT: %A.ref: type = name_ref A, imports.%import_ref.2 [template = constants.%A] // CHECK:STDOUT: %a: %A = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %C = out_param runtime_param1 // CHECK:STDOUT: %return: ref %C = return_slot %return.param diff --git a/toolchain/check/testdata/impl/no_prelude/self_in_signature.carbon b/toolchain/check/testdata/impl/no_prelude/self_in_signature.carbon index ccf7121923551..6e5882c3e1004 100644 --- a/toolchain/check/testdata/impl/no_prelude/self_in_signature.carbon +++ b/toolchain/check/testdata/impl/no_prelude/self_in_signature.carbon @@ -127,18 +127,22 @@ impl D as SelfNested { // CHECK:STDOUT: %return.patt: @F.1.%Self.as_type.loc12_14.1 (%Self.as_type.1) = return_slot_pattern // CHECK:STDOUT: %return.param_patt: @F.1.%Self.as_type.loc12_14.1 (%Self.as_type.1) = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref.loc12_14: %UseSelf.type = name_ref Self, @UseSelf.%Self [symbolic = %Self (constants.%Self.1)] -// CHECK:STDOUT: %Self.as_type.loc12_14.2: type = facet_access_type %Self.ref.loc12_14 [symbolic = %Self.as_type.loc12_14.1 (constants.%Self.as_type.1)] -// CHECK:STDOUT: %.loc12_14: type = converted %Self.ref.loc12_14, %Self.as_type.loc12_14.2 [symbolic = %Self.as_type.loc12_14.1 (constants.%Self.as_type.1)] -// CHECK:STDOUT: %Self.ref.loc12_23: %UseSelf.type = name_ref Self, @UseSelf.%Self [symbolic = %Self (constants.%Self.1)] -// CHECK:STDOUT: %Self.as_type.loc12_23: type = facet_access_type %Self.ref.loc12_23 [symbolic = %Self.as_type.loc12_14.1 (constants.%Self.as_type.1)] -// CHECK:STDOUT: %.loc12_23: type = converted %Self.ref.loc12_23, %Self.as_type.loc12_23 [symbolic = %Self.as_type.loc12_14.1 (constants.%Self.as_type.1)] // CHECK:STDOUT: %Self.ref.loc12_32: %UseSelf.type = name_ref Self, @UseSelf.%Self [symbolic = %Self (constants.%Self.1)] // CHECK:STDOUT: %Self.as_type.loc12_32: type = facet_access_type %Self.ref.loc12_32 [symbolic = %Self.as_type.loc12_14.1 (constants.%Self.as_type.1)] // CHECK:STDOUT: %.loc12_32: type = converted %Self.ref.loc12_32, %Self.as_type.loc12_32 [symbolic = %Self.as_type.loc12_14.1 (constants.%Self.as_type.1)] // CHECK:STDOUT: %self.param: @F.1.%Self.as_type.loc12_14.1 (%Self.as_type.1) = value_param runtime_param0 +// CHECK:STDOUT: %.loc12_14.2: type = splice_block %.loc12_14.1 [symbolic = %Self.as_type.loc12_14.1 (constants.%Self.as_type.1)] { +// CHECK:STDOUT: %Self.ref.loc12_14: %UseSelf.type = name_ref Self, @UseSelf.%Self [symbolic = %Self (constants.%Self.1)] +// CHECK:STDOUT: %Self.as_type.loc12_14.2: type = facet_access_type %Self.ref.loc12_14 [symbolic = %Self.as_type.loc12_14.1 (constants.%Self.as_type.1)] +// CHECK:STDOUT: %.loc12_14.1: type = converted %Self.ref.loc12_14, %Self.as_type.loc12_14.2 [symbolic = %Self.as_type.loc12_14.1 (constants.%Self.as_type.1)] +// CHECK:STDOUT: } // CHECK:STDOUT: %self: @F.1.%Self.as_type.loc12_14.1 (%Self.as_type.1) = bind_name self, %self.param // CHECK:STDOUT: %x.param: @F.1.%Self.as_type.loc12_14.1 (%Self.as_type.1) = value_param runtime_param1 +// CHECK:STDOUT: %.loc12_23.2: type = splice_block %.loc12_23.1 [symbolic = %Self.as_type.loc12_14.1 (constants.%Self.as_type.1)] { +// CHECK:STDOUT: %Self.ref.loc12_23: %UseSelf.type = name_ref Self, @UseSelf.%Self [symbolic = %Self (constants.%Self.1)] +// CHECK:STDOUT: %Self.as_type.loc12_23: type = facet_access_type %Self.ref.loc12_23 [symbolic = %Self.as_type.loc12_14.1 (constants.%Self.as_type.1)] +// CHECK:STDOUT: %.loc12_23.1: type = converted %Self.ref.loc12_23, %Self.as_type.loc12_23 [symbolic = %Self.as_type.loc12_14.1 (constants.%Self.as_type.1)] +// CHECK:STDOUT: } // CHECK:STDOUT: %x: @F.1.%Self.as_type.loc12_14.1 (%Self.as_type.1) = bind_name x, %x.param // CHECK:STDOUT: %return.param: ref @F.1.%Self.as_type.loc12_14.1 (%Self.as_type.1) = out_param runtime_param2 // CHECK:STDOUT: %return: ref @F.1.%Self.as_type.loc12_14.1 (%Self.as_type.1) = return_slot %return.param @@ -157,19 +161,21 @@ impl D as SelfNested { // CHECK:STDOUT: %x.patt: @F.4.%tuple.type (%tuple.type.2) = binding_pattern x // CHECK:STDOUT: %x.param_patt: @F.4.%tuple.type (%tuple.type.2) = value_param_pattern %x.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref.loc28_12: %SelfNested.type = name_ref Self, @SelfNested.%Self [symbolic = %Self (constants.%Self.2)] -// CHECK:STDOUT: %Self.as_type.loc28_16.2: type = facet_access_type %Self.ref.loc28_12 [symbolic = %Self.as_type.loc28_16.1 (constants.%Self.as_type.2)] -// CHECK:STDOUT: %.loc28_16: type = converted %Self.ref.loc28_12, %Self.as_type.loc28_16.2 [symbolic = %Self.as_type.loc28_16.1 (constants.%Self.as_type.2)] -// CHECK:STDOUT: %ptr.loc28_16.2: type = ptr_type %Self.as_type.2 [symbolic = %ptr.loc28_16.1 (constants.%ptr.2)] -// CHECK:STDOUT: %Self.ref.loc28_24: %SelfNested.type = name_ref Self, @SelfNested.%Self [symbolic = %Self (constants.%Self.2)] -// CHECK:STDOUT: %Self.as_type.loc28_24: type = facet_access_type %Self.ref.loc28_24 [symbolic = %Self.as_type.loc28_16.1 (constants.%Self.as_type.2)] -// CHECK:STDOUT: %.loc28_24: type = converted %Self.ref.loc28_24, %Self.as_type.loc28_24 [symbolic = %Self.as_type.loc28_16.1 (constants.%Self.as_type.2)] -// CHECK:STDOUT: %.loc28_35.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc28_35.2: type = converted %.loc28_35.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] -// CHECK:STDOUT: %struct_type.x.y.loc28_36.2: type = struct_type {.x: %Self.as_type.2, .y: %empty_tuple.type} [symbolic = %struct_type.x.y.loc28_36.1 (constants.%struct_type.x.y.1)] -// CHECK:STDOUT: %.loc28_37.1: %tuple.type.1 = tuple_literal (%ptr.loc28_16.2, %struct_type.x.y.loc28_36.2) -// CHECK:STDOUT: %.loc28_37.2: type = converted %.loc28_37.1, constants.%tuple.type.2 [symbolic = %tuple.type (constants.%tuple.type.2)] // CHECK:STDOUT: %x.param: @F.4.%tuple.type (%tuple.type.2) = value_param runtime_param0 +// CHECK:STDOUT: %.loc28_37.3: type = splice_block %.loc28_37.2 [symbolic = %tuple.type (constants.%tuple.type.2)] { +// CHECK:STDOUT: %Self.ref.loc28_12: %SelfNested.type = name_ref Self, @SelfNested.%Self [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: %Self.as_type.loc28_16.2: type = facet_access_type %Self.ref.loc28_12 [symbolic = %Self.as_type.loc28_16.1 (constants.%Self.as_type.2)] +// CHECK:STDOUT: %.loc28_16: type = converted %Self.ref.loc28_12, %Self.as_type.loc28_16.2 [symbolic = %Self.as_type.loc28_16.1 (constants.%Self.as_type.2)] +// CHECK:STDOUT: %ptr.loc28_16.2: type = ptr_type %Self.as_type.2 [symbolic = %ptr.loc28_16.1 (constants.%ptr.2)] +// CHECK:STDOUT: %Self.ref.loc28_24: %SelfNested.type = name_ref Self, @SelfNested.%Self [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: %Self.as_type.loc28_24: type = facet_access_type %Self.ref.loc28_24 [symbolic = %Self.as_type.loc28_16.1 (constants.%Self.as_type.2)] +// CHECK:STDOUT: %.loc28_24: type = converted %Self.ref.loc28_24, %Self.as_type.loc28_24 [symbolic = %Self.as_type.loc28_16.1 (constants.%Self.as_type.2)] +// CHECK:STDOUT: %.loc28_35.1: %empty_tuple.type = tuple_literal () +// CHECK:STDOUT: %.loc28_35.2: type = converted %.loc28_35.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] +// CHECK:STDOUT: %struct_type.x.y.loc28_36.2: type = struct_type {.x: %Self.as_type.2, .y: %empty_tuple.type} [symbolic = %struct_type.x.y.loc28_36.1 (constants.%struct_type.x.y.1)] +// CHECK:STDOUT: %.loc28_37.1: %tuple.type.1 = tuple_literal (%ptr.loc28_16.2, %struct_type.x.y.loc28_36.2) +// CHECK:STDOUT: %.loc28_37.2: type = converted %.loc28_37.1, constants.%tuple.type.2 [symbolic = %tuple.type (constants.%tuple.type.2)] +// CHECK:STDOUT: } // CHECK:STDOUT: %x: @F.4.%tuple.type (%tuple.type.2) = bind_name x, %x.param // CHECK:STDOUT: } // CHECK:STDOUT: %assoc0: %F.assoc_type.2 = assoc_entity element0, %F.decl [template = constants.%assoc0.2] @@ -189,12 +195,12 @@ impl D as SelfNested { // CHECK:STDOUT: %return.patt: %C = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %C = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref.loc20_14: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %C.ref.loc20_20: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %C.ref.loc20_26: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %self.param: %C = value_param runtime_param0 +// CHECK:STDOUT: %C.ref.loc20_14: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %self: %C = bind_name self, %self.param // CHECK:STDOUT: %x.param: %C = value_param runtime_param1 +// CHECK:STDOUT: %C.ref.loc20_20: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %x: %C = bind_name x, %x.param // CHECK:STDOUT: %return.param: ref %C = out_param runtime_param2 // CHECK:STDOUT: %return: ref %C = return_slot %return.param @@ -215,12 +221,12 @@ impl D as SelfNested { // CHECK:STDOUT: %return.patt: %D = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %D = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref.loc24_14: type = name_ref Self, @impl.2.%D.ref [template = constants.%D] -// CHECK:STDOUT: %Self.ref.loc24_23: type = name_ref Self, @impl.2.%D.ref [template = constants.%D] // CHECK:STDOUT: %Self.ref.loc24_32: type = name_ref Self, @impl.2.%D.ref [template = constants.%D] // CHECK:STDOUT: %self.param: %D = value_param runtime_param0 +// CHECK:STDOUT: %Self.ref.loc24_14: type = name_ref Self, @impl.2.%D.ref [template = constants.%D] // CHECK:STDOUT: %self: %D = bind_name self, %self.param // CHECK:STDOUT: %x.param: %D = value_param runtime_param1 +// CHECK:STDOUT: %Self.ref.loc24_23: type = name_ref Self, @impl.2.%D.ref [template = constants.%D] // CHECK:STDOUT: %x: %D = bind_name x, %x.param // CHECK:STDOUT: %return.param: ref %D = out_param runtime_param2 // CHECK:STDOUT: %return: ref %D = return_slot %return.param @@ -237,15 +243,17 @@ impl D as SelfNested { // CHECK:STDOUT: %x.patt: %tuple.type.3 = binding_pattern x // CHECK:STDOUT: %x.param_patt: %tuple.type.3 = value_param_pattern %x.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref.loc32_12: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %ptr: type = ptr_type %C [template = constants.%ptr.3] -// CHECK:STDOUT: %C.ref.loc32_21: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %.loc32_29.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc32_29.2: type = converted %.loc32_29.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] -// CHECK:STDOUT: %struct_type.x.y: type = struct_type {.x: %C, .y: %empty_tuple.type} [template = constants.%struct_type.x.y.2] -// CHECK:STDOUT: %.loc32_31.1: %tuple.type.1 = tuple_literal (%ptr, %struct_type.x.y) -// CHECK:STDOUT: %.loc32_31.2: type = converted %.loc32_31.1, constants.%tuple.type.3 [template = constants.%tuple.type.3] // CHECK:STDOUT: %x.param: %tuple.type.3 = value_param runtime_param0 +// CHECK:STDOUT: %.loc32_31.3: type = splice_block %.loc32_31.2 [template = constants.%tuple.type.3] { +// CHECK:STDOUT: %C.ref.loc32_12: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %ptr: type = ptr_type %C [template = constants.%ptr.3] +// CHECK:STDOUT: %C.ref.loc32_21: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %.loc32_29.1: %empty_tuple.type = tuple_literal () +// CHECK:STDOUT: %.loc32_29.2: type = converted %.loc32_29.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] +// CHECK:STDOUT: %struct_type.x.y: type = struct_type {.x: %C, .y: %empty_tuple.type} [template = constants.%struct_type.x.y.2] +// CHECK:STDOUT: %.loc32_31.1: %tuple.type.1 = tuple_literal (%ptr, %struct_type.x.y) +// CHECK:STDOUT: %.loc32_31.2: type = converted %.loc32_31.1, constants.%tuple.type.3 [template = constants.%tuple.type.3] +// CHECK:STDOUT: } // CHECK:STDOUT: %x: %tuple.type.3 = bind_name x, %x.param // CHECK:STDOUT: } // CHECK:STDOUT: %interface: = interface_witness (%F.decl) [template = constants.%interface.3] @@ -260,15 +268,17 @@ impl D as SelfNested { // CHECK:STDOUT: %x.patt: %tuple.type.4 = binding_pattern x // CHECK:STDOUT: %x.param_patt: %tuple.type.4 = value_param_pattern %x.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref.loc36_12: type = name_ref Self, @impl.4.%D.ref [template = constants.%D] -// CHECK:STDOUT: %ptr: type = ptr_type %D [template = constants.%ptr.4] -// CHECK:STDOUT: %Self.ref.loc36_24: type = name_ref Self, @impl.4.%D.ref [template = constants.%D] -// CHECK:STDOUT: %.loc36_35.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc36_35.2: type = converted %.loc36_35.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] -// CHECK:STDOUT: %struct_type.x.y: type = struct_type {.x: %D, .y: %empty_tuple.type} [template = constants.%struct_type.x.y.3] -// CHECK:STDOUT: %.loc36_37.1: %tuple.type.1 = tuple_literal (%ptr, %struct_type.x.y) -// CHECK:STDOUT: %.loc36_37.2: type = converted %.loc36_37.1, constants.%tuple.type.4 [template = constants.%tuple.type.4] // CHECK:STDOUT: %x.param: %tuple.type.4 = value_param runtime_param0 +// CHECK:STDOUT: %.loc36_37.3: type = splice_block %.loc36_37.2 [template = constants.%tuple.type.4] { +// CHECK:STDOUT: %Self.ref.loc36_12: type = name_ref Self, @impl.4.%D.ref [template = constants.%D] +// CHECK:STDOUT: %ptr: type = ptr_type %D [template = constants.%ptr.4] +// CHECK:STDOUT: %Self.ref.loc36_24: type = name_ref Self, @impl.4.%D.ref [template = constants.%D] +// CHECK:STDOUT: %.loc36_35.1: %empty_tuple.type = tuple_literal () +// CHECK:STDOUT: %.loc36_35.2: type = converted %.loc36_35.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] +// CHECK:STDOUT: %struct_type.x.y: type = struct_type {.x: %D, .y: %empty_tuple.type} [template = constants.%struct_type.x.y.3] +// CHECK:STDOUT: %.loc36_37.1: %tuple.type.1 = tuple_literal (%ptr, %struct_type.x.y) +// CHECK:STDOUT: %.loc36_37.2: type = converted %.loc36_37.1, constants.%tuple.type.4 [template = constants.%tuple.type.4] +// CHECK:STDOUT: } // CHECK:STDOUT: %x: %tuple.type.4 = bind_name x, %x.param // CHECK:STDOUT: } // CHECK:STDOUT: %interface: = interface_witness (%F.decl) [template = constants.%interface.4] diff --git a/toolchain/check/testdata/index/array_element_access.carbon b/toolchain/check/testdata/index/array_element_access.carbon index b712a43989a52..e4abbc748d764 100644 --- a/toolchain/check/testdata/index/array_element_access.carbon +++ b/toolchain/check/testdata/index/array_element_access.carbon @@ -62,22 +62,12 @@ var d: i32 = a[b]; // CHECK:STDOUT: .d = %d // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int_32.loc11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2] -// CHECK:STDOUT: %array_type: type = array_type %int_2, %i32 [template = constants.%array_type] // CHECK:STDOUT: %a.var: ref %array_type = var a // CHECK:STDOUT: %a: ref %array_type = bind_name a, %a.var -// CHECK:STDOUT: %int_32.loc12: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc12: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %b.var: ref %i32 = var b // CHECK:STDOUT: %b: ref %i32 = bind_name b, %b.var -// CHECK:STDOUT: %int_32.loc13: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc13: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %c.var: ref %i32 = var c // CHECK:STDOUT: %c: ref %i32 = bind_name c, %c.var -// CHECK:STDOUT: %int_32.loc14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %d.var: ref %i32 = var d // CHECK:STDOUT: %d: ref %i32 = bind_name d, %d.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/index/expr_category.carbon b/toolchain/check/testdata/index/expr_category.carbon index c3cf079c78ac1..a5667ffb04377 100644 --- a/toolchain/check/testdata/index/expr_category.carbon +++ b/toolchain/check/testdata/index/expr_category.carbon @@ -101,22 +101,26 @@ fn ValueBinding(b: [i32; 3]) { // CHECK:STDOUT: %b.patt: %array_type = binding_pattern b // CHECK:STDOUT: %b.param_patt: %array_type = value_param_pattern %b.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc13: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc13: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_3.loc13: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] -// CHECK:STDOUT: %array_type.loc13: type = array_type %int_3.loc13, %i32 [template = constants.%array_type] // CHECK:STDOUT: %b.param: %array_type = value_param runtime_param0 +// CHECK:STDOUT: %.loc13: type = splice_block %array_type [template = constants.%array_type] { +// CHECK:STDOUT: %int_32.loc13: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc13: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %int_3.loc13: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] +// CHECK:STDOUT: %array_type: type = array_type %int_3.loc13, %i32 [template = constants.%array_type] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: %array_type = bind_name b, %b.param // CHECK:STDOUT: } // CHECK:STDOUT: %ValueBinding.decl: %ValueBinding.type = fn_decl @ValueBinding [template = constants.%ValueBinding] { // CHECK:STDOUT: %b.patt: %array_type = binding_pattern b // CHECK:STDOUT: %b.param_patt: %array_type = value_param_pattern %b.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc21: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc21: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_3.loc21: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] -// CHECK:STDOUT: %array_type.loc21: type = array_type %int_3.loc21, %i32 [template = constants.%array_type] // CHECK:STDOUT: %b.param: %array_type = value_param runtime_param0 +// CHECK:STDOUT: %.loc21: type = splice_block %array_type [template = constants.%array_type] { +// CHECK:STDOUT: %int_32.loc21: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc21: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %int_3.loc21: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] +// CHECK:STDOUT: %array_type: type = array_type %int_3.loc21, %i32 [template = constants.%array_type] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: %array_type = bind_name b, %b.param // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -125,16 +129,12 @@ fn ValueBinding(b: [i32; 3]) { // CHECK:STDOUT: // CHECK:STDOUT: fn @G(%b.param_patt: %array_type) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int_32.loc14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_3.loc14_16: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] -// CHECK:STDOUT: %array_type.loc14: type = array_type %int_3.loc14_16, %i32 [template = constants.%array_type] // CHECK:STDOUT: %a.var: ref %array_type = var a // CHECK:STDOUT: %a: ref %array_type = bind_name a, %a.var // CHECK:STDOUT: %int_1.loc14_22: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_2.loc14_25: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %int_3.loc14_28: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] -// CHECK:STDOUT: %.loc14_29.1: %tuple.type = tuple_literal (%int_1.loc14_22, %int_2.loc14_25, %int_3.loc14_28) +// CHECK:STDOUT: %int_3.loc14: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] +// CHECK:STDOUT: %.loc14_29.1: %tuple.type = tuple_literal (%int_1.loc14_22, %int_2.loc14_25, %int_3.loc14) // CHECK:STDOUT: %impl.elem0.loc14_29.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc14_29.1: = bound_method %int_1.loc14_22, %impl.elem0.loc14_29.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc14_29.1: = specific_function %Convert.bound.loc14_29.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] @@ -152,25 +152,22 @@ fn ValueBinding(b: [i32; 3]) { // CHECK:STDOUT: %.loc14_29.6: ref %i32 = array_index %a.var, %int_1.loc14_29 // CHECK:STDOUT: %.loc14_29.7: init %i32 = initialize_from %.loc14_29.5 to %.loc14_29.6 [template = constants.%int_2.2] // CHECK:STDOUT: %impl.elem0.loc14_29.3: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc14_29.3: = bound_method %int_3.loc14_28, %impl.elem0.loc14_29.3 [template = constants.%Convert.bound.3] +// CHECK:STDOUT: %Convert.bound.loc14_29.3: = bound_method %int_3.loc14, %impl.elem0.loc14_29.3 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc14_29.3: = specific_function %Convert.bound.loc14_29.3, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] -// CHECK:STDOUT: %int.convert_checked.loc14_29.3: init %i32 = call %Convert.specific_fn.loc14_29.3(%int_3.loc14_28) [template = constants.%int_3.2] -// CHECK:STDOUT: %.loc14_29.8: init %i32 = converted %int_3.loc14_28, %int.convert_checked.loc14_29.3 [template = constants.%int_3.2] +// CHECK:STDOUT: %int.convert_checked.loc14_29.3: init %i32 = call %Convert.specific_fn.loc14_29.3(%int_3.loc14) [template = constants.%int_3.2] +// CHECK:STDOUT: %.loc14_29.8: init %i32 = converted %int_3.loc14, %int.convert_checked.loc14_29.3 [template = constants.%int_3.2] // CHECK:STDOUT: %int_2.loc14_29: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %.loc14_29.9: ref %i32 = array_index %a.var, %int_2.loc14_29 // CHECK:STDOUT: %.loc14_29.10: init %i32 = initialize_from %.loc14_29.8 to %.loc14_29.9 [template = constants.%int_3.2] // CHECK:STDOUT: %.loc14_29.11: init %array_type = array_init (%.loc14_29.4, %.loc14_29.7, %.loc14_29.10) to %a.var [template = constants.%array] // CHECK:STDOUT: %.loc14_30: init %array_type = converted %.loc14_29.1, %.loc14_29.11 [template = constants.%array] // CHECK:STDOUT: assign %a.var, %.loc14_30 -// CHECK:STDOUT: %int_32.loc17_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc17_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %ptr: type = ptr_type %i32 [template = constants.%ptr.2] // CHECK:STDOUT: %pa.var: ref %ptr.2 = var pa // CHECK:STDOUT: %pa: ref %ptr.2 = bind_name pa, %pa.var // CHECK:STDOUT: %a.ref.loc17: ref %array_type = name_ref a, %a // CHECK:STDOUT: %int_0.loc17: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %int_32.loc17_22: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc17_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %int_32.loc17: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %impl.elem0.loc17: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc17: = bound_method %int_0.loc17, %impl.elem0.loc17 [template = constants.%Convert.bound.4] // CHECK:STDOUT: %Convert.specific_fn.loc17: = specific_function %Convert.bound.loc17, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.4] @@ -203,16 +200,12 @@ fn ValueBinding(b: [i32; 3]) { // CHECK:STDOUT: // CHECK:STDOUT: fn @ValueBinding(%b.param_patt: %array_type) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int_32.loc22: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_3.loc22_16: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] -// CHECK:STDOUT: %array_type.loc22: type = array_type %int_3.loc22_16, %i32 [template = constants.%array_type] // CHECK:STDOUT: %a.var: ref %array_type = var a // CHECK:STDOUT: %a: ref %array_type = bind_name a, %a.var // CHECK:STDOUT: %int_1.loc22_22: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_2.loc22_25: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %int_3.loc22_28: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] -// CHECK:STDOUT: %.loc22_29.1: %tuple.type = tuple_literal (%int_1.loc22_22, %int_2.loc22_25, %int_3.loc22_28) +// CHECK:STDOUT: %int_3.loc22: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] +// CHECK:STDOUT: %.loc22_29.1: %tuple.type = tuple_literal (%int_1.loc22_22, %int_2.loc22_25, %int_3.loc22) // CHECK:STDOUT: %impl.elem0.loc22_29.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc22_29.1: = bound_method %int_1.loc22_22, %impl.elem0.loc22_29.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc22_29.1: = specific_function %Convert.bound.loc22_29.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] @@ -230,10 +223,10 @@ fn ValueBinding(b: [i32; 3]) { // CHECK:STDOUT: %.loc22_29.6: ref %i32 = array_index %a.var, %int_1.loc22_29 // CHECK:STDOUT: %.loc22_29.7: init %i32 = initialize_from %.loc22_29.5 to %.loc22_29.6 [template = constants.%int_2.2] // CHECK:STDOUT: %impl.elem0.loc22_29.3: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc22_29.3: = bound_method %int_3.loc22_28, %impl.elem0.loc22_29.3 [template = constants.%Convert.bound.3] +// CHECK:STDOUT: %Convert.bound.loc22_29.3: = bound_method %int_3.loc22, %impl.elem0.loc22_29.3 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc22_29.3: = specific_function %Convert.bound.loc22_29.3, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] -// CHECK:STDOUT: %int.convert_checked.loc22_29.3: init %i32 = call %Convert.specific_fn.loc22_29.3(%int_3.loc22_28) [template = constants.%int_3.2] -// CHECK:STDOUT: %.loc22_29.8: init %i32 = converted %int_3.loc22_28, %int.convert_checked.loc22_29.3 [template = constants.%int_3.2] +// CHECK:STDOUT: %int.convert_checked.loc22_29.3: init %i32 = call %Convert.specific_fn.loc22_29.3(%int_3.loc22) [template = constants.%int_3.2] +// CHECK:STDOUT: %.loc22_29.8: init %i32 = converted %int_3.loc22, %int.convert_checked.loc22_29.3 [template = constants.%int_3.2] // CHECK:STDOUT: %int_2.loc22_29: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %.loc22_29.9: ref %i32 = array_index %a.var, %int_2.loc22_29 // CHECK:STDOUT: %.loc22_29.10: init %i32 = initialize_from %.loc22_29.8 to %.loc22_29.9 [template = constants.%int_3.2] diff --git a/toolchain/check/testdata/index/fail_array_large_index.carbon b/toolchain/check/testdata/index/fail_array_large_index.carbon index a59163be8ae49..25dc37dbfc3d7 100644 --- a/toolchain/check/testdata/index/fail_array_large_index.carbon +++ b/toolchain/check/testdata/index/fail_array_large_index.carbon @@ -65,18 +65,10 @@ var c: i32 = a[0x7FFF_FFFF]; // CHECK:STDOUT: .c = %c // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int_32.loc11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %array_type: type = array_type %int_1, %i32 [template = constants.%array_type] // CHECK:STDOUT: %a.var: ref %array_type = var a // CHECK:STDOUT: %a: ref %array_type = bind_name a, %a.var -// CHECK:STDOUT: %int_32.loc17: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %b.var: ref %i32 = var b // CHECK:STDOUT: %b: ref %i32 = bind_name b, %b.var -// CHECK:STDOUT: %int_32.loc22: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %c.var: ref %i32 = var c // CHECK:STDOUT: %c: ref %i32 = bind_name c, %c.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/index/fail_array_non_int_indexing.carbon b/toolchain/check/testdata/index/fail_array_non_int_indexing.carbon index d344adf94016f..b345fd685529c 100644 --- a/toolchain/check/testdata/index/fail_array_non_int_indexing.carbon +++ b/toolchain/check/testdata/index/fail_array_non_int_indexing.carbon @@ -54,14 +54,8 @@ var b: i32 = a[2.6]; // CHECK:STDOUT: .b = %b // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int_32.loc11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1] -// CHECK:STDOUT: %array_type: type = array_type %int_1, %i32 [template = constants.%array_type] // CHECK:STDOUT: %a.var: ref %array_type = var a // CHECK:STDOUT: %a: ref %array_type = bind_name a, %a.var -// CHECK:STDOUT: %int_32.loc18: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc18: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %b.var: ref %i32 = var b // CHECK:STDOUT: %b: ref %i32 = bind_name b, %b.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/index/fail_array_out_of_bound_access.carbon b/toolchain/check/testdata/index/fail_array_out_of_bound_access.carbon index 3d8a305a46158..69dc59d6abef5 100644 --- a/toolchain/check/testdata/index/fail_array_out_of_bound_access.carbon +++ b/toolchain/check/testdata/index/fail_array_out_of_bound_access.carbon @@ -53,14 +53,8 @@ var b: i32 = a[1]; // CHECK:STDOUT: .b = %b // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int_32.loc11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %array_type: type = array_type %int_1, %i32 [template = constants.%array_type] // CHECK:STDOUT: %a.var: ref %array_type = var a // CHECK:STDOUT: %a: ref %array_type = bind_name a, %a.var -// CHECK:STDOUT: %int_32.loc15: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc15: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %b.var: ref %i32 = var b // CHECK:STDOUT: %b: ref %i32 = bind_name b, %b.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/index/fail_expr_category.carbon b/toolchain/check/testdata/index/fail_expr_category.carbon index 7f0f1835a0b96..e1c386a450cc3 100644 --- a/toolchain/check/testdata/index/fail_expr_category.carbon +++ b/toolchain/check/testdata/index/fail_expr_category.carbon @@ -93,11 +93,13 @@ fn G(b: [i32; 3]) { // CHECK:STDOUT: %b.patt: %array_type = binding_pattern b // CHECK:STDOUT: %b.param_patt: %array_type = value_param_pattern %b.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc13: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc13: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3] -// CHECK:STDOUT: %array_type: type = array_type %int_3, %i32 [template = constants.%array_type] // CHECK:STDOUT: %b.param: %array_type = value_param runtime_param0 +// CHECK:STDOUT: %.loc13: type = splice_block %array_type [template = constants.%array_type] { +// CHECK:STDOUT: %int_32.loc13: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc13: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3] +// CHECK:STDOUT: %array_type: type = array_type %int_3, %i32 [template = constants.%array_type] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: %array_type = bind_name b, %b.param // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -106,15 +108,12 @@ fn G(b: [i32; 3]) { // CHECK:STDOUT: // CHECK:STDOUT: fn @G(%b.param_patt: %array_type) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int_32.loc19_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc19_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %ptr.loc19: type = ptr_type %i32 [template = constants.%ptr.2] // CHECK:STDOUT: %pb.var: ref %ptr.2 = var pb // CHECK:STDOUT: %pb: ref %ptr.2 = bind_name pb, %pb.var // CHECK:STDOUT: %b.ref.loc19: %array_type = name_ref b, %b // CHECK:STDOUT: %int_0.loc19: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %int_32.loc19_22: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc19_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %int_32.loc19: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %impl.elem0.loc19: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc19: = bound_method %int_0.loc19, %impl.elem0.loc19 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc19: = specific_function %Convert.bound.loc19, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] @@ -146,9 +145,6 @@ fn G(b: [i32; 3]) { // CHECK:STDOUT: %int.convert_checked.loc24_8: init %i32 = call %Convert.specific_fn.loc24_8(%int_4.loc24) [template = constants.%int_4.2] // CHECK:STDOUT: %.loc24_8: init %i32 = converted %int_4.loc24, %int.convert_checked.loc24_8 [template = constants.%int_4.2] // CHECK:STDOUT: assign %.loc24_6.3, %.loc24_8 -// CHECK:STDOUT: %int_32.loc32_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc32_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %ptr.loc32: type = ptr_type %i32 [template = constants.%ptr.2] // CHECK:STDOUT: %pf.var: ref %ptr.2 = var pf // CHECK:STDOUT: %pf: ref %ptr.2 = bind_name pf, %pf.var // CHECK:STDOUT: %F.ref.loc32: %F.type = name_ref F, file.%F.decl [template = constants.%F] @@ -156,8 +152,8 @@ fn G(b: [i32; 3]) { // CHECK:STDOUT: %F.call.loc32: init %array_type = call %F.ref.loc32() to %.loc32_21.1 // CHECK:STDOUT: %int_0.loc32: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %.loc32_21.2: ref %array_type = temporary %.loc32_21.1, %F.call.loc32 -// CHECK:STDOUT: %int_32.loc32_24: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc32_24: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %int_32.loc32: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %impl.elem0.loc32: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc32: = bound_method %int_0.loc32, %impl.elem0.loc32 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc32: = specific_function %Convert.bound.loc32, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] diff --git a/toolchain/check/testdata/index/fail_invalid_base.carbon b/toolchain/check/testdata/index/fail_invalid_base.carbon index 0685759d715ad..88ebd8100a0df 100644 --- a/toolchain/check/testdata/index/fail_invalid_base.carbon +++ b/toolchain/check/testdata/index/fail_invalid_base.carbon @@ -69,21 +69,13 @@ var d: i32 = {.a: i32, .b: i32}[0]; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %N: = namespace [template] {} -// CHECK:STDOUT: %int_32.loc16: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc16: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.var: ref %i32 = var a // CHECK:STDOUT: %a: ref %i32 = bind_name a, %a.var // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {} -// CHECK:STDOUT: %int_32.loc23: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc23: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %b.var: ref %i32 = var b // CHECK:STDOUT: %b: ref %i32 = bind_name b, %b.var -// CHECK:STDOUT: %int_32.loc29: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc29: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %c.var: ref %i32 = var c // CHECK:STDOUT: %c: ref %i32 = bind_name c, %c.var -// CHECK:STDOUT: %int_32.loc34: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc34: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %d.var: ref %i32 = var d // CHECK:STDOUT: %d: ref %i32 = bind_name d, %d.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/index/fail_name_not_found.carbon b/toolchain/check/testdata/index/fail_name_not_found.carbon index e369f788f3258..165aeb72a5eb4 100644 --- a/toolchain/check/testdata/index/fail_name_not_found.carbon +++ b/toolchain/check/testdata/index/fail_name_not_found.carbon @@ -44,8 +44,6 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: fn @Main() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %b.var: ref %i32 = var b // CHECK:STDOUT: %b: ref %i32 = bind_name b, %b.var // CHECK:STDOUT: %a.ref: = name_ref a, [template = ] diff --git a/toolchain/check/testdata/index/fail_negative_indexing.carbon b/toolchain/check/testdata/index/fail_negative_indexing.carbon index 922b45ac905f3..81f17a70b0d4a 100644 --- a/toolchain/check/testdata/index/fail_negative_indexing.carbon +++ b/toolchain/check/testdata/index/fail_negative_indexing.carbon @@ -54,14 +54,8 @@ var d: i32 = c[-10]; // CHECK:STDOUT: .d = %d // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int_32.loc11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2] -// CHECK:STDOUT: %array_type: type = array_type %int_2, %i32 [template = constants.%array_type] // CHECK:STDOUT: %c.var: ref %array_type = var c // CHECK:STDOUT: %c: ref %array_type = bind_name c, %c.var -// CHECK:STDOUT: %int_32.loc15: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc15: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %d.var: ref %i32 = var d // CHECK:STDOUT: %d: ref %i32 = bind_name d, %d.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/interface/assoc_const.carbon b/toolchain/check/testdata/interface/assoc_const.carbon index e8eb8e1a97131..a4b113eb7d002 100644 --- a/toolchain/check/testdata/interface/assoc_const.carbon +++ b/toolchain/check/testdata/interface/assoc_const.carbon @@ -47,8 +47,6 @@ interface I { // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self] // CHECK:STDOUT: %T: type = assoc_const_decl T [template] // CHECK:STDOUT: %assoc0: %assoc_type.1 = assoc_entity element0, %T [template = constants.%assoc0] -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %N: %i32 = assoc_const_decl N [template] // CHECK:STDOUT: %assoc1: %assoc_type.2 = assoc_entity element1, %N [template = constants.%assoc1] // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interface/fail_todo_assoc_const_default.carbon b/toolchain/check/testdata/interface/fail_todo_assoc_const_default.carbon index 9abea6fba37b8..e0c88174cfdde 100644 --- a/toolchain/check/testdata/interface/fail_todo_assoc_const_default.carbon +++ b/toolchain/check/testdata/interface/fail_todo_assoc_const_default.carbon @@ -71,8 +71,6 @@ interface I { // CHECK:STDOUT: %.loc16_36: type = converted %.loc16_35, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %T: type = assoc_const_decl T [template] // CHECK:STDOUT: %assoc0: %assoc_type.1 = assoc_entity element0, %T [template = constants.%assoc0.1] -// CHECK:STDOUT: %int_32.loc20: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc20: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_42: Core.IntLiteral = int_value 42 [template = constants.%int_42.1] // CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_42, %impl.elem0 [template = constants.%Convert.bound] diff --git a/toolchain/check/testdata/interface/fail_todo_define_default_fn_inline.carbon b/toolchain/check/testdata/interface/fail_todo_define_default_fn_inline.carbon index bbaea5efdae1e..b3c6f00e3ee98 100644 --- a/toolchain/check/testdata/interface/fail_todo_define_default_fn_inline.carbon +++ b/toolchain/check/testdata/interface/fail_todo_define_default_fn_inline.carbon @@ -67,15 +67,19 @@ interface Interface { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc21_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc21_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc21_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc21_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc21_35: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc21_35: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc21_19: type = splice_block %i32.loc21_19 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc21_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc21_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %.loc21_27: type = splice_block %i32.loc21_27 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc21_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc21_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param diff --git a/toolchain/check/testdata/interface/fail_todo_define_default_fn_out_of_line.carbon b/toolchain/check/testdata/interface/fail_todo_define_default_fn_out_of_line.carbon index 3a9d42ceb4467..def5b62198d83 100644 --- a/toolchain/check/testdata/interface/fail_todo_define_default_fn_out_of_line.carbon +++ b/toolchain/check/testdata/interface/fail_todo_define_default_fn_out_of_line.carbon @@ -108,15 +108,19 @@ fn Interface.C.F[self: Self](U:! type, u: U) -> U { return u; } // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc31_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc31_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc31_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc31_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc31_35: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc31_35: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc31_19: type = splice_block %i32.loc31_19 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc31_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc31_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %.loc31_27: type = splice_block %i32.loc31_27 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc31_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc31_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -135,15 +139,19 @@ fn Interface.C.F[self: Self](U:! type, u: U) -> U { return u; } // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc13_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc13_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc13_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc13_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc13_35: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc13_35: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc13_19: type = splice_block %i32.loc13_19 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc13_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc13_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %.loc13_27: type = splice_block %i32.loc13_27 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc13_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc13_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -231,15 +239,17 @@ fn Interface.C.F[self: Self](U:! type, u: U) -> U { return u; } // CHECK:STDOUT: %return.patt: %U = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %U = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc20: type = specific_constant constants.%C.2, @C(constants.%Self) [symbolic = constants.%C.2] -// CHECK:STDOUT: %Self.ref.loc20: type = name_ref Self, %.loc20 [symbolic = constants.%C.2] -// CHECK:STDOUT: %U.ref.loc20_43: type = name_ref U, %U.loc20 [symbolic = constants.%U] // CHECK:STDOUT: %U.ref.loc20_49: type = name_ref U, %U.loc20 [symbolic = constants.%U] // CHECK:STDOUT: %self.param.loc20: %C.2 = value_param runtime_param0 +// CHECK:STDOUT: %.loc20_24.2: type = splice_block %Self.ref.loc20 [symbolic = constants.%C.2] { +// CHECK:STDOUT: %.loc20_24.1: type = specific_constant constants.%C.2, @C(constants.%Self) [symbolic = constants.%C.2] +// CHECK:STDOUT: %Self.ref.loc20: type = name_ref Self, %.loc20_24.1 [symbolic = constants.%C.2] +// CHECK:STDOUT: } // CHECK:STDOUT: %self.loc20: %C.2 = bind_name self, %self.param.loc20 // CHECK:STDOUT: %U.param.loc20: type = value_param runtime_param // CHECK:STDOUT: %U.loc20: type = bind_symbolic_name U, 1, %U.param.loc20 [symbolic = constants.%U] // CHECK:STDOUT: %u.param.loc20: %U = value_param runtime_param1 +// CHECK:STDOUT: %U.ref.loc20_43: type = name_ref U, %U.loc20 [symbolic = constants.%U] // CHECK:STDOUT: %u.loc20: %U = bind_name u, %u.param.loc20 // CHECK:STDOUT: %return.param.loc20: ref %U = out_param runtime_param2 // CHECK:STDOUT: %return.loc20: ref %U = return_slot %return.param.loc20 @@ -273,15 +283,17 @@ fn Interface.C.F[self: Self](U:! type, u: U) -> U { return u; } // CHECK:STDOUT: %return.patt: %U = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %U = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc14: type = specific_constant constants.%C.2, @C(constants.%Self) [symbolic = %C (constants.%C.2)] -// CHECK:STDOUT: %Self.ref.loc14: type = name_ref Self, %.loc14 [symbolic = %C (constants.%C.2)] -// CHECK:STDOUT: %U.ref.loc14_35: type = name_ref U, %U.loc14_22.2 [symbolic = %U.loc14_22.1 (constants.%U)] // CHECK:STDOUT: %U.ref.loc14_41: type = name_ref U, %U.loc14_22.2 [symbolic = %U.loc14_22.1 (constants.%U)] // CHECK:STDOUT: %self.param.loc14: @F.%C (%C.2) = value_param runtime_param0 +// CHECK:STDOUT: %.loc14_16.2: type = splice_block %Self.ref.loc14 [symbolic = %C (constants.%C.2)] { +// CHECK:STDOUT: %.loc14_16.1: type = specific_constant constants.%C.2, @C(constants.%Self) [symbolic = %C (constants.%C.2)] +// CHECK:STDOUT: %Self.ref.loc14: type = name_ref Self, %.loc14_16.1 [symbolic = %C (constants.%C.2)] +// CHECK:STDOUT: } // CHECK:STDOUT: %self.loc14: @F.%C (%C.2) = bind_name self, %self.param.loc14 // CHECK:STDOUT: %U.param.loc14: type = value_param runtime_param // CHECK:STDOUT: %U.loc14_22.2: type = bind_symbolic_name U, 1, %U.param.loc14 [symbolic = %U.loc14_22.1 (constants.%U)] // CHECK:STDOUT: %u.param.loc14: @F.%U.loc14_22.1 (%U) = value_param runtime_param1 +// CHECK:STDOUT: %U.ref.loc14_35: type = name_ref U, %U.loc14_22.2 [symbolic = %U.loc14_22.1 (constants.%U)] // CHECK:STDOUT: %u.loc14: @F.%U.loc14_22.1 (%U) = bind_name u, %u.param.loc14 // CHECK:STDOUT: %return.param.loc14: ref @F.%U.loc14_22.1 (%U) = out_param runtime_param2 // CHECK:STDOUT: %return.loc14: ref @F.%U.loc14_22.1 (%U) = return_slot %return.param.loc14 diff --git a/toolchain/check/testdata/interface/member_lookup.carbon b/toolchain/check/testdata/interface/member_lookup.carbon index 246d8ed56a404..b46c8254f870c 100644 --- a/toolchain/check/testdata/interface/member_lookup.carbon +++ b/toolchain/check/testdata/interface/member_lookup.carbon @@ -112,13 +112,15 @@ fn AccessMissingConcrete(I:! Interface(i32)) -> i32 { // CHECK:STDOUT: %return.patt: @AccessGeneric.%T.loc8_18.2 (%T) = return_slot_pattern // CHECK:STDOUT: %return.param_patt: @AccessGeneric.%T.loc8_18.2 (%T) = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Interface.ref: %Interface.type.1 = name_ref Interface, file.%Interface.decl [template = constants.%Interface.generic] -// CHECK:STDOUT: %T.ref.loc8_42: type = name_ref T, %T.loc8_18.1 [symbolic = %T.loc8_18.2 (constants.%T)] -// CHECK:STDOUT: %Interface.type.loc8_43.1: type = facet_type <@Interface, @Interface(constants.%T)> [symbolic = %Interface.type.loc8_43.2 (constants.%Interface.type.2)] // CHECK:STDOUT: %T.ref.loc8_49: type = name_ref T, %T.loc8_18.1 [symbolic = %T.loc8_18.2 (constants.%T)] // CHECK:STDOUT: %T.param: type = value_param runtime_param // CHECK:STDOUT: %T.loc8_18.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc8_18.2 (constants.%T)] // CHECK:STDOUT: %I.param: @AccessGeneric.%Interface.type.loc8_43.2 (%Interface.type.2) = value_param runtime_param +// CHECK:STDOUT: %.loc8: type = splice_block %Interface.type.loc8_43.1 [symbolic = %Interface.type.loc8_43.2 (constants.%Interface.type.2)] { +// CHECK:STDOUT: %Interface.ref: %Interface.type.1 = name_ref Interface, file.%Interface.decl [template = constants.%Interface.generic] +// CHECK:STDOUT: %T.ref.loc8_42: type = name_ref T, %T.loc8_18.1 [symbolic = %T.loc8_18.2 (constants.%T)] +// CHECK:STDOUT: %Interface.type.loc8_43.1: type = facet_type <@Interface, @Interface(constants.%T)> [symbolic = %Interface.type.loc8_43.2 (constants.%Interface.type.2)] +// CHECK:STDOUT: } // CHECK:STDOUT: %I.loc8_28.1: @AccessGeneric.%Interface.type.loc8_43.2 (%Interface.type.2) = bind_symbolic_name I, 1, %I.param [symbolic = %I.loc8_28.2 (constants.%I.1)] // CHECK:STDOUT: %return.param: ref @AccessGeneric.%T.loc8_18.2 (%T) = out_param runtime_param0 // CHECK:STDOUT: %return: ref @AccessGeneric.%T.loc8_18.2 (%T) = return_slot %return.param @@ -129,13 +131,15 @@ fn AccessMissingConcrete(I:! Interface(i32)) -> i32 { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Interface.ref: %Interface.type.1 = name_ref Interface, file.%Interface.decl [template = constants.%Interface.generic] -// CHECK:STDOUT: %int_32.loc12_33: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc12_33: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %Interface.type: type = facet_type <@Interface, @Interface(constants.%i32)> [template = constants.%Interface.type.3] // CHECK:STDOUT: %int_32.loc12_42: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc12_42: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %I.param: %Interface.type.3 = value_param runtime_param +// CHECK:STDOUT: %.loc12: type = splice_block %Interface.type [template = constants.%Interface.type.3] { +// CHECK:STDOUT: %Interface.ref: %Interface.type.1 = name_ref Interface, file.%Interface.decl [template = constants.%Interface.generic] +// CHECK:STDOUT: %int_32.loc12_33: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc12_33: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %Interface.type: type = facet_type <@Interface, @Interface(constants.%i32)> [template = constants.%Interface.type.3] +// CHECK:STDOUT: } // CHECK:STDOUT: %I.loc12_19.1: %Interface.type.3 = bind_symbolic_name I, 0, %I.param [symbolic = %I.loc12_19.2 (constants.%I.2)] // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -155,7 +159,6 @@ fn AccessMissingConcrete(I:! Interface(i32)) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: interface { // CHECK:STDOUT: %Self.1: @Interface.%Interface.type (%Interface.type.2) = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self)] -// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc4_21.1 [symbolic = %T.loc4_21.2 (constants.%T)] // CHECK:STDOUT: %X: @Interface.%T.loc4_21.2 (%T) = assoc_const_decl X [template] // CHECK:STDOUT: %assoc0.loc5_12.1: @Interface.%assoc_type (%assoc_type.1) = assoc_entity element0, %X [symbolic = %assoc0.loc5_12.2 (constants.%assoc0.1)] // CHECK:STDOUT: @@ -313,13 +316,15 @@ fn AccessMissingConcrete(I:! Interface(i32)) -> i32 { // CHECK:STDOUT: %return.patt: @AccessMissingGeneric.%T.loc8_25.2 (%T) = return_slot_pattern // CHECK:STDOUT: %return.param_patt: @AccessMissingGeneric.%T.loc8_25.2 (%T) = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Interface.ref: %Interface.type.1 = name_ref Interface, file.%Interface.decl [template = constants.%Interface.generic] -// CHECK:STDOUT: %T.ref.loc8_49: type = name_ref T, %T.loc8_25.1 [symbolic = %T.loc8_25.2 (constants.%T)] -// CHECK:STDOUT: %Interface.type.loc8_50.1: type = facet_type <@Interface, @Interface(constants.%T)> [symbolic = %Interface.type.loc8_50.2 (constants.%Interface.type.2)] // CHECK:STDOUT: %T.ref.loc8_56: type = name_ref T, %T.loc8_25.1 [symbolic = %T.loc8_25.2 (constants.%T)] // CHECK:STDOUT: %T.param: type = value_param runtime_param // CHECK:STDOUT: %T.loc8_25.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc8_25.2 (constants.%T)] // CHECK:STDOUT: %I.param: @AccessMissingGeneric.%Interface.type.loc8_50.2 (%Interface.type.2) = value_param runtime_param +// CHECK:STDOUT: %.loc8: type = splice_block %Interface.type.loc8_50.1 [symbolic = %Interface.type.loc8_50.2 (constants.%Interface.type.2)] { +// CHECK:STDOUT: %Interface.ref: %Interface.type.1 = name_ref Interface, file.%Interface.decl [template = constants.%Interface.generic] +// CHECK:STDOUT: %T.ref.loc8_49: type = name_ref T, %T.loc8_25.1 [symbolic = %T.loc8_25.2 (constants.%T)] +// CHECK:STDOUT: %Interface.type.loc8_50.1: type = facet_type <@Interface, @Interface(constants.%T)> [symbolic = %Interface.type.loc8_50.2 (constants.%Interface.type.2)] +// CHECK:STDOUT: } // CHECK:STDOUT: %I.loc8_35.1: @AccessMissingGeneric.%Interface.type.loc8_50.2 (%Interface.type.2) = bind_symbolic_name I, 1, %I.param [symbolic = %I.loc8_35.2 (constants.%I.1)] // CHECK:STDOUT: %return.param: ref @AccessMissingGeneric.%T.loc8_25.2 (%T) = out_param runtime_param0 // CHECK:STDOUT: %return: ref @AccessMissingGeneric.%T.loc8_25.2 (%T) = return_slot %return.param @@ -330,13 +335,15 @@ fn AccessMissingConcrete(I:! Interface(i32)) -> i32 { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Interface.ref: %Interface.type.1 = name_ref Interface, file.%Interface.decl [template = constants.%Interface.generic] -// CHECK:STDOUT: %int_32.loc16_40: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc16_40: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %Interface.type: type = facet_type <@Interface, @Interface(constants.%i32)> [template = constants.%Interface.type.3] // CHECK:STDOUT: %int_32.loc16_49: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc16_49: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %I.param: %Interface.type.3 = value_param runtime_param +// CHECK:STDOUT: %.loc16: type = splice_block %Interface.type [template = constants.%Interface.type.3] { +// CHECK:STDOUT: %Interface.ref: %Interface.type.1 = name_ref Interface, file.%Interface.decl [template = constants.%Interface.generic] +// CHECK:STDOUT: %int_32.loc16_40: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc16_40: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %Interface.type: type = facet_type <@Interface, @Interface(constants.%i32)> [template = constants.%Interface.type.3] +// CHECK:STDOUT: } // CHECK:STDOUT: %I.loc16_26.1: %Interface.type.3 = bind_symbolic_name I, 0, %I.param [symbolic = %I.loc16_26.2 (constants.%I.2)] // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -356,7 +363,6 @@ fn AccessMissingConcrete(I:! Interface(i32)) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: interface { // CHECK:STDOUT: %Self.1: @Interface.%Interface.type (%Interface.type.2) = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self)] -// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc4_21.1 [symbolic = %T.loc4_21.2 (constants.%T)] // CHECK:STDOUT: %X: @Interface.%T.loc4_21.2 (%T) = assoc_const_decl X [template] // CHECK:STDOUT: %assoc0.loc5_12.1: @Interface.%assoc_type (%assoc_type.1) = assoc_entity element0, %X [symbolic = %assoc0.loc5_12.2 (constants.%assoc0.1)] // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interface/no_prelude/as_type.carbon b/toolchain/check/testdata/interface/no_prelude/as_type.carbon index bd15ac2389328..99b521132c767 100644 --- a/toolchain/check/testdata/interface/no_prelude/as_type.carbon +++ b/toolchain/check/testdata/interface/no_prelude/as_type.carbon @@ -31,8 +31,8 @@ fn F(e: Empty) {} // CHECK:STDOUT: %e.patt: %Empty.type = binding_pattern e // CHECK:STDOUT: %e.param_patt: %Empty.type = value_param_pattern %e.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Empty.ref: type = name_ref Empty, file.%Empty.decl [template = constants.%Empty.type] // CHECK:STDOUT: %e.param: %Empty.type = value_param runtime_param0 +// CHECK:STDOUT: %Empty.ref: type = name_ref Empty, file.%Empty.decl [template = constants.%Empty.type] // CHECK:STDOUT: %e: %Empty.type = bind_name e, %e.param // CHECK:STDOUT: } // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/interface/no_prelude/as_type_of_type.carbon b/toolchain/check/testdata/interface/no_prelude/as_type_of_type.carbon index f51912518a12f..53c11889925e1 100644 --- a/toolchain/check/testdata/interface/no_prelude/as_type_of_type.carbon +++ b/toolchain/check/testdata/interface/no_prelude/as_type_of_type.carbon @@ -37,8 +37,8 @@ fn F(T:! Empty) { // CHECK:STDOUT: %T.patt.loc13_6.1: %Empty.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc13_6.2 (constants.%T.patt)] // CHECK:STDOUT: %T.param_patt: %Empty.type = value_param_pattern %T.patt.loc13_6.1, runtime_param [symbolic = %T.patt.loc13_6.2 (constants.%T.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %Empty.ref: type = name_ref Empty, file.%Empty.decl [template = constants.%Empty.type] // CHECK:STDOUT: %T.param: %Empty.type = value_param runtime_param +// CHECK:STDOUT: %Empty.ref: type = name_ref Empty, file.%Empty.decl [template = constants.%Empty.type] // CHECK:STDOUT: %T.loc13_6.1: %Empty.type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc13_6.2 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -56,16 +56,13 @@ fn F(T:! Empty) { // CHECK:STDOUT: %T.patt.loc13_6.2: %Empty.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc13_6.2 (constants.%T.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %T.as_type.loc14_10.2: type = facet_access_type %T.loc13_6.2 [symbolic = %T.as_type.loc14_10.2 (constants.%T.as_type)] -// CHECK:STDOUT: %require_complete: = require_complete_type @F.%T.as_type.loc14_10.2 (%T.as_type) [symbolic = %require_complete (constants.%require_complete)] +// CHECK:STDOUT: %T.as_type: type = facet_access_type %T.loc13_6.2 [symbolic = %T.as_type (constants.%T.as_type)] +// CHECK:STDOUT: %require_complete: = require_complete_type @F.%T.as_type (%T.as_type) [symbolic = %require_complete (constants.%require_complete)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%T.param_patt: %Empty.type) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %T.ref: %Empty.type = name_ref T, %T.loc13_6.1 [symbolic = %T.loc13_6.2 (constants.%T)] -// CHECK:STDOUT: %T.as_type.loc14_10.1: type = facet_access_type %T.ref [symbolic = %T.as_type.loc14_10.2 (constants.%T.as_type)] -// CHECK:STDOUT: %.loc14: type = converted %T.ref, %T.as_type.loc14_10.1 [symbolic = %T.as_type.loc14_10.2 (constants.%T.as_type)] -// CHECK:STDOUT: %x.var: ref @F.%T.as_type.loc14_10.2 (%T.as_type) = var x -// CHECK:STDOUT: %x: ref @F.%T.as_type.loc14_10.2 (%T.as_type) = bind_name x, %x.var +// CHECK:STDOUT: %x.var: ref @F.%T.as_type (%T.as_type) = var x +// CHECK:STDOUT: %x: ref @F.%T.as_type (%T.as_type) = bind_name x, %x.var // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/interface/no_prelude/default_fn.carbon b/toolchain/check/testdata/interface/no_prelude/default_fn.carbon index 1dc560535b6d6..55c787424d953 100644 --- a/toolchain/check/testdata/interface/no_prelude/default_fn.carbon +++ b/toolchain/check/testdata/interface/no_prelude/default_fn.carbon @@ -89,7 +89,6 @@ class C { // CHECK:STDOUT: // CHECK:STDOUT: fn() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %c.var: ref %C = var c // CHECK:STDOUT: %c: ref %C = bind_name c, %c.var // CHECK:STDOUT: %.loc16_19.1: %empty_struct_type = struct_literal () diff --git a/toolchain/check/testdata/interface/no_prelude/export_name.carbon b/toolchain/check/testdata/interface/no_prelude/export_name.carbon index 37d2fd6ddcadf..ca81fdbaf5278 100644 --- a/toolchain/check/testdata/interface/no_prelude/export_name.carbon +++ b/toolchain/check/testdata/interface/no_prelude/export_name.carbon @@ -108,8 +108,8 @@ fn UseEmpty(i: I) {} // CHECK:STDOUT: %i.patt: %I.type = binding_pattern i // CHECK:STDOUT: %i.param_patt: %I.type = value_param_pattern %i.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %I.ref: type = name_ref I, imports.%import_ref.1 [template = constants.%I.type] // CHECK:STDOUT: %i.param: %I.type = value_param runtime_param0 +// CHECK:STDOUT: %I.ref: type = name_ref I, imports.%import_ref.1 [template = constants.%I.type] // CHECK:STDOUT: %i: %I.type = bind_name i, %i.param // CHECK:STDOUT: } // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/interface/no_prelude/fail_assoc_const_not_constant.carbon b/toolchain/check/testdata/interface/no_prelude/fail_assoc_const_not_constant.carbon index bbcb6432af923..1927430c5632e 100644 --- a/toolchain/check/testdata/interface/no_prelude/fail_assoc_const_not_constant.carbon +++ b/toolchain/check/testdata/interface/no_prelude/fail_assoc_const_not_constant.carbon @@ -30,7 +30,6 @@ alias UseOther = I.other; // CHECK:STDOUT: constants { // CHECK:STDOUT: %I.type: type = facet_type <@I> [template] // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic] -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -50,7 +49,6 @@ alias UseOther = I.other; // CHECK:STDOUT: // CHECK:STDOUT: interface @I { // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self] -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = %Self diff --git a/toolchain/check/testdata/interface/no_prelude/fail_duplicate.carbon b/toolchain/check/testdata/interface/no_prelude/fail_duplicate.carbon index a492b94129038..ad69c248b9b14 100644 --- a/toolchain/check/testdata/interface/no_prelude/fail_duplicate.carbon +++ b/toolchain/check/testdata/interface/no_prelude/fail_duplicate.carbon @@ -152,10 +152,12 @@ interface Class { } // CHECK:STDOUT: %self.patt: @F.%Self.as_type.loc14_14.1 (%Self.as_type) = binding_pattern self // CHECK:STDOUT: %self.param_patt: @F.%Self.as_type.loc14_14.1 (%Self.as_type) = value_param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref: %.type = name_ref Self, @.1.%Self [symbolic = %Self (constants.%Self.2)] -// CHECK:STDOUT: %Self.as_type.loc14_14.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc14_14.1 (constants.%Self.as_type)] -// CHECK:STDOUT: %.loc14: type = converted %Self.ref, %Self.as_type.loc14_14.2 [symbolic = %Self.as_type.loc14_14.1 (constants.%Self.as_type)] // CHECK:STDOUT: %self.param: @F.%Self.as_type.loc14_14.1 (%Self.as_type) = value_param runtime_param0 +// CHECK:STDOUT: %.loc14_14.2: type = splice_block %.loc14_14.1 [symbolic = %Self.as_type.loc14_14.1 (constants.%Self.as_type)] { +// CHECK:STDOUT: %Self.ref: %.type = name_ref Self, @.1.%Self [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: %Self.as_type.loc14_14.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc14_14.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %.loc14_14.1: type = converted %Self.ref, %Self.as_type.loc14_14.2 [symbolic = %Self.as_type.loc14_14.1 (constants.%Self.as_type)] +// CHECK:STDOUT: } // CHECK:STDOUT: %self: @F.%Self.as_type.loc14_14.1 (%Self.as_type) = bind_name self, %self.param // CHECK:STDOUT: } // CHECK:STDOUT: %assoc0: %F.assoc_type = assoc_entity element0, %F.decl [template = constants.%assoc0] diff --git a/toolchain/check/testdata/interface/no_prelude/fail_generic_redeclaration.carbon b/toolchain/check/testdata/interface/no_prelude/fail_generic_redeclaration.carbon index b18a173c487bc..d385f2292c403 100644 --- a/toolchain/check/testdata/interface/no_prelude/fail_generic_redeclaration.carbon +++ b/toolchain/check/testdata/interface/no_prelude/fail_generic_redeclaration.carbon @@ -95,9 +95,11 @@ interface DifferentParams(T:! ()) {} // CHECK:STDOUT: %T.patt.loc38_27.1: %empty_tuple.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc38_27.2 (constants.%T.patt.2)] // CHECK:STDOUT: %T.param_patt: %empty_tuple.type = value_param_pattern %T.patt.loc38_27.1, runtime_param [symbolic = %T.patt.loc38_27.2 (constants.%T.patt.2)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc38_32.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc38_32.2: type = converted %.loc38_32.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %T.param: %empty_tuple.type = value_param runtime_param +// CHECK:STDOUT: %.loc38_32.3: type = splice_block %.loc38_32.2 [template = constants.%empty_tuple.type] { +// CHECK:STDOUT: %.loc38_32.1: %empty_tuple.type = tuple_literal () +// CHECK:STDOUT: %.loc38_32.2: type = converted %.loc38_32.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] +// CHECK:STDOUT: } // CHECK:STDOUT: %T.loc38_27.1: %empty_tuple.type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc38_27.2 (constants.%T.2)] // CHECK:STDOUT: } // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/interface/no_prelude/fail_lookup_in_type_type.carbon b/toolchain/check/testdata/interface/no_prelude/fail_lookup_in_type_type.carbon index 7f7176d274c03..1f6aaadc81593 100644 --- a/toolchain/check/testdata/interface/no_prelude/fail_lookup_in_type_type.carbon +++ b/toolchain/check/testdata/interface/no_prelude/fail_lookup_in_type_type.carbon @@ -49,8 +49,6 @@ let U: (type where .Self impls type).missing = {}; // CHECK:STDOUT: --- fail_lookup_type_where.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %.Self: type = bind_symbolic_name .Self [symbolic] -// CHECK:STDOUT: %type_where: type = facet_type [template] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -58,12 +56,6 @@ let U: (type where .Self impls type).missing = {}; // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .U = @__global_init.%U // CHECK:STDOUT: } -// CHECK:STDOUT: %.Self: type = bind_symbolic_name .Self [symbolic = constants.%.Self] -// CHECK:STDOUT: %.Self.ref: type = name_ref .Self, %.Self [symbolic = constants.%.Self] -// CHECK:STDOUT: %.loc7: type = where_expr %.Self [template = constants.%type_where] { -// CHECK:STDOUT: requirement_impls %.Self.ref, type -// CHECK:STDOUT: } -// CHECK:STDOUT: %missing.ref: = name_ref missing, [template = ] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { diff --git a/toolchain/check/testdata/interface/no_prelude/fail_member_lookup.carbon b/toolchain/check/testdata/interface/no_prelude/fail_member_lookup.carbon index e6b15d47c92dc..0dce1419f9034 100644 --- a/toolchain/check/testdata/interface/no_prelude/fail_member_lookup.carbon +++ b/toolchain/check/testdata/interface/no_prelude/fail_member_lookup.carbon @@ -72,11 +72,11 @@ fn G(U:! Different) -> U.(Interface.T); // CHECK:STDOUT: %return.patt: = return_slot_pattern // CHECK:STDOUT: %return.param_patt: = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Different.ref: type = name_ref Different, file.%Different.decl [template = constants.%Different.type] // CHECK:STDOUT: %U.ref: %Different.type = name_ref U, %U.loc36_6.1 [symbolic = %U.loc36_6.2 (constants.%U)] // CHECK:STDOUT: %Interface.ref: type = name_ref Interface, file.%Interface.decl [template = constants.%Interface.type] // CHECK:STDOUT: %T.ref: %assoc_type = name_ref T, @Interface.%assoc1 [template = constants.%assoc1] // CHECK:STDOUT: %U.param: %Different.type = value_param runtime_param +// CHECK:STDOUT: %Different.ref: type = name_ref Different, file.%Different.decl [template = constants.%Different.type] // CHECK:STDOUT: %U.loc36_6.1: %Different.type = bind_symbolic_name U, 0, %U.param [symbolic = %U.loc36_6.2 (constants.%U)] // CHECK:STDOUT: %return.param: ref = out_param runtime_param0 // CHECK:STDOUT: %return: ref = return_slot %return.param @@ -112,11 +112,8 @@ fn G(U:! Different) -> U.(Interface.T); // CHECK:STDOUT: // CHECK:STDOUT: fn @F.2() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Interface.ref.loc22: type = name_ref Interface, file.%Interface.decl [template = constants.%Interface.type] +// CHECK:STDOUT: %Interface.ref: type = name_ref Interface, file.%Interface.decl [template = constants.%Interface.type] // CHECK:STDOUT: %F.ref: %F.assoc_type = name_ref F, @Interface.%assoc0 [template = constants.%assoc0] -// CHECK:STDOUT: %Interface.ref.loc28: type = name_ref Interface, file.%Interface.decl [template = constants.%Interface.type] -// CHECK:STDOUT: %T.ref: %assoc_type = name_ref T, @Interface.%assoc1 [template = constants.%assoc1] -// CHECK:STDOUT: %.loc28: type = converted %T.ref, [template = ] // CHECK:STDOUT: %v.var: ref = var v // CHECK:STDOUT: %v: ref = bind_name v, %v.var // CHECK:STDOUT: return diff --git a/toolchain/check/testdata/interface/no_prelude/fail_modifiers.carbon b/toolchain/check/testdata/interface/no_prelude/fail_modifiers.carbon index 2b46f7a30daca..37f94498415e1 100644 --- a/toolchain/check/testdata/interface/no_prelude/fail_modifiers.carbon +++ b/toolchain/check/testdata/interface/no_prelude/fail_modifiers.carbon @@ -172,10 +172,12 @@ interface I { // CHECK:STDOUT: %self.patt: @F.%Self.as_type.loc9_22.1 (%Self.as_type) = binding_pattern self // CHECK:STDOUT: %self.param_patt: @F.%Self.as_type.loc9_22.1 (%Self.as_type) = value_param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref: %I.type = name_ref Self, @I.%Self [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %Self.as_type.loc9_22.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc9_22.1 (constants.%Self.as_type)] -// CHECK:STDOUT: %.loc9: type = converted %Self.ref, %Self.as_type.loc9_22.2 [symbolic = %Self.as_type.loc9_22.1 (constants.%Self.as_type)] // CHECK:STDOUT: %self.param: @F.%Self.as_type.loc9_22.1 (%Self.as_type) = value_param runtime_param0 +// CHECK:STDOUT: %.loc9_22.2: type = splice_block %.loc9_22.1 [symbolic = %Self.as_type.loc9_22.1 (constants.%Self.as_type)] { +// CHECK:STDOUT: %Self.ref: %I.type = name_ref Self, @I.%Self [symbolic = %Self (constants.%Self)] +// CHECK:STDOUT: %Self.as_type.loc9_22.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc9_22.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %.loc9_22.1: type = converted %Self.ref, %Self.as_type.loc9_22.2 [symbolic = %Self.as_type.loc9_22.1 (constants.%Self.as_type)] +// CHECK:STDOUT: } // CHECK:STDOUT: %self: @F.%Self.as_type.loc9_22.1 (%Self.as_type) = bind_name self, %self.param // CHECK:STDOUT: } // CHECK:STDOUT: %assoc0: %F.assoc_type = assoc_entity element0, %F.decl [template = constants.%assoc0] @@ -223,10 +225,12 @@ interface I { // CHECK:STDOUT: %self.patt: @F.%Self.as_type.loc8_24.1 (%Self.as_type) = binding_pattern self // CHECK:STDOUT: %self.param_patt: @F.%Self.as_type.loc8_24.1 (%Self.as_type) = value_param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref: %I.type = name_ref Self, @I.%Self [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %Self.as_type.loc8_24.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc8_24.1 (constants.%Self.as_type)] -// CHECK:STDOUT: %.loc8: type = converted %Self.ref, %Self.as_type.loc8_24.2 [symbolic = %Self.as_type.loc8_24.1 (constants.%Self.as_type)] // CHECK:STDOUT: %self.param: @F.%Self.as_type.loc8_24.1 (%Self.as_type) = value_param runtime_param0 +// CHECK:STDOUT: %.loc8_24.2: type = splice_block %.loc8_24.1 [symbolic = %Self.as_type.loc8_24.1 (constants.%Self.as_type)] { +// CHECK:STDOUT: %Self.ref: %I.type = name_ref Self, @I.%Self [symbolic = %Self (constants.%Self)] +// CHECK:STDOUT: %Self.as_type.loc8_24.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc8_24.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %.loc8_24.1: type = converted %Self.ref, %Self.as_type.loc8_24.2 [symbolic = %Self.as_type.loc8_24.1 (constants.%Self.as_type)] +// CHECK:STDOUT: } // CHECK:STDOUT: %self: @F.%Self.as_type.loc8_24.1 (%Self.as_type) = bind_name self, %self.param // CHECK:STDOUT: } // CHECK:STDOUT: %assoc0: %F.assoc_type = assoc_entity element0, %F.decl [template = constants.%assoc0] diff --git a/toolchain/check/testdata/interface/no_prelude/fail_todo_facet_lookup.carbon b/toolchain/check/testdata/interface/no_prelude/fail_todo_facet_lookup.carbon index baca7f01f4071..d644af0f0caaf 100644 --- a/toolchain/check/testdata/interface/no_prelude/fail_todo_facet_lookup.carbon +++ b/toolchain/check/testdata/interface/no_prelude/fail_todo_facet_lookup.carbon @@ -57,8 +57,8 @@ fn CallFacet(T:! Interface, x: T) { // CHECK:STDOUT: %T.patt.loc13_15.1: %Interface.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc13_15.2 (constants.%T.patt)] // CHECK:STDOUT: %T.param_patt: %Interface.type = value_param_pattern %T.patt.loc13_15.1, runtime_param [symbolic = %T.patt.loc13_15.2 (constants.%T.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %Interface.ref: type = name_ref Interface, file.%Interface.decl [template = constants.%Interface.type] // CHECK:STDOUT: %T.param: %Interface.type = value_param runtime_param +// CHECK:STDOUT: %Interface.ref: type = name_ref Interface, file.%Interface.decl [template = constants.%Interface.type] // CHECK:STDOUT: %T.loc13_15.1: %Interface.type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc13_15.2 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: %CallFacet.decl: %CallFacet.type = fn_decl @CallFacet [template = constants.%CallFacet] { @@ -67,13 +67,15 @@ fn CallFacet(T:! Interface, x: T) { // CHECK:STDOUT: %x.patt: @CallFacet.%T.as_type.loc21_32.2 (%T.as_type) = binding_pattern x // CHECK:STDOUT: %x.param_patt: @CallFacet.%T.as_type.loc21_32.2 (%T.as_type) = value_param_pattern %x.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Interface.ref: type = name_ref Interface, file.%Interface.decl [template = constants.%Interface.type] -// CHECK:STDOUT: %T.ref: %Interface.type = name_ref T, %T.loc21_14.1 [symbolic = %T.loc21_14.2 (constants.%T)] -// CHECK:STDOUT: %T.as_type.loc21_32.1: type = facet_access_type %T.ref [symbolic = %T.as_type.loc21_32.2 (constants.%T.as_type)] -// CHECK:STDOUT: %.loc21: type = converted %T.ref, %T.as_type.loc21_32.1 [symbolic = %T.as_type.loc21_32.2 (constants.%T.as_type)] // CHECK:STDOUT: %T.param: %Interface.type = value_param runtime_param +// CHECK:STDOUT: %Interface.ref: type = name_ref Interface, file.%Interface.decl [template = constants.%Interface.type] // CHECK:STDOUT: %T.loc21_14.1: %Interface.type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc21_14.2 (constants.%T)] // CHECK:STDOUT: %x.param: @CallFacet.%T.as_type.loc21_32.2 (%T.as_type) = value_param runtime_param0 +// CHECK:STDOUT: %.loc21_32.2: type = splice_block %.loc21_32.1 [symbolic = %T.as_type.loc21_32.2 (constants.%T.as_type)] { +// CHECK:STDOUT: %T.ref: %Interface.type = name_ref T, %T.loc21_14.1 [symbolic = %T.loc21_14.2 (constants.%T)] +// CHECK:STDOUT: %T.as_type.loc21_32.1: type = facet_access_type %T.ref [symbolic = %T.as_type.loc21_32.2 (constants.%T.as_type)] +// CHECK:STDOUT: %.loc21_32.1: type = converted %T.ref, %T.as_type.loc21_32.1 [symbolic = %T.as_type.loc21_32.2 (constants.%T.as_type)] +// CHECK:STDOUT: } // CHECK:STDOUT: %x: @CallFacet.%T.as_type.loc21_32.2 (%T.as_type) = bind_name x, %x.param // CHECK:STDOUT: } // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/interface/no_prelude/fail_todo_generic_default_fn.carbon b/toolchain/check/testdata/interface/no_prelude/fail_todo_generic_default_fn.carbon index 16658113add2d..0d24ce6264ff8 100644 --- a/toolchain/check/testdata/interface/no_prelude/fail_todo_generic_default_fn.carbon +++ b/toolchain/check/testdata/interface/no_prelude/fail_todo_generic_default_fn.carbon @@ -59,15 +59,17 @@ fn I(T:! type).F[self: Self]() -> Self { return self; } // CHECK:STDOUT: } { // CHECK:STDOUT: %T.param: type = value_param runtime_param // CHECK:STDOUT: %T.loc22_6.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc22_6.2 (constants.%T)] -// CHECK:STDOUT: %.loc22_24.1: @.1.%I.type (%I.type.2) = specific_constant @I.%Self.1, @I(constants.%T) [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %Self.ref.loc22_24: @.1.%I.type (%I.type.2) = name_ref Self, %.loc22_24.1 [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %Self.as_type.loc22_24.1: type = facet_access_type %Self.ref.loc22_24 [symbolic = %Self.as_type.loc22_24.2 (constants.%Self.as_type)] -// CHECK:STDOUT: %.loc22_24.2: type = converted %Self.ref.loc22_24, %Self.as_type.loc22_24.1 [symbolic = %Self.as_type.loc22_24.2 (constants.%Self.as_type)] // CHECK:STDOUT: %.loc22_35.1: @.1.%I.type (%I.type.2) = specific_constant @I.%Self.1, @I(constants.%T) [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: %Self.ref.loc22_35: @.1.%I.type (%I.type.2) = name_ref Self, %.loc22_35.1 [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: %Self.as_type.loc22_35: type = facet_access_type %Self.ref.loc22_35 [symbolic = %Self.as_type.loc22_24.2 (constants.%Self.as_type)] // CHECK:STDOUT: %.loc22_35.2: type = converted %Self.ref.loc22_35, %Self.as_type.loc22_35 [symbolic = %Self.as_type.loc22_24.2 (constants.%Self.as_type)] // CHECK:STDOUT: %self.param: @.1.%Self.as_type.loc22_24.2 (%Self.as_type) = value_param runtime_param0 +// CHECK:STDOUT: %.loc22_24.3: type = splice_block %.loc22_24.2 [symbolic = %Self.as_type.loc22_24.2 (constants.%Self.as_type)] { +// CHECK:STDOUT: %.loc22_24.1: @.1.%I.type (%I.type.2) = specific_constant @I.%Self.1, @I(constants.%T) [symbolic = %Self (constants.%Self)] +// CHECK:STDOUT: %Self.ref.loc22_24: @.1.%I.type (%I.type.2) = name_ref Self, %.loc22_24.1 [symbolic = %Self (constants.%Self)] +// CHECK:STDOUT: %Self.as_type.loc22_24.1: type = facet_access_type %Self.ref.loc22_24 [symbolic = %Self.as_type.loc22_24.2 (constants.%Self.as_type)] +// CHECK:STDOUT: %.loc22_24.2: type = converted %Self.ref.loc22_24, %Self.as_type.loc22_24.1 [symbolic = %Self.as_type.loc22_24.2 (constants.%Self.as_type)] +// CHECK:STDOUT: } // CHECK:STDOUT: %self: @.1.%Self.as_type.loc22_24.2 (%Self.as_type) = bind_name self, %self.param // CHECK:STDOUT: %return.param: ref @.1.%Self.as_type.loc22_24.2 (%Self.as_type) = out_param runtime_param1 // CHECK:STDOUT: %return: ref @.1.%Self.as_type.loc22_24.2 (%Self.as_type) = return_slot %return.param @@ -94,15 +96,17 @@ fn I(T:! type).F[self: Self]() -> Self { return self; } // CHECK:STDOUT: %return.patt: @F.%Self.as_type.loc13_14.1 (%Self.as_type) = return_slot_pattern // CHECK:STDOUT: %return.param_patt: @F.%Self.as_type.loc13_14.1 (%Self.as_type) = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc13_14.1: @F.%I.type (%I.type.2) = specific_constant @I.%Self.1, @I(constants.%T) [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %Self.ref.loc13_14: @F.%I.type (%I.type.2) = name_ref Self, %.loc13_14.1 [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %Self.as_type.loc13_14.2: type = facet_access_type %Self.ref.loc13_14 [symbolic = %Self.as_type.loc13_14.1 (constants.%Self.as_type)] -// CHECK:STDOUT: %.loc13_14.2: type = converted %Self.ref.loc13_14, %Self.as_type.loc13_14.2 [symbolic = %Self.as_type.loc13_14.1 (constants.%Self.as_type)] // CHECK:STDOUT: %.loc13_25.1: @F.%I.type (%I.type.2) = specific_constant @I.%Self.1, @I(constants.%T) [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: %Self.ref.loc13_25: @F.%I.type (%I.type.2) = name_ref Self, %.loc13_25.1 [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: %Self.as_type.loc13_25: type = facet_access_type %Self.ref.loc13_25 [symbolic = %Self.as_type.loc13_14.1 (constants.%Self.as_type)] // CHECK:STDOUT: %.loc13_25.2: type = converted %Self.ref.loc13_25, %Self.as_type.loc13_25 [symbolic = %Self.as_type.loc13_14.1 (constants.%Self.as_type)] // CHECK:STDOUT: %self.param: @F.%Self.as_type.loc13_14.1 (%Self.as_type) = value_param runtime_param0 +// CHECK:STDOUT: %.loc13_14.3: type = splice_block %.loc13_14.2 [symbolic = %Self.as_type.loc13_14.1 (constants.%Self.as_type)] { +// CHECK:STDOUT: %.loc13_14.1: @F.%I.type (%I.type.2) = specific_constant @I.%Self.1, @I(constants.%T) [symbolic = %Self (constants.%Self)] +// CHECK:STDOUT: %Self.ref.loc13_14: @F.%I.type (%I.type.2) = name_ref Self, %.loc13_14.1 [symbolic = %Self (constants.%Self)] +// CHECK:STDOUT: %Self.as_type.loc13_14.2: type = facet_access_type %Self.ref.loc13_14 [symbolic = %Self.as_type.loc13_14.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %.loc13_14.2: type = converted %Self.ref.loc13_14, %Self.as_type.loc13_14.2 [symbolic = %Self.as_type.loc13_14.1 (constants.%Self.as_type)] +// CHECK:STDOUT: } // CHECK:STDOUT: %self: @F.%Self.as_type.loc13_14.1 (%Self.as_type) = bind_name self, %self.param // CHECK:STDOUT: %return.param: ref @F.%Self.as_type.loc13_14.1 (%Self.as_type) = out_param runtime_param1 // CHECK:STDOUT: %return: ref @F.%Self.as_type.loc13_14.1 (%Self.as_type) = return_slot %return.param diff --git a/toolchain/check/testdata/interface/no_prelude/generic.carbon b/toolchain/check/testdata/interface/no_prelude/generic.carbon index 05502498edeab..b4661488e7f82 100644 --- a/toolchain/check/testdata/interface/no_prelude/generic.carbon +++ b/toolchain/check/testdata/interface/no_prelude/generic.carbon @@ -137,30 +137,34 @@ fn G(T:! Generic(B)) { // CHECK:STDOUT: %N.patt.loc22_38.1: @WithImplicitArgs.%T.loc22_28.2 (%T.1) = symbolic_binding_pattern N, 1 [symbolic = %N.patt.loc22_38.2 (constants.%N.patt)] // CHECK:STDOUT: %N.param_patt: @WithImplicitArgs.%T.loc22_28.2 (%T.1) = value_param_pattern %N.patt.loc22_38.1, runtime_param [symbolic = %N.patt.loc22_38.2 (constants.%N.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc22_28.1 [symbolic = %T.loc22_28.2 (constants.%T.1)] // CHECK:STDOUT: %T.param: type = value_param runtime_param // CHECK:STDOUT: %T.loc22_28.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc22_28.2 (constants.%T.1)] // CHECK:STDOUT: %N.param: @WithImplicitArgs.%T.loc22_28.2 (%T.1) = value_param runtime_param +// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc22_28.1 [symbolic = %T.loc22_28.2 (constants.%T.1)] // CHECK:STDOUT: %N.loc22_38.1: @WithImplicitArgs.%T.loc22_28.2 (%T.1) = bind_symbolic_name N, 1, %N.param [symbolic = %N.loc22_38.2 (constants.%N)] // CHECK:STDOUT: } // CHECK:STDOUT: %Receive.decl: %Receive.type = fn_decl @Receive [template = constants.%Receive] { // CHECK:STDOUT: %T.patt.loc24_12.1: %Simple.type.3 = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc24_12.2 (constants.%T.patt.2)] // CHECK:STDOUT: %T.param_patt: %Simple.type.3 = value_param_pattern %T.patt.loc24_12.1, runtime_param [symbolic = %T.patt.loc24_12.2 (constants.%T.patt.2)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %Simple.ref: %Simple.type.1 = name_ref Simple, file.%Simple.decl [template = constants.%Simple.generic] -// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %Simple.type: type = facet_type <@Simple, @Simple(constants.%C)> [template = constants.%Simple.type.3] // CHECK:STDOUT: %T.param: %Simple.type.3 = value_param runtime_param +// CHECK:STDOUT: %.loc24: type = splice_block %Simple.type [template = constants.%Simple.type.3] { +// CHECK:STDOUT: %Simple.ref: %Simple.type.1 = name_ref Simple, file.%Simple.decl [template = constants.%Simple.generic] +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %Simple.type: type = facet_type <@Simple, @Simple(constants.%C)> [template = constants.%Simple.type.3] +// CHECK:STDOUT: } // CHECK:STDOUT: %T.loc24_12.1: %Simple.type.3 = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc24_12.2 (constants.%T.2)] // CHECK:STDOUT: } // CHECK:STDOUT: %Pass.decl: %Pass.type = fn_decl @Pass [template = constants.%Pass] { // CHECK:STDOUT: %T.patt.loc25_9.1: %Simple.type.3 = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc25_9.2 (constants.%T.patt.2)] // CHECK:STDOUT: %T.param_patt: %Simple.type.3 = value_param_pattern %T.patt.loc25_9.1, runtime_param [symbolic = %T.patt.loc25_9.2 (constants.%T.patt.2)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %Simple.ref: %Simple.type.1 = name_ref Simple, file.%Simple.decl [template = constants.%Simple.generic] -// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %Simple.type: type = facet_type <@Simple, @Simple(constants.%C)> [template = constants.%Simple.type.3] // CHECK:STDOUT: %T.param: %Simple.type.3 = value_param runtime_param +// CHECK:STDOUT: %.loc25: type = splice_block %Simple.type [template = constants.%Simple.type.3] { +// CHECK:STDOUT: %Simple.ref: %Simple.type.1 = name_ref Simple, file.%Simple.decl [template = constants.%Simple.generic] +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %Simple.type: type = facet_type <@Simple, @Simple(constants.%C)> [template = constants.%Simple.type.3] +// CHECK:STDOUT: } // CHECK:STDOUT: %T.loc25_9.1: %Simple.type.3 = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc25_9.2 (constants.%T.2)] // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -422,20 +426,24 @@ fn G(T:! Generic(B)) { // CHECK:STDOUT: %T.patt.loc9_6.1: %Generic.type.3 = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc9_6.2 (constants.%T.patt.2)] // CHECK:STDOUT: %T.param_patt: %Generic.type.3 = value_param_pattern %T.patt.loc9_6.1, runtime_param [symbolic = %T.patt.loc9_6.2 (constants.%T.patt.2)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %Generic.ref: %Generic.type.1 = name_ref Generic, file.%Generic.decl [template = constants.%Generic.generic] -// CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%A] -// CHECK:STDOUT: %Generic.type: type = facet_type <@Generic, @Generic(constants.%A)> [template = constants.%Generic.type.3] // CHECK:STDOUT: %T.param: %Generic.type.3 = value_param runtime_param +// CHECK:STDOUT: %.loc9: type = splice_block %Generic.type [template = constants.%Generic.type.3] { +// CHECK:STDOUT: %Generic.ref: %Generic.type.1 = name_ref Generic, file.%Generic.decl [template = constants.%Generic.generic] +// CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%A] +// CHECK:STDOUT: %Generic.type: type = facet_type <@Generic, @Generic(constants.%A)> [template = constants.%Generic.type.3] +// CHECK:STDOUT: } // CHECK:STDOUT: %T.loc9_6.1: %Generic.type.3 = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc9_6.2 (constants.%T.2)] // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %T.patt.loc10_6.1: %Generic.type.4 = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc10_6.2 (constants.%T.patt.3)] // CHECK:STDOUT: %T.param_patt: %Generic.type.4 = value_param_pattern %T.patt.loc10_6.1, runtime_param [symbolic = %T.patt.loc10_6.2 (constants.%T.patt.3)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %Generic.ref: %Generic.type.1 = name_ref Generic, file.%Generic.decl [template = constants.%Generic.generic] -// CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [template = constants.%B] -// CHECK:STDOUT: %Generic.type: type = facet_type <@Generic, @Generic(constants.%B)> [template = constants.%Generic.type.4] // CHECK:STDOUT: %T.param: %Generic.type.4 = value_param runtime_param +// CHECK:STDOUT: %.loc10: type = splice_block %Generic.type [template = constants.%Generic.type.4] { +// CHECK:STDOUT: %Generic.ref: %Generic.type.1 = name_ref Generic, file.%Generic.decl [template = constants.%Generic.generic] +// CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [template = constants.%B] +// CHECK:STDOUT: %Generic.type: type = facet_type <@Generic, @Generic(constants.%B)> [template = constants.%Generic.type.4] +// CHECK:STDOUT: } // CHECK:STDOUT: %T.loc10_6.1: %Generic.type.4 = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc10_6.2 (constants.%T.3)] // CHECK:STDOUT: } // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/interface/no_prelude/import.carbon b/toolchain/check/testdata/interface/no_prelude/import.carbon index 81e7cd28392e4..1aeb233cd7ba2 100644 --- a/toolchain/check/testdata/interface/no_prelude/import.carbon +++ b/toolchain/check/testdata/interface/no_prelude/import.carbon @@ -82,8 +82,6 @@ var f: ForwardDeclared* = &f_ref.f; // CHECK:STDOUT: %Empty.decl: type = interface_decl @Empty [template = constants.%Empty.type] {} {} // CHECK:STDOUT: %Basic.decl: type = interface_decl @Basic [template = constants.%Basic.type] {} {} // CHECK:STDOUT: %ForwardDeclared.decl: type = interface_decl @ForwardDeclared [template = constants.%ForwardDeclared.type] {} {} -// CHECK:STDOUT: %ForwardDeclared.ref: type = name_ref ForwardDeclared, %ForwardDeclared.decl [template = constants.%ForwardDeclared.type] -// CHECK:STDOUT: %struct_type.f: type = struct_type {.f: %ForwardDeclared.type} [template = constants.%struct_type.f.1] // CHECK:STDOUT: %f_ref.var: ref %struct_type.f.1 = var f_ref // CHECK:STDOUT: %f_ref: ref %struct_type.f.1 = bind_name f_ref, %f_ref.var // CHECK:STDOUT: } @@ -204,24 +202,24 @@ var f: ForwardDeclared* = &f_ref.f; // CHECK:STDOUT: %e.patt: %Empty.type = binding_pattern e // CHECK:STDOUT: %e.param_patt: %Empty.type = value_param_pattern %e.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Empty.ref: type = name_ref Empty, imports.%import_ref.1 [template = constants.%Empty.type] // CHECK:STDOUT: %e.param: %Empty.type = value_param runtime_param0 +// CHECK:STDOUT: %Empty.ref: type = name_ref Empty, imports.%import_ref.1 [template = constants.%Empty.type] // CHECK:STDOUT: %e: %Empty.type = bind_name e, %e.param // CHECK:STDOUT: } // CHECK:STDOUT: %UseBasic.decl: %UseBasic.type = fn_decl @UseBasic [template = constants.%UseBasic] { // CHECK:STDOUT: %e.patt: %Basic.type = binding_pattern e // CHECK:STDOUT: %e.param_patt: %Basic.type = value_param_pattern %e.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Basic.ref: type = name_ref Basic, imports.%import_ref.2 [template = constants.%Basic.type] // CHECK:STDOUT: %e.param: %Basic.type = value_param runtime_param0 +// CHECK:STDOUT: %Basic.ref: type = name_ref Basic, imports.%import_ref.2 [template = constants.%Basic.type] // CHECK:STDOUT: %e: %Basic.type = bind_name e, %e.param // CHECK:STDOUT: } // CHECK:STDOUT: %UseForwardDeclared.decl: %UseForwardDeclared.type = fn_decl @UseForwardDeclared [template = constants.%UseForwardDeclared] { // CHECK:STDOUT: %f.patt: %ForwardDeclared.type = binding_pattern f // CHECK:STDOUT: %f.param_patt: %ForwardDeclared.type = value_param_pattern %f.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %ForwardDeclared.ref: type = name_ref ForwardDeclared, imports.%import_ref.3 [template = constants.%ForwardDeclared.type] // CHECK:STDOUT: %f.param: %ForwardDeclared.type = value_param runtime_param0 +// CHECK:STDOUT: %ForwardDeclared.ref: type = name_ref ForwardDeclared, imports.%import_ref.3 [template = constants.%ForwardDeclared.type] // CHECK:STDOUT: %f: %ForwardDeclared.type = bind_name f, %f.param // CHECK:STDOUT: } // CHECK:STDOUT: %Basic.ref.loc10: type = name_ref Basic, imports.%import_ref.2 [template = constants.%Basic.type] @@ -236,8 +234,6 @@ var f: ForwardDeclared* = &f_ref.f; // CHECK:STDOUT: %ForwardDeclared.ref.loc14: type = name_ref ForwardDeclared, imports.%import_ref.3 [template = constants.%ForwardDeclared.type] // CHECK:STDOUT: %F.ref.loc14: %F.assoc_type.2 = name_ref F, imports.%import_ref.13 [template = constants.%assoc1.2] // CHECK:STDOUT: %UseForwardDeclaredF: %F.assoc_type.2 = bind_alias UseForwardDeclaredF, imports.%import_ref.13 [template = constants.%assoc1.2] -// CHECK:STDOUT: %ForwardDeclared.ref.loc16: type = name_ref ForwardDeclared, imports.%import_ref.3 [template = constants.%ForwardDeclared.type] -// CHECK:STDOUT: %ptr: type = ptr_type %ForwardDeclared.type [template = constants.%ptr] // CHECK:STDOUT: %f.var: ref %ptr = var f // CHECK:STDOUT: %f: ref %ptr = bind_name f, %f.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/interface/no_prelude/import_access.carbon b/toolchain/check/testdata/interface/no_prelude/import_access.carbon index c10de96c50423..3ec6c50062672 100644 --- a/toolchain/check/testdata/interface/no_prelude/import_access.carbon +++ b/toolchain/check/testdata/interface/no_prelude/import_access.carbon @@ -215,8 +215,8 @@ private interface Redecl {} // CHECK:STDOUT: %i.patt: %Def.type = binding_pattern i // CHECK:STDOUT: %i.param_patt: %Def.type = value_param_pattern %i.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Def.ref: type = name_ref Def, imports.%import_ref.1 [template = constants.%Def.type] // CHECK:STDOUT: %i.param: %Def.type = value_param runtime_param0 +// CHECK:STDOUT: %Def.ref: type = name_ref Def, imports.%import_ref.1 [template = constants.%Def.type] // CHECK:STDOUT: %i: %Def.type = bind_name i, %i.param // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -248,8 +248,8 @@ private interface Redecl {} // CHECK:STDOUT: %i.patt: = binding_pattern i // CHECK:STDOUT: %i.param_patt: = value_param_pattern %i.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Def.ref: = name_ref Def, [template = ] // CHECK:STDOUT: %i.param: = value_param runtime_param0 +// CHECK:STDOUT: %Def.ref: = name_ref Def, [template = ] // CHECK:STDOUT: %i: = bind_name i, %i.param // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -282,9 +282,11 @@ private interface Redecl {} // CHECK:STDOUT: %i.patt: = binding_pattern i // CHECK:STDOUT: %i.param_patt: = value_param_pattern %i.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Test.ref: = name_ref Test, imports.%Test [template = imports.%Test] -// CHECK:STDOUT: %Def.ref: = name_ref Def, [template = ] // CHECK:STDOUT: %i.param: = value_param runtime_param0 +// CHECK:STDOUT: %.1: = splice_block [template = ] { +// CHECK:STDOUT: %Test.ref: = name_ref Test, imports.%Test [template = imports.%Test] +// CHECK:STDOUT: %Def.ref: = name_ref Def, [template = ] +// CHECK:STDOUT: } // CHECK:STDOUT: %i: = bind_name i, %i.param // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -318,8 +320,8 @@ private interface Redecl {} // CHECK:STDOUT: %i.patt: %ForwardWithDef.type = binding_pattern i // CHECK:STDOUT: %i.param_patt: %ForwardWithDef.type = value_param_pattern %i.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %ForwardWithDef.ref: type = name_ref ForwardWithDef, imports.%import_ref.1 [template = constants.%ForwardWithDef.type] // CHECK:STDOUT: %i.param: %ForwardWithDef.type = value_param runtime_param0 +// CHECK:STDOUT: %ForwardWithDef.ref: type = name_ref ForwardWithDef, imports.%import_ref.1 [template = constants.%ForwardWithDef.type] // CHECK:STDOUT: %i: %ForwardWithDef.type = bind_name i, %i.param // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -351,8 +353,8 @@ private interface Redecl {} // CHECK:STDOUT: %i.patt: = binding_pattern i // CHECK:STDOUT: %i.param_patt: = value_param_pattern %i.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %ForwardWithDef.ref: = name_ref ForwardWithDef, [template = ] // CHECK:STDOUT: %i.param: = value_param runtime_param0 +// CHECK:STDOUT: %ForwardWithDef.ref: = name_ref ForwardWithDef, [template = ] // CHECK:STDOUT: %i: = bind_name i, %i.param // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -385,9 +387,11 @@ private interface Redecl {} // CHECK:STDOUT: %i.patt: = binding_pattern i // CHECK:STDOUT: %i.param_patt: = value_param_pattern %i.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Test.ref: = name_ref Test, imports.%Test [template = imports.%Test] -// CHECK:STDOUT: %ForwardWithDef.ref: = name_ref ForwardWithDef, [template = ] // CHECK:STDOUT: %i.param: = value_param runtime_param0 +// CHECK:STDOUT: %.1: = splice_block [template = ] { +// CHECK:STDOUT: %Test.ref: = name_ref Test, imports.%Test [template = imports.%Test] +// CHECK:STDOUT: %ForwardWithDef.ref: = name_ref ForwardWithDef, [template = ] +// CHECK:STDOUT: } // CHECK:STDOUT: %i: = bind_name i, %i.param // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -417,9 +421,11 @@ private interface Redecl {} // CHECK:STDOUT: %i.patt: = binding_pattern i // CHECK:STDOUT: %i.param_patt: = value_param_pattern %i.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Forward.ref: = name_ref Forward, [template = ] -// CHECK:STDOUT: %ptr: type = ptr_type [template = ] // CHECK:STDOUT: %i.param: = value_param runtime_param0 +// CHECK:STDOUT: %.loc8: type = splice_block %ptr [template = ] { +// CHECK:STDOUT: %Forward.ref: = name_ref Forward, [template = ] +// CHECK:STDOUT: %ptr: type = ptr_type [template = ] +// CHECK:STDOUT: } // CHECK:STDOUT: %i: = bind_name i, %i.param // CHECK:STDOUT: } // CHECK:STDOUT: %Forward.decl: type = interface_decl @Forward [template = constants.%Forward.type] {} {} @@ -454,9 +460,11 @@ private interface Redecl {} // CHECK:STDOUT: %i.patt: = binding_pattern i // CHECK:STDOUT: %i.param_patt: = value_param_pattern %i.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Forward.ref: = name_ref Forward, [template = ] -// CHECK:STDOUT: %ptr: type = ptr_type [template = ] // CHECK:STDOUT: %i.param: = value_param runtime_param0 +// CHECK:STDOUT: %.loc10: type = splice_block %ptr [template = ] { +// CHECK:STDOUT: %Forward.ref: = name_ref Forward, [template = ] +// CHECK:STDOUT: %ptr: type = ptr_type [template = ] +// CHECK:STDOUT: } // CHECK:STDOUT: %i: = bind_name i, %i.param // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -489,9 +497,11 @@ private interface Redecl {} // CHECK:STDOUT: %i.patt: = binding_pattern i // CHECK:STDOUT: %i.param_patt: = value_param_pattern %i.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Forward.ref: = name_ref Forward, [template = ] -// CHECK:STDOUT: %ptr: type = ptr_type [template = ] // CHECK:STDOUT: %i.param: = value_param runtime_param0 +// CHECK:STDOUT: %.loc9: type = splice_block %ptr [template = ] { +// CHECK:STDOUT: %Forward.ref: = name_ref Forward, [template = ] +// CHECK:STDOUT: %ptr: type = ptr_type [template = ] +// CHECK:STDOUT: } // CHECK:STDOUT: %i: = bind_name i, %i.param // CHECK:STDOUT: } // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/interface/no_prelude/self.carbon b/toolchain/check/testdata/interface/no_prelude/self.carbon index 131b346937f8f..8f5bf9ac2ebc7 100644 --- a/toolchain/check/testdata/interface/no_prelude/self.carbon +++ b/toolchain/check/testdata/interface/no_prelude/self.carbon @@ -39,13 +39,15 @@ interface UseSelf { // CHECK:STDOUT: %return.patt: @F.%Self.as_type.loc12_14.1 (%Self.as_type) = return_slot_pattern // CHECK:STDOUT: %return.param_patt: @F.%Self.as_type.loc12_14.1 (%Self.as_type) = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref.loc12_14: %UseSelf.type = name_ref Self, @UseSelf.%Self [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %Self.as_type.loc12_14.2: type = facet_access_type %Self.ref.loc12_14 [symbolic = %Self.as_type.loc12_14.1 (constants.%Self.as_type)] -// CHECK:STDOUT: %.loc12_14: type = converted %Self.ref.loc12_14, %Self.as_type.loc12_14.2 [symbolic = %Self.as_type.loc12_14.1 (constants.%Self.as_type)] // CHECK:STDOUT: %Self.ref.loc12_25: %UseSelf.type = name_ref Self, @UseSelf.%Self [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: %Self.as_type.loc12_25: type = facet_access_type %Self.ref.loc12_25 [symbolic = %Self.as_type.loc12_14.1 (constants.%Self.as_type)] // CHECK:STDOUT: %.loc12_25: type = converted %Self.ref.loc12_25, %Self.as_type.loc12_25 [symbolic = %Self.as_type.loc12_14.1 (constants.%Self.as_type)] // CHECK:STDOUT: %self.param: @F.%Self.as_type.loc12_14.1 (%Self.as_type) = value_param runtime_param0 +// CHECK:STDOUT: %.loc12_14.2: type = splice_block %.loc12_14.1 [symbolic = %Self.as_type.loc12_14.1 (constants.%Self.as_type)] { +// CHECK:STDOUT: %Self.ref.loc12_14: %UseSelf.type = name_ref Self, @UseSelf.%Self [symbolic = %Self (constants.%Self)] +// CHECK:STDOUT: %Self.as_type.loc12_14.2: type = facet_access_type %Self.ref.loc12_14 [symbolic = %Self.as_type.loc12_14.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %.loc12_14.1: type = converted %Self.ref.loc12_14, %Self.as_type.loc12_14.2 [symbolic = %Self.as_type.loc12_14.1 (constants.%Self.as_type)] +// CHECK:STDOUT: } // CHECK:STDOUT: %self: @F.%Self.as_type.loc12_14.1 (%Self.as_type) = bind_name self, %self.param // CHECK:STDOUT: %return.param: ref @F.%Self.as_type.loc12_14.1 (%Self.as_type) = out_param runtime_param1 // CHECK:STDOUT: %return: ref @F.%Self.as_type.loc12_14.1 (%Self.as_type) = return_slot %return.param diff --git a/toolchain/check/testdata/interface/no_prelude/syntactic_merge.carbon b/toolchain/check/testdata/interface/no_prelude/syntactic_merge.carbon index fdb2743301576..9d8d996ae3991 100644 --- a/toolchain/check/testdata/interface/no_prelude/syntactic_merge.carbon +++ b/toolchain/check/testdata/interface/no_prelude/syntactic_merge.carbon @@ -217,32 +217,32 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: %a.patt.loc7_15.1: %C = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc7_15.2 (constants.%a.patt)] // CHECK:STDOUT: %a.param_patt: %C = value_param_pattern %a.patt.loc7_15.1, runtime_param [symbolic = %a.patt.loc7_15.2 (constants.%a.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref.loc7: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a.param.loc7: %C = value_param runtime_param +// CHECK:STDOUT: %C.ref.loc7: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a.loc7_15.1: %C = bind_symbolic_name a, 0, %a.param.loc7 [symbolic = %a.loc7_15.2 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: %Foo.decl.loc8: %Foo.type.1 = interface_decl @Foo [template = constants.%Foo.generic] { // CHECK:STDOUT: %a.patt.loc7_15.1: %C = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc7_15.2 (constants.%a.patt)] // CHECK:STDOUT: %a.param_patt: %C = value_param_pattern %a.patt.loc7_15.1, runtime_param [symbolic = %a.patt.loc7_15.2 (constants.%a.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref.loc8: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a.param.loc8: %C = value_param runtime_param +// CHECK:STDOUT: %C.ref.loc8: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a.loc8: %C = bind_symbolic_name a, 0, %a.param.loc8 [symbolic = constants.%a] // CHECK:STDOUT: } // CHECK:STDOUT: %Bar.decl.loc10: %Bar.type.1 = interface_decl @Bar [template = constants.%Bar.generic] { // CHECK:STDOUT: %a.patt.loc10_15.1: %C = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc10_15.2 (constants.%a.patt)] // CHECK:STDOUT: %a.param_patt: %C = value_param_pattern %a.patt.loc10_15.1, runtime_param [symbolic = %a.patt.loc10_15.2 (constants.%a.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %D.ref.loc10: type = name_ref D, file.%D [template = constants.%C] // CHECK:STDOUT: %a.param.loc10: %C = value_param runtime_param +// CHECK:STDOUT: %D.ref.loc10: type = name_ref D, file.%D [template = constants.%C] // CHECK:STDOUT: %a.loc10_15.1: %C = bind_symbolic_name a, 0, %a.param.loc10 [symbolic = %a.loc10_15.2 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: %Bar.decl.loc11: %Bar.type.1 = interface_decl @Bar [template = constants.%Bar.generic] { // CHECK:STDOUT: %a.patt.loc10_15.1: %C = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc10_15.2 (constants.%a.patt)] // CHECK:STDOUT: %a.param_patt: %C = value_param_pattern %a.patt.loc10_15.1, runtime_param [symbolic = %a.patt.loc10_15.2 (constants.%a.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %D.ref.loc11: type = name_ref D, file.%D [template = constants.%C] // CHECK:STDOUT: %a.param.loc11: %C = value_param runtime_param +// CHECK:STDOUT: %D.ref.loc11: type = name_ref D, file.%D [template = constants.%C] // CHECK:STDOUT: %a.loc11: %C = bind_symbolic_name a, 0, %a.param.loc11 [symbolic = constants.%a] // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -327,16 +327,16 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: %a.patt.loc6_21.1: %C = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc6_21.2 (constants.%a.patt)] // CHECK:STDOUT: %a.param_patt: %C = value_param_pattern %a.patt.loc6_21.1, runtime_param [symbolic = %a.patt.loc6_21.2 (constants.%a.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref.loc6: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a.param.loc6: %C = value_param runtime_param +// CHECK:STDOUT: %C.ref.loc6: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a.loc6_21.1: %C = bind_symbolic_name a, 0, %a.param.loc6 [symbolic = %a.loc6_21.2 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: %Foo.decl.loc7: %Foo.type.1 = interface_decl @Foo [template = constants.%Foo.generic] { // CHECK:STDOUT: %a.patt.loc6_21.1: %C = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc6_21.2 (constants.%a.patt)] // CHECK:STDOUT: %a.param_patt: %C = value_param_pattern %a.patt.loc6_21.1, runtime_param [symbolic = %a.patt.loc6_21.2 (constants.%a.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref.loc7: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a.param.loc7: %C = value_param runtime_param +// CHECK:STDOUT: %C.ref.loc7: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a.loc7: %C = bind_symbolic_name a, 0, %a.param.loc7 [symbolic = constants.%a] // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -399,16 +399,16 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: %a.patt.loc6_15.1: %C = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc6_15.2 (constants.%a.patt)] // CHECK:STDOUT: %a.param_patt: %C = value_param_pattern %a.patt.loc6_15.1, runtime_param [symbolic = %a.patt.loc6_15.2 (constants.%a.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a.param: %C = value_param runtime_param +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a.loc6_15.1: %C = bind_symbolic_name a, 0, %a.param [symbolic = %a.loc6_15.2 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: %.decl: %.type.1 = interface_decl @.1 [template = constants.%.generic] { // CHECK:STDOUT: %a.patt.loc14_15.1: %C = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc14_15.2 (constants.%a.patt)] // CHECK:STDOUT: %a.param_patt: %C = value_param_pattern %a.patt.loc14_15.1, runtime_param [symbolic = %a.patt.loc14_15.2 (constants.%a.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a.param: %C = value_param runtime_param +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a.loc14_15.1: %C = bind_symbolic_name a, 0, %a.param [symbolic = %a.loc14_15.2 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -481,16 +481,16 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: %a.patt.loc6_15.1: %C = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc6_15.2 (constants.%a.patt)] // CHECK:STDOUT: %a.param_patt: %C = value_param_pattern %a.patt.loc6_15.1, runtime_param [symbolic = %a.patt.loc6_15.2 (constants.%a.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref.loc6: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a.param.loc6: %C = value_param runtime_param +// CHECK:STDOUT: %C.ref.loc6: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a.loc6_15.1: %C = bind_symbolic_name a, 0, %a.param.loc6 [symbolic = %a.loc6_15.2 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: %Foo.decl.loc7: %Foo.type.1 = interface_decl @Foo [template = constants.%Foo.generic] { // CHECK:STDOUT: %a.patt.loc6_15.1: %C = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc6_15.2 (constants.%a.patt)] // CHECK:STDOUT: %a.param_patt: %C = value_param_pattern %a.patt.loc6_15.1, runtime_param [symbolic = %a.patt.loc6_15.2 (constants.%a.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref.loc7: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a.param.loc7: %C = value_param runtime_param +// CHECK:STDOUT: %C.ref.loc7: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a.loc7: %C = bind_symbolic_name a, 0, %a.param.loc7 [symbolic = constants.%a] // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -555,16 +555,16 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: %a.patt.loc7_15.1: %C = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc7_15.2 (constants.%a.patt)] // CHECK:STDOUT: %a.param_patt: %C = value_param_pattern %a.patt.loc7_15.1, runtime_param [symbolic = %a.patt.loc7_15.2 (constants.%a.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a.param: %C = value_param runtime_param +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a.loc7_15.1: %C = bind_symbolic_name a, 0, %a.param [symbolic = %a.loc7_15.2 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: %Bar.decl: %Bar.type = interface_decl @Bar [template = constants.%Bar.generic] { // CHECK:STDOUT: %a.patt.loc8_15.1: %C = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc8_15.2 (constants.%a.patt)] // CHECK:STDOUT: %a.param_patt: %C = value_param_pattern %a.patt.loc8_15.1, runtime_param [symbolic = %a.patt.loc8_15.2 (constants.%a.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %D.ref: type = name_ref D, file.%D [template = constants.%C] // CHECK:STDOUT: %a.param: %C = value_param runtime_param +// CHECK:STDOUT: %D.ref: type = name_ref D, file.%D [template = constants.%C] // CHECK:STDOUT: %a.loc8_15.1: %C = bind_symbolic_name a, 0, %a.param [symbolic = %a.loc8_15.2 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -645,16 +645,16 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: %a.patt.loc12_15.1: %C = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc12_15.2 (constants.%a.patt)] // CHECK:STDOUT: %a.param_patt: %C = value_param_pattern %a.patt.loc12_15.1, runtime_param [symbolic = %a.patt.loc12_15.2 (constants.%a.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %a.param: %C = value_param runtime_param +// CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %a.loc12_15.1: %C = bind_symbolic_name a, 0, %a.param [symbolic = %a.loc12_15.2 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: %.decl.loc21: %.type.3 = interface_decl @.2 [template = constants.%.generic.2] { // CHECK:STDOUT: %a.patt.loc21_15.1: %C = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc21_15.2 (constants.%a.patt)] // CHECK:STDOUT: %a.param_patt: %C = value_param_pattern %a.patt.loc21_15.1, runtime_param [symbolic = %a.patt.loc21_15.2 (constants.%a.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %D.ref: type = name_ref D, imports.%import_ref.2 [template = constants.%C] // CHECK:STDOUT: %a.param: %C = value_param runtime_param +// CHECK:STDOUT: %D.ref: type = name_ref D, imports.%import_ref.2 [template = constants.%C] // CHECK:STDOUT: %a.loc21_15.1: %C = bind_symbolic_name a, 0, %a.param [symbolic = %a.loc21_15.2 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -768,16 +768,16 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: %a.patt.loc7_15.1: %C = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc7_15.2 (constants.%a.patt)] // CHECK:STDOUT: %a.param_patt: %C = value_param_pattern %a.patt.loc7_15.1, runtime_param [symbolic = %a.patt.loc7_15.2 (constants.%a.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a.param: %C = value_param runtime_param +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a.loc7_15.1: %C = bind_symbolic_name a, 0, %a.param [symbolic = %a.loc7_15.2 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: %.decl: %.type.1 = interface_decl @.1 [template = constants.%.generic] { // CHECK:STDOUT: %b.patt.loc15_15.1: %C = symbolic_binding_pattern b, 0 [symbolic = %b.patt.loc15_15.2 (constants.%b.patt)] // CHECK:STDOUT: %b.param_patt: %C = value_param_pattern %b.patt.loc15_15.1, runtime_param [symbolic = %b.patt.loc15_15.2 (constants.%b.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %D.ref: type = name_ref D, file.%D [template = constants.%C] // CHECK:STDOUT: %b.param: %C = value_param runtime_param +// CHECK:STDOUT: %D.ref: type = name_ref D, file.%D [template = constants.%C] // CHECK:STDOUT: %b.loc15_15.1: %C = bind_symbolic_name b, 0, %b.param [symbolic = %b.loc15_15.2 (constants.%b)] // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -855,16 +855,16 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: %a.patt.loc7_15.1: %C = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc7_15.2 (constants.%a.patt)] // CHECK:STDOUT: %a.param_patt: %C = value_param_pattern %a.patt.loc7_15.1, runtime_param [symbolic = %a.patt.loc7_15.2 (constants.%a.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a.param: %C = value_param runtime_param +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a.loc7_15.1: %C = bind_symbolic_name a, 0, %a.param [symbolic = %a.loc7_15.2 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: %.decl: %.type.1 = interface_decl @.1 [template = constants.%.generic] { // CHECK:STDOUT: %a.patt.loc15_15.1: %C = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc15_15.2 (constants.%a.patt)] // CHECK:STDOUT: %a.param_patt: %C = value_param_pattern %a.patt.loc15_15.1, runtime_param [symbolic = %a.patt.loc15_15.2 (constants.%a.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %D.ref: type = name_ref D, file.%D [template = constants.%C] // CHECK:STDOUT: %a.param: %C = value_param runtime_param +// CHECK:STDOUT: %D.ref: type = name_ref D, file.%D [template = constants.%C] // CHECK:STDOUT: %a.loc15_15.1: %C = bind_symbolic_name a, 0, %a.param [symbolic = %a.loc15_15.2 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -942,16 +942,16 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: %a.patt.loc7_15.1: %C = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc7_15.2 (constants.%a.patt)] // CHECK:STDOUT: %a.param_patt: %C = value_param_pattern %a.patt.loc7_15.1, runtime_param [symbolic = %a.patt.loc7_15.2 (constants.%a.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a.param: %C = value_param runtime_param +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a.loc7_15.1: %C = bind_symbolic_name a, 0, %a.param [symbolic = %a.loc7_15.2 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: %.decl: %.type.1 = interface_decl @.1 [template = constants.%.generic] { // CHECK:STDOUT: %a.patt.loc15_15.1: %C = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc15_15.2 (constants.%a.patt)] // CHECK:STDOUT: %a.param_patt: %C = value_param_pattern %a.patt.loc15_15.1, runtime_param [symbolic = %a.patt.loc15_15.2 (constants.%a.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %D.ref: type = name_ref D, file.%D [template = constants.%C] // CHECK:STDOUT: %a.param: %C = value_param runtime_param +// CHECK:STDOUT: %D.ref: type = name_ref D, file.%D [template = constants.%C] // CHECK:STDOUT: %a.loc15_15.1: %C = bind_symbolic_name a, 0, %a.param [symbolic = %a.loc15_15.2 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -1022,8 +1022,8 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: %a.patt.loc6_15.1: %C = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc6_15.2 (constants.%a.patt)] // CHECK:STDOUT: %a.param_patt: %C = value_param_pattern %a.patt.loc6_15.1, runtime_param [symbolic = %a.patt.loc6_15.2 (constants.%a.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a.param: %C = value_param runtime_param +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a.loc6_15.1: %C = bind_symbolic_name a, 0, %a.param [symbolic = %a.loc6_15.2 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -1085,8 +1085,8 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: %a.patt.loc17_15.1: %C = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc17_15.2 (constants.%a.patt)] // CHECK:STDOUT: %a.param_patt: %C = value_param_pattern %a.patt.loc17_15.1, runtime_param [symbolic = %a.patt.loc17_15.2 (constants.%a.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %D.ref: type = name_ref D, file.%D [template = constants.%C] // CHECK:STDOUT: %a.param: %C = value_param runtime_param +// CHECK:STDOUT: %D.ref: type = name_ref D, file.%D [template = constants.%C] // CHECK:STDOUT: %a.loc17_15.1: %C = bind_symbolic_name a, 0, %a.param [symbolic = %a.loc17_15.2 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -1160,19 +1160,23 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: %a.patt.loc6_15.1: %const = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc6_15.2 (constants.%a.patt)] // CHECK:STDOUT: %a.param_patt: %const = value_param_pattern %a.patt.loc6_15.1, runtime_param [symbolic = %a.patt.loc6_15.2 (constants.%a.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %const: type = const_type %C [template = constants.%const] // CHECK:STDOUT: %a.param: %const = value_param runtime_param +// CHECK:STDOUT: %.loc6: type = splice_block %const [template = constants.%const] { +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %const: type = const_type %C [template = constants.%const] +// CHECK:STDOUT: } // CHECK:STDOUT: %a.loc6_15.1: %const = bind_symbolic_name a, 0, %a.param [symbolic = %a.loc6_15.2 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: %.decl: %.type.1 = interface_decl @.1 [template = constants.%.generic] { // CHECK:STDOUT: %a.patt.loc17_15.1: %const = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc17_15.2 (constants.%a.patt)] // CHECK:STDOUT: %a.param_patt: %const = value_param_pattern %a.patt.loc17_15.1, runtime_param [symbolic = %a.patt.loc17_15.2 (constants.%a.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %const.loc17_26: type = const_type %C [template = constants.%const] -// CHECK:STDOUT: %const.loc17_19: type = const_type %const [template = constants.%const] // CHECK:STDOUT: %a.param: %const = value_param runtime_param +// CHECK:STDOUT: %.loc17: type = splice_block %const.loc17_19 [template = constants.%const] { +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %const.loc17_26: type = const_type %C [template = constants.%const] +// CHECK:STDOUT: %const.loc17_19: type = const_type %const [template = constants.%const] +// CHECK:STDOUT: } // CHECK:STDOUT: %a.loc17_15.1: %const = bind_symbolic_name a, 0, %a.param [symbolic = %a.loc17_15.2 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/interface/todo_define_not_default.carbon b/toolchain/check/testdata/interface/todo_define_not_default.carbon index 52ab8e46fd307..9bbbe677c58d1 100644 --- a/toolchain/check/testdata/interface/todo_define_not_default.carbon +++ b/toolchain/check/testdata/interface/todo_define_not_default.carbon @@ -80,15 +80,19 @@ interface I { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc14_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc14_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc14_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc14_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc14_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc14_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc14_11: type = splice_block %i32.loc14_11 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc14_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc14_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %.loc14_19: type = splice_block %i32.loc14_19 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc14_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc14_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -102,8 +106,6 @@ interface I { // CHECK:STDOUT: %.loc18_28: type = converted %.loc18_27, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %T: type = assoc_const_decl T [template] // CHECK:STDOUT: %assoc2: %assoc_type.1 = assoc_entity element2, %T [template = constants.%assoc2] -// CHECK:STDOUT: %int_32.loc19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_42: Core.IntLiteral = int_value 42 [template = constants.%int_42.1] // CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_42, %impl.elem0 [template = constants.%Convert.bound] diff --git a/toolchain/check/testdata/ir/duplicate_name_same_line.carbon b/toolchain/check/testdata/ir/duplicate_name_same_line.carbon index b36f50311d37b..77996dc1ce78c 100644 --- a/toolchain/check/testdata/ir/duplicate_name_same_line.carbon +++ b/toolchain/check/testdata/ir/duplicate_name_same_line.carbon @@ -56,8 +56,6 @@ fn A() { if (true) { var n: i32 = 1; } if (true) { var n: i32 = 2; } } // CHECK:STDOUT: if %true.loc11_14 br !if.then.loc11_18 else br !if.else.loc11_18 // CHECK:STDOUT: // CHECK:STDOUT: !if.then.loc11_18: -// CHECK:STDOUT: %int_32.loc11_29: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc11_29: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %n.var.loc11_26: ref %i32 = var n // CHECK:STDOUT: %n.loc11_26: ref %i32 = bind_name n, %n.var.loc11_26 // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] @@ -74,8 +72,6 @@ fn A() { if (true) { var n: i32 = 1; } if (true) { var n: i32 = 2; } } // CHECK:STDOUT: if %true.loc11_44 br !if.then.loc11_48 else br !if.else.loc11_48 // CHECK:STDOUT: // CHECK:STDOUT: !if.then.loc11_48: -// CHECK:STDOUT: %int_32.loc11_59: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc11_59: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %n.var.loc11_56: ref %i32 = var n // CHECK:STDOUT: %n.loc11_56: ref %i32 = bind_name n, %n.var.loc11_56 // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] diff --git a/toolchain/check/testdata/let/compile_time_bindings.carbon b/toolchain/check/testdata/let/compile_time_bindings.carbon index ce3a4607ca2d0..0382f1735569a 100644 --- a/toolchain/check/testdata/let/compile_time_bindings.carbon +++ b/toolchain/check/testdata/let/compile_time_bindings.carbon @@ -200,8 +200,6 @@ impl i32 as Empty { // CHECK:STDOUT: %return.param: ref %empty_tuple.type = out_param runtime_param0 // CHECK:STDOUT: %return: ref %empty_tuple.type = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc10_12.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc10_12.2: type = converted %.loc10_12.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %.loc10_17: %empty_tuple.type = tuple_literal () // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [template = constants.%empty_tuple] // CHECK:STDOUT: %.loc10_18: %empty_tuple.type = converted %.loc10_17, %empty_tuple [template = constants.%empty_tuple] @@ -250,8 +248,6 @@ impl i32 as Empty { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { -// CHECK:STDOUT: %.loc9_12.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc9_12.2: type = converted %.loc9_12.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %.loc9_17: %empty_tuple.type = tuple_literal () // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [template = constants.%empty_tuple] // CHECK:STDOUT: %.loc9_18: %empty_tuple.type = converted %.loc9_17, %empty_tuple [template = constants.%empty_tuple] @@ -321,8 +317,6 @@ impl i32 as Empty { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { -// CHECK:STDOUT: %.loc9_12.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc9_12.2: type = converted %.loc9_12.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %.loc9_17: %empty_tuple.type = tuple_literal () // CHECK:STDOUT: %empty_tuple.loc9: %empty_tuple.type = tuple_value () [template = constants.%empty_tuple] // CHECK:STDOUT: %.loc9_18: %empty_tuple.type = converted %.loc9_17, %empty_tuple.loc9 [template = constants.%empty_tuple] @@ -331,21 +325,15 @@ impl i32 as Empty { // CHECK:STDOUT: %b.patt.loc10_8.2: %tuple.type.1 = symbolic_binding_pattern b, 0 [symbolic = %b.patt.loc10_8.1 (constants.%b.patt)] // CHECK:STDOUT: %b.param_patt: %tuple.type.1 = value_param_pattern %b.patt.loc10_8.2, runtime_param [symbolic = %b.patt.loc10_8.1 (constants.%b.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc10_14: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc10_16.1: %tuple.type.1 = tuple_literal (%.loc10_14) -// CHECK:STDOUT: %.loc10_16.2: type = converted %.loc10_14, constants.%empty_tuple.type [template = constants.%empty_tuple.type] -// CHECK:STDOUT: %.loc10_16.3: type = converted %.loc10_16.1, constants.%tuple.type.1 [template = constants.%tuple.type.1] // CHECK:STDOUT: %b.param: %tuple.type.1 = value_param runtime_param +// CHECK:STDOUT: %.loc10_16.4: type = splice_block %.loc10_16.3 [template = constants.%tuple.type.1] { +// CHECK:STDOUT: %.loc10_14: %empty_tuple.type = tuple_literal () +// CHECK:STDOUT: %.loc10_16.1: %tuple.type.1 = tuple_literal (%.loc10_14) +// CHECK:STDOUT: %.loc10_16.2: type = converted %.loc10_14, constants.%empty_tuple.type [template = constants.%empty_tuple.type] +// CHECK:STDOUT: %.loc10_16.3: type = converted %.loc10_16.1, constants.%tuple.type.1 [template = constants.%tuple.type.1] +// CHECK:STDOUT: } // CHECK:STDOUT: %b.loc10_8.2: %tuple.type.1 = bind_symbolic_name b, 0, %b.param [symbolic = %b.loc10_8.1 (constants.%b)] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc22_13: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc22_17: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc22_21: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc22_22.1: %tuple.type.2 = tuple_literal (%.loc22_13, %.loc22_17, %.loc22_21) -// CHECK:STDOUT: %.loc22_22.2: type = converted %.loc22_13, constants.%empty_tuple.type [template = constants.%empty_tuple.type] -// CHECK:STDOUT: %.loc22_22.3: type = converted %.loc22_17, constants.%empty_tuple.type [template = constants.%empty_tuple.type] -// CHECK:STDOUT: %.loc22_22.4: type = converted %.loc22_21, constants.%empty_tuple.type [template = constants.%empty_tuple.type] -// CHECK:STDOUT: %.loc22_22.5: type = converted %.loc22_22.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %.loc22_28: %empty_tuple.type = tuple_literal () // CHECK:STDOUT: %.loc22_32: %empty_tuple.type = tuple_literal () // CHECK:STDOUT: %.loc22_36: %empty_tuple.type = tuple_literal () @@ -381,12 +369,6 @@ impl i32 as Empty { // CHECK:STDOUT: // CHECK:STDOUT: fn(%b.param_patt: %tuple.type.1) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc11_15: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc11_19: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc11_20.1: %tuple.type.3 = tuple_literal (%.loc11_15, %.loc11_19) -// CHECK:STDOUT: %.loc11_20.2: type = converted %.loc11_15, constants.%empty_tuple.type [template = constants.%empty_tuple.type] -// CHECK:STDOUT: %.loc11_20.3: type = converted %.loc11_19, constants.%empty_tuple.type [template = constants.%empty_tuple.type] -// CHECK:STDOUT: %.loc11_20.4: type = converted %.loc11_20.1, constants.%tuple.type.3 [template = constants.%tuple.type.3] // CHECK:STDOUT: %.loc11_26: %empty_tuple.type = tuple_literal () // CHECK:STDOUT: %.loc11_30: %empty_tuple.type = tuple_literal () // CHECK:STDOUT: %.loc11_31.1: %tuple.type.3 = tuple_literal (%.loc11_26, %.loc11_30) @@ -397,18 +379,12 @@ impl i32 as Empty { // CHECK:STDOUT: %tuple: %tuple.type.3 = tuple_value (%.loc11_31.2, %.loc11_31.3) [template = constants.%tuple.2] // CHECK:STDOUT: %.loc11_32: %tuple.type.3 = converted %.loc11_31.1, %tuple [template = constants.%tuple.2] // CHECK:STDOUT: %c.loc11_9.1: %tuple.type.3 = bind_symbolic_name c, 1, %.loc11_32 [symbolic = %c.loc11_9.2 (constants.%c)] -// CHECK:STDOUT: %.loc13_14.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc13_14.2: type = converted %.loc13_14.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %a1.var: ref %empty_tuple.type = var a1 // CHECK:STDOUT: %a1: ref %empty_tuple.type = bind_name a1, %a1.var // CHECK:STDOUT: %a.ref: %empty_tuple.type = name_ref a, @C.%a // CHECK:STDOUT: %.loc13_18: init %empty_tuple.type = tuple_init () to %a1.var [template = constants.%empty_tuple] // CHECK:STDOUT: %.loc13_19: init %empty_tuple.type = converted %a.ref, %.loc13_18 [template = constants.%empty_tuple] // CHECK:STDOUT: assign %a1.var, %.loc13_19 -// CHECK:STDOUT: %.loc14_15: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc14_17.1: %tuple.type.1 = tuple_literal (%.loc14_15) -// CHECK:STDOUT: %.loc14_17.2: type = converted %.loc14_15, constants.%empty_tuple.type [template = constants.%empty_tuple.type] -// CHECK:STDOUT: %.loc14_17.3: type = converted %.loc14_17.1, constants.%tuple.type.1 [template = constants.%tuple.type.1] // CHECK:STDOUT: %b1.var: ref %tuple.type.1 = var b1 // CHECK:STDOUT: %b1: ref %tuple.type.1 = bind_name b1, %b1.var // CHECK:STDOUT: %b.ref: %tuple.type.1 = name_ref b, %b.loc10_8.2 [symbolic = %b.loc10_8.1 (constants.%b)] @@ -419,12 +395,6 @@ impl i32 as Empty { // CHECK:STDOUT: %.loc14_21.3: init %tuple.type.1 = tuple_init (%.loc14_21.2) to %b1.var [template = constants.%tuple.3] // CHECK:STDOUT: %.loc14_22: init %tuple.type.1 = converted %b.ref, %.loc14_21.3 [template = constants.%tuple.3] // CHECK:STDOUT: assign %b1.var, %.loc14_22 -// CHECK:STDOUT: %.loc15_15: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc15_19: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc15_20.1: %tuple.type.3 = tuple_literal (%.loc15_15, %.loc15_19) -// CHECK:STDOUT: %.loc15_20.2: type = converted %.loc15_15, constants.%empty_tuple.type [template = constants.%empty_tuple.type] -// CHECK:STDOUT: %.loc15_20.3: type = converted %.loc15_19, constants.%empty_tuple.type [template = constants.%empty_tuple.type] -// CHECK:STDOUT: %.loc15_20.4: type = converted %.loc15_20.1, constants.%tuple.type.3 [template = constants.%tuple.type.3] // CHECK:STDOUT: %c1.var: ref %tuple.type.3 = var c1 // CHECK:STDOUT: %c1: ref %tuple.type.3 = bind_name c1, %c1.var // CHECK:STDOUT: %c.ref: %tuple.type.3 = name_ref c, %c.loc11_9.1 [symbolic = %c.loc11_9.2 (constants.%c)] @@ -439,14 +409,6 @@ impl i32 as Empty { // CHECK:STDOUT: %.loc15_24.5: init %tuple.type.3 = tuple_init (%.loc15_24.2, %.loc15_24.4) to %c1.var [template = constants.%tuple.2] // CHECK:STDOUT: %.loc15_25: init %tuple.type.3 = converted %c.ref, %.loc15_24.5 [template = constants.%tuple.2] // CHECK:STDOUT: assign %c1.var, %.loc15_25 -// CHECK:STDOUT: %.loc16_15: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc16_19: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc16_23: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc16_24.1: %tuple.type.2 = tuple_literal (%.loc16_15, %.loc16_19, %.loc16_23) -// CHECK:STDOUT: %.loc16_24.2: type = converted %.loc16_15, constants.%empty_tuple.type [template = constants.%empty_tuple.type] -// CHECK:STDOUT: %.loc16_24.3: type = converted %.loc16_19, constants.%empty_tuple.type [template = constants.%empty_tuple.type] -// CHECK:STDOUT: %.loc16_24.4: type = converted %.loc16_23, constants.%empty_tuple.type [template = constants.%empty_tuple.type] -// CHECK:STDOUT: %.loc16_24.5: type = converted %.loc16_24.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %d1.var: ref %tuple.type.2 = var d1 // CHECK:STDOUT: %d1: ref %tuple.type.2 = bind_name d1, %d1.var // CHECK:STDOUT: %d.ref: %tuple.type.2 = name_ref d, @C.%d @@ -512,8 +474,6 @@ impl i32 as Empty { // CHECK:STDOUT: %return.param: ref %empty_tuple.type = out_param runtime_param0 // CHECK:STDOUT: %return: ref %empty_tuple.type = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc14_12.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc14_12.2: type = converted %.loc14_12.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %x: %empty_tuple.type = bind_name x, // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] // CHECK:STDOUT: @@ -569,8 +529,8 @@ impl i32 as Empty { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc4: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc4: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } @@ -578,8 +538,6 @@ impl i32 as Empty { // CHECK:STDOUT: // CHECK:STDOUT: fn @F() -> %i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int_32.loc5: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc5: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound] @@ -634,8 +592,8 @@ impl i32 as Empty { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc4: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc4: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } @@ -647,8 +605,6 @@ impl i32 as Empty { // CHECK:STDOUT: if %true br !if.then else br !if.else // CHECK:STDOUT: // CHECK:STDOUT: !if.then: -// CHECK:STDOUT: %int_32.loc6: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc6: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %impl.elem0.loc6: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc6: = bound_method %int_0, %impl.elem0.loc6 [template = constants.%Convert.bound.1] @@ -866,8 +822,8 @@ impl i32 as Empty { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Empty.decl: type = interface_decl @Empty [template = constants.%Empty.type] {} {} // CHECK:STDOUT: impl_decl @impl.1 [template] {} { -// CHECK:STDOUT: %int_32.loc6: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc6: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %Empty.ref: type = name_ref Empty, file.%Empty.decl [template = constants.%Empty.type] // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -880,9 +836,7 @@ impl i32 as Empty { // CHECK:STDOUT: witness = () // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.1: %i32.loc6 as %Empty.ref { -// CHECK:STDOUT: %int_32.loc10: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc10: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: impl @impl.1: %i32 as %Empty.ref { // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound] diff --git a/toolchain/check/testdata/let/convert.carbon b/toolchain/check/testdata/let/convert.carbon index e37b5772c5029..d6c6e058cce45 100644 --- a/toolchain/check/testdata/let/convert.carbon +++ b/toolchain/check/testdata/let/convert.carbon @@ -22,7 +22,6 @@ fn F() -> i32 { // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %tuple.type.1: type = tuple_type (type, type, type) [template] // CHECK:STDOUT: %tuple.type.2: type = tuple_type (%i32, %i32, %i32) [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] @@ -63,8 +62,8 @@ fn F() -> i32 { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } @@ -72,14 +71,6 @@ fn F() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: fn @F() -> %i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int_32.loc12_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc12_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc12_16: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc12_16: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc12_21: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc12_21: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc12_24.1: %tuple.type.1 = tuple_literal (%i32.loc12_11, %i32.loc12_16, %i32.loc12_21) -// CHECK:STDOUT: %.loc12_24.2: type = converted %.loc12_24.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %v.var: ref %tuple.type.2 = var v // CHECK:STDOUT: %v: ref %tuple.type.2 = bind_name v, %v.var // CHECK:STDOUT: %int_1.loc12: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] @@ -110,14 +101,6 @@ fn F() -> i32 { // CHECK:STDOUT: %.loc12_36.8: init %tuple.type.2 = tuple_init (%.loc12_36.3, %.loc12_36.5, %.loc12_36.7) to %v.var [template = constants.%tuple] // CHECK:STDOUT: %.loc12_37: init %tuple.type.2 = converted %.loc12_36.1, %.loc12_36.8 [template = constants.%tuple] // CHECK:STDOUT: assign %v.var, %.loc12_37 -// CHECK:STDOUT: %int_32.loc14_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc14_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc14_16: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc14_16: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc14_21: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc14_21: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc14_24.1: %tuple.type.1 = tuple_literal (%i32.loc14_11, %i32.loc14_16, %i32.loc14_21) -// CHECK:STDOUT: %.loc14_24.2: type = converted %.loc14_24.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %v.ref: ref %tuple.type.2 = name_ref v, %v // CHECK:STDOUT: %tuple.elem0.loc14: ref %i32 = tuple_access %v.ref, element0 // CHECK:STDOUT: %.loc14_28.1: %i32 = bind_value %tuple.elem0.loc14 diff --git a/toolchain/check/testdata/let/fail_duplicate_decl.carbon b/toolchain/check/testdata/let/fail_duplicate_decl.carbon index 358e9ed7ee307..95e0e7e159550 100644 --- a/toolchain/check/testdata/let/fail_duplicate_decl.carbon +++ b/toolchain/check/testdata/let/fail_duplicate_decl.carbon @@ -60,8 +60,6 @@ fn F() { // CHECK:STDOUT: // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int_32.loc12: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc12: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %impl.elem0.loc12: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc12: = bound_method %int_1, %impl.elem0.loc12 [template = constants.%Convert.bound.1] @@ -70,8 +68,6 @@ fn F() { // CHECK:STDOUT: %.loc12_17.1: %i32 = value_of_initializer %int.convert_checked.loc12 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc12_17.2: %i32 = converted %int_1, %.loc12_17.1 [template = constants.%int_1.2] // CHECK:STDOUT: %a.loc12: %i32 = bind_name a, %.loc12_17.2 -// CHECK:STDOUT: %int_32.loc19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %impl.elem0.loc19: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc19: = bound_method %int_2, %impl.elem0.loc19 [template = constants.%Convert.bound.2] diff --git a/toolchain/check/testdata/let/fail_generic.carbon b/toolchain/check/testdata/let/fail_generic.carbon index f4929b1f3531f..4e137a2e6bcf0 100644 --- a/toolchain/check/testdata/let/fail_generic.carbon +++ b/toolchain/check/testdata/let/fail_generic.carbon @@ -60,11 +60,13 @@ fn F(a: i32) -> i32 { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc12_9: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc12_9: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc12_17: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc12_17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc12: type = splice_block %i32.loc12_9 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc12_9: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc12_9: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -76,7 +78,6 @@ fn F(a: i32) -> i32 { // CHECK:STDOUT: %int_32.loc13: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc13: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0, %i32.loc13 [symbolic = constants.%T] -// CHECK:STDOUT: %T.ref: type = name_ref T, %T [symbolic = constants.%T] // CHECK:STDOUT: %int_5: Core.IntLiteral = int_value 5 [template = constants.%int_5] // CHECK:STDOUT: %.loc21: %T = converted %int_5, [template = ] // CHECK:STDOUT: %x: %T = bind_name x, diff --git a/toolchain/check/testdata/let/fail_generic_import.carbon b/toolchain/check/testdata/let/fail_generic_import.carbon index 4fb47a0440981..570174feb61e7 100644 --- a/toolchain/check/testdata/let/fail_generic_import.carbon +++ b/toolchain/check/testdata/let/fail_generic_import.carbon @@ -82,7 +82,6 @@ let a: T = 0; // CHECK:STDOUT: %Implicit.import = import Implicit // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %T.ref: type = name_ref T, imports.%import_ref // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { diff --git a/toolchain/check/testdata/let/fail_missing_value.carbon b/toolchain/check/testdata/let/fail_missing_value.carbon index c66ed6d5179f4..37c0df7b31f74 100644 --- a/toolchain/check/testdata/let/fail_missing_value.carbon +++ b/toolchain/check/testdata/let/fail_missing_value.carbon @@ -45,16 +45,12 @@ fn F() { // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %n: %i32 = bind_name n, // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %n: %i32 = bind_name n, // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/let/fail_modifiers.carbon b/toolchain/check/testdata/let/fail_modifiers.carbon index 0d6c751f4d8bc..8e70e4d4cba08 100644 --- a/toolchain/check/testdata/let/fail_modifiers.carbon +++ b/toolchain/check/testdata/let/fail_modifiers.carbon @@ -120,22 +120,6 @@ protected protected let i: i32 = 1; // CHECK:STDOUT: .i = @__global_init.%i // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int_32.loc15: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc15: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc21: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc21: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc33: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc33: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc46: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc46: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc59: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc59: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc72: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc72: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc84: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc84: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { diff --git a/toolchain/check/testdata/let/fail_use_in_init.carbon b/toolchain/check/testdata/let/fail_use_in_init.carbon index 0d3624683580f..8ca2389e6c376 100644 --- a/toolchain/check/testdata/let/fail_use_in_init.carbon +++ b/toolchain/check/testdata/let/fail_use_in_init.carbon @@ -43,8 +43,6 @@ fn F() { // CHECK:STDOUT: // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.ref: = name_ref a, [template = ] // CHECK:STDOUT: %a: %i32 = bind_name a, // CHECK:STDOUT: return diff --git a/toolchain/check/testdata/let/generic.carbon b/toolchain/check/testdata/let/generic.carbon index 630faff440d1d..75a249c00c07e 100644 --- a/toolchain/check/testdata/let/generic.carbon +++ b/toolchain/check/testdata/let/generic.carbon @@ -47,11 +47,8 @@ fn F() { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0, %i32 [symbolic = constants.%T] -// CHECK:STDOUT: %T.ref.loc13: type = name_ref T, %T [symbolic = constants.%T] -// CHECK:STDOUT: %ptr: type = ptr_type %T [symbolic = constants.%ptr] // CHECK:STDOUT: %p.var: ref %ptr = var p // CHECK:STDOUT: %p: ref %ptr = bind_name p, %p.var -// CHECK:STDOUT: %T.ref.loc14: type = name_ref T, %T [symbolic = constants.%T] // CHECK:STDOUT: %a.var: ref %T = var a // CHECK:STDOUT: %a: ref %T = bind_name a, %a.var // CHECK:STDOUT: %p.ref: ref %ptr = name_ref p, %p diff --git a/toolchain/check/testdata/let/generic_import.carbon b/toolchain/check/testdata/let/generic_import.carbon index 158f872225808..5002c499c983d 100644 --- a/toolchain/check/testdata/let/generic_import.carbon +++ b/toolchain/check/testdata/let/generic_import.carbon @@ -83,11 +83,8 @@ var b: T = *a; // CHECK:STDOUT: %Implicit.import = import Implicit // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %T.ref.loc8: type = name_ref T, imports.%import_ref -// CHECK:STDOUT: %ptr: type = ptr_type [template = ] // CHECK:STDOUT: %a.var: ref = var a // CHECK:STDOUT: %a: ref = bind_name a, %a.var -// CHECK:STDOUT: %T.ref.loc12: type = name_ref T, imports.%import_ref // CHECK:STDOUT: %b.var: ref = var b // CHECK:STDOUT: %b: ref = bind_name b, %b.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/let/global.carbon b/toolchain/check/testdata/let/global.carbon index 8dc64d81de618..78760aa5307de 100644 --- a/toolchain/check/testdata/let/global.carbon +++ b/toolchain/check/testdata/let/global.carbon @@ -45,8 +45,6 @@ fn F() -> i32 { return n; } // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 diff --git a/toolchain/check/testdata/let/local.carbon b/toolchain/check/testdata/let/local.carbon index f223b422a9f9c..5f2c0dae3c094 100644 --- a/toolchain/check/testdata/let/local.carbon +++ b/toolchain/check/testdata/let/local.carbon @@ -42,11 +42,13 @@ fn F(a: i32) -> i32 { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc11_9: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc11_9: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc11_17: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc11_17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc11: type = splice_block %i32.loc11_9 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc11_9: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc11_9: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -55,8 +57,6 @@ fn F(a: i32) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: fn @F(%a.param_patt: %i32) -> %i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int_32.loc12: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc12: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.ref: %i32 = name_ref a, %a // CHECK:STDOUT: %b: %i32 = bind_name b, %a.ref // CHECK:STDOUT: %b.ref: %i32 = name_ref b, %b diff --git a/toolchain/check/testdata/let/no_prelude/import.carbon b/toolchain/check/testdata/let/no_prelude/import.carbon index 49df73b454f28..ff08684d494c1 100644 --- a/toolchain/check/testdata/let/no_prelude/import.carbon +++ b/toolchain/check/testdata/let/no_prelude/import.carbon @@ -43,8 +43,6 @@ let b: () = Other.a; // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .a = @__global_init.%a // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc4_9.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc4_9.2: type = converted %.loc4_9.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { @@ -73,8 +71,6 @@ let b: () = Other.a; // CHECK:STDOUT: } // CHECK:STDOUT: %Implicit.import = import Implicit // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %.loc4_9.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc4_9.2: type = converted %.loc4_9.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { @@ -95,8 +91,6 @@ let b: () = Other.a; // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .a = @__global_init.%a // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc4_9.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc4_9.2: type = converted %.loc4_9.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { @@ -128,8 +122,6 @@ let b: () = Other.a; // CHECK:STDOUT: .b = @__global_init.%b // CHECK:STDOUT: } // CHECK:STDOUT: %Other.import = import Other -// CHECK:STDOUT: %.loc4_9.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc4_9.2: type = converted %.loc4_9.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { diff --git a/toolchain/check/testdata/let/no_prelude/import_access.carbon b/toolchain/check/testdata/let/no_prelude/import_access.carbon index 4d995ba88353d..914dc07fffd2c 100644 --- a/toolchain/check/testdata/let/no_prelude/import_access.carbon +++ b/toolchain/check/testdata/let/no_prelude/import_access.carbon @@ -62,8 +62,6 @@ let v2: () = Test.v; // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .v [private] = @__global_init.%v // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc4_17.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc4_17.2: type = converted %.loc4_17.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { @@ -92,8 +90,6 @@ let v2: () = Test.v; // CHECK:STDOUT: } // CHECK:STDOUT: %Test.import = import Test // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %.loc4_10.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc4_10.2: type = converted %.loc4_10.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { @@ -114,8 +110,6 @@ let v2: () = Test.v; // CHECK:STDOUT: .v2 = @__global_init.%v2 // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %.loc10_10.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc10_10.2: type = converted %.loc10_10.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { @@ -143,8 +137,6 @@ let v2: () = Test.v; // CHECK:STDOUT: .v2 = @__global_init.%v2 // CHECK:STDOUT: } // CHECK:STDOUT: %Test.import = import Test -// CHECK:STDOUT: %.loc9_10.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc9_10.2: type = converted %.loc9_10.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { diff --git a/toolchain/check/testdata/let/shadowed_decl.carbon b/toolchain/check/testdata/let/shadowed_decl.carbon index 79352f85fef71..65a0791d83fb5 100644 --- a/toolchain/check/testdata/let/shadowed_decl.carbon +++ b/toolchain/check/testdata/let/shadowed_decl.carbon @@ -52,11 +52,13 @@ fn F(a: i32) -> i32 { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc11_9: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc11_9: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc11_17: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc11_17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc11: type = splice_block %i32.loc11_9 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc11_9: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc11_9: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %a.loc11: %i32 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -65,8 +67,6 @@ fn F(a: i32) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: fn @F(%a.param_patt: %i32) -> %i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int_32.loc12: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc12: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1, %impl.elem0 [template = constants.%Convert.bound] diff --git a/toolchain/check/testdata/namespace/add_to_import.carbon b/toolchain/check/testdata/namespace/add_to_import.carbon index de1aa87e438ca..21f3dc47ffdd7 100644 --- a/toolchain/check/testdata/namespace/add_to_import.carbon +++ b/toolchain/check/testdata/namespace/add_to_import.carbon @@ -88,8 +88,6 @@ var a: i32 = NS.A(); // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.var: ref %i32 = var a // CHECK:STDOUT: %a: ref %i32 = bind_name a, %a.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/namespace/fail_duplicate.carbon b/toolchain/check/testdata/namespace/fail_duplicate.carbon index ae4d1e2c5c267..bf646d65cd6a4 100644 --- a/toolchain/check/testdata/namespace/fail_duplicate.carbon +++ b/toolchain/check/testdata/namespace/fail_duplicate.carbon @@ -52,8 +52,5 @@ fn Foo.Baz() { // CHECK:STDOUT: fn @Baz() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return -// CHECK:STDOUT: -// CHECK:STDOUT: !.loc23: -// CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/namespace/fail_params.carbon b/toolchain/check/testdata/namespace/fail_params.carbon index f3e28d07db729..5f22c1cfa315a 100644 --- a/toolchain/check/testdata/namespace/fail_params.carbon +++ b/toolchain/check/testdata/namespace/fail_params.carbon @@ -72,15 +72,17 @@ fn D(T:! type).F() {} // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {} -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %n.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc24: type = splice_block %i32 [template = constants.%i32] { +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %n: %i32 = bind_name n, %n.param // CHECK:STDOUT: %B: = namespace [template] {} -// CHECK:STDOUT: %T.ref: type = name_ref T, %T [symbolic = constants.%T] // CHECK:STDOUT: %T.param: type = value_param runtime_param // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0, %T.param [symbolic = constants.%T] // CHECK:STDOUT: %x.param: %T = value_param runtime_param0 +// CHECK:STDOUT: %T.ref: type = name_ref T, %T [symbolic = constants.%T] // CHECK:STDOUT: %x: %T = bind_name x, %x.param // CHECK:STDOUT: %C: = namespace [template] {} // CHECK:STDOUT: %D: = namespace [template] {} diff --git a/toolchain/check/testdata/namespace/imported.carbon b/toolchain/check/testdata/namespace/imported.carbon index 47240ab4f1eaa..8449fac6ba804 100644 --- a/toolchain/check/testdata/namespace/imported.carbon +++ b/toolchain/check/testdata/namespace/imported.carbon @@ -105,20 +105,12 @@ var package_b: () = package.NS.ChildNS.B(); // CHECK:STDOUT: %Implicit.import = import Implicit // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %.loc4_9.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc4_9.2: type = converted %.loc4_9.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %a.var: ref %empty_tuple.type = var a // CHECK:STDOUT: %a: ref %empty_tuple.type = bind_name a, %a.var -// CHECK:STDOUT: %.loc5_9.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc5_9.2: type = converted %.loc5_9.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %b.var: ref %empty_tuple.type = var b // CHECK:STDOUT: %b: ref %empty_tuple.type = bind_name b, %b.var -// CHECK:STDOUT: %.loc7_17.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc7_17.2: type = converted %.loc7_17.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %package_a.var: ref %empty_tuple.type = var package_a // CHECK:STDOUT: %package_a: ref %empty_tuple.type = bind_name package_a, %package_a.var -// CHECK:STDOUT: %.loc8_17.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc8_17.2: type = converted %.loc8_17.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %package_b.var: ref %empty_tuple.type = var package_b // CHECK:STDOUT: %package_b: ref %empty_tuple.type = bind_name package_b, %package_b.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/namespace/imported_indirect.carbon b/toolchain/check/testdata/namespace/imported_indirect.carbon index c059c78479039..62c0309a6a616 100644 --- a/toolchain/check/testdata/namespace/imported_indirect.carbon +++ b/toolchain/check/testdata/namespace/imported_indirect.carbon @@ -253,8 +253,6 @@ fn G() { Same.F(); } // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %.loc5_9.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc5_9.2: type = converted %.loc5_9.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %e.var: ref %empty_tuple.type = var e // CHECK:STDOUT: %e: ref %empty_tuple.type = bind_name e, %e.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/namespace/merging_with_indirections.carbon b/toolchain/check/testdata/namespace/merging_with_indirections.carbon index 8ebf87f085328..22d0c698705b2 100644 --- a/toolchain/check/testdata/namespace/merging_with_indirections.carbon +++ b/toolchain/check/testdata/namespace/merging_with_indirections.carbon @@ -175,13 +175,6 @@ fn Run() { // CHECK:STDOUT: %import_ref.1: %F.type = import_ref Other//b, F, loaded [template = constants.%F] // CHECK:STDOUT: %import_ref.2: = import_ref Other//b, inst28 [indirect], loaded [template = constants.%complete_type] // CHECK:STDOUT: %import_ref.3 = import_ref Other//b, inst29 [indirect], unloaded -// CHECK:STDOUT: %import_ref.4: = import_ref Other//b, NS1, loaded -// CHECK:STDOUT: %NS1: = namespace %import_ref.4, [template] { -// CHECK:STDOUT: .A = %import_ref.5 -// CHECK:STDOUT: import Other//b -// CHECK:STDOUT: import Other//a -// CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.5: type = import_ref Other//a, A, loaded [template = constants.%A] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -208,9 +201,6 @@ fn Run() { // CHECK:STDOUT: %.loc7_11.1: ref %A = temporary_storage // CHECK:STDOUT: %F.call.loc7: init %A = call %F.ref.loc7() to %.loc7_11.1 // CHECK:STDOUT: %.loc7_11.2: ref %A = temporary %.loc7_11.1, %F.call.loc7 -// CHECK:STDOUT: %Other.ref.loc10: = name_ref Other, imports.%Other [template = imports.%Other] -// CHECK:STDOUT: %NS1.ref: = name_ref NS1, imports.%NS1 [template = imports.%NS1] -// CHECK:STDOUT: %A.ref: type = name_ref A, imports.%import_ref.5 [template = constants.%A] // CHECK:STDOUT: %a.var: ref %A = var a // CHECK:STDOUT: %a: ref %A = bind_name a, %a.var // CHECK:STDOUT: %a.ref: ref %A = name_ref a, %a diff --git a/toolchain/check/testdata/namespace/shadow.carbon b/toolchain/check/testdata/namespace/shadow.carbon index cfdbc63cb028e..8af56b402af69 100644 --- a/toolchain/check/testdata/namespace/shadow.carbon +++ b/toolchain/check/testdata/namespace/shadow.carbon @@ -79,8 +79,8 @@ fn N.M.B() -> i32 { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc18: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc18: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } @@ -98,8 +98,6 @@ fn N.M.B() -> i32 { // CHECK:STDOUT: if %true br !if.then else br !if.else // CHECK:STDOUT: // CHECK:STDOUT: !if.then: -// CHECK:STDOUT: %int_32.loc22: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %A.var: ref %i32 = var A // CHECK:STDOUT: %A: ref %i32 = bind_name A, %A.var // CHECK:STDOUT: %int_0.loc22: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] diff --git a/toolchain/check/testdata/operators/builtin/and.carbon b/toolchain/check/testdata/operators/builtin/and.carbon index bb106a5dc6386..7ac74c04caa5a 100644 --- a/toolchain/check/testdata/operators/builtin/and.carbon +++ b/toolchain/check/testdata/operators/builtin/and.carbon @@ -100,10 +100,12 @@ fn PartialConstant(x: bool) { // CHECK:STDOUT: %x.patt: bool = binding_pattern x // CHECK:STDOUT: %x.param_patt: bool = value_param_pattern %x.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %bool.make_type.loc25: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc25_23.1: type = value_of_initializer %bool.make_type.loc25 [template = bool] -// CHECK:STDOUT: %.loc25_23.2: type = converted %bool.make_type.loc25, %.loc25_23.1 [template = bool] // CHECK:STDOUT: %x.param: bool = value_param runtime_param0 +// CHECK:STDOUT: %.loc25_23.3: type = splice_block %.loc25_23.2 [template = bool] { +// CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] +// CHECK:STDOUT: %.loc25_23.1: type = value_of_initializer %bool.make_type [template = bool] +// CHECK:STDOUT: %.loc25_23.2: type = converted %bool.make_type, %.loc25_23.1 [template = bool] +// CHECK:STDOUT: } // CHECK:STDOUT: %x: bool = bind_name x, %x.param // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -143,122 +145,22 @@ fn PartialConstant(x: bool) { // CHECK:STDOUT: // CHECK:STDOUT: fn @Constant() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %true.loc19_13: bool = bool_literal true [template = constants.%true] -// CHECK:STDOUT: %false.loc19: bool = bool_literal false [template = constants.%false] -// CHECK:STDOUT: if %true.loc19_13 br !and.rhs.loc19 else br !and.result.loc19(%false.loc19) -// CHECK:STDOUT: -// CHECK:STDOUT: !and.rhs.loc19: -// CHECK:STDOUT: %true.loc19_22: bool = bool_literal true [template = constants.%true] -// CHECK:STDOUT: br !and.result.loc19(%true.loc19_22) -// CHECK:STDOUT: -// CHECK:STDOUT: !and.result.loc19: -// CHECK:STDOUT: %.loc19_18: bool = block_arg !and.result.loc19 [template = constants.%true] -// CHECK:STDOUT: if %.loc19_18 br !if.expr.then.loc19 else br !if.expr.else.loc19 -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.then.loc19: -// CHECK:STDOUT: %bool.make_type.loc19: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc19_32.1: type = value_of_initializer %bool.make_type.loc19 [template = bool] -// CHECK:STDOUT: %.loc19_32.2: type = converted %bool.make_type.loc19, %.loc19_32.1 [template = bool] -// CHECK:STDOUT: br !if.expr.result.loc19(%.loc19_32.2) -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.else.loc19: -// CHECK:STDOUT: %.loc19_43: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc19_37: type = converted %.loc19_43, constants.%empty_tuple.type [template = constants.%empty_tuple.type] -// CHECK:STDOUT: br !if.expr.result.loc19(%.loc19_37) -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.result.loc19: -// CHECK:STDOUT: %.loc19_10: type = block_arg !if.expr.result.loc19 [template = bool] // CHECK:STDOUT: %a.var: ref bool = var a // CHECK:STDOUT: %a: ref bool = bind_name a, %a.var -// CHECK:STDOUT: %true.loc19_47: bool = bool_literal true [template = constants.%true] -// CHECK:STDOUT: assign %a.var, %true.loc19_47 -// CHECK:STDOUT: %true.loc20: bool = bool_literal true [template = constants.%true] -// CHECK:STDOUT: %false.loc20_18: bool = bool_literal false [template = constants.%false] -// CHECK:STDOUT: if %true.loc20 br !and.rhs.loc20 else br !and.result.loc20(%false.loc20_18) -// CHECK:STDOUT: -// CHECK:STDOUT: !and.rhs.loc20: -// CHECK:STDOUT: %false.loc20_22: bool = bool_literal false [template = constants.%false] -// CHECK:STDOUT: br !and.result.loc20(%false.loc20_22) -// CHECK:STDOUT: -// CHECK:STDOUT: !and.result.loc20: -// CHECK:STDOUT: %.loc20_18: bool = block_arg !and.result.loc20 [template = constants.%false] -// CHECK:STDOUT: if %.loc20_18 br !if.expr.then.loc20 else br !if.expr.else.loc20 -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.then.loc20: -// CHECK:STDOUT: %bool.make_type.loc20: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc20_33.1: type = value_of_initializer %bool.make_type.loc20 [template = bool] -// CHECK:STDOUT: %.loc20_33.2: type = converted %bool.make_type.loc20, %.loc20_33.1 [template = bool] -// CHECK:STDOUT: br !if.expr.result.loc20(%.loc20_33.2) -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.else.loc20: -// CHECK:STDOUT: %.loc20_44: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc20_38: type = converted %.loc20_44, constants.%empty_tuple.type [template = constants.%empty_tuple.type] -// CHECK:STDOUT: br !if.expr.result.loc20(%.loc20_38) -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.result.loc20: -// CHECK:STDOUT: %.loc20_10: type = block_arg !if.expr.result.loc20 [template = constants.%empty_tuple.type] +// CHECK:STDOUT: %true: bool = bool_literal true [template = constants.%true] +// CHECK:STDOUT: assign %a.var, %true // CHECK:STDOUT: %b.var: ref %empty_tuple.type = var b // CHECK:STDOUT: %b: ref %empty_tuple.type = bind_name b, %b.var // CHECK:STDOUT: %.loc20_49.1: %empty_tuple.type = tuple_literal () // CHECK:STDOUT: %.loc20_49.2: init %empty_tuple.type = tuple_init () to %b.var [template = constants.%empty_tuple] // CHECK:STDOUT: %.loc20_50: init %empty_tuple.type = converted %.loc20_49.1, %.loc20_49.2 [template = constants.%empty_tuple] // CHECK:STDOUT: assign %b.var, %.loc20_50 -// CHECK:STDOUT: %false.loc21_13: bool = bool_literal false [template = constants.%false] -// CHECK:STDOUT: %false.loc21_19: bool = bool_literal false [template = constants.%false] -// CHECK:STDOUT: if %false.loc21_13 br !and.rhs.loc21 else br !and.result.loc21(%false.loc21_19) -// CHECK:STDOUT: -// CHECK:STDOUT: !and.rhs.loc21: -// CHECK:STDOUT: %true.loc21: bool = bool_literal true [template = constants.%true] -// CHECK:STDOUT: br !and.result.loc21(%true.loc21) -// CHECK:STDOUT: -// CHECK:STDOUT: !and.result.loc21: -// CHECK:STDOUT: %.loc21_19: bool = block_arg !and.result.loc21 [template = constants.%false] -// CHECK:STDOUT: if %.loc21_19 br !if.expr.then.loc21 else br !if.expr.else.loc21 -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.then.loc21: -// CHECK:STDOUT: %bool.make_type.loc21: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc21_33.1: type = value_of_initializer %bool.make_type.loc21 [template = bool] -// CHECK:STDOUT: %.loc21_33.2: type = converted %bool.make_type.loc21, %.loc21_33.1 [template = bool] -// CHECK:STDOUT: br !if.expr.result.loc21(%.loc21_33.2) -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.else.loc21: -// CHECK:STDOUT: %.loc21_44: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc21_38: type = converted %.loc21_44, constants.%empty_tuple.type [template = constants.%empty_tuple.type] -// CHECK:STDOUT: br !if.expr.result.loc21(%.loc21_38) -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.result.loc21: -// CHECK:STDOUT: %.loc21_10: type = block_arg !if.expr.result.loc21 [template = constants.%empty_tuple.type] // CHECK:STDOUT: %c.var: ref %empty_tuple.type = var c // CHECK:STDOUT: %c: ref %empty_tuple.type = bind_name c, %c.var // CHECK:STDOUT: %.loc21_49.1: %empty_tuple.type = tuple_literal () // CHECK:STDOUT: %.loc21_49.2: init %empty_tuple.type = tuple_init () to %c.var [template = constants.%empty_tuple] // CHECK:STDOUT: %.loc21_50: init %empty_tuple.type = converted %.loc21_49.1, %.loc21_49.2 [template = constants.%empty_tuple] // CHECK:STDOUT: assign %c.var, %.loc21_50 -// CHECK:STDOUT: %false.loc22_13: bool = bool_literal false [template = constants.%false] -// CHECK:STDOUT: %false.loc22_19: bool = bool_literal false [template = constants.%false] -// CHECK:STDOUT: if %false.loc22_13 br !and.rhs.loc22 else br !and.result.loc22(%false.loc22_19) -// CHECK:STDOUT: -// CHECK:STDOUT: !and.rhs.loc22: -// CHECK:STDOUT: %false.loc22_23: bool = bool_literal false [template = constants.%false] -// CHECK:STDOUT: br !and.result.loc22(%false.loc22_23) -// CHECK:STDOUT: -// CHECK:STDOUT: !and.result.loc22: -// CHECK:STDOUT: %.loc22_19: bool = block_arg !and.result.loc22 [template = constants.%false] -// CHECK:STDOUT: if %.loc22_19 br !if.expr.then.loc22 else br !if.expr.else.loc22 -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.then.loc22: -// CHECK:STDOUT: %bool.make_type.loc22: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc22_34.1: type = value_of_initializer %bool.make_type.loc22 [template = bool] -// CHECK:STDOUT: %.loc22_34.2: type = converted %bool.make_type.loc22, %.loc22_34.1 [template = bool] -// CHECK:STDOUT: br !if.expr.result.loc22(%.loc22_34.2) -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.else.loc22: -// CHECK:STDOUT: %.loc22_45: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc22_39: type = converted %.loc22_45, constants.%empty_tuple.type [template = constants.%empty_tuple.type] -// CHECK:STDOUT: br !if.expr.result.loc22(%.loc22_39) -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.result.loc22: -// CHECK:STDOUT: %.loc22_10: type = block_arg !if.expr.result.loc22 [template = constants.%empty_tuple.type] // CHECK:STDOUT: %d.var: ref %empty_tuple.type = var d // CHECK:STDOUT: %d: ref %empty_tuple.type = bind_name d, %d.var // CHECK:STDOUT: %.loc22_50.1: %empty_tuple.type = tuple_literal () @@ -270,31 +172,6 @@ fn PartialConstant(x: bool) { // CHECK:STDOUT: // CHECK:STDOUT: fn @PartialConstant(%x.param_patt: bool) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %false.loc26_13: bool = bool_literal false [template = constants.%false] -// CHECK:STDOUT: %false.loc26_19: bool = bool_literal false [template = constants.%false] -// CHECK:STDOUT: if %false.loc26_13 br !and.rhs else br !and.result(%false.loc26_19) -// CHECK:STDOUT: -// CHECK:STDOUT: !and.rhs: -// CHECK:STDOUT: %x.ref: bool = name_ref x, %x -// CHECK:STDOUT: br !and.result(%x.ref) -// CHECK:STDOUT: -// CHECK:STDOUT: !and.result: -// CHECK:STDOUT: %.loc26_19: bool = block_arg !and.result [template = constants.%false] -// CHECK:STDOUT: if %.loc26_19 br !if.expr.then else br !if.expr.else -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.then: -// CHECK:STDOUT: %bool.make_type.loc26: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc26_30.1: type = value_of_initializer %bool.make_type.loc26 [template = bool] -// CHECK:STDOUT: %.loc26_30.2: type = converted %bool.make_type.loc26, %.loc26_30.1 [template = bool] -// CHECK:STDOUT: br !if.expr.result(%.loc26_30.2) -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.else: -// CHECK:STDOUT: %.loc26_41: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc26_35: type = converted %.loc26_41, constants.%empty_tuple.type [template = constants.%empty_tuple.type] -// CHECK:STDOUT: br !if.expr.result(%.loc26_35) -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.result: -// CHECK:STDOUT: %.loc26_10: type = block_arg !if.expr.result [template = constants.%empty_tuple.type] // CHECK:STDOUT: %a.var: ref %empty_tuple.type = var a // CHECK:STDOUT: %a: ref %empty_tuple.type = bind_name a, %a.var // CHECK:STDOUT: %.loc26_46.1: %empty_tuple.type = tuple_literal () diff --git a/toolchain/check/testdata/operators/builtin/assignment.carbon b/toolchain/check/testdata/operators/builtin/assignment.carbon index f2c05f5327193..fb8fb537d3837 100644 --- a/toolchain/check/testdata/operators/builtin/assignment.carbon +++ b/toolchain/check/testdata/operators/builtin/assignment.carbon @@ -45,7 +45,6 @@ fn Main() { // CHECK:STDOUT: %Convert.bound.2: = bound_method %int_9.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_9.2: %i32 = int_value 9 [template] -// CHECK:STDOUT: %tuple.type.1: type = tuple_type (type, type) [template] // CHECK:STDOUT: %tuple.type.2: type = tuple_type (%i32, %i32) [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] @@ -101,8 +100,6 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: fn @Main() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int_32.loc12: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc12: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.var: ref %i32 = var a // CHECK:STDOUT: %a: ref %i32 = bind_name a, %a.var // CHECK:STDOUT: %int_12: Core.IntLiteral = int_value 12 [template = constants.%int_12.1] @@ -120,12 +117,6 @@ fn Main() { // CHECK:STDOUT: %int.convert_checked.loc13: init %i32 = call %Convert.specific_fn.loc13(%int_9) [template = constants.%int_9.2] // CHECK:STDOUT: %.loc13: init %i32 = converted %int_9, %int.convert_checked.loc13 [template = constants.%int_9.2] // CHECK:STDOUT: assign %a.ref.loc13, %.loc13 -// CHECK:STDOUT: %int_32.loc15_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc15_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc15_16: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc15_16: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc15_19.1: %tuple.type.1 = tuple_literal (%i32.loc15_11, %i32.loc15_16) -// CHECK:STDOUT: %.loc15_19.2: type = converted %.loc15_19.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %b.var: ref %tuple.type.2 = var b // CHECK:STDOUT: %b: ref %tuple.type.2 = bind_name b, %b.var // CHECK:STDOUT: %int_1.loc15: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] @@ -168,11 +159,6 @@ fn Main() { // CHECK:STDOUT: %int.convert_checked.loc17: init %i32 = call %Convert.specific_fn.loc17(%int_4.loc17) [template = constants.%int_4.2] // CHECK:STDOUT: %.loc17: init %i32 = converted %int_4.loc17, %int.convert_checked.loc17 [template = constants.%int_4.2] // CHECK:STDOUT: assign %tuple.elem1.loc17, %.loc17 -// CHECK:STDOUT: %int_32.loc19_15: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc19_15: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc19_24: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc19_24: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %struct_type.a.b: type = struct_type {.a: %i32, .b: %i32} [template = constants.%struct_type.a.b.1] // CHECK:STDOUT: %c.var: ref %struct_type.a.b.1 = var c // CHECK:STDOUT: %c: ref %struct_type.a.b.1 = bind_name c, %c.var // CHECK:STDOUT: %int_1.loc19: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] @@ -213,9 +199,6 @@ fn Main() { // CHECK:STDOUT: %int.convert_checked.loc21: init %i32 = call %Convert.specific_fn.loc21(%int_4.loc21) [template = constants.%int_4.2] // CHECK:STDOUT: %.loc21_7: init %i32 = converted %int_4.loc21, %int.convert_checked.loc21 [template = constants.%int_4.2] // CHECK:STDOUT: assign %.loc21_4, %.loc21_7 -// CHECK:STDOUT: %int_32.loc23: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc23: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %ptr: type = ptr_type %i32 [template = constants.%ptr.3] // CHECK:STDOUT: %p.var: ref %ptr.3 = var p // CHECK:STDOUT: %p: ref %ptr.3 = bind_name p, %p.var // CHECK:STDOUT: %a.ref.loc23: ref %i32 = name_ref a, %a diff --git a/toolchain/check/testdata/operators/builtin/fail_and_or_not_in_function.carbon b/toolchain/check/testdata/operators/builtin/fail_and_or_not_in_function.carbon index f04d66dcdb0d6..2dca60c5f1aba 100644 --- a/toolchain/check/testdata/operators/builtin/fail_and_or_not_in_function.carbon +++ b/toolchain/check/testdata/operators/builtin/fail_and_or_not_in_function.carbon @@ -14,59 +14,118 @@ fn F(b: bool) -> type { } // TODO: Short-circuit operators should be permitted outside functions. -// CHECK:STDERR: fail_and_or_not_in_function.carbon:[[@LINE+12]]:11: error: cannot evaluate type expression [TypeExprEvaluationFailure] +// CHECK:STDERR: fail_and_or_not_in_function.carbon:[[@LINE+8]]:11: error: cannot evaluate type expression [TypeExprEvaluationFailure] // CHECK:STDERR: var and_: F(true and true); // CHECK:STDERR: ^~~~~~~~~~~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_and_or_not_in_function.carbon:[[@LINE+8]]:13: error: semantics TODO: `Control flow expressions are currently only supported inside functions.` [SemanticsTodo] -// CHECK:STDERR: var and_: F(true and true); -// CHECK:STDERR: ^~~~~~~~ -// CHECK:STDERR: // CHECK:STDERR: fail_and_or_not_in_function.carbon:[[@LINE+4]]:13: error: semantics TODO: `Control flow expressions are currently only supported inside functions.` [SemanticsTodo] // CHECK:STDERR: var and_: F(true and true); // CHECK:STDERR: ^~~~~~~~~~~~~ // CHECK:STDERR: var and_: F(true and true); -// CHECK:STDERR: fail_and_or_not_in_function.carbon:[[@LINE+11]]:10: error: cannot evaluate type expression [TypeExprEvaluationFailure] -// CHECK:STDERR: var or_: F(true or true); -// CHECK:STDERR: ^~~~~~~~~~~~~~~ +// CHECK:STDERR: fail_and_or_not_in_function.carbon:[[@LINE+12]]:21: error: semantics TODO: `Control flow expressions are currently only supported inside functions.` [SemanticsTodo] +// CHECK:STDERR: var and_val: bool = true and true; +// CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_and_or_not_in_function.carbon:[[@LINE+7]]:12: error: semantics TODO: `Control flow expressions are currently only supported inside functions.` [SemanticsTodo] +// CHECK:STDERR: fail_and_or_not_in_function.carbon:[[@LINE+8]]:21: error: semantics TODO: `Control flow expressions are currently only supported inside functions.` [SemanticsTodo] +// CHECK:STDERR: var and_val: bool = true and true; +// CHECK:STDERR: ^~~~~~~~~~~~~ +// CHECK:STDERR: +// CHECK:STDERR: fail_and_or_not_in_function.carbon:[[@LINE+4]]:21: error: semantics TODO: `Control flow expressions are currently only supported inside functions.` [SemanticsTodo] +// CHECK:STDERR: var and_val: bool = true and true; +// CHECK:STDERR: ^~~~~~~~~~~~~ +// CHECK:STDERR: +var and_val: bool = true and true; + +// CHECK:STDERR: fail_and_or_not_in_function.carbon:[[@LINE+8]]:10: error: cannot evaluate type expression [TypeExprEvaluationFailure] // CHECK:STDERR: var or_: F(true or true); -// CHECK:STDERR: ^~~~~~~ +// CHECK:STDERR: ^~~~~~~~~~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_and_or_not_in_function.carbon:[[@LINE+3]]:12: error: semantics TODO: `Control flow expressions are currently only supported inside functions.` [SemanticsTodo] +// CHECK:STDERR: fail_and_or_not_in_function.carbon:[[@LINE+4]]:12: error: semantics TODO: `Control flow expressions are currently only supported inside functions.` [SemanticsTodo] // CHECK:STDERR: var or_: F(true or true); // CHECK:STDERR: ^~~~~~~~~~~~ +// CHECK:STDERR: var or_: F(true or true); +// CHECK:STDERR: fail_and_or_not_in_function.carbon:[[@LINE+11]]:20: error: semantics TODO: `Control flow expressions are currently only supported inside functions.` [SemanticsTodo] +// CHECK:STDERR: var or_val: bool = true or true; +// CHECK:STDERR: ^~~~~~~ +// CHECK:STDERR: +// CHECK:STDERR: fail_and_or_not_in_function.carbon:[[@LINE+7]]:20: error: semantics TODO: `Control flow expressions are currently only supported inside functions.` [SemanticsTodo] +// CHECK:STDERR: var or_val: bool = true or true; +// CHECK:STDERR: ^~~~~~~~~~~~ +// CHECK:STDERR: +// CHECK:STDERR: fail_and_or_not_in_function.carbon:[[@LINE+3]]:20: error: semantics TODO: `Control flow expressions are currently only supported inside functions.` [SemanticsTodo] +// CHECK:STDERR: var or_val: bool = true or true; +// CHECK:STDERR: ^~~~~~~~~~~~ +var or_val: bool = true or true; + // CHECK:STDOUT: --- fail_and_or_not_in_function.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { +// CHECK:STDOUT: %Bool.type: type = fn_type @Bool [template] +// CHECK:STDOUT: %Bool: %Bool.type = struct_value () [template] +// CHECK:STDOUT: %F.type: type = fn_type @F [template] +// CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [template] // CHECK:STDOUT: %Float.type: type = fn_type @Float [template] // CHECK:STDOUT: %Float: %Float.type = struct_value () [template] // CHECK:STDOUT: %true: bool = bool_literal true [template] +// CHECK:STDOUT: %false: bool = bool_literal false [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Bool = %import_ref.1 +// CHECK:STDOUT: .Int = %import_ref.2 +// CHECK:STDOUT: .Float = %import_ref.6 +// CHECK:STDOUT: import Core//prelude +// CHECK:STDOUT: import Core//prelude/... +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { -// CHECK:STDOUT: %.loc42_17: bool = block_arg [template = constants.%true] -// CHECK:STDOUT: %F.call: init type = call .inst96.loc42_10(%.loc42_17) -// CHECK:STDOUT: %.loc42_24.1: type = value_of_initializer %F.call -// CHECK:STDOUT: %.loc42_24.2: type = converted %F.call, %.loc42_24.1 +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .F = %F.decl +// CHECK:STDOUT: .and_ = %and_ +// CHECK:STDOUT: .and_val = %and_val +// CHECK:STDOUT: .or_ = %or_ +// CHECK:STDOUT: .or_val = %or_val +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { +// CHECK:STDOUT: %b.patt: bool = binding_pattern b +// CHECK:STDOUT: %b.param_patt: bool = value_param_pattern %b.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: type = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: type = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %b.param: bool = value_param runtime_param0 +// CHECK:STDOUT: %.loc12_9.3: type = splice_block %.loc12_9.2 [template = bool] { +// CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] +// CHECK:STDOUT: %.loc12_9.1: type = value_of_initializer %bool.make_type [template = bool] +// CHECK:STDOUT: %.loc12_9.2: type = converted %bool.make_type, %.loc12_9.1 [template = bool] +// CHECK:STDOUT: } +// CHECK:STDOUT: %b: bool = bind_name b, %b.param +// CHECK:STDOUT: %return.param: ref type = out_param runtime_param1 +// CHECK:STDOUT: %return: ref type = return_slot %return.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %and_.var: ref = var and_ +// CHECK:STDOUT: %and_: ref = bind_name and_, %and_.var +// CHECK:STDOUT: %and_val.var: ref bool = var and_val +// CHECK:STDOUT: %and_val: ref bool = bind_name and_val, %and_val.var // CHECK:STDOUT: %or_.var: ref = var or_ // CHECK:STDOUT: %or_: ref = bind_name or_, %or_.var +// CHECK:STDOUT: %or_val.var: ref bool = var or_val +// CHECK:STDOUT: %or_val: ref bool = bind_name or_val, %or_val.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F(%b.param_patt: bool) -> type { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %b.ref: bool = name_ref b, .inst25.loc12_6 +// CHECK:STDOUT: %b.ref: bool = name_ref b, %b // CHECK:STDOUT: if %b.ref br !if.expr.then else br !if.expr.else // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then: @@ -86,3 +145,10 @@ var or_: F(true or true); // CHECK:STDOUT: return %.loc13_10 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @__global_init() { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %true: bool = bool_literal true [template = constants.%true] +// CHECK:STDOUT: %false: bool = bool_literal false [template = constants.%false] +// CHECK:STDOUT: if %true br !and.rhs else br !and.result(%false) +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/operators/builtin/fail_and_or_partial_constant.carbon b/toolchain/check/testdata/operators/builtin/fail_and_or_partial_constant.carbon index 43de5e48f3d32..5eee9a9a1f017 100644 --- a/toolchain/check/testdata/operators/builtin/fail_and_or_partial_constant.carbon +++ b/toolchain/check/testdata/operators/builtin/fail_and_or_partial_constant.carbon @@ -47,12 +47,9 @@ fn KnownValueButNonConstantCondition(x: bool) { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %Bool.type: type = fn_type @Bool [template] -// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template] // CHECK:STDOUT: %Bool: %Bool.type = struct_value () [template] // CHECK:STDOUT: %PartialConstant.type: type = fn_type @PartialConstant [template] // CHECK:STDOUT: %PartialConstant: %PartialConstant.type = struct_value () [template] -// CHECK:STDOUT: %true: bool = bool_literal true [template] -// CHECK:STDOUT: %false: bool = bool_literal false [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -73,69 +70,20 @@ fn KnownValueButNonConstantCondition(x: bool) { // CHECK:STDOUT: %x.patt: bool = binding_pattern x // CHECK:STDOUT: %x.param_patt: bool = value_param_pattern %x.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %bool.make_type.loc4: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc4_23.1: type = value_of_initializer %bool.make_type.loc4 [template = bool] -// CHECK:STDOUT: %.loc4_23.2: type = converted %bool.make_type.loc4, %.loc4_23.1 [template = bool] // CHECK:STDOUT: %x.param: bool = value_param runtime_param0 +// CHECK:STDOUT: %.loc4_23.3: type = splice_block %.loc4_23.2 [template = bool] { +// CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] +// CHECK:STDOUT: %.loc4_23.1: type = value_of_initializer %bool.make_type [template = bool] +// CHECK:STDOUT: %.loc4_23.2: type = converted %bool.make_type, %.loc4_23.1 [template = bool] +// CHECK:STDOUT: } // CHECK:STDOUT: %x: bool = bind_name x, %x.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @PartialConstant(%x.param_patt: bool) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %true.loc9: bool = bool_literal true [template = constants.%true] -// CHECK:STDOUT: %false.loc9: bool = bool_literal false [template = constants.%false] -// CHECK:STDOUT: if %true.loc9 br !and.rhs else br !and.result(%false.loc9) -// CHECK:STDOUT: -// CHECK:STDOUT: !and.rhs: -// CHECK:STDOUT: %x.ref.loc9: bool = name_ref x, %x -// CHECK:STDOUT: br !and.result(%x.ref.loc9) -// CHECK:STDOUT: -// CHECK:STDOUT: !and.result: -// CHECK:STDOUT: %.loc9_18: bool = block_arg !and.result -// CHECK:STDOUT: if %.loc9_18 br !if.expr.then.loc9 else br !if.expr.else.loc9 -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.then.loc9: -// CHECK:STDOUT: %bool.make_type.loc9: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc9_29.1: type = value_of_initializer %bool.make_type.loc9 [template = bool] -// CHECK:STDOUT: %.loc9_29.2: type = converted %bool.make_type.loc9, %.loc9_29.1 [template = bool] -// CHECK:STDOUT: br !if.expr.result.loc9(%.loc9_29.2) -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.else.loc9: -// CHECK:STDOUT: %.loc9_40: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc9_34: type = converted %.loc9_40, constants.%empty_tuple.type [template = constants.%empty_tuple.type] -// CHECK:STDOUT: br !if.expr.result.loc9(%.loc9_34) -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.result.loc9: -// CHECK:STDOUT: %.loc9_10: type = block_arg !if.expr.result.loc9 // CHECK:STDOUT: %a.var: ref = var a // CHECK:STDOUT: %a: ref = bind_name a, %a.var -// CHECK:STDOUT: %false.loc14: bool = bool_literal false [template = constants.%false] -// CHECK:STDOUT: %.loc14_19.1: bool = not %false.loc14 [template = constants.%true] -// CHECK:STDOUT: %true.loc14: bool = bool_literal true [template = constants.%true] -// CHECK:STDOUT: if %.loc14_19.1 br !or.rhs else br !or.result(%true.loc14) -// CHECK:STDOUT: -// CHECK:STDOUT: !or.rhs: -// CHECK:STDOUT: %x.ref.loc14: bool = name_ref x, %x -// CHECK:STDOUT: br !or.result(%x.ref.loc14) -// CHECK:STDOUT: -// CHECK:STDOUT: !or.result: -// CHECK:STDOUT: %.loc14_19.2: bool = block_arg !or.result -// CHECK:STDOUT: if %.loc14_19.2 br !if.expr.then.loc14 else br !if.expr.else.loc14 -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.then.loc14: -// CHECK:STDOUT: %bool.make_type.loc14: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc14_29.1: type = value_of_initializer %bool.make_type.loc14 [template = bool] -// CHECK:STDOUT: %.loc14_29.2: type = converted %bool.make_type.loc14, %.loc14_29.1 [template = bool] -// CHECK:STDOUT: br !if.expr.result.loc14(%.loc14_29.2) -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.else.loc14: -// CHECK:STDOUT: %.loc14_40: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc14_34: type = converted %.loc14_40, constants.%empty_tuple.type [template = constants.%empty_tuple.type] -// CHECK:STDOUT: br !if.expr.result.loc14(%.loc14_34) -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.result.loc14: -// CHECK:STDOUT: %.loc14_10: type = block_arg !if.expr.result.loc14 // CHECK:STDOUT: %b.var: ref = var b // CHECK:STDOUT: %b: ref = bind_name b, %b.var // CHECK:STDOUT: return @@ -145,12 +93,9 @@ fn KnownValueButNonConstantCondition(x: bool) { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %Bool.type: type = fn_type @Bool [template] -// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template] // CHECK:STDOUT: %Bool: %Bool.type = struct_value () [template] // CHECK:STDOUT: %KnownValueButNonConstantCondition.type: type = fn_type @KnownValueButNonConstantCondition [template] // CHECK:STDOUT: %KnownValueButNonConstantCondition: %KnownValueButNonConstantCondition.type = struct_value () [template] -// CHECK:STDOUT: %false: bool = bool_literal false [template] -// CHECK:STDOUT: %true: bool = bool_literal true [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -171,69 +116,20 @@ fn KnownValueButNonConstantCondition(x: bool) { // CHECK:STDOUT: %x.patt: bool = binding_pattern x // CHECK:STDOUT: %x.param_patt: bool = value_param_pattern %x.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %bool.make_type.loc4: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc4_41.1: type = value_of_initializer %bool.make_type.loc4 [template = bool] -// CHECK:STDOUT: %.loc4_41.2: type = converted %bool.make_type.loc4, %.loc4_41.1 [template = bool] // CHECK:STDOUT: %x.param: bool = value_param runtime_param0 +// CHECK:STDOUT: %.loc4_41.3: type = splice_block %.loc4_41.2 [template = bool] { +// CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] +// CHECK:STDOUT: %.loc4_41.1: type = value_of_initializer %bool.make_type [template = bool] +// CHECK:STDOUT: %.loc4_41.2: type = converted %bool.make_type, %.loc4_41.1 [template = bool] +// CHECK:STDOUT: } // CHECK:STDOUT: %x: bool = bind_name x, %x.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @KnownValueButNonConstantCondition(%x.param_patt: bool) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %x.ref.loc11: bool = name_ref x, %x -// CHECK:STDOUT: %false.loc11_15: bool = bool_literal false [template = constants.%false] -// CHECK:STDOUT: if %x.ref.loc11 br !and.rhs else br !and.result(%false.loc11_15) -// CHECK:STDOUT: -// CHECK:STDOUT: !and.rhs: -// CHECK:STDOUT: %false.loc11_19: bool = bool_literal false [template = constants.%false] -// CHECK:STDOUT: br !and.result(%false.loc11_19) -// CHECK:STDOUT: -// CHECK:STDOUT: !and.result: -// CHECK:STDOUT: %.loc11_15: bool = block_arg !and.result -// CHECK:STDOUT: if %.loc11_15 br !if.expr.then.loc11 else br !if.expr.else.loc11 -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.then.loc11: -// CHECK:STDOUT: %bool.make_type.loc11: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc11_30.1: type = value_of_initializer %bool.make_type.loc11 [template = bool] -// CHECK:STDOUT: %.loc11_30.2: type = converted %bool.make_type.loc11, %.loc11_30.1 [template = bool] -// CHECK:STDOUT: br !if.expr.result.loc11(%.loc11_30.2) -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.else.loc11: -// CHECK:STDOUT: %.loc11_41: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc11_35: type = converted %.loc11_41, constants.%empty_tuple.type [template = constants.%empty_tuple.type] -// CHECK:STDOUT: br !if.expr.result.loc11(%.loc11_35) -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.result.loc11: -// CHECK:STDOUT: %.loc11_10: type = block_arg !if.expr.result.loc11 // CHECK:STDOUT: %c.var: ref = var c // CHECK:STDOUT: %c: ref = bind_name c, %c.var -// CHECK:STDOUT: %x.ref.loc15: bool = name_ref x, %x -// CHECK:STDOUT: %.loc15_15.1: bool = not %x.ref.loc15 -// CHECK:STDOUT: %true.loc15_15: bool = bool_literal true [template = constants.%true] -// CHECK:STDOUT: if %.loc15_15.1 br !or.rhs else br !or.result(%true.loc15_15) -// CHECK:STDOUT: -// CHECK:STDOUT: !or.rhs: -// CHECK:STDOUT: %true.loc15_18: bool = bool_literal true [template = constants.%true] -// CHECK:STDOUT: br !or.result(%true.loc15_18) -// CHECK:STDOUT: -// CHECK:STDOUT: !or.result: -// CHECK:STDOUT: %.loc15_15.2: bool = block_arg !or.result -// CHECK:STDOUT: if %.loc15_15.2 br !if.expr.then.loc15 else br !if.expr.else.loc15 -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.then.loc15: -// CHECK:STDOUT: %bool.make_type.loc15: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc15_28.1: type = value_of_initializer %bool.make_type.loc15 [template = bool] -// CHECK:STDOUT: %.loc15_28.2: type = converted %bool.make_type.loc15, %.loc15_28.1 [template = bool] -// CHECK:STDOUT: br !if.expr.result.loc15(%.loc15_28.2) -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.else.loc15: -// CHECK:STDOUT: %.loc15_39: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc15_33: type = converted %.loc15_39, constants.%empty_tuple.type [template = constants.%empty_tuple.type] -// CHECK:STDOUT: br !if.expr.result.loc15(%.loc15_33) -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.result.loc15: -// CHECK:STDOUT: %.loc15_10: type = block_arg !if.expr.result.loc15 // CHECK:STDOUT: %d.var: ref = var d // CHECK:STDOUT: %d: ref = bind_name d, %d.var // CHECK:STDOUT: return diff --git a/toolchain/check/testdata/operators/builtin/fail_assignment_to_non_assignable.carbon b/toolchain/check/testdata/operators/builtin/fail_assignment_to_non_assignable.carbon index 19720122b217c..a91245aab83f0 100644 --- a/toolchain/check/testdata/operators/builtin/fail_assignment_to_non_assignable.carbon +++ b/toolchain/check/testdata/operators/builtin/fail_assignment_to_non_assignable.carbon @@ -161,8 +161,6 @@ fn Main() { // CHECK:STDOUT: assign %.loc28_8.1, %.loc28_10 // CHECK:STDOUT: %tuple.loc28: %tuple.type.1 = tuple_value (%int_1.loc28, %int_2.loc28) [template = constants.%tuple.2] // CHECK:STDOUT: %.loc28_8.2: %tuple.type.1 = converted %.loc28_8.1, %tuple.loc28 [template = constants.%tuple.2] -// CHECK:STDOUT: %int_32.loc29: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc29: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %n.var: ref %i32 = var n // CHECK:STDOUT: %n: ref %i32 = bind_name n, %n.var // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] @@ -254,8 +252,6 @@ fn Main() { // CHECK:STDOUT: %int.convert_checked.loc49_27: init %i32 = call %Convert.specific_fn.loc49_27(%int_3.loc49) [template = constants.%int_3.2] // CHECK:STDOUT: %.loc49_27: init %i32 = converted %int_3.loc49, %int.convert_checked.loc49_27 [template = constants.%int_3.2] // CHECK:STDOUT: assign %.loc49_4, %.loc49_27 -// CHECK:STDOUT: %int_32.loc52: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc52: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.var: ref %i32 = var a // CHECK:STDOUT: %a: ref %i32 = bind_name a, %a.var // CHECK:STDOUT: %true.loc56: bool = bool_literal true [template = constants.%true] diff --git a/toolchain/check/testdata/operators/builtin/fail_redundant_compound_access.carbon b/toolchain/check/testdata/operators/builtin/fail_redundant_compound_access.carbon index 0e3d3719ed03e..fc4f450b741c1 100644 --- a/toolchain/check/testdata/operators/builtin/fail_redundant_compound_access.carbon +++ b/toolchain/check/testdata/operators/builtin/fail_redundant_compound_access.carbon @@ -88,8 +88,6 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: fn @Main() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.var: ref %i32 = var a // CHECK:STDOUT: %a: ref %i32 = bind_name a, %a.var // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] diff --git a/toolchain/check/testdata/operators/builtin/fail_type_mismatch.carbon b/toolchain/check/testdata/operators/builtin/fail_type_mismatch.carbon index 164949a70fa39..a62abe86e1b3c 100644 --- a/toolchain/check/testdata/operators/builtin/fail_type_mismatch.carbon +++ b/toolchain/check/testdata/operators/builtin/fail_type_mismatch.carbon @@ -23,8 +23,6 @@ fn Main() { // CHECK:STDOUT: constants { // CHECK:STDOUT: %Main.type: type = fn_type @Main [template] // CHECK:STDOUT: %Main: %Main.type = struct_value () [template] -// CHECK:STDOUT: %Bool.type: type = fn_type @Bool [template] -// CHECK:STDOUT: %Bool: %Bool.type = struct_value () [template] // CHECK:STDOUT: %int_12: Core.IntLiteral = int_value 12 [template] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -48,9 +46,6 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: fn @Main() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc18_10.1: type = value_of_initializer %bool.make_type [template = bool] -// CHECK:STDOUT: %.loc18_10.2: type = converted %bool.make_type, %.loc18_10.1 [template = bool] // CHECK:STDOUT: %x.var: ref bool = var x // CHECK:STDOUT: %x: ref bool = bind_name x, %x.var // CHECK:STDOUT: %int_12: Core.IntLiteral = int_value 12 [template = constants.%int_12] diff --git a/toolchain/check/testdata/operators/builtin/fail_type_mismatch_assignment.carbon b/toolchain/check/testdata/operators/builtin/fail_type_mismatch_assignment.carbon index 2e3fecb0fe406..e64cc7adef81a 100644 --- a/toolchain/check/testdata/operators/builtin/fail_type_mismatch_assignment.carbon +++ b/toolchain/check/testdata/operators/builtin/fail_type_mismatch_assignment.carbon @@ -57,8 +57,6 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: fn @Main() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.var: ref %i32 = var a // CHECK:STDOUT: %a: ref %i32 = bind_name a, %a.var // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] diff --git a/toolchain/check/testdata/operators/builtin/or.carbon b/toolchain/check/testdata/operators/builtin/or.carbon index af800fc395623..a6348a38655a5 100644 --- a/toolchain/check/testdata/operators/builtin/or.carbon +++ b/toolchain/check/testdata/operators/builtin/or.carbon @@ -41,7 +41,6 @@ fn PartialConstant(x: bool) { // CHECK:STDOUT: %Or: %Or.type = struct_value () [template] // CHECK:STDOUT: %Constant.type: type = fn_type @Constant [template] // CHECK:STDOUT: %Constant: %Constant.type = struct_value () [template] -// CHECK:STDOUT: %false: bool = bool_literal false [template] // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [template] // CHECK:STDOUT: %PartialConstant.type: type = fn_type @PartialConstant [template] // CHECK:STDOUT: %PartialConstant: %PartialConstant.type = struct_value () [template] @@ -100,10 +99,12 @@ fn PartialConstant(x: bool) { // CHECK:STDOUT: %x.patt: bool = binding_pattern x // CHECK:STDOUT: %x.param_patt: bool = value_param_pattern %x.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %bool.make_type.loc25: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc25_23.1: type = value_of_initializer %bool.make_type.loc25 [template = bool] -// CHECK:STDOUT: %.loc25_23.2: type = converted %bool.make_type.loc25, %.loc25_23.1 [template = bool] // CHECK:STDOUT: %x.param: bool = value_param runtime_param0 +// CHECK:STDOUT: %.loc25_23.3: type = splice_block %.loc25_23.2 [template = bool] { +// CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] +// CHECK:STDOUT: %.loc25_23.1: type = value_of_initializer %bool.make_type [template = bool] +// CHECK:STDOUT: %.loc25_23.2: type = converted %bool.make_type, %.loc25_23.1 [template = bool] +// CHECK:STDOUT: } // CHECK:STDOUT: %x: bool = bind_name x, %x.param // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -144,122 +145,18 @@ fn PartialConstant(x: bool) { // CHECK:STDOUT: // CHECK:STDOUT: fn @Constant() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %true.loc19_13: bool = bool_literal true [template = constants.%true] -// CHECK:STDOUT: %.loc19_18.1: bool = not %true.loc19_13 [template = constants.%false] -// CHECK:STDOUT: %true.loc19_18: bool = bool_literal true [template = constants.%true] -// CHECK:STDOUT: if %.loc19_18.1 br !or.rhs.loc19 else br !or.result.loc19(%true.loc19_18) -// CHECK:STDOUT: -// CHECK:STDOUT: !or.rhs.loc19: -// CHECK:STDOUT: %true.loc19_21: bool = bool_literal true [template = constants.%true] -// CHECK:STDOUT: br !or.result.loc19(%true.loc19_21) -// CHECK:STDOUT: -// CHECK:STDOUT: !or.result.loc19: -// CHECK:STDOUT: %.loc19_18.2: bool = block_arg !or.result.loc19 [template = constants.%true] -// CHECK:STDOUT: if %.loc19_18.2 br !if.expr.then.loc19 else br !if.expr.else.loc19 -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.then.loc19: -// CHECK:STDOUT: %bool.make_type.loc19: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc19_31.1: type = value_of_initializer %bool.make_type.loc19 [template = bool] -// CHECK:STDOUT: %.loc19_31.2: type = converted %bool.make_type.loc19, %.loc19_31.1 [template = bool] -// CHECK:STDOUT: br !if.expr.result.loc19(%.loc19_31.2) -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.else.loc19: -// CHECK:STDOUT: %.loc19_42: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc19_36: type = converted %.loc19_42, constants.%empty_tuple.type [template = constants.%empty_tuple.type] -// CHECK:STDOUT: br !if.expr.result.loc19(%.loc19_36) -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.result.loc19: -// CHECK:STDOUT: %.loc19_10: type = block_arg !if.expr.result.loc19 [template = bool] // CHECK:STDOUT: %a.var: ref bool = var a // CHECK:STDOUT: %a: ref bool = bind_name a, %a.var -// CHECK:STDOUT: %true.loc19_46: bool = bool_literal true [template = constants.%true] -// CHECK:STDOUT: assign %a.var, %true.loc19_46 -// CHECK:STDOUT: %true.loc20_13: bool = bool_literal true [template = constants.%true] -// CHECK:STDOUT: %.loc20_18.1: bool = not %true.loc20_13 [template = constants.%false] -// CHECK:STDOUT: %true.loc20_18: bool = bool_literal true [template = constants.%true] -// CHECK:STDOUT: if %.loc20_18.1 br !or.rhs.loc20 else br !or.result.loc20(%true.loc20_18) -// CHECK:STDOUT: -// CHECK:STDOUT: !or.rhs.loc20: -// CHECK:STDOUT: %false.loc20: bool = bool_literal false [template = constants.%false] -// CHECK:STDOUT: br !or.result.loc20(%false.loc20) -// CHECK:STDOUT: -// CHECK:STDOUT: !or.result.loc20: -// CHECK:STDOUT: %.loc20_18.2: bool = block_arg !or.result.loc20 [template = constants.%true] -// CHECK:STDOUT: if %.loc20_18.2 br !if.expr.then.loc20 else br !if.expr.else.loc20 -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.then.loc20: -// CHECK:STDOUT: %bool.make_type.loc20: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc20_32.1: type = value_of_initializer %bool.make_type.loc20 [template = bool] -// CHECK:STDOUT: %.loc20_32.2: type = converted %bool.make_type.loc20, %.loc20_32.1 [template = bool] -// CHECK:STDOUT: br !if.expr.result.loc20(%.loc20_32.2) -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.else.loc20: -// CHECK:STDOUT: %.loc20_43: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc20_37: type = converted %.loc20_43, constants.%empty_tuple.type [template = constants.%empty_tuple.type] -// CHECK:STDOUT: br !if.expr.result.loc20(%.loc20_37) -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.result.loc20: -// CHECK:STDOUT: %.loc20_10: type = block_arg !if.expr.result.loc20 [template = bool] +// CHECK:STDOUT: %true.loc19: bool = bool_literal true [template = constants.%true] +// CHECK:STDOUT: assign %a.var, %true.loc19 // CHECK:STDOUT: %b.var: ref bool = var b // CHECK:STDOUT: %b: ref bool = bind_name b, %b.var -// CHECK:STDOUT: %true.loc20_47: bool = bool_literal true [template = constants.%true] -// CHECK:STDOUT: assign %b.var, %true.loc20_47 -// CHECK:STDOUT: %false.loc21: bool = bool_literal false [template = constants.%false] -// CHECK:STDOUT: %.loc21_19.1: bool = not %false.loc21 [template = constants.%true] -// CHECK:STDOUT: %true.loc21_19: bool = bool_literal true [template = constants.%true] -// CHECK:STDOUT: if %.loc21_19.1 br !or.rhs.loc21 else br !or.result.loc21(%true.loc21_19) -// CHECK:STDOUT: -// CHECK:STDOUT: !or.rhs.loc21: -// CHECK:STDOUT: %true.loc21_22: bool = bool_literal true [template = constants.%true] -// CHECK:STDOUT: br !or.result.loc21(%true.loc21_22) -// CHECK:STDOUT: -// CHECK:STDOUT: !or.result.loc21: -// CHECK:STDOUT: %.loc21_19.2: bool = block_arg !or.result.loc21 [template = constants.%true] -// CHECK:STDOUT: if %.loc21_19.2 br !if.expr.then.loc21 else br !if.expr.else.loc21 -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.then.loc21: -// CHECK:STDOUT: %bool.make_type.loc21: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc21_32.1: type = value_of_initializer %bool.make_type.loc21 [template = bool] -// CHECK:STDOUT: %.loc21_32.2: type = converted %bool.make_type.loc21, %.loc21_32.1 [template = bool] -// CHECK:STDOUT: br !if.expr.result.loc21(%.loc21_32.2) -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.else.loc21: -// CHECK:STDOUT: %.loc21_43: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc21_37: type = converted %.loc21_43, constants.%empty_tuple.type [template = constants.%empty_tuple.type] -// CHECK:STDOUT: br !if.expr.result.loc21(%.loc21_37) -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.result.loc21: -// CHECK:STDOUT: %.loc21_10: type = block_arg !if.expr.result.loc21 [template = bool] +// CHECK:STDOUT: %true.loc20: bool = bool_literal true [template = constants.%true] +// CHECK:STDOUT: assign %b.var, %true.loc20 // CHECK:STDOUT: %c.var: ref bool = var c // CHECK:STDOUT: %c: ref bool = bind_name c, %c.var -// CHECK:STDOUT: %true.loc21_47: bool = bool_literal true [template = constants.%true] -// CHECK:STDOUT: assign %c.var, %true.loc21_47 -// CHECK:STDOUT: %false.loc22_13: bool = bool_literal false [template = constants.%false] -// CHECK:STDOUT: %.loc22_19.1: bool = not %false.loc22_13 [template = constants.%true] -// CHECK:STDOUT: %true.loc22: bool = bool_literal true [template = constants.%true] -// CHECK:STDOUT: if %.loc22_19.1 br !or.rhs.loc22 else br !or.result.loc22(%true.loc22) -// CHECK:STDOUT: -// CHECK:STDOUT: !or.rhs.loc22: -// CHECK:STDOUT: %false.loc22_22: bool = bool_literal false [template = constants.%false] -// CHECK:STDOUT: br !or.result.loc22(%false.loc22_22) -// CHECK:STDOUT: -// CHECK:STDOUT: !or.result.loc22: -// CHECK:STDOUT: %.loc22_19.2: bool = block_arg !or.result.loc22 [template = constants.%false] -// CHECK:STDOUT: if %.loc22_19.2 br !if.expr.then.loc22 else br !if.expr.else.loc22 -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.then.loc22: -// CHECK:STDOUT: %bool.make_type.loc22: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc22_33.1: type = value_of_initializer %bool.make_type.loc22 [template = bool] -// CHECK:STDOUT: %.loc22_33.2: type = converted %bool.make_type.loc22, %.loc22_33.1 [template = bool] -// CHECK:STDOUT: br !if.expr.result.loc22(%.loc22_33.2) -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.else.loc22: -// CHECK:STDOUT: %.loc22_44: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc22_38: type = converted %.loc22_44, constants.%empty_tuple.type [template = constants.%empty_tuple.type] -// CHECK:STDOUT: br !if.expr.result.loc22(%.loc22_38) -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.result.loc22: -// CHECK:STDOUT: %.loc22_10: type = block_arg !if.expr.result.loc22 [template = constants.%empty_tuple.type] +// CHECK:STDOUT: %true.loc21: bool = bool_literal true [template = constants.%true] +// CHECK:STDOUT: assign %c.var, %true.loc21 // CHECK:STDOUT: %d.var: ref %empty_tuple.type = var d // CHECK:STDOUT: %d: ref %empty_tuple.type = bind_name d, %d.var // CHECK:STDOUT: %.loc22_49.1: %empty_tuple.type = tuple_literal () @@ -271,36 +168,10 @@ fn PartialConstant(x: bool) { // CHECK:STDOUT: // CHECK:STDOUT: fn @PartialConstant(%x.param_patt: bool) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %true.loc26_13: bool = bool_literal true [template = constants.%true] -// CHECK:STDOUT: %.loc26_18.1: bool = not %true.loc26_13 [template = constants.%false] -// CHECK:STDOUT: %true.loc26_18: bool = bool_literal true [template = constants.%true] -// CHECK:STDOUT: if %.loc26_18.1 br !or.rhs else br !or.result(%true.loc26_18) -// CHECK:STDOUT: -// CHECK:STDOUT: !or.rhs: -// CHECK:STDOUT: %x.ref: bool = name_ref x, %x -// CHECK:STDOUT: br !or.result(%x.ref) -// CHECK:STDOUT: -// CHECK:STDOUT: !or.result: -// CHECK:STDOUT: %.loc26_18.2: bool = block_arg !or.result [template = constants.%true] -// CHECK:STDOUT: if %.loc26_18.2 br !if.expr.then else br !if.expr.else -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.then: -// CHECK:STDOUT: %bool.make_type.loc26: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc26_28.1: type = value_of_initializer %bool.make_type.loc26 [template = bool] -// CHECK:STDOUT: %.loc26_28.2: type = converted %bool.make_type.loc26, %.loc26_28.1 [template = bool] -// CHECK:STDOUT: br !if.expr.result(%.loc26_28.2) -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.else: -// CHECK:STDOUT: %.loc26_39: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc26_33: type = converted %.loc26_39, constants.%empty_tuple.type [template = constants.%empty_tuple.type] -// CHECK:STDOUT: br !if.expr.result(%.loc26_33) -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.result: -// CHECK:STDOUT: %.loc26_10: type = block_arg !if.expr.result [template = bool] // CHECK:STDOUT: %a.var: ref bool = var a // CHECK:STDOUT: %a: ref bool = bind_name a, %a.var -// CHECK:STDOUT: %true.loc26_43: bool = bool_literal true [template = constants.%true] -// CHECK:STDOUT: assign %a.var, %true.loc26_43 +// CHECK:STDOUT: %true: bool = bool_literal true [template = constants.%true] +// CHECK:STDOUT: assign %a.var, %true // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/operators/builtin/unary_op.carbon b/toolchain/check/testdata/operators/builtin/unary_op.carbon index dfc80f429fd5c..21095c0a41674 100644 --- a/toolchain/check/testdata/operators/builtin/unary_op.carbon +++ b/toolchain/check/testdata/operators/builtin/unary_op.carbon @@ -58,23 +58,19 @@ fn Constant() { // CHECK:STDOUT: %return.patt: bool = return_slot_pattern // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %bool.make_type.loc11_11: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %bool.make_type.loc11_11 [template = bool] -// CHECK:STDOUT: %.loc11_11.2: type = converted %bool.make_type.loc11_11, %.loc11_11.1 [template = bool] // CHECK:STDOUT: %bool.make_type.loc11_20: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc11_20.1: type = value_of_initializer %bool.make_type.loc11_20 [template = bool] // CHECK:STDOUT: %.loc11_20.2: type = converted %bool.make_type.loc11_20, %.loc11_20.1 [template = bool] // CHECK:STDOUT: %b.param: bool = value_param runtime_param0 +// CHECK:STDOUT: %.loc11_11.3: type = splice_block %.loc11_11.2 [template = bool] { +// CHECK:STDOUT: %bool.make_type.loc11_11: init type = call constants.%Bool() [template = bool] +// CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %bool.make_type.loc11_11 [template = bool] +// CHECK:STDOUT: %.loc11_11.2: type = converted %bool.make_type.loc11_11, %.loc11_11.1 [template = bool] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: bool = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param1 // CHECK:STDOUT: %return: ref bool = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %bool.make_type.loc15: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc15_15.1: type = value_of_initializer %bool.make_type.loc15 [template = bool] -// CHECK:STDOUT: %.loc15_15.2: type = converted %bool.make_type.loc15, %.loc15_15.1 [template = bool] -// CHECK:STDOUT: %bool.make_type.loc16: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc16_16.1: type = value_of_initializer %bool.make_type.loc16 [template = bool] -// CHECK:STDOUT: %.loc16_16.2: type = converted %bool.make_type.loc16, %.loc16_16.1 [template = bool] // CHECK:STDOUT: %Constant.decl: %Constant.type = fn_decl @Constant [template = constants.%Constant] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: @@ -87,50 +83,16 @@ fn Constant() { // CHECK:STDOUT: // CHECK:STDOUT: fn @Constant() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %true.loc19: bool = bool_literal true [template = constants.%true] -// CHECK:STDOUT: %.loc19_13: bool = not %true.loc19 [template = constants.%false] -// CHECK:STDOUT: if %.loc19_13 br !if.expr.then.loc19 else br !if.expr.else.loc19 -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.then.loc19: -// CHECK:STDOUT: %bool.make_type.loc19: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc19_27.1: type = value_of_initializer %bool.make_type.loc19 [template = bool] -// CHECK:STDOUT: %.loc19_27.2: type = converted %bool.make_type.loc19, %.loc19_27.1 [template = bool] -// CHECK:STDOUT: br !if.expr.result.loc19(%.loc19_27.2) -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.else.loc19: -// CHECK:STDOUT: %.loc19_38: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc19_32: type = converted %.loc19_38, constants.%empty_tuple.type [template = constants.%empty_tuple.type] -// CHECK:STDOUT: br !if.expr.result.loc19(%.loc19_32) -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.result.loc19: -// CHECK:STDOUT: %.loc19_10: type = block_arg !if.expr.result.loc19 [template = constants.%empty_tuple.type] // CHECK:STDOUT: %a.var: ref %empty_tuple.type = var a // CHECK:STDOUT: %a: ref %empty_tuple.type = bind_name a, %a.var // CHECK:STDOUT: %.loc19_43.1: %empty_tuple.type = tuple_literal () // CHECK:STDOUT: %.loc19_43.2: init %empty_tuple.type = tuple_init () to %a.var [template = constants.%empty_tuple] // CHECK:STDOUT: %.loc19_44: init %empty_tuple.type = converted %.loc19_43.1, %.loc19_43.2 [template = constants.%empty_tuple] // CHECK:STDOUT: assign %a.var, %.loc19_44 -// CHECK:STDOUT: %false: bool = bool_literal false [template = constants.%false] -// CHECK:STDOUT: %.loc20_13: bool = not %false [template = constants.%true] -// CHECK:STDOUT: if %.loc20_13 br !if.expr.then.loc20 else br !if.expr.else.loc20 -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.then.loc20: -// CHECK:STDOUT: %bool.make_type.loc20: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc20_28.1: type = value_of_initializer %bool.make_type.loc20 [template = bool] -// CHECK:STDOUT: %.loc20_28.2: type = converted %bool.make_type.loc20, %.loc20_28.1 [template = bool] -// CHECK:STDOUT: br !if.expr.result.loc20(%.loc20_28.2) -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.else.loc20: -// CHECK:STDOUT: %.loc20_39: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc20_33: type = converted %.loc20_39, constants.%empty_tuple.type [template = constants.%empty_tuple.type] -// CHECK:STDOUT: br !if.expr.result.loc20(%.loc20_33) -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.result.loc20: -// CHECK:STDOUT: %.loc20_10: type = block_arg !if.expr.result.loc20 [template = bool] // CHECK:STDOUT: %b.var: ref bool = var b // CHECK:STDOUT: %b: ref bool = bind_name b, %b.var -// CHECK:STDOUT: %true.loc20: bool = bool_literal true [template = constants.%true] -// CHECK:STDOUT: assign %b.var, %true.loc20 +// CHECK:STDOUT: %true: bool = bool_literal true [template = constants.%true] +// CHECK:STDOUT: assign %b.var, %true // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/operators/overloaded/add.carbon b/toolchain/check/testdata/operators/overloaded/add.carbon index 210a583a1bbf7..3396ecffec9e1 100644 --- a/toolchain/check/testdata/operators/overloaded/add.carbon +++ b/toolchain/check/testdata/operators/overloaded/add.carbon @@ -94,12 +94,12 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %return.patt: %C = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %C = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref.loc26_14: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %C.ref.loc26_20: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %C.ref.loc26_26: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a.param: %C = value_param runtime_param0 +// CHECK:STDOUT: %C.ref.loc26_14: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a: %C = bind_name a, %a.param // CHECK:STDOUT: %b.param: %C = value_param runtime_param1 +// CHECK:STDOUT: %C.ref.loc26_20: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %b: %C = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref %C = out_param runtime_param2 // CHECK:STDOUT: %return: ref %C = return_slot %return.param @@ -110,12 +110,14 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %b.patt: %C = binding_pattern b // CHECK:STDOUT: %b.param_patt: %C = value_param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref.loc30_18: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %ptr: type = ptr_type %C [template = constants.%ptr.2] -// CHECK:STDOUT: %C.ref.loc30_25: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a.param: %ptr.2 = value_param runtime_param0 +// CHECK:STDOUT: %.loc30: type = splice_block %ptr [template = constants.%ptr.2] { +// CHECK:STDOUT: %C.ref.loc30_18: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %ptr: type = ptr_type %C [template = constants.%ptr.2] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %ptr.2 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %C = value_param runtime_param1 +// CHECK:STDOUT: %C.ref.loc30_25: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %b: %C = bind_name b, %b.param // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -129,12 +131,12 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %return.patt: %C = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %C = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref.loc18_15: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %C.ref.loc18_25: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %C.ref.loc18_31: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %self.param: %C = value_param runtime_param0 +// CHECK:STDOUT: %C.ref.loc18_15: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %self: %C = bind_name self, %self.param // CHECK:STDOUT: %other.param: %C = value_param runtime_param1 +// CHECK:STDOUT: %C.ref.loc18_25: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %other: %C = bind_name other, %other.param // CHECK:STDOUT: %return.param: ref %C = out_param runtime_param2 // CHECK:STDOUT: %return: ref %C = return_slot %return.param @@ -150,16 +152,18 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %Op.decl: %Op.type.3 = fn_decl @Op.3 [template = constants.%Op.3] { // CHECK:STDOUT: %self.patt: %ptr.2 = binding_pattern self // CHECK:STDOUT: %self.param_patt: %ptr.2 = value_param_pattern %self.patt, runtime_param0 -// CHECK:STDOUT: %.loc23: auto = addr_pattern %self.param_patt +// CHECK:STDOUT: %.loc23_9: auto = addr_pattern %self.param_patt // CHECK:STDOUT: %other.patt: %C = binding_pattern other // CHECK:STDOUT: %other.param_patt: %C = value_param_pattern %other.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref.loc23_20: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %ptr: type = ptr_type %C [template = constants.%ptr.2] -// CHECK:STDOUT: %C.ref.loc23_31: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %self.param: %ptr.2 = value_param runtime_param0 +// CHECK:STDOUT: %.loc23_21: type = splice_block %ptr [template = constants.%ptr.2] { +// CHECK:STDOUT: %C.ref.loc23_20: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %ptr: type = ptr_type %C [template = constants.%ptr.2] +// CHECK:STDOUT: } // CHECK:STDOUT: %self: %ptr.2 = bind_name self, %self.param // CHECK:STDOUT: %other.param: %C = value_param runtime_param1 +// CHECK:STDOUT: %C.ref.loc23_31: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %other: %C = bind_name other, %other.param // CHECK:STDOUT: } // CHECK:STDOUT: %interface: = interface_witness (%Op.decl) [template = constants.%interface.2] diff --git a/toolchain/check/testdata/operators/overloaded/bit_and.carbon b/toolchain/check/testdata/operators/overloaded/bit_and.carbon index 658d89f5cc9d1..e56b393ac9279 100644 --- a/toolchain/check/testdata/operators/overloaded/bit_and.carbon +++ b/toolchain/check/testdata/operators/overloaded/bit_and.carbon @@ -94,12 +94,12 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %return.patt: %C = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %C = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref.loc26_14: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %C.ref.loc26_20: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %C.ref.loc26_26: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a.param: %C = value_param runtime_param0 +// CHECK:STDOUT: %C.ref.loc26_14: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a: %C = bind_name a, %a.param // CHECK:STDOUT: %b.param: %C = value_param runtime_param1 +// CHECK:STDOUT: %C.ref.loc26_20: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %b: %C = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref %C = out_param runtime_param2 // CHECK:STDOUT: %return: ref %C = return_slot %return.param @@ -110,12 +110,14 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %b.patt: %C = binding_pattern b // CHECK:STDOUT: %b.param_patt: %C = value_param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref.loc30_18: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %ptr: type = ptr_type %C [template = constants.%ptr.2] -// CHECK:STDOUT: %C.ref.loc30_25: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a.param: %ptr.2 = value_param runtime_param0 +// CHECK:STDOUT: %.loc30: type = splice_block %ptr [template = constants.%ptr.2] { +// CHECK:STDOUT: %C.ref.loc30_18: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %ptr: type = ptr_type %C [template = constants.%ptr.2] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %ptr.2 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %C = value_param runtime_param1 +// CHECK:STDOUT: %C.ref.loc30_25: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %b: %C = bind_name b, %b.param // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -129,12 +131,12 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %return.patt: %C = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %C = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref.loc18_15: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %C.ref.loc18_25: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %C.ref.loc18_31: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %self.param: %C = value_param runtime_param0 +// CHECK:STDOUT: %C.ref.loc18_15: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %self: %C = bind_name self, %self.param // CHECK:STDOUT: %other.param: %C = value_param runtime_param1 +// CHECK:STDOUT: %C.ref.loc18_25: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %other: %C = bind_name other, %other.param // CHECK:STDOUT: %return.param: ref %C = out_param runtime_param2 // CHECK:STDOUT: %return: ref %C = return_slot %return.param @@ -150,16 +152,18 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %Op.decl: %Op.type.3 = fn_decl @Op.3 [template = constants.%Op.3] { // CHECK:STDOUT: %self.patt: %ptr.2 = binding_pattern self // CHECK:STDOUT: %self.param_patt: %ptr.2 = value_param_pattern %self.patt, runtime_param0 -// CHECK:STDOUT: %.loc23: auto = addr_pattern %self.param_patt +// CHECK:STDOUT: %.loc23_9: auto = addr_pattern %self.param_patt // CHECK:STDOUT: %other.patt: %C = binding_pattern other // CHECK:STDOUT: %other.param_patt: %C = value_param_pattern %other.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref.loc23_20: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %ptr: type = ptr_type %C [template = constants.%ptr.2] -// CHECK:STDOUT: %C.ref.loc23_31: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %self.param: %ptr.2 = value_param runtime_param0 +// CHECK:STDOUT: %.loc23_21: type = splice_block %ptr [template = constants.%ptr.2] { +// CHECK:STDOUT: %C.ref.loc23_20: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %ptr: type = ptr_type %C [template = constants.%ptr.2] +// CHECK:STDOUT: } // CHECK:STDOUT: %self: %ptr.2 = bind_name self, %self.param // CHECK:STDOUT: %other.param: %C = value_param runtime_param1 +// CHECK:STDOUT: %C.ref.loc23_31: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %other: %C = bind_name other, %other.param // CHECK:STDOUT: } // CHECK:STDOUT: %interface: = interface_witness (%Op.decl) [template = constants.%interface.2] diff --git a/toolchain/check/testdata/operators/overloaded/bit_complement.carbon b/toolchain/check/testdata/operators/overloaded/bit_complement.carbon index ccd42c22a5f06..cbacbb9dcdd89 100644 --- a/toolchain/check/testdata/operators/overloaded/bit_complement.carbon +++ b/toolchain/check/testdata/operators/overloaded/bit_complement.carbon @@ -68,9 +68,9 @@ fn TestOp(a: C) -> C { // CHECK:STDOUT: %return.patt: %C = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %C = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref.loc23_14: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %C.ref.loc23_20: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a.param: %C = value_param runtime_param0 +// CHECK:STDOUT: %C.ref.loc23_14: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a: %C = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %C = out_param runtime_param1 // CHECK:STDOUT: %return: ref %C = return_slot %return.param @@ -84,9 +84,9 @@ fn TestOp(a: C) -> C { // CHECK:STDOUT: %return.patt: %C = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %C = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref.loc18_15: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %C.ref.loc18_23: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %self.param: %C = value_param runtime_param0 +// CHECK:STDOUT: %C.ref.loc18_15: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %self: %C = bind_name self, %self.param // CHECK:STDOUT: %return.param: ref %C = out_param runtime_param1 // CHECK:STDOUT: %return: ref %C = return_slot %return.param diff --git a/toolchain/check/testdata/operators/overloaded/bit_or.carbon b/toolchain/check/testdata/operators/overloaded/bit_or.carbon index b965a282d036d..94fce897edd4c 100644 --- a/toolchain/check/testdata/operators/overloaded/bit_or.carbon +++ b/toolchain/check/testdata/operators/overloaded/bit_or.carbon @@ -94,12 +94,12 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %return.patt: %C = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %C = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref.loc26_14: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %C.ref.loc26_20: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %C.ref.loc26_26: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a.param: %C = value_param runtime_param0 +// CHECK:STDOUT: %C.ref.loc26_14: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a: %C = bind_name a, %a.param // CHECK:STDOUT: %b.param: %C = value_param runtime_param1 +// CHECK:STDOUT: %C.ref.loc26_20: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %b: %C = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref %C = out_param runtime_param2 // CHECK:STDOUT: %return: ref %C = return_slot %return.param @@ -110,12 +110,14 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %b.patt: %C = binding_pattern b // CHECK:STDOUT: %b.param_patt: %C = value_param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref.loc30_18: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %ptr: type = ptr_type %C [template = constants.%ptr.2] -// CHECK:STDOUT: %C.ref.loc30_25: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a.param: %ptr.2 = value_param runtime_param0 +// CHECK:STDOUT: %.loc30: type = splice_block %ptr [template = constants.%ptr.2] { +// CHECK:STDOUT: %C.ref.loc30_18: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %ptr: type = ptr_type %C [template = constants.%ptr.2] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %ptr.2 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %C = value_param runtime_param1 +// CHECK:STDOUT: %C.ref.loc30_25: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %b: %C = bind_name b, %b.param // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -129,12 +131,12 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %return.patt: %C = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %C = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref.loc18_15: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %C.ref.loc18_25: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %C.ref.loc18_31: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %self.param: %C = value_param runtime_param0 +// CHECK:STDOUT: %C.ref.loc18_15: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %self: %C = bind_name self, %self.param // CHECK:STDOUT: %other.param: %C = value_param runtime_param1 +// CHECK:STDOUT: %C.ref.loc18_25: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %other: %C = bind_name other, %other.param // CHECK:STDOUT: %return.param: ref %C = out_param runtime_param2 // CHECK:STDOUT: %return: ref %C = return_slot %return.param @@ -150,16 +152,18 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %Op.decl: %Op.type.3 = fn_decl @Op.3 [template = constants.%Op.3] { // CHECK:STDOUT: %self.patt: %ptr.2 = binding_pattern self // CHECK:STDOUT: %self.param_patt: %ptr.2 = value_param_pattern %self.patt, runtime_param0 -// CHECK:STDOUT: %.loc23: auto = addr_pattern %self.param_patt +// CHECK:STDOUT: %.loc23_9: auto = addr_pattern %self.param_patt // CHECK:STDOUT: %other.patt: %C = binding_pattern other // CHECK:STDOUT: %other.param_patt: %C = value_param_pattern %other.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref.loc23_20: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %ptr: type = ptr_type %C [template = constants.%ptr.2] -// CHECK:STDOUT: %C.ref.loc23_31: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %self.param: %ptr.2 = value_param runtime_param0 +// CHECK:STDOUT: %.loc23_21: type = splice_block %ptr [template = constants.%ptr.2] { +// CHECK:STDOUT: %C.ref.loc23_20: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %ptr: type = ptr_type %C [template = constants.%ptr.2] +// CHECK:STDOUT: } // CHECK:STDOUT: %self: %ptr.2 = bind_name self, %self.param // CHECK:STDOUT: %other.param: %C = value_param runtime_param1 +// CHECK:STDOUT: %C.ref.loc23_31: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %other: %C = bind_name other, %other.param // CHECK:STDOUT: } // CHECK:STDOUT: %interface: = interface_witness (%Op.decl) [template = constants.%interface.2] diff --git a/toolchain/check/testdata/operators/overloaded/bit_xor.carbon b/toolchain/check/testdata/operators/overloaded/bit_xor.carbon index b27d98183aa51..327a6732341d7 100644 --- a/toolchain/check/testdata/operators/overloaded/bit_xor.carbon +++ b/toolchain/check/testdata/operators/overloaded/bit_xor.carbon @@ -94,12 +94,12 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %return.patt: %C = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %C = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref.loc26_14: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %C.ref.loc26_20: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %C.ref.loc26_26: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a.param: %C = value_param runtime_param0 +// CHECK:STDOUT: %C.ref.loc26_14: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a: %C = bind_name a, %a.param // CHECK:STDOUT: %b.param: %C = value_param runtime_param1 +// CHECK:STDOUT: %C.ref.loc26_20: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %b: %C = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref %C = out_param runtime_param2 // CHECK:STDOUT: %return: ref %C = return_slot %return.param @@ -110,12 +110,14 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %b.patt: %C = binding_pattern b // CHECK:STDOUT: %b.param_patt: %C = value_param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref.loc30_18: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %ptr: type = ptr_type %C [template = constants.%ptr.2] -// CHECK:STDOUT: %C.ref.loc30_25: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a.param: %ptr.2 = value_param runtime_param0 +// CHECK:STDOUT: %.loc30: type = splice_block %ptr [template = constants.%ptr.2] { +// CHECK:STDOUT: %C.ref.loc30_18: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %ptr: type = ptr_type %C [template = constants.%ptr.2] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %ptr.2 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %C = value_param runtime_param1 +// CHECK:STDOUT: %C.ref.loc30_25: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %b: %C = bind_name b, %b.param // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -129,12 +131,12 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %return.patt: %C = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %C = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref.loc18_15: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %C.ref.loc18_25: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %C.ref.loc18_31: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %self.param: %C = value_param runtime_param0 +// CHECK:STDOUT: %C.ref.loc18_15: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %self: %C = bind_name self, %self.param // CHECK:STDOUT: %other.param: %C = value_param runtime_param1 +// CHECK:STDOUT: %C.ref.loc18_25: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %other: %C = bind_name other, %other.param // CHECK:STDOUT: %return.param: ref %C = out_param runtime_param2 // CHECK:STDOUT: %return: ref %C = return_slot %return.param @@ -150,16 +152,18 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %Op.decl: %Op.type.3 = fn_decl @Op.3 [template = constants.%Op.3] { // CHECK:STDOUT: %self.patt: %ptr.2 = binding_pattern self // CHECK:STDOUT: %self.param_patt: %ptr.2 = value_param_pattern %self.patt, runtime_param0 -// CHECK:STDOUT: %.loc23: auto = addr_pattern %self.param_patt +// CHECK:STDOUT: %.loc23_9: auto = addr_pattern %self.param_patt // CHECK:STDOUT: %other.patt: %C = binding_pattern other // CHECK:STDOUT: %other.param_patt: %C = value_param_pattern %other.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref.loc23_20: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %ptr: type = ptr_type %C [template = constants.%ptr.2] -// CHECK:STDOUT: %C.ref.loc23_31: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %self.param: %ptr.2 = value_param runtime_param0 +// CHECK:STDOUT: %.loc23_21: type = splice_block %ptr [template = constants.%ptr.2] { +// CHECK:STDOUT: %C.ref.loc23_20: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %ptr: type = ptr_type %C [template = constants.%ptr.2] +// CHECK:STDOUT: } // CHECK:STDOUT: %self: %ptr.2 = bind_name self, %self.param // CHECK:STDOUT: %other.param: %C = value_param runtime_param1 +// CHECK:STDOUT: %C.ref.loc23_31: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %other: %C = bind_name other, %other.param // CHECK:STDOUT: } // CHECK:STDOUT: %interface: = interface_witness (%Op.decl) [template = constants.%interface.2] diff --git a/toolchain/check/testdata/operators/overloaded/dec.carbon b/toolchain/check/testdata/operators/overloaded/dec.carbon index 8d3048c5f1c10..c15f13ed45194 100644 --- a/toolchain/check/testdata/operators/overloaded/dec.carbon +++ b/toolchain/check/testdata/operators/overloaded/dec.carbon @@ -70,11 +70,13 @@ fn TestOp() { // CHECK:STDOUT: %Op.decl: %Op.type.1 = fn_decl @Op.1 [template = constants.%Op.1] { // CHECK:STDOUT: %self.patt: %ptr.1 = binding_pattern self // CHECK:STDOUT: %self.param_patt: %ptr.1 = value_param_pattern %self.patt, runtime_param0 -// CHECK:STDOUT: %.loc18: auto = addr_pattern %self.param_patt +// CHECK:STDOUT: %.loc18_9: auto = addr_pattern %self.param_patt // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %ptr: type = ptr_type %C [template = constants.%ptr.1] // CHECK:STDOUT: %self.param: %ptr.1 = value_param runtime_param0 +// CHECK:STDOUT: %.loc18_21: type = splice_block %ptr [template = constants.%ptr.1] { +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %ptr: type = ptr_type %C [template = constants.%ptr.1] +// CHECK:STDOUT: } // CHECK:STDOUT: %self: %ptr.1 = bind_name self, %self.param // CHECK:STDOUT: } // CHECK:STDOUT: %interface: = interface_witness (%Op.decl) [template = constants.%interface] @@ -96,7 +98,6 @@ fn TestOp() { // CHECK:STDOUT: // CHECK:STDOUT: fn @TestOp() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %c.var: ref %C = var c // CHECK:STDOUT: %c: ref %C = bind_name c, %c.var // CHECK:STDOUT: %.loc22_15.1: %empty_struct_type = struct_literal () diff --git a/toolchain/check/testdata/operators/overloaded/div.carbon b/toolchain/check/testdata/operators/overloaded/div.carbon index d55dc3c3387b3..ef5167fd2bd1f 100644 --- a/toolchain/check/testdata/operators/overloaded/div.carbon +++ b/toolchain/check/testdata/operators/overloaded/div.carbon @@ -94,12 +94,12 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %return.patt: %C = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %C = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref.loc26_14: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %C.ref.loc26_20: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %C.ref.loc26_26: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a.param: %C = value_param runtime_param0 +// CHECK:STDOUT: %C.ref.loc26_14: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a: %C = bind_name a, %a.param // CHECK:STDOUT: %b.param: %C = value_param runtime_param1 +// CHECK:STDOUT: %C.ref.loc26_20: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %b: %C = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref %C = out_param runtime_param2 // CHECK:STDOUT: %return: ref %C = return_slot %return.param @@ -110,12 +110,14 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %b.patt: %C = binding_pattern b // CHECK:STDOUT: %b.param_patt: %C = value_param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref.loc30_18: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %ptr: type = ptr_type %C [template = constants.%ptr.2] -// CHECK:STDOUT: %C.ref.loc30_25: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a.param: %ptr.2 = value_param runtime_param0 +// CHECK:STDOUT: %.loc30: type = splice_block %ptr [template = constants.%ptr.2] { +// CHECK:STDOUT: %C.ref.loc30_18: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %ptr: type = ptr_type %C [template = constants.%ptr.2] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %ptr.2 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %C = value_param runtime_param1 +// CHECK:STDOUT: %C.ref.loc30_25: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %b: %C = bind_name b, %b.param // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -129,12 +131,12 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %return.patt: %C = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %C = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref.loc18_15: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %C.ref.loc18_25: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %C.ref.loc18_31: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %self.param: %C = value_param runtime_param0 +// CHECK:STDOUT: %C.ref.loc18_15: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %self: %C = bind_name self, %self.param // CHECK:STDOUT: %other.param: %C = value_param runtime_param1 +// CHECK:STDOUT: %C.ref.loc18_25: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %other: %C = bind_name other, %other.param // CHECK:STDOUT: %return.param: ref %C = out_param runtime_param2 // CHECK:STDOUT: %return: ref %C = return_slot %return.param @@ -150,16 +152,18 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %Op.decl: %Op.type.3 = fn_decl @Op.3 [template = constants.%Op.3] { // CHECK:STDOUT: %self.patt: %ptr.2 = binding_pattern self // CHECK:STDOUT: %self.param_patt: %ptr.2 = value_param_pattern %self.patt, runtime_param0 -// CHECK:STDOUT: %.loc23: auto = addr_pattern %self.param_patt +// CHECK:STDOUT: %.loc23_9: auto = addr_pattern %self.param_patt // CHECK:STDOUT: %other.patt: %C = binding_pattern other // CHECK:STDOUT: %other.param_patt: %C = value_param_pattern %other.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref.loc23_20: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %ptr: type = ptr_type %C [template = constants.%ptr.2] -// CHECK:STDOUT: %C.ref.loc23_31: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %self.param: %ptr.2 = value_param runtime_param0 +// CHECK:STDOUT: %.loc23_21: type = splice_block %ptr [template = constants.%ptr.2] { +// CHECK:STDOUT: %C.ref.loc23_20: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %ptr: type = ptr_type %C [template = constants.%ptr.2] +// CHECK:STDOUT: } // CHECK:STDOUT: %self: %ptr.2 = bind_name self, %self.param // CHECK:STDOUT: %other.param: %C = value_param runtime_param1 +// CHECK:STDOUT: %C.ref.loc23_31: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %other: %C = bind_name other, %other.param // CHECK:STDOUT: } // CHECK:STDOUT: %interface: = interface_witness (%Op.decl) [template = constants.%interface.2] diff --git a/toolchain/check/testdata/operators/overloaded/eq.carbon b/toolchain/check/testdata/operators/overloaded/eq.carbon index aba611ffadaef..bc531ae1a361b 100644 --- a/toolchain/check/testdata/operators/overloaded/eq.carbon +++ b/toolchain/check/testdata/operators/overloaded/eq.carbon @@ -136,14 +136,14 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: %return.patt: bool = return_slot_pattern // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref.loc11_17: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %C.ref.loc11_23: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc11_29.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc11_29.2: type = converted %bool.make_type, %.loc11_29.1 [template = bool] // CHECK:STDOUT: %a.param: %C = value_param runtime_param0 +// CHECK:STDOUT: %C.ref.loc11_17: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a: %C = bind_name a, %a.param // CHECK:STDOUT: %b.param: %C = value_param runtime_param1 +// CHECK:STDOUT: %C.ref.loc11_23: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %b: %C = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param @@ -156,14 +156,14 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: %return.patt: bool = return_slot_pattern // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref.loc15_20: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %C.ref.loc15_26: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc15_32.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc15_32.2: type = converted %bool.make_type, %.loc15_32.1 [template = bool] // CHECK:STDOUT: %a.param: %C = value_param runtime_param0 +// CHECK:STDOUT: %C.ref.loc15_20: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a: %C = bind_name a, %a.param // CHECK:STDOUT: %b.param: %C = value_param runtime_param1 +// CHECK:STDOUT: %C.ref.loc15_26: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %b: %C = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param @@ -179,14 +179,14 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: %return.patt: bool = return_slot_pattern // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref.loc7_18: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %C.ref.loc7_28: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc7_34.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc7_34.2: type = converted %bool.make_type, %.loc7_34.1 [template = bool] // CHECK:STDOUT: %self.param: %C = value_param runtime_param0 +// CHECK:STDOUT: %C.ref.loc7_18: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %self: %C = bind_name self, %self.param // CHECK:STDOUT: %other.param: %C = value_param runtime_param1 +// CHECK:STDOUT: %C.ref.loc7_28: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %other: %C = bind_name other, %other.param // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param @@ -199,14 +199,14 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: %return.patt: bool = return_slot_pattern // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref.loc8_21: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %C.ref.loc8_31: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc8_37.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc8_37.2: type = converted %bool.make_type, %.loc8_37.1 [template = bool] // CHECK:STDOUT: %self.param: %C = value_param runtime_param0 +// CHECK:STDOUT: %C.ref.loc8_21: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %self: %C = bind_name self, %self.param // CHECK:STDOUT: %other.param: %C = value_param runtime_param1 +// CHECK:STDOUT: %C.ref.loc8_31: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %other: %C = bind_name other, %other.param // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param @@ -295,14 +295,14 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: %return.patt: bool = return_slot_pattern // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %D.ref.loc6_17: type = name_ref D, file.%D.decl [template = constants.%D] -// CHECK:STDOUT: %D.ref.loc6_23: type = name_ref D, file.%D.decl [template = constants.%D] // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc6_29.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc6_29.2: type = converted %bool.make_type, %.loc6_29.1 [template = bool] // CHECK:STDOUT: %a.param: %D = value_param runtime_param0 +// CHECK:STDOUT: %D.ref.loc6_17: type = name_ref D, file.%D.decl [template = constants.%D] // CHECK:STDOUT: %a: %D = bind_name a, %a.param // CHECK:STDOUT: %b.param: %D = value_param runtime_param1 +// CHECK:STDOUT: %D.ref.loc6_23: type = name_ref D, file.%D.decl [template = constants.%D] // CHECK:STDOUT: %b: %D = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param @@ -315,14 +315,14 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: %return.patt: bool = return_slot_pattern // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %D.ref.loc14_20: type = name_ref D, file.%D.decl [template = constants.%D] -// CHECK:STDOUT: %D.ref.loc14_26: type = name_ref D, file.%D.decl [template = constants.%D] // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc14_32.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc14_32.2: type = converted %bool.make_type, %.loc14_32.1 [template = bool] // CHECK:STDOUT: %a.param: %D = value_param runtime_param0 +// CHECK:STDOUT: %D.ref.loc14_20: type = name_ref D, file.%D.decl [template = constants.%D] // CHECK:STDOUT: %a: %D = bind_name a, %a.param // CHECK:STDOUT: %b.param: %D = value_param runtime_param1 +// CHECK:STDOUT: %D.ref.loc14_26: type = name_ref D, file.%D.decl [template = constants.%D] // CHECK:STDOUT: %b: %D = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param @@ -408,14 +408,14 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: %return.patt: bool = return_slot_pattern // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [template = constants.%D] // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc12_30.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc12_30.2: type = converted %bool.make_type, %.loc12_30.1 [template = bool] // CHECK:STDOUT: %a.param: %C = value_param runtime_param0 +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a: %C = bind_name a, %a.param // CHECK:STDOUT: %b.param: %D = value_param runtime_param1 +// CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [template = constants.%D] // CHECK:STDOUT: %b: %D = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param @@ -428,14 +428,14 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: %return.patt: bool = return_slot_pattern // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [template = constants.%D] -// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc26_30.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc26_30.2: type = converted %bool.make_type, %.loc26_30.1 [template = bool] // CHECK:STDOUT: %a.param: %D = value_param runtime_param0 +// CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [template = constants.%D] // CHECK:STDOUT: %a: %D = bind_name a, %a.param // CHECK:STDOUT: %b.param: %C = value_param runtime_param1 +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %b: %C = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param @@ -451,14 +451,14 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: %return.patt: bool = return_slot_pattern // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref.loc8_18: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %C.ref.loc8_28: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc8_34.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc8_34.2: type = converted %bool.make_type, %.loc8_34.1 [template = bool] // CHECK:STDOUT: %self.param: %C = value_param runtime_param0 +// CHECK:STDOUT: %C.ref.loc8_18: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %self: %C = bind_name self, %self.param // CHECK:STDOUT: %other.param: %C = value_param runtime_param1 +// CHECK:STDOUT: %C.ref.loc8_28: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %other: %C = bind_name other, %other.param // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param @@ -471,14 +471,14 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: %return.patt: bool = return_slot_pattern // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref.loc9_21: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %C.ref.loc9_31: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc9_37.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc9_37.2: type = converted %bool.make_type, %.loc9_37.1 [template = bool] // CHECK:STDOUT: %self.param: %C = value_param runtime_param0 +// CHECK:STDOUT: %C.ref.loc9_21: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %self: %C = bind_name self, %self.param // CHECK:STDOUT: %other.param: %C = value_param runtime_param1 +// CHECK:STDOUT: %C.ref.loc9_31: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %other: %C = bind_name other, %other.param // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param diff --git a/toolchain/check/testdata/operators/overloaded/fail_assign_non_ref.carbon b/toolchain/check/testdata/operators/overloaded/fail_assign_non_ref.carbon index 32cb5bd17ee36..46b82d2a497a5 100644 --- a/toolchain/check/testdata/operators/overloaded/fail_assign_non_ref.carbon +++ b/toolchain/check/testdata/operators/overloaded/fail_assign_non_ref.carbon @@ -98,8 +98,8 @@ fn TestAddAssignNonRef(a: C, b: C) { // CHECK:STDOUT: %a.patt: %C = binding_pattern a // CHECK:STDOUT: %a.param_patt: %C = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a.param: %C = value_param runtime_param0 +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a: %C = bind_name a, %a.param // CHECK:STDOUT: } // CHECK:STDOUT: %TestAddAssignNonRef.decl: %TestAddAssignNonRef.type = fn_decl @TestAddAssignNonRef [template = constants.%TestAddAssignNonRef] { @@ -108,11 +108,11 @@ fn TestAddAssignNonRef(a: C, b: C) { // CHECK:STDOUT: %b.patt: %C = binding_pattern b // CHECK:STDOUT: %b.param_patt: %C = value_param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref.loc33_27: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %C.ref.loc33_33: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a.param: %C = value_param runtime_param0 +// CHECK:STDOUT: %C.ref.loc33_27: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a: %C = bind_name a, %a.param // CHECK:STDOUT: %b.param: %C = value_param runtime_param1 +// CHECK:STDOUT: %C.ref.loc33_33: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %b: %C = bind_name b, %b.param // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -121,11 +121,13 @@ fn TestAddAssignNonRef(a: C, b: C) { // CHECK:STDOUT: %Op.decl: %Op.type.1 = fn_decl @Op.1 [template = constants.%Op.1] { // CHECK:STDOUT: %self.patt: %ptr.1 = binding_pattern self // CHECK:STDOUT: %self.param_patt: %ptr.1 = value_param_pattern %self.patt, runtime_param0 -// CHECK:STDOUT: %.loc16: auto = addr_pattern %self.param_patt +// CHECK:STDOUT: %.loc16_9: auto = addr_pattern %self.param_patt // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %ptr: type = ptr_type %C [template = constants.%ptr.1] // CHECK:STDOUT: %self.param: %ptr.1 = value_param runtime_param0 +// CHECK:STDOUT: %.loc16_21: type = splice_block %ptr [template = constants.%ptr.1] { +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %ptr: type = ptr_type %C [template = constants.%ptr.1] +// CHECK:STDOUT: } // CHECK:STDOUT: %self: %ptr.1 = bind_name self, %self.param // CHECK:STDOUT: } // CHECK:STDOUT: %interface: = interface_witness (%Op.decl) [template = constants.%interface.1] @@ -139,16 +141,18 @@ fn TestAddAssignNonRef(a: C, b: C) { // CHECK:STDOUT: %Op.decl: %Op.type.3 = fn_decl @Op.3 [template = constants.%Op.3] { // CHECK:STDOUT: %self.patt: %ptr.1 = binding_pattern self // CHECK:STDOUT: %self.param_patt: %ptr.1 = value_param_pattern %self.patt, runtime_param0 -// CHECK:STDOUT: %.loc19: auto = addr_pattern %self.param_patt +// CHECK:STDOUT: %.loc19_9: auto = addr_pattern %self.param_patt // CHECK:STDOUT: %other.patt: %C = binding_pattern other // CHECK:STDOUT: %other.param_patt: %C = value_param_pattern %other.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref.loc19_20: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %ptr: type = ptr_type %C [template = constants.%ptr.1] -// CHECK:STDOUT: %C.ref.loc19_31: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %self.param: %ptr.1 = value_param runtime_param0 +// CHECK:STDOUT: %.loc19_21: type = splice_block %ptr [template = constants.%ptr.1] { +// CHECK:STDOUT: %C.ref.loc19_20: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %ptr: type = ptr_type %C [template = constants.%ptr.1] +// CHECK:STDOUT: } // CHECK:STDOUT: %self: %ptr.1 = bind_name self, %self.param // CHECK:STDOUT: %other.param: %C = value_param runtime_param1 +// CHECK:STDOUT: %C.ref.loc19_31: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %other: %C = bind_name other, %other.param // CHECK:STDOUT: } // CHECK:STDOUT: %interface: = interface_witness (%Op.decl) [template = constants.%interface.2] diff --git a/toolchain/check/testdata/operators/overloaded/fail_no_impl.carbon b/toolchain/check/testdata/operators/overloaded/fail_no_impl.carbon index f76473272923c..361503889b22b 100644 --- a/toolchain/check/testdata/operators/overloaded/fail_no_impl.carbon +++ b/toolchain/check/testdata/operators/overloaded/fail_no_impl.carbon @@ -83,9 +83,9 @@ fn TestRef(b: C) { // CHECK:STDOUT: %return.patt: %C = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %C = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref.loc15_17: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %C.ref.loc15_23: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a.param: %C = value_param runtime_param0 +// CHECK:STDOUT: %C.ref.loc15_17: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a: %C = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %C = out_param runtime_param1 // CHECK:STDOUT: %return: ref %C = return_slot %return.param @@ -98,12 +98,12 @@ fn TestRef(b: C) { // CHECK:STDOUT: %return.patt: %C = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %C = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref.loc23_18: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %C.ref.loc23_24: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %C.ref.loc23_30: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a.param: %C = value_param runtime_param0 +// CHECK:STDOUT: %C.ref.loc23_18: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a: %C = bind_name a, %a.param // CHECK:STDOUT: %b.param: %C = value_param runtime_param1 +// CHECK:STDOUT: %C.ref.loc23_24: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %b: %C = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref %C = out_param runtime_param2 // CHECK:STDOUT: %return: ref %C = return_slot %return.param @@ -112,8 +112,8 @@ fn TestRef(b: C) { // CHECK:STDOUT: %b.patt: %C = binding_pattern b // CHECK:STDOUT: %b.param_patt: %C = value_param_pattern %b.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref.loc31: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %b.param: %C = value_param runtime_param0 +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %b: %C = bind_name b, %b.param // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -141,7 +141,6 @@ fn TestRef(b: C) { // CHECK:STDOUT: // CHECK:STDOUT: fn @TestRef(%b.param_patt: %C) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %C.ref.loc32: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a.var: ref %C = var a // CHECK:STDOUT: %a: ref %C = bind_name a, %a.var // CHECK:STDOUT: %.loc32_15.1: %empty_struct_type = struct_literal () diff --git a/toolchain/check/testdata/operators/overloaded/fail_no_impl_for_arg.carbon b/toolchain/check/testdata/operators/overloaded/fail_no_impl_for_arg.carbon index 6ea10283ce257..41b12049f7ce7 100644 --- a/toolchain/check/testdata/operators/overloaded/fail_no_impl_for_arg.carbon +++ b/toolchain/check/testdata/operators/overloaded/fail_no_impl_for_arg.carbon @@ -115,12 +115,12 @@ fn TestAssign(b: D) { // CHECK:STDOUT: %return.patt: %C = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %C = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref.loc23_12: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [template = constants.%D] // CHECK:STDOUT: %C.ref.loc23_24: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a.param: %C = value_param runtime_param0 +// CHECK:STDOUT: %C.ref.loc23_12: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a: %C = bind_name a, %a.param // CHECK:STDOUT: %b.param: %D = value_param runtime_param1 +// CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [template = constants.%D] // CHECK:STDOUT: %b: %D = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref %C = out_param runtime_param2 // CHECK:STDOUT: %return: ref %C = return_slot %return.param @@ -129,8 +129,8 @@ fn TestAssign(b: D) { // CHECK:STDOUT: %b.patt: %D = binding_pattern b // CHECK:STDOUT: %b.param_patt: %D = value_param_pattern %b.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [template = constants.%D] // CHECK:STDOUT: %b.param: %D = value_param runtime_param0 +// CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [template = constants.%D] // CHECK:STDOUT: %b: %D = bind_name b, %b.param // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -144,12 +144,12 @@ fn TestAssign(b: D) { // CHECK:STDOUT: %return.patt: %C = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %C = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref.loc17_15: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %C.ref.loc17_25: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %C.ref.loc17_31: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %self.param: %C = value_param runtime_param0 +// CHECK:STDOUT: %C.ref.loc17_15: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %self: %C = bind_name self, %self.param // CHECK:STDOUT: %other.param: %C = value_param runtime_param1 +// CHECK:STDOUT: %C.ref.loc17_25: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %other: %C = bind_name other, %other.param // CHECK:STDOUT: %return.param: ref %C = out_param runtime_param2 // CHECK:STDOUT: %return: ref %C = return_slot %return.param @@ -165,16 +165,18 @@ fn TestAssign(b: D) { // CHECK:STDOUT: %Op.decl: %Op.type.3 = fn_decl @Op.3 [template = constants.%Op.3] { // CHECK:STDOUT: %self.patt: %ptr.1 = binding_pattern self // CHECK:STDOUT: %self.param_patt: %ptr.1 = value_param_pattern %self.patt, runtime_param0 -// CHECK:STDOUT: %.loc20: auto = addr_pattern %self.param_patt +// CHECK:STDOUT: %.loc20_9: auto = addr_pattern %self.param_patt // CHECK:STDOUT: %other.patt: %C = binding_pattern other // CHECK:STDOUT: %other.param_patt: %C = value_param_pattern %other.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref.loc20_20: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %ptr: type = ptr_type %C [template = constants.%ptr.1] -// CHECK:STDOUT: %C.ref.loc20_31: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %self.param: %ptr.1 = value_param runtime_param0 +// CHECK:STDOUT: %.loc20_21: type = splice_block %ptr [template = constants.%ptr.1] { +// CHECK:STDOUT: %C.ref.loc20_20: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %ptr: type = ptr_type %C [template = constants.%ptr.1] +// CHECK:STDOUT: } // CHECK:STDOUT: %self: %ptr.1 = bind_name self, %self.param // CHECK:STDOUT: %other.param: %C = value_param runtime_param1 +// CHECK:STDOUT: %C.ref.loc20_31: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %other: %C = bind_name other, %other.param // CHECK:STDOUT: } // CHECK:STDOUT: %interface: = interface_witness (%Op.decl) [template = constants.%interface.2] @@ -218,7 +220,6 @@ fn TestAssign(b: D) { // CHECK:STDOUT: // CHECK:STDOUT: fn @TestAssign(%b.param_patt: %D) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a.var: ref %C = var a // CHECK:STDOUT: %a: ref %C = bind_name a, %a.var // CHECK:STDOUT: %.loc38_15.1: %empty_struct_type = struct_literal () diff --git a/toolchain/check/testdata/operators/overloaded/implicit_as.carbon b/toolchain/check/testdata/operators/overloaded/implicit_as.carbon index b6be4861d8b98..0351e99104f00 100644 --- a/toolchain/check/testdata/operators/overloaded/implicit_as.carbon +++ b/toolchain/check/testdata/operators/overloaded/implicit_as.carbon @@ -112,17 +112,19 @@ fn Test() { // CHECK:STDOUT: %n.patt: %i32 = binding_pattern n // CHECK:STDOUT: %n.param_patt: %i32 = value_param_pattern %n.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %n.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc25: type = splice_block %i32 [template = constants.%i32] { +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %n: %i32 = bind_name n, %n.param // CHECK:STDOUT: } // CHECK:STDOUT: %Sink_X.decl: %Sink_X.type = fn_decl @Sink_X [template = constants.%Sink_X] { // CHECK:STDOUT: %x.patt: %X = binding_pattern x // CHECK:STDOUT: %x.param_patt: %X = value_param_pattern %x.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [template = constants.%X] // CHECK:STDOUT: %x.param: %X = value_param runtime_param0 +// CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [template = constants.%X] // CHECK:STDOUT: %x: %X = bind_name x, %x.param // CHECK:STDOUT: } // CHECK:STDOUT: %Source.decl: %Source.type = fn_decl @Source [template = constants.%Source] { @@ -147,10 +149,12 @@ fn Test() { // CHECK:STDOUT: %return.patt: %X = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %X = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [template = constants.%X] // CHECK:STDOUT: %self.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc16_20: type = splice_block %i32 [template = constants.%i32] { +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %self: %i32 = bind_name self, %self.param // CHECK:STDOUT: %return.param: ref %X = out_param runtime_param1 // CHECK:STDOUT: %return: ref %X = return_slot %return.param @@ -169,10 +173,10 @@ fn Test() { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [template = constants.%X] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %self.param: %X = value_param runtime_param0 +// CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [template = constants.%X] // CHECK:STDOUT: %self: %X = bind_name self, %self.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -185,8 +189,6 @@ fn Test() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @X { -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc12: %X.elem = field_decl n, element0 [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.n [template = constants.%complete_type.3] // CHECK:STDOUT: diff --git a/toolchain/check/testdata/operators/overloaded/inc.carbon b/toolchain/check/testdata/operators/overloaded/inc.carbon index ff7d9a6b5ef8f..e45cb71c94d22 100644 --- a/toolchain/check/testdata/operators/overloaded/inc.carbon +++ b/toolchain/check/testdata/operators/overloaded/inc.carbon @@ -70,11 +70,13 @@ fn TestOp() { // CHECK:STDOUT: %Op.decl: %Op.type.1 = fn_decl @Op.1 [template = constants.%Op.1] { // CHECK:STDOUT: %self.patt: %ptr.1 = binding_pattern self // CHECK:STDOUT: %self.param_patt: %ptr.1 = value_param_pattern %self.patt, runtime_param0 -// CHECK:STDOUT: %.loc18: auto = addr_pattern %self.param_patt +// CHECK:STDOUT: %.loc18_9: auto = addr_pattern %self.param_patt // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %ptr: type = ptr_type %C [template = constants.%ptr.1] // CHECK:STDOUT: %self.param: %ptr.1 = value_param runtime_param0 +// CHECK:STDOUT: %.loc18_21: type = splice_block %ptr [template = constants.%ptr.1] { +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %ptr: type = ptr_type %C [template = constants.%ptr.1] +// CHECK:STDOUT: } // CHECK:STDOUT: %self: %ptr.1 = bind_name self, %self.param // CHECK:STDOUT: } // CHECK:STDOUT: %interface: = interface_witness (%Op.decl) [template = constants.%interface] @@ -96,7 +98,6 @@ fn TestOp() { // CHECK:STDOUT: // CHECK:STDOUT: fn @TestOp() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %c.var: ref %C = var c // CHECK:STDOUT: %c: ref %C = bind_name c, %c.var // CHECK:STDOUT: %.loc22_15.1: %empty_struct_type = struct_literal () diff --git a/toolchain/check/testdata/operators/overloaded/index.carbon b/toolchain/check/testdata/operators/overloaded/index.carbon index 55f0e87a0dd22..d3bf0975fabda 100644 --- a/toolchain/check/testdata/operators/overloaded/index.carbon +++ b/toolchain/check/testdata/operators/overloaded/index.carbon @@ -127,9 +127,6 @@ let x: i32 = c[0]; // CHECK:STDOUT: %ElementType.ref: type = name_ref ElementType, file.%ElementType.decl [template = constants.%ElementType.1] // CHECK:STDOUT: %IndexWith.type: type = facet_type <@IndexWith, @IndexWith(constants.%SubscriptType.1, constants.%ElementType.1)> [template = constants.%IndexWith.type.3] // CHECK:STDOUT: } -// CHECK:STDOUT: %SubscriptType.ref: type = name_ref SubscriptType, %SubscriptType.decl [template = constants.%SubscriptType.1] -// CHECK:STDOUT: %C.ref: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %ElementType.ref: type = name_ref ElementType, %ElementType.decl [template = constants.%ElementType.1] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl: %C.ref as %IndexWith.type { @@ -141,12 +138,12 @@ let x: i32 = c[0]; // CHECK:STDOUT: %return.patt: %ElementType.1 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %ElementType.1 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref: type = name_ref Self, @impl.%C.ref [template = constants.%C] -// CHECK:STDOUT: %SubscriptType.ref: type = name_ref SubscriptType, file.%SubscriptType.decl [template = constants.%SubscriptType.1] // CHECK:STDOUT: %ElementType.ref: type = name_ref ElementType, file.%ElementType.decl [template = constants.%ElementType.1] // CHECK:STDOUT: %self.param: %C = value_param runtime_param0 +// CHECK:STDOUT: %Self.ref: type = name_ref Self, @impl.%C.ref [template = constants.%C] // CHECK:STDOUT: %self: %C = bind_name self, %self.param // CHECK:STDOUT: %subscript.param: %SubscriptType.1 = value_param runtime_param1 +// CHECK:STDOUT: %SubscriptType.ref: type = name_ref SubscriptType, file.%SubscriptType.decl [template = constants.%SubscriptType.1] // CHECK:STDOUT: %subscript: %SubscriptType.1 = bind_name subscript, %subscript.param // CHECK:STDOUT: %return.param: ref %ElementType.1 = out_param runtime_param2 // CHECK:STDOUT: %return: ref %ElementType.1 = return_slot %return.param @@ -285,14 +282,6 @@ let x: i32 = c[0]; // CHECK:STDOUT: %i32.loc4_40: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %IndexWith.type: type = facet_type <@IndexWith, @IndexWith(constants.%i32, constants.%i32)> [template = constants.%IndexWith.type.3] // CHECK:STDOUT: } -// CHECK:STDOUT: %int_32.loc10_9: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc10_9: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc10_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc10_14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc10_17.1: %tuple.type.1 = tuple_literal (%i32.loc10_9, %i32.loc10_14) -// CHECK:STDOUT: %.loc10_17.2: type = converted %.loc10_17.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] -// CHECK:STDOUT: %int_32.loc11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.1: %.loc4_15.2 as %IndexWith.type { @@ -304,14 +293,16 @@ let x: i32 = c[0]; // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref: type = name_ref Self, @impl.1.%.loc4_15.2 [template = constants.%tuple.type.2] -// CHECK:STDOUT: %int_32.loc5_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc5_32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc5_40: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc5_40: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %self.param: %tuple.type.2 = value_param runtime_param0 +// CHECK:STDOUT: %Self.ref: type = name_ref Self, @impl.1.%.loc4_15.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %self: %tuple.type.2 = bind_name self, %self.param // CHECK:STDOUT: %subscript.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %.loc5: type = splice_block %i32.loc5_32 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc5_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc5_32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %subscript: %i32 = bind_name subscript, %subscript.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -419,8 +410,6 @@ let x: i32 = c[0]; // CHECK:STDOUT: %ElementType.ref: type = name_ref ElementType, file.%ElementType.decl [template = constants.%ElementType.1] // CHECK:STDOUT: %IndexWith.type: type = facet_type <@IndexWith, @IndexWith(constants.%SubscriptType.1, constants.%ElementType.1)> [template = constants.%IndexWith.type.3] // CHECK:STDOUT: } -// CHECK:STDOUT: %C.ref: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %ElementType.ref: type = name_ref ElementType, %ElementType.decl [template = constants.%ElementType.1] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl: %C.ref as %IndexWith.type { @@ -432,12 +421,12 @@ let x: i32 = c[0]; // CHECK:STDOUT: %return.patt: %ElementType.1 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %ElementType.1 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref: type = name_ref Self, @impl.%C.ref [template = constants.%C] -// CHECK:STDOUT: %SubscriptType.ref: type = name_ref SubscriptType, file.%SubscriptType.decl [template = constants.%SubscriptType.1] // CHECK:STDOUT: %ElementType.ref: type = name_ref ElementType, file.%ElementType.decl [template = constants.%ElementType.1] // CHECK:STDOUT: %self.param: %C = value_param runtime_param0 +// CHECK:STDOUT: %Self.ref: type = name_ref Self, @impl.%C.ref [template = constants.%C] // CHECK:STDOUT: %self: %C = bind_name self, %self.param // CHECK:STDOUT: %subscript.param: %SubscriptType.1 = value_param runtime_param1 +// CHECK:STDOUT: %SubscriptType.ref: type = name_ref SubscriptType, file.%SubscriptType.decl [template = constants.%SubscriptType.1] // CHECK:STDOUT: %subscript: %SubscriptType.1 = bind_name subscript, %subscript.param // CHECK:STDOUT: %return.param: ref %ElementType.1 = out_param runtime_param2 // CHECK:STDOUT: %return: ref %ElementType.1 = return_slot %return.param @@ -533,9 +522,6 @@ let x: i32 = c[0]; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {} -// CHECK:STDOUT: %C.ref: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { diff --git a/toolchain/check/testdata/operators/overloaded/left_shift.carbon b/toolchain/check/testdata/operators/overloaded/left_shift.carbon index 044e03779f168..c4f303a181eee 100644 --- a/toolchain/check/testdata/operators/overloaded/left_shift.carbon +++ b/toolchain/check/testdata/operators/overloaded/left_shift.carbon @@ -94,12 +94,12 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %return.patt: %C = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %C = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref.loc26_14: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %C.ref.loc26_20: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %C.ref.loc26_26: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a.param: %C = value_param runtime_param0 +// CHECK:STDOUT: %C.ref.loc26_14: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a: %C = bind_name a, %a.param // CHECK:STDOUT: %b.param: %C = value_param runtime_param1 +// CHECK:STDOUT: %C.ref.loc26_20: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %b: %C = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref %C = out_param runtime_param2 // CHECK:STDOUT: %return: ref %C = return_slot %return.param @@ -110,12 +110,14 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %b.patt: %C = binding_pattern b // CHECK:STDOUT: %b.param_patt: %C = value_param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref.loc30_18: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %ptr: type = ptr_type %C [template = constants.%ptr.2] -// CHECK:STDOUT: %C.ref.loc30_25: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a.param: %ptr.2 = value_param runtime_param0 +// CHECK:STDOUT: %.loc30: type = splice_block %ptr [template = constants.%ptr.2] { +// CHECK:STDOUT: %C.ref.loc30_18: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %ptr: type = ptr_type %C [template = constants.%ptr.2] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %ptr.2 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %C = value_param runtime_param1 +// CHECK:STDOUT: %C.ref.loc30_25: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %b: %C = bind_name b, %b.param // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -129,12 +131,12 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %return.patt: %C = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %C = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref.loc18_15: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %C.ref.loc18_25: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %C.ref.loc18_31: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %self.param: %C = value_param runtime_param0 +// CHECK:STDOUT: %C.ref.loc18_15: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %self: %C = bind_name self, %self.param // CHECK:STDOUT: %other.param: %C = value_param runtime_param1 +// CHECK:STDOUT: %C.ref.loc18_25: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %other: %C = bind_name other, %other.param // CHECK:STDOUT: %return.param: ref %C = out_param runtime_param2 // CHECK:STDOUT: %return: ref %C = return_slot %return.param @@ -150,16 +152,18 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %Op.decl: %Op.type.3 = fn_decl @Op.3 [template = constants.%Op.3] { // CHECK:STDOUT: %self.patt: %ptr.2 = binding_pattern self // CHECK:STDOUT: %self.param_patt: %ptr.2 = value_param_pattern %self.patt, runtime_param0 -// CHECK:STDOUT: %.loc23: auto = addr_pattern %self.param_patt +// CHECK:STDOUT: %.loc23_9: auto = addr_pattern %self.param_patt // CHECK:STDOUT: %other.patt: %C = binding_pattern other // CHECK:STDOUT: %other.param_patt: %C = value_param_pattern %other.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref.loc23_20: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %ptr: type = ptr_type %C [template = constants.%ptr.2] -// CHECK:STDOUT: %C.ref.loc23_31: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %self.param: %ptr.2 = value_param runtime_param0 +// CHECK:STDOUT: %.loc23_21: type = splice_block %ptr [template = constants.%ptr.2] { +// CHECK:STDOUT: %C.ref.loc23_20: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %ptr: type = ptr_type %C [template = constants.%ptr.2] +// CHECK:STDOUT: } // CHECK:STDOUT: %self: %ptr.2 = bind_name self, %self.param // CHECK:STDOUT: %other.param: %C = value_param runtime_param1 +// CHECK:STDOUT: %C.ref.loc23_31: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %other: %C = bind_name other, %other.param // CHECK:STDOUT: } // CHECK:STDOUT: %interface: = interface_witness (%Op.decl) [template = constants.%interface.2] diff --git a/toolchain/check/testdata/operators/overloaded/mod.carbon b/toolchain/check/testdata/operators/overloaded/mod.carbon index f73b6d63b7505..de66d0dedf23a 100644 --- a/toolchain/check/testdata/operators/overloaded/mod.carbon +++ b/toolchain/check/testdata/operators/overloaded/mod.carbon @@ -94,12 +94,12 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %return.patt: %C = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %C = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref.loc26_14: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %C.ref.loc26_20: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %C.ref.loc26_26: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a.param: %C = value_param runtime_param0 +// CHECK:STDOUT: %C.ref.loc26_14: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a: %C = bind_name a, %a.param // CHECK:STDOUT: %b.param: %C = value_param runtime_param1 +// CHECK:STDOUT: %C.ref.loc26_20: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %b: %C = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref %C = out_param runtime_param2 // CHECK:STDOUT: %return: ref %C = return_slot %return.param @@ -110,12 +110,14 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %b.patt: %C = binding_pattern b // CHECK:STDOUT: %b.param_patt: %C = value_param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref.loc30_18: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %ptr: type = ptr_type %C [template = constants.%ptr.2] -// CHECK:STDOUT: %C.ref.loc30_25: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a.param: %ptr.2 = value_param runtime_param0 +// CHECK:STDOUT: %.loc30: type = splice_block %ptr [template = constants.%ptr.2] { +// CHECK:STDOUT: %C.ref.loc30_18: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %ptr: type = ptr_type %C [template = constants.%ptr.2] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %ptr.2 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %C = value_param runtime_param1 +// CHECK:STDOUT: %C.ref.loc30_25: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %b: %C = bind_name b, %b.param // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -129,12 +131,12 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %return.patt: %C = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %C = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref.loc18_15: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %C.ref.loc18_25: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %C.ref.loc18_31: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %self.param: %C = value_param runtime_param0 +// CHECK:STDOUT: %C.ref.loc18_15: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %self: %C = bind_name self, %self.param // CHECK:STDOUT: %other.param: %C = value_param runtime_param1 +// CHECK:STDOUT: %C.ref.loc18_25: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %other: %C = bind_name other, %other.param // CHECK:STDOUT: %return.param: ref %C = out_param runtime_param2 // CHECK:STDOUT: %return: ref %C = return_slot %return.param @@ -150,16 +152,18 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %Op.decl: %Op.type.3 = fn_decl @Op.3 [template = constants.%Op.3] { // CHECK:STDOUT: %self.patt: %ptr.2 = binding_pattern self // CHECK:STDOUT: %self.param_patt: %ptr.2 = value_param_pattern %self.patt, runtime_param0 -// CHECK:STDOUT: %.loc23: auto = addr_pattern %self.param_patt +// CHECK:STDOUT: %.loc23_9: auto = addr_pattern %self.param_patt // CHECK:STDOUT: %other.patt: %C = binding_pattern other // CHECK:STDOUT: %other.param_patt: %C = value_param_pattern %other.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref.loc23_20: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %ptr: type = ptr_type %C [template = constants.%ptr.2] -// CHECK:STDOUT: %C.ref.loc23_31: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %self.param: %ptr.2 = value_param runtime_param0 +// CHECK:STDOUT: %.loc23_21: type = splice_block %ptr [template = constants.%ptr.2] { +// CHECK:STDOUT: %C.ref.loc23_20: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %ptr: type = ptr_type %C [template = constants.%ptr.2] +// CHECK:STDOUT: } // CHECK:STDOUT: %self: %ptr.2 = bind_name self, %self.param // CHECK:STDOUT: %other.param: %C = value_param runtime_param1 +// CHECK:STDOUT: %C.ref.loc23_31: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %other: %C = bind_name other, %other.param // CHECK:STDOUT: } // CHECK:STDOUT: %interface: = interface_witness (%Op.decl) [template = constants.%interface.2] diff --git a/toolchain/check/testdata/operators/overloaded/mul.carbon b/toolchain/check/testdata/operators/overloaded/mul.carbon index f013f13526c62..32679475c9192 100644 --- a/toolchain/check/testdata/operators/overloaded/mul.carbon +++ b/toolchain/check/testdata/operators/overloaded/mul.carbon @@ -94,12 +94,12 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %return.patt: %C = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %C = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref.loc26_14: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %C.ref.loc26_20: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %C.ref.loc26_26: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a.param: %C = value_param runtime_param0 +// CHECK:STDOUT: %C.ref.loc26_14: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a: %C = bind_name a, %a.param // CHECK:STDOUT: %b.param: %C = value_param runtime_param1 +// CHECK:STDOUT: %C.ref.loc26_20: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %b: %C = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref %C = out_param runtime_param2 // CHECK:STDOUT: %return: ref %C = return_slot %return.param @@ -110,12 +110,14 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %b.patt: %C = binding_pattern b // CHECK:STDOUT: %b.param_patt: %C = value_param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref.loc30_18: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %ptr: type = ptr_type %C [template = constants.%ptr.2] -// CHECK:STDOUT: %C.ref.loc30_25: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a.param: %ptr.2 = value_param runtime_param0 +// CHECK:STDOUT: %.loc30: type = splice_block %ptr [template = constants.%ptr.2] { +// CHECK:STDOUT: %C.ref.loc30_18: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %ptr: type = ptr_type %C [template = constants.%ptr.2] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %ptr.2 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %C = value_param runtime_param1 +// CHECK:STDOUT: %C.ref.loc30_25: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %b: %C = bind_name b, %b.param // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -129,12 +131,12 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %return.patt: %C = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %C = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref.loc18_15: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %C.ref.loc18_25: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %C.ref.loc18_31: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %self.param: %C = value_param runtime_param0 +// CHECK:STDOUT: %C.ref.loc18_15: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %self: %C = bind_name self, %self.param // CHECK:STDOUT: %other.param: %C = value_param runtime_param1 +// CHECK:STDOUT: %C.ref.loc18_25: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %other: %C = bind_name other, %other.param // CHECK:STDOUT: %return.param: ref %C = out_param runtime_param2 // CHECK:STDOUT: %return: ref %C = return_slot %return.param @@ -150,16 +152,18 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %Op.decl: %Op.type.3 = fn_decl @Op.3 [template = constants.%Op.3] { // CHECK:STDOUT: %self.patt: %ptr.2 = binding_pattern self // CHECK:STDOUT: %self.param_patt: %ptr.2 = value_param_pattern %self.patt, runtime_param0 -// CHECK:STDOUT: %.loc23: auto = addr_pattern %self.param_patt +// CHECK:STDOUT: %.loc23_9: auto = addr_pattern %self.param_patt // CHECK:STDOUT: %other.patt: %C = binding_pattern other // CHECK:STDOUT: %other.param_patt: %C = value_param_pattern %other.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref.loc23_20: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %ptr: type = ptr_type %C [template = constants.%ptr.2] -// CHECK:STDOUT: %C.ref.loc23_31: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %self.param: %ptr.2 = value_param runtime_param0 +// CHECK:STDOUT: %.loc23_21: type = splice_block %ptr [template = constants.%ptr.2] { +// CHECK:STDOUT: %C.ref.loc23_20: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %ptr: type = ptr_type %C [template = constants.%ptr.2] +// CHECK:STDOUT: } // CHECK:STDOUT: %self: %ptr.2 = bind_name self, %self.param // CHECK:STDOUT: %other.param: %C = value_param runtime_param1 +// CHECK:STDOUT: %C.ref.loc23_31: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %other: %C = bind_name other, %other.param // CHECK:STDOUT: } // CHECK:STDOUT: %interface: = interface_witness (%Op.decl) [template = constants.%interface.2] diff --git a/toolchain/check/testdata/operators/overloaded/negate.carbon b/toolchain/check/testdata/operators/overloaded/negate.carbon index 8c0efa78ea09b..907f48a5bae64 100644 --- a/toolchain/check/testdata/operators/overloaded/negate.carbon +++ b/toolchain/check/testdata/operators/overloaded/negate.carbon @@ -68,9 +68,9 @@ fn TestOp(a: C) -> C { // CHECK:STDOUT: %return.patt: %C = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %C = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref.loc23_14: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %C.ref.loc23_20: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a.param: %C = value_param runtime_param0 +// CHECK:STDOUT: %C.ref.loc23_14: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a: %C = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref %C = out_param runtime_param1 // CHECK:STDOUT: %return: ref %C = return_slot %return.param @@ -84,9 +84,9 @@ fn TestOp(a: C) -> C { // CHECK:STDOUT: %return.patt: %C = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %C = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref.loc18_15: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %C.ref.loc18_23: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %self.param: %C = value_param runtime_param0 +// CHECK:STDOUT: %C.ref.loc18_15: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %self: %C = bind_name self, %self.param // CHECK:STDOUT: %return.param: ref %C = out_param runtime_param1 // CHECK:STDOUT: %return: ref %C = return_slot %return.param diff --git a/toolchain/check/testdata/operators/overloaded/no_prelude/index.carbon b/toolchain/check/testdata/operators/overloaded/no_prelude/index.carbon index e97041aa4223c..35d3b87ba85d9 100644 --- a/toolchain/check/testdata/operators/overloaded/no_prelude/index.carbon +++ b/toolchain/check/testdata/operators/overloaded/no_prelude/index.carbon @@ -191,16 +191,18 @@ fn F() { ()[()]; } // CHECK:STDOUT: %return.patt: %empty_tuple.type = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %empty_tuple.type = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc6_15.1: @At.1.%IndexWith.type (%IndexWith.type.2) = specific_constant @IndexWith.%Self.1, @IndexWith(constants.%SubscriptType) [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %Self.ref: @At.1.%IndexWith.type (%IndexWith.type.2) = name_ref Self, %.loc6_15.1 [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %Self.as_type.loc6_15.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc6_15.1 (constants.%Self.as_type)] -// CHECK:STDOUT: %.loc6_15.2: type = converted %Self.ref, %Self.as_type.loc6_15.2 [symbolic = %Self.as_type.loc6_15.1 (constants.%Self.as_type)] -// CHECK:STDOUT: %SubscriptType.ref: type = name_ref SubscriptType, @IndexWith.%SubscriptType.loc5_26.1 [symbolic = %SubscriptType (constants.%SubscriptType)] // CHECK:STDOUT: %.loc6_51.1: %empty_tuple.type = tuple_literal () // CHECK:STDOUT: %.loc6_51.2: type = converted %.loc6_51.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %self.param: @At.1.%Self.as_type.loc6_15.1 (%Self.as_type) = value_param runtime_param0 +// CHECK:STDOUT: %.loc6_15.3: type = splice_block %.loc6_15.2 [symbolic = %Self.as_type.loc6_15.1 (constants.%Self.as_type)] { +// CHECK:STDOUT: %.loc6_15.1: @At.1.%IndexWith.type (%IndexWith.type.2) = specific_constant @IndexWith.%Self.1, @IndexWith(constants.%SubscriptType) [symbolic = %Self (constants.%Self)] +// CHECK:STDOUT: %Self.ref: @At.1.%IndexWith.type (%IndexWith.type.2) = name_ref Self, %.loc6_15.1 [symbolic = %Self (constants.%Self)] +// CHECK:STDOUT: %Self.as_type.loc6_15.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc6_15.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %.loc6_15.2: type = converted %Self.ref, %Self.as_type.loc6_15.2 [symbolic = %Self.as_type.loc6_15.1 (constants.%Self.as_type)] +// CHECK:STDOUT: } // CHECK:STDOUT: %self: @At.1.%Self.as_type.loc6_15.1 (%Self.as_type) = bind_name self, %self.param // CHECK:STDOUT: %subscript.param: @At.1.%SubscriptType (%SubscriptType) = value_param runtime_param1 +// CHECK:STDOUT: %SubscriptType.ref: type = name_ref SubscriptType, @IndexWith.%SubscriptType.loc5_26.1 [symbolic = %SubscriptType (constants.%SubscriptType)] // CHECK:STDOUT: %subscript: @At.1.%SubscriptType (%SubscriptType) = bind_name subscript, %subscript.param // CHECK:STDOUT: %return.param: ref %empty_tuple.type = out_param runtime_param2 // CHECK:STDOUT: %return: ref %empty_tuple.type = return_slot %return.param @@ -223,14 +225,16 @@ fn F() { ()[()]; } // CHECK:STDOUT: %return.patt: %empty_tuple.type = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %empty_tuple.type = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref: type = name_ref Self, @impl.%.loc9_7.2 [template = constants.%empty_tuple.type] -// CHECK:STDOUT: %.loc10_33.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc10_33.2: type = converted %.loc10_33.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %.loc10_40.1: %empty_tuple.type = tuple_literal () // CHECK:STDOUT: %.loc10_40.2: type = converted %.loc10_40.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %self.param: %empty_tuple.type = value_param runtime_param0 +// CHECK:STDOUT: %Self.ref: type = name_ref Self, @impl.%.loc9_7.2 [template = constants.%empty_tuple.type] // CHECK:STDOUT: %self: %empty_tuple.type = bind_name self, %self.param // CHECK:STDOUT: %subscript.param: %empty_tuple.type = value_param runtime_param1 +// CHECK:STDOUT: %.loc10_33.3: type = splice_block %.loc10_33.2 [template = constants.%empty_tuple.type] { +// CHECK:STDOUT: %.loc10_33.1: %empty_tuple.type = tuple_literal () +// CHECK:STDOUT: %.loc10_33.2: type = converted %.loc10_33.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] +// CHECK:STDOUT: } // CHECK:STDOUT: %subscript: %empty_tuple.type = bind_name subscript, %subscript.param // CHECK:STDOUT: %return.param: ref %empty_tuple.type = out_param runtime_param2 // CHECK:STDOUT: %return: ref %empty_tuple.type = return_slot %return.param diff --git a/toolchain/check/testdata/operators/overloaded/ordered.carbon b/toolchain/check/testdata/operators/overloaded/ordered.carbon index 25ca32ecca90a..c031b4f32103b 100644 --- a/toolchain/check/testdata/operators/overloaded/ordered.carbon +++ b/toolchain/check/testdata/operators/overloaded/ordered.carbon @@ -140,14 +140,14 @@ fn TestGreaterEqual(a: D, b: D) -> bool { // CHECK:STDOUT: %return.patt: bool = return_slot_pattern // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref.loc13_16: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %C.ref.loc13_22: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc13_28.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc13_28.2: type = converted %bool.make_type, %.loc13_28.1 [template = bool] // CHECK:STDOUT: %a.param: %C = value_param runtime_param0 +// CHECK:STDOUT: %C.ref.loc13_16: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a: %C = bind_name a, %a.param // CHECK:STDOUT: %b.param: %C = value_param runtime_param1 +// CHECK:STDOUT: %C.ref.loc13_22: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %b: %C = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param @@ -160,14 +160,14 @@ fn TestGreaterEqual(a: D, b: D) -> bool { // CHECK:STDOUT: %return.patt: bool = return_slot_pattern // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref.loc17_21: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %C.ref.loc17_27: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc17_33.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc17_33.2: type = converted %bool.make_type, %.loc17_33.1 [template = bool] // CHECK:STDOUT: %a.param: %C = value_param runtime_param0 +// CHECK:STDOUT: %C.ref.loc17_21: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a: %C = bind_name a, %a.param // CHECK:STDOUT: %b.param: %C = value_param runtime_param1 +// CHECK:STDOUT: %C.ref.loc17_27: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %b: %C = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param @@ -180,14 +180,14 @@ fn TestGreaterEqual(a: D, b: D) -> bool { // CHECK:STDOUT: %return.patt: bool = return_slot_pattern // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref.loc21_19: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %C.ref.loc21_25: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc21_31.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc21_31.2: type = converted %bool.make_type, %.loc21_31.1 [template = bool] // CHECK:STDOUT: %a.param: %C = value_param runtime_param0 +// CHECK:STDOUT: %C.ref.loc21_19: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a: %C = bind_name a, %a.param // CHECK:STDOUT: %b.param: %C = value_param runtime_param1 +// CHECK:STDOUT: %C.ref.loc21_25: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %b: %C = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param @@ -200,14 +200,14 @@ fn TestGreaterEqual(a: D, b: D) -> bool { // CHECK:STDOUT: %return.patt: bool = return_slot_pattern // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref.loc25_24: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %C.ref.loc25_30: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc25_36.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc25_36.2: type = converted %bool.make_type, %.loc25_36.1 [template = bool] // CHECK:STDOUT: %a.param: %C = value_param runtime_param0 +// CHECK:STDOUT: %C.ref.loc25_24: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a: %C = bind_name a, %a.param // CHECK:STDOUT: %b.param: %C = value_param runtime_param1 +// CHECK:STDOUT: %C.ref.loc25_30: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %b: %C = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param @@ -223,14 +223,14 @@ fn TestGreaterEqual(a: D, b: D) -> bool { // CHECK:STDOUT: %return.patt: bool = return_slot_pattern // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref.loc7_17: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %C.ref.loc7_27: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc7_33.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc7_33.2: type = converted %bool.make_type, %.loc7_33.1 [template = bool] // CHECK:STDOUT: %self.param: %C = value_param runtime_param0 +// CHECK:STDOUT: %C.ref.loc7_17: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %self: %C = bind_name self, %self.param // CHECK:STDOUT: %other.param: %C = value_param runtime_param1 +// CHECK:STDOUT: %C.ref.loc7_27: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %other: %C = bind_name other, %other.param // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param @@ -243,14 +243,14 @@ fn TestGreaterEqual(a: D, b: D) -> bool { // CHECK:STDOUT: %return.patt: bool = return_slot_pattern // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref.loc8_29: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %C.ref.loc8_39: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc8_45.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc8_45.2: type = converted %bool.make_type, %.loc8_45.1 [template = bool] // CHECK:STDOUT: %self.param: %C = value_param runtime_param0 +// CHECK:STDOUT: %C.ref.loc8_29: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %self: %C = bind_name self, %self.param // CHECK:STDOUT: %other.param: %C = value_param runtime_param1 +// CHECK:STDOUT: %C.ref.loc8_39: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %other: %C = bind_name other, %other.param // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param @@ -263,14 +263,14 @@ fn TestGreaterEqual(a: D, b: D) -> bool { // CHECK:STDOUT: %return.patt: bool = return_slot_pattern // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref.loc9_20: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %C.ref.loc9_30: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc9_36.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc9_36.2: type = converted %bool.make_type, %.loc9_36.1 [template = bool] // CHECK:STDOUT: %self.param: %C = value_param runtime_param0 +// CHECK:STDOUT: %C.ref.loc9_20: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %self: %C = bind_name self, %self.param // CHECK:STDOUT: %other.param: %C = value_param runtime_param1 +// CHECK:STDOUT: %C.ref.loc9_30: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %other: %C = bind_name other, %other.param // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param @@ -283,14 +283,14 @@ fn TestGreaterEqual(a: D, b: D) -> bool { // CHECK:STDOUT: %return.patt: bool = return_slot_pattern // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref.loc10_32: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %C.ref.loc10_42: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc10_48.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc10_48.2: type = converted %bool.make_type, %.loc10_48.1 [template = bool] // CHECK:STDOUT: %self.param: %C = value_param runtime_param0 +// CHECK:STDOUT: %C.ref.loc10_32: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %self: %C = bind_name self, %self.param // CHECK:STDOUT: %other.param: %C = value_param runtime_param1 +// CHECK:STDOUT: %C.ref.loc10_42: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %other: %C = bind_name other, %other.param // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param @@ -415,14 +415,14 @@ fn TestGreaterEqual(a: D, b: D) -> bool { // CHECK:STDOUT: %return.patt: bool = return_slot_pattern // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %D.ref.loc6_16: type = name_ref D, file.%D.decl [template = constants.%D] -// CHECK:STDOUT: %D.ref.loc6_22: type = name_ref D, file.%D.decl [template = constants.%D] // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc6_28.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc6_28.2: type = converted %bool.make_type, %.loc6_28.1 [template = bool] // CHECK:STDOUT: %a.param: %D = value_param runtime_param0 +// CHECK:STDOUT: %D.ref.loc6_16: type = name_ref D, file.%D.decl [template = constants.%D] // CHECK:STDOUT: %a: %D = bind_name a, %a.param // CHECK:STDOUT: %b.param: %D = value_param runtime_param1 +// CHECK:STDOUT: %D.ref.loc6_22: type = name_ref D, file.%D.decl [template = constants.%D] // CHECK:STDOUT: %b: %D = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param @@ -435,14 +435,14 @@ fn TestGreaterEqual(a: D, b: D) -> bool { // CHECK:STDOUT: %return.patt: bool = return_slot_pattern // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %D.ref.loc14_21: type = name_ref D, file.%D.decl [template = constants.%D] -// CHECK:STDOUT: %D.ref.loc14_27: type = name_ref D, file.%D.decl [template = constants.%D] // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc14_33.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc14_33.2: type = converted %bool.make_type, %.loc14_33.1 [template = bool] // CHECK:STDOUT: %a.param: %D = value_param runtime_param0 +// CHECK:STDOUT: %D.ref.loc14_21: type = name_ref D, file.%D.decl [template = constants.%D] // CHECK:STDOUT: %a: %D = bind_name a, %a.param // CHECK:STDOUT: %b.param: %D = value_param runtime_param1 +// CHECK:STDOUT: %D.ref.loc14_27: type = name_ref D, file.%D.decl [template = constants.%D] // CHECK:STDOUT: %b: %D = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param @@ -455,14 +455,14 @@ fn TestGreaterEqual(a: D, b: D) -> bool { // CHECK:STDOUT: %return.patt: bool = return_slot_pattern // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %D.ref.loc22_19: type = name_ref D, file.%D.decl [template = constants.%D] -// CHECK:STDOUT: %D.ref.loc22_25: type = name_ref D, file.%D.decl [template = constants.%D] // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc22_31.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc22_31.2: type = converted %bool.make_type, %.loc22_31.1 [template = bool] // CHECK:STDOUT: %a.param: %D = value_param runtime_param0 +// CHECK:STDOUT: %D.ref.loc22_19: type = name_ref D, file.%D.decl [template = constants.%D] // CHECK:STDOUT: %a: %D = bind_name a, %a.param // CHECK:STDOUT: %b.param: %D = value_param runtime_param1 +// CHECK:STDOUT: %D.ref.loc22_25: type = name_ref D, file.%D.decl [template = constants.%D] // CHECK:STDOUT: %b: %D = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param @@ -475,14 +475,14 @@ fn TestGreaterEqual(a: D, b: D) -> bool { // CHECK:STDOUT: %return.patt: bool = return_slot_pattern // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %D.ref.loc30_24: type = name_ref D, file.%D.decl [template = constants.%D] -// CHECK:STDOUT: %D.ref.loc30_30: type = name_ref D, file.%D.decl [template = constants.%D] // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc30_36.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc30_36.2: type = converted %bool.make_type, %.loc30_36.1 [template = bool] // CHECK:STDOUT: %a.param: %D = value_param runtime_param0 +// CHECK:STDOUT: %D.ref.loc30_24: type = name_ref D, file.%D.decl [template = constants.%D] // CHECK:STDOUT: %a: %D = bind_name a, %a.param // CHECK:STDOUT: %b.param: %D = value_param runtime_param1 +// CHECK:STDOUT: %D.ref.loc30_30: type = name_ref D, file.%D.decl [template = constants.%D] // CHECK:STDOUT: %b: %D = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param diff --git a/toolchain/check/testdata/operators/overloaded/right_shift.carbon b/toolchain/check/testdata/operators/overloaded/right_shift.carbon index 5220ab523649c..7ac3e88ea90b1 100644 --- a/toolchain/check/testdata/operators/overloaded/right_shift.carbon +++ b/toolchain/check/testdata/operators/overloaded/right_shift.carbon @@ -94,12 +94,12 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %return.patt: %C = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %C = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref.loc26_14: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %C.ref.loc26_20: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %C.ref.loc26_26: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a.param: %C = value_param runtime_param0 +// CHECK:STDOUT: %C.ref.loc26_14: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a: %C = bind_name a, %a.param // CHECK:STDOUT: %b.param: %C = value_param runtime_param1 +// CHECK:STDOUT: %C.ref.loc26_20: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %b: %C = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref %C = out_param runtime_param2 // CHECK:STDOUT: %return: ref %C = return_slot %return.param @@ -110,12 +110,14 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %b.patt: %C = binding_pattern b // CHECK:STDOUT: %b.param_patt: %C = value_param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref.loc30_18: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %ptr: type = ptr_type %C [template = constants.%ptr.2] -// CHECK:STDOUT: %C.ref.loc30_25: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a.param: %ptr.2 = value_param runtime_param0 +// CHECK:STDOUT: %.loc30: type = splice_block %ptr [template = constants.%ptr.2] { +// CHECK:STDOUT: %C.ref.loc30_18: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %ptr: type = ptr_type %C [template = constants.%ptr.2] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %ptr.2 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %C = value_param runtime_param1 +// CHECK:STDOUT: %C.ref.loc30_25: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %b: %C = bind_name b, %b.param // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -129,12 +131,12 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %return.patt: %C = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %C = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref.loc18_15: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %C.ref.loc18_25: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %C.ref.loc18_31: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %self.param: %C = value_param runtime_param0 +// CHECK:STDOUT: %C.ref.loc18_15: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %self: %C = bind_name self, %self.param // CHECK:STDOUT: %other.param: %C = value_param runtime_param1 +// CHECK:STDOUT: %C.ref.loc18_25: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %other: %C = bind_name other, %other.param // CHECK:STDOUT: %return.param: ref %C = out_param runtime_param2 // CHECK:STDOUT: %return: ref %C = return_slot %return.param @@ -150,16 +152,18 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %Op.decl: %Op.type.3 = fn_decl @Op.3 [template = constants.%Op.3] { // CHECK:STDOUT: %self.patt: %ptr.2 = binding_pattern self // CHECK:STDOUT: %self.param_patt: %ptr.2 = value_param_pattern %self.patt, runtime_param0 -// CHECK:STDOUT: %.loc23: auto = addr_pattern %self.param_patt +// CHECK:STDOUT: %.loc23_9: auto = addr_pattern %self.param_patt // CHECK:STDOUT: %other.patt: %C = binding_pattern other // CHECK:STDOUT: %other.param_patt: %C = value_param_pattern %other.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref.loc23_20: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %ptr: type = ptr_type %C [template = constants.%ptr.2] -// CHECK:STDOUT: %C.ref.loc23_31: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %self.param: %ptr.2 = value_param runtime_param0 +// CHECK:STDOUT: %.loc23_21: type = splice_block %ptr [template = constants.%ptr.2] { +// CHECK:STDOUT: %C.ref.loc23_20: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %ptr: type = ptr_type %C [template = constants.%ptr.2] +// CHECK:STDOUT: } // CHECK:STDOUT: %self: %ptr.2 = bind_name self, %self.param // CHECK:STDOUT: %other.param: %C = value_param runtime_param1 +// CHECK:STDOUT: %C.ref.loc23_31: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %other: %C = bind_name other, %other.param // CHECK:STDOUT: } // CHECK:STDOUT: %interface: = interface_witness (%Op.decl) [template = constants.%interface.2] diff --git a/toolchain/check/testdata/operators/overloaded/sub.carbon b/toolchain/check/testdata/operators/overloaded/sub.carbon index 9eb83cb4f16cf..f786b3edf782e 100644 --- a/toolchain/check/testdata/operators/overloaded/sub.carbon +++ b/toolchain/check/testdata/operators/overloaded/sub.carbon @@ -94,12 +94,12 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %return.patt: %C = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %C = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref.loc26_14: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %C.ref.loc26_20: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %C.ref.loc26_26: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a.param: %C = value_param runtime_param0 +// CHECK:STDOUT: %C.ref.loc26_14: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a: %C = bind_name a, %a.param // CHECK:STDOUT: %b.param: %C = value_param runtime_param1 +// CHECK:STDOUT: %C.ref.loc26_20: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %b: %C = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref %C = out_param runtime_param2 // CHECK:STDOUT: %return: ref %C = return_slot %return.param @@ -110,12 +110,14 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %b.patt: %C = binding_pattern b // CHECK:STDOUT: %b.param_patt: %C = value_param_pattern %b.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref.loc30_18: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %ptr: type = ptr_type %C [template = constants.%ptr.2] -// CHECK:STDOUT: %C.ref.loc30_25: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %a.param: %ptr.2 = value_param runtime_param0 +// CHECK:STDOUT: %.loc30: type = splice_block %ptr [template = constants.%ptr.2] { +// CHECK:STDOUT: %C.ref.loc30_18: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %ptr: type = ptr_type %C [template = constants.%ptr.2] +// CHECK:STDOUT: } // CHECK:STDOUT: %a: %ptr.2 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %C = value_param runtime_param1 +// CHECK:STDOUT: %C.ref.loc30_25: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %b: %C = bind_name b, %b.param // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -129,12 +131,12 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %return.patt: %C = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %C = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref.loc18_15: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %C.ref.loc18_25: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %C.ref.loc18_31: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %self.param: %C = value_param runtime_param0 +// CHECK:STDOUT: %C.ref.loc18_15: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %self: %C = bind_name self, %self.param // CHECK:STDOUT: %other.param: %C = value_param runtime_param1 +// CHECK:STDOUT: %C.ref.loc18_25: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %other: %C = bind_name other, %other.param // CHECK:STDOUT: %return.param: ref %C = out_param runtime_param2 // CHECK:STDOUT: %return: ref %C = return_slot %return.param @@ -150,16 +152,18 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %Op.decl: %Op.type.3 = fn_decl @Op.3 [template = constants.%Op.3] { // CHECK:STDOUT: %self.patt: %ptr.2 = binding_pattern self // CHECK:STDOUT: %self.param_patt: %ptr.2 = value_param_pattern %self.patt, runtime_param0 -// CHECK:STDOUT: %.loc23: auto = addr_pattern %self.param_patt +// CHECK:STDOUT: %.loc23_9: auto = addr_pattern %self.param_patt // CHECK:STDOUT: %other.patt: %C = binding_pattern other // CHECK:STDOUT: %other.param_patt: %C = value_param_pattern %other.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref.loc23_20: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %ptr: type = ptr_type %C [template = constants.%ptr.2] -// CHECK:STDOUT: %C.ref.loc23_31: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %self.param: %ptr.2 = value_param runtime_param0 +// CHECK:STDOUT: %.loc23_21: type = splice_block %ptr [template = constants.%ptr.2] { +// CHECK:STDOUT: %C.ref.loc23_20: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %ptr: type = ptr_type %C [template = constants.%ptr.2] +// CHECK:STDOUT: } // CHECK:STDOUT: %self: %ptr.2 = bind_name self, %self.param // CHECK:STDOUT: %other.param: %C = value_param runtime_param1 +// CHECK:STDOUT: %C.ref.loc23_31: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %other: %C = bind_name other, %other.param // CHECK:STDOUT: } // CHECK:STDOUT: %interface: = interface_witness (%Op.decl) [template = constants.%interface.2] diff --git a/toolchain/check/testdata/package_expr/fail_not_found.carbon b/toolchain/check/testdata/package_expr/fail_not_found.carbon index 19ce199b5f414..edb9ba8bb07de 100644 --- a/toolchain/check/testdata/package_expr/fail_not_found.carbon +++ b/toolchain/check/testdata/package_expr/fail_not_found.carbon @@ -43,8 +43,6 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: fn @Main() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %y.var: ref %i32 = var y // CHECK:STDOUT: %y: ref %i32 = bind_name y, %y.var // CHECK:STDOUT: %package.ref: = name_ref package, package [template = package] diff --git a/toolchain/check/testdata/package_expr/syntax.carbon b/toolchain/check/testdata/package_expr/syntax.carbon index 9db92b049de9c..89c0013b3f93f 100644 --- a/toolchain/check/testdata/package_expr/syntax.carbon +++ b/toolchain/check/testdata/package_expr/syntax.carbon @@ -72,12 +72,8 @@ fn Main() { // CHECK:STDOUT: .y = %y // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int_32.loc4: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc4: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %x.var: ref %i32 = var x // CHECK:STDOUT: %x: ref %i32 = bind_name x, %x.var -// CHECK:STDOUT: %int_32.loc5: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc5: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %y.var: ref %i32 = var y // CHECK:STDOUT: %y: ref %i32 = bind_name y, %y.var // CHECK:STDOUT: } @@ -135,8 +131,6 @@ fn Main() { // CHECK:STDOUT: .Main = %Main.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %x.var: ref %i32 = var x // CHECK:STDOUT: %x: ref %i32 = bind_name x, %x.var // CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} {} @@ -144,8 +138,6 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: fn @Main() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int_32.loc7: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc7: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %x.var: ref %i32 = var x // CHECK:STDOUT: %x: ref %i32 = bind_name x, %x.var // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] @@ -155,8 +147,6 @@ fn Main() { // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_1) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc7: init %i32 = converted %int_1, %int.convert_checked [template = constants.%int_1.2] // CHECK:STDOUT: assign %x.var, %.loc7 -// CHECK:STDOUT: %int_32.loc9: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc9: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %y.var: ref %i32 = var y // CHECK:STDOUT: %y: ref %i32 = bind_name y, %y.var // CHECK:STDOUT: %package.ref: = name_ref package, package [template = package] diff --git a/toolchain/check/testdata/packages/fail_conflict_no_namespaces.carbon b/toolchain/check/testdata/packages/fail_conflict_no_namespaces.carbon index 6a905185ff06c..af6e9abb3b1a9 100644 --- a/toolchain/check/testdata/packages/fail_conflict_no_namespaces.carbon +++ b/toolchain/check/testdata/packages/fail_conflict_no_namespaces.carbon @@ -81,8 +81,6 @@ import library "var"; // CHECK:STDOUT: .Foo = %Foo // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %Foo.var: ref %i32 = var Foo // CHECK:STDOUT: %Foo: ref %i32 = bind_name Foo, %Foo.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/packages/fail_import_type_error.carbon b/toolchain/check/testdata/packages/fail_import_type_error.carbon index 430e758ca9b18..b7c29c241b1cd 100644 --- a/toolchain/check/testdata/packages/fail_import_type_error.carbon +++ b/toolchain/check/testdata/packages/fail_import_type_error.carbon @@ -61,19 +61,12 @@ var d: i32 = d_ref; // CHECK:STDOUT: .d_ref = %d_ref // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %x.ref.loc8: = name_ref x, [template = ] // CHECK:STDOUT: %a_ref.var: ref = var a_ref // CHECK:STDOUT: %a_ref: ref = bind_name a_ref, %a_ref.var -// CHECK:STDOUT: %x.ref.loc13: = name_ref x, [template = ] -// CHECK:STDOUT: %.loc13: = struct_literal (%x.ref.loc13) // CHECK:STDOUT: %b_ref.var: ref = var b_ref // CHECK:STDOUT: %b_ref: ref = bind_name b_ref, %b_ref.var -// CHECK:STDOUT: %x.ref.loc18: = name_ref x, [template = ] -// CHECK:STDOUT: %.loc18: = tuple_literal (%x.ref.loc18) // CHECK:STDOUT: %c_ref.var: ref = var c_ref // CHECK:STDOUT: %c_ref: ref = bind_name c_ref, %c_ref.var -// CHECK:STDOUT: %x.ref.loc22: = name_ref x, [template = ] -// CHECK:STDOUT: %ptr: type = ptr_type [template = ] // CHECK:STDOUT: %d_ref.var: ref = var d_ref // CHECK:STDOUT: %d_ref: ref = bind_name d_ref, %d_ref.var // CHECK:STDOUT: } @@ -112,20 +105,12 @@ var d: i32 = d_ref; // CHECK:STDOUT: %Implicit.import = import Implicit // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int_32.loc6: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc6: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.var: ref %i32 = var a // CHECK:STDOUT: %a: ref %i32 = bind_name a, %a.var -// CHECK:STDOUT: %int_32.loc7: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc7: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %b.var: ref %i32 = var b // CHECK:STDOUT: %b: ref %i32 = bind_name b, %b.var -// CHECK:STDOUT: %int_32.loc8: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc8: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %c.var: ref %i32 = var c // CHECK:STDOUT: %c: ref %i32 = bind_name c, %c.var -// CHECK:STDOUT: %int_32.loc9: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc9: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %d.var: ref %i32 = var d // CHECK:STDOUT: %d: ref %i32 = bind_name d, %d.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/packages/fail_name_with_import_failure.carbon b/toolchain/check/testdata/packages/fail_name_with_import_failure.carbon index cb7514c415c5d..08bb03e9f6d49 100644 --- a/toolchain/check/testdata/packages/fail_name_with_import_failure.carbon +++ b/toolchain/check/testdata/packages/fail_name_with_import_failure.carbon @@ -38,8 +38,6 @@ var a: () = A(); // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %.loc7_9.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc7_9.2: type = converted %.loc7_9.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %a.var: ref %empty_tuple.type = var a // CHECK:STDOUT: %a: ref %empty_tuple.type = bind_name a, %a.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/packages/implicit_imports_prelude.carbon b/toolchain/check/testdata/packages/implicit_imports_prelude.carbon index 27424c5b306ae..ef1d30a75e253 100644 --- a/toolchain/check/testdata/packages/implicit_imports_prelude.carbon +++ b/toolchain/check/testdata/packages/implicit_imports_prelude.carbon @@ -52,8 +52,6 @@ var b: i32 = a; // CHECK:STDOUT: .a = %a // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.var: ref %i32 = var a // CHECK:STDOUT: %a: ref %i32 = bind_name a, %a.var // CHECK:STDOUT: } @@ -95,8 +93,6 @@ var b: i32 = a; // CHECK:STDOUT: %default.import.loc2_6.1 = import // CHECK:STDOUT: %default.import.loc2_6.2 = import // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %b.var: ref %i32 = var b // CHECK:STDOUT: %b: ref %i32 = bind_name b, %b.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/packages/loaded_global.carbon b/toolchain/check/testdata/packages/loaded_global.carbon index 8255163b023a5..15a6302ed4f05 100644 --- a/toolchain/check/testdata/packages/loaded_global.carbon +++ b/toolchain/check/testdata/packages/loaded_global.carbon @@ -89,12 +89,8 @@ var package_b: () = package.B(); // CHECK:STDOUT: %Implicit.import = import Implicit // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %.loc4_9.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc4_9.2: type = converted %.loc4_9.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %a.var: ref %empty_tuple.type = var a // CHECK:STDOUT: %a: ref %empty_tuple.type = bind_name a, %a.var -// CHECK:STDOUT: %.loc6_17.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc6_17.2: type = converted %.loc6_17.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %package_a.var: ref %empty_tuple.type = var package_a // CHECK:STDOUT: %package_a: ref %empty_tuple.type = bind_name package_a, %package_a.var // CHECK:STDOUT: } @@ -163,12 +159,8 @@ var package_b: () = package.B(); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %.loc6_9.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc6_9.2: type = converted %.loc6_9.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %b.var: ref %empty_tuple.type = var b // CHECK:STDOUT: %b: ref %empty_tuple.type = bind_name b, %b.var -// CHECK:STDOUT: %.loc8_17.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc8_17.2: type = converted %.loc8_17.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %package_b.var: ref %empty_tuple.type = var package_b // CHECK:STDOUT: %package_b: ref %empty_tuple.type = bind_name package_b, %package_b.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/packages/no_prelude/cross_package_export.carbon b/toolchain/check/testdata/packages/no_prelude/cross_package_export.carbon index 14ad3b0108fe3..d016884689cdc 100644 --- a/toolchain/check/testdata/packages/no_prelude/cross_package_export.carbon +++ b/toolchain/check/testdata/packages/no_prelude/cross_package_export.carbon @@ -209,14 +209,12 @@ alias C = Other.C; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { -// CHECK:STDOUT: %.loc5_11.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc5_11.2: type = converted %.loc5_11.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] -// CHECK:STDOUT: %.loc5_8: %C.elem = field_decl x, element0 [template] +// CHECK:STDOUT: %.loc5: %C.elem = field_decl x, element0 [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.x [template = constants.%complete_type] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C -// CHECK:STDOUT: .x = %.loc5_8 +// CHECK:STDOUT: .x = %.loc5 // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } // CHECK:STDOUT: @@ -388,7 +386,6 @@ alias C = Other.C; // CHECK:STDOUT: import Other//export_import // CHECK:STDOUT: import Other//base // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref Other//base, C, loaded [template = constants.%C] // CHECK:STDOUT: %import_ref.2: = import_ref Other//base, loc6_1, loaded [template = constants.%complete_type] // CHECK:STDOUT: %import_ref.3 = import_ref Other//base, inst14 [no loc], unloaded // CHECK:STDOUT: %import_ref.4 = import_ref Other//base, loc5_8, unloaded @@ -400,8 +397,6 @@ alias C = Other.C; // CHECK:STDOUT: .c = %c // CHECK:STDOUT: } // CHECK:STDOUT: %Other.import = import Other -// CHECK:STDOUT: %Other.ref: = name_ref Other, imports.%Other [template = imports.%Other] -// CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %c.var: ref %C = var c // CHECK:STDOUT: %c: ref %C = bind_name c, %c.var // CHECK:STDOUT: } @@ -444,7 +439,6 @@ alias C = Other.C; // CHECK:STDOUT: import Other//export_import_copy // CHECK:STDOUT: import Other//base // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref Other//base, C, loaded [template = constants.%C] // CHECK:STDOUT: %import_ref.2: = import_ref Other//base, loc6_1, loaded [template = constants.%complete_type] // CHECK:STDOUT: %import_ref.3 = import_ref Other//base, inst14 [no loc], unloaded // CHECK:STDOUT: %import_ref.4 = import_ref Other//base, loc5_8, unloaded @@ -456,8 +450,6 @@ alias C = Other.C; // CHECK:STDOUT: .c = %c // CHECK:STDOUT: } // CHECK:STDOUT: %Other.import = import Other -// CHECK:STDOUT: %Other.ref: = name_ref Other, imports.%Other [template = imports.%Other] -// CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %c.var: ref %C = var c // CHECK:STDOUT: %c: ref %C = bind_name c, %c.var // CHECK:STDOUT: } @@ -500,7 +492,6 @@ alias C = Other.C; // CHECK:STDOUT: import Other//export_import // CHECK:STDOUT: import Other//base // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref Other//base, C, loaded [template = constants.%C] // CHECK:STDOUT: %import_ref.2: = import_ref Other//base, loc6_1, loaded [template = constants.%complete_type] // CHECK:STDOUT: %import_ref.3 = import_ref Other//base, inst14 [no loc], unloaded // CHECK:STDOUT: %import_ref.4 = import_ref Other//base, loc5_8, unloaded @@ -512,8 +503,6 @@ alias C = Other.C; // CHECK:STDOUT: .c = %c // CHECK:STDOUT: } // CHECK:STDOUT: %Other.import = import Other -// CHECK:STDOUT: %Other.ref: = name_ref Other, imports.%Other [template = imports.%Other] -// CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %c.var: ref %C = var c // CHECK:STDOUT: %c: ref %C = bind_name c, %c.var // CHECK:STDOUT: } @@ -554,7 +543,6 @@ alias C = Other.C; // CHECK:STDOUT: .C = %import_ref.1 // CHECK:STDOUT: import Other//export_name // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref Other//export_name, C, loaded [template = constants.%C] // CHECK:STDOUT: %import_ref.2: = import_ref Other//export_name, inst20 [indirect], loaded [template = constants.%complete_type] // CHECK:STDOUT: %import_ref.3 = import_ref Other//export_name, inst21 [indirect], unloaded // CHECK:STDOUT: %import_ref.4 = import_ref Other//export_name, inst22 [indirect], unloaded @@ -566,8 +554,6 @@ alias C = Other.C; // CHECK:STDOUT: .c = %c // CHECK:STDOUT: } // CHECK:STDOUT: %Other.import = import Other -// CHECK:STDOUT: %Other.ref: = name_ref Other, imports.%Other [template = imports.%Other] -// CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %c.var: ref %C = var c // CHECK:STDOUT: %c: ref %C = bind_name c, %c.var // CHECK:STDOUT: } @@ -609,7 +595,6 @@ alias C = Other.C; // CHECK:STDOUT: import Other//export_name // CHECK:STDOUT: import Other//export_name_copy // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref Other//export_name, C, loaded [template = constants.%C] // CHECK:STDOUT: %import_ref.2: = import_ref Other//export_name, inst20 [indirect], loaded [template = constants.%complete_type] // CHECK:STDOUT: %import_ref.3 = import_ref Other//export_name, inst21 [indirect], unloaded // CHECK:STDOUT: %import_ref.4 = import_ref Other//export_name, inst22 [indirect], unloaded @@ -621,8 +606,6 @@ alias C = Other.C; // CHECK:STDOUT: .c = %c // CHECK:STDOUT: } // CHECK:STDOUT: %Other.import = import Other -// CHECK:STDOUT: %Other.ref: = name_ref Other, imports.%Other [template = imports.%Other] -// CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %c.var: ref %C = var c // CHECK:STDOUT: %c: ref %C = bind_name c, %c.var // CHECK:STDOUT: } @@ -663,7 +646,6 @@ alias C = Other.C; // CHECK:STDOUT: .C = %import_ref.1 // CHECK:STDOUT: import Other//export_name_indirect // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref Other//export_name_indirect, C, loaded [template = constants.%C] // CHECK:STDOUT: %import_ref.2: = import_ref Other//export_name_indirect, inst20 [indirect], loaded [template = constants.%complete_type] // CHECK:STDOUT: %import_ref.3 = import_ref Other//export_name_indirect, inst21 [indirect], unloaded // CHECK:STDOUT: %import_ref.4 = import_ref Other//export_name_indirect, inst22 [indirect], unloaded @@ -675,8 +657,6 @@ alias C = Other.C; // CHECK:STDOUT: .c = %c // CHECK:STDOUT: } // CHECK:STDOUT: %Other.import = import Other -// CHECK:STDOUT: %Other.ref: = name_ref Other, imports.%Other [template = imports.%Other] -// CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %c.var: ref %C = var c // CHECK:STDOUT: %c: ref %C = bind_name c, %c.var // CHECK:STDOUT: } @@ -723,7 +703,6 @@ alias C = Other.C; // CHECK:STDOUT: import Other//export_name_indirect // CHECK:STDOUT: import Other//base // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref Other//export_name, C, loaded [template = constants.%C] // CHECK:STDOUT: %import_ref.2: = import_ref Other//export_name, inst20 [indirect], loaded [template = constants.%complete_type] // CHECK:STDOUT: %import_ref.3 = import_ref Other//export_name, inst21 [indirect], unloaded // CHECK:STDOUT: %import_ref.4 = import_ref Other//export_name, inst22 [indirect], unloaded @@ -735,8 +714,6 @@ alias C = Other.C; // CHECK:STDOUT: .c = %c // CHECK:STDOUT: } // CHECK:STDOUT: %Other.import = import Other -// CHECK:STDOUT: %Other.ref: = name_ref Other, imports.%Other [template = imports.%Other] -// CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %c.var: ref %C = var c // CHECK:STDOUT: %c: ref %C = bind_name c, %c.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/packages/no_prelude/cross_package_import.carbon b/toolchain/check/testdata/packages/no_prelude/cross_package_import.carbon index e86958d20aad0..99da6839b6bb6 100644 --- a/toolchain/check/testdata/packages/no_prelude/cross_package_import.carbon +++ b/toolchain/check/testdata/packages/no_prelude/cross_package_import.carbon @@ -257,9 +257,11 @@ fn UseF() { Other.F(); } // CHECK:STDOUT: %x.patt: %empty_tuple.type = binding_pattern x // CHECK:STDOUT: %x.param_patt: %empty_tuple.type = value_param_pattern %x.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc4_10.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc4_10.2: type = converted %.loc4_10.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %x.param: %empty_tuple.type = value_param runtime_param0 +// CHECK:STDOUT: %.loc4_10.3: type = splice_block %.loc4_10.2 [template = constants.%empty_tuple.type] { +// CHECK:STDOUT: %.loc4_10.1: %empty_tuple.type = tuple_literal () +// CHECK:STDOUT: %.loc4_10.2: type = converted %.loc4_10.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] +// CHECK:STDOUT: } // CHECK:STDOUT: %x: %empty_tuple.type = bind_name x, %x.param // CHECK:STDOUT: } // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/packages/no_prelude/export_import.carbon b/toolchain/check/testdata/packages/no_prelude/export_import.carbon index a66d289a5162f..f644783d06b71 100644 --- a/toolchain/check/testdata/packages/no_prelude/export_import.carbon +++ b/toolchain/check/testdata/packages/no_prelude/export_import.carbon @@ -188,14 +188,12 @@ var indirect_c: C = {.x = ()}; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { -// CHECK:STDOUT: %.loc5_11.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc5_11.2: type = converted %.loc5_11.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] -// CHECK:STDOUT: %.loc5_8: %C.elem = field_decl x, element0 [template] +// CHECK:STDOUT: %.loc5: %C.elem = field_decl x, element0 [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.x [template = constants.%complete_type] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C -// CHECK:STDOUT: .x = %.loc5_8 +// CHECK:STDOUT: .x = %.loc5 // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } // CHECK:STDOUT: @@ -294,7 +292,6 @@ var indirect_c: C = {.x = ()}; // CHECK:STDOUT: .c = %c // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %c.var: ref %C = var c // CHECK:STDOUT: %c: ref %C = bind_name c, %c.var // CHECK:STDOUT: } @@ -348,7 +345,6 @@ var indirect_c: C = {.x = ()}; // CHECK:STDOUT: } // CHECK:STDOUT: %default.import.loc2_6.1 = import // CHECK:STDOUT: %default.import.loc2_6.2 = import -// CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %c.var: ref %C = var c // CHECK:STDOUT: %c: ref %C = bind_name c, %c.var // CHECK:STDOUT: } @@ -397,7 +393,6 @@ var indirect_c: C = {.x = ()}; // CHECK:STDOUT: .c = %c // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %c.var: ref %C = var c // CHECK:STDOUT: %c: ref %C = bind_name c, %c.var // CHECK:STDOUT: } @@ -446,7 +441,6 @@ var indirect_c: C = {.x = ()}; // CHECK:STDOUT: .c = %c // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %c.var: ref %C = var c // CHECK:STDOUT: %c: ref %C = bind_name c, %c.var // CHECK:STDOUT: } @@ -495,7 +489,6 @@ var indirect_c: C = {.x = ()}; // CHECK:STDOUT: .c = %c // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %c.var: ref %C = var c // CHECK:STDOUT: %c: ref %C = bind_name c, %c.var // CHECK:STDOUT: } @@ -544,7 +537,6 @@ var indirect_c: C = {.x = ()}; // CHECK:STDOUT: .c = %c // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %c.var: ref %C = var c // CHECK:STDOUT: %c: ref %C = bind_name c, %c.var // CHECK:STDOUT: } @@ -593,7 +585,6 @@ var indirect_c: C = {.x = ()}; // CHECK:STDOUT: .c = %c // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %c.var: ref %C = var c // CHECK:STDOUT: %c: ref %C = bind_name c, %c.var // CHECK:STDOUT: } @@ -642,7 +633,6 @@ var indirect_c: C = {.x = ()}; // CHECK:STDOUT: .c = %c // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %c.var: ref %C = var c // CHECK:STDOUT: %c: ref %C = bind_name c, %c.var // CHECK:STDOUT: } @@ -702,7 +692,6 @@ var indirect_c: C = {.x = ()}; // CHECK:STDOUT: .c = %c // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %c.var: ref %C = var c // CHECK:STDOUT: %c: ref %C = bind_name c, %c.var // CHECK:STDOUT: } @@ -753,7 +742,6 @@ var indirect_c: C = {.x = ()}; // CHECK:STDOUT: .indirect_c = %indirect_c // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.2 [template = constants.%C] // CHECK:STDOUT: %indirect_c.var: ref %C = var indirect_c // CHECK:STDOUT: %indirect_c: ref %C = bind_name indirect_c, %indirect_c.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/packages/no_prelude/export_mixed.carbon b/toolchain/check/testdata/packages/no_prelude/export_mixed.carbon index 1a4a0455904dd..00db5e93e78bf 100644 --- a/toolchain/check/testdata/packages/no_prelude/export_mixed.carbon +++ b/toolchain/check/testdata/packages/no_prelude/export_mixed.carbon @@ -137,26 +137,22 @@ var d: D = {.y = ()}; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { -// CHECK:STDOUT: %.loc5_11.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc5_11.2: type = converted %.loc5_11.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] -// CHECK:STDOUT: %.loc5_8: %C.elem = field_decl x, element0 [template] +// CHECK:STDOUT: %.loc5: %C.elem = field_decl x, element0 [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.x [template = constants.%complete_type.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C -// CHECK:STDOUT: .x = %.loc5_8 +// CHECK:STDOUT: .x = %.loc5 // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @D { -// CHECK:STDOUT: %.loc9_11.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc9_11.2: type = converted %.loc9_11.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] -// CHECK:STDOUT: %.loc9_8: %D.elem = field_decl y, element0 [template] +// CHECK:STDOUT: %.loc9: %D.elem = field_decl y, element0 [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.y [template = constants.%complete_type.2] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%D -// CHECK:STDOUT: .y = %.loc9_8 +// CHECK:STDOUT: .y = %.loc9 // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } // CHECK:STDOUT: @@ -278,7 +274,6 @@ var d: D = {.y = ()}; // CHECK:STDOUT: .c = %c // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %c.var: ref %C = var c // CHECK:STDOUT: %c: ref %C = bind_name c, %c.var // CHECK:STDOUT: } @@ -327,7 +322,6 @@ var d: D = {.y = ()}; // CHECK:STDOUT: .c = %c // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %c.var: ref %C = var c // CHECK:STDOUT: %c: ref %C = bind_name c, %c.var // CHECK:STDOUT: } @@ -376,7 +370,6 @@ var d: D = {.y = ()}; // CHECK:STDOUT: .c = %c // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %c.var: ref %C = var c // CHECK:STDOUT: %c: ref %C = bind_name c, %c.var // CHECK:STDOUT: } @@ -418,7 +411,6 @@ var d: D = {.y = ()}; // CHECK:STDOUT: .d = %d // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %D.ref: = name_ref D, [template = ] // CHECK:STDOUT: %d.var: ref = var d // CHECK:STDOUT: %d: ref = bind_name d, %d.var // CHECK:STDOUT: } @@ -455,7 +447,6 @@ var d: D = {.y = ()}; // CHECK:STDOUT: .c = %c // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %c.var: ref %C = var c // CHECK:STDOUT: %c: ref %C = bind_name c, %c.var // CHECK:STDOUT: } @@ -514,10 +505,8 @@ var d: D = {.y = ()}; // CHECK:STDOUT: .d = %d // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %c.var: ref %C = var c // CHECK:STDOUT: %c: ref %C = bind_name c, %c.var -// CHECK:STDOUT: %D.ref: type = name_ref D, imports.%import_ref.2 [template = constants.%D] // CHECK:STDOUT: %d.var: ref %D = var d // CHECK:STDOUT: %d: ref %D = bind_name d, %d.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/packages/no_prelude/export_name.carbon b/toolchain/check/testdata/packages/no_prelude/export_name.carbon index 8294c49126f18..8572c1bc5ee4d 100644 --- a/toolchain/check/testdata/packages/no_prelude/export_name.carbon +++ b/toolchain/check/testdata/packages/no_prelude/export_name.carbon @@ -227,26 +227,22 @@ private export C; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { -// CHECK:STDOUT: %.loc5_11.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc5_11.2: type = converted %.loc5_11.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] -// CHECK:STDOUT: %.loc5_8: %C.elem = field_decl x, element0 [template] +// CHECK:STDOUT: %.loc5: %C.elem = field_decl x, element0 [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.x [template = constants.%complete_type.1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C -// CHECK:STDOUT: .x = %.loc5_8 +// CHECK:STDOUT: .x = %.loc5 // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @NSC { -// CHECK:STDOUT: %.loc10_11.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc10_11.2: type = converted %.loc10_11.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] -// CHECK:STDOUT: %.loc10_8: %NSC.elem = field_decl y, element0 [template] +// CHECK:STDOUT: %.loc10: %NSC.elem = field_decl y, element0 [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.y [template = constants.%complete_type.2] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%NSC -// CHECK:STDOUT: .y = %.loc10_8 +// CHECK:STDOUT: .y = %.loc10 // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } // CHECK:STDOUT: @@ -397,7 +393,6 @@ private export C; // CHECK:STDOUT: %NS: = namespace %import_ref.2, [template] { // CHECK:STDOUT: .NSC = %import_ref.3 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.3: type = import_ref Main//export, NSC, loaded [template = constants.%NSC] // CHECK:STDOUT: %import_ref.4: = import_ref Main//export, inst23 [indirect], loaded [template = constants.%complete_type.1] // CHECK:STDOUT: %import_ref.5 = import_ref Main//export, inst24 [indirect], unloaded // CHECK:STDOUT: %import_ref.6 = import_ref Main//export, inst25 [indirect], unloaded @@ -414,11 +409,8 @@ private export C; // CHECK:STDOUT: .nsc = %nsc // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %c.var: ref %C = var c // CHECK:STDOUT: %c: ref %C = bind_name c, %c.var -// CHECK:STDOUT: %NS.ref: = name_ref NS, imports.%NS [template = imports.%NS] -// CHECK:STDOUT: %NSC.ref: type = name_ref NSC, imports.%import_ref.3 [template = constants.%NSC] // CHECK:STDOUT: %nsc.var: ref %NSC = var nsc // CHECK:STDOUT: %nsc: ref %NSC = bind_name nsc, %nsc.var // CHECK:STDOUT: } @@ -479,7 +471,6 @@ private export C; // CHECK:STDOUT: %NS: = namespace %import_ref.2, [template] { // CHECK:STDOUT: .NSC = %import_ref.3 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.3: type = import_ref Main//export_export, NSC, loaded [template = constants.%NSC] // CHECK:STDOUT: %import_ref.4: = import_ref Main//export_export, inst23 [indirect], loaded [template = constants.%complete_type.1] // CHECK:STDOUT: %import_ref.5 = import_ref Main//export_export, inst24 [indirect], unloaded // CHECK:STDOUT: %import_ref.6 = import_ref Main//export_export, inst25 [indirect], unloaded @@ -497,11 +488,8 @@ private export C; // CHECK:STDOUT: } // CHECK:STDOUT: %default.import.loc2_6.1 = import // CHECK:STDOUT: %default.import.loc2_6.2 = import -// CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %c.var: ref %C = var c // CHECK:STDOUT: %c: ref %C = bind_name c, %c.var -// CHECK:STDOUT: %NS.ref: = name_ref NS, imports.%NS [template = imports.%NS] -// CHECK:STDOUT: %NSC.ref: type = name_ref NSC, imports.%import_ref.3 [template = constants.%NSC] // CHECK:STDOUT: %nsc.var: ref %NSC = var nsc // CHECK:STDOUT: %nsc: ref %NSC = bind_name nsc, %nsc.var // CHECK:STDOUT: } @@ -562,7 +550,6 @@ private export C; // CHECK:STDOUT: %NS: = namespace %import_ref.2, [template] { // CHECK:STDOUT: .NSC = %import_ref.3 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.3: type = import_ref Main//export_export, NSC, loaded [template = constants.%NSC] // CHECK:STDOUT: %import_ref.4: = import_ref Main//export_export, inst23 [indirect], loaded [template = constants.%complete_type.1] // CHECK:STDOUT: %import_ref.5 = import_ref Main//export_export, inst24 [indirect], unloaded // CHECK:STDOUT: %import_ref.6 = import_ref Main//export_export, inst25 [indirect], unloaded @@ -579,11 +566,8 @@ private export C; // CHECK:STDOUT: .nsc = %nsc // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %c.var: ref %C = var c // CHECK:STDOUT: %c: ref %C = bind_name c, %c.var -// CHECK:STDOUT: %NS.ref: = name_ref NS, imports.%NS [template = imports.%NS] -// CHECK:STDOUT: %NSC.ref: type = name_ref NSC, imports.%import_ref.3 [template = constants.%NSC] // CHECK:STDOUT: %nsc.var: ref %NSC = var nsc // CHECK:STDOUT: %nsc: ref %NSC = bind_name nsc, %nsc.var // CHECK:STDOUT: } @@ -720,7 +704,6 @@ private export C; // CHECK:STDOUT: %NS: = namespace %import_ref.2, [template] { // CHECK:STDOUT: .NSC = %import_ref.3 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.3: type = import_ref Main//base, NSC, loaded [template = constants.%NSC] // CHECK:STDOUT: %import_ref.4: = import_ref Main//base, loc6_1, loaded [template = constants.%complete_type.1] // CHECK:STDOUT: %import_ref.5 = import_ref Main//base, inst14 [no loc], unloaded // CHECK:STDOUT: %import_ref.6 = import_ref Main//base, loc5_8, unloaded @@ -737,11 +720,8 @@ private export C; // CHECK:STDOUT: .nsc = %nsc // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %c.var: ref %C = var c // CHECK:STDOUT: %c: ref %C = bind_name c, %c.var -// CHECK:STDOUT: %NS.ref: = name_ref NS, imports.%NS [template = imports.%NS] -// CHECK:STDOUT: %NSC.ref: type = name_ref NSC, imports.%import_ref.3 [template = constants.%NSC] // CHECK:STDOUT: %nsc.var: ref %NSC = var nsc // CHECK:STDOUT: %nsc: ref %NSC = bind_name nsc, %nsc.var // CHECK:STDOUT: } @@ -802,7 +782,6 @@ private export C; // CHECK:STDOUT: %NS: = namespace %import_ref.2, [template] { // CHECK:STDOUT: .NSC = %import_ref.3 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.3: type = import_ref Main//export, NSC, loaded [template = constants.%NSC] // CHECK:STDOUT: %import_ref.4: = import_ref Main//export, inst23 [indirect], loaded [template = constants.%complete_type.1] // CHECK:STDOUT: %import_ref.5 = import_ref Main//export, inst24 [indirect], unloaded // CHECK:STDOUT: %import_ref.6 = import_ref Main//export, inst25 [indirect], unloaded @@ -819,11 +798,8 @@ private export C; // CHECK:STDOUT: .nsc = %nsc // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %c.var: ref %C = var c // CHECK:STDOUT: %c: ref %C = bind_name c, %c.var -// CHECK:STDOUT: %NS.ref: = name_ref NS, imports.%NS [template = imports.%NS] -// CHECK:STDOUT: %NSC.ref: type = name_ref NSC, imports.%import_ref.3 [template = constants.%NSC] // CHECK:STDOUT: %nsc.var: ref %NSC = var nsc // CHECK:STDOUT: %nsc: ref %NSC = bind_name nsc, %nsc.var // CHECK:STDOUT: } @@ -938,7 +914,6 @@ private export C; // CHECK:STDOUT: .c = %c // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %c.var: ref %C = var c // CHECK:STDOUT: %c: ref %C = bind_name c, %c.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/packages/no_prelude/fail_export_name_member.carbon b/toolchain/check/testdata/packages/no_prelude/fail_export_name_member.carbon index c87722e435729..f4afdd4fa7d9f 100644 --- a/toolchain/check/testdata/packages/no_prelude/fail_export_name_member.carbon +++ b/toolchain/check/testdata/packages/no_prelude/fail_export_name_member.carbon @@ -51,14 +51,12 @@ export C.n; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { -// CHECK:STDOUT: %.loc5_11.1: %empty_struct_type = struct_literal () -// CHECK:STDOUT: %.loc5_11.2: type = converted %.loc5_11.1, constants.%empty_struct_type [template = constants.%empty_struct_type] -// CHECK:STDOUT: %.loc5_8: %C.elem = field_decl n, element0 [template] +// CHECK:STDOUT: %.loc5: %C.elem = field_decl n, element0 [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.n [template = constants.%complete_type] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C -// CHECK:STDOUT: .n = %.loc5_8 +// CHECK:STDOUT: .n = %.loc5 // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/packages/no_prelude/implicit_imports_entities.carbon b/toolchain/check/testdata/packages/no_prelude/implicit_imports_entities.carbon index 208c57afc1237..b0f69140e255f 100644 --- a/toolchain/check/testdata/packages/no_prelude/implicit_imports_entities.carbon +++ b/toolchain/check/testdata/packages/no_prelude/implicit_imports_entities.carbon @@ -347,10 +347,8 @@ import Other library "o1"; // CHECK:STDOUT: } // CHECK:STDOUT: %default.import.loc2_6.1 = import // CHECK:STDOUT: %default.import.loc2_6.2 = import -// CHECK:STDOUT: %C1.ref: type = name_ref C1, imports.%import_ref.1 [template = constants.%C1] // CHECK:STDOUT: %c1.var: ref %C1 = var c1 // CHECK:STDOUT: %c1: ref %C1 = bind_name c1, %c1.var -// CHECK:STDOUT: %C2.ref: type = name_ref C2, imports.%import_ref.2 [template = constants.%C2] // CHECK:STDOUT: %c2.var: ref %C2 = var c2 // CHECK:STDOUT: %c2: ref %C2 = bind_name c2, %c2.var // CHECK:STDOUT: } @@ -415,7 +413,6 @@ import Other library "o1"; // CHECK:STDOUT: } // CHECK:STDOUT: %default.import.loc2_6.1 = import // CHECK:STDOUT: %default.import.loc2_6.2 = import -// CHECK:STDOUT: %C1.ref: type = name_ref C1, imports.%import_ref.1 [template = constants.%C1] // CHECK:STDOUT: %c1.var: ref %C1 = var c1 // CHECK:STDOUT: %c1: ref %C1 = bind_name c1, %c1.var // CHECK:STDOUT: } @@ -465,7 +462,6 @@ import Other library "o1"; // CHECK:STDOUT: %NS: = namespace %import_ref.1, [template] { // CHECK:STDOUT: .C = %import_ref.2 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.2: type = import_ref Main//use_ns, C, loaded [template = constants.%C] // CHECK:STDOUT: %import_ref.3: = import_ref Main//ns, loc5_13, loaded [template = constants.%complete_type] // CHECK:STDOUT: %import_ref.4 = import_ref Main//ns, inst15 [no loc], unloaded // CHECK:STDOUT: } @@ -477,8 +473,6 @@ import Other library "o1"; // CHECK:STDOUT: } // CHECK:STDOUT: %default.import.loc2_6.1 = import // CHECK:STDOUT: %default.import.loc2_6.2 = import -// CHECK:STDOUT: %NS.ref: = name_ref NS, imports.%NS [template = imports.%NS] -// CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.2 [template = constants.%C] // CHECK:STDOUT: %c.var: ref %C = var c // CHECK:STDOUT: %c: ref %C = bind_name c, %c.var // CHECK:STDOUT: } @@ -531,10 +525,8 @@ import Other library "o1"; // CHECK:STDOUT: import Other//o2 // CHECK:STDOUT: import Other//o1 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref Other//o1, O1, loaded [template = constants.%O1] // CHECK:STDOUT: %import_ref.2: = import_ref Other//o1, loc4_11, loaded [template = constants.%complete_type] // CHECK:STDOUT: %import_ref.3 = import_ref Other//o1, inst14 [no loc], unloaded -// CHECK:STDOUT: %import_ref.4: type = import_ref Other//o2, O2, loaded [template = constants.%O2] // CHECK:STDOUT: %import_ref.5: = import_ref Other//o2, loc4_11, loaded [template = constants.%complete_type] // CHECK:STDOUT: %import_ref.6 = import_ref Other//o2, inst14 [no loc], unloaded // CHECK:STDOUT: } @@ -548,12 +540,8 @@ import Other library "o1"; // CHECK:STDOUT: %default.import.loc2_6.1 = import // CHECK:STDOUT: %default.import.loc2_6.2 = import // CHECK:STDOUT: %Other.import = import Other -// CHECK:STDOUT: %Other.ref.loc6: = name_ref Other, imports.%Other [template = imports.%Other] -// CHECK:STDOUT: %O1.ref: type = name_ref O1, imports.%import_ref.1 [template = constants.%O1] // CHECK:STDOUT: %o1.var: ref %O1 = var o1 // CHECK:STDOUT: %o1: ref %O1 = bind_name o1, %o1.var -// CHECK:STDOUT: %Other.ref.loc7: = name_ref Other, imports.%Other [template = imports.%Other] -// CHECK:STDOUT: %O2.ref: type = name_ref O2, imports.%import_ref.4 [template = constants.%O2] // CHECK:STDOUT: %o2.var: ref %O2 = var o2 // CHECK:STDOUT: %o2: ref %O2 = bind_name o2, %o2.var // CHECK:STDOUT: } @@ -612,7 +600,6 @@ import Other library "o1"; // CHECK:STDOUT: .O1 = %import_ref.1 // CHECK:STDOUT: import Other//o1 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref Other//o1, O1, loaded [template = constants.%O1] // CHECK:STDOUT: %import_ref.2: = import_ref Other//o1, loc4_11, loaded [template = constants.%complete_type] // CHECK:STDOUT: %import_ref.3 = import_ref Other//o1, inst14 [no loc], unloaded // CHECK:STDOUT: } @@ -625,8 +612,6 @@ import Other library "o1"; // CHECK:STDOUT: %default.import.loc2_6.1 = import // CHECK:STDOUT: %default.import.loc2_6.2 = import // CHECK:STDOUT: %Other.import = import Other -// CHECK:STDOUT: %Other.ref: = name_ref Other, imports.%Other [template = imports.%Other] -// CHECK:STDOUT: %O1.ref: type = name_ref O1, imports.%import_ref.1 [template = constants.%O1] // CHECK:STDOUT: %o1.var: ref %O1 = var o1 // CHECK:STDOUT: %o1: ref %O1 = bind_name o1, %o1.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/packages/no_prelude/missing_prelude.carbon b/toolchain/check/testdata/packages/no_prelude/missing_prelude.carbon index 8c3afc2103a9b..2eb622c3b77f7 100644 --- a/toolchain/check/testdata/packages/no_prelude/missing_prelude.carbon +++ b/toolchain/check/testdata/packages/no_prelude/missing_prelude.carbon @@ -88,14 +88,12 @@ var n: {} = i32; // CHECK:STDOUT: --- fail_missing_prelude.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .n = %n // CHECK:STDOUT: } -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %n.var: ref = var n // CHECK:STDOUT: %n: ref = bind_name n, %n.var // CHECK:STDOUT: } @@ -109,7 +107,6 @@ var n: {} = i32; // CHECK:STDOUT: --- fail_missing_prelude_member.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -124,7 +121,6 @@ var n: {} = i32; // CHECK:STDOUT: .n = %n // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %n.var: ref = var n // CHECK:STDOUT: %n: ref = bind_name n, %n.var // CHECK:STDOUT: } @@ -154,12 +150,12 @@ var n: {} = i32; // CHECK:STDOUT: %return.patt: %empty_struct_type = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %empty_struct_type = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc4_8.1 [symbolic = %T.loc4_8.2 (constants.%T)] // CHECK:STDOUT: %.loc4_29.1: %empty_struct_type = struct_literal () // CHECK:STDOUT: %.loc4_29.2: type = converted %.loc4_29.1, constants.%empty_struct_type [template = constants.%empty_struct_type] // CHECK:STDOUT: %T.param: type = value_param runtime_param // CHECK:STDOUT: %T.loc4_8.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc4_8.2 (constants.%T)] // CHECK:STDOUT: %N.param: @Int.%T.loc4_8.2 (%T) = value_param runtime_param +// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc4_8.1 [symbolic = %T.loc4_8.2 (constants.%T)] // CHECK:STDOUT: %N.loc4_18.1: @Int.%T.loc4_8.2 (%T) = bind_symbolic_name N, 1, %N.param [symbolic = %N.loc4_18.2 (constants.%N)] // CHECK:STDOUT: %return.param: ref %empty_struct_type = out_param runtime_param0 // CHECK:STDOUT: %return: ref %empty_struct_type = return_slot %return.param @@ -217,8 +213,6 @@ var n: {} = i32; // CHECK:STDOUT: .n = %n // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %.loc6_9.1: %empty_struct_type = struct_literal () -// CHECK:STDOUT: %.loc6_9.2: type = converted %.loc6_9.1, constants.%empty_struct_type [template = constants.%empty_struct_type] // CHECK:STDOUT: %n.var: ref %empty_struct_type = var n // CHECK:STDOUT: %n: ref %empty_struct_type = bind_name n, %n.var // CHECK:STDOUT: } @@ -287,18 +281,16 @@ var n: {} = i32; // CHECK:STDOUT: %return.patt: %empty_tuple.type = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %empty_tuple.type = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc8_8.1 [symbolic = %T.loc8_8.2 (constants.%T)] // CHECK:STDOUT: %.loc8_29.1: %empty_tuple.type = tuple_literal () // CHECK:STDOUT: %.loc8_29.2: type = converted %.loc8_29.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %T.param: type = value_param runtime_param // CHECK:STDOUT: %T.loc8_8.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc8_8.2 (constants.%T)] // CHECK:STDOUT: %N.param: @Int.%T.loc8_8.2 (%T) = value_param runtime_param +// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc8_8.1 [symbolic = %T.loc8_8.2 (constants.%T)] // CHECK:STDOUT: %N.loc8_18.1: @Int.%T.loc8_8.2 (%T) = bind_symbolic_name N, 1, %N.param [symbolic = %N.loc8_18.2 (constants.%N)] // CHECK:STDOUT: %return.param: ref %empty_tuple.type = out_param runtime_param0 // CHECK:STDOUT: %return: ref %empty_tuple.type = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc10_9.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc10_9.2: type = converted %.loc10_9.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %n.var: ref %empty_tuple.type = var n // CHECK:STDOUT: %n: ref %empty_tuple.type = bind_name n, %n.var // CHECK:STDOUT: } @@ -376,18 +368,16 @@ var n: {} = i32; // CHECK:STDOUT: %return.patt: %empty_struct_type = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %empty_struct_type = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc7_13.1 [symbolic = %T.loc7_13.2 (constants.%T)] // CHECK:STDOUT: %.loc7_34.1: %empty_struct_type = struct_literal () // CHECK:STDOUT: %.loc7_34.2: type = converted %.loc7_34.1, constants.%empty_struct_type [template = constants.%empty_struct_type] // CHECK:STDOUT: %T.param: type = value_param runtime_param // CHECK:STDOUT: %T.loc7_13.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc7_13.2 (constants.%T)] // CHECK:STDOUT: %N.param: @Int.%T.loc7_13.2 (%T) = value_param runtime_param +// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc7_13.1 [symbolic = %T.loc7_13.2 (constants.%T)] // CHECK:STDOUT: %N.loc7_23.1: @Int.%T.loc7_13.2 (%T) = bind_symbolic_name N, 1, %N.param [symbolic = %N.loc7_23.2 (constants.%N)] // CHECK:STDOUT: %return.param: ref %empty_struct_type = out_param runtime_param0 // CHECK:STDOUT: %return: ref %empty_struct_type = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc9_9.1: %empty_struct_type = struct_literal () -// CHECK:STDOUT: %.loc9_9.2: type = converted %.loc9_9.1, constants.%empty_struct_type [template = constants.%empty_struct_type] // CHECK:STDOUT: %n.var: ref %empty_struct_type = var n // CHECK:STDOUT: %n: ref %empty_struct_type = bind_name n, %n.var // CHECK:STDOUT: } @@ -456,8 +446,6 @@ var n: {} = i32; // CHECK:STDOUT: .n = %n // CHECK:STDOUT: } // CHECK:STDOUT: %Core.decl: type = class_decl @Core [template = constants.%Core] {} {} -// CHECK:STDOUT: %.loc12_9.1: %empty_struct_type = struct_literal () -// CHECK:STDOUT: %.loc12_9.2: type = converted %.loc12_9.1, constants.%empty_struct_type [template = constants.%empty_struct_type] // CHECK:STDOUT: %n.var: ref %empty_struct_type = var n // CHECK:STDOUT: %n: ref %empty_struct_type = bind_name n, %n.var // CHECK:STDOUT: } @@ -471,12 +459,12 @@ var n: {} = i32; // CHECK:STDOUT: %return.patt: %empty_struct_type = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %empty_struct_type = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc6_10.2 [symbolic = %T.loc6_10.1 (constants.%T)] // CHECK:STDOUT: %.loc6_31.1: %empty_struct_type = struct_literal () // CHECK:STDOUT: %.loc6_31.2: type = converted %.loc6_31.1, constants.%empty_struct_type [template = constants.%empty_struct_type] // CHECK:STDOUT: %T.param: type = value_param runtime_param // CHECK:STDOUT: %T.loc6_10.2: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc6_10.1 (constants.%T)] // CHECK:STDOUT: %N.param: @Int.%T.loc6_10.1 (%T) = value_param runtime_param +// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc6_10.2 [symbolic = %T.loc6_10.1 (constants.%T)] // CHECK:STDOUT: %N.loc6_20.2: @Int.%T.loc6_10.1 (%T) = bind_symbolic_name N, 1, %N.param [symbolic = %N.loc6_20.1 (constants.%N)] // CHECK:STDOUT: %return.param: ref %empty_struct_type = out_param runtime_param0 // CHECK:STDOUT: %return: ref %empty_struct_type = return_slot %return.param diff --git a/toolchain/check/testdata/pointer/address_of_deref.carbon b/toolchain/check/testdata/pointer/address_of_deref.carbon index e8236d23694d7..a1945dfa5597e 100644 --- a/toolchain/check/testdata/pointer/address_of_deref.carbon +++ b/toolchain/check/testdata/pointer/address_of_deref.carbon @@ -50,8 +50,8 @@ fn F() -> i32 { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } @@ -59,8 +59,6 @@ fn F() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: fn @F() -> %i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int_32.loc12: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc12: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %n.var: ref %i32 = var n // CHECK:STDOUT: %n: ref %i32 = bind_name n, %n.var // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] diff --git a/toolchain/check/testdata/pointer/address_of_lvalue.carbon b/toolchain/check/testdata/pointer/address_of_lvalue.carbon index 1938ea3be1404..0ca2d59cd08f3 100644 --- a/toolchain/check/testdata/pointer/address_of_lvalue.carbon +++ b/toolchain/check/testdata/pointer/address_of_lvalue.carbon @@ -44,7 +44,6 @@ fn F() { // CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] // CHECK:STDOUT: %struct: %struct_type.a.b.1 = struct_value (%int_1.2, %int_2.2) [template] // CHECK:STDOUT: %ptr.2: type = ptr_type %i32 [template] -// CHECK:STDOUT: %tuple.type.1: type = tuple_type (type, type) [template] // CHECK:STDOUT: %tuple.type.2: type = tuple_type (%i32, %i32) [template] // CHECK:STDOUT: %tuple.type.3: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [template] // CHECK:STDOUT: %tuple: %tuple.type.2 = tuple_value (%int_1.2, %int_2.2) [template] @@ -71,11 +70,6 @@ fn F() { // CHECK:STDOUT: // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int_32.loc12_15: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc12_15: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc12_24: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc12_24: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %struct_type.a.b.loc12: type = struct_type {.a: %i32, .b: %i32} [template = constants.%struct_type.a.b.1] // CHECK:STDOUT: %s.var: ref %struct_type.a.b.1 = var s // CHECK:STDOUT: %s: ref %struct_type.a.b.1 = bind_name s, %s.var // CHECK:STDOUT: %int_1.loc12: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] @@ -98,41 +92,23 @@ fn F() { // CHECK:STDOUT: %.loc12_46.8: init %struct_type.a.b.1 = struct_init (%.loc12_46.4, %.loc12_46.7) to %s.var [template = constants.%struct] // CHECK:STDOUT: %.loc12_47: init %struct_type.a.b.1 = converted %.loc12_46.1, %.loc12_46.8 [template = constants.%struct] // CHECK:STDOUT: assign %s.var, %.loc12_47 -// CHECK:STDOUT: %int_32.loc14_15: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc14_15: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc14_24: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc14_24: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %struct_type.a.b.loc14: type = struct_type {.a: %i32, .b: %i32} [template = constants.%struct_type.a.b.1] -// CHECK:STDOUT: %ptr.loc14: type = ptr_type %struct_type.a.b.1 [template = constants.%ptr.1] // CHECK:STDOUT: %p.var: ref %ptr.1 = var p // CHECK:STDOUT: %p: ref %ptr.1 = bind_name p, %p.var // CHECK:STDOUT: %s.ref.loc14: ref %struct_type.a.b.1 = name_ref s, %s // CHECK:STDOUT: %addr.loc14: %ptr.1 = addr_of %s.ref.loc14 // CHECK:STDOUT: assign %p.var, %addr.loc14 -// CHECK:STDOUT: %int_32.loc15: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc15: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %ptr.loc15: type = ptr_type %i32 [template = constants.%ptr.2] // CHECK:STDOUT: %q.var: ref %ptr.2 = var q // CHECK:STDOUT: %q: ref %ptr.2 = bind_name q, %q.var // CHECK:STDOUT: %s.ref.loc15: ref %struct_type.a.b.1 = name_ref s, %s // CHECK:STDOUT: %.loc15: ref %i32 = struct_access %s.ref.loc15, element0 // CHECK:STDOUT: %addr.loc15: %ptr.2 = addr_of %.loc15 // CHECK:STDOUT: assign %q.var, %addr.loc15 -// CHECK:STDOUT: %int_32.loc16: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc16: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %ptr.loc16: type = ptr_type %i32 [template = constants.%ptr.2] // CHECK:STDOUT: %r.var: ref %ptr.2 = var r // CHECK:STDOUT: %r: ref %ptr.2 = bind_name r, %r.var // CHECK:STDOUT: %s.ref.loc16: ref %struct_type.a.b.1 = name_ref s, %s // CHECK:STDOUT: %.loc16: ref %i32 = struct_access %s.ref.loc16, element1 // CHECK:STDOUT: %addr.loc16: %ptr.2 = addr_of %.loc16 // CHECK:STDOUT: assign %r.var, %addr.loc16 -// CHECK:STDOUT: %int_32.loc18_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc18_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc18_16: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc18_16: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc18_19.1: %tuple.type.1 = tuple_literal (%i32.loc18_11, %i32.loc18_16) -// CHECK:STDOUT: %.loc18_19.2: type = converted %.loc18_19.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %t.var: ref %tuple.type.2 = var t // CHECK:STDOUT: %t: ref %tuple.type.2 = bind_name t, %t.var // CHECK:STDOUT: %int_1.loc18: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] @@ -155,9 +131,6 @@ fn F() { // CHECK:STDOUT: %.loc18_28.6: init %tuple.type.2 = tuple_init (%.loc18_28.3, %.loc18_28.5) to %t.var [template = constants.%tuple] // CHECK:STDOUT: %.loc18_29: init %tuple.type.2 = converted %.loc18_28.1, %.loc18_28.6 [template = constants.%tuple] // CHECK:STDOUT: assign %t.var, %.loc18_29 -// CHECK:STDOUT: %int_32.loc19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %ptr.loc19: type = ptr_type %i32 [template = constants.%ptr.2] // CHECK:STDOUT: %t0.var: ref %ptr.2 = var t0 // CHECK:STDOUT: %t0: ref %ptr.2 = bind_name t0, %t0.var // CHECK:STDOUT: %t.ref.loc19: ref %tuple.type.2 = name_ref t, %t @@ -165,9 +138,6 @@ fn F() { // CHECK:STDOUT: %tuple.elem0.loc19: ref %i32 = tuple_access %t.ref.loc19, element0 // CHECK:STDOUT: %addr.loc19: %ptr.2 = addr_of %tuple.elem0.loc19 // CHECK:STDOUT: assign %t0.var, %addr.loc19 -// CHECK:STDOUT: %int_32.loc20: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc20: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %ptr.loc20: type = ptr_type %i32 [template = constants.%ptr.2] // CHECK:STDOUT: %t1.var: ref %ptr.2 = var t1 // CHECK:STDOUT: %t1: ref %ptr.2 = bind_name t1, %t1.var // CHECK:STDOUT: %t.ref.loc20: ref %tuple.type.2 = name_ref t, %t diff --git a/toolchain/check/testdata/pointer/arrow.carbon b/toolchain/check/testdata/pointer/arrow.carbon index bbcea4d407e8a..04e9d8d695c32 100644 --- a/toolchain/check/testdata/pointer/arrow.carbon +++ b/toolchain/check/testdata/pointer/arrow.carbon @@ -57,9 +57,11 @@ fn Foo(ptr: C*) { // CHECK:STDOUT: %ptr.patt: %ptr.1 = binding_pattern ptr // CHECK:STDOUT: %ptr.param_patt: %ptr.1 = value_param_pattern %ptr.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %ptr.loc16_14: type = ptr_type %C [template = constants.%ptr.1] // CHECK:STDOUT: %ptr.param: %ptr.1 = value_param runtime_param0 +// CHECK:STDOUT: %.loc16: type = splice_block %ptr.loc16_14 [template = constants.%ptr.1] { +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %ptr.loc16_14: type = ptr_type %C [template = constants.%ptr.1] +// CHECK:STDOUT: } // CHECK:STDOUT: %ptr.loc16_8: %ptr.1 = bind_name ptr, %ptr.param // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -69,12 +71,10 @@ fn Foo(ptr: C*) { // CHECK:STDOUT: %self.patt: %C = binding_pattern self // CHECK:STDOUT: %self.param_patt: %C = value_param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C [template = constants.%C] // CHECK:STDOUT: %self.param: %C = value_param runtime_param0 +// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C [template = constants.%C] // CHECK:STDOUT: %self: %C = bind_name self, %self.param // CHECK:STDOUT: } -// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %ptr: type = ptr_type %C [template = constants.%ptr.1] // CHECK:STDOUT: %.loc13: %C.elem = field_decl field, element0 [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.field [template = constants.%complete_type] // CHECK:STDOUT: diff --git a/toolchain/check/testdata/pointer/basic.carbon b/toolchain/check/testdata/pointer/basic.carbon index d7995fe7d9fe2..fccad22cad273 100644 --- a/toolchain/check/testdata/pointer/basic.carbon +++ b/toolchain/check/testdata/pointer/basic.carbon @@ -52,8 +52,8 @@ fn F() -> i32 { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } @@ -61,8 +61,6 @@ fn F() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: fn @F() -> %i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int_32.loc12: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc12: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %n.var: ref %i32 = var n // CHECK:STDOUT: %n: ref %i32 = bind_name n, %n.var // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] @@ -72,9 +70,6 @@ fn F() -> i32 { // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.2] // CHECK:STDOUT: %.loc12: init %i32 = converted %int_0, %int.convert_checked [template = constants.%int_0.2] // CHECK:STDOUT: assign %n.var, %.loc12 -// CHECK:STDOUT: %int_32.loc13: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc13: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %ptr: type = ptr_type %i32 [template = constants.%ptr] // CHECK:STDOUT: %p.var: ref %ptr = var p // CHECK:STDOUT: %p: ref %ptr = bind_name p, %p.var // CHECK:STDOUT: %n.ref: ref %i32 = name_ref n, %n diff --git a/toolchain/check/testdata/pointer/fail_address_of_value.carbon b/toolchain/check/testdata/pointer/fail_address_of_value.carbon index 2748d4f5e2389..ef9fad1bb387d 100644 --- a/toolchain/check/testdata/pointer/fail_address_of_value.carbon +++ b/toolchain/check/testdata/pointer/fail_address_of_value.carbon @@ -193,9 +193,11 @@ fn AddressOfParam(param: i32) { // CHECK:STDOUT: %param.patt: %i32 = binding_pattern param // CHECK:STDOUT: %param.param_patt: %i32 = value_param_pattern %param.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc95: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc95: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %param.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc95: type = splice_block %i32 [template = constants.%i32] { +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %param: %i32 = bind_name param, %param.param // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -285,9 +287,6 @@ fn AddressOfParam(param: i32) { // CHECK:STDOUT: // CHECK:STDOUT: fn @AddressOfParam(%param.param_patt: %i32) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int_32.loc99: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc99: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %ptr: type = ptr_type %i32 [template = constants.%ptr.7] // CHECK:STDOUT: %param_addr.var: ref %ptr.7 = var param_addr // CHECK:STDOUT: %param_addr: ref %ptr.7 = bind_name param_addr, %param_addr.var // CHECK:STDOUT: %param.ref: %i32 = name_ref param, %param diff --git a/toolchain/check/testdata/pointer/fail_deref_error.carbon b/toolchain/check/testdata/pointer/fail_deref_error.carbon index a396b0f7dad54..51b40e66aa84a 100644 --- a/toolchain/check/testdata/pointer/fail_deref_error.carbon +++ b/toolchain/check/testdata/pointer/fail_deref_error.carbon @@ -40,10 +40,6 @@ let n2: i32 = undeclared->foo; // CHECK:STDOUT: .n2 = @__global_init.%n2 // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int_32.loc15: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc15: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { diff --git a/toolchain/check/testdata/pointer/fail_deref_not_pointer.carbon b/toolchain/check/testdata/pointer/fail_deref_not_pointer.carbon index 59e46091f0294..a3ed1a193a9ee 100644 --- a/toolchain/check/testdata/pointer/fail_deref_not_pointer.carbon +++ b/toolchain/check/testdata/pointer/fail_deref_not_pointer.carbon @@ -71,9 +71,11 @@ fn Deref(n: i32) { // CHECK:STDOUT: %n.patt: %i32 = binding_pattern n // CHECK:STDOUT: %n.param_patt: %i32 = value_param_pattern %n.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %n.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc11: type = splice_block %i32 [template = constants.%i32] { +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %n: %i32 = bind_name n, %n.param // CHECK:STDOUT: } // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/pointer/fail_deref_type.carbon b/toolchain/check/testdata/pointer/fail_deref_type.carbon index 949b3b0639d9e..85f431b0af84d 100644 --- a/toolchain/check/testdata/pointer/fail_deref_type.carbon +++ b/toolchain/check/testdata/pointer/fail_deref_type.carbon @@ -24,8 +24,6 @@ var p2: i32->foo; // CHECK:STDOUT: --- fail_deref_type.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -43,15 +41,8 @@ var p2: i32->foo; // CHECK:STDOUT: .p2 = %p2 // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int_32.loc18: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc18: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc18: ref = deref %i32.loc18 // CHECK:STDOUT: %p.var: ref = var p // CHECK:STDOUT: %p: ref = bind_name p, %p.var -// CHECK:STDOUT: %int_32.loc22: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc22: ref = deref %i32.loc22 -// CHECK:STDOUT: %foo.ref: = name_ref foo, [template = ] // CHECK:STDOUT: %p2.var: ref = var p2 // CHECK:STDOUT: %p2: ref = bind_name p2, %p2.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/pointer/fail_type_mismatch.carbon b/toolchain/check/testdata/pointer/fail_type_mismatch.carbon index 54e9aa51a3ca3..7526c805e070d 100644 --- a/toolchain/check/testdata/pointer/fail_type_mismatch.carbon +++ b/toolchain/check/testdata/pointer/fail_type_mismatch.carbon @@ -50,15 +50,17 @@ fn ConstMismatch(p: const {}*) -> const ({}*) { // CHECK:STDOUT: %return.patt: %const.2 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %const.2 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc11_28: %empty_struct_type = struct_literal () -// CHECK:STDOUT: %.loc11_21: type = converted %.loc11_28, constants.%empty_struct_type [template = constants.%empty_struct_type] -// CHECK:STDOUT: %const.loc11_21: type = const_type %empty_struct_type [template = constants.%const.1] -// CHECK:STDOUT: %ptr.loc11_29: type = ptr_type %const.1 [template = constants.%ptr.1] // CHECK:STDOUT: %.loc11_43: %empty_struct_type = struct_literal () // CHECK:STDOUT: %.loc11_44: type = converted %.loc11_43, constants.%empty_struct_type [template = constants.%empty_struct_type] // CHECK:STDOUT: %ptr.loc11_44: type = ptr_type %empty_struct_type [template = constants.%ptr.2] // CHECK:STDOUT: %const.loc11_35: type = const_type %ptr.2 [template = constants.%const.2] // CHECK:STDOUT: %p.param: %ptr.1 = value_param runtime_param0 +// CHECK:STDOUT: %.loc11_29: type = splice_block %ptr.loc11_29 [template = constants.%ptr.1] { +// CHECK:STDOUT: %.loc11_28: %empty_struct_type = struct_literal () +// CHECK:STDOUT: %.loc11_21: type = converted %.loc11_28, constants.%empty_struct_type [template = constants.%empty_struct_type] +// CHECK:STDOUT: %const.loc11_21: type = const_type %empty_struct_type [template = constants.%const.1] +// CHECK:STDOUT: %ptr.loc11_29: type = ptr_type %const.1 [template = constants.%ptr.1] +// CHECK:STDOUT: } // CHECK:STDOUT: %p: %ptr.1 = bind_name p, %p.param // CHECK:STDOUT: %return.param: ref %const.2 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %const.2 = return_slot %return.param diff --git a/toolchain/check/testdata/pointer/import.carbon b/toolchain/check/testdata/pointer/import.carbon index 3018624adfec4..5761bc7bab678 100644 --- a/toolchain/check/testdata/pointer/import.carbon +++ b/toolchain/check/testdata/pointer/import.carbon @@ -53,13 +53,8 @@ var a: i32* = a_ref; // CHECK:STDOUT: .a_ref = %a_ref // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int_32.loc4: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc4: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a_orig.var: ref %i32 = var a_orig // CHECK:STDOUT: %a_orig: ref %i32 = bind_name a_orig, %a_orig.var -// CHECK:STDOUT: %int_32.loc5: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc5: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %ptr: type = ptr_type %i32 [template = constants.%ptr] // CHECK:STDOUT: %a_ref.var: ref %ptr = var a_ref // CHECK:STDOUT: %a_ref: ref %ptr = bind_name a_ref, %a_ref.var // CHECK:STDOUT: } @@ -107,9 +102,6 @@ var a: i32* = a_ref; // CHECK:STDOUT: %Implicit.import = import Implicit // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %ptr: type = ptr_type %i32 [template = constants.%ptr] // CHECK:STDOUT: %a.var: ref %ptr = var a // CHECK:STDOUT: %a: ref %ptr = bind_name a, %a.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/pointer/nested_const.carbon b/toolchain/check/testdata/pointer/nested_const.carbon index 81a95ce749b08..a76b1e3d43bfb 100644 --- a/toolchain/check/testdata/pointer/nested_const.carbon +++ b/toolchain/check/testdata/pointer/nested_const.carbon @@ -47,17 +47,19 @@ fn F(p: const (const (const i32*)*)) -> const i32 { // CHECK:STDOUT: %return.patt: %const.1 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %const.1 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc12_29: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc12_29: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %const.loc12_23: type = const_type %i32 [template = constants.%const.1] -// CHECK:STDOUT: %ptr.loc12_32: type = ptr_type %const.1 [template = constants.%ptr.1] -// CHECK:STDOUT: %const.loc12_16: type = const_type %ptr.1 [template = constants.%const.2] -// CHECK:STDOUT: %ptr.loc12_34: type = ptr_type %const.2 [template = constants.%ptr.2] -// CHECK:STDOUT: %const.loc12_9: type = const_type %ptr.2 [template = constants.%const.3] // CHECK:STDOUT: %int_32.loc12_47: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc12_47: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %const.loc12_41: type = const_type %i32 [template = constants.%const.1] // CHECK:STDOUT: %p.param: %const.3 = value_param runtime_param0 +// CHECK:STDOUT: %.loc12: type = splice_block %const.loc12_9 [template = constants.%const.3] { +// CHECK:STDOUT: %int_32.loc12_29: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc12_29: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %const.loc12_23: type = const_type %i32 [template = constants.%const.1] +// CHECK:STDOUT: %ptr.loc12_32: type = ptr_type %const.1 [template = constants.%ptr.1] +// CHECK:STDOUT: %const.loc12_16: type = const_type %ptr.1 [template = constants.%const.2] +// CHECK:STDOUT: %ptr.loc12_34: type = ptr_type %const.2 [template = constants.%ptr.2] +// CHECK:STDOUT: %const.loc12_9: type = const_type %ptr.2 [template = constants.%const.3] +// CHECK:STDOUT: } // CHECK:STDOUT: %p: %const.3 = bind_name p, %p.param // CHECK:STDOUT: %return.param: ref %const.1 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %const.1 = return_slot %return.param diff --git a/toolchain/check/testdata/pointer/types.carbon b/toolchain/check/testdata/pointer/types.carbon index 8700887e6d7a7..2a1757100e390 100644 --- a/toolchain/check/testdata/pointer/types.carbon +++ b/toolchain/check/testdata/pointer/types.carbon @@ -51,13 +51,15 @@ fn ConstPtr(p: const i32*) -> (const i32)* { // CHECK:STDOUT: %return.patt: %ptr.1 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %ptr.1 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc11_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc11_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %ptr.loc11_14: type = ptr_type %i32 [template = constants.%ptr.1] // CHECK:STDOUT: %int_32.loc11_20: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc11_20: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %ptr.loc11_23: type = ptr_type %i32 [template = constants.%ptr.1] // CHECK:STDOUT: %p.param: %ptr.1 = value_param runtime_param0 +// CHECK:STDOUT: %.loc11: type = splice_block %ptr.loc11_14 [template = constants.%ptr.1] { +// CHECK:STDOUT: %int_32.loc11_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc11_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %ptr.loc11_14: type = ptr_type %i32 [template = constants.%ptr.1] +// CHECK:STDOUT: } // CHECK:STDOUT: %p: %ptr.1 = bind_name p, %p.param // CHECK:STDOUT: %return.param: ref %ptr.1 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %ptr.1 = return_slot %return.param @@ -68,15 +70,17 @@ fn ConstPtr(p: const i32*) -> (const i32)* { // CHECK:STDOUT: %return.patt: %ptr.2 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %ptr.2 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc15_22: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc15_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %const.loc15_16: type = const_type %i32 [template = constants.%const] -// CHECK:STDOUT: %ptr.loc15_25: type = ptr_type %const [template = constants.%ptr.2] // CHECK:STDOUT: %int_32.loc15_38: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc15_38: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %const.loc15_32: type = const_type %i32 [template = constants.%const] // CHECK:STDOUT: %ptr.loc15_42: type = ptr_type %const [template = constants.%ptr.2] // CHECK:STDOUT: %p.param: %ptr.2 = value_param runtime_param0 +// CHECK:STDOUT: %.loc15: type = splice_block %ptr.loc15_25 [template = constants.%ptr.2] { +// CHECK:STDOUT: %int_32.loc15_22: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc15_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %const.loc15_16: type = const_type %i32 [template = constants.%const] +// CHECK:STDOUT: %ptr.loc15_25: type = ptr_type %const [template = constants.%ptr.2] +// CHECK:STDOUT: } // CHECK:STDOUT: %p: %ptr.2 = bind_name p, %p.param // CHECK:STDOUT: %return.param: ref %ptr.2 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %ptr.2 = return_slot %return.param diff --git a/toolchain/check/testdata/return/code_after_return_value.carbon b/toolchain/check/testdata/return/code_after_return_value.carbon index 3f9d17e362790..7f00bf9e07059 100644 --- a/toolchain/check/testdata/return/code_after_return_value.carbon +++ b/toolchain/check/testdata/return/code_after_return_value.carbon @@ -61,12 +61,14 @@ fn F(b: bool) -> i32 { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc11_9.1: type = value_of_initializer %bool.make_type [template = bool] -// CHECK:STDOUT: %.loc11_9.2: type = converted %bool.make_type, %.loc11_9.1 [template = bool] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %b.param: bool = value_param runtime_param0 +// CHECK:STDOUT: %.loc11_9.3: type = splice_block %.loc11_9.2 [template = bool] { +// CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] +// CHECK:STDOUT: %.loc11_9.1: type = value_of_initializer %bool.make_type [template = bool] +// CHECK:STDOUT: %.loc11_9.2: type = converted %bool.make_type, %.loc11_9.1 [template = bool] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: bool = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param diff --git a/toolchain/check/testdata/return/fail_return_with_returned_var.carbon b/toolchain/check/testdata/return/fail_return_with_returned_var.carbon index facaa2f2f069f..a498ef33bee63 100644 --- a/toolchain/check/testdata/return/fail_return_with_returned_var.carbon +++ b/toolchain/check/testdata/return/fail_return_with_returned_var.carbon @@ -86,8 +86,8 @@ fn G() -> C { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } @@ -96,18 +96,14 @@ fn G() -> C { // CHECK:STDOUT: %return.patt: %C = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %C = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref.loc24: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %return.param: ref %C = out_param runtime_param0 // CHECK:STDOUT: %return: ref %C = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { -// CHECK:STDOUT: %int_32.loc23_18: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc23_18: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc23_16: %C.elem = field_decl a, element0 [template] -// CHECK:STDOUT: %int_32.loc23_30: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc23_30: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc23_28: %C.elem = field_decl b, element1 [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a.b.1 [template = constants.%complete_type.4] // CHECK:STDOUT: @@ -120,8 +116,6 @@ fn G() -> C { // CHECK:STDOUT: // CHECK:STDOUT: fn @F() -> %i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int_32.loc12: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc12: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %v.var: ref %i32 = var v // CHECK:STDOUT: %v: ref %i32 = bind_name v, %v.var // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] @@ -137,7 +131,6 @@ fn G() -> C { // CHECK:STDOUT: // CHECK:STDOUT: fn @G() -> %return.param_patt: %C { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %C.ref.loc25: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %c: ref %C = bind_name c, %return // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] diff --git a/toolchain/check/testdata/return/fail_returned_var_no_return_type.carbon b/toolchain/check/testdata/return/fail_returned_var_no_return_type.carbon index 67376a18bbc87..08478b66afd43 100644 --- a/toolchain/check/testdata/return/fail_returned_var_no_return_type.carbon +++ b/toolchain/check/testdata/return/fail_returned_var_no_return_type.carbon @@ -65,10 +65,8 @@ fn ForgotReturnType() { // CHECK:STDOUT: // CHECK:STDOUT: fn @Procedure() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc12_20.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc12_20.2: type = converted %.loc12_20.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %v: %empty_tuple.type = bind_name v, -// CHECK:STDOUT: %.loc12_25: %empty_tuple.type = tuple_literal () +// CHECK:STDOUT: %.loc12: %empty_tuple.type = tuple_literal () // CHECK:STDOUT: assign , // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -100,8 +98,6 @@ fn ForgotReturnType() { // CHECK:STDOUT: // CHECK:STDOUT: fn @ForgotReturnType() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc11_20.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc11_20.2: type = converted %.loc11_20.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %v: %empty_tuple.type = bind_name v, // CHECK:STDOUT: %.loc11_25: %empty_tuple.type = tuple_literal () // CHECK:STDOUT: assign , diff --git a/toolchain/check/testdata/return/fail_returned_var_shadow.carbon b/toolchain/check/testdata/return/fail_returned_var_shadow.carbon index e28c88a735185..87d743bd61cb0 100644 --- a/toolchain/check/testdata/return/fail_returned_var_shadow.carbon +++ b/toolchain/check/testdata/return/fail_returned_var_shadow.carbon @@ -83,8 +83,8 @@ fn DifferentScopes() -> i32 { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } @@ -92,8 +92,8 @@ fn DifferentScopes() -> i32 { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc26: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc26: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } @@ -105,8 +105,6 @@ fn DifferentScopes() -> i32 { // CHECK:STDOUT: if %true br !if.then else br !if.else // CHECK:STDOUT: // CHECK:STDOUT: !if.then: -// CHECK:STDOUT: %int_32.loc13: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc13: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %v.var: ref %i32 = var v // CHECK:STDOUT: %v: ref %i32 = bind_name v, %v.var // CHECK:STDOUT: %int_0.loc13: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] @@ -116,8 +114,6 @@ fn DifferentScopes() -> i32 { // CHECK:STDOUT: %int.convert_checked.loc13: init %i32 = call %Convert.specific_fn.loc13(%int_0.loc13) [template = constants.%int_0.2] // CHECK:STDOUT: %.loc13: init %i32 = converted %int_0.loc13, %int.convert_checked.loc13 [template = constants.%int_0.2] // CHECK:STDOUT: assign %v.var, %.loc13 -// CHECK:STDOUT: %int_32.loc21: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc21: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %w.var: ref %i32 = var w // CHECK:STDOUT: %w: ref %i32 = bind_name w, %w.var // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] @@ -146,8 +142,6 @@ fn DifferentScopes() -> i32 { // CHECK:STDOUT: if %true.loc27 br !if.then.loc27 else br !if.else.loc27 // CHECK:STDOUT: // CHECK:STDOUT: !if.then.loc27: -// CHECK:STDOUT: %int_32.loc28: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc28: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %v.var: ref %i32 = var v // CHECK:STDOUT: %v: ref %i32 = bind_name v, %v.var // CHECK:STDOUT: %int_0.loc28: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] @@ -161,8 +155,6 @@ fn DifferentScopes() -> i32 { // CHECK:STDOUT: if %true.loc29 br !if.then.loc29 else br !if.else.loc29 // CHECK:STDOUT: // CHECK:STDOUT: !if.then.loc29: -// CHECK:STDOUT: %int_32.loc36: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc36: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %w.var: ref %i32 = var w // CHECK:STDOUT: %w: ref %i32 = bind_name w, %w.var // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] diff --git a/toolchain/check/testdata/return/fail_returned_var_type.carbon b/toolchain/check/testdata/return/fail_returned_var_type.carbon index 90c2af009b35c..2cace038a3603 100644 --- a/toolchain/check/testdata/return/fail_returned_var_type.carbon +++ b/toolchain/check/testdata/return/fail_returned_var_type.carbon @@ -26,9 +26,6 @@ fn Mismatch() -> i32 { // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %Mismatch.type: type = fn_type @Mismatch [template] // CHECK:STDOUT: %Mismatch: %Mismatch.type = struct_value () [template] -// CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [template] -// CHECK:STDOUT: %Float.type: type = fn_type @Float [template] -// CHECK:STDOUT: %Float: %Float.type = struct_value () [template] // CHECK:STDOUT: %float: f64 = float_literal 0 [template] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -60,10 +57,6 @@ fn Mismatch() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: fn @Mismatch() -> %i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type: init type = call constants.%Float(%int_64) [template = f64] -// CHECK:STDOUT: %.loc18_19.1: type = value_of_initializer %float.make_type [template = f64] -// CHECK:STDOUT: %.loc18_19.2: type = converted %float.make_type, %.loc18_19.1 [template = f64] // CHECK:STDOUT: %v: f64 = bind_name v, // CHECK:STDOUT: %float: f64 = float_literal 0 [template = constants.%float] // CHECK:STDOUT: assign , diff --git a/toolchain/check/testdata/return/no_prelude/import_convert_function.carbon b/toolchain/check/testdata/return/no_prelude/import_convert_function.carbon index b733e0aff3b48..773f23ce8f265 100644 --- a/toolchain/check/testdata/return/no_prelude/import_convert_function.carbon +++ b/toolchain/check/testdata/return/no_prelude/import_convert_function.carbon @@ -112,11 +112,13 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %return.patt: type = return_slot_pattern // CHECK:STDOUT: %return.param_patt: type = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [template = constants.%IntLiteral] -// CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral] -// CHECK:STDOUT: %.loc6_22.1: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral] -// CHECK:STDOUT: %.loc6_22.2: type = converted %int_literal.make_type, %.loc6_22.1 [template = Core.IntLiteral] // CHECK:STDOUT: %N.param: Core.IntLiteral = value_param runtime_param0 +// CHECK:STDOUT: %.loc6_22.3: type = splice_block %.loc6_22.2 [template = Core.IntLiteral] { +// CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [template = constants.%IntLiteral] +// CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral] +// CHECK:STDOUT: %.loc6_22.1: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral] +// CHECK:STDOUT: %.loc6_22.2: type = converted %int_literal.make_type, %.loc6_22.1 [template = Core.IntLiteral] +// CHECK:STDOUT: } // CHECK:STDOUT: %N: Core.IntLiteral = bind_name N, %N.param // CHECK:STDOUT: %return.param: ref type = out_param runtime_param1 // CHECK:STDOUT: %return: ref type = return_slot %return.param @@ -162,12 +164,14 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %return.patt: @Convert.1.%T (%T) = return_slot_pattern // CHECK:STDOUT: %return.param_patt: @Convert.1.%T (%T) = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc9_20.1: @Convert.1.%ImplicitAs.type (%ImplicitAs.type.2) = specific_constant @ImplicitAs.%Self.1, @ImplicitAs(constants.%T) [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %Self.ref: @Convert.1.%ImplicitAs.type (%ImplicitAs.type.2) = name_ref Self, %.loc9_20.1 [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %Self.as_type.loc9_20.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc9_20.1 (constants.%Self.as_type)] -// CHECK:STDOUT: %.loc9_20.2: type = converted %Self.ref, %Self.as_type.loc9_20.2 [symbolic = %Self.as_type.loc9_20.1 (constants.%Self.as_type)] // CHECK:STDOUT: %T.ref: type = name_ref T, @ImplicitAs.%T.loc8_22.1 [symbolic = %T (constants.%T)] // CHECK:STDOUT: %self.param: @Convert.1.%Self.as_type.loc9_20.1 (%Self.as_type) = value_param runtime_param0 +// CHECK:STDOUT: %.loc9_20.3: type = splice_block %.loc9_20.2 [symbolic = %Self.as_type.loc9_20.1 (constants.%Self.as_type)] { +// CHECK:STDOUT: %.loc9_20.1: @Convert.1.%ImplicitAs.type (%ImplicitAs.type.2) = specific_constant @ImplicitAs.%Self.1, @ImplicitAs(constants.%T) [symbolic = %Self (constants.%Self)] +// CHECK:STDOUT: %Self.ref: @Convert.1.%ImplicitAs.type (%ImplicitAs.type.2) = name_ref Self, %.loc9_20.1 [symbolic = %Self (constants.%Self)] +// CHECK:STDOUT: %Self.as_type.loc9_20.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc9_20.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %.loc9_20.2: type = converted %Self.ref, %Self.as_type.loc9_20.2 [symbolic = %Self.as_type.loc9_20.1 (constants.%Self.as_type)] +// CHECK:STDOUT: } // CHECK:STDOUT: %self: @Convert.1.%Self.as_type.loc9_20.1 (%Self.as_type) = bind_name self, %self.param // CHECK:STDOUT: %return.param: ref @Convert.1.%T (%T) = out_param runtime_param1 // CHECK:STDOUT: %return: ref @Convert.1.%T (%T) = return_slot %return.param @@ -188,12 +192,12 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %return.patt: %i32.builtin = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32.builtin = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref: type = name_ref Self, @impl.%.loc12_17.2 [template = Core.IntLiteral] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32.builtin] // CHECK:STDOUT: %.loc13_31.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32.builtin] // CHECK:STDOUT: %.loc13_31.2: type = converted %int.make_type_signed, %.loc13_31.1 [template = constants.%i32.builtin] // CHECK:STDOUT: %self.param: Core.IntLiteral = value_param runtime_param0 +// CHECK:STDOUT: %Self.ref: type = name_ref Self, @impl.%.loc12_17.2 [template = Core.IntLiteral] // CHECK:STDOUT: %self: Core.IntLiteral = bind_name self, %self.param // CHECK:STDOUT: %return.param: ref %i32.builtin = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32.builtin = return_slot %return.param @@ -376,7 +380,7 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: import Core//default // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.2: %ImplicitAs.type.1 = import_ref Core//default, ImplicitAs, loaded [template = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %import_ref.3 = import_ref Core//default, inst48 [no loc], unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref Core//default, inst49 [no loc], unloaded // CHECK:STDOUT: %import_ref.4: @ImplicitAs.%Convert.assoc_type (%Convert.assoc_type.1) = import_ref Core//default, loc9_32, loaded [symbolic = @ImplicitAs.%assoc0 (constants.%assoc0.3)] // CHECK:STDOUT: %import_ref.5: @ImplicitAs.%Convert.type (%Convert.type.1) = import_ref Core//default, Convert, loaded [symbolic = @ImplicitAs.%Convert (constants.%Convert.1)] // CHECK:STDOUT: %import_ref.6 = import_ref Core//default, loc9_32, unloaded @@ -397,11 +401,13 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %N.patt.loc6_9.1: %i32.builtin = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc6_9.2 (constants.%N.patt)] // CHECK:STDOUT: %N.param_patt: %i32.builtin = value_param_pattern %N.patt.loc6_9.1, runtime_param [symbolic = %N.patt.loc6_9.2 (constants.%N.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32.builtin] -// CHECK:STDOUT: %.loc6_13.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32.builtin] -// CHECK:STDOUT: %.loc6_13.2: type = converted %int.make_type_signed, %.loc6_13.1 [template = constants.%i32.builtin] // CHECK:STDOUT: %N.param: %i32.builtin = value_param runtime_param +// CHECK:STDOUT: %.loc6_13.3: type = splice_block %.loc6_13.2 [template = constants.%i32.builtin] { +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32.builtin] +// CHECK:STDOUT: %.loc6_13.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32.builtin] +// CHECK:STDOUT: %.loc6_13.2: type = converted %int.make_type_signed, %.loc6_13.1 [template = constants.%i32.builtin] +// CHECK:STDOUT: } // CHECK:STDOUT: %N.loc6_9.1: %i32.builtin = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc6_9.2 (constants.%N)] // CHECK:STDOUT: } // CHECK:STDOUT: %D.decl: type = class_decl @D [template = constants.%D] {} {} @@ -559,9 +565,9 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %return.patt: %D = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %D = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref: type = name_ref Self, @impl.2.%C [template = constants.%C.2] // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [template = constants.%D] // CHECK:STDOUT: %self.param: %C.2 = value_param runtime_param0 +// CHECK:STDOUT: %Self.ref: type = name_ref Self, @impl.2.%C [template = constants.%C.2] // CHECK:STDOUT: %self: %C.2 = bind_name self, %self.param // CHECK:STDOUT: %return.param: ref %D = out_param runtime_param1 // CHECK:STDOUT: %return: ref %D = return_slot %return.param @@ -580,9 +586,9 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %return.patt: %D = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %D = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref: type = name_ref Self, @impl.3.%C [template = constants.%C.3] // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [template = constants.%D] // CHECK:STDOUT: %self.param: %C.3 = value_param runtime_param0 +// CHECK:STDOUT: %Self.ref: type = name_ref Self, @impl.3.%C [template = constants.%C.3] // CHECK:STDOUT: %self: %C.3 = bind_name self, %self.param // CHECK:STDOUT: %return.param: ref %D = out_param runtime_param1 // CHECK:STDOUT: %return: ref %D = return_slot %return.param @@ -601,9 +607,9 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %return.patt: %D = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %D = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref: type = name_ref Self, @impl.4.%C [template = constants.%C.4] // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [template = constants.%D] // CHECK:STDOUT: %self.param: %C.4 = value_param runtime_param0 +// CHECK:STDOUT: %Self.ref: type = name_ref Self, @impl.4.%C [template = constants.%C.4] // CHECK:STDOUT: %self: %C.4 = bind_name self, %self.param // CHECK:STDOUT: %return.param: ref %D = out_param runtime_param1 // CHECK:STDOUT: %return: ref %D = return_slot %return.param @@ -622,9 +628,9 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %return.patt: %D = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %D = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref: type = name_ref Self, @impl.5.%C [template = constants.%C.5] // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [template = constants.%D] // CHECK:STDOUT: %self.param: %C.5 = value_param runtime_param0 +// CHECK:STDOUT: %Self.ref: type = name_ref Self, @impl.5.%C [template = constants.%C.5] // CHECK:STDOUT: %self: %C.5 = bind_name self, %self.param // CHECK:STDOUT: %return.param: ref %D = out_param runtime_param1 // CHECK:STDOUT: %return: ref %D = return_slot %return.param @@ -643,9 +649,9 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %return.patt: %D = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %D = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref: type = name_ref Self, @impl.6.%C [template = constants.%C.6] // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [template = constants.%D] // CHECK:STDOUT: %self.param: %C.6 = value_param runtime_param0 +// CHECK:STDOUT: %Self.ref: type = name_ref Self, @impl.6.%C [template = constants.%C.6] // CHECK:STDOUT: %self: %C.6 = bind_name self, %self.param // CHECK:STDOUT: %return.param: ref %D = out_param runtime_param1 // CHECK:STDOUT: %return: ref %D = return_slot %return.param @@ -664,9 +670,9 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %return.patt: %D = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %D = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref: type = name_ref Self, @impl.7.%C [template = constants.%C.7] // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [template = constants.%D] // CHECK:STDOUT: %self.param: %C.7 = value_param runtime_param0 +// CHECK:STDOUT: %Self.ref: type = name_ref Self, @impl.7.%C [template = constants.%C.7] // CHECK:STDOUT: %self: %C.7 = bind_name self, %self.param // CHECK:STDOUT: %return.param: ref %D = out_param runtime_param1 // CHECK:STDOUT: %return: ref %D = return_slot %return.param @@ -685,9 +691,9 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %return.patt: %D = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %D = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref: type = name_ref Self, @impl.8.%C [template = constants.%C.8] // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [template = constants.%D] // CHECK:STDOUT: %self.param: %C.8 = value_param runtime_param0 +// CHECK:STDOUT: %Self.ref: type = name_ref Self, @impl.8.%C [template = constants.%C.8] // CHECK:STDOUT: %self: %C.8 = bind_name self, %self.param // CHECK:STDOUT: %return.param: ref %D = out_param runtime_param1 // CHECK:STDOUT: %return: ref %D = return_slot %return.param @@ -706,9 +712,9 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %return.patt: %D = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %D = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref: type = name_ref Self, @impl.9.%C [template = constants.%C.9] // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [template = constants.%D] // CHECK:STDOUT: %self.param: %C.9 = value_param runtime_param0 +// CHECK:STDOUT: %Self.ref: type = name_ref Self, @impl.9.%C [template = constants.%C.9] // CHECK:STDOUT: %self: %C.9 = bind_name self, %self.param // CHECK:STDOUT: %return.param: ref %D = out_param runtime_param1 // CHECK:STDOUT: %return: ref %D = return_slot %return.param @@ -736,15 +742,7 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @D { -// CHECK:STDOUT: %int_32.loc7_18: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc7_18: init type = call constants.%Int(%int_32.loc7_18) [template = constants.%i32.builtin] -// CHECK:STDOUT: %.loc7_18.1: type = value_of_initializer %int.make_type_signed.loc7_18 [template = constants.%i32.builtin] -// CHECK:STDOUT: %.loc7_18.2: type = converted %int.make_type_signed.loc7_18, %.loc7_18.1 [template = constants.%i32.builtin] // CHECK:STDOUT: %.loc7_16: %D.elem = field_decl n, element0 [template] -// CHECK:STDOUT: %int_32.loc7_30: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed.loc7_30: init type = call constants.%Int(%int_32.loc7_30) [template = constants.%i32.builtin] -// CHECK:STDOUT: %.loc7_30.1: type = value_of_initializer %int.make_type_signed.loc7_30 [template = constants.%i32.builtin] -// CHECK:STDOUT: %.loc7_30.2: type = converted %int.make_type_signed.loc7_30, %.loc7_30.1 [template = constants.%i32.builtin] // CHECK:STDOUT: %.loc7_28: %D.elem = field_decl m, element1 [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.n.m.1 [template = constants.%complete_type.2] // CHECK:STDOUT: @@ -1137,13 +1135,13 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.2: type = import_ref P//library, D, loaded [template = constants.%D] // CHECK:STDOUT: %import_ref.3: = import_ref P//library, loc7_35, loaded [template = constants.%complete_type.1] -// CHECK:STDOUT: %import_ref.4 = import_ref P//library, inst46 [no loc], unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref P//library, inst47 [no loc], unloaded // CHECK:STDOUT: %import_ref.5 = import_ref P//library, loc7_16, unloaded // CHECK:STDOUT: %import_ref.6 = import_ref P//library, loc7_28, unloaded // CHECK:STDOUT: %import_ref.7: %C.type = import_ref P//library, C, loaded [template = constants.%C.generic] // CHECK:STDOUT: %import_ref.8: = import_ref P//library, loc6_19, loaded [template = constants.%complete_type.2] -// CHECK:STDOUT: %import_ref.9 = import_ref P//library, inst41 [no loc], unloaded -// CHECK:STDOUT: %import_ref.11 = import_ref Core//default, inst48 [no loc], unloaded +// CHECK:STDOUT: %import_ref.9 = import_ref P//library, inst42 [no loc], unloaded +// CHECK:STDOUT: %import_ref.11 = import_ref Core//default, inst49 [no loc], unloaded // CHECK:STDOUT: %import_ref.12: @ImplicitAs.%Convert.assoc_type (%Convert.assoc_type.1) = import_ref Core//default, loc9_32, loaded [symbolic = @ImplicitAs.%assoc0 (constants.%assoc0.3)] // CHECK:STDOUT: %import_ref.13 = import_ref Core//default, Convert, unloaded // CHECK:STDOUT: %import_ref.14 = import_ref Core//default, loc9_32, unloaded @@ -1191,13 +1189,15 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %return.patt: %D = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %D = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32.builtin] -// CHECK:STDOUT: %.loc7_10.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32.builtin] -// CHECK:STDOUT: %.loc7_10.2: type = converted %int.make_type_signed, %.loc7_10.1 [template = constants.%i32.builtin] // CHECK:STDOUT: %P.ref.loc7: = name_ref P, imports.%P [template = imports.%P] // CHECK:STDOUT: %D.ref: type = name_ref D, imports.%import_ref.2 [template = constants.%D] // CHECK:STDOUT: %n.param: %i32.builtin = value_param runtime_param0 +// CHECK:STDOUT: %.loc7_10.3: type = splice_block %.loc7_10.2 [template = constants.%i32.builtin] { +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32.builtin] +// CHECK:STDOUT: %.loc7_10.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32.builtin] +// CHECK:STDOUT: %.loc7_10.2: type = converted %int.make_type_signed, %.loc7_10.1 [template = constants.%i32.builtin] +// CHECK:STDOUT: } // CHECK:STDOUT: %n: %i32.builtin = bind_name n, %n.param // CHECK:STDOUT: %return.param: ref %D = out_param runtime_param1 // CHECK:STDOUT: %return: ref %D = return_slot %return.param diff --git a/toolchain/check/testdata/return/returned_var.carbon b/toolchain/check/testdata/return/returned_var.carbon index 6e0bae13ebf15..a13e24ea43916 100644 --- a/toolchain/check/testdata/return/returned_var.carbon +++ b/toolchain/check/testdata/return/returned_var.carbon @@ -78,7 +78,7 @@ fn G() -> i32 { // CHECK:STDOUT: %return.patt: %C = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %C = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref.loc16: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %return.param: ref %C = out_param runtime_param0 // CHECK:STDOUT: %return: ref %C = return_slot %return.param // CHECK:STDOUT: } @@ -86,19 +86,15 @@ fn G() -> i32 { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc21: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc21: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { -// CHECK:STDOUT: %int_32.loc12: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc12: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc12: %C.elem = field_decl a, element0 [template] -// CHECK:STDOUT: %int_32.loc13: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc13: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc13: %C.elem = field_decl b, element1 [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a.b.1 [template = constants.%complete_type.3] // CHECK:STDOUT: @@ -111,7 +107,6 @@ fn G() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: fn @F() -> %return.param_patt: %C { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %C.ref.loc17: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %result: ref %C = bind_name result, %return // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] @@ -138,8 +133,6 @@ fn G() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: fn @G() -> %i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int_32.loc22: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %result.var: ref %i32 = var result // CHECK:STDOUT: %result: ref %i32 = bind_name result, %result.var // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] diff --git a/toolchain/check/testdata/return/returned_var_scope.carbon b/toolchain/check/testdata/return/returned_var_scope.carbon index 6776faa597e0d..ece1b5332b3cb 100644 --- a/toolchain/check/testdata/return/returned_var_scope.carbon +++ b/toolchain/check/testdata/return/returned_var_scope.carbon @@ -74,8 +74,8 @@ fn EnclosingButAfter(b: bool) -> i32 { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } @@ -85,12 +85,14 @@ fn EnclosingButAfter(b: bool) -> i32 { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc21_25.1: type = value_of_initializer %bool.make_type [template = bool] -// CHECK:STDOUT: %.loc21_25.2: type = converted %bool.make_type, %.loc21_25.1 [template = bool] -// CHECK:STDOUT: %int_32.loc21: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc21: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %b.param: bool = value_param runtime_param0 +// CHECK:STDOUT: %.loc21_25.3: type = splice_block %.loc21_25.2 [template = bool] { +// CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] +// CHECK:STDOUT: %.loc21_25.1: type = value_of_initializer %bool.make_type [template = bool] +// CHECK:STDOUT: %.loc21_25.2: type = converted %bool.make_type, %.loc21_25.1 [template = bool] +// CHECK:STDOUT: } // CHECK:STDOUT: %b: bool = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -103,8 +105,6 @@ fn EnclosingButAfter(b: bool) -> i32 { // CHECK:STDOUT: if %true.loc12 br !if.then.loc12 else br !if.else.loc12 // CHECK:STDOUT: // CHECK:STDOUT: !if.then.loc12: -// CHECK:STDOUT: %int_32.loc13: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc13: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %v.var: ref %i32 = var v // CHECK:STDOUT: %v: ref %i32 = bind_name v, %v.var // CHECK:STDOUT: %int_0.loc13: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] @@ -121,8 +121,6 @@ fn EnclosingButAfter(b: bool) -> i32 { // CHECK:STDOUT: if %true.loc15 br !if.then.loc15 else br !if.else.loc15 // CHECK:STDOUT: // CHECK:STDOUT: !if.then.loc15: -// CHECK:STDOUT: %int_32.loc16: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc16: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %w.var: ref %i32 = var w // CHECK:STDOUT: %w: ref %i32 = bind_name w, %w.var // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] @@ -151,8 +149,6 @@ fn EnclosingButAfter(b: bool) -> i32 { // CHECK:STDOUT: if %b.ref br !if.then else br !if.else // CHECK:STDOUT: // CHECK:STDOUT: !if.then: -// CHECK:STDOUT: %int_32.loc23: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc23: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %v.var: ref %i32 = var v // CHECK:STDOUT: %v: ref %i32 = bind_name v, %v.var // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] @@ -166,8 +162,6 @@ fn EnclosingButAfter(b: bool) -> i32 { // CHECK:STDOUT: return %.loc23_18 // CHECK:STDOUT: // CHECK:STDOUT: !if.else: -// CHECK:STDOUT: %int_32.loc26: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc26: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %w.var: ref %i32 = var w // CHECK:STDOUT: %w: ref %i32 = bind_name w, %w.var // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] diff --git a/toolchain/check/testdata/struct/fail_assign_empty.carbon b/toolchain/check/testdata/struct/fail_assign_empty.carbon index 9182423b385f6..285bd994a813e 100644 --- a/toolchain/check/testdata/struct/fail_assign_empty.carbon +++ b/toolchain/check/testdata/struct/fail_assign_empty.carbon @@ -36,9 +36,6 @@ var x: {.a: i32} = {}; // CHECK:STDOUT: .x = %x // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %struct_type.a: type = struct_type {.a: %i32} [template = constants.%struct_type.a] // CHECK:STDOUT: %x.var: ref %struct_type.a = var x // CHECK:STDOUT: %x: ref %struct_type.a = bind_name x, %x.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/struct/fail_assign_to_empty.carbon b/toolchain/check/testdata/struct/fail_assign_to_empty.carbon index 719a4c227964e..29fe517c24e18 100644 --- a/toolchain/check/testdata/struct/fail_assign_to_empty.carbon +++ b/toolchain/check/testdata/struct/fail_assign_to_empty.carbon @@ -34,8 +34,6 @@ var x: {} = {.a = 1}; // CHECK:STDOUT: .x = %x // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %.loc14_9.1: %empty_struct_type = struct_literal () -// CHECK:STDOUT: %.loc14_9.2: type = converted %.loc14_9.1, constants.%empty_struct_type [template = constants.%empty_struct_type] // CHECK:STDOUT: %x.var: ref %empty_struct_type = var x // CHECK:STDOUT: %x: ref %empty_struct_type = bind_name x, %x.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/struct/fail_duplicate_name.carbon b/toolchain/check/testdata/struct/fail_duplicate_name.carbon index 82e44977a043f..ce8779863d80c 100644 --- a/toolchain/check/testdata/struct/fail_duplicate_name.carbon +++ b/toolchain/check/testdata/struct/fail_duplicate_name.carbon @@ -103,22 +103,8 @@ var y: {.b: i32, .c: i32} = {.b = 3, .b = 4}; // CHECK:STDOUT: %return.param: ref = out_param runtime_param0 // CHECK:STDOUT: %return: ref = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %int_32.loc27_13: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc27_13: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc27_22: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc27_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc36: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc36: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc45: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc45: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %struct_type.a: type = struct_type {.a: %i32} [template = constants.%struct_type.a.2] // CHECK:STDOUT: %x.var: ref %struct_type.a.2 = var x // CHECK:STDOUT: %x: ref %struct_type.a.2 = bind_name x, %x.var -// CHECK:STDOUT: %int_32.loc53_13: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc53_13: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc53_22: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc53_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %struct_type.b.c: type = struct_type {.b: %i32, .c: %i32} [template = constants.%struct_type.b.c] // CHECK:STDOUT: %y.var: ref %struct_type.b.c = var y // CHECK:STDOUT: %y: ref %struct_type.b.c = bind_name y, %y.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/struct/fail_field_name_mismatch.carbon b/toolchain/check/testdata/struct/fail_field_name_mismatch.carbon index 8a1e0bca575bc..0836172189b97 100644 --- a/toolchain/check/testdata/struct/fail_field_name_mismatch.carbon +++ b/toolchain/check/testdata/struct/fail_field_name_mismatch.carbon @@ -45,14 +45,8 @@ var y: {.b: i32} = x; // CHECK:STDOUT: .y = %y // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int_32.loc15: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc15: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %struct_type.a: type = struct_type {.a: %i32} [template = constants.%struct_type.a] // CHECK:STDOUT: %x.var: ref %struct_type.a = var x // CHECK:STDOUT: %x: ref %struct_type.a = bind_name x, %x.var -// CHECK:STDOUT: %int_32.loc20: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc20: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %struct_type.b: type = struct_type {.b: %i32} [template = constants.%struct_type.b.2] // CHECK:STDOUT: %y.var: ref %struct_type.b.2 = var y // CHECK:STDOUT: %y: ref %struct_type.b.2 = bind_name y, %y.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/struct/fail_field_type_mismatch.carbon b/toolchain/check/testdata/struct/fail_field_type_mismatch.carbon index a364098401432..b4d182974b0ad 100644 --- a/toolchain/check/testdata/struct/fail_field_type_mismatch.carbon +++ b/toolchain/check/testdata/struct/fail_field_type_mismatch.carbon @@ -37,9 +37,6 @@ var x: {.a: i32} = {.b = 1.0}; // CHECK:STDOUT: .x = %x // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %struct_type.a: type = struct_type {.a: %i32} [template = constants.%struct_type.a] // CHECK:STDOUT: %x.var: ref %struct_type.a = var x // CHECK:STDOUT: %x: ref %struct_type.a = bind_name x, %x.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/struct/fail_member_access_type.carbon b/toolchain/check/testdata/struct/fail_member_access_type.carbon index 2bce5ec8c957b..3667d373f617c 100644 --- a/toolchain/check/testdata/struct/fail_member_access_type.carbon +++ b/toolchain/check/testdata/struct/fail_member_access_type.carbon @@ -17,9 +17,6 @@ var y: i32 = x.b; // CHECK:STDOUT: --- fail_member_access_type.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [template] -// CHECK:STDOUT: %Float.type: type = fn_type @Float [template] -// CHECK:STDOUT: %Float: %Float.type = struct_value () [template] // CHECK:STDOUT: %struct_type.a: type = struct_type {.a: f64} [template] // CHECK:STDOUT: %float: f64 = float_literal 4 [template] // CHECK:STDOUT: %struct: %struct_type.a = struct_value (%float) [template] @@ -43,15 +40,8 @@ var y: i32 = x.b; // CHECK:STDOUT: .y = %y // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type: init type = call constants.%Float(%int_64) [template = f64] -// CHECK:STDOUT: %.loc11_13.1: type = value_of_initializer %float.make_type [template = f64] -// CHECK:STDOUT: %.loc11_13.2: type = converted %float.make_type, %.loc11_13.1 [template = f64] -// CHECK:STDOUT: %struct_type.a: type = struct_type {.a: f64} [template = constants.%struct_type.a] // CHECK:STDOUT: %x.var: ref %struct_type.a = var x // CHECK:STDOUT: %x: ref %struct_type.a = bind_name x, %x.var -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %y.var: ref %i32 = var y // CHECK:STDOUT: %y: ref %i32 = bind_name y, %y.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/struct/fail_non_member_access.carbon b/toolchain/check/testdata/struct/fail_non_member_access.carbon index bf87dd513d7cd..bc66d304324a2 100644 --- a/toolchain/check/testdata/struct/fail_non_member_access.carbon +++ b/toolchain/check/testdata/struct/fail_non_member_access.carbon @@ -48,13 +48,8 @@ var y: i32 = x.b; // CHECK:STDOUT: .y = %y // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int_32.loc11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %struct_type.a: type = struct_type {.a: %i32} [template = constants.%struct_type.a.1] // CHECK:STDOUT: %x.var: ref %struct_type.a.1 = var x // CHECK:STDOUT: %x: ref %struct_type.a.1 = bind_name x, %x.var -// CHECK:STDOUT: %int_32.loc15: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc15: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %y.var: ref %i32 = var y // CHECK:STDOUT: %y: ref %i32 = bind_name y, %y.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/struct/fail_too_few_values.carbon b/toolchain/check/testdata/struct/fail_too_few_values.carbon index 41a1724505b87..ac4d51608b662 100644 --- a/toolchain/check/testdata/struct/fail_too_few_values.carbon +++ b/toolchain/check/testdata/struct/fail_too_few_values.carbon @@ -37,11 +37,6 @@ var x: {.a: i32, .b: i32} = {.a = 1}; // CHECK:STDOUT: .x = %x // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int_32.loc14_13: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc14_13: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc14_22: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc14_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %struct_type.a.b: type = struct_type {.a: %i32, .b: %i32} [template = constants.%struct_type.a.b] // CHECK:STDOUT: %x.var: ref %struct_type.a.b = var x // CHECK:STDOUT: %x: ref %struct_type.a.b = bind_name x, %x.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/struct/fail_type_assign.carbon b/toolchain/check/testdata/struct/fail_type_assign.carbon index fc8191ec155d7..46ae6394e6510 100644 --- a/toolchain/check/testdata/struct/fail_type_assign.carbon +++ b/toolchain/check/testdata/struct/fail_type_assign.carbon @@ -39,9 +39,6 @@ var x: {.a: i32} = {.a: i32}; // CHECK:STDOUT: .x = %x // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %struct_type.a: type = struct_type {.a: %i32} [template = constants.%struct_type.a] // CHECK:STDOUT: %x.var: ref %struct_type.a = var x // CHECK:STDOUT: %x: ref %struct_type.a = bind_name x, %x.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/struct/fail_value_as_type.carbon b/toolchain/check/testdata/struct/fail_value_as_type.carbon index 0a5725a17446d..0483713922be1 100644 --- a/toolchain/check/testdata/struct/fail_value_as_type.carbon +++ b/toolchain/check/testdata/struct/fail_value_as_type.carbon @@ -19,8 +19,6 @@ var x: {.a = 1}; // CHECK:STDOUT: --- fail_value_as_type.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %struct_type.a: type = struct_type {.a: Core.IntLiteral} [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -37,9 +35,6 @@ var x: {.a = 1}; // CHECK:STDOUT: .x = %x // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1] -// CHECK:STDOUT: %.loc17_15.1: %struct_type.a = struct_literal (%int_1) -// CHECK:STDOUT: %.loc17_15.2: type = converted %.loc17_15.1, [template = ] // CHECK:STDOUT: %x.var: ref = var x // CHECK:STDOUT: %x: ref = bind_name x, %x.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/struct/import.carbon b/toolchain/check/testdata/struct/import.carbon index b0a4fbae02488..811d79f230de6 100644 --- a/toolchain/check/testdata/struct/import.carbon +++ b/toolchain/check/testdata/struct/import.carbon @@ -67,7 +67,6 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] // CHECK:STDOUT: %struct.1: %struct_type.a.1 = struct_value (%int_0.2) [template] -// CHECK:STDOUT: %tuple.type.1: type = tuple_type (type) [template] // CHECK:STDOUT: %tuple.type.2: type = tuple_type (%i32) [template] // CHECK:STDOUT: %struct_type.b.c.1: type = struct_type {.b: %i32, .c: %tuple.type.2} [template] // CHECK:STDOUT: %struct_type.a.d.1: type = struct_type {.a: %struct_type.b.c.1, .d: %i32} [template] @@ -118,33 +117,22 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int_32.loc4: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc4: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %struct_type.a: type = struct_type {.a: %i32} [template = constants.%struct_type.a.1] // CHECK:STDOUT: %a_ref.var: ref %struct_type.a.1 = var a_ref // CHECK:STDOUT: %a_ref: ref %struct_type.a.1 = bind_name a_ref, %a_ref.var -// CHECK:STDOUT: %int_32.loc5_22: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc5_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc5_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc5_32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc5_36.1: %tuple.type.1 = tuple_literal (%i32.loc5_32) -// CHECK:STDOUT: %.loc5_36.2: type = converted %.loc5_36.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] -// CHECK:STDOUT: %struct_type.b.c: type = struct_type {.b: %i32, .c: %tuple.type.2} [template = constants.%struct_type.b.c.1] -// CHECK:STDOUT: %int_32.loc5_44: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc5_44: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %struct_type.a.d: type = struct_type {.a: %struct_type.b.c.1, .d: %i32} [template = constants.%struct_type.a.d.1] // CHECK:STDOUT: %b_ref.var: ref %struct_type.a.d.1 = var b_ref // CHECK:STDOUT: %b_ref: ref %struct_type.a.d.1 = bind_name b_ref, %b_ref.var // CHECK:STDOUT: %C.decl: %C.type = class_decl @C [template = constants.%C.generic] { // CHECK:STDOUT: %S.patt.loc8_9.1: %struct_type.a.b.1 = symbolic_binding_pattern S, 0 [symbolic = %S.patt.loc8_9.2 (constants.%S.patt)] // CHECK:STDOUT: %S.param_patt: %struct_type.a.b.1 = value_param_pattern %S.patt.loc8_9.1, runtime_param [symbolic = %S.patt.loc8_9.2 (constants.%S.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc8_18: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc8_18: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc8_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc8_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %struct_type.a.b: type = struct_type {.a: %i32, .b: %i32} [template = constants.%struct_type.a.b.1] // CHECK:STDOUT: %S.param: %struct_type.a.b.1 = value_param runtime_param +// CHECK:STDOUT: %.loc8: type = splice_block %struct_type.a.b [template = constants.%struct_type.a.b.1] { +// CHECK:STDOUT: %int_32.loc8_18: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc8_18: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %int_32.loc8_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc8_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %struct_type.a.b: type = struct_type {.a: %i32, .b: %i32} [template = constants.%struct_type.a.b.1] +// CHECK:STDOUT: } // CHECK:STDOUT: %S.loc8_9.1: %struct_type.a.b.1 = bind_symbolic_name S, 0, %S.param [symbolic = %S.loc8_9.2 (constants.%S)] // CHECK:STDOUT: } // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { @@ -258,7 +246,6 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %struct_type.a: type = struct_type {.a: %i32} [template] -// CHECK:STDOUT: %tuple.type.1: type = tuple_type (type) [template] // CHECK:STDOUT: %tuple.type.2: type = tuple_type (%i32) [template] // CHECK:STDOUT: %struct_type.b.c: type = struct_type {.b: %i32, .c: %tuple.type.2} [template] // CHECK:STDOUT: %struct_type.a.d.1: type = struct_type {.a: %struct_type.b.c, .d: %i32} [template] @@ -269,18 +256,7 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %struct_type.a.b.1: type = struct_type {.a: %i32, .b: %i32} [template] // CHECK:STDOUT: %S: %struct_type.a.b.1 = bind_symbolic_name S, 0 [symbolic] // CHECK:STDOUT: %S.patt: %struct_type.a.b.1 = symbolic_binding_pattern S, 0 [symbolic] -// CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %struct_type.a.b.2: type = struct_type {.a: Core.IntLiteral, .b: Core.IntLiteral} [template] -// CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] // CHECK:STDOUT: %struct: %struct_type.a.b.1 = struct_value (%int_1.2, %int_2.2) [template] // CHECK:STDOUT: %C.2: type = class_type @C, @C(%struct) [template] @@ -300,7 +276,7 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.195: = import_ref Implicit//default, loc8_34, loaded [template = constants.%complete_type.3] -// CHECK:STDOUT: %import_ref.196 = import_ref Implicit//default, inst602 [no loc], unloaded +// CHECK:STDOUT: %import_ref.196 = import_ref Implicit//default, inst603 [no loc], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -317,42 +293,10 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %Implicit.import = import Implicit // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int_32.loc4: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc4: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %struct_type.a: type = struct_type {.a: %i32} [template = constants.%struct_type.a] // CHECK:STDOUT: %a.var: ref %struct_type.a = var a // CHECK:STDOUT: %a: ref %struct_type.a = bind_name a, %a.var -// CHECK:STDOUT: %int_32.loc5_18: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc5_18: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc5_28: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc5_28: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc5_32.1: %tuple.type.1 = tuple_literal (%i32.loc5_28) -// CHECK:STDOUT: %.loc5_32.2: type = converted %.loc5_32.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] -// CHECK:STDOUT: %struct_type.b.c: type = struct_type {.b: %i32, .c: %tuple.type.2} [template = constants.%struct_type.b.c] -// CHECK:STDOUT: %int_32.loc5_40: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc5_40: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %struct_type.a.d: type = struct_type {.a: %struct_type.b.c, .d: %i32} [template = constants.%struct_type.a.d.1] // CHECK:STDOUT: %b.var: ref %struct_type.a.d.1 = var b // CHECK:STDOUT: %b: ref %struct_type.a.d.1 = bind_name b, %b.var -// CHECK:STDOUT: %C.ref: %C.type = name_ref C, imports.%import_ref.3 [template = constants.%C.generic] -// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %.loc6_25.1: %struct_type.a.b.2 = struct_literal (%int_1, %int_2) -// CHECK:STDOUT: %impl.elem0.loc6_25.1: %Convert.type.9 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc6_25.1: = bound_method %int_1, %impl.elem0.loc6_25.1 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc6_25.1: = specific_function %Convert.bound.loc6_25.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc6_25.1: init %i32 = call %Convert.specific_fn.loc6_25.1(%int_1) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc6_25.2: %i32 = value_of_initializer %int.convert_checked.loc6_25.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc6_25.3: %i32 = converted %int_1, %.loc6_25.2 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc6_25.2: %Convert.type.9 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc6_25.2: = bound_method %int_2, %impl.elem0.loc6_25.2 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc6_25.2: = specific_function %Convert.bound.loc6_25.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] -// CHECK:STDOUT: %int.convert_checked.loc6_25.2: init %i32 = call %Convert.specific_fn.loc6_25.2(%int_2) [template = constants.%int_2.2] -// CHECK:STDOUT: %.loc6_25.4: %i32 = value_of_initializer %int.convert_checked.loc6_25.2 [template = constants.%int_2.2] -// CHECK:STDOUT: %.loc6_25.5: %i32 = converted %int_2, %.loc6_25.4 [template = constants.%int_2.2] -// CHECK:STDOUT: %struct: %struct_type.a.b.1 = struct_value (%.loc6_25.3, %.loc6_25.5) [template = constants.%struct] -// CHECK:STDOUT: %.loc6_26: %struct_type.a.b.1 = converted %.loc6_25.1, %struct [template = constants.%struct] -// CHECK:STDOUT: %C: type = class_type @C, @C(constants.%struct) [template = constants.%C.2] // CHECK:STDOUT: %c.var: ref %C.2 = var c // CHECK:STDOUT: %c: ref %C.2 = bind_name c, %c.var // CHECK:STDOUT: } @@ -434,9 +378,6 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %struct_type.a.b: type = struct_type {.a: %i32, .b: %i32} [template] // CHECK:STDOUT: %S: %struct_type.a.b = bind_symbolic_name S, 0 [symbolic] // CHECK:STDOUT: %S.patt: %struct_type.a.b = symbolic_binding_pattern S, 0 [symbolic] -// CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %struct_type.c.d: type = struct_type {.c: Core.IntLiteral, .d: Core.IntLiteral} [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] @@ -455,7 +396,7 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.194: = import_ref Implicit//default, loc8_34, loaded [template = constants.%complete_type.3] -// CHECK:STDOUT: %import_ref.195 = import_ref Implicit//default, inst602 [no loc], unloaded +// CHECK:STDOUT: %import_ref.195 = import_ref Implicit//default, inst603 [no loc], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -470,10 +411,6 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %Implicit.import = import Implicit // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %C.ref: %C.type = name_ref C, imports.%import_ref.3 [template = constants.%C.generic] -// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %.loc11: %struct_type.c.d = struct_literal (%int_1, %int_2) // CHECK:STDOUT: %c_bad.var: ref = var c_bad // CHECK:STDOUT: %c_bad: ref = bind_name c_bad, %c_bad.var // CHECK:STDOUT: } @@ -526,18 +463,7 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %struct_type.a.b.1: type = struct_type {.a: %i32, .b: %i32} [template] // CHECK:STDOUT: %S: %struct_type.a.b.1 = bind_symbolic_name S, 0 [symbolic] // CHECK:STDOUT: %S.patt: %struct_type.a.b.1 = symbolic_binding_pattern S, 0 [symbolic] -// CHECK:STDOUT: %int_3.1: Core.IntLiteral = int_value 3 [template] -// CHECK:STDOUT: %int_4.1: Core.IntLiteral = int_value 4 [template] -// CHECK:STDOUT: %struct_type.a.b.2: type = struct_type {.a: Core.IntLiteral, .b: Core.IntLiteral} [template] -// CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_3.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_3.2: %i32 = int_value 3 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_4.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_4.2: %i32 = int_value 4 [template] // CHECK:STDOUT: %struct.1: %struct_type.a.b.1 = struct_value (%int_3.2, %int_4.2) [template] // CHECK:STDOUT: %C.2: type = class_type @C, @C(%struct.1) [template] @@ -560,7 +486,7 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.194: = import_ref Implicit//default, loc8_34, loaded [template = constants.%complete_type.3] -// CHECK:STDOUT: %import_ref.195 = import_ref Implicit//default, inst602 [no loc], unloaded +// CHECK:STDOUT: %import_ref.195 = import_ref Implicit//default, inst603 [no loc], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -575,25 +501,6 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %Implicit.import = import Implicit // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %C.ref: %C.type = name_ref C, imports.%import_ref.3 [template = constants.%C.generic] -// CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] -// CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [template = constants.%int_4.1] -// CHECK:STDOUT: %.loc9_29.1: %struct_type.a.b.2 = struct_literal (%int_3, %int_4) -// CHECK:STDOUT: %impl.elem0.loc9_29.1: %Convert.type.9 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc9_29.1: = bound_method %int_3, %impl.elem0.loc9_29.1 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc9_29.1: = specific_function %Convert.bound.loc9_29.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc9_29.1: init %i32 = call %Convert.specific_fn.loc9_29.1(%int_3) [template = constants.%int_3.2] -// CHECK:STDOUT: %.loc9_29.2: %i32 = value_of_initializer %int.convert_checked.loc9_29.1 [template = constants.%int_3.2] -// CHECK:STDOUT: %.loc9_29.3: %i32 = converted %int_3, %.loc9_29.2 [template = constants.%int_3.2] -// CHECK:STDOUT: %impl.elem0.loc9_29.2: %Convert.type.9 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc9_29.2: = bound_method %int_4, %impl.elem0.loc9_29.2 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc9_29.2: = specific_function %Convert.bound.loc9_29.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] -// CHECK:STDOUT: %int.convert_checked.loc9_29.2: init %i32 = call %Convert.specific_fn.loc9_29.2(%int_4) [template = constants.%int_4.2] -// CHECK:STDOUT: %.loc9_29.4: %i32 = value_of_initializer %int.convert_checked.loc9_29.2 [template = constants.%int_4.2] -// CHECK:STDOUT: %.loc9_29.5: %i32 = converted %int_4, %.loc9_29.4 [template = constants.%int_4.2] -// CHECK:STDOUT: %struct: %struct_type.a.b.1 = struct_value (%.loc9_29.3, %.loc9_29.5) [template = constants.%struct.1] -// CHECK:STDOUT: %.loc9_30: %struct_type.a.b.1 = converted %.loc9_29.1, %struct [template = constants.%struct.1] -// CHECK:STDOUT: %C: type = class_type @C, @C(constants.%struct.1) [template = constants.%C.2] // CHECK:STDOUT: %c_bad.var: ref %C.2 = var c_bad // CHECK:STDOUT: %c_bad: ref %C.2 = bind_name c_bad, %c_bad.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/struct/member_access.carbon b/toolchain/check/testdata/struct/member_access.carbon index 22065dfc41a56..b1a9867dca1c4 100644 --- a/toolchain/check/testdata/struct/member_access.carbon +++ b/toolchain/check/testdata/struct/member_access.carbon @@ -15,9 +15,6 @@ var z: i32 = y; // CHECK:STDOUT: --- member_access.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [template] -// CHECK:STDOUT: %Float.type: type = fn_type @Float [template] -// CHECK:STDOUT: %Float: %Float.type = struct_value () [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %struct_type.a.b.1: type = struct_type {.a: f64, .b: %i32} [template] @@ -52,21 +49,10 @@ var z: i32 = y; // CHECK:STDOUT: .z = %z // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type: init type = call constants.%Float(%int_64) [template = f64] -// CHECK:STDOUT: %.loc11_13.1: type = value_of_initializer %float.make_type [template = f64] -// CHECK:STDOUT: %.loc11_13.2: type = converted %float.make_type, %.loc11_13.1 [template = f64] -// CHECK:STDOUT: %int_32.loc11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %struct_type.a.b: type = struct_type {.a: f64, .b: %i32} [template = constants.%struct_type.a.b.1] // CHECK:STDOUT: %x.var: ref %struct_type.a.b.1 = var x // CHECK:STDOUT: %x: ref %struct_type.a.b.1 = bind_name x, %x.var -// CHECK:STDOUT: %int_32.loc12: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc12: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %y.var: ref %i32 = var y // CHECK:STDOUT: %y: ref %i32 = bind_name y, %y.var -// CHECK:STDOUT: %int_32.loc13: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc13: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %z.var: ref %i32 = var z // CHECK:STDOUT: %z: ref %i32 = bind_name z, %z.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/struct/nested_struct_in_place.carbon b/toolchain/check/testdata/struct/nested_struct_in_place.carbon index 87ae9e4f1f64e..ccb87b64c7a45 100644 --- a/toolchain/check/testdata/struct/nested_struct_in_place.carbon +++ b/toolchain/check/testdata/struct/nested_struct_in_place.carbon @@ -65,23 +65,6 @@ fn G() { // CHECK:STDOUT: // CHECK:STDOUT: fn @G() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int_32.loc14_16: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc14_16: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc14_21: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc14_21: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc14_26: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc14_26: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc14_29.1: %tuple.type.1 = tuple_literal (%i32.loc14_16, %i32.loc14_21, %i32.loc14_26) -// CHECK:STDOUT: %.loc14_29.2: type = converted %.loc14_29.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] -// CHECK:STDOUT: %int_32.loc14_37: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc14_37: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc14_42: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc14_42: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc14_47: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc14_47: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc14_50.1: %tuple.type.1 = tuple_literal (%i32.loc14_37, %i32.loc14_42, %i32.loc14_47) -// CHECK:STDOUT: %.loc14_50.2: type = converted %.loc14_50.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] -// CHECK:STDOUT: %struct_type.a.b: type = struct_type {.a: %tuple.type.2, .b: %tuple.type.2} [template = constants.%struct_type.a.b.1] // CHECK:STDOUT: %v.var: ref %struct_type.a.b.1 = var v // CHECK:STDOUT: %v: ref %struct_type.a.b.1 = bind_name v, %v.var // CHECK:STDOUT: %F.ref.loc14_61: %F.type = name_ref F, file.%F.decl [template = constants.%F] diff --git a/toolchain/check/testdata/struct/no_prelude/empty.carbon b/toolchain/check/testdata/struct/no_prelude/empty.carbon index c136b2bf70371..9ca51695ec903 100644 --- a/toolchain/check/testdata/struct/no_prelude/empty.carbon +++ b/toolchain/check/testdata/struct/no_prelude/empty.carbon @@ -23,12 +23,8 @@ var y: {} = x; // CHECK:STDOUT: .x = %x // CHECK:STDOUT: .y = %y // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc11_9.1: %empty_struct_type = struct_literal () -// CHECK:STDOUT: %.loc11_9.2: type = converted %.loc11_9.1, constants.%empty_struct_type [template = constants.%empty_struct_type] // CHECK:STDOUT: %x.var: ref %empty_struct_type = var x // CHECK:STDOUT: %x: ref %empty_struct_type = bind_name x, %x.var -// CHECK:STDOUT: %.loc12_9.1: %empty_struct_type = struct_literal () -// CHECK:STDOUT: %.loc12_9.2: type = converted %.loc12_9.1, constants.%empty_struct_type [template = constants.%empty_struct_type] // CHECK:STDOUT: %y.var: ref %empty_struct_type = var y // CHECK:STDOUT: %y: ref %empty_struct_type = bind_name y, %y.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/struct/no_prelude/fail_assign_nested.carbon b/toolchain/check/testdata/struct/no_prelude/fail_assign_nested.carbon index ff6e657f8057b..89361dd986451 100644 --- a/toolchain/check/testdata/struct/no_prelude/fail_assign_nested.carbon +++ b/toolchain/check/testdata/struct/no_prelude/fail_assign_nested.carbon @@ -25,9 +25,6 @@ var x: {.a: {}} = {.b = {}}; // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .x = %x // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc14_14.1: %empty_struct_type = struct_literal () -// CHECK:STDOUT: %.loc14_14.2: type = converted %.loc14_14.1, constants.%empty_struct_type [template = constants.%empty_struct_type] -// CHECK:STDOUT: %struct_type.a: type = struct_type {.a: %empty_struct_type} [template = constants.%struct_type.a.1] // CHECK:STDOUT: %x.var: ref %struct_type.a.1 = var x // CHECK:STDOUT: %x: ref %struct_type.a.1 = bind_name x, %x.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/struct/no_prelude/fail_nested_incomplete.carbon b/toolchain/check/testdata/struct/no_prelude/fail_nested_incomplete.carbon index b518bdb80249b..8306852ac7b08 100644 --- a/toolchain/check/testdata/struct/no_prelude/fail_nested_incomplete.carbon +++ b/toolchain/check/testdata/struct/no_prelude/fail_nested_incomplete.carbon @@ -24,7 +24,6 @@ var p: Incomplete* = &s.a; // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %Incomplete: type = class_type @Incomplete [template] -// CHECK:STDOUT: %struct_type.a: type = struct_type {.a: %Incomplete} [template] // CHECK:STDOUT: %ptr: type = ptr_type %Incomplete [template] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -35,12 +34,8 @@ var p: Incomplete* = &s.a; // CHECK:STDOUT: .p = %p // CHECK:STDOUT: } // CHECK:STDOUT: %Incomplete.decl: type = class_decl @Incomplete [template = constants.%Incomplete] {} {} -// CHECK:STDOUT: %Incomplete.ref.loc19: type = name_ref Incomplete, %Incomplete.decl [template = constants.%Incomplete] -// CHECK:STDOUT: %struct_type.a: type = struct_type {.a: %Incomplete} [template = constants.%struct_type.a] // CHECK:STDOUT: %s.var: ref = var s // CHECK:STDOUT: %s: ref = bind_name s, %s.var -// CHECK:STDOUT: %Incomplete.ref.loc21: type = name_ref Incomplete, %Incomplete.decl [template = constants.%Incomplete] -// CHECK:STDOUT: %ptr: type = ptr_type %Incomplete [template = constants.%ptr] // CHECK:STDOUT: %p.var: ref %ptr = var p // CHECK:STDOUT: %p: ref %ptr = bind_name p, %p.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/struct/one_entry.carbon b/toolchain/check/testdata/struct/one_entry.carbon index 03503357507e1..30dfbbe54e6f6 100644 --- a/toolchain/check/testdata/struct/one_entry.carbon +++ b/toolchain/check/testdata/struct/one_entry.carbon @@ -45,14 +45,8 @@ var y: {.a: i32} = x; // CHECK:STDOUT: .y = %y // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int_32.loc11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %struct_type.a.loc11: type = struct_type {.a: %i32} [template = constants.%struct_type.a.1] // CHECK:STDOUT: %x.var: ref %struct_type.a.1 = var x // CHECK:STDOUT: %x: ref %struct_type.a.1 = bind_name x, %x.var -// CHECK:STDOUT: %int_32.loc12: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc12: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %struct_type.a.loc12: type = struct_type {.a: %i32} [template = constants.%struct_type.a.1] // CHECK:STDOUT: %y.var: ref %struct_type.a.1 = var y // CHECK:STDOUT: %y: ref %struct_type.a.1 = bind_name y, %y.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/struct/partially_const.carbon b/toolchain/check/testdata/struct/partially_const.carbon index b6173a93ccaf3..05ef1be1b0685 100644 --- a/toolchain/check/testdata/struct/partially_const.carbon +++ b/toolchain/check/testdata/struct/partially_const.carbon @@ -52,8 +52,6 @@ fn Make(n: i32) -> {.a: i32, .b: i32, .c: i32} { // CHECK:STDOUT: %return.patt: %struct_type.a.b.c.1 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %struct_type.a.b.c.1 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc11_12: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc11_12: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc11_25: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc11_25: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_32.loc11_34: Core.IntLiteral = int_value 32 [template = constants.%int_32] @@ -62,6 +60,10 @@ fn Make(n: i32) -> {.a: i32, .b: i32, .c: i32} { // CHECK:STDOUT: %i32.loc11_43: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %struct_type.a.b.c: type = struct_type {.a: %i32, .b: %i32, .c: %i32} [template = constants.%struct_type.a.b.c.1] // CHECK:STDOUT: %n.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc11: type = splice_block %i32.loc11_12 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc11_12: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc11_12: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } // CHECK:STDOUT: %n: %i32 = bind_name n, %n.param // CHECK:STDOUT: %return.param: ref %struct_type.a.b.c.1 = out_param runtime_param1 // CHECK:STDOUT: %return: ref %struct_type.a.b.c.1 = return_slot %return.param diff --git a/toolchain/check/testdata/struct/reorder_fields.carbon b/toolchain/check/testdata/struct/reorder_fields.carbon index cb790a47f455d..de946a0d9284f 100644 --- a/toolchain/check/testdata/struct/reorder_fields.carbon +++ b/toolchain/check/testdata/struct/reorder_fields.carbon @@ -76,13 +76,13 @@ fn F() -> {.a: i32, .b: f64} { // CHECK:STDOUT: %return.patt: %struct_type.a.b = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %struct_type.a.b = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_64.loc14: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc14: init type = call constants.%Float(%int_64.loc14) [template = f64] -// CHECK:STDOUT: %.loc14_25.1: type = value_of_initializer %float.make_type.loc14 [template = f64] -// CHECK:STDOUT: %.loc14_25.2: type = converted %float.make_type.loc14, %.loc14_25.1 [template = f64] -// CHECK:STDOUT: %struct_type.a.b.loc14: type = struct_type {.a: %i32, .b: f64} [template = constants.%struct_type.a.b] +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type: init type = call constants.%Float(%int_64) [template = f64] +// CHECK:STDOUT: %.loc14_25.1: type = value_of_initializer %float.make_type [template = f64] +// CHECK:STDOUT: %.loc14_25.2: type = converted %float.make_type, %.loc14_25.1 [template = f64] +// CHECK:STDOUT: %struct_type.a.b: type = struct_type {.a: %i32, .b: f64} [template = constants.%struct_type.a.b] // CHECK:STDOUT: %return.param: ref %struct_type.a.b = out_param runtime_param0 // CHECK:STDOUT: %return: ref %struct_type.a.b = return_slot %return.param // CHECK:STDOUT: } @@ -94,13 +94,6 @@ fn F() -> {.a: i32, .b: f64} { // CHECK:STDOUT: // CHECK:STDOUT: fn @F() -> %return.param_patt: %struct_type.a.b { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int_32.loc15: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc15: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_64.loc15: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc15: init type = call constants.%Float(%int_64.loc15) [template = f64] -// CHECK:STDOUT: %.loc15_24.1: type = value_of_initializer %float.make_type.loc15 [template = f64] -// CHECK:STDOUT: %.loc15_24.2: type = converted %float.make_type.loc15, %.loc15_24.1 [template = f64] -// CHECK:STDOUT: %struct_type.a.b.loc15: type = struct_type {.a: %i32, .b: f64} [template = constants.%struct_type.a.b] // CHECK:STDOUT: %MakeF64.ref: %MakeF64.type = name_ref MakeF64, file.%MakeF64.decl [template = constants.%MakeF64] // CHECK:STDOUT: %MakeF64.call: init f64 = call %MakeF64.ref() // CHECK:STDOUT: %MakeI32.ref: %MakeI32.type = name_ref MakeI32, file.%MakeI32.decl [template = constants.%MakeI32] @@ -113,13 +106,6 @@ fn F() -> {.a: i32, .b: f64} { // CHECK:STDOUT: %struct.loc15: %struct_type.a.b = struct_value (%.loc15_62.3, %.loc15_62.5) // CHECK:STDOUT: %.loc15_63: %struct_type.a.b = converted %.loc15_62.1, %struct.loc15 // CHECK:STDOUT: %x: %struct_type.a.b = bind_name x, %.loc15_63 -// CHECK:STDOUT: %int_64.loc16: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc16: init type = call constants.%Float(%int_64.loc16) [template = f64] -// CHECK:STDOUT: %.loc16_15.1: type = value_of_initializer %float.make_type.loc16 [template = f64] -// CHECK:STDOUT: %.loc16_15.2: type = converted %float.make_type.loc16, %.loc16_15.1 [template = f64] -// CHECK:STDOUT: %int_32.loc16: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc16: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %struct_type.b.a: type = struct_type {.b: f64, .a: %i32} [template = constants.%struct_type.b.a] // CHECK:STDOUT: %x.ref: %struct_type.a.b = name_ref x, %x // CHECK:STDOUT: %.loc16_31.1: f64 = struct_access %x.ref, element1 // CHECK:STDOUT: %.loc16_31.2: %i32 = struct_access %x.ref, element0 diff --git a/toolchain/check/testdata/struct/tuple_as_element.carbon b/toolchain/check/testdata/struct/tuple_as_element.carbon index d70c4f22c747b..4b6997fab31de 100644 --- a/toolchain/check/testdata/struct/tuple_as_element.carbon +++ b/toolchain/check/testdata/struct/tuple_as_element.carbon @@ -16,7 +16,6 @@ var y: {.a: i32, .b: (i32,)} = x; // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] -// CHECK:STDOUT: %tuple.type.1: type = tuple_type (type) [template] // CHECK:STDOUT: %tuple.type.2: type = tuple_type (%i32) [template] // CHECK:STDOUT: %struct_type.a.b.1: type = struct_type {.a: %i32, .b: %tuple.type.2} [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] @@ -53,22 +52,8 @@ var y: {.a: i32, .b: (i32,)} = x; // CHECK:STDOUT: .y = %y // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int_32.loc11_13: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc11_13: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc11_23: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc11_23: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_27.1: %tuple.type.1 = tuple_literal (%i32.loc11_23) -// CHECK:STDOUT: %.loc11_27.2: type = converted %.loc11_27.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] -// CHECK:STDOUT: %struct_type.a.b.loc11: type = struct_type {.a: %i32, .b: %tuple.type.2} [template = constants.%struct_type.a.b.1] // CHECK:STDOUT: %x.var: ref %struct_type.a.b.1 = var x // CHECK:STDOUT: %x: ref %struct_type.a.b.1 = bind_name x, %x.var -// CHECK:STDOUT: %int_32.loc12_13: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc12_13: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc12_23: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc12_23: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc12_27.1: %tuple.type.1 = tuple_literal (%i32.loc12_23) -// CHECK:STDOUT: %.loc12_27.2: type = converted %.loc12_27.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] -// CHECK:STDOUT: %struct_type.a.b.loc12: type = struct_type {.a: %i32, .b: %tuple.type.2} [template = constants.%struct_type.a.b.1] // CHECK:STDOUT: %y.var: ref %struct_type.a.b.1 = var y // CHECK:STDOUT: %y: ref %struct_type.a.b.1 = bind_name y, %y.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/struct/two_entries.carbon b/toolchain/check/testdata/struct/two_entries.carbon index 5fd7c423ccd5d..92af23fb75b24 100644 --- a/toolchain/check/testdata/struct/two_entries.carbon +++ b/toolchain/check/testdata/struct/two_entries.carbon @@ -54,28 +54,8 @@ var y: {.a: i32, .b: i32} = x; // CHECK:STDOUT: .y = %y // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int_32.loc11_13: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc11_13: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc11_22: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc11_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %struct_type.a.b.loc11: type = struct_type {.a: %i32, .b: %i32} [template = constants.%struct_type.a.b.1] -// CHECK:STDOUT: %int_32.loc12_13: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc12_13: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc12_22: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc12_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %struct_type.a.b.loc12: type = struct_type {.a: %i32, .b: %i32} [template = constants.%struct_type.a.b.1] -// CHECK:STDOUT: %int_32.loc14_13: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc14_13: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc14_22: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc14_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %struct_type.a.b.loc14: type = struct_type {.a: %i32, .b: %i32} [template = constants.%struct_type.a.b.1] // CHECK:STDOUT: %x.var: ref %struct_type.a.b.1 = var x // CHECK:STDOUT: %x: ref %struct_type.a.b.1 = bind_name x, %x.var -// CHECK:STDOUT: %int_32.loc15_13: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc15_13: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc15_22: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc15_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %struct_type.a.b.loc15: type = struct_type {.a: %i32, .b: %i32} [template = constants.%struct_type.a.b.1] // CHECK:STDOUT: %y.var: ref %struct_type.a.b.1 = var y // CHECK:STDOUT: %y: ref %struct_type.a.b.1 = bind_name y, %y.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/tuple/access/element_access.carbon b/toolchain/check/testdata/tuple/access/element_access.carbon index 98cac2e6fdf27..c6c7361b5d458 100644 --- a/toolchain/check/testdata/tuple/access/element_access.carbon +++ b/toolchain/check/testdata/tuple/access/element_access.carbon @@ -17,7 +17,6 @@ var c: i32 = b.0; // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] -// CHECK:STDOUT: %tuple.type.1: type = tuple_type (type) [template] // CHECK:STDOUT: %tuple.type.2: type = tuple_type (%i32) [template] // CHECK:STDOUT: %int_12.1: Core.IntLiteral = int_value 12 [template] // CHECK:STDOUT: %tuple.type.3: type = tuple_type (Core.IntLiteral) [template] @@ -49,20 +48,10 @@ var c: i32 = b.0; // CHECK:STDOUT: .c = %c // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int_32.loc11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_13.1: %tuple.type.1 = tuple_literal (%i32.loc11) -// CHECK:STDOUT: %.loc11_13.2: type = converted %.loc11_13.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %a.var: ref %tuple.type.2 = var a // CHECK:STDOUT: %a: ref %tuple.type.2 = bind_name a, %a.var -// CHECK:STDOUT: %int_32.loc12: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc12: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc12_13.1: %tuple.type.1 = tuple_literal (%i32.loc12) -// CHECK:STDOUT: %.loc12_13.2: type = converted %.loc12_13.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %b.var: ref %tuple.type.2 = var b // CHECK:STDOUT: %b: ref %tuple.type.2 = bind_name b, %b.var -// CHECK:STDOUT: %int_32.loc13: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc13: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %c.var: ref %i32 = var c // CHECK:STDOUT: %c: ref %i32 = bind_name c, %c.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/tuple/access/fail_access_error.carbon b/toolchain/check/testdata/tuple/access/fail_access_error.carbon index c8a6cbf34d4e6..34865334cc09d 100644 --- a/toolchain/check/testdata/tuple/access/fail_access_error.carbon +++ b/toolchain/check/testdata/tuple/access/fail_access_error.carbon @@ -19,7 +19,6 @@ var b: i32 = a.(oops); // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] -// CHECK:STDOUT: %tuple.type.1: type = tuple_type (type, type) [template] // CHECK:STDOUT: %tuple.type.2: type = tuple_type (%i32, %i32) [template] // CHECK:STDOUT: %int_12.1: Core.IntLiteral = int_value 12 [template] // CHECK:STDOUT: %int_6.1: Core.IntLiteral = int_value 6 [template] @@ -53,16 +52,8 @@ var b: i32 = a.(oops); // CHECK:STDOUT: .b = %b // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int_32.loc11_9: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc11_9: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc11_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc11_14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_17.1: %tuple.type.1 = tuple_literal (%i32.loc11_9, %i32.loc11_14) -// CHECK:STDOUT: %.loc11_17.2: type = converted %.loc11_17.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %a.var: ref %tuple.type.2 = var a // CHECK:STDOUT: %a: ref %tuple.type.2 = bind_name a, %a.var -// CHECK:STDOUT: %int_32.loc15: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc15: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %b.var: ref %i32 = var b // CHECK:STDOUT: %b: ref %i32 = bind_name b, %b.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/tuple/access/fail_large_index.carbon b/toolchain/check/testdata/tuple/access/fail_large_index.carbon index 8f2ca20ac6093..e2769558ff399 100644 --- a/toolchain/check/testdata/tuple/access/fail_large_index.carbon +++ b/toolchain/check/testdata/tuple/access/fail_large_index.carbon @@ -25,7 +25,6 @@ var d: i32 = b.(0x7FFF_FFFF); // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] -// CHECK:STDOUT: %tuple.type.1: type = tuple_type (type) [template] // CHECK:STDOUT: %tuple.type.2: type = tuple_type (%i32) [template] // CHECK:STDOUT: %int_12.1: Core.IntLiteral = int_value 12 [template] // CHECK:STDOUT: %tuple.type.3: type = tuple_type (Core.IntLiteral) [template] @@ -59,24 +58,12 @@ var d: i32 = b.(0x7FFF_FFFF); // CHECK:STDOUT: .d = %d // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int_32.loc11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_13.1: %tuple.type.1 = tuple_literal (%i32.loc11) -// CHECK:STDOUT: %.loc11_13.2: type = converted %.loc11_13.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %a.var: ref %tuple.type.2 = var a // CHECK:STDOUT: %a: ref %tuple.type.2 = bind_name a, %a.var -// CHECK:STDOUT: %int_32.loc12: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc12: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc12_13.1: %tuple.type.1 = tuple_literal (%i32.loc12) -// CHECK:STDOUT: %.loc12_13.2: type = converted %.loc12_13.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %b.var: ref %tuple.type.2 = var b // CHECK:STDOUT: %b: ref %tuple.type.2 = bind_name b, %b.var -// CHECK:STDOUT: %int_32.loc17: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %c.var: ref %i32 = var c // CHECK:STDOUT: %c: ref %i32 = bind_name c, %c.var -// CHECK:STDOUT: %int_32.loc21: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc21: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %d.var: ref %i32 = var d // CHECK:STDOUT: %d: ref %i32 = bind_name d, %d.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/tuple/access/fail_negative_indexing.carbon b/toolchain/check/testdata/tuple/access/fail_negative_indexing.carbon index 2d6290bd08508..f358890dcb2a6 100644 --- a/toolchain/check/testdata/tuple/access/fail_negative_indexing.carbon +++ b/toolchain/check/testdata/tuple/access/fail_negative_indexing.carbon @@ -19,7 +19,6 @@ var b: i32 = a.(-10); // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] -// CHECK:STDOUT: %tuple.type.1: type = tuple_type (type, type) [template] // CHECK:STDOUT: %tuple.type.2: type = tuple_type (%i32, %i32) [template] // CHECK:STDOUT: %int_12.1: Core.IntLiteral = int_value 12 [template] // CHECK:STDOUT: %int_6.1: Core.IntLiteral = int_value 6 [template] @@ -55,16 +54,8 @@ var b: i32 = a.(-10); // CHECK:STDOUT: .b = %b // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int_32.loc11_9: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc11_9: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc11_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc11_14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_17.1: %tuple.type.1 = tuple_literal (%i32.loc11_9, %i32.loc11_14) -// CHECK:STDOUT: %.loc11_17.2: type = converted %.loc11_17.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %a.var: ref %tuple.type.2 = var a // CHECK:STDOUT: %a: ref %tuple.type.2 = bind_name a, %a.var -// CHECK:STDOUT: %int_32.loc15: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc15: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %b.var: ref %i32 = var b // CHECK:STDOUT: %b: ref %i32 = bind_name b, %b.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/tuple/access/fail_non_deterministic_type.carbon b/toolchain/check/testdata/tuple/access/fail_non_deterministic_type.carbon index c58c71b7d95e2..e62614306555a 100644 --- a/toolchain/check/testdata/tuple/access/fail_non_deterministic_type.carbon +++ b/toolchain/check/testdata/tuple/access/fail_non_deterministic_type.carbon @@ -20,7 +20,6 @@ var c: i32 = a.(b); // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] -// CHECK:STDOUT: %tuple.type.1: type = tuple_type (type, type) [template] // CHECK:STDOUT: %tuple.type.2: type = tuple_type (%i32, %i32) [template] // CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %int_3.1: Core.IntLiteral = int_value 3 [template] @@ -59,20 +58,10 @@ var c: i32 = a.(b); // CHECK:STDOUT: .c = %c // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int_32.loc11_9: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc11_9: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc11_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc11_14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_17.1: %tuple.type.1 = tuple_literal (%i32.loc11_9, %i32.loc11_14) -// CHECK:STDOUT: %.loc11_17.2: type = converted %.loc11_17.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %a.var: ref %tuple.type.2 = var a // CHECK:STDOUT: %a: ref %tuple.type.2 = bind_name a, %a.var -// CHECK:STDOUT: %int_32.loc12: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc12: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %b.var: ref %i32 = var b // CHECK:STDOUT: %b: ref %i32 = bind_name b, %b.var -// CHECK:STDOUT: %int_32.loc16: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc16: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %c.var: ref %i32 = var c // CHECK:STDOUT: %c: ref %i32 = bind_name c, %c.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/tuple/access/fail_non_int_indexing.carbon b/toolchain/check/testdata/tuple/access/fail_non_int_indexing.carbon index d93c84e75b25a..f61d58fac4f84 100644 --- a/toolchain/check/testdata/tuple/access/fail_non_int_indexing.carbon +++ b/toolchain/check/testdata/tuple/access/fail_non_int_indexing.carbon @@ -22,7 +22,6 @@ var b: i32 = a.(2.6); // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] -// CHECK:STDOUT: %tuple.type.1: type = tuple_type (type, type) [template] // CHECK:STDOUT: %tuple.type.2: type = tuple_type (%i32, %i32) [template] // CHECK:STDOUT: %int_12.1: Core.IntLiteral = int_value 12 [template] // CHECK:STDOUT: %int_6.1: Core.IntLiteral = int_value 6 [template] @@ -57,16 +56,8 @@ var b: i32 = a.(2.6); // CHECK:STDOUT: .b = %b // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int_32.loc11_9: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc11_9: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc11_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc11_14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_17.1: %tuple.type.1 = tuple_literal (%i32.loc11_9, %i32.loc11_14) -// CHECK:STDOUT: %.loc11_17.2: type = converted %.loc11_17.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %a.var: ref %tuple.type.2 = var a // CHECK:STDOUT: %a: ref %tuple.type.2 = bind_name a, %a.var -// CHECK:STDOUT: %int_32.loc18: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc18: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %b.var: ref %i32 = var b // CHECK:STDOUT: %b: ref %i32 = bind_name b, %b.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/tuple/access/fail_non_tuple_access.carbon b/toolchain/check/testdata/tuple/access/fail_non_tuple_access.carbon index 9ea058c14ccd7..f0b214a67a692 100644 --- a/toolchain/check/testdata/tuple/access/fail_non_tuple_access.carbon +++ b/toolchain/check/testdata/tuple/access/fail_non_tuple_access.carbon @@ -68,10 +68,6 @@ fn Main() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_0.loc16: Core.IntLiteral = int_value 0 [template = constants.%int_0] // CHECK:STDOUT: %int_1.loc16: Core.IntLiteral = int_value 1 [template = constants.%int_1] -// CHECK:STDOUT: %int_32.loc18: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc18: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2] -// CHECK:STDOUT: %array_type: type = array_type %int_2, %i32 [template = constants.%array_type] // CHECK:STDOUT: %non_tuple.var: ref %array_type = var non_tuple // CHECK:STDOUT: %non_tuple: ref %array_type = bind_name non_tuple, %non_tuple.var // CHECK:STDOUT: %int_5.loc18_30: Core.IntLiteral = int_value 5 [template = constants.%int_5.1] @@ -96,8 +92,6 @@ fn Main() { // CHECK:STDOUT: %.loc18_34.8: init %array_type = array_init (%.loc18_34.4, %.loc18_34.7) to %non_tuple.var [template = constants.%array] // CHECK:STDOUT: %.loc18_35: init %array_type = converted %.loc18_34.1, %.loc18_34.8 [template = constants.%array] // CHECK:STDOUT: assign %non_tuple.var, %.loc18_35 -// CHECK:STDOUT: %int_32.loc22: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %first.var: ref %i32 = var first // CHECK:STDOUT: %first: ref %i32 = bind_name first, %first.var // CHECK:STDOUT: %non_tuple.ref: ref %array_type = name_ref non_tuple, %non_tuple diff --git a/toolchain/check/testdata/tuple/access/fail_out_of_bound_access.carbon b/toolchain/check/testdata/tuple/access/fail_out_of_bound_access.carbon index 4e42dbddd9391..7607c1f52600b 100644 --- a/toolchain/check/testdata/tuple/access/fail_out_of_bound_access.carbon +++ b/toolchain/check/testdata/tuple/access/fail_out_of_bound_access.carbon @@ -19,7 +19,6 @@ var b: i32 = a.2; // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] -// CHECK:STDOUT: %tuple.type.1: type = tuple_type (type, type) [template] // CHECK:STDOUT: %tuple.type.2: type = tuple_type (%i32, %i32) [template] // CHECK:STDOUT: %int_12.1: Core.IntLiteral = int_value 12 [template] // CHECK:STDOUT: %int_6.1: Core.IntLiteral = int_value 6 [template] @@ -54,16 +53,8 @@ var b: i32 = a.2; // CHECK:STDOUT: .b = %b // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int_32.loc11_9: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc11_9: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc11_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc11_14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_17.1: %tuple.type.1 = tuple_literal (%i32.loc11_9, %i32.loc11_14) -// CHECK:STDOUT: %.loc11_17.2: type = converted %.loc11_17.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %a.var: ref %tuple.type.2 = var a // CHECK:STDOUT: %a: ref %tuple.type.2 = bind_name a, %a.var -// CHECK:STDOUT: %int_32.loc15: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc15: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %b.var: ref %i32 = var b // CHECK:STDOUT: %b: ref %i32 = bind_name b, %b.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/tuple/access/fail_out_of_bound_not_literal.carbon b/toolchain/check/testdata/tuple/access/fail_out_of_bound_not_literal.carbon index 6e1d4d68c4d1f..1993c1859c3eb 100644 --- a/toolchain/check/testdata/tuple/access/fail_out_of_bound_not_literal.carbon +++ b/toolchain/check/testdata/tuple/access/fail_out_of_bound_not_literal.carbon @@ -19,7 +19,6 @@ var b: i32 = a.({.index = 2}.index); // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] -// CHECK:STDOUT: %tuple.type.1: type = tuple_type (type, type) [template] // CHECK:STDOUT: %tuple.type.2: type = tuple_type (%i32, %i32) [template] // CHECK:STDOUT: %int_12.1: Core.IntLiteral = int_value 12 [template] // CHECK:STDOUT: %int_34.1: Core.IntLiteral = int_value 34 [template] @@ -56,16 +55,8 @@ var b: i32 = a.({.index = 2}.index); // CHECK:STDOUT: .b = %b // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int_32.loc11_9: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc11_9: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc11_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc11_14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_17.1: %tuple.type.1 = tuple_literal (%i32.loc11_9, %i32.loc11_14) -// CHECK:STDOUT: %.loc11_17.2: type = converted %.loc11_17.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %a.var: ref %tuple.type.2 = var a // CHECK:STDOUT: %a: ref %tuple.type.2 = bind_name a, %a.var -// CHECK:STDOUT: %int_32.loc15: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc15: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %b.var: ref %i32 = var b // CHECK:STDOUT: %b: ref %i32 = bind_name b, %b.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/tuple/access/index_not_literal.carbon b/toolchain/check/testdata/tuple/access/index_not_literal.carbon index 6e45793f2a6c3..e9a59558c22d7 100644 --- a/toolchain/check/testdata/tuple/access/index_not_literal.carbon +++ b/toolchain/check/testdata/tuple/access/index_not_literal.carbon @@ -16,11 +16,8 @@ var d: i32 = a.({.index = 1 as i32}.index); // CHECK:STDOUT: --- index_not_literal.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Bool.type: type = fn_type @Bool [template] -// CHECK:STDOUT: %Bool: %Bool.type = struct_value () [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] -// CHECK:STDOUT: %tuple.type.1: type = tuple_type (type, type) [template] // CHECK:STDOUT: %tuple.type.2: type = tuple_type (bool, %i32) [template] // CHECK:STDOUT: %true: bool = bool_literal true [template] // CHECK:STDOUT: %int_34.1: Core.IntLiteral = int_value 34 [template] @@ -79,26 +76,12 @@ var d: i32 = a.({.index = 1 as i32}.index); // CHECK:STDOUT: .d = %d // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %bool.make_type.loc11: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %int_32.loc11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_18.1: %tuple.type.1 = tuple_literal (%bool.make_type.loc11, %i32.loc11) -// CHECK:STDOUT: %.loc11_18.2: type = value_of_initializer %bool.make_type.loc11 [template = bool] -// CHECK:STDOUT: %.loc11_18.3: type = converted %bool.make_type.loc11, %.loc11_18.2 [template = bool] -// CHECK:STDOUT: %.loc11_18.4: type = converted %.loc11_18.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %a.var: ref %tuple.type.2 = var a // CHECK:STDOUT: %a: ref %tuple.type.2 = bind_name a, %a.var -// CHECK:STDOUT: %int_32.loc12: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc12: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %b.var: ref %i32 = var b // CHECK:STDOUT: %b: ref %i32 = bind_name b, %b.var -// CHECK:STDOUT: %bool.make_type.loc13: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc13_8.1: type = value_of_initializer %bool.make_type.loc13 [template = bool] -// CHECK:STDOUT: %.loc13_8.2: type = converted %bool.make_type.loc13, %.loc13_8.1 [template = bool] // CHECK:STDOUT: %c.var: ref bool = var c // CHECK:STDOUT: %c: ref bool = bind_name c, %c.var -// CHECK:STDOUT: %int_32.loc14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %d.var: ref %i32 = var d // CHECK:STDOUT: %d: ref %i32 = bind_name d, %d.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/tuple/fail_assign_nested.carbon b/toolchain/check/testdata/tuple/fail_assign_nested.carbon index cb2450977b116..13beb1215939d 100644 --- a/toolchain/check/testdata/tuple/fail_assign_nested.carbon +++ b/toolchain/check/testdata/tuple/fail_assign_nested.carbon @@ -18,8 +18,6 @@ var x: ((i32, i32), (i32, i32)) = ((1, 2, 3), (4, 5, 6)); // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] -// CHECK:STDOUT: %tuple.type.1: type = tuple_type (type, type) [template] -// CHECK:STDOUT: %tuple.type.2: type = tuple_type (%tuple.type.1, %tuple.type.1) [template] // CHECK:STDOUT: %tuple.type.3: type = tuple_type (%i32, %i32) [template] // CHECK:STDOUT: %tuple.type.4: type = tuple_type (%tuple.type.3, %tuple.type.3) [template] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template] @@ -46,20 +44,6 @@ var x: ((i32, i32), (i32, i32)) = ((1, 2, 3), (4, 5, 6)); // CHECK:STDOUT: .x = %x // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int_32.loc14_10: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc14_10: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc14_15: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc14_15: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc14_18: %tuple.type.1 = tuple_literal (%i32.loc14_10, %i32.loc14_15) -// CHECK:STDOUT: %int_32.loc14_22: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc14_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc14_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc14_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc14_30: %tuple.type.1 = tuple_literal (%i32.loc14_22, %i32.loc14_27) -// CHECK:STDOUT: %.loc14_31.1: %tuple.type.2 = tuple_literal (%.loc14_18, %.loc14_30) -// CHECK:STDOUT: %.loc14_31.2: type = converted %.loc14_18, constants.%tuple.type.3 [template = constants.%tuple.type.3] -// CHECK:STDOUT: %.loc14_31.3: type = converted %.loc14_30, constants.%tuple.type.3 [template = constants.%tuple.type.3] -// CHECK:STDOUT: %.loc14_31.4: type = converted %.loc14_31.1, constants.%tuple.type.4 [template = constants.%tuple.type.4] // CHECK:STDOUT: %x.var: ref %tuple.type.4 = var x // CHECK:STDOUT: %x: ref %tuple.type.4 = bind_name x, %x.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/tuple/fail_element_type_mismatch.carbon b/toolchain/check/testdata/tuple/fail_element_type_mismatch.carbon index e90255e4e7138..4eddc80f95341 100644 --- a/toolchain/check/testdata/tuple/fail_element_type_mismatch.carbon +++ b/toolchain/check/testdata/tuple/fail_element_type_mismatch.carbon @@ -21,7 +21,6 @@ var x: (i32, i32) = (2, 65.89); // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] -// CHECK:STDOUT: %tuple.type.1: type = tuple_type (type, type) [template] // CHECK:STDOUT: %tuple.type.2: type = tuple_type (%i32, %i32) [template] // CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %float: f64 = float_literal 65.890000000000001 [template] @@ -50,12 +49,6 @@ var x: (i32, i32) = (2, 65.89); // CHECK:STDOUT: .x = %x // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int_32.loc17_9: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc17_9: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc17_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc17_14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc17_17.1: %tuple.type.1 = tuple_literal (%i32.loc17_9, %i32.loc17_14) -// CHECK:STDOUT: %.loc17_17.2: type = converted %.loc17_17.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %x.var: ref %tuple.type.2 = var x // CHECK:STDOUT: %x: ref %tuple.type.2 = bind_name x, %x.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/tuple/fail_nested_incomplete.carbon b/toolchain/check/testdata/tuple/fail_nested_incomplete.carbon index 4db900e89f700..680fcaad880c3 100644 --- a/toolchain/check/testdata/tuple/fail_nested_incomplete.carbon +++ b/toolchain/check/testdata/tuple/fail_nested_incomplete.carbon @@ -24,10 +24,6 @@ var p: Incomplete* = &t[1]; // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %Incomplete: type = class_type @Incomplete [template] -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] -// CHECK:STDOUT: %tuple.type.1: type = tuple_type (type, type) [template] -// CHECK:STDOUT: %tuple.type.2: type = tuple_type (%i32, %Incomplete) [template] // CHECK:STDOUT: %ptr: type = ptr_type %Incomplete [template] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: } @@ -49,15 +45,8 @@ var p: Incomplete* = &t[1]; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Incomplete.decl: type = class_decl @Incomplete [template = constants.%Incomplete] {} {} -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %Incomplete.ref.loc19: type = name_ref Incomplete, %Incomplete.decl [template = constants.%Incomplete] -// CHECK:STDOUT: %.loc19_24.1: %tuple.type.1 = tuple_literal (%i32, %Incomplete.ref.loc19) -// CHECK:STDOUT: %.loc19_24.2: type = converted %.loc19_24.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %t.var: ref = var t // CHECK:STDOUT: %t: ref = bind_name t, %t.var -// CHECK:STDOUT: %Incomplete.ref.loc21: type = name_ref Incomplete, %Incomplete.decl [template = constants.%Incomplete] -// CHECK:STDOUT: %ptr: type = ptr_type %Incomplete [template = constants.%ptr] // CHECK:STDOUT: %p.var: ref %ptr = var p // CHECK:STDOUT: %p: ref %ptr = bind_name p, %p.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/tuple/fail_too_few_element.carbon b/toolchain/check/testdata/tuple/fail_too_few_element.carbon index 386963a35ada7..09a838692fd2d 100644 --- a/toolchain/check/testdata/tuple/fail_too_few_element.carbon +++ b/toolchain/check/testdata/tuple/fail_too_few_element.carbon @@ -18,7 +18,6 @@ var x: (i32, i32) = (2, ); // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] -// CHECK:STDOUT: %tuple.type.1: type = tuple_type (type, type) [template] // CHECK:STDOUT: %tuple.type.2: type = tuple_type (%i32, %i32) [template] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template] // CHECK:STDOUT: %tuple.type.3: type = tuple_type (Core.IntLiteral) [template] @@ -38,12 +37,6 @@ var x: (i32, i32) = (2, ); // CHECK:STDOUT: .x = %x // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int_32.loc14_9: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc14_9: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc14_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc14_14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc14_17.1: %tuple.type.1 = tuple_literal (%i32.loc14_9, %i32.loc14_14) -// CHECK:STDOUT: %.loc14_17.2: type = converted %.loc14_17.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %x.var: ref %tuple.type.2 = var x // CHECK:STDOUT: %x: ref %tuple.type.2 = bind_name x, %x.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/tuple/fail_type_assign.carbon b/toolchain/check/testdata/tuple/fail_type_assign.carbon index b35fd146b08e3..642cdb3420fa8 100644 --- a/toolchain/check/testdata/tuple/fail_type_assign.carbon +++ b/toolchain/check/testdata/tuple/fail_type_assign.carbon @@ -40,10 +40,6 @@ var x: (i32, ) = (i32, ); // CHECK:STDOUT: .x = %x // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc17_14.1: %tuple.type.1 = tuple_literal (%i32) -// CHECK:STDOUT: %.loc17_14.2: type = converted %.loc17_14.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %x.var: ref %tuple.type.2 = var x // CHECK:STDOUT: %x: ref %tuple.type.2 = bind_name x, %x.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/tuple/fail_value_as_type.carbon b/toolchain/check/testdata/tuple/fail_value_as_type.carbon index ad24527852d64..e3db2175a08d9 100644 --- a/toolchain/check/testdata/tuple/fail_value_as_type.carbon +++ b/toolchain/check/testdata/tuple/fail_value_as_type.carbon @@ -19,8 +19,6 @@ var x: (1, ); // CHECK:STDOUT: --- fail_value_as_type.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %tuple.type: type = tuple_type (Core.IntLiteral) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -37,9 +35,6 @@ var x: (1, ); // CHECK:STDOUT: .x = %x // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1] -// CHECK:STDOUT: %.loc17_12.1: %tuple.type = tuple_literal (%int_1) -// CHECK:STDOUT: %.loc17_12.2: type = converted %int_1, [template = ] // CHECK:STDOUT: %x.var: ref = var x // CHECK:STDOUT: %x: ref = bind_name x, %x.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/tuple/import.carbon b/toolchain/check/testdata/tuple/import.carbon index 32a90df4b979f..621d60e8b5211 100644 --- a/toolchain/check/testdata/tuple/import.carbon +++ b/toolchain/check/testdata/tuple/import.carbon @@ -58,7 +58,6 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] -// CHECK:STDOUT: %tuple.type.1: type = tuple_type (type) [template] // CHECK:STDOUT: %tuple.type.2: type = tuple_type (%i32) [template] // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] // CHECK:STDOUT: %tuple.type.3: type = tuple_type (Core.IntLiteral) [template] @@ -70,9 +69,7 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] // CHECK:STDOUT: %tuple.1: %tuple.type.2 = tuple_value (%int_0.2) [template] -// CHECK:STDOUT: %tuple.type.4: type = tuple_type (%tuple.type.1, type) [template] // CHECK:STDOUT: %tuple.type.5: type = tuple_type (type, type) [template] -// CHECK:STDOUT: %tuple.type.6: type = tuple_type (%tuple.type.4, %tuple.type.5) [template] // CHECK:STDOUT: %tuple.type.7: type = tuple_type (%tuple.type.2, %i32) [template] // CHECK:STDOUT: %tuple.type.8: type = tuple_type (%i32, %i32) [template] // CHECK:STDOUT: %tuple.type.9: type = tuple_type (%tuple.type.7, %tuple.type.8) [template] @@ -125,41 +122,23 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int_32.loc4: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc4: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc4_17.1: %tuple.type.1 = tuple_literal (%i32.loc4) -// CHECK:STDOUT: %.loc4_17.2: type = converted %.loc4_17.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %a_ref.var: ref %tuple.type.2 = var a_ref // CHECK:STDOUT: %a_ref: ref %tuple.type.2 = bind_name a_ref, %a_ref.var -// CHECK:STDOUT: %int_32.loc5_15: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc5_15: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc5_19: %tuple.type.1 = tuple_literal (%i32.loc5_15) -// CHECK:STDOUT: %int_32.loc5_22: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc5_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc5_25: %tuple.type.4 = tuple_literal (%.loc5_19, %i32.loc5_22) -// CHECK:STDOUT: %int_32.loc5_29: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc5_29: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc5_34: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc5_34: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc5_37: %tuple.type.5 = tuple_literal (%i32.loc5_29, %i32.loc5_34) -// CHECK:STDOUT: %.loc5_38.1: %tuple.type.6 = tuple_literal (%.loc5_25, %.loc5_37) -// CHECK:STDOUT: %.loc5_38.2: type = converted %.loc5_19, constants.%tuple.type.2 [template = constants.%tuple.type.2] -// CHECK:STDOUT: %.loc5_38.3: type = converted %.loc5_25, constants.%tuple.type.7 [template = constants.%tuple.type.7] -// CHECK:STDOUT: %.loc5_38.4: type = converted %.loc5_37, constants.%tuple.type.8 [template = constants.%tuple.type.8] -// CHECK:STDOUT: %.loc5_38.5: type = converted %.loc5_38.1, constants.%tuple.type.9 [template = constants.%tuple.type.9] // CHECK:STDOUT: %b_ref.var: ref %tuple.type.9 = var b_ref // CHECK:STDOUT: %b_ref: ref %tuple.type.9 = bind_name b_ref, %b_ref.var // CHECK:STDOUT: %C.decl: %C.type = class_decl @C [template = constants.%C.generic] { // CHECK:STDOUT: %X.patt.loc7_9.1: %tuple.type.8 = symbolic_binding_pattern X, 0 [symbolic = %X.patt.loc7_9.2 (constants.%X.patt)] // CHECK:STDOUT: %X.param_patt: %tuple.type.8 = value_param_pattern %X.patt.loc7_9.1, runtime_param [symbolic = %X.patt.loc7_9.2 (constants.%X.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc7_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc7_14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc7_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc7_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc7_22.1: %tuple.type.5 = tuple_literal (%i32.loc7_14, %i32.loc7_19) -// CHECK:STDOUT: %.loc7_22.2: type = converted %.loc7_22.1, constants.%tuple.type.8 [template = constants.%tuple.type.8] // CHECK:STDOUT: %X.param: %tuple.type.8 = value_param runtime_param +// CHECK:STDOUT: %.loc7_22.3: type = splice_block %.loc7_22.2 [template = constants.%tuple.type.8] { +// CHECK:STDOUT: %int_32.loc7_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc7_14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %int_32.loc7_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc7_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc7_22.1: %tuple.type.5 = tuple_literal (%i32.loc7_14, %i32.loc7_19) +// CHECK:STDOUT: %.loc7_22.2: type = converted %.loc7_22.1, constants.%tuple.type.8 [template = constants.%tuple.type.8] +// CHECK:STDOUT: } // CHECK:STDOUT: %X.loc7_9.1: %tuple.type.8 = bind_symbolic_name X, 0, %X.param [symbolic = %X.loc7_9.2 (constants.%X)] // CHECK:STDOUT: } // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { @@ -284,11 +263,7 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] -// CHECK:STDOUT: %tuple.type.1: type = tuple_type (type) [template] // CHECK:STDOUT: %tuple.type.2: type = tuple_type (%i32) [template] -// CHECK:STDOUT: %tuple.type.3: type = tuple_type (%tuple.type.1, type) [template] -// CHECK:STDOUT: %tuple.type.4: type = tuple_type (type, type) [template] -// CHECK:STDOUT: %tuple.type.5: type = tuple_type (%tuple.type.3, %tuple.type.4) [template] // CHECK:STDOUT: %tuple.type.6: type = tuple_type (%tuple.type.2, %i32) [template] // CHECK:STDOUT: %tuple.type.7: type = tuple_type (%i32, %i32) [template] // CHECK:STDOUT: %tuple.type.8: type = tuple_type (%tuple.type.6, %tuple.type.7) [template] @@ -298,18 +273,7 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %complete_type.3: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %X: %tuple.type.7 = bind_symbolic_name X, 0 [symbolic] // CHECK:STDOUT: %X.patt: %tuple.type.7 = symbolic_binding_pattern X, 0 [symbolic] -// CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %tuple.type.10: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] // CHECK:STDOUT: %tuple: %tuple.type.7 = tuple_value (%int_1.2, %int_2.2) [template] // CHECK:STDOUT: %C.2: type = class_type @C, @C(%tuple) [template] @@ -329,7 +293,7 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.195: = import_ref Implicit//default, loc7_26, loaded [template = constants.%complete_type.3] -// CHECK:STDOUT: %import_ref.196 = import_ref Implicit//default, inst637 [no loc], unloaded +// CHECK:STDOUT: %import_ref.196 = import_ref Implicit//default, inst638 [no loc], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -346,49 +310,10 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %Implicit.import = import Implicit // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int_32.loc4: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc4: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc4_13.1: %tuple.type.1 = tuple_literal (%i32.loc4) -// CHECK:STDOUT: %.loc4_13.2: type = converted %.loc4_13.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %a.var: ref %tuple.type.2 = var a // CHECK:STDOUT: %a: ref %tuple.type.2 = bind_name a, %a.var -// CHECK:STDOUT: %int_32.loc5_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc5_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc5_15: %tuple.type.1 = tuple_literal (%i32.loc5_11) -// CHECK:STDOUT: %int_32.loc5_18: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc5_18: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc5_21: %tuple.type.3 = tuple_literal (%.loc5_15, %i32.loc5_18) -// CHECK:STDOUT: %int_32.loc5_25: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc5_25: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc5_30: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc5_30: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc5_33: %tuple.type.4 = tuple_literal (%i32.loc5_25, %i32.loc5_30) -// CHECK:STDOUT: %.loc5_34.1: %tuple.type.5 = tuple_literal (%.loc5_21, %.loc5_33) -// CHECK:STDOUT: %.loc5_34.2: type = converted %.loc5_15, constants.%tuple.type.2 [template = constants.%tuple.type.2] -// CHECK:STDOUT: %.loc5_34.3: type = converted %.loc5_21, constants.%tuple.type.6 [template = constants.%tuple.type.6] -// CHECK:STDOUT: %.loc5_34.4: type = converted %.loc5_33, constants.%tuple.type.7 [template = constants.%tuple.type.7] -// CHECK:STDOUT: %.loc5_34.5: type = converted %.loc5_34.1, constants.%tuple.type.8 [template = constants.%tuple.type.8] // CHECK:STDOUT: %b.var: ref %tuple.type.8 = var b // CHECK:STDOUT: %b: ref %tuple.type.8 = bind_name b, %b.var -// CHECK:STDOUT: %C.ref: %C.type = name_ref C, imports.%import_ref.3 [template = constants.%C.generic] -// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %.loc6_15.1: %tuple.type.10 = tuple_literal (%int_1, %int_2) -// CHECK:STDOUT: %impl.elem0.loc6_15.1: %Convert.type.9 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc6_15.1: = bound_method %int_1, %impl.elem0.loc6_15.1 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc6_15.1: = specific_function %Convert.bound.loc6_15.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc6_15.1: init %i32 = call %Convert.specific_fn.loc6_15.1(%int_1) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc6_15.2: %i32 = value_of_initializer %int.convert_checked.loc6_15.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc6_15.3: %i32 = converted %int_1, %.loc6_15.2 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc6_15.2: %Convert.type.9 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc6_15.2: = bound_method %int_2, %impl.elem0.loc6_15.2 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc6_15.2: = specific_function %Convert.bound.loc6_15.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] -// CHECK:STDOUT: %int.convert_checked.loc6_15.2: init %i32 = call %Convert.specific_fn.loc6_15.2(%int_2) [template = constants.%int_2.2] -// CHECK:STDOUT: %.loc6_15.4: %i32 = value_of_initializer %int.convert_checked.loc6_15.2 [template = constants.%int_2.2] -// CHECK:STDOUT: %.loc6_15.5: %i32 = converted %int_2, %.loc6_15.4 [template = constants.%int_2.2] -// CHECK:STDOUT: %tuple: %tuple.type.7 = tuple_value (%.loc6_15.3, %.loc6_15.5) [template = constants.%tuple] -// CHECK:STDOUT: %.loc6_16: %tuple.type.7 = converted %.loc6_15.1, %tuple [template = constants.%tuple] -// CHECK:STDOUT: %C: type = class_type @C, @C(constants.%tuple) [template = constants.%C.2] // CHECK:STDOUT: %c.var: ref %C.2 = var c // CHECK:STDOUT: %c: ref %C.2 = bind_name c, %c.var // CHECK:STDOUT: } @@ -478,10 +403,6 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %tuple.type.1: type = tuple_type (%i32, %i32) [template] // CHECK:STDOUT: %X: %tuple.type.1 = bind_symbolic_name X, 0 [symbolic] // CHECK:STDOUT: %X.patt: %tuple.type.1 = symbolic_binding_pattern X, 0 [symbolic] -// CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template] -// CHECK:STDOUT: %tuple.type.2: type = tuple_type (Core.IntLiteral, Core.IntLiteral, Core.IntLiteral) [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] @@ -500,7 +421,7 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.194: = import_ref Implicit//default, loc7_26, loaded [template = constants.%complete_type.3] -// CHECK:STDOUT: %import_ref.195 = import_ref Implicit//default, inst637 [no loc], unloaded +// CHECK:STDOUT: %import_ref.195 = import_ref Implicit//default, inst638 [no loc], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -515,11 +436,6 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %Implicit.import = import Implicit // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %C.ref: %C.type = name_ref C, imports.%import_ref.3 [template = constants.%C.generic] -// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3] -// CHECK:STDOUT: %.loc12: %tuple.type.2 = tuple_literal (%int_1, %int_2, %int_3) // CHECK:STDOUT: %c_bad.var: ref = var c_bad // CHECK:STDOUT: %c_bad: ref = bind_name c_bad, %c_bad.var // CHECK:STDOUT: } @@ -572,18 +488,7 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %tuple.type.1: type = tuple_type (%i32, %i32) [template] // CHECK:STDOUT: %X: %tuple.type.1 = bind_symbolic_name X, 0 [symbolic] // CHECK:STDOUT: %X.patt: %tuple.type.1 = symbolic_binding_pattern X, 0 [symbolic] -// CHECK:STDOUT: %int_3.1: Core.IntLiteral = int_value 3 [template] -// CHECK:STDOUT: %int_4.1: Core.IntLiteral = int_value 4 [template] -// CHECK:STDOUT: %tuple.type.2: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [template] -// CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_3.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_3.2: %i32 = int_value 3 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_4.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_4.2: %i32 = int_value 4 [template] // CHECK:STDOUT: %tuple.1: %tuple.type.1 = tuple_value (%int_3.2, %int_4.2) [template] // CHECK:STDOUT: %C.2: type = class_type @C, @C(%tuple.1) [template] @@ -606,7 +511,7 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.194: = import_ref Implicit//default, loc7_26, loaded [template = constants.%complete_type.3] -// CHECK:STDOUT: %import_ref.195 = import_ref Implicit//default, inst637 [no loc], unloaded +// CHECK:STDOUT: %import_ref.195 = import_ref Implicit//default, inst638 [no loc], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -621,25 +526,6 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %Implicit.import = import Implicit // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %C.ref: %C.type = name_ref C, imports.%import_ref.3 [template = constants.%C.generic] -// CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] -// CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [template = constants.%int_4.1] -// CHECK:STDOUT: %.loc10_19.1: %tuple.type.2 = tuple_literal (%int_3, %int_4) -// CHECK:STDOUT: %impl.elem0.loc10_19.1: %Convert.type.9 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc10_19.1: = bound_method %int_3, %impl.elem0.loc10_19.1 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc10_19.1: = specific_function %Convert.bound.loc10_19.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc10_19.1: init %i32 = call %Convert.specific_fn.loc10_19.1(%int_3) [template = constants.%int_3.2] -// CHECK:STDOUT: %.loc10_19.2: %i32 = value_of_initializer %int.convert_checked.loc10_19.1 [template = constants.%int_3.2] -// CHECK:STDOUT: %.loc10_19.3: %i32 = converted %int_3, %.loc10_19.2 [template = constants.%int_3.2] -// CHECK:STDOUT: %impl.elem0.loc10_19.2: %Convert.type.9 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc10_19.2: = bound_method %int_4, %impl.elem0.loc10_19.2 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc10_19.2: = specific_function %Convert.bound.loc10_19.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] -// CHECK:STDOUT: %int.convert_checked.loc10_19.2: init %i32 = call %Convert.specific_fn.loc10_19.2(%int_4) [template = constants.%int_4.2] -// CHECK:STDOUT: %.loc10_19.4: %i32 = value_of_initializer %int.convert_checked.loc10_19.2 [template = constants.%int_4.2] -// CHECK:STDOUT: %.loc10_19.5: %i32 = converted %int_4, %.loc10_19.4 [template = constants.%int_4.2] -// CHECK:STDOUT: %tuple: %tuple.type.1 = tuple_value (%.loc10_19.3, %.loc10_19.5) [template = constants.%tuple.1] -// CHECK:STDOUT: %.loc10_20: %tuple.type.1 = converted %.loc10_19.1, %tuple [template = constants.%tuple.1] -// CHECK:STDOUT: %C: type = class_type @C, @C(constants.%tuple.1) [template = constants.%C.2] // CHECK:STDOUT: %c_bad.var: ref %C.2 = var c_bad // CHECK:STDOUT: %c_bad: ref %C.2 = bind_name c_bad, %c_bad.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/tuple/nested_tuple.carbon b/toolchain/check/testdata/tuple/nested_tuple.carbon index 1ead3759c074c..329883656d7e5 100644 --- a/toolchain/check/testdata/tuple/nested_tuple.carbon +++ b/toolchain/check/testdata/tuple/nested_tuple.carbon @@ -15,8 +15,6 @@ var x: ((i32, i32), i32) = ((12, 76), 6); // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] -// CHECK:STDOUT: %tuple.type.1: type = tuple_type (type, type) [template] -// CHECK:STDOUT: %tuple.type.2: type = tuple_type (%tuple.type.1, type) [template] // CHECK:STDOUT: %tuple.type.3: type = tuple_type (%i32, %i32) [template] // CHECK:STDOUT: %tuple.type.4: type = tuple_type (%tuple.type.3, %i32) [template] // CHECK:STDOUT: %int_12.1: Core.IntLiteral = int_value 12 [template] @@ -56,16 +54,6 @@ var x: ((i32, i32), i32) = ((12, 76), 6); // CHECK:STDOUT: .x = %x // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int_32.loc11_10: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc11_10: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc11_15: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc11_15: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_18: %tuple.type.1 = tuple_literal (%i32.loc11_10, %i32.loc11_15) -// CHECK:STDOUT: %int_32.loc11_21: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc11_21: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_24.1: %tuple.type.2 = tuple_literal (%.loc11_18, %i32.loc11_21) -// CHECK:STDOUT: %.loc11_24.2: type = converted %.loc11_18, constants.%tuple.type.3 [template = constants.%tuple.type.3] -// CHECK:STDOUT: %.loc11_24.3: type = converted %.loc11_24.1, constants.%tuple.type.4 [template = constants.%tuple.type.4] // CHECK:STDOUT: %x.var: ref %tuple.type.4 = var x // CHECK:STDOUT: %x: ref %tuple.type.4 = bind_name x, %x.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/tuple/nested_tuple_in_place.carbon b/toolchain/check/testdata/tuple/nested_tuple_in_place.carbon index 3b9604201bf26..7cdbaa3cde80b 100644 --- a/toolchain/check/testdata/tuple/nested_tuple_in_place.carbon +++ b/toolchain/check/testdata/tuple/nested_tuple_in_place.carbon @@ -29,11 +29,9 @@ fn H() { // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] -// CHECK:STDOUT: %tuple.type.3: type = tuple_type (%tuple.type.1, %tuple.type.1) [template] // CHECK:STDOUT: %tuple.type.4: type = tuple_type (%tuple.type.2, %tuple.type.2) [template] // CHECK:STDOUT: %H.type: type = fn_type @H [template] // CHECK:STDOUT: %H: %H.type = struct_value () [template] -// CHECK:STDOUT: %tuple.type.6: type = tuple_type (type, %tuple.type.1, type) [template] // CHECK:STDOUT: %tuple.type.7: type = tuple_type (%i32, %tuple.type.2, %i32) [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] // CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] @@ -90,24 +88,6 @@ fn H() { // CHECK:STDOUT: // CHECK:STDOUT: fn @G() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int_32.loc14_12: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc14_12: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc14_17: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc14_17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc14_22: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc14_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc14_25: %tuple.type.1 = tuple_literal (%i32.loc14_12, %i32.loc14_17, %i32.loc14_22) -// CHECK:STDOUT: %int_32.loc14_29: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc14_29: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc14_34: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc14_34: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc14_39: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc14_39: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc14_42: %tuple.type.1 = tuple_literal (%i32.loc14_29, %i32.loc14_34, %i32.loc14_39) -// CHECK:STDOUT: %.loc14_43.1: %tuple.type.3 = tuple_literal (%.loc14_25, %.loc14_42) -// CHECK:STDOUT: %.loc14_43.2: type = converted %.loc14_25, constants.%tuple.type.2 [template = constants.%tuple.type.2] -// CHECK:STDOUT: %.loc14_43.3: type = converted %.loc14_42, constants.%tuple.type.2 [template = constants.%tuple.type.2] -// CHECK:STDOUT: %.loc14_43.4: type = converted %.loc14_43.1, constants.%tuple.type.4 [template = constants.%tuple.type.4] // CHECK:STDOUT: %v.var: ref %tuple.type.4 = var v // CHECK:STDOUT: %v: ref %tuple.type.4 = bind_name v, %v.var // CHECK:STDOUT: %F.ref.loc14_48: %F.type = name_ref F, file.%F.decl [template = constants.%F] @@ -125,20 +105,6 @@ fn H() { // CHECK:STDOUT: // CHECK:STDOUT: fn @H() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int_32.loc18_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc18_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc18_17: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc18_17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc18_22: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc18_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc18_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc18_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc18_30: %tuple.type.1 = tuple_literal (%i32.loc18_17, %i32.loc18_22, %i32.loc18_27) -// CHECK:STDOUT: %int_32.loc18_33: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc18_33: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc18_36.1: %tuple.type.6 = tuple_literal (%i32.loc18_11, %.loc18_30, %i32.loc18_33) -// CHECK:STDOUT: %.loc18_36.2: type = converted %.loc18_30, constants.%tuple.type.2 [template = constants.%tuple.type.2] -// CHECK:STDOUT: %.loc18_36.3: type = converted %.loc18_36.1, constants.%tuple.type.7 [template = constants.%tuple.type.7] // CHECK:STDOUT: %v.var: ref %tuple.type.7 = var v // CHECK:STDOUT: %v: ref %tuple.type.7 = bind_name v, %v.var // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] diff --git a/toolchain/check/testdata/tuple/no_prelude/empty.carbon b/toolchain/check/testdata/tuple/no_prelude/empty.carbon index ea1f690d976ac..b12481d3a2f2a 100644 --- a/toolchain/check/testdata/tuple/no_prelude/empty.carbon +++ b/toolchain/check/testdata/tuple/no_prelude/empty.carbon @@ -23,12 +23,8 @@ var y: () = x; // CHECK:STDOUT: .x = %x // CHECK:STDOUT: .y = %y // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc11_9.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc11_9.2: type = converted %.loc11_9.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %x.var: ref %empty_tuple.type = var x // CHECK:STDOUT: %x: ref %empty_tuple.type = bind_name x, %x.var -// CHECK:STDOUT: %.loc12_9.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc12_9.2: type = converted %.loc12_9.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %y.var: ref %empty_tuple.type = var y // CHECK:STDOUT: %y: ref %empty_tuple.type = bind_name y, %y.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/tuple/no_prelude/fail_assign_empty.carbon b/toolchain/check/testdata/tuple/no_prelude/fail_assign_empty.carbon index 1e21bddbc41af..df8abdb34dd20 100644 --- a/toolchain/check/testdata/tuple/no_prelude/fail_assign_empty.carbon +++ b/toolchain/check/testdata/tuple/no_prelude/fail_assign_empty.carbon @@ -24,10 +24,6 @@ var x: ((),) = (); // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .x = %x // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc14_10: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc14_12.1: %tuple.type = tuple_literal (%.loc14_10) -// CHECK:STDOUT: %.loc14_12.2: type = converted %.loc14_10, constants.%empty_tuple.type [template = constants.%empty_tuple.type] -// CHECK:STDOUT: %.loc14_12.3: type = converted %.loc14_12.1, constants.%tuple.type [template = constants.%tuple.type] // CHECK:STDOUT: %x.var: ref %tuple.type = var x // CHECK:STDOUT: %x: ref %tuple.type = bind_name x, %x.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/tuple/no_prelude/fail_assign_to_empty.carbon b/toolchain/check/testdata/tuple/no_prelude/fail_assign_to_empty.carbon index d5fe5553a234a..434a52a042216 100644 --- a/toolchain/check/testdata/tuple/no_prelude/fail_assign_to_empty.carbon +++ b/toolchain/check/testdata/tuple/no_prelude/fail_assign_to_empty.carbon @@ -24,8 +24,6 @@ var x: () = ((),); // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .x = %x // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc14_9.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc14_9.2: type = converted %.loc14_9.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %x.var: ref %empty_tuple.type = var x // CHECK:STDOUT: %x: ref %empty_tuple.type = bind_name x, %x.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/tuple/one_element.carbon b/toolchain/check/testdata/tuple/one_element.carbon index 01be2b758d361..18bec3632c133 100644 --- a/toolchain/check/testdata/tuple/one_element.carbon +++ b/toolchain/check/testdata/tuple/one_element.carbon @@ -16,7 +16,6 @@ var y: (i32,) = x; // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] -// CHECK:STDOUT: %tuple.type.1: type = tuple_type (type) [template] // CHECK:STDOUT: %tuple.type.2: type = tuple_type (%i32) [template] // CHECK:STDOUT: %int_4.1: Core.IntLiteral = int_value 4 [template] // CHECK:STDOUT: %tuple.type.3: type = tuple_type (Core.IntLiteral) [template] @@ -46,16 +45,8 @@ var y: (i32,) = x; // CHECK:STDOUT: .y = %y // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int_32.loc11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_13.1: %tuple.type.1 = tuple_literal (%i32.loc11) -// CHECK:STDOUT: %.loc11_13.2: type = converted %.loc11_13.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %x.var: ref %tuple.type.2 = var x // CHECK:STDOUT: %x: ref %tuple.type.2 = bind_name x, %x.var -// CHECK:STDOUT: %int_32.loc12: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc12: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc12_13.1: %tuple.type.1 = tuple_literal (%i32.loc12) -// CHECK:STDOUT: %.loc12_13.2: type = converted %.loc12_13.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %y.var: ref %tuple.type.2 = var y // CHECK:STDOUT: %y: ref %tuple.type.2 = bind_name y, %y.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/tuple/two_elements.carbon b/toolchain/check/testdata/tuple/two_elements.carbon index b2f6abf8d50c1..a17a81c3b62bc 100644 --- a/toolchain/check/testdata/tuple/two_elements.carbon +++ b/toolchain/check/testdata/tuple/two_elements.carbon @@ -19,7 +19,6 @@ var y: (i32, i32) = x; // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] -// CHECK:STDOUT: %tuple.type.1: type = tuple_type (type, type) [template] // CHECK:STDOUT: %tuple.type.2: type = tuple_type (%i32, %i32) [template] // CHECK:STDOUT: %int_4.1: Core.IntLiteral = int_value 4 [template] // CHECK:STDOUT: %int_102.1: Core.IntLiteral = int_value 102 [template] @@ -55,32 +54,8 @@ var y: (i32, i32) = x; // CHECK:STDOUT: .y = %y // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %int_32.loc11_9: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc11_9: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc11_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc11_14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc11_17.1: %tuple.type.1 = tuple_literal (%i32.loc11_9, %i32.loc11_14) -// CHECK:STDOUT: %.loc11_17.2: type = converted %.loc11_17.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] -// CHECK:STDOUT: %int_32.loc12_9: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc12_9: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc12_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc12_14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc12_17.1: %tuple.type.1 = tuple_literal (%i32.loc12_9, %i32.loc12_14) -// CHECK:STDOUT: %.loc12_17.2: type = converted %.loc12_17.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] -// CHECK:STDOUT: %int_32.loc14_9: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc14_9: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc14_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc14_14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc14_17.1: %tuple.type.1 = tuple_literal (%i32.loc14_9, %i32.loc14_14) -// CHECK:STDOUT: %.loc14_17.2: type = converted %.loc14_17.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %x.var: ref %tuple.type.2 = var x // CHECK:STDOUT: %x: ref %tuple.type.2 = bind_name x, %x.var -// CHECK:STDOUT: %int_32.loc15_9: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc15_9: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc15_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc15_14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc15_17.1: %tuple.type.1 = tuple_literal (%i32.loc15_9, %i32.loc15_14) -// CHECK:STDOUT: %.loc15_17.2: type = converted %.loc15_17.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] // CHECK:STDOUT: %y.var: ref %tuple.type.2 = var y // CHECK:STDOUT: %y: ref %tuple.type.2 = bind_name y, %y.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/var/fail_not_copyable.carbon b/toolchain/check/testdata/var/fail_not_copyable.carbon index 81726b2ea89ad..7d35b861fa1e0 100644 --- a/toolchain/check/testdata/var/fail_not_copyable.carbon +++ b/toolchain/check/testdata/var/fail_not_copyable.carbon @@ -57,8 +57,8 @@ fn F(x: X) { // CHECK:STDOUT: %x.patt: %X = binding_pattern x // CHECK:STDOUT: %x.param_patt: %X = value_param_pattern %x.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %X.ref.loc14: type = name_ref X, file.%X.decl [template = constants.%X] // CHECK:STDOUT: %x.param: %X = value_param runtime_param0 +// CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [template = constants.%X] // CHECK:STDOUT: %x: %X = bind_name x, %x.param // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -77,7 +77,6 @@ fn F(x: X) { // CHECK:STDOUT: %s: ref String = bind_name s, %s.var // CHECK:STDOUT: %str: String = string_literal "hello" [template = constants.%str] // CHECK:STDOUT: assign %s.var, -// CHECK:STDOUT: %X.ref.loc27: type = name_ref X, file.%X.decl [template = constants.%X] // CHECK:STDOUT: %y.var: ref %X = var y // CHECK:STDOUT: %y: ref %X = bind_name y, %y.var // CHECK:STDOUT: %x.ref: %X = name_ref x, %x diff --git a/toolchain/check/testdata/var/fail_storage_is_literal.carbon b/toolchain/check/testdata/var/fail_storage_is_literal.carbon index f799ed7a0b969..4e44271b69f4f 100644 --- a/toolchain/check/testdata/var/fail_storage_is_literal.carbon +++ b/toolchain/check/testdata/var/fail_storage_is_literal.carbon @@ -45,11 +45,9 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: fn @Main() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int_1.loc18_10: Core.IntLiteral = int_value 1 [template = constants.%int_1] -// CHECK:STDOUT: %.loc18: type = converted %int_1.loc18_10, [template = ] // CHECK:STDOUT: %x.var: ref = var x // CHECK:STDOUT: %x: ref = bind_name x, %x.var -// CHECK:STDOUT: %int_1.loc18_14: Core.IntLiteral = int_value 1 [template = constants.%int_1] +// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1] // CHECK:STDOUT: assign %x.var, // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/var/fail_todo_control_flow_init.carbon b/toolchain/check/testdata/var/fail_todo_control_flow_init.carbon index adf88eb0e8ec8..a0417fc2768e0 100644 --- a/toolchain/check/testdata/var/fail_todo_control_flow_init.carbon +++ b/toolchain/check/testdata/var/fail_todo_control_flow_init.carbon @@ -8,48 +8,64 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/var/fail_todo_control_flow_init.carbon -// CHECK:STDERR: fail_todo_control_flow_init.carbon:[[@LINE+12]]:13: error: semantics TODO: `Control flow expressions are currently only supported inside functions.` [SemanticsTodo] +// CHECK:STDERR: fail_todo_control_flow_init.carbon:[[@LINE+16]]:13: error: semantics TODO: `Control flow expressions are currently only supported inside functions.` [SemanticsTodo] // CHECK:STDERR: var x: () = if true then () else (); // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_todo_control_flow_init.carbon:[[@LINE+8]]:13: error: semantics TODO: `Control flow expressions are currently only supported inside functions.` [SemanticsTodo] +// CHECK:STDERR: fail_todo_control_flow_init.carbon:[[@LINE+12]]:13: error: semantics TODO: `Control flow expressions are currently only supported inside functions.` [SemanticsTodo] // CHECK:STDERR: var x: () = if true then () else (); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: +// CHECK:STDERR: fail_todo_control_flow_init.carbon:[[@LINE+8]]:13: error: semantics TODO: `Control flow expressions are currently only supported inside functions.` [SemanticsTodo] +// CHECK:STDERR: var x: () = if true then () else (); +// CHECK:STDERR: ^~~~~~~ +// CHECK:STDERR: // CHECK:STDERR: fail_todo_control_flow_init.carbon:[[@LINE+4]]:21: error: semantics TODO: `Control flow expressions are currently only supported inside functions.` [SemanticsTodo] // CHECK:STDERR: var x: () = if true then () else (); // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: var x: () = if true then () else (); -// CHECK:STDERR: fail_todo_control_flow_init.carbon:[[@LINE+12]]:14: error: semantics TODO: `Control flow expressions are currently only supported inside functions.` [SemanticsTodo] +// CHECK:STDERR: fail_todo_control_flow_init.carbon:[[@LINE+16]]:14: error: semantics TODO: `Control flow expressions are currently only supported inside functions.` [SemanticsTodo] // CHECK:STDERR: var x2: () = if false then () else (); // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_todo_control_flow_init.carbon:[[@LINE+8]]:14: error: semantics TODO: `Control flow expressions are currently only supported inside functions.` [SemanticsTodo] +// CHECK:STDERR: fail_todo_control_flow_init.carbon:[[@LINE+12]]:14: error: semantics TODO: `Control flow expressions are currently only supported inside functions.` [SemanticsTodo] // CHECK:STDERR: var x2: () = if false then () else (); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: +// CHECK:STDERR: fail_todo_control_flow_init.carbon:[[@LINE+8]]:14: error: semantics TODO: `Control flow expressions are currently only supported inside functions.` [SemanticsTodo] +// CHECK:STDERR: var x2: () = if false then () else (); +// CHECK:STDERR: ^~~~~~~~ +// CHECK:STDERR: // CHECK:STDERR: fail_todo_control_flow_init.carbon:[[@LINE+4]]:23: error: semantics TODO: `Control flow expressions are currently only supported inside functions.` [SemanticsTodo] // CHECK:STDERR: var x2: () = if false then () else (); // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: var x2: () = if false then () else (); -// CHECK:STDERR: fail_todo_control_flow_init.carbon:[[@LINE+8]]:15: error: semantics TODO: `Control flow expressions are currently only supported inside functions.` [SemanticsTodo] +// CHECK:STDERR: fail_todo_control_flow_init.carbon:[[@LINE+12]]:15: error: semantics TODO: `Control flow expressions are currently only supported inside functions.` [SemanticsTodo] // CHECK:STDERR: var y: bool = true or false; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: +// CHECK:STDERR: fail_todo_control_flow_init.carbon:[[@LINE+8]]:15: error: semantics TODO: `Control flow expressions are currently only supported inside functions.` [SemanticsTodo] +// CHECK:STDERR: var y: bool = true or false; +// CHECK:STDERR: ^~~~~~~~~~~~~ +// CHECK:STDERR: // CHECK:STDERR: fail_todo_control_flow_init.carbon:[[@LINE+4]]:15: error: semantics TODO: `Control flow expressions are currently only supported inside functions.` [SemanticsTodo] // CHECK:STDERR: var y: bool = true or false; // CHECK:STDERR: ^~~~~~~~~~~~~ // CHECK:STDERR: var y: bool = true or false; -// CHECK:STDERR: fail_todo_control_flow_init.carbon:[[@LINE+7]]:16: error: semantics TODO: `Control flow expressions are currently only supported inside functions.` [SemanticsTodo] +// CHECK:STDERR: fail_todo_control_flow_init.carbon:[[@LINE+11]]:16: error: semantics TODO: `Control flow expressions are currently only supported inside functions.` [SemanticsTodo] // CHECK:STDERR: var y2: bool = false or true; // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: +// CHECK:STDERR: fail_todo_control_flow_init.carbon:[[@LINE+7]]:16: error: semantics TODO: `Control flow expressions are currently only supported inside functions.` [SemanticsTodo] +// CHECK:STDERR: var y2: bool = false or true; +// CHECK:STDERR: ^~~~~~~~~~~~~ +// CHECK:STDERR: // CHECK:STDERR: fail_todo_control_flow_init.carbon:[[@LINE+3]]:16: error: semantics TODO: `Control flow expressions are currently only supported inside functions.` [SemanticsTodo] // CHECK:STDERR: var y2: bool = false or true; // CHECK:STDERR: ^~~~~~~~~~~~~ @@ -60,8 +76,6 @@ var y2: bool = false or true; // CHECK:STDOUT: constants { // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template] // CHECK:STDOUT: %true: bool = bool_literal true [template] -// CHECK:STDOUT: %Bool.type: type = fn_type @Bool [template] -// CHECK:STDOUT: %Bool: %Bool.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -81,22 +95,12 @@ var y2: bool = false or true; // CHECK:STDOUT: .y2 = %y2 // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %.loc23_9.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc23_9.2: type = converted %.loc23_9.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %x.var: ref %empty_tuple.type = var x // CHECK:STDOUT: %x: ref %empty_tuple.type = bind_name x, %x.var -// CHECK:STDOUT: %.loc37_10.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc37_10.2: type = converted %.loc37_10.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %x2.var: ref %empty_tuple.type = var x2 // CHECK:STDOUT: %x2: ref %empty_tuple.type = bind_name x2, %x2.var -// CHECK:STDOUT: %bool.make_type.loc47: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc47_8.1: type = value_of_initializer %bool.make_type.loc47 [template = bool] -// CHECK:STDOUT: %.loc47_8.2: type = converted %bool.make_type.loc47, %.loc47_8.1 [template = bool] // CHECK:STDOUT: %y.var: ref bool = var y // CHECK:STDOUT: %y: ref bool = bind_name y, %y.var -// CHECK:STDOUT: %bool.make_type.loc56: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc56_9.1: type = value_of_initializer %bool.make_type.loc56 [template = bool] -// CHECK:STDOUT: %.loc56_9.2: type = converted %bool.make_type.loc56, %.loc56_9.1 [template = bool] // CHECK:STDOUT: %y2.var: ref bool = var y2 // CHECK:STDOUT: %y2: ref bool = bind_name y2, %y2.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/var/no_prelude/decl.carbon b/toolchain/check/testdata/var/no_prelude/decl.carbon index 6fd50710afa32..853c0029dd883 100644 --- a/toolchain/check/testdata/var/no_prelude/decl.carbon +++ b/toolchain/check/testdata/var/no_prelude/decl.carbon @@ -29,8 +29,6 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: fn @Main() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc12_11.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc12_11.2: type = converted %.loc12_11.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %x.var: ref %empty_tuple.type = var x // CHECK:STDOUT: %x: ref %empty_tuple.type = bind_name x, %x.var // CHECK:STDOUT: return diff --git a/toolchain/check/testdata/var/no_prelude/decl_with_init.carbon b/toolchain/check/testdata/var/no_prelude/decl_with_init.carbon index 5ca2ea03d5b86..df63de8b5b323 100644 --- a/toolchain/check/testdata/var/no_prelude/decl_with_init.carbon +++ b/toolchain/check/testdata/var/no_prelude/decl_with_init.carbon @@ -30,8 +30,6 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: fn @Main() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc12_11.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc12_11.2: type = converted %.loc12_11.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %x.var: ref %empty_tuple.type = var x // CHECK:STDOUT: %x: ref %empty_tuple.type = bind_name x, %x.var // CHECK:STDOUT: %.loc12_16.1: %empty_tuple.type = tuple_literal () diff --git a/toolchain/check/testdata/var/no_prelude/export_name.carbon b/toolchain/check/testdata/var/no_prelude/export_name.carbon index 545a88848440d..e1bb7077ea99d 100644 --- a/toolchain/check/testdata/var/no_prelude/export_name.carbon +++ b/toolchain/check/testdata/var/no_prelude/export_name.carbon @@ -53,8 +53,6 @@ var w: () = v; // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .v = %v // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc4_9.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc4_9.2: type = converted %.loc4_9.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %v.var: ref %empty_tuple.type = var v // CHECK:STDOUT: %v: ref %empty_tuple.type = bind_name v, %v.var // CHECK:STDOUT: } @@ -94,8 +92,6 @@ var w: () = v; // CHECK:STDOUT: .w = %w // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %.loc11_9.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc11_9.2: type = converted %.loc11_9.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %w.var: ref %empty_tuple.type = var w // CHECK:STDOUT: %w: ref %empty_tuple.type = bind_name w, %w.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/var/no_prelude/fail_duplicate_decl.carbon b/toolchain/check/testdata/var/no_prelude/fail_duplicate_decl.carbon index 7711cf1823e83..416fbecd9a25a 100644 --- a/toolchain/check/testdata/var/no_prelude/fail_duplicate_decl.carbon +++ b/toolchain/check/testdata/var/no_prelude/fail_duplicate_decl.carbon @@ -38,16 +38,12 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: fn @Main() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc13_11.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc13_11.2: type = converted %.loc13_11.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %x.var.loc13: ref %empty_tuple.type = var x // CHECK:STDOUT: %x.loc13: ref %empty_tuple.type = bind_name x, %x.var.loc13 // CHECK:STDOUT: %.loc13_16.1: %empty_tuple.type = tuple_literal () // CHECK:STDOUT: %.loc13_16.2: init %empty_tuple.type = tuple_init () to %x.var.loc13 [template = constants.%empty_tuple] // CHECK:STDOUT: %.loc13_17: init %empty_tuple.type = converted %.loc13_16.1, %.loc13_16.2 [template = constants.%empty_tuple] // CHECK:STDOUT: assign %x.var.loc13, %.loc13_17 -// CHECK:STDOUT: %.loc20_11.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc20_11.2: type = converted %.loc20_11.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %x.var.loc20: ref %empty_tuple.type = var x // CHECK:STDOUT: %x.loc20: ref %empty_tuple.type = bind_name x, %x.var.loc20 // CHECK:STDOUT: %.loc20_16.1: %empty_tuple.type = tuple_literal () diff --git a/toolchain/check/testdata/var/no_prelude/fail_generic.carbon b/toolchain/check/testdata/var/no_prelude/fail_generic.carbon index 94f80ca1e7863..89f7994de283f 100644 --- a/toolchain/check/testdata/var/no_prelude/fail_generic.carbon +++ b/toolchain/check/testdata/var/no_prelude/fail_generic.carbon @@ -34,8 +34,6 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: fn @Main() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc15_12.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc15_12.2: type = converted %.loc15_12.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %x.var: ref %empty_tuple.type = var x // CHECK:STDOUT: %x: %empty_tuple.type = bind_symbolic_name x, %x.var [symbolic = constants.%x] // CHECK:STDOUT: %.loc15_17.1: %empty_tuple.type = tuple_literal () diff --git a/toolchain/check/testdata/var/no_prelude/fail_init_type_mismatch.carbon b/toolchain/check/testdata/var/no_prelude/fail_init_type_mismatch.carbon index 02f8b4a5f179d..1c3b26c90a028 100644 --- a/toolchain/check/testdata/var/no_prelude/fail_init_type_mismatch.carbon +++ b/toolchain/check/testdata/var/no_prelude/fail_init_type_mismatch.carbon @@ -34,8 +34,6 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: fn @Main() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc15_11.1: %empty_struct_type = struct_literal () -// CHECK:STDOUT: %.loc15_11.2: type = converted %.loc15_11.1, constants.%empty_struct_type [template = constants.%empty_struct_type] // CHECK:STDOUT: %x.var: ref %empty_struct_type = var x // CHECK:STDOUT: %x: ref %empty_struct_type = bind_name x, %x.var // CHECK:STDOUT: %.loc15_16.1: %empty_tuple.type = tuple_literal () diff --git a/toolchain/check/testdata/var/no_prelude/fail_init_with_self.carbon b/toolchain/check/testdata/var/no_prelude/fail_init_with_self.carbon index 109caf7855a91..72c4c49de9712 100644 --- a/toolchain/check/testdata/var/no_prelude/fail_init_with_self.carbon +++ b/toolchain/check/testdata/var/no_prelude/fail_init_with_self.carbon @@ -32,8 +32,6 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: fn @Main() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc15_11.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc15_11.2: type = converted %.loc15_11.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %x.var: ref %empty_tuple.type = var x // CHECK:STDOUT: %x: ref %empty_tuple.type = bind_name x, %x.var // CHECK:STDOUT: %x.ref: = name_ref x, [template = ] diff --git a/toolchain/check/testdata/var/no_prelude/fail_lookup_outside_scope.carbon b/toolchain/check/testdata/var/no_prelude/fail_lookup_outside_scope.carbon index 0b8c74632c3b1..e1ddf6f028a9e 100644 --- a/toolchain/check/testdata/var/no_prelude/fail_lookup_outside_scope.carbon +++ b/toolchain/check/testdata/var/no_prelude/fail_lookup_outside_scope.carbon @@ -31,16 +31,12 @@ var y: () = x; // CHECK:STDOUT: .y = %y // CHECK:STDOUT: } // CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} {} -// CHECK:STDOUT: %.loc18_9.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc18_9.2: type = converted %.loc18_9.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %y.var: ref %empty_tuple.type = var y // CHECK:STDOUT: %y: ref %empty_tuple.type = bind_name y, %y.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Main() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc12_11.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc12_11.2: type = converted %.loc12_11.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %x.var: ref %empty_tuple.type = var x // CHECK:STDOUT: %x: ref %empty_tuple.type = bind_name x, %x.var // CHECK:STDOUT: return diff --git a/toolchain/check/testdata/var/no_prelude/fail_modifiers.carbon b/toolchain/check/testdata/var/no_prelude/fail_modifiers.carbon index 0423bd01a922e..8646141c33220 100644 --- a/toolchain/check/testdata/var/no_prelude/fail_modifiers.carbon +++ b/toolchain/check/testdata/var/no_prelude/fail_modifiers.carbon @@ -54,20 +54,12 @@ abstract var e: (); // CHECK:STDOUT: .d = %d // CHECK:STDOUT: .e = %e // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc15_19.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc15_19.2: type = converted %.loc15_19.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %b.var: ref %empty_tuple.type = var b // CHECK:STDOUT: %b: ref %empty_tuple.type = bind_name b, %b.var -// CHECK:STDOUT: %.loc24_27.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc24_27.2: type = converted %.loc24_27.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %c.var: ref %empty_tuple.type = var c // CHECK:STDOUT: %c: ref %empty_tuple.type = bind_name c, %c.var -// CHECK:STDOUT: %.loc37_29.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc37_29.2: type = converted %.loc37_29.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %d.var: ref %empty_tuple.type = var d // CHECK:STDOUT: %d: ref %empty_tuple.type = bind_name d, %d.var -// CHECK:STDOUT: %.loc42_18.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc42_18.2: type = converted %.loc42_18.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %e.var: ref %empty_tuple.type = var e // CHECK:STDOUT: %e: ref %empty_tuple.type = bind_name e, %e.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/var/no_prelude/fail_namespace_conflict.carbon b/toolchain/check/testdata/var/no_prelude/fail_namespace_conflict.carbon index 85c8c309a068a..9c790d7c2d593 100644 --- a/toolchain/check/testdata/var/no_prelude/fail_namespace_conflict.carbon +++ b/toolchain/check/testdata/var/no_prelude/fail_namespace_conflict.carbon @@ -39,12 +39,8 @@ var A: () = (); // CHECK:STDOUT: .A = %A.loc11 // CHECK:STDOUT: } // CHECK:STDOUT: %A.loc11: = namespace [template] {} -// CHECK:STDOUT: %.loc20_9.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc20_9.2: type = converted %.loc20_9.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %A.var.loc20: ref %empty_tuple.type = var A // CHECK:STDOUT: %A.loc20: ref %empty_tuple.type = bind_name A, %A.var.loc20 -// CHECK:STDOUT: %.loc28_9.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc28_9.2: type = converted %.loc28_9.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %A.var.loc28: ref %empty_tuple.type = var A // CHECK:STDOUT: %A.loc28: ref %empty_tuple.type = bind_name A, %A.var.loc28 // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/var/no_prelude/global_decl.carbon b/toolchain/check/testdata/var/no_prelude/global_decl.carbon index 01e8dcc73ddd6..47d49e559419f 100644 --- a/toolchain/check/testdata/var/no_prelude/global_decl.carbon +++ b/toolchain/check/testdata/var/no_prelude/global_decl.carbon @@ -21,9 +21,6 @@ var x: {.v: ()}; // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .x = %x // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc11_14.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc11_14.2: type = converted %.loc11_14.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] -// CHECK:STDOUT: %struct_type.v: type = struct_type {.v: %empty_tuple.type} [template = constants.%struct_type.v] // CHECK:STDOUT: %x.var: ref %struct_type.v = var x // CHECK:STDOUT: %x: ref %struct_type.v = bind_name x, %x.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/var/no_prelude/global_decl_with_init.carbon b/toolchain/check/testdata/var/no_prelude/global_decl_with_init.carbon index 492213c011710..f8849b5cf5014 100644 --- a/toolchain/check/testdata/var/no_prelude/global_decl_with_init.carbon +++ b/toolchain/check/testdata/var/no_prelude/global_decl_with_init.carbon @@ -23,9 +23,6 @@ var x: {.v: ()} = {.v = ()}; // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .x = %x // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc11_14.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc11_14.2: type = converted %.loc11_14.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] -// CHECK:STDOUT: %struct_type.v: type = struct_type {.v: %empty_tuple.type} [template = constants.%struct_type.v] // CHECK:STDOUT: %x.var: ref %struct_type.v = var x // CHECK:STDOUT: %x: ref %struct_type.v = bind_name x, %x.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/var/no_prelude/global_lookup.carbon b/toolchain/check/testdata/var/no_prelude/global_lookup.carbon index 73efcf10599e7..c9c70cea3b052 100644 --- a/toolchain/check/testdata/var/no_prelude/global_lookup.carbon +++ b/toolchain/check/testdata/var/no_prelude/global_lookup.carbon @@ -25,14 +25,8 @@ var y: {.v: ()} = x; // CHECK:STDOUT: .x = %x // CHECK:STDOUT: .y = %y // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc11_14.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc11_14.2: type = converted %.loc11_14.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] -// CHECK:STDOUT: %struct_type.v.loc11: type = struct_type {.v: %empty_tuple.type} [template = constants.%struct_type.v] // CHECK:STDOUT: %x.var: ref %struct_type.v = var x // CHECK:STDOUT: %x: ref %struct_type.v = bind_name x, %x.var -// CHECK:STDOUT: %.loc12_14.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc12_14.2: type = converted %.loc12_14.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] -// CHECK:STDOUT: %struct_type.v.loc12: type = struct_type {.v: %empty_tuple.type} [template = constants.%struct_type.v] // CHECK:STDOUT: %y.var: ref %struct_type.v = var y // CHECK:STDOUT: %y: ref %struct_type.v = bind_name y, %y.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/var/no_prelude/global_lookup_in_scope.carbon b/toolchain/check/testdata/var/no_prelude/global_lookup_in_scope.carbon index 4f2fd135abd92..0056295ebbe77 100644 --- a/toolchain/check/testdata/var/no_prelude/global_lookup_in_scope.carbon +++ b/toolchain/check/testdata/var/no_prelude/global_lookup_in_scope.carbon @@ -30,9 +30,6 @@ fn Main() { // CHECK:STDOUT: .x = %x // CHECK:STDOUT: .Main = %Main.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc11_14.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc11_14.2: type = converted %.loc11_14.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] -// CHECK:STDOUT: %struct_type.v: type = struct_type {.v: %empty_tuple.type} [template = constants.%struct_type.v] // CHECK:STDOUT: %x.var: ref %struct_type.v = var x // CHECK:STDOUT: %x: ref %struct_type.v = bind_name x, %x.var // CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} {} @@ -40,9 +37,6 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: fn @Main() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc14_16.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc14_16.2: type = converted %.loc14_16.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] -// CHECK:STDOUT: %struct_type.v: type = struct_type {.v: %empty_tuple.type} [template = constants.%struct_type.v] // CHECK:STDOUT: %y.var: ref %struct_type.v = var y // CHECK:STDOUT: %y: ref %struct_type.v = bind_name y, %y.var // CHECK:STDOUT: %x.ref: ref %struct_type.v = name_ref x, file.%x diff --git a/toolchain/check/testdata/var/no_prelude/import.carbon b/toolchain/check/testdata/var/no_prelude/import.carbon index cff135b7b45f7..7fe3dba5e9301 100644 --- a/toolchain/check/testdata/var/no_prelude/import.carbon +++ b/toolchain/check/testdata/var/no_prelude/import.carbon @@ -31,8 +31,6 @@ var a: () = a_ref; // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .a_ref = %a_ref // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc4_13.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc4_13.2: type = converted %.loc4_13.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %a_ref.var: ref %empty_tuple.type = var a_ref // CHECK:STDOUT: %a_ref: ref %empty_tuple.type = bind_name a_ref, %a_ref.var // CHECK:STDOUT: } @@ -64,8 +62,6 @@ var a: () = a_ref; // CHECK:STDOUT: } // CHECK:STDOUT: %Implicit.import = import Implicit // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %.loc4_9.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc4_9.2: type = converted %.loc4_9.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %a.var: ref %empty_tuple.type = var a // CHECK:STDOUT: %a: ref %empty_tuple.type = bind_name a, %a.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/var/no_prelude/import_access.carbon b/toolchain/check/testdata/var/no_prelude/import_access.carbon index f392ab220d7a0..e8aa4dc69cdcc 100644 --- a/toolchain/check/testdata/var/no_prelude/import_access.carbon +++ b/toolchain/check/testdata/var/no_prelude/import_access.carbon @@ -62,8 +62,6 @@ var v2: () = Test.v; // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .v [private] = %v // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc4_17.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc4_17.2: type = converted %.loc4_17.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %v.var: ref %empty_tuple.type = var v // CHECK:STDOUT: %v: ref %empty_tuple.type = bind_name v, %v.var // CHECK:STDOUT: } @@ -95,8 +93,6 @@ var v2: () = Test.v; // CHECK:STDOUT: } // CHECK:STDOUT: %Test.import = import Test // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %.loc4_10.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc4_10.2: type = converted %.loc4_10.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %v2.var: ref %empty_tuple.type = var v2 // CHECK:STDOUT: %v2: ref %empty_tuple.type = bind_name v2, %v2.var // CHECK:STDOUT: } @@ -121,8 +117,6 @@ var v2: () = Test.v; // CHECK:STDOUT: .v2 = %v2 // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %.loc10_10.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc10_10.2: type = converted %.loc10_10.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %v2.var: ref %empty_tuple.type = var v2 // CHECK:STDOUT: %v2: ref %empty_tuple.type = bind_name v2, %v2.var // CHECK:STDOUT: } @@ -152,8 +146,6 @@ var v2: () = Test.v; // CHECK:STDOUT: .v2 = %v2 // CHECK:STDOUT: } // CHECK:STDOUT: %Test.import = import Test -// CHECK:STDOUT: %.loc9_10.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc9_10.2: type = converted %.loc9_10.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %v2.var: ref %empty_tuple.type = var v2 // CHECK:STDOUT: %v2: ref %empty_tuple.type = bind_name v2, %v2.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/var/no_prelude/lookup.carbon b/toolchain/check/testdata/var/no_prelude/lookup.carbon index 94f57d850efcb..4b0d15249052c 100644 --- a/toolchain/check/testdata/var/no_prelude/lookup.carbon +++ b/toolchain/check/testdata/var/no_prelude/lookup.carbon @@ -31,8 +31,6 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: fn @Main() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc12_11.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc12_11.2: type = converted %.loc12_11.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %x.var: ref %empty_tuple.type = var x // CHECK:STDOUT: %x: ref %empty_tuple.type = bind_name x, %x.var // CHECK:STDOUT: %.loc12_16.1: %empty_tuple.type = tuple_literal () diff --git a/toolchain/check/testdata/var/no_prelude/shadowing.carbon b/toolchain/check/testdata/var/no_prelude/shadowing.carbon index 6137bed2d9b5a..17e20e98c0b25 100644 --- a/toolchain/check/testdata/var/no_prelude/shadowing.carbon +++ b/toolchain/check/testdata/var/no_prelude/shadowing.carbon @@ -44,8 +44,6 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: fn @Main() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc14_12.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc14_12.2: type = converted %.loc14_12.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %NS.var: ref %empty_tuple.type = var NS // CHECK:STDOUT: %NS: ref %empty_tuple.type = bind_name NS, %NS.var // CHECK:STDOUT: %.loc14_17.1: %empty_tuple.type = tuple_literal () @@ -57,8 +55,6 @@ fn Main() { // CHECK:STDOUT: %.loc15_9.2: init %empty_tuple.type = tuple_init () to %NS.ref [template = constants.%empty_tuple] // CHECK:STDOUT: %.loc15_6: init %empty_tuple.type = converted %.loc15_9.1, %.loc15_9.2 [template = constants.%empty_tuple] // CHECK:STDOUT: assign %NS.ref, %.loc15_6 -// CHECK:STDOUT: %.loc17_11.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc17_11.2: type = converted %.loc17_11.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %x.var.loc17: ref %empty_tuple.type = var x // CHECK:STDOUT: %x.loc17: ref %empty_tuple.type = bind_name x, %x.var.loc17 // CHECK:STDOUT: %.loc17_16.1: %empty_tuple.type = tuple_literal () @@ -69,8 +65,6 @@ fn Main() { // CHECK:STDOUT: if %true br !if.then else br !if.else // CHECK:STDOUT: // CHECK:STDOUT: !if.then: -// CHECK:STDOUT: %.loc19_13.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc19_13.2: type = converted %.loc19_13.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %x.var.loc19: ref %empty_tuple.type = var x // CHECK:STDOUT: %x.loc19: ref %empty_tuple.type = bind_name x, %x.var.loc19 // CHECK:STDOUT: %.loc19_18.1: %empty_tuple.type = tuple_literal () diff --git a/toolchain/check/testdata/where_expr/constraints.carbon b/toolchain/check/testdata/where_expr/constraints.carbon index 0fa5cd0d04c0b..5b5f0e1072dcd 100644 --- a/toolchain/check/testdata/where_expr/constraints.carbon +++ b/toolchain/check/testdata/where_expr/constraints.carbon @@ -173,52 +173,58 @@ fn NotEmptyStruct() { // CHECK:STDOUT: %U.patt.loc11_15.1: %I_where.type = symbolic_binding_pattern U, 0 [symbolic = %U.patt.loc11_15.2 (constants.%U.patt)] // CHECK:STDOUT: %U.param_patt: %I_where.type = value_param_pattern %U.patt.loc11_15.1, runtime_param [symbolic = %U.patt.loc11_15.2 (constants.%U.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%I.type] -// CHECK:STDOUT: %.Self: %I.type = bind_symbolic_name .Self [symbolic = constants.%.Self.1] -// CHECK:STDOUT: %.Self.ref: %I.type = name_ref .Self, %.Self [symbolic = constants.%.Self.1] -// CHECK:STDOUT: %.loc11_37: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc11_21: type = where_expr %.Self [template = constants.%I_where.type] { -// CHECK:STDOUT: requirement_equivalent %.Self.ref, %.loc11_37 -// CHECK:STDOUT: } // CHECK:STDOUT: %U.param: %I_where.type = value_param runtime_param +// CHECK:STDOUT: %.loc11_21.2: type = splice_block %.loc11_21.1 [template = constants.%I_where.type] { +// CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%I.type] +// CHECK:STDOUT: %.Self: %I.type = bind_symbolic_name .Self [symbolic = constants.%.Self.1] +// CHECK:STDOUT: %.Self.ref: %I.type = name_ref .Self, %.Self [symbolic = constants.%.Self.1] +// CHECK:STDOUT: %.loc11_37: %empty_tuple.type = tuple_literal () +// CHECK:STDOUT: %.loc11_21.1: type = where_expr %.Self [template = constants.%I_where.type] { +// CHECK:STDOUT: requirement_equivalent %.Self.ref, %.loc11_37 +// CHECK:STDOUT: } +// CHECK:STDOUT: } // CHECK:STDOUT: %U.loc11_15.1: %I_where.type = bind_symbolic_name U, 0, %U.param [symbolic = %U.loc11_15.2 (constants.%U)] // CHECK:STDOUT: } // CHECK:STDOUT: %Impls.decl: %Impls.type = fn_decl @Impls [template = constants.%Impls] { // CHECK:STDOUT: %V.patt.loc13_10.1: %J_where.type = symbolic_binding_pattern V, 0 [symbolic = %V.patt.loc13_10.2 (constants.%V.patt)] // CHECK:STDOUT: %V.param_patt: %J_where.type = value_param_pattern %V.patt.loc13_10.1, runtime_param [symbolic = %V.patt.loc13_10.2 (constants.%V.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [template = constants.%J.type] -// CHECK:STDOUT: %.Self: %J.type = bind_symbolic_name .Self [symbolic = constants.%.Self.2] -// CHECK:STDOUT: %.Self.ref: %J.type = name_ref .Self, %.Self [symbolic = constants.%.Self.2] -// CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%I.type] -// CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic = constants.%.Self.as_type.1] -// CHECK:STDOUT: %.loc13_22: type = converted %.Self.ref, %.Self.as_type [symbolic = constants.%.Self.as_type.1] -// CHECK:STDOUT: %.loc13_16: type = where_expr %.Self [template = constants.%J_where.type] { -// CHECK:STDOUT: requirement_impls %.loc13_22, %I.ref -// CHECK:STDOUT: } // CHECK:STDOUT: %V.param: %J_where.type = value_param runtime_param +// CHECK:STDOUT: %.loc13_16.2: type = splice_block %.loc13_16.1 [template = constants.%J_where.type] { +// CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [template = constants.%J.type] +// CHECK:STDOUT: %.Self: %J.type = bind_symbolic_name .Self [symbolic = constants.%.Self.2] +// CHECK:STDOUT: %.Self.ref: %J.type = name_ref .Self, %.Self [symbolic = constants.%.Self.2] +// CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%I.type] +// CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic = constants.%.Self.as_type.1] +// CHECK:STDOUT: %.loc13_22: type = converted %.Self.ref, %.Self.as_type [symbolic = constants.%.Self.as_type.1] +// CHECK:STDOUT: %.loc13_16.1: type = where_expr %.Self [template = constants.%J_where.type] { +// CHECK:STDOUT: requirement_impls %.loc13_22, %I.ref +// CHECK:STDOUT: } +// CHECK:STDOUT: } // CHECK:STDOUT: %V.loc13_10.1: %J_where.type = bind_symbolic_name V, 0, %V.param [symbolic = %V.loc13_10.2 (constants.%V)] // CHECK:STDOUT: } // CHECK:STDOUT: %And.decl: %And.type = fn_decl @And [template = constants.%And] { // CHECK:STDOUT: %W.patt.loc15_8.1: %I_where.type = symbolic_binding_pattern W, 0 [symbolic = %W.patt.loc15_8.2 (constants.%W.patt)] // CHECK:STDOUT: %W.param_patt: %I_where.type = value_param_pattern %W.patt.loc15_8.1, runtime_param [symbolic = %W.patt.loc15_8.2 (constants.%W.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%I.type] -// CHECK:STDOUT: %.Self: %I.type = bind_symbolic_name .Self [symbolic = constants.%.Self.1] -// CHECK:STDOUT: %.Self.ref.loc15_20: %I.type = name_ref .Self, %.Self [symbolic = constants.%.Self.1] -// CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [template = constants.%J.type] -// CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref.loc15_20 [symbolic = constants.%.Self.as_type.2] -// CHECK:STDOUT: %.loc15_20: type = converted %.Self.ref.loc15_20, %.Self.as_type [symbolic = constants.%.Self.as_type.2] -// CHECK:STDOUT: %.Self.ref.loc15_38: %I.type = name_ref .Self, %.Self [symbolic = constants.%.Self.1] -// CHECK:STDOUT: %Member.ref: %assoc_type.1 = name_ref Member, @I.%assoc0 [template = constants.%assoc0] -// CHECK:STDOUT: %.Self.as_wit: = facet_access_witness %.Self.ref.loc15_38 [symbolic = constants.%.Self.as_wit] -// CHECK:STDOUT: %impl.elem0: type = interface_witness_access %.Self.as_wit, element0 [symbolic = constants.%impl.elem0] -// CHECK:STDOUT: %.loc15_50: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc15_14: type = where_expr %.Self [template = constants.%I_where.type] { -// CHECK:STDOUT: requirement_impls %.loc15_20, %J.ref -// CHECK:STDOUT: requirement_equivalent %impl.elem0, %.loc15_50 -// CHECK:STDOUT: } // CHECK:STDOUT: %W.param: %I_where.type = value_param runtime_param +// CHECK:STDOUT: %.loc15_14.2: type = splice_block %.loc15_14.1 [template = constants.%I_where.type] { +// CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%I.type] +// CHECK:STDOUT: %.Self: %I.type = bind_symbolic_name .Self [symbolic = constants.%.Self.1] +// CHECK:STDOUT: %.Self.ref.loc15_20: %I.type = name_ref .Self, %.Self [symbolic = constants.%.Self.1] +// CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [template = constants.%J.type] +// CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref.loc15_20 [symbolic = constants.%.Self.as_type.2] +// CHECK:STDOUT: %.loc15_20: type = converted %.Self.ref.loc15_20, %.Self.as_type [symbolic = constants.%.Self.as_type.2] +// CHECK:STDOUT: %.Self.ref.loc15_38: %I.type = name_ref .Self, %.Self [symbolic = constants.%.Self.1] +// CHECK:STDOUT: %Member.ref: %assoc_type.1 = name_ref Member, @I.%assoc0 [template = constants.%assoc0] +// CHECK:STDOUT: %.Self.as_wit: = facet_access_witness %.Self.ref.loc15_38 [symbolic = constants.%.Self.as_wit] +// CHECK:STDOUT: %impl.elem0: type = interface_witness_access %.Self.as_wit, element0 [symbolic = constants.%impl.elem0] +// CHECK:STDOUT: %.loc15_50: %empty_tuple.type = tuple_literal () +// CHECK:STDOUT: %.loc15_14.1: type = where_expr %.Self [template = constants.%I_where.type] { +// CHECK:STDOUT: requirement_impls %.loc15_20, %J.ref +// CHECK:STDOUT: requirement_equivalent %impl.elem0, %.loc15_50 +// CHECK:STDOUT: } +// CHECK:STDOUT: } // CHECK:STDOUT: %W.loc15_8.1: %I_where.type = bind_symbolic_name W, 0, %W.param [symbolic = %W.loc15_8.2 (constants.%W)] // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -235,7 +241,6 @@ fn NotEmptyStruct() { // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.2] // CHECK:STDOUT: %Member: type = assoc_const_decl Member [template] // CHECK:STDOUT: %assoc0: %assoc_type.1 = assoc_entity element0, %Member [template = constants.%assoc0] -// CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [template = constants.%J.type] // CHECK:STDOUT: %Second: %J.type = assoc_const_decl Second [template] // CHECK:STDOUT: %assoc1: %assoc_type.2 = assoc_entity element1, %Second [template = constants.%assoc1] // CHECK:STDOUT: @@ -327,19 +332,21 @@ fn NotEmptyStruct() { // CHECK:STDOUT: %W.patt.loc11_24.1: %K_where.type = symbolic_binding_pattern W, 0 [symbolic = %W.patt.loc11_24.2 (constants.%W.patt)] // CHECK:STDOUT: %W.param_patt: %K_where.type = value_param_pattern %W.patt.loc11_24.1, runtime_param [symbolic = %W.patt.loc11_24.2 (constants.%W.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %K.ref: type = name_ref K, file.%K.decl [template = constants.%K.type] -// CHECK:STDOUT: %.Self: %K.type = bind_symbolic_name .Self [symbolic = constants.%.Self] -// CHECK:STDOUT: %.Self.ref: %K.type = name_ref .Self, %.Self [symbolic = constants.%.Self] -// CHECK:STDOUT: %Associated.ref: %assoc_type = name_ref Associated, @K.%assoc0 [template = constants.%assoc0] -// CHECK:STDOUT: %.Self.as_wit: = facet_access_witness %.Self.ref [symbolic = constants.%.Self.as_wit] -// CHECK:STDOUT: %impl.elem0: %L.type = interface_witness_access %.Self.as_wit, element0 [symbolic = constants.%impl.elem0] -// CHECK:STDOUT: %M.ref: type = name_ref M, file.%M.decl [template = constants.%M.type] -// CHECK:STDOUT: %as_type: type = facet_access_type %impl.elem0 [symbolic = constants.%as_type] -// CHECK:STDOUT: %.loc11_36: type = converted %impl.elem0, %as_type [symbolic = constants.%as_type] -// CHECK:STDOUT: %.loc11_30: type = where_expr %.Self [template = constants.%K_where.type] { -// CHECK:STDOUT: requirement_impls %.loc11_36, %M.ref -// CHECK:STDOUT: } // CHECK:STDOUT: %W.param: %K_where.type = value_param runtime_param +// CHECK:STDOUT: %.loc11_30.2: type = splice_block %.loc11_30.1 [template = constants.%K_where.type] { +// CHECK:STDOUT: %K.ref: type = name_ref K, file.%K.decl [template = constants.%K.type] +// CHECK:STDOUT: %.Self: %K.type = bind_symbolic_name .Self [symbolic = constants.%.Self] +// CHECK:STDOUT: %.Self.ref: %K.type = name_ref .Self, %.Self [symbolic = constants.%.Self] +// CHECK:STDOUT: %Associated.ref: %assoc_type = name_ref Associated, @K.%assoc0 [template = constants.%assoc0] +// CHECK:STDOUT: %.Self.as_wit: = facet_access_witness %.Self.ref [symbolic = constants.%.Self.as_wit] +// CHECK:STDOUT: %impl.elem0: %L.type = interface_witness_access %.Self.as_wit, element0 [symbolic = constants.%impl.elem0] +// CHECK:STDOUT: %M.ref: type = name_ref M, file.%M.decl [template = constants.%M.type] +// CHECK:STDOUT: %as_type: type = facet_access_type %impl.elem0 [symbolic = constants.%as_type] +// CHECK:STDOUT: %.loc11_36: type = converted %impl.elem0, %as_type [symbolic = constants.%as_type] +// CHECK:STDOUT: %.loc11_30.1: type = where_expr %.Self [template = constants.%K_where.type] { +// CHECK:STDOUT: requirement_impls %.loc11_36, %M.ref +// CHECK:STDOUT: } +// CHECK:STDOUT: } // CHECK:STDOUT: %W.loc11_24.1: %K_where.type = bind_symbolic_name W, 0, %W.param [symbolic = %W.loc11_24.2 (constants.%W)] // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -362,7 +369,6 @@ fn NotEmptyStruct() { // CHECK:STDOUT: // CHECK:STDOUT: interface @K { // CHECK:STDOUT: %Self: %K.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.3] -// CHECK:STDOUT: %L.ref: type = name_ref L, file.%L.decl [template = constants.%L.type] // CHECK:STDOUT: %Associated: %L.type = assoc_const_decl Associated [template] // CHECK:STDOUT: %assoc0: %assoc_type = assoc_entity element0, %Associated [template = constants.%assoc0] // CHECK:STDOUT: @@ -414,13 +420,15 @@ fn NotEmptyStruct() { // CHECK:STDOUT: %U.patt.loc11_17.1: %type_where = symbolic_binding_pattern U, 0 [symbolic = %U.patt.loc11_17.2 (constants.%U.patt)] // CHECK:STDOUT: %U.param_patt: %type_where = value_param_pattern %U.patt.loc11_17.1, runtime_param [symbolic = %U.patt.loc11_17.2 (constants.%U.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %.Self: type = bind_symbolic_name .Self [symbolic = constants.%.Self] -// CHECK:STDOUT: %int_7: Core.IntLiteral = int_value 7 [template = constants.%int_7] -// CHECK:STDOUT: %.loc11_32: type = converted %int_7, [template = ] -// CHECK:STDOUT: %.loc11_26: type = where_expr %.Self [template = constants.%type_where] { -// CHECK:STDOUT: requirement_impls , type -// CHECK:STDOUT: } // CHECK:STDOUT: %U.param: %type_where = value_param runtime_param +// CHECK:STDOUT: %.loc11_26.2: type = splice_block %.loc11_26.1 [template = constants.%type_where] { +// CHECK:STDOUT: %.Self: type = bind_symbolic_name .Self [symbolic = constants.%.Self] +// CHECK:STDOUT: %int_7: Core.IntLiteral = int_value 7 [template = constants.%int_7] +// CHECK:STDOUT: %.loc11_32: type = converted %int_7, [template = ] +// CHECK:STDOUT: %.loc11_26.1: type = where_expr %.Self [template = constants.%type_where] { +// CHECK:STDOUT: requirement_impls , type +// CHECK:STDOUT: } +// CHECK:STDOUT: } // CHECK:STDOUT: %U.loc11_17.1: %type_where = bind_symbolic_name U, 0, %U.param [symbolic = %U.loc11_17.2 (constants.%U)] // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -467,14 +475,16 @@ fn NotEmptyStruct() { // CHECK:STDOUT: %U.patt.loc11_17.1: %type_where = symbolic_binding_pattern U, 0 [symbolic = %U.patt.loc11_17.2 (constants.%U.patt)] // CHECK:STDOUT: %U.param_patt: %type_where = value_param_pattern %U.patt.loc11_17.1, runtime_param [symbolic = %U.patt.loc11_17.2 (constants.%U.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %.Self: type = bind_symbolic_name .Self [symbolic = constants.%.Self] -// CHECK:STDOUT: %.Self.ref: type = name_ref .Self, %.Self [symbolic = constants.%.Self] -// CHECK:STDOUT: %int_7: Core.IntLiteral = int_value 7 [template = constants.%int_7] -// CHECK:STDOUT: %.loc11_44: type = converted %int_7, [template = ] -// CHECK:STDOUT: %.loc11_26: type = where_expr %.Self [template = constants.%type_where] { -// CHECK:STDOUT: requirement_impls %.Self.ref, -// CHECK:STDOUT: } // CHECK:STDOUT: %U.param: %type_where = value_param runtime_param +// CHECK:STDOUT: %.loc11_26.2: type = splice_block %.loc11_26.1 [template = constants.%type_where] { +// CHECK:STDOUT: %.Self: type = bind_symbolic_name .Self [symbolic = constants.%.Self] +// CHECK:STDOUT: %.Self.ref: type = name_ref .Self, %.Self [symbolic = constants.%.Self] +// CHECK:STDOUT: %int_7: Core.IntLiteral = int_value 7 [template = constants.%int_7] +// CHECK:STDOUT: %.loc11_44: type = converted %int_7, [template = ] +// CHECK:STDOUT: %.loc11_26.1: type = where_expr %.Self [template = constants.%type_where] { +// CHECK:STDOUT: requirement_impls %.Self.ref, +// CHECK:STDOUT: } +// CHECK:STDOUT: } // CHECK:STDOUT: %U.loc11_17.1: %type_where = bind_symbolic_name U, 0, %U.param [symbolic = %U.loc11_17.2 (constants.%U)] // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -522,14 +532,16 @@ fn NotEmptyStruct() { // CHECK:STDOUT: %U.patt.loc8_24.1: %type_where = symbolic_binding_pattern U, 0 [symbolic = %U.patt.loc8_24.2 (constants.%U.patt)] // CHECK:STDOUT: %U.param_patt: %type_where = value_param_pattern %U.patt.loc8_24.1, runtime_param [symbolic = %U.patt.loc8_24.2 (constants.%U.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %.Self: type = bind_symbolic_name .Self [symbolic = constants.%.Self] -// CHECK:STDOUT: %.Self.ref: type = name_ref .Self, %.Self [symbolic = constants.%.Self] -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc8: type = where_expr %.Self [template = constants.%type_where] { -// CHECK:STDOUT: requirement_impls %.Self.ref, -// CHECK:STDOUT: } // CHECK:STDOUT: %U.param: %type_where = value_param runtime_param +// CHECK:STDOUT: %.loc8_33.2: type = splice_block %.loc8_33.1 [template = constants.%type_where] { +// CHECK:STDOUT: %.Self: type = bind_symbolic_name .Self [symbolic = constants.%.Self] +// CHECK:STDOUT: %.Self.ref: type = name_ref .Self, %.Self [symbolic = constants.%.Self] +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc8_33.1: type = where_expr %.Self [template = constants.%type_where] { +// CHECK:STDOUT: requirement_impls %.Self.ref, +// CHECK:STDOUT: } +// CHECK:STDOUT: } // CHECK:STDOUT: %U.loc8_24.1: %type_where = bind_symbolic_name U, 0, %U.param [symbolic = %U.loc8_24.2 (constants.%U)] // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -609,14 +621,16 @@ fn NotEmptyStruct() { // CHECK:STDOUT: %Y.patt.loc26_16.1: %J_where.type = symbolic_binding_pattern Y, 0 [symbolic = %Y.patt.loc26_16.2 (constants.%Y.patt)] // CHECK:STDOUT: %Y.param_patt: %J_where.type = value_param_pattern %Y.patt.loc26_16.1, runtime_param [symbolic = %Y.patt.loc26_16.2 (constants.%Y.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %J.ref: type = name_ref J, imports.%import_ref.1 [template = constants.%J.type] -// CHECK:STDOUT: %.Self: %J.type = bind_symbolic_name .Self [symbolic = constants.%.Self] -// CHECK:STDOUT: %.Self.ref: %J.type = name_ref .Self, %.Self [symbolic = constants.%.Self] -// CHECK:STDOUT: %.loc26_38: %empty_struct_type = struct_literal () -// CHECK:STDOUT: %.loc26_22: type = where_expr %.Self [template = constants.%J_where.type] { -// CHECK:STDOUT: requirement_equivalent %.Self.ref, %.loc26_38 -// CHECK:STDOUT: } // CHECK:STDOUT: %Y.param: %J_where.type = value_param runtime_param +// CHECK:STDOUT: %.loc26_22.2: type = splice_block %.loc26_22.1 [template = constants.%J_where.type] { +// CHECK:STDOUT: %J.ref: type = name_ref J, imports.%import_ref.1 [template = constants.%J.type] +// CHECK:STDOUT: %.Self: %J.type = bind_symbolic_name .Self [symbolic = constants.%.Self] +// CHECK:STDOUT: %.Self.ref: %J.type = name_ref .Self, %.Self [symbolic = constants.%.Self] +// CHECK:STDOUT: %.loc26_38: %empty_struct_type = struct_literal () +// CHECK:STDOUT: %.loc26_22.1: type = where_expr %.Self [template = constants.%J_where.type] { +// CHECK:STDOUT: requirement_equivalent %.Self.ref, %.loc26_38 +// CHECK:STDOUT: } +// CHECK:STDOUT: } // CHECK:STDOUT: %Y.loc26_16.1: %J_where.type = bind_symbolic_name Y, 0, %Y.param [symbolic = %Y.loc26_16.2 (constants.%Y)] // CHECK:STDOUT: } // CHECK:STDOUT: %NotEmptyStruct.decl: %NotEmptyStruct.type = fn_decl @NotEmptyStruct [template = constants.%NotEmptyStruct] {} {} diff --git a/toolchain/check/testdata/where_expr/designator.carbon b/toolchain/check/testdata/where_expr/designator.carbon index 6ca1952b0fc21..a7bf9ed2b936a 100644 --- a/toolchain/check/testdata/where_expr/designator.carbon +++ b/toolchain/check/testdata/where_expr/designator.carbon @@ -135,44 +135,50 @@ class D { // CHECK:STDOUT: %T.patt.loc8_15.1: %I_where.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_15.2 (constants.%T.patt)] // CHECK:STDOUT: %T.param_patt: %I_where.type = value_param_pattern %T.patt.loc8_15.1, runtime_param [symbolic = %T.patt.loc8_15.2 (constants.%T.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%I.type] -// CHECK:STDOUT: %.Self: %I.type = bind_symbolic_name .Self [symbolic = constants.%.Self.1] -// CHECK:STDOUT: %.Self.ref: %I.type = name_ref .Self, %.Self [symbolic = constants.%.Self.1] -// CHECK:STDOUT: %.loc8_37: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc8_21: type = where_expr %.Self [template = constants.%I_where.type] { -// CHECK:STDOUT: requirement_equivalent %.Self.ref, %.loc8_37 -// CHECK:STDOUT: } // CHECK:STDOUT: %T.param: %I_where.type = value_param runtime_param +// CHECK:STDOUT: %.loc8_21.2: type = splice_block %.loc8_21.1 [template = constants.%I_where.type] { +// CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%I.type] +// CHECK:STDOUT: %.Self: %I.type = bind_symbolic_name .Self [symbolic = constants.%.Self.1] +// CHECK:STDOUT: %.Self.ref: %I.type = name_ref .Self, %.Self [symbolic = constants.%.Self.1] +// CHECK:STDOUT: %.loc8_37: %empty_tuple.type = tuple_literal () +// CHECK:STDOUT: %.loc8_21.1: type = where_expr %.Self [template = constants.%I_where.type] { +// CHECK:STDOUT: requirement_equivalent %.Self.ref, %.loc8_37 +// CHECK:STDOUT: } +// CHECK:STDOUT: } // CHECK:STDOUT: %T.loc8_15.1: %I_where.type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc8_15.2 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: %PeriodMember.decl: %PeriodMember.type = fn_decl @PeriodMember [template = constants.%PeriodMember] { // CHECK:STDOUT: %U.patt.loc10_17.1: %I_where.type = symbolic_binding_pattern U, 0 [symbolic = %U.patt.loc10_17.2 (constants.%U.patt)] // CHECK:STDOUT: %U.param_patt: %I_where.type = value_param_pattern %U.patt.loc10_17.1, runtime_param [symbolic = %U.patt.loc10_17.2 (constants.%U.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%I.type] -// CHECK:STDOUT: %.Self: %I.type = bind_symbolic_name .Self [symbolic = constants.%.Self.1] -// CHECK:STDOUT: %.Self.ref: %I.type = name_ref .Self, %.Self [symbolic = constants.%.Self.1] -// CHECK:STDOUT: %Member.ref: %assoc_type = name_ref Member, @I.%assoc0 [template = constants.%assoc0] -// CHECK:STDOUT: %.Self.as_wit: = facet_access_witness %.Self.ref [symbolic = constants.%.Self.as_wit] -// CHECK:STDOUT: %impl.elem0: type = interface_witness_access %.Self.as_wit, element0 [symbolic = constants.%impl.elem0] -// CHECK:STDOUT: %.loc10_41: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc10_23: type = where_expr %.Self [template = constants.%I_where.type] { -// CHECK:STDOUT: requirement_equivalent %impl.elem0, %.loc10_41 -// CHECK:STDOUT: } // CHECK:STDOUT: %U.param: %I_where.type = value_param runtime_param +// CHECK:STDOUT: %.loc10_23.2: type = splice_block %.loc10_23.1 [template = constants.%I_where.type] { +// CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%I.type] +// CHECK:STDOUT: %.Self: %I.type = bind_symbolic_name .Self [symbolic = constants.%.Self.1] +// CHECK:STDOUT: %.Self.ref: %I.type = name_ref .Self, %.Self [symbolic = constants.%.Self.1] +// CHECK:STDOUT: %Member.ref: %assoc_type = name_ref Member, @I.%assoc0 [template = constants.%assoc0] +// CHECK:STDOUT: %.Self.as_wit: = facet_access_witness %.Self.ref [symbolic = constants.%.Self.as_wit] +// CHECK:STDOUT: %impl.elem0: type = interface_witness_access %.Self.as_wit, element0 [symbolic = constants.%impl.elem0] +// CHECK:STDOUT: %.loc10_41: %empty_tuple.type = tuple_literal () +// CHECK:STDOUT: %.loc10_23.1: type = where_expr %.Self [template = constants.%I_where.type] { +// CHECK:STDOUT: requirement_equivalent %impl.elem0, %.loc10_41 +// CHECK:STDOUT: } +// CHECK:STDOUT: } // CHECK:STDOUT: %U.loc10_17.1: %I_where.type = bind_symbolic_name U, 0, %U.param [symbolic = %U.loc10_17.2 (constants.%U)] // CHECK:STDOUT: } // CHECK:STDOUT: %TypeSelfImpls.decl: %TypeSelfImpls.type = fn_decl @TypeSelfImpls [template = constants.%TypeSelfImpls] { // CHECK:STDOUT: %V.patt.loc12_18.1: %type_where = symbolic_binding_pattern V, 0 [symbolic = %V.patt.loc12_18.2 (constants.%V.patt)] // CHECK:STDOUT: %V.param_patt: %type_where = value_param_pattern %V.patt.loc12_18.1, runtime_param [symbolic = %V.patt.loc12_18.2 (constants.%V.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %.Self: type = bind_symbolic_name .Self [symbolic = constants.%.Self.2] -// CHECK:STDOUT: %.Self.ref: type = name_ref .Self, %.Self [symbolic = constants.%.Self.2] -// CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%I.type] -// CHECK:STDOUT: %.loc12: type = where_expr %.Self [template = constants.%type_where] { -// CHECK:STDOUT: requirement_impls %.Self.ref, %I.ref -// CHECK:STDOUT: } // CHECK:STDOUT: %V.param: %type_where = value_param runtime_param +// CHECK:STDOUT: %.loc12_27.2: type = splice_block %.loc12_27.1 [template = constants.%type_where] { +// CHECK:STDOUT: %.Self: type = bind_symbolic_name .Self [symbolic = constants.%.Self.2] +// CHECK:STDOUT: %.Self.ref: type = name_ref .Self, %.Self [symbolic = constants.%.Self.2] +// CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%I.type] +// CHECK:STDOUT: %.loc12_27.1: type = where_expr %.Self [template = constants.%type_where] { +// CHECK:STDOUT: requirement_impls %.Self.ref, %I.ref +// CHECK:STDOUT: } +// CHECK:STDOUT: } // CHECK:STDOUT: %V.loc12_18.1: %type_where = bind_symbolic_name V, 0, %V.param [symbolic = %V.loc12_18.2 (constants.%V)] // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -257,15 +263,17 @@ class D { // CHECK:STDOUT: %W.patt.loc12_19.1: = symbolic_binding_pattern W, 0 [symbolic = %W.patt.loc12_19.2 (constants.%W.patt)] // CHECK:STDOUT: %W.param_patt: = value_param_pattern %W.patt.loc12_19.1, runtime_param [symbolic = %W.patt.loc12_19.2 (constants.%W.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [template = constants.%J.type] -// CHECK:STDOUT: %.Self: %J.type = bind_symbolic_name .Self [symbolic = constants.%.Self] -// CHECK:STDOUT: %.Self.ref: %J.type = name_ref .Self, %.Self [symbolic = constants.%.Self] -// CHECK:STDOUT: %Mismatch.ref: = name_ref Mismatch, [template = ] -// CHECK:STDOUT: %.loc12_44: %empty_struct_type = struct_literal () -// CHECK:STDOUT: %.loc12_25: type = where_expr %.Self [template = ] { -// CHECK:STDOUT: requirement_rewrite %Mismatch.ref, -// CHECK:STDOUT: } // CHECK:STDOUT: %W.param: = value_param runtime_param +// CHECK:STDOUT: %.loc12_25.2: type = splice_block %.loc12_25.1 [template = ] { +// CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [template = constants.%J.type] +// CHECK:STDOUT: %.Self: %J.type = bind_symbolic_name .Self [symbolic = constants.%.Self] +// CHECK:STDOUT: %.Self.ref: %J.type = name_ref .Self, %.Self [symbolic = constants.%.Self] +// CHECK:STDOUT: %Mismatch.ref: = name_ref Mismatch, [template = ] +// CHECK:STDOUT: %.loc12_44: %empty_struct_type = struct_literal () +// CHECK:STDOUT: %.loc12_25.1: type = where_expr %.Self [template = ] { +// CHECK:STDOUT: requirement_rewrite %Mismatch.ref, +// CHECK:STDOUT: } +// CHECK:STDOUT: } // CHECK:STDOUT: %W: = bind_symbolic_name W, 0, %W.param [template = ] // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -325,8 +333,6 @@ class D { // CHECK:STDOUT: // CHECK:STDOUT: fn @Foo() -> %empty_tuple.type { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc5_11.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc5_11.2: type = converted %.loc5_11.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %x.var: ref %empty_tuple.type = var x // CHECK:STDOUT: %x: ref %empty_tuple.type = bind_name x, %x.var // CHECK:STDOUT: %.Self.ref: = name_ref .Self, [template = ] diff --git a/toolchain/check/testdata/where_expr/dot_self_index.carbon b/toolchain/check/testdata/where_expr/dot_self_index.carbon index a16ae3d9813ac..1085478c39dc2 100644 --- a/toolchain/check/testdata/where_expr/dot_self_index.carbon +++ b/toolchain/check/testdata/where_expr/dot_self_index.carbon @@ -100,23 +100,25 @@ fn G(U: Empty(i32) where .A = i32*) { // CHECK:STDOUT: %V.patt.loc18_43.1: type = symbolic_binding_pattern V, 1 [symbolic = %V.patt.loc18_43.2 (constants.%V.patt)] // CHECK:STDOUT: %V.param_patt: type = value_param_pattern %V.patt.loc18_43.1, runtime_param [symbolic = %V.patt.loc18_43.2 (constants.%V.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %Empty.ref: %Empty.type.1 = name_ref Empty, file.%Empty.decl [template = constants.%Empty.generic] -// CHECK:STDOUT: %T.ref.loc18_25: type = name_ref T, %T.loc18_6.1 [symbolic = %T.loc18_6.2 (constants.%T)] -// CHECK:STDOUT: %Empty.type.loc18_26.1: type = facet_type <@Empty, @Empty(constants.%T)> [symbolic = %Empty.type.loc18_26.2 (constants.%Empty.type.3)] -// CHECK:STDOUT: %.Self.1: @H.%Empty.type.loc18_26.2 (%Empty.type.3) = bind_symbolic_name .Self [symbolic = %.Self.2 (constants.%.Self.1)] -// CHECK:STDOUT: %.Self.ref: @H.%Empty.type.loc18_26.2 (%Empty.type.3) = name_ref .Self, %.Self.1 [symbolic = %.Self.2 (constants.%.Self.1)] -// CHECK:STDOUT: %.loc18_34: @H.%assoc_type (%assoc_type.2) = specific_constant @Empty.%assoc0.loc12_15.1, @Empty(constants.%T) [symbolic = %assoc0 (constants.%assoc0.2)] -// CHECK:STDOUT: %A.ref: @H.%assoc_type (%assoc_type.2) = name_ref A, %.loc18_34 [symbolic = %assoc0 (constants.%assoc0.2)] -// CHECK:STDOUT: %.Self.as_wit.loc18_34.1: = facet_access_witness %.Self.ref [symbolic = %.Self.as_wit.loc18_34.2 (constants.%.Self.as_wit.1)] -// CHECK:STDOUT: %impl.elem0.loc18_34.1: type = interface_witness_access %.Self.as_wit.loc18_34.1, element0 [symbolic = %impl.elem0.loc18_34.2 (constants.%impl.elem0.1)] -// CHECK:STDOUT: %T.ref.loc18_39: type = name_ref T, %T.loc18_6.1 [symbolic = %T.loc18_6.2 (constants.%T)] -// CHECK:STDOUT: %ptr.loc18_40.1: type = ptr_type %T [symbolic = %ptr.loc18_40.2 (constants.%ptr.1)] -// CHECK:STDOUT: %.loc18_28: type = where_expr %.Self.1 [symbolic = %Empty_where.type (constants.%Empty_where.type.1)] { -// CHECK:STDOUT: requirement_rewrite %impl.elem0.loc18_34.1, %ptr.loc18_40.1 -// CHECK:STDOUT: } // CHECK:STDOUT: %T.param: type = value_param runtime_param // CHECK:STDOUT: %T.loc18_6.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc18_6.2 (constants.%T)] // CHECK:STDOUT: %U.param: @H.%Empty_where.type (%Empty_where.type.1) = value_param runtime_param0 +// CHECK:STDOUT: %.loc18_28.2: type = splice_block %.loc18_28.1 [symbolic = %Empty_where.type (constants.%Empty_where.type.1)] { +// CHECK:STDOUT: %Empty.ref: %Empty.type.1 = name_ref Empty, file.%Empty.decl [template = constants.%Empty.generic] +// CHECK:STDOUT: %T.ref.loc18_25: type = name_ref T, %T.loc18_6.1 [symbolic = %T.loc18_6.2 (constants.%T)] +// CHECK:STDOUT: %Empty.type.loc18_26.1: type = facet_type <@Empty, @Empty(constants.%T)> [symbolic = %Empty.type.loc18_26.2 (constants.%Empty.type.3)] +// CHECK:STDOUT: %.Self.1: @H.%Empty.type.loc18_26.2 (%Empty.type.3) = bind_symbolic_name .Self [symbolic = %.Self.2 (constants.%.Self.1)] +// CHECK:STDOUT: %.Self.ref: @H.%Empty.type.loc18_26.2 (%Empty.type.3) = name_ref .Self, %.Self.1 [symbolic = %.Self.2 (constants.%.Self.1)] +// CHECK:STDOUT: %.loc18_34: @H.%assoc_type (%assoc_type.2) = specific_constant @Empty.%assoc0.loc12_15.1, @Empty(constants.%T) [symbolic = %assoc0 (constants.%assoc0.2)] +// CHECK:STDOUT: %A.ref: @H.%assoc_type (%assoc_type.2) = name_ref A, %.loc18_34 [symbolic = %assoc0 (constants.%assoc0.2)] +// CHECK:STDOUT: %.Self.as_wit.loc18_34.1: = facet_access_witness %.Self.ref [symbolic = %.Self.as_wit.loc18_34.2 (constants.%.Self.as_wit.1)] +// CHECK:STDOUT: %impl.elem0.loc18_34.1: type = interface_witness_access %.Self.as_wit.loc18_34.1, element0 [symbolic = %impl.elem0.loc18_34.2 (constants.%impl.elem0.1)] +// CHECK:STDOUT: %T.ref.loc18_39: type = name_ref T, %T.loc18_6.1 [symbolic = %T.loc18_6.2 (constants.%T)] +// CHECK:STDOUT: %ptr.loc18_40.1: type = ptr_type %T [symbolic = %ptr.loc18_40.2 (constants.%ptr.1)] +// CHECK:STDOUT: %.loc18_28.1: type = where_expr %.Self.1 [symbolic = %Empty_where.type (constants.%Empty_where.type.1)] { +// CHECK:STDOUT: requirement_rewrite %impl.elem0.loc18_34.1, %ptr.loc18_40.1 +// CHECK:STDOUT: } +// CHECK:STDOUT: } // CHECK:STDOUT: %U: @H.%Empty_where.type (%Empty_where.type.1) = bind_name U, %U.param // CHECK:STDOUT: %V.param: type = value_param runtime_param // CHECK:STDOUT: %V.loc18_43.1: type = bind_symbolic_name V, 1, %V.param [symbolic = %V.loc18_43.2 (constants.%V)] @@ -125,23 +127,25 @@ fn G(U: Empty(i32) where .A = i32*) { // CHECK:STDOUT: %U.patt: %Empty_where.type.2 = binding_pattern U // CHECK:STDOUT: %U.param_patt: %Empty_where.type.2 = value_param_pattern %U.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Empty.ref: %Empty.type.1 = name_ref Empty, file.%Empty.decl [template = constants.%Empty.generic] -// CHECK:STDOUT: %int_32.loc20_15: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc20_15: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %Empty.type: type = facet_type <@Empty, @Empty(constants.%i32)> [template = constants.%Empty.type.4] -// CHECK:STDOUT: %.Self: %Empty.type.4 = bind_symbolic_name .Self [symbolic = constants.%.Self.2] -// CHECK:STDOUT: %.Self.ref: %Empty.type.4 = name_ref .Self, %.Self [symbolic = constants.%.Self.2] -// CHECK:STDOUT: %.loc20_26: %assoc_type.3 = specific_constant @Empty.%assoc0.loc12_15.1, @Empty(constants.%i32) [template = constants.%assoc0.3] -// CHECK:STDOUT: %A.ref: %assoc_type.3 = name_ref A, %.loc20_26 [template = constants.%assoc0.3] -// CHECK:STDOUT: %.Self.as_wit: = facet_access_witness %.Self.ref [symbolic = constants.%.Self.as_wit.2] -// CHECK:STDOUT: %impl.elem0: type = interface_witness_access %.Self.as_wit, element0 [symbolic = constants.%impl.elem0.2] -// CHECK:STDOUT: %int_32.loc20_31: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc20_31: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %ptr: type = ptr_type %i32 [template = constants.%ptr.2] -// CHECK:STDOUT: %.loc20_20: type = where_expr %.Self [template = constants.%Empty_where.type.2] { -// CHECK:STDOUT: requirement_rewrite %impl.elem0, %ptr -// CHECK:STDOUT: } // CHECK:STDOUT: %U.param: %Empty_where.type.2 = value_param runtime_param0 +// CHECK:STDOUT: %.loc20_20.2: type = splice_block %.loc20_20.1 [template = constants.%Empty_where.type.2] { +// CHECK:STDOUT: %Empty.ref: %Empty.type.1 = name_ref Empty, file.%Empty.decl [template = constants.%Empty.generic] +// CHECK:STDOUT: %int_32.loc20_15: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc20_15: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %Empty.type: type = facet_type <@Empty, @Empty(constants.%i32)> [template = constants.%Empty.type.4] +// CHECK:STDOUT: %.Self: %Empty.type.4 = bind_symbolic_name .Self [symbolic = constants.%.Self.2] +// CHECK:STDOUT: %.Self.ref: %Empty.type.4 = name_ref .Self, %.Self [symbolic = constants.%.Self.2] +// CHECK:STDOUT: %.loc20_26: %assoc_type.3 = specific_constant @Empty.%assoc0.loc12_15.1, @Empty(constants.%i32) [template = constants.%assoc0.3] +// CHECK:STDOUT: %A.ref: %assoc_type.3 = name_ref A, %.loc20_26 [template = constants.%assoc0.3] +// CHECK:STDOUT: %.Self.as_wit: = facet_access_witness %.Self.ref [symbolic = constants.%.Self.as_wit.2] +// CHECK:STDOUT: %impl.elem0: type = interface_witness_access %.Self.as_wit, element0 [symbolic = constants.%impl.elem0.2] +// CHECK:STDOUT: %int_32.loc20_31: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc20_31: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %ptr: type = ptr_type %i32 [template = constants.%ptr.2] +// CHECK:STDOUT: %.loc20_20.1: type = where_expr %.Self [template = constants.%Empty_where.type.2] { +// CHECK:STDOUT: requirement_rewrite %impl.elem0, %ptr +// CHECK:STDOUT: } +// CHECK:STDOUT: } // CHECK:STDOUT: %U: %Empty_where.type.2 = bind_name U, %U.param // CHECK:STDOUT: } // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/where_expr/equal_rewrite.carbon b/toolchain/check/testdata/where_expr/equal_rewrite.carbon index d14074f101cf6..7937a6e4567cd 100644 --- a/toolchain/check/testdata/where_expr/equal_rewrite.carbon +++ b/toolchain/check/testdata/where_expr/equal_rewrite.carbon @@ -255,18 +255,20 @@ let K: (E where .F = .Self.G) = bool; // CHECK:STDOUT: %T.patt.loc8_10.1: %N_where.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_10.2 (constants.%T.patt)] // CHECK:STDOUT: %T.param_patt: %N_where.type = value_param_pattern %T.patt.loc8_10.1, runtime_param [symbolic = %T.patt.loc8_10.2 (constants.%T.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %N.ref: type = name_ref N, file.%N.decl [template = constants.%N.type] -// CHECK:STDOUT: %.Self: %N.type = bind_symbolic_name .Self [symbolic = constants.%.Self] -// CHECK:STDOUT: %.Self.ref: %N.type = name_ref .Self, %.Self [symbolic = constants.%.Self] -// CHECK:STDOUT: %P.ref: %assoc_type = name_ref P, @N.%assoc0 [template = constants.%assoc0] -// CHECK:STDOUT: %.Self.as_wit: = facet_access_witness %.Self.ref [symbolic = constants.%.Self.as_wit] -// CHECK:STDOUT: %impl.elem0: type = interface_witness_access %.Self.as_wit, element0 [symbolic = constants.%impl.elem0] -// CHECK:STDOUT: %.loc8_28.1: %empty_struct_type = struct_literal () -// CHECK:STDOUT: %.loc8_28.2: type = converted %.loc8_28.1, constants.%empty_struct_type [template = constants.%empty_struct_type] -// CHECK:STDOUT: %.loc8_16: type = where_expr %.Self [template = constants.%N_where.type] { -// CHECK:STDOUT: requirement_rewrite %impl.elem0, %.loc8_28.2 -// CHECK:STDOUT: } // CHECK:STDOUT: %T.param: %N_where.type = value_param runtime_param +// CHECK:STDOUT: %.loc8_16.2: type = splice_block %.loc8_16.1 [template = constants.%N_where.type] { +// CHECK:STDOUT: %N.ref: type = name_ref N, file.%N.decl [template = constants.%N.type] +// CHECK:STDOUT: %.Self: %N.type = bind_symbolic_name .Self [symbolic = constants.%.Self] +// CHECK:STDOUT: %.Self.ref: %N.type = name_ref .Self, %.Self [symbolic = constants.%.Self] +// CHECK:STDOUT: %P.ref: %assoc_type = name_ref P, @N.%assoc0 [template = constants.%assoc0] +// CHECK:STDOUT: %.Self.as_wit: = facet_access_witness %.Self.ref [symbolic = constants.%.Self.as_wit] +// CHECK:STDOUT: %impl.elem0: type = interface_witness_access %.Self.as_wit, element0 [symbolic = constants.%impl.elem0] +// CHECK:STDOUT: %.loc8_28.1: %empty_struct_type = struct_literal () +// CHECK:STDOUT: %.loc8_28.2: type = converted %.loc8_28.1, constants.%empty_struct_type [template = constants.%empty_struct_type] +// CHECK:STDOUT: %.loc8_16.1: type = where_expr %.Self [template = constants.%N_where.type] { +// CHECK:STDOUT: requirement_rewrite %impl.elem0, %.loc8_28.2 +// CHECK:STDOUT: } +// CHECK:STDOUT: } // CHECK:STDOUT: %T.loc8_10.1: %N_where.type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc8_10.2 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -339,29 +341,31 @@ let K: (E where .F = .Self.G) = bool; // CHECK:STDOUT: %D.patt.loc9_18.1: %A_where.type.2 = symbolic_binding_pattern D, 0 [symbolic = %D.patt.loc9_18.2 (constants.%D.patt)] // CHECK:STDOUT: %D.param_patt: %A_where.type.2 = value_param_pattern %D.patt.loc9_18.1, runtime_param [symbolic = %D.patt.loc9_18.2 (constants.%D.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%A.type] -// CHECK:STDOUT: %.Self.1: %A.type = bind_symbolic_name .Self [symbolic = constants.%.Self.1] -// CHECK:STDOUT: %.Self.ref.loc9_31: %A.type = name_ref .Self, %.Self.1 [symbolic = constants.%.Self.1] -// CHECK:STDOUT: %B.ref: %assoc_type = name_ref B, @A.%assoc0 [template = constants.%assoc0] -// CHECK:STDOUT: %.Self.as_wit.loc9_31: = facet_access_witness %.Self.ref.loc9_31 [symbolic = constants.%.Self.as_wit.1] -// CHECK:STDOUT: %impl.elem0: type = interface_witness_access %.Self.as_wit.loc9_31, element0 [symbolic = constants.%impl.elem0] -// CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc9_36.1: type = value_of_initializer %bool.make_type [template = bool] -// CHECK:STDOUT: %.loc9_36.2: type = converted %bool.make_type, %.loc9_36.1 [template = bool] -// CHECK:STDOUT: %.loc9_25: type = where_expr %.Self.1 [template = constants.%A_where.type.1] { -// CHECK:STDOUT: requirement_rewrite %impl.elem0, %.loc9_36.2 -// CHECK:STDOUT: } -// CHECK:STDOUT: %.Self.2: %A_where.type.1 = bind_symbolic_name .Self [symbolic = constants.%.Self.2] -// CHECK:STDOUT: %.Self.ref.loc9_48: %A_where.type.1 = name_ref .Self, %.Self.2 [symbolic = constants.%.Self.2] -// CHECK:STDOUT: %C.ref: %assoc_type = name_ref C, @A.%assoc1 [template = constants.%assoc1] -// CHECK:STDOUT: %.Self.as_wit.loc9_48: = facet_access_witness %.Self.ref.loc9_48 [symbolic = constants.%.Self.as_wit.2] -// CHECK:STDOUT: %impl.elem1: type = interface_witness_access %.Self.as_wit.loc9_48, element1 [symbolic = constants.%impl.elem1] -// CHECK:STDOUT: %.loc9_54.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc9_54.2: type = converted %.loc9_54.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] -// CHECK:STDOUT: %.loc9_42: type = where_expr %.Self.2 [template = constants.%A_where.type.2] { -// CHECK:STDOUT: requirement_rewrite %impl.elem1, %.loc9_54.2 -// CHECK:STDOUT: } // CHECK:STDOUT: %D.param: %A_where.type.2 = value_param runtime_param +// CHECK:STDOUT: %.loc9_42.2: type = splice_block %.loc9_42.1 [template = constants.%A_where.type.2] { +// CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%A.type] +// CHECK:STDOUT: %.Self.1: %A.type = bind_symbolic_name .Self [symbolic = constants.%.Self.1] +// CHECK:STDOUT: %.Self.ref.loc9_31: %A.type = name_ref .Self, %.Self.1 [symbolic = constants.%.Self.1] +// CHECK:STDOUT: %B.ref: %assoc_type = name_ref B, @A.%assoc0 [template = constants.%assoc0] +// CHECK:STDOUT: %.Self.as_wit.loc9_31: = facet_access_witness %.Self.ref.loc9_31 [symbolic = constants.%.Self.as_wit.1] +// CHECK:STDOUT: %impl.elem0: type = interface_witness_access %.Self.as_wit.loc9_31, element0 [symbolic = constants.%impl.elem0] +// CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] +// CHECK:STDOUT: %.loc9_36.1: type = value_of_initializer %bool.make_type [template = bool] +// CHECK:STDOUT: %.loc9_36.2: type = converted %bool.make_type, %.loc9_36.1 [template = bool] +// CHECK:STDOUT: %.loc9_25: type = where_expr %.Self.1 [template = constants.%A_where.type.1] { +// CHECK:STDOUT: requirement_rewrite %impl.elem0, %.loc9_36.2 +// CHECK:STDOUT: } +// CHECK:STDOUT: %.Self.2: %A_where.type.1 = bind_symbolic_name .Self [symbolic = constants.%.Self.2] +// CHECK:STDOUT: %.Self.ref.loc9_48: %A_where.type.1 = name_ref .Self, %.Self.2 [symbolic = constants.%.Self.2] +// CHECK:STDOUT: %C.ref: %assoc_type = name_ref C, @A.%assoc1 [template = constants.%assoc1] +// CHECK:STDOUT: %.Self.as_wit.loc9_48: = facet_access_witness %.Self.ref.loc9_48 [symbolic = constants.%.Self.as_wit.2] +// CHECK:STDOUT: %impl.elem1: type = interface_witness_access %.Self.as_wit.loc9_48, element1 [symbolic = constants.%impl.elem1] +// CHECK:STDOUT: %.loc9_54.1: %empty_tuple.type = tuple_literal () +// CHECK:STDOUT: %.loc9_54.2: type = converted %.loc9_54.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] +// CHECK:STDOUT: %.loc9_42.1: type = where_expr %.Self.2 [template = constants.%A_where.type.2] { +// CHECK:STDOUT: requirement_rewrite %impl.elem1, %.loc9_54.2 +// CHECK:STDOUT: } +// CHECK:STDOUT: } // CHECK:STDOUT: %D.loc9_18.1: %A_where.type.2 = bind_symbolic_name D, 0, %D.param [symbolic = %D.loc9_18.2 (constants.%D)] // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -445,61 +449,67 @@ let K: (E where .F = .Self.G) = bool; // CHECK:STDOUT: %G.patt.loc8_15.1: %E_where.type = symbolic_binding_pattern G, 0 [symbolic = %G.patt.loc8_15.2 (constants.%G.patt)] // CHECK:STDOUT: %G.param_patt: %E_where.type = value_param_pattern %G.patt.loc8_15.1, runtime_param [symbolic = %G.patt.loc8_15.2 (constants.%G.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %E.ref: type = name_ref E, file.%E.decl [template = constants.%E.type] -// CHECK:STDOUT: %.Self: %E.type = bind_symbolic_name .Self [symbolic = constants.%.Self] -// CHECK:STDOUT: %.Self.ref: %E.type = name_ref .Self, %.Self [symbolic = constants.%.Self] -// CHECK:STDOUT: %F.ref: %assoc_type = name_ref F, @E.%assoc0 [template = constants.%assoc0] -// CHECK:STDOUT: %.Self.as_wit: = facet_access_witness %.Self.ref [symbolic = constants.%.Self.as_wit] -// CHECK:STDOUT: %impl.elem0: type = interface_witness_access %.Self.as_wit, element0 [symbolic = constants.%impl.elem0] -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc8: type = where_expr %.Self [template = constants.%E_where.type] { -// CHECK:STDOUT: requirement_rewrite %impl.elem0, %i32 -// CHECK:STDOUT: } // CHECK:STDOUT: %G.param: %E_where.type = value_param runtime_param +// CHECK:STDOUT: %.loc8_21.2: type = splice_block %.loc8_21.1 [template = constants.%E_where.type] { +// CHECK:STDOUT: %E.ref: type = name_ref E, file.%E.decl [template = constants.%E.type] +// CHECK:STDOUT: %.Self: %E.type = bind_symbolic_name .Self [symbolic = constants.%.Self] +// CHECK:STDOUT: %.Self.ref: %E.type = name_ref .Self, %.Self [symbolic = constants.%.Self] +// CHECK:STDOUT: %F.ref: %assoc_type = name_ref F, @E.%assoc0 [template = constants.%assoc0] +// CHECK:STDOUT: %.Self.as_wit: = facet_access_witness %.Self.ref [symbolic = constants.%.Self.as_wit] +// CHECK:STDOUT: %impl.elem0: type = interface_witness_access %.Self.as_wit, element0 [symbolic = constants.%impl.elem0] +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc8_21.1: type = where_expr %.Self [template = constants.%E_where.type] { +// CHECK:STDOUT: requirement_rewrite %impl.elem0, %i32 +// CHECK:STDOUT: } +// CHECK:STDOUT: } // CHECK:STDOUT: %G.loc8_15.1: %E_where.type = bind_symbolic_name G, 0, %G.param [symbolic = %G.loc8_15.2 (constants.%G)] // CHECK:STDOUT: } // CHECK:STDOUT: %RepeatedRewrite.decl: %RepeatedRewrite.type = fn_decl @RepeatedRewrite [template = constants.%RepeatedRewrite] { // CHECK:STDOUT: %H.patt.loc10_20.1: %E_where.type = symbolic_binding_pattern H, 0 [symbolic = %H.patt.loc10_20.2 (constants.%H.patt)] // CHECK:STDOUT: %H.param_patt: %E_where.type = value_param_pattern %H.patt.loc10_20.1, runtime_param [symbolic = %H.patt.loc10_20.2 (constants.%H.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %E.ref: type = name_ref E, file.%E.decl [template = constants.%E.type] -// CHECK:STDOUT: %.Self: %E.type = bind_symbolic_name .Self [symbolic = constants.%.Self] -// CHECK:STDOUT: %.Self.ref.loc10_32: %E.type = name_ref .Self, %.Self [symbolic = constants.%.Self] -// CHECK:STDOUT: %F.ref.loc10_32: %assoc_type = name_ref F, @E.%assoc0 [template = constants.%assoc0] -// CHECK:STDOUT: %.Self.as_wit.loc10_32: = facet_access_witness %.Self.ref.loc10_32 [symbolic = constants.%.Self.as_wit] -// CHECK:STDOUT: %impl.elem0.loc10_32: type = interface_witness_access %.Self.as_wit.loc10_32, element0 [symbolic = constants.%impl.elem0] -// CHECK:STDOUT: %int_32.loc10_37: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc10_37: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.Self.ref.loc10_45: %E.type = name_ref .Self, %.Self [symbolic = constants.%.Self] -// CHECK:STDOUT: %F.ref.loc10_45: %assoc_type = name_ref F, @E.%assoc0 [template = constants.%assoc0] -// CHECK:STDOUT: %.Self.as_wit.loc10_45: = facet_access_witness %.Self.ref.loc10_45 [symbolic = constants.%.Self.as_wit] -// CHECK:STDOUT: %impl.elem0.loc10_45: type = interface_witness_access %.Self.as_wit.loc10_45, element0 [symbolic = constants.%impl.elem0] -// CHECK:STDOUT: %int_32.loc10_50: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc10_50: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc10: type = where_expr %.Self [template = constants.%E_where.type] { -// CHECK:STDOUT: requirement_rewrite %impl.elem0.loc10_32, %i32.loc10_37 -// CHECK:STDOUT: requirement_rewrite %impl.elem0.loc10_45, %i32.loc10_50 -// CHECK:STDOUT: } // CHECK:STDOUT: %H.param: %E_where.type = value_param runtime_param +// CHECK:STDOUT: %.loc10_26.2: type = splice_block %.loc10_26.1 [template = constants.%E_where.type] { +// CHECK:STDOUT: %E.ref: type = name_ref E, file.%E.decl [template = constants.%E.type] +// CHECK:STDOUT: %.Self: %E.type = bind_symbolic_name .Self [symbolic = constants.%.Self] +// CHECK:STDOUT: %.Self.ref.loc10_32: %E.type = name_ref .Self, %.Self [symbolic = constants.%.Self] +// CHECK:STDOUT: %F.ref.loc10_32: %assoc_type = name_ref F, @E.%assoc0 [template = constants.%assoc0] +// CHECK:STDOUT: %.Self.as_wit.loc10_32: = facet_access_witness %.Self.ref.loc10_32 [symbolic = constants.%.Self.as_wit] +// CHECK:STDOUT: %impl.elem0.loc10_32: type = interface_witness_access %.Self.as_wit.loc10_32, element0 [symbolic = constants.%impl.elem0] +// CHECK:STDOUT: %int_32.loc10_37: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc10_37: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.Self.ref.loc10_45: %E.type = name_ref .Self, %.Self [symbolic = constants.%.Self] +// CHECK:STDOUT: %F.ref.loc10_45: %assoc_type = name_ref F, @E.%assoc0 [template = constants.%assoc0] +// CHECK:STDOUT: %.Self.as_wit.loc10_45: = facet_access_witness %.Self.ref.loc10_45 [symbolic = constants.%.Self.as_wit] +// CHECK:STDOUT: %impl.elem0.loc10_45: type = interface_witness_access %.Self.as_wit.loc10_45, element0 [symbolic = constants.%impl.elem0] +// CHECK:STDOUT: %int_32.loc10_50: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc10_50: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc10_26.1: type = where_expr %.Self [template = constants.%E_where.type] { +// CHECK:STDOUT: requirement_rewrite %impl.elem0.loc10_32, %i32.loc10_37 +// CHECK:STDOUT: requirement_rewrite %impl.elem0.loc10_45, %i32.loc10_50 +// CHECK:STDOUT: } +// CHECK:STDOUT: } // CHECK:STDOUT: %H.loc10_20.1: %E_where.type = bind_symbolic_name H, 0, %H.param [symbolic = %H.loc10_20.2 (constants.%H)] // CHECK:STDOUT: } // CHECK:STDOUT: %OneRewriteAgain.decl: %OneRewriteAgain.type = fn_decl @OneRewriteAgain [template = constants.%OneRewriteAgain] { // CHECK:STDOUT: %I.patt.loc14_20.1: %E_where.type = symbolic_binding_pattern I, 0 [symbolic = %I.patt.loc14_20.2 (constants.%I.patt)] // CHECK:STDOUT: %I.param_patt: %E_where.type = value_param_pattern %I.patt.loc14_20.1, runtime_param [symbolic = %I.patt.loc14_20.2 (constants.%I.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %E.ref: type = name_ref E, file.%E.decl [template = constants.%E.type] -// CHECK:STDOUT: %.Self: %E.type = bind_symbolic_name .Self [symbolic = constants.%.Self] -// CHECK:STDOUT: %.Self.ref: %E.type = name_ref .Self, %.Self [symbolic = constants.%.Self] -// CHECK:STDOUT: %F.ref: %assoc_type = name_ref F, @E.%assoc0 [template = constants.%assoc0] -// CHECK:STDOUT: %.Self.as_wit: = facet_access_witness %.Self.ref [symbolic = constants.%.Self.as_wit] -// CHECK:STDOUT: %impl.elem0: type = interface_witness_access %.Self.as_wit, element0 [symbolic = constants.%impl.elem0] -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc14: type = where_expr %.Self [template = constants.%E_where.type] { -// CHECK:STDOUT: requirement_rewrite %impl.elem0, %i32 -// CHECK:STDOUT: } // CHECK:STDOUT: %I.param: %E_where.type = value_param runtime_param +// CHECK:STDOUT: %.loc14_26.2: type = splice_block %.loc14_26.1 [template = constants.%E_where.type] { +// CHECK:STDOUT: %E.ref: type = name_ref E, file.%E.decl [template = constants.%E.type] +// CHECK:STDOUT: %.Self: %E.type = bind_symbolic_name .Self [symbolic = constants.%.Self] +// CHECK:STDOUT: %.Self.ref: %E.type = name_ref .Self, %.Self [symbolic = constants.%.Self] +// CHECK:STDOUT: %F.ref: %assoc_type = name_ref F, @E.%assoc0 [template = constants.%assoc0] +// CHECK:STDOUT: %.Self.as_wit: = facet_access_witness %.Self.ref [symbolic = constants.%.Self.as_wit] +// CHECK:STDOUT: %impl.elem0: type = interface_witness_access %.Self.as_wit, element0 [symbolic = constants.%impl.elem0] +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc14_26.1: type = where_expr %.Self [template = constants.%E_where.type] { +// CHECK:STDOUT: requirement_rewrite %impl.elem0, %i32 +// CHECK:STDOUT: } +// CHECK:STDOUT: } // CHECK:STDOUT: %I.loc14_20.1: %E_where.type = bind_symbolic_name I, 0, %I.param [symbolic = %I.loc14_20.2 (constants.%I)] // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -648,52 +658,56 @@ let K: (E where .F = .Self.G) = bool; // CHECK:STDOUT: %M.patt.loc9_17.1: %J_where.type = symbolic_binding_pattern M, 0 [symbolic = %M.patt.loc9_17.2 (constants.%M.patt)] // CHECK:STDOUT: %M.param_patt: %J_where.type = value_param_pattern %M.patt.loc9_17.1, runtime_param [symbolic = %M.patt.loc9_17.2 (constants.%M.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [template = constants.%J.type] -// CHECK:STDOUT: %.Self: %J.type = bind_symbolic_name .Self [symbolic = constants.%.Self] -// CHECK:STDOUT: %.Self.ref.loc9_29: %J.type = name_ref .Self, %.Self [symbolic = constants.%.Self] -// CHECK:STDOUT: %K.ref: %assoc_type = name_ref K, @J.%assoc0 [template = constants.%assoc0] -// CHECK:STDOUT: %.Self.as_wit.loc9_29: = facet_access_witness %.Self.ref.loc9_29 [symbolic = constants.%.Self.as_wit] -// CHECK:STDOUT: %impl.elem0: type = interface_witness_access %.Self.as_wit.loc9_29, element0 [symbolic = constants.%impl.elem0] -// CHECK:STDOUT: %.loc9_35.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc9_35.2: type = converted %.loc9_35.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] -// CHECK:STDOUT: %.Self.ref.loc9_41: %J.type = name_ref .Self, %.Self [symbolic = constants.%.Self] -// CHECK:STDOUT: %L.ref: %assoc_type = name_ref L, @J.%assoc1 [template = constants.%assoc1] -// CHECK:STDOUT: %.Self.as_wit.loc9_41: = facet_access_witness %.Self.ref.loc9_41 [symbolic = constants.%.Self.as_wit] -// CHECK:STDOUT: %impl.elem1: type = interface_witness_access %.Self.as_wit.loc9_41, element1 [symbolic = constants.%impl.elem1] -// CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc9_46.1: type = value_of_initializer %bool.make_type [template = bool] -// CHECK:STDOUT: %.loc9_46.2: type = converted %bool.make_type, %.loc9_46.1 [template = bool] -// CHECK:STDOUT: %.loc9_23: type = where_expr %.Self [template = constants.%J_where.type] { -// CHECK:STDOUT: requirement_rewrite %impl.elem0, %.loc9_35.2 -// CHECK:STDOUT: requirement_rewrite %impl.elem1, %.loc9_46.2 -// CHECK:STDOUT: } // CHECK:STDOUT: %M.param: %J_where.type = value_param runtime_param +// CHECK:STDOUT: %.loc9_23.2: type = splice_block %.loc9_23.1 [template = constants.%J_where.type] { +// CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [template = constants.%J.type] +// CHECK:STDOUT: %.Self: %J.type = bind_symbolic_name .Self [symbolic = constants.%.Self] +// CHECK:STDOUT: %.Self.ref.loc9_29: %J.type = name_ref .Self, %.Self [symbolic = constants.%.Self] +// CHECK:STDOUT: %K.ref: %assoc_type = name_ref K, @J.%assoc0 [template = constants.%assoc0] +// CHECK:STDOUT: %.Self.as_wit.loc9_29: = facet_access_witness %.Self.ref.loc9_29 [symbolic = constants.%.Self.as_wit] +// CHECK:STDOUT: %impl.elem0: type = interface_witness_access %.Self.as_wit.loc9_29, element0 [symbolic = constants.%impl.elem0] +// CHECK:STDOUT: %.loc9_35.1: %empty_tuple.type = tuple_literal () +// CHECK:STDOUT: %.loc9_35.2: type = converted %.loc9_35.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] +// CHECK:STDOUT: %.Self.ref.loc9_41: %J.type = name_ref .Self, %.Self [symbolic = constants.%.Self] +// CHECK:STDOUT: %L.ref: %assoc_type = name_ref L, @J.%assoc1 [template = constants.%assoc1] +// CHECK:STDOUT: %.Self.as_wit.loc9_41: = facet_access_witness %.Self.ref.loc9_41 [symbolic = constants.%.Self.as_wit] +// CHECK:STDOUT: %impl.elem1: type = interface_witness_access %.Self.as_wit.loc9_41, element1 [symbolic = constants.%impl.elem1] +// CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] +// CHECK:STDOUT: %.loc9_46.1: type = value_of_initializer %bool.make_type [template = bool] +// CHECK:STDOUT: %.loc9_46.2: type = converted %bool.make_type, %.loc9_46.1 [template = bool] +// CHECK:STDOUT: %.loc9_23.1: type = where_expr %.Self [template = constants.%J_where.type] { +// CHECK:STDOUT: requirement_rewrite %impl.elem0, %.loc9_35.2 +// CHECK:STDOUT: requirement_rewrite %impl.elem1, %.loc9_46.2 +// CHECK:STDOUT: } +// CHECK:STDOUT: } // CHECK:STDOUT: %M.loc9_17.1: %J_where.type = bind_symbolic_name M, 0, %M.param [symbolic = %M.loc9_17.2 (constants.%M)] // CHECK:STDOUT: } // CHECK:STDOUT: %Reversed.decl: %Reversed.type = fn_decl @Reversed [template = constants.%Reversed] { // CHECK:STDOUT: %N.patt.loc11_13.1: %J_where.type = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc11_13.2 (constants.%N.patt)] // CHECK:STDOUT: %N.param_patt: %J_where.type = value_param_pattern %N.patt.loc11_13.1, runtime_param [symbolic = %N.patt.loc11_13.2 (constants.%N.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [template = constants.%J.type] -// CHECK:STDOUT: %.Self: %J.type = bind_symbolic_name .Self [symbolic = constants.%.Self] -// CHECK:STDOUT: %.Self.ref.loc11_25: %J.type = name_ref .Self, %.Self [symbolic = constants.%.Self] -// CHECK:STDOUT: %L.ref: %assoc_type = name_ref L, @J.%assoc1 [template = constants.%assoc1] -// CHECK:STDOUT: %.Self.as_wit.loc11_25: = facet_access_witness %.Self.ref.loc11_25 [symbolic = constants.%.Self.as_wit] -// CHECK:STDOUT: %impl.elem1: type = interface_witness_access %.Self.as_wit.loc11_25, element1 [symbolic = constants.%impl.elem1] -// CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc11_30.1: type = value_of_initializer %bool.make_type [template = bool] -// CHECK:STDOUT: %.loc11_30.2: type = converted %bool.make_type, %.loc11_30.1 [template = bool] -// CHECK:STDOUT: %.Self.ref.loc11_39: %J.type = name_ref .Self, %.Self [symbolic = constants.%.Self] -// CHECK:STDOUT: %K.ref: %assoc_type = name_ref K, @J.%assoc0 [template = constants.%assoc0] -// CHECK:STDOUT: %.Self.as_wit.loc11_39: = facet_access_witness %.Self.ref.loc11_39 [symbolic = constants.%.Self.as_wit] -// CHECK:STDOUT: %impl.elem0: type = interface_witness_access %.Self.as_wit.loc11_39, element0 [symbolic = constants.%impl.elem0] -// CHECK:STDOUT: %.loc11_45.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc11_45.2: type = converted %.loc11_45.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] -// CHECK:STDOUT: %.loc11_19: type = where_expr %.Self [template = constants.%J_where.type] { -// CHECK:STDOUT: requirement_rewrite %impl.elem1, %.loc11_30.2 -// CHECK:STDOUT: requirement_rewrite %impl.elem0, %.loc11_45.2 -// CHECK:STDOUT: } // CHECK:STDOUT: %N.param: %J_where.type = value_param runtime_param +// CHECK:STDOUT: %.loc11_19.2: type = splice_block %.loc11_19.1 [template = constants.%J_where.type] { +// CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [template = constants.%J.type] +// CHECK:STDOUT: %.Self: %J.type = bind_symbolic_name .Self [symbolic = constants.%.Self] +// CHECK:STDOUT: %.Self.ref.loc11_25: %J.type = name_ref .Self, %.Self [symbolic = constants.%.Self] +// CHECK:STDOUT: %L.ref: %assoc_type = name_ref L, @J.%assoc1 [template = constants.%assoc1] +// CHECK:STDOUT: %.Self.as_wit.loc11_25: = facet_access_witness %.Self.ref.loc11_25 [symbolic = constants.%.Self.as_wit] +// CHECK:STDOUT: %impl.elem1: type = interface_witness_access %.Self.as_wit.loc11_25, element1 [symbolic = constants.%impl.elem1] +// CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] +// CHECK:STDOUT: %.loc11_30.1: type = value_of_initializer %bool.make_type [template = bool] +// CHECK:STDOUT: %.loc11_30.2: type = converted %bool.make_type, %.loc11_30.1 [template = bool] +// CHECK:STDOUT: %.Self.ref.loc11_39: %J.type = name_ref .Self, %.Self [symbolic = constants.%.Self] +// CHECK:STDOUT: %K.ref: %assoc_type = name_ref K, @J.%assoc0 [template = constants.%assoc0] +// CHECK:STDOUT: %.Self.as_wit.loc11_39: = facet_access_witness %.Self.ref.loc11_39 [symbolic = constants.%.Self.as_wit] +// CHECK:STDOUT: %impl.elem0: type = interface_witness_access %.Self.as_wit.loc11_39, element0 [symbolic = constants.%impl.elem0] +// CHECK:STDOUT: %.loc11_45.1: %empty_tuple.type = tuple_literal () +// CHECK:STDOUT: %.loc11_45.2: type = converted %.loc11_45.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] +// CHECK:STDOUT: %.loc11_19.1: type = where_expr %.Self [template = constants.%J_where.type] { +// CHECK:STDOUT: requirement_rewrite %impl.elem1, %.loc11_30.2 +// CHECK:STDOUT: requirement_rewrite %impl.elem0, %.loc11_45.2 +// CHECK:STDOUT: } +// CHECK:STDOUT: } // CHECK:STDOUT: %N.loc11_13.1: %J_where.type = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc11_13.2 (constants.%N)] // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -809,37 +823,41 @@ let K: (E where .F = .Self.G) = bool; // CHECK:STDOUT: %Q.patt.loc8_16.1: %O_where.type.1 = symbolic_binding_pattern Q, 0 [symbolic = %Q.patt.loc8_16.2 (constants.%Q.patt)] // CHECK:STDOUT: %Q.param_patt: %O_where.type.1 = value_param_pattern %Q.patt.loc8_16.1, runtime_param [symbolic = %Q.patt.loc8_16.2 (constants.%Q.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %O.ref: type = name_ref O, file.%O.decl [template = constants.%O.type] -// CHECK:STDOUT: %.Self: %O.type = bind_symbolic_name .Self [symbolic = constants.%.Self] -// CHECK:STDOUT: %.Self.ref: %O.type = name_ref .Self, %.Self [symbolic = constants.%.Self] -// CHECK:STDOUT: %P.ref: %assoc_type = name_ref P, @O.%assoc0 [template = constants.%assoc0.1] -// CHECK:STDOUT: %.Self.as_wit: = facet_access_witness %.Self.ref [symbolic = constants.%.Self.as_wit] -// CHECK:STDOUT: %impl.elem0: type = interface_witness_access %.Self.as_wit, element0 [symbolic = constants.%impl.elem0] -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc8: type = where_expr %.Self [template = constants.%O_where.type.1] { -// CHECK:STDOUT: requirement_rewrite %impl.elem0, %i32 -// CHECK:STDOUT: } // CHECK:STDOUT: %Q.param: %O_where.type.1 = value_param runtime_param +// CHECK:STDOUT: %.loc8_22.2: type = splice_block %.loc8_22.1 [template = constants.%O_where.type.1] { +// CHECK:STDOUT: %O.ref: type = name_ref O, file.%O.decl [template = constants.%O.type] +// CHECK:STDOUT: %.Self: %O.type = bind_symbolic_name .Self [symbolic = constants.%.Self] +// CHECK:STDOUT: %.Self.ref: %O.type = name_ref .Self, %.Self [symbolic = constants.%.Self] +// CHECK:STDOUT: %P.ref: %assoc_type = name_ref P, @O.%assoc0 [template = constants.%assoc0.1] +// CHECK:STDOUT: %.Self.as_wit: = facet_access_witness %.Self.ref [symbolic = constants.%.Self.as_wit] +// CHECK:STDOUT: %impl.elem0: type = interface_witness_access %.Self.as_wit, element0 [symbolic = constants.%impl.elem0] +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc8_22.1: type = where_expr %.Self [template = constants.%O_where.type.1] { +// CHECK:STDOUT: requirement_rewrite %impl.elem0, %i32 +// CHECK:STDOUT: } +// CHECK:STDOUT: } // CHECK:STDOUT: %Q.loc8_16.1: %O_where.type.1 = bind_symbolic_name Q, 0, %Q.param [symbolic = %Q.loc8_16.2 (constants.%Q)] // CHECK:STDOUT: } // CHECK:STDOUT: %WithBool.decl: %WithBool.type = fn_decl @WithBool [template = constants.%WithBool] { // CHECK:STDOUT: %R.patt.loc10_13.1: %O_where.type.2 = symbolic_binding_pattern R, 0 [symbolic = %R.patt.loc10_13.2 (constants.%R.patt)] // CHECK:STDOUT: %R.param_patt: %O_where.type.2 = value_param_pattern %R.patt.loc10_13.1, runtime_param [symbolic = %R.patt.loc10_13.2 (constants.%R.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %O.ref: type = name_ref O, file.%O.decl [template = constants.%O.type] -// CHECK:STDOUT: %.Self: %O.type = bind_symbolic_name .Self [symbolic = constants.%.Self] -// CHECK:STDOUT: %.Self.ref: %O.type = name_ref .Self, %.Self [symbolic = constants.%.Self] -// CHECK:STDOUT: %P.ref: %assoc_type = name_ref P, @O.%assoc0 [template = constants.%assoc0.1] -// CHECK:STDOUT: %.Self.as_wit: = facet_access_witness %.Self.ref [symbolic = constants.%.Self.as_wit] -// CHECK:STDOUT: %impl.elem0: type = interface_witness_access %.Self.as_wit, element0 [symbolic = constants.%impl.elem0] -// CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc10_30.1: type = value_of_initializer %bool.make_type [template = bool] -// CHECK:STDOUT: %.loc10_30.2: type = converted %bool.make_type, %.loc10_30.1 [template = bool] -// CHECK:STDOUT: %.loc10_19: type = where_expr %.Self [template = constants.%O_where.type.2] { -// CHECK:STDOUT: requirement_rewrite %impl.elem0, %.loc10_30.2 -// CHECK:STDOUT: } // CHECK:STDOUT: %R.param: %O_where.type.2 = value_param runtime_param +// CHECK:STDOUT: %.loc10_19.2: type = splice_block %.loc10_19.1 [template = constants.%O_where.type.2] { +// CHECK:STDOUT: %O.ref: type = name_ref O, file.%O.decl [template = constants.%O.type] +// CHECK:STDOUT: %.Self: %O.type = bind_symbolic_name .Self [symbolic = constants.%.Self] +// CHECK:STDOUT: %.Self.ref: %O.type = name_ref .Self, %.Self [symbolic = constants.%.Self] +// CHECK:STDOUT: %P.ref: %assoc_type = name_ref P, @O.%assoc0 [template = constants.%assoc0.1] +// CHECK:STDOUT: %.Self.as_wit: = facet_access_witness %.Self.ref [symbolic = constants.%.Self.as_wit] +// CHECK:STDOUT: %impl.elem0: type = interface_witness_access %.Self.as_wit, element0 [symbolic = constants.%impl.elem0] +// CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] +// CHECK:STDOUT: %.loc10_30.1: type = value_of_initializer %bool.make_type [template = bool] +// CHECK:STDOUT: %.loc10_30.2: type = converted %bool.make_type, %.loc10_30.1 [template = bool] +// CHECK:STDOUT: %.loc10_19.1: type = where_expr %.Self [template = constants.%O_where.type.2] { +// CHECK:STDOUT: requirement_rewrite %impl.elem0, %.loc10_30.2 +// CHECK:STDOUT: } +// CHECK:STDOUT: } // CHECK:STDOUT: %R.loc10_13.1: %O_where.type.2 = bind_symbolic_name R, 0, %R.param [symbolic = %R.loc10_13.2 (constants.%R)] // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -938,36 +956,40 @@ let K: (E where .F = .Self.G) = bool; // CHECK:STDOUT: %V.patt.loc9_10.1: %S_where.type.1 = symbolic_binding_pattern V, 0 [symbolic = %V.patt.loc9_10.2 (constants.%V.patt)] // CHECK:STDOUT: %V.param_patt: %S_where.type.1 = value_param_pattern %V.patt.loc9_10.1, runtime_param [symbolic = %V.patt.loc9_10.2 (constants.%V.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %S.ref: type = name_ref S, file.%S.decl [template = constants.%S.type] -// CHECK:STDOUT: %.Self: %S.type = bind_symbolic_name .Self [symbolic = constants.%.Self] -// CHECK:STDOUT: %.Self.ref: %S.type = name_ref .Self, %.Self [symbolic = constants.%.Self] -// CHECK:STDOUT: %T.ref: %assoc_type = name_ref T, @S.%assoc0 [template = constants.%assoc0.1] -// CHECK:STDOUT: %.Self.as_wit: = facet_access_witness %.Self.ref [symbolic = constants.%.Self.as_wit] -// CHECK:STDOUT: %impl.elem0: type = interface_witness_access %.Self.as_wit, element0 [symbolic = constants.%impl.elem0] -// CHECK:STDOUT: %.loc9_28.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc9_28.2: type = converted %.loc9_28.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] -// CHECK:STDOUT: %.loc9_16: type = where_expr %.Self [template = constants.%S_where.type.1] { -// CHECK:STDOUT: requirement_rewrite %impl.elem0, %.loc9_28.2 -// CHECK:STDOUT: } // CHECK:STDOUT: %V.param: %S_where.type.1 = value_param runtime_param +// CHECK:STDOUT: %.loc9_16.2: type = splice_block %.loc9_16.1 [template = constants.%S_where.type.1] { +// CHECK:STDOUT: %S.ref: type = name_ref S, file.%S.decl [template = constants.%S.type] +// CHECK:STDOUT: %.Self: %S.type = bind_symbolic_name .Self [symbolic = constants.%.Self] +// CHECK:STDOUT: %.Self.ref: %S.type = name_ref .Self, %.Self [symbolic = constants.%.Self] +// CHECK:STDOUT: %T.ref: %assoc_type = name_ref T, @S.%assoc0 [template = constants.%assoc0.1] +// CHECK:STDOUT: %.Self.as_wit: = facet_access_witness %.Self.ref [symbolic = constants.%.Self.as_wit] +// CHECK:STDOUT: %impl.elem0: type = interface_witness_access %.Self.as_wit, element0 [symbolic = constants.%impl.elem0] +// CHECK:STDOUT: %.loc9_28.1: %empty_tuple.type = tuple_literal () +// CHECK:STDOUT: %.loc9_28.2: type = converted %.loc9_28.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] +// CHECK:STDOUT: %.loc9_16.1: type = where_expr %.Self [template = constants.%S_where.type.1] { +// CHECK:STDOUT: requirement_rewrite %impl.elem0, %.loc9_28.2 +// CHECK:STDOUT: } +// CHECK:STDOUT: } // CHECK:STDOUT: %V.loc9_10.1: %S_where.type.1 = bind_symbolic_name V, 0, %V.param [symbolic = %V.loc9_10.2 (constants.%V)] // CHECK:STDOUT: } // CHECK:STDOUT: %WithU.decl: %WithU.type = fn_decl @WithU [template = constants.%WithU] { // CHECK:STDOUT: %W.patt.loc11_10.1: %S_where.type.2 = symbolic_binding_pattern W, 0 [symbolic = %W.patt.loc11_10.2 (constants.%W.patt)] // CHECK:STDOUT: %W.param_patt: %S_where.type.2 = value_param_pattern %W.patt.loc11_10.1, runtime_param [symbolic = %W.patt.loc11_10.2 (constants.%W.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %S.ref: type = name_ref S, file.%S.decl [template = constants.%S.type] -// CHECK:STDOUT: %.Self: %S.type = bind_symbolic_name .Self [symbolic = constants.%.Self] -// CHECK:STDOUT: %.Self.ref: %S.type = name_ref .Self, %.Self [symbolic = constants.%.Self] -// CHECK:STDOUT: %U.ref: %assoc_type = name_ref U, @S.%assoc1 [template = constants.%assoc1] -// CHECK:STDOUT: %.Self.as_wit: = facet_access_witness %.Self.ref [symbolic = constants.%.Self.as_wit] -// CHECK:STDOUT: %impl.elem1: type = interface_witness_access %.Self.as_wit, element1 [symbolic = constants.%impl.elem1] -// CHECK:STDOUT: %.loc11_28.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc11_28.2: type = converted %.loc11_28.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] -// CHECK:STDOUT: %.loc11_16: type = where_expr %.Self [template = constants.%S_where.type.2] { -// CHECK:STDOUT: requirement_rewrite %impl.elem1, %.loc11_28.2 -// CHECK:STDOUT: } // CHECK:STDOUT: %W.param: %S_where.type.2 = value_param runtime_param +// CHECK:STDOUT: %.loc11_16.2: type = splice_block %.loc11_16.1 [template = constants.%S_where.type.2] { +// CHECK:STDOUT: %S.ref: type = name_ref S, file.%S.decl [template = constants.%S.type] +// CHECK:STDOUT: %.Self: %S.type = bind_symbolic_name .Self [symbolic = constants.%.Self] +// CHECK:STDOUT: %.Self.ref: %S.type = name_ref .Self, %.Self [symbolic = constants.%.Self] +// CHECK:STDOUT: %U.ref: %assoc_type = name_ref U, @S.%assoc1 [template = constants.%assoc1] +// CHECK:STDOUT: %.Self.as_wit: = facet_access_witness %.Self.ref [symbolic = constants.%.Self.as_wit] +// CHECK:STDOUT: %impl.elem1: type = interface_witness_access %.Self.as_wit, element1 [symbolic = constants.%impl.elem1] +// CHECK:STDOUT: %.loc11_28.1: %empty_tuple.type = tuple_literal () +// CHECK:STDOUT: %.loc11_28.2: type = converted %.loc11_28.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] +// CHECK:STDOUT: %.loc11_16.1: type = where_expr %.Self [template = constants.%S_where.type.2] { +// CHECK:STDOUT: requirement_rewrite %impl.elem1, %.loc11_28.2 +// CHECK:STDOUT: } +// CHECK:STDOUT: } // CHECK:STDOUT: %W.loc11_10.1: %S_where.type.2 = bind_symbolic_name W, 0, %W.param [symbolic = %W.loc11_10.2 (constants.%W)] // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -1181,18 +1203,20 @@ let K: (E where .F = .Self.G) = bool; // CHECK:STDOUT: %X.patt.loc16_24.1: = symbolic_binding_pattern X, 0 [symbolic = %X.patt.loc16_24.2 (constants.%X.patt)] // CHECK:STDOUT: %X.param_patt: = value_param_pattern %X.patt.loc16_24.1, runtime_param [symbolic = %X.patt.loc16_24.2 (constants.%X.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%I.type] -// CHECK:STDOUT: %.Self: %I.type = bind_symbolic_name .Self [symbolic = constants.%.Self] -// CHECK:STDOUT: %.Self.ref: %I.type = name_ref .Self, %.Self [symbolic = constants.%.Self] -// CHECK:STDOUT: %Member.ref: %assoc_type = name_ref Member, @I.%assoc0 [template = constants.%assoc0.1] -// CHECK:STDOUT: %.Self.as_wit: = facet_access_witness %.Self.ref [symbolic = constants.%.Self.as_wit] -// CHECK:STDOUT: %impl.elem0: type = interface_witness_access %.Self.as_wit, element0 [symbolic = constants.%impl.elem0] -// CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2] -// CHECK:STDOUT: %.loc16_46: type = converted %int_2, [template = ] -// CHECK:STDOUT: %.loc16_30: type = where_expr %.Self [template = ] { -// CHECK:STDOUT: requirement_rewrite %impl.elem0, -// CHECK:STDOUT: } // CHECK:STDOUT: %X.param: = value_param runtime_param +// CHECK:STDOUT: %.loc16_30.2: type = splice_block %.loc16_30.1 [template = ] { +// CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%I.type] +// CHECK:STDOUT: %.Self: %I.type = bind_symbolic_name .Self [symbolic = constants.%.Self] +// CHECK:STDOUT: %.Self.ref: %I.type = name_ref .Self, %.Self [symbolic = constants.%.Self] +// CHECK:STDOUT: %Member.ref: %assoc_type = name_ref Member, @I.%assoc0 [template = constants.%assoc0.1] +// CHECK:STDOUT: %.Self.as_wit: = facet_access_witness %.Self.ref [symbolic = constants.%.Self.as_wit] +// CHECK:STDOUT: %impl.elem0: type = interface_witness_access %.Self.as_wit, element0 [symbolic = constants.%impl.elem0] +// CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2] +// CHECK:STDOUT: %.loc16_46: type = converted %int_2, [template = ] +// CHECK:STDOUT: %.loc16_30.1: type = where_expr %.Self [template = ] { +// CHECK:STDOUT: requirement_rewrite %impl.elem0, +// CHECK:STDOUT: } +// CHECK:STDOUT: } // CHECK:STDOUT: %X: = bind_symbolic_name X, 0, %X.param [template = ] // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -1227,7 +1251,6 @@ let K: (E where .F = .Self.G) = bool; // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template] // CHECK:STDOUT: %interface: = interface_witness () [template] -// CHECK:STDOUT: %.Self: type = bind_symbolic_name .Self [symbolic] // CHECK:STDOUT: %type_where: type = facet_type [template] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1253,12 +1276,6 @@ let K: (E where .F = .Self.G) = bool; // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [template = constants.%D] // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%A.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %.Self: type = bind_symbolic_name .Self [symbolic = constants.%.Self] -// CHECK:STDOUT: %.Self.ref: type = name_ref .Self, %.Self [symbolic = constants.%.Self] -// CHECK:STDOUT: %A.ref: type = name_ref A, %A.decl [template = constants.%A.type] -// CHECK:STDOUT: %.loc15: type = where_expr %.Self [template = constants.%type_where] { -// CHECK:STDOUT: requirement_impls %.Self.ref, %A.ref -// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @A { @@ -1343,59 +1360,6 @@ let K: (E where .F = .Self.G) = bool; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %E.decl: type = interface_decl @E [template = constants.%E.type] {} {} -// CHECK:STDOUT: %E.ref.loc18: type = name_ref E, %E.decl [template = constants.%E.type] -// CHECK:STDOUT: %.Self.1: %E.type = bind_symbolic_name .Self [symbolic = constants.%.Self.1] -// CHECK:STDOUT: %.Self.ref.loc18_17: %E.type = name_ref .Self, %.Self.1 [symbolic = constants.%.Self.1] -// CHECK:STDOUT: %F.ref.loc18: %assoc_type = name_ref F, @E.%assoc0 [template = constants.%assoc0.1] -// CHECK:STDOUT: %.Self.as_wit.loc18_17: = facet_access_witness %.Self.ref.loc18_17 [symbolic = constants.%.Self.as_wit.1] -// CHECK:STDOUT: %impl.elem0.loc18: type = interface_witness_access %.Self.as_wit.loc18_17, element0 [symbolic = constants.%impl.elem0] -// CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc18_22.1: type = value_of_initializer %bool.make_type [template = bool] -// CHECK:STDOUT: %.loc18_22.2: type = converted %bool.make_type, %.loc18_22.1 [template = bool] -// CHECK:STDOUT: %.Self.ref.loc18_31: %E.type = name_ref .Self, %.Self.1 [symbolic = constants.%.Self.1] -// CHECK:STDOUT: %G.ref.loc18: %assoc_type = name_ref G, @E.%assoc1 [template = constants.%assoc1] -// CHECK:STDOUT: %.Self.as_wit.loc18_31: = facet_access_witness %.Self.ref.loc18_31 [symbolic = constants.%.Self.as_wit.1] -// CHECK:STDOUT: %impl.elem1.loc18: type = interface_witness_access %.Self.as_wit.loc18_31, element1 [symbolic = constants.%impl.elem1.1] -// CHECK:STDOUT: %.loc18_37.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc18_37.2: type = converted %.loc18_37.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] -// CHECK:STDOUT: %.loc18_11: type = where_expr %.Self.1 [template = constants.%E_where.type.1] { -// CHECK:STDOUT: requirement_rewrite %impl.elem0.loc18, %.loc18_22.2 -// CHECK:STDOUT: requirement_rewrite %impl.elem1.loc18, %.loc18_37.2 -// CHECK:STDOUT: } -// CHECK:STDOUT: %E.ref.loc27: type = name_ref E, %E.decl [template = constants.%E.type] -// CHECK:STDOUT: %.Self.2: %E.type = bind_symbolic_name .Self [symbolic = constants.%.Self.1] -// CHECK:STDOUT: %.Self.ref.loc27_18: %E.type = name_ref .Self, %.Self.2 [symbolic = constants.%.Self.1] -// CHECK:STDOUT: %F.ref.loc27: %assoc_type = name_ref F, @E.%assoc0 [template = constants.%assoc0.1] -// CHECK:STDOUT: %.Self.as_wit.loc27_18: = facet_access_witness %.Self.ref.loc27_18 [symbolic = constants.%.Self.as_wit.1] -// CHECK:STDOUT: %impl.elem0.loc27: type = interface_witness_access %.Self.as_wit.loc27_18, element0 [symbolic = constants.%impl.elem0] -// CHECK:STDOUT: %.loc27_24.1: %empty_struct_type = struct_literal () -// CHECK:STDOUT: %.loc27_24.2: type = converted %.loc27_24.1, constants.%empty_struct_type [template = constants.%empty_struct_type] -// CHECK:STDOUT: %.loc27_12: type = where_expr %.Self.2 [template = constants.%E_where.type.2] { -// CHECK:STDOUT: requirement_rewrite %impl.elem0.loc27, %.loc27_24.2 -// CHECK:STDOUT: } -// CHECK:STDOUT: %.Self.3: %E_where.type.2 = bind_symbolic_name .Self [symbolic = constants.%.Self.2] -// CHECK:STDOUT: %.Self.ref.loc27_33: %E_where.type.2 = name_ref .Self, %.Self.3 [symbolic = constants.%.Self.2] -// CHECK:STDOUT: %G.ref.loc27: %assoc_type = name_ref G, @E.%assoc1 [template = constants.%assoc1] -// CHECK:STDOUT: %.Self.as_wit.loc27_33: = facet_access_witness %.Self.ref.loc27_33 [symbolic = constants.%.Self.as_wit.2] -// CHECK:STDOUT: %impl.elem1.loc27: type = interface_witness_access %.Self.as_wit.loc27_33, element1 [symbolic = constants.%impl.elem1.2] -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc27_27: type = where_expr %.Self.3 [template = constants.%E_where.type.3] { -// CHECK:STDOUT: requirement_rewrite %impl.elem1.loc27, %i32 -// CHECK:STDOUT: } -// CHECK:STDOUT: %E.ref.loc35: type = name_ref E, %E.decl [template = constants.%E.type] -// CHECK:STDOUT: %.Self.4: %E.type = bind_symbolic_name .Self [symbolic = constants.%.Self.1] -// CHECK:STDOUT: %.Self.ref.loc35_17: %E.type = name_ref .Self, %.Self.4 [symbolic = constants.%.Self.1] -// CHECK:STDOUT: %F.ref.loc35: %assoc_type = name_ref F, @E.%assoc0 [template = constants.%assoc0.1] -// CHECK:STDOUT: %.Self.as_wit.loc35_17: = facet_access_witness %.Self.ref.loc35_17 [symbolic = constants.%.Self.as_wit.1] -// CHECK:STDOUT: %impl.elem0.loc35: type = interface_witness_access %.Self.as_wit.loc35_17, element0 [symbolic = constants.%impl.elem0] -// CHECK:STDOUT: %.Self.ref.loc35_22: %E.type = name_ref .Self, %.Self.4 [symbolic = constants.%.Self.1] -// CHECK:STDOUT: %G.ref.loc35: %assoc_type = name_ref G, @E.%assoc1 [template = constants.%assoc1] -// CHECK:STDOUT: %.Self.as_wit.loc35_27: = facet_access_witness %.Self.ref.loc35_22 [symbolic = constants.%.Self.as_wit.1] -// CHECK:STDOUT: %impl.elem1.loc35: type = interface_witness_access %.Self.as_wit.loc35_27, element1 [symbolic = constants.%impl.elem1.1] -// CHECK:STDOUT: %.loc35: type = where_expr %.Self.4 [template = constants.%E_where.type.4] { -// CHECK:STDOUT: requirement_rewrite %impl.elem0.loc35, %impl.elem1.loc35 -// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @E { diff --git a/toolchain/check/testdata/where_expr/fail_not_facet.carbon b/toolchain/check/testdata/where_expr/fail_not_facet.carbon index d9ea24d531b07..8b5722043f570 100644 --- a/toolchain/check/testdata/where_expr/fail_not_facet.carbon +++ b/toolchain/check/testdata/where_expr/fail_not_facet.carbon @@ -68,15 +68,17 @@ var v: e where .x = 3; // CHECK:STDOUT: %T.patt.loc8_6.1: = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_6.2 (constants.%T.patt)] // CHECK:STDOUT: %T.param_patt: = value_param_pattern %T.patt.loc8_6.1, runtime_param [symbolic = %T.patt.loc8_6.2 (constants.%T.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.Self: = bind_symbolic_name .Self [template = ] -// CHECK:STDOUT: %.Self.ref: = name_ref .Self, %.Self [template = ] -// CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc8: type = where_expr %.Self [template = ] { -// CHECK:STDOUT: requirement_equivalent %.Self.ref, %bool.make_type -// CHECK:STDOUT: } // CHECK:STDOUT: %T.param: = value_param runtime_param +// CHECK:STDOUT: %.loc8_14.2: type = splice_block %.loc8_14.1 [template = ] { +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.Self: = bind_symbolic_name .Self [template = ] +// CHECK:STDOUT: %.Self.ref: = name_ref .Self, %.Self [template = ] +// CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] +// CHECK:STDOUT: %.loc8_14.1: type = where_expr %.Self [template = ] { +// CHECK:STDOUT: requirement_equivalent %.Self.ref, %bool.make_type +// CHECK:STDOUT: } +// CHECK:STDOUT: } // CHECK:STDOUT: %T: = bind_symbolic_name T, 0, %T.param [template = ] // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -119,14 +121,16 @@ var v: e where .x = 3; // CHECK:STDOUT: %U.patt.loc8_6.1: = symbolic_binding_pattern U, 0 [symbolic = %U.patt.loc8_6.2 (constants.%U.patt)] // CHECK:STDOUT: %U.param_patt: = value_param_pattern %U.patt.loc8_6.1, runtime_param [symbolic = %U.patt.loc8_6.2 (constants.%U.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %NOT_DECLARED.ref: = name_ref NOT_DECLARED, [template = ] -// CHECK:STDOUT: %.Self: = bind_symbolic_name .Self [template = ] -// CHECK:STDOUT: %.Self.ref: = name_ref .Self, %.Self [template = ] -// CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc8: type = where_expr %.Self [template = ] { -// CHECK:STDOUT: requirement_equivalent %.Self.ref, %bool.make_type -// CHECK:STDOUT: } // CHECK:STDOUT: %U.param: = value_param runtime_param +// CHECK:STDOUT: %.loc8_23.2: type = splice_block %.loc8_23.1 [template = ] { +// CHECK:STDOUT: %NOT_DECLARED.ref: = name_ref NOT_DECLARED, [template = ] +// CHECK:STDOUT: %.Self: = bind_symbolic_name .Self [template = ] +// CHECK:STDOUT: %.Self.ref: = name_ref .Self, %.Self [template = ] +// CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] +// CHECK:STDOUT: %.loc8_23.1: type = where_expr %.Self [template = ] { +// CHECK:STDOUT: requirement_equivalent %.Self.ref, %bool.make_type +// CHECK:STDOUT: } +// CHECK:STDOUT: } // CHECK:STDOUT: %U: = bind_symbolic_name U, 0, %U.param [template = ] // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -144,7 +148,6 @@ var v: e where .x = 3; // CHECK:STDOUT: --- fail_var.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -160,14 +163,6 @@ var v: e where .x = 3; // CHECK:STDOUT: .v = %v // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %e.ref: = name_ref e, [template = ] -// CHECK:STDOUT: %.Self: = bind_symbolic_name .Self [template = ] -// CHECK:STDOUT: %.Self.ref: = name_ref .Self, %.Self [template = ] -// CHECK:STDOUT: %x.ref: = name_ref x, [template = ] -// CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3] -// CHECK:STDOUT: %.loc7: type = where_expr %.Self [template = ] { -// CHECK:STDOUT: requirement_rewrite %x.ref, -// CHECK:STDOUT: } // CHECK:STDOUT: %v.var: ref = var v // CHECK:STDOUT: %v: ref = bind_name v, %v.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/where_expr/non_generic.carbon b/toolchain/check/testdata/where_expr/non_generic.carbon index b60be9a0466f7..9993cd2251df8 100644 --- a/toolchain/check/testdata/where_expr/non_generic.carbon +++ b/toolchain/check/testdata/where_expr/non_generic.carbon @@ -50,18 +50,20 @@ fn NotGenericF(U: I where .T == i32) {} // CHECK:STDOUT: %U.patt: %I_where.type = binding_pattern U // CHECK:STDOUT: %U.param_patt: %I_where.type = value_param_pattern %U.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%I.type] -// CHECK:STDOUT: %.Self: %I.type = bind_symbolic_name .Self [symbolic = constants.%.Self] -// CHECK:STDOUT: %.Self.ref: %I.type = name_ref .Self, %.Self [symbolic = constants.%.Self] -// CHECK:STDOUT: %T.ref: %assoc_type = name_ref T, @I.%assoc0 [template = constants.%assoc0] -// CHECK:STDOUT: %.Self.as_wit: = facet_access_witness %.Self.ref [symbolic = constants.%.Self.as_wit] -// CHECK:STDOUT: %impl.elem0: type = interface_witness_access %.Self.as_wit, element0 [symbolic = constants.%impl.elem0] -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc14: type = where_expr %.Self [template = constants.%I_where.type] { -// CHECK:STDOUT: requirement_equivalent %impl.elem0, %i32 -// CHECK:STDOUT: } // CHECK:STDOUT: %U.param: %I_where.type = value_param runtime_param0 +// CHECK:STDOUT: %.loc14_21.2: type = splice_block %.loc14_21.1 [template = constants.%I_where.type] { +// CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%I.type] +// CHECK:STDOUT: %.Self: %I.type = bind_symbolic_name .Self [symbolic = constants.%.Self] +// CHECK:STDOUT: %.Self.ref: %I.type = name_ref .Self, %.Self [symbolic = constants.%.Self] +// CHECK:STDOUT: %T.ref: %assoc_type = name_ref T, @I.%assoc0 [template = constants.%assoc0] +// CHECK:STDOUT: %.Self.as_wit: = facet_access_witness %.Self.ref [symbolic = constants.%.Self.as_wit] +// CHECK:STDOUT: %impl.elem0: type = interface_witness_access %.Self.as_wit, element0 [symbolic = constants.%impl.elem0] +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc14_21.1: type = where_expr %.Self [template = constants.%I_where.type] { +// CHECK:STDOUT: requirement_equivalent %impl.elem0, %i32 +// CHECK:STDOUT: } +// CHECK:STDOUT: } // CHECK:STDOUT: %U: %I_where.type = bind_name U, %U.param // CHECK:STDOUT: } // CHECK:STDOUT: } diff --git a/toolchain/sem_ir/file.h b/toolchain/sem_ir/file.h index 9aaf1b163bb99..024ff6c74c40b 100644 --- a/toolchain/sem_ir/file.h +++ b/toolchain/sem_ir/file.h @@ -35,6 +35,23 @@ namespace Carbon::SemIR { +// An expression that may contain control flow, represented as a +// single-entry/single-exit region. `block_ids` are the blocks that are part of +// evaluation of the expression, and `result_id` represents the result of +// evaluating the expression. `block_ids` consists of all blocks that are +// dominated by `block_ids.front()` and post-dominated by `block_ids.back()`, +// and should be in lexical order. `result_id` will be in `block_ids.back()` or +// some block that dominates it. +// +// `block_ids` cannot be empty. If it has a single element, then the region +// should be used via a `SpliceBlock` inst. Otherwise, the region should be used +// by branching to the entry block, and the last inst in the exit block will +// likewise be a branch. +struct ExprRegion { + llvm::SmallVector block_ids; + InstId result_id; +}; + // Provides semantic analysis on a Parse::Tree. class File : public Printable { public: @@ -166,6 +183,11 @@ class File : public Printable { auto constants() -> ConstantStore& { return constants_; } auto constants() const -> const ConstantStore& { return constants_; } + auto expr_regions() -> ValueStore& { return expr_regions_; } + auto expr_regions() const -> const ValueStore& { + return expr_regions_; + } + auto top_inst_block_id() const -> InstBlockId { return top_inst_block_id_; } auto set_top_inst_block_id(InstBlockId block_id) -> void { top_inst_block_id_ = block_id; @@ -272,6 +294,10 @@ class File : public Printable { // Descriptions of types used in this file. TypeStore types_ = TypeStore(this); + + // Single-entry/single-exit regions that are referenced as units, e.g. because + // they represent expressions. + ValueStore expr_regions_; }; // The expression category of a sem_ir instruction. See /docs/design/values.md diff --git a/toolchain/sem_ir/id_kind.h b/toolchain/sem_ir/id_kind.h index 2ed5889ec94f2..7c86f6b1c7716 100644 --- a/toolchain/sem_ir/id_kind.h +++ b/toolchain/sem_ir/id_kind.h @@ -142,7 +142,7 @@ using IdKind = TypeEnum< InstId, AbsoluteInstId, AnyRawId, ConstantId, EntityNameId, CompileTimeBindIndex, RuntimeParamIndex, FacetTypeId, FunctionId, ClassId, InterfaceId, ImplId, GenericId, SpecificId, ImportIRId, ImportIRInstId, - LocId, BoolValue, IntKind, NameId, NameScopeId, InstBlockId, + LocId, BoolValue, IntKind, NameId, NameScopeId, InstBlockId, ExprRegionId, StructTypeFieldsId, TypeId, TypeBlockId, ElementIndex, LibraryNameId, FloatKind>; diff --git a/toolchain/sem_ir/ids.h b/toolchain/sem_ir/ids.h index 8d98d70978967..6a9b60c62e269 100644 --- a/toolchain/sem_ir/ids.h +++ b/toolchain/sem_ir/ids.h @@ -29,6 +29,7 @@ struct ImportIRInst; struct Impl; struct Interface; struct StructTypeField; +struct ExprRegion; struct TypeInfo; // The ID of an instruction. @@ -551,6 +552,20 @@ constexpr InstBlockId InstBlockId::GlobalInit = InstBlockId(3); constexpr InstBlockId InstBlockId::Invalid = InstBlockId(InvalidIndex); constexpr InstBlockId InstBlockId::Unreachable = InstBlockId(InvalidIndex - 1); +// TODO: Move this out of sem_ir and into check, if we don't wind up using it +// in the SemIR for expression patterns. +struct ExprRegionId : public IdBase { + static constexpr llvm::StringLiteral Label = "region"; + using ValueType = ExprRegion; + + // An explicitly invalid ID. + static const ExprRegionId Invalid; + + using IdBase::IdBase; +}; + +constexpr ExprRegionId ExprRegionId::Invalid = ExprRegionId(InvalidIndex); + // The ID of a struct type field block. struct StructTypeFieldsId : public IdBase { static constexpr llvm::StringLiteral Label = "struct_type_fields"; diff --git a/toolchain/sem_ir/yaml_test.cpp b/toolchain/sem_ir/yaml_test.cpp index 1bbafae77b481..88b1129438fef 100644 --- a/toolchain/sem_ir/yaml_test.cpp +++ b/toolchain/sem_ir/yaml_test.cpp @@ -97,7 +97,9 @@ TEST(SemIRTest, YAML) { Pair("import_refs", Yaml::Mapping(IsEmpty())), Pair("global_init", Yaml::Mapping(IsEmpty())), Pair("inst_block4", Yaml::Mapping(Each(Pair(_, inst_id)))), - Pair("inst_block5", Yaml::Mapping(Each(Pair(_, inst_id))))))))); + Pair("inst_block5", Yaml::Mapping(Each(Pair(_, inst_id)))), + Pair("inst_block6", Yaml::Mapping(Each(Pair(_, inst_id)))), + Pair("inst_block7", Yaml::Mapping(Each(Pair(_, inst_id))))))))); auto root = Yaml::Sequence(ElementsAre(Yaml::Mapping( ElementsAre(Pair("filename", "test.carbon"), Pair("sem_ir", file))))); From de41a4b1b30b7ae42da5f71e82161dfebb32dc0c Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Thu, 19 Dec 2024 14:01:18 -0800 Subject: [PATCH 61/68] Fix a protected data member in a test. (#4717) --- toolchain/lex/numeric_literal_test.cpp | 2 +- toolchain/parse/tree_test.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/toolchain/lex/numeric_literal_test.cpp b/toolchain/lex/numeric_literal_test.cpp index 81be741dc9277..ccda4ede97b5e 100644 --- a/toolchain/lex/numeric_literal_test.cpp +++ b/toolchain/lex/numeric_literal_test.cpp @@ -22,7 +22,7 @@ using ::testing::Truly; using ::testing::VariantWith; class NumericLiteralTest : public ::testing::Test { - protected: + public: NumericLiteralTest() : error_tracker(ConsoleDiagnosticConsumer()) {} auto Lex(llvm::StringRef text) -> NumericLiteral { diff --git a/toolchain/parse/tree_test.cpp b/toolchain/parse/tree_test.cpp index 291f06a7bc1cf..66bb132f09887 100644 --- a/toolchain/parse/tree_test.cpp +++ b/toolchain/parse/tree_test.cpp @@ -30,7 +30,7 @@ using ::testing::Pair; namespace Yaml = ::Carbon::Testing::Yaml; class TreeTest : public ::testing::Test { - protected: + public: Testing::CompileHelper compile_helper_; }; From 6fe8e0b5aa4172f59b2683543bd8908faed19615 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Thu, 19 Dec 2024 14:02:18 -0800 Subject: [PATCH 62/68] Provide generic impls for `Core.Int` and `Core.UInt` operations. (#4693) Instead of providing operations only for `i32`, provide them for all `iN` and `uN` types. For now, this excludes the `*Assign`, `Inc` and `Dec` interfaces, because the implementations for those are defined as Carbon functions rather than builtins, and we can't yet lower definitions for specific functions, so converting those to be generic breaks the build for our examples. --- core/prelude/types/int.carbon | 180 ++++++++++-------- core/prelude/types/uint.carbon | 160 +++++++++++++++- .../testdata/array/array_vs_tuple.carbon | 14 +- .../testdata/array/assign_return_value.carbon | 4 +- .../check/testdata/array/assign_var.carbon | 8 +- toolchain/check/testdata/array/base.carbon | 4 +- .../testdata/array/canonicalize_index.carbon | 8 +- .../fail_out_of_bound_non_literal.carbon | 10 +- .../testdata/array/fail_type_mismatch.carbon | 4 +- .../testdata/array/function_param.carbon | 10 +- .../testdata/array/index_not_literal.carbon | 10 +- .../check/testdata/array/nine_elements.carbon | 20 +- .../testdata/as/adapter_conversion.carbon | 24 +-- toolchain/check/testdata/as/basic.carbon | 4 +- toolchain/check/testdata/as/overloaded.carbon | 4 +- .../testdata/basics/builtin_types.carbon | 4 +- .../fail_numeric_literal_overflow.carbon | 8 +- .../testdata/basics/numeric_literals.carbon | 14 +- toolchain/check/testdata/basics/parens.carbon | 6 +- .../check/testdata/basics/run_i32.carbon | 4 +- .../testdata/builtins/float/make_type.carbon | 4 +- .../builtins/int/convert_checked.carbon | 122 ++++++------ .../check/testdata/builtins/int/eq.carbon | 10 +- .../testdata/builtins/int/greater.carbon | 42 ++-- .../testdata/builtins/int/greater_eq.carbon | 22 +-- .../testdata/builtins/int/left_shift.carbon | 34 ++-- .../check/testdata/builtins/int/less.carbon | 42 ++-- .../testdata/builtins/int/less_eq.carbon | 22 +-- .../check/testdata/builtins/int/neq.carbon | 10 +- .../testdata/builtins/int/right_shift.carbon | 18 +- .../check/testdata/builtins/int/sadd.carbon | 10 +- .../check/testdata/builtins/int/sdiv.carbon | 28 +-- .../check/testdata/builtins/int/smod.carbon | 28 +-- .../check/testdata/builtins/int/smul.carbon | 10 +- .../testdata/builtins/int/snegate.carbon | 12 +- .../check/testdata/builtins/int/ssub.carbon | 18 +- .../check/testdata/builtins/int/uadd.carbon | 10 +- .../check/testdata/builtins/int/udiv.carbon | 28 +-- .../check/testdata/builtins/int/umod.carbon | 28 +-- .../check/testdata/builtins/int/umul.carbon | 10 +- .../testdata/builtins/int/unegate.carbon | 12 +- .../check/testdata/builtins/int/usub.carbon | 18 +- .../check/testdata/builtins/print/char.carbon | 6 +- .../check/testdata/builtins/print/int.carbon | 6 +- .../testdata/class/access_modifers.carbon | 22 +-- .../testdata/class/adapter/init_adapt.carbon | 12 +- toolchain/check/testdata/class/base.carbon | 6 +- .../check/testdata/class/base_method.carbon | 4 +- toolchain/check/testdata/class/basic.carbon | 4 +- .../testdata/class/derived_to_base.carbon | 8 +- .../class/fail_field_modifiers.carbon | 6 +- .../check/testdata/class/fail_init.carbon | 4 +- .../class/fail_init_as_inplace.carbon | 6 +- .../check/testdata/class/fail_scope.carbon | 4 +- .../check/testdata/class/field_access.carbon | 6 +- .../class/field_access_in_value.carbon | 6 +- .../generic/complete_in_conversion.carbon | 4 +- .../testdata/class/generic/import.carbon | 8 +- .../testdata/class/generic/stringify.carbon | 6 +- toolchain/check/testdata/class/import.carbon | 8 +- .../check/testdata/class/import_base.carbon | 8 +- .../testdata/class/inheritance_access.carbon | 14 +- toolchain/check/testdata/class/init_as.carbon | 6 +- toolchain/check/testdata/class/method.carbon | 4 +- toolchain/check/testdata/class/reorder.carbon | 4 +- .../testdata/class/reorder_qualified.carbon | 10 +- toolchain/check/testdata/class/scope.carbon | 6 +- .../testdata/class/self_conversion.carbon | 4 +- .../class/syntactic_merge_literal.carbon | 12 +- .../testdata/class/virtual_modifiers.carbon | 10 +- toolchain/check/testdata/deduce/array.carbon | 20 +- .../check/testdata/deduce/generic_type.carbon | 4 +- toolchain/check/testdata/deduce/tuple.carbon | 6 +- .../check/testdata/eval/aggregate.carbon | 16 +- .../check/testdata/eval/fail_aggregate.carbon | 12 +- .../check/testdata/function/call/i32.carbon | 4 +- .../function/call/more_param_ir.carbon | 6 +- .../testdata/function/call/params_one.carbon | 4 +- .../function/call/params_one_comma.carbon | 6 +- .../testdata/function/call/params_two.carbon | 6 +- .../function/call/params_two_comma.carbon | 10 +- .../call/prefer_unqualified_lookup.carbon | 4 +- .../function/declaration/import.carbon | 30 +-- .../function/definition/import.carbon | 6 +- .../testdata/function/generic/deduce.carbon | 8 +- .../generic/fail_todo_param_in_type.carbon | 4 +- .../function/generic/undefined.carbon | 12 +- .../check/testdata/global/simple_init.carbon | 4 +- .../testdata/global/simple_with_fun.carbon | 4 +- .../if/fail_reachable_fallthrough.carbon | 8 +- toolchain/check/testdata/if/fail_scope.carbon | 4 +- .../if/unreachable_fallthrough.carbon | 6 +- toolchain/check/testdata/if_expr/basic.carbon | 4 +- .../if_expr/constant_condition.carbon | 10 +- .../testdata/if_expr/control_flow.carbon | 6 +- .../check/testdata/if_expr/nested.carbon | 10 +- .../check/testdata/if_expr/struct.carbon | 6 +- .../testdata/impl/extend_impl_generic.carbon | 4 +- .../index/array_element_access.carbon | 10 +- .../check/testdata/index/expr_category.carbon | 26 +-- .../index/fail_array_large_index.carbon | 8 +- .../index/fail_array_non_int_indexing.carbon | 4 +- .../fail_array_out_of_bound_access.carbon | 6 +- .../testdata/index/fail_expr_category.carbon | 14 +- .../index/fail_negative_indexing.carbon | 6 +- .../fail_todo_assoc_const_default.carbon | 4 +- .../interface/todo_define_not_default.carbon | 4 +- .../ir/duplicate_name_same_line.carbon | 6 +- .../testdata/let/compile_time_bindings.carbon | 18 +- toolchain/check/testdata/let/convert.carbon | 8 +- .../testdata/let/fail_duplicate_decl.carbon | 6 +- .../check/testdata/let/fail_modifiers.carbon | 18 +- toolchain/check/testdata/let/global.carbon | 4 +- .../check/testdata/let/shadowed_decl.carbon | 4 +- .../testdata/namespace/add_to_import.carbon | 4 +- .../check/testdata/namespace/alias.carbon | 4 +- .../namespace/fail_decl_in_alias.carbon | 4 +- .../check/testdata/namespace/shadow.carbon | 6 +- .../operators/builtin/assignment.carbon | 26 +-- .../fail_assignment_to_non_assignable.carbon | 18 +- .../fail_redundant_compound_access.carbon | 6 +- .../fail_type_mismatch_assignment.carbon | 4 +- .../operators/overloaded/index.carbon | 8 +- .../check/testdata/package_expr/syntax.carbon | 10 +- .../packages/implicit_imports_prelude.carbon | 4 +- .../testdata/pointer/address_of_deref.carbon | 4 +- .../testdata/pointer/address_of_lvalue.carbon | 10 +- toolchain/check/testdata/pointer/basic.carbon | 4 +- .../check/testdata/pointer/import.carbon | 4 +- .../return/code_after_return_value.carbon | 4 +- .../fail_return_with_returned_var.carbon | 8 +- .../return/fail_returned_var_shadow.carbon | 14 +- .../check/testdata/return/returned_var.carbon | 8 +- .../testdata/return/returned_var_scope.carbon | 12 +- toolchain/check/testdata/return/struct.carbon | 4 +- toolchain/check/testdata/return/tuple.carbon | 6 +- toolchain/check/testdata/return/value.carbon | 4 +- .../struct/fail_non_member_access.carbon | 4 +- toolchain/check/testdata/struct/import.carbon | 20 +- .../testdata/struct/member_access.carbon | 4 +- .../check/testdata/struct/one_entry.carbon | 4 +- .../testdata/struct/partially_const.carbon | 6 +- .../testdata/struct/tuple_as_element.carbon | 6 +- .../check/testdata/struct/two_entries.carbon | 10 +- .../tuple/access/element_access.carbon | 4 +- .../tuple/access/fail_access_error.carbon | 6 +- .../tuple/access/fail_large_index.carbon | 4 +- .../access/fail_negative_indexing.carbon | 6 +- .../access/fail_non_deterministic_type.carbon | 8 +- .../tuple/access/fail_non_int_indexing.carbon | 6 +- .../tuple/access/fail_non_tuple_access.carbon | 6 +- .../access/fail_out_of_bound_access.carbon | 6 +- .../fail_out_of_bound_not_literal.carbon | 6 +- .../tuple/access/index_not_literal.carbon | 16 +- .../tuple/access/return_value_access.carbon | 4 +- .../tuple/fail_element_type_mismatch.carbon | 4 +- toolchain/check/testdata/tuple/import.carbon | 22 +-- .../check/testdata/tuple/nested_tuple.carbon | 8 +- .../tuple/nested_tuple_in_place.carbon | 6 +- .../check/testdata/tuple/one_element.carbon | 4 +- .../check/testdata/tuple/two_elements.carbon | 10 +- .../testdata/function/generic/call.carbon | 16 +- .../function/generic/call_method.carbon | 4 +- 163 files changed, 1085 insertions(+), 903 deletions(-) diff --git a/core/prelude/types/int.carbon b/core/prelude/types/int.carbon index 600a7cecf07c6..27b42e59d7615 100644 --- a/core/prelude/types/int.carbon +++ b/core/prelude/types/int.carbon @@ -13,6 +13,8 @@ class Int(N:! IntLiteral()) { adapt MakeInt(N); } +// Conversions. + impl forall [N:! IntLiteral()] IntLiteral() as ImplicitAs(Int(N)) { fn Convert[self: Self]() -> Int(N) = "int.convert_checked"; } @@ -30,138 +32,160 @@ impl forall [N:! IntLiteral()] Int(N) as As(IntLiteral()) { fn Convert[self: Self]() -> IntLiteral() = "int.convert_checked"; } -// TODO: Make these operations generic. +// Comparisons. + +impl forall [N:! IntLiteral()] Int(N) as Eq { + fn Equal[self: Self](other: Self) -> bool = "int.eq"; + fn NotEqual[self: Self](other: Self) -> bool = "int.neq"; +} + +impl forall [N:! IntLiteral()] Int(N) as Ordered { + // TODO: fn Compare + fn Less[self: Self](other: Self) -> bool = "int.less"; + fn LessOrEquivalent[self: Self](other: Self) -> bool = "int.less_eq"; + fn Greater[self: Self](other: Self) -> bool = "int.greater"; + fn GreaterOrEquivalent[self: Self](other: Self) -> bool = "int.greater_eq"; +} + +// Arithmetic. -impl i32 as Add { +impl forall [N:! IntLiteral()] Int(N) as Add { fn Op[self: Self](other: Self) -> Self = "int.sadd"; } -impl i32 as AddAssign { - fn Op[addr self: Self*](other: Self) { - // TODO: Once operator lookup works inside Core. - // *self = *self + other; - *self = self->(Add.Op)(other); - } + +impl forall [N:! IntLiteral()] Int(N) as Div { + fn Op[self: Self](other: Self) -> Self = "int.sdiv"; } -impl i32 as Inc { - fn Op[addr self: Self*]() { - // *self += 1; - self->(AddAssign.Op)(1); - } + +impl forall [N:! IntLiteral()] Int(N) as Mod { + fn Op[self: Self](other: Self) -> Self = "int.smod"; } -impl i32 as BitAnd { - fn Op[self: Self](other: Self) -> Self = "int.and"; +impl forall [N:! IntLiteral()] Int(N) as Mul { + fn Op[self: Self](other: Self) -> Self = "int.smul"; } -impl i32 as BitAndAssign { - fn Op[addr self: Self*](other: Self) { - // *self = *self & other; - *self = self->(BitAnd.Op)(other); - } + +impl forall [N:! IntLiteral()] Int(N) as Negate { + fn Op[self: Self]() -> Self = "int.snegate"; } -impl i32 as BitComplement { +impl forall [N:! IntLiteral()] Int(N) as Sub { + fn Op[self: Self](other: Self) -> Self = "int.ssub"; +} + +// Bitwise operators. + +impl forall [N:! IntLiteral()] Int(N) as BitAnd { + fn Op[self: Self](other: Self) -> Self = "int.and"; +} + +impl forall [N:! IntLiteral()] Int(N) as BitComplement { fn Op[self: Self]() -> Self = "int.complement"; } -impl i32 as BitOr { +impl forall [N:! IntLiteral()] Int(N) as BitOr { fn Op[self: Self](other: Self) -> Self = "int.or"; } -impl i32 as BitOrAssign { - fn Op[addr self: Self*](other: Self) { - // *self = *self | other; - *self = self->(BitOr.Op)(other); - } -} -impl i32 as BitXor { +impl forall [N:! IntLiteral()] Int(N) as BitXor { fn Op[self: Self](other: Self) -> Self = "int.xor"; } -impl i32 as BitXorAssign { + +impl forall [N:! IntLiteral()] Int(N) as LeftShift { + fn Op[self: Self](other: Self) -> Self = "int.left_shift"; +} + +impl forall [N:! IntLiteral()] Int(N) as RightShift { + fn Op[self: Self](other: Self) -> Self = "int.right_shift"; +} + +// Compound assignments. + +// TODO: Once we can lower specific functions, make these generic. +// Each function has a commented out generic signature. + +// impl forall [N:! IntLiteral()] Int(N) as AddAssign { +impl i32 as AddAssign { fn Op[addr self: Self*](other: Self) { - // *self = *self ^ other; - *self = self->(BitXor.Op)(other); + *self = *self + other; } } -impl i32 as Div { - fn Op[self: Self](other: Self) -> Self = "int.sdiv"; +// impl forall [N:! IntLiteral()] Int(N) as BitAndAssign { +impl i32 as BitAndAssign { + fn Op[addr self: Self*](other: Self) { + *self = *self & other; + } } -impl i32 as DivAssign { + +// impl forall [N:! IntLiteral()] Int(N) as BitOrAssign { +impl i32 as BitOrAssign { fn Op[addr self: Self*](other: Self) { - // *self = *self / other; - *self = self->(Div.Op)(other); + *self = *self | other; } } -impl i32 as Eq { - fn Equal[self: Self](other: Self) -> bool = "int.eq"; - fn NotEqual[self: Self](other: Self) -> bool = "int.neq"; +// impl forall [N:! IntLiteral()] Int(N) as BitXorAssign { +impl i32 as BitXorAssign { + fn Op[addr self: Self*](other: Self) { + *self = *self ^ other; + } } -impl i32 as LeftShift { - fn Op[self: Self](other: Self) -> Self = "int.left_shift"; +// impl forall [N:! IntLiteral()] Int(N) as DivAssign { +impl i32 as DivAssign { + fn Op[addr self: Self*](other: Self) { + *self = *self / other; + } } + +// impl forall [N:! IntLiteral()] Int(N) as LeftShiftAssign { impl i32 as LeftShiftAssign { fn Op[addr self: Self*](other: Self) { - // *self = *self << other; - *self = self->(LeftShift.Op)(other); + *self = *self << other; } } -impl i32 as Mod { - fn Op[self: Self](other: Self) -> Self = "int.smod"; -} +// impl forall [N:! IntLiteral()] Int(N) as ModAssign { impl i32 as ModAssign { fn Op[addr self: Self*](other: Self) { - // *self = *self % other; - *self = self->(Mod.Op)(other); + *self = *self % other; } } -impl i32 as Mul { - fn Op[self: Self](other: Self) -> Self = "int.smul"; -} +// impl forall [N:! IntLiteral()] Int(N) as MulAssign { impl i32 as MulAssign { fn Op[addr self: Self*](other: Self) { - // *self = *self * other; - *self = self->(Mul.Op)(other); + *self = *self * other; } } -impl i32 as Negate { - fn Op[self: Self]() -> Self = "int.snegate"; -} - -impl i32 as Ordered { - // TODO: fn Compare - fn Less[self: Self](other: Self) -> bool = "int.less"; - fn LessOrEquivalent[self: Self](other: Self) -> bool = "int.less_eq"; - fn Greater[self: Self](other: Self) -> bool = "int.greater"; - fn GreaterOrEquivalent[self: Self](other: Self) -> bool = "int.greater_eq"; -} - -impl i32 as RightShift { - fn Op[self: Self](other: Self) -> Self = "int.right_shift"; -} +// impl forall [N:! IntLiteral()] Int(N) as RightShiftAssign { impl i32 as RightShiftAssign { fn Op[addr self: Self*](other: Self) { - // *self = *self >> other; - *self = self->(RightShift.Op)(other); + *self = *self >> other; } } -impl i32 as Sub { - fn Op[self: Self](other: Self) -> Self = "int.ssub"; -} +// impl forall [N:! IntLiteral()] Int(N) as SubAssign { impl i32 as SubAssign { fn Op[addr self: Self*](other: Self) { - // *self = *self - other; - *self = self->(Sub.Op)(other); + *self = *self - other; } } + +// Increment and decrement. + +// impl forall [N:! IntLiteral()] Int(N) as Dec { impl i32 as Dec { fn Op[addr self: Self*]() { - // *self -= 1; - self->(SubAssign.Op)(1); + *self -= 1; + } +} + +// impl forall [N:! IntLiteral()] Int(N) as Inc { +impl i32 as Inc { + fn Op[addr self: Self*]() { + *self += 1; } } diff --git a/core/prelude/types/uint.carbon b/core/prelude/types/uint.carbon index e5d236992aa93..ef4461cb94130 100644 --- a/core/prelude/types/uint.carbon +++ b/core/prelude/types/uint.carbon @@ -13,6 +13,8 @@ class UInt(N:! IntLiteral()) { adapt MakeUInt(N); } +// Conversions. + impl forall [N:! IntLiteral()] IntLiteral() as ImplicitAs(UInt(N)) { fn Convert[self: Self]() -> UInt(N) = "int.convert_checked"; } @@ -30,4 +32,160 @@ impl forall [N:! IntLiteral()] UInt(N) as As(IntLiteral()) { fn Convert[self: Self]() -> IntLiteral() = "int.convert_checked"; } -// TODO: Operations. +// Comparisons. + +impl forall [N:! IntLiteral()] UInt(N) as Eq { + fn Equal[self: Self](other: Self) -> bool = "int.eq"; + fn NotEqual[self: Self](other: Self) -> bool = "int.neq"; +} + +impl forall [N:! IntLiteral()] UInt(N) as Ordered { + // TODO: fn Compare + fn Less[self: Self](other: Self) -> bool = "int.less"; + fn LessOrEquivalent[self: Self](other: Self) -> bool = "int.less_eq"; + fn Greater[self: Self](other: Self) -> bool = "int.greater"; + fn GreaterOrEquivalent[self: Self](other: Self) -> bool = "int.greater_eq"; +} + +// Arithmetic. + +impl forall [N:! IntLiteral()] UInt(N) as Add { + fn Op[self: Self](other: Self) -> Self = "int.sadd"; +} + +impl forall [N:! IntLiteral()] UInt(N) as Div { + fn Op[self: Self](other: Self) -> Self = "int.sdiv"; +} + +impl forall [N:! IntLiteral()] UInt(N) as Mod { + fn Op[self: Self](other: Self) -> Self = "int.smod"; +} + +impl forall [N:! IntLiteral()] UInt(N) as Mul { + fn Op[self: Self](other: Self) -> Self = "int.smul"; +} + +impl forall [N:! IntLiteral()] UInt(N) as Negate { + fn Op[self: Self]() -> Self = "int.snegate"; +} + +impl forall [N:! IntLiteral()] UInt(N) as Sub { + fn Op[self: Self](other: Self) -> Self = "int.ssub"; +} + +// Bitwise operators. + +impl forall [N:! IntLiteral()] UInt(N) as BitAnd { + fn Op[self: Self](other: Self) -> Self = "int.and"; +} + +impl forall [N:! IntLiteral()] UInt(N) as BitComplement { + fn Op[self: Self]() -> Self = "int.complement"; +} + +impl forall [N:! IntLiteral()] UInt(N) as BitOr { + fn Op[self: Self](other: Self) -> Self = "int.or"; +} + +impl forall [N:! IntLiteral()] UInt(N) as BitXor { + fn Op[self: Self](other: Self) -> Self = "int.xor"; +} + +impl forall [N:! IntLiteral()] UInt(N) as LeftShift { + fn Op[self: Self](other: Self) -> Self = "int.left_shift"; +} + +impl forall [N:! IntLiteral()] UInt(N) as RightShift { + fn Op[self: Self](other: Self) -> Self = "int.right_shift"; +} + +// Compound assignments. + +// TODO: Once we can lower specific functions, make these generic. +// Each function has a commented out generic signature. + +// impl forall [N:! IntLiteral()] UInt(N) as AddAssign { +impl u32 as AddAssign { + fn Op[addr self: Self*](other: Self) { + *self = *self + other; + } +} + +// impl forall [N:! IntLiteral()] UInt(N) as BitAndAssign { +impl u32 as BitAndAssign { + fn Op[addr self: Self*](other: Self) { + *self = *self & other; + } +} + +// impl forall [N:! IntLiteral()] UInt(N) as BitOrAssign { +impl u32 as BitOrAssign { + fn Op[addr self: Self*](other: Self) { + *self = *self | other; + } +} + +// impl forall [N:! IntLiteral()] UInt(N) as BitXorAssign { +impl u32 as BitXorAssign { + fn Op[addr self: Self*](other: Self) { + *self = *self ^ other; + } +} + +// impl forall [N:! IntLiteral()] UInt(N) as DivAssign { +impl u32 as DivAssign { + fn Op[addr self: Self*](other: Self) { + *self = *self / other; + } +} + +// impl forall [N:! IntLiteral()] UInt(N) as LeftShiftAssign { +impl u32 as LeftShiftAssign { + fn Op[addr self: Self*](other: Self) { + *self = *self << other; + } +} + +// impl forall [N:! IntLiteral()] UInt(N) as ModAssign { +impl u32 as ModAssign { + fn Op[addr self: Self*](other: Self) { + *self = *self % other; + } +} + +// impl forall [N:! IntLiteral()] UInt(N) as MulAssign { +impl u32 as MulAssign { + fn Op[addr self: Self*](other: Self) { + *self = *self * other; + } +} + +// impl forall [N:! IntLiteral()] UInt(N) as RightShiftAssign { +impl u32 as RightShiftAssign { + fn Op[addr self: Self*](other: Self) { + *self = *self >> other; + } +} + +// impl forall [N:! IntLiteral()] UInt(N) as SubAssign { +impl u32 as SubAssign { + fn Op[addr self: Self*](other: Self) { + *self = *self - other; + } +} + +// Increment and decrement. + +// impl forall [N:! IntLiteral()] UInt(N) as Dec { +impl u32 as Dec { + fn Op[addr self: Self*]() { + *self -= 1; + } +} + +// impl forall [N:! IntLiteral()] UInt(N) as Inc { +impl u32 as Inc { + fn Op[addr self: Self*]() { + *self += 1; + } +} diff --git a/toolchain/check/testdata/array/array_vs_tuple.carbon b/toolchain/check/testdata/array/array_vs_tuple.carbon index ff0cff43ca145..39bf623805356 100644 --- a/toolchain/check/testdata/array/array_vs_tuple.carbon +++ b/toolchain/check/testdata/array/array_vs_tuple.carbon @@ -30,7 +30,7 @@ fn G() { // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -71,7 +71,7 @@ fn G() { // CHECK:STDOUT: %int_2.loc13_25: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %int_3.loc13: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] // CHECK:STDOUT: %.loc13_29.1: %tuple.type.1 = tuple_literal (%int_1.loc13_22, %int_2.loc13_25, %int_3.loc13) -// CHECK:STDOUT: %impl.elem0.loc13_29.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc13_29.1: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc13_29.1: = bound_method %int_1.loc13_22, %impl.elem0.loc13_29.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc13_29.1: = specific_function %Convert.bound.loc13_29.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc13_29.1: init %i32 = call %Convert.specific_fn.loc13_29.1(%int_1.loc13_22) [template = constants.%int_1.2] @@ -79,7 +79,7 @@ fn G() { // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0] // CHECK:STDOUT: %.loc13_29.3: ref %i32 = array_index %a.var, %int_0 // CHECK:STDOUT: %.loc13_29.4: init %i32 = initialize_from %.loc13_29.2 to %.loc13_29.3 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc13_29.2: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc13_29.2: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc13_29.2: = bound_method %int_2.loc13_25, %impl.elem0.loc13_29.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc13_29.2: = specific_function %Convert.bound.loc13_29.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc13_29.2: init %i32 = call %Convert.specific_fn.loc13_29.2(%int_2.loc13_25) [template = constants.%int_2.2] @@ -87,7 +87,7 @@ fn G() { // CHECK:STDOUT: %int_1.loc13_29: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %.loc13_29.6: ref %i32 = array_index %a.var, %int_1.loc13_29 // CHECK:STDOUT: %.loc13_29.7: init %i32 = initialize_from %.loc13_29.5 to %.loc13_29.6 [template = constants.%int_2.2] -// CHECK:STDOUT: %impl.elem0.loc13_29.3: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc13_29.3: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc13_29.3: = bound_method %int_3.loc13, %impl.elem0.loc13_29.3 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc13_29.3: = specific_function %Convert.bound.loc13_29.3, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc13_29.3: init %i32 = call %Convert.specific_fn.loc13_29.3(%int_3.loc13) [template = constants.%int_3.2] @@ -104,21 +104,21 @@ fn G() { // CHECK:STDOUT: %int_2.loc14: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %int_3.loc14: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] // CHECK:STDOUT: %.loc14_36.1: %tuple.type.1 = tuple_literal (%int_1.loc14, %int_2.loc14, %int_3.loc14) -// CHECK:STDOUT: %impl.elem0.loc14_36.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc14_36.1: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc14_36.1: = bound_method %int_1.loc14, %impl.elem0.loc14_36.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc14_36.1: = specific_function %Convert.bound.loc14_36.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc14_36.1: init %i32 = call %Convert.specific_fn.loc14_36.1(%int_1.loc14) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc14_36.2: init %i32 = converted %int_1.loc14, %int.convert_checked.loc14_36.1 [template = constants.%int_1.2] // CHECK:STDOUT: %tuple.elem0: ref %i32 = tuple_access %b.var, element0 // CHECK:STDOUT: %.loc14_36.3: init %i32 = initialize_from %.loc14_36.2 to %tuple.elem0 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc14_36.2: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc14_36.2: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc14_36.2: = bound_method %int_2.loc14, %impl.elem0.loc14_36.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc14_36.2: = specific_function %Convert.bound.loc14_36.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc14_36.2: init %i32 = call %Convert.specific_fn.loc14_36.2(%int_2.loc14) [template = constants.%int_2.2] // CHECK:STDOUT: %.loc14_36.4: init %i32 = converted %int_2.loc14, %int.convert_checked.loc14_36.2 [template = constants.%int_2.2] // CHECK:STDOUT: %tuple.elem1: ref %i32 = tuple_access %b.var, element1 // CHECK:STDOUT: %.loc14_36.5: init %i32 = initialize_from %.loc14_36.4 to %tuple.elem1 [template = constants.%int_2.2] -// CHECK:STDOUT: %impl.elem0.loc14_36.3: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc14_36.3: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc14_36.3: = bound_method %int_3.loc14, %impl.elem0.loc14_36.3 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc14_36.3: = specific_function %Convert.bound.loc14_36.3, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc14_36.3: init %i32 = call %Convert.specific_fn.loc14_36.3(%int_3.loc14) [template = constants.%int_3.2] diff --git a/toolchain/check/testdata/array/assign_return_value.carbon b/toolchain/check/testdata/array/assign_return_value.carbon index c58cc909019ff..c9e634d7e0aff 100644 --- a/toolchain/check/testdata/array/assign_return_value.carbon +++ b/toolchain/check/testdata/array/assign_return_value.carbon @@ -28,7 +28,7 @@ fn Run() { // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] @@ -73,7 +73,7 @@ fn Run() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %.loc11_30.1: %tuple.type.3 = tuple_literal (%int_0) -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.2] diff --git a/toolchain/check/testdata/array/assign_var.carbon b/toolchain/check/testdata/array/assign_var.carbon index 45857cf35f665..1fc27f9444a88 100644 --- a/toolchain/check/testdata/array/assign_var.carbon +++ b/toolchain/check/testdata/array/assign_var.carbon @@ -24,7 +24,7 @@ var b: [i32; 3] = a; // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -67,21 +67,21 @@ var b: [i32; 3] = a; // CHECK:STDOUT: %int_2.loc11: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] // CHECK:STDOUT: %.loc11_34.1: %tuple.type.3 = tuple_literal (%int_1.loc11, %int_2.loc11, %int_3) -// CHECK:STDOUT: %impl.elem0.loc11_34.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11_34.1: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_34.1: = bound_method %int_1.loc11, %impl.elem0.loc11_34.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc11_34.1: = specific_function %Convert.bound.loc11_34.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc11_34.1: init %i32 = call %Convert.specific_fn.loc11_34.1(%int_1.loc11) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc11_34.2: init %i32 = converted %int_1.loc11, %int.convert_checked.loc11_34.1 [template = constants.%int_1.2] // CHECK:STDOUT: %tuple.elem0.loc11: ref %i32 = tuple_access file.%a.var, element0 // CHECK:STDOUT: %.loc11_34.3: init %i32 = initialize_from %.loc11_34.2 to %tuple.elem0.loc11 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc11_34.2: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11_34.2: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_34.2: = bound_method %int_2.loc11, %impl.elem0.loc11_34.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc11_34.2: = specific_function %Convert.bound.loc11_34.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc11_34.2: init %i32 = call %Convert.specific_fn.loc11_34.2(%int_2.loc11) [template = constants.%int_2.2] // CHECK:STDOUT: %.loc11_34.4: init %i32 = converted %int_2.loc11, %int.convert_checked.loc11_34.2 [template = constants.%int_2.2] // CHECK:STDOUT: %tuple.elem1.loc11: ref %i32 = tuple_access file.%a.var, element1 // CHECK:STDOUT: %.loc11_34.5: init %i32 = initialize_from %.loc11_34.4 to %tuple.elem1.loc11 [template = constants.%int_2.2] -// CHECK:STDOUT: %impl.elem0.loc11_34.3: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11_34.3: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_34.3: = bound_method %int_3, %impl.elem0.loc11_34.3 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc11_34.3: = specific_function %Convert.bound.loc11_34.3, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc11_34.3: init %i32 = call %Convert.specific_fn.loc11_34.3(%int_3) [template = constants.%int_3.2] diff --git a/toolchain/check/testdata/array/base.carbon b/toolchain/check/testdata/array/base.carbon index 8db35a3d17227..f186bef623c60 100644 --- a/toolchain/check/testdata/array/base.carbon +++ b/toolchain/check/testdata/array/base.carbon @@ -25,7 +25,7 @@ var c: [(); 5] = ((), (), (), (), (),); // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -75,7 +75,7 @@ var c: [(); 5] = ((), (), (), (), (),); // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_1.loc11: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %.loc11_22.1: %tuple.type.1 = tuple_literal (%int_1.loc11) -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1.loc11, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_1.loc11) [template = constants.%int_1.2] diff --git a/toolchain/check/testdata/array/canonicalize_index.carbon b/toolchain/check/testdata/array/canonicalize_index.carbon index 3e1d3b1dc5184..d69cea13ec5a1 100644 --- a/toolchain/check/testdata/array/canonicalize_index.carbon +++ b/toolchain/check/testdata/array/canonicalize_index.carbon @@ -30,7 +30,7 @@ let c: [i32; ConvertToU32(3)]* = &a; // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -124,7 +124,7 @@ let c: [i32; ConvertToU32(3)]* = &a; // CHECK:STDOUT: %int_2.loc14_31: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3.2] // CHECK:STDOUT: %.loc14_35.1: %tuple.type = tuple_literal (%int_1.loc14_28, %int_2.loc14_31, %int_3) -// CHECK:STDOUT: %impl.elem0.loc14_35.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc14_35.1: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc14_35.1: = bound_method %int_1.loc14_28, %impl.elem0.loc14_35.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc14_35.1: = specific_function %Convert.bound.loc14_35.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc14_35.1: init %i32 = call %Convert.specific_fn.loc14_35.1(%int_1.loc14_28) [template = constants.%int_1.2] @@ -132,7 +132,7 @@ let c: [i32; ConvertToU32(3)]* = &a; // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0] // CHECK:STDOUT: %.loc14_35.3: ref %i32 = array_index file.%a.var, %int_0 // CHECK:STDOUT: %.loc14_35.4: init %i32 = initialize_from %.loc14_35.2 to %.loc14_35.3 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc14_35.2: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc14_35.2: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc14_35.2: = bound_method %int_2.loc14_31, %impl.elem0.loc14_35.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc14_35.2: = specific_function %Convert.bound.loc14_35.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc14_35.2: init %i32 = call %Convert.specific_fn.loc14_35.2(%int_2.loc14_31) [template = constants.%int_2.2] @@ -140,7 +140,7 @@ let c: [i32; ConvertToU32(3)]* = &a; // CHECK:STDOUT: %int_1.loc14_35: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %.loc14_35.6: ref %i32 = array_index file.%a.var, %int_1.loc14_35 // CHECK:STDOUT: %.loc14_35.7: init %i32 = initialize_from %.loc14_35.5 to %.loc14_35.6 [template = constants.%int_2.2] -// CHECK:STDOUT: %impl.elem0.loc14_35.3: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc14_35.3: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc14_35.3: = bound_method %int_3, %impl.elem0.loc14_35.3 [template = constants.%Convert.bound.4] // CHECK:STDOUT: %Convert.specific_fn.loc14_35.3: = specific_function %Convert.bound.loc14_35.3, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.4] // CHECK:STDOUT: %int.convert_checked.loc14_35.3: init %i32 = call %Convert.specific_fn.loc14_35.3(%int_3) [template = constants.%int_3.1] diff --git a/toolchain/check/testdata/array/fail_out_of_bound_non_literal.carbon b/toolchain/check/testdata/array/fail_out_of_bound_non_literal.carbon index 60d8cd1bfd8d0..a6f4856615326 100644 --- a/toolchain/check/testdata/array/fail_out_of_bound_non_literal.carbon +++ b/toolchain/check/testdata/array/fail_out_of_bound_non_literal.carbon @@ -28,7 +28,7 @@ var b: i32 = a[{.index = 3}.index]; // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -71,7 +71,7 @@ var b: i32 = a[{.index = 3}.index]; // CHECK:STDOUT: %int_2.loc11_23: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %int_3.loc11: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] // CHECK:STDOUT: %.loc11_27.1: %tuple.type = tuple_literal (%int_1.loc11_20, %int_2.loc11_23, %int_3.loc11) -// CHECK:STDOUT: %impl.elem0.loc11_27.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11_27.1: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_27.1: = bound_method %int_1.loc11_20, %impl.elem0.loc11_27.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc11_27.1: = specific_function %Convert.bound.loc11_27.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc11_27.1: init %i32 = call %Convert.specific_fn.loc11_27.1(%int_1.loc11_20) [template = constants.%int_1.2] @@ -79,7 +79,7 @@ var b: i32 = a[{.index = 3}.index]; // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0] // CHECK:STDOUT: %.loc11_27.3: ref %i32 = array_index file.%a.var, %int_0 // CHECK:STDOUT: %.loc11_27.4: init %i32 = initialize_from %.loc11_27.2 to %.loc11_27.3 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc11_27.2: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11_27.2: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_27.2: = bound_method %int_2.loc11_23, %impl.elem0.loc11_27.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc11_27.2: = specific_function %Convert.bound.loc11_27.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc11_27.2: init %i32 = call %Convert.specific_fn.loc11_27.2(%int_2.loc11_23) [template = constants.%int_2.2] @@ -87,7 +87,7 @@ var b: i32 = a[{.index = 3}.index]; // CHECK:STDOUT: %int_1.loc11_27: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %.loc11_27.6: ref %i32 = array_index file.%a.var, %int_1.loc11_27 // CHECK:STDOUT: %.loc11_27.7: init %i32 = initialize_from %.loc11_27.5 to %.loc11_27.6 [template = constants.%int_2.2] -// CHECK:STDOUT: %impl.elem0.loc11_27.3: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11_27.3: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_27.3: = bound_method %int_3.loc11, %impl.elem0.loc11_27.3 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc11_27.3: = specific_function %Convert.bound.loc11_27.3, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc11_27.3: init %i32 = call %Convert.specific_fn.loc11_27.3(%int_3.loc11) [template = constants.%int_3.2] @@ -106,7 +106,7 @@ var b: i32 = a[{.index = 3}.index]; // CHECK:STDOUT: %.loc15_28.1: Core.IntLiteral = struct_access %.loc15_27.2, element0 [template = constants.%int_3.1] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc15: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc15: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc15: = bound_method %.loc15_28.1, %impl.elem0.loc15 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc15: = specific_function %Convert.bound.loc15, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc15: init %i32 = call %Convert.specific_fn.loc15(%.loc15_28.1) [template = constants.%int_3.2] diff --git a/toolchain/check/testdata/array/fail_type_mismatch.carbon b/toolchain/check/testdata/array/fail_type_mismatch.carbon index 9f4537cbc912f..8b370b1b337ab 100644 --- a/toolchain/check/testdata/array/fail_type_mismatch.carbon +++ b/toolchain/check/testdata/array/fail_type_mismatch.carbon @@ -54,7 +54,7 @@ var d: [i32; 3] = t2; // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -104,7 +104,7 @@ var d: [i32; 3] = t2; // CHECK:STDOUT: %str.loc18_23: String = string_literal "Hello" [template = constants.%str.1] // CHECK:STDOUT: %str.loc18_32: String = string_literal "World" [template = constants.%str.2] // CHECK:STDOUT: %.loc18_39.1: %tuple.type.1 = tuple_literal (%int_1.loc18, %str.loc18_23, %str.loc18_32) -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1.loc18, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_1.loc18) [template = constants.%int_1.2] diff --git a/toolchain/check/testdata/array/function_param.carbon b/toolchain/check/testdata/array/function_param.carbon index 83fef56138da9..18a2f18cb790c 100644 --- a/toolchain/check/testdata/array/function_param.carbon +++ b/toolchain/check/testdata/array/function_param.carbon @@ -34,7 +34,7 @@ fn G() -> i32 { // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -121,7 +121,7 @@ fn G() -> i32 { // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] // CHECK:STDOUT: %.loc16_20.1: %tuple.type = tuple_literal (%int_1.loc16_13, %int_2.loc16_16, %int_3) // CHECK:STDOUT: %int_1.loc16_23: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc16_20.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc16_20.1: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc16_20.1: = bound_method %int_1.loc16_13, %impl.elem0.loc16_20.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc16_20.1: = specific_function %Convert.bound.loc16_20.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc16_20.1: init %i32 = call %Convert.specific_fn.loc16_20.1(%int_1.loc16_13) [template = constants.%int_1.2] @@ -130,7 +130,7 @@ fn G() -> i32 { // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0] // CHECK:STDOUT: %.loc16_20.4: ref %i32 = array_index %.loc16_20.3, %int_0 // CHECK:STDOUT: %.loc16_20.5: init %i32 = initialize_from %.loc16_20.2 to %.loc16_20.4 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc16_20.2: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc16_20.2: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc16_20.2: = bound_method %int_2.loc16_16, %impl.elem0.loc16_20.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc16_20.2: = specific_function %Convert.bound.loc16_20.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc16_20.2: init %i32 = call %Convert.specific_fn.loc16_20.2(%int_2.loc16_16) [template = constants.%int_2.2] @@ -138,7 +138,7 @@ fn G() -> i32 { // CHECK:STDOUT: %int_1.loc16_20: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %.loc16_20.7: ref %i32 = array_index %.loc16_20.3, %int_1.loc16_20 // CHECK:STDOUT: %.loc16_20.8: init %i32 = initialize_from %.loc16_20.6 to %.loc16_20.7 [template = constants.%int_2.2] -// CHECK:STDOUT: %impl.elem0.loc16_20.3: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc16_20.3: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc16_20.3: = bound_method %int_3, %impl.elem0.loc16_20.3 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc16_20.3: = specific_function %Convert.bound.loc16_20.3, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc16_20.3: init %i32 = call %Convert.specific_fn.loc16_20.3(%int_3) [template = constants.%int_3.2] @@ -150,7 +150,7 @@ fn G() -> i32 { // CHECK:STDOUT: %.loc16_20.13: init %array_type = converted %.loc16_20.1, %.loc16_20.12 [template = constants.%array] // CHECK:STDOUT: %.loc16_20.14: ref %array_type = temporary %.loc16_20.3, %.loc16_20.13 // CHECK:STDOUT: %.loc16_20.15: %array_type = bind_value %.loc16_20.14 -// CHECK:STDOUT: %impl.elem0.loc16_23: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc16_23: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc16_23: = bound_method %int_1.loc16_23, %impl.elem0.loc16_23 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc16_23: = specific_function %Convert.bound.loc16_23, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc16_23: init %i32 = call %Convert.specific_fn.loc16_23(%int_1.loc16_23) [template = constants.%int_1.2] diff --git a/toolchain/check/testdata/array/index_not_literal.carbon b/toolchain/check/testdata/array/index_not_literal.carbon index 53980489b320b..c411019a07a9e 100644 --- a/toolchain/check/testdata/array/index_not_literal.carbon +++ b/toolchain/check/testdata/array/index_not_literal.carbon @@ -25,7 +25,7 @@ var b: i32 = a[{.index = 2}.index]; // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -68,7 +68,7 @@ var b: i32 = a[{.index = 2}.index]; // CHECK:STDOUT: %int_2.loc11_23: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] // CHECK:STDOUT: %.loc11_27.1: %tuple.type = tuple_literal (%int_1.loc11_20, %int_2.loc11_23, %int_3) -// CHECK:STDOUT: %impl.elem0.loc11_27.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11_27.1: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_27.1: = bound_method %int_1.loc11_20, %impl.elem0.loc11_27.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc11_27.1: = specific_function %Convert.bound.loc11_27.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc11_27.1: init %i32 = call %Convert.specific_fn.loc11_27.1(%int_1.loc11_20) [template = constants.%int_1.2] @@ -76,7 +76,7 @@ var b: i32 = a[{.index = 2}.index]; // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0] // CHECK:STDOUT: %.loc11_27.3: ref %i32 = array_index file.%a.var, %int_0 // CHECK:STDOUT: %.loc11_27.4: init %i32 = initialize_from %.loc11_27.2 to %.loc11_27.3 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc11_27.2: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11_27.2: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_27.2: = bound_method %int_2.loc11_23, %impl.elem0.loc11_27.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc11_27.2: = specific_function %Convert.bound.loc11_27.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc11_27.2: init %i32 = call %Convert.specific_fn.loc11_27.2(%int_2.loc11_23) [template = constants.%int_2.2] @@ -84,7 +84,7 @@ var b: i32 = a[{.index = 2}.index]; // CHECK:STDOUT: %int_1.loc11_27: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %.loc11_27.6: ref %i32 = array_index file.%a.var, %int_1.loc11_27 // CHECK:STDOUT: %.loc11_27.7: init %i32 = initialize_from %.loc11_27.5 to %.loc11_27.6 [template = constants.%int_2.2] -// CHECK:STDOUT: %impl.elem0.loc11_27.3: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11_27.3: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_27.3: = bound_method %int_3, %impl.elem0.loc11_27.3 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc11_27.3: = specific_function %Convert.bound.loc11_27.3, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc11_27.3: init %i32 = call %Convert.specific_fn.loc11_27.3(%int_3) [template = constants.%int_3.2] @@ -103,7 +103,7 @@ var b: i32 = a[{.index = 2}.index]; // CHECK:STDOUT: %.loc12_28.1: Core.IntLiteral = struct_access %.loc12_27.2, element0 [template = constants.%int_2.1] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc12: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc12: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc12: = bound_method %.loc12_28.1, %impl.elem0.loc12 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc12: = specific_function %Convert.bound.loc12, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc12: init %i32 = call %Convert.specific_fn.loc12(%.loc12_28.1) [template = constants.%int_2.2] diff --git a/toolchain/check/testdata/array/nine_elements.carbon b/toolchain/check/testdata/array/nine_elements.carbon index 43aa7a1a5988b..469f2ca244eb2 100644 --- a/toolchain/check/testdata/array/nine_elements.carbon +++ b/toolchain/check/testdata/array/nine_elements.carbon @@ -30,7 +30,7 @@ var a: [i32; 9] = (1, 2, 3, 4, 5, 6, 7, 8, 9); // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -92,7 +92,7 @@ var a: [i32; 9] = (1, 2, 3, 4, 5, 6, 7, 8, 9); // CHECK:STDOUT: %int_8.loc11_41: Core.IntLiteral = int_value 8 [template = constants.%int_8.1] // CHECK:STDOUT: %int_9: Core.IntLiteral = int_value 9 [template = constants.%int_9.1] // CHECK:STDOUT: %.loc11_45.1: %tuple.type = tuple_literal (%int_1.loc11_20, %int_2.loc11_23, %int_3.loc11_26, %int_4.loc11_29, %int_5.loc11_32, %int_6.loc11_35, %int_7.loc11_38, %int_8.loc11_41, %int_9) -// CHECK:STDOUT: %impl.elem0.loc11_45.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11_45.1: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_45.1: = bound_method %int_1.loc11_20, %impl.elem0.loc11_45.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc11_45.1: = specific_function %Convert.bound.loc11_45.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc11_45.1: init %i32 = call %Convert.specific_fn.loc11_45.1(%int_1.loc11_20) [template = constants.%int_1.2] @@ -100,7 +100,7 @@ var a: [i32; 9] = (1, 2, 3, 4, 5, 6, 7, 8, 9); // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0] // CHECK:STDOUT: %.loc11_45.3: ref %i32 = array_index file.%a.var, %int_0 // CHECK:STDOUT: %.loc11_45.4: init %i32 = initialize_from %.loc11_45.2 to %.loc11_45.3 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc11_45.2: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11_45.2: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_45.2: = bound_method %int_2.loc11_23, %impl.elem0.loc11_45.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc11_45.2: = specific_function %Convert.bound.loc11_45.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc11_45.2: init %i32 = call %Convert.specific_fn.loc11_45.2(%int_2.loc11_23) [template = constants.%int_2.2] @@ -108,7 +108,7 @@ var a: [i32; 9] = (1, 2, 3, 4, 5, 6, 7, 8, 9); // CHECK:STDOUT: %int_1.loc11_45: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %.loc11_45.6: ref %i32 = array_index file.%a.var, %int_1.loc11_45 // CHECK:STDOUT: %.loc11_45.7: init %i32 = initialize_from %.loc11_45.5 to %.loc11_45.6 [template = constants.%int_2.2] -// CHECK:STDOUT: %impl.elem0.loc11_45.3: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11_45.3: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_45.3: = bound_method %int_3.loc11_26, %impl.elem0.loc11_45.3 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc11_45.3: = specific_function %Convert.bound.loc11_45.3, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc11_45.3: init %i32 = call %Convert.specific_fn.loc11_45.3(%int_3.loc11_26) [template = constants.%int_3.2] @@ -116,7 +116,7 @@ var a: [i32; 9] = (1, 2, 3, 4, 5, 6, 7, 8, 9); // CHECK:STDOUT: %int_2.loc11_45: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %.loc11_45.9: ref %i32 = array_index file.%a.var, %int_2.loc11_45 // CHECK:STDOUT: %.loc11_45.10: init %i32 = initialize_from %.loc11_45.8 to %.loc11_45.9 [template = constants.%int_3.2] -// CHECK:STDOUT: %impl.elem0.loc11_45.4: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11_45.4: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_45.4: = bound_method %int_4.loc11_29, %impl.elem0.loc11_45.4 [template = constants.%Convert.bound.4] // CHECK:STDOUT: %Convert.specific_fn.loc11_45.4: = specific_function %Convert.bound.loc11_45.4, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.4] // CHECK:STDOUT: %int.convert_checked.loc11_45.4: init %i32 = call %Convert.specific_fn.loc11_45.4(%int_4.loc11_29) [template = constants.%int_4.2] @@ -124,7 +124,7 @@ var a: [i32; 9] = (1, 2, 3, 4, 5, 6, 7, 8, 9); // CHECK:STDOUT: %int_3.loc11_45: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] // CHECK:STDOUT: %.loc11_45.12: ref %i32 = array_index file.%a.var, %int_3.loc11_45 // CHECK:STDOUT: %.loc11_45.13: init %i32 = initialize_from %.loc11_45.11 to %.loc11_45.12 [template = constants.%int_4.2] -// CHECK:STDOUT: %impl.elem0.loc11_45.5: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11_45.5: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_45.5: = bound_method %int_5.loc11_32, %impl.elem0.loc11_45.5 [template = constants.%Convert.bound.5] // CHECK:STDOUT: %Convert.specific_fn.loc11_45.5: = specific_function %Convert.bound.loc11_45.5, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.5] // CHECK:STDOUT: %int.convert_checked.loc11_45.5: init %i32 = call %Convert.specific_fn.loc11_45.5(%int_5.loc11_32) [template = constants.%int_5.2] @@ -132,7 +132,7 @@ var a: [i32; 9] = (1, 2, 3, 4, 5, 6, 7, 8, 9); // CHECK:STDOUT: %int_4.loc11_45: Core.IntLiteral = int_value 4 [template = constants.%int_4.1] // CHECK:STDOUT: %.loc11_45.15: ref %i32 = array_index file.%a.var, %int_4.loc11_45 // CHECK:STDOUT: %.loc11_45.16: init %i32 = initialize_from %.loc11_45.14 to %.loc11_45.15 [template = constants.%int_5.2] -// CHECK:STDOUT: %impl.elem0.loc11_45.6: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11_45.6: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_45.6: = bound_method %int_6.loc11_35, %impl.elem0.loc11_45.6 [template = constants.%Convert.bound.6] // CHECK:STDOUT: %Convert.specific_fn.loc11_45.6: = specific_function %Convert.bound.loc11_45.6, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.6] // CHECK:STDOUT: %int.convert_checked.loc11_45.6: init %i32 = call %Convert.specific_fn.loc11_45.6(%int_6.loc11_35) [template = constants.%int_6.2] @@ -140,7 +140,7 @@ var a: [i32; 9] = (1, 2, 3, 4, 5, 6, 7, 8, 9); // CHECK:STDOUT: %int_5.loc11_45: Core.IntLiteral = int_value 5 [template = constants.%int_5.1] // CHECK:STDOUT: %.loc11_45.18: ref %i32 = array_index file.%a.var, %int_5.loc11_45 // CHECK:STDOUT: %.loc11_45.19: init %i32 = initialize_from %.loc11_45.17 to %.loc11_45.18 [template = constants.%int_6.2] -// CHECK:STDOUT: %impl.elem0.loc11_45.7: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11_45.7: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_45.7: = bound_method %int_7.loc11_38, %impl.elem0.loc11_45.7 [template = constants.%Convert.bound.7] // CHECK:STDOUT: %Convert.specific_fn.loc11_45.7: = specific_function %Convert.bound.loc11_45.7, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.7] // CHECK:STDOUT: %int.convert_checked.loc11_45.7: init %i32 = call %Convert.specific_fn.loc11_45.7(%int_7.loc11_38) [template = constants.%int_7.2] @@ -148,7 +148,7 @@ var a: [i32; 9] = (1, 2, 3, 4, 5, 6, 7, 8, 9); // CHECK:STDOUT: %int_6.loc11_45: Core.IntLiteral = int_value 6 [template = constants.%int_6.1] // CHECK:STDOUT: %.loc11_45.21: ref %i32 = array_index file.%a.var, %int_6.loc11_45 // CHECK:STDOUT: %.loc11_45.22: init %i32 = initialize_from %.loc11_45.20 to %.loc11_45.21 [template = constants.%int_7.2] -// CHECK:STDOUT: %impl.elem0.loc11_45.8: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11_45.8: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_45.8: = bound_method %int_8.loc11_41, %impl.elem0.loc11_45.8 [template = constants.%Convert.bound.8] // CHECK:STDOUT: %Convert.specific_fn.loc11_45.8: = specific_function %Convert.bound.loc11_45.8, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.8] // CHECK:STDOUT: %int.convert_checked.loc11_45.8: init %i32 = call %Convert.specific_fn.loc11_45.8(%int_8.loc11_41) [template = constants.%int_8.2] @@ -156,7 +156,7 @@ var a: [i32; 9] = (1, 2, 3, 4, 5, 6, 7, 8, 9); // CHECK:STDOUT: %int_7.loc11_45: Core.IntLiteral = int_value 7 [template = constants.%int_7.1] // CHECK:STDOUT: %.loc11_45.24: ref %i32 = array_index file.%a.var, %int_7.loc11_45 // CHECK:STDOUT: %.loc11_45.25: init %i32 = initialize_from %.loc11_45.23 to %.loc11_45.24 [template = constants.%int_8.2] -// CHECK:STDOUT: %impl.elem0.loc11_45.9: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11_45.9: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_45.9: = bound_method %int_9, %impl.elem0.loc11_45.9 [template = constants.%Convert.bound.9] // CHECK:STDOUT: %Convert.specific_fn.loc11_45.9: = specific_function %Convert.bound.loc11_45.9, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.9] // CHECK:STDOUT: %int.convert_checked.loc11_45.9: init %i32 = call %Convert.specific_fn.loc11_45.9(%int_9) [template = constants.%int_9.2] diff --git a/toolchain/check/testdata/as/adapter_conversion.carbon b/toolchain/check/testdata/as/adapter_conversion.carbon index e36fcbcce4024..3bf811ac33f4a 100644 --- a/toolchain/check/testdata/as/adapter_conversion.carbon +++ b/toolchain/check/testdata/as/adapter_conversion.carbon @@ -122,7 +122,7 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -199,14 +199,14 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %.loc9_27.1: %struct_type.x.y.2 = struct_literal (%int_1, %int_2) -// CHECK:STDOUT: %impl.elem0.loc9_27.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc9_27.1: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc9_27.1: = bound_method %int_1, %impl.elem0.loc9_27.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc9_27.1: = specific_function %Convert.bound.loc9_27.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc9_27.1: init %i32 = call %Convert.specific_fn.loc9_27.1(%int_1) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc9_27.2: init %i32 = converted %int_1, %int.convert_checked.loc9_27.1 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc9_27.3: ref %i32 = class_element_access %return, element0 // CHECK:STDOUT: %.loc9_27.4: init %i32 = initialize_from %.loc9_27.2 to %.loc9_27.3 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc9_27.2: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc9_27.2: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc9_27.2: = bound_method %int_2, %impl.elem0.loc9_27.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc9_27.2: = specific_function %Convert.bound.loc9_27.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc9_27.2: init %i32 = call %Convert.specific_fn.loc9_27.2(%int_2) [template = constants.%int_2.2] @@ -223,14 +223,14 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %.loc17_31.1: %struct_type.x.y.2 = struct_literal (%int_1, %int_2) -// CHECK:STDOUT: %impl.elem0.loc17_31.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc17_31.1: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc17_31.1: = bound_method %int_1, %impl.elem0.loc17_31.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc17_31.1: = specific_function %Convert.bound.loc17_31.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc17_31.1: init %i32 = call %Convert.specific_fn.loc17_31.1(%int_1) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc17_31.2: init %i32 = converted %int_1, %int.convert_checked.loc17_31.1 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc17_31.3: ref %i32 = class_element_access file.%a_ref.var, element0 // CHECK:STDOUT: %.loc17_31.4: init %i32 = initialize_from %.loc17_31.2 to %.loc17_31.3 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc17_31.2: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc17_31.2: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc17_31.2: = bound_method %int_2, %impl.elem0.loc17_31.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc17_31.2: = specific_function %Convert.bound.loc17_31.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc17_31.2: init %i32 = call %Convert.specific_fn.loc17_31.2(%int_2) [template = constants.%int_2.2] @@ -277,7 +277,7 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @As(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.5, @impl.3(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.5(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -319,7 +319,7 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_32.loc8: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc8: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.5(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_1) [template = constants.%int_1.2] @@ -441,7 +441,7 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -503,7 +503,7 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: %int_2.loc13: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %.loc13_34.1: %struct_type.x.y.2 = struct_literal (%int_1.loc13, %int_2.loc13) // CHECK:STDOUT: %A.ref.loc13: type = name_ref A, file.%A.decl [template = constants.%A] -// CHECK:STDOUT: %impl.elem0.loc13_34.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc13_34.1: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc13_34.1: = bound_method %int_1.loc13, %impl.elem0.loc13_34.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc13_34.1: = specific_function %Convert.bound.loc13_34.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc13_34.1: init %i32 = call %Convert.specific_fn.loc13_34.1(%int_1.loc13) [template = constants.%int_1.2] @@ -511,7 +511,7 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: %.loc13_34.3: ref %A = temporary_storage // CHECK:STDOUT: %.loc13_34.4: ref %i32 = class_element_access %.loc13_34.3, element0 // CHECK:STDOUT: %.loc13_34.5: init %i32 = initialize_from %.loc13_34.2 to %.loc13_34.4 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc13_34.2: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc13_34.2: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc13_34.2: = bound_method %int_2.loc13, %impl.elem0.loc13_34.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc13_34.2: = specific_function %Convert.bound.loc13_34.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc13_34.2: init %i32 = call %Convert.specific_fn.loc13_34.2(%int_2.loc13) [template = constants.%int_2.2] @@ -530,7 +530,7 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: %int_2.loc24: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %.loc24_33.1: %struct_type.x.y.2 = struct_literal (%int_1.loc24, %int_2.loc24) // CHECK:STDOUT: %A.ref.loc24: type = name_ref A, file.%A.decl [template = constants.%A] -// CHECK:STDOUT: %impl.elem0.loc24_33.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc24_33.1: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc24_33.1: = bound_method %int_1.loc24, %impl.elem0.loc24_33.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc24_33.1: = specific_function %Convert.bound.loc24_33.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc24_33.1: init %i32 = call %Convert.specific_fn.loc24_33.1(%int_1.loc24) [template = constants.%int_1.2] @@ -538,7 +538,7 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: %.loc24_33.3: ref %A = temporary_storage // CHECK:STDOUT: %.loc24_33.4: ref %i32 = class_element_access %.loc24_33.3, element0 // CHECK:STDOUT: %.loc24_33.5: init %i32 = initialize_from %.loc24_33.2 to %.loc24_33.4 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc24_33.2: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc24_33.2: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc24_33.2: = bound_method %int_2.loc24, %impl.elem0.loc24_33.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc24_33.2: = specific_function %Convert.bound.loc24_33.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc24_33.2: init %i32 = call %Convert.specific_fn.loc24_33.2(%int_2.loc24) [template = constants.%int_2.2] diff --git a/toolchain/check/testdata/as/basic.carbon b/toolchain/check/testdata/as/basic.carbon index 7093353206ac9..7ed50cd414321 100644 --- a/toolchain/check/testdata/as/basic.carbon +++ b/toolchain/check/testdata/as/basic.carbon @@ -23,7 +23,7 @@ fn Main() -> i32 { // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @As(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.5, @impl.3(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.5(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -60,7 +60,7 @@ fn Main() -> i32 { // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_32.loc12: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc12: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.5(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_1) [template = constants.%int_1.2] diff --git a/toolchain/check/testdata/as/overloaded.carbon b/toolchain/check/testdata/as/overloaded.carbon index 3c8462ee80933..5fdce48601bbd 100644 --- a/toolchain/check/testdata/as/overloaded.carbon +++ b/toolchain/check/testdata/as/overloaded.carbon @@ -46,7 +46,7 @@ let n: i32 = ((4 as i32) as X) as i32; // CHECK:STDOUT: %int_4.1: Core.IntLiteral = int_value 4 [template] // CHECK:STDOUT: %Convert.type.13: type = fn_type @Convert.7, @impl.5(%int_32) [template] // CHECK:STDOUT: %Convert.13: %Convert.type.13 = struct_value () [template] -// CHECK:STDOUT: %interface.7: = interface_witness (%Convert.13) [template] +// CHECK:STDOUT: %interface.21: = interface_witness (%Convert.13) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_4.1, %Convert.13 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound.1, @Convert.7(%int_32) [template] // CHECK:STDOUT: %int_4.2: %i32 = int_value 4 [template] @@ -170,7 +170,7 @@ let n: i32 = ((4 as i32) as X) as i32; // CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [template = constants.%int_4.1] // CHECK:STDOUT: %int_32.loc23_21: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc23_21: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc23_18: %Convert.type.5 = interface_witness_access constants.%interface.7, element0 [template = constants.%Convert.13] +// CHECK:STDOUT: %impl.elem0.loc23_18: %Convert.type.5 = interface_witness_access constants.%interface.21, element0 [template = constants.%Convert.13] // CHECK:STDOUT: %Convert.bound.loc23_18: = bound_method %int_4, %impl.elem0.loc23_18 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound.loc23_18, @Convert.7(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_4) [template = constants.%int_4.2] diff --git a/toolchain/check/testdata/basics/builtin_types.carbon b/toolchain/check/testdata/basics/builtin_types.carbon index 1852151eacc37..a049b21d2cfcb 100644 --- a/toolchain/check/testdata/basics/builtin_types.carbon +++ b/toolchain/check/testdata/basics/builtin_types.carbon @@ -22,7 +22,7 @@ var test_type: type = i32; // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] @@ -60,7 +60,7 @@ var test_type: type = i32; // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.2] diff --git a/toolchain/check/testdata/basics/fail_numeric_literal_overflow.carbon b/toolchain/check/testdata/basics/fail_numeric_literal_overflow.carbon index 6a6d77d70900f..454ace1a461b8 100644 --- a/toolchain/check/testdata/basics/fail_numeric_literal_overflow.carbon +++ b/toolchain/check/testdata/basics/fail_numeric_literal_overflow.carbon @@ -46,7 +46,7 @@ let e: f64 = 5.0e39999999999999999993; // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_39999999999999999993.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_39999999999999999993.2: %i32 = int_value 39999999999999999993 [template] @@ -81,7 +81,7 @@ let e: f64 = 5.0e39999999999999999993; // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_39999999999999999993: Core.IntLiteral = int_value 39999999999999999993 [template = constants.%int_39999999999999999993.1] -// CHECK:STDOUT: %impl.elem0.loc15: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc15: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc15: = bound_method %int_39999999999999999993, %impl.elem0.loc15 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc15: = specific_function %Convert.bound.loc15, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc15: init %i32 = call %Convert.specific_fn.loc15(%int_39999999999999999993) [template = constants.%int_39999999999999999993.2] @@ -89,7 +89,7 @@ let e: f64 = 5.0e39999999999999999993; // CHECK:STDOUT: %.loc15_34.2: %i32 = converted %int_39999999999999999993, %.loc15_34.1 [template = constants.%int_39999999999999999993.2] // CHECK:STDOUT: %a: %i32 = bind_name a, %.loc15_34.2 // CHECK:STDOUT: %int_2147483648.loc21: Core.IntLiteral = int_value 2147483648 [template = constants.%int_2147483648.1] -// CHECK:STDOUT: %impl.elem0.loc21: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc21: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc21: = bound_method %int_2147483648.loc21, %impl.elem0.loc21 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc21: = specific_function %Convert.bound.loc21, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc21: init %i32 = call %Convert.specific_fn.loc21(%int_2147483648.loc21) [template = constants.%int_2147483648.2] @@ -97,7 +97,7 @@ let e: f64 = 5.0e39999999999999999993; // CHECK:STDOUT: %.loc21_27.2: %i32 = converted %int_2147483648.loc21, %.loc21_27.1 [template = constants.%int_2147483648.2] // CHECK:STDOUT: %b: %i32 = bind_name b, %.loc21_27.2 // CHECK:STDOUT: %int_2147483648.loc27: Core.IntLiteral = int_value 2147483648 [template = constants.%int_2147483648.1] -// CHECK:STDOUT: %impl.elem0.loc27: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc27: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc27: = bound_method %int_2147483648.loc27, %impl.elem0.loc27 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc27: = specific_function %Convert.bound.loc27, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc27: init %i32 = call %Convert.specific_fn.loc27(%int_2147483648.loc27) [template = constants.%int_2147483648.2] diff --git a/toolchain/check/testdata/basics/numeric_literals.carbon b/toolchain/check/testdata/basics/numeric_literals.carbon index 33bd20e9d21d6..90f6965dfedf3 100644 --- a/toolchain/check/testdata/basics/numeric_literals.carbon +++ b/toolchain/check/testdata/basics/numeric_literals.carbon @@ -46,7 +46,7 @@ fn F() { // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_8.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_8.2: %i32 = int_value 8 [template] @@ -103,7 +103,7 @@ fn F() { // CHECK:STDOUT: %int_2147483647.loc19: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] // CHECK:STDOUT: %int_2147483647.loc20: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] // CHECK:STDOUT: %.loc21_3.1: %tuple.type.1 = tuple_literal (%int_8.loc15, %int_9, %int_8.loc17, %int_8.loc18, %int_2147483647.loc19, %int_2147483647.loc20) -// CHECK:STDOUT: %impl.elem0.loc21_3.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc21_3.1: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc21_3.1: = bound_method %int_8.loc15, %impl.elem0.loc21_3.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc21_3.1: = specific_function %Convert.bound.loc21_3.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc21_3.1: init %i32 = call %Convert.specific_fn.loc21_3.1(%int_8.loc15) [template = constants.%int_8.2] @@ -111,7 +111,7 @@ fn F() { // CHECK:STDOUT: %int_0.loc21: Core.IntLiteral = int_value 0 [template = constants.%int_0] // CHECK:STDOUT: %.loc21_3.3: ref %i32 = array_index %ints.var, %int_0.loc21 // CHECK:STDOUT: %.loc21_3.4: init %i32 = initialize_from %.loc21_3.2 to %.loc21_3.3 [template = constants.%int_8.2] -// CHECK:STDOUT: %impl.elem0.loc21_3.2: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc21_3.2: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc21_3.2: = bound_method %int_9, %impl.elem0.loc21_3.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc21_3.2: = specific_function %Convert.bound.loc21_3.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc21_3.2: init %i32 = call %Convert.specific_fn.loc21_3.2(%int_9) [template = constants.%int_9.2] @@ -119,7 +119,7 @@ fn F() { // CHECK:STDOUT: %int_1.loc21: Core.IntLiteral = int_value 1 [template = constants.%int_1] // CHECK:STDOUT: %.loc21_3.6: ref %i32 = array_index %ints.var, %int_1.loc21 // CHECK:STDOUT: %.loc21_3.7: init %i32 = initialize_from %.loc21_3.5 to %.loc21_3.6 [template = constants.%int_9.2] -// CHECK:STDOUT: %impl.elem0.loc21_3.3: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc21_3.3: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc21_3.3: = bound_method %int_8.loc17, %impl.elem0.loc21_3.3 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc21_3.3: = specific_function %Convert.bound.loc21_3.3, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc21_3.3: init %i32 = call %Convert.specific_fn.loc21_3.3(%int_8.loc17) [template = constants.%int_8.2] @@ -127,7 +127,7 @@ fn F() { // CHECK:STDOUT: %int_2.loc21: Core.IntLiteral = int_value 2 [template = constants.%int_2] // CHECK:STDOUT: %.loc21_3.9: ref %i32 = array_index %ints.var, %int_2.loc21 // CHECK:STDOUT: %.loc21_3.10: init %i32 = initialize_from %.loc21_3.8 to %.loc21_3.9 [template = constants.%int_8.2] -// CHECK:STDOUT: %impl.elem0.loc21_3.4: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc21_3.4: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc21_3.4: = bound_method %int_8.loc18, %impl.elem0.loc21_3.4 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc21_3.4: = specific_function %Convert.bound.loc21_3.4, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc21_3.4: init %i32 = call %Convert.specific_fn.loc21_3.4(%int_8.loc18) [template = constants.%int_8.2] @@ -135,7 +135,7 @@ fn F() { // CHECK:STDOUT: %int_3.loc21: Core.IntLiteral = int_value 3 [template = constants.%int_3] // CHECK:STDOUT: %.loc21_3.12: ref %i32 = array_index %ints.var, %int_3.loc21 // CHECK:STDOUT: %.loc21_3.13: init %i32 = initialize_from %.loc21_3.11 to %.loc21_3.12 [template = constants.%int_8.2] -// CHECK:STDOUT: %impl.elem0.loc21_3.5: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc21_3.5: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc21_3.5: = bound_method %int_2147483647.loc19, %impl.elem0.loc21_3.5 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc21_3.5: = specific_function %Convert.bound.loc21_3.5, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc21_3.5: init %i32 = call %Convert.specific_fn.loc21_3.5(%int_2147483647.loc19) [template = constants.%int_2147483647.2] @@ -143,7 +143,7 @@ fn F() { // CHECK:STDOUT: %int_4.loc21: Core.IntLiteral = int_value 4 [template = constants.%int_4] // CHECK:STDOUT: %.loc21_3.15: ref %i32 = array_index %ints.var, %int_4.loc21 // CHECK:STDOUT: %.loc21_3.16: init %i32 = initialize_from %.loc21_3.14 to %.loc21_3.15 [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %impl.elem0.loc21_3.6: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc21_3.6: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc21_3.6: = bound_method %int_2147483647.loc20, %impl.elem0.loc21_3.6 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc21_3.6: = specific_function %Convert.bound.loc21_3.6, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc21_3.6: init %i32 = call %Convert.specific_fn.loc21_3.6(%int_2147483647.loc20) [template = constants.%int_2147483647.2] diff --git a/toolchain/check/testdata/basics/parens.carbon b/toolchain/check/testdata/basics/parens.carbon index 3823451af2ab1..a9fbd832629cf 100644 --- a/toolchain/check/testdata/basics/parens.carbon +++ b/toolchain/check/testdata/basics/parens.carbon @@ -20,7 +20,7 @@ var b: i32 = ((2)); // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -55,14 +55,14 @@ var b: i32 = ((2)); // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc11: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11: = bound_method %int_1, %impl.elem0.loc11 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc11: = specific_function %Convert.bound.loc11, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc11: init %i32 = call %Convert.specific_fn.loc11(%int_1) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc11: init %i32 = converted %int_1, %int.convert_checked.loc11 [template = constants.%int_1.2] // CHECK:STDOUT: assign file.%a.var, %.loc11 // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %impl.elem0.loc12: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc12: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc12: = bound_method %int_2, %impl.elem0.loc12 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc12: = specific_function %Convert.bound.loc12, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc12: init %i32 = call %Convert.specific_fn.loc12(%int_2) [template = constants.%int_2.2] diff --git a/toolchain/check/testdata/basics/run_i32.carbon b/toolchain/check/testdata/basics/run_i32.carbon index 4fce75b49abf2..bfa6a608f1361 100644 --- a/toolchain/check/testdata/basics/run_i32.carbon +++ b/toolchain/check/testdata/basics/run_i32.carbon @@ -21,7 +21,7 @@ fn Run() -> i32 { return 0; } // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] @@ -58,7 +58,7 @@ fn Run() -> i32 { return 0; } // CHECK:STDOUT: fn @Run() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.2] diff --git a/toolchain/check/testdata/builtins/float/make_type.carbon b/toolchain/check/testdata/builtins/float/make_type.carbon index 90ab08701326f..26b97383e7c95 100644 --- a/toolchain/check/testdata/builtins/float/make_type.carbon +++ b/toolchain/check/testdata/builtins/float/make_type.carbon @@ -165,7 +165,7 @@ var dyn: Float(dyn_size); // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32.1) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %int_64.1: Core.IntLiteral = int_value 64 [template] // CHECK:STDOUT: %Convert.bound.2: = bound_method %int_64.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32.1) [template] @@ -205,7 +205,7 @@ var dyn: Float(dyn_size); // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [template = constants.%int_64.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_64, %impl.elem0 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32.1) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_64) [template = constants.%int_64.2] diff --git a/toolchain/check/testdata/builtins/int/convert_checked.carbon b/toolchain/check/testdata/builtins/int/convert_checked.carbon index c3e3d09f7e27c..d9eea6d2db2d0 100644 --- a/toolchain/check/testdata/builtins/int/convert_checked.carbon +++ b/toolchain/check/testdata/builtins/int/convert_checked.carbon @@ -769,7 +769,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] @@ -876,7 +876,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Int32ToInt32.ref.loc5: %Int32ToInt32.type = name_ref Int32ToInt32, imports.%import_ref.5 [template = constants.%Int32ToInt32] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0.loc5: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc5: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc5: = bound_method %int_0, %impl.elem0.loc5 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc5: = specific_function %Convert.bound.loc5, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc5_27: init %i32 = call %Convert.specific_fn.loc5(%int_0) [template = constants.%int_0.2] @@ -888,7 +888,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %a: %i32 = bind_name a, %.loc5_29.2 // CHECK:STDOUT: %Int32ToInt32.ref.loc6: %Int32ToInt32.type = name_ref Int32ToInt32, imports.%import_ref.5 [template = constants.%Int32ToInt32] // CHECK:STDOUT: %int_2147483647.loc6: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] -// CHECK:STDOUT: %impl.elem0.loc6: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc6: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc6: = bound_method %int_2147483647.loc6, %impl.elem0.loc6 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc6: = specific_function %Convert.bound.loc6, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc6_27: init %i32 = call %Convert.specific_fn.loc6(%int_2147483647.loc6) [template = constants.%int_2147483647.2] @@ -902,7 +902,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %SubI32.ref: %SubI32.type = name_ref SubI32, imports.%import_ref.2 [template = constants.%SubI32] // CHECK:STDOUT: %NegateI32.ref.loc7: %NegateI32.type = name_ref NegateI32, imports.%import_ref.1 [template = constants.%NegateI32] // CHECK:STDOUT: %int_2147483647.loc7: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] -// CHECK:STDOUT: %impl.elem0.loc7_44: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc7_44: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc7_44: = bound_method %int_2147483647.loc7, %impl.elem0.loc7_44 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc7_44: = specific_function %Convert.bound.loc7_44, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc7_44: init %i32 = call %Convert.specific_fn.loc7_44(%int_2147483647.loc7) [template = constants.%int_2147483647.2] @@ -912,7 +912,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %int_1.loc7: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %.loc7_55.1: %i32 = value_of_initializer %int.snegate.loc7 [template = constants.%int_-2147483647] // CHECK:STDOUT: %.loc7_55.2: %i32 = converted %int.snegate.loc7, %.loc7_55.1 [template = constants.%int_-2147483647] -// CHECK:STDOUT: %impl.elem0.loc7_58: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc7_58: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc7_58: = bound_method %int_1.loc7, %impl.elem0.loc7_58 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc7_58: = specific_function %Convert.bound.loc7_58, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc7_58: init %i32 = call %Convert.specific_fn.loc7_58(%int_1.loc7) [template = constants.%int_1.2] @@ -929,7 +929,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %Int32ToIntLiteral.ref: %Int32ToIntLiteral.type = name_ref Int32ToIntLiteral, imports.%import_ref.20 [template = constants.%Int32ToIntLiteral] // CHECK:STDOUT: %NegateI32.ref.loc8: %NegateI32.type = name_ref NegateI32, imports.%import_ref.1 [template = constants.%NegateI32] // CHECK:STDOUT: %int_1.loc8: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc8: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc8: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc8: = bound_method %int_1.loc8, %impl.elem0.loc8 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc8: = specific_function %Convert.bound.loc8, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc8_74: init %i32 = call %Convert.specific_fn.loc8(%int_1.loc8) [template = constants.%int_1.2] @@ -960,7 +960,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_2147483647.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2147483647.2: %i32 = int_value 2147483647 [template] @@ -1039,7 +1039,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Int32ToUint32.ref.loc5: %Int32ToUint32.type = name_ref Int32ToUint32, imports.%import_ref.6 [template = constants.%Int32ToUint32] // CHECK:STDOUT: %int_2147483647.loc5: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] -// CHECK:STDOUT: %impl.elem0.loc5: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc5: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc5: = bound_method %int_2147483647.loc5, %impl.elem0.loc5 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn.loc5: = specific_function %Convert.bound.loc5, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc5_30: init %i32 = call %Convert.specific_fn.loc5(%int_2147483647.loc5) [template = constants.%int_2147483647.2] @@ -1052,7 +1052,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %Uint32ToInt32.ref: %Uint32ToInt32.type = name_ref Uint32ToInt32, imports.%import_ref.7 [template = constants.%Uint32ToInt32] // CHECK:STDOUT: %Int32ToUint32.ref.loc6: %Int32ToUint32.type = name_ref Int32ToUint32, imports.%import_ref.6 [template = constants.%Int32ToUint32] // CHECK:STDOUT: %int_2147483647.loc6: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] -// CHECK:STDOUT: %impl.elem0.loc6: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc6: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc6: = bound_method %int_2147483647.loc6, %impl.elem0.loc6 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn.loc6: = specific_function %Convert.bound.loc6, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc6_54: init %i32 = call %Convert.specific_fn.loc6(%int_2147483647.loc6) [template = constants.%int_2147483647.2] @@ -1081,7 +1081,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] @@ -1221,7 +1221,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Int32ToUint16.ref.loc5: %Int32ToUint16.type = name_ref Int32ToUint16, imports.%import_ref.11 [template = constants.%Int32ToUint16] // CHECK:STDOUT: %int_0.loc5: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0.loc5: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc5: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc5: = bound_method %int_0.loc5, %impl.elem0.loc5 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc5: = specific_function %Convert.bound.loc5, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc5_28: init %i32 = call %Convert.specific_fn.loc5(%int_0.loc5) [template = constants.%int_0.2] @@ -1233,7 +1233,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %a: %u16 = bind_name a, %.loc5_30.2 // CHECK:STDOUT: %Int32ToUint16.ref.loc6: %Int32ToUint16.type = name_ref Int32ToUint16, imports.%import_ref.11 [template = constants.%Int32ToUint16] // CHECK:STDOUT: %int_65535.loc6: Core.IntLiteral = int_value 65535 [template = constants.%int_65535.1] -// CHECK:STDOUT: %impl.elem0.loc6: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc6: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc6: = bound_method %int_65535.loc6, %impl.elem0.loc6 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc6: = specific_function %Convert.bound.loc6, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc6_28: init %i32 = call %Convert.specific_fn.loc6(%int_65535.loc6) [template = constants.%int_65535.2] @@ -1245,7 +1245,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %b: %u16 = bind_name b, %.loc6_35.2 // CHECK:STDOUT: %Int32ToInt16.ref.loc8: %Int32ToInt16.type = name_ref Int32ToInt16, imports.%import_ref.10 [template = constants.%Int32ToInt16] // CHECK:STDOUT: %int_32767.loc8: Core.IntLiteral = int_value 32767 [template = constants.%int_32767.1] -// CHECK:STDOUT: %impl.elem0.loc8: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc8: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc8: = bound_method %int_32767.loc8, %impl.elem0.loc8 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc8: = specific_function %Convert.bound.loc8, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc8_27: init %i32 = call %Convert.specific_fn.loc8(%int_32767.loc8) [template = constants.%int_32767.2] @@ -1258,7 +1258,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %Int32ToInt16.ref.loc9: %Int32ToInt16.type = name_ref Int32ToInt16, imports.%import_ref.10 [template = constants.%Int32ToInt16] // CHECK:STDOUT: %NegateI32.ref.loc9: %NegateI32.type = name_ref NegateI32, imports.%import_ref.1 [template = constants.%NegateI32] // CHECK:STDOUT: %int_32768.loc9: Core.IntLiteral = int_value 32768 [template = constants.%int_32768.1] -// CHECK:STDOUT: %impl.elem0.loc9: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc9: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc9: = bound_method %int_32768.loc9, %impl.elem0.loc9 [template = constants.%Convert.bound.4] // CHECK:STDOUT: %Convert.specific_fn.loc9: = specific_function %Convert.bound.loc9, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.4] // CHECK:STDOUT: %int.convert_checked.loc9_37: init %i32 = call %Convert.specific_fn.loc9(%int_32768.loc9) [template = constants.%int_32768.2] @@ -1274,7 +1274,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %Uint32ToUint16.ref.loc11: %Uint32ToUint16.type = name_ref Uint32ToUint16, imports.%import_ref.13 [template = constants.%Uint32ToUint16] // CHECK:STDOUT: %Int32ToUint32.ref.loc11: %Int32ToUint32.type = name_ref Int32ToUint32, imports.%import_ref.6 [template = constants.%Int32ToUint32] // CHECK:STDOUT: %int_0.loc11: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0.loc11: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11: = bound_method %int_0.loc11, %impl.elem0.loc11 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc11: = specific_function %Convert.bound.loc11, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc11_43: init %i32 = call %Convert.specific_fn.loc11(%int_0.loc11) [template = constants.%int_0.2] @@ -1290,7 +1290,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %Uint32ToUint16.ref.loc12: %Uint32ToUint16.type = name_ref Uint32ToUint16, imports.%import_ref.13 [template = constants.%Uint32ToUint16] // CHECK:STDOUT: %Int32ToUint32.ref.loc12: %Int32ToUint32.type = name_ref Int32ToUint32, imports.%import_ref.6 [template = constants.%Int32ToUint32] // CHECK:STDOUT: %int_65535.loc12: Core.IntLiteral = int_value 65535 [template = constants.%int_65535.1] -// CHECK:STDOUT: %impl.elem0.loc12: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc12: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc12: = bound_method %int_65535.loc12, %impl.elem0.loc12 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc12: = specific_function %Convert.bound.loc12, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc12_43: init %i32 = call %Convert.specific_fn.loc12(%int_65535.loc12) [template = constants.%int_65535.2] @@ -1306,7 +1306,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %Uint32ToInt16.ref.loc14: %Uint32ToInt16.type = name_ref Uint32ToInt16, imports.%import_ref.12 [template = constants.%Uint32ToInt16] // CHECK:STDOUT: %Int32ToUint32.ref.loc14: %Int32ToUint32.type = name_ref Int32ToUint32, imports.%import_ref.6 [template = constants.%Int32ToUint32] // CHECK:STDOUT: %int_0.loc14: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0.loc14: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc14: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc14: = bound_method %int_0.loc14, %impl.elem0.loc14 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc14: = specific_function %Convert.bound.loc14, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc14_42: init %i32 = call %Convert.specific_fn.loc14(%int_0.loc14) [template = constants.%int_0.2] @@ -1322,7 +1322,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %Uint32ToInt16.ref.loc15: %Uint32ToInt16.type = name_ref Uint32ToInt16, imports.%import_ref.12 [template = constants.%Uint32ToInt16] // CHECK:STDOUT: %Int32ToUint32.ref.loc15: %Int32ToUint32.type = name_ref Int32ToUint32, imports.%import_ref.6 [template = constants.%Int32ToUint32] // CHECK:STDOUT: %int_32767.loc15: Core.IntLiteral = int_value 32767 [template = constants.%int_32767.1] -// CHECK:STDOUT: %impl.elem0.loc15: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc15: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc15: = bound_method %int_32767.loc15, %impl.elem0.loc15 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc15: = specific_function %Convert.bound.loc15, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc15_42: init %i32 = call %Convert.specific_fn.loc15(%int_32767.loc15) [template = constants.%int_32767.2] @@ -1339,7 +1339,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %Int32ToIntLiteral.ref.loc17: %Int32ToIntLiteral.type = name_ref Int32ToIntLiteral, imports.%import_ref.20 [template = constants.%Int32ToIntLiteral] // CHECK:STDOUT: %NegateI32.ref.loc17: %NegateI32.type = name_ref NegateI32, imports.%import_ref.1 [template = constants.%NegateI32] // CHECK:STDOUT: %int_32768.loc17: Core.IntLiteral = int_value 32768 [template = constants.%int_32768.1] -// CHECK:STDOUT: %impl.elem0.loc17: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc17: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc17: = bound_method %int_32768.loc17, %impl.elem0.loc17 [template = constants.%Convert.bound.4] // CHECK:STDOUT: %Convert.specific_fn.loc17: = specific_function %Convert.bound.loc17, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.4] // CHECK:STDOUT: %int.convert_checked.loc17_70: init %i32 = call %Convert.specific_fn.loc17(%int_32768.loc17) [template = constants.%int_32768.2] @@ -1358,7 +1358,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %IntLiteralToInt16.ref.loc18: %IntLiteralToInt16.type = name_ref IntLiteralToInt16, imports.%import_ref.14 [template = constants.%IntLiteralToInt16] // CHECK:STDOUT: %Int32ToIntLiteral.ref.loc18: %Int32ToIntLiteral.type = name_ref Int32ToIntLiteral, imports.%import_ref.20 [template = constants.%Int32ToIntLiteral] // CHECK:STDOUT: %int_32767.loc18: Core.IntLiteral = int_value 32767 [template = constants.%int_32767.1] -// CHECK:STDOUT: %impl.elem0.loc18: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc18: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc18: = bound_method %int_32767.loc18, %impl.elem0.loc18 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc18: = specific_function %Convert.bound.loc18, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc18_60: init %i32 = call %Convert.specific_fn.loc18(%int_32767.loc18) [template = constants.%int_32767.2] @@ -1374,7 +1374,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %IntLiteralToUint16.ref.loc20: %IntLiteralToUint16.type = name_ref IntLiteralToUint16, imports.%import_ref.15 [template = constants.%IntLiteralToUint16] // CHECK:STDOUT: %Int32ToIntLiteral.ref.loc20: %Int32ToIntLiteral.type = name_ref Int32ToIntLiteral, imports.%import_ref.20 [template = constants.%Int32ToIntLiteral] // CHECK:STDOUT: %int_0.loc20: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0.loc20: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc20: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc20: = bound_method %int_0.loc20, %impl.elem0.loc20 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc20: = specific_function %Convert.bound.loc20, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc20_61: init %i32 = call %Convert.specific_fn.loc20(%int_0.loc20) [template = constants.%int_0.2] @@ -1390,7 +1390,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %IntLiteralToUint16.ref.loc21: %IntLiteralToUint16.type = name_ref IntLiteralToUint16, imports.%import_ref.15 [template = constants.%IntLiteralToUint16] // CHECK:STDOUT: %Int32ToIntLiteral.ref.loc21: %Int32ToIntLiteral.type = name_ref Int32ToIntLiteral, imports.%import_ref.20 [template = constants.%Int32ToIntLiteral] // CHECK:STDOUT: %int_65535.loc21: Core.IntLiteral = int_value 65535 [template = constants.%int_65535.1] -// CHECK:STDOUT: %impl.elem0.loc21: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc21: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc21: = bound_method %int_65535.loc21, %impl.elem0.loc21 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc21: = specific_function %Convert.bound.loc21, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc21_61: init %i32 = call %Convert.specific_fn.loc21(%int_65535.loc21) [template = constants.%int_65535.2] @@ -1422,7 +1422,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] @@ -1527,7 +1527,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %Uint32ToUint64.ref.loc5: %Uint32ToUint64.type = name_ref Uint32ToUint64, imports.%import_ref.19 [template = constants.%Uint32ToUint64] // CHECK:STDOUT: %Int32ToUint32.ref.loc5: %Int32ToUint32.type = name_ref Int32ToUint32, imports.%import_ref.6 [template = constants.%Int32ToUint32] // CHECK:STDOUT: %int_0.loc5: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0.loc5: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc5: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc5: = bound_method %int_0.loc5, %impl.elem0.loc5 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc5: = specific_function %Convert.bound.loc5, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc5_43: init %i32 = call %Convert.specific_fn.loc5(%int_0.loc5) [template = constants.%int_0.2] @@ -1545,7 +1545,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %AddU32.ref.loc8: %AddU32.type = name_ref AddU32, imports.%import_ref.3 [template = constants.%AddU32] // CHECK:STDOUT: %Int32ToUint32.ref.loc8_12: %Int32ToUint32.type = name_ref Int32ToUint32, imports.%import_ref.6 [template = constants.%Int32ToUint32] // CHECK:STDOUT: %int_2147483647.loc8_26: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] -// CHECK:STDOUT: %impl.elem0.loc8_26: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc8_26: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc8_26: = bound_method %int_2147483647.loc8_26, %impl.elem0.loc8_26 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc8_26: = specific_function %Convert.bound.loc8_26, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc8_26: init %i32 = call %Convert.specific_fn.loc8_26(%int_2147483647.loc8_26) [template = constants.%int_2147483647.2] @@ -1554,7 +1554,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %int.convert_checked.loc8_37: init %u32 = call %Int32ToUint32.ref.loc8_12(%.loc8_26.2) [template = constants.%int_2147483647.3] // CHECK:STDOUT: %Int32ToUint32.ref.loc8_40: %Int32ToUint32.type = name_ref Int32ToUint32, imports.%import_ref.6 [template = constants.%Int32ToUint32] // CHECK:STDOUT: %int_2147483647.loc8_54: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] -// CHECK:STDOUT: %impl.elem0.loc8_54: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc8_54: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc8_54: = bound_method %int_2147483647.loc8_54, %impl.elem0.loc8_54 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc8_54: = specific_function %Convert.bound.loc8_54, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc8_54: init %i32 = call %Convert.specific_fn.loc8_54(%int_2147483647.loc8_54) [template = constants.%int_2147483647.2] @@ -1568,7 +1568,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %int.uadd.loc8: init %u32 = call %AddU32.ref.loc8(%.loc8_37.2, %.loc8_65.2) [template = constants.%int_4294967294] // CHECK:STDOUT: %Int32ToUint32.ref.loc9: %Int32ToUint32.type = name_ref Int32ToUint32, imports.%import_ref.6 [template = constants.%Int32ToUint32] // CHECK:STDOUT: %int_1.loc9: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc9: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc9: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc9: = bound_method %int_1.loc9, %impl.elem0.loc9 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc9: = specific_function %Convert.bound.loc9, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc9_19: init %i32 = call %Convert.specific_fn.loc9(%int_1.loc9) [template = constants.%int_1.2] @@ -1589,7 +1589,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %Uint32ToInt64.ref.loc11: %Uint32ToInt64.type = name_ref Uint32ToInt64, imports.%import_ref.18 [template = constants.%Uint32ToInt64] // CHECK:STDOUT: %Int32ToUint32.ref.loc11: %Int32ToUint32.type = name_ref Int32ToUint32, imports.%import_ref.6 [template = constants.%Int32ToUint32] // CHECK:STDOUT: %int_0.loc11: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0.loc11: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11: = bound_method %int_0.loc11, %impl.elem0.loc11 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc11: = specific_function %Convert.bound.loc11, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc11_42: init %i32 = call %Convert.specific_fn.loc11(%int_0.loc11) [template = constants.%int_0.2] @@ -1607,7 +1607,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %AddU32.ref.loc14: %AddU32.type = name_ref AddU32, imports.%import_ref.3 [template = constants.%AddU32] // CHECK:STDOUT: %Int32ToUint32.ref.loc14_12: %Int32ToUint32.type = name_ref Int32ToUint32, imports.%import_ref.6 [template = constants.%Int32ToUint32] // CHECK:STDOUT: %int_2147483647.loc14_26: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] -// CHECK:STDOUT: %impl.elem0.loc14_26: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc14_26: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc14_26: = bound_method %int_2147483647.loc14_26, %impl.elem0.loc14_26 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc14_26: = specific_function %Convert.bound.loc14_26, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc14_26: init %i32 = call %Convert.specific_fn.loc14_26(%int_2147483647.loc14_26) [template = constants.%int_2147483647.2] @@ -1616,7 +1616,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %int.convert_checked.loc14_37: init %u32 = call %Int32ToUint32.ref.loc14_12(%.loc14_26.2) [template = constants.%int_2147483647.3] // CHECK:STDOUT: %Int32ToUint32.ref.loc14_40: %Int32ToUint32.type = name_ref Int32ToUint32, imports.%import_ref.6 [template = constants.%Int32ToUint32] // CHECK:STDOUT: %int_2147483647.loc14_54: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] -// CHECK:STDOUT: %impl.elem0.loc14_54: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc14_54: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc14_54: = bound_method %int_2147483647.loc14_54, %impl.elem0.loc14_54 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc14_54: = specific_function %Convert.bound.loc14_54, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc14_54: init %i32 = call %Convert.specific_fn.loc14_54(%int_2147483647.loc14_54) [template = constants.%int_2147483647.2] @@ -1630,7 +1630,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %int.uadd.loc14: init %u32 = call %AddU32.ref.loc14(%.loc14_37.2, %.loc14_65.2) [template = constants.%int_4294967294] // CHECK:STDOUT: %Int32ToUint32.ref.loc15: %Int32ToUint32.type = name_ref Int32ToUint32, imports.%import_ref.6 [template = constants.%Int32ToUint32] // CHECK:STDOUT: %int_1.loc15: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc15: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc15: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc15: = bound_method %int_1.loc15, %impl.elem0.loc15 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc15: = specific_function %Convert.bound.loc15, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc15_19: init %i32 = call %Convert.specific_fn.loc15(%int_1.loc15) [template = constants.%int_1.2] @@ -1664,7 +1664,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] @@ -1767,7 +1767,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Int32ToUint64.ref.loc5: %Int32ToUint64.type = name_ref Int32ToUint64, imports.%import_ref.17 [template = constants.%Int32ToUint64] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0.loc5: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc5: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc5: = bound_method %int_0, %impl.elem0.loc5 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc5: = specific_function %Convert.bound.loc5, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc5_28: init %i32 = call %Convert.specific_fn.loc5(%int_0) [template = constants.%int_0.2] @@ -1779,7 +1779,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %a: %u64 = bind_name a, %.loc5_30.2 // CHECK:STDOUT: %Int32ToUint64.ref.loc6: %Int32ToUint64.type = name_ref Int32ToUint64, imports.%import_ref.17 [template = constants.%Int32ToUint64] // CHECK:STDOUT: %int_2147483647.loc6: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] -// CHECK:STDOUT: %impl.elem0.loc6: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc6: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc6: = bound_method %int_2147483647.loc6, %impl.elem0.loc6 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc6: = specific_function %Convert.bound.loc6, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc6_28: init %i32 = call %Convert.specific_fn.loc6(%int_2147483647.loc6) [template = constants.%int_2147483647.2] @@ -1793,7 +1793,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %SubI32.ref: %SubI32.type = name_ref SubI32, imports.%import_ref.2 [template = constants.%SubI32] // CHECK:STDOUT: %NegateI32.ref: %NegateI32.type = name_ref NegateI32, imports.%import_ref.1 [template = constants.%NegateI32] // CHECK:STDOUT: %int_2147483647.loc8: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] -// CHECK:STDOUT: %impl.elem0.loc8_44: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc8_44: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc8_44: = bound_method %int_2147483647.loc8, %impl.elem0.loc8_44 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc8_44: = specific_function %Convert.bound.loc8_44, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc8_44: init %i32 = call %Convert.specific_fn.loc8_44(%int_2147483647.loc8) [template = constants.%int_2147483647.2] @@ -1803,7 +1803,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %.loc8_55.1: %i32 = value_of_initializer %int.snegate [template = constants.%int_-2147483647] // CHECK:STDOUT: %.loc8_55.2: %i32 = converted %int.snegate, %.loc8_55.1 [template = constants.%int_-2147483647] -// CHECK:STDOUT: %impl.elem0.loc8_58: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc8_58: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc8_58: = bound_method %int_1, %impl.elem0.loc8_58 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc8_58: = specific_function %Convert.bound.loc8_58, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc8_58: init %i32 = call %Convert.specific_fn.loc8_58(%int_1) [template = constants.%int_1.2] @@ -1818,7 +1818,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %c: %i64 = bind_name c, %.loc8_61.2 // CHECK:STDOUT: %Int32ToInt64.ref.loc9: %Int32ToInt64.type = name_ref Int32ToInt64, imports.%import_ref.16 [template = constants.%Int32ToInt64] // CHECK:STDOUT: %int_2147483647.loc9: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] -// CHECK:STDOUT: %impl.elem0.loc9: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc9: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc9: = bound_method %int_2147483647.loc9, %impl.elem0.loc9 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc9: = specific_function %Convert.bound.loc9, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc9_27: init %i32 = call %Convert.specific_fn.loc9(%int_2147483647.loc9) [template = constants.%int_2147483647.2] @@ -1847,7 +1847,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_2147483647.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2147483647.2: %i32 = int_value 2147483647 [template] @@ -1933,7 +1933,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %AddU32.ref: %AddU32.type = name_ref AddU32, imports.%import_ref.3 [template = constants.%AddU32] // CHECK:STDOUT: %Int32ToUint32.ref.loc11: %Int32ToUint32.type = name_ref Int32ToUint32, imports.%import_ref.6 [template = constants.%Int32ToUint32] // CHECK:STDOUT: %int_2147483647: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] -// CHECK:STDOUT: %impl.elem0.loc11: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11: = bound_method %int_2147483647, %impl.elem0.loc11 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc11: = specific_function %Convert.bound.loc11, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc11_26: init %i32 = call %Convert.specific_fn.loc11(%int_2147483647) [template = constants.%int_2147483647.2] @@ -1942,7 +1942,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %int.convert_checked.loc11_37: init %u32 = call %Int32ToUint32.ref.loc11(%.loc11_26.2) [template = constants.%int_2147483647.3] // CHECK:STDOUT: %Int32ToUint32.ref.loc12: %Int32ToUint32.type = name_ref Int32ToUint32, imports.%import_ref.6 [template = constants.%Int32ToUint32] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc12: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc12: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc12: = bound_method %int_1, %impl.elem0.loc12 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc12: = specific_function %Convert.bound.loc12, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc12_26: init %i32 = call %Convert.specific_fn.loc12(%int_1) [template = constants.%int_1.2] @@ -1976,7 +1976,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_32768.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_32768.2: %i32 = int_value 32768 [template] @@ -2049,7 +2049,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Int32ToInt16.ref: %Int32ToInt16.type = name_ref Int32ToInt16, imports.%import_ref.10 [template = constants.%Int32ToInt16] // CHECK:STDOUT: %int_32768: Core.IntLiteral = int_value 32768 [template = constants.%int_32768.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_32768, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc9_38: init %i32 = call %Convert.specific_fn(%int_32768) [template = constants.%int_32768.2] @@ -2075,7 +2075,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_65536.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_65536.2: %i32 = int_value 65536 [template] @@ -2148,7 +2148,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Int32ToUint16.ref: %Int32ToUint16.type = name_ref Int32ToUint16, imports.%import_ref.11 [template = constants.%Int32ToUint16] // CHECK:STDOUT: %int_65536: Core.IntLiteral = int_value 65536 [template = constants.%int_65536.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_65536, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc9_39: init %i32 = call %Convert.specific_fn(%int_65536) [template = constants.%int_65536.2] @@ -2177,7 +2177,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_32768.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_32768.2: %i32 = int_value 32768 [template] @@ -2254,7 +2254,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %Uint32ToInt16.ref: %Uint32ToInt16.type = name_ref Uint32ToInt16, imports.%import_ref.12 [template = constants.%Uint32ToInt16] // CHECK:STDOUT: %Int32ToUint32.ref: %Int32ToUint32.type = name_ref Int32ToUint32, imports.%import_ref.6 [template = constants.%Int32ToUint32] // CHECK:STDOUT: %int_32768: Core.IntLiteral = int_value 32768 [template = constants.%int_32768.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_32768, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc9_53: init %i32 = call %Convert.specific_fn(%int_32768) [template = constants.%int_32768.2] @@ -2286,7 +2286,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_65536.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_65536.2: %i32 = int_value 65536 [template] @@ -2363,7 +2363,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %Uint32ToUint16.ref: %Uint32ToUint16.type = name_ref Uint32ToUint16, imports.%import_ref.13 [template = constants.%Uint32ToUint16] // CHECK:STDOUT: %Int32ToUint32.ref: %Int32ToUint32.type = name_ref Int32ToUint32, imports.%import_ref.6 [template = constants.%Int32ToUint32] // CHECK:STDOUT: %int_65536: Core.IntLiteral = int_value 65536 [template = constants.%int_65536.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_65536, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc9_54: init %i32 = call %Convert.specific_fn(%int_65536) [template = constants.%int_65536.2] @@ -2395,7 +2395,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] @@ -2476,13 +2476,13 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %SubI32.ref: %SubI32.type = name_ref SubI32, imports.%import_ref.2 [template = constants.%SubI32] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc9_50: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc9_50: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc9_50: = bound_method %int_0, %impl.elem0.loc9_50 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc9_50: = specific_function %Convert.bound.loc9_50, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc9_50: init %i32 = call %Convert.specific_fn.loc9_50(%int_0) [template = constants.%int_0.2] // CHECK:STDOUT: %.loc9_50.1: %i32 = value_of_initializer %int.convert_checked.loc9_50 [template = constants.%int_0.2] // CHECK:STDOUT: %.loc9_50.2: %i32 = converted %int_0, %.loc9_50.1 [template = constants.%int_0.2] -// CHECK:STDOUT: %impl.elem0.loc9_53: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc9_53: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc9_53: = bound_method %int_1, %impl.elem0.loc9_53 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc9_53: = specific_function %Convert.bound.loc9_53, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc9_53: init %i32 = call %Convert.specific_fn.loc9_53(%int_1) [template = constants.%int_1.2] @@ -2513,7 +2513,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] @@ -2594,13 +2594,13 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %SubI32.ref: %SubI32.type = name_ref SubI32, imports.%import_ref.2 [template = constants.%SubI32] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc9_50: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc9_50: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc9_50: = bound_method %int_0, %impl.elem0.loc9_50 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc9_50: = specific_function %Convert.bound.loc9_50, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc9_50: init %i32 = call %Convert.specific_fn.loc9_50(%int_0) [template = constants.%int_0.2] // CHECK:STDOUT: %.loc9_50.1: %i32 = value_of_initializer %int.convert_checked.loc9_50 [template = constants.%int_0.2] // CHECK:STDOUT: %.loc9_50.2: %i32 = converted %int_0, %.loc9_50.1 [template = constants.%int_0.2] -// CHECK:STDOUT: %impl.elem0.loc9_53: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc9_53: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc9_53: = bound_method %int_1, %impl.elem0.loc9_53 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc9_53: = specific_function %Convert.bound.loc9_53, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc9_53: init %i32 = call %Convert.specific_fn.loc9_53(%int_1) [template = constants.%int_1.2] @@ -2632,7 +2632,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] @@ -2713,13 +2713,13 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %SubI32.ref: %SubI32.type = name_ref SubI32, imports.%import_ref.2 [template = constants.%SubI32] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc9_50: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc9_50: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc9_50: = bound_method %int_0, %impl.elem0.loc9_50 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc9_50: = specific_function %Convert.bound.loc9_50, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc9_50: init %i32 = call %Convert.specific_fn.loc9_50(%int_0) [template = constants.%int_0.2] // CHECK:STDOUT: %.loc9_50.1: %i32 = value_of_initializer %int.convert_checked.loc9_50 [template = constants.%int_0.2] // CHECK:STDOUT: %.loc9_50.2: %i32 = converted %int_0, %.loc9_50.1 [template = constants.%int_0.2] -// CHECK:STDOUT: %impl.elem0.loc9_53: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc9_53: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc9_53: = bound_method %int_1, %impl.elem0.loc9_53 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc9_53: = specific_function %Convert.bound.loc9_53, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc9_53: init %i32 = call %Convert.specific_fn.loc9_53(%int_1) [template = constants.%int_1.2] @@ -2750,7 +2750,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_32769.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_32769.2: %i32 = int_value 32769 [template] @@ -2827,7 +2827,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %Int32ToInt16.ref: %Int32ToInt16.type = name_ref Int32ToInt16, imports.%import_ref.10 [template = constants.%Int32ToInt16] // CHECK:STDOUT: %NegateI32.ref: %NegateI32.type = name_ref NegateI32, imports.%import_ref.1 [template = constants.%NegateI32] // CHECK:STDOUT: %int_32769: Core.IntLiteral = int_value 32769 [template = constants.%int_32769.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_32769, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc9_49: init %i32 = call %Convert.specific_fn(%int_32769) [template = constants.%int_32769.2] @@ -2852,7 +2852,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] @@ -2940,7 +2940,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc5: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.2] diff --git a/toolchain/check/testdata/builtins/int/eq.carbon b/toolchain/check/testdata/builtins/int/eq.carbon index d01ff9aba5827..88ec32a2a1d81 100644 --- a/toolchain/check/testdata/builtins/int/eq.carbon +++ b/toolchain/check/testdata/builtins/int/eq.carbon @@ -52,7 +52,7 @@ fn WrongResult(a: i32, b: i32) -> i32 = "int.eq"; // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -179,13 +179,13 @@ fn WrongResult(a: i32, b: i32) -> i32 = "int.eq"; // CHECK:STDOUT: %Eq.ref.loc8: %Eq.type.1 = name_ref Eq, file.%Eq.decl [template = constants.%Eq] // CHECK:STDOUT: %int_1.loc8_19: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_1.loc8_22: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc8_19: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc8_19: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc8_19: = bound_method %int_1.loc8_19, %impl.elem0.loc8_19 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc8_19: = specific_function %Convert.bound.loc8_19, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc8_19: init %i32 = call %Convert.specific_fn.loc8_19(%int_1.loc8_19) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc8_19.1: %i32 = value_of_initializer %int.convert_checked.loc8_19 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc8_19.2: %i32 = converted %int_1.loc8_19, %.loc8_19.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc8_22: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc8_22: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc8_22: = bound_method %int_1.loc8_22, %impl.elem0.loc8_22 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc8_22: = specific_function %Convert.bound.loc8_22, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc8_22: init %i32 = call %Convert.specific_fn.loc8_22(%int_1.loc8_22) [template = constants.%int_1.2] @@ -210,13 +210,13 @@ fn WrongResult(a: i32, b: i32) -> i32 = "int.eq"; // CHECK:STDOUT: %Eq.ref.loc9: %Eq.type.1 = name_ref Eq, file.%Eq.decl [template = constants.%Eq] // CHECK:STDOUT: %int_1.loc9: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %impl.elem0.loc9_20: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc9_20: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc9_20: = bound_method %int_1.loc9, %impl.elem0.loc9_20 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc9_20: = specific_function %Convert.bound.loc9_20, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc9_20: init %i32 = call %Convert.specific_fn.loc9_20(%int_1.loc9) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc9_20.1: %i32 = value_of_initializer %int.convert_checked.loc9_20 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc9_20.2: %i32 = converted %int_1.loc9, %.loc9_20.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc9_23: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc9_23: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc9_23: = bound_method %int_2, %impl.elem0.loc9_23 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc9_23: = specific_function %Convert.bound.loc9_23, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc9_23: init %i32 = call %Convert.specific_fn.loc9_23(%int_2) [template = constants.%int_2.2] diff --git a/toolchain/check/testdata/builtins/int/greater.carbon b/toolchain/check/testdata/builtins/int/greater.carbon index 73a4d4ec2d71d..679fa7f939e15 100644 --- a/toolchain/check/testdata/builtins/int/greater.carbon +++ b/toolchain/check/testdata/builtins/int/greater.carbon @@ -35,8 +35,8 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %Bool.type: type = fn_type @Bool [template] // CHECK:STDOUT: %Bool: %Bool.type = struct_value () [template] -// CHECK:STDOUT: %Greater.type: type = fn_type @Greater [template] -// CHECK:STDOUT: %Greater: %Greater.type = struct_value () [template] +// CHECK:STDOUT: %Greater.type.1: type = fn_type @Greater.1 [template] +// CHECK:STDOUT: %Greater.1: %Greater.type.1 = struct_value () [template] // CHECK:STDOUT: %Negate.type.1: type = fn_type @Negate.1 [template] // CHECK:STDOUT: %Negate: %Negate.type.1 = struct_value () [template] // CHECK:STDOUT: %True: type = class_type @True [template] @@ -50,7 +50,7 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -89,7 +89,7 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Greater.decl: %Greater.type = fn_decl @Greater [template = constants.%Greater] { +// CHECK:STDOUT: %Greater.decl: %Greater.type.1 = fn_decl @Greater.1 [template = constants.%Greater.1] { // CHECK:STDOUT: %a.patt: %i32 = binding_pattern a // CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: %i32 = binding_pattern b @@ -191,23 +191,23 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Greater(%a.param_patt: %i32, %b.param_patt: %i32) -> bool = "int.greater"; +// CHECK:STDOUT: fn @Greater.1(%a.param_patt: %i32, %b.param_patt: %i32) -> bool = "int.greater"; // CHECK:STDOUT: // CHECK:STDOUT: fn @Negate.1(%a.param_patt: %i32) -> %i32 = "int.snegate"; // CHECK:STDOUT: // CHECK:STDOUT: fn @F(%true_.param_patt: %True, %false_.param_patt: %False) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %false_.ref.loc9: %False = name_ref false_, %false_ -// CHECK:STDOUT: %Greater.ref.loc9: %Greater.type = name_ref Greater, file.%Greater.decl [template = constants.%Greater] +// CHECK:STDOUT: %Greater.ref.loc9: %Greater.type.1 = name_ref Greater, file.%Greater.decl [template = constants.%Greater.1] // CHECK:STDOUT: %int_1.loc9: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %impl.elem0.loc9_25: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc9_25: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc9_25: = bound_method %int_1.loc9, %impl.elem0.loc9_25 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc9_25: = specific_function %Convert.bound.loc9_25, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc9_25: init %i32 = call %Convert.specific_fn.loc9_25(%int_1.loc9) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc9_25.1: %i32 = value_of_initializer %int.convert_checked.loc9_25 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc9_25.2: %i32 = converted %int_1.loc9, %.loc9_25.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc9_28: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc9_28: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc9_28: = bound_method %int_2, %impl.elem0.loc9_28 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc9_28: = specific_function %Convert.bound.loc9_28, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc9_28: init %i32 = call %Convert.specific_fn.loc9_28(%int_2) [template = constants.%int_2.2] @@ -229,16 +229,16 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: !if.expr.result.loc9: // CHECK:STDOUT: %.loc9_14.3: type = block_arg !if.expr.result.loc9 [template = constants.%False] // CHECK:STDOUT: %false_.ref.loc10: %False = name_ref false_, %false_ -// CHECK:STDOUT: %Greater.ref.loc10: %Greater.type = name_ref Greater, file.%Greater.decl [template = constants.%Greater] +// CHECK:STDOUT: %Greater.ref.loc10: %Greater.type.1 = name_ref Greater, file.%Greater.decl [template = constants.%Greater.1] // CHECK:STDOUT: %int_1.loc10_25: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_1.loc10_28: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc10_25: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc10_25: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc10_25: = bound_method %int_1.loc10_25, %impl.elem0.loc10_25 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc10_25: = specific_function %Convert.bound.loc10_25, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc10_25: init %i32 = call %Convert.specific_fn.loc10_25(%int_1.loc10_25) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc10_25.1: %i32 = value_of_initializer %int.convert_checked.loc10_25 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc10_25.2: %i32 = converted %int_1.loc10_25, %.loc10_25.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc10_28: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc10_28: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc10_28: = bound_method %int_1.loc10_28, %impl.elem0.loc10_28 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc10_28: = specific_function %Convert.bound.loc10_28, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc10_28: init %i32 = call %Convert.specific_fn.loc10_28(%int_1.loc10_28) [template = constants.%int_1.2] @@ -260,16 +260,16 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: !if.expr.result.loc10: // CHECK:STDOUT: %.loc10_14.3: type = block_arg !if.expr.result.loc10 [template = constants.%False] // CHECK:STDOUT: %true_.ref.loc11: %True = name_ref true_, %true_ -// CHECK:STDOUT: %Greater.ref.loc11: %Greater.type = name_ref Greater, file.%Greater.decl [template = constants.%Greater] +// CHECK:STDOUT: %Greater.ref.loc11: %Greater.type.1 = name_ref Greater, file.%Greater.decl [template = constants.%Greater.1] // CHECK:STDOUT: %int_1.loc11: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_0.loc11: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0.loc11_24: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11_24: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_24: = bound_method %int_1.loc11, %impl.elem0.loc11_24 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc11_24: = specific_function %Convert.bound.loc11_24, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc11_24: init %i32 = call %Convert.specific_fn.loc11_24(%int_1.loc11) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc11_24.1: %i32 = value_of_initializer %int.convert_checked.loc11_24 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc11_24.2: %i32 = converted %int_1.loc11, %.loc11_24.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc11_27: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11_27: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_27: = bound_method %int_0.loc11, %impl.elem0.loc11_27 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc11_27: = specific_function %Convert.bound.loc11_27, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc11_27: init %i32 = call %Convert.specific_fn.loc11_27(%int_0.loc11) [template = constants.%int_0.2] @@ -291,10 +291,10 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: !if.expr.result.loc11: // CHECK:STDOUT: %.loc11_13.3: type = block_arg !if.expr.result.loc11 [template = constants.%True] // CHECK:STDOUT: %false_.ref.loc12: %False = name_ref false_, %false_ -// CHECK:STDOUT: %Greater.ref.loc12: %Greater.type = name_ref Greater, file.%Greater.decl [template = constants.%Greater] +// CHECK:STDOUT: %Greater.ref.loc12: %Greater.type.1 = name_ref Greater, file.%Greater.decl [template = constants.%Greater.1] // CHECK:STDOUT: %Negate.ref.loc12: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %int_1.loc12: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc12_32: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc12_32: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc12_32: = bound_method %int_1.loc12, %impl.elem0.loc12_32 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc12_32: = specific_function %Convert.bound.loc12_32, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc12_32: init %i32 = call %Convert.specific_fn.loc12_32(%int_1.loc12) [template = constants.%int_1.2] @@ -304,7 +304,7 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %int_0.loc12: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %.loc12_33.1: %i32 = value_of_initializer %int.snegate.loc12 [template = constants.%int_-1] // CHECK:STDOUT: %.loc12_33.2: %i32 = converted %int.snegate.loc12, %.loc12_33.1 [template = constants.%int_-1] -// CHECK:STDOUT: %impl.elem0.loc12_36: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc12_36: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc12_36: = bound_method %int_0.loc12, %impl.elem0.loc12_36 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc12_36: = specific_function %Convert.bound.loc12_36, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc12_36: init %i32 = call %Convert.specific_fn.loc12_36(%int_0.loc12) [template = constants.%int_0.2] @@ -326,18 +326,18 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: !if.expr.result.loc12: // CHECK:STDOUT: %.loc12_14.3: type = block_arg !if.expr.result.loc12 [template = constants.%False] // CHECK:STDOUT: %true_.ref.loc13: %True = name_ref true_, %true_ -// CHECK:STDOUT: %Greater.ref.loc13: %Greater.type = name_ref Greater, file.%Greater.decl [template = constants.%Greater] +// CHECK:STDOUT: %Greater.ref.loc13: %Greater.type.1 = name_ref Greater, file.%Greater.decl [template = constants.%Greater.1] // CHECK:STDOUT: %int_0.loc13: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %Negate.ref.loc13: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %int_1.loc13: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc13_34: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc13_34: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc13_34: = bound_method %int_1.loc13, %impl.elem0.loc13_34 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc13_34: = specific_function %Convert.bound.loc13_34, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc13_34: init %i32 = call %Convert.specific_fn.loc13_34(%int_1.loc13) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc13_34.1: %i32 = value_of_initializer %int.convert_checked.loc13_34 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc13_34.2: %i32 = converted %int_1.loc13, %.loc13_34.1 [template = constants.%int_1.2] // CHECK:STDOUT: %int.snegate.loc13: init %i32 = call %Negate.ref.loc13(%.loc13_34.2) [template = constants.%int_-1] -// CHECK:STDOUT: %impl.elem0.loc13_24: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc13_24: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc13_24: = bound_method %int_0.loc13, %impl.elem0.loc13_24 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc13_24: = specific_function %Convert.bound.loc13_24, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc13_24: init %i32 = call %Convert.specific_fn.loc13_24(%int_0.loc13) [template = constants.%int_0.2] @@ -365,7 +365,7 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: // CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: %i32, %b.param_patt: %i32) -> bool { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Greater.ref: %Greater.type = name_ref Greater, file.%Greater.decl [template = constants.%Greater] +// CHECK:STDOUT: %Greater.ref: %Greater.type.1 = name_ref Greater, file.%Greater.decl [template = constants.%Greater.1] // CHECK:STDOUT: %a.ref: %i32 = name_ref a, %a // CHECK:STDOUT: %b.ref: %i32 = name_ref b, %b // CHECK:STDOUT: %int.greater: init bool = call %Greater.ref(%a.ref, %b.ref) diff --git a/toolchain/check/testdata/builtins/int/greater_eq.carbon b/toolchain/check/testdata/builtins/int/greater_eq.carbon index 0322f2e423ebe..8f865aab5e5e9 100644 --- a/toolchain/check/testdata/builtins/int/greater_eq.carbon +++ b/toolchain/check/testdata/builtins/int/greater_eq.carbon @@ -50,7 +50,7 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -201,13 +201,13 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %GreaterEq.ref.loc9: %GreaterEq.type = name_ref GreaterEq, file.%GreaterEq.decl [template = constants.%GreaterEq] // CHECK:STDOUT: %int_1.loc9: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %impl.elem0.loc9_27: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc9_27: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc9_27: = bound_method %int_1.loc9, %impl.elem0.loc9_27 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc9_27: = specific_function %Convert.bound.loc9_27, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc9_27: init %i32 = call %Convert.specific_fn.loc9_27(%int_1.loc9) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc9_27.1: %i32 = value_of_initializer %int.convert_checked.loc9_27 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc9_27.2: %i32 = converted %int_1.loc9, %.loc9_27.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc9_30: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc9_30: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc9_30: = bound_method %int_2, %impl.elem0.loc9_30 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc9_30: = specific_function %Convert.bound.loc9_30, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc9_30: init %i32 = call %Convert.specific_fn.loc9_30(%int_2) [template = constants.%int_2.2] @@ -232,13 +232,13 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %GreaterEq.ref.loc10: %GreaterEq.type = name_ref GreaterEq, file.%GreaterEq.decl [template = constants.%GreaterEq] // CHECK:STDOUT: %int_1.loc10_26: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_1.loc10_29: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc10_26: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc10_26: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc10_26: = bound_method %int_1.loc10_26, %impl.elem0.loc10_26 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc10_26: = specific_function %Convert.bound.loc10_26, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc10_26: init %i32 = call %Convert.specific_fn.loc10_26(%int_1.loc10_26) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc10_26.1: %i32 = value_of_initializer %int.convert_checked.loc10_26 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc10_26.2: %i32 = converted %int_1.loc10_26, %.loc10_26.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc10_29: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc10_29: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc10_29: = bound_method %int_1.loc10_29, %impl.elem0.loc10_29 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc10_29: = specific_function %Convert.bound.loc10_29, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc10_29: init %i32 = call %Convert.specific_fn.loc10_29(%int_1.loc10_29) [template = constants.%int_1.2] @@ -263,13 +263,13 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %GreaterEq.ref.loc11: %GreaterEq.type = name_ref GreaterEq, file.%GreaterEq.decl [template = constants.%GreaterEq] // CHECK:STDOUT: %int_1.loc11: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_0.loc11: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0.loc11_26: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11_26: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_26: = bound_method %int_1.loc11, %impl.elem0.loc11_26 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc11_26: = specific_function %Convert.bound.loc11_26, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc11_26: init %i32 = call %Convert.specific_fn.loc11_26(%int_1.loc11) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc11_26.1: %i32 = value_of_initializer %int.convert_checked.loc11_26 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc11_26.2: %i32 = converted %int_1.loc11, %.loc11_26.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc11_29: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11_29: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_29: = bound_method %int_0.loc11, %impl.elem0.loc11_29 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc11_29: = specific_function %Convert.bound.loc11_29, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc11_29: init %i32 = call %Convert.specific_fn.loc11_29(%int_0.loc11) [template = constants.%int_0.2] @@ -294,7 +294,7 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %GreaterEq.ref.loc12: %GreaterEq.type = name_ref GreaterEq, file.%GreaterEq.decl [template = constants.%GreaterEq] // CHECK:STDOUT: %Negate.ref.loc12: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %int_1.loc12: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc12_34: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc12_34: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc12_34: = bound_method %int_1.loc12, %impl.elem0.loc12_34 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc12_34: = specific_function %Convert.bound.loc12_34, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc12_34: init %i32 = call %Convert.specific_fn.loc12_34(%int_1.loc12) [template = constants.%int_1.2] @@ -304,7 +304,7 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %int_0.loc12: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %.loc12_35.1: %i32 = value_of_initializer %int.snegate.loc12 [template = constants.%int_-1] // CHECK:STDOUT: %.loc12_35.2: %i32 = converted %int.snegate.loc12, %.loc12_35.1 [template = constants.%int_-1] -// CHECK:STDOUT: %impl.elem0.loc12_38: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc12_38: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc12_38: = bound_method %int_0.loc12, %impl.elem0.loc12_38 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc12_38: = specific_function %Convert.bound.loc12_38, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc12_38: init %i32 = call %Convert.specific_fn.loc12_38(%int_0.loc12) [template = constants.%int_0.2] @@ -330,14 +330,14 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %int_0.loc13: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %Negate.ref.loc13: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %int_1.loc13: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc13_36: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc13_36: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc13_36: = bound_method %int_1.loc13, %impl.elem0.loc13_36 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc13_36: = specific_function %Convert.bound.loc13_36, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc13_36: init %i32 = call %Convert.specific_fn.loc13_36(%int_1.loc13) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc13_36.1: %i32 = value_of_initializer %int.convert_checked.loc13_36 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc13_36.2: %i32 = converted %int_1.loc13, %.loc13_36.1 [template = constants.%int_1.2] // CHECK:STDOUT: %int.snegate.loc13: init %i32 = call %Negate.ref.loc13(%.loc13_36.2) [template = constants.%int_-1] -// CHECK:STDOUT: %impl.elem0.loc13_26: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc13_26: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc13_26: = bound_method %int_0.loc13, %impl.elem0.loc13_26 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc13_26: = specific_function %Convert.bound.loc13_26, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc13_26: init %i32 = call %Convert.specific_fn.loc13_26(%int_0.loc13) [template = constants.%int_0.2] diff --git a/toolchain/check/testdata/builtins/int/left_shift.carbon b/toolchain/check/testdata/builtins/int/left_shift.carbon index 7663a25e84602..726997da352e7 100644 --- a/toolchain/check/testdata/builtins/int/left_shift.carbon +++ b/toolchain/check/testdata/builtins/int/left_shift.carbon @@ -184,7 +184,7 @@ let negative: i32 = LeftShift(1, Negate(1)); // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32.1) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32.1) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -287,13 +287,13 @@ let negative: i32 = LeftShift(1, Negate(1)); // CHECK:STDOUT: %LeftShift.ref.loc8: %LeftShift.type.1 = name_ref LeftShift, file.%LeftShift.decl [template = constants.%LeftShift] // CHECK:STDOUT: %int_1.loc8: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_31.loc8: Core.IntLiteral = int_value 31 [template = constants.%int_31.1] -// CHECK:STDOUT: %impl.elem0.loc8_29: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc8_29: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc8_29: = bound_method %int_1.loc8, %impl.elem0.loc8_29 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc8_29: = specific_function %Convert.bound.loc8_29, @Convert.2(constants.%int_32.1) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc8_29: init %i32 = call %Convert.specific_fn.loc8_29(%int_1.loc8) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc8_29.1: %i32 = value_of_initializer %int.convert_checked.loc8_29 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc8_29.2: %i32 = converted %int_1.loc8, %.loc8_29.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc8_32: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc8_32: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc8_32: = bound_method %int_31.loc8, %impl.elem0.loc8_32 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc8_32: = specific_function %Convert.bound.loc8_32, @Convert.2(constants.%int_32.1) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc8_32: init %i32 = call %Convert.specific_fn.loc8_32(%int_31.loc8) [template = constants.%int_31.2] @@ -306,13 +306,13 @@ let negative: i32 = LeftShift(1, Negate(1)); // CHECK:STDOUT: %LeftShift.ref.loc13: %LeftShift.type.1 = name_ref LeftShift, file.%LeftShift.decl [template = constants.%LeftShift] // CHECK:STDOUT: %int_1.loc13: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_32.loc13: Core.IntLiteral = int_value 32 [template = constants.%int_32.1] -// CHECK:STDOUT: %impl.elem0.loc13_29: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc13_29: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc13_29: = bound_method %int_1.loc13, %impl.elem0.loc13_29 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc13_29: = specific_function %Convert.bound.loc13_29, @Convert.2(constants.%int_32.1) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc13_29: init %i32 = call %Convert.specific_fn.loc13_29(%int_1.loc13) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc13_29.1: %i32 = value_of_initializer %int.convert_checked.loc13_29 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc13_29.2: %i32 = converted %int_1.loc13, %.loc13_29.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc13_32: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc13_32: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc13_32: = bound_method %int_32.loc13, %impl.elem0.loc13_32 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc13_32: = specific_function %Convert.bound.loc13_32, @Convert.2(constants.%int_32.1) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc13_32: init %i32 = call %Convert.specific_fn.loc13_32(%int_32.loc13) [template = constants.%int_32.2] @@ -325,13 +325,13 @@ let negative: i32 = LeftShift(1, Negate(1)); // CHECK:STDOUT: %LeftShift.ref.loc18: %LeftShift.type.1 = name_ref LeftShift, file.%LeftShift.decl [template = constants.%LeftShift] // CHECK:STDOUT: %int_1.loc18: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_33: Core.IntLiteral = int_value 33 [template = constants.%int_33.1] -// CHECK:STDOUT: %impl.elem0.loc18_29: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc18_29: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc18_29: = bound_method %int_1.loc18, %impl.elem0.loc18_29 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc18_29: = specific_function %Convert.bound.loc18_29, @Convert.2(constants.%int_32.1) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc18_29: init %i32 = call %Convert.specific_fn.loc18_29(%int_1.loc18) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc18_29.1: %i32 = value_of_initializer %int.convert_checked.loc18_29 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc18_29.2: %i32 = converted %int_1.loc18, %.loc18_29.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc18_32: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc18_32: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc18_32: = bound_method %int_33, %impl.elem0.loc18_32 [template = constants.%Convert.bound.4] // CHECK:STDOUT: %Convert.specific_fn.loc18_32: = specific_function %Convert.bound.loc18_32, @Convert.2(constants.%int_32.1) [template = constants.%Convert.specific_fn.4] // CHECK:STDOUT: %int.convert_checked.loc18_32: init %i32 = call %Convert.specific_fn.loc18_32(%int_33) [template = constants.%int_33.2] @@ -344,13 +344,13 @@ let negative: i32 = LeftShift(1, Negate(1)); // CHECK:STDOUT: %LeftShift.ref.loc21: %LeftShift.type.1 = name_ref LeftShift, file.%LeftShift.decl [template = constants.%LeftShift] // CHECK:STDOUT: %int_1000.loc21: Core.IntLiteral = int_value 1000 [template = constants.%int_1000.1] // CHECK:STDOUT: %int_31.loc21: Core.IntLiteral = int_value 31 [template = constants.%int_31.1] -// CHECK:STDOUT: %impl.elem0.loc21_33: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc21_33: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc21_33: = bound_method %int_1000.loc21, %impl.elem0.loc21_33 [template = constants.%Convert.bound.5] // CHECK:STDOUT: %Convert.specific_fn.loc21_33: = specific_function %Convert.bound.loc21_33, @Convert.2(constants.%int_32.1) [template = constants.%Convert.specific_fn.5] // CHECK:STDOUT: %int.convert_checked.loc21_33: init %i32 = call %Convert.specific_fn.loc21_33(%int_1000.loc21) [template = constants.%int_1000.2] // CHECK:STDOUT: %.loc21_33.1: %i32 = value_of_initializer %int.convert_checked.loc21_33 [template = constants.%int_1000.2] // CHECK:STDOUT: %.loc21_33.2: %i32 = converted %int_1000.loc21, %.loc21_33.1 [template = constants.%int_1000.2] -// CHECK:STDOUT: %impl.elem0.loc21_39: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc21_39: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc21_39: = bound_method %int_31.loc21, %impl.elem0.loc21_39 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc21_39: = specific_function %Convert.bound.loc21_39, @Convert.2(constants.%int_32.1) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc21_39: init %i32 = call %Convert.specific_fn.loc21_39(%int_31.loc21) [template = constants.%int_31.2] @@ -363,13 +363,13 @@ let negative: i32 = LeftShift(1, Negate(1)); // CHECK:STDOUT: %LeftShift.ref.loc26: %LeftShift.type.1 = name_ref LeftShift, file.%LeftShift.decl [template = constants.%LeftShift] // CHECK:STDOUT: %int_1000.loc26: Core.IntLiteral = int_value 1000 [template = constants.%int_1000.1] // CHECK:STDOUT: %int_32.loc26: Core.IntLiteral = int_value 32 [template = constants.%int_32.1] -// CHECK:STDOUT: %impl.elem0.loc26_33: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc26_33: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc26_33: = bound_method %int_1000.loc26, %impl.elem0.loc26_33 [template = constants.%Convert.bound.5] // CHECK:STDOUT: %Convert.specific_fn.loc26_33: = specific_function %Convert.bound.loc26_33, @Convert.2(constants.%int_32.1) [template = constants.%Convert.specific_fn.5] // CHECK:STDOUT: %int.convert_checked.loc26_33: init %i32 = call %Convert.specific_fn.loc26_33(%int_1000.loc26) [template = constants.%int_1000.2] // CHECK:STDOUT: %.loc26_33.1: %i32 = value_of_initializer %int.convert_checked.loc26_33 [template = constants.%int_1000.2] // CHECK:STDOUT: %.loc26_33.2: %i32 = converted %int_1000.loc26, %.loc26_33.1 [template = constants.%int_1000.2] -// CHECK:STDOUT: %impl.elem0.loc26_39: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc26_39: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc26_39: = bound_method %int_32.loc26, %impl.elem0.loc26_39 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc26_39: = specific_function %Convert.bound.loc26_39, @Convert.2(constants.%int_32.1) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc26_39: init %i32 = call %Convert.specific_fn.loc26_39(%int_32.loc26) [template = constants.%int_32.2] @@ -382,13 +382,13 @@ let negative: i32 = LeftShift(1, Negate(1)); // CHECK:STDOUT: %LeftShift.ref.loc29: %LeftShift.type.1 = name_ref LeftShift, file.%LeftShift.decl [template = constants.%LeftShift] // CHECK:STDOUT: %int_0.loc29: Core.IntLiteral = int_value 0 [template = constants.%int_0.2] // CHECK:STDOUT: %int_31.loc29: Core.IntLiteral = int_value 31 [template = constants.%int_31.1] -// CHECK:STDOUT: %impl.elem0.loc29_36: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc29_36: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc29_36: = bound_method %int_0.loc29, %impl.elem0.loc29_36 [template = constants.%Convert.bound.6] // CHECK:STDOUT: %Convert.specific_fn.loc29_36: = specific_function %Convert.bound.loc29_36, @Convert.2(constants.%int_32.1) [template = constants.%Convert.specific_fn.6] // CHECK:STDOUT: %int.convert_checked.loc29_36: init %i32 = call %Convert.specific_fn.loc29_36(%int_0.loc29) [template = constants.%int_0.1] // CHECK:STDOUT: %.loc29_36.1: %i32 = value_of_initializer %int.convert_checked.loc29_36 [template = constants.%int_0.1] // CHECK:STDOUT: %.loc29_36.2: %i32 = converted %int_0.loc29, %.loc29_36.1 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0.loc29_39: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc29_39: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc29_39: = bound_method %int_31.loc29, %impl.elem0.loc29_39 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc29_39: = specific_function %Convert.bound.loc29_39, @Convert.2(constants.%int_32.1) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc29_39: init %i32 = call %Convert.specific_fn.loc29_39(%int_31.loc29) [template = constants.%int_31.2] @@ -401,13 +401,13 @@ let negative: i32 = LeftShift(1, Negate(1)); // CHECK:STDOUT: %LeftShift.ref.loc34: %LeftShift.type.1 = name_ref LeftShift, file.%LeftShift.decl [template = constants.%LeftShift] // CHECK:STDOUT: %int_0.loc34: Core.IntLiteral = int_value 0 [template = constants.%int_0.2] // CHECK:STDOUT: %int_32.loc34: Core.IntLiteral = int_value 32 [template = constants.%int_32.1] -// CHECK:STDOUT: %impl.elem0.loc34_36: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc34_36: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc34_36: = bound_method %int_0.loc34, %impl.elem0.loc34_36 [template = constants.%Convert.bound.6] // CHECK:STDOUT: %Convert.specific_fn.loc34_36: = specific_function %Convert.bound.loc34_36, @Convert.2(constants.%int_32.1) [template = constants.%Convert.specific_fn.6] // CHECK:STDOUT: %int.convert_checked.loc34_36: init %i32 = call %Convert.specific_fn.loc34_36(%int_0.loc34) [template = constants.%int_0.1] // CHECK:STDOUT: %.loc34_36.1: %i32 = value_of_initializer %int.convert_checked.loc34_36 [template = constants.%int_0.1] // CHECK:STDOUT: %.loc34_36.2: %i32 = converted %int_0.loc34, %.loc34_36.1 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0.loc34_39: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc34_39: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc34_39: = bound_method %int_32.loc34, %impl.elem0.loc34_39 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc34_39: = specific_function %Convert.bound.loc34_39, @Convert.2(constants.%int_32.1) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc34_39: init %i32 = call %Convert.specific_fn.loc34_39(%int_32.loc34) [template = constants.%int_32.2] @@ -421,14 +421,14 @@ let negative: i32 = LeftShift(1, Negate(1)); // CHECK:STDOUT: %int_1.loc40_31: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %Negate.ref: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %int_1.loc40_41: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc40_41: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc40_41: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc40_41: = bound_method %int_1.loc40_41, %impl.elem0.loc40_41 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc40_41: = specific_function %Convert.bound.loc40_41, @Convert.2(constants.%int_32.1) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc40_41: init %i32 = call %Convert.specific_fn.loc40_41(%int_1.loc40_41) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc40_41.1: %i32 = value_of_initializer %int.convert_checked.loc40_41 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc40_41.2: %i32 = converted %int_1.loc40_41, %.loc40_41.1 [template = constants.%int_1.2] // CHECK:STDOUT: %int.snegate: init %i32 = call %Negate.ref(%.loc40_41.2) [template = constants.%int_-1] -// CHECK:STDOUT: %impl.elem0.loc40_31: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc40_31: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc40_31: = bound_method %int_1.loc40_31, %impl.elem0.loc40_31 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc40_31: = specific_function %Convert.bound.loc40_31, @Convert.2(constants.%int_32.1) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc40_31: init %i32 = call %Convert.specific_fn.loc40_31(%int_1.loc40_31) [template = constants.%int_1.2] diff --git a/toolchain/check/testdata/builtins/int/less.carbon b/toolchain/check/testdata/builtins/int/less.carbon index dd1a3ab4a5461..517e91b8aaa1a 100644 --- a/toolchain/check/testdata/builtins/int/less.carbon +++ b/toolchain/check/testdata/builtins/int/less.carbon @@ -35,8 +35,8 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] // CHECK:STDOUT: %Bool.type: type = fn_type @Bool [template] // CHECK:STDOUT: %Bool: %Bool.type = struct_value () [template] -// CHECK:STDOUT: %Less.type: type = fn_type @Less [template] -// CHECK:STDOUT: %Less: %Less.type = struct_value () [template] +// CHECK:STDOUT: %Less.type.1: type = fn_type @Less.1 [template] +// CHECK:STDOUT: %Less.1: %Less.type.1 = struct_value () [template] // CHECK:STDOUT: %Negate.type.1: type = fn_type @Negate.1 [template] // CHECK:STDOUT: %Negate: %Negate.type.1 = struct_value () [template] // CHECK:STDOUT: %True: type = class_type @True [template] @@ -50,7 +50,7 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -89,7 +89,7 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Less.decl: %Less.type = fn_decl @Less [template = constants.%Less] { +// CHECK:STDOUT: %Less.decl: %Less.type.1 = fn_decl @Less.1 [template = constants.%Less.1] { // CHECK:STDOUT: %a.patt: %i32 = binding_pattern a // CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: %i32 = binding_pattern b @@ -191,23 +191,23 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Less(%a.param_patt: %i32, %b.param_patt: %i32) -> bool = "int.less"; +// CHECK:STDOUT: fn @Less.1(%a.param_patt: %i32, %b.param_patt: %i32) -> bool = "int.less"; // CHECK:STDOUT: // CHECK:STDOUT: fn @Negate.1(%a.param_patt: %i32) -> %i32 = "int.snegate"; // CHECK:STDOUT: // CHECK:STDOUT: fn @F(%true_.param_patt: %True, %false_.param_patt: %False) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %true_.ref.loc9: %True = name_ref true_, %true_ -// CHECK:STDOUT: %Less.ref.loc9: %Less.type = name_ref Less, file.%Less.decl [template = constants.%Less] +// CHECK:STDOUT: %Less.ref.loc9: %Less.type.1 = name_ref Less, file.%Less.decl [template = constants.%Less.1] // CHECK:STDOUT: %int_1.loc9: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %impl.elem0.loc9_21: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc9_21: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc9_21: = bound_method %int_1.loc9, %impl.elem0.loc9_21 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc9_21: = specific_function %Convert.bound.loc9_21, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc9_21: init %i32 = call %Convert.specific_fn.loc9_21(%int_1.loc9) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc9_21.1: %i32 = value_of_initializer %int.convert_checked.loc9_21 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc9_21.2: %i32 = converted %int_1.loc9, %.loc9_21.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc9_24: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc9_24: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc9_24: = bound_method %int_2, %impl.elem0.loc9_24 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc9_24: = specific_function %Convert.bound.loc9_24, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc9_24: init %i32 = call %Convert.specific_fn.loc9_24(%int_2) [template = constants.%int_2.2] @@ -229,16 +229,16 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: !if.expr.result.loc9: // CHECK:STDOUT: %.loc9_13.3: type = block_arg !if.expr.result.loc9 [template = constants.%True] // CHECK:STDOUT: %false_.ref.loc10: %False = name_ref false_, %false_ -// CHECK:STDOUT: %Less.ref.loc10: %Less.type = name_ref Less, file.%Less.decl [template = constants.%Less] +// CHECK:STDOUT: %Less.ref.loc10: %Less.type.1 = name_ref Less, file.%Less.decl [template = constants.%Less.1] // CHECK:STDOUT: %int_1.loc10_22: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_1.loc10_25: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc10_22: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc10_22: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc10_22: = bound_method %int_1.loc10_22, %impl.elem0.loc10_22 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc10_22: = specific_function %Convert.bound.loc10_22, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc10_22: init %i32 = call %Convert.specific_fn.loc10_22(%int_1.loc10_22) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc10_22.1: %i32 = value_of_initializer %int.convert_checked.loc10_22 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc10_22.2: %i32 = converted %int_1.loc10_22, %.loc10_22.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc10_25: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc10_25: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc10_25: = bound_method %int_1.loc10_25, %impl.elem0.loc10_25 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc10_25: = specific_function %Convert.bound.loc10_25, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc10_25: init %i32 = call %Convert.specific_fn.loc10_25(%int_1.loc10_25) [template = constants.%int_1.2] @@ -260,16 +260,16 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: !if.expr.result.loc10: // CHECK:STDOUT: %.loc10_14.3: type = block_arg !if.expr.result.loc10 [template = constants.%False] // CHECK:STDOUT: %false_.ref.loc11: %False = name_ref false_, %false_ -// CHECK:STDOUT: %Less.ref.loc11: %Less.type = name_ref Less, file.%Less.decl [template = constants.%Less] +// CHECK:STDOUT: %Less.ref.loc11: %Less.type.1 = name_ref Less, file.%Less.decl [template = constants.%Less.1] // CHECK:STDOUT: %int_1.loc11: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_0.loc11: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0.loc11_22: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11_22: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_22: = bound_method %int_1.loc11, %impl.elem0.loc11_22 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc11_22: = specific_function %Convert.bound.loc11_22, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc11_22: init %i32 = call %Convert.specific_fn.loc11_22(%int_1.loc11) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc11_22.1: %i32 = value_of_initializer %int.convert_checked.loc11_22 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc11_22.2: %i32 = converted %int_1.loc11, %.loc11_22.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc11_25: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11_25: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_25: = bound_method %int_0.loc11, %impl.elem0.loc11_25 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc11_25: = specific_function %Convert.bound.loc11_25, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc11_25: init %i32 = call %Convert.specific_fn.loc11_25(%int_0.loc11) [template = constants.%int_0.2] @@ -291,10 +291,10 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: !if.expr.result.loc11: // CHECK:STDOUT: %.loc11_14.3: type = block_arg !if.expr.result.loc11 [template = constants.%False] // CHECK:STDOUT: %true_.ref.loc12: %True = name_ref true_, %true_ -// CHECK:STDOUT: %Less.ref.loc12: %Less.type = name_ref Less, file.%Less.decl [template = constants.%Less] +// CHECK:STDOUT: %Less.ref.loc12: %Less.type.1 = name_ref Less, file.%Less.decl [template = constants.%Less.1] // CHECK:STDOUT: %Negate.ref.loc12: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %int_1.loc12: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc12_28: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc12_28: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc12_28: = bound_method %int_1.loc12, %impl.elem0.loc12_28 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc12_28: = specific_function %Convert.bound.loc12_28, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc12_28: init %i32 = call %Convert.specific_fn.loc12_28(%int_1.loc12) [template = constants.%int_1.2] @@ -304,7 +304,7 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %int_0.loc12: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %.loc12_29.1: %i32 = value_of_initializer %int.snegate.loc12 [template = constants.%int_-1] // CHECK:STDOUT: %.loc12_29.2: %i32 = converted %int.snegate.loc12, %.loc12_29.1 [template = constants.%int_-1] -// CHECK:STDOUT: %impl.elem0.loc12_32: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc12_32: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc12_32: = bound_method %int_0.loc12, %impl.elem0.loc12_32 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc12_32: = specific_function %Convert.bound.loc12_32, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc12_32: init %i32 = call %Convert.specific_fn.loc12_32(%int_0.loc12) [template = constants.%int_0.2] @@ -326,18 +326,18 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: !if.expr.result.loc12: // CHECK:STDOUT: %.loc12_13.3: type = block_arg !if.expr.result.loc12 [template = constants.%True] // CHECK:STDOUT: %false_.ref.loc13: %False = name_ref false_, %false_ -// CHECK:STDOUT: %Less.ref.loc13: %Less.type = name_ref Less, file.%Less.decl [template = constants.%Less] +// CHECK:STDOUT: %Less.ref.loc13: %Less.type.1 = name_ref Less, file.%Less.decl [template = constants.%Less.1] // CHECK:STDOUT: %int_0.loc13: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %Negate.ref.loc13: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %int_1.loc13: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc13_32: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc13_32: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc13_32: = bound_method %int_1.loc13, %impl.elem0.loc13_32 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc13_32: = specific_function %Convert.bound.loc13_32, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc13_32: init %i32 = call %Convert.specific_fn.loc13_32(%int_1.loc13) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc13_32.1: %i32 = value_of_initializer %int.convert_checked.loc13_32 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc13_32.2: %i32 = converted %int_1.loc13, %.loc13_32.1 [template = constants.%int_1.2] // CHECK:STDOUT: %int.snegate.loc13: init %i32 = call %Negate.ref.loc13(%.loc13_32.2) [template = constants.%int_-1] -// CHECK:STDOUT: %impl.elem0.loc13_22: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc13_22: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc13_22: = bound_method %int_0.loc13, %impl.elem0.loc13_22 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc13_22: = specific_function %Convert.bound.loc13_22, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc13_22: init %i32 = call %Convert.specific_fn.loc13_22(%int_0.loc13) [template = constants.%int_0.2] @@ -365,7 +365,7 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: // CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: %i32, %b.param_patt: %i32) -> bool { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Less.ref: %Less.type = name_ref Less, file.%Less.decl [template = constants.%Less] +// CHECK:STDOUT: %Less.ref: %Less.type.1 = name_ref Less, file.%Less.decl [template = constants.%Less.1] // CHECK:STDOUT: %a.ref: %i32 = name_ref a, %a // CHECK:STDOUT: %b.ref: %i32 = name_ref b, %b // CHECK:STDOUT: %int.less: init bool = call %Less.ref(%a.ref, %b.ref) diff --git a/toolchain/check/testdata/builtins/int/less_eq.carbon b/toolchain/check/testdata/builtins/int/less_eq.carbon index 99b5acbf01579..3f8d683fed8b7 100644 --- a/toolchain/check/testdata/builtins/int/less_eq.carbon +++ b/toolchain/check/testdata/builtins/int/less_eq.carbon @@ -50,7 +50,7 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -201,13 +201,13 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %LessEq.ref.loc9: %LessEq.type = name_ref LessEq, file.%LessEq.decl [template = constants.%LessEq] // CHECK:STDOUT: %int_1.loc9: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %impl.elem0.loc9_23: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc9_23: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc9_23: = bound_method %int_1.loc9, %impl.elem0.loc9_23 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc9_23: = specific_function %Convert.bound.loc9_23, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc9_23: init %i32 = call %Convert.specific_fn.loc9_23(%int_1.loc9) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc9_23.1: %i32 = value_of_initializer %int.convert_checked.loc9_23 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc9_23.2: %i32 = converted %int_1.loc9, %.loc9_23.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc9_26: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc9_26: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc9_26: = bound_method %int_2, %impl.elem0.loc9_26 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc9_26: = specific_function %Convert.bound.loc9_26, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc9_26: init %i32 = call %Convert.specific_fn.loc9_26(%int_2) [template = constants.%int_2.2] @@ -232,13 +232,13 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %LessEq.ref.loc10: %LessEq.type = name_ref LessEq, file.%LessEq.decl [template = constants.%LessEq] // CHECK:STDOUT: %int_1.loc10_23: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_1.loc10_26: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc10_23: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc10_23: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc10_23: = bound_method %int_1.loc10_23, %impl.elem0.loc10_23 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc10_23: = specific_function %Convert.bound.loc10_23, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc10_23: init %i32 = call %Convert.specific_fn.loc10_23(%int_1.loc10_23) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc10_23.1: %i32 = value_of_initializer %int.convert_checked.loc10_23 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc10_23.2: %i32 = converted %int_1.loc10_23, %.loc10_23.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc10_26: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc10_26: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc10_26: = bound_method %int_1.loc10_26, %impl.elem0.loc10_26 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc10_26: = specific_function %Convert.bound.loc10_26, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc10_26: init %i32 = call %Convert.specific_fn.loc10_26(%int_1.loc10_26) [template = constants.%int_1.2] @@ -263,13 +263,13 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %LessEq.ref.loc11: %LessEq.type = name_ref LessEq, file.%LessEq.decl [template = constants.%LessEq] // CHECK:STDOUT: %int_1.loc11: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_0.loc11: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0.loc11_24: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11_24: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_24: = bound_method %int_1.loc11, %impl.elem0.loc11_24 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc11_24: = specific_function %Convert.bound.loc11_24, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc11_24: init %i32 = call %Convert.specific_fn.loc11_24(%int_1.loc11) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc11_24.1: %i32 = value_of_initializer %int.convert_checked.loc11_24 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc11_24.2: %i32 = converted %int_1.loc11, %.loc11_24.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc11_27: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11_27: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_27: = bound_method %int_0.loc11, %impl.elem0.loc11_27 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc11_27: = specific_function %Convert.bound.loc11_27, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc11_27: init %i32 = call %Convert.specific_fn.loc11_27(%int_0.loc11) [template = constants.%int_0.2] @@ -294,7 +294,7 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %LessEq.ref.loc12: %LessEq.type = name_ref LessEq, file.%LessEq.decl [template = constants.%LessEq] // CHECK:STDOUT: %Negate.ref.loc12: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %int_1.loc12: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc12_30: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc12_30: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc12_30: = bound_method %int_1.loc12, %impl.elem0.loc12_30 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc12_30: = specific_function %Convert.bound.loc12_30, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc12_30: init %i32 = call %Convert.specific_fn.loc12_30(%int_1.loc12) [template = constants.%int_1.2] @@ -304,7 +304,7 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %int_0.loc12: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %.loc12_31.1: %i32 = value_of_initializer %int.snegate.loc12 [template = constants.%int_-1] // CHECK:STDOUT: %.loc12_31.2: %i32 = converted %int.snegate.loc12, %.loc12_31.1 [template = constants.%int_-1] -// CHECK:STDOUT: %impl.elem0.loc12_34: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc12_34: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc12_34: = bound_method %int_0.loc12, %impl.elem0.loc12_34 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc12_34: = specific_function %Convert.bound.loc12_34, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc12_34: init %i32 = call %Convert.specific_fn.loc12_34(%int_0.loc12) [template = constants.%int_0.2] @@ -330,14 +330,14 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %int_0.loc13: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %Negate.ref.loc13: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %int_1.loc13: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc13_34: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc13_34: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc13_34: = bound_method %int_1.loc13, %impl.elem0.loc13_34 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc13_34: = specific_function %Convert.bound.loc13_34, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc13_34: init %i32 = call %Convert.specific_fn.loc13_34(%int_1.loc13) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc13_34.1: %i32 = value_of_initializer %int.convert_checked.loc13_34 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc13_34.2: %i32 = converted %int_1.loc13, %.loc13_34.1 [template = constants.%int_1.2] // CHECK:STDOUT: %int.snegate.loc13: init %i32 = call %Negate.ref.loc13(%.loc13_34.2) [template = constants.%int_-1] -// CHECK:STDOUT: %impl.elem0.loc13_24: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc13_24: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc13_24: = bound_method %int_0.loc13, %impl.elem0.loc13_24 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc13_24: = specific_function %Convert.bound.loc13_24, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc13_24: init %i32 = call %Convert.specific_fn.loc13_24(%int_0.loc13) [template = constants.%int_0.2] diff --git a/toolchain/check/testdata/builtins/int/neq.carbon b/toolchain/check/testdata/builtins/int/neq.carbon index 0767f710c642f..a593d58007a43 100644 --- a/toolchain/check/testdata/builtins/int/neq.carbon +++ b/toolchain/check/testdata/builtins/int/neq.carbon @@ -43,7 +43,7 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -170,13 +170,13 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %Neq.ref.loc8: %Neq.type = name_ref Neq, file.%Neq.decl [template = constants.%Neq] // CHECK:STDOUT: %int_1.loc8_21: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_1.loc8_24: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc8_21: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc8_21: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc8_21: = bound_method %int_1.loc8_21, %impl.elem0.loc8_21 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc8_21: = specific_function %Convert.bound.loc8_21, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc8_21: init %i32 = call %Convert.specific_fn.loc8_21(%int_1.loc8_21) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc8_21.1: %i32 = value_of_initializer %int.convert_checked.loc8_21 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc8_21.2: %i32 = converted %int_1.loc8_21, %.loc8_21.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc8_24: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc8_24: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc8_24: = bound_method %int_1.loc8_24, %impl.elem0.loc8_24 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc8_24: = specific_function %Convert.bound.loc8_24, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc8_24: init %i32 = call %Convert.specific_fn.loc8_24(%int_1.loc8_24) [template = constants.%int_1.2] @@ -201,13 +201,13 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %Neq.ref.loc9: %Neq.type = name_ref Neq, file.%Neq.decl [template = constants.%Neq] // CHECK:STDOUT: %int_1.loc9: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %impl.elem0.loc9_20: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc9_20: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc9_20: = bound_method %int_1.loc9, %impl.elem0.loc9_20 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc9_20: = specific_function %Convert.bound.loc9_20, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc9_20: init %i32 = call %Convert.specific_fn.loc9_20(%int_1.loc9) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc9_20.1: %i32 = value_of_initializer %int.convert_checked.loc9_20 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc9_20.2: %i32 = converted %int_1.loc9, %.loc9_20.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc9_23: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc9_23: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc9_23: = bound_method %int_2, %impl.elem0.loc9_23 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc9_23: = specific_function %Convert.bound.loc9_23, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc9_23: init %i32 = call %Convert.specific_fn.loc9_23(%int_2) [template = constants.%int_2.2] diff --git a/toolchain/check/testdata/builtins/int/right_shift.carbon b/toolchain/check/testdata/builtins/int/right_shift.carbon index b32b0cce6901e..b97ad19732e20 100644 --- a/toolchain/check/testdata/builtins/int/right_shift.carbon +++ b/toolchain/check/testdata/builtins/int/right_shift.carbon @@ -285,7 +285,7 @@ let negative: i32 = RightShift(1, Negate(1)); // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32.1) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32.1) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -376,13 +376,13 @@ let negative: i32 = RightShift(1, Negate(1)); // CHECK:STDOUT: %RightShift.ref.loc8: %RightShift.type.1 = name_ref RightShift, file.%RightShift.decl [template = constants.%RightShift] // CHECK:STDOUT: %int_1.loc8: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_31: Core.IntLiteral = int_value 31 [template = constants.%int_31.1] -// CHECK:STDOUT: %impl.elem0.loc8_30: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc8_30: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc8_30: = bound_method %int_1.loc8, %impl.elem0.loc8_30 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc8_30: = specific_function %Convert.bound.loc8_30, @Convert.2(constants.%int_32.1) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc8_30: init %i32 = call %Convert.specific_fn.loc8_30(%int_1.loc8) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc8_30.1: %i32 = value_of_initializer %int.convert_checked.loc8_30 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc8_30.2: %i32 = converted %int_1.loc8, %.loc8_30.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc8_33: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc8_33: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc8_33: = bound_method %int_31, %impl.elem0.loc8_33 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc8_33: = specific_function %Convert.bound.loc8_33, @Convert.2(constants.%int_32.1) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc8_33: init %i32 = call %Convert.specific_fn.loc8_33(%int_31) [template = constants.%int_31.2] @@ -395,13 +395,13 @@ let negative: i32 = RightShift(1, Negate(1)); // CHECK:STDOUT: %RightShift.ref.loc13: %RightShift.type.1 = name_ref RightShift, file.%RightShift.decl [template = constants.%RightShift] // CHECK:STDOUT: %int_1.loc13: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32.1] -// CHECK:STDOUT: %impl.elem0.loc13_30: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc13_30: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc13_30: = bound_method %int_1.loc13, %impl.elem0.loc13_30 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc13_30: = specific_function %Convert.bound.loc13_30, @Convert.2(constants.%int_32.1) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc13_30: init %i32 = call %Convert.specific_fn.loc13_30(%int_1.loc13) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc13_30.1: %i32 = value_of_initializer %int.convert_checked.loc13_30 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc13_30.2: %i32 = converted %int_1.loc13, %.loc13_30.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc13_33: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc13_33: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc13_33: = bound_method %int_32, %impl.elem0.loc13_33 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc13_33: = specific_function %Convert.bound.loc13_33, @Convert.2(constants.%int_32.1) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc13_33: init %i32 = call %Convert.specific_fn.loc13_33(%int_32) [template = constants.%int_32.2] @@ -414,13 +414,13 @@ let negative: i32 = RightShift(1, Negate(1)); // CHECK:STDOUT: %RightShift.ref.loc18: %RightShift.type.1 = name_ref RightShift, file.%RightShift.decl [template = constants.%RightShift] // CHECK:STDOUT: %int_1.loc18: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_33: Core.IntLiteral = int_value 33 [template = constants.%int_33.1] -// CHECK:STDOUT: %impl.elem0.loc18_30: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc18_30: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc18_30: = bound_method %int_1.loc18, %impl.elem0.loc18_30 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc18_30: = specific_function %Convert.bound.loc18_30, @Convert.2(constants.%int_32.1) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc18_30: init %i32 = call %Convert.specific_fn.loc18_30(%int_1.loc18) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc18_30.1: %i32 = value_of_initializer %int.convert_checked.loc18_30 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc18_30.2: %i32 = converted %int_1.loc18, %.loc18_30.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc18_33: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc18_33: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc18_33: = bound_method %int_33, %impl.elem0.loc18_33 [template = constants.%Convert.bound.4] // CHECK:STDOUT: %Convert.specific_fn.loc18_33: = specific_function %Convert.bound.loc18_33, @Convert.2(constants.%int_32.1) [template = constants.%Convert.specific_fn.4] // CHECK:STDOUT: %int.convert_checked.loc18_33: init %i32 = call %Convert.specific_fn.loc18_33(%int_33) [template = constants.%int_33.2] @@ -434,14 +434,14 @@ let negative: i32 = RightShift(1, Negate(1)); // CHECK:STDOUT: %int_1.loc24_32: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %Negate.ref: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %int_1.loc24_42: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc24_42: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc24_42: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc24_42: = bound_method %int_1.loc24_42, %impl.elem0.loc24_42 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc24_42: = specific_function %Convert.bound.loc24_42, @Convert.2(constants.%int_32.1) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc24_42: init %i32 = call %Convert.specific_fn.loc24_42(%int_1.loc24_42) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc24_42.1: %i32 = value_of_initializer %int.convert_checked.loc24_42 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc24_42.2: %i32 = converted %int_1.loc24_42, %.loc24_42.1 [template = constants.%int_1.2] // CHECK:STDOUT: %int.snegate: init %i32 = call %Negate.ref(%.loc24_42.2) [template = constants.%int_-1] -// CHECK:STDOUT: %impl.elem0.loc24_32: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc24_32: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc24_32: = bound_method %int_1.loc24_32, %impl.elem0.loc24_32 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc24_32: = specific_function %Convert.bound.loc24_32, @Convert.2(constants.%int_32.1) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc24_32: init %i32 = call %Convert.specific_fn.loc24_32(%int_1.loc24_32) [template = constants.%int_1.2] diff --git a/toolchain/check/testdata/builtins/int/sadd.carbon b/toolchain/check/testdata/builtins/int/sadd.carbon index 0737efcc02746..853f11cc47754 100644 --- a/toolchain/check/testdata/builtins/int/sadd.carbon +++ b/toolchain/check/testdata/builtins/int/sadd.carbon @@ -485,7 +485,7 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_2147483647.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2147483647.2: %i32 = int_value 2147483647 [template] @@ -550,13 +550,13 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: %Add.ref.loc6: %Add.type.1 = name_ref Add, file.%Add.decl [template = constants.%Add] // CHECK:STDOUT: %int_2147483647.loc6: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0.loc6_18: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc6_18: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc6_18: = bound_method %int_2147483647.loc6, %impl.elem0.loc6_18 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc6_18: = specific_function %Convert.bound.loc6_18, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc6_18: init %i32 = call %Convert.specific_fn.loc6_18(%int_2147483647.loc6) [template = constants.%int_2147483647.2] // CHECK:STDOUT: %.loc6_18.1: %i32 = value_of_initializer %int.convert_checked.loc6_18 [template = constants.%int_2147483647.2] // CHECK:STDOUT: %.loc6_18.2: %i32 = converted %int_2147483647.loc6, %.loc6_18.1 [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %impl.elem0.loc6_30: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc6_30: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc6_30: = bound_method %int_0, %impl.elem0.loc6_30 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc6_30: = specific_function %Convert.bound.loc6_30, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc6_30: init %i32 = call %Convert.specific_fn.loc6_30(%int_0) [template = constants.%int_0.2] @@ -569,13 +569,13 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: %Add.ref.loc10: %Add.type.1 = name_ref Add, file.%Add.decl [template = constants.%Add] // CHECK:STDOUT: %int_2147483647.loc10: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc10_18: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc10_18: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc10_18: = bound_method %int_2147483647.loc10, %impl.elem0.loc10_18 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc10_18: = specific_function %Convert.bound.loc10_18, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc10_18: init %i32 = call %Convert.specific_fn.loc10_18(%int_2147483647.loc10) [template = constants.%int_2147483647.2] // CHECK:STDOUT: %.loc10_18.1: %i32 = value_of_initializer %int.convert_checked.loc10_18 [template = constants.%int_2147483647.2] // CHECK:STDOUT: %.loc10_18.2: %i32 = converted %int_2147483647.loc10, %.loc10_18.1 [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %impl.elem0.loc10_30: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc10_30: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc10_30: = bound_method %int_1, %impl.elem0.loc10_30 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc10_30: = specific_function %Convert.bound.loc10_30, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc10_30: init %i32 = call %Convert.specific_fn.loc10_30(%int_1) [template = constants.%int_1.2] diff --git a/toolchain/check/testdata/builtins/int/sdiv.carbon b/toolchain/check/testdata/builtins/int/sdiv.carbon index c5cbd9c2a52e1..9a86c2ad1c3dd 100644 --- a/toolchain/check/testdata/builtins/int/sdiv.carbon +++ b/toolchain/check/testdata/builtins/int/sdiv.carbon @@ -179,7 +179,7 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_2147483647.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2147483647.2: %i32 = int_value 2147483647 [template] @@ -292,7 +292,7 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: %Div.ref.loc9: %Div.type.1 = name_ref Div, file.%Div.decl [template = constants.%Div] // CHECK:STDOUT: %Negate.ref.loc9_18: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %int_2147483647.loc9: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] -// CHECK:STDOUT: %impl.elem0.loc9_25: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc9_25: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc9_25: = bound_method %int_2147483647.loc9, %impl.elem0.loc9_25 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc9_25: = specific_function %Convert.bound.loc9_25, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc9_25: init %i32 = call %Convert.specific_fn.loc9_25(%int_2147483647.loc9) [template = constants.%int_2147483647.2] @@ -301,7 +301,7 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: %int.snegate.loc9_36: init %i32 = call %Negate.ref.loc9_18(%.loc9_25.2) [template = constants.%int_-2147483647] // CHECK:STDOUT: %Negate.ref.loc9_39: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %int_1.loc9: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc9_46: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc9_46: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc9_46: = bound_method %int_1.loc9, %impl.elem0.loc9_46 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc9_46: = specific_function %Convert.bound.loc9_46, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc9_46: init %i32 = call %Convert.specific_fn.loc9_46(%int_1.loc9) [template = constants.%int_1.2] @@ -320,7 +320,7 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: %Sub.ref.loc12: %Sub.type.1 = name_ref Sub, file.%Sub.decl [template = constants.%Sub] // CHECK:STDOUT: %Negate.ref.loc12: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %int_2147483647.loc12: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] -// CHECK:STDOUT: %impl.elem0.loc12_29: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc12_29: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc12_29: = bound_method %int_2147483647.loc12, %impl.elem0.loc12_29 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc12_29: = specific_function %Convert.bound.loc12_29, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc12_29: init %i32 = call %Convert.specific_fn.loc12_29(%int_2147483647.loc12) [template = constants.%int_2147483647.2] @@ -330,7 +330,7 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: %int_1.loc12_43: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %.loc12_40.1: %i32 = value_of_initializer %int.snegate.loc12 [template = constants.%int_-2147483647] // CHECK:STDOUT: %.loc12_40.2: %i32 = converted %int.snegate.loc12, %.loc12_40.1 [template = constants.%int_-2147483647] -// CHECK:STDOUT: %impl.elem0.loc12_43: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc12_43: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc12_43: = bound_method %int_1.loc12_43, %impl.elem0.loc12_43 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc12_43: = specific_function %Convert.bound.loc12_43, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc12_43: init %i32 = call %Convert.specific_fn.loc12_43(%int_1.loc12_43) [template = constants.%int_1.2] @@ -340,7 +340,7 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: %int_1.loc12_47: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %.loc12_44.1: %i32 = value_of_initializer %int.ssub.loc12 [template = constants.%int_-2147483648] // CHECK:STDOUT: %.loc12_44.2: %i32 = converted %int.ssub.loc12, %.loc12_44.1 [template = constants.%int_-2147483648] -// CHECK:STDOUT: %impl.elem0.loc12_47: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc12_47: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc12_47: = bound_method %int_1.loc12_47, %impl.elem0.loc12_47 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc12_47: = specific_function %Convert.bound.loc12_47, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc12_47: init %i32 = call %Convert.specific_fn.loc12_47(%int_1.loc12_47) [template = constants.%int_1.2] @@ -354,7 +354,7 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: %Sub.ref.loc19: %Sub.type.1 = name_ref Sub, file.%Sub.decl [template = constants.%Sub] // CHECK:STDOUT: %Negate.ref.loc19_22: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %int_2147483647.loc19: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] -// CHECK:STDOUT: %impl.elem0.loc19_29: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc19_29: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc19_29: = bound_method %int_2147483647.loc19, %impl.elem0.loc19_29 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc19_29: = specific_function %Convert.bound.loc19_29, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc19_29: init %i32 = call %Convert.specific_fn.loc19_29(%int_2147483647.loc19) [template = constants.%int_2147483647.2] @@ -364,7 +364,7 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: %int_1.loc19_43: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %.loc19_40.1: %i32 = value_of_initializer %int.snegate.loc19_40 [template = constants.%int_-2147483647] // CHECK:STDOUT: %.loc19_40.2: %i32 = converted %int.snegate.loc19_40, %.loc19_40.1 [template = constants.%int_-2147483647] -// CHECK:STDOUT: %impl.elem0.loc19_43: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc19_43: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc19_43: = bound_method %int_1.loc19_43, %impl.elem0.loc19_43 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc19_43: = specific_function %Convert.bound.loc19_43, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc19_43: init %i32 = call %Convert.specific_fn.loc19_43(%int_1.loc19_43) [template = constants.%int_1.2] @@ -373,7 +373,7 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: %int.ssub.loc19: init %i32 = call %Sub.ref.loc19(%.loc19_40.2, %.loc19_43.2) [template = constants.%int_-2147483648] // CHECK:STDOUT: %Negate.ref.loc19_47: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %int_1.loc19_54: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc19_54: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc19_54: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc19_54: = bound_method %int_1.loc19_54, %impl.elem0.loc19_54 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc19_54: = specific_function %Convert.bound.loc19_54, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc19_54: init %i32 = call %Convert.specific_fn.loc19_54(%int_1.loc19_54) [template = constants.%int_1.2] @@ -403,7 +403,7 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -463,13 +463,13 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: %Div.ref.loc10: %Div.type.1 = name_ref Div, file.%Div.decl [template = constants.%Div] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_0.loc10: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0.loc10_18: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc10_18: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc10_18: = bound_method %int_1, %impl.elem0.loc10_18 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc10_18: = specific_function %Convert.bound.loc10_18, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc10_18: init %i32 = call %Convert.specific_fn.loc10_18(%int_1) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc10_18.1: %i32 = value_of_initializer %int.convert_checked.loc10_18 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc10_18.2: %i32 = converted %int_1, %.loc10_18.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc10_21: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc10_21: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc10_21: = bound_method %int_0.loc10, %impl.elem0.loc10_21 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc10_21: = specific_function %Convert.bound.loc10_21, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc10_21: init %i32 = call %Convert.specific_fn.loc10_21(%int_0.loc10) [template = constants.%int_0.2] @@ -482,13 +482,13 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: %Div.ref.loc15: %Div.type.1 = name_ref Div, file.%Div.decl [template = constants.%Div] // CHECK:STDOUT: %int_0.loc15_18: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %int_0.loc15_21: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0.loc15_18: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc15_18: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc15_18: = bound_method %int_0.loc15_18, %impl.elem0.loc15_18 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc15_18: = specific_function %Convert.bound.loc15_18, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc15_18: init %i32 = call %Convert.specific_fn.loc15_18(%int_0.loc15_18) [template = constants.%int_0.2] // CHECK:STDOUT: %.loc15_18.1: %i32 = value_of_initializer %int.convert_checked.loc15_18 [template = constants.%int_0.2] // CHECK:STDOUT: %.loc15_18.2: %i32 = converted %int_0.loc15_18, %.loc15_18.1 [template = constants.%int_0.2] -// CHECK:STDOUT: %impl.elem0.loc15_21: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc15_21: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc15_21: = bound_method %int_0.loc15_21, %impl.elem0.loc15_21 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc15_21: = specific_function %Convert.bound.loc15_21, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc15_21: init %i32 = call %Convert.specific_fn.loc15_21(%int_0.loc15_21) [template = constants.%int_0.2] diff --git a/toolchain/check/testdata/builtins/int/smod.carbon b/toolchain/check/testdata/builtins/int/smod.carbon index e529f6346131a..c6ae78058e84c 100644 --- a/toolchain/check/testdata/builtins/int/smod.carbon +++ b/toolchain/check/testdata/builtins/int/smod.carbon @@ -182,7 +182,7 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_2147483647.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2147483647.2: %i32 = int_value 2147483647 [template] @@ -296,7 +296,7 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: %Mod.ref.loc9: %Mod.type.1 = name_ref Mod, file.%Mod.decl [template = constants.%Mod] // CHECK:STDOUT: %Negate.ref.loc9_18: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %int_2147483647.loc9: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] -// CHECK:STDOUT: %impl.elem0.loc9_25: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc9_25: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc9_25: = bound_method %int_2147483647.loc9, %impl.elem0.loc9_25 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc9_25: = specific_function %Convert.bound.loc9_25, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc9_25: init %i32 = call %Convert.specific_fn.loc9_25(%int_2147483647.loc9) [template = constants.%int_2147483647.2] @@ -305,7 +305,7 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: %int.snegate.loc9_36: init %i32 = call %Negate.ref.loc9_18(%.loc9_25.2) [template = constants.%int_-2147483647] // CHECK:STDOUT: %Negate.ref.loc9_39: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %int_1.loc9: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc9_46: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc9_46: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc9_46: = bound_method %int_1.loc9, %impl.elem0.loc9_46 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc9_46: = specific_function %Convert.bound.loc9_46, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc9_46: init %i32 = call %Convert.specific_fn.loc9_46(%int_1.loc9) [template = constants.%int_1.2] @@ -324,7 +324,7 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: %Sub.ref.loc12: %Sub.type.1 = name_ref Sub, file.%Sub.decl [template = constants.%Sub] // CHECK:STDOUT: %Negate.ref.loc12: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %int_2147483647.loc12: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] -// CHECK:STDOUT: %impl.elem0.loc12_29: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc12_29: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc12_29: = bound_method %int_2147483647.loc12, %impl.elem0.loc12_29 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc12_29: = specific_function %Convert.bound.loc12_29, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc12_29: init %i32 = call %Convert.specific_fn.loc12_29(%int_2147483647.loc12) [template = constants.%int_2147483647.2] @@ -334,7 +334,7 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: %int_1.loc12_43: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %.loc12_40.1: %i32 = value_of_initializer %int.snegate.loc12 [template = constants.%int_-2147483647] // CHECK:STDOUT: %.loc12_40.2: %i32 = converted %int.snegate.loc12, %.loc12_40.1 [template = constants.%int_-2147483647] -// CHECK:STDOUT: %impl.elem0.loc12_43: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc12_43: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc12_43: = bound_method %int_1.loc12_43, %impl.elem0.loc12_43 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc12_43: = specific_function %Convert.bound.loc12_43, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc12_43: init %i32 = call %Convert.specific_fn.loc12_43(%int_1.loc12_43) [template = constants.%int_1.2] @@ -344,7 +344,7 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: %int_1.loc12_47: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %.loc12_44.1: %i32 = value_of_initializer %int.ssub.loc12 [template = constants.%int_-2147483648] // CHECK:STDOUT: %.loc12_44.2: %i32 = converted %int.ssub.loc12, %.loc12_44.1 [template = constants.%int_-2147483648] -// CHECK:STDOUT: %impl.elem0.loc12_47: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc12_47: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc12_47: = bound_method %int_1.loc12_47, %impl.elem0.loc12_47 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc12_47: = specific_function %Convert.bound.loc12_47, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc12_47: init %i32 = call %Convert.specific_fn.loc12_47(%int_1.loc12_47) [template = constants.%int_1.2] @@ -358,7 +358,7 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: %Sub.ref.loc20: %Sub.type.1 = name_ref Sub, file.%Sub.decl [template = constants.%Sub] // CHECK:STDOUT: %Negate.ref.loc20_22: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %int_2147483647.loc20: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] -// CHECK:STDOUT: %impl.elem0.loc20_29: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc20_29: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc20_29: = bound_method %int_2147483647.loc20, %impl.elem0.loc20_29 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc20_29: = specific_function %Convert.bound.loc20_29, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc20_29: init %i32 = call %Convert.specific_fn.loc20_29(%int_2147483647.loc20) [template = constants.%int_2147483647.2] @@ -368,7 +368,7 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: %int_1.loc20_43: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %.loc20_40.1: %i32 = value_of_initializer %int.snegate.loc20_40 [template = constants.%int_-2147483647] // CHECK:STDOUT: %.loc20_40.2: %i32 = converted %int.snegate.loc20_40, %.loc20_40.1 [template = constants.%int_-2147483647] -// CHECK:STDOUT: %impl.elem0.loc20_43: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc20_43: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc20_43: = bound_method %int_1.loc20_43, %impl.elem0.loc20_43 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc20_43: = specific_function %Convert.bound.loc20_43, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc20_43: init %i32 = call %Convert.specific_fn.loc20_43(%int_1.loc20_43) [template = constants.%int_1.2] @@ -377,7 +377,7 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: %int.ssub.loc20: init %i32 = call %Sub.ref.loc20(%.loc20_40.2, %.loc20_43.2) [template = constants.%int_-2147483648] // CHECK:STDOUT: %Negate.ref.loc20_47: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %int_1.loc20_54: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc20_54: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc20_54: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc20_54: = bound_method %int_1.loc20_54, %impl.elem0.loc20_54 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc20_54: = specific_function %Convert.bound.loc20_54, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc20_54: init %i32 = call %Convert.specific_fn.loc20_54(%int_1.loc20_54) [template = constants.%int_1.2] @@ -407,7 +407,7 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -467,13 +467,13 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: %Mod.ref.loc12: %Mod.type.1 = name_ref Mod, file.%Mod.decl [template = constants.%Mod] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_0.loc12: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0.loc12_18: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc12_18: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc12_18: = bound_method %int_1, %impl.elem0.loc12_18 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc12_18: = specific_function %Convert.bound.loc12_18, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc12_18: init %i32 = call %Convert.specific_fn.loc12_18(%int_1) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc12_18.1: %i32 = value_of_initializer %int.convert_checked.loc12_18 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc12_18.2: %i32 = converted %int_1, %.loc12_18.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc12_21: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc12_21: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc12_21: = bound_method %int_0.loc12, %impl.elem0.loc12_21 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc12_21: = specific_function %Convert.bound.loc12_21, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc12_21: init %i32 = call %Convert.specific_fn.loc12_21(%int_0.loc12) [template = constants.%int_0.2] @@ -486,13 +486,13 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: %Mod.ref.loc17: %Mod.type.1 = name_ref Mod, file.%Mod.decl [template = constants.%Mod] // CHECK:STDOUT: %int_0.loc17_18: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %int_0.loc17_21: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0.loc17_18: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc17_18: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc17_18: = bound_method %int_0.loc17_18, %impl.elem0.loc17_18 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc17_18: = specific_function %Convert.bound.loc17_18, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc17_18: init %i32 = call %Convert.specific_fn.loc17_18(%int_0.loc17_18) [template = constants.%int_0.2] // CHECK:STDOUT: %.loc17_18.1: %i32 = value_of_initializer %int.convert_checked.loc17_18 [template = constants.%int_0.2] // CHECK:STDOUT: %.loc17_18.2: %i32 = converted %int_0.loc17_18, %.loc17_18.1 [template = constants.%int_0.2] -// CHECK:STDOUT: %impl.elem0.loc17_21: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc17_21: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc17_21: = bound_method %int_0.loc17_21, %impl.elem0.loc17_21 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc17_21: = specific_function %Convert.bound.loc17_21, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc17_21: init %i32 = call %Convert.specific_fn.loc17_21(%int_0.loc17_21) [template = constants.%int_0.2] diff --git a/toolchain/check/testdata/builtins/int/smul.carbon b/toolchain/check/testdata/builtins/int/smul.carbon index 72b5cb63472bf..5cf91e233671d 100644 --- a/toolchain/check/testdata/builtins/int/smul.carbon +++ b/toolchain/check/testdata/builtins/int/smul.carbon @@ -150,7 +150,7 @@ let b: i32 = Mul(0x8000, 0x10000); // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_32767.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_32767.2: %i32 = int_value 32767 [template] @@ -216,13 +216,13 @@ let b: i32 = Mul(0x8000, 0x10000); // CHECK:STDOUT: %Mul.ref.loc6: %Mul.type.1 = name_ref Mul, file.%Mul.decl [template = constants.%Mul] // CHECK:STDOUT: %int_32767: Core.IntLiteral = int_value 32767 [template = constants.%int_32767.1] // CHECK:STDOUT: %int_65536.loc6: Core.IntLiteral = int_value 65536 [template = constants.%int_65536.1] -// CHECK:STDOUT: %impl.elem0.loc6_18: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc6_18: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc6_18: = bound_method %int_32767, %impl.elem0.loc6_18 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc6_18: = specific_function %Convert.bound.loc6_18, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc6_18: init %i32 = call %Convert.specific_fn.loc6_18(%int_32767) [template = constants.%int_32767.2] // CHECK:STDOUT: %.loc6_18.1: %i32 = value_of_initializer %int.convert_checked.loc6_18 [template = constants.%int_32767.2] // CHECK:STDOUT: %.loc6_18.2: %i32 = converted %int_32767, %.loc6_18.1 [template = constants.%int_32767.2] -// CHECK:STDOUT: %impl.elem0.loc6_26: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc6_26: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc6_26: = bound_method %int_65536.loc6, %impl.elem0.loc6_26 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc6_26: = specific_function %Convert.bound.loc6_26, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc6_26: init %i32 = call %Convert.specific_fn.loc6_26(%int_65536.loc6) [template = constants.%int_65536.2] @@ -235,13 +235,13 @@ let b: i32 = Mul(0x8000, 0x10000); // CHECK:STDOUT: %Mul.ref.loc10: %Mul.type.1 = name_ref Mul, file.%Mul.decl [template = constants.%Mul] // CHECK:STDOUT: %int_32768: Core.IntLiteral = int_value 32768 [template = constants.%int_32768.1] // CHECK:STDOUT: %int_65536.loc10: Core.IntLiteral = int_value 65536 [template = constants.%int_65536.1] -// CHECK:STDOUT: %impl.elem0.loc10_18: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc10_18: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc10_18: = bound_method %int_32768, %impl.elem0.loc10_18 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc10_18: = specific_function %Convert.bound.loc10_18, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc10_18: init %i32 = call %Convert.specific_fn.loc10_18(%int_32768) [template = constants.%int_32768.2] // CHECK:STDOUT: %.loc10_18.1: %i32 = value_of_initializer %int.convert_checked.loc10_18 [template = constants.%int_32768.2] // CHECK:STDOUT: %.loc10_18.2: %i32 = converted %int_32768, %.loc10_18.1 [template = constants.%int_32768.2] -// CHECK:STDOUT: %impl.elem0.loc10_26: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc10_26: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc10_26: = bound_method %int_65536.loc10, %impl.elem0.loc10_26 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc10_26: = specific_function %Convert.bound.loc10_26, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc10_26: init %i32 = call %Convert.specific_fn.loc10_26(%int_65536.loc10) [template = constants.%int_65536.2] diff --git a/toolchain/check/testdata/builtins/int/snegate.carbon b/toolchain/check/testdata/builtins/int/snegate.carbon index 829736364d21a..d680c18e6bcdc 100644 --- a/toolchain/check/testdata/builtins/int/snegate.carbon +++ b/toolchain/check/testdata/builtins/int/snegate.carbon @@ -127,7 +127,7 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %array_type: type = array_type %int_123.1, %i32 [template] // CHECK:STDOUT: %ptr: type = ptr_type %array_type [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] @@ -223,7 +223,7 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %arr_p: %ptr = bind_name arr_p, %addr // CHECK:STDOUT: %Negate.ref: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1, %impl.elem0 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_1) [template = constants.%int_1.2] @@ -485,7 +485,7 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_2147483647.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2147483647.2: %i32 = int_value 2147483647 [template] @@ -568,7 +568,7 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %Negate.ref.loc8_14: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %Negate.ref.loc8_21: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %int_2147483647.loc8: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] -// CHECK:STDOUT: %impl.elem0.loc8: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc8: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc8: = bound_method %int_2147483647.loc8, %impl.elem0.loc8 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc8: = specific_function %Convert.bound.loc8, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc8: init %i32 = call %Convert.specific_fn.loc8(%int_2147483647.loc8) [template = constants.%int_2147483647.2] @@ -585,7 +585,7 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %Sub.ref: %Sub.type.1 = name_ref Sub, file.%Sub.decl [template = constants.%Sub] // CHECK:STDOUT: %Negate.ref.loc14_25: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %int_2147483647.loc14: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] -// CHECK:STDOUT: %impl.elem0.loc14_32: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc14_32: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc14_32: = bound_method %int_2147483647.loc14, %impl.elem0.loc14_32 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc14_32: = specific_function %Convert.bound.loc14_32, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc14_32: init %i32 = call %Convert.specific_fn.loc14_32(%int_2147483647.loc14) [template = constants.%int_2147483647.2] @@ -595,7 +595,7 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %.loc14_42.1: %i32 = value_of_initializer %int.snegate.loc14_42 [template = constants.%int_-2147483647] // CHECK:STDOUT: %.loc14_42.2: %i32 = converted %int.snegate.loc14_42, %.loc14_42.1 [template = constants.%int_-2147483647] -// CHECK:STDOUT: %impl.elem0.loc14_45: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc14_45: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc14_45: = bound_method %int_1, %impl.elem0.loc14_45 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc14_45: = specific_function %Convert.bound.loc14_45, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc14_45: init %i32 = call %Convert.specific_fn.loc14_45(%int_1) [template = constants.%int_1.2] diff --git a/toolchain/check/testdata/builtins/int/ssub.carbon b/toolchain/check/testdata/builtins/int/ssub.carbon index 308e79c50eb2d..d80d5d28a5ecd 100644 --- a/toolchain/check/testdata/builtins/int/ssub.carbon +++ b/toolchain/check/testdata/builtins/int/ssub.carbon @@ -151,7 +151,7 @@ let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] @@ -222,13 +222,13 @@ let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDOUT: %Sub.ref.loc6: %Sub.type.1 = name_ref Sub, file.%Sub.decl [template = constants.%Sub] // CHECK:STDOUT: %int_0.loc6: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %int_2147483647.loc6: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] -// CHECK:STDOUT: %impl.elem0.loc6_18: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc6_18: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc6_18: = bound_method %int_0.loc6, %impl.elem0.loc6_18 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc6_18: = specific_function %Convert.bound.loc6_18, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc6_18: init %i32 = call %Convert.specific_fn.loc6_18(%int_0.loc6) [template = constants.%int_0.2] // CHECK:STDOUT: %.loc6_18.1: %i32 = value_of_initializer %int.convert_checked.loc6_18 [template = constants.%int_0.2] // CHECK:STDOUT: %.loc6_18.2: %i32 = converted %int_0.loc6, %.loc6_18.1 [template = constants.%int_0.2] -// CHECK:STDOUT: %impl.elem0.loc6_21: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc6_21: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc6_21: = bound_method %int_2147483647.loc6, %impl.elem0.loc6_21 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc6_21: = specific_function %Convert.bound.loc6_21, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc6_21: init %i32 = call %Convert.specific_fn.loc6_21(%int_2147483647.loc6) [template = constants.%int_2147483647.2] @@ -242,13 +242,13 @@ let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDOUT: %Sub.ref.loc7_18: %Sub.type.1 = name_ref Sub, file.%Sub.decl [template = constants.%Sub] // CHECK:STDOUT: %int_0.loc7: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %int_2147483647.loc7: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] -// CHECK:STDOUT: %impl.elem0.loc7_22: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc7_22: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc7_22: = bound_method %int_0.loc7, %impl.elem0.loc7_22 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc7_22: = specific_function %Convert.bound.loc7_22, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc7_22: init %i32 = call %Convert.specific_fn.loc7_22(%int_0.loc7) [template = constants.%int_0.2] // CHECK:STDOUT: %.loc7_22.1: %i32 = value_of_initializer %int.convert_checked.loc7_22 [template = constants.%int_0.2] // CHECK:STDOUT: %.loc7_22.2: %i32 = converted %int_0.loc7, %.loc7_22.1 [template = constants.%int_0.2] -// CHECK:STDOUT: %impl.elem0.loc7_25: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc7_25: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc7_25: = bound_method %int_2147483647.loc7, %impl.elem0.loc7_25 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc7_25: = specific_function %Convert.bound.loc7_25, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc7_25: init %i32 = call %Convert.specific_fn.loc7_25(%int_2147483647.loc7) [template = constants.%int_2147483647.2] @@ -258,7 +258,7 @@ let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %.loc7_35.1: %i32 = value_of_initializer %int.ssub.loc7_35 [template = constants.%int_-2147483647] // CHECK:STDOUT: %.loc7_35.2: %i32 = converted %int.ssub.loc7_35, %.loc7_35.1 [template = constants.%int_-2147483647] -// CHECK:STDOUT: %impl.elem0.loc7_38: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc7_38: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc7_38: = bound_method %int_1, %impl.elem0.loc7_38 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc7_38: = specific_function %Convert.bound.loc7_38, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc7_38: init %i32 = call %Convert.specific_fn.loc7_38(%int_1) [template = constants.%int_1.2] @@ -272,13 +272,13 @@ let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDOUT: %Sub.ref.loc11_18: %Sub.type.1 = name_ref Sub, file.%Sub.decl [template = constants.%Sub] // CHECK:STDOUT: %int_0.loc11: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %int_2147483647.loc11: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] -// CHECK:STDOUT: %impl.elem0.loc11_22: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11_22: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_22: = bound_method %int_0.loc11, %impl.elem0.loc11_22 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc11_22: = specific_function %Convert.bound.loc11_22, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc11_22: init %i32 = call %Convert.specific_fn.loc11_22(%int_0.loc11) [template = constants.%int_0.2] // CHECK:STDOUT: %.loc11_22.1: %i32 = value_of_initializer %int.convert_checked.loc11_22 [template = constants.%int_0.2] // CHECK:STDOUT: %.loc11_22.2: %i32 = converted %int_0.loc11, %.loc11_22.1 [template = constants.%int_0.2] -// CHECK:STDOUT: %impl.elem0.loc11_25: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11_25: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_25: = bound_method %int_2147483647.loc11, %impl.elem0.loc11_25 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc11_25: = specific_function %Convert.bound.loc11_25, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc11_25: init %i32 = call %Convert.specific_fn.loc11_25(%int_2147483647.loc11) [template = constants.%int_2147483647.2] @@ -288,7 +288,7 @@ let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %.loc11_35.1: %i32 = value_of_initializer %int.ssub.loc11_35 [template = constants.%int_-2147483647] // CHECK:STDOUT: %.loc11_35.2: %i32 = converted %int.ssub.loc11_35, %.loc11_35.1 [template = constants.%int_-2147483647] -// CHECK:STDOUT: %impl.elem0.loc11_38: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11_38: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_38: = bound_method %int_2, %impl.elem0.loc11_38 [template = constants.%Convert.bound.4] // CHECK:STDOUT: %Convert.specific_fn.loc11_38: = specific_function %Convert.bound.loc11_38, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.4] // CHECK:STDOUT: %int.convert_checked.loc11_38: init %i32 = call %Convert.specific_fn.loc11_38(%int_2) [template = constants.%int_2.2] diff --git a/toolchain/check/testdata/builtins/int/uadd.carbon b/toolchain/check/testdata/builtins/int/uadd.carbon index 67a4fdf8ddef9..c6695f0488ac5 100644 --- a/toolchain/check/testdata/builtins/int/uadd.carbon +++ b/toolchain/check/testdata/builtins/int/uadd.carbon @@ -482,7 +482,7 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_2147483647.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2147483647.2: %i32 = int_value 2147483647 [template] @@ -547,13 +547,13 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: %Add.ref.loc7: %Add.type.1 = name_ref Add, file.%Add.decl [template = constants.%Add] // CHECK:STDOUT: %int_2147483647.loc7: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0.loc7_18: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc7_18: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc7_18: = bound_method %int_2147483647.loc7, %impl.elem0.loc7_18 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc7_18: = specific_function %Convert.bound.loc7_18, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc7_18: init %i32 = call %Convert.specific_fn.loc7_18(%int_2147483647.loc7) [template = constants.%int_2147483647.2] // CHECK:STDOUT: %.loc7_18.1: %i32 = value_of_initializer %int.convert_checked.loc7_18 [template = constants.%int_2147483647.2] // CHECK:STDOUT: %.loc7_18.2: %i32 = converted %int_2147483647.loc7, %.loc7_18.1 [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %impl.elem0.loc7_30: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc7_30: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc7_30: = bound_method %int_0, %impl.elem0.loc7_30 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc7_30: = specific_function %Convert.bound.loc7_30, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc7_30: init %i32 = call %Convert.specific_fn.loc7_30(%int_0) [template = constants.%int_0.2] @@ -566,13 +566,13 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: %Add.ref.loc8: %Add.type.1 = name_ref Add, file.%Add.decl [template = constants.%Add] // CHECK:STDOUT: %int_2147483647.loc8: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc8_18: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc8_18: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc8_18: = bound_method %int_2147483647.loc8, %impl.elem0.loc8_18 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc8_18: = specific_function %Convert.bound.loc8_18, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc8_18: init %i32 = call %Convert.specific_fn.loc8_18(%int_2147483647.loc8) [template = constants.%int_2147483647.2] // CHECK:STDOUT: %.loc8_18.1: %i32 = value_of_initializer %int.convert_checked.loc8_18 [template = constants.%int_2147483647.2] // CHECK:STDOUT: %.loc8_18.2: %i32 = converted %int_2147483647.loc8, %.loc8_18.1 [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %impl.elem0.loc8_30: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc8_30: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc8_30: = bound_method %int_1, %impl.elem0.loc8_30 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc8_30: = specific_function %Convert.bound.loc8_30, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc8_30: init %i32 = call %Convert.specific_fn.loc8_30(%int_1) [template = constants.%int_1.2] diff --git a/toolchain/check/testdata/builtins/int/udiv.carbon b/toolchain/check/testdata/builtins/int/udiv.carbon index 1e529db8ee3a4..605d5ac2801ee 100644 --- a/toolchain/check/testdata/builtins/int/udiv.carbon +++ b/toolchain/check/testdata/builtins/int/udiv.carbon @@ -175,7 +175,7 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_2147483647.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2147483647.2: %i32 = int_value 2147483647 [template] @@ -289,7 +289,7 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: %Div.ref.loc9: %Div.type.1 = name_ref Div, file.%Div.decl [template = constants.%Div] // CHECK:STDOUT: %Negate.ref.loc9_18: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %int_2147483647.loc9: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] -// CHECK:STDOUT: %impl.elem0.loc9_25: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc9_25: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc9_25: = bound_method %int_2147483647.loc9, %impl.elem0.loc9_25 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc9_25: = specific_function %Convert.bound.loc9_25, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc9_25: init %i32 = call %Convert.specific_fn.loc9_25(%int_2147483647.loc9) [template = constants.%int_2147483647.2] @@ -298,7 +298,7 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: %int.unegate.loc9_36: init %i32 = call %Negate.ref.loc9_18(%.loc9_25.2) [template = constants.%int_-2147483647] // CHECK:STDOUT: %Negate.ref.loc9_39: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %int_1.loc9: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc9_46: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc9_46: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc9_46: = bound_method %int_1.loc9, %impl.elem0.loc9_46 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc9_46: = specific_function %Convert.bound.loc9_46, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc9_46: init %i32 = call %Convert.specific_fn.loc9_46(%int_1.loc9) [template = constants.%int_1.2] @@ -317,7 +317,7 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: %Sub.ref.loc12: %Sub.type.1 = name_ref Sub, file.%Sub.decl [template = constants.%Sub] // CHECK:STDOUT: %Negate.ref.loc12: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %int_2147483647.loc12: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] -// CHECK:STDOUT: %impl.elem0.loc12_29: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc12_29: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc12_29: = bound_method %int_2147483647.loc12, %impl.elem0.loc12_29 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc12_29: = specific_function %Convert.bound.loc12_29, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc12_29: init %i32 = call %Convert.specific_fn.loc12_29(%int_2147483647.loc12) [template = constants.%int_2147483647.2] @@ -327,7 +327,7 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: %int_1.loc12_43: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %.loc12_40.1: %i32 = value_of_initializer %int.unegate.loc12 [template = constants.%int_-2147483647] // CHECK:STDOUT: %.loc12_40.2: %i32 = converted %int.unegate.loc12, %.loc12_40.1 [template = constants.%int_-2147483647] -// CHECK:STDOUT: %impl.elem0.loc12_43: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc12_43: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc12_43: = bound_method %int_1.loc12_43, %impl.elem0.loc12_43 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc12_43: = specific_function %Convert.bound.loc12_43, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc12_43: init %i32 = call %Convert.specific_fn.loc12_43(%int_1.loc12_43) [template = constants.%int_1.2] @@ -337,7 +337,7 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: %int_1.loc12_47: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %.loc12_44.1: %i32 = value_of_initializer %int.usub.loc12 [template = constants.%int_-2147483648] // CHECK:STDOUT: %.loc12_44.2: %i32 = converted %int.usub.loc12, %.loc12_44.1 [template = constants.%int_-2147483648] -// CHECK:STDOUT: %impl.elem0.loc12_47: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc12_47: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc12_47: = bound_method %int_1.loc12_47, %impl.elem0.loc12_47 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc12_47: = specific_function %Convert.bound.loc12_47, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc12_47: init %i32 = call %Convert.specific_fn.loc12_47(%int_1.loc12_47) [template = constants.%int_1.2] @@ -351,7 +351,7 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: %Sub.ref.loc15: %Sub.type.1 = name_ref Sub, file.%Sub.decl [template = constants.%Sub] // CHECK:STDOUT: %Negate.ref.loc15_22: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %int_2147483647.loc15: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] -// CHECK:STDOUT: %impl.elem0.loc15_29: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc15_29: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc15_29: = bound_method %int_2147483647.loc15, %impl.elem0.loc15_29 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc15_29: = specific_function %Convert.bound.loc15_29, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc15_29: init %i32 = call %Convert.specific_fn.loc15_29(%int_2147483647.loc15) [template = constants.%int_2147483647.2] @@ -361,7 +361,7 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: %int_1.loc15_43: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %.loc15_40.1: %i32 = value_of_initializer %int.unegate.loc15_40 [template = constants.%int_-2147483647] // CHECK:STDOUT: %.loc15_40.2: %i32 = converted %int.unegate.loc15_40, %.loc15_40.1 [template = constants.%int_-2147483647] -// CHECK:STDOUT: %impl.elem0.loc15_43: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc15_43: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc15_43: = bound_method %int_1.loc15_43, %impl.elem0.loc15_43 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc15_43: = specific_function %Convert.bound.loc15_43, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc15_43: init %i32 = call %Convert.specific_fn.loc15_43(%int_1.loc15_43) [template = constants.%int_1.2] @@ -370,7 +370,7 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: %int.usub.loc15: init %i32 = call %Sub.ref.loc15(%.loc15_40.2, %.loc15_43.2) [template = constants.%int_-2147483648] // CHECK:STDOUT: %Negate.ref.loc15_47: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %int_1.loc15_54: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc15_54: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc15_54: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc15_54: = bound_method %int_1.loc15_54, %impl.elem0.loc15_54 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc15_54: = specific_function %Convert.bound.loc15_54, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc15_54: init %i32 = call %Convert.specific_fn.loc15_54(%int_1.loc15_54) [template = constants.%int_1.2] @@ -400,7 +400,7 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -460,13 +460,13 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: %Div.ref.loc10: %Div.type.1 = name_ref Div, file.%Div.decl [template = constants.%Div] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_0.loc10: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0.loc10_18: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc10_18: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc10_18: = bound_method %int_1, %impl.elem0.loc10_18 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc10_18: = specific_function %Convert.bound.loc10_18, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc10_18: init %i32 = call %Convert.specific_fn.loc10_18(%int_1) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc10_18.1: %i32 = value_of_initializer %int.convert_checked.loc10_18 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc10_18.2: %i32 = converted %int_1, %.loc10_18.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc10_21: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc10_21: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc10_21: = bound_method %int_0.loc10, %impl.elem0.loc10_21 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc10_21: = specific_function %Convert.bound.loc10_21, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc10_21: init %i32 = call %Convert.specific_fn.loc10_21(%int_0.loc10) [template = constants.%int_0.2] @@ -479,13 +479,13 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: %Div.ref.loc15: %Div.type.1 = name_ref Div, file.%Div.decl [template = constants.%Div] // CHECK:STDOUT: %int_0.loc15_18: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %int_0.loc15_21: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0.loc15_18: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc15_18: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc15_18: = bound_method %int_0.loc15_18, %impl.elem0.loc15_18 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc15_18: = specific_function %Convert.bound.loc15_18, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc15_18: init %i32 = call %Convert.specific_fn.loc15_18(%int_0.loc15_18) [template = constants.%int_0.2] // CHECK:STDOUT: %.loc15_18.1: %i32 = value_of_initializer %int.convert_checked.loc15_18 [template = constants.%int_0.2] // CHECK:STDOUT: %.loc15_18.2: %i32 = converted %int_0.loc15_18, %.loc15_18.1 [template = constants.%int_0.2] -// CHECK:STDOUT: %impl.elem0.loc15_21: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc15_21: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc15_21: = bound_method %int_0.loc15_21, %impl.elem0.loc15_21 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc15_21: = specific_function %Convert.bound.loc15_21, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc15_21: init %i32 = call %Convert.specific_fn.loc15_21(%int_0.loc15_21) [template = constants.%int_0.2] diff --git a/toolchain/check/testdata/builtins/int/umod.carbon b/toolchain/check/testdata/builtins/int/umod.carbon index 50060fad4c920..623a0c99ee172 100644 --- a/toolchain/check/testdata/builtins/int/umod.carbon +++ b/toolchain/check/testdata/builtins/int/umod.carbon @@ -177,7 +177,7 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_2147483647.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2147483647.2: %i32 = int_value 2147483647 [template] @@ -291,7 +291,7 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: %Mod.ref.loc9: %Mod.type.1 = name_ref Mod, file.%Mod.decl [template = constants.%Mod] // CHECK:STDOUT: %Negate.ref.loc9_18: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %int_2147483647.loc9: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] -// CHECK:STDOUT: %impl.elem0.loc9_25: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc9_25: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc9_25: = bound_method %int_2147483647.loc9, %impl.elem0.loc9_25 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc9_25: = specific_function %Convert.bound.loc9_25, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc9_25: init %i32 = call %Convert.specific_fn.loc9_25(%int_2147483647.loc9) [template = constants.%int_2147483647.2] @@ -300,7 +300,7 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: %int.unegate.loc9_36: init %i32 = call %Negate.ref.loc9_18(%.loc9_25.2) [template = constants.%int_-2147483647] // CHECK:STDOUT: %Negate.ref.loc9_39: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %int_1.loc9: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc9_46: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc9_46: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc9_46: = bound_method %int_1.loc9, %impl.elem0.loc9_46 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc9_46: = specific_function %Convert.bound.loc9_46, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc9_46: init %i32 = call %Convert.specific_fn.loc9_46(%int_1.loc9) [template = constants.%int_1.2] @@ -319,7 +319,7 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: %Sub.ref.loc12: %Sub.type.1 = name_ref Sub, file.%Sub.decl [template = constants.%Sub] // CHECK:STDOUT: %Negate.ref.loc12: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %int_2147483647.loc12: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] -// CHECK:STDOUT: %impl.elem0.loc12_29: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc12_29: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc12_29: = bound_method %int_2147483647.loc12, %impl.elem0.loc12_29 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc12_29: = specific_function %Convert.bound.loc12_29, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc12_29: init %i32 = call %Convert.specific_fn.loc12_29(%int_2147483647.loc12) [template = constants.%int_2147483647.2] @@ -329,7 +329,7 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: %int_1.loc12_43: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %.loc12_40.1: %i32 = value_of_initializer %int.unegate.loc12 [template = constants.%int_-2147483647] // CHECK:STDOUT: %.loc12_40.2: %i32 = converted %int.unegate.loc12, %.loc12_40.1 [template = constants.%int_-2147483647] -// CHECK:STDOUT: %impl.elem0.loc12_43: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc12_43: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc12_43: = bound_method %int_1.loc12_43, %impl.elem0.loc12_43 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc12_43: = specific_function %Convert.bound.loc12_43, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc12_43: init %i32 = call %Convert.specific_fn.loc12_43(%int_1.loc12_43) [template = constants.%int_1.2] @@ -339,7 +339,7 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: %int_1.loc12_47: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %.loc12_44.1: %i32 = value_of_initializer %int.usub.loc12 [template = constants.%int_-2147483648] // CHECK:STDOUT: %.loc12_44.2: %i32 = converted %int.usub.loc12, %.loc12_44.1 [template = constants.%int_-2147483648] -// CHECK:STDOUT: %impl.elem0.loc12_47: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc12_47: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc12_47: = bound_method %int_1.loc12_47, %impl.elem0.loc12_47 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc12_47: = specific_function %Convert.bound.loc12_47, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc12_47: init %i32 = call %Convert.specific_fn.loc12_47(%int_1.loc12_47) [template = constants.%int_1.2] @@ -353,7 +353,7 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: %Sub.ref.loc15: %Sub.type.1 = name_ref Sub, file.%Sub.decl [template = constants.%Sub] // CHECK:STDOUT: %Negate.ref.loc15_22: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %int_2147483647.loc15: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] -// CHECK:STDOUT: %impl.elem0.loc15_29: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc15_29: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc15_29: = bound_method %int_2147483647.loc15, %impl.elem0.loc15_29 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc15_29: = specific_function %Convert.bound.loc15_29, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc15_29: init %i32 = call %Convert.specific_fn.loc15_29(%int_2147483647.loc15) [template = constants.%int_2147483647.2] @@ -363,7 +363,7 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: %int_1.loc15_43: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %.loc15_40.1: %i32 = value_of_initializer %int.unegate.loc15_40 [template = constants.%int_-2147483647] // CHECK:STDOUT: %.loc15_40.2: %i32 = converted %int.unegate.loc15_40, %.loc15_40.1 [template = constants.%int_-2147483647] -// CHECK:STDOUT: %impl.elem0.loc15_43: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc15_43: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc15_43: = bound_method %int_1.loc15_43, %impl.elem0.loc15_43 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc15_43: = specific_function %Convert.bound.loc15_43, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc15_43: init %i32 = call %Convert.specific_fn.loc15_43(%int_1.loc15_43) [template = constants.%int_1.2] @@ -372,7 +372,7 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: %int.usub.loc15: init %i32 = call %Sub.ref.loc15(%.loc15_40.2, %.loc15_43.2) [template = constants.%int_-2147483648] // CHECK:STDOUT: %Negate.ref.loc15_47: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %int_1.loc15_54: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc15_54: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc15_54: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc15_54: = bound_method %int_1.loc15_54, %impl.elem0.loc15_54 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc15_54: = specific_function %Convert.bound.loc15_54, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc15_54: init %i32 = call %Convert.specific_fn.loc15_54(%int_1.loc15_54) [template = constants.%int_1.2] @@ -402,7 +402,7 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -462,13 +462,13 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: %Mod.ref.loc12: %Mod.type.1 = name_ref Mod, file.%Mod.decl [template = constants.%Mod] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_0.loc12: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0.loc12_18: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc12_18: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc12_18: = bound_method %int_1, %impl.elem0.loc12_18 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc12_18: = specific_function %Convert.bound.loc12_18, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc12_18: init %i32 = call %Convert.specific_fn.loc12_18(%int_1) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc12_18.1: %i32 = value_of_initializer %int.convert_checked.loc12_18 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc12_18.2: %i32 = converted %int_1, %.loc12_18.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc12_21: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc12_21: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc12_21: = bound_method %int_0.loc12, %impl.elem0.loc12_21 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc12_21: = specific_function %Convert.bound.loc12_21, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc12_21: init %i32 = call %Convert.specific_fn.loc12_21(%int_0.loc12) [template = constants.%int_0.2] @@ -481,13 +481,13 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: %Mod.ref.loc17: %Mod.type.1 = name_ref Mod, file.%Mod.decl [template = constants.%Mod] // CHECK:STDOUT: %int_0.loc17_18: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %int_0.loc17_21: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0.loc17_18: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc17_18: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc17_18: = bound_method %int_0.loc17_18, %impl.elem0.loc17_18 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc17_18: = specific_function %Convert.bound.loc17_18, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc17_18: init %i32 = call %Convert.specific_fn.loc17_18(%int_0.loc17_18) [template = constants.%int_0.2] // CHECK:STDOUT: %.loc17_18.1: %i32 = value_of_initializer %int.convert_checked.loc17_18 [template = constants.%int_0.2] // CHECK:STDOUT: %.loc17_18.2: %i32 = converted %int_0.loc17_18, %.loc17_18.1 [template = constants.%int_0.2] -// CHECK:STDOUT: %impl.elem0.loc17_21: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc17_21: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc17_21: = bound_method %int_0.loc17_21, %impl.elem0.loc17_21 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc17_21: = specific_function %Convert.bound.loc17_21, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc17_21: init %i32 = call %Convert.specific_fn.loc17_21(%int_0.loc17_21) [template = constants.%int_0.2] diff --git a/toolchain/check/testdata/builtins/int/umul.carbon b/toolchain/check/testdata/builtins/int/umul.carbon index 04efd8669fa50..3446d1bae5ebd 100644 --- a/toolchain/check/testdata/builtins/int/umul.carbon +++ b/toolchain/check/testdata/builtins/int/umul.carbon @@ -147,7 +147,7 @@ let b: i32 = Mul(0x8000, 0x10000); // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_32767.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_32767.2: %i32 = int_value 32767 [template] @@ -213,13 +213,13 @@ let b: i32 = Mul(0x8000, 0x10000); // CHECK:STDOUT: %Mul.ref.loc6: %Mul.type.1 = name_ref Mul, file.%Mul.decl [template = constants.%Mul] // CHECK:STDOUT: %int_32767: Core.IntLiteral = int_value 32767 [template = constants.%int_32767.1] // CHECK:STDOUT: %int_65536.loc6: Core.IntLiteral = int_value 65536 [template = constants.%int_65536.1] -// CHECK:STDOUT: %impl.elem0.loc6_18: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc6_18: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc6_18: = bound_method %int_32767, %impl.elem0.loc6_18 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc6_18: = specific_function %Convert.bound.loc6_18, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc6_18: init %i32 = call %Convert.specific_fn.loc6_18(%int_32767) [template = constants.%int_32767.2] // CHECK:STDOUT: %.loc6_18.1: %i32 = value_of_initializer %int.convert_checked.loc6_18 [template = constants.%int_32767.2] // CHECK:STDOUT: %.loc6_18.2: %i32 = converted %int_32767, %.loc6_18.1 [template = constants.%int_32767.2] -// CHECK:STDOUT: %impl.elem0.loc6_26: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc6_26: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc6_26: = bound_method %int_65536.loc6, %impl.elem0.loc6_26 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc6_26: = specific_function %Convert.bound.loc6_26, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc6_26: init %i32 = call %Convert.specific_fn.loc6_26(%int_65536.loc6) [template = constants.%int_65536.2] @@ -232,13 +232,13 @@ let b: i32 = Mul(0x8000, 0x10000); // CHECK:STDOUT: %Mul.ref.loc7: %Mul.type.1 = name_ref Mul, file.%Mul.decl [template = constants.%Mul] // CHECK:STDOUT: %int_32768: Core.IntLiteral = int_value 32768 [template = constants.%int_32768.1] // CHECK:STDOUT: %int_65536.loc7: Core.IntLiteral = int_value 65536 [template = constants.%int_65536.1] -// CHECK:STDOUT: %impl.elem0.loc7_18: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc7_18: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc7_18: = bound_method %int_32768, %impl.elem0.loc7_18 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc7_18: = specific_function %Convert.bound.loc7_18, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc7_18: init %i32 = call %Convert.specific_fn.loc7_18(%int_32768) [template = constants.%int_32768.2] // CHECK:STDOUT: %.loc7_18.1: %i32 = value_of_initializer %int.convert_checked.loc7_18 [template = constants.%int_32768.2] // CHECK:STDOUT: %.loc7_18.2: %i32 = converted %int_32768, %.loc7_18.1 [template = constants.%int_32768.2] -// CHECK:STDOUT: %impl.elem0.loc7_26: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc7_26: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc7_26: = bound_method %int_65536.loc7, %impl.elem0.loc7_26 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc7_26: = specific_function %Convert.bound.loc7_26, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc7_26: init %i32 = call %Convert.specific_fn.loc7_26(%int_65536.loc7) [template = constants.%int_65536.2] diff --git a/toolchain/check/testdata/builtins/int/unegate.carbon b/toolchain/check/testdata/builtins/int/unegate.carbon index 06f0228ce82bf..992d31025089b 100644 --- a/toolchain/check/testdata/builtins/int/unegate.carbon +++ b/toolchain/check/testdata/builtins/int/unegate.carbon @@ -123,7 +123,7 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %array_type: type = array_type %int_123.1, %i32 [template] // CHECK:STDOUT: %ptr: type = ptr_type %array_type [template] // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] @@ -219,7 +219,7 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %arr_p: %ptr = bind_name arr_p, %addr // CHECK:STDOUT: %Negate.ref: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1, %impl.elem0 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_1) [template = constants.%int_1.2] @@ -481,7 +481,7 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_2147483647.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2147483647.2: %i32 = int_value 2147483647 [template] @@ -564,7 +564,7 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %Negate.ref.loc8_14: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %Negate.ref.loc8_21: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %int_2147483647.loc8: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] -// CHECK:STDOUT: %impl.elem0.loc8: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc8: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc8: = bound_method %int_2147483647.loc8, %impl.elem0.loc8 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc8: = specific_function %Convert.bound.loc8, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc8: init %i32 = call %Convert.specific_fn.loc8(%int_2147483647.loc8) [template = constants.%int_2147483647.2] @@ -581,7 +581,7 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %Sub.ref: %Sub.type.1 = name_ref Sub, file.%Sub.decl [template = constants.%Sub] // CHECK:STDOUT: %Negate.ref.loc11_25: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %int_2147483647.loc11: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] -// CHECK:STDOUT: %impl.elem0.loc11_32: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11_32: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_32: = bound_method %int_2147483647.loc11, %impl.elem0.loc11_32 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc11_32: = specific_function %Convert.bound.loc11_32, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc11_32: init %i32 = call %Convert.specific_fn.loc11_32(%int_2147483647.loc11) [template = constants.%int_2147483647.2] @@ -591,7 +591,7 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %.loc11_42.1: %i32 = value_of_initializer %int.unegate.loc11_42 [template = constants.%int_-2147483647] // CHECK:STDOUT: %.loc11_42.2: %i32 = converted %int.unegate.loc11_42, %.loc11_42.1 [template = constants.%int_-2147483647] -// CHECK:STDOUT: %impl.elem0.loc11_45: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11_45: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_45: = bound_method %int_1, %impl.elem0.loc11_45 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc11_45: = specific_function %Convert.bound.loc11_45, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc11_45: init %i32 = call %Convert.specific_fn.loc11_45(%int_1) [template = constants.%int_1.2] diff --git a/toolchain/check/testdata/builtins/int/usub.carbon b/toolchain/check/testdata/builtins/int/usub.carbon index 65113f94b1e7b..728eb51c14050 100644 --- a/toolchain/check/testdata/builtins/int/usub.carbon +++ b/toolchain/check/testdata/builtins/int/usub.carbon @@ -148,7 +148,7 @@ let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] @@ -219,13 +219,13 @@ let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDOUT: %Sub.ref.loc6: %Sub.type.1 = name_ref Sub, file.%Sub.decl [template = constants.%Sub] // CHECK:STDOUT: %int_0.loc6: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %int_2147483647.loc6: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] -// CHECK:STDOUT: %impl.elem0.loc6_18: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc6_18: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc6_18: = bound_method %int_0.loc6, %impl.elem0.loc6_18 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc6_18: = specific_function %Convert.bound.loc6_18, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc6_18: init %i32 = call %Convert.specific_fn.loc6_18(%int_0.loc6) [template = constants.%int_0.2] // CHECK:STDOUT: %.loc6_18.1: %i32 = value_of_initializer %int.convert_checked.loc6_18 [template = constants.%int_0.2] // CHECK:STDOUT: %.loc6_18.2: %i32 = converted %int_0.loc6, %.loc6_18.1 [template = constants.%int_0.2] -// CHECK:STDOUT: %impl.elem0.loc6_21: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc6_21: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc6_21: = bound_method %int_2147483647.loc6, %impl.elem0.loc6_21 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc6_21: = specific_function %Convert.bound.loc6_21, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc6_21: init %i32 = call %Convert.specific_fn.loc6_21(%int_2147483647.loc6) [template = constants.%int_2147483647.2] @@ -239,13 +239,13 @@ let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDOUT: %Sub.ref.loc7_18: %Sub.type.1 = name_ref Sub, file.%Sub.decl [template = constants.%Sub] // CHECK:STDOUT: %int_0.loc7: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %int_2147483647.loc7: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] -// CHECK:STDOUT: %impl.elem0.loc7_22: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc7_22: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc7_22: = bound_method %int_0.loc7, %impl.elem0.loc7_22 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc7_22: = specific_function %Convert.bound.loc7_22, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc7_22: init %i32 = call %Convert.specific_fn.loc7_22(%int_0.loc7) [template = constants.%int_0.2] // CHECK:STDOUT: %.loc7_22.1: %i32 = value_of_initializer %int.convert_checked.loc7_22 [template = constants.%int_0.2] // CHECK:STDOUT: %.loc7_22.2: %i32 = converted %int_0.loc7, %.loc7_22.1 [template = constants.%int_0.2] -// CHECK:STDOUT: %impl.elem0.loc7_25: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc7_25: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc7_25: = bound_method %int_2147483647.loc7, %impl.elem0.loc7_25 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc7_25: = specific_function %Convert.bound.loc7_25, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc7_25: init %i32 = call %Convert.specific_fn.loc7_25(%int_2147483647.loc7) [template = constants.%int_2147483647.2] @@ -255,7 +255,7 @@ let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %.loc7_35.1: %i32 = value_of_initializer %int.usub.loc7_35 [template = constants.%int_-2147483647] // CHECK:STDOUT: %.loc7_35.2: %i32 = converted %int.usub.loc7_35, %.loc7_35.1 [template = constants.%int_-2147483647] -// CHECK:STDOUT: %impl.elem0.loc7_38: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc7_38: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc7_38: = bound_method %int_1, %impl.elem0.loc7_38 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc7_38: = specific_function %Convert.bound.loc7_38, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc7_38: init %i32 = call %Convert.specific_fn.loc7_38(%int_1) [template = constants.%int_1.2] @@ -269,13 +269,13 @@ let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDOUT: %Sub.ref.loc8_18: %Sub.type.1 = name_ref Sub, file.%Sub.decl [template = constants.%Sub] // CHECK:STDOUT: %int_0.loc8: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %int_2147483647.loc8: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] -// CHECK:STDOUT: %impl.elem0.loc8_22: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc8_22: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc8_22: = bound_method %int_0.loc8, %impl.elem0.loc8_22 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc8_22: = specific_function %Convert.bound.loc8_22, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc8_22: init %i32 = call %Convert.specific_fn.loc8_22(%int_0.loc8) [template = constants.%int_0.2] // CHECK:STDOUT: %.loc8_22.1: %i32 = value_of_initializer %int.convert_checked.loc8_22 [template = constants.%int_0.2] // CHECK:STDOUT: %.loc8_22.2: %i32 = converted %int_0.loc8, %.loc8_22.1 [template = constants.%int_0.2] -// CHECK:STDOUT: %impl.elem0.loc8_25: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc8_25: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc8_25: = bound_method %int_2147483647.loc8, %impl.elem0.loc8_25 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc8_25: = specific_function %Convert.bound.loc8_25, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc8_25: init %i32 = call %Convert.specific_fn.loc8_25(%int_2147483647.loc8) [template = constants.%int_2147483647.2] @@ -285,7 +285,7 @@ let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %.loc8_35.1: %i32 = value_of_initializer %int.usub.loc8_35 [template = constants.%int_-2147483647] // CHECK:STDOUT: %.loc8_35.2: %i32 = converted %int.usub.loc8_35, %.loc8_35.1 [template = constants.%int_-2147483647] -// CHECK:STDOUT: %impl.elem0.loc8_38: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc8_38: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc8_38: = bound_method %int_2, %impl.elem0.loc8_38 [template = constants.%Convert.bound.4] // CHECK:STDOUT: %Convert.specific_fn.loc8_38: = specific_function %Convert.bound.loc8_38, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.4] // CHECK:STDOUT: %int.convert_checked.loc8_38: init %i32 = call %Convert.specific_fn.loc8_38(%int_2) [template = constants.%int_2.2] diff --git a/toolchain/check/testdata/builtins/print/char.carbon b/toolchain/check/testdata/builtins/print/char.carbon index d9a9b442937bf..a6a1a1b8f9501 100644 --- a/toolchain/check/testdata/builtins/print/char.carbon +++ b/toolchain/check/testdata/builtins/print/char.carbon @@ -30,7 +30,7 @@ fn Main() { // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -87,7 +87,7 @@ fn Main() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %PrintChar.ref.loc16: %PrintChar.type.1 = name_ref PrintChar, file.%PrintChar.decl [template = constants.%PrintChar.1] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc16: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc16: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc16: = bound_method %int_1, %impl.elem0.loc16 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc16: = specific_function %Convert.bound.loc16, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc16: init %i32 = call %Convert.specific_fn.loc16(%int_1) [template = constants.%int_1.2] @@ -97,7 +97,7 @@ fn Main() { // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %PrintChar.ref.loc17: %PrintChar.type.2 = name_ref PrintChar, imports.%import_ref.193 [template = constants.%PrintChar.2] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %impl.elem0.loc17: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc17: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc17: = bound_method %int_2, %impl.elem0.loc17 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc17: = specific_function %Convert.bound.loc17, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc17: init %i32 = call %Convert.specific_fn.loc17(%int_2) [template = constants.%int_2.2] diff --git a/toolchain/check/testdata/builtins/print/int.carbon b/toolchain/check/testdata/builtins/print/int.carbon index d2294037411e1..3725d6cc5f586 100644 --- a/toolchain/check/testdata/builtins/print/int.carbon +++ b/toolchain/check/testdata/builtins/print/int.carbon @@ -32,7 +32,7 @@ fn Main() { // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -83,7 +83,7 @@ fn Main() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Print.ref.loc16: %Print.type.1 = name_ref Print, file.%Print.decl [template = constants.%Print.1] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc16: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc16: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc16: = bound_method %int_1, %impl.elem0.loc16 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc16: = specific_function %Convert.bound.loc16, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc16: init %i32 = call %Convert.specific_fn.loc16(%int_1) [template = constants.%int_1.2] @@ -93,7 +93,7 @@ fn Main() { // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %Print.ref.loc18: %Print.type.2 = name_ref Print, imports.%import_ref.193 [template = constants.%Print.2] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %impl.elem0.loc18: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc18: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc18: = bound_method %int_2, %impl.elem0.loc18 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc18: = specific_function %Convert.bound.loc18, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc18: init %i32 = call %Convert.specific_fn.loc18(%int_2) [template = constants.%int_2.2] diff --git a/toolchain/check/testdata/class/access_modifers.carbon b/toolchain/check/testdata/class/access_modifers.carbon index 4c9ef50efdb80..62a3ea56b0542 100644 --- a/toolchain/check/testdata/class/access_modifers.carbon +++ b/toolchain/check/testdata/class/access_modifers.carbon @@ -156,7 +156,7 @@ class A { // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_5.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_5.2: %i32 = int_value 5 [template] @@ -199,7 +199,7 @@ class A { // CHECK:STDOUT: class @Circle { // CHECK:STDOUT: %.loc5: %Circle.elem = field_decl radius, element0 [template] // CHECK:STDOUT: %int_5: Core.IntLiteral = int_value 5 [template = constants.%int_5.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_5, %impl.elem0 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_5) [template = constants.%int_5.2] @@ -237,7 +237,7 @@ class A { // CHECK:STDOUT: fn @SomeInternalFunction() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.2] @@ -250,7 +250,7 @@ class A { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_5: Core.IntLiteral = int_value 5 [template = constants.%int_5.1] // CHECK:STDOUT: %.loc13_24.1: %struct_type.radius.2 = struct_literal (%int_5) -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_5, %impl.elem0 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_5) [template = constants.%int_5.2] @@ -354,7 +354,7 @@ class A { // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] @@ -440,7 +440,7 @@ class A { // CHECK:STDOUT: fn @SomeInternalFunction() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.2] @@ -469,7 +469,7 @@ class A { // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_5.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_5.2: %i32 = int_value 5 [template] @@ -498,7 +498,7 @@ class A { // CHECK:STDOUT: // CHECK:STDOUT: class @A { // CHECK:STDOUT: %int_5: Core.IntLiteral = int_value 5 [template = constants.%int_5.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_5, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_5) [template = constants.%int_5.2] @@ -531,7 +531,7 @@ class A { // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_5.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_5.2: %i32 = int_value 5 [template] @@ -561,7 +561,7 @@ class A { // CHECK:STDOUT: // CHECK:STDOUT: class @A { // CHECK:STDOUT: %int_5.loc5: Core.IntLiteral = int_value 5 [template = constants.%int_5.1] -// CHECK:STDOUT: %impl.elem0.loc5: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc5: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc5: = bound_method %int_5.loc5, %impl.elem0.loc5 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn.loc5: = specific_function %Convert.bound.loc5, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc5: init %i32 = call %Convert.specific_fn.loc5(%int_5.loc5) [template = constants.%int_5.2] @@ -569,7 +569,7 @@ class A { // CHECK:STDOUT: %.loc5_27.2: %i32 = converted %int_5.loc5, %.loc5_27.1 [template = constants.%int_5.2] // CHECK:STDOUT: %x: %i32 = bind_name x, %.loc5_27.2 // CHECK:STDOUT: %int_5.loc6: Core.IntLiteral = int_value 5 [template = constants.%int_5.1] -// CHECK:STDOUT: %impl.elem0.loc6: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc6: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc6: = bound_method %int_5.loc6, %impl.elem0.loc6 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn.loc6: = specific_function %Convert.bound.loc6, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc6: init %i32 = call %Convert.specific_fn.loc6(%int_5.loc6) [template = constants.%int_5.2] diff --git a/toolchain/check/testdata/class/adapter/init_adapt.carbon b/toolchain/check/testdata/class/adapter/init_adapt.carbon index b222fa8f16818..e0d429f014a89 100644 --- a/toolchain/check/testdata/class/adapter/init_adapt.carbon +++ b/toolchain/check/testdata/class/adapter/init_adapt.carbon @@ -107,7 +107,7 @@ var e: C = MakeAdaptC(); // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -199,7 +199,7 @@ var e: C = MakeAdaptC(); // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %.loc13_27.1: %struct_type.a.b.2 = struct_literal (%int_1, %int_2) -// CHECK:STDOUT: %impl.elem0.loc13_27.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc13_27.1: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc13_27.1: = bound_method %int_1, %impl.elem0.loc13_27.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc13_27.1: = specific_function %Convert.bound.loc13_27.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc13_27.1: init %i32 = call %Convert.specific_fn.loc13_27.1(%int_1) [template = constants.%int_1.2] @@ -207,7 +207,7 @@ var e: C = MakeAdaptC(); // CHECK:STDOUT: %.loc13_27.3: ref %C = temporary_storage // CHECK:STDOUT: %.loc13_27.4: ref %i32 = class_element_access %.loc13_27.3, element0 // CHECK:STDOUT: %.loc13_27.5: init %i32 = initialize_from %.loc13_27.2 to %.loc13_27.4 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc13_27.2: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc13_27.2: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc13_27.2: = bound_method %int_2, %impl.elem0.loc13_27.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc13_27.2: = specific_function %Convert.bound.loc13_27.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc13_27.2: init %i32 = call %Convert.specific_fn.loc13_27.2(%int_2) [template = constants.%int_2.2] @@ -262,7 +262,7 @@ var e: C = MakeAdaptC(); // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -354,7 +354,7 @@ var e: C = MakeAdaptC(); // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %.loc13_27.1: %struct_type.a.b.2 = struct_literal (%int_1, %int_2) -// CHECK:STDOUT: %impl.elem0.loc13_27.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc13_27.1: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc13_27.1: = bound_method %int_1, %impl.elem0.loc13_27.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc13_27.1: = specific_function %Convert.bound.loc13_27.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc13_27.1: init %i32 = call %Convert.specific_fn.loc13_27.1(%int_1) [template = constants.%int_1.2] @@ -362,7 +362,7 @@ var e: C = MakeAdaptC(); // CHECK:STDOUT: %.loc13_27.3: ref %C = temporary_storage // CHECK:STDOUT: %.loc13_27.4: ref %i32 = class_element_access %.loc13_27.3, element0 // CHECK:STDOUT: %.loc13_27.5: init %i32 = initialize_from %.loc13_27.2 to %.loc13_27.4 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc13_27.2: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc13_27.2: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc13_27.2: = bound_method %int_2, %impl.elem0.loc13_27.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc13_27.2: = specific_function %Convert.bound.loc13_27.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc13_27.2: init %i32 = call %Convert.specific_fn.loc13_27.2(%int_2) [template = constants.%int_2.2] diff --git a/toolchain/check/testdata/class/base.carbon b/toolchain/check/testdata/class/base.carbon index 59ad333269ded..7bf5bd41139be 100644 --- a/toolchain/check/testdata/class/base.carbon +++ b/toolchain/check/testdata/class/base.carbon @@ -67,7 +67,7 @@ class Derived { // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_4.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_4.2: %i32 = int_value 4 [template] @@ -160,7 +160,7 @@ class Derived { // CHECK:STDOUT: %.loc14_26.1: %struct_type.b.2 = struct_literal (%int_4) // CHECK:STDOUT: %int_7: Core.IntLiteral = int_value 7 [template = constants.%int_7.1] // CHECK:STDOUT: %.loc14_35.1: %struct_type.base.d.3 = struct_literal (%.loc14_26.1, %int_7) -// CHECK:STDOUT: %impl.elem0.loc14_26: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc14_26: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc14_26: = bound_method %int_4, %impl.elem0.loc14_26 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc14_26: = specific_function %Convert.bound.loc14_26, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc14_26: init %i32 = call %Convert.specific_fn.loc14_26(%int_4) [template = constants.%int_4.2] @@ -170,7 +170,7 @@ class Derived { // CHECK:STDOUT: %.loc14_26.4: init %i32 = initialize_from %.loc14_26.2 to %.loc14_26.3 [template = constants.%int_4.2] // CHECK:STDOUT: %.loc14_26.5: init %Base = class_init (%.loc14_26.4), %.loc14_35.2 [template = constants.%Base.val] // CHECK:STDOUT: %.loc14_35.3: init %Base = converted %.loc14_26.1, %.loc14_26.5 [template = constants.%Base.val] -// CHECK:STDOUT: %impl.elem0.loc14_35: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc14_35: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc14_35: = bound_method %int_7, %impl.elem0.loc14_35 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc14_35: = specific_function %Convert.bound.loc14_35, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc14_35: init %i32 = call %Convert.specific_fn.loc14_35(%int_7) [template = constants.%int_7.2] diff --git a/toolchain/check/testdata/class/base_method.carbon b/toolchain/check/testdata/class/base_method.carbon index 747b90c83db67..05f383f2d8b7a 100644 --- a/toolchain/check/testdata/class/base_method.carbon +++ b/toolchain/check/testdata/class/base_method.carbon @@ -43,7 +43,7 @@ fn Call(p: Derived*) { // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -142,7 +142,7 @@ fn Call(p: Derived*) { // CHECK:STDOUT: %a.ref: %Base.elem = name_ref a, @Base.%.loc12 [template = @Base.%.loc12] // CHECK:STDOUT: %.loc18_10: ref %i32 = class_element_access %.loc18_4, element0 // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_1) [template = constants.%int_1.2] diff --git a/toolchain/check/testdata/class/basic.carbon b/toolchain/check/testdata/class/basic.carbon index c7a8d89e65c4f..51ca98f26ffd7 100644 --- a/toolchain/check/testdata/class/basic.carbon +++ b/toolchain/check/testdata/class/basic.carbon @@ -45,7 +45,7 @@ fn Run() -> i32 { // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_4.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_4.2: %i32 = int_value 4 [template] @@ -161,7 +161,7 @@ fn Run() -> i32 { // CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class] // CHECK:STDOUT: %F.ref: %F.type = name_ref F, @Class.%F.decl [template = constants.%F] // CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [template = constants.%int_4.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_4, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_4) [template = constants.%int_4.2] diff --git a/toolchain/check/testdata/class/derived_to_base.carbon b/toolchain/check/testdata/class/derived_to_base.carbon index f6830842aca74..4a5697d186fcf 100644 --- a/toolchain/check/testdata/class/derived_to_base.carbon +++ b/toolchain/check/testdata/class/derived_to_base.carbon @@ -81,7 +81,7 @@ fn ConvertInit() { // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -302,7 +302,7 @@ fn ConvertInit() { // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] // CHECK:STDOUT: %.loc38_57.1: %struct_type.base.c.3 = struct_literal (%.loc38_48.1, %int_3) // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %impl.elem0.loc38_39: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc38_39: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc38_39: = bound_method %int_1, %impl.elem0.loc38_39 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc38_39: = specific_function %Convert.bound.loc38_39, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc38_39: init %i32 = call %Convert.specific_fn.loc38_39(%int_1) [template = constants.%int_1.2] @@ -314,7 +314,7 @@ fn ConvertInit() { // CHECK:STDOUT: %.loc38_39.4: init %i32 = initialize_from %.loc38_39.2 to %.loc38_39.3 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc38_39.5: init %A = class_init (%.loc38_39.4), %.loc38_48.2 [template = constants.%A.val] // CHECK:STDOUT: %.loc38_48.3: init %A = converted %.loc38_39.1, %.loc38_39.5 [template = constants.%A.val] -// CHECK:STDOUT: %impl.elem0.loc38_48: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc38_48: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc38_48: = bound_method %int_2, %impl.elem0.loc38_48 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc38_48: = specific_function %Convert.bound.loc38_48, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc38_48: init %i32 = call %Convert.specific_fn.loc38_48(%int_2) [template = constants.%int_2.2] @@ -323,7 +323,7 @@ fn ConvertInit() { // CHECK:STDOUT: %.loc38_48.6: init %i32 = initialize_from %.loc38_48.4 to %.loc38_48.5 [template = constants.%int_2.2] // CHECK:STDOUT: %.loc38_48.7: init %B = class_init (%.loc38_48.3, %.loc38_48.6), %.loc38_57.3 [template = constants.%B.val] // CHECK:STDOUT: %.loc38_57.4: init %B = converted %.loc38_48.1, %.loc38_48.7 [template = constants.%B.val] -// CHECK:STDOUT: %impl.elem0.loc38_57: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc38_57: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc38_57: = bound_method %int_3, %impl.elem0.loc38_57 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc38_57: = specific_function %Convert.bound.loc38_57, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc38_57: init %i32 = call %Convert.specific_fn.loc38_57(%int_3) [template = constants.%int_3.2] diff --git a/toolchain/check/testdata/class/fail_field_modifiers.carbon b/toolchain/check/testdata/class/fail_field_modifiers.carbon index db3d41b167da6..9dda4c38cb644 100644 --- a/toolchain/check/testdata/class/fail_field_modifiers.carbon +++ b/toolchain/check/testdata/class/fail_field_modifiers.carbon @@ -45,7 +45,7 @@ class Class { // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] @@ -79,7 +79,7 @@ class Class { // CHECK:STDOUT: %.loc17: %Class.elem = field_decl j, element0 [template] // CHECK:STDOUT: %.loc23: %Class.elem = field_decl k, element1 [template] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0.loc29: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc29: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc29: = bound_method %int_0, %impl.elem0.loc29 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc29: = specific_function %Convert.bound.loc29, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc29: init %i32 = call %Convert.specific_fn.loc29(%int_0) [template = constants.%int_0.2] @@ -87,7 +87,7 @@ class Class { // CHECK:STDOUT: %.loc29_25.2: %i32 = converted %int_0, %.loc29_25.1 [template = constants.%int_0.2] // CHECK:STDOUT: %l: %i32 = bind_name l, %.loc29_25.2 // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc34: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc34: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc34: = bound_method %int_1, %impl.elem0.loc34 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc34: = specific_function %Convert.bound.loc34, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc34: init %i32 = call %Convert.specific_fn.loc34(%int_1) [template = constants.%int_1.2] diff --git a/toolchain/check/testdata/class/fail_init.carbon b/toolchain/check/testdata/class/fail_init.carbon index dde6a52bcda92..d10c76c764e82 100644 --- a/toolchain/check/testdata/class/fail_init.carbon +++ b/toolchain/check/testdata/class/fail_init.carbon @@ -48,7 +48,7 @@ fn F() { // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -100,7 +100,7 @@ fn F() { // CHECK:STDOUT: %int_2.loc26: Core.IntLiteral = int_value 2 [template = constants.%int_2] // CHECK:STDOUT: %.loc26_18.1: %struct_type.a.c = struct_literal (%int_1.loc26, %int_2.loc26) // CHECK:STDOUT: %Class.ref.loc26: type = name_ref Class, file.%Class.decl [template = constants.%Class] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1.loc26, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_1.loc26) [template = constants.%int_1.2] diff --git a/toolchain/check/testdata/class/fail_init_as_inplace.carbon b/toolchain/check/testdata/class/fail_init_as_inplace.carbon index c154e1e5101e1..5e6b2cc9cf442 100644 --- a/toolchain/check/testdata/class/fail_init_as_inplace.carbon +++ b/toolchain/check/testdata/class/fail_init_as_inplace.carbon @@ -47,7 +47,7 @@ fn F() { // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -111,7 +111,7 @@ fn F() { // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %.loc25_33.1: %struct_type.a.b.2 = struct_literal (%int_1, %int_2) // CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class] -// CHECK:STDOUT: %impl.elem0.loc25_33.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc25_33.1: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc25_33.1: = bound_method %int_1, %impl.elem0.loc25_33.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc25_33.1: = specific_function %Convert.bound.loc25_33.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc25_33.1: init %i32 = call %Convert.specific_fn.loc25_33.1(%int_1) [template = constants.%int_1.2] @@ -119,7 +119,7 @@ fn F() { // CHECK:STDOUT: %.loc25_33.3: ref %Class = temporary_storage // CHECK:STDOUT: %.loc25_33.4: ref %i32 = class_element_access %.loc25_33.3, element0 // CHECK:STDOUT: %.loc25_33.5: init %i32 = initialize_from %.loc25_33.2 to %.loc25_33.4 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc25_33.2: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc25_33.2: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc25_33.2: = bound_method %int_2, %impl.elem0.loc25_33.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc25_33.2: = specific_function %Convert.bound.loc25_33.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc25_33.2: init %i32 = call %Convert.specific_fn.loc25_33.2(%int_2) [template = constants.%int_2.2] diff --git a/toolchain/check/testdata/class/fail_scope.carbon b/toolchain/check/testdata/class/fail_scope.carbon index 634f57c17370a..a717e0769bea4 100644 --- a/toolchain/check/testdata/class/fail_scope.carbon +++ b/toolchain/check/testdata/class/fail_scope.carbon @@ -35,7 +35,7 @@ fn G() -> i32 { // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -92,7 +92,7 @@ fn G() -> i32 { // CHECK:STDOUT: fn @F() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_1) [template = constants.%int_1.2] diff --git a/toolchain/check/testdata/class/field_access.carbon b/toolchain/check/testdata/class/field_access.carbon index 75379cfab9d36..ada7b6c1cc3a7 100644 --- a/toolchain/check/testdata/class/field_access.carbon +++ b/toolchain/check/testdata/class/field_access.carbon @@ -36,7 +36,7 @@ fn Run() { // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -86,7 +86,7 @@ fn Run() { // CHECK:STDOUT: %j.ref.loc18: %Class.elem = name_ref j, @Class.%.loc12 [template = @Class.%.loc12] // CHECK:STDOUT: %.loc18_4: ref %i32 = class_element_access %c.ref.loc18, element0 // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc18: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc18: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc18: = bound_method %int_1, %impl.elem0.loc18 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc18: = specific_function %Convert.bound.loc18, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc18: init %i32 = call %Convert.specific_fn.loc18(%int_1) [template = constants.%int_1.2] @@ -96,7 +96,7 @@ fn Run() { // CHECK:STDOUT: %k.ref.loc19: %Class.elem = name_ref k, @Class.%.loc13 [template = @Class.%.loc13] // CHECK:STDOUT: %.loc19_4: ref %i32 = class_element_access %c.ref.loc19, element1 // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %impl.elem0.loc19: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc19: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc19: = bound_method %int_2, %impl.elem0.loc19 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc19: = specific_function %Convert.bound.loc19, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc19: init %i32 = call %Convert.specific_fn.loc19(%int_2) [template = constants.%int_2.2] diff --git a/toolchain/check/testdata/class/field_access_in_value.carbon b/toolchain/check/testdata/class/field_access_in_value.carbon index 8fef8721fe7e3..f999f5cd77e40 100644 --- a/toolchain/check/testdata/class/field_access_in_value.carbon +++ b/toolchain/check/testdata/class/field_access_in_value.carbon @@ -37,7 +37,7 @@ fn Test() { // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -87,7 +87,7 @@ fn Test() { // CHECK:STDOUT: %j.ref.loc18: %Class.elem = name_ref j, @Class.%.loc12 [template = @Class.%.loc12] // CHECK:STDOUT: %.loc18_5: ref %i32 = class_element_access %cv.ref.loc18, element0 // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc18: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc18: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc18: = bound_method %int_1, %impl.elem0.loc18 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc18: = specific_function %Convert.bound.loc18, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc18: init %i32 = call %Convert.specific_fn.loc18(%int_1) [template = constants.%int_1.2] @@ -97,7 +97,7 @@ fn Test() { // CHECK:STDOUT: %k.ref.loc19: %Class.elem = name_ref k, @Class.%.loc13 [template = @Class.%.loc13] // CHECK:STDOUT: %.loc19_5: ref %i32 = class_element_access %cv.ref.loc19, element1 // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %impl.elem0.loc19: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc19: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc19: = bound_method %int_2, %impl.elem0.loc19 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc19: = specific_function %Convert.bound.loc19, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc19: init %i32 = call %Convert.specific_fn.loc19(%int_2) [template = constants.%int_2.2] diff --git a/toolchain/check/testdata/class/generic/complete_in_conversion.carbon b/toolchain/check/testdata/class/generic/complete_in_conversion.carbon index 8f8f7759eb2f8..c4ad3fa6ebeec 100644 --- a/toolchain/check/testdata/class/generic/complete_in_conversion.carbon +++ b/toolchain/check/testdata/class/generic/complete_in_conversion.carbon @@ -62,7 +62,7 @@ fn F(a: A(0)*) { // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [template] -// CHECK:STDOUT: %interface.6: = interface_witness (%Convert.11) [template] +// CHECK:STDOUT: %interface.20: = interface_witness (%Convert.11) [template] // CHECK:STDOUT: %Convert.bound.2: = bound_method %int_0.1, %Convert.11 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] @@ -134,7 +134,7 @@ fn F(a: A(0)*) { // CHECK:STDOUT: %.loc15_13: type = splice_block %ptr [template = constants.%ptr.2] { // CHECK:STDOUT: %A.ref: %A.type = name_ref A, file.%A.decl [template = constants.%A.generic] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.10 = interface_witness_access constants.%interface.6, element0 [template = constants.%Convert.11] +// CHECK:STDOUT: %impl.elem0: %Convert.type.10 = interface_witness_access constants.%interface.20, element0 [template = constants.%Convert.11] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.2] diff --git a/toolchain/check/testdata/class/generic/import.carbon b/toolchain/check/testdata/class/generic/import.carbon index 9f8180f539d01..a37535e99a22d 100644 --- a/toolchain/check/testdata/class/generic/import.carbon +++ b/toolchain/check/testdata/class/generic/import.carbon @@ -105,7 +105,7 @@ class Class(U:! type) { // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] @@ -202,7 +202,7 @@ class Class(U:! type) { // CHECK:STDOUT: fn() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.2] @@ -272,7 +272,7 @@ class Class(U:! type) { // CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -374,7 +374,7 @@ class Class(U:! type) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %.loc9_17.1: %struct_type.n.2 = struct_literal (%int_1) -// CHECK:STDOUT: %impl.elem0: %Convert.type.9 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.9 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_1) [template = constants.%int_1.2] diff --git a/toolchain/check/testdata/class/generic/stringify.carbon b/toolchain/check/testdata/class/generic/stringify.carbon index b14be55814b39..8f4dbb12437f4 100644 --- a/toolchain/check/testdata/class/generic/stringify.carbon +++ b/toolchain/check/testdata/class/generic/stringify.carbon @@ -382,7 +382,7 @@ var g: E({.a = 1, .b = 2}) = {} as E({.a = 3, .b = 4} as D); // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %int_3.1: Core.IntLiteral = int_value 3 [template] // CHECK:STDOUT: %int_4.1: Core.IntLiteral = int_value 4 [template] // CHECK:STDOUT: %Convert.bound.3: = bound_method %int_3.1, %Convert.10 [template] @@ -459,7 +459,7 @@ var g: E({.a = 1, .b = 2}) = {} as E({.a = 3, .b = 4} as D); // CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [template = constants.%int_4.1] // CHECK:STDOUT: %.loc24_53.1: %struct_type.a.b.2 = struct_literal (%int_3, %int_4) // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [template = constants.%D] -// CHECK:STDOUT: %impl.elem0.loc24_53.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc24_53.1: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc24_53.1: = bound_method %int_3, %impl.elem0.loc24_53.1 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc24_53.1: = specific_function %Convert.bound.loc24_53.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc24_53.1: init %i32 = call %Convert.specific_fn.loc24_53.1(%int_3) [template = constants.%int_3.2] @@ -467,7 +467,7 @@ var g: E({.a = 1, .b = 2}) = {} as E({.a = 3, .b = 4} as D); // CHECK:STDOUT: %.loc24_53.3: ref %D = temporary_storage // CHECK:STDOUT: %.loc24_53.4: ref %i32 = class_element_access %.loc24_53.3, element0 // CHECK:STDOUT: %.loc24_53.5: init %i32 = initialize_from %.loc24_53.2 to %.loc24_53.4 [template = constants.%int_3.2] -// CHECK:STDOUT: %impl.elem0.loc24_53.2: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc24_53.2: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc24_53.2: = bound_method %int_4, %impl.elem0.loc24_53.2 [template = constants.%Convert.bound.4] // CHECK:STDOUT: %Convert.specific_fn.loc24_53.2: = specific_function %Convert.bound.loc24_53.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.4] // CHECK:STDOUT: %int.convert_checked.loc24_53.2: init %i32 = call %Convert.specific_fn.loc24_53.2(%int_4) [template = constants.%int_4.2] diff --git a/toolchain/check/testdata/class/import.carbon b/toolchain/check/testdata/class/import.carbon index 713eb12d0db6d..1e85ae3f91f58 100644 --- a/toolchain/check/testdata/class/import.carbon +++ b/toolchain/check/testdata/class/import.carbon @@ -168,7 +168,7 @@ fn Run() { // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -271,7 +271,7 @@ fn Run() { // CHECK:STDOUT: %b: ref %Field = bind_name b, %b.var // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %.loc9_25.1: %struct_type.x.2 = struct_literal (%int_1) -// CHECK:STDOUT: %impl.elem0.loc9: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc9: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc9: = bound_method %int_1, %impl.elem0.loc9 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc9: = specific_function %Convert.bound.loc9, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc9: init %i32 = call %Convert.specific_fn.loc9(%int_1) [template = constants.%int_1.2] @@ -285,7 +285,7 @@ fn Run() { // CHECK:STDOUT: %x.ref: %Field.elem = name_ref x, imports.%import_ref.12 [template = imports.%.1] // CHECK:STDOUT: %.loc10_4: ref %i32 = class_element_access %b.ref, element0 // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %impl.elem0.loc10: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc10: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc10: = bound_method %int_2, %impl.elem0.loc10 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc10: = specific_function %Convert.bound.loc10, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc10: init %i32 = call %Convert.specific_fn.loc10(%int_2) [template = constants.%int_2.2] @@ -319,5 +319,5 @@ fn Run() { // CHECK:STDOUT: // CHECK:STDOUT: fn @F[%self.param_patt: %ForwardDeclared.1]() [from "a.carbon"]; // CHECK:STDOUT: -// CHECK:STDOUT: fn @G[addr .inst605: %ptr.3]() [from "a.carbon"]; +// CHECK:STDOUT: fn @G[addr .inst947: %ptr.3]() [from "a.carbon"]; // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/import_base.carbon b/toolchain/check/testdata/class/import_base.carbon index ec5e98eb4aa42..5c5b923dea1ce 100644 --- a/toolchain/check/testdata/class/import_base.carbon +++ b/toolchain/check/testdata/class/import_base.carbon @@ -141,7 +141,7 @@ fn Run() { // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] @@ -217,7 +217,7 @@ fn Run() { // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %.loc7_47.1: %struct_type.x.unused.2 = struct_literal (%int_0, %int_1) // CHECK:STDOUT: %.loc7_48.1: %struct_type.base.3 = struct_literal (%.loc7_47.1) -// CHECK:STDOUT: %impl.elem0.loc7_47.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc7_47.1: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc7_47.1: = bound_method %int_0, %impl.elem0.loc7_47.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc7_47.1: = specific_function %Convert.bound.loc7_47.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc7_47.1: init %i32 = call %Convert.specific_fn.loc7_47.1(%int_0) [template = constants.%int_0.2] @@ -225,7 +225,7 @@ fn Run() { // CHECK:STDOUT: %.loc7_48.2: ref %Base = class_element_access %a.var, element0 // CHECK:STDOUT: %.loc7_47.3: ref %i32 = class_element_access %.loc7_48.2, element0 // CHECK:STDOUT: %.loc7_47.4: init %i32 = initialize_from %.loc7_47.2 to %.loc7_47.3 [template = constants.%int_0.2] -// CHECK:STDOUT: %impl.elem0.loc7_47.2: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc7_47.2: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc7_47.2: = bound_method %int_1, %impl.elem0.loc7_47.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc7_47.2: = specific_function %Convert.bound.loc7_47.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc7_47.2: init %i32 = call %Convert.specific_fn.loc7_47.2(%int_1) [template = constants.%int_1.2] @@ -243,7 +243,7 @@ fn Run() { // CHECK:STDOUT: %.loc8_4.2: ref %Base = converted %a.ref.loc8, %.loc8_4.1 // CHECK:STDOUT: %.loc8_4.3: ref %i32 = class_element_access %.loc8_4.2, element0 // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %impl.elem0.loc8: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc8: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc8: = bound_method %int_2, %impl.elem0.loc8 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc8: = specific_function %Convert.bound.loc8, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc8: init %i32 = call %Convert.specific_fn.loc8(%int_2) [template = constants.%int_2.2] diff --git a/toolchain/check/testdata/class/inheritance_access.carbon b/toolchain/check/testdata/class/inheritance_access.carbon index cfc02546cd711..f26405ea0ff2f 100644 --- a/toolchain/check/testdata/class/inheritance_access.carbon +++ b/toolchain/check/testdata/class/inheritance_access.carbon @@ -463,7 +463,7 @@ class B { // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_5.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_5.2: %i32 = int_value 5 [template] @@ -503,7 +503,7 @@ class B { // CHECK:STDOUT: // CHECK:STDOUT: class @A { // CHECK:STDOUT: %int_5: Core.IntLiteral = int_value 5 [template = constants.%int_5.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_5, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_5) [template = constants.%int_5.2] @@ -563,7 +563,7 @@ class B { // CHECK:STDOUT: fn @SomeProtectedFunction() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_5: Core.IntLiteral = int_value 5 [template = constants.%int_5.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_5, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_5) [template = constants.%int_5.2] @@ -929,7 +929,7 @@ class B { // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_5.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_5.2: %i32 = int_value 5 [template] @@ -970,7 +970,7 @@ class B { // CHECK:STDOUT: // CHECK:STDOUT: class @A { // CHECK:STDOUT: %int_5.loc5: Core.IntLiteral = int_value 5 [template = constants.%int_5.1] -// CHECK:STDOUT: %impl.elem0.loc5: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc5: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc5: = bound_method %int_5.loc5, %impl.elem0.loc5 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn.loc5: = specific_function %Convert.bound.loc5, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc5: init %i32 = call %Convert.specific_fn.loc5(%int_5.loc5) [template = constants.%int_5.2] @@ -978,7 +978,7 @@ class B { // CHECK:STDOUT: %.loc5_49.2: %i32 = converted %int_5.loc5, %.loc5_49.1 [template = constants.%int_5.2] // CHECK:STDOUT: %SOME_PROTECTED_CONSTANT: %i32 = bind_name SOME_PROTECTED_CONSTANT, %.loc5_49.2 // CHECK:STDOUT: %int_5.loc6: Core.IntLiteral = int_value 5 [template = constants.%int_5.1] -// CHECK:STDOUT: %impl.elem0.loc6: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc6: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc6: = bound_method %int_5.loc6, %impl.elem0.loc6 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn.loc6: = specific_function %Convert.bound.loc6, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc6: init %i32 = call %Convert.specific_fn.loc6(%int_5.loc6) [template = constants.%int_5.2] @@ -996,7 +996,7 @@ class B { // CHECK:STDOUT: // CHECK:STDOUT: class @Internal { // CHECK:STDOUT: %int_5: Core.IntLiteral = int_value 5 [template = constants.%int_5.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_5, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_5) [template = constants.%int_5.2] diff --git a/toolchain/check/testdata/class/init_as.carbon b/toolchain/check/testdata/class/init_as.carbon index ab74464177900..0ef7565e3dbfa 100644 --- a/toolchain/check/testdata/class/init_as.carbon +++ b/toolchain/check/testdata/class/init_as.carbon @@ -34,7 +34,7 @@ fn F() -> i32 { // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -90,7 +90,7 @@ fn F() -> i32 { // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %.loc17_26.1: %struct_type.a.b.2 = struct_literal (%int_1, %int_2) // CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class] -// CHECK:STDOUT: %impl.elem0.loc17_26.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc17_26.1: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc17_26.1: = bound_method %int_1, %impl.elem0.loc17_26.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc17_26.1: = specific_function %Convert.bound.loc17_26.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc17_26.1: init %i32 = call %Convert.specific_fn.loc17_26.1(%int_1) [template = constants.%int_1.2] @@ -98,7 +98,7 @@ fn F() -> i32 { // CHECK:STDOUT: %.loc17_26.3: ref %Class = temporary_storage // CHECK:STDOUT: %.loc17_26.4: ref %i32 = class_element_access %.loc17_26.3, element0 // CHECK:STDOUT: %.loc17_26.5: init %i32 = initialize_from %.loc17_26.2 to %.loc17_26.4 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc17_26.2: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc17_26.2: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc17_26.2: = bound_method %int_2, %impl.elem0.loc17_26.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc17_26.2: = specific_function %Convert.bound.loc17_26.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc17_26.2: init %i32 = call %Convert.specific_fn.loc17_26.2(%int_2) [template = constants.%int_2.2] diff --git a/toolchain/check/testdata/class/method.carbon b/toolchain/check/testdata/class/method.carbon index 410af5e3a8488..40164647e8b66 100644 --- a/toolchain/check/testdata/class/method.carbon +++ b/toolchain/check/testdata/class/method.carbon @@ -83,7 +83,7 @@ fn CallGOnInitializingExpr() -> i32 { // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -334,7 +334,7 @@ fn CallGOnInitializingExpr() -> i32 { // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %.loc35_18.1: %struct_type.k.2 = struct_literal (%int_1) // CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_1) [template = constants.%int_1.2] diff --git a/toolchain/check/testdata/class/reorder.carbon b/toolchain/check/testdata/class/reorder.carbon index 2bebd570b3472..b9b2976748e98 100644 --- a/toolchain/check/testdata/class/reorder.carbon +++ b/toolchain/check/testdata/class/reorder.carbon @@ -34,7 +34,7 @@ class Class { // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -99,7 +99,7 @@ class Class { // CHECK:STDOUT: fn @F() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_1) [template = constants.%int_1.2] diff --git a/toolchain/check/testdata/class/reorder_qualified.carbon b/toolchain/check/testdata/class/reorder_qualified.carbon index 0ea2f83557fb2..0bef8c616ceac 100644 --- a/toolchain/check/testdata/class/reorder_qualified.carbon +++ b/toolchain/check/testdata/class/reorder_qualified.carbon @@ -83,7 +83,7 @@ class A { // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -194,7 +194,7 @@ class A { // CHECK:STDOUT: %a: ref %A = bind_name a, %a.var // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %.loc29_25.1: %struct_type.a.2 = struct_literal (%int_1) -// CHECK:STDOUT: %impl.elem0.loc29: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc29: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc29: = bound_method %int_1, %impl.elem0.loc29 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc29: = specific_function %Convert.bound.loc29, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc29: init %i32 = call %Convert.specific_fn.loc29(%int_1) [template = constants.%int_1.2] @@ -208,7 +208,7 @@ class A { // CHECK:STDOUT: %b: ref %B = bind_name b, %b.var // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %.loc30_25.1: %struct_type.b.2 = struct_literal (%int_2) -// CHECK:STDOUT: %impl.elem0.loc30: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc30: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc30: = bound_method %int_2, %impl.elem0.loc30 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc30: = specific_function %Convert.bound.loc30, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc30: init %i32 = call %Convert.specific_fn.loc30(%int_2) [template = constants.%int_2.2] @@ -222,7 +222,7 @@ class A { // CHECK:STDOUT: %c: ref %C = bind_name c, %c.var // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] // CHECK:STDOUT: %.loc31_25.1: %struct_type.c.2 = struct_literal (%int_3) -// CHECK:STDOUT: %impl.elem0.loc31: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc31: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc31: = bound_method %int_3, %impl.elem0.loc31 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc31: = specific_function %Convert.bound.loc31, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc31: init %i32 = call %Convert.specific_fn.loc31(%int_3) [template = constants.%int_3.2] @@ -236,7 +236,7 @@ class A { // CHECK:STDOUT: %d: ref %D = bind_name d, %d.var // CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [template = constants.%int_4.1] // CHECK:STDOUT: %.loc32_25.1: %struct_type.d.2 = struct_literal (%int_4) -// CHECK:STDOUT: %impl.elem0.loc32: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc32: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc32: = bound_method %int_4, %impl.elem0.loc32 [template = constants.%Convert.bound.4] // CHECK:STDOUT: %Convert.specific_fn.loc32: = specific_function %Convert.bound.loc32, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.4] // CHECK:STDOUT: %int.convert_checked.loc32: init %i32 = call %Convert.specific_fn.loc32(%int_4) [template = constants.%int_4.2] diff --git a/toolchain/check/testdata/class/scope.carbon b/toolchain/check/testdata/class/scope.carbon index c3b19c62027c2..1f517cea69c2b 100644 --- a/toolchain/check/testdata/class/scope.carbon +++ b/toolchain/check/testdata/class/scope.carbon @@ -43,7 +43,7 @@ fn Run() { // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -118,7 +118,7 @@ fn Run() { // CHECK:STDOUT: fn @F.1() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1, %impl.elem0 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_1) [template = constants.%int_1.2] @@ -139,7 +139,7 @@ fn Run() { // CHECK:STDOUT: fn @F.2() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_2, %impl.elem0 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_2) [template = constants.%int_2.2] diff --git a/toolchain/check/testdata/class/self_conversion.carbon b/toolchain/check/testdata/class/self_conversion.carbon index cf4a2b9202914..894b2340a5fd0 100644 --- a/toolchain/check/testdata/class/self_conversion.carbon +++ b/toolchain/check/testdata/class/self_conversion.carbon @@ -55,7 +55,7 @@ fn Call(p: Derived*) -> i32 { // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -194,7 +194,7 @@ fn Call(p: Derived*) -> i32 { // CHECK:STDOUT: %a.ref: %Base.elem = name_ref a, @Base.%.loc12 [template = @Base.%.loc12] // CHECK:STDOUT: %.loc27_10: ref %i32 = class_element_access %.loc27_4, element0 // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_1) [template = constants.%int_1.2] diff --git a/toolchain/check/testdata/class/syntactic_merge_literal.carbon b/toolchain/check/testdata/class/syntactic_merge_literal.carbon index 2e36a324be45c..d76c582821aaf 100644 --- a/toolchain/check/testdata/class/syntactic_merge_literal.carbon +++ b/toolchain/check/testdata/class/syntactic_merge_literal.carbon @@ -46,7 +46,7 @@ class D(b:! C(1_000)) {} // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1000.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1000.2: %i32 = int_value 1000 [template] @@ -93,7 +93,7 @@ class D(b:! C(1_000)) {} // CHECK:STDOUT: %.loc5_20.3: type = splice_block %C.loc5 [template = constants.%C.2] { // CHECK:STDOUT: %C.ref.loc5: %C.type = name_ref C, file.%C.decl [template = constants.%C.generic] // CHECK:STDOUT: %int_1000.loc5: Core.IntLiteral = int_value 1000 [template = constants.%int_1000.1] -// CHECK:STDOUT: %impl.elem0.loc5: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc5: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc5: = bound_method %int_1000.loc5, %impl.elem0.loc5 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn.loc5: = specific_function %Convert.bound.loc5, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc5: init %i32 = call %Convert.specific_fn.loc5(%int_1000.loc5) [template = constants.%int_1000.2] @@ -111,7 +111,7 @@ class D(b:! C(1_000)) {} // CHECK:STDOUT: %.loc6_20.3: type = splice_block %C.loc6 [template = constants.%C.2] { // CHECK:STDOUT: %C.ref.loc6: %C.type = name_ref C, file.%C.decl [template = constants.%C.generic] // CHECK:STDOUT: %int_1000.loc6: Core.IntLiteral = int_value 1000 [template = constants.%int_1000.1] -// CHECK:STDOUT: %impl.elem0.loc6: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc6: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc6: = bound_method %int_1000.loc6, %impl.elem0.loc6 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn.loc6: = specific_function %Convert.bound.loc6, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc6: init %i32 = call %Convert.specific_fn.loc6(%int_1000.loc6) [template = constants.%int_1000.2] @@ -184,7 +184,7 @@ class D(b:! C(1_000)) {} // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1000.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1000.2: %i32 = int_value 1000 [template] @@ -233,7 +233,7 @@ class D(b:! C(1_000)) {} // CHECK:STDOUT: %.loc5_19.3: type = splice_block %C [template = constants.%C.2] { // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [template = constants.%C.generic] // CHECK:STDOUT: %int_1000: Core.IntLiteral = int_value 1000 [template = constants.%int_1000.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1000, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_1000) [template = constants.%int_1000.2] @@ -251,7 +251,7 @@ class D(b:! C(1_000)) {} // CHECK:STDOUT: %.loc12_20.3: type = splice_block %C [template = constants.%C.2] { // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [template = constants.%C.generic] // CHECK:STDOUT: %int_1000: Core.IntLiteral = int_value 1000 [template = constants.%int_1000.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1000, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_1000) [template = constants.%int_1000.2] diff --git a/toolchain/check/testdata/class/virtual_modifiers.carbon b/toolchain/check/testdata/class/virtual_modifiers.carbon index ef3ca23227d61..2e84dc9a26c1a 100644 --- a/toolchain/check/testdata/class/virtual_modifiers.carbon +++ b/toolchain/check/testdata/class/virtual_modifiers.carbon @@ -510,7 +510,7 @@ class Derived { // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_3.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_3.2: %i32 = int_value 3 [template] @@ -567,7 +567,7 @@ class Derived { // CHECK:STDOUT: %i.var: ref %i32 = var i // CHECK:STDOUT: %i: ref %i32 = bind_name i, %i.var // CHECK:STDOUT: %int_3.loc12: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] -// CHECK:STDOUT: %impl.elem0.loc12: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc12: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc12: = bound_method %int_3.loc12, %impl.elem0.loc12 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc12: = specific_function %Convert.bound.loc12, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc12: init %i32 = call %Convert.specific_fn.loc12(%int_3.loc12) [template = constants.%int_3.2] @@ -598,14 +598,14 @@ class Derived { // CHECK:STDOUT: %.loc15_35.2: ref %ptr.1 = class_element_access %b2.var, element0 // CHECK:STDOUT: %.loc15_35.3: ref %ptr.1 = vtable_ptr // CHECK:STDOUT: %.loc15_35.4: init %ptr.1 = initialize_from %.loc15_35.3 to %.loc15_35.2 -// CHECK:STDOUT: %impl.elem0.loc15_35.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc15_35.1: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc15_35.1: = bound_method %int_5, %impl.elem0.loc15_35.1 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc15_35.1: = specific_function %Convert.bound.loc15_35.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc15_35.1: init %i32 = call %Convert.specific_fn.loc15_35.1(%int_5) [template = constants.%int_5.2] // CHECK:STDOUT: %.loc15_35.5: init %i32 = converted %int_5, %int.convert_checked.loc15_35.1 [template = constants.%int_5.2] // CHECK:STDOUT: %.loc15_35.6: ref %i32 = class_element_access %b2.var, element2 // CHECK:STDOUT: %.loc15_35.7: init %i32 = initialize_from %.loc15_35.5 to %.loc15_35.6 [template = constants.%int_5.2] -// CHECK:STDOUT: %impl.elem0.loc15_35.2: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc15_35.2: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc15_35.2: = bound_method %int_3.loc15, %impl.elem0.loc15_35.2 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc15_35.2: = specific_function %Convert.bound.loc15_35.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc15_35.2: init %i32 = call %Convert.specific_fn.loc15_35.2(%int_3.loc15) [template = constants.%int_3.2] @@ -619,7 +619,7 @@ class Derived { // CHECK:STDOUT: %m2.ref: %Base.elem = name_ref m2, @Base.%.loc6 [template = @Base.%.loc6] // CHECK:STDOUT: %.loc18_5: ref %i32 = class_element_access %b1.ref, element2 // CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [template = constants.%int_4.1] -// CHECK:STDOUT: %impl.elem0.loc18: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc18: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc18: = bound_method %int_4, %impl.elem0.loc18 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc18: = specific_function %Convert.bound.loc18, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc18: init %i32 = call %Convert.specific_fn.loc18(%int_4) [template = constants.%int_4.2] diff --git a/toolchain/check/testdata/deduce/array.carbon b/toolchain/check/testdata/deduce/array.carbon index d9b8fd354ac2c..2727d262db915 100644 --- a/toolchain/check/testdata/deduce/array.carbon +++ b/toolchain/check/testdata/deduce/array.carbon @@ -117,7 +117,7 @@ fn G() -> C { // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] @@ -205,7 +205,7 @@ fn G() -> C { // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.2] @@ -279,7 +279,7 @@ fn G() -> C { // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] // CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.3, @impl.2(%int_32) [template] // CHECK:STDOUT: %Convert.9: %Convert.type.9 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.9) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.9) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %N.2, %Convert.9 [symbolic] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.3(%int_32) [symbolic] // CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %Convert.specific_fn(%N.2) [symbolic] @@ -335,7 +335,7 @@ fn G() -> C { // CHECK:STDOUT: %.loc10_23: type = splice_block %array_type [template = ] { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %N.ref.loc10_22: %i32 = name_ref N, %N.loc10_6.1 [symbolic = %N.loc10_6.2 (constants.%N.2)] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.9] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.9] // CHECK:STDOUT: %Convert.bound.loc10_22.1: = bound_method %N.ref.loc10_22, %impl.elem0 [symbolic = %Convert.bound.loc10_22.2 (constants.%Convert.bound)] // CHECK:STDOUT: %Convert.specific_fn.loc10_22.1: = specific_function %Convert.bound.loc10_22.1, @Convert.3(constants.%int_32) [symbolic = %Convert.specific_fn.loc10_22.2 (constants.%Convert.specific_fn)] // CHECK:STDOUT: %int.convert_checked.loc10_22.1: init Core.IntLiteral = call %Convert.specific_fn.loc10_22.1(%N.ref.loc10_22) [symbolic = %int.convert_checked.loc10_22.2 (constants.%int.convert_checked)] @@ -432,7 +432,7 @@ fn G() -> C { // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] // CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.3, @impl.2(%int_32) [template] // CHECK:STDOUT: %Convert.9: %Convert.type.9 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.9) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.9) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %N.2, %Convert.9 [symbolic] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.3(%int_32) [symbolic] // CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %Convert.specific_fn(%N.2) [symbolic] @@ -491,7 +491,7 @@ fn G() -> C { // CHECK:STDOUT: %.loc10_33: type = splice_block %array_type [template = ] { // CHECK:STDOUT: %T.ref.loc10_29: type = name_ref T, %T.loc10_6.1 [symbolic = %T.loc10_6.2 (constants.%T)] // CHECK:STDOUT: %N.ref: %i32 = name_ref N, %N.loc10_16.1 [symbolic = %N.loc10_16.2 (constants.%N.2)] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.9] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.9] // CHECK:STDOUT: %Convert.bound.loc10_32.1: = bound_method %N.ref, %impl.elem0 [symbolic = %Convert.bound.loc10_32.2 (constants.%Convert.bound)] // CHECK:STDOUT: %Convert.specific_fn.loc10_32.1: = specific_function %Convert.bound.loc10_32.1, @Convert.3(constants.%int_32) [symbolic = %Convert.specific_fn.loc10_32.2 (constants.%Convert.specific_fn)] // CHECK:STDOUT: %int.convert_checked.loc10_32.1: init Core.IntLiteral = call %Convert.specific_fn.loc10_32.1(%N.ref) [symbolic = %int.convert_checked.loc10_32.2 (constants.%int.convert_checked)] @@ -591,7 +591,7 @@ fn G() -> C { // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] @@ -680,7 +680,7 @@ fn G() -> C { // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.2] @@ -755,7 +755,7 @@ fn G() -> C { // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] // CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.3, @impl.2(%int_32) [template] // CHECK:STDOUT: %Convert.9: %Convert.type.9 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.9) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.9) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %N.2, %Convert.9 [symbolic] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.3(%int_32) [symbolic] // CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %Convert.specific_fn(%N.2) [symbolic] @@ -813,7 +813,7 @@ fn G() -> C { // CHECK:STDOUT: %.loc10_23: type = splice_block %array_type [template = ] { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %N.ref.loc10_22: %i32 = name_ref N, %N.loc10_6.1 [symbolic = %N.loc10_6.2 (constants.%N.2)] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.9] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.9] // CHECK:STDOUT: %Convert.bound.loc10_22.1: = bound_method %N.ref.loc10_22, %impl.elem0 [symbolic = %Convert.bound.loc10_22.2 (constants.%Convert.bound)] // CHECK:STDOUT: %Convert.specific_fn.loc10_22.1: = specific_function %Convert.bound.loc10_22.1, @Convert.3(constants.%int_32) [symbolic = %Convert.specific_fn.loc10_22.2 (constants.%Convert.specific_fn)] // CHECK:STDOUT: %int.convert_checked.loc10_22.1: init Core.IntLiteral = call %Convert.specific_fn.loc10_22.1(%N.ref.loc10_22) [symbolic = %int.convert_checked.loc10_22.2 (constants.%int.convert_checked)] diff --git a/toolchain/check/testdata/deduce/generic_type.carbon b/toolchain/check/testdata/deduce/generic_type.carbon index d8a71a4c888f8..450517531a512 100644 --- a/toolchain/check/testdata/deduce/generic_type.carbon +++ b/toolchain/check/testdata/deduce/generic_type.carbon @@ -752,7 +752,7 @@ fn G() -> i32 { // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] @@ -862,7 +862,7 @@ fn G() -> i32 { // CHECK:STDOUT: %.loc9_13.1: %empty_struct_type = struct_literal () // CHECK:STDOUT: %WithNontype.ref: %WithNontype.type = name_ref WithNontype, file.%WithNontype.decl [template = constants.%WithNontype.generic] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.2] diff --git a/toolchain/check/testdata/deduce/tuple.carbon b/toolchain/check/testdata/deduce/tuple.carbon index e266424c7ae2a..0a1b633cb9e82 100644 --- a/toolchain/check/testdata/deduce/tuple.carbon +++ b/toolchain/check/testdata/deduce/tuple.carbon @@ -248,7 +248,7 @@ fn G(pair: (C, D)) -> D { // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -346,13 +346,13 @@ fn G(pair: (C, D)) -> D { // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %.loc8_22.1: %tuple.type.3 = tuple_literal (%int_1, %int_2) -// CHECK:STDOUT: %impl.elem0.loc8_22.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc8_22.1: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc8_22.1: = bound_method %int_1, %impl.elem0.loc8_22.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc8_22.1: = specific_function %Convert.bound.loc8_22.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc8_22.1: init %i32 = call %Convert.specific_fn.loc8_22.1(%int_1) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc8_22.2: %i32 = value_of_initializer %int.convert_checked.loc8_22.1 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc8_22.3: %i32 = converted %int_1, %.loc8_22.2 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc8_22.2: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc8_22.2: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc8_22.2: = bound_method %int_2, %impl.elem0.loc8_22.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc8_22.2: = specific_function %Convert.bound.loc8_22.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc8_22.2: init %i32 = call %Convert.specific_fn.loc8_22.2(%int_2) [template = constants.%int_2.2] diff --git a/toolchain/check/testdata/eval/aggregate.carbon b/toolchain/check/testdata/eval/aggregate.carbon index 4c61640caf159..70a434c411803 100644 --- a/toolchain/check/testdata/eval/aggregate.carbon +++ b/toolchain/check/testdata/eval/aggregate.carbon @@ -29,7 +29,7 @@ var struct_access: [i32; 1] = (0,) as [i32; {.a = 3, .b = 1}.b]; // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -101,13 +101,13 @@ var struct_access: [i32; 1] = (0,) as [i32; {.a = 3, .b = 1}.b]; // CHECK:STDOUT: %i32.loc11_46: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %.loc11_49.1: %tuple.type.1 = tuple_literal (%i32.loc11_41, %i32.loc11_46) // CHECK:STDOUT: %.loc11_49.2: type = converted %.loc11_49.1, constants.%tuple.type.2 [template = constants.%tuple.type.2] -// CHECK:STDOUT: %impl.elem0.loc11_35.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11_35.1: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_35.1: = bound_method %int_1.loc11, %impl.elem0.loc11_35.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc11_35.1: = specific_function %Convert.bound.loc11_35.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc11_35.1: init %i32 = call %Convert.specific_fn.loc11_35.1(%int_1.loc11) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc11_35.2: %i32 = value_of_initializer %int.convert_checked.loc11_35.1 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc11_35.3: %i32 = converted %int_1.loc11, %.loc11_35.2 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc11_35.2: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11_35.2: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_35.2: = bound_method %int_2.loc11, %impl.elem0.loc11_35.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc11_35.2: = specific_function %Convert.bound.loc11_35.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc11_35.2: init %i32 = call %Convert.specific_fn.loc11_35.2(%int_2.loc11) [template = constants.%int_2.2] @@ -135,19 +135,19 @@ var struct_access: [i32; 1] = (0,) as [i32; {.a = 3, .b = 1}.b]; // CHECK:STDOUT: %int_32.loc13_99: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc13_99: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %struct_type.b.a.c: type = struct_type {.b: %i32, .a: %i32, .c: %i32} [template = constants.%struct_type.b.a.c] -// CHECK:STDOUT: %impl.elem0.loc13_71.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc13_71.1: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc13_71.1: = bound_method %int_2.loc13, %impl.elem0.loc13_71.1 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc13_71.1: = specific_function %Convert.bound.loc13_71.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc13_71.1: init %i32 = call %Convert.specific_fn.loc13_71.1(%int_2.loc13) [template = constants.%int_2.2] // CHECK:STDOUT: %.loc13_71.2: %i32 = value_of_initializer %int.convert_checked.loc13_71.1 [template = constants.%int_2.2] // CHECK:STDOUT: %.loc13_71.3: %i32 = converted %int_2.loc13, %.loc13_71.2 [template = constants.%int_2.2] -// CHECK:STDOUT: %impl.elem0.loc13_71.2: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc13_71.2: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc13_71.2: = bound_method %int_1.loc13, %impl.elem0.loc13_71.2 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc13_71.2: = specific_function %Convert.bound.loc13_71.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc13_71.2: init %i32 = call %Convert.specific_fn.loc13_71.2(%int_1.loc13) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc13_71.4: %i32 = value_of_initializer %int.convert_checked.loc13_71.2 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc13_71.5: %i32 = converted %int_1.loc13, %.loc13_71.4 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc13_71.3: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc13_71.3: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc13_71.3: = bound_method %int_3.loc13, %impl.elem0.loc13_71.3 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc13_71.3: = specific_function %Convert.bound.loc13_71.3, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc13_71.3: init %i32 = call %Convert.specific_fn.loc13_71.3(%int_3.loc13) [template = constants.%int_3.2] @@ -181,7 +181,7 @@ var struct_access: [i32; 1] = (0,) as [i32; {.a = 3, .b = 1}.b]; // CHECK:STDOUT: %.loc15_54.2: %tuple.type.5 = converted %.loc15_54.1, %tuple.loc15 [template = constants.%tuple.2] // CHECK:STDOUT: %tuple.elem2: Core.IntLiteral = tuple_access %.loc15_54.2, element2 [template = constants.%int_1.1] // CHECK:STDOUT: %array_type.loc15: type = array_type %tuple.elem2, %i32 [template = constants.%array_type] -// CHECK:STDOUT: %impl.elem0.loc15: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc15: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc15: = bound_method %int_0.loc15_30, %impl.elem0.loc15 [template = constants.%Convert.bound.4] // CHECK:STDOUT: %Convert.specific_fn.loc15: = specific_function %Convert.bound.loc15, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.4] // CHECK:STDOUT: %int.convert_checked.loc15: init %i32 = call %Convert.specific_fn.loc15(%int_0.loc15_30) [template = constants.%int_0.2] @@ -204,7 +204,7 @@ var struct_access: [i32; 1] = (0,) as [i32; {.a = 3, .b = 1}.b]; // CHECK:STDOUT: %.loc17_60.2: %struct_type.a.b = converted %.loc17_60.1, %struct.loc17 [template = constants.%struct.3] // CHECK:STDOUT: %.loc17_61: Core.IntLiteral = struct_access %.loc17_60.2, element1 [template = constants.%int_1.1] // CHECK:STDOUT: %array_type.loc17: type = array_type %.loc17_61, %i32 [template = constants.%array_type] -// CHECK:STDOUT: %impl.elem0.loc17: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc17: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc17: = bound_method %int_0.loc17_32, %impl.elem0.loc17 [template = constants.%Convert.bound.4] // CHECK:STDOUT: %Convert.specific_fn.loc17: = specific_function %Convert.bound.loc17, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.4] // CHECK:STDOUT: %int.convert_checked.loc17: init %i32 = call %Convert.specific_fn.loc17(%int_0.loc17_32) [template = constants.%int_0.2] diff --git a/toolchain/check/testdata/eval/fail_aggregate.carbon b/toolchain/check/testdata/eval/fail_aggregate.carbon index 5a275ea40f855..7e338948cb126 100644 --- a/toolchain/check/testdata/eval/fail_aggregate.carbon +++ b/toolchain/check/testdata/eval/fail_aggregate.carbon @@ -33,7 +33,7 @@ var array_index: [i32; 1] = (0,) as [i32; ((5, 7, 1, 9) as [i32; 4])[2]]; // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_5.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_5.2: %i32 = int_value 5 [template] @@ -88,7 +88,7 @@ var array_index: [i32; 1] = (0,) as [i32; ((5, 7, 1, 9) as [i32; 4])[2]]; // CHECK:STDOUT: %i32.loc16_61: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [template = constants.%int_4] // CHECK:STDOUT: %array_type: type = array_type %int_4, %i32 [template = constants.%array_type.2] -// CHECK:STDOUT: %impl.elem0.loc16_55.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc16_55.1: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc16_55.1: = bound_method %int_5, %impl.elem0.loc16_55.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc16_55.1: = specific_function %Convert.bound.loc16_55.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc16_55.1: init %i32 = call %Convert.specific_fn.loc16_55.1(%int_5) [template = constants.%int_5.2] @@ -97,7 +97,7 @@ var array_index: [i32; 1] = (0,) as [i32; ((5, 7, 1, 9) as [i32; 4])[2]]; // CHECK:STDOUT: %int_0.loc16_55: Core.IntLiteral = int_value 0 [template = constants.%int_0] // CHECK:STDOUT: %.loc16_55.4: ref %i32 = array_index %.loc16_55.3, %int_0.loc16_55 // CHECK:STDOUT: %.loc16_55.5: init %i32 = initialize_from %.loc16_55.2 to %.loc16_55.4 [template = constants.%int_5.2] -// CHECK:STDOUT: %impl.elem0.loc16_55.2: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc16_55.2: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc16_55.2: = bound_method %int_7, %impl.elem0.loc16_55.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc16_55.2: = specific_function %Convert.bound.loc16_55.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc16_55.2: init %i32 = call %Convert.specific_fn.loc16_55.2(%int_7) [template = constants.%int_7.2] @@ -105,7 +105,7 @@ var array_index: [i32; 1] = (0,) as [i32; ((5, 7, 1, 9) as [i32; 4])[2]]; // CHECK:STDOUT: %int_1.loc16_55: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %.loc16_55.7: ref %i32 = array_index %.loc16_55.3, %int_1.loc16_55 // CHECK:STDOUT: %.loc16_55.8: init %i32 = initialize_from %.loc16_55.6 to %.loc16_55.7 [template = constants.%int_7.2] -// CHECK:STDOUT: %impl.elem0.loc16_55.3: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc16_55.3: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc16_55.3: = bound_method %int_1.loc16_51, %impl.elem0.loc16_55.3 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc16_55.3: = specific_function %Convert.bound.loc16_55.3, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc16_55.3: init %i32 = call %Convert.specific_fn.loc16_55.3(%int_1.loc16_51) [template = constants.%int_1.2] @@ -113,7 +113,7 @@ var array_index: [i32; 1] = (0,) as [i32; ((5, 7, 1, 9) as [i32; 4])[2]]; // CHECK:STDOUT: %int_2.loc16_55: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %.loc16_55.10: ref %i32 = array_index %.loc16_55.3, %int_2.loc16_55 // CHECK:STDOUT: %.loc16_55.11: init %i32 = initialize_from %.loc16_55.9 to %.loc16_55.10 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc16_55.4: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc16_55.4: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc16_55.4: = bound_method %int_9, %impl.elem0.loc16_55.4 [template = constants.%Convert.bound.4] // CHECK:STDOUT: %Convert.specific_fn.loc16_55.4: = specific_function %Convert.bound.loc16_55.4, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.4] // CHECK:STDOUT: %int.convert_checked.loc16_55.4: init %i32 = call %Convert.specific_fn.loc16_55.4(%int_9) [template = constants.%int_9.2] @@ -127,7 +127,7 @@ var array_index: [i32; 1] = (0,) as [i32; ((5, 7, 1, 9) as [i32; 4])[2]]; // CHECK:STDOUT: %.loc16_57.2: ref %array_type.2 = temporary %.loc16_55.3, %.loc16_57.1 // CHECK:STDOUT: %int_32.loc16_71: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc16_71: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc16_70: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc16_70: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc16_70: = bound_method %int_2.loc16_70, %impl.elem0.loc16_70 [template = constants.%Convert.bound.5] // CHECK:STDOUT: %Convert.specific_fn.loc16_70: = specific_function %Convert.bound.loc16_70, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.5] // CHECK:STDOUT: %int.convert_checked.loc16_70: init %i32 = call %Convert.specific_fn.loc16_70(%int_2.loc16_70) [template = constants.%int_2.2] diff --git a/toolchain/check/testdata/function/call/i32.carbon b/toolchain/check/testdata/function/call/i32.carbon index 728319a639585..875c108d45cd1 100644 --- a/toolchain/check/testdata/function/call/i32.carbon +++ b/toolchain/check/testdata/function/call/i32.carbon @@ -29,7 +29,7 @@ fn Main() { // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -83,7 +83,7 @@ fn Main() { // CHECK:STDOUT: %b: ref %i32 = bind_name b, %b.var // CHECK:STDOUT: %Echo.ref: %Echo.type = name_ref Echo, file.%Echo.decl [template = constants.%Echo] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_1) [template = constants.%int_1.2] diff --git a/toolchain/check/testdata/function/call/more_param_ir.carbon b/toolchain/check/testdata/function/call/more_param_ir.carbon index b74cfefdfec08..6d9db96b7fff7 100644 --- a/toolchain/check/testdata/function/call/more_param_ir.carbon +++ b/toolchain/check/testdata/function/call/more_param_ir.carbon @@ -32,7 +32,7 @@ fn Main() { // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -93,7 +93,7 @@ fn Main() { // CHECK:STDOUT: %x: ref %tuple.type.2 = bind_name x, %x.var // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %.loc14_22.1: %tuple.type.3 = tuple_literal (%int_1) -// CHECK:STDOUT: %impl.elem0.loc14: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc14: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc14: = bound_method %int_1, %impl.elem0.loc14 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc14: = specific_function %Convert.bound.loc14, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc14: init %i32 = call %Convert.specific_fn.loc14(%int_1) [template = constants.%int_1.2] @@ -107,7 +107,7 @@ fn Main() { // CHECK:STDOUT: %tuple.elem0: ref %i32 = tuple_access %x.ref, element0 // CHECK:STDOUT: %int_6: Core.IntLiteral = int_value 6 [template = constants.%int_6.1] // CHECK:STDOUT: %.loc16_8: %i32 = bind_value %tuple.elem0 -// CHECK:STDOUT: %impl.elem0.loc16: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc16: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc16: = bound_method %int_6, %impl.elem0.loc16 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc16: = specific_function %Convert.bound.loc16, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc16: init %i32 = call %Convert.specific_fn.loc16(%int_6) [template = constants.%int_6.2] diff --git a/toolchain/check/testdata/function/call/params_one.carbon b/toolchain/check/testdata/function/call/params_one.carbon index 579c5ea9ab942..06ff140bb7962 100644 --- a/toolchain/check/testdata/function/call/params_one.carbon +++ b/toolchain/check/testdata/function/call/params_one.carbon @@ -28,7 +28,7 @@ fn Main() { // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -73,7 +73,7 @@ fn Main() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Foo.ref: %Foo.type = name_ref Foo, file.%Foo.decl [template = constants.%Foo] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_1) [template = constants.%int_1.2] diff --git a/toolchain/check/testdata/function/call/params_one_comma.carbon b/toolchain/check/testdata/function/call/params_one_comma.carbon index 824200f8ac76a..52f00c4fa41b7 100644 --- a/toolchain/check/testdata/function/call/params_one_comma.carbon +++ b/toolchain/check/testdata/function/call/params_one_comma.carbon @@ -29,7 +29,7 @@ fn Main() { // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -74,7 +74,7 @@ fn Main() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Foo.ref.loc14: %Foo.type = name_ref Foo, file.%Foo.decl [template = constants.%Foo] // CHECK:STDOUT: %int_1.loc14: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc14: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc14: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc14: = bound_method %int_1.loc14, %impl.elem0.loc14 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn.loc14: = specific_function %Convert.bound.loc14, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc14: init %i32 = call %Convert.specific_fn.loc14(%int_1.loc14) [template = constants.%int_1.2] @@ -83,7 +83,7 @@ fn Main() { // CHECK:STDOUT: %Foo.call.loc14: init %empty_tuple.type = call %Foo.ref.loc14(%.loc14_7.2) // CHECK:STDOUT: %Foo.ref.loc15: %Foo.type = name_ref Foo, file.%Foo.decl [template = constants.%Foo] // CHECK:STDOUT: %int_1.loc15: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc15: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc15: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc15: = bound_method %int_1.loc15, %impl.elem0.loc15 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn.loc15: = specific_function %Convert.bound.loc15, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc15: init %i32 = call %Convert.specific_fn.loc15(%int_1.loc15) [template = constants.%int_1.2] diff --git a/toolchain/check/testdata/function/call/params_two.carbon b/toolchain/check/testdata/function/call/params_two.carbon index be496138e71fe..8d60586684cdf 100644 --- a/toolchain/check/testdata/function/call/params_two.carbon +++ b/toolchain/check/testdata/function/call/params_two.carbon @@ -29,7 +29,7 @@ fn Main() { // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -86,13 +86,13 @@ fn Main() { // CHECK:STDOUT: %Foo.ref: %Foo.type = name_ref Foo, file.%Foo.decl [template = constants.%Foo] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %impl.elem0.loc14_7: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc14_7: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc14_7: = bound_method %int_1, %impl.elem0.loc14_7 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc14_7: = specific_function %Convert.bound.loc14_7, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc14_7: init %i32 = call %Convert.specific_fn.loc14_7(%int_1) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc14_7.1: %i32 = value_of_initializer %int.convert_checked.loc14_7 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc14_7.2: %i32 = converted %int_1, %.loc14_7.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc14_10: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc14_10: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc14_10: = bound_method %int_2, %impl.elem0.loc14_10 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc14_10: = specific_function %Convert.bound.loc14_10, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc14_10: init %i32 = call %Convert.specific_fn.loc14_10(%int_2) [template = constants.%int_2.2] diff --git a/toolchain/check/testdata/function/call/params_two_comma.carbon b/toolchain/check/testdata/function/call/params_two_comma.carbon index d7e1cf0d19550..7e5416fda5116 100644 --- a/toolchain/check/testdata/function/call/params_two_comma.carbon +++ b/toolchain/check/testdata/function/call/params_two_comma.carbon @@ -30,7 +30,7 @@ fn Main() { // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -87,13 +87,13 @@ fn Main() { // CHECK:STDOUT: %Foo.ref.loc14: %Foo.type = name_ref Foo, file.%Foo.decl [template = constants.%Foo] // CHECK:STDOUT: %int_1.loc14: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_2.loc14: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %impl.elem0.loc14_7: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc14_7: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc14_7: = bound_method %int_1.loc14, %impl.elem0.loc14_7 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc14_7: = specific_function %Convert.bound.loc14_7, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc14_7: init %i32 = call %Convert.specific_fn.loc14_7(%int_1.loc14) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc14_7.1: %i32 = value_of_initializer %int.convert_checked.loc14_7 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc14_7.2: %i32 = converted %int_1.loc14, %.loc14_7.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc14_10: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc14_10: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc14_10: = bound_method %int_2.loc14, %impl.elem0.loc14_10 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc14_10: = specific_function %Convert.bound.loc14_10, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc14_10: init %i32 = call %Convert.specific_fn.loc14_10(%int_2.loc14) [template = constants.%int_2.2] @@ -103,13 +103,13 @@ fn Main() { // CHECK:STDOUT: %Foo.ref.loc15: %Foo.type = name_ref Foo, file.%Foo.decl [template = constants.%Foo] // CHECK:STDOUT: %int_1.loc15: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_2.loc15: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %impl.elem0.loc15_7: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc15_7: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc15_7: = bound_method %int_1.loc15, %impl.elem0.loc15_7 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc15_7: = specific_function %Convert.bound.loc15_7, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc15_7: init %i32 = call %Convert.specific_fn.loc15_7(%int_1.loc15) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc15_7.1: %i32 = value_of_initializer %int.convert_checked.loc15_7 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc15_7.2: %i32 = converted %int_1.loc15, %.loc15_7.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc15_10: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc15_10: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc15_10: = bound_method %int_2.loc15, %impl.elem0.loc15_10 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc15_10: = specific_function %Convert.bound.loc15_10, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc15_10: init %i32 = call %Convert.specific_fn.loc15_10(%int_2.loc15) [template = constants.%int_2.2] diff --git a/toolchain/check/testdata/function/call/prefer_unqualified_lookup.carbon b/toolchain/check/testdata/function/call/prefer_unqualified_lookup.carbon index 1dd935b8a51f5..d6d0457d52af7 100644 --- a/toolchain/check/testdata/function/call/prefer_unqualified_lookup.carbon +++ b/toolchain/check/testdata/function/call/prefer_unqualified_lookup.carbon @@ -45,7 +45,7 @@ fn Class(F:! type).Inner.G() -> i32 { return F(); } // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] @@ -147,7 +147,7 @@ fn Class(F:! type).Inner.G() -> i32 { return F(); } // CHECK:STDOUT: fn() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.2] diff --git a/toolchain/check/testdata/function/declaration/import.carbon b/toolchain/check/testdata/function/declaration/import.carbon index 89a96dce322e1..2356a39b75d3d 100644 --- a/toolchain/check/testdata/function/declaration/import.carbon +++ b/toolchain/check/testdata/function/declaration/import.carbon @@ -455,7 +455,7 @@ import library "extern_api"; // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -534,7 +534,7 @@ import library "extern_api"; // CHECK:STDOUT: assign file.%a.var, %A.call // CHECK:STDOUT: %B.ref: %B.type = name_ref B, imports.%import_ref.2 [template = constants.%B] // CHECK:STDOUT: %int_1.loc7: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc7: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc7: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc7: = bound_method %int_1.loc7, %impl.elem0.loc7 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn.loc7: = specific_function %Convert.bound.loc7, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc7: init %i32 = call %Convert.specific_fn.loc7(%int_1.loc7) [template = constants.%int_1.2] @@ -545,7 +545,7 @@ import library "extern_api"; // CHECK:STDOUT: %C.ref: %C.type = name_ref C, imports.%import_ref.3 [template = constants.%C] // CHECK:STDOUT: %int_1.loc8: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %.loc8_25.1: %tuple.type.2 = tuple_literal (%int_1.loc8) -// CHECK:STDOUT: %impl.elem0.loc8: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc8: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc8: = bound_method %int_1.loc8, %impl.elem0.loc8 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn.loc8: = specific_function %Convert.bound.loc8, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc8: init %i32 = call %Convert.specific_fn.loc8(%int_1.loc8) [template = constants.%int_1.2] @@ -588,7 +588,7 @@ import library "extern_api"; // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -684,7 +684,7 @@ import library "extern_api"; // CHECK:STDOUT: assign file.%a.var, %A.call // CHECK:STDOUT: %B.ref: %B.type = name_ref B, file.%B.decl [template = constants.%B] // CHECK:STDOUT: %int_1.loc53: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc53: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc53: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc53: = bound_method %int_1.loc53, %impl.elem0.loc53 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn.loc53: = specific_function %Convert.bound.loc53, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc53: init %i32 = call %Convert.specific_fn.loc53(%int_1.loc53) [template = constants.%int_1.2] @@ -695,7 +695,7 @@ import library "extern_api"; // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %int_1.loc54: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %.loc54_25.1: %tuple.type.3 = tuple_literal (%int_1.loc54) -// CHECK:STDOUT: %impl.elem0.loc54: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc54: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc54: = bound_method %int_1.loc54, %impl.elem0.loc54 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn.loc54: = specific_function %Convert.bound.loc54, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc54: init %i32 = call %Convert.specific_fn.loc54(%int_1.loc54) [template = constants.%int_1.2] @@ -738,7 +738,7 @@ import library "extern_api"; // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -834,7 +834,7 @@ import library "extern_api"; // CHECK:STDOUT: assign file.%a.var, %A.call // CHECK:STDOUT: %B.ref: %B.type = name_ref B, file.%B.decl [template = constants.%B] // CHECK:STDOUT: %int_1.loc13: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc13: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc13: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc13: = bound_method %int_1.loc13, %impl.elem0.loc13 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn.loc13: = specific_function %Convert.bound.loc13, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc13: init %i32 = call %Convert.specific_fn.loc13(%int_1.loc13) [template = constants.%int_1.2] @@ -845,7 +845,7 @@ import library "extern_api"; // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %int_1.loc14: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %.loc14_25.1: %tuple.type.3 = tuple_literal (%int_1.loc14) -// CHECK:STDOUT: %impl.elem0.loc14: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc14: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc14: = bound_method %int_1.loc14, %impl.elem0.loc14 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn.loc14: = specific_function %Convert.bound.loc14, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc14: init %i32 = call %Convert.specific_fn.loc14(%int_1.loc14) [template = constants.%int_1.2] @@ -879,7 +879,7 @@ import library "extern_api"; // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -958,7 +958,7 @@ import library "extern_api"; // CHECK:STDOUT: assign file.%a.var, %A.call // CHECK:STDOUT: %B.ref: %B.type = name_ref B, imports.%import_ref.2 [template = constants.%B] // CHECK:STDOUT: %int_1.loc53: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc53: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc53: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc53: = bound_method %int_1.loc53, %impl.elem0.loc53 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn.loc53: = specific_function %Convert.bound.loc53, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc53: init %i32 = call %Convert.specific_fn.loc53(%int_1.loc53) [template = constants.%int_1.2] @@ -969,7 +969,7 @@ import library "extern_api"; // CHECK:STDOUT: %C.ref: %C.type = name_ref C, imports.%import_ref.3 [template = constants.%C] // CHECK:STDOUT: %int_1.loc54: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %.loc54_25.1: %tuple.type.2 = tuple_literal (%int_1.loc54) -// CHECK:STDOUT: %impl.elem0.loc54: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc54: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc54: = bound_method %int_1.loc54, %impl.elem0.loc54 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn.loc54: = specific_function %Convert.bound.loc54, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc54: init %i32 = call %Convert.specific_fn.loc54(%int_1.loc54) [template = constants.%int_1.2] @@ -1003,7 +1003,7 @@ import library "extern_api"; // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -1082,7 +1082,7 @@ import library "extern_api"; // CHECK:STDOUT: assign file.%a.var, %A.call // CHECK:STDOUT: %B.ref: %B.type = name_ref B, imports.%import_ref.2 [template = constants.%B] // CHECK:STDOUT: %int_1.loc52: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc52: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc52: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc52: = bound_method %int_1.loc52, %impl.elem0.loc52 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn.loc52: = specific_function %Convert.bound.loc52, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc52: init %i32 = call %Convert.specific_fn.loc52(%int_1.loc52) [template = constants.%int_1.2] @@ -1093,7 +1093,7 @@ import library "extern_api"; // CHECK:STDOUT: %C.ref: %C.type = name_ref C, imports.%import_ref.3 [template = constants.%C] // CHECK:STDOUT: %int_1.loc53: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %.loc53_25.1: %tuple.type.2 = tuple_literal (%int_1.loc53) -// CHECK:STDOUT: %impl.elem0.loc53: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc53: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc53: = bound_method %int_1.loc53, %impl.elem0.loc53 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn.loc53: = specific_function %Convert.bound.loc53, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc53: init %i32 = call %Convert.specific_fn.loc53(%int_1.loc53) [template = constants.%int_1.2] diff --git a/toolchain/check/testdata/function/definition/import.carbon b/toolchain/check/testdata/function/definition/import.carbon index b445c590c7bd1..8068b9d443b6f 100644 --- a/toolchain/check/testdata/function/definition/import.carbon +++ b/toolchain/check/testdata/function/definition/import.carbon @@ -249,7 +249,7 @@ fn D() {} // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -308,7 +308,7 @@ fn D() {} // CHECK:STDOUT: assign file.%a.var, %A.call // CHECK:STDOUT: %B.ref: %B.type = name_ref B, imports.%import_ref.2 [template = constants.%B] // CHECK:STDOUT: %int_1.loc7: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc7: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc7: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc7: = bound_method %int_1.loc7, %impl.elem0.loc7 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn.loc7: = specific_function %Convert.bound.loc7, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc7: init %i32 = call %Convert.specific_fn.loc7(%int_1.loc7) [template = constants.%int_1.2] @@ -319,7 +319,7 @@ fn D() {} // CHECK:STDOUT: %C.ref: %C.type = name_ref C, imports.%import_ref.3 [template = constants.%C] // CHECK:STDOUT: %int_1.loc8: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %.loc8_25.1: %tuple.type.2 = tuple_literal (%int_1.loc8) -// CHECK:STDOUT: %impl.elem0.loc8: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc8: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc8: = bound_method %int_1.loc8, %impl.elem0.loc8 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn.loc8: = specific_function %Convert.bound.loc8, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc8: init %i32 = call %Convert.specific_fn.loc8(%int_1.loc8) [template = constants.%int_1.2] diff --git a/toolchain/check/testdata/function/generic/deduce.carbon b/toolchain/check/testdata/function/generic/deduce.carbon index 7ef56292af90e..a5287fd80034e 100644 --- a/toolchain/check/testdata/function/generic/deduce.carbon +++ b/toolchain/check/testdata/function/generic/deduce.carbon @@ -787,7 +787,7 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_2.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] @@ -853,7 +853,7 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %.loc7_19.1: %tuple.type.3 = tuple_literal (%int_1, %int_2) // CHECK:STDOUT: %TupleParam.specific_fn: = specific_function %TupleParam.ref, @TupleParam(Core.IntLiteral) [template = constants.%TupleParam.specific_fn] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_2, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_2) [template = constants.%int_2.2] @@ -902,7 +902,7 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_2.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] @@ -967,7 +967,7 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %.loc7_30.1: %struct_type.a.b.2 = struct_literal (%int_1, %int_2) // CHECK:STDOUT: %StructParam.specific_fn: = specific_function %StructParam.ref, @StructParam(Core.IntLiteral) [template = constants.%StructParam.specific_fn] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_2, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_2) [template = constants.%int_2.2] diff --git a/toolchain/check/testdata/function/generic/fail_todo_param_in_type.carbon b/toolchain/check/testdata/function/generic/fail_todo_param_in_type.carbon index 360c8ee860ebf..bc7f9411918ce 100644 --- a/toolchain/check/testdata/function/generic/fail_todo_param_in_type.carbon +++ b/toolchain/check/testdata/function/generic/fail_todo_param_in_type.carbon @@ -23,7 +23,7 @@ fn F(N:! i32, a: [i32; N]*); // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] // CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.3, @impl.2(%int_32) [template] // CHECK:STDOUT: %Convert.9: %Convert.type.9 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.9) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.9) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %N.2, %Convert.9 [symbolic] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.3(%int_32) [symbolic] // CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %Convert.specific_fn(%N.2) [symbolic] @@ -63,7 +63,7 @@ fn F(N:! i32, a: [i32; N]*); // CHECK:STDOUT: %int_32.loc14_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc14_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %N.ref: %i32 = name_ref N, %N.loc14_6.1 [symbolic = %N.loc14_6.2 (constants.%N.2)] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.9] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.9] // CHECK:STDOUT: %Convert.bound.loc14_24.1: = bound_method %N.ref, %impl.elem0 [symbolic = %Convert.bound.loc14_24.2 (constants.%Convert.bound)] // CHECK:STDOUT: %Convert.specific_fn.loc14_24.1: = specific_function %Convert.bound.loc14_24.1, @Convert.3(constants.%int_32) [symbolic = %Convert.specific_fn.loc14_24.2 (constants.%Convert.specific_fn)] // CHECK:STDOUT: %int.convert_checked.loc14_24.1: init Core.IntLiteral = call %Convert.specific_fn.loc14_24.1(%N.ref) [symbolic = %int.convert_checked.loc14_24.2 (constants.%int.convert_checked)] diff --git a/toolchain/check/testdata/function/generic/undefined.carbon b/toolchain/check/testdata/function/generic/undefined.carbon index 5d17cc2abbf9b..76b13e58c7bd2 100644 --- a/toolchain/check/testdata/function/generic/undefined.carbon +++ b/toolchain/check/testdata/function/generic/undefined.carbon @@ -68,7 +68,7 @@ fn CallUndefined() -> i32 { // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @As(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.5, @impl.3(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.5(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] @@ -139,7 +139,7 @@ fn CallUndefined() -> i32 { // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %int_32.loc9: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc9: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.5(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.2] @@ -182,7 +182,7 @@ fn CallUndefined() -> i32 { // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @As(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.5, @impl.3(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.5(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] @@ -271,7 +271,7 @@ fn CallUndefined() -> i32 { // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %int_32.loc7: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc7: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.5(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.2] @@ -312,7 +312,7 @@ fn CallUndefined() -> i32 { // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @As(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.5, @impl.3(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.5(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] @@ -376,7 +376,7 @@ fn CallUndefined() -> i32 { // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %int_32.loc13: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc13: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.5(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.2] diff --git a/toolchain/check/testdata/global/simple_init.carbon b/toolchain/check/testdata/global/simple_init.carbon index ce22fe8c47113..b5746a1114b98 100644 --- a/toolchain/check/testdata/global/simple_init.carbon +++ b/toolchain/check/testdata/global/simple_init.carbon @@ -18,7 +18,7 @@ var a: i32 = 0; // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] @@ -46,7 +46,7 @@ var a: i32 = 0; // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.2] diff --git a/toolchain/check/testdata/global/simple_with_fun.carbon b/toolchain/check/testdata/global/simple_with_fun.carbon index 9b415f907b946..46ee685e4a70a 100644 --- a/toolchain/check/testdata/global/simple_with_fun.carbon +++ b/toolchain/check/testdata/global/simple_with_fun.carbon @@ -25,7 +25,7 @@ var a: i32 = test_a(); // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] @@ -63,7 +63,7 @@ var a: i32 = test_a(); // CHECK:STDOUT: fn @test_a() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.2] diff --git a/toolchain/check/testdata/if/fail_reachable_fallthrough.carbon b/toolchain/check/testdata/if/fail_reachable_fallthrough.carbon index 181cd0ac3eda6..908fa8ce93fd8 100644 --- a/toolchain/check/testdata/if/fail_reachable_fallthrough.carbon +++ b/toolchain/check/testdata/if/fail_reachable_fallthrough.carbon @@ -52,7 +52,7 @@ fn If3(b: bool) -> i32 { // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -147,7 +147,7 @@ fn If3(b: bool) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: !if.then: // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1, %impl.elem0 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_1) [template = constants.%int_1.2] @@ -171,7 +171,7 @@ fn If3(b: bool) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: !if.else: // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_2, %impl.elem0 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_2) [template = constants.%int_2.2] @@ -189,7 +189,7 @@ fn If3(b: bool) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: !if.then: // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1, %impl.elem0 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_1) [template = constants.%int_1.2] diff --git a/toolchain/check/testdata/if/fail_scope.carbon b/toolchain/check/testdata/if/fail_scope.carbon index 89eb2b35e0644..55ff6d4255135 100644 --- a/toolchain/check/testdata/if/fail_scope.carbon +++ b/toolchain/check/testdata/if/fail_scope.carbon @@ -32,7 +32,7 @@ fn VarScope(b: bool) -> i32 { // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_2.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] @@ -83,7 +83,7 @@ fn VarScope(b: bool) -> i32 { // CHECK:STDOUT: %n.var: ref %i32 = var n // CHECK:STDOUT: %n: ref %i32 = bind_name n, %n.var // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_2, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_2) [template = constants.%int_2.2] diff --git a/toolchain/check/testdata/if/unreachable_fallthrough.carbon b/toolchain/check/testdata/if/unreachable_fallthrough.carbon index d3f743e5d9fb1..d50c5dd076fe0 100644 --- a/toolchain/check/testdata/if/unreachable_fallthrough.carbon +++ b/toolchain/check/testdata/if/unreachable_fallthrough.carbon @@ -30,7 +30,7 @@ fn If(b: bool) -> i32 { // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -83,7 +83,7 @@ fn If(b: bool) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: !if.then: // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc13: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc13: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc13: = bound_method %int_1, %impl.elem0.loc13 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc13: = specific_function %Convert.bound.loc13, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc13: init %i32 = call %Convert.specific_fn.loc13(%int_1) [template = constants.%int_1.2] @@ -93,7 +93,7 @@ fn If(b: bool) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: !if.else: // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %impl.elem0.loc15: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc15: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc15: = bound_method %int_2, %impl.elem0.loc15 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc15: = specific_function %Convert.bound.loc15, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc15: init %i32 = call %Convert.specific_fn.loc15(%int_2) [template = constants.%int_2.2] diff --git a/toolchain/check/testdata/if_expr/basic.carbon b/toolchain/check/testdata/if_expr/basic.carbon index a4a346038c140..07f40b6454234 100644 --- a/toolchain/check/testdata/if_expr/basic.carbon +++ b/toolchain/check/testdata/if_expr/basic.carbon @@ -29,7 +29,7 @@ fn F(b: bool, n: i32, m: i32) -> i32 { // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] @@ -94,7 +94,7 @@ fn F(b: bool, n: i32, m: i32) -> i32 { // CHECK:STDOUT: %x: ref %array_type = bind_name x, %x.var // CHECK:STDOUT: %int_0.loc12_22: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %.loc12_24.1: %tuple.type = tuple_literal (%int_0.loc12_22) -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.loc12_22, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_0.loc12_22) [template = constants.%int_0.2] diff --git a/toolchain/check/testdata/if_expr/constant_condition.carbon b/toolchain/check/testdata/if_expr/constant_condition.carbon index 1d63bce3f0511..35f6efb91d91b 100644 --- a/toolchain/check/testdata/if_expr/constant_condition.carbon +++ b/toolchain/check/testdata/if_expr/constant_condition.carbon @@ -42,7 +42,7 @@ fn PartiallyConstant(t: type) -> i32 { // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -148,7 +148,7 @@ fn PartiallyConstant(t: type) -> i32 { // CHECK:STDOUT: fn @A() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1, %impl.elem0 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_1) [template = constants.%int_1.2] @@ -160,7 +160,7 @@ fn PartiallyConstant(t: type) -> i32 { // CHECK:STDOUT: fn @B() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_2, %impl.elem0 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_2) [template = constants.%int_2.2] @@ -222,7 +222,7 @@ fn PartiallyConstant(t: type) -> i32 { // CHECK:STDOUT: %v.var: ref %i32 = var v // CHECK:STDOUT: %v: ref %i32 = bind_name v, %v.var // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1, %impl.elem0 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_1) [template = constants.%int_1.2] @@ -245,7 +245,7 @@ fn PartiallyConstant(t: type) -> i32 { // CHECK:STDOUT: %v.var: ref %i32 = var v // CHECK:STDOUT: %v: ref %i32 = bind_name v, %v.var // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1, %impl.elem0 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_1) [template = constants.%int_1.2] diff --git a/toolchain/check/testdata/if_expr/control_flow.carbon b/toolchain/check/testdata/if_expr/control_flow.carbon index 8427a022407df..1904bb6d8bf19 100644 --- a/toolchain/check/testdata/if_expr/control_flow.carbon +++ b/toolchain/check/testdata/if_expr/control_flow.carbon @@ -26,7 +26,7 @@ fn F(b: bool) -> i32 { // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -101,7 +101,7 @@ fn F(b: bool) -> i32 { // CHECK:STDOUT: fn @A() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1, %impl.elem0 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_1) [template = constants.%int_1.2] @@ -113,7 +113,7 @@ fn F(b: bool) -> i32 { // CHECK:STDOUT: fn @B() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_2, %impl.elem0 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_2) [template = constants.%int_2.2] diff --git a/toolchain/check/testdata/if_expr/nested.carbon b/toolchain/check/testdata/if_expr/nested.carbon index e700adafd626b..c07eb3bb8f86a 100644 --- a/toolchain/check/testdata/if_expr/nested.carbon +++ b/toolchain/check/testdata/if_expr/nested.carbon @@ -25,7 +25,7 @@ fn F(a: bool, b: bool, c: bool) -> i32 { // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -110,7 +110,7 @@ fn F(a: bool, b: bool, c: bool) -> i32 { // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_32.loc12_25: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc12_25: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc12_25: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc12_25: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc12_25: = bound_method %int_1, %impl.elem0.loc12_25 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc12_25: = specific_function %Convert.bound.loc12_25, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc12_25: init %i32 = call %Convert.specific_fn.loc12_25(%int_1) [template = constants.%int_1.2] @@ -120,7 +120,7 @@ fn F(a: bool, b: bool, c: bool) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.else.loc12_20: // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %impl.elem0.loc12_32: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc12_32: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc12_32: = bound_method %int_2, %impl.elem0.loc12_32 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc12_32: = specific_function %Convert.bound.loc12_32, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc12_32: init %i32 = call %Convert.specific_fn.loc12_32(%int_2) [template = constants.%int_2.2] @@ -140,7 +140,7 @@ fn F(a: bool, b: bool, c: bool) -> i32 { // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] // CHECK:STDOUT: %int_32.loc12_49: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc12_49: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc12_49: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc12_49: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc12_49: = bound_method %int_3, %impl.elem0.loc12_49 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc12_49: = specific_function %Convert.bound.loc12_49, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc12_49: init %i32 = call %Convert.specific_fn.loc12_49(%int_3) [template = constants.%int_3.2] @@ -150,7 +150,7 @@ fn F(a: bool, b: bool, c: bool) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.else.loc12_44: // CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [template = constants.%int_4.1] -// CHECK:STDOUT: %impl.elem0.loc12_56: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc12_56: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc12_56: = bound_method %int_4, %impl.elem0.loc12_56 [template = constants.%Convert.bound.4] // CHECK:STDOUT: %Convert.specific_fn.loc12_56: = specific_function %Convert.bound.loc12_56, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.4] // CHECK:STDOUT: %int.convert_checked.loc12_56: init %i32 = call %Convert.specific_fn.loc12_56(%int_4) [template = constants.%int_4.2] diff --git a/toolchain/check/testdata/if_expr/struct.carbon b/toolchain/check/testdata/if_expr/struct.carbon index 3912d5aeb4647..389277b57fd4a 100644 --- a/toolchain/check/testdata/if_expr/struct.carbon +++ b/toolchain/check/testdata/if_expr/struct.carbon @@ -34,7 +34,7 @@ fn F(cond: bool) { // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -98,14 +98,14 @@ fn F(cond: bool) { // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %.loc14_46.1: %struct_type.a.b.2 = struct_literal (%int_1, %int_2) -// CHECK:STDOUT: %impl.elem0.loc14_46.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc14_46.1: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc14_46.1: = bound_method %int_1, %impl.elem0.loc14_46.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc14_46.1: = specific_function %Convert.bound.loc14_46.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc14_46.1: init %i32 = call %Convert.specific_fn.loc14_46.1(%int_1) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc14_46.2: init %i32 = converted %int_1, %int.convert_checked.loc14_46.1 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc14_46.3: ref %i32 = struct_access %a.var, element0 // CHECK:STDOUT: %.loc14_46.4: init %i32 = initialize_from %.loc14_46.2 to %.loc14_46.3 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc14_46.2: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc14_46.2: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc14_46.2: = bound_method %int_2, %impl.elem0.loc14_46.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc14_46.2: = specific_function %Convert.bound.loc14_46.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc14_46.2: init %i32 = call %Convert.specific_fn.loc14_46.2(%int_2) [template = constants.%int_2.2] diff --git a/toolchain/check/testdata/impl/extend_impl_generic.carbon b/toolchain/check/testdata/impl/extend_impl_generic.carbon index ad5b63dff11f0..2265dda36aeca 100644 --- a/toolchain/check/testdata/impl/extend_impl_generic.carbon +++ b/toolchain/check/testdata/impl/extend_impl_generic.carbon @@ -83,7 +83,7 @@ class X(U:! type) { // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.2(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.6: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.20: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_2.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] @@ -211,7 +211,7 @@ class X(U:! type) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %.loc15_21.1: %struct_type.x.2 = struct_literal (%int_2) -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.6, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.20, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_2, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_2) [template = constants.%int_2.2] diff --git a/toolchain/check/testdata/index/array_element_access.carbon b/toolchain/check/testdata/index/array_element_access.carbon index e4abbc748d764..96f952a471d1b 100644 --- a/toolchain/check/testdata/index/array_element_access.carbon +++ b/toolchain/check/testdata/index/array_element_access.carbon @@ -27,7 +27,7 @@ var d: i32 = a[b]; // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_12.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_12.2: %i32 = int_value 12 [template] @@ -77,7 +77,7 @@ var d: i32 = a[b]; // CHECK:STDOUT: %int_12: Core.IntLiteral = int_value 12 [template = constants.%int_12.1] // CHECK:STDOUT: %int_24: Core.IntLiteral = int_value 24 [template = constants.%int_24.1] // CHECK:STDOUT: %.loc11_26.1: %tuple.type = tuple_literal (%int_12, %int_24) -// CHECK:STDOUT: %impl.elem0.loc11_26.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11_26.1: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_26.1: = bound_method %int_12, %impl.elem0.loc11_26.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc11_26.1: = specific_function %Convert.bound.loc11_26.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc11_26.1: init %i32 = call %Convert.specific_fn.loc11_26.1(%int_12) [template = constants.%int_12.2] @@ -85,7 +85,7 @@ var d: i32 = a[b]; // CHECK:STDOUT: %int_0.loc11: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %.loc11_26.3: ref %i32 = array_index file.%a.var, %int_0.loc11 // CHECK:STDOUT: %.loc11_26.4: init %i32 = initialize_from %.loc11_26.2 to %.loc11_26.3 [template = constants.%int_12.2] -// CHECK:STDOUT: %impl.elem0.loc11_26.2: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11_26.2: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_26.2: = bound_method %int_24, %impl.elem0.loc11_26.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc11_26.2: = specific_function %Convert.bound.loc11_26.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc11_26.2: init %i32 = call %Convert.specific_fn.loc11_26.2(%int_24) [template = constants.%int_24.2] @@ -97,7 +97,7 @@ var d: i32 = a[b]; // CHECK:STDOUT: %.loc11_27: init %array_type = converted %.loc11_26.1, %.loc11_26.8 [template = constants.%array] // CHECK:STDOUT: assign file.%a.var, %.loc11_27 // CHECK:STDOUT: %int_1.loc12: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc12: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc12: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc12: = bound_method %int_1.loc12, %impl.elem0.loc12 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc12: = specific_function %Convert.bound.loc12, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc12: init %i32 = call %Convert.specific_fn.loc12(%int_1.loc12) [template = constants.%int_1.2] @@ -107,7 +107,7 @@ var d: i32 = a[b]; // CHECK:STDOUT: %int_0.loc13: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %int_32.loc13: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc13: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc13: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc13: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc13: = bound_method %int_0.loc13, %impl.elem0.loc13 [template = constants.%Convert.bound.4] // CHECK:STDOUT: %Convert.specific_fn.loc13: = specific_function %Convert.bound.loc13, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.4] // CHECK:STDOUT: %int.convert_checked.loc13: init %i32 = call %Convert.specific_fn.loc13(%int_0.loc13) [template = constants.%int_0.2] diff --git a/toolchain/check/testdata/index/expr_category.carbon b/toolchain/check/testdata/index/expr_category.carbon index a5667ffb04377..dabeb14730914 100644 --- a/toolchain/check/testdata/index/expr_category.carbon +++ b/toolchain/check/testdata/index/expr_category.carbon @@ -46,7 +46,7 @@ fn ValueBinding(b: [i32; 3]) { // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -135,7 +135,7 @@ fn ValueBinding(b: [i32; 3]) { // CHECK:STDOUT: %int_2.loc14_25: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %int_3.loc14: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] // CHECK:STDOUT: %.loc14_29.1: %tuple.type = tuple_literal (%int_1.loc14_22, %int_2.loc14_25, %int_3.loc14) -// CHECK:STDOUT: %impl.elem0.loc14_29.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc14_29.1: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc14_29.1: = bound_method %int_1.loc14_22, %impl.elem0.loc14_29.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc14_29.1: = specific_function %Convert.bound.loc14_29.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc14_29.1: init %i32 = call %Convert.specific_fn.loc14_29.1(%int_1.loc14_22) [template = constants.%int_1.2] @@ -143,7 +143,7 @@ fn ValueBinding(b: [i32; 3]) { // CHECK:STDOUT: %int_0.loc14: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %.loc14_29.3: ref %i32 = array_index %a.var, %int_0.loc14 // CHECK:STDOUT: %.loc14_29.4: init %i32 = initialize_from %.loc14_29.2 to %.loc14_29.3 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc14_29.2: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc14_29.2: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc14_29.2: = bound_method %int_2.loc14_25, %impl.elem0.loc14_29.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc14_29.2: = specific_function %Convert.bound.loc14_29.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc14_29.2: init %i32 = call %Convert.specific_fn.loc14_29.2(%int_2.loc14_25) [template = constants.%int_2.2] @@ -151,7 +151,7 @@ fn ValueBinding(b: [i32; 3]) { // CHECK:STDOUT: %int_1.loc14_29: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %.loc14_29.6: ref %i32 = array_index %a.var, %int_1.loc14_29 // CHECK:STDOUT: %.loc14_29.7: init %i32 = initialize_from %.loc14_29.5 to %.loc14_29.6 [template = constants.%int_2.2] -// CHECK:STDOUT: %impl.elem0.loc14_29.3: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc14_29.3: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc14_29.3: = bound_method %int_3.loc14, %impl.elem0.loc14_29.3 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc14_29.3: = specific_function %Convert.bound.loc14_29.3, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc14_29.3: init %i32 = call %Convert.specific_fn.loc14_29.3(%int_3.loc14) [template = constants.%int_3.2] @@ -168,7 +168,7 @@ fn ValueBinding(b: [i32; 3]) { // CHECK:STDOUT: %int_0.loc17: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %int_32.loc17: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc17: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc17: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc17: = bound_method %int_0.loc17, %impl.elem0.loc17 [template = constants.%Convert.bound.4] // CHECK:STDOUT: %Convert.specific_fn.loc17: = specific_function %Convert.bound.loc17, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.4] // CHECK:STDOUT: %int.convert_checked.loc17: init %i32 = call %Convert.specific_fn.loc17(%int_0.loc17) [template = constants.%int_0.2] @@ -181,7 +181,7 @@ fn ValueBinding(b: [i32; 3]) { // CHECK:STDOUT: %int_0.loc18: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %int_32.loc18: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc18: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc18_5: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc18_5: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc18_5: = bound_method %int_0.loc18, %impl.elem0.loc18_5 [template = constants.%Convert.bound.4] // CHECK:STDOUT: %Convert.specific_fn.loc18_5: = specific_function %Convert.bound.loc18_5, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.4] // CHECK:STDOUT: %int.convert_checked.loc18_5: init %i32 = call %Convert.specific_fn.loc18_5(%int_0.loc18) [template = constants.%int_0.2] @@ -189,7 +189,7 @@ fn ValueBinding(b: [i32; 3]) { // CHECK:STDOUT: %.loc18_5.2: %i32 = converted %int_0.loc18, %.loc18_5.1 [template = constants.%int_0.2] // CHECK:STDOUT: %.loc18_6: ref %i32 = array_index %a.ref.loc18, %.loc18_5.2 // CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [template = constants.%int_4.1] -// CHECK:STDOUT: %impl.elem0.loc18_8: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc18_8: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc18_8: = bound_method %int_4, %impl.elem0.loc18_8 [template = constants.%Convert.bound.5] // CHECK:STDOUT: %Convert.specific_fn.loc18_8: = specific_function %Convert.bound.loc18_8, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.5] // CHECK:STDOUT: %int.convert_checked.loc18_8: init %i32 = call %Convert.specific_fn.loc18_8(%int_4) [template = constants.%int_4.2] @@ -206,7 +206,7 @@ fn ValueBinding(b: [i32; 3]) { // CHECK:STDOUT: %int_2.loc22_25: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %int_3.loc22: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] // CHECK:STDOUT: %.loc22_29.1: %tuple.type = tuple_literal (%int_1.loc22_22, %int_2.loc22_25, %int_3.loc22) -// CHECK:STDOUT: %impl.elem0.loc22_29.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc22_29.1: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc22_29.1: = bound_method %int_1.loc22_22, %impl.elem0.loc22_29.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc22_29.1: = specific_function %Convert.bound.loc22_29.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc22_29.1: init %i32 = call %Convert.specific_fn.loc22_29.1(%int_1.loc22_22) [template = constants.%int_1.2] @@ -214,7 +214,7 @@ fn ValueBinding(b: [i32; 3]) { // CHECK:STDOUT: %int_0.loc22: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %.loc22_29.3: ref %i32 = array_index %a.var, %int_0.loc22 // CHECK:STDOUT: %.loc22_29.4: init %i32 = initialize_from %.loc22_29.2 to %.loc22_29.3 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc22_29.2: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc22_29.2: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc22_29.2: = bound_method %int_2.loc22_25, %impl.elem0.loc22_29.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc22_29.2: = specific_function %Convert.bound.loc22_29.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc22_29.2: init %i32 = call %Convert.specific_fn.loc22_29.2(%int_2.loc22_25) [template = constants.%int_2.2] @@ -222,7 +222,7 @@ fn ValueBinding(b: [i32; 3]) { // CHECK:STDOUT: %int_1.loc22_29: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %.loc22_29.6: ref %i32 = array_index %a.var, %int_1.loc22_29 // CHECK:STDOUT: %.loc22_29.7: init %i32 = initialize_from %.loc22_29.5 to %.loc22_29.6 [template = constants.%int_2.2] -// CHECK:STDOUT: %impl.elem0.loc22_29.3: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc22_29.3: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc22_29.3: = bound_method %int_3.loc22, %impl.elem0.loc22_29.3 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc22_29.3: = specific_function %Convert.bound.loc22_29.3, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc22_29.3: init %i32 = call %Convert.specific_fn.loc22_29.3(%int_3.loc22) [template = constants.%int_3.2] @@ -237,7 +237,7 @@ fn ValueBinding(b: [i32; 3]) { // CHECK:STDOUT: %int_0.loc26: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %int_32.loc26: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc26: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc26: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc26: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc26: = bound_method %int_0.loc26, %impl.elem0.loc26 [template = constants.%Convert.bound.4] // CHECK:STDOUT: %Convert.specific_fn.loc26: = specific_function %Convert.bound.loc26, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.4] // CHECK:STDOUT: %int.convert_checked.loc26: init %i32 = call %Convert.specific_fn.loc26(%int_0.loc26) [template = constants.%int_0.2] @@ -248,7 +248,7 @@ fn ValueBinding(b: [i32; 3]) { // CHECK:STDOUT: %int_0.loc27: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %int_32.loc27: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc27: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc27: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc27: = bound_method %int_0.loc27, %impl.elem0.loc27 [template = constants.%Convert.bound.4] // CHECK:STDOUT: %Convert.specific_fn.loc27: = specific_function %Convert.bound.loc27, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.4] // CHECK:STDOUT: %int.convert_checked.loc27: init %i32 = call %Convert.specific_fn.loc27(%int_0.loc27) [template = constants.%int_0.2] @@ -264,7 +264,7 @@ fn ValueBinding(b: [i32; 3]) { // CHECK:STDOUT: %.loc28_5.2: ref %array_type = temporary %.loc28_5.1, %F.call // CHECK:STDOUT: %int_32.loc28: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc28: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc28: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc28: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc28: = bound_method %int_0.loc28, %impl.elem0.loc28 [template = constants.%Convert.bound.4] // CHECK:STDOUT: %Convert.specific_fn.loc28: = specific_function %Convert.bound.loc28, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.4] // CHECK:STDOUT: %int.convert_checked.loc28: init %i32 = call %Convert.specific_fn.loc28(%int_0.loc28) [template = constants.%int_0.2] diff --git a/toolchain/check/testdata/index/fail_array_large_index.carbon b/toolchain/check/testdata/index/fail_array_large_index.carbon index 25dc37dbfc3d7..206024057f0fc 100644 --- a/toolchain/check/testdata/index/fail_array_large_index.carbon +++ b/toolchain/check/testdata/index/fail_array_large_index.carbon @@ -34,7 +34,7 @@ var c: i32 = a[0x7FFF_FFFF]; // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_12.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_12.2: %i32 = int_value 12 [template] @@ -77,7 +77,7 @@ var c: i32 = a[0x7FFF_FFFF]; // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_12: Core.IntLiteral = int_value 12 [template = constants.%int_12.1] // CHECK:STDOUT: %.loc11_23.1: %tuple.type = tuple_literal (%int_12) -// CHECK:STDOUT: %impl.elem0.loc11: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11: = bound_method %int_12, %impl.elem0.loc11 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc11: = specific_function %Convert.bound.loc11, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc11: init %i32 = call %Convert.specific_fn.loc11(%int_12) [template = constants.%int_12.2] @@ -92,7 +92,7 @@ var c: i32 = a[0x7FFF_FFFF]; // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_32.loc17: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc17: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc17: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc17: = bound_method %int_1, %impl.elem0.loc17 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc17: = specific_function %Convert.bound.loc17, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc17: init %i32 = call %Convert.specific_fn.loc17(%int_1) [template = constants.%int_1.2] @@ -105,7 +105,7 @@ var c: i32 = a[0x7FFF_FFFF]; // CHECK:STDOUT: %int_2147483647: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] // CHECK:STDOUT: %int_32.loc22: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc22: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc22: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc22: = bound_method %int_2147483647, %impl.elem0.loc22 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc22: = specific_function %Convert.bound.loc22, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc22: init %i32 = call %Convert.specific_fn.loc22(%int_2147483647) [template = constants.%int_2147483647.2] diff --git a/toolchain/check/testdata/index/fail_array_non_int_indexing.carbon b/toolchain/check/testdata/index/fail_array_non_int_indexing.carbon index b345fd685529c..61c08a7077c25 100644 --- a/toolchain/check/testdata/index/fail_array_non_int_indexing.carbon +++ b/toolchain/check/testdata/index/fail_array_non_int_indexing.carbon @@ -30,7 +30,7 @@ var b: i32 = a[2.6]; // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_12.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_12.2: %i32 = int_value 12 [template] @@ -64,7 +64,7 @@ var b: i32 = a[2.6]; // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_12: Core.IntLiteral = int_value 12 [template = constants.%int_12.1] // CHECK:STDOUT: %.loc11_23.1: %tuple.type = tuple_literal (%int_12) -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_12, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_12) [template = constants.%int_12.2] diff --git a/toolchain/check/testdata/index/fail_array_out_of_bound_access.carbon b/toolchain/check/testdata/index/fail_array_out_of_bound_access.carbon index 69dc59d6abef5..87556322401a1 100644 --- a/toolchain/check/testdata/index/fail_array_out_of_bound_access.carbon +++ b/toolchain/check/testdata/index/fail_array_out_of_bound_access.carbon @@ -27,7 +27,7 @@ var b: i32 = a[1]; // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_12.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_12.2: %i32 = int_value 12 [template] @@ -63,7 +63,7 @@ var b: i32 = a[1]; // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_12: Core.IntLiteral = int_value 12 [template = constants.%int_12.1] // CHECK:STDOUT: %.loc11_23.1: %tuple.type = tuple_literal (%int_12) -// CHECK:STDOUT: %impl.elem0.loc11: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11: = bound_method %int_12, %impl.elem0.loc11 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc11: = specific_function %Convert.bound.loc11, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc11: init %i32 = call %Convert.specific_fn.loc11(%int_12) [template = constants.%int_12.2] @@ -78,7 +78,7 @@ var b: i32 = a[1]; // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc15: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc15: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc15: = bound_method %int_1, %impl.elem0.loc15 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc15: = specific_function %Convert.bound.loc15, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc15: init %i32 = call %Convert.specific_fn.loc15(%int_1) [template = constants.%int_1.2] diff --git a/toolchain/check/testdata/index/fail_expr_category.carbon b/toolchain/check/testdata/index/fail_expr_category.carbon index e1c386a450cc3..711664ad1cce0 100644 --- a/toolchain/check/testdata/index/fail_expr_category.carbon +++ b/toolchain/check/testdata/index/fail_expr_category.carbon @@ -52,7 +52,7 @@ fn G(b: [i32; 3]) { // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] @@ -114,7 +114,7 @@ fn G(b: [i32; 3]) { // CHECK:STDOUT: %int_0.loc19: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %int_32.loc19: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc19: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc19: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc19: = bound_method %int_0.loc19, %impl.elem0.loc19 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc19: = specific_function %Convert.bound.loc19, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc19: init %i32 = call %Convert.specific_fn.loc19(%int_0.loc19) [template = constants.%int_0.2] @@ -129,7 +129,7 @@ fn G(b: [i32; 3]) { // CHECK:STDOUT: %int_0.loc24: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %int_32.loc24: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc24: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc24_5: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc24_5: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc24_5: = bound_method %int_0.loc24, %impl.elem0.loc24_5 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc24_5: = specific_function %Convert.bound.loc24_5, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc24_5: init %i32 = call %Convert.specific_fn.loc24_5(%int_0.loc24) [template = constants.%int_0.2] @@ -139,7 +139,7 @@ fn G(b: [i32; 3]) { // CHECK:STDOUT: %.loc24_6.2: ref %i32 = array_index %.loc24_6.1, %.loc24_5.2 // CHECK:STDOUT: %.loc24_6.3: %i32 = bind_value %.loc24_6.2 // CHECK:STDOUT: %int_4.loc24: Core.IntLiteral = int_value 4 [template = constants.%int_4.1] -// CHECK:STDOUT: %impl.elem0.loc24_8: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc24_8: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc24_8: = bound_method %int_4.loc24, %impl.elem0.loc24_8 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc24_8: = specific_function %Convert.bound.loc24_8, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc24_8: init %i32 = call %Convert.specific_fn.loc24_8(%int_4.loc24) [template = constants.%int_4.2] @@ -154,7 +154,7 @@ fn G(b: [i32; 3]) { // CHECK:STDOUT: %.loc32_21.2: ref %array_type = temporary %.loc32_21.1, %F.call.loc32 // CHECK:STDOUT: %int_32.loc32: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc32: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc32: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc32: = bound_method %int_0.loc32, %impl.elem0.loc32 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc32: = specific_function %Convert.bound.loc32, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc32: init %i32 = call %Convert.specific_fn.loc32(%int_0.loc32) [template = constants.%int_0.2] @@ -171,7 +171,7 @@ fn G(b: [i32; 3]) { // CHECK:STDOUT: %.loc36_5.2: ref %array_type = temporary %.loc36_5.1, %F.call.loc36 // CHECK:STDOUT: %int_32.loc36: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc36: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc36_7: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc36_7: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc36_7: = bound_method %int_0.loc36, %impl.elem0.loc36_7 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc36_7: = specific_function %Convert.bound.loc36_7, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc36_7: init %i32 = call %Convert.specific_fn.loc36_7(%int_0.loc36) [template = constants.%int_0.2] @@ -180,7 +180,7 @@ fn G(b: [i32; 3]) { // CHECK:STDOUT: %.loc36_8.1: ref %i32 = array_index %.loc36_5.2, %.loc36_7.2 // CHECK:STDOUT: %.loc36_8.2: %i32 = bind_value %.loc36_8.1 // CHECK:STDOUT: %int_4.loc36: Core.IntLiteral = int_value 4 [template = constants.%int_4.1] -// CHECK:STDOUT: %impl.elem0.loc36_10: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc36_10: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc36_10: = bound_method %int_4.loc36, %impl.elem0.loc36_10 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc36_10: = specific_function %Convert.bound.loc36_10, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc36_10: init %i32 = call %Convert.specific_fn.loc36_10(%int_4.loc36) [template = constants.%int_4.2] diff --git a/toolchain/check/testdata/index/fail_negative_indexing.carbon b/toolchain/check/testdata/index/fail_negative_indexing.carbon index 81f17a70b0d4a..9e3d86e8803cb 100644 --- a/toolchain/check/testdata/index/fail_negative_indexing.carbon +++ b/toolchain/check/testdata/index/fail_negative_indexing.carbon @@ -28,7 +28,7 @@ var d: i32 = c[-10]; // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_42.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_42.2: %i32 = int_value 42 [template] @@ -65,7 +65,7 @@ var d: i32 = c[-10]; // CHECK:STDOUT: %int_42.loc11_20: Core.IntLiteral = int_value 42 [template = constants.%int_42.1] // CHECK:STDOUT: %int_42.loc11_24: Core.IntLiteral = int_value 42 [template = constants.%int_42.1] // CHECK:STDOUT: %.loc11_26.1: %tuple.type = tuple_literal (%int_42.loc11_20, %int_42.loc11_24) -// CHECK:STDOUT: %impl.elem0.loc11_26.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11_26.1: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_26.1: = bound_method %int_42.loc11_20, %impl.elem0.loc11_26.1 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn.loc11_26.1: = specific_function %Convert.bound.loc11_26.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc11_26.1: init %i32 = call %Convert.specific_fn.loc11_26.1(%int_42.loc11_20) [template = constants.%int_42.2] @@ -73,7 +73,7 @@ var d: i32 = c[-10]; // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0] // CHECK:STDOUT: %.loc11_26.3: ref %i32 = array_index file.%c.var, %int_0 // CHECK:STDOUT: %.loc11_26.4: init %i32 = initialize_from %.loc11_26.2 to %.loc11_26.3 [template = constants.%int_42.2] -// CHECK:STDOUT: %impl.elem0.loc11_26.2: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11_26.2: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_26.2: = bound_method %int_42.loc11_24, %impl.elem0.loc11_26.2 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn.loc11_26.2: = specific_function %Convert.bound.loc11_26.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc11_26.2: init %i32 = call %Convert.specific_fn.loc11_26.2(%int_42.loc11_24) [template = constants.%int_42.2] diff --git a/toolchain/check/testdata/interface/fail_todo_assoc_const_default.carbon b/toolchain/check/testdata/interface/fail_todo_assoc_const_default.carbon index e0c88174cfdde..ce907e890d968 100644 --- a/toolchain/check/testdata/interface/fail_todo_assoc_const_default.carbon +++ b/toolchain/check/testdata/interface/fail_todo_assoc_const_default.carbon @@ -35,7 +35,7 @@ interface I { // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_42.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_42.2: %i32 = int_value 42 [template] @@ -72,7 +72,7 @@ interface I { // CHECK:STDOUT: %T: type = assoc_const_decl T [template] // CHECK:STDOUT: %assoc0: %assoc_type.1 = assoc_entity element0, %T [template = constants.%assoc0.1] // CHECK:STDOUT: %int_42: Core.IntLiteral = int_value 42 [template = constants.%int_42.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_42, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_42) [template = constants.%int_42.2] diff --git a/toolchain/check/testdata/interface/todo_define_not_default.carbon b/toolchain/check/testdata/interface/todo_define_not_default.carbon index 9bbbe677c58d1..aadc253803730 100644 --- a/toolchain/check/testdata/interface/todo_define_not_default.carbon +++ b/toolchain/check/testdata/interface/todo_define_not_default.carbon @@ -42,7 +42,7 @@ interface I { // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_42.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_42.2: %i32 = int_value 42 [template] @@ -107,7 +107,7 @@ interface I { // CHECK:STDOUT: %T: type = assoc_const_decl T [template] // CHECK:STDOUT: %assoc2: %assoc_type.1 = assoc_entity element2, %T [template = constants.%assoc2] // CHECK:STDOUT: %int_42: Core.IntLiteral = int_value 42 [template = constants.%int_42.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_42, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_42) [template = constants.%int_42.2] diff --git a/toolchain/check/testdata/ir/duplicate_name_same_line.carbon b/toolchain/check/testdata/ir/duplicate_name_same_line.carbon index 77996dc1ce78c..b3f0993e818ec 100644 --- a/toolchain/check/testdata/ir/duplicate_name_same_line.carbon +++ b/toolchain/check/testdata/ir/duplicate_name_same_line.carbon @@ -22,7 +22,7 @@ fn A() { if (true) { var n: i32 = 1; } if (true) { var n: i32 = 2; } } // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -59,7 +59,7 @@ fn A() { if (true) { var n: i32 = 1; } if (true) { var n: i32 = 2; } } // CHECK:STDOUT: %n.var.loc11_26: ref %i32 = var n // CHECK:STDOUT: %n.loc11_26: ref %i32 = bind_name n, %n.var.loc11_26 // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc11_36: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11_36: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_36: = bound_method %int_1, %impl.elem0.loc11_36 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc11_36: = specific_function %Convert.bound.loc11_36, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc11_36: init %i32 = call %Convert.specific_fn.loc11_36(%int_1) [template = constants.%int_1.2] @@ -75,7 +75,7 @@ fn A() { if (true) { var n: i32 = 1; } if (true) { var n: i32 = 2; } } // CHECK:STDOUT: %n.var.loc11_56: ref %i32 = var n // CHECK:STDOUT: %n.loc11_56: ref %i32 = bind_name n, %n.var.loc11_56 // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %impl.elem0.loc11_66: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11_66: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_66: = bound_method %int_2, %impl.elem0.loc11_66 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc11_66: = specific_function %Convert.bound.loc11_66, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc11_66: init %i32 = call %Convert.specific_fn.loc11_66(%int_2) [template = constants.%int_2.2] diff --git a/toolchain/check/testdata/let/compile_time_bindings.carbon b/toolchain/check/testdata/let/compile_time_bindings.carbon index 0382f1735569a..2062a091c423f 100644 --- a/toolchain/check/testdata/let/compile_time_bindings.carbon +++ b/toolchain/check/testdata/let/compile_time_bindings.carbon @@ -503,7 +503,7 @@ impl i32 as Empty { // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] @@ -539,7 +539,7 @@ impl i32 as Empty { // CHECK:STDOUT: fn @F() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.2] @@ -562,7 +562,7 @@ impl i32 as Empty { // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] @@ -606,7 +606,7 @@ impl i32 as Empty { // CHECK:STDOUT: // CHECK:STDOUT: !if.then: // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0.loc6: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc6: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc6: = bound_method %int_0, %impl.elem0.loc6 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc6: = specific_function %Convert.bound.loc6, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc6: init %i32 = call %Convert.specific_fn.loc6(%int_0) [template = constants.%int_0.2] @@ -618,7 +618,7 @@ impl i32 as Empty { // CHECK:STDOUT: // CHECK:STDOUT: !if.else: // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc9: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc9: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc9: = bound_method %int_1, %impl.elem0.loc9 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc9: = specific_function %Convert.bound.loc9, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc9: init %i32 = call %Convert.specific_fn.loc9(%int_1) [template = constants.%int_1.2] @@ -798,11 +798,11 @@ impl i32 as Empty { // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.2(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] -// CHECK:STDOUT: %interface.6: = interface_witness () [template] +// CHECK:STDOUT: %interface.20: = interface_witness () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -838,14 +838,14 @@ impl i32 as Empty { // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.1: %i32 as %Empty.ref { // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.2] // CHECK:STDOUT: %.loc10_21.1: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_0.2] // CHECK:STDOUT: %.loc10_21.2: %i32 = converted %int_0, %.loc10_21.1 [template = constants.%int_0.2] // CHECK:STDOUT: %Zero: %i32 = bind_name Zero, %.loc10_21.2 -// CHECK:STDOUT: %interface: = interface_witness () [template = constants.%interface.6] +// CHECK:STDOUT: %interface: = interface_witness () [template = constants.%interface.20] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Zero = %Zero diff --git a/toolchain/check/testdata/let/convert.carbon b/toolchain/check/testdata/let/convert.carbon index d6c6e058cce45..69dc672ca15be 100644 --- a/toolchain/check/testdata/let/convert.carbon +++ b/toolchain/check/testdata/let/convert.carbon @@ -30,7 +30,7 @@ fn F() -> i32 { // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -77,21 +77,21 @@ fn F() -> i32 { // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] // CHECK:STDOUT: %.loc12_36.1: %tuple.type.3 = tuple_literal (%int_1.loc12, %int_2, %int_3) -// CHECK:STDOUT: %impl.elem0.loc12_36.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc12_36.1: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc12_36.1: = bound_method %int_1.loc12, %impl.elem0.loc12_36.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc12_36.1: = specific_function %Convert.bound.loc12_36.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc12_36.1: init %i32 = call %Convert.specific_fn.loc12_36.1(%int_1.loc12) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc12_36.2: init %i32 = converted %int_1.loc12, %int.convert_checked.loc12_36.1 [template = constants.%int_1.2] // CHECK:STDOUT: %tuple.elem0.loc12: ref %i32 = tuple_access %v.var, element0 // CHECK:STDOUT: %.loc12_36.3: init %i32 = initialize_from %.loc12_36.2 to %tuple.elem0.loc12 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc12_36.2: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc12_36.2: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc12_36.2: = bound_method %int_2, %impl.elem0.loc12_36.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc12_36.2: = specific_function %Convert.bound.loc12_36.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc12_36.2: init %i32 = call %Convert.specific_fn.loc12_36.2(%int_2) [template = constants.%int_2.2] // CHECK:STDOUT: %.loc12_36.4: init %i32 = converted %int_2, %int.convert_checked.loc12_36.2 [template = constants.%int_2.2] // CHECK:STDOUT: %tuple.elem1.loc12: ref %i32 = tuple_access %v.var, element1 // CHECK:STDOUT: %.loc12_36.5: init %i32 = initialize_from %.loc12_36.4 to %tuple.elem1.loc12 [template = constants.%int_2.2] -// CHECK:STDOUT: %impl.elem0.loc12_36.3: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc12_36.3: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc12_36.3: = bound_method %int_3, %impl.elem0.loc12_36.3 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc12_36.3: = specific_function %Convert.bound.loc12_36.3, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc12_36.3: init %i32 = call %Convert.specific_fn.loc12_36.3(%int_3) [template = constants.%int_3.2] diff --git a/toolchain/check/testdata/let/fail_duplicate_decl.carbon b/toolchain/check/testdata/let/fail_duplicate_decl.carbon index 95e0e7e159550..2e58b1f03331e 100644 --- a/toolchain/check/testdata/let/fail_duplicate_decl.carbon +++ b/toolchain/check/testdata/let/fail_duplicate_decl.carbon @@ -30,7 +30,7 @@ fn F() { // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -61,7 +61,7 @@ fn F() { // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc12: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc12: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc12: = bound_method %int_1, %impl.elem0.loc12 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc12: = specific_function %Convert.bound.loc12, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc12: init %i32 = call %Convert.specific_fn.loc12(%int_1) [template = constants.%int_1.2] @@ -69,7 +69,7 @@ fn F() { // CHECK:STDOUT: %.loc12_17.2: %i32 = converted %int_1, %.loc12_17.1 [template = constants.%int_1.2] // CHECK:STDOUT: %a.loc12: %i32 = bind_name a, %.loc12_17.2 // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %impl.elem0.loc19: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc19: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc19: = bound_method %int_2, %impl.elem0.loc19 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc19: = specific_function %Convert.bound.loc19, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc19: init %i32 = call %Convert.specific_fn.loc19(%int_2) [template = constants.%int_2.2] diff --git a/toolchain/check/testdata/let/fail_modifiers.carbon b/toolchain/check/testdata/let/fail_modifiers.carbon index 8e70e4d4cba08..6fde88e5ab55c 100644 --- a/toolchain/check/testdata/let/fail_modifiers.carbon +++ b/toolchain/check/testdata/let/fail_modifiers.carbon @@ -92,7 +92,7 @@ protected protected let i: i32 = 1; // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -125,7 +125,7 @@ protected protected let i: i32 = 1; // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_1.loc15: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc15: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc15: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc15: = bound_method %int_1.loc15, %impl.elem0.loc15 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn.loc15: = specific_function %Convert.bound.loc15, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc15: init %i32 = call %Convert.specific_fn.loc15(%int_1.loc15) [template = constants.%int_1.2] @@ -133,7 +133,7 @@ protected protected let i: i32 = 1; // CHECK:STDOUT: %.loc15_25.2: %i32 = converted %int_1.loc15, %.loc15_25.1 [template = constants.%int_1.2] // CHECK:STDOUT: %b: %i32 = bind_name b, %.loc15_25.2 // CHECK:STDOUT: %int_1.loc21: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc21: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc21: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc21: = bound_method %int_1.loc21, %impl.elem0.loc21 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn.loc21: = specific_function %Convert.bound.loc21, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc21: init %i32 = call %Convert.specific_fn.loc21(%int_1.loc21) [template = constants.%int_1.2] @@ -141,7 +141,7 @@ protected protected let i: i32 = 1; // CHECK:STDOUT: %.loc21_23.2: %i32 = converted %int_1.loc21, %.loc21_23.1 [template = constants.%int_1.2] // CHECK:STDOUT: %c: %i32 = bind_name c, %.loc21_23.2 // CHECK:STDOUT: %int_1.loc27: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc27: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc27: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc27: = bound_method %int_1.loc27, %impl.elem0.loc27 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn.loc27: = specific_function %Convert.bound.loc27, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc27: init %i32 = call %Convert.specific_fn.loc27(%int_1.loc27) [template = constants.%int_1.2] @@ -149,7 +149,7 @@ protected protected let i: i32 = 1; // CHECK:STDOUT: %.loc27_21.2: %i32 = converted %int_1.loc27, %.loc27_21.1 [template = constants.%int_1.2] // CHECK:STDOUT: %d: %i32 = bind_name d, %.loc27_21.2 // CHECK:STDOUT: %int_1.loc33: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc33: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc33: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc33: = bound_method %int_1.loc33, %impl.elem0.loc33 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn.loc33: = specific_function %Convert.bound.loc33, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc33: init %i32 = call %Convert.specific_fn.loc33(%int_1.loc33) [template = constants.%int_1.2] @@ -157,7 +157,7 @@ protected protected let i: i32 = 1; // CHECK:STDOUT: %.loc33_23.2: %i32 = converted %int_1.loc33, %.loc33_23.1 [template = constants.%int_1.2] // CHECK:STDOUT: %e: %i32 = bind_name e, %.loc33_23.2 // CHECK:STDOUT: %int_1.loc46: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc46: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc46: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc46: = bound_method %int_1.loc46, %impl.elem0.loc46 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn.loc46: = specific_function %Convert.bound.loc46, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc46: init %i32 = call %Convert.specific_fn.loc46(%int_1.loc46) [template = constants.%int_1.2] @@ -165,7 +165,7 @@ protected protected let i: i32 = 1; // CHECK:STDOUT: %.loc46_29.2: %i32 = converted %int_1.loc46, %.loc46_29.1 [template = constants.%int_1.2] // CHECK:STDOUT: %f: %i32 = bind_name f, %.loc46_29.2 // CHECK:STDOUT: %int_1.loc59: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc59: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc59: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc59: = bound_method %int_1.loc59, %impl.elem0.loc59 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn.loc59: = specific_function %Convert.bound.loc59, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc59: init %i32 = call %Convert.specific_fn.loc59(%int_1.loc59) [template = constants.%int_1.2] @@ -173,7 +173,7 @@ protected protected let i: i32 = 1; // CHECK:STDOUT: %.loc59_31.2: %i32 = converted %int_1.loc59, %.loc59_31.1 [template = constants.%int_1.2] // CHECK:STDOUT: %g: %i32 = bind_name g, %.loc59_31.2 // CHECK:STDOUT: %int_1.loc72: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc72: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc72: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc72: = bound_method %int_1.loc72, %impl.elem0.loc72 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn.loc72: = specific_function %Convert.bound.loc72, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc72: init %i32 = call %Convert.specific_fn.loc72(%int_1.loc72) [template = constants.%int_1.2] @@ -181,7 +181,7 @@ protected protected let i: i32 = 1; // CHECK:STDOUT: %.loc72_33.2: %i32 = converted %int_1.loc72, %.loc72_33.1 [template = constants.%int_1.2] // CHECK:STDOUT: %h: %i32 = bind_name h, %.loc72_33.2 // CHECK:STDOUT: %int_1.loc84: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc84: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc84: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc84: = bound_method %int_1.loc84, %impl.elem0.loc84 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn.loc84: = specific_function %Convert.bound.loc84, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc84: init %i32 = call %Convert.specific_fn.loc84(%int_1.loc84) [template = constants.%int_1.2] diff --git a/toolchain/check/testdata/let/global.carbon b/toolchain/check/testdata/let/global.carbon index 78760aa5307de..2df28f3743dd6 100644 --- a/toolchain/check/testdata/let/global.carbon +++ b/toolchain/check/testdata/let/global.carbon @@ -21,7 +21,7 @@ fn F() -> i32 { return n; } // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -65,7 +65,7 @@ fn F() -> i32 { return n; } // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_1) [template = constants.%int_1.2] diff --git a/toolchain/check/testdata/let/shadowed_decl.carbon b/toolchain/check/testdata/let/shadowed_decl.carbon index 65a0791d83fb5..a11c286dae19a 100644 --- a/toolchain/check/testdata/let/shadowed_decl.carbon +++ b/toolchain/check/testdata/let/shadowed_decl.carbon @@ -25,7 +25,7 @@ fn F(a: i32) -> i32 { // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -68,7 +68,7 @@ fn F(a: i32) -> i32 { // CHECK:STDOUT: fn @F(%a.param_patt: %i32) -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_1) [template = constants.%int_1.2] diff --git a/toolchain/check/testdata/namespace/add_to_import.carbon b/toolchain/check/testdata/namespace/add_to_import.carbon index 21f3dc47ffdd7..1b43f5b5ee990 100644 --- a/toolchain/check/testdata/namespace/add_to_import.carbon +++ b/toolchain/check/testdata/namespace/add_to_import.carbon @@ -51,7 +51,7 @@ var a: i32 = NS.A(); // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] @@ -95,7 +95,7 @@ var a: i32 = NS.A(); // CHECK:STDOUT: fn @A() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.2] diff --git a/toolchain/check/testdata/namespace/alias.carbon b/toolchain/check/testdata/namespace/alias.carbon index a4d4b3871c8a9..47b736a8ce0ed 100644 --- a/toolchain/check/testdata/namespace/alias.carbon +++ b/toolchain/check/testdata/namespace/alias.carbon @@ -31,7 +31,7 @@ fn D() -> i32 { return C(); } // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] @@ -100,7 +100,7 @@ fn D() -> i32 { return C(); } // CHECK:STDOUT: fn @A() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.2] diff --git a/toolchain/check/testdata/namespace/fail_decl_in_alias.carbon b/toolchain/check/testdata/namespace/fail_decl_in_alias.carbon index cd75ed6c4d980..85debd7fb3153 100644 --- a/toolchain/check/testdata/namespace/fail_decl_in_alias.carbon +++ b/toolchain/check/testdata/namespace/fail_decl_in_alias.carbon @@ -32,7 +32,7 @@ fn ns.A() -> i32 { return 0; } // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] @@ -71,7 +71,7 @@ fn ns.A() -> i32 { return 0; } // CHECK:STDOUT: fn @.1() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.2] diff --git a/toolchain/check/testdata/namespace/shadow.carbon b/toolchain/check/testdata/namespace/shadow.carbon index 8af56b402af69..4d72708f44cbc 100644 --- a/toolchain/check/testdata/namespace/shadow.carbon +++ b/toolchain/check/testdata/namespace/shadow.carbon @@ -44,7 +44,7 @@ fn N.M.B() -> i32 { // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] @@ -101,7 +101,7 @@ fn N.M.B() -> i32 { // CHECK:STDOUT: %A.var: ref %i32 = var A // CHECK:STDOUT: %A: ref %i32 = bind_name A, %A.var // CHECK:STDOUT: %int_0.loc22: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0.loc22: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc22: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc22: = bound_method %int_0.loc22, %impl.elem0.loc22 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn.loc22: = specific_function %Convert.bound.loc22, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc22: init %i32 = call %Convert.specific_fn.loc22(%int_0.loc22) [template = constants.%int_0.2] @@ -113,7 +113,7 @@ fn N.M.B() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: !if.else: // CHECK:STDOUT: %int_0.loc27: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0.loc27: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc27: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc27: = bound_method %int_0.loc27, %impl.elem0.loc27 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn.loc27: = specific_function %Convert.bound.loc27, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc27: init %i32 = call %Convert.specific_fn.loc27(%int_0.loc27) [template = constants.%int_0.2] diff --git a/toolchain/check/testdata/operators/builtin/assignment.carbon b/toolchain/check/testdata/operators/builtin/assignment.carbon index fb8fb537d3837..dcfdbe6d13d47 100644 --- a/toolchain/check/testdata/operators/builtin/assignment.carbon +++ b/toolchain/check/testdata/operators/builtin/assignment.carbon @@ -37,7 +37,7 @@ fn Main() { // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_12.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_12.2: %i32 = int_value 12 [template] @@ -103,7 +103,7 @@ fn Main() { // CHECK:STDOUT: %a.var: ref %i32 = var a // CHECK:STDOUT: %a: ref %i32 = bind_name a, %a.var // CHECK:STDOUT: %int_12: Core.IntLiteral = int_value 12 [template = constants.%int_12.1] -// CHECK:STDOUT: %impl.elem0.loc12: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc12: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc12: = bound_method %int_12, %impl.elem0.loc12 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc12: = specific_function %Convert.bound.loc12, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc12: init %i32 = call %Convert.specific_fn.loc12(%int_12) [template = constants.%int_12.2] @@ -111,7 +111,7 @@ fn Main() { // CHECK:STDOUT: assign %a.var, %.loc12 // CHECK:STDOUT: %a.ref.loc13: ref %i32 = name_ref a, %a // CHECK:STDOUT: %int_9: Core.IntLiteral = int_value 9 [template = constants.%int_9.1] -// CHECK:STDOUT: %impl.elem0.loc13: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc13: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc13: = bound_method %int_9, %impl.elem0.loc13 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc13: = specific_function %Convert.bound.loc13, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc13: init %i32 = call %Convert.specific_fn.loc13(%int_9) [template = constants.%int_9.2] @@ -122,14 +122,14 @@ fn Main() { // CHECK:STDOUT: %int_1.loc15: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_2.loc15: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %.loc15_28.1: %tuple.type.3 = tuple_literal (%int_1.loc15, %int_2.loc15) -// CHECK:STDOUT: %impl.elem0.loc15_28.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc15_28.1: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc15_28.1: = bound_method %int_1.loc15, %impl.elem0.loc15_28.1 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc15_28.1: = specific_function %Convert.bound.loc15_28.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc15_28.1: init %i32 = call %Convert.specific_fn.loc15_28.1(%int_1.loc15) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc15_28.2: init %i32 = converted %int_1.loc15, %int.convert_checked.loc15_28.1 [template = constants.%int_1.2] // CHECK:STDOUT: %tuple.elem0.loc15: ref %i32 = tuple_access %b.var, element0 // CHECK:STDOUT: %.loc15_28.3: init %i32 = initialize_from %.loc15_28.2 to %tuple.elem0.loc15 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc15_28.2: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc15_28.2: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc15_28.2: = bound_method %int_2.loc15, %impl.elem0.loc15_28.2 [template = constants.%Convert.bound.4] // CHECK:STDOUT: %Convert.specific_fn.loc15_28.2: = specific_function %Convert.bound.loc15_28.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.4] // CHECK:STDOUT: %int.convert_checked.loc15_28.2: init %i32 = call %Convert.specific_fn.loc15_28.2(%int_2.loc15) [template = constants.%int_2.2] @@ -143,7 +143,7 @@ fn Main() { // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0] // CHECK:STDOUT: %tuple.elem0.loc16: ref %i32 = tuple_access %b.ref.loc16, element0 // CHECK:STDOUT: %int_3.loc16: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] -// CHECK:STDOUT: %impl.elem0.loc16: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc16: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc16: = bound_method %int_3.loc16, %impl.elem0.loc16 [template = constants.%Convert.bound.5] // CHECK:STDOUT: %Convert.specific_fn.loc16: = specific_function %Convert.bound.loc16, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.5] // CHECK:STDOUT: %int.convert_checked.loc16: init %i32 = call %Convert.specific_fn.loc16(%int_3.loc16) [template = constants.%int_3.2] @@ -153,7 +153,7 @@ fn Main() { // CHECK:STDOUT: %int_1.loc17: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %tuple.elem1.loc17: ref %i32 = tuple_access %b.ref.loc17, element1 // CHECK:STDOUT: %int_4.loc17: Core.IntLiteral = int_value 4 [template = constants.%int_4.1] -// CHECK:STDOUT: %impl.elem0.loc17: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc17: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc17: = bound_method %int_4.loc17, %impl.elem0.loc17 [template = constants.%Convert.bound.6] // CHECK:STDOUT: %Convert.specific_fn.loc17: = specific_function %Convert.bound.loc17, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.6] // CHECK:STDOUT: %int.convert_checked.loc17: init %i32 = call %Convert.specific_fn.loc17(%int_4.loc17) [template = constants.%int_4.2] @@ -164,14 +164,14 @@ fn Main() { // CHECK:STDOUT: %int_1.loc19: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_2.loc19: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %.loc19_46.1: %struct_type.a.b.2 = struct_literal (%int_1.loc19, %int_2.loc19) -// CHECK:STDOUT: %impl.elem0.loc19_46.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc19_46.1: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc19_46.1: = bound_method %int_1.loc19, %impl.elem0.loc19_46.1 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc19_46.1: = specific_function %Convert.bound.loc19_46.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc19_46.1: init %i32 = call %Convert.specific_fn.loc19_46.1(%int_1.loc19) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc19_46.2: init %i32 = converted %int_1.loc19, %int.convert_checked.loc19_46.1 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc19_46.3: ref %i32 = struct_access %c.var, element0 // CHECK:STDOUT: %.loc19_46.4: init %i32 = initialize_from %.loc19_46.2 to %.loc19_46.3 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc19_46.2: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc19_46.2: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc19_46.2: = bound_method %int_2.loc19, %impl.elem0.loc19_46.2 [template = constants.%Convert.bound.4] // CHECK:STDOUT: %Convert.specific_fn.loc19_46.2: = specific_function %Convert.bound.loc19_46.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.4] // CHECK:STDOUT: %int.convert_checked.loc19_46.2: init %i32 = call %Convert.specific_fn.loc19_46.2(%int_2.loc19) [template = constants.%int_2.2] @@ -184,7 +184,7 @@ fn Main() { // CHECK:STDOUT: %c.ref.loc20: ref %struct_type.a.b.1 = name_ref c, %c // CHECK:STDOUT: %.loc20_4: ref %i32 = struct_access %c.ref.loc20, element0 // CHECK:STDOUT: %int_3.loc20: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] -// CHECK:STDOUT: %impl.elem0.loc20: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc20: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc20: = bound_method %int_3.loc20, %impl.elem0.loc20 [template = constants.%Convert.bound.5] // CHECK:STDOUT: %Convert.specific_fn.loc20: = specific_function %Convert.bound.loc20, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.5] // CHECK:STDOUT: %int.convert_checked.loc20: init %i32 = call %Convert.specific_fn.loc20(%int_3.loc20) [template = constants.%int_3.2] @@ -193,7 +193,7 @@ fn Main() { // CHECK:STDOUT: %c.ref.loc21: ref %struct_type.a.b.1 = name_ref c, %c // CHECK:STDOUT: %.loc21_4: ref %i32 = struct_access %c.ref.loc21, element1 // CHECK:STDOUT: %int_4.loc21: Core.IntLiteral = int_value 4 [template = constants.%int_4.1] -// CHECK:STDOUT: %impl.elem0.loc21: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc21: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc21: = bound_method %int_4.loc21, %impl.elem0.loc21 [template = constants.%Convert.bound.6] // CHECK:STDOUT: %Convert.specific_fn.loc21: = specific_function %Convert.bound.loc21, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.6] // CHECK:STDOUT: %int.convert_checked.loc21: init %i32 = call %Convert.specific_fn.loc21(%int_4.loc21) [template = constants.%int_4.2] @@ -208,7 +208,7 @@ fn Main() { // CHECK:STDOUT: %.loc24_4: %ptr.3 = bind_value %p.ref.loc24 // CHECK:STDOUT: %.loc24_3: ref %i32 = deref %.loc24_4 // CHECK:STDOUT: %int_5: Core.IntLiteral = int_value 5 [template = constants.%int_5.1] -// CHECK:STDOUT: %impl.elem0.loc24: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc24: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc24: = bound_method %int_5, %impl.elem0.loc24 [template = constants.%Convert.bound.7] // CHECK:STDOUT: %Convert.specific_fn.loc24: = specific_function %Convert.bound.loc24, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.7] // CHECK:STDOUT: %int.convert_checked.loc24: init %i32 = call %Convert.specific_fn.loc24(%int_5) [template = constants.%int_5.2] @@ -231,7 +231,7 @@ fn Main() { // CHECK:STDOUT: %.loc26_5: %ptr.3 = block_arg !if.expr.result // CHECK:STDOUT: %.loc26_3: ref %i32 = deref %.loc26_5 // CHECK:STDOUT: %int_10: Core.IntLiteral = int_value 10 [template = constants.%int_10.1] -// CHECK:STDOUT: %impl.elem0.loc26: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc26: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc26: = bound_method %int_10, %impl.elem0.loc26 [template = constants.%Convert.bound.8] // CHECK:STDOUT: %Convert.specific_fn.loc26: = specific_function %Convert.bound.loc26, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.8] // CHECK:STDOUT: %int.convert_checked.loc26: init %i32 = call %Convert.specific_fn.loc26(%int_10) [template = constants.%int_10.2] diff --git a/toolchain/check/testdata/operators/builtin/fail_assignment_to_non_assignable.carbon b/toolchain/check/testdata/operators/builtin/fail_assignment_to_non_assignable.carbon index a91245aab83f0..5b36957eee41b 100644 --- a/toolchain/check/testdata/operators/builtin/fail_assignment_to_non_assignable.carbon +++ b/toolchain/check/testdata/operators/builtin/fail_assignment_to_non_assignable.carbon @@ -70,7 +70,7 @@ fn Main() { // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -140,7 +140,7 @@ fn Main() { // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [template = constants.%F] // CHECK:STDOUT: %F.call: init %i32 = call %F.ref() // CHECK:STDOUT: %int_1.loc23: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc23: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc23: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc23: = bound_method %int_1.loc23, %impl.elem0.loc23 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc23: = specific_function %Convert.bound.loc23, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc23: init %i32 = call %Convert.specific_fn.loc23(%int_1.loc23) [template = constants.%int_1.2] @@ -164,7 +164,7 @@ fn Main() { // CHECK:STDOUT: %n.var: ref %i32 = var n // CHECK:STDOUT: %n: ref %i32 = bind_name n, %n.var // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0.loc29: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc29: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc29: = bound_method %int_0, %impl.elem0.loc29 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc29: = specific_function %Convert.bound.loc29, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc29: init %i32 = call %Convert.specific_fn.loc29(%int_0) [template = constants.%int_0.2] @@ -176,14 +176,14 @@ fn Main() { // CHECK:STDOUT: %int_1.loc34: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_2.loc34: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %.loc34_17.1: %tuple.type.1 = tuple_literal (%int_1.loc34, %int_2.loc34) -// CHECK:STDOUT: %impl.elem0.loc34_17.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc34_17.1: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc34_17.1: = bound_method %int_1.loc34, %impl.elem0.loc34_17.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc34_17.1: = specific_function %Convert.bound.loc34_17.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc34_17.1: init %i32 = call %Convert.specific_fn.loc34_17.1(%int_1.loc34) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc34_17.2: init %i32 = converted %int_1.loc34, %int.convert_checked.loc34_17.1 [template = constants.%int_1.2] // CHECK:STDOUT: %tuple.elem0.loc34: %i32 = tuple_access %.loc34_8.1, element0 // CHECK:STDOUT: %.loc34_17.3: init %i32 = initialize_from %.loc34_17.2 to %tuple.elem0.loc34 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc34_17.2: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc34_17.2: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc34_17.2: = bound_method %int_2.loc34, %impl.elem0.loc34_17.2 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc34_17.2: = specific_function %Convert.bound.loc34_17.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc34_17.2: init %i32 = call %Convert.specific_fn.loc34_17.2(%int_2.loc34) [template = constants.%int_2.2] @@ -225,7 +225,7 @@ fn Main() { // CHECK:STDOUT: %int_1.loc49: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_32.loc49: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc49: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc49_12: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc49_12: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc49_12: = bound_method %int_1.loc49, %impl.elem0.loc49_12 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc49_12: = specific_function %Convert.bound.loc49_12, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc49_12: init %i32 = call %Convert.specific_fn.loc49_12(%int_1.loc49) [template = constants.%int_1.2] @@ -235,7 +235,7 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.else.loc49: // CHECK:STDOUT: %int_2.loc49: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %impl.elem0.loc49_19: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc49_19: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc49_19: = bound_method %int_2.loc49, %impl.elem0.loc49_19 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc49_19: = specific_function %Convert.bound.loc49_19, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc49_19: init %i32 = call %Convert.specific_fn.loc49_19(%int_2.loc49) [template = constants.%int_2.2] @@ -246,7 +246,7 @@ fn Main() { // CHECK:STDOUT: !if.expr.result.loc49: // CHECK:STDOUT: %.loc49_4: %i32 = block_arg !if.expr.result.loc49 [template = constants.%int_1.2] // CHECK:STDOUT: %int_3.loc49: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] -// CHECK:STDOUT: %impl.elem0.loc49_27: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc49_27: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc49_27: = bound_method %int_3.loc49, %impl.elem0.loc49_27 [template = constants.%Convert.bound.4] // CHECK:STDOUT: %Convert.specific_fn.loc49_27: = specific_function %Convert.bound.loc49_27, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.4] // CHECK:STDOUT: %int.convert_checked.loc49_27: init %i32 = call %Convert.specific_fn.loc49_27(%int_3.loc49) [template = constants.%int_3.2] @@ -270,7 +270,7 @@ fn Main() { // CHECK:STDOUT: !if.expr.result.loc56: // CHECK:STDOUT: %.loc56_4: %i32 = block_arg !if.expr.result.loc56 // CHECK:STDOUT: %int_10: Core.IntLiteral = int_value 10 [template = constants.%int_10.1] -// CHECK:STDOUT: %impl.elem0.loc56: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc56: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc56: = bound_method %int_10, %impl.elem0.loc56 [template = constants.%Convert.bound.5] // CHECK:STDOUT: %Convert.specific_fn.loc56: = specific_function %Convert.bound.loc56, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.5] // CHECK:STDOUT: %int.convert_checked.loc56: init %i32 = call %Convert.specific_fn.loc56(%int_10) [template = constants.%int_10.2] diff --git a/toolchain/check/testdata/operators/builtin/fail_redundant_compound_access.carbon b/toolchain/check/testdata/operators/builtin/fail_redundant_compound_access.carbon index fc4f450b741c1..3f195420be5c2 100644 --- a/toolchain/check/testdata/operators/builtin/fail_redundant_compound_access.carbon +++ b/toolchain/check/testdata/operators/builtin/fail_redundant_compound_access.carbon @@ -34,7 +34,7 @@ fn Main() { // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] @@ -77,7 +77,7 @@ fn Main() { // CHECK:STDOUT: fn @F() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.2] @@ -91,7 +91,7 @@ fn Main() { // CHECK:STDOUT: %a.var: ref %i32 = var a // CHECK:STDOUT: %a: ref %i32 = bind_name a, %a.var // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_3, %impl.elem0 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_3) [template = constants.%int_3.2] diff --git a/toolchain/check/testdata/operators/builtin/fail_type_mismatch_assignment.carbon b/toolchain/check/testdata/operators/builtin/fail_type_mismatch_assignment.carbon index e64cc7adef81a..210415f238c79 100644 --- a/toolchain/check/testdata/operators/builtin/fail_type_mismatch_assignment.carbon +++ b/toolchain/check/testdata/operators/builtin/fail_type_mismatch_assignment.carbon @@ -30,7 +30,7 @@ fn Main() { // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_3.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_3.2: %i32 = int_value 3 [template] @@ -60,7 +60,7 @@ fn Main() { // CHECK:STDOUT: %a.var: ref %i32 = var a // CHECK:STDOUT: %a: ref %i32 = bind_name a, %a.var // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_3, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_3) [template = constants.%int_3.2] diff --git a/toolchain/check/testdata/operators/overloaded/index.carbon b/toolchain/check/testdata/operators/overloaded/index.carbon index d3bf0975fabda..e6efb4e396b04 100644 --- a/toolchain/check/testdata/operators/overloaded/index.carbon +++ b/toolchain/check/testdata/operators/overloaded/index.carbon @@ -236,7 +236,7 @@ let x: i32 = c[0]; // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.2(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.6: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.20: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -327,13 +327,13 @@ let x: i32 = c[0]; // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_5: Core.IntLiteral = int_value 5 [template = constants.%int_5.1] // CHECK:STDOUT: %.loc10_26.1: %tuple.type.3 = tuple_literal (%int_1, %int_5) -// CHECK:STDOUT: %impl.elem0.loc10_26.1: %Convert.type.2 = interface_witness_access constants.%interface.6, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc10_26.1: %Convert.type.2 = interface_witness_access constants.%interface.20, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc10_26.1: = bound_method %int_1, %impl.elem0.loc10_26.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc10_26.1: = specific_function %Convert.bound.loc10_26.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc10_26.1: init %i32 = call %Convert.specific_fn.loc10_26.1(%int_1) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc10_26.2: %i32 = value_of_initializer %int.convert_checked.loc10_26.1 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc10_26.3: %i32 = converted %int_1, %.loc10_26.2 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc10_26.2: %Convert.type.2 = interface_witness_access constants.%interface.6, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc10_26.2: %Convert.type.2 = interface_witness_access constants.%interface.20, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc10_26.2: = bound_method %int_5, %impl.elem0.loc10_26.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc10_26.2: = specific_function %Convert.bound.loc10_26.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc10_26.2: init %i32 = call %Convert.specific_fn.loc10_26.2(%int_5) [template = constants.%int_5.2] @@ -344,7 +344,7 @@ let x: i32 = c[0]; // CHECK:STDOUT: %s: %tuple.type.2 = bind_name s, %.loc10_27 // CHECK:STDOUT: %s.ref: %tuple.type.2 = name_ref s, %s // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0.loc11_17.1: %Convert.type.2 = interface_witness_access constants.%interface.6, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11_17.1: %Convert.type.2 = interface_witness_access constants.%interface.20, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11: = bound_method %int_0, %impl.elem0.loc11_17.1 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc11: = specific_function %Convert.bound.loc11, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc11: init %i32 = call %Convert.specific_fn.loc11(%int_0) [template = constants.%int_0.2] diff --git a/toolchain/check/testdata/package_expr/syntax.carbon b/toolchain/check/testdata/package_expr/syntax.carbon index 89c0013b3f93f..4e1f4d57f902f 100644 --- a/toolchain/check/testdata/package_expr/syntax.carbon +++ b/toolchain/check/testdata/package_expr/syntax.carbon @@ -50,7 +50,7 @@ fn Main() { // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] @@ -81,7 +81,7 @@ fn Main() { // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.2] @@ -103,7 +103,7 @@ fn Main() { // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] @@ -141,7 +141,7 @@ fn Main() { // CHECK:STDOUT: %x.var: ref %i32 = var x // CHECK:STDOUT: %x: ref %i32 = bind_name x, %x.var // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1, %impl.elem0 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_1) [template = constants.%int_1.2] @@ -159,7 +159,7 @@ fn Main() { // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.2] diff --git a/toolchain/check/testdata/packages/implicit_imports_prelude.carbon b/toolchain/check/testdata/packages/implicit_imports_prelude.carbon index ef1d30a75e253..cf73aceba5fcc 100644 --- a/toolchain/check/testdata/packages/implicit_imports_prelude.carbon +++ b/toolchain/check/testdata/packages/implicit_imports_prelude.carbon @@ -31,7 +31,7 @@ var b: i32 = a; // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] @@ -59,7 +59,7 @@ var b: i32 = a; // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.2] diff --git a/toolchain/check/testdata/pointer/address_of_deref.carbon b/toolchain/check/testdata/pointer/address_of_deref.carbon index a1945dfa5597e..ea1e0122d59af 100644 --- a/toolchain/check/testdata/pointer/address_of_deref.carbon +++ b/toolchain/check/testdata/pointer/address_of_deref.carbon @@ -24,7 +24,7 @@ fn F() -> i32 { // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] @@ -62,7 +62,7 @@ fn F() -> i32 { // CHECK:STDOUT: %n.var: ref %i32 = var n // CHECK:STDOUT: %n: ref %i32 = bind_name n, %n.var // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.2] diff --git a/toolchain/check/testdata/pointer/address_of_lvalue.carbon b/toolchain/check/testdata/pointer/address_of_lvalue.carbon index 0ca2d59cd08f3..e49a1151c2ae9 100644 --- a/toolchain/check/testdata/pointer/address_of_lvalue.carbon +++ b/toolchain/check/testdata/pointer/address_of_lvalue.carbon @@ -35,7 +35,7 @@ fn F() { // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -75,14 +75,14 @@ fn F() { // CHECK:STDOUT: %int_1.loc12: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_2.loc12: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %.loc12_46.1: %struct_type.a.b.2 = struct_literal (%int_1.loc12, %int_2.loc12) -// CHECK:STDOUT: %impl.elem0.loc12_46.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc12_46.1: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc12_46.1: = bound_method %int_1.loc12, %impl.elem0.loc12_46.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc12_46.1: = specific_function %Convert.bound.loc12_46.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc12_46.1: init %i32 = call %Convert.specific_fn.loc12_46.1(%int_1.loc12) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc12_46.2: init %i32 = converted %int_1.loc12, %int.convert_checked.loc12_46.1 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc12_46.3: ref %i32 = struct_access %s.var, element0 // CHECK:STDOUT: %.loc12_46.4: init %i32 = initialize_from %.loc12_46.2 to %.loc12_46.3 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc12_46.2: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc12_46.2: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc12_46.2: = bound_method %int_2.loc12, %impl.elem0.loc12_46.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc12_46.2: = specific_function %Convert.bound.loc12_46.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc12_46.2: init %i32 = call %Convert.specific_fn.loc12_46.2(%int_2.loc12) [template = constants.%int_2.2] @@ -114,14 +114,14 @@ fn F() { // CHECK:STDOUT: %int_1.loc18: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_2.loc18: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %.loc18_28.1: %tuple.type.3 = tuple_literal (%int_1.loc18, %int_2.loc18) -// CHECK:STDOUT: %impl.elem0.loc18_28.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc18_28.1: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc18_28.1: = bound_method %int_1.loc18, %impl.elem0.loc18_28.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc18_28.1: = specific_function %Convert.bound.loc18_28.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc18_28.1: init %i32 = call %Convert.specific_fn.loc18_28.1(%int_1.loc18) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc18_28.2: init %i32 = converted %int_1.loc18, %int.convert_checked.loc18_28.1 [template = constants.%int_1.2] // CHECK:STDOUT: %tuple.elem0.loc18: ref %i32 = tuple_access %t.var, element0 // CHECK:STDOUT: %.loc18_28.3: init %i32 = initialize_from %.loc18_28.2 to %tuple.elem0.loc18 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc18_28.2: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc18_28.2: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc18_28.2: = bound_method %int_2.loc18, %impl.elem0.loc18_28.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc18_28.2: = specific_function %Convert.bound.loc18_28.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc18_28.2: init %i32 = call %Convert.specific_fn.loc18_28.2(%int_2.loc18) [template = constants.%int_2.2] diff --git a/toolchain/check/testdata/pointer/basic.carbon b/toolchain/check/testdata/pointer/basic.carbon index fccad22cad273..197a07f38f879 100644 --- a/toolchain/check/testdata/pointer/basic.carbon +++ b/toolchain/check/testdata/pointer/basic.carbon @@ -26,7 +26,7 @@ fn F() -> i32 { // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] @@ -64,7 +64,7 @@ fn F() -> i32 { // CHECK:STDOUT: %n.var: ref %i32 = var n // CHECK:STDOUT: %n: ref %i32 = bind_name n, %n.var // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.2] diff --git a/toolchain/check/testdata/pointer/import.carbon b/toolchain/check/testdata/pointer/import.carbon index 5761bc7bab678..c5906b3482eb7 100644 --- a/toolchain/check/testdata/pointer/import.carbon +++ b/toolchain/check/testdata/pointer/import.carbon @@ -30,7 +30,7 @@ var a: i32* = a_ref; // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] @@ -62,7 +62,7 @@ var a: i32* = a_ref; // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.2] diff --git a/toolchain/check/testdata/return/code_after_return_value.carbon b/toolchain/check/testdata/return/code_after_return_value.carbon index 7f00bf9e07059..532fa18a9825c 100644 --- a/toolchain/check/testdata/return/code_after_return_value.carbon +++ b/toolchain/check/testdata/return/code_after_return_value.carbon @@ -33,7 +33,7 @@ fn F(b: bool) -> i32 { // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] @@ -78,7 +78,7 @@ fn F(b: bool) -> i32 { // CHECK:STDOUT: fn @F(%b.param_patt: bool) -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.2] diff --git a/toolchain/check/testdata/return/fail_return_with_returned_var.carbon b/toolchain/check/testdata/return/fail_return_with_returned_var.carbon index a498ef33bee63..ae122b298e5db 100644 --- a/toolchain/check/testdata/return/fail_return_with_returned_var.carbon +++ b/toolchain/check/testdata/return/fail_return_with_returned_var.carbon @@ -43,7 +43,7 @@ fn G() -> C { // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] @@ -119,7 +119,7 @@ fn G() -> C { // CHECK:STDOUT: %v.var: ref %i32 = var v // CHECK:STDOUT: %v: ref %i32 = bind_name v, %v.var // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.2] @@ -135,14 +135,14 @@ fn G() -> C { // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %.loc25_38.1: %struct_type.a.b.2 = struct_literal (%int_1, %int_2) -// CHECK:STDOUT: %impl.elem0.loc25_38.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc25_38.1: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc25_38.1: = bound_method %int_1, %impl.elem0.loc25_38.1 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc25_38.1: = specific_function %Convert.bound.loc25_38.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc25_38.1: init %i32 = call %Convert.specific_fn.loc25_38.1(%int_1) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc25_38.2: init %i32 = converted %int_1, %int.convert_checked.loc25_38.1 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc25_38.3: ref %i32 = class_element_access %return, element0 // CHECK:STDOUT: %.loc25_38.4: init %i32 = initialize_from %.loc25_38.2 to %.loc25_38.3 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc25_38.2: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc25_38.2: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc25_38.2: = bound_method %int_2, %impl.elem0.loc25_38.2 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc25_38.2: = specific_function %Convert.bound.loc25_38.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc25_38.2: init %i32 = call %Convert.specific_fn.loc25_38.2(%int_2) [template = constants.%int_2.2] diff --git a/toolchain/check/testdata/return/fail_returned_var_shadow.carbon b/toolchain/check/testdata/return/fail_returned_var_shadow.carbon index 87d743bd61cb0..a0ee4366af09f 100644 --- a/toolchain/check/testdata/return/fail_returned_var_shadow.carbon +++ b/toolchain/check/testdata/return/fail_returned_var_shadow.carbon @@ -51,7 +51,7 @@ fn DifferentScopes() -> i32 { // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] @@ -108,7 +108,7 @@ fn DifferentScopes() -> i32 { // CHECK:STDOUT: %v.var: ref %i32 = var v // CHECK:STDOUT: %v: ref %i32 = bind_name v, %v.var // CHECK:STDOUT: %int_0.loc13: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0.loc13: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc13: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc13: = bound_method %int_0.loc13, %impl.elem0.loc13 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc13: = specific_function %Convert.bound.loc13, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc13: init %i32 = call %Convert.specific_fn.loc13(%int_0.loc13) [template = constants.%int_0.2] @@ -117,7 +117,7 @@ fn DifferentScopes() -> i32 { // CHECK:STDOUT: %w.var: ref %i32 = var w // CHECK:STDOUT: %w: ref %i32 = bind_name w, %w.var // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc21: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc21: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc21: = bound_method %int_1, %impl.elem0.loc21 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc21: = specific_function %Convert.bound.loc21, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc21: init %i32 = call %Convert.specific_fn.loc21(%int_1) [template = constants.%int_1.2] @@ -127,7 +127,7 @@ fn DifferentScopes() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: !if.else: // CHECK:STDOUT: %int_0.loc23: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0.loc23: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc23: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc23: = bound_method %int_0.loc23, %impl.elem0.loc23 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc23: = specific_function %Convert.bound.loc23, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc23: init %i32 = call %Convert.specific_fn.loc23(%int_0.loc23) [template = constants.%int_0.2] @@ -145,7 +145,7 @@ fn DifferentScopes() -> i32 { // CHECK:STDOUT: %v.var: ref %i32 = var v // CHECK:STDOUT: %v: ref %i32 = bind_name v, %v.var // CHECK:STDOUT: %int_0.loc28: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0.loc28: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc28: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc28: = bound_method %int_0.loc28, %impl.elem0.loc28 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc28: = specific_function %Convert.bound.loc28, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc28: init %i32 = call %Convert.specific_fn.loc28(%int_0.loc28) [template = constants.%int_0.2] @@ -158,7 +158,7 @@ fn DifferentScopes() -> i32 { // CHECK:STDOUT: %w.var: ref %i32 = var w // CHECK:STDOUT: %w: ref %i32 = bind_name w, %w.var // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc36: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc36: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc36: = bound_method %int_1, %impl.elem0.loc36 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc36: = specific_function %Convert.bound.loc36, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc36: init %i32 = call %Convert.specific_fn.loc36(%int_1) [template = constants.%int_1.2] @@ -171,7 +171,7 @@ fn DifferentScopes() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: !if.else.loc27: // CHECK:STDOUT: %int_0.loc39: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0.loc39: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc39: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc39: = bound_method %int_0.loc39, %impl.elem0.loc39 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc39: = specific_function %Convert.bound.loc39, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc39: init %i32 = call %Convert.specific_fn.loc39(%int_0.loc39) [template = constants.%int_0.2] diff --git a/toolchain/check/testdata/return/returned_var.carbon b/toolchain/check/testdata/return/returned_var.carbon index a13e24ea43916..6c1a6dd2f0799 100644 --- a/toolchain/check/testdata/return/returned_var.carbon +++ b/toolchain/check/testdata/return/returned_var.carbon @@ -40,7 +40,7 @@ fn G() -> i32 { // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -111,14 +111,14 @@ fn G() -> i32 { // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %.loc17_43.1: %struct_type.a.b.2 = struct_literal (%int_1, %int_2) -// CHECK:STDOUT: %impl.elem0.loc17_43.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc17_43.1: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc17_43.1: = bound_method %int_1, %impl.elem0.loc17_43.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc17_43.1: = specific_function %Convert.bound.loc17_43.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc17_43.1: init %i32 = call %Convert.specific_fn.loc17_43.1(%int_1) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc17_43.2: init %i32 = converted %int_1, %int.convert_checked.loc17_43.1 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc17_43.3: ref %i32 = class_element_access %return, element0 // CHECK:STDOUT: %.loc17_43.4: init %i32 = initialize_from %.loc17_43.2 to %.loc17_43.3 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc17_43.2: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc17_43.2: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc17_43.2: = bound_method %int_2, %impl.elem0.loc17_43.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc17_43.2: = specific_function %Convert.bound.loc17_43.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc17_43.2: init %i32 = call %Convert.specific_fn.loc17_43.2(%int_2) [template = constants.%int_2.2] @@ -136,7 +136,7 @@ fn G() -> i32 { // CHECK:STDOUT: %result.var: ref %i32 = var result // CHECK:STDOUT: %result: ref %i32 = bind_name result, %result.var // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.2] diff --git a/toolchain/check/testdata/return/returned_var_scope.carbon b/toolchain/check/testdata/return/returned_var_scope.carbon index ece1b5332b3cb..f7cb11bdc2ee6 100644 --- a/toolchain/check/testdata/return/returned_var_scope.carbon +++ b/toolchain/check/testdata/return/returned_var_scope.carbon @@ -39,7 +39,7 @@ fn EnclosingButAfter(b: bool) -> i32 { // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] @@ -108,7 +108,7 @@ fn EnclosingButAfter(b: bool) -> i32 { // CHECK:STDOUT: %v.var: ref %i32 = var v // CHECK:STDOUT: %v: ref %i32 = bind_name v, %v.var // CHECK:STDOUT: %int_0.loc13: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0.loc13: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc13: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc13: = bound_method %int_0.loc13, %impl.elem0.loc13 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc13: = specific_function %Convert.bound.loc13, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc13: init %i32 = call %Convert.specific_fn.loc13(%int_0.loc13) [template = constants.%int_0.2] @@ -124,7 +124,7 @@ fn EnclosingButAfter(b: bool) -> i32 { // CHECK:STDOUT: %w.var: ref %i32 = var w // CHECK:STDOUT: %w: ref %i32 = bind_name w, %w.var // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc16: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc16: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc16: = bound_method %int_1, %impl.elem0.loc16 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc16: = specific_function %Convert.bound.loc16, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc16: init %i32 = call %Convert.specific_fn.loc16(%int_1) [template = constants.%int_1.2] @@ -134,7 +134,7 @@ fn EnclosingButAfter(b: bool) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: !if.else.loc15: // CHECK:STDOUT: %int_0.loc18: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0.loc18: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc18: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc18: = bound_method %int_0.loc18, %impl.elem0.loc18 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc18: = specific_function %Convert.bound.loc18, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc18: init %i32 = call %Convert.specific_fn.loc18(%int_0.loc18) [template = constants.%int_0.2] @@ -152,7 +152,7 @@ fn EnclosingButAfter(b: bool) -> i32 { // CHECK:STDOUT: %v.var: ref %i32 = var v // CHECK:STDOUT: %v: ref %i32 = bind_name v, %v.var // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0.loc23: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc23: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc23: = bound_method %int_0, %impl.elem0.loc23 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc23: = specific_function %Convert.bound.loc23, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc23: init %i32 = call %Convert.specific_fn.loc23(%int_0) [template = constants.%int_0.2] @@ -165,7 +165,7 @@ fn EnclosingButAfter(b: bool) -> i32 { // CHECK:STDOUT: %w.var: ref %i32 = var w // CHECK:STDOUT: %w: ref %i32 = bind_name w, %w.var // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc26: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc26: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc26: = bound_method %int_1, %impl.elem0.loc26 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc26: = specific_function %Convert.bound.loc26, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc26: init %i32 = call %Convert.specific_fn.loc26(%int_1) [template = constants.%int_1.2] diff --git a/toolchain/check/testdata/return/struct.carbon b/toolchain/check/testdata/return/struct.carbon index 758b0bdcb19be..cabf00e7e1383 100644 --- a/toolchain/check/testdata/return/struct.carbon +++ b/toolchain/check/testdata/return/struct.carbon @@ -25,7 +25,7 @@ fn Main() -> {.a: i32} { // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_3.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_3.2: %i32 = int_value 3 [template] @@ -63,7 +63,7 @@ fn Main() -> {.a: i32} { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] // CHECK:STDOUT: %.loc12_17.1: %struct_type.a.2 = struct_literal (%int_3) -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_3, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_3) [template = constants.%int_3.2] diff --git a/toolchain/check/testdata/return/tuple.carbon b/toolchain/check/testdata/return/tuple.carbon index bf416164d9e23..440d4e879487e 100644 --- a/toolchain/check/testdata/return/tuple.carbon +++ b/toolchain/check/testdata/return/tuple.carbon @@ -28,7 +28,7 @@ fn Main() -> (i32, i32) { // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_15.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_15.2: %i32 = int_value 15 [template] @@ -73,14 +73,14 @@ fn Main() -> (i32, i32) { // CHECK:STDOUT: %int_15: Core.IntLiteral = int_value 15 [template = constants.%int_15.1] // CHECK:STDOUT: %int_35: Core.IntLiteral = int_value 35 [template = constants.%int_35.1] // CHECK:STDOUT: %.loc13_17.1: %tuple.type.3 = tuple_literal (%int_15, %int_35) -// CHECK:STDOUT: %impl.elem0.loc13_17.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc13_17.1: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc13_17.1: = bound_method %int_15, %impl.elem0.loc13_17.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc13_17.1: = specific_function %Convert.bound.loc13_17.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc13_17.1: init %i32 = call %Convert.specific_fn.loc13_17.1(%int_15) [template = constants.%int_15.2] // CHECK:STDOUT: %.loc13_17.2: init %i32 = converted %int_15, %int.convert_checked.loc13_17.1 [template = constants.%int_15.2] // CHECK:STDOUT: %tuple.elem0: ref %i32 = tuple_access %return, element0 // CHECK:STDOUT: %.loc13_17.3: init %i32 = initialize_from %.loc13_17.2 to %tuple.elem0 [template = constants.%int_15.2] -// CHECK:STDOUT: %impl.elem0.loc13_17.2: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc13_17.2: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc13_17.2: = bound_method %int_35, %impl.elem0.loc13_17.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc13_17.2: = specific_function %Convert.bound.loc13_17.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc13_17.2: init %i32 = call %Convert.specific_fn.loc13_17.2(%int_35) [template = constants.%int_35.2] diff --git a/toolchain/check/testdata/return/value.carbon b/toolchain/check/testdata/return/value.carbon index 2855077b5b4dc..4d36bb990a57c 100644 --- a/toolchain/check/testdata/return/value.carbon +++ b/toolchain/check/testdata/return/value.carbon @@ -23,7 +23,7 @@ fn Main() -> i32 { // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] @@ -58,7 +58,7 @@ fn Main() -> i32 { // CHECK:STDOUT: fn @Main() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.2] diff --git a/toolchain/check/testdata/struct/fail_non_member_access.carbon b/toolchain/check/testdata/struct/fail_non_member_access.carbon index bc66d304324a2..ef018b5ccd37e 100644 --- a/toolchain/check/testdata/struct/fail_non_member_access.carbon +++ b/toolchain/check/testdata/struct/fail_non_member_access.carbon @@ -25,7 +25,7 @@ var y: i32 = x.b; // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_4.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_4.2: %i32 = int_value 4 [template] @@ -58,7 +58,7 @@ var y: i32 = x.b; // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [template = constants.%int_4.1] // CHECK:STDOUT: %.loc11_27.1: %struct_type.a.2 = struct_literal (%int_4) -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_4, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_4) [template = constants.%int_4.2] diff --git a/toolchain/check/testdata/struct/import.carbon b/toolchain/check/testdata/struct/import.carbon index 811d79f230de6..1b0a93f361c90 100644 --- a/toolchain/check/testdata/struct/import.carbon +++ b/toolchain/check/testdata/struct/import.carbon @@ -62,7 +62,7 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] @@ -143,13 +143,13 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %.loc9_28.1: %struct_type.a.b.2 = struct_literal (%int_1, %int_2) -// CHECK:STDOUT: %impl.elem0.loc9_28.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc9_28.1: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc9_28.1: = bound_method %int_1, %impl.elem0.loc9_28.1 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc9_28.1: = specific_function %Convert.bound.loc9_28.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc9_28.1: init %i32 = call %Convert.specific_fn.loc9_28.1(%int_1) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc9_28.2: %i32 = value_of_initializer %int.convert_checked.loc9_28.1 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc9_28.3: %i32 = converted %int_1, %.loc9_28.2 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc9_28.2: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc9_28.2: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc9_28.2: = bound_method %int_2, %impl.elem0.loc9_28.2 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc9_28.2: = specific_function %Convert.bound.loc9_28.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc9_28.2: init %i32 = call %Convert.specific_fn.loc9_28.2(%int_2) [template = constants.%int_2.2] @@ -184,7 +184,7 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_0.loc4: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %.loc4_31.1: %struct_type.a.2 = struct_literal (%int_0.loc4) -// CHECK:STDOUT: %impl.elem0.loc4: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc4: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc4: = bound_method %int_0.loc4, %impl.elem0.loc4 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc4: = specific_function %Convert.bound.loc4, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc4: init %i32 = call %Convert.specific_fn.loc4(%int_0.loc4) [template = constants.%int_0.2] @@ -198,7 +198,7 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %.loc6_29.1: %struct_type.b.c.2 = struct_literal (%int_0.loc6_17, %.loc6_28.1) // CHECK:STDOUT: %int_0.loc6_37: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %.loc6_38.1: %struct_type.a.d.3 = struct_literal (%.loc6_29.1, %int_0.loc6_37) -// CHECK:STDOUT: %impl.elem0.loc6_29: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc6_29: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc6_29: = bound_method %int_0.loc6_17, %impl.elem0.loc6_29 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc6_29: = specific_function %Convert.bound.loc6_29, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc6_29: init %i32 = call %Convert.specific_fn.loc6_29(%int_0.loc6_17) [template = constants.%int_0.2] @@ -206,7 +206,7 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %.loc6_38.2: ref %struct_type.b.c.1 = struct_access file.%b_ref.var, element0 // CHECK:STDOUT: %.loc6_29.3: ref %i32 = struct_access %.loc6_38.2, element0 // CHECK:STDOUT: %.loc6_29.4: init %i32 = initialize_from %.loc6_29.2 to %.loc6_29.3 [template = constants.%int_0.2] -// CHECK:STDOUT: %impl.elem0.loc6_28: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc6_28: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc6_28: = bound_method %int_0.loc6_26, %impl.elem0.loc6_28 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc6_28: = specific_function %Convert.bound.loc6_28, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc6_28: init %i32 = call %Convert.specific_fn.loc6_28(%int_0.loc6_26) [template = constants.%int_0.2] @@ -217,7 +217,7 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %.loc6_29.7: init %tuple.type.2 = initialize_from %.loc6_29.6 to %.loc6_29.5 [template = constants.%tuple] // CHECK:STDOUT: %.loc6_29.8: init %struct_type.b.c.1 = struct_init (%.loc6_29.4, %.loc6_29.7) to %.loc6_38.2 [template = constants.%struct.2] // CHECK:STDOUT: %.loc6_38.3: init %struct_type.b.c.1 = converted %.loc6_29.1, %.loc6_29.8 [template = constants.%struct.2] -// CHECK:STDOUT: %impl.elem0.loc6_38: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc6_38: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc6_38: = bound_method %int_0.loc6_37, %impl.elem0.loc6_38 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc6_38: = specific_function %Convert.bound.loc6_38, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc6_38: init %i32 = call %Convert.specific_fn.loc6_38(%int_0.loc6_37) [template = constants.%int_0.2] @@ -276,7 +276,7 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.195: = import_ref Implicit//default, loc8_34, loaded [template = constants.%complete_type.3] -// CHECK:STDOUT: %import_ref.196 = import_ref Implicit//default, inst603 [no loc], unloaded +// CHECK:STDOUT: %import_ref.196 = import_ref Implicit//default, inst945 [no loc], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -396,7 +396,7 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.194: = import_ref Implicit//default, loc8_34, loaded [template = constants.%complete_type.3] -// CHECK:STDOUT: %import_ref.195 = import_ref Implicit//default, inst603 [no loc], unloaded +// CHECK:STDOUT: %import_ref.195 = import_ref Implicit//default, inst945 [no loc], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -486,7 +486,7 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.194: = import_ref Implicit//default, loc8_34, loaded [template = constants.%complete_type.3] -// CHECK:STDOUT: %import_ref.195 = import_ref Implicit//default, inst603 [no loc], unloaded +// CHECK:STDOUT: %import_ref.195 = import_ref Implicit//default, inst945 [no loc], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/struct/member_access.carbon b/toolchain/check/testdata/struct/member_access.carbon index b1a9867dca1c4..e189791d733b7 100644 --- a/toolchain/check/testdata/struct/member_access.carbon +++ b/toolchain/check/testdata/struct/member_access.carbon @@ -24,7 +24,7 @@ var z: i32 = y; // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -64,7 +64,7 @@ var z: i32 = y; // CHECK:STDOUT: %.loc11_46.1: %struct_type.a.b.2 = struct_literal (%float, %int_1) // CHECK:STDOUT: %.loc11_46.2: ref f64 = struct_access file.%x.var, element0 // CHECK:STDOUT: %.loc11_46.3: init f64 = initialize_from %float to %.loc11_46.2 [template = constants.%float] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_1) [template = constants.%int_1.2] diff --git a/toolchain/check/testdata/struct/one_entry.carbon b/toolchain/check/testdata/struct/one_entry.carbon index 30dfbbe54e6f6..4c912e57e1c8e 100644 --- a/toolchain/check/testdata/struct/one_entry.carbon +++ b/toolchain/check/testdata/struct/one_entry.carbon @@ -22,7 +22,7 @@ var y: {.a: i32} = x; // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_4.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_4.2: %i32 = int_value 4 [template] @@ -55,7 +55,7 @@ var y: {.a: i32} = x; // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [template = constants.%int_4.1] // CHECK:STDOUT: %.loc11_27.1: %struct_type.a.2 = struct_literal (%int_4) -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_4, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_4) [template = constants.%int_4.2] diff --git a/toolchain/check/testdata/struct/partially_const.carbon b/toolchain/check/testdata/struct/partially_const.carbon index 05ef1be1b0685..d6f2bc87fb4ec 100644 --- a/toolchain/check/testdata/struct/partially_const.carbon +++ b/toolchain/check/testdata/struct/partially_const.carbon @@ -25,7 +25,7 @@ fn Make(n: i32) -> {.a: i32, .b: i32, .c: i32} { // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] @@ -76,7 +76,7 @@ fn Make(n: i32) -> {.a: i32, .b: i32, .c: i32} { // CHECK:STDOUT: %n.ref: %i32 = name_ref n, %n // CHECK:STDOUT: %int_0.loc12_32: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %.loc12_33.1: %struct_type.a.b.c.2 = struct_literal (%int_0.loc12_16, %n.ref, %int_0.loc12_32) -// CHECK:STDOUT: %impl.elem0.loc12_33.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc12_33.1: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc12_33.1: = bound_method %int_0.loc12_16, %impl.elem0.loc12_33.1 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn.loc12_33.1: = specific_function %Convert.bound.loc12_33.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc12_33.1: init %i32 = call %Convert.specific_fn.loc12_33.1(%int_0.loc12_16) [template = constants.%int_0.2] @@ -85,7 +85,7 @@ fn Make(n: i32) -> {.a: i32, .b: i32, .c: i32} { // CHECK:STDOUT: %.loc12_33.4: init %i32 = initialize_from %.loc12_33.2 to %.loc12_33.3 [template = constants.%int_0.2] // CHECK:STDOUT: %.loc12_33.5: ref %i32 = struct_access %return, element1 // CHECK:STDOUT: %.loc12_33.6: init %i32 = initialize_from %n.ref to %.loc12_33.5 -// CHECK:STDOUT: %impl.elem0.loc12_33.2: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc12_33.2: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc12_33.2: = bound_method %int_0.loc12_32, %impl.elem0.loc12_33.2 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn.loc12_33.2: = specific_function %Convert.bound.loc12_33.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc12_33.2: init %i32 = call %Convert.specific_fn.loc12_33.2(%int_0.loc12_32) [template = constants.%int_0.2] diff --git a/toolchain/check/testdata/struct/tuple_as_element.carbon b/toolchain/check/testdata/struct/tuple_as_element.carbon index 4b6997fab31de..aafdf62c83dc2 100644 --- a/toolchain/check/testdata/struct/tuple_as_element.carbon +++ b/toolchain/check/testdata/struct/tuple_as_element.carbon @@ -25,7 +25,7 @@ var y: {.a: i32, .b: (i32,)} = x; // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -64,14 +64,14 @@ var y: {.a: i32, .b: (i32,)} = x; // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %.loc11_49.1: %tuple.type.3 = tuple_literal (%int_2) // CHECK:STDOUT: %.loc11_50.1: %struct_type.a.b.2 = struct_literal (%int_1, %.loc11_49.1) -// CHECK:STDOUT: %impl.elem0.loc11_50: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11_50: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_50: = bound_method %int_1, %impl.elem0.loc11_50 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc11_50: = specific_function %Convert.bound.loc11_50, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc11_50: init %i32 = call %Convert.specific_fn.loc11_50(%int_1) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc11_50.2: init %i32 = converted %int_1, %int.convert_checked.loc11_50 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc11_50.3: ref %i32 = struct_access file.%x.var, element0 // CHECK:STDOUT: %.loc11_50.4: init %i32 = initialize_from %.loc11_50.2 to %.loc11_50.3 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc11_49: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11_49: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_49: = bound_method %int_2, %impl.elem0.loc11_49 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc11_49: = specific_function %Convert.bound.loc11_49, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc11_49: init %i32 = call %Convert.specific_fn.loc11_49(%int_2) [template = constants.%int_2.2] diff --git a/toolchain/check/testdata/struct/two_entries.carbon b/toolchain/check/testdata/struct/two_entries.carbon index 92af23fb75b24..ccac7fa9a6e39 100644 --- a/toolchain/check/testdata/struct/two_entries.carbon +++ b/toolchain/check/testdata/struct/two_entries.carbon @@ -26,7 +26,7 @@ var y: {.a: i32, .b: i32} = x; // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -65,13 +65,13 @@ var y: {.a: i32, .b: i32} = x; // CHECK:STDOUT: %int_1.loc11: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_2.loc11: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %.loc11_44.1: %struct_type.a.b.2 = struct_literal (%int_1.loc11, %int_2.loc11) -// CHECK:STDOUT: %impl.elem0.loc11_44.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11_44.1: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_44.1: = bound_method %int_1.loc11, %impl.elem0.loc11_44.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc11_44.1: = specific_function %Convert.bound.loc11_44.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc11_44.1: init %i32 = call %Convert.specific_fn.loc11_44.1(%int_1.loc11) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc11_44.2: %i32 = value_of_initializer %int.convert_checked.loc11_44.1 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc11_44.3: %i32 = converted %int_1.loc11, %.loc11_44.2 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc11_44.2: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11_44.2: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_44.2: = bound_method %int_2.loc11, %impl.elem0.loc11_44.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc11_44.2: = specific_function %Convert.bound.loc11_44.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc11_44.2: init %i32 = call %Convert.specific_fn.loc11_44.2(%int_2.loc11) [template = constants.%int_2.2] @@ -85,14 +85,14 @@ var y: {.a: i32, .b: i32} = x; // CHECK:STDOUT: %int_1.loc14: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_2.loc14: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %.loc14_44.1: %struct_type.a.b.2 = struct_literal (%int_1.loc14, %int_2.loc14) -// CHECK:STDOUT: %impl.elem0.loc14_44.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc14_44.1: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc14_44.1: = bound_method %int_1.loc14, %impl.elem0.loc14_44.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc14_44.1: = specific_function %Convert.bound.loc14_44.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc14_44.1: init %i32 = call %Convert.specific_fn.loc14_44.1(%int_1.loc14) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc14_44.2: init %i32 = converted %int_1.loc14, %int.convert_checked.loc14_44.1 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc14_44.3: ref %i32 = struct_access file.%x.var, element0 // CHECK:STDOUT: %.loc14_44.4: init %i32 = initialize_from %.loc14_44.2 to %.loc14_44.3 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc14_44.2: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc14_44.2: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc14_44.2: = bound_method %int_2.loc14, %impl.elem0.loc14_44.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc14_44.2: = specific_function %Convert.bound.loc14_44.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc14_44.2: init %i32 = call %Convert.specific_fn.loc14_44.2(%int_2.loc14) [template = constants.%int_2.2] diff --git a/toolchain/check/testdata/tuple/access/element_access.carbon b/toolchain/check/testdata/tuple/access/element_access.carbon index c6c7361b5d458..4335eb8ebbcc7 100644 --- a/toolchain/check/testdata/tuple/access/element_access.carbon +++ b/toolchain/check/testdata/tuple/access/element_access.carbon @@ -23,7 +23,7 @@ var c: i32 = b.0; // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_12.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_12.2: %i32 = int_value 12 [template] @@ -60,7 +60,7 @@ var c: i32 = b.0; // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_12: Core.IntLiteral = int_value 12 [template = constants.%int_12.1] // CHECK:STDOUT: %.loc11_21.1: %tuple.type.3 = tuple_literal (%int_12) -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_12, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_12) [template = constants.%int_12.2] diff --git a/toolchain/check/testdata/tuple/access/fail_access_error.carbon b/toolchain/check/testdata/tuple/access/fail_access_error.carbon index 34865334cc09d..0648dc4812712 100644 --- a/toolchain/check/testdata/tuple/access/fail_access_error.carbon +++ b/toolchain/check/testdata/tuple/access/fail_access_error.carbon @@ -26,7 +26,7 @@ var b: i32 = a.(oops); // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_12.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_12.2: %i32 = int_value 12 [template] @@ -63,14 +63,14 @@ var b: i32 = a.(oops); // CHECK:STDOUT: %int_12: Core.IntLiteral = int_value 12 [template = constants.%int_12.1] // CHECK:STDOUT: %int_6: Core.IntLiteral = int_value 6 [template = constants.%int_6.1] // CHECK:STDOUT: %.loc11_27.1: %tuple.type.3 = tuple_literal (%int_12, %int_6) -// CHECK:STDOUT: %impl.elem0.loc11_27.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11_27.1: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_27.1: = bound_method %int_12, %impl.elem0.loc11_27.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc11_27.1: = specific_function %Convert.bound.loc11_27.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc11_27.1: init %i32 = call %Convert.specific_fn.loc11_27.1(%int_12) [template = constants.%int_12.2] // CHECK:STDOUT: %.loc11_27.2: init %i32 = converted %int_12, %int.convert_checked.loc11_27.1 [template = constants.%int_12.2] // CHECK:STDOUT: %tuple.elem0: ref %i32 = tuple_access file.%a.var, element0 // CHECK:STDOUT: %.loc11_27.3: init %i32 = initialize_from %.loc11_27.2 to %tuple.elem0 [template = constants.%int_12.2] -// CHECK:STDOUT: %impl.elem0.loc11_27.2: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11_27.2: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_27.2: = bound_method %int_6, %impl.elem0.loc11_27.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc11_27.2: = specific_function %Convert.bound.loc11_27.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc11_27.2: init %i32 = call %Convert.specific_fn.loc11_27.2(%int_6) [template = constants.%int_6.2] diff --git a/toolchain/check/testdata/tuple/access/fail_large_index.carbon b/toolchain/check/testdata/tuple/access/fail_large_index.carbon index e2769558ff399..bec5ed2e097b6 100644 --- a/toolchain/check/testdata/tuple/access/fail_large_index.carbon +++ b/toolchain/check/testdata/tuple/access/fail_large_index.carbon @@ -31,7 +31,7 @@ var d: i32 = b.(0x7FFF_FFFF); // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_12.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_12.2: %i32 = int_value 12 [template] @@ -72,7 +72,7 @@ var d: i32 = b.(0x7FFF_FFFF); // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_12: Core.IntLiteral = int_value 12 [template = constants.%int_12.1] // CHECK:STDOUT: %.loc11_21.1: %tuple.type.3 = tuple_literal (%int_12) -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_12, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_12) [template = constants.%int_12.2] diff --git a/toolchain/check/testdata/tuple/access/fail_negative_indexing.carbon b/toolchain/check/testdata/tuple/access/fail_negative_indexing.carbon index f358890dcb2a6..976149262c8e0 100644 --- a/toolchain/check/testdata/tuple/access/fail_negative_indexing.carbon +++ b/toolchain/check/testdata/tuple/access/fail_negative_indexing.carbon @@ -26,7 +26,7 @@ var b: i32 = a.(-10); // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_12.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_12.2: %i32 = int_value 12 [template] @@ -65,14 +65,14 @@ var b: i32 = a.(-10); // CHECK:STDOUT: %int_12: Core.IntLiteral = int_value 12 [template = constants.%int_12.1] // CHECK:STDOUT: %int_6: Core.IntLiteral = int_value 6 [template = constants.%int_6.1] // CHECK:STDOUT: %.loc11_27.1: %tuple.type.3 = tuple_literal (%int_12, %int_6) -// CHECK:STDOUT: %impl.elem0.loc11_27.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11_27.1: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_27.1: = bound_method %int_12, %impl.elem0.loc11_27.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc11_27.1: = specific_function %Convert.bound.loc11_27.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc11_27.1: init %i32 = call %Convert.specific_fn.loc11_27.1(%int_12) [template = constants.%int_12.2] // CHECK:STDOUT: %.loc11_27.2: init %i32 = converted %int_12, %int.convert_checked.loc11_27.1 [template = constants.%int_12.2] // CHECK:STDOUT: %tuple.elem0: ref %i32 = tuple_access file.%a.var, element0 // CHECK:STDOUT: %.loc11_27.3: init %i32 = initialize_from %.loc11_27.2 to %tuple.elem0 [template = constants.%int_12.2] -// CHECK:STDOUT: %impl.elem0.loc11_27.2: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11_27.2: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_27.2: = bound_method %int_6, %impl.elem0.loc11_27.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc11_27.2: = specific_function %Convert.bound.loc11_27.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc11_27.2: init %i32 = call %Convert.specific_fn.loc11_27.2(%int_6) [template = constants.%int_6.2] diff --git a/toolchain/check/testdata/tuple/access/fail_non_deterministic_type.carbon b/toolchain/check/testdata/tuple/access/fail_non_deterministic_type.carbon index e62614306555a..9c3e7763ae82a 100644 --- a/toolchain/check/testdata/tuple/access/fail_non_deterministic_type.carbon +++ b/toolchain/check/testdata/tuple/access/fail_non_deterministic_type.carbon @@ -27,7 +27,7 @@ var c: i32 = a.(b); // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_2.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] @@ -71,14 +71,14 @@ var c: i32 = a.(b); // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] // CHECK:STDOUT: %.loc11_26.1: %tuple.type.3 = tuple_literal (%int_2, %int_3) -// CHECK:STDOUT: %impl.elem0.loc11_26.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11_26.1: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_26.1: = bound_method %int_2, %impl.elem0.loc11_26.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc11_26.1: = specific_function %Convert.bound.loc11_26.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc11_26.1: init %i32 = call %Convert.specific_fn.loc11_26.1(%int_2) [template = constants.%int_2.2] // CHECK:STDOUT: %.loc11_26.2: init %i32 = converted %int_2, %int.convert_checked.loc11_26.1 [template = constants.%int_2.2] // CHECK:STDOUT: %tuple.elem0: ref %i32 = tuple_access file.%a.var, element0 // CHECK:STDOUT: %.loc11_26.3: init %i32 = initialize_from %.loc11_26.2 to %tuple.elem0 [template = constants.%int_2.2] -// CHECK:STDOUT: %impl.elem0.loc11_26.2: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11_26.2: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_26.2: = bound_method %int_3, %impl.elem0.loc11_26.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc11_26.2: = specific_function %Convert.bound.loc11_26.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc11_26.2: init %i32 = call %Convert.specific_fn.loc11_26.2(%int_3) [template = constants.%int_3.2] @@ -89,7 +89,7 @@ var c: i32 = a.(b); // CHECK:STDOUT: %.loc11_27: init %tuple.type.2 = converted %.loc11_26.1, %.loc11_26.6 [template = constants.%tuple] // CHECK:STDOUT: assign file.%a.var, %.loc11_27 // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0.loc12: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc12: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc12: = bound_method %int_0, %impl.elem0.loc12 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc12: = specific_function %Convert.bound.loc12, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc12: init %i32 = call %Convert.specific_fn.loc12(%int_0) [template = constants.%int_0.2] diff --git a/toolchain/check/testdata/tuple/access/fail_non_int_indexing.carbon b/toolchain/check/testdata/tuple/access/fail_non_int_indexing.carbon index f61d58fac4f84..14b601137f361 100644 --- a/toolchain/check/testdata/tuple/access/fail_non_int_indexing.carbon +++ b/toolchain/check/testdata/tuple/access/fail_non_int_indexing.carbon @@ -29,7 +29,7 @@ var b: i32 = a.(2.6); // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_12.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_12.2: %i32 = int_value 12 [template] @@ -67,14 +67,14 @@ var b: i32 = a.(2.6); // CHECK:STDOUT: %int_12: Core.IntLiteral = int_value 12 [template = constants.%int_12.1] // CHECK:STDOUT: %int_6: Core.IntLiteral = int_value 6 [template = constants.%int_6.1] // CHECK:STDOUT: %.loc11_27.1: %tuple.type.3 = tuple_literal (%int_12, %int_6) -// CHECK:STDOUT: %impl.elem0.loc11_27.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11_27.1: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_27.1: = bound_method %int_12, %impl.elem0.loc11_27.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc11_27.1: = specific_function %Convert.bound.loc11_27.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc11_27.1: init %i32 = call %Convert.specific_fn.loc11_27.1(%int_12) [template = constants.%int_12.2] // CHECK:STDOUT: %.loc11_27.2: init %i32 = converted %int_12, %int.convert_checked.loc11_27.1 [template = constants.%int_12.2] // CHECK:STDOUT: %tuple.elem0: ref %i32 = tuple_access file.%a.var, element0 // CHECK:STDOUT: %.loc11_27.3: init %i32 = initialize_from %.loc11_27.2 to %tuple.elem0 [template = constants.%int_12.2] -// CHECK:STDOUT: %impl.elem0.loc11_27.2: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11_27.2: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_27.2: = bound_method %int_6, %impl.elem0.loc11_27.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc11_27.2: = specific_function %Convert.bound.loc11_27.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc11_27.2: init %i32 = call %Convert.specific_fn.loc11_27.2(%int_6) [template = constants.%int_6.2] diff --git a/toolchain/check/testdata/tuple/access/fail_non_tuple_access.carbon b/toolchain/check/testdata/tuple/access/fail_non_tuple_access.carbon index f0b214a67a692..ac08b37b15431 100644 --- a/toolchain/check/testdata/tuple/access/fail_non_tuple_access.carbon +++ b/toolchain/check/testdata/tuple/access/fail_non_tuple_access.carbon @@ -38,7 +38,7 @@ fn Main() { // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_5.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_5.2: %i32 = int_value 5 [template] @@ -73,7 +73,7 @@ fn Main() { // CHECK:STDOUT: %int_5.loc18_30: Core.IntLiteral = int_value 5 [template = constants.%int_5.1] // CHECK:STDOUT: %int_5.loc18_33: Core.IntLiteral = int_value 5 [template = constants.%int_5.1] // CHECK:STDOUT: %.loc18_34.1: %tuple.type = tuple_literal (%int_5.loc18_30, %int_5.loc18_33) -// CHECK:STDOUT: %impl.elem0.loc18_34.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc18_34.1: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc18_34.1: = bound_method %int_5.loc18_30, %impl.elem0.loc18_34.1 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn.loc18_34.1: = specific_function %Convert.bound.loc18_34.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc18_34.1: init %i32 = call %Convert.specific_fn.loc18_34.1(%int_5.loc18_30) [template = constants.%int_5.2] @@ -81,7 +81,7 @@ fn Main() { // CHECK:STDOUT: %int_0.loc18: Core.IntLiteral = int_value 0 [template = constants.%int_0] // CHECK:STDOUT: %.loc18_34.3: ref %i32 = array_index %non_tuple.var, %int_0.loc18 // CHECK:STDOUT: %.loc18_34.4: init %i32 = initialize_from %.loc18_34.2 to %.loc18_34.3 [template = constants.%int_5.2] -// CHECK:STDOUT: %impl.elem0.loc18_34.2: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc18_34.2: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc18_34.2: = bound_method %int_5.loc18_33, %impl.elem0.loc18_34.2 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn.loc18_34.2: = specific_function %Convert.bound.loc18_34.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc18_34.2: init %i32 = call %Convert.specific_fn.loc18_34.2(%int_5.loc18_33) [template = constants.%int_5.2] diff --git a/toolchain/check/testdata/tuple/access/fail_out_of_bound_access.carbon b/toolchain/check/testdata/tuple/access/fail_out_of_bound_access.carbon index 7607c1f52600b..ba8263fd0906d 100644 --- a/toolchain/check/testdata/tuple/access/fail_out_of_bound_access.carbon +++ b/toolchain/check/testdata/tuple/access/fail_out_of_bound_access.carbon @@ -26,7 +26,7 @@ var b: i32 = a.2; // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_12.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_12.2: %i32 = int_value 12 [template] @@ -64,14 +64,14 @@ var b: i32 = a.2; // CHECK:STDOUT: %int_12: Core.IntLiteral = int_value 12 [template = constants.%int_12.1] // CHECK:STDOUT: %int_6: Core.IntLiteral = int_value 6 [template = constants.%int_6.1] // CHECK:STDOUT: %.loc11_27.1: %tuple.type.3 = tuple_literal (%int_12, %int_6) -// CHECK:STDOUT: %impl.elem0.loc11_27.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11_27.1: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_27.1: = bound_method %int_12, %impl.elem0.loc11_27.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc11_27.1: = specific_function %Convert.bound.loc11_27.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc11_27.1: init %i32 = call %Convert.specific_fn.loc11_27.1(%int_12) [template = constants.%int_12.2] // CHECK:STDOUT: %.loc11_27.2: init %i32 = converted %int_12, %int.convert_checked.loc11_27.1 [template = constants.%int_12.2] // CHECK:STDOUT: %tuple.elem0: ref %i32 = tuple_access file.%a.var, element0 // CHECK:STDOUT: %.loc11_27.3: init %i32 = initialize_from %.loc11_27.2 to %tuple.elem0 [template = constants.%int_12.2] -// CHECK:STDOUT: %impl.elem0.loc11_27.2: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11_27.2: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_27.2: = bound_method %int_6, %impl.elem0.loc11_27.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc11_27.2: = specific_function %Convert.bound.loc11_27.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc11_27.2: init %i32 = call %Convert.specific_fn.loc11_27.2(%int_6) [template = constants.%int_6.2] diff --git a/toolchain/check/testdata/tuple/access/fail_out_of_bound_not_literal.carbon b/toolchain/check/testdata/tuple/access/fail_out_of_bound_not_literal.carbon index 1993c1859c3eb..c935b54f7dfd3 100644 --- a/toolchain/check/testdata/tuple/access/fail_out_of_bound_not_literal.carbon +++ b/toolchain/check/testdata/tuple/access/fail_out_of_bound_not_literal.carbon @@ -26,7 +26,7 @@ var b: i32 = a.({.index = 2}.index); // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_12.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_12.2: %i32 = int_value 12 [template] @@ -66,14 +66,14 @@ var b: i32 = a.({.index = 2}.index); // CHECK:STDOUT: %int_12: Core.IntLiteral = int_value 12 [template = constants.%int_12.1] // CHECK:STDOUT: %int_34: Core.IntLiteral = int_value 34 [template = constants.%int_34.1] // CHECK:STDOUT: %.loc11_28.1: %tuple.type.3 = tuple_literal (%int_12, %int_34) -// CHECK:STDOUT: %impl.elem0.loc11_28.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11_28.1: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_28.1: = bound_method %int_12, %impl.elem0.loc11_28.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc11_28.1: = specific_function %Convert.bound.loc11_28.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc11_28.1: init %i32 = call %Convert.specific_fn.loc11_28.1(%int_12) [template = constants.%int_12.2] // CHECK:STDOUT: %.loc11_28.2: init %i32 = converted %int_12, %int.convert_checked.loc11_28.1 [template = constants.%int_12.2] // CHECK:STDOUT: %tuple.elem0: ref %i32 = tuple_access file.%a.var, element0 // CHECK:STDOUT: %.loc11_28.3: init %i32 = initialize_from %.loc11_28.2 to %tuple.elem0 [template = constants.%int_12.2] -// CHECK:STDOUT: %impl.elem0.loc11_28.2: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11_28.2: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_28.2: = bound_method %int_34, %impl.elem0.loc11_28.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc11_28.2: = specific_function %Convert.bound.loc11_28.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc11_28.2: init %i32 = call %Convert.specific_fn.loc11_28.2(%int_34) [template = constants.%int_34.2] diff --git a/toolchain/check/testdata/tuple/access/index_not_literal.carbon b/toolchain/check/testdata/tuple/access/index_not_literal.carbon index e9a59558c22d7..f7aa408e6be4e 100644 --- a/toolchain/check/testdata/tuple/access/index_not_literal.carbon +++ b/toolchain/check/testdata/tuple/access/index_not_literal.carbon @@ -26,7 +26,7 @@ var d: i32 = a.({.index = 1 as i32}.index); // CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_34.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_34.2: %i32 = int_value 34 [template] @@ -38,13 +38,13 @@ var d: i32 = a.({.index = 1 as i32}.index); // CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.4, @As(%i32) [template] // CHECK:STDOUT: %Convert.type.12: type = fn_type @Convert.5, @impl.3(%int_32) [template] // CHECK:STDOUT: %Convert.12: %Convert.type.12 = struct_value () [template] -// CHECK:STDOUT: %interface.6: = interface_witness (%Convert.12) [template] +// CHECK:STDOUT: %interface.20: = interface_witness (%Convert.12) [template] // CHECK:STDOUT: %Convert.bound.2: = bound_method %int_0.1, %Convert.12 [template] // CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.5(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] // CHECK:STDOUT: %Convert.type.13: type = fn_type @Convert.3, @impl.2(%int_32) [template] // CHECK:STDOUT: %Convert.13: %Convert.type.13 = struct_value () [template] -// CHECK:STDOUT: %interface.7: = interface_witness (%Convert.13) [template] +// CHECK:STDOUT: %interface.21: = interface_witness (%Convert.13) [template] // CHECK:STDOUT: %Convert.bound.3: = bound_method %int_0.2, %Convert.13 [template] // CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.3(%int_32) [template] // CHECK:STDOUT: %Convert.bound.4: = bound_method %int_1.1, %Convert.12 [template] @@ -93,7 +93,7 @@ var d: i32 = a.({.index = 1 as i32}.index); // CHECK:STDOUT: %.loc11_31.1: %tuple.type.3 = tuple_literal (%true, %int_34) // CHECK:STDOUT: %tuple.elem0.loc11: ref bool = tuple_access file.%a.var, element0 // CHECK:STDOUT: %.loc11_31.2: init bool = initialize_from %true to %tuple.elem0.loc11 [template = constants.%true] -// CHECK:STDOUT: %impl.elem0.loc11: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11: = bound_method %int_34, %impl.elem0.loc11 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc11: = specific_function %Convert.bound.loc11, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc11: init %i32 = call %Convert.specific_fn.loc11(%int_34) [template = constants.%int_34.2] @@ -116,13 +116,13 @@ var d: i32 = a.({.index = 1 as i32}.index); // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %int_32.loc13: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc13: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc13_20.1: %Convert.type.11 = interface_witness_access constants.%interface.6, element0 [template = constants.%Convert.12] +// CHECK:STDOUT: %impl.elem0.loc13_20.1: %Convert.type.11 = interface_witness_access constants.%interface.20, element0 [template = constants.%Convert.12] // CHECK:STDOUT: %Convert.bound.loc13_20.1: = bound_method %int_0, %impl.elem0.loc13_20.1 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc13_20.1: = specific_function %Convert.bound.loc13_20.1, @Convert.5(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc13_20.1: init %i32 = call %Convert.specific_fn.loc13_20.1(%int_0) [template = constants.%int_0.2] // CHECK:STDOUT: %.loc13_20.1: %i32 = value_of_initializer %int.convert_checked.loc13_20.1 [template = constants.%int_0.2] // CHECK:STDOUT: %.loc13_20.2: %i32 = converted %int_0, %.loc13_20.1 [template = constants.%int_0.2] -// CHECK:STDOUT: %impl.elem0.loc13_20.2: %Convert.type.5 = interface_witness_access constants.%interface.7, element0 [template = constants.%Convert.13] +// CHECK:STDOUT: %impl.elem0.loc13_20.2: %Convert.type.5 = interface_witness_access constants.%interface.21, element0 [template = constants.%Convert.13] // CHECK:STDOUT: %Convert.bound.loc13_20.2: = bound_method %.loc13_20.2, %impl.elem0.loc13_20.2 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc13_20.2: = specific_function %Convert.bound.loc13_20.2, @Convert.3(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc13_20.2: init Core.IntLiteral = call %Convert.specific_fn.loc13_20.2(%.loc13_20.2) [template = constants.%int_0.1] @@ -135,7 +135,7 @@ var d: i32 = a.({.index = 1 as i32}.index); // CHECK:STDOUT: %int_1.loc14: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_32.loc14: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc14_29: %Convert.type.11 = interface_witness_access constants.%interface.6, element0 [template = constants.%Convert.12] +// CHECK:STDOUT: %impl.elem0.loc14_29: %Convert.type.11 = interface_witness_access constants.%interface.20, element0 [template = constants.%Convert.12] // CHECK:STDOUT: %Convert.bound.loc14_29: = bound_method %int_1.loc14, %impl.elem0.loc14_29 [template = constants.%Convert.bound.4] // CHECK:STDOUT: %Convert.specific_fn.loc14_29: = specific_function %Convert.bound.loc14_29, @Convert.5(constants.%int_32) [template = constants.%Convert.specific_fn.4] // CHECK:STDOUT: %int.convert_checked.loc14_29: init %i32 = call %Convert.specific_fn.loc14_29(%int_1.loc14) [template = constants.%int_1.2] @@ -145,7 +145,7 @@ var d: i32 = a.({.index = 1 as i32}.index); // CHECK:STDOUT: %struct.loc14: %struct_type.index.2 = struct_value (%.loc14_29.2) [template = constants.%struct.2] // CHECK:STDOUT: %.loc14_35.2: %struct_type.index.2 = converted %.loc14_35.1, %struct.loc14 [template = constants.%struct.2] // CHECK:STDOUT: %.loc14_36.1: %i32 = struct_access %.loc14_35.2, element0 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc14_36: %Convert.type.5 = interface_witness_access constants.%interface.7, element0 [template = constants.%Convert.13] +// CHECK:STDOUT: %impl.elem0.loc14_36: %Convert.type.5 = interface_witness_access constants.%interface.21, element0 [template = constants.%Convert.13] // CHECK:STDOUT: %Convert.bound.loc14_36: = bound_method %.loc14_36.1, %impl.elem0.loc14_36 [template = constants.%Convert.bound.5] // CHECK:STDOUT: %Convert.specific_fn.loc14_36: = specific_function %Convert.bound.loc14_36, @Convert.3(constants.%int_32) [template = constants.%Convert.specific_fn.5] // CHECK:STDOUT: %int.convert_checked.loc14_36: init Core.IntLiteral = call %Convert.specific_fn.loc14_36(%.loc14_36.1) [template = constants.%int_1.1] diff --git a/toolchain/check/testdata/tuple/access/return_value_access.carbon b/toolchain/check/testdata/tuple/access/return_value_access.carbon index eeacb6305b0b5..7c14bf088c14c 100644 --- a/toolchain/check/testdata/tuple/access/return_value_access.carbon +++ b/toolchain/check/testdata/tuple/access/return_value_access.carbon @@ -28,7 +28,7 @@ fn Run() -> i32 { // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] @@ -81,7 +81,7 @@ fn Run() -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %.loc11_30.1: %tuple.type.3 = tuple_literal (%int_0) -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.2] diff --git a/toolchain/check/testdata/tuple/fail_element_type_mismatch.carbon b/toolchain/check/testdata/tuple/fail_element_type_mismatch.carbon index 4eddc80f95341..6a706f17546c4 100644 --- a/toolchain/check/testdata/tuple/fail_element_type_mismatch.carbon +++ b/toolchain/check/testdata/tuple/fail_element_type_mismatch.carbon @@ -28,7 +28,7 @@ var x: (i32, i32) = (2, 65.89); // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_2.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] @@ -58,7 +58,7 @@ var x: (i32, i32) = (2, 65.89); // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %float: f64 = float_literal 65.890000000000001 [template = constants.%float] // CHECK:STDOUT: %.loc17_30.1: %tuple.type.3 = tuple_literal (%int_2, %float) -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_2, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_2) [template = constants.%int_2.2] diff --git a/toolchain/check/testdata/tuple/import.carbon b/toolchain/check/testdata/tuple/import.carbon index 621d60e8b5211..be2025283c7a7 100644 --- a/toolchain/check/testdata/tuple/import.carbon +++ b/toolchain/check/testdata/tuple/import.carbon @@ -64,7 +64,7 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_0.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] @@ -149,13 +149,13 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %.loc9_18.1: %tuple.type.12 = tuple_literal (%int_1, %int_2) -// CHECK:STDOUT: %impl.elem0.loc9_18.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc9_18.1: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc9_18.1: = bound_method %int_1, %impl.elem0.loc9_18.1 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc9_18.1: = specific_function %Convert.bound.loc9_18.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc9_18.1: init %i32 = call %Convert.specific_fn.loc9_18.1(%int_1) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc9_18.2: %i32 = value_of_initializer %int.convert_checked.loc9_18.1 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc9_18.3: %i32 = converted %int_1, %.loc9_18.2 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc9_18.2: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc9_18.2: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc9_18.2: = bound_method %int_2, %impl.elem0.loc9_18.2 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc9_18.2: = specific_function %Convert.bound.loc9_18.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc9_18.2: init %i32 = call %Convert.specific_fn.loc9_18.2(%int_2) [template = constants.%int_2.2] @@ -190,7 +190,7 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_0.loc4: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] // CHECK:STDOUT: %.loc4_24.1: %tuple.type.3 = tuple_literal (%int_0.loc4) -// CHECK:STDOUT: %impl.elem0.loc4: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc4: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc4: = bound_method %int_0.loc4, %impl.elem0.loc4 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc4: = specific_function %Convert.bound.loc4, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc4: init %i32 = call %Convert.specific_fn.loc4(%int_0.loc4) [template = constants.%int_0.2] @@ -206,7 +206,7 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3.1] // CHECK:STDOUT: %.loc5_59.1: %tuple.type.12 = tuple_literal (%int_2, %int_3) // CHECK:STDOUT: %.loc5_60.1: %tuple.type.13 = tuple_literal (%.loc5_51.1, %.loc5_59.1) -// CHECK:STDOUT: %impl.elem0.loc5_47: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc5_47: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc5_47: = bound_method %int_0.loc5, %impl.elem0.loc5_47 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc5_47: = specific_function %Convert.bound.loc5_47, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc5_47: init %i32 = call %Convert.specific_fn.loc5_47(%int_0.loc5) [template = constants.%int_0.2] @@ -216,7 +216,7 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %.loc5_47.3: init %tuple.type.2 = tuple_init (%.loc5_47.2) to %tuple.elem0.loc5_51 [template = constants.%tuple.1] // CHECK:STDOUT: %.loc5_51.2: init %tuple.type.2 = converted %.loc5_47.1, %.loc5_47.3 [template = constants.%tuple.1] // CHECK:STDOUT: %.loc5_51.3: init %tuple.type.2 = initialize_from %.loc5_51.2 to %tuple.elem0.loc5_51 [template = constants.%tuple.1] -// CHECK:STDOUT: %impl.elem0.loc5_51: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc5_51: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc5_51: = bound_method %int_1, %impl.elem0.loc5_51 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc5_51: = specific_function %Convert.bound.loc5_51, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc5_51: init %i32 = call %Convert.specific_fn.loc5_51(%int_1) [template = constants.%int_1.2] @@ -225,7 +225,7 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %.loc5_51.5: init %i32 = initialize_from %.loc5_51.4 to %tuple.elem1.loc5_51 [template = constants.%int_1.2] // CHECK:STDOUT: %.loc5_51.6: init %tuple.type.7 = tuple_init (%.loc5_51.3, %.loc5_51.5) to %tuple.elem0.loc5_60 [template = constants.%tuple.2] // CHECK:STDOUT: %.loc5_60.2: init %tuple.type.7 = converted %.loc5_51.1, %.loc5_51.6 [template = constants.%tuple.2] -// CHECK:STDOUT: %impl.elem0.loc5_59.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc5_59.1: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc5_59.1: = bound_method %int_2, %impl.elem0.loc5_59.1 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc5_59.1: = specific_function %Convert.bound.loc5_59.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc5_59.1: init %i32 = call %Convert.specific_fn.loc5_59.1(%int_2) [template = constants.%int_2.2] @@ -233,7 +233,7 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %tuple.elem1.loc5_60: ref %tuple.type.8 = tuple_access file.%b_ref.var, element1 // CHECK:STDOUT: %tuple.elem0.loc5_59: ref %i32 = tuple_access %tuple.elem1.loc5_60, element0 // CHECK:STDOUT: %.loc5_59.3: init %i32 = initialize_from %.loc5_59.2 to %tuple.elem0.loc5_59 [template = constants.%int_2.2] -// CHECK:STDOUT: %impl.elem0.loc5_59.2: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc5_59.2: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc5_59.2: = bound_method %int_3, %impl.elem0.loc5_59.2 [template = constants.%Convert.bound.4] // CHECK:STDOUT: %Convert.specific_fn.loc5_59.2: = specific_function %Convert.bound.loc5_59.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.4] // CHECK:STDOUT: %int.convert_checked.loc5_59.2: init %i32 = call %Convert.specific_fn.loc5_59.2(%int_3) [template = constants.%int_3.2] @@ -293,7 +293,7 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.195: = import_ref Implicit//default, loc7_26, loaded [template = constants.%complete_type.3] -// CHECK:STDOUT: %import_ref.196 = import_ref Implicit//default, inst638 [no loc], unloaded +// CHECK:STDOUT: %import_ref.196 = import_ref Implicit//default, inst980 [no loc], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -421,7 +421,7 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.194: = import_ref Implicit//default, loc7_26, loaded [template = constants.%complete_type.3] -// CHECK:STDOUT: %import_ref.195 = import_ref Implicit//default, inst638 [no loc], unloaded +// CHECK:STDOUT: %import_ref.195 = import_ref Implicit//default, inst980 [no loc], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -511,7 +511,7 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.194: = import_ref Implicit//default, loc7_26, loaded [template = constants.%complete_type.3] -// CHECK:STDOUT: %import_ref.195 = import_ref Implicit//default, inst638 [no loc], unloaded +// CHECK:STDOUT: %import_ref.195 = import_ref Implicit//default, inst980 [no loc], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/tuple/nested_tuple.carbon b/toolchain/check/testdata/tuple/nested_tuple.carbon index 329883656d7e5..967f492937712 100644 --- a/toolchain/check/testdata/tuple/nested_tuple.carbon +++ b/toolchain/check/testdata/tuple/nested_tuple.carbon @@ -25,7 +25,7 @@ var x: ((i32, i32), i32) = ((12, 76), 6); // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_12.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_12.2: %i32 = int_value 12 [template] @@ -65,7 +65,7 @@ var x: ((i32, i32), i32) = ((12, 76), 6); // CHECK:STDOUT: %.loc11_36.1: %tuple.type.6 = tuple_literal (%int_12, %int_76) // CHECK:STDOUT: %int_6: Core.IntLiteral = int_value 6 [template = constants.%int_6.1] // CHECK:STDOUT: %.loc11_40.1: %tuple.type.7 = tuple_literal (%.loc11_36.1, %int_6) -// CHECK:STDOUT: %impl.elem0.loc11_36.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11_36.1: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_36.1: = bound_method %int_12, %impl.elem0.loc11_36.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc11_36.1: = specific_function %Convert.bound.loc11_36.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc11_36.1: init %i32 = call %Convert.specific_fn.loc11_36.1(%int_12) [template = constants.%int_12.2] @@ -73,7 +73,7 @@ var x: ((i32, i32), i32) = ((12, 76), 6); // CHECK:STDOUT: %tuple.elem0.loc11_40: ref %tuple.type.3 = tuple_access file.%x.var, element0 // CHECK:STDOUT: %tuple.elem0.loc11_36: ref %i32 = tuple_access %tuple.elem0.loc11_40, element0 // CHECK:STDOUT: %.loc11_36.3: init %i32 = initialize_from %.loc11_36.2 to %tuple.elem0.loc11_36 [template = constants.%int_12.2] -// CHECK:STDOUT: %impl.elem0.loc11_36.2: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11_36.2: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_36.2: = bound_method %int_76, %impl.elem0.loc11_36.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc11_36.2: = specific_function %Convert.bound.loc11_36.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc11_36.2: init %i32 = call %Convert.specific_fn.loc11_36.2(%int_76) [template = constants.%int_76.2] @@ -82,7 +82,7 @@ var x: ((i32, i32), i32) = ((12, 76), 6); // CHECK:STDOUT: %.loc11_36.5: init %i32 = initialize_from %.loc11_36.4 to %tuple.elem1.loc11_36 [template = constants.%int_76.2] // CHECK:STDOUT: %.loc11_36.6: init %tuple.type.3 = tuple_init (%.loc11_36.3, %.loc11_36.5) to %tuple.elem0.loc11_40 [template = constants.%tuple.1] // CHECK:STDOUT: %.loc11_40.2: init %tuple.type.3 = converted %.loc11_36.1, %.loc11_36.6 [template = constants.%tuple.1] -// CHECK:STDOUT: %impl.elem0.loc11_40: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11_40: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_40: = bound_method %int_6, %impl.elem0.loc11_40 [template = constants.%Convert.bound.3] // CHECK:STDOUT: %Convert.specific_fn.loc11_40: = specific_function %Convert.bound.loc11_40, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] // CHECK:STDOUT: %int.convert_checked.loc11_40: init %i32 = call %Convert.specific_fn.loc11_40(%int_6) [template = constants.%int_6.2] diff --git a/toolchain/check/testdata/tuple/nested_tuple_in_place.carbon b/toolchain/check/testdata/tuple/nested_tuple_in_place.carbon index 7cdbaa3cde80b..3ab706e3ac193 100644 --- a/toolchain/check/testdata/tuple/nested_tuple_in_place.carbon +++ b/toolchain/check/testdata/tuple/nested_tuple_in_place.carbon @@ -39,7 +39,7 @@ fn H() { // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] @@ -113,14 +113,14 @@ fn H() { // CHECK:STDOUT: %F.call: init %tuple.type.2 = call %F.ref() to %tuple.elem1 // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] // CHECK:STDOUT: %.loc18_50.1: %tuple.type.9 = tuple_literal (%int_1, %F.call, %int_2) -// CHECK:STDOUT: %impl.elem0.loc18_50.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc18_50.1: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc18_50.1: = bound_method %int_1, %impl.elem0.loc18_50.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc18_50.1: = specific_function %Convert.bound.loc18_50.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc18_50.1: init %i32 = call %Convert.specific_fn.loc18_50.1(%int_1) [template = constants.%int_1.2] // CHECK:STDOUT: %.loc18_50.2: init %i32 = converted %int_1, %int.convert_checked.loc18_50.1 [template = constants.%int_1.2] // CHECK:STDOUT: %tuple.elem0: ref %i32 = tuple_access %v.var, element0 // CHECK:STDOUT: %.loc18_50.3: init %i32 = initialize_from %.loc18_50.2 to %tuple.elem0 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc18_50.2: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc18_50.2: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc18_50.2: = bound_method %int_2, %impl.elem0.loc18_50.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc18_50.2: = specific_function %Convert.bound.loc18_50.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc18_50.2: init %i32 = call %Convert.specific_fn.loc18_50.2(%int_2) [template = constants.%int_2.2] diff --git a/toolchain/check/testdata/tuple/one_element.carbon b/toolchain/check/testdata/tuple/one_element.carbon index 18bec3632c133..252016c7bbbfc 100644 --- a/toolchain/check/testdata/tuple/one_element.carbon +++ b/toolchain/check/testdata/tuple/one_element.carbon @@ -22,7 +22,7 @@ var y: (i32,) = x; // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound: = bound_method %int_4.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_4.2: %i32 = int_value 4 [template] @@ -55,7 +55,7 @@ var y: (i32,) = x; // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [template = constants.%int_4.1] // CHECK:STDOUT: %.loc11_20.1: %tuple.type.3 = tuple_literal (%int_4) -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound: = bound_method %int_4, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_4) [template = constants.%int_4.2] diff --git a/toolchain/check/testdata/tuple/two_elements.carbon b/toolchain/check/testdata/tuple/two_elements.carbon index a17a81c3b62bc..038319041f6d4 100644 --- a/toolchain/check/testdata/tuple/two_elements.carbon +++ b/toolchain/check/testdata/tuple/two_elements.carbon @@ -26,7 +26,7 @@ var y: (i32, i32) = x; // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.5: = interface_witness (%Convert.10) [template] +// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] // CHECK:STDOUT: %Convert.bound.1: = bound_method %int_4.1, %Convert.10 [template] // CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] // CHECK:STDOUT: %int_4.2: %i32 = int_value 4 [template] @@ -65,13 +65,13 @@ var y: (i32, i32) = x; // CHECK:STDOUT: %int_4.loc11: Core.IntLiteral = int_value 4 [template = constants.%int_4.1] // CHECK:STDOUT: %int_102.loc11: Core.IntLiteral = int_value 102 [template = constants.%int_102.1] // CHECK:STDOUT: %.loc11_28.1: %tuple.type.3 = tuple_literal (%int_4.loc11, %int_102.loc11) -// CHECK:STDOUT: %impl.elem0.loc11_28.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11_28.1: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_28.1: = bound_method %int_4.loc11, %impl.elem0.loc11_28.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc11_28.1: = specific_function %Convert.bound.loc11_28.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc11_28.1: init %i32 = call %Convert.specific_fn.loc11_28.1(%int_4.loc11) [template = constants.%int_4.2] // CHECK:STDOUT: %.loc11_28.2: %i32 = value_of_initializer %int.convert_checked.loc11_28.1 [template = constants.%int_4.2] // CHECK:STDOUT: %.loc11_28.3: %i32 = converted %int_4.loc11, %.loc11_28.2 [template = constants.%int_4.2] -// CHECK:STDOUT: %impl.elem0.loc11_28.2: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc11_28.2: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc11_28.2: = bound_method %int_102.loc11, %impl.elem0.loc11_28.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc11_28.2: = specific_function %Convert.bound.loc11_28.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc11_28.2: init %i32 = call %Convert.specific_fn.loc11_28.2(%int_102.loc11) [template = constants.%int_102.2] @@ -85,14 +85,14 @@ var y: (i32, i32) = x; // CHECK:STDOUT: %int_4.loc14: Core.IntLiteral = int_value 4 [template = constants.%int_4.1] // CHECK:STDOUT: %int_102.loc14: Core.IntLiteral = int_value 102 [template = constants.%int_102.1] // CHECK:STDOUT: %.loc14_28.1: %tuple.type.3 = tuple_literal (%int_4.loc14, %int_102.loc14) -// CHECK:STDOUT: %impl.elem0.loc14_28.1: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc14_28.1: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc14_28.1: = bound_method %int_4.loc14, %impl.elem0.loc14_28.1 [template = constants.%Convert.bound.1] // CHECK:STDOUT: %Convert.specific_fn.loc14_28.1: = specific_function %Convert.bound.loc14_28.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] // CHECK:STDOUT: %int.convert_checked.loc14_28.1: init %i32 = call %Convert.specific_fn.loc14_28.1(%int_4.loc14) [template = constants.%int_4.2] // CHECK:STDOUT: %.loc14_28.2: init %i32 = converted %int_4.loc14, %int.convert_checked.loc14_28.1 [template = constants.%int_4.2] // CHECK:STDOUT: %tuple.elem0.loc14: ref %i32 = tuple_access file.%x.var, element0 // CHECK:STDOUT: %.loc14_28.3: init %i32 = initialize_from %.loc14_28.2 to %tuple.elem0.loc14 [template = constants.%int_4.2] -// CHECK:STDOUT: %impl.elem0.loc14_28.2: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10] +// CHECK:STDOUT: %impl.elem0.loc14_28.2: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] // CHECK:STDOUT: %Convert.bound.loc14_28.2: = bound_method %int_102.loc14, %impl.elem0.loc14_28.2 [template = constants.%Convert.bound.2] // CHECK:STDOUT: %Convert.specific_fn.loc14_28.2: = specific_function %Convert.bound.loc14_28.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] // CHECK:STDOUT: %int.convert_checked.loc14_28.2: init %i32 = call %Convert.specific_fn.loc14_28.2(%int_102.loc14) [template = constants.%int_102.2] diff --git a/toolchain/lower/testdata/function/generic/call.carbon b/toolchain/lower/testdata/function/generic/call.carbon index d6d39409ac43b..46b827f525474 100644 --- a/toolchain/lower/testdata/function/generic/call.carbon +++ b/toolchain/lower/testdata/function/generic/call.carbon @@ -44,11 +44,11 @@ fn G() { // CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %d.var, ptr align 1 @D.val.loc19_16, i64 0, i1 false), !dbg !9 // CHECK:STDOUT: call void @llvm.lifetime.start.p0(i64 4, ptr %n.var), !dbg !7 // CHECK:STDOUT: store i32 0, ptr %n.var, align 4, !dbg !10 -// CHECK:STDOUT: call void @_CF.Main.40(ptr %c.var), !dbg !11 -// CHECK:STDOUT: call void @_CF.Main.41(ptr %d.var), !dbg !12 +// CHECK:STDOUT: call void @_CF.Main.118(ptr %c.var), !dbg !11 +// CHECK:STDOUT: call void @_CF.Main.119(ptr %d.var), !dbg !12 // CHECK:STDOUT: %.loc24 = load i32, ptr %n.var, align 4, !dbg !13 -// CHECK:STDOUT: call void @_CF.Main.42(i32 %.loc24), !dbg !14 -// CHECK:STDOUT: call void @_CF.Main.43(%type zeroinitializer), !dbg !15 +// CHECK:STDOUT: call void @_CF.Main.120(i32 %.loc24), !dbg !14 +// CHECK:STDOUT: call void @_CF.Main.121(%type zeroinitializer), !dbg !15 // CHECK:STDOUT: ret void, !dbg !16 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -58,13 +58,13 @@ fn G() { // CHECK:STDOUT: ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) // CHECK:STDOUT: declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1 // CHECK:STDOUT: -// CHECK:STDOUT: declare void @_CF.Main.40(ptr) +// CHECK:STDOUT: declare void @_CF.Main.118(ptr) // CHECK:STDOUT: -// CHECK:STDOUT: declare void @_CF.Main.41(ptr) +// CHECK:STDOUT: declare void @_CF.Main.119(ptr) // CHECK:STDOUT: -// CHECK:STDOUT: declare void @_CF.Main.42(i32) +// CHECK:STDOUT: declare void @_CF.Main.120(i32) // CHECK:STDOUT: -// CHECK:STDOUT: declare void @_CF.Main.43(%type) +// CHECK:STDOUT: declare void @_CF.Main.121(%type) // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives // CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 2, 1, 0 } diff --git a/toolchain/lower/testdata/function/generic/call_method.carbon b/toolchain/lower/testdata/function/generic/call_method.carbon index f8cd4c132ecd3..9dcd371b8628e 100644 --- a/toolchain/lower/testdata/function/generic/call_method.carbon +++ b/toolchain/lower/testdata/function/generic/call_method.carbon @@ -34,7 +34,7 @@ fn CallF() -> i32 { // CHECK:STDOUT: call void @llvm.lifetime.start.p0(i64 4, ptr %n.var), !dbg !7 // CHECK:STDOUT: store i32 0, ptr %n.var, align 4, !dbg !9 // CHECK:STDOUT: %.loc20_14 = load i32, ptr %n.var, align 4, !dbg !10 -// CHECK:STDOUT: %F.call = call i32 @_CF.C.Main.40(ptr %c.var, i32 %.loc20_14), !dbg !11 +// CHECK:STDOUT: %F.call = call i32 @_CF.C.Main.118(ptr %c.var, i32 %.loc20_14), !dbg !11 // CHECK:STDOUT: ret i32 %F.call, !dbg !12 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -44,7 +44,7 @@ fn CallF() -> i32 { // CHECK:STDOUT: ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) // CHECK:STDOUT: declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1 // CHECK:STDOUT: -// CHECK:STDOUT: declare i32 @_CF.C.Main.40(ptr, i32) +// CHECK:STDOUT: declare i32 @_CF.C.Main.118(ptr, i32) // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives // CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 1, 0 } From 85ea848879eb7c39e5a54696eb90305263bbaf84 Mon Sep 17 00:00:00 2001 From: josh11b <15258583+josh11b@users.noreply.github.com> Date: Thu, 19 Dec 2024 16:31:38 -0800 Subject: [PATCH 63/68] Fix syntactic match of impl decl to definition (#4709) Co-authored-by: Josh L --- toolchain/check/handle_impl.cpp | 10 +- .../no_prelude/generic_redeclaration.carbon | 226 +++++++----------- .../check/testdata/impl/redeclaration.carbon | 16 +- 3 files changed, 101 insertions(+), 151 deletions(-) diff --git a/toolchain/check/handle_impl.cpp b/toolchain/check/handle_impl.cpp index 33ebb26de0999..edae4e39bc362 100644 --- a/toolchain/check/handle_impl.cpp +++ b/toolchain/check/handle_impl.cpp @@ -217,7 +217,15 @@ static auto PopImplIntroducerAndParamsAsNameComponent( Parse::NodeId first_param_node_id = context.node_stack().PopForSoloNodeId(); - Parse::NodeId last_param_node_id = end_of_decl_node_id; + // Subtracting 1 since we don't want to include the final `{` or `;` of the + // declaration when performing syntactic match. + // TODO: Following proposal #3763, we should exclude any `where` clause, and + // add `Self` before `as` if needed, see: + // https://github.com/carbon-language/carbon-lang/blob/trunk/proposals/p3763.md#redeclarations + auto node_kind = context.parse_tree().node_kind(end_of_decl_node_id); + CARBON_CHECK(node_kind == Parse::NodeKind::ImplDefinitionStart || + node_kind == Parse::NodeKind::ImplDecl); + Parse::NodeId last_param_node_id(end_of_decl_node_id.index - 1); return { .name_loc_id = Parse::NodeId::Invalid, diff --git a/toolchain/check/testdata/impl/no_prelude/generic_redeclaration.carbon b/toolchain/check/testdata/impl/no_prelude/generic_redeclaration.carbon index 1a8b9bde0ce49..dce411f353de4 100644 --- a/toolchain/check/testdata/impl/no_prelude/generic_redeclaration.carbon +++ b/toolchain/check/testdata/impl/no_prelude/generic_redeclaration.carbon @@ -24,7 +24,7 @@ impl forall [T:! J] T as Interface; impl forall [T:! K] T as Interface; impl forall [T:! L] T as Interface; -// These are two different impls, so this is not a redefinition, even though the +// These are different impls, so they are not redefinitions, even though the // self type and constraint type are the same. impl forall [T:! I] T as Interface {} impl forall [T:! J] T as Interface {} @@ -108,97 +108,97 @@ impl (C, C).0 as I {} // CHECK:STDOUT: %T.patt.loc11_14.1: %I.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc11_14.2 (constants.%T.patt.1)] // CHECK:STDOUT: %T.param_patt: %I.type = value_param_pattern %T.patt.loc11_14.1, runtime_param [symbolic = %T.patt.loc11_14.2 (constants.%T.patt.1)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.ref: %I.type = name_ref T, %T.loc11_14.1 [symbolic = %T.loc11_14.2 (constants.%T.1)] -// CHECK:STDOUT: %T.as_type.loc11_21.1: type = facet_access_type %T.ref [symbolic = %T.as_type.loc11_21.2 (constants.%T.as_type.1)] -// CHECK:STDOUT: %.loc11: type = converted %T.ref, %T.as_type.loc11_21.1 [symbolic = %T.as_type.loc11_21.2 (constants.%T.as_type.1)] -// CHECK:STDOUT: %Interface.ref: type = name_ref Interface, file.%Interface.decl [template = constants.%Interface.type] -// CHECK:STDOUT: %T.param: %I.type = value_param runtime_param -// CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%I.type] -// CHECK:STDOUT: %T.loc11_14.1: %I.type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc11_14.2 (constants.%T.1)] +// CHECK:STDOUT: %T.ref.loc11: %I.type = name_ref T, %T.loc11_14.1 [symbolic = %T.loc11_14.2 (constants.%T.1)] +// CHECK:STDOUT: %T.as_type.loc11_21.1: type = facet_access_type %T.ref.loc11 [symbolic = %T.as_type.loc11_21.2 (constants.%T.as_type.1)] +// CHECK:STDOUT: %.loc11: type = converted %T.ref.loc11, %T.as_type.loc11_21.1 [symbolic = %T.as_type.loc11_21.2 (constants.%T.as_type.1)] +// CHECK:STDOUT: %Interface.ref.loc11: type = name_ref Interface, file.%Interface.decl [template = constants.%Interface.type] +// CHECK:STDOUT: %T.param.loc11: %I.type = value_param runtime_param +// CHECK:STDOUT: %I.ref.loc11: type = name_ref I, file.%I.decl [template = constants.%I.type] +// CHECK:STDOUT: %T.loc11_14.1: %I.type = bind_symbolic_name T, 0, %T.param.loc11 [symbolic = %T.loc11_14.2 (constants.%T.1)] // CHECK:STDOUT: } // CHECK:STDOUT: impl_decl @impl.2 [template] { // CHECK:STDOUT: %T.patt.loc12_14.1: %J.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc12_14.2 (constants.%T.patt.2)] // CHECK:STDOUT: %T.param_patt: %J.type = value_param_pattern %T.patt.loc12_14.1, runtime_param [symbolic = %T.patt.loc12_14.2 (constants.%T.patt.2)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.ref: %J.type = name_ref T, %T.loc12_14.1 [symbolic = %T.loc12_14.2 (constants.%T.2)] -// CHECK:STDOUT: %T.as_type.loc12_21.1: type = facet_access_type %T.ref [symbolic = %T.as_type.loc12_21.2 (constants.%T.as_type.2)] -// CHECK:STDOUT: %.loc12: type = converted %T.ref, %T.as_type.loc12_21.1 [symbolic = %T.as_type.loc12_21.2 (constants.%T.as_type.2)] -// CHECK:STDOUT: %Interface.ref: type = name_ref Interface, file.%Interface.decl [template = constants.%Interface.type] -// CHECK:STDOUT: %T.param: %J.type = value_param runtime_param -// CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [template = constants.%J.type] -// CHECK:STDOUT: %T.loc12_14.1: %J.type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc12_14.2 (constants.%T.2)] +// CHECK:STDOUT: %T.ref.loc12: %J.type = name_ref T, %T.loc12_14.1 [symbolic = %T.loc12_14.2 (constants.%T.2)] +// CHECK:STDOUT: %T.as_type.loc12_21.1: type = facet_access_type %T.ref.loc12 [symbolic = %T.as_type.loc12_21.2 (constants.%T.as_type.2)] +// CHECK:STDOUT: %.loc12: type = converted %T.ref.loc12, %T.as_type.loc12_21.1 [symbolic = %T.as_type.loc12_21.2 (constants.%T.as_type.2)] +// CHECK:STDOUT: %Interface.ref.loc12: type = name_ref Interface, file.%Interface.decl [template = constants.%Interface.type] +// CHECK:STDOUT: %T.param.loc12: %J.type = value_param runtime_param +// CHECK:STDOUT: %J.ref.loc12: type = name_ref J, file.%J.decl [template = constants.%J.type] +// CHECK:STDOUT: %T.loc12_14.1: %J.type = bind_symbolic_name T, 0, %T.param.loc12 [symbolic = %T.loc12_14.2 (constants.%T.2)] // CHECK:STDOUT: } // CHECK:STDOUT: impl_decl @impl.3 [template] { // CHECK:STDOUT: %T.patt.loc13_14.1: %K.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc13_14.2 (constants.%T.patt.3)] // CHECK:STDOUT: %T.param_patt: %K.type = value_param_pattern %T.patt.loc13_14.1, runtime_param [symbolic = %T.patt.loc13_14.2 (constants.%T.patt.3)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.ref: %K.type = name_ref T, %T.loc13_14.1 [symbolic = %T.loc13_14.2 (constants.%T.3)] -// CHECK:STDOUT: %T.as_type.loc13_21.1: type = facet_access_type %T.ref [symbolic = %T.as_type.loc13_21.2 (constants.%T.as_type.3)] -// CHECK:STDOUT: %.loc13: type = converted %T.ref, %T.as_type.loc13_21.1 [symbolic = %T.as_type.loc13_21.2 (constants.%T.as_type.3)] -// CHECK:STDOUT: %Interface.ref: type = name_ref Interface, file.%Interface.decl [template = constants.%Interface.type] -// CHECK:STDOUT: %T.param: %K.type = value_param runtime_param -// CHECK:STDOUT: %K.ref: type = name_ref K, file.%K.decl [template = constants.%K.type] -// CHECK:STDOUT: %T.loc13_14.1: %K.type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc13_14.2 (constants.%T.3)] +// CHECK:STDOUT: %T.ref.loc13: %K.type = name_ref T, %T.loc13_14.1 [symbolic = %T.loc13_14.2 (constants.%T.3)] +// CHECK:STDOUT: %T.as_type.loc13_21.1: type = facet_access_type %T.ref.loc13 [symbolic = %T.as_type.loc13_21.2 (constants.%T.as_type.3)] +// CHECK:STDOUT: %.loc13: type = converted %T.ref.loc13, %T.as_type.loc13_21.1 [symbolic = %T.as_type.loc13_21.2 (constants.%T.as_type.3)] +// CHECK:STDOUT: %Interface.ref.loc13: type = name_ref Interface, file.%Interface.decl [template = constants.%Interface.type] +// CHECK:STDOUT: %T.param.loc13: %K.type = value_param runtime_param +// CHECK:STDOUT: %K.ref.loc13: type = name_ref K, file.%K.decl [template = constants.%K.type] +// CHECK:STDOUT: %T.loc13_14.1: %K.type = bind_symbolic_name T, 0, %T.param.loc13 [symbolic = %T.loc13_14.2 (constants.%T.3)] // CHECK:STDOUT: } // CHECK:STDOUT: impl_decl @impl.4 [template] { // CHECK:STDOUT: %T.patt.loc14_14.1: %L.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc14_14.2 (constants.%T.patt.4)] // CHECK:STDOUT: %T.param_patt: %L.type = value_param_pattern %T.patt.loc14_14.1, runtime_param [symbolic = %T.patt.loc14_14.2 (constants.%T.patt.4)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.ref: %L.type = name_ref T, %T.loc14_14.1 [symbolic = %T.loc14_14.2 (constants.%T.4)] -// CHECK:STDOUT: %T.as_type.loc14_21.1: type = facet_access_type %T.ref [symbolic = %T.as_type.loc14_21.2 (constants.%T.as_type.4)] -// CHECK:STDOUT: %.loc14: type = converted %T.ref, %T.as_type.loc14_21.1 [symbolic = %T.as_type.loc14_21.2 (constants.%T.as_type.4)] -// CHECK:STDOUT: %Interface.ref: type = name_ref Interface, file.%Interface.decl [template = constants.%Interface.type] -// CHECK:STDOUT: %T.param: %L.type = value_param runtime_param -// CHECK:STDOUT: %L.ref: type = name_ref L, file.%L.decl [template = constants.%L.type] -// CHECK:STDOUT: %T.loc14_14.1: %L.type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc14_14.2 (constants.%T.4)] +// CHECK:STDOUT: %T.ref.loc14: %L.type = name_ref T, %T.loc14_14.1 [symbolic = %T.loc14_14.2 (constants.%T.4)] +// CHECK:STDOUT: %T.as_type.loc14_21.1: type = facet_access_type %T.ref.loc14 [symbolic = %T.as_type.loc14_21.2 (constants.%T.as_type.4)] +// CHECK:STDOUT: %.loc14: type = converted %T.ref.loc14, %T.as_type.loc14_21.1 [symbolic = %T.as_type.loc14_21.2 (constants.%T.as_type.4)] +// CHECK:STDOUT: %Interface.ref.loc14: type = name_ref Interface, file.%Interface.decl [template = constants.%Interface.type] +// CHECK:STDOUT: %T.param.loc14: %L.type = value_param runtime_param +// CHECK:STDOUT: %L.ref.loc14: type = name_ref L, file.%L.decl [template = constants.%L.type] +// CHECK:STDOUT: %T.loc14_14.1: %L.type = bind_symbolic_name T, 0, %T.param.loc14 [symbolic = %T.loc14_14.2 (constants.%T.4)] // CHECK:STDOUT: } -// CHECK:STDOUT: impl_decl @impl.5 [template] { -// CHECK:STDOUT: %T.patt.loc18_14.1: %I.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc18_14.2 (constants.%T.patt.1)] -// CHECK:STDOUT: %T.param_patt: %I.type = value_param_pattern %T.patt.loc18_14.1, runtime_param [symbolic = %T.patt.loc18_14.2 (constants.%T.patt.1)] +// CHECK:STDOUT: impl_decl @impl.1 [template] { +// CHECK:STDOUT: %T.patt.loc11_14.1: %I.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc11_14.2 (constants.%T.patt.1)] +// CHECK:STDOUT: %T.param_patt: %I.type = value_param_pattern %T.patt.loc11_14.1, runtime_param [symbolic = %T.patt.loc11_14.2 (constants.%T.patt.1)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.ref: %I.type = name_ref T, %T.loc18_14.1 [symbolic = %T.loc18_14.2 (constants.%T.1)] -// CHECK:STDOUT: %T.as_type.loc18_21.1: type = facet_access_type %T.ref [symbolic = %T.as_type.loc18_21.2 (constants.%T.as_type.1)] -// CHECK:STDOUT: %.loc18: type = converted %T.ref, %T.as_type.loc18_21.1 [symbolic = %T.as_type.loc18_21.2 (constants.%T.as_type.1)] -// CHECK:STDOUT: %Interface.ref: type = name_ref Interface, file.%Interface.decl [template = constants.%Interface.type] -// CHECK:STDOUT: %T.param: %I.type = value_param runtime_param -// CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%I.type] -// CHECK:STDOUT: %T.loc18_14.1: %I.type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc18_14.2 (constants.%T.1)] +// CHECK:STDOUT: %T.ref.loc18: %I.type = name_ref T, %T.loc18 [symbolic = constants.%T.1] +// CHECK:STDOUT: %T.as_type.loc18: type = facet_access_type %T.ref.loc18 [symbolic = constants.%T.as_type.1] +// CHECK:STDOUT: %.loc18: type = converted %T.ref.loc18, %T.as_type.loc18 [symbolic = constants.%T.as_type.1] +// CHECK:STDOUT: %Interface.ref.loc18: type = name_ref Interface, file.%Interface.decl [template = constants.%Interface.type] +// CHECK:STDOUT: %T.param.loc18: %I.type = value_param runtime_param +// CHECK:STDOUT: %I.ref.loc18: type = name_ref I, file.%I.decl [template = constants.%I.type] +// CHECK:STDOUT: %T.loc18: %I.type = bind_symbolic_name T, 0, %T.param.loc18 [symbolic = constants.%T.1] // CHECK:STDOUT: } -// CHECK:STDOUT: impl_decl @impl.6 [template] { -// CHECK:STDOUT: %T.patt.loc19_14.1: %J.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc19_14.2 (constants.%T.patt.2)] -// CHECK:STDOUT: %T.param_patt: %J.type = value_param_pattern %T.patt.loc19_14.1, runtime_param [symbolic = %T.patt.loc19_14.2 (constants.%T.patt.2)] +// CHECK:STDOUT: impl_decl @impl.2 [template] { +// CHECK:STDOUT: %T.patt.loc12_14.1: %J.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc12_14.2 (constants.%T.patt.2)] +// CHECK:STDOUT: %T.param_patt: %J.type = value_param_pattern %T.patt.loc12_14.1, runtime_param [symbolic = %T.patt.loc12_14.2 (constants.%T.patt.2)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.ref: %J.type = name_ref T, %T.loc19_14.1 [symbolic = %T.loc19_14.2 (constants.%T.2)] -// CHECK:STDOUT: %T.as_type.loc19_21.1: type = facet_access_type %T.ref [symbolic = %T.as_type.loc19_21.2 (constants.%T.as_type.2)] -// CHECK:STDOUT: %.loc19: type = converted %T.ref, %T.as_type.loc19_21.1 [symbolic = %T.as_type.loc19_21.2 (constants.%T.as_type.2)] -// CHECK:STDOUT: %Interface.ref: type = name_ref Interface, file.%Interface.decl [template = constants.%Interface.type] -// CHECK:STDOUT: %T.param: %J.type = value_param runtime_param -// CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [template = constants.%J.type] -// CHECK:STDOUT: %T.loc19_14.1: %J.type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc19_14.2 (constants.%T.2)] +// CHECK:STDOUT: %T.ref.loc19: %J.type = name_ref T, %T.loc19 [symbolic = constants.%T.2] +// CHECK:STDOUT: %T.as_type.loc19: type = facet_access_type %T.ref.loc19 [symbolic = constants.%T.as_type.2] +// CHECK:STDOUT: %.loc19: type = converted %T.ref.loc19, %T.as_type.loc19 [symbolic = constants.%T.as_type.2] +// CHECK:STDOUT: %Interface.ref.loc19: type = name_ref Interface, file.%Interface.decl [template = constants.%Interface.type] +// CHECK:STDOUT: %T.param.loc19: %J.type = value_param runtime_param +// CHECK:STDOUT: %J.ref.loc19: type = name_ref J, file.%J.decl [template = constants.%J.type] +// CHECK:STDOUT: %T.loc19: %J.type = bind_symbolic_name T, 0, %T.param.loc19 [symbolic = constants.%T.2] // CHECK:STDOUT: } -// CHECK:STDOUT: impl_decl @impl.7 [template] { -// CHECK:STDOUT: %T.patt.loc20_14.1: %K.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc20_14.2 (constants.%T.patt.3)] -// CHECK:STDOUT: %T.param_patt: %K.type = value_param_pattern %T.patt.loc20_14.1, runtime_param [symbolic = %T.patt.loc20_14.2 (constants.%T.patt.3)] +// CHECK:STDOUT: impl_decl @impl.3 [template] { +// CHECK:STDOUT: %T.patt.loc13_14.1: %K.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc13_14.2 (constants.%T.patt.3)] +// CHECK:STDOUT: %T.param_patt: %K.type = value_param_pattern %T.patt.loc13_14.1, runtime_param [symbolic = %T.patt.loc13_14.2 (constants.%T.patt.3)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.ref: %K.type = name_ref T, %T.loc20_14.1 [symbolic = %T.loc20_14.2 (constants.%T.3)] -// CHECK:STDOUT: %T.as_type.loc20_21.1: type = facet_access_type %T.ref [symbolic = %T.as_type.loc20_21.2 (constants.%T.as_type.3)] -// CHECK:STDOUT: %.loc20: type = converted %T.ref, %T.as_type.loc20_21.1 [symbolic = %T.as_type.loc20_21.2 (constants.%T.as_type.3)] -// CHECK:STDOUT: %Interface.ref: type = name_ref Interface, file.%Interface.decl [template = constants.%Interface.type] -// CHECK:STDOUT: %T.param: %K.type = value_param runtime_param -// CHECK:STDOUT: %K.ref: type = name_ref K, file.%K.decl [template = constants.%K.type] -// CHECK:STDOUT: %T.loc20_14.1: %K.type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc20_14.2 (constants.%T.3)] +// CHECK:STDOUT: %T.ref.loc20: %K.type = name_ref T, %T.loc20 [symbolic = constants.%T.3] +// CHECK:STDOUT: %T.as_type.loc20: type = facet_access_type %T.ref.loc20 [symbolic = constants.%T.as_type.3] +// CHECK:STDOUT: %.loc20: type = converted %T.ref.loc20, %T.as_type.loc20 [symbolic = constants.%T.as_type.3] +// CHECK:STDOUT: %Interface.ref.loc20: type = name_ref Interface, file.%Interface.decl [template = constants.%Interface.type] +// CHECK:STDOUT: %T.param.loc20: %K.type = value_param runtime_param +// CHECK:STDOUT: %K.ref.loc20: type = name_ref K, file.%K.decl [template = constants.%K.type] +// CHECK:STDOUT: %T.loc20: %K.type = bind_symbolic_name T, 0, %T.param.loc20 [symbolic = constants.%T.3] // CHECK:STDOUT: } -// CHECK:STDOUT: impl_decl @impl.8 [template] { -// CHECK:STDOUT: %T.patt.loc21_14.1: %L.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc21_14.2 (constants.%T.patt.4)] -// CHECK:STDOUT: %T.param_patt: %L.type = value_param_pattern %T.patt.loc21_14.1, runtime_param [symbolic = %T.patt.loc21_14.2 (constants.%T.patt.4)] +// CHECK:STDOUT: impl_decl @impl.4 [template] { +// CHECK:STDOUT: %T.patt.loc14_14.1: %L.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc14_14.2 (constants.%T.patt.4)] +// CHECK:STDOUT: %T.param_patt: %L.type = value_param_pattern %T.patt.loc14_14.1, runtime_param [symbolic = %T.patt.loc14_14.2 (constants.%T.patt.4)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.ref: %L.type = name_ref T, %T.loc21_14.1 [symbolic = %T.loc21_14.2 (constants.%T.4)] -// CHECK:STDOUT: %T.as_type.loc21_21.1: type = facet_access_type %T.ref [symbolic = %T.as_type.loc21_21.2 (constants.%T.as_type.4)] -// CHECK:STDOUT: %.loc21: type = converted %T.ref, %T.as_type.loc21_21.1 [symbolic = %T.as_type.loc21_21.2 (constants.%T.as_type.4)] -// CHECK:STDOUT: %Interface.ref: type = name_ref Interface, file.%Interface.decl [template = constants.%Interface.type] -// CHECK:STDOUT: %T.param: %L.type = value_param runtime_param -// CHECK:STDOUT: %L.ref: type = name_ref L, file.%L.decl [template = constants.%L.type] -// CHECK:STDOUT: %T.loc21_14.1: %L.type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc21_14.2 (constants.%T.4)] +// CHECK:STDOUT: %T.ref.loc21: %L.type = name_ref T, %T.loc21 [symbolic = constants.%T.4] +// CHECK:STDOUT: %T.as_type.loc21: type = facet_access_type %T.ref.loc21 [symbolic = constants.%T.as_type.4] +// CHECK:STDOUT: %.loc21: type = converted %T.ref.loc21, %T.as_type.loc21 [symbolic = constants.%T.as_type.4] +// CHECK:STDOUT: %Interface.ref.loc21: type = name_ref Interface, file.%Interface.decl [template = constants.%Interface.type] +// CHECK:STDOUT: %T.param.loc21: %L.type = value_param runtime_param +// CHECK:STDOUT: %L.ref.loc21: type = name_ref L, file.%L.decl [template = constants.%L.type] +// CHECK:STDOUT: %T.loc21: %L.type = bind_symbolic_name T, 0, %T.param.loc21 [symbolic = constants.%T.4] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -247,41 +247,9 @@ impl (C, C).0 as I {} // CHECK:STDOUT: %T.patt.loc11_14.2: %I.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc11_14.2 (constants.%T.patt.1)] // CHECK:STDOUT: %T.as_type.loc11_21.2: type = facet_access_type %T.loc11_14.2 [symbolic = %T.as_type.loc11_21.2 (constants.%T.as_type.1)] // CHECK:STDOUT: -// CHECK:STDOUT: impl: %.loc11 as %Interface.ref; -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: generic impl @impl.2(%T.loc12_14.1: %J.type) { -// CHECK:STDOUT: %T.loc12_14.2: %J.type = bind_symbolic_name T, 0 [symbolic = %T.loc12_14.2 (constants.%T.2)] -// CHECK:STDOUT: %T.patt.loc12_14.2: %J.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc12_14.2 (constants.%T.patt.2)] -// CHECK:STDOUT: %T.as_type.loc12_21.2: type = facet_access_type %T.loc12_14.2 [symbolic = %T.as_type.loc12_21.2 (constants.%T.as_type.2)] -// CHECK:STDOUT: -// CHECK:STDOUT: impl: %.loc12 as %Interface.ref; -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: generic impl @impl.3(%T.loc13_14.1: %K.type) { -// CHECK:STDOUT: %T.loc13_14.2: %K.type = bind_symbolic_name T, 0 [symbolic = %T.loc13_14.2 (constants.%T.3)] -// CHECK:STDOUT: %T.patt.loc13_14.2: %K.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc13_14.2 (constants.%T.patt.3)] -// CHECK:STDOUT: %T.as_type.loc13_21.2: type = facet_access_type %T.loc13_14.2 [symbolic = %T.as_type.loc13_21.2 (constants.%T.as_type.3)] -// CHECK:STDOUT: -// CHECK:STDOUT: impl: %.loc13 as %Interface.ref; -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: generic impl @impl.4(%T.loc14_14.1: %L.type) { -// CHECK:STDOUT: %T.loc14_14.2: %L.type = bind_symbolic_name T, 0 [symbolic = %T.loc14_14.2 (constants.%T.4)] -// CHECK:STDOUT: %T.patt.loc14_14.2: %L.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc14_14.2 (constants.%T.patt.4)] -// CHECK:STDOUT: %T.as_type.loc14_21.2: type = facet_access_type %T.loc14_14.2 [symbolic = %T.as_type.loc14_21.2 (constants.%T.as_type.4)] -// CHECK:STDOUT: -// CHECK:STDOUT: impl: %.loc14 as %Interface.ref; -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: generic impl @impl.5(%T.loc18_14.1: %I.type) { -// CHECK:STDOUT: %T.loc18_14.2: %I.type = bind_symbolic_name T, 0 [symbolic = %T.loc18_14.2 (constants.%T.1)] -// CHECK:STDOUT: %T.patt.loc18_14.2: %I.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc18_14.2 (constants.%T.patt.1)] -// CHECK:STDOUT: %T.as_type.loc18_21.2: type = facet_access_type %T.loc18_14.2 [symbolic = %T.as_type.loc18_21.2 (constants.%T.as_type.1)] -// CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: impl: %.loc18 as %Interface.ref { +// CHECK:STDOUT: impl: %.loc11 as %Interface.ref.loc11 { // CHECK:STDOUT: %interface: = interface_witness () [template = constants.%interface] // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -289,14 +257,14 @@ impl (C, C).0 as I {} // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic impl @impl.6(%T.loc19_14.1: %J.type) { -// CHECK:STDOUT: %T.loc19_14.2: %J.type = bind_symbolic_name T, 0 [symbolic = %T.loc19_14.2 (constants.%T.2)] -// CHECK:STDOUT: %T.patt.loc19_14.2: %J.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc19_14.2 (constants.%T.patt.2)] -// CHECK:STDOUT: %T.as_type.loc19_21.2: type = facet_access_type %T.loc19_14.2 [symbolic = %T.as_type.loc19_21.2 (constants.%T.as_type.2)] +// CHECK:STDOUT: generic impl @impl.2(%T.loc12_14.1: %J.type) { +// CHECK:STDOUT: %T.loc12_14.2: %J.type = bind_symbolic_name T, 0 [symbolic = %T.loc12_14.2 (constants.%T.2)] +// CHECK:STDOUT: %T.patt.loc12_14.2: %J.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc12_14.2 (constants.%T.patt.2)] +// CHECK:STDOUT: %T.as_type.loc12_21.2: type = facet_access_type %T.loc12_14.2 [symbolic = %T.as_type.loc12_21.2 (constants.%T.as_type.2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: impl: %.loc19 as %Interface.ref { +// CHECK:STDOUT: impl: %.loc12 as %Interface.ref.loc12 { // CHECK:STDOUT: %interface: = interface_witness () [template = constants.%interface] // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -304,14 +272,14 @@ impl (C, C).0 as I {} // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic impl @impl.7(%T.loc20_14.1: %K.type) { -// CHECK:STDOUT: %T.loc20_14.2: %K.type = bind_symbolic_name T, 0 [symbolic = %T.loc20_14.2 (constants.%T.3)] -// CHECK:STDOUT: %T.patt.loc20_14.2: %K.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc20_14.2 (constants.%T.patt.3)] -// CHECK:STDOUT: %T.as_type.loc20_21.2: type = facet_access_type %T.loc20_14.2 [symbolic = %T.as_type.loc20_21.2 (constants.%T.as_type.3)] +// CHECK:STDOUT: generic impl @impl.3(%T.loc13_14.1: %K.type) { +// CHECK:STDOUT: %T.loc13_14.2: %K.type = bind_symbolic_name T, 0 [symbolic = %T.loc13_14.2 (constants.%T.3)] +// CHECK:STDOUT: %T.patt.loc13_14.2: %K.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc13_14.2 (constants.%T.patt.3)] +// CHECK:STDOUT: %T.as_type.loc13_21.2: type = facet_access_type %T.loc13_14.2 [symbolic = %T.as_type.loc13_21.2 (constants.%T.as_type.3)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: impl: %.loc20 as %Interface.ref { +// CHECK:STDOUT: impl: %.loc13 as %Interface.ref.loc13 { // CHECK:STDOUT: %interface: = interface_witness () [template = constants.%interface] // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -319,14 +287,14 @@ impl (C, C).0 as I {} // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic impl @impl.8(%T.loc21_14.1: %L.type) { -// CHECK:STDOUT: %T.loc21_14.2: %L.type = bind_symbolic_name T, 0 [symbolic = %T.loc21_14.2 (constants.%T.4)] -// CHECK:STDOUT: %T.patt.loc21_14.2: %L.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc21_14.2 (constants.%T.patt.4)] -// CHECK:STDOUT: %T.as_type.loc21_21.2: type = facet_access_type %T.loc21_14.2 [symbolic = %T.as_type.loc21_21.2 (constants.%T.as_type.4)] +// CHECK:STDOUT: generic impl @impl.4(%T.loc14_14.1: %L.type) { +// CHECK:STDOUT: %T.loc14_14.2: %L.type = bind_symbolic_name T, 0 [symbolic = %T.loc14_14.2 (constants.%T.4)] +// CHECK:STDOUT: %T.patt.loc14_14.2: %L.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc14_14.2 (constants.%T.patt.4)] +// CHECK:STDOUT: %T.as_type.loc14_21.2: type = facet_access_type %T.loc14_14.2 [symbolic = %T.as_type.loc14_21.2 (constants.%T.as_type.4)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: impl: %.loc21 as %Interface.ref { +// CHECK:STDOUT: impl: %.loc14 as %Interface.ref.loc14 { // CHECK:STDOUT: %interface: = interface_witness () [template = constants.%interface] // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -358,30 +326,6 @@ impl (C, C).0 as I {} // CHECK:STDOUT: %T.as_type.loc14_21.2 => constants.%T.as_type.4 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.5(constants.%T.1) { -// CHECK:STDOUT: %T.loc18_14.2 => constants.%T.1 -// CHECK:STDOUT: %T.patt.loc18_14.2 => constants.%T.1 -// CHECK:STDOUT: %T.as_type.loc18_21.2 => constants.%T.as_type.1 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.6(constants.%T.2) { -// CHECK:STDOUT: %T.loc19_14.2 => constants.%T.2 -// CHECK:STDOUT: %T.patt.loc19_14.2 => constants.%T.2 -// CHECK:STDOUT: %T.as_type.loc19_21.2 => constants.%T.as_type.2 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.7(constants.%T.3) { -// CHECK:STDOUT: %T.loc20_14.2 => constants.%T.3 -// CHECK:STDOUT: %T.patt.loc20_14.2 => constants.%T.3 -// CHECK:STDOUT: %T.as_type.loc20_21.2 => constants.%T.as_type.3 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.8(constants.%T.4) { -// CHECK:STDOUT: %T.loc21_14.2 => constants.%T.4 -// CHECK:STDOUT: %T.patt.loc21_14.2 => constants.%T.4 -// CHECK:STDOUT: %T.as_type.loc21_21.2 => constants.%T.as_type.4 -// CHECK:STDOUT: } -// CHECK:STDOUT: // CHECK:STDOUT: --- fail_same_self_and_interface_redefined.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { diff --git a/toolchain/check/testdata/impl/redeclaration.carbon b/toolchain/check/testdata/impl/redeclaration.carbon index 1c21ddb968604..067a171f2efdb 100644 --- a/toolchain/check/testdata/impl/redeclaration.carbon +++ b/toolchain/check/testdata/impl/redeclaration.carbon @@ -47,16 +47,16 @@ impl i32 as I {} // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%I.type] {} {} -// CHECK:STDOUT: impl_decl @impl.1 [template] {} { +// CHECK:STDOUT: impl_decl @impl [template] {} { // CHECK:STDOUT: %int_32.loc13: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc13: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %I.ref.loc13: type = name_ref I, file.%I.decl [template = constants.%I.type] // CHECK:STDOUT: } // CHECK:STDOUT: %X.decl: type = class_decl @X [template = constants.%X] {} {} -// CHECK:STDOUT: impl_decl @impl.2 [template] {} { -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%I.type] +// CHECK:STDOUT: impl_decl @impl [template] {} { +// CHECK:STDOUT: %int_32.loc19: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %I.ref.loc19: type = name_ref I, file.%I.decl [template = constants.%I.type] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -68,9 +68,7 @@ impl i32 as I {} // CHECK:STDOUT: witness = () // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.1: %i32.loc13 as %I.ref.loc13; -// CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.2: %i32 as %I.ref { +// CHECK:STDOUT: impl @impl: %i32.loc13 as %I.ref.loc13 { // CHECK:STDOUT: %interface: = interface_witness () [template = constants.%interface] // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -78,7 +76,7 @@ impl i32 as I {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @X { -// CHECK:STDOUT: impl_decl @impl.1 [template] {} { +// CHECK:STDOUT: impl_decl @impl [template] {} { // CHECK:STDOUT: %int_32.loc16: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32.loc16: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %I.ref.loc16: type = name_ref I, file.%I.decl [template = constants.%I.type] From 13502b7c8907b90bb045dc1512ca65ee3bdc5c2f Mon Sep 17 00:00:00 2001 From: Chandler Carruth Date: Thu, 19 Dec 2024 16:33:29 -0800 Subject: [PATCH 64/68] Replace #4505 with a different set of workarounds (#4527) This restores the symlinks for the installation, but teaches the busybox info search to look for a relative path to the busybox binary itself before walking through symlinks. This let's it find the tree structure when directly invoking `prefix_root/bin/carbon` or similar, either inside of a Bazel rule or from the command line, and mirrors how we expect the installed tree to look. This works even when Bazel resolves the symlink target fully, and potentially to something nonsensical like a CAS file. In order to make a convenient Bazel target that can be used with `bazel run //toolchain`, this adds an override to explicitly set the desired argv[0] to use when selecting a mode for the busybox and a busybox binary. Currently, the workaround uses an environment variable because that required the least amount of plumbing, and seems a useful override mechanism generally, but I'm open to other approaches. This should allow a few things to work a bit more nicely: - It should handle sibling symlinks like `clang++` to `clang` or `ld.lld` to `lld`, where that symlink in turn points at the busybox. We want to use *initial* `argv[0]` value to select the mode there. - It avoids bouncing through Python (or other subprocesses) when invoking the `carbon` binary in Bazel rules, which will be nice for building the example code and benchmarking. It does come at a cost of removing one feature: the initial symlink can't be some unrelated alias like `my_carbon_symlink` -- we expect the *first* argv[0] name to have the meaningful filename for selecting a busybox mode. It also trades the complexity of the Python script for some complexity in the busybox search in order to look for a relative `carbon-busybox` binary. On the whole, I think that tradeoff is worthwhile, but it isn't free. --------- Co-authored-by: Jon Ross-Perkins --- .vscode/gdb_launch.json | 2 +- .vscode/lldb_launch.json | 2 +- docs/project/contribution_tools.md | 2 +- toolchain/BUILD | 14 +- toolchain/docs/adding_features.md | 6 +- toolchain/install/BUILD | 22 +-- toolchain/install/busybox_info.h | 67 ++++++++- toolchain/install/busybox_info_test.cpp | 177 ++++++++++++++++++++--- toolchain/install/busybox_main.cpp | 2 +- toolchain/install/install_filegroups.bzl | 39 +---- toolchain/install/run_tool.bzl | 67 --------- toolchain/install/symlink_helpers.bzl | 62 -------- toolchain/run_tool.bzl | 40 +++++ utils/nvim/carbon.lua | 2 +- utils/vscode/package.json | 2 +- utils/vscode/src/extension.ts | 2 +- 16 files changed, 292 insertions(+), 216 deletions(-) delete mode 100644 toolchain/install/run_tool.bzl create mode 100644 toolchain/run_tool.bzl diff --git a/.vscode/gdb_launch.json b/.vscode/gdb_launch.json index a50b089104516..cb9ddf8a311d1 100644 --- a/.vscode/gdb_launch.json +++ b/.vscode/gdb_launch.json @@ -14,7 +14,7 @@ "type": "by-gdb", "request": "launch", "name": "carbon compile (gdb)", - "program": "bazel-bin/toolchain/install/prefix_root/lib/carbon/carbon-busybox", + "program": "bazel-bin/toolchain/carbon", "programArgs": "compile --phase=lower --dump-sem-ir --stream-errors ${relativeFile}", "cwd": "${workspaceFolder}" } diff --git a/.vscode/lldb_launch.json b/.vscode/lldb_launch.json index fc0e35cd78405..929976f77dbc2 100644 --- a/.vscode/lldb_launch.json +++ b/.vscode/lldb_launch.json @@ -18,7 +18,7 @@ "type": "lldb-dap", "request": "launch", "name": "carbon compile (lldb)", - "program": "bazel-bin/toolchain/install/prefix_root/lib/carbon/carbon-busybox", + "program": "bazel-bin/toolchain/carbon", "args": [ "compile", "--phase=lower", diff --git a/docs/project/contribution_tools.md b/docs/project/contribution_tools.md index 68e4ec3ff0f1c..b6e432a43053a 100644 --- a/docs/project/contribution_tools.md +++ b/docs/project/contribution_tools.md @@ -345,7 +345,7 @@ bazel build -c dbg //toolchain Then debugging works with LLDB: ```shell -lldb bazel-bin/toolchain/install/prefix_root/lib/carbon/carbon-busybox +lldb bazel-bin/toolchain/carbon ``` Any installed version of LLDB at least as recent as the installed Clang used for diff --git a/toolchain/BUILD b/toolchain/BUILD index a6a22fe04c415..17bbfd17211d7 100644 --- a/toolchain/BUILD +++ b/toolchain/BUILD @@ -2,9 +2,21 @@ # Exceptions. See /LICENSE for license information. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +load("//bazel/cc_toolchains:defs.bzl", "cc_env") +load("run_tool.bzl", "run_tool") + +# Support `bazel run` and create a convenience symlink for the tool in the +# toolchain's install. +run_tool( + name = "carbon", + data = ["//toolchain/install:install_data"], + env = cc_env(), + tool = "//toolchain/install:prefix_root/bin/carbon", +) + # A convenience target for running the toolchain with the full prelude # available. alias( name = "toolchain", - actual = "//toolchain/install:run_carbon", + actual = ":carbon", ) diff --git a/toolchain/docs/adding_features.md b/toolchain/docs/adding_features.md index cf23795105dfe..bfd0c49b56c37 100644 --- a/toolchain/docs/adding_features.md +++ b/toolchain/docs/adding_features.md @@ -467,8 +467,10 @@ example, with `toolchain/parse/testdata/basics/empty.carbon`: - Executes an individual test. - `bazel run //toolchain -- compile --phase=parse --dump-parse-tree toolchain/parse/testdata/basics/empty.carbon` - Explicitly runs `carbon` with the provided arguments. -- `bazel-bin/toolchain/install/run_carbon compile --phase=parse --dump-parse-tree toolchain/parse/testdata/basics/empty.carbon` - - Similar to the previous command, but without using `bazel`. +- `bazel-bin/toolchain/carbon compile --phase=parse --dump-parse-tree toolchain/parse/testdata/basics/empty.carbon` + - Similar to the previous command, but without using `bazel run`. This can + be useful with a debugger or other tool that needs to directly run the + binary. - `bazel run //toolchain -- -v compile --phase=check toolchain/check/testdata/basics/run.carbon` - Runs using `-v` for verbose log output, and running through the `check` phase. diff --git a/toolchain/install/BUILD b/toolchain/install/BUILD index 9cb16c9fd92d4..0e85002cce97f 100644 --- a/toolchain/install/BUILD +++ b/toolchain/install/BUILD @@ -5,9 +5,8 @@ load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library", "cc_test") load("//bazel/cc_toolchains:defs.bzl", "cc_env") load("//bazel/manifest:defs.bzl", "manifest") -load("install_filegroups.bzl", "install_busybox_wrapper", "install_filegroup", "install_symlink", "install_target", "make_install_filegroups") +load("install_filegroups.bzl", "install_filegroup", "install_symlink", "install_target", "make_install_filegroups") load("pkg_helpers.bzl", "pkg_naming_variables", "pkg_tar_and_test") -load("run_tool.bzl", "run_tool") package(default_visibility = ["//visibility:public"]) @@ -89,6 +88,7 @@ cc_test( "//common:check", "//testing/base:gtest_main", "@googletest//:gtest", + "@llvm-project//llvm:Support", ], ) @@ -130,9 +130,10 @@ lld_aliases = [ # based on the FHS (Filesystem Hierarchy Standard). install_dirs = { "bin": [ - install_busybox_wrapper( + install_symlink( "carbon", "../lib/carbon/carbon-busybox", + is_driver = True, ), ], "lib/carbon": [ @@ -151,13 +152,10 @@ install_dirs = { "@llvm-project//lld:lld", executable = True, ), - install_busybox_wrapper( + install_symlink( "clang", "../../carbon-busybox", - [ - "clang", - "--", - ], + is_driver = True, ), ] + [install_symlink(name, "lld") for name in lld_aliases], } @@ -194,11 +192,3 @@ pkg_tar_and_test( package_variables = ":packaging_variables", stamp = -1, # Allow `--stamp` builds to produce file timestamps. ) - -# Support `bazel run` on specific binaries. -run_tool( - name = "run_carbon", - data = [":install_data"], - env = cc_env(), - tool = "prefix_root/bin/carbon", -) diff --git a/toolchain/install/busybox_info.h b/toolchain/install/busybox_info.h index 72fad4a20a145..926350e9e2efc 100644 --- a/toolchain/install/busybox_info.h +++ b/toolchain/install/busybox_info.h @@ -6,6 +6,7 @@ #define CARBON_TOOLCHAIN_INSTALL_BUSYBOX_INFO_H_ #include +#include #include #include @@ -14,6 +15,8 @@ namespace Carbon { +constexpr const char* Argv0OverrideEnv = "CARBON_ARGV0_OVERRIDE"; + struct BusyboxInfo { // The path to `carbon-busybox`. std::filesystem::path bin_path; @@ -21,24 +24,76 @@ struct BusyboxInfo { std::optional mode; }; -// Returns the busybox information, given argv[0]. This primarily handles -// resolving symlinks that point at the busybox. +// Returns the busybox information, given argv[0]. +// +// Extracts the desired mode for the busybox from the initial command name. +// +// Checks if the path in argv0 is an executable in a valid Carbon install, or a +// symlink to such an executable, and sets `bin_path` to the path of +// `lib/carbon/carbon-busybox` within that install. +// +// If unable to locate a plausible busybox binary, returns an error instead. inline auto GetBusyboxInfo(llvm::StringRef argv0) -> ErrorOr { - BusyboxInfo info = BusyboxInfo{argv0.str(), std::nullopt}; + // Check for an override of `argv[0]` from the environment and apply it. + if (const char* argv0_override = getenv(Argv0OverrideEnv)) { + argv0 = argv0_override; + } + + BusyboxInfo info = {.bin_path = argv0.str(), .mode = std::nullopt}; + std::filesystem::path filename = info.bin_path.filename(); + // The mode is set to the initial filename used for `argv[0]`. + if (filename != "carbon" && filename != "carbon-busybox") { + info.mode = filename; + } + + // Now search through any symlinks to locate the installed busybox binary. while (true) { - std::string filename = info.bin_path.filename(); + filename = info.bin_path.filename(); if (filename == "carbon-busybox") { return info; } + + // If we've not already reached the busybox, look for it relative to the + // current binary path. This can help more immediately locate an + // installation tree, and avoids walking through a final layer of symlinks + // which may point to content-addressed storage or other parts of a build + // output tree. + // + // We break this into two cases we need to handle: + // - Carbon's CLI will be: `/bin/carbon` + // - Other tools will be: `/lib/carbon//bin/` + // + // We also check that the current path is within a `bin` directory to + // provide best-effort checking for accidentally walking up from symlinks + // that aren't within an installation-shaped tree. + auto parent_path = info.bin_path.parent_path(); + // Strip any `.` path components at the end to simplify processing. + while (parent_path.filename() == ".") { + parent_path = parent_path.parent_path(); + } + if (parent_path.filename() == "bin") { + auto lib_path = filename == "carbon" + ? parent_path / ".." / "lib" / "carbon" + : parent_path / ".." / ".."; + auto busybox_path = lib_path / "carbon-busybox"; + std::error_code ec; + if (std::filesystem::exists(busybox_path, ec)) { + info.bin_path = busybox_path; + return info; + } + } + + // Try to walk through another layer of symlinks and see if we can find the + // installation there or are linked directly to the busybox. std::error_code ec; auto symlink_target = std::filesystem::read_symlink(info.bin_path, ec); if (ec) { return ErrorBuilder() << "expected carbon-busybox symlink at `" << info.bin_path << "`"; } - info.mode = filename; + // Do a path join, to handle relative symlinks. - info.bin_path = info.bin_path.parent_path() / symlink_target; + info.bin_path = parent_path / symlink_target; } } diff --git a/toolchain/install/busybox_info_test.cpp b/toolchain/install/busybox_info_test.cpp index 1d01bb7351838..56c5a5dde0ea2 100644 --- a/toolchain/install/busybox_info_test.cpp +++ b/toolchain/install/busybox_info_test.cpp @@ -11,6 +11,7 @@ #include #include "common/check.h" +#include "llvm/ADT/ScopeExit.h" namespace Carbon { namespace { @@ -52,14 +53,35 @@ class BusyboxInfoTest : public ::testing::Test { return file; } - // Creates a directory. Returns the input file for easier use. + // Creates a directory, recursively if needed. Returns the input file for + // easier use. auto MakeDir(std::filesystem::path dir) -> std::filesystem::path { std::error_code ec; - std::filesystem::create_directory(dir, ec); + std::filesystem::create_directories(dir, ec); CARBON_CHECK(!ec, "error creating {0}: {1}", dir, ec.message()); return dir; } + // Creates a synthetic install tree to test a batch of interactions. + // Optionally accepts a symlink target for the busybox in the install tree. + // Returns the input prefix for easy use. + auto MakeInstallTree(std::filesystem::path prefix, + std::optional busybox_target = {}) + -> std::filesystem::path { + MakeDir(prefix / "lib/carbon"); + if (busybox_target) { + MakeSymlink(prefix / "lib/carbon/carbon-busybox", *busybox_target); + } else { + MakeFile(prefix / "lib/carbon/carbon-busybox"); + } + MakeDir(prefix / "lib/carbon/llvm/bin"); + MakeSymlink(prefix / "lib/carbon/llvm/bin/clang++", "clang"); + MakeSymlink(prefix / "lib/carbon/llvm/bin/clang", "../../carbon-busybox"); + MakeDir(prefix / "bin"); + MakeSymlink(prefix / "bin/carbon", "../lib/carbon/carbon-busybox"); + return prefix; + } + // The test's temp directory, deleted on destruction. std::filesystem::path dir_; }; @@ -80,7 +102,7 @@ TEST_F(BusyboxInfoTest, SymlinkInCurrentDirectory) { auto info = GetBusyboxInfo(target.string()); ASSERT_TRUE(info.ok()) << info.error(); EXPECT_THAT(info->bin_path, Eq(dir_ / "carbon-busybox")); - EXPECT_THAT(info->mode, Eq("carbon")); + EXPECT_THAT(info->mode, Eq(std::nullopt)); } TEST_F(BusyboxInfoTest, SymlinkInCurrentDirectoryWithDot) { @@ -90,18 +112,35 @@ TEST_F(BusyboxInfoTest, SymlinkInCurrentDirectoryWithDot) { auto info = GetBusyboxInfo(target.string()); ASSERT_TRUE(info.ok()) << info.error(); EXPECT_THAT(info->bin_path, Eq(dir_ / "./carbon-busybox")); - EXPECT_THAT(info->mode, Eq("carbon")); + EXPECT_THAT(info->mode, Eq(std::nullopt)); } TEST_F(BusyboxInfoTest, ExtraSymlink) { MakeFile(dir_ / "carbon-busybox"); - MakeSymlink(dir_ / "carbon", "carbon-busybox"); - auto target = MakeSymlink(dir_ / "c", "carbon"); + MakeSymlink(dir_ / "c", "carbon-busybox"); + auto target = MakeSymlink(dir_ / "carbon", "c"); auto info = GetBusyboxInfo(target.string()); ASSERT_TRUE(info.ok()) << info.error(); EXPECT_THAT(info->bin_path, Eq(dir_ / "carbon-busybox")); - EXPECT_THAT(info->mode, Eq("carbon")); + EXPECT_THAT(info->mode, Eq(std::nullopt)); +} + +TEST_F(BusyboxInfoTest, OriginalSymlinkNameFormsMode) { + MakeFile(dir_ / "carbon-busybox"); + MakeSymlink(dir_ / "carbon", "carbon-busybox"); + auto clang_target = MakeSymlink(dir_ / "clang", "carbon"); + auto clang_plusplus_target = MakeSymlink(dir_ / "clang++", "clang"); + + auto info = GetBusyboxInfo(clang_target.string()); + ASSERT_TRUE(info.ok()) << info.error(); + EXPECT_THAT(info->bin_path, Eq(dir_ / "carbon-busybox")); + EXPECT_THAT(info->mode, Eq("clang")); + + info = GetBusyboxInfo(clang_plusplus_target.string()); + ASSERT_TRUE(info.ok()) << info.error(); + EXPECT_THAT(info->bin_path, Eq(dir_ / "carbon-busybox")); + EXPECT_THAT(info->mode, Eq("clang++")); } TEST_F(BusyboxInfoTest, BusyboxIsSymlink) { @@ -124,31 +163,28 @@ TEST_F(BusyboxInfoTest, BusyboxIsSymlinkToNowhere) { } TEST_F(BusyboxInfoTest, RelativeSymlink) { - MakeDir(dir_ / "lib"); - MakeDir(dir_ / "lib/carbon"); - MakeFile(dir_ / "lib/carbon/carbon-busybox"); - MakeDir(dir_ / "bin"); - auto target = - MakeSymlink(dir_ / "bin/carbon", "../lib/carbon/carbon-busybox"); + MakeDir(dir_ / "dir1"); + MakeFile(dir_ / "dir1/carbon-busybox"); + MakeDir(dir_ / "dir2"); + auto target = MakeSymlink(dir_ / "dir2/carbon", "../dir1/carbon-busybox"); auto info = GetBusyboxInfo(target.string()); ASSERT_TRUE(info.ok()) << info.error(); - EXPECT_THAT(info->bin_path, Eq(dir_ / "bin/../lib/carbon/carbon-busybox")); - EXPECT_THAT(info->mode, Eq("carbon")); + EXPECT_THAT(info->bin_path, Eq(dir_ / "dir2/../dir1/carbon-busybox")); + EXPECT_THAT(info->mode, Eq(std::nullopt)); } TEST_F(BusyboxInfoTest, AbsoluteSymlink) { - MakeDir(dir_ / "lib"); - MakeDir(dir_ / "lib/carbon"); - auto busybox = MakeFile(dir_ / "lib/carbon/carbon-busybox"); + MakeDir(dir_ / "dir1"); + auto busybox = MakeFile(dir_ / "dir1/carbon-busybox"); ASSERT_TRUE(busybox.is_absolute()); - MakeDir(dir_ / "bin"); - auto target = MakeSymlink(dir_ / "bin/carbon", busybox); + MakeDir(dir_ / "dir2"); + auto target = MakeSymlink(dir_ / "dir2/carbon", busybox); auto info = GetBusyboxInfo(target.string()); ASSERT_TRUE(info.ok()) << info.error(); EXPECT_THAT(info->bin_path, Eq(busybox)); - EXPECT_THAT(info->mode, Eq("carbon")); + EXPECT_THAT(info->mode, Eq(std::nullopt)); } TEST_F(BusyboxInfoTest, NotBusyboxFile) { @@ -166,5 +202,104 @@ TEST_F(BusyboxInfoTest, NotBusyboxSymlink) { EXPECT_FALSE(info.ok()); } +TEST_F(BusyboxInfoTest, LayerSymlinksInstallTree) { + auto actual_busybox = MakeFile(dir_ / "actual-busybox"); + + // Create a facsimile of the install prefix with even the busybox as a + // symlink. Also include potential relative sibling symlinks like `clang++` to + // `clang`. + auto prefix = MakeInstallTree(dir_ / "test_prefix", actual_busybox); + + auto info = GetBusyboxInfo((prefix / "bin/carbon").string()); + ASSERT_TRUE(info.ok()) << info.error(); + EXPECT_THAT(info->bin_path, Eq(prefix / "bin/../lib/carbon/carbon-busybox")); + EXPECT_THAT(info->mode, Eq(std::nullopt)); + + info = GetBusyboxInfo((prefix / "lib/carbon/llvm/bin/clang").string()); + ASSERT_TRUE(info.ok()) << info.error(); + EXPECT_THAT(info->bin_path, + Eq(prefix / "lib/carbon/llvm/bin/../../carbon-busybox")); + EXPECT_THAT(info->mode, Eq("clang")); + + info = GetBusyboxInfo((prefix / "lib/carbon/llvm/bin/clang++").string()); + ASSERT_TRUE(info.ok()) << info.error(); + EXPECT_THAT(info->bin_path, + Eq(prefix / "lib/carbon/llvm/bin/../../carbon-busybox")); + EXPECT_THAT(info->mode, Eq("clang++")); +} + +TEST_F(BusyboxInfoTest, StopSearchAtFirstSymlinkWithRelativeBusybox) { + // Some install of Carbon under `opt`. + auto opt_prefix = MakeInstallTree(dir_ / "opt"); + + // A second install, but with its symlinks pointing into the `opt` tree rather + // than at its busybox. + MakeDir(dir_ / "lib/carbon"); + MakeFile(dir_ / "lib/carbon/carbon-busybox"); + MakeDir(dir_ / "bin"); + auto target = MakeSymlink(dir_ / "bin/carbon", "../opt/bin/carbon"); + MakeDir(dir_ / "lib/carbon/llvm/bin"); + auto clang_target = MakeSymlink(dir_ / "lib/carbon/llvm/bin/clang", + opt_prefix / "lib/carbon/llvm/bin/clang"); + + // Starting from the second install uses the relative busybox rather than + // traversing the symlink further. + auto info = GetBusyboxInfo(target.string()); + ASSERT_TRUE(info.ok()) << info.error(); + EXPECT_THAT(info->bin_path, Eq(dir_ / "bin/../lib/carbon/carbon-busybox")); + info = GetBusyboxInfo(clang_target.string()); + ASSERT_TRUE(info.ok()) << info.error(); + EXPECT_THAT(info->bin_path, + Eq(dir_ / "lib/carbon/llvm/bin/../../carbon-busybox")); +} + +TEST_F(BusyboxInfoTest, RejectSymlinkInUnrelatedInstall) { + // Add two installs of Carbon nested inside each other in a realistic + // scenario: `/usr` and `/usr/local`. + auto usr_prefix = MakeInstallTree(dir_ / "usr"); + auto usr_local_prefix = MakeInstallTree(dir_ / "usr/local"); + + // Now add a stray symlink directly in `.../usr/local` to the local install. + // + // This has the interesting property that both of these "work" and find the + // same busybox but probably wanted to find different ones: + // - `.../usr/local/../lib/carbon/carbon-busybox` + // - `.../usr/bin/../lib/carbon/carbon-busybox` + auto stray_target = MakeSymlink(dir_ / "usr/local/carbon", "bin/carbon"); + + // Check that the busybox doesn't use the relative busybox in this case, and + // walks the symlink to find the correct installation. + auto info = GetBusyboxInfo(stray_target.string()); + ASSERT_TRUE(info.ok()) << info.error(); + EXPECT_THAT(info->bin_path, + Eq(dir_ / "usr/local/bin/../lib/carbon/carbon-busybox")); + + // Ensure this works even with intervening `.` directory components. + stray_target = MakeSymlink(dir_ / "usr/local/carbon2", "bin/././carbon"); + + // Check that the busybox doesn't use the relative busybox in this case, and + // walks the symlink to find the correct installation. + info = GetBusyboxInfo(stray_target.string()); + ASSERT_TRUE(info.ok()) << info.error(); + EXPECT_THAT(info->bin_path, + Eq(dir_ / "usr/local/bin/../lib/carbon/carbon-busybox")); +} + +TEST_F(BusyboxInfoTest, EnvBinaryPathOverride) { + // The test should not have this environment variable set. + ASSERT_THAT(getenv(Argv0OverrideEnv), Eq(nullptr)); + // Clean up this environment variable when this test finishes. + auto _ = llvm::make_scope_exit([] { unsetenv(Argv0OverrideEnv); }); + + // Set the environment to our actual busybox. + auto busybox = MakeFile(dir_ / "carbon-busybox"); + setenv(Argv0OverrideEnv, busybox.c_str(), /*overwrite=*/1); + + auto info = GetBusyboxInfo("/some/nonexistent/path"); + ASSERT_TRUE(info.ok()) << info.error(); + EXPECT_THAT(info->bin_path, Eq(busybox)); + EXPECT_THAT(info->mode, Eq(std::nullopt)); +} + } // namespace } // namespace Carbon diff --git a/toolchain/install/busybox_main.cpp b/toolchain/install/busybox_main.cpp index 3928f7bd03668..1609f8fed129c 100644 --- a/toolchain/install/busybox_main.cpp +++ b/toolchain/install/busybox_main.cpp @@ -40,7 +40,7 @@ static auto Main(int argc, char** argv) -> ErrorOr { llvm::SmallVector args; args.reserve(argc + 1); - if (busybox_info.mode && busybox_info.mode != "carbon") { + if (busybox_info.mode) { args.append({*busybox_info.mode, "--"}); } args.append(argv + 1, argv + argc); diff --git a/toolchain/install/install_filegroups.bzl b/toolchain/install/install_filegroups.bzl index 95df1db34a4f4..eb938af81e40c 100644 --- a/toolchain/install/install_filegroups.bzl +++ b/toolchain/install/install_filegroups.bzl @@ -5,25 +5,7 @@ """Rules for constructing install information.""" load("@rules_pkg//pkg:mappings.bzl", "pkg_attributes", "pkg_filegroup", "pkg_files", "pkg_mklink", "strip_prefix") -load("symlink_helpers.bzl", "busybox_wrapper", "symlink_file", "symlink_filegroup") - -def install_busybox_wrapper(name, busybox, busybox_args = []): - """Adds a busybox wrapper for install. - - Used in the `install_dirs` dict. - - Args: - name: The filename to use. - busybox: A relative path for the busybox. - busybox_args: Arguments needed to simulate busybox when a symlink isn't - actually used. - """ - return { - "busybox": busybox, - "busybox_args": busybox_args, - "is_driver": True, - "name": name, - } +load("symlink_helpers.bzl", "symlink_file", "symlink_filegroup") def install_filegroup(name, filegroup_target): """Adds a filegroup for install. @@ -40,7 +22,7 @@ def install_filegroup(name, filegroup_target): "name": name, } -def install_symlink(name, symlink_to): +def install_symlink(name, symlink_to, is_driver = False): """Adds a symlink for install. Used in the `install_dirs` dict. @@ -48,9 +30,11 @@ def install_symlink(name, symlink_to): Args: name: The filename to use. symlink_to: A relative path for the symlink. + is_driver: False if it should be included in the `no_driver_name` + filegroup. """ return { - "is_driver": False, + "is_driver": is_driver, "name": name, "symlink": symlink_to, } @@ -122,19 +106,6 @@ def make_install_filegroups(name, no_driver_name, pkg_name, install_dirs, prefix attributes = pkg_attributes(mode = mode), renames = {entry["target"]: path}, ) - elif "busybox" in entry: - busybox_wrapper( - name = prefixed_path, - symlink = entry["busybox"], - busybox_args = entry["busybox_args"], - ) - - # For the distributed package, we retain relative symlinks. - pkg_mklink( - name = pkg_path, - link_name = path, - target = entry["busybox"], - ) elif "filegroup" in entry: symlink_filegroup( name = prefixed_path, diff --git a/toolchain/install/run_tool.bzl b/toolchain/install/run_tool.bzl deleted file mode 100644 index e9410b51e0792..0000000000000 --- a/toolchain/install/run_tool.bzl +++ /dev/null @@ -1,67 +0,0 @@ -# Part of the Carbon Language project, under the Apache License v2.0 with LLVM -# Exceptions. See /LICENSE for license information. -# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception - -"""Supports running a tool from the install filegroup.""" - -_RUN_TOOL_TMPL = """#!/usr/bin/env python3 - -import os -import sys - -# These will be relative locations in bazel-out. -_SCRIPT_LOCATION = "{0}" -_TOOL_LOCATION = "{1}" - -# Drop shared parent portions so that we're working with a minimum suffix. -# This is so that both `bazel-out` and manual `bazel-bin` invocations work. -script_parts = _SCRIPT_LOCATION.split('/') -tool_parts = _TOOL_LOCATION.split('/') -while script_parts and tool_parts and script_parts[0] == tool_parts[0]: - del script_parts[0] - del tool_parts[0] -script_suffix = '/' + '/'.join(script_parts) -tool_suffix = '/' + '/'.join(tool_parts) - -# Make sure we have the expected structure. -if not __file__.endswith(script_suffix): - exit( - "Unable to figure out path:\\n" - f" __file__: {{__file__}}\\n" - f" script: {{script_suffix}}\\n" - ) - -# Run the tool using the absolute path, forwarding arguments. -tool_path = __file__.removesuffix(script_suffix) + tool_suffix -os.execv(tool_path, [tool_path] + sys.argv[1:]) -""" - -def _run_tool_impl(ctx): - content = _RUN_TOOL_TMPL.format(ctx.outputs.executable.path, ctx.file.tool.path) - ctx.actions.write( - output = ctx.outputs.executable, - is_executable = True, - content = content, - ) - return [ - DefaultInfo( - runfiles = ctx.runfiles(files = ctx.files.data), - ), - RunEnvironmentInfo(environment = ctx.attr.env), - ] - -run_tool = rule( - doc = "Helper for running a tool in a filegroup.", - implementation = _run_tool_impl, - attrs = { - "data": attr.label_list(allow_files = True), - "env": attr.string_dict(), - "tool": attr.label( - allow_single_file = True, - executable = True, - cfg = "target", - mandatory = True, - ), - }, - executable = True, -) diff --git a/toolchain/install/symlink_helpers.bzl b/toolchain/install/symlink_helpers.bzl index c39fdb541cbed..01284cc700144 100644 --- a/toolchain/install/symlink_helpers.bzl +++ b/toolchain/install/symlink_helpers.bzl @@ -4,68 +4,6 @@ """Rules for symlinking in ways that assist install_filegroups.""" -_SYMLINK_BUSYBOX_TMPL = """#!/usr/bin/env python3 - -from pathlib import Path -import os -import sys - -_RELATIVE_PATH = "{0}" -_BUSYBOX_ARGS = {1} - -# Run the tool using the absolute path, forwarding arguments. -tool_path = Path(__file__).parent / _RELATIVE_PATH -os.execv(tool_path, [tool_path] + _BUSYBOX_ARGS + sys.argv[1:]) -""" - -def _busybox_wrapper_impl(ctx): - """Symlinking busybox things needs special logic. - - This is because Bazel doesn't cache the actual symlink, resulting in - essentially resolved symlinks being produced in place of the expected tool. - As a consequence, we can't rely on the symlink name when dealing with - busybox entries. - - An example repro of this using a local build cache is: - bazel build //toolchain - bazel clean - bazel build //toolchain - - We could in theory get reasonable behavior with - `ctx.actions.declare_symlink`, but that's disallowed in our `.bazelrc` for - cross-environment compatibility. - - The particular approach here uses the Python script as a launching pad so - that the busybox still receives an appropriate location in argv[0], allowing - it to find other files in the lib directory. Arguments are inserted to get - equivalent behavior as if symlink resolution had occurred. - - The underlying bug is noted at: - https://github.com/bazelbuild/bazel/issues/23620 - """ - content = _SYMLINK_BUSYBOX_TMPL.format( - ctx.attr.symlink, - ctx.attr.busybox_args, - ) - ctx.actions.write( - output = ctx.outputs.executable, - is_executable = True, - content = content, - ) - return [] - -busybox_wrapper = rule( - doc = "Helper for running a busybox with symlink-like characteristics.", - implementation = _busybox_wrapper_impl, - attrs = { - "busybox_args": attr.string_list( - doc = "Optional arguments to pass for equivalent behavior to a symlink.", - ), - "symlink": attr.string(mandatory = True), - }, - executable = True, -) - def _symlink_file_impl(ctx): executable = None if ctx.attr.symlink_binary: diff --git a/toolchain/run_tool.bzl b/toolchain/run_tool.bzl new file mode 100644 index 0000000000000..41b77f42fd5ee --- /dev/null +++ b/toolchain/run_tool.bzl @@ -0,0 +1,40 @@ +# Part of the Carbon Language project, under the Apache License v2.0 with LLVM +# Exceptions. See /LICENSE for license information. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +"""Supports running a tool from the install filegroup.""" + +def _run_tool_impl(ctx): + tool_files = ctx.attr.tool.files.to_list() + if len(tool_files) != 1: + fail("Expected 1 tool file, found {0}".format(len(tool_files))) + ctx.actions.symlink( + output = ctx.outputs.executable, + target_file = tool_files[0], + is_executable = True, + ) + return [ + DefaultInfo( + runfiles = ctx.runfiles(files = ctx.files.data), + ), + RunEnvironmentInfo( + environment = ctx.attr.env | + {"CARBON_ARGV0_OVERRIDE": tool_files[0].short_path}, + ), + ] + +run_tool = rule( + doc = "Helper for running a tool in a filegroup.", + implementation = _run_tool_impl, + attrs = { + "data": attr.label_list(allow_files = True), + "env": attr.string_dict(), + "tool": attr.label( + allow_single_file = True, + executable = True, + cfg = "target", + mandatory = True, + ), + }, + executable = True, +) diff --git a/utils/nvim/carbon.lua b/utils/nvim/carbon.lua index 35269725b5e5e..ef8887108aa27 100644 --- a/utils/nvim/carbon.lua +++ b/utils/nvim/carbon.lua @@ -19,7 +19,7 @@ local util = require 'lspconfig.util' if not configs.carbon then configs.carbon = { default_config = { - cmd = { "./bazel-bin/toolchain/install/run_carbon language-server" }, + cmd = { "./bazel-bin/toolchain/carbon language-server" }, filetypes = { "carbon" }, root_dir = util.find_git_ancestor, } diff --git a/utils/vscode/package.json b/utils/vscode/package.json index 41db15032d471..fc2ef598174e0 100644 --- a/utils/vscode/package.json +++ b/utils/vscode/package.json @@ -43,7 +43,7 @@ "carbon.carbonPath": { "type": "string", "description": "The path to the 'carbon' binary.", - "default": "./bazel-bin/toolchain/install/run_carbon" + "default": "./bazel-bin/toolchain/carbon" } } } diff --git a/utils/vscode/src/extension.ts b/utils/vscode/src/extension.ts index d89c1216ae9fd..c58773b33cb7d 100644 --- a/utils/vscode/src/extension.ts +++ b/utils/vscode/src/extension.ts @@ -26,7 +26,7 @@ export function activate(context: ExtensionContext) { // fallback. command: settings.get( 'carbonPath', - context.asAbsolutePath('./bazel-bin/toolchain/install/run_carbon') + context.asAbsolutePath('./bazel-bin/toolchain/carbon') ), args: ['language-server'], }; From e85125c3d7a72473ec919948b42475eaef35f61f Mon Sep 17 00:00:00 2001 From: Jon Ross-Perkins Date: Thu, 19 Dec 2024 16:59:49 -0800 Subject: [PATCH 65/68] Extension version bump and npm update for a release of #4527 (#4722) --- utils/vscode/package-lock.json | 325 ++++++++++++++++++--------------- utils/vscode/package.json | 2 +- 2 files changed, 178 insertions(+), 149 deletions(-) diff --git a/utils/vscode/package-lock.json b/utils/vscode/package-lock.json index f584eb2f3a9fa..b9c44a4ebc68c 100644 --- a/utils/vscode/package-lock.json +++ b/utils/vscode/package-lock.json @@ -1,12 +1,12 @@ { "name": "carbon-vscode", - "version": "0.0.4", + "version": "0.0.5", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "carbon-vscode", - "version": "0.0.4", + "version": "0.0.5", "dependencies": { "vscode-languageclient": "^9.0.1" }, @@ -151,9 +151,9 @@ } }, "node_modules/@azure/msal-browser": { - "version": "3.27.0", - "resolved": "https://registry.npmjs.org/@azure/msal-browser/-/msal-browser-3.27.0.tgz", - "integrity": "sha512-+b4ZKSD8+vslCtVRVetkegEhOFMLP3rxDWJY212ct+2r6jVg6OSQKc1Qz3kCoXo0FgwaXkb+76TMZfpHp8QtgA==", + "version": "3.28.0", + "resolved": "https://registry.npmjs.org/@azure/msal-browser/-/msal-browser-3.28.0.tgz", + "integrity": "sha512-1c1qUF6vB52mWlyoMem4xR1gdwiQWYEQB2uhDkbAL4wVJr8WmAcXybc1Qs33y19N4BdPI8/DHI7rPE8L5jMtWw==", "dev": true, "dependencies": { "@azure/msal-common": "14.16.0" @@ -702,9 +702,9 @@ } }, "node_modules/@eslint/js": { - "version": "9.16.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.16.0.tgz", - "integrity": "sha512-tw2HxzQkrbeuvyj1tG2Yqq+0H9wGoI2IMk4EOsQeX+vmd75FtJAzf+gTA69WF+baUKRYQ3x2kbLE08js5OsTVg==", + "version": "9.17.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.17.0.tgz", + "integrity": "sha512-Sxc4hqcs1kTu0iID3kcZDW3JHq2a77HO9P8CP6YEA/FpH3Ll8UXE2r/86Rz9YJLKme39S9vU5OWNjC6Xl0Cr3w==", "dev": true, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -828,9 +828,9 @@ } }, "node_modules/@stylistic/eslint-plugin": { - "version": "2.12.0", - "resolved": "https://registry.npmjs.org/@stylistic/eslint-plugin/-/eslint-plugin-2.12.0.tgz", - "integrity": "sha512-IvD2WXbOoSp0zNpyYbjdSyEjZtut78RYfj2WIlbChE7HFuposTK5X1hc5+4AyqYcjLXYdD5oo/sJtqMGFNRb1w==", + "version": "2.12.1", + "resolved": "https://registry.npmjs.org/@stylistic/eslint-plugin/-/eslint-plugin-2.12.1.tgz", + "integrity": "sha512-fubZKIHSPuo07FgRTn6S4Nl0uXPRPYVNpyZzIDGfp7Fny6JjNus6kReLD7NI380JXi4HtUTSOZ34LBuNPO1XLQ==", "dev": true, "dependencies": { "@typescript-eslint/utils": "^8.13.0", @@ -859,31 +859,31 @@ "dev": true }, "node_modules/@types/node": { - "version": "20.17.9", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.17.9.tgz", - "integrity": "sha512-0JOXkRyLanfGPE2QRCwgxhzlBAvaRdCNMcvbd7jFfpmD4eEXll7LRwy5ymJmyeZqk7Nh7eD2LeUyQ68BbndmXw==", + "version": "20.17.10", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.17.10.tgz", + "integrity": "sha512-/jrvh5h6NXhEauFFexRin69nA0uHJ5gwk4iDivp/DeoEua3uwCUto6PC86IpRITBOs4+6i2I56K5x5b6WYGXHA==", "dev": true, "dependencies": { "undici-types": "~6.19.2" } }, "node_modules/@types/vscode": { - "version": "1.95.0", - "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.95.0.tgz", - "integrity": "sha512-0LBD8TEiNbet3NvWsmn59zLzOFu/txSlGxnv5yAFHCrhG9WvAnR3IvfHzMOs2aeWqgvNjq9pO99IUw8d3n+unw==", + "version": "1.96.0", + "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.96.0.tgz", + "integrity": "sha512-qvZbSZo+K4ZYmmDuaodMbAa67Pl6VDQzLKFka6rq+3WUTY4Kro7Bwoi0CuZLO/wema0ygcmpwow7zZfPJTs5jg==", "dev": true }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "8.18.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.18.0.tgz", - "integrity": "sha512-NR2yS7qUqCL7AIxdJUQf2MKKNDVNaig/dEB0GBLU7D+ZdHgK1NoH/3wsgO3OnPVipn51tG3MAwaODEGil70WEw==", + "version": "8.18.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.18.1.tgz", + "integrity": "sha512-Ncvsq5CT3Gvh+uJG0Lwlho6suwDfUXH0HztslDf5I+F2wAFAZMRwYLEorumpKLzmO2suAXZ/td1tBg4NZIi9CQ==", "dev": true, "dependencies": { "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "8.18.0", - "@typescript-eslint/type-utils": "8.18.0", - "@typescript-eslint/utils": "8.18.0", - "@typescript-eslint/visitor-keys": "8.18.0", + "@typescript-eslint/scope-manager": "8.18.1", + "@typescript-eslint/type-utils": "8.18.1", + "@typescript-eslint/utils": "8.18.1", + "@typescript-eslint/visitor-keys": "8.18.1", "graphemer": "^1.4.0", "ignore": "^5.3.1", "natural-compare": "^1.4.0", @@ -903,15 +903,15 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "8.18.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.18.0.tgz", - "integrity": "sha512-hgUZ3kTEpVzKaK3uNibExUYm6SKKOmTU2BOxBSvOYwtJEPdVQ70kZJpPjstlnhCHcuc2WGfSbpKlb/69ttyN5Q==", + "version": "8.18.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.18.1.tgz", + "integrity": "sha512-rBnTWHCdbYM2lh7hjyXqxk70wvon3p2FyaniZuey5TrcGBpfhVp0OxOa6gxr9Q9YhZFKyfbEnxc24ZnVbbUkCA==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "8.18.0", - "@typescript-eslint/types": "8.18.0", - "@typescript-eslint/typescript-estree": "8.18.0", - "@typescript-eslint/visitor-keys": "8.18.0", + "@typescript-eslint/scope-manager": "8.18.1", + "@typescript-eslint/types": "8.18.1", + "@typescript-eslint/typescript-estree": "8.18.1", + "@typescript-eslint/visitor-keys": "8.18.1", "debug": "^4.3.4" }, "engines": { @@ -927,13 +927,13 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "8.18.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.18.0.tgz", - "integrity": "sha512-PNGcHop0jkK2WVYGotk/hxj+UFLhXtGPiGtiaWgVBVP1jhMoMCHlTyJA+hEj4rszoSdLTK3fN4oOatrL0Cp+Xw==", + "version": "8.18.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.18.1.tgz", + "integrity": "sha512-HxfHo2b090M5s2+/9Z3gkBhI6xBH8OJCFjH9MhQ+nnoZqxU3wNxkLT+VWXWSFWc3UF3Z+CfPAyqdCTdoXtDPCQ==", "dev": true, "dependencies": { - "@typescript-eslint/types": "8.18.0", - "@typescript-eslint/visitor-keys": "8.18.0" + "@typescript-eslint/types": "8.18.1", + "@typescript-eslint/visitor-keys": "8.18.1" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -944,13 +944,13 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "8.18.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.18.0.tgz", - "integrity": "sha512-er224jRepVAVLnMF2Q7MZJCq5CsdH2oqjP4dT7K6ij09Kyd+R21r7UVJrF0buMVdZS5QRhDzpvzAxHxabQadow==", + "version": "8.18.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.18.1.tgz", + "integrity": "sha512-jAhTdK/Qx2NJPNOTxXpMwlOiSymtR2j283TtPqXkKBdH8OAMmhiUfP0kJjc/qSE51Xrq02Gj9NY7MwK+UxVwHQ==", "dev": true, "dependencies": { - "@typescript-eslint/typescript-estree": "8.18.0", - "@typescript-eslint/utils": "8.18.0", + "@typescript-eslint/typescript-estree": "8.18.1", + "@typescript-eslint/utils": "8.18.1", "debug": "^4.3.4", "ts-api-utils": "^1.3.0" }, @@ -967,9 +967,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "8.18.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.18.0.tgz", - "integrity": "sha512-FNYxgyTCAnFwTrzpBGq+zrnoTO4x0c1CKYY5MuUTzpScqmY5fmsh2o3+57lqdI3NZucBDCzDgdEbIaNfAjAHQA==", + "version": "8.18.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.18.1.tgz", + "integrity": "sha512-7uoAUsCj66qdNQNpH2G8MyTFlgerum8ubf21s3TSM3XmKXuIn+H2Sifh/ES2nPOPiYSRJWAk0fDkW0APBWcpfw==", "dev": true, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -980,13 +980,13 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "8.18.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.18.0.tgz", - "integrity": "sha512-rqQgFRu6yPkauz+ms3nQpohwejS8bvgbPyIDq13cgEDbkXt4LH4OkDMT0/fN1RUtzG8e8AKJyDBoocuQh8qNeg==", + "version": "8.18.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.18.1.tgz", + "integrity": "sha512-z8U21WI5txzl2XYOW7i9hJhxoKKNG1kcU4RzyNvKrdZDmbjkmLBo8bgeiOJmA06kizLI76/CCBAAGlTlEeUfyg==", "dev": true, "dependencies": { - "@typescript-eslint/types": "8.18.0", - "@typescript-eslint/visitor-keys": "8.18.0", + "@typescript-eslint/types": "8.18.1", + "@typescript-eslint/visitor-keys": "8.18.1", "debug": "^4.3.4", "fast-glob": "^3.3.2", "is-glob": "^4.0.3", @@ -1006,15 +1006,15 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "8.18.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.18.0.tgz", - "integrity": "sha512-p6GLdY383i7h5b0Qrfbix3Vc3+J2k6QWw6UMUeY5JGfm3C5LbZ4QIZzJNoNOfgyRe0uuYKjvVOsO/jD4SJO+xg==", + "version": "8.18.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.18.1.tgz", + "integrity": "sha512-8vikiIj2ebrC4WRdcAdDcmnu9Q/MXXwg+STf40BVfT8exDqBCUPdypvzcUPxEqRGKg9ALagZ0UWcYCtn+4W2iQ==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", - "@typescript-eslint/scope-manager": "8.18.0", - "@typescript-eslint/types": "8.18.0", - "@typescript-eslint/typescript-estree": "8.18.0" + "@typescript-eslint/scope-manager": "8.18.1", + "@typescript-eslint/types": "8.18.1", + "@typescript-eslint/typescript-estree": "8.18.1" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -1029,12 +1029,12 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "8.18.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.18.0.tgz", - "integrity": "sha512-pCh/qEA8Lb1wVIqNvBke8UaRjJ6wrAWkJO5yyIbs8Yx6TNGYyfNjOo61tLv+WwLvoLPp4BQ8B7AHKijl8NGUfw==", + "version": "8.18.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.18.1.tgz", + "integrity": "sha512-Vj0WLm5/ZsD013YeUKn+K0y8p1M0jPpxOkKdbD1wB0ns53a5piVY02zjf072TblEweAbcYiFiPoSMF3kp+VhhQ==", "dev": true, "dependencies": { - "@typescript-eslint/types": "8.18.0", + "@typescript-eslint/types": "8.18.1", "eslint-visitor-keys": "^4.2.0" }, "engines": { @@ -1427,35 +1427,33 @@ "integrity": "sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA==", "dev": true }, - "node_modules/call-bind": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.8.tgz", - "integrity": "sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww==", + "node_modules/call-bind-apply-helpers": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.1.tgz", + "integrity": "sha512-BhYE+WDaywFg2TBWYNXAE+8B1ATnThNBqXHP5nQu0jWJdVvY2hvkpyB3qOmtmDePiS5/BDQ8wASEWGMWRG148g==", "dev": true, "dependencies": { - "call-bind-apply-helpers": "^1.0.0", - "es-define-property": "^1.0.0", - "get-intrinsic": "^1.2.4", - "set-function-length": "^1.2.2" + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" }, "engines": { "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/call-bind-apply-helpers": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.1.tgz", - "integrity": "sha512-BhYE+WDaywFg2TBWYNXAE+8B1ATnThNBqXHP5nQu0jWJdVvY2hvkpyB3qOmtmDePiS5/BDQ8wASEWGMWRG148g==", + "node_modules/call-bound": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.3.tgz", + "integrity": "sha512-YTd+6wGlNlPxSuri7Y6X8tY2dmm12UMH66RpKMhiX6rsk5wXXnYgbUcOt8kiS31/AjfoTOvCsE+w8nZQLQnzHA==", "dev": true, "dependencies": { - "es-errors": "^1.3.0", - "function-bind": "^1.1.2" + "call-bind-apply-helpers": "^1.0.1", + "get-intrinsic": "^1.2.6" }, "engines": { "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/callsites": { @@ -1672,23 +1670,6 @@ "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", "dev": true }, - "node_modules/define-data-property": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", - "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", - "dev": true, - "dependencies": { - "es-define-property": "^1.0.0", - "es-errors": "^1.3.0", - "gopd": "^1.0.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/define-lazy-prop": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-2.0.0.tgz", @@ -1773,12 +1754,12 @@ } }, "node_modules/dunder-proto": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.0.tgz", - "integrity": "sha512-9+Sj30DIu+4KvHqMfLUGLFYL2PkURSYMVXJyXe92nFRvlYq5hBjLEhblKB+vkd/WVlUYMWigiY07T91Fkk0+4A==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", "dev": true, "dependencies": { - "call-bind-apply-helpers": "^1.0.0", + "call-bind-apply-helpers": "^1.0.1", "es-errors": "^1.3.0", "gopd": "^1.2.0" }, @@ -1848,6 +1829,18 @@ "node": ">= 0.4" } }, + "node_modules/es-object-atoms": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.0.0.tgz", + "integrity": "sha512-MZ4iQ6JwHOBQjahnjwaC1ZtIBH+2ohjamzAO3oaHcXYup7qxjF2fixyH+Q71voWHeOkI2q/TnJao/KfXYIZWbw==", + "dev": true, + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/esbuild": { "version": "0.24.0", "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.24.0.tgz", @@ -1897,9 +1890,9 @@ } }, "node_modules/eslint": { - "version": "9.16.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.16.0.tgz", - "integrity": "sha512-whp8mSQI4C8VXd+fLgSM0lh3UlmcFtVwUQjyKCFfsp+2ItAIYhlq/hqGahGqHE6cv9unM41VlqKk2VtKYR2TaA==", + "version": "9.17.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.17.0.tgz", + "integrity": "sha512-evtlNcpJg+cZLcnVKwsai8fExnqjGPicK7gnUtlNuzu+Fv9bI0aLpND5T44VLQtoMEnI57LoXO9XAkIXwohKrA==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", @@ -1907,7 +1900,7 @@ "@eslint/config-array": "^0.19.0", "@eslint/core": "^0.9.0", "@eslint/eslintrc": "^3.2.0", - "@eslint/js": "9.16.0", + "@eslint/js": "9.17.0", "@eslint/plugin-kit": "^0.2.3", "@humanfs/node": "^0.16.6", "@humanwhocodes/module-importer": "^1.0.1", @@ -1916,7 +1909,7 @@ "@types/json-schema": "^7.0.15", "ajv": "^6.12.4", "chalk": "^4.0.0", - "cross-spawn": "^7.0.5", + "cross-spawn": "^7.0.6", "debug": "^4.3.2", "escape-string-regexp": "^4.0.0", "eslint-scope": "^8.2.0", @@ -2325,19 +2318,21 @@ } }, "node_modules/get-intrinsic": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.5.tgz", - "integrity": "sha512-Y4+pKa7XeRUPWFNvOOYHkRYrfzW07oraURSvjDmRVOJ748OrVmeXtpE4+GCEHncjCjkTxPNRt8kEbxDhsn6VTg==", + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.6.tgz", + "integrity": "sha512-qxsEs+9A+u85HhllWJJFicJfPDhRmjzoYdl64aMWW9yRIJmSyxdn8IEkuIM530/7T+lv0TIHd8L6Q/ra0tEoeA==", "dev": true, "dependencies": { - "call-bind-apply-helpers": "^1.0.0", + "call-bind-apply-helpers": "^1.0.1", "dunder-proto": "^1.0.0", "es-define-property": "^1.0.1", "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", "function-bind": "^1.1.2", "gopd": "^1.2.0", "has-symbols": "^1.1.0", - "hasown": "^2.0.2" + "hasown": "^2.0.2", + "math-intrinsics": "^1.0.0" }, "engines": { "node": ">= 0.4" @@ -2447,18 +2442,6 @@ "node": ">=4" } }, - "node_modules/has-property-descriptors": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", - "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", - "dev": true, - "dependencies": { - "es-define-property": "^1.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/has-symbols": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", @@ -2946,6 +2929,15 @@ "url": "https://github.com/fb55/entities?sponsor=1" } }, + "node_modules/math-intrinsics": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", + "dev": true, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/mdurl": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-1.0.1.tgz", @@ -3547,23 +3539,6 @@ "node": ">=10" } }, - "node_modules/set-function-length": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", - "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", - "dev": true, - "dependencies": { - "define-data-property": "^1.1.4", - "es-errors": "^1.3.0", - "function-bind": "^1.1.2", - "get-intrinsic": "^1.2.4", - "gopd": "^1.0.1", - "has-property-descriptors": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - } - }, "node_modules/shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", @@ -3586,15 +3561,69 @@ } }, "node_modules/side-channel": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz", - "integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz", + "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==", + "dev": true, + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3", + "side-channel-list": "^1.0.0", + "side-channel-map": "^1.0.1", + "side-channel-weakmap": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-list": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.0.tgz", + "integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==", + "dev": true, + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-map": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz", + "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", + "dev": true, + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-weakmap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", + "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", "dev": true, "dependencies": { - "call-bind": "^1.0.7", + "call-bound": "^1.0.2", "es-errors": "^1.3.0", - "get-intrinsic": "^1.2.4", - "object-inspect": "^1.13.1" + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3", + "side-channel-map": "^1.0.1" }, "engines": { "node": ">= 0.4" @@ -3822,14 +3851,14 @@ } }, "node_modules/typescript-eslint": { - "version": "8.18.0", - "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.18.0.tgz", - "integrity": "sha512-Xq2rRjn6tzVpAyHr3+nmSg1/9k9aIHnJ2iZeOH7cfGOWqTkXTm3kwpQglEuLGdNrYvPF+2gtAs+/KF5rjVo+WQ==", + "version": "8.18.1", + "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.18.1.tgz", + "integrity": "sha512-Mlaw6yxuaDEPQvb/2Qwu3/TfgeBHy9iTJ3mTwe7OvpPmF6KPQjVOfGyEJpPv6Ez2C34OODChhXrzYw/9phI0MQ==", "dev": true, "dependencies": { - "@typescript-eslint/eslint-plugin": "8.18.0", - "@typescript-eslint/parser": "8.18.0", - "@typescript-eslint/utils": "8.18.0" + "@typescript-eslint/eslint-plugin": "8.18.1", + "@typescript-eslint/parser": "8.18.1", + "@typescript-eslint/utils": "8.18.1" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" diff --git a/utils/vscode/package.json b/utils/vscode/package.json index fc2ef598174e0..0865f2a451720 100644 --- a/utils/vscode/package.json +++ b/utils/vscode/package.json @@ -1,7 +1,7 @@ { "name": "carbon-vscode", "displayName": "Carbon Language", - "version": "0.0.4", + "version": "0.0.5", "publisher": "carbon-lang", "description": "Carbon language support for Visual Studio Code.", "repository": { From 3ae968a74c4cbe05e132e94d3a7b77bb783e8082 Mon Sep 17 00:00:00 2001 From: Chandler Carruth Date: Thu, 19 Dec 2024 20:40:58 -0800 Subject: [PATCH 66/68] Teach the SIMD metadata group match to defer masking (#4595) When using a byte-encoding for matched group metadata we need to mask down to a single bit in each matching byte to make the iteration of a range of match indices work. In most cases, this mask can be folded into the overall match computation, but for Arm Neon, there is avoidable overhead from this. Instead, we can defer the mask until starting to iterate. Doing more than one iteration is relative rare so this doesn't accumulate much waste and makes common paths a bit faster. For the M1 this makes the SIMD match path about 2-4% faster. This isn't enough to catch the portable match code path on the M1 though. For some Neoverse cores the difference here is more significant (>10% improvement) and it makes the SIMD and scalar code paths have comparable latency. Still not clear which is better as the latency is comparable and beyond latency the factors are very hard to analyze -- port pressure on different parts of the CPU, etc. Leaving the selected code path as portable since that's so much better on the M1, and I'm hoping to avoid different code paths for different Arm CPUs for a while. --------- Co-authored-by: Danila Kutenin --- common/raw_hashtable_metadata_group.h | 169 ++++++++++++------ ...raw_hashtable_metadata_group_benchmark.cpp | 12 +- 2 files changed, 123 insertions(+), 58 deletions(-) diff --git a/common/raw_hashtable_metadata_group.h b/common/raw_hashtable_metadata_group.h index e15d7aeb41768..c5394140b0433 100644 --- a/common/raw_hashtable_metadata_group.h +++ b/common/raw_hashtable_metadata_group.h @@ -8,6 +8,7 @@ #include #include #include +#include #include "common/check.h" #include "common/ostream.h" @@ -55,11 +56,12 @@ constexpr ssize_t MaxGroupSize = 16; // // Some bits of the underlying value may be known-zero, which can optimize // various operations. These can be represented as a `ZeroMask`. -template +template class BitIndex - : public Printable> { + : public Printable> { public: using BitsT = BitsInputT; + static constexpr bool ByteEncoding = ByteEncodingInput; BitIndex() = default; explicit BitIndex(BitsT bits) : bits_(bits) {} @@ -175,10 +177,13 @@ class BitIndex // with byte-encoded bit indices, exactly the high bit and no other bit of each // matching byte must be set. This is a stricter constraint than what `BitIndex` // alone would impose on any one of the matches. -template -class BitIndexRange : public Printable> { +template +class BitIndexRange + : public Printable> { public: using BitsT = BitIndexT::BitsT; + static_assert(BitIndexT::ByteEncoding || ByteEncodingMask == 0, + "Non-byte encoding must not have a byte encoding mask."); class Iterator : public llvm::iterator_facade_base> { auto operator++() -> Iterator& { CARBON_DCHECK(bits_ != 0, "Must not increment past the end!"); __builtin_assume(bits_ != 0); + + if constexpr (ByteEncodingMask != 0) { + // Apply an increment mask to the bits first. This is used with the byte + // encoding when the mask isn't needed until we begin incrementing. + bits_ &= ByteEncodingMask; + } + // Clears the least significant set bit, effectively stepping to the next // match. bits_ &= (bits_ - 1); @@ -229,7 +241,28 @@ class BitIndexRange : public Printable> { auto end() const -> Iterator { return Iterator(); } friend auto operator==(BitIndexRange lhs, BitIndexRange rhs) -> bool { - return lhs.bits_ == rhs.bits_; + if constexpr (ByteEncodingMask == 0) { + // If there is no encoding mask, we can just compare the bits directly. + return lhs.bits_ == rhs.bits_; + } else { + // Otherwise, compare the initial bit indices and the masked bits. + return BitIndexT(lhs.bits_) == BitIndexT(rhs.bits_) && + (lhs.bits_ & ByteEncodingMask) == (rhs.bits_ & ByteEncodingMask); + } + } + + // Define heterogeneous equality between a masked (the current type) and + // unmasked range. Requires a non-zero mask to avoid a redundant definition + // with the homogeneous equality. + friend auto operator==(BitIndexRange lhs, BitIndexRange rhs) + -> bool + requires(ByteEncodingMask != 0) + { + // For mixed masked / unmasked comparison, we make sure the initial indices + // are the same and that the masked side (LHS) is the same after masking as + // the unmasked side (RHS). + return BitIndexT(lhs.bits_) == BitIndexT(rhs.bits_) && + (lhs.bits_ & ByteEncodingMask) == rhs.bits_; } auto Print(llvm::raw_ostream& out) const -> void { @@ -240,6 +273,10 @@ class BitIndexRange : public Printable> { explicit operator BitIndexT() const { return BitIndexT(bits_); } private: + template + friend class BitIndexRange; + BitsT bits_ = 0; }; @@ -304,6 +341,16 @@ class MetadataGroup : public Printable { static constexpr uint8_t PresentMask = 0b1000'0000; + // Whether to use a SIMD implementation. Even when we *support* a SIMD + // implementation, we do not always have to use it in the event that it is + // less efficient than the portable version. + static constexpr bool UseSIMD = +#if CARBON_X86_SIMD_SUPPORT + true; +#else + false; +#endif + // Some architectures make it much more efficient to build the match indices // in a byte-encoded form rather than a bit-encoded form. This encoding // changes verification and other aspects of our algorithms. @@ -327,11 +374,31 @@ class MetadataGroup : public Printable { // the larger metadata array. static constexpr bool FastByteClear = Size == 8; + // Most and least significant bits set. + static constexpr uint64_t MSBs = 0x8080'8080'8080'8080ULL; + static constexpr uint64_t LSBs = 0x0101'0101'0101'0101ULL; + using MatchIndex = BitIndex, ByteEncoding, /*ZeroMask=*/ByteEncoding ? 0 : (~0U << Size)>; - using MatchRange = BitIndexRange; + + // Only one kind of portable matched range is needed. + using PortableMatchRange = BitIndexRange; + + // We use specialized match range types for SIMD implementations to allow + // deferring the masking operation where useful. When that optimization + // doesn't apply, these will be the same type. + using SIMDMatchRange = + BitIndexRange; + using SIMDMatchPresentRange = BitIndexRange; + + // The public API range types can be either the portable or SIMD variations, + // selected here. + using MatchRange = + std::conditional_t; + using MatchPresentRange = + std::conditional_t; union { uint8_t metadata_bytes[Size]; @@ -390,7 +457,7 @@ class MetadataGroup : public Printable { // Find all of the present bytes of metadata in this group. A range over all // of the byte indices which are present is returned. - auto MatchPresent() const -> MatchRange; + auto MatchPresent() const -> MatchPresentRange; // Find the first byte of the metadata group that is empty and return that // index. There is no order or position required for which of the bytes of @@ -412,16 +479,6 @@ class MetadataGroup : public Printable { friend class BenchmarkPortableMetadataGroup; friend class BenchmarkSIMDMetadataGroup; - // Whether to use a SIMD implementation. Even when we *support* a SIMD - // implementation, we do not always have to use it in the event that it is - // less efficient than the portable version. - static constexpr bool UseSIMD = -#if CARBON_X86_SIMD_SUPPORT - true; -#else - false; -#endif - // All SIMD variants that we have an implementation for should be enabled for // debugging. This lets us maintain a SIMD implementation even if it is not // used due to performance reasons, and easily re-enable it if the performance @@ -433,12 +490,19 @@ class MetadataGroup : public Printable { false; #endif - // Most and least significant bits set. - static constexpr uint64_t MSBs = 0x8080'8080'8080'8080ULL; - static constexpr uint64_t LSBs = 0x0101'0101'0101'0101ULL; - using MatchBitsT = MatchIndex::BitsT; + // A helper function to allow deducing the return type from the selected arm + // of a `constexpr` ternary. + template + static auto ConstexprTernary(LeftT lhs, RightT rhs) { + if constexpr (Condition) { + return lhs; + } else { + return rhs; + } + } + static auto CompareEqual(MetadataGroup lhs, MetadataGroup rhs) -> bool; // Functions for validating the returned matches agree with what is predicted @@ -451,9 +515,9 @@ class MetadataGroup : public Printable { auto VerifyIndexBits( MatchBitsT index_bits, llvm::function_refbool> byte_match) const -> bool; - // `VerifyRangeBits` is for functions that return `MatchRange`, and so it - // validates all the bytes of `range_bits`. - auto VerifyRangeBits( + // `VerifyPortableRangeBits` is for functions that return `MatchRange`, and so + // it validates all the bytes of `range_bits`. + auto VerifyPortableRangeBits( MatchBitsT range_bits, llvm::function_refbool> byte_match) const -> bool; @@ -472,8 +536,8 @@ class MetadataGroup : public Printable { auto PortableClearDeleted() -> void; - auto PortableMatch(uint8_t tag) const -> MatchRange; - auto PortableMatchPresent() const -> MatchRange; + auto PortableMatch(uint8_t tag) const -> PortableMatchRange; + auto PortableMatchPresent() const -> PortableMatchRange; auto PortableMatchEmpty() const -> MatchIndex; auto PortableMatchDeleted() const -> MatchIndex; @@ -494,8 +558,8 @@ class MetadataGroup : public Printable { auto SIMDClearDeleted() -> void; - auto SIMDMatch(uint8_t tag) const -> MatchRange; - auto SIMDMatchPresent() const -> MatchRange; + auto SIMDMatch(uint8_t tag) const -> SIMDMatchRange; + auto SIMDMatchPresent() const -> SIMDMatchPresentRange; auto SIMDMatchEmpty() const -> MatchIndex; auto SIMDMatchDeleted() const -> MatchIndex; @@ -505,7 +569,7 @@ class MetadataGroup : public Printable { #if CARBON_X86_SIMD_SUPPORT // A common routine for x86 SIMD matching that can be used for matching // present, empty, and deleted bytes with equal efficiency. - auto X86SIMDMatch(uint8_t match_byte) const -> MatchRange; + auto X86SIMDMatch(uint8_t match_byte) const -> SIMDMatchRange; #endif }; @@ -570,8 +634,8 @@ inline auto MetadataGroup::Match(uint8_t tag) const -> MatchRange { // a present byte. CARBON_DCHECK((tag & PresentMask) == 0, "{0:x}", tag); - MatchRange portable_result; - MatchRange simd_result; + PortableMatchRange portable_result; + SIMDMatchRange simd_result; if constexpr (!UseSIMD || DebugSIMD) { portable_result = PortableMatch(tag); } @@ -581,12 +645,13 @@ inline auto MetadataGroup::Match(uint8_t tag) const -> MatchRange { "SIMD result '{0}' doesn't match portable result '{1}'", simd_result, portable_result); } - return UseSIMD ? simd_result : portable_result; + // Return whichever result we're using. + return ConstexprTernary(simd_result, portable_result); } -inline auto MetadataGroup::MatchPresent() const -> MatchRange { - MatchRange portable_result; - MatchRange simd_result; +inline auto MetadataGroup::MatchPresent() const -> MatchPresentRange { + PortableMatchRange portable_result; + SIMDMatchPresentRange simd_result; if constexpr (!UseSIMD || DebugSIMD) { portable_result = PortableMatchPresent(); } @@ -596,7 +661,8 @@ inline auto MetadataGroup::MatchPresent() const -> MatchRange { "SIMD result '{0}' doesn't match portable result '{1}'", simd_result, portable_result); } - return UseSIMD ? simd_result : portable_result; + // Return whichever result we're using. + return ConstexprTernary(simd_result, portable_result); } inline auto MetadataGroup::MatchEmpty() const -> MatchIndex { @@ -679,7 +745,7 @@ inline auto MetadataGroup::VerifyIndexBits( return true; } -inline auto MetadataGroup::VerifyRangeBits( +inline auto MetadataGroup::VerifyPortableRangeBits( MatchBitsT range_bits, llvm::function_refbool> byte_match) const -> bool { for (ssize_t byte_index : llvm::seq(0, Size)) { @@ -814,7 +880,7 @@ inline auto MetadataGroup::PortableMatch(uint8_t tag) const -> MatchRange { // At this point, `match_bits` has the high bit set for bytes where the // original group byte equals `tag` plus the high bit. - CARBON_DCHECK(VerifyRangeBits( + CARBON_DCHECK(VerifyPortableRangeBits( match_bits, [&](uint8_t byte) { return byte == (tag | PresentMask); })); return MatchRange(match_bits); } @@ -841,7 +907,7 @@ inline auto MetadataGroup::PortableMatchPresent() const -> MatchRange { // represents a present slot. uint64_t match_bits = metadata_ints[0] & MSBs; - CARBON_DCHECK(VerifyRangeBits( + CARBON_DCHECK(VerifyPortableRangeBits( match_bits, [&](uint8_t byte) { return (byte & PresentMask) != 0; })); return MatchRange(match_bits); } @@ -966,8 +1032,8 @@ inline auto MetadataGroup::SIMDClearDeleted() -> void { #endif } -inline auto MetadataGroup::SIMDMatch(uint8_t tag) const -> MatchRange { - MatchRange result; +inline auto MetadataGroup::SIMDMatch(uint8_t tag) const -> SIMDMatchRange { + SIMDMatchRange result; #if CARBON_NEON_SIMD_SUPPORT // Broadcast byte we want to match to every byte in the vector. auto match_byte_vec = vdup_n_u8(tag | PresentMask); @@ -975,11 +1041,8 @@ inline auto MetadataGroup::SIMDMatch(uint8_t tag) const -> MatchRange { // clear everything but MSBs next. auto match_byte_cmp_vec = vceq_u8(metadata_vec, match_byte_vec); uint64_t match_bits = vreinterpret_u64_u8(match_byte_cmp_vec)[0]; - // The matched range is likely to be tested for zero by the caller, and that - // test can often be folded into masking the bits with `MSBs` when we do that - // mask in the scalar domain rather than the SIMD domain. So we do the mask - // here rather than above prior to extracting the match bits. - result = MatchRange(match_bits & MSBs); + // Note that the range will lazily mask to the MSBs as part of incrementing. + result = SIMDMatchRange(match_bits); #elif CARBON_X86_SIMD_SUPPORT result = X86SIMDMatch(tag | PresentMask); #else @@ -989,20 +1052,18 @@ inline auto MetadataGroup::SIMDMatch(uint8_t tag) const -> MatchRange { return result; } -inline auto MetadataGroup::SIMDMatchPresent() const -> MatchRange { - MatchRange result; +inline auto MetadataGroup::SIMDMatchPresent() const -> SIMDMatchPresentRange { + SIMDMatchPresentRange result; #if CARBON_NEON_SIMD_SUPPORT // Just extract the metadata directly. uint64_t match_bits = vreinterpret_u64_u8(metadata_vec)[0]; - // The matched range is likely to be tested for zero by the caller, and that - // test can often be folded into masking the bits with `MSBs` when we do that - // mask in the scalar domain rather than the SIMD domain. So we do the mask - // here rather than above prior to extracting the match bits. - result = MatchRange(match_bits & MSBs); + // Even though the Neon SIMD range will do its own masking, we have to mask + // here so that `empty` is correct. + result = SIMDMatchPresentRange(match_bits & MSBs); #elif CARBON_X86_SIMD_SUPPORT // We arranged the byte vector so that present bytes have the high bit set, // which this instruction extracts. - result = MatchRange(_mm_movemask_epi8(metadata_vec)); + result = SIMDMatchPresentRange(_mm_movemask_epi8(metadata_vec)); #else static_assert(!UseSIMD && !DebugSIMD, "Unimplemented SIMD operation"); #endif diff --git a/common/raw_hashtable_metadata_group_benchmark.cpp b/common/raw_hashtable_metadata_group_benchmark.cpp index c51a6eb359c41..cb0522052941b 100644 --- a/common/raw_hashtable_metadata_group_benchmark.cpp +++ b/common/raw_hashtable_metadata_group_benchmark.cpp @@ -29,10 +29,12 @@ class BenchmarkPortableMetadataGroup : public MetadataGroup { auto ClearDeleted() -> void { PortableClearDeleted(); } - auto Match(uint8_t present_byte) const -> MatchRange { + auto Match(uint8_t present_byte) const -> PortableMatchRange { return PortableMatch(present_byte); } - auto MatchPresent() const -> MatchRange { return PortableMatchPresent(); } + auto MatchPresent() const -> PortableMatchRange { + return PortableMatchPresent(); + } auto MatchEmpty() const -> MatchIndex { return PortableMatchEmpty(); } auto MatchDeleted() const -> MatchIndex { return PortableMatchDeleted(); } @@ -53,10 +55,12 @@ class BenchmarkSIMDMetadataGroup : public MetadataGroup { auto ClearDeleted() -> void { SIMDClearDeleted(); } - auto Match(uint8_t present_byte) const -> MatchRange { + auto Match(uint8_t present_byte) const -> SIMDMatchRange { return SIMDMatch(present_byte); } - auto MatchPresent() const -> MatchRange { return SIMDMatchPresent(); } + auto MatchPresent() const -> SIMDMatchPresentRange { + return SIMDMatchPresent(); + } auto MatchEmpty() const -> MatchIndex { return SIMDMatchEmpty(); } auto MatchDeleted() const -> MatchIndex { return SIMDMatchDeleted(); } From c130fe8d51489e3c4f596f18210cc1f4a5431e96 Mon Sep 17 00:00:00 2001 From: josh11b <15258583+josh11b@users.noreply.github.com> Date: Thu, 19 Dec 2024 23:16:35 -0800 Subject: [PATCH 67/68] Fix VSCode language extension configuration instructions (#4725) The instructions did not match the example. The VSCode settings suggests the example is the correct one. Co-authored-by: Josh L --- utils/vscode/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/vscode/README.md b/utils/vscode/README.md index cbf6dec1df665..2b39a2602c4fe 100644 --- a/utils/vscode/README.md +++ b/utils/vscode/README.md @@ -24,8 +24,8 @@ This extension is currently experimental, and being developed alongside Carbon. ## Configuration -The configuration is under `carbon-vscode.*`. At present, the only configuration -is the path to the `carbon` binary. This looks like: +The configuration is under `carbon.*`. At present, the only configuration is the +path to the `carbon` binary. This looks like: ``` "carbon.carbonPath": "/path/to/carbon" From aca862ceffa68c39840c6da6b91d9a9acc044a4a Mon Sep 17 00:00:00 2001 From: Chandler Carruth Date: Thu, 19 Dec 2024 23:18:59 -0800 Subject: [PATCH 68/68] Fix a clang-tidy issue (#4723) --- toolchain/check/context.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolchain/check/context.cpp b/toolchain/check/context.cpp index a0d7d9bd744e1..193cb52e999f7 100644 --- a/toolchain/check/context.cpp +++ b/toolchain/check/context.cpp @@ -879,7 +879,7 @@ auto Context::InsertHere(SemIR::ExprRegionId region_id) -> SemIR::InstId { if (region.block_ids.size() == 1) { // TODO: Is it possible to avoid leaving an "orphan" block in the IR in the // first two cases? - if (exit_block.size() == 0) { + if (exit_block.empty()) { return region.result_id; } if (exit_block.size() == 1) {